diff --git a/app.py b/app.py index 7e9689e2..edc8b139 100644 --- a/app.py +++ b/app.py @@ -649,8 +649,8 @@ try: pdf_file = tmp_file.with_suffix('.pdf') print(f"PDF file generated: {pdf_file}") - except subprocess.CalledProcessError as e: - self.error(f"Error occurred while compiling LaTeX: {e}") + except subprocess.CalledProcessError as ex: + self.error(f"Error occurred while compiling LaTeX: {ex}") error_json = {"output": "
"+str(ex)+"\n"+get_trace_exception(ex)+"
", "execution_time": execution_time} return json.dumps(error_json) diff --git a/endpoints/lollms_advanced.py b/endpoints/lollms_advanced.py new file mode 100644 index 00000000..a3d10e3b --- /dev/null +++ b/endpoints/lollms_advanced.py @@ -0,0 +1,62 @@ +""" +project: lollms_user +file: lollms_user.py +author: ParisNeo +description: + This module contains a set of FastAPI routes that provide information about the Lord of Large Language and Multimodal Systems (LoLLMs) Web UI + application. These routes allow users to do advanced stuff like executing code. + +""" +from fastapi import APIRouter, Request +from lollms_webui import LOLLMSWebUI +from pydantic import BaseModel +from starlette.responses import StreamingResponse +from lollms.types import MSG_TYPE +from lollms.main_config import BaseConfig +from lollms.utilities import detect_antiprompt, remove_text_from_string, trace_exception +from ascii_colors import ASCIIColors +from api.db import DiscussionsDB +from pathlib import Path +from safe_store.text_vectorizer import TextVectorizer, VectorizationMethod, VisualizationMethod +import tqdm +from fastapi import FastAPI, UploadFile, File +import shutil + +from utilities.execution_engines.python_execution_engine import execute_python +from utilities.execution_engines.latex_execution_engine import execute_latex +from utilities.execution_engines.shell_execution_engine import execute_bash + +router = APIRouter() +lollmsElfServer:LOLLMSWebUI = LOLLMSWebUI.get_instance() + +@router.post("/execute_code") +async def execute_code(request: Request): + """ + Executes Python code and returns the output. + + :param request: The HTTP request object. + :return: A JSON response with the status of the operation. + """ + + try: + data = (await request.json()) + code = data["code"] + discussion_id = data.get("discussion_id","unknown_discussion") + message_id = data.get("message_id","unknown_message") + language = data.get("language","python") + + + ASCIIColors.info("Executing python code:") + ASCIIColors.yellow(code) + + if language=="python": + return execute_python(code, discussion_id, message_id) + elif language=="latex": + return execute_latex(code, discussion_id, message_id) + elif language in ["bash","shell","cmd","powershell"]: + return execute_bash(code, discussion_id, message_id) + return {"output": "Unsupported language", "execution_time": 0} + except Exception as ex: + trace_exception(ex) + lollmsElfServer.error(ex) + return {"status":False,"error":str(ex)} \ No newline at end of file diff --git a/lollms_core b/lollms_core index fb402a5d..c7ebbb12 160000 --- a/lollms_core +++ b/lollms_core @@ -1 +1 @@ -Subproject commit fb402a5d3d043efbecd7199ea45927d6ad37af6c +Subproject commit c7ebbb1228a1bc48da1d953629569d60c185a011 diff --git a/new_app.py b/new_app.py index 64cb458a..daccf1e4 100644 --- a/new_app.py +++ b/new_app.py @@ -74,6 +74,7 @@ if __name__ == "__main__": from endpoints.lollms_discussion import router as lollms_discussion_router from endpoints.lollms_message import router as lollms_message_router from endpoints.lollms_user import router as lollms_user_router + from endpoints.lollms_advanced import router as lollms_advanced_router @@ -89,12 +90,14 @@ if __name__ == "__main__": app.include_router(lollms_personalities_infos_router) app.include_router(lollms_extensions_infos_router) + app.include_router(lollms_webui_infos_router) app.include_router(lollms_generator_router) app.include_router(lollms_discussion_router) app.include_router(lollms_message_router) app.include_router(lollms_user_router) + app.include_router(lollms_advanced_router) app.include_router(lollms_configuration_infos_router) @@ -109,6 +112,8 @@ if __name__ == "__main__": app.mount("/", StaticFiles(directory=Path(__file__).parent/"web"/"dist", html=True), name="static") app = ASGIApp(socketio_server=sio, other_asgi_app=app) + lollmsElfServer.app = app + # if autoshow if config.auto_show_browser: diff --git a/utilities/execution_engines/latex_execution_engine.py b/utilities/execution_engines/latex_execution_engine.py new file mode 100644 index 00000000..ae35ce89 --- /dev/null +++ b/utilities/execution_engines/latex_execution_engine.py @@ -0,0 +1,75 @@ +""" +project: lollms_webui +file: latex_execution_engine.py +author: ParisNeo +description: + This is a utility for executing latex code + +""" +from fastapi import APIRouter, Request, routing +from lollms_webui import LOLLMSWebUI +from pydantic import BaseModel +from starlette.responses import StreamingResponse +from lollms.types import MSG_TYPE +from lollms.main_config import BaseConfig +from lollms.utilities import detect_antiprompt, remove_text_from_string, trace_exception, get_trace_exception +from ascii_colors import ASCIIColors +from api.db import DiscussionsDB +from pathlib import Path +from safe_store.text_vectorizer import TextVectorizer, VectorizationMethod, VisualizationMethod +import tqdm +from fastapi import FastAPI, UploadFile, File +import shutil +import time +import subprocess +import json + +lollmsElfServer:LOLLMSWebUI = LOLLMSWebUI.get_instance() + +def execute_latex(lollmsElfServer:LOLLMSWebUI, code, discussion_id, message_id): + def spawn_process(code): + """Executes Python code and returns the output as JSON.""" + + # Start the timer. + start_time = time.time() + + # Create a temporary file. + root_folder = lollmsElfServer.lollms_paths.personal_outputs_path/"discussions"/f"d_{discussion_id}" + root_folder.mkdir(parents=True,exist_ok=True) + tmp_file = root_folder/f"latex_file_{message_id}.tex" + with open(tmp_file,"w",encoding="utf8") as f: + f.write(code) + try: + # Determine the pdflatex command based on the provided or default path + if lollmsElfServer.config.pdf_latex_path: + pdflatex_command = lollmsElfServer.config.pdf_latex_path + else: + pdflatex_command = 'pdflatex' + # Set the execution path to the folder containing the tmp_file + execution_path = tmp_file.parent + # Run the pdflatex command with the file path + result = subprocess.run([pdflatex_command, "-interaction=nonstopmode", tmp_file], check=True, capture_output=True, text=True, cwd=execution_path) + # Check the return code of the pdflatex command + if result.returncode != 0: + error_message = result.stderr.strip() + execution_time = time.time() - start_time + error_json = {"output": f"Error occurred while compiling LaTeX: {error_message}", "execution_time": execution_time} + return json.dumps(error_json) + # If the compilation is successful, you will get a PDF file + pdf_file = tmp_file.with_suffix('.pdf') + print(f"PDF file generated: {pdf_file}") + + except subprocess.CalledProcessError as ex: + lollmsElfServer.error(f"Error occurred while compiling LaTeX: {ex}") + error_json = {"output": "
"+str(ex)+"\n"+get_trace_exception(ex)+"
", "execution_time": execution_time} + return json.dumps(error_json) + + # Stop the timer. + execution_time = time.time() - start_time + + # The child process was successful. + pdf_file=str(pdf_file) + url = f"{routing.get_url_path_for(lollmsElfServer.app.router, 'main')[:-4]}{pdf_file[pdf_file.index('outputs'):]}" + output_json = {"output": f"Pdf file generated at: {pdf_file}\nClick here to show", "execution_time": execution_time} + return json.dumps(output_json) + return spawn_process(code) diff --git a/utilities/execution_engines/python_execution_engine.py b/utilities/execution_engines/python_execution_engine.py new file mode 100644 index 00000000..8a9fa816 --- /dev/null +++ b/utilities/execution_engines/python_execution_engine.py @@ -0,0 +1,165 @@ +""" +project: lollms_webui +file: python_execution_engine.py +author: ParisNeo +description: + This is a utility for executing python code + +""" +from fastapi import APIRouter, Request, routing +from lollms_webui import LOLLMSWebUI +from pydantic import BaseModel +from starlette.responses import StreamingResponse +from lollms.types import MSG_TYPE +from lollms.main_config import BaseConfig +from lollms.utilities import detect_antiprompt, remove_text_from_string, trace_exception, get_trace_exception +from ascii_colors import ASCIIColors +from api.db import DiscussionsDB +from pathlib import Path +from safe_store.text_vectorizer import TextVectorizer, VectorizationMethod, VisualizationMethod +import tqdm +from fastapi import FastAPI, UploadFile, File +import shutil +import time +import subprocess +import json + +lollmsElfServer:LOLLMSWebUI = LOLLMSWebUI.get_instance() + +def execute_python(code, discussion_id, message_id): + def spawn_process(code): + """Executes Python code and returns the output as JSON.""" + + # Start the timer. + start_time = time.time() + + # Create a temporary file. + root_folder = lollmsElfServer.lollms_paths.personal_outputs_path/"discussions"/f"d_{discussion_id}" + root_folder.mkdir(parents=True,exist_ok=True) + tmp_file = root_folder/f"ai_code_{message_id}.py" + with open(tmp_file,"w",encoding="utf8") as f: + f.write(code) + + try: + # Execute the Python code in a temporary file. + process = subprocess.Popen( + ["python", str(tmp_file)], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + cwd=root_folder + ) + + # Get the output and error from the process. + output, error = process.communicate() + except Exception as ex: + # Stop the timer. + execution_time = time.time() - start_time + error_message = f"Error executing Python code: {ex}" + error_json = {"output": "
"+ex+"\n"+get_trace_exception(ex)+"
", "execution_time": execution_time} + return json.dumps(error_json) + + # Stop the timer. + execution_time = time.time() - start_time + + # Check if the process was successful. + if process.returncode != 0: + # The child process threw an exception. + error_message = f"Error executing Python code: {error.decode('utf8')}" + error_json = {"output": "
"+error_message+"
", "execution_time": execution_time} + return json.dumps(error_json) + + # The child process was successful. + output_json = {"output": output.decode("utf8"), "execution_time": execution_time} + return json.dumps(output_json) + return spawn_process(code) + +def execute_latex(lollmsElfServer:LOLLMSWebUI, code, discussion_id, message_id): + def spawn_process(code): + """Executes Python code and returns the output as JSON.""" + + # Start the timer. + start_time = time.time() + + # Create a temporary file. + root_folder = lollmsElfServer.lollms_paths.personal_outputs_path/"discussions"/f"d_{discussion_id}" + root_folder.mkdir(parents=True,exist_ok=True) + tmp_file = root_folder/f"latex_file_{message_id}.tex" + with open(tmp_file,"w",encoding="utf8") as f: + f.write(code) + try: + # Determine the pdflatex command based on the provided or default path + if lollmsElfServer.config.pdf_latex_path: + pdflatex_command = lollmsElfServer.config.pdf_latex_path + else: + pdflatex_command = 'pdflatex' + # Set the execution path to the folder containing the tmp_file + execution_path = tmp_file.parent + # Run the pdflatex command with the file path + result = subprocess.run([pdflatex_command, "-interaction=nonstopmode", tmp_file], check=True, capture_output=True, text=True, cwd=execution_path) + # Check the return code of the pdflatex command + if result.returncode != 0: + error_message = result.stderr.strip() + execution_time = time.time() - start_time + error_json = {"output": f"Error occurred while compiling LaTeX: {error_message}", "execution_time": execution_time} + return json.dumps(error_json) + # If the compilation is successful, you will get a PDF file + pdf_file = tmp_file.with_suffix('.pdf') + print(f"PDF file generated: {pdf_file}") + + except subprocess.CalledProcessError as ex: + lollmsElfServer.error(f"Error occurred while compiling LaTeX: {ex}") + error_json = {"output": "
"+str(ex)+"\n"+get_trace_exception(ex)+"
", "execution_time": execution_time} + return json.dumps(error_json) + + # Stop the timer. + execution_time = time.time() - start_time + + # The child process was successful. + pdf_file=str(pdf_file) + url = f"{routing.get_url_path_for(lollmsElfServer.app.router, 'main')[:-4]}{pdf_file[pdf_file.index('outputs'):]}" + output_json = {"output": f"Pdf file generated at: {pdf_file}\nClick here to show", "execution_time": execution_time} + return json.dumps(output_json) + return spawn_process(code) + +def execute_bash(lollmsElfServer, code, discussion_id, message_id): + def spawn_process(code): + """Executes Python code and returns the output as JSON.""" + + # Start the timer. + start_time = time.time() + + # Create a temporary file. + root_folder = lollmsElfServer.lollms_paths.personal_outputs_path/"discussions"/f"d_{discussion_id}" + root_folder.mkdir(parents=True,exist_ok=True) + try: + # Execute the Python code in a temporary file. + process = subprocess.Popen( + code, + shell=True, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + ) + + # Get the output and error from the process. + output, error = process.communicate() + except Exception as ex: + # Stop the timer. + execution_time = time.time() - start_time + error_message = f"Error executing Python code: {ex}" + error_json = {"output": "
"+str(ex)+"\n"+get_trace_exception(ex)+"
", "execution_time": execution_time} + return json.dumps(error_json) + + # Stop the timer. + execution_time = time.time() - start_time + + # Check if the process was successful. + if process.returncode != 0: + # The child process threw an exception. + error_message = f"Error executing Python code: {error.decode('utf8')}" + error_json = {"output": "
"+error_message+"
", "execution_time": execution_time} + return json.dumps(error_json) + + # The child process was successful. + output_json = {"output": output.decode("utf8"), "execution_time": execution_time} + return json.dumps(output_json) + return spawn_process(code) \ No newline at end of file diff --git a/utilities/execution_engines/shell_execution_engine.py b/utilities/execution_engines/shell_execution_engine.py new file mode 100644 index 00000000..9bb80098 --- /dev/null +++ b/utilities/execution_engines/shell_execution_engine.py @@ -0,0 +1,69 @@ +""" +project: lollms_webui +file: shell_execution_engine.py +author: ParisNeo +description: + This is a utility for executing python code + +""" +from fastapi import APIRouter, Request, routing +from lollms_webui import LOLLMSWebUI +from pydantic import BaseModel +from starlette.responses import StreamingResponse +from lollms.types import MSG_TYPE +from lollms.main_config import BaseConfig +from lollms.utilities import detect_antiprompt, remove_text_from_string, trace_exception, get_trace_exception +from ascii_colors import ASCIIColors +from api.db import DiscussionsDB +from pathlib import Path +from safe_store.text_vectorizer import TextVectorizer, VectorizationMethod, VisualizationMethod +import tqdm +from fastapi import FastAPI, UploadFile, File +import shutil +import time +import subprocess +import json + +lollmsElfServer:LOLLMSWebUI = LOLLMSWebUI.get_instance() +def execute_bash(lollmsElfServer, code, discussion_id, message_id): + def spawn_process(code): + """Executes Python code and returns the output as JSON.""" + + # Start the timer. + start_time = time.time() + + # Create a temporary file. + root_folder = lollmsElfServer.lollms_paths.personal_outputs_path/"discussions"/f"d_{discussion_id}" + root_folder.mkdir(parents=True,exist_ok=True) + try: + # Execute the Python code in a temporary file. + process = subprocess.Popen( + code, + shell=True, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + ) + + # Get the output and error from the process. + output, error = process.communicate() + except Exception as ex: + # Stop the timer. + execution_time = time.time() - start_time + error_message = f"Error executing Python code: {ex}" + error_json = {"output": "
"+str(ex)+"\n"+get_trace_exception(ex)+"
", "execution_time": execution_time} + return json.dumps(error_json) + + # Stop the timer. + execution_time = time.time() - start_time + + # Check if the process was successful. + if process.returncode != 0: + # The child process threw an exception. + error_message = f"Error executing Python code: {error.decode('utf8')}" + error_json = {"output": "
"+error_message+"
", "execution_time": execution_time} + return json.dumps(error_json) + + # The child process was successful. + output_json = {"output": output.decode("utf8"), "execution_time": execution_time} + return json.dumps(output_json) + return spawn_process(code) \ No newline at end of file diff --git a/web/dist/assets/index-d5a593e6.css b/web/dist/assets/index-299ef7d5.css similarity index 99% rename from web/dist/assets/index-d5a593e6.css rename to web/dist/assets/index-299ef7d5.css index 5299ad68..0f5c1a0d 100644 --- a/web/dist/assets/index-d5a593e6.css +++ b/web/dist/assets/index-299ef7d5.css @@ -5,4 +5,4 @@ Author: (c) Henri Vandersleyen License: see project LICENSE Touched: 2022 -*/.hljs-meta,.hljs-comment{color:#565f89}.hljs-tag,.hljs-doctag,.hljs-selector-id,.hljs-selector-class,.hljs-regexp,.hljs-template-tag,.hljs-selector-pseudo,.hljs-selector-attr,.hljs-variable.language_,.hljs-deletion{color:#f7768e}.hljs-variable,.hljs-template-variable,.hljs-number,.hljs-literal,.hljs-type,.hljs-params,.hljs-link{color:#ff9e64}.hljs-built_in,.hljs-attribute{color:#e0af68}.hljs-selector-tag{color:#2ac3de}.hljs-keyword,.hljs-title.function_,.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-subst,.hljs-property{color:#7dcfff}.hljs-selector-tag{color:#73daca}.hljs-quote,.hljs-string,.hljs-symbol,.hljs-bullet,.hljs-addition{color:#9ece6a}.hljs-code,.hljs-formula,.hljs-section{color:#7aa2f7}.hljs-name,.hljs-keyword,.hljs-operator,.hljs-char.escape_,.hljs-attr{color:#bb9af7}.hljs-punctuation{color:#c0caf5}.hljs{background:#1a1b26;color:#9aa5ce}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.code-container{display:flex;margin:0}.line-numbers{flex-shrink:0;padding-right:5px;color:#999;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap;margin:0}.code-content{flex-grow:1;margin:0}.hovered{transition:transform .3s cubic-bezier(.175,.885,.32,1.275);transform:scale(1.1)}.active{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%)}.overlay{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#0009;pointer-events:all}select{width:200px}body{background-color:#fafafa;font-family:sans-serif}.container{margin:4px auto;width:800px}.settings{position:fixed;top:0;right:0;width:250px;background-color:#fff;z-index:1000;display:none}.settings-button{cursor:pointer;padding:10px;border:1px solid #ddd;border-radius:5px;color:#333;font-size:14px}.settings-button:hover{background-color:#eee}.settings-button:active{background-color:#ddd}.slider-container{margin-top:20px}.slider-value{display:inline-block;margin-left:10px;color:#6b7280;font-size:14px}.small-button{padding:.5rem .75rem;font-size:.875rem}.active-tab{font-weight:700}.scrollbar[data-v-b19a05a8]{scrollbar-width:thin;scrollbar-color:var(--scrollbar-thumb-color) var(--scrollbar-track-color);white-space:pre-wrap;overflow-wrap:break-word}.scrollbar[data-v-b19a05a8]::-webkit-scrollbar{width:8px}.scrollbar[data-v-b19a05a8]::-webkit-scrollbar-track{background-color:var(--scrollbar-track-color)}.scrollbar[data-v-b19a05a8]::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-color);border-radius:4px}.scrollbar[data-v-b19a05a8]::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover-color)}.menu-container{position:relative;display:inline-block}.menu-button{background-color:#007bff;color:#fff;padding:10px;border:none;cursor:pointer;border-radius:4px}.menu-list{position:absolute;background-color:#fff;color:#000;border:1px solid #ccc;border-radius:4px;box-shadow:0 2px 4px #0003;padding:10px;max-width:500px;z-index:1000}.slide-enter-active,.slide-leave-active{transition:transform .2s}.slide-enter-to,.slide-leave-from{transform:translateY(-10px)}.menu-ul{list-style:none;padding:0;margin:0}.menu-li{cursor:pointer;display:flex;align-items:center;padding:5px}.menu-icon{width:20px;height:20px;margin-right:8px}.menu-command{min-width:200px;text-align:left}.selected-choice{background-color:#bde4ff}.heartbeat-text[data-v-d96111fe]{font-size:24px;animation:pulsate-d96111fe 1.5s infinite}@keyframes pulsate-d96111fe{0%{transform:scale(1);opacity:1}50%{transform:scale(1.1);opacity:.7}to{transform:scale(1);opacity:1}}.list-move[data-v-d96111fe],.list-enter-active[data-v-d96111fe],.list-leave-active[data-v-d96111fe]{transition:all .5s ease}.list-enter-from[data-v-d96111fe]{transform:translatey(-30px)}.list-leave-to[data-v-d96111fe]{opacity:0;transform:translatey(30px)}.list-leave-active[data-v-d96111fe]{position:absolute}.bounce-enter-active[data-v-d96111fe]{animation:bounce-in-d96111fe .5s}.bounce-leave-active[data-v-d96111fe]{animation:bounce-in-d96111fe .5s reverse}@keyframes bounce-in-d96111fe{0%{transform:scale(0)}50%{transform:scale(1.25)}to{transform:scale(1)}}.bg-primary-light[data-v-d96111fe]{background-color:#0ff}.hover[data-v-d96111fe]:bg-primary-light:hover{background-color:#7fffd4}.font-bold[data-v-d96111fe]{font-weight:700}.collapsible-section{cursor:pointer;margin-bottom:10px;font-weight:700}.collapsible-section:hover{color:#1a202c}.collapsible-section .toggle-icon{margin-right:.25rem}.collapsible-section .toggle-icon i{color:#4a5568}.collapsible-section .toggle-icon i:hover{color:#1a202c}.json-viewer{max-height:300px;max-width:700px;flex:auto;overflow-y:auto;padding:10px;background-color:#f1f1f1;border:1px solid #ccc;border-radius:4px}.json-viewer .toggle-icon{cursor:pointer;margin-right:.25rem}.json-viewer .toggle-icon i{color:#4a5568}.json-viewer .toggle-icon i:hover{color:#1a202c}.expand-button{margin-left:10px;margin-right:10px;background:none;border:none;padding:0;cursor:pointer}.htmljs{background:none}.bounce-enter-active[data-v-d16a58b9]{animation:bounce-in-d16a58b9 .5s}.bounce-leave-active[data-v-d16a58b9]{animation:bounce-in-d16a58b9 .5s reverse}@keyframes bounce-in-d16a58b9{0%{transform:scale(0)}50%{transform:scale(1.25)}to{transform:scale(1)}}.custom-scrollbar[data-v-52cfa09c]::-webkit-scrollbar{width:8px}.custom-scrollbar[data-v-52cfa09c]::-webkit-scrollbar-track{background-color:#f1f1f1}.custom-scrollbar[data-v-52cfa09c]::-webkit-scrollbar-thumb{background-color:#888;border-radius:4px}.custom-scrollbar[data-v-52cfa09c]::-webkit-scrollbar-thumb:hover{background-color:#555}.menu[data-v-52cfa09c]{display:flex;flex-direction:column;align-items:center}.commands-menu-items-wrapper[data-v-52cfa09c]{position:relative;display:flex;flex-direction:column;align-items:center}.commands-menu-items-wrapper>#commands-menu-items[data-v-52cfa09c]{top:calc(-100% - 2rem)}.list-move[data-v-6b91f51b],.list-enter-active[data-v-6b91f51b],.list-leave-active[data-v-6b91f51b]{transition:all .5s ease}.list-enter-from[data-v-6b91f51b]{transform:translatey(-30px)}.list-leave-to[data-v-6b91f51b]{opacity:0;transform:translatey(30px)}.list-leave-active[data-v-6b91f51b]{position:absolute}.slide-right-enter-active[data-v-7a271009],.slide-right-leave-active[data-v-7a271009]{transition:transform .3s ease}.slide-right-enter[data-v-7a271009],.slide-right-leave-to[data-v-7a271009]{transform:translate(-100%)}.fade-and-fly-enter-active[data-v-7a271009]{animation:fade-and-fly-enter-7a271009 .5s ease}.fade-and-fly-leave-active[data-v-7a271009]{animation:fade-and-fly-leave-7a271009 .5s ease}@keyframes fade-and-fly-enter-7a271009{0%{opacity:0;transform:translateY(20px) scale(.8)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes fade-and-fly-leave-7a271009{0%{opacity:1;transform:translateY(0) scale(1)}to{opacity:0;transform:translateY(-20px) scale(1.2)}}.list-move[data-v-7a271009],.list-enter-active[data-v-7a271009],.list-leave-active[data-v-7a271009]{transition:all .5s ease}.list-enter-from[data-v-7a271009]{transform:translatey(-30px)}.list-leave-to[data-v-7a271009]{opacity:0;transform:translatey(30px)}.list-leave-active[data-v-7a271009]{position:absolute}.container{display:flex;justify-content:flex-start;align-items:flex-start;flex-wrap:wrap}.floating-frame{margin:15px;float:left;height:auto;border:1px solid #000;border-radius:4px;overflow:hidden;z-index:5000;position:fixed;cursor:move;bottom:0;right:0}.handle{width:100%;height:20px;background:#ccc;cursor:move;text-align:center}.floating-frame img{width:100%;height:auto}.controls{margin-top:10px}#webglContainer{top:0;left:0}.floating-frame2{margin:15px;width:800px;height:auto;border:1px solid #000;border-radius:4px;overflow:hidden;min-height:200px;z-index:5000}:root{--baklava-control-color-primary: #e28b46;--baklava-control-color-error: #d00000;--baklava-control-color-background: #2c3748;--baklava-control-color-foreground: white;--baklava-control-color-hover: #455670;--baklava-control-color-active: #556986;--baklava-control-color-disabled-foreground: #666c75;--baklava-control-border-radius: 3px;--baklava-sidebar-color-background: #1b202c;--baklava-sidebar-color-foreground: white;--baklava-node-color-background: #1b202c;--baklava-node-color-foreground: white;--baklava-node-color-hover: #e28c4677;--baklava-node-color-selected: var(--baklava-control-color-primary);--baklava-node-color-resize-handle: var(--baklava-control-color-background);--baklava-node-title-color-background: #151a24;--baklava-node-title-color-foreground: white;--baklava-group-node-title-color-background: #215636;--baklava-group-node-title-color-foreground: white;--baklava-node-interface-port-tooltip-color-foreground: var(--baklava-control-color-primary);--baklava-node-interface-port-tooltip-color-background: var(--baklava-editor-background-pattern-black);--baklava-node-border-radius: 6px;--baklava-color-connection-default: #737f96;--baklava-color-connection-allowed: #48bc79;--baklava-color-connection-forbidden: #bc4848;--baklava-editor-background-pattern-default: #202b3c;--baklava-editor-background-pattern-line: #263140;--baklava-editor-background-pattern-black: #263140;--baklava-context-menu-background: #1b202c;--baklava-context-menu-shadow: 0 0 8px rgba(0, 0, 0, .65);--baklava-toolbar-background: #1b202caa;--baklava-toolbar-foreground: white;--baklava-node-palette-background: #1b202caa;--baklava-node-palette-foreground: white;--baklava-visual-transition: .1s linear}.baklava-button{background-color:var(--baklava-control-color-background);color:var(--baklava-control-color-foreground);transition:background-color var(--baklava-visual-transition);border:none;padding:.45em .35em;border-radius:var(--baklava-control-border-radius);font-size:inherit;cursor:pointer;overflow-x:hidden}.baklava-button:hover{background-color:var(--baklava-control-color-hover)}.baklava-button:active{background-color:var(--baklava-control-color-primary)}.baklava-button.--block{width:100%}.baklava-checkbox{display:flex;padding:.35em 0;cursor:pointer;overflow-x:hidden;align-items:center}.baklava-checkbox .__checkmark-container{display:flex;background-color:var(--baklava-control-color-background);border-radius:var(--baklava-control-border-radius);transition:background-color var(--baklava-visual-transition);width:18px;height:18px}.baklava-checkbox:hover .__checkmark-container{background-color:var(--baklava-control-color-hover)}.baklava-checkbox:active .__checkmark-container{background-color:var(--baklava-control-color-active)}.baklava-checkbox .__checkmark{stroke-dasharray:15;stroke-dashoffset:15;stroke:var(--baklava-control-color-foreground);stroke-width:2px;fill:none;transition:stroke-dashoffset var(--baklava-visual-transition)}.baklava-checkbox.--checked .__checkmark{stroke-dashoffset:0}.baklava-checkbox.--checked .__checkmark-container{background-color:var(--baklava-control-color-primary)}.baklava-checkbox .__label{margin-left:.5rem}.baklava-context-menu{color:var(--baklava-control-color-foreground);position:absolute;display:inline-block;z-index:100;background-color:var(--baklava-context-menu-background);box-shadow:var(--baklava-context-menu-shadow);border-radius:0 0 var(--baklava-control-border-radius) var(--baklava-control-border-radius);min-width:6rem;width:-moz-max-content;width:max-content}.baklava-context-menu>.item{display:flex;align-items:center;padding:.35em 1em;transition:background .05s linear;position:relative}.baklava-context-menu>.item>.__label{flex:1 1 auto}.baklava-context-menu>.item>.__submenu-icon{margin-left:.75rem}.baklava-context-menu>.item.--disabled{color:var(--baklava-control-color-hover)}.baklava-context-menu>.item:not(.--header):not(.--active):not(.--disabled):hover{background:var(--baklava-control-color-primary)}.baklava-context-menu>.item.--active{background:var(--baklava-control-color-primary)}.baklava-context-menu.--nested{left:100%;top:0}.baklava-context-menu.--flipped-x.--nested{left:unset;right:100%}.baklava-context-menu.--flipped-y.--nested{top:unset;bottom:0}.baklava-context-menu>.divider{margin:.35em 0;height:1px;background-color:var(--baklava-control-color-hover)}.baklava-icon{display:block;height:100%}.baklava-icon.--clickable{cursor:pointer;transition:color var(--baklava-visual-transition)}.baklava-icon.--clickable:hover{color:var(--baklava-control-color-primary)}.baklava-input{background-color:var(--baklava-control-color-background);color:var(--baklava-control-color-foreground);caret-color:var(--baklava-control-color-primary);border:none;border-radius:var(--baklava-control-border-radius);padding:.45em .75em;width:100%;transition:background-color var(--baklava-visual-transition);font-size:inherit;font:inherit}.baklava-input:hover{background-color:var(--baklava-control-color-hover)}.baklava-input:active{background-color:var(--baklava-control-color-active)}.baklava-input:focus-visible{outline:1px solid var(--baklava-control-color-primary)}.baklava-input[type=number]::-webkit-inner-spin-button,.baklava-input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.baklava-input.--invalid{box-shadow:0 0 2px 2px var(--baklava-control-color-error)}.baklava-num-input{background:var(--baklava-control-color-background);color:var(--baklava-control-color-foreground);border-radius:var(--baklava-control-border-radius);width:100%;display:grid;grid-template-columns:20px 1fr 20px}.baklava-num-input>.__button{display:flex;flex:0 0 auto;width:20px;justify-content:center;align-items:center;transition:background var(--baklava-visual-transition);cursor:pointer}.baklava-num-input>.__button:hover{background-color:var(--baklava-control-color-hover)}.baklava-num-input>.__button:active{background-color:var(--baklava-control-color-active)}.baklava-num-input>.__button.--dec{grid-area:1/1/span 1/span 1}.baklava-num-input>.__button.--dec>svg{transform:rotate(90deg)}.baklava-num-input>.__button.--inc{grid-area:1/3/span 1/span 1}.baklava-num-input>.__button.--inc>svg{transform:rotate(-90deg)}.baklava-num-input>.__button path{stroke:var(--baklava-control-color-foreground);fill:var(--baklava-control-color-foreground)}.baklava-num-input>.__content{grid-area:1/2/span 1/span 1;display:inline-flex;cursor:pointer;max-width:100%;min-width:0;align-items:center;transition:background-color var(--baklava-visual-transition)}.baklava-num-input>.__content:hover{background-color:var(--baklava-control-color-hover)}.baklava-num-input>.__content:active{background-color:var(--baklava-control-color-active)}.baklava-num-input>.__content>.__label,.baklava-num-input>.__content>.__value{margin:.35em 0;padding:0 .5em}.baklava-num-input>.__content>.__label{flex:1;min-width:0;overflow:hidden}.baklava-num-input>.__content>.__value{text-align:right}.baklava-num-input>.__content>input{background-color:var(--baklava-control-color-background);color:var(--baklava-control-color-foreground);caret-color:var(--baklava-control-color-primary);padding:.35em;width:100%}.baklava-select{width:100%;position:relative;color:var(--baklava-control-color-foreground)}.baklava-select.--open>.__selected{border-bottom-left-radius:0;border-bottom-right-radius:0}.baklava-select.--open>.__selected>.__icon{transform:rotate(180deg)}.baklava-select>.__selected{background-color:var(--baklava-control-color-background);padding:.35em .75em;border-radius:var(--baklava-control-border-radius);transition:background var(--baklava-visual-transition);min-height:1.7em;display:flex;align-items:center;cursor:pointer}.baklava-select>.__selected:hover{background:var(--baklava-control-color-hover)}.baklava-select>.__selected:active{background:var(--baklava-control-color-active)}.baklava-select>.__selected>.__text{flex:1 0 auto;flex-basis:0;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.baklava-select>.__selected>.__icon{flex:0 0 auto;display:flex;justify-content:center;align-items:center;transition:transform .25s ease;width:18px;height:18px}.baklava-select>.__selected>.__icon path{stroke:var(--baklava-control-color-foreground);fill:var(--baklava-control-color-foreground)}.baklava-select>.__dropdown{position:absolute;top:100%;left:0;right:0;z-index:10;background-color:var(--baklava-context-menu-background);filter:drop-shadow(0 0 4px black);border-radius:0 0 var(--baklava-control-border-radius) var(--baklava-control-border-radius);max-height:15em;overflow-y:scroll}.baklava-select>.__dropdown::-webkit-scrollbar{width:0px;background:transparent}.baklava-select>.__dropdown>.item{padding:.35em .35em .35em 1em;transition:background .05s linear}.baklava-select>.__dropdown>.item:not(.--header):not(.--active){cursor:pointer}.baklava-select>.__dropdown>.item:not(.--header):not(.--active):hover{background:var(--baklava-control-color-hover)}.baklava-select>.__dropdown>.item.--active{background:var(--baklava-control-color-primary)}.baklava-select>.__dropdown>.item.--header{color:var(--baklava-control-color-disabled-foreground);border-bottom:1px solid var(--baklava-control-color-disabled-foreground);padding:.5em .35em .5em 1em}.baklava-slider{background:var(--baklava-control-color-background);color:var(--baklava-control-color-foreground);border-radius:var(--baklava-control-border-radius);position:relative;cursor:pointer}.baklava-slider>.__content{display:flex;position:relative}.baklava-slider>.__content>.__label,.baklava-slider>.__content>.__value{flex:1 1 auto;margin:.35em 0;padding:0 .5em;text-overflow:ellipsis}.baklava-slider>.__content>.__value{text-align:right}.baklava-slider>.__content>input{background-color:var(--baklava-control-color-background);color:var(--baklava-control-color-foreground);caret-color:var(--baklava-control-color-primary);padding:.35em;width:100%}.baklava-slider>.__slider{position:absolute;top:0;bottom:0;left:0;background-color:var(--baklava-control-color-primary);border-radius:var(--baklava-control-border-radius)}.baklava-connection{stroke:var(--baklava-color-connection-default);stroke-width:2px;fill:none}.baklava-connection.--temporary{stroke-width:4px;stroke-dasharray:5 5;stroke-dashoffset:0;animation:dash 1s linear infinite;transform:translateY(-1px)}@keyframes dash{to{stroke-dashoffset:20}}.baklava-connection.--allowed{stroke:var(--baklava-color-connection-allowed)}.baklava-connection.--forbidden{stroke:var(--baklava-color-connection-forbidden)}.baklava-minimap{position:absolute;height:15%;width:15%;min-width:150px;max-width:90%;top:20px;right:20px;z-index:900}.baklava-editor{width:100%;height:100%;position:relative;overflow:hidden;outline:none!important;font-family:Lato,Segoe UI,Tahoma,Geneva,Verdana,sans-serif;font-size:15px;touch-action:none}.baklava-editor .background{background-color:var(--baklava-editor-background-pattern-default);background-image:linear-gradient(var(--baklava-editor-background-pattern-black) 2px,transparent 2px),linear-gradient(90deg,var(--baklava-editor-background-pattern-black) 2px,transparent 2px),linear-gradient(var(--baklava-editor-background-pattern-line) 1px,transparent 1px),linear-gradient(90deg,var(--baklava-editor-background-pattern-line) 1px,transparent 1px);background-repeat:repeat;width:100%;height:100%;pointer-events:none!important}.baklava-editor *:not(input):not(textarea){user-select:none;-moz-user-select:none;-webkit-user-select:none;touch-action:none}.baklava-editor .input-user-select{user-select:auto;-moz-user-select:auto;-webkit-user-select:auto}.baklava-editor *,.baklava-editor *:after,.baklava-editor *:before{box-sizing:border-box}.baklava-editor.--temporary-connection{cursor:crosshair}.baklava-editor .connections-container{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none!important}.baklava-editor .node-container{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.baklava-editor .node-container *{pointer-events:all}.baklava-ignore-mouse *{pointer-events:none!important}.baklava-ignore-mouse .__port{pointer-events:all!important}.baklava-node-interface{padding:.25em 0;position:relative}.baklava-node-interface .__port{position:absolute;width:10px;height:10px;background:white;border-radius:50%;top:calc(50% - 5px);cursor:crosshair}.baklava-node-interface .__port.--selected{outline:2px var(--baklava-color-connection-default) solid;outline-offset:4px}.baklava-node-interface.--input{text-align:left;padding-left:.5em}.baklava-node-interface.--input .__port{left:-1.1em}.baklava-node-interface.--output{text-align:right;padding-right:.5em}.baklava-node-interface.--output .__port{right:-1.1em}.baklava-node-interface .__tooltip{position:absolute;left:5px;top:15px;transform:translate(-50%);background:var(--baklava-node-interface-port-tooltip-color-background);color:var(--baklava-node-interface-port-tooltip-color-foreground);padding:.25em .5em;text-align:center;z-index:2}.baklava-node-palette{position:absolute;left:0;top:60px;width:250px;height:calc(100% - 60px);z-index:3;padding:2rem;overflow-y:auto;background:var(--baklava-node-palette-background);color:var(--baklava-node-palette-foreground)}.baklava-node-palette h1{margin-top:2rem}.baklava-node.--palette{position:unset;margin:1rem 0;cursor:grab}.baklava-node.--palette:first-child{margin-top:0}.baklava-node.--palette .__title{padding:.5rem;border-radius:var(--baklava-node-border-radius)}.baklava-dragged-node{position:absolute;width:calc(250px - 4rem);height:40px;z-index:4;pointer-events:none}.baklava-node{background:var(--baklava-node-color-background);color:var(--baklava-node-color-foreground);border:1px solid transparent;border-radius:var(--baklava-node-border-radius);position:absolute;box-shadow:0 0 4px #000c;transition:border-color var(--baklava-visual-transition),box-shadow var(--baklava-visual-transition);width:var(--width)}.baklava-node:hover{border-color:var(--baklava-node-color-hover)}.baklava-node:hover .__resize-handle:after{opacity:1}.baklava-node.--selected{z-index:5;border-color:var(--baklava-node-color-selected)}.baklava-node.--dragging{box-shadow:0 0 12px #000c}.baklava-node.--dragging>.__title{cursor:grabbing}.baklava-node>.__title{display:flex;background:var(--baklava-node-title-color-background);color:var(--baklava-node-title-color-foreground);padding:.4em .75em;border-radius:var(--baklava-node-border-radius) var(--baklava-node-border-radius) 0 0;cursor:grab}.baklava-node>.__title>*:first-child{flex-grow:1}.baklava-node>.__title>.__title-label{pointer-events:none}.baklava-node>.__title>.__menu{position:relative;cursor:initial}.baklava-node[data-node-type^=__baklava_]>.__title{background:var(--baklava-group-node-title-color-background);color:var(--baklava-group-node-title-color-foreground)}.baklava-node>.__content{padding:.75em}.baklava-node>.__content>div>div{margin:.5em 0}.baklava-node.--two-column>.__content{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto auto;grid-template-areas:". ." ". ."}.baklava-node.--two-column>.__content>.__inputs{grid-row:1;grid-column:1}.baklava-node.--two-column>.__content>.__outputs{grid-row:1;grid-column:2}.baklava-node .__resize-handle{position:absolute;right:0;bottom:0;width:1rem;height:1rem;transform:translate(50%);cursor:ew-resize}.baklava-node .__resize-handle:after{content:"";position:absolute;bottom:0;left:-.5rem;width:1rem;height:1rem;opacity:0;border-bottom-right-radius:var(--baklava-node-border-radius);transition:opacity var(--baklava-visual-transition);background:linear-gradient(-45deg,transparent 10%,var(--baklava-node-color-resize-handle) 10%,var(--baklava-node-color-resize-handle) 15%,transparent 15%,transparent 30%,var(--baklava-node-color-resize-handle) 30%,var(--baklava-node-color-resize-handle) 35%,transparent 35%,transparent 50%,var(--baklava-node-color-resize-handle) 50%,var(--baklava-node-color-resize-handle) 55%,transparent 55%)}.baklava-sidebar{position:absolute;height:100%;width:25%;min-width:300px;max-width:90%;top:0;right:0;z-index:1000;background-color:var(--baklava-sidebar-color-background);color:var(--baklava-sidebar-color-foreground);box-shadow:none;overflow-x:hidden;padding:1em;transform:translate(100%);transition:transform .5s;display:flex;flex-direction:column}.baklava-sidebar.--open{transform:translate(0);box-shadow:0 0 15px #000}.baklava-sidebar .__resizer{position:absolute;left:0;top:0;height:100%;width:4px;cursor:col-resize}.baklava-sidebar .__header{display:flex;align-items:center}.baklava-sidebar .__header .__node-name{margin-left:.5rem}.baklava-sidebar .__close{font-size:2em;border:none;background:none;color:inherit;cursor:pointer}.baklava-sidebar .__interface{margin:.5em 0}.baklava-toolbar{position:absolute;left:0;top:0;width:100%;height:60px;z-index:3;padding:.5rem 2rem;background:var(--baklava-toolbar-background);color:var(--baklava-toolbar-foreground);display:flex;align-items:center}.baklava-toolbar-entry{margin-left:.5rem;margin-right:.5rem}.baklava-toolbar-button{color:var(--baklava-toolbar-foreground);background:none;border:none;transition:color var(--baklava-visual-transition)}.baklava-toolbar-button:not([disabled]){cursor:pointer}.baklava-toolbar-button:hover:not([disabled]){color:var(--baklava-control-color-primary)}.baklava-toolbar-button[disabled]{color:var(--baklava-control-color-disabled-foreground)}.slide-fade-enter-active,.slide-fade-leave-active{transition:all .1s ease-out}.slide-fade-enter-from,.slide-fade-leave-to{transform:translateY(5px);opacity:0}.fade-enter-active,.fade-leave-active{transition:opacity .1s ease-out!important}.fade-enter-from,.fade-leave-to{opacity:0}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:PTSans,Roboto,sans-serif;font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}.tooltip-arrow,.tooltip-arrow:before{position:absolute;width:8px;height:8px;background:inherit}.tooltip-arrow{visibility:hidden}.tooltip-arrow:before{content:"";visibility:visible;transform:rotate(45deg)}[data-tooltip-style^=light]+.tooltip>.tooltip-arrow:before{border-style:solid;border-color:#e5e7eb}[data-tooltip-style^=light]+.tooltip[data-popper-placement^=top]>.tooltip-arrow:before{border-bottom-width:1px;border-right-width:1px}[data-tooltip-style^=light]+.tooltip[data-popper-placement^=right]>.tooltip-arrow:before{border-bottom-width:1px;border-left-width:1px}[data-tooltip-style^=light]+.tooltip[data-popper-placement^=bottom]>.tooltip-arrow:before{border-top-width:1px;border-left-width:1px}[data-tooltip-style^=light]+.tooltip[data-popper-placement^=left]>.tooltip-arrow:before{border-top-width:1px;border-right-width:1px}.tooltip[data-popper-placement^=top]>.tooltip-arrow{bottom:-4px}.tooltip[data-popper-placement^=bottom]>.tooltip-arrow{top:-4px}.tooltip[data-popper-placement^=left]>.tooltip-arrow{right:-4px}.tooltip[data-popper-placement^=right]>.tooltip-arrow{left:-4px}.tooltip.invisible>.tooltip-arrow:before{visibility:hidden}[data-popper-arrow],[data-popper-arrow]:before{position:absolute;width:8px;height:8px;background:inherit}[data-popper-arrow]{visibility:hidden}[data-popper-arrow]:before{content:"";visibility:visible;transform:rotate(45deg)}[data-popper-arrow]:after{content:"";visibility:visible;transform:rotate(45deg);position:absolute;width:9px;height:9px;background:inherit}[role=tooltip]>[data-popper-arrow]:before{border-style:solid;border-color:#e5e7eb}.dark [role=tooltip]>[data-popper-arrow]:before{border-style:solid;border-color:#4b5563}[role=tooltip]>[data-popper-arrow]:after{border-style:solid;border-color:#e5e7eb}.dark [role=tooltip]>[data-popper-arrow]:after{border-style:solid;border-color:#4b5563}[data-popover][role=tooltip][data-popper-placement^=top]>[data-popper-arrow]:before{border-bottom-width:1px;border-right-width:1px}[data-popover][role=tooltip][data-popper-placement^=top]>[data-popper-arrow]:after{border-bottom-width:1px;border-right-width:1px}[data-popover][role=tooltip][data-popper-placement^=right]>[data-popper-arrow]:before{border-bottom-width:1px;border-left-width:1px}[data-popover][role=tooltip][data-popper-placement^=right]>[data-popper-arrow]:after{border-bottom-width:1px;border-left-width:1px}[data-popover][role=tooltip][data-popper-placement^=bottom]>[data-popper-arrow]:before{border-top-width:1px;border-left-width:1px}[data-popover][role=tooltip][data-popper-placement^=bottom]>[data-popper-arrow]:after{border-top-width:1px;border-left-width:1px}[data-popover][role=tooltip][data-popper-placement^=left]>[data-popper-arrow]:before{border-top-width:1px;border-right-width:1px}[data-popover][role=tooltip][data-popper-placement^=left]>[data-popper-arrow]:after{border-top-width:1px;border-right-width:1px}[data-popover][role=tooltip][data-popper-placement^=top]>[data-popper-arrow]{bottom:-5px}[data-popover][role=tooltip][data-popper-placement^=bottom]>[data-popper-arrow]{top:-5px}[data-popover][role=tooltip][data-popper-placement^=left]>[data-popper-arrow]{right:-5px}[data-popover][role=tooltip][data-popper-placement^=right]>[data-popper-arrow]{left:-5px}[role=tooltip].invisible>[data-popper-arrow]:before{visibility:hidden}[role=tooltip].invisible>[data-popper-arrow]:after{visibility:hidden}[type=text],[type=email],[type=url],[type=password],[type=number],[type=date],[type=datetime-local],[type=month],[type=search],[type=tel],[type=time],[type=week],[multiple],textarea,select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#6b7280;border-width:1px;border-radius:0;padding:.5rem .75rem;font-size:1rem;line-height:1.5rem;--tw-shadow: 0 0 #0000}[type=text]:focus,[type=email]:focus,[type=url]:focus,[type=password]:focus,[type=number]:focus,[type=date]:focus,[type=datetime-local]:focus,[type=month]:focus,[type=search]:focus,[type=tel]:focus,[type=time]:focus,[type=week]:focus,[multiple]:focus,textarea:focus,select:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-inset: var(--tw-empty, );--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: #1C64F2;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-color:#1c64f2}input::-moz-placeholder,textarea::-moz-placeholder{color:#6b7280;opacity:1}input::placeholder,textarea::placeholder{color:#6b7280;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em}select:not([size]){background-image:url("data:image/svg+xml,%3csvg aria-hidden='true' xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 10 6'%3e %3cpath stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 1 4 4 4-4'/%3e %3c/svg%3e");background-position:right .75rem center;background-repeat:no-repeat;background-size:.75em .75em;padding-right:2.5rem;-webkit-print-color-adjust:exact;print-color-adjust:exact}[multiple]{background-image:initial;background-position:initial;background-repeat:unset;background-size:initial;padding-right:.75rem;-webkit-print-color-adjust:unset;print-color-adjust:unset}[type=checkbox],[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;-webkit-print-color-adjust:exact;print-color-adjust:exact;display:inline-block;vertical-align:middle;background-origin:border-box;-webkit-user-select:none;-moz-user-select:none;user-select:none;flex-shrink:0;height:1rem;width:1rem;color:#1c64f2;background-color:#fff;border-color:#6b7280;border-width:1px;--tw-shadow: 0 0 #0000}[type=checkbox]{border-radius:0}[type=radio]{border-radius:100%}[type=checkbox]:focus,[type=radio]:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-inset: var(--tw-empty, );--tw-ring-offset-width: 2px;--tw-ring-offset-color: #fff;--tw-ring-color: #1C64F2;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}[type=checkbox]:checked,[type=radio]:checked,.dark [type=checkbox]:checked,.dark [type=radio]:checked{border-color:transparent;background-color:currentColor;background-size:.55em .55em;background-position:center;background-repeat:no-repeat}[type=checkbox]:checked{background-image:url("data:image/svg+xml,%3csvg aria-hidden='true' xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 12'%3e %3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M1 5.917 5.724 10.5 15 1.5'/%3e %3c/svg%3e");background-repeat:no-repeat;background-size:.55em .55em;-webkit-print-color-adjust:exact;print-color-adjust:exact}[type=radio]:checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e");background-size:1em 1em}.dark [type=radio]:checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e");background-size:1em 1em}[type=checkbox]:indeterminate{background-image:url("data:image/svg+xml,%3csvg aria-hidden='true' xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 12'%3e %3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M1 5.917 5.724 10.5 15 1.5'/%3e %3c/svg%3e");background-color:currentColor;border-color:transparent;background-position:center;background-repeat:no-repeat;background-size:.55em .55em;-webkit-print-color-adjust:exact;print-color-adjust:exact}[type=checkbox]:indeterminate:hover,[type=checkbox]:indeterminate:focus{border-color:transparent;background-color:currentColor}[type=file]{background:unset;border-color:inherit;border-width:0;border-radius:0;padding:0;font-size:unset;line-height:inherit}[type=file]:focus{outline:1px auto inherit}input[type=file]::file-selector-button{color:#fff;background:#1F2937;border:0;font-weight:500;font-size:.875rem;cursor:pointer;padding:.625rem 1rem .625rem 2rem;margin-inline-start:-1rem;margin-inline-end:1rem}input[type=file]::file-selector-button:hover{background:#374151}.dark input[type=file]::file-selector-button{color:#fff;background:#4B5563}.dark input[type=file]::file-selector-button:hover{background:#6B7280}input[type=range]::-webkit-slider-thumb{height:1.25rem;width:1.25rem;background:#1C64F2;border-radius:9999px;border:0;appearance:none;-moz-appearance:none;-webkit-appearance:none;cursor:pointer}input[type=range]:disabled::-webkit-slider-thumb{background:#9CA3AF}.dark input[type=range]:disabled::-webkit-slider-thumb{background:#6B7280}input[type=range]:focus::-webkit-slider-thumb{outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-opacity: 1px;--tw-ring-color: rgb(164 202 254 / var(--tw-ring-opacity))}input[type=range]::-moz-range-thumb{height:1.25rem;width:1.25rem;background:#1C64F2;border-radius:9999px;border:0;appearance:none;-moz-appearance:none;-webkit-appearance:none;cursor:pointer}input[type=range]:disabled::-moz-range-thumb{background:#9CA3AF}.dark input[type=range]:disabled::-moz-range-thumb{background:#6B7280}input[type=range]::-moz-range-progress{background:#3F83F8}input[type=range]::-ms-fill-lower{background:#3F83F8}.toggle-bg:after{content:"";position:absolute;top:.125rem;left:.125rem;background:white;border-color:#d1d5db;border-width:1px;border-radius:9999px;height:1.25rem;width:1.25rem;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-duration:.15s;box-shadow:var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color)}input:checked+.toggle-bg:after{transform:translate(100%);border-color:#fff}input:checked+.toggle-bg{background:#1C64F2;border-color:#1c64f2}*{scrollbar-color:initial;scrollbar-width:initial}html{scroll-behavior:smooth}@font-face{font-family:Roboto;src:url(/assets/Roboto-Regular-7277cfb8.ttf) format("truetype")}@font-face{font-family:PTSans;src:url(/assets/PTSans-Regular-23b91352.ttf) format("truetype")}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(63 131 248 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(63 131 248 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%;margin-right:auto;margin-left:auto;padding-right:2rem;padding-left:2rem}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-y-0{top:0;bottom:0}.-bottom-1{bottom:-.25rem}.-bottom-1\.5{bottom:-.375rem}.-bottom-2{bottom:-.5rem}.-bottom-4{bottom:-1rem}.-left-1{left:-.25rem}.-left-1\.5{left:-.375rem}.-right-0{right:-0px}.-right-0\.5{right:-.125rem}.-right-1{right:-.25rem}.-right-1\.5{right:-.375rem}.-top-1{top:-.25rem}.-top-1\.5{top:-.375rem}.bottom-0{bottom:0}.bottom-16{bottom:4rem}.bottom-2{bottom:.5rem}.bottom-2\.5{bottom:.625rem}.bottom-5{bottom:1.25rem}.bottom-\[60px\]{bottom:60px}.left-0{left:0}.left-1\/2{left:50%}.left-2{left:.5rem}.left-7{left:1.75rem}.left-9{left:2.25rem}.right-0{right:0}.right-2{right:.5rem}.right-2\.5{right:.625rem}.right-3{right:.75rem}.top-0{top:0}.top-1\/2{top:50%}.top-3{top:.75rem}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.-m-1{margin:-.25rem}.-m-2{margin:-.5rem}.-m-4{margin:-1rem}.m-0{margin:0}.m-1{margin:.25rem}.m-2{margin:.5rem}.m-4{margin:1rem}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.-mx-1\.5{margin-left:-.375rem;margin-right:-.375rem}.-mx-2{margin-left:-.5rem;margin-right:-.5rem}.-mx-5{margin-left:-1.25rem;margin-right:-1.25rem}.-my-1{margin-top:-.25rem;margin-bottom:-.25rem}.-my-1\.5{margin-top:-.375rem;margin-bottom:-.375rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-1\.5{margin-left:.375rem;margin-right:.375rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-4{margin-top:1rem;margin-bottom:1rem}.-mb-px{margin-bottom:-1px}.mb-1{margin-bottom:.25rem}.mb-10{margin-bottom:2.5rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.ml-0{margin-left:0}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-5{margin-left:1.25rem}.ml-auto{margin-left:auto}.mr-0{margin-right:0}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-4{margin-right:1rem}.mt-0{margin-top:0}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-14{margin-top:3.5rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-3{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-0{height:0px}.h-0\.5{height:.125rem}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-32{height:8rem}.h-36{height:9rem}.h-4{height:1rem}.h-4\/5{height:80%}.h-48{height:12rem}.h-5{height:1.25rem}.h-56{height:14rem}.h-6{height:1.5rem}.h-60{height:15rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-96{height:24rem}.h-auto{height:auto}.h-full{height:100%}.h-modal{height:calc(100% - 2rem)}.h-px{height:1px}.h-screen{height:100vh}.max-h-6{max-height:1.5rem}.max-h-64{max-height:16rem}.max-h-96{max-height:24rem}.max-h-\[400px\]{max-height:400px}.max-h-full{max-height:100%}.max-h-screen{max-height:100vh}.min-h-\[900px\]{min-height:900px}.min-h-full{min-height:100%}.w-0{width:0px}.w-0\.5{width:.125rem}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-1\/2{width:50%}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-3\/5{width:60%}.w-36{width:9rem}.w-4{width:1rem}.w-4\/5{width:80%}.w-4\/6{width:66.666667%}.w-48{width:12rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-60{width:15rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-96{width:24rem}.w-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-px{width:1px}.w-screen{width:100vw}.min-w-\[23rem\]{min-width:23rem}.min-w-\[24rem\]{min-width:24rem}.min-w-\[300px\]{min-width:300px}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.max-w-6xl{max-width:72rem}.max-w-7xl{max-width:80rem}.max-w-\[23rem\]{max-width:23rem}.max-w-\[24rem\]{max-width:24rem}.max-w-\[300px\]{max-width:300px}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xl{max-width:36rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-none{flex:none}.flex-shrink{flex-shrink:1}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.flex-grow-0{flex-grow:0}.grow{flex-grow:1}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-0{--tw-translate-y: -0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-full{--tw-translate-y: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-1\/2{--tw-translate-y: 50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-full{--tw-translate-y: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-75{--tw-scale-x: .75;--tw-scale-y: .75;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform-none{transform:none}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.list-disc{list-style-type:disc}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.-space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(-1rem * var(--tw-space-x-reverse));margin-left:calc(-1rem * calc(1 - var(--tw-space-x-reverse)))}.-space-x-px>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(-1px * var(--tw-space-x-reverse));margin-left:calc(-1px * calc(1 - var(--tw-space-x-reverse)))}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse: 0;border-right-width:calc(1px * var(--tw-divide-x-reverse));border-left-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-gray-100>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(243 244 246 / var(--tw-divide-opacity))}.divide-gray-200>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(229 231 235 / var(--tw-divide-opacity))}.self-center{align-self:center}.self-stretch{align-self:stretch}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-hidden{overflow-y:hidden}.overflow-y-scroll{overflow-y:scroll}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.\!rounded-full{border-radius:9999px!important}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-b{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-b-lg{border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem}.rounded-l-lg{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.rounded-r-lg{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.rounded-t-xl{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-4{border-width:4px}.border-x-0{border-left-width:0px;border-right-width:0px}.border-b{border-bottom-width:1px}.border-b-0{border-bottom-width:0px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-t{border-top-width:1px}.border-t-0{border-top-width:0px}.border-t-4{border-top-width:4px}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-bg-dark{--tw-border-opacity: 1;border-color:rgb(19 46 89 / var(--tw-border-opacity))}.border-blue-300{--tw-border-opacity: 1;border-color:rgb(164 202 254 / var(--tw-border-opacity))}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(63 131 248 / var(--tw-border-opacity))}.border-blue-600{--tw-border-opacity: 1;border-color:rgb(28 100 242 / var(--tw-border-opacity))}.border-blue-700{--tw-border-opacity: 1;border-color:rgb(26 86 219 / var(--tw-border-opacity))}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.border-gray-500{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity))}.border-gray-600{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity))}.border-gray-700{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity))}.border-gray-800{--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity))}.border-green-500{--tw-border-opacity: 1;border-color:rgb(14 159 110 / var(--tw-border-opacity))}.border-green-600{--tw-border-opacity: 1;border-color:rgb(5 122 85 / var(--tw-border-opacity))}.border-green-700{--tw-border-opacity: 1;border-color:rgb(4 108 78 / var(--tw-border-opacity))}.border-pink-600{--tw-border-opacity: 1;border-color:rgb(214 31 105 / var(--tw-border-opacity))}.border-pink-700{--tw-border-opacity: 1;border-color:rgb(191 18 93 / var(--tw-border-opacity))}.border-primary{--tw-border-opacity: 1;border-color:rgb(14 142 240 / var(--tw-border-opacity))}.border-primary-light{--tw-border-opacity: 1;border-color:rgb(61 171 255 / var(--tw-border-opacity))}.border-purple-600{--tw-border-opacity: 1;border-color:rgb(126 58 242 / var(--tw-border-opacity))}.border-purple-700{--tw-border-opacity: 1;border-color:rgb(108 43 217 / var(--tw-border-opacity))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(240 82 82 / var(--tw-border-opacity))}.border-red-600{--tw-border-opacity: 1;border-color:rgb(224 36 36 / var(--tw-border-opacity))}.border-red-700{--tw-border-opacity: 1;border-color:rgb(200 30 30 / var(--tw-border-opacity))}.border-secondary{--tw-border-opacity: 1;border-color:rgb(15 217 116 / var(--tw-border-opacity))}.border-transparent{border-color:transparent}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity))}.border-yellow-400{--tw-border-opacity: 1;border-color:rgb(227 160 8 / var(--tw-border-opacity))}.border-yellow-500{--tw-border-opacity: 1;border-color:rgb(194 120 3 / var(--tw-border-opacity))}.bg-accent{--tw-bg-opacity: 1;background-color:rgb(240 112 14 / var(--tw-bg-opacity))}.bg-bg-dark-tone-panel{--tw-bg-opacity: 1;background-color:rgb(67 103 163 / var(--tw-bg-opacity))}.bg-bg-light{--tw-bg-opacity: 1;background-color:rgb(226 237 255 / var(--tw-bg-opacity))}.bg-bg-light-discussion{--tw-bg-opacity: 1;background-color:rgb(197 216 248 / var(--tw-bg-opacity))}.bg-bg-light-tone{--tw-bg-opacity: 1;background-color:rgb(185 210 247 / var(--tw-bg-opacity))}.bg-bg-light-tone-panel{--tw-bg-opacity: 1;background-color:rgb(143 181 239 / var(--tw-bg-opacity))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(225 239 254 / var(--tw-bg-opacity))}.bg-blue-200{--tw-bg-opacity: 1;background-color:rgb(195 221 253 / var(--tw-bg-opacity))}.bg-blue-300{--tw-bg-opacity: 1;background-color:rgb(164 202 254 / var(--tw-bg-opacity))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(235 245 255 / var(--tw-bg-opacity))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(63 131 248 / var(--tw-bg-opacity))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity))}.bg-blue-700{--tw-bg-opacity: 1;background-color:rgb(26 86 219 / var(--tw-bg-opacity))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity))}.bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}.bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(222 247 236 / var(--tw-bg-opacity))}.bg-green-200{--tw-bg-opacity: 1;background-color:rgb(188 240 218 / var(--tw-bg-opacity))}.bg-green-400{--tw-bg-opacity: 1;background-color:rgb(49 196 141 / var(--tw-bg-opacity))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(14 159 110 / var(--tw-bg-opacity))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(5 122 85 / var(--tw-bg-opacity))}.bg-green-700{--tw-bg-opacity: 1;background-color:rgb(4 108 78 / var(--tw-bg-opacity))}.bg-indigo-100{--tw-bg-opacity: 1;background-color:rgb(229 237 255 / var(--tw-bg-opacity))}.bg-indigo-200{--tw-bg-opacity: 1;background-color:rgb(205 219 254 / var(--tw-bg-opacity))}.bg-indigo-500{--tw-bg-opacity: 1;background-color:rgb(104 117 245 / var(--tw-bg-opacity))}.bg-indigo-600{--tw-bg-opacity: 1;background-color:rgb(88 80 236 / var(--tw-bg-opacity))}.bg-orange-100{--tw-bg-opacity: 1;background-color:rgb(254 236 220 / var(--tw-bg-opacity))}.bg-pink-100{--tw-bg-opacity: 1;background-color:rgb(252 232 243 / var(--tw-bg-opacity))}.bg-pink-200{--tw-bg-opacity: 1;background-color:rgb(250 209 232 / var(--tw-bg-opacity))}.bg-pink-700{--tw-bg-opacity: 1;background-color:rgb(191 18 93 / var(--tw-bg-opacity))}.bg-primary{--tw-bg-opacity: 1;background-color:rgb(14 142 240 / var(--tw-bg-opacity))}.bg-primary-light{--tw-bg-opacity: 1;background-color:rgb(61 171 255 / var(--tw-bg-opacity))}.bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(237 235 254 / var(--tw-bg-opacity))}.bg-purple-200{--tw-bg-opacity: 1;background-color:rgb(220 215 254 / var(--tw-bg-opacity))}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(144 97 249 / var(--tw-bg-opacity))}.bg-purple-600{--tw-bg-opacity: 1;background-color:rgb(126 58 242 / var(--tw-bg-opacity))}.bg-purple-700{--tw-bg-opacity: 1;background-color:rgb(108 43 217 / var(--tw-bg-opacity))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(253 232 232 / var(--tw-bg-opacity))}.bg-red-200{--tw-bg-opacity: 1;background-color:rgb(251 213 213 / var(--tw-bg-opacity))}.bg-red-400{--tw-bg-opacity: 1;background-color:rgb(249 128 128 / var(--tw-bg-opacity))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(240 82 82 / var(--tw-bg-opacity))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(224 36 36 / var(--tw-bg-opacity))}.bg-red-700{--tw-bg-opacity: 1;background-color:rgb(200 30 30 / var(--tw-bg-opacity))}.bg-secondary{--tw-bg-opacity: 1;background-color:rgb(15 217 116 / var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-white\/30{background-color:#ffffff4d}.bg-white\/50{background-color:#ffffff80}.bg-yellow-100{--tw-bg-opacity: 1;background-color:rgb(253 246 178 / var(--tw-bg-opacity))}.bg-yellow-200{--tw-bg-opacity: 1;background-color:rgb(252 233 106 / var(--tw-bg-opacity))}.bg-yellow-400{--tw-bg-opacity: 1;background-color:rgb(227 160 8 / var(--tw-bg-opacity))}.bg-opacity-50{--tw-bg-opacity: .5}.bg-opacity-70{--tw-bg-opacity: .7}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-bg-light{--tw-gradient-from: #e2edff var(--tw-gradient-from-position);--tw-gradient-to: rgb(226 237 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-bg-light-tone{--tw-gradient-from: #b9d2f7 var(--tw-gradient-from-position);--tw-gradient-to: rgb(185 210 247 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-blue-500{--tw-gradient-from: #3F83F8 var(--tw-gradient-from-position);--tw-gradient-to: rgb(63 131 248 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-cyan-500{--tw-gradient-from: #06b6d4 var(--tw-gradient-from-position);--tw-gradient-to: rgb(6 182 212 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-green-400{--tw-gradient-from: #31C48D var(--tw-gradient-from-position);--tw-gradient-to: rgb(49 196 141 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-green-500{--tw-gradient-from: #0E9F6E var(--tw-gradient-from-position);--tw-gradient-to: rgb(14 159 110 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-lime-500{--tw-gradient-from: #84cc16 var(--tw-gradient-from-position);--tw-gradient-to: rgb(132 204 22 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-pink-500{--tw-gradient-from: #E74694 var(--tw-gradient-from-position);--tw-gradient-to: rgb(231 70 148 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-500{--tw-gradient-from: #9061F9 var(--tw-gradient-from-position);--tw-gradient-to: rgb(144 97 249 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-600{--tw-gradient-from: #7E3AF2 var(--tw-gradient-from-position);--tw-gradient-to: rgb(126 58 242 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-red-200{--tw-gradient-from: #FBD5D5 var(--tw-gradient-from-position);--tw-gradient-to: rgb(251 213 213 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-red-500{--tw-gradient-from: #F05252 var(--tw-gradient-from-position);--tw-gradient-to: rgb(240 82 82 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-teal-200{--tw-gradient-from: #AFECEF var(--tw-gradient-from-position);--tw-gradient-to: rgb(175 236 239 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-teal-300{--tw-gradient-from: #7EDCE2 var(--tw-gradient-from-position);--tw-gradient-to: rgb(126 220 226 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-teal-500{--tw-gradient-from: #0694A2 var(--tw-gradient-from-position);--tw-gradient-to: rgb(6 148 162 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-5\%{--tw-gradient-from-position: 5%}.via-bg-light{--tw-gradient-to: rgb(226 237 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #e2edff var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-blue-600{--tw-gradient-to: rgb(28 100 242 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #1C64F2 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-cyan-600{--tw-gradient-to: rgb(8 145 178 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #0891b2 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-green-600{--tw-gradient-to: rgb(5 122 85 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #057A55 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-lime-600{--tw-gradient-to: rgb(101 163 13 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #65a30d var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-pink-600{--tw-gradient-to: rgb(214 31 105 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #D61F69 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-purple-600{--tw-gradient-to: rgb(126 58 242 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #7E3AF2 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-red-300{--tw-gradient-to: rgb(248 180 180 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #F8B4B4 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-red-600{--tw-gradient-to: rgb(224 36 36 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #E02424 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-teal-600{--tw-gradient-to: rgb(4 116 129 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #047481 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-10\%{--tw-gradient-via-position: 10%}.to-blue-500{--tw-gradient-to: #3F83F8 var(--tw-gradient-to-position)}.to-blue-600{--tw-gradient-to: #1C64F2 var(--tw-gradient-to-position)}.to-blue-700{--tw-gradient-to: #1A56DB var(--tw-gradient-to-position)}.to-cyan-700{--tw-gradient-to: #0e7490 var(--tw-gradient-to-position)}.to-green-700{--tw-gradient-to: #046C4E var(--tw-gradient-to-position)}.to-lime-200{--tw-gradient-to: #d9f99d var(--tw-gradient-to-position)}.to-lime-300{--tw-gradient-to: #bef264 var(--tw-gradient-to-position)}.to-lime-700{--tw-gradient-to: #4d7c0f var(--tw-gradient-to-position)}.to-orange-400{--tw-gradient-to: #FF8A4C var(--tw-gradient-to-position)}.to-pink-500{--tw-gradient-to: #E74694 var(--tw-gradient-to-position)}.to-pink-700{--tw-gradient-to: #BF125D var(--tw-gradient-to-position)}.to-purple-700{--tw-gradient-to: #6C2BD9 var(--tw-gradient-to-position)}.to-red-700{--tw-gradient-to: #C81E1E var(--tw-gradient-to-position)}.to-teal-700{--tw-gradient-to: #036672 var(--tw-gradient-to-position)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.to-yellow-200{--tw-gradient-to: #FCE96A var(--tw-gradient-to-position)}.to-100\%{--tw-gradient-to-position: 100%}.fill-blue-600{fill:#1c64f2}.fill-gray-300{fill:#d1d5db}.fill-gray-600{fill:#4b5563}.fill-green-500{fill:#0e9f6e}.fill-pink-600{fill:#d61f69}.fill-purple-600{fill:#7e3af2}.fill-red-600{fill:#e02424}.fill-secondary{fill:#0fd974}.fill-white{fill:#fff}.fill-yellow-400{fill:#e3a008}.object-cover{-o-object-fit:cover;object-fit:cover}.object-fill{-o-object-fit:fill;object-fit:fill}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-10{padding:2.5rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-0{padding-bottom:0}.pb-2{padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pl-10{padding-left:2.5rem}.pl-2{padding-left:.5rem}.pl-3{padding-left:.75rem}.pl-4{padding-left:1rem}.pr-10{padding-right:2.5rem}.pr-2{padding-right:.5rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pt-0{padding-top:0}.pt-16{padding-top:4rem}.pt-2{padding-top:.5rem}.pt-24{padding-top:6rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.align-bottom{vertical-align:bottom}.font-sans{font-family:PTSans,Roboto,sans-serif}.text-2xl{font-size:1.5rem;line-height:2rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-5xl{font-size:3rem;line-height:1}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.font-thin{font-weight:100}.uppercase{text-transform:uppercase}.leading-6{line-height:1.5rem}.leading-9{line-height:2.25rem}.leading-none{line-height:1}.leading-normal{line-height:1.5}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.text-blue-100{--tw-text-opacity: 1;color:rgb(225 239 254 / var(--tw-text-opacity))}.text-blue-400{--tw-text-opacity: 1;color:rgb(118 169 250 / var(--tw-text-opacity))}.text-blue-500{--tw-text-opacity: 1;color:rgb(63 131 248 / var(--tw-text-opacity))}.text-blue-600{--tw-text-opacity: 1;color:rgb(28 100 242 / var(--tw-text-opacity))}.text-blue-700{--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 66 159 / var(--tw-text-opacity))}.text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.text-green-200{--tw-text-opacity: 1;color:rgb(188 240 218 / var(--tw-text-opacity))}.text-green-500{--tw-text-opacity: 1;color:rgb(14 159 110 / var(--tw-text-opacity))}.text-green-600{--tw-text-opacity: 1;color:rgb(5 122 85 / var(--tw-text-opacity))}.text-green-700{--tw-text-opacity: 1;color:rgb(4 108 78 / var(--tw-text-opacity))}.text-green-800{--tw-text-opacity: 1;color:rgb(3 84 63 / var(--tw-text-opacity))}.text-green-900{--tw-text-opacity: 1;color:rgb(1 71 55 / var(--tw-text-opacity))}.text-indigo-500{--tw-text-opacity: 1;color:rgb(104 117 245 / var(--tw-text-opacity))}.text-indigo-700{--tw-text-opacity: 1;color:rgb(81 69 205 / var(--tw-text-opacity))}.text-indigo-800{--tw-text-opacity: 1;color:rgb(66 56 157 / var(--tw-text-opacity))}.text-indigo-900{--tw-text-opacity: 1;color:rgb(54 47 120 / var(--tw-text-opacity))}.text-orange-200{--tw-text-opacity: 1;color:rgb(252 217 189 / var(--tw-text-opacity))}.text-orange-500{--tw-text-opacity: 1;color:rgb(255 90 31 / var(--tw-text-opacity))}.text-pink-500{--tw-text-opacity: 1;color:rgb(231 70 148 / var(--tw-text-opacity))}.text-pink-600{--tw-text-opacity: 1;color:rgb(214 31 105 / var(--tw-text-opacity))}.text-pink-700{--tw-text-opacity: 1;color:rgb(191 18 93 / var(--tw-text-opacity))}.text-pink-800{--tw-text-opacity: 1;color:rgb(153 21 75 / var(--tw-text-opacity))}.text-pink-900{--tw-text-opacity: 1;color:rgb(117 26 61 / var(--tw-text-opacity))}.text-purple-500{--tw-text-opacity: 1;color:rgb(144 97 249 / var(--tw-text-opacity))}.text-purple-600{--tw-text-opacity: 1;color:rgb(126 58 242 / var(--tw-text-opacity))}.text-purple-700{--tw-text-opacity: 1;color:rgb(108 43 217 / var(--tw-text-opacity))}.text-purple-800{--tw-text-opacity: 1;color:rgb(85 33 181 / var(--tw-text-opacity))}.text-purple-900{--tw-text-opacity: 1;color:rgb(74 29 150 / var(--tw-text-opacity))}.text-red-200{--tw-text-opacity: 1;color:rgb(251 213 213 / var(--tw-text-opacity))}.text-red-400{--tw-text-opacity: 1;color:rgb(249 128 128 / var(--tw-text-opacity))}.text-red-500{--tw-text-opacity: 1;color:rgb(240 82 82 / var(--tw-text-opacity))}.text-red-600{--tw-text-opacity: 1;color:rgb(224 36 36 / var(--tw-text-opacity))}.text-red-700{--tw-text-opacity: 1;color:rgb(200 30 30 / var(--tw-text-opacity))}.text-red-800{--tw-text-opacity: 1;color:rgb(155 28 28 / var(--tw-text-opacity))}.text-red-900{--tw-text-opacity: 1;color:rgb(119 29 29 / var(--tw-text-opacity))}.text-secondary{--tw-text-opacity: 1;color:rgb(15 217 116 / var(--tw-text-opacity))}.text-slate-50{--tw-text-opacity: 1;color:rgb(248 250 252 / var(--tw-text-opacity))}.text-slate-950{--tw-text-opacity: 1;color:rgb(2 6 23 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(227 160 8 / var(--tw-text-opacity))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(194 120 3 / var(--tw-text-opacity))}.text-yellow-700{--tw-text-opacity: 1;color:rgb(142 75 16 / var(--tw-text-opacity))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(114 59 19 / var(--tw-text-opacity))}.text-yellow-900{--tw-text-opacity: 1;color:rgb(99 49 18 / var(--tw-text-opacity))}.text-opacity-95{--tw-text-opacity: .95}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-20{opacity:.2}.opacity-30{opacity:.3}.opacity-50{opacity:.5}.opacity-80{opacity:.8}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-inner{--tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / .05);--tw-shadow-colored: inset 0 2px 4px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-blue-500\/50{--tw-shadow-color: rgb(63 131 248 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-blue-800\/80{--tw-shadow-color: rgb(30 66 159 / .8);--tw-shadow: var(--tw-shadow-colored)}.shadow-cyan-500\/50{--tw-shadow-color: rgb(6 182 212 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-cyan-800\/80{--tw-shadow-color: rgb(21 94 117 / .8);--tw-shadow: var(--tw-shadow-colored)}.shadow-green-500\/50{--tw-shadow-color: rgb(14 159 110 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-green-800\/80{--tw-shadow-color: rgb(3 84 63 / .8);--tw-shadow: var(--tw-shadow-colored)}.shadow-lime-500\/50{--tw-shadow-color: rgb(132 204 22 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-lime-800\/80{--tw-shadow-color: rgb(63 98 18 / .8);--tw-shadow: var(--tw-shadow-colored)}.shadow-pink-500\/50{--tw-shadow-color: rgb(231 70 148 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-pink-800\/80{--tw-shadow-color: rgb(153 21 75 / .8);--tw-shadow: var(--tw-shadow-colored)}.shadow-purple-500\/50{--tw-shadow-color: rgb(144 97 249 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-purple-800\/80{--tw-shadow-color: rgb(85 33 181 / .8);--tw-shadow: var(--tw-shadow-colored)}.shadow-red-500\/50{--tw-shadow-color: rgb(240 82 82 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-red-800\/80{--tw-shadow-color: rgb(155 28 28 / .8);--tw-shadow: var(--tw-shadow-colored)}.shadow-teal-500\/50{--tw-shadow-color: rgb(6 148 162 / .5);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-blue-800{--tw-ring-opacity: 1;--tw-ring-color: rgb(30 66 159 / var(--tw-ring-opacity))}.ring-cyan-800{--tw-ring-opacity: 1;--tw-ring-color: rgb(21 94 117 / var(--tw-ring-opacity))}.ring-gray-300{--tw-ring-opacity: 1;--tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity))}.ring-gray-600{--tw-ring-opacity: 1;--tw-ring-color: rgb(75 85 99 / var(--tw-ring-opacity))}.ring-gray-800{--tw-ring-opacity: 1;--tw-ring-color: rgb(31 41 55 / var(--tw-ring-opacity))}.ring-green-800{--tw-ring-opacity: 1;--tw-ring-color: rgb(3 84 63 / var(--tw-ring-opacity))}.ring-pink-800{--tw-ring-opacity: 1;--tw-ring-color: rgb(153 21 75 / var(--tw-ring-opacity))}.ring-pink-900{--tw-ring-opacity: 1;--tw-ring-color: rgb(117 26 61 / var(--tw-ring-opacity))}.ring-purple-800{--tw-ring-opacity: 1;--tw-ring-color: rgb(85 33 181 / var(--tw-ring-opacity))}.ring-purple-900{--tw-ring-opacity: 1;--tw-ring-color: rgb(74 29 150 / var(--tw-ring-opacity))}.ring-red-400{--tw-ring-opacity: 1;--tw-ring-color: rgb(249 128 128 / var(--tw-ring-opacity))}.ring-red-900{--tw-ring-opacity: 1;--tw-ring-color: rgb(119 29 29 / var(--tw-ring-opacity))}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.drop-shadow-md{--tw-drop-shadow: drop-shadow(0 4px 3px rgb(0 0 0 / .07)) drop-shadow(0 2px 2px rgb(0 0 0 / .06));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.drop-shadow-sm{--tw-drop-shadow: drop-shadow(0 1px 1px rgb(0 0 0 / .05));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.grayscale{--tw-grayscale: grayscale(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.grayscale-0{--tw-grayscale: grayscale(0);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.duration-75{transition-duration:75ms}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.scrollbar{scrollbar-color:var(--scrollbar-thumb, initial) var(--scrollbar-track, initial)}.scrollbar::-webkit-scrollbar-track{background-color:var(--scrollbar-track);border-radius:var(--scrollbar-track-radius)}.scrollbar::-webkit-scrollbar-track:hover{background-color:var(--scrollbar-track-hover, var(--scrollbar-track))}.scrollbar::-webkit-scrollbar-track:active{background-color:var(--scrollbar-track-active, var(--scrollbar-track-hover, var(--scrollbar-track)))}.scrollbar::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb);border-radius:var(--scrollbar-thumb-radius)}.scrollbar::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover, var(--scrollbar-thumb))}.scrollbar::-webkit-scrollbar-thumb:active{background-color:var(--scrollbar-thumb-active, var(--scrollbar-thumb-hover, var(--scrollbar-thumb)))}.scrollbar::-webkit-scrollbar-corner{background-color:var(--scrollbar-corner);border-radius:var(--scrollbar-corner-radius)}.scrollbar::-webkit-scrollbar-corner:hover{background-color:var(--scrollbar-corner-hover, var(--scrollbar-corner))}.scrollbar::-webkit-scrollbar-corner:active{background-color:var(--scrollbar-corner-active, var(--scrollbar-corner-hover, var(--scrollbar-corner)))}.scrollbar{scrollbar-width:auto}.scrollbar::-webkit-scrollbar{display:block;width:var(--scrollbar-width, 16px);height:var(--scrollbar-height, 16px)}.scrollbar-thin{scrollbar-color:var(--scrollbar-thumb, initial) var(--scrollbar-track, initial)}.scrollbar-thin::-webkit-scrollbar-track{background-color:var(--scrollbar-track);border-radius:var(--scrollbar-track-radius)}.scrollbar-thin::-webkit-scrollbar-track:hover{background-color:var(--scrollbar-track-hover, var(--scrollbar-track))}.scrollbar-thin::-webkit-scrollbar-track:active{background-color:var(--scrollbar-track-active, var(--scrollbar-track-hover, var(--scrollbar-track)))}.scrollbar-thin::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb);border-radius:var(--scrollbar-thumb-radius)}.scrollbar-thin::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover, var(--scrollbar-thumb))}.scrollbar-thin::-webkit-scrollbar-thumb:active{background-color:var(--scrollbar-thumb-active, var(--scrollbar-thumb-hover, var(--scrollbar-thumb)))}.scrollbar-thin::-webkit-scrollbar-corner{background-color:var(--scrollbar-corner);border-radius:var(--scrollbar-corner-radius)}.scrollbar-thin::-webkit-scrollbar-corner:hover{background-color:var(--scrollbar-corner-hover, var(--scrollbar-corner))}.scrollbar-thin::-webkit-scrollbar-corner:active{background-color:var(--scrollbar-corner-active, var(--scrollbar-corner-hover, var(--scrollbar-corner)))}.scrollbar-thin{scrollbar-width:thin}.scrollbar-thin::-webkit-scrollbar{display:block;width:8px;height:8px}.scrollbar-track-bg-light{--scrollbar-track: #e2edff !important}.scrollbar-track-bg-light-tone{--scrollbar-track: #b9d2f7 !important}.scrollbar-thumb-bg-light-tone{--scrollbar-thumb: #b9d2f7 !important}.scrollbar-thumb-bg-light-tone-panel{--scrollbar-thumb: #8fb5ef !important}.no-scrollbar::-webkit-scrollbar{display:none}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}.display-none{display:none}h1{font-size:36px;font-weight:700}h2{font-size:24px;font-weight:700}h3{font-size:18px;font-weight:700}h4{font-size:18px;font-style:italic}p{font-size:16px;word-wrap:break-word;overflow-wrap:break-word;white-space:normal}ul{list-style-type:disc;margin-left:0}li{list-style-type:disc;margin-left:20px}ol{list-style-type:decimal;margin-left:20px}.odd\:bg-bg-light-tone:nth-child(odd){--tw-bg-opacity: 1;background-color:rgb(185 210 247 / var(--tw-bg-opacity))}.even\:bg-bg-light-discussion-odd:nth-child(2n){--tw-bg-opacity: 1;background-color:rgb(214 231 255 / var(--tw-bg-opacity))}.even\:bg-bg-light-tone-panel:nth-child(2n){--tw-bg-opacity: 1;background-color:rgb(143 181 239 / var(--tw-bg-opacity))}.group\/avatar:hover .group-hover\/avatar\:visible,.group:hover .group-hover\:visible{visibility:visible}.group:hover .group-hover\:block{display:block}.group:hover .group-hover\:-translate-y-10{--tw-translate-y: -2.5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:border-secondary{--tw-border-opacity: 1;border-color:rgb(15 217 116 / var(--tw-border-opacity))}.group:hover .group-hover\:bg-white\/50{background-color:#ffffff80}.group:hover .group-hover\:bg-opacity-0{--tw-bg-opacity: 0}.group:hover .group-hover\:from-cyan-500{--tw-gradient-from: #06b6d4 var(--tw-gradient-from-position);--tw-gradient-to: rgb(6 182 212 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.group:hover .group-hover\:from-green-400{--tw-gradient-from: #31C48D var(--tw-gradient-from-position);--tw-gradient-to: rgb(49 196 141 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.group:hover .group-hover\:from-pink-500{--tw-gradient-from: #E74694 var(--tw-gradient-from-position);--tw-gradient-to: rgb(231 70 148 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.group:hover .group-hover\:from-purple-500{--tw-gradient-from: #9061F9 var(--tw-gradient-from-position);--tw-gradient-to: rgb(144 97 249 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.group:hover .group-hover\:from-purple-600{--tw-gradient-from: #7E3AF2 var(--tw-gradient-from-position);--tw-gradient-to: rgb(126 58 242 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.group:hover .group-hover\:from-red-200{--tw-gradient-from: #FBD5D5 var(--tw-gradient-from-position);--tw-gradient-to: rgb(251 213 213 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.group:hover .group-hover\:from-teal-300{--tw-gradient-from: #7EDCE2 var(--tw-gradient-from-position);--tw-gradient-to: rgb(126 220 226 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.group:hover .group-hover\:via-red-300{--tw-gradient-to: rgb(248 180 180 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #F8B4B4 var(--tw-gradient-via-position), var(--tw-gradient-to)}.group:hover .group-hover\:to-blue-500{--tw-gradient-to: #3F83F8 var(--tw-gradient-to-position)}.group:hover .group-hover\:to-blue-600{--tw-gradient-to: #1C64F2 var(--tw-gradient-to-position)}.group:hover .group-hover\:to-lime-300{--tw-gradient-to: #bef264 var(--tw-gradient-to-position)}.group:hover .group-hover\:to-orange-400{--tw-gradient-to: #FF8A4C var(--tw-gradient-to-position)}.group:hover .group-hover\:to-pink-500{--tw-gradient-to: #E74694 var(--tw-gradient-to-position)}.group:hover .group-hover\:to-yellow-200{--tw-gradient-to: #FCE96A var(--tw-gradient-to-position)}.group:hover .group-hover\:text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.group\/avatar:hover .group-hover\/avatar\:opacity-100,.group:hover .group-hover\:opacity-100{opacity:1}.group:focus .group-focus\:outline-none{outline:2px solid transparent;outline-offset:2px}.group:focus .group-focus\:ring-4{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.group:focus .group-focus\:ring-white{--tw-ring-opacity: 1;--tw-ring-color: rgb(255 255 255 / var(--tw-ring-opacity))}.peer:checked~.peer-checked\:text-primary{--tw-text-opacity: 1;color:rgb(14 142 240 / var(--tw-text-opacity))}.hover\:z-10:hover{z-index:10}.hover\:z-20:hover{z-index:20}.hover\:block:hover{display:block}.hover\:h-8:hover{height:2rem}.hover\:-translate-y-2:hover{--tw-translate-y: -.5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-95:hover{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border-2:hover{border-width:2px}.hover\:border-solid:hover{border-style:solid}.hover\:border-gray-300:hover{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.hover\:border-gray-600:hover{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity))}.hover\:border-green-200:hover{--tw-border-opacity: 1;border-color:rgb(188 240 218 / var(--tw-border-opacity))}.hover\:border-primary:hover{--tw-border-opacity: 1;border-color:rgb(14 142 240 / var(--tw-border-opacity))}.hover\:border-primary-light:hover{--tw-border-opacity: 1;border-color:rgb(61 171 255 / var(--tw-border-opacity))}.hover\:border-secondary:hover{--tw-border-opacity: 1;border-color:rgb(15 217 116 / var(--tw-border-opacity))}.hover\:bg-bg-light-tone:hover{--tw-bg-opacity: 1;background-color:rgb(185 210 247 / var(--tw-bg-opacity))}.hover\:bg-bg-light-tone-panel:hover{--tw-bg-opacity: 1;background-color:rgb(143 181 239 / var(--tw-bg-opacity))}.hover\:bg-blue-100:hover{--tw-bg-opacity: 1;background-color:rgb(225 239 254 / var(--tw-bg-opacity))}.hover\:bg-blue-200:hover{--tw-bg-opacity: 1;background-color:rgb(195 221 253 / var(--tw-bg-opacity))}.hover\:bg-blue-300:hover{--tw-bg-opacity: 1;background-color:rgb(164 202 254 / var(--tw-bg-opacity))}.hover\:bg-blue-400:hover{--tw-bg-opacity: 1;background-color:rgb(118 169 250 / var(--tw-bg-opacity))}.hover\:bg-blue-600:hover{--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity))}.hover\:bg-blue-800:hover{--tw-bg-opacity: 1;background-color:rgb(30 66 159 / var(--tw-bg-opacity))}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.hover\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.hover\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.hover\:bg-gray-600:hover{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}.hover\:bg-gray-900:hover{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.hover\:bg-green-200:hover{--tw-bg-opacity: 1;background-color:rgb(188 240 218 / var(--tw-bg-opacity))}.hover\:bg-green-600:hover{--tw-bg-opacity: 1;background-color:rgb(5 122 85 / var(--tw-bg-opacity))}.hover\:bg-green-700:hover{--tw-bg-opacity: 1;background-color:rgb(4 108 78 / var(--tw-bg-opacity))}.hover\:bg-green-800:hover{--tw-bg-opacity: 1;background-color:rgb(3 84 63 / var(--tw-bg-opacity))}.hover\:bg-pink-800:hover{--tw-bg-opacity: 1;background-color:rgb(153 21 75 / var(--tw-bg-opacity))}.hover\:bg-primary:hover{--tw-bg-opacity: 1;background-color:rgb(14 142 240 / var(--tw-bg-opacity))}.hover\:bg-primary-light:hover{--tw-bg-opacity: 1;background-color:rgb(61 171 255 / var(--tw-bg-opacity))}.hover\:bg-purple-800:hover{--tw-bg-opacity: 1;background-color:rgb(85 33 181 / var(--tw-bg-opacity))}.hover\:bg-red-200:hover{--tw-bg-opacity: 1;background-color:rgb(251 213 213 / var(--tw-bg-opacity))}.hover\:bg-red-600:hover{--tw-bg-opacity: 1;background-color:rgb(224 36 36 / var(--tw-bg-opacity))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(200 30 30 / var(--tw-bg-opacity))}.hover\:bg-red-800:hover{--tw-bg-opacity: 1;background-color:rgb(155 28 28 / var(--tw-bg-opacity))}.hover\:bg-white:hover{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.hover\:bg-yellow-200:hover{--tw-bg-opacity: 1;background-color:rgb(252 233 106 / var(--tw-bg-opacity))}.hover\:bg-yellow-500:hover{--tw-bg-opacity: 1;background-color:rgb(194 120 3 / var(--tw-bg-opacity))}.hover\:bg-gradient-to-bl:hover{background-image:linear-gradient(to bottom left,var(--tw-gradient-stops))}.hover\:bg-gradient-to-br:hover{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.hover\:bg-gradient-to-l:hover{background-image:linear-gradient(to left,var(--tw-gradient-stops))}.hover\:from-teal-200:hover{--tw-gradient-from: #AFECEF var(--tw-gradient-from-position);--tw-gradient-to: rgb(175 236 239 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:to-lime-200:hover{--tw-gradient-to: #d9f99d var(--tw-gradient-to-position)}.hover\:fill-primary:hover{fill:#0e8ef0}.hover\:text-blue-400:hover{--tw-text-opacity: 1;color:rgb(118 169 250 / var(--tw-text-opacity))}.hover\:text-blue-600:hover{--tw-text-opacity: 1;color:rgb(28 100 242 / var(--tw-text-opacity))}.hover\:text-blue-700:hover{--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity))}.hover\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.hover\:text-gray-700:hover{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.hover\:text-gray-900:hover{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.hover\:text-green-500:hover{--tw-text-opacity: 1;color:rgb(14 159 110 / var(--tw-text-opacity))}.hover\:text-primary:hover{--tw-text-opacity: 1;color:rgb(14 142 240 / var(--tw-text-opacity))}.hover\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(240 82 82 / var(--tw-text-opacity))}.hover\:text-red-600:hover{--tw-text-opacity: 1;color:rgb(224 36 36 / var(--tw-text-opacity))}.hover\:text-secondary:hover{--tw-text-opacity: 1;color:rgb(15 217 116 / var(--tw-text-opacity))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.hover\:underline:hover{text-decoration-line:underline}.hover\:no-underline:hover{text-decoration-line:none}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:scrollbar-thumb-primary{--scrollbar-thumb-hover: #0e8ef0 !important}.focus\:z-10:focus{z-index:10}.focus\:border-blue-300:focus{--tw-border-opacity: 1;border-color:rgb(164 202 254 / var(--tw-border-opacity))}.focus\:border-blue-500:focus{--tw-border-opacity: 1;border-color:rgb(63 131 248 / var(--tw-border-opacity))}.focus\:border-secondary:focus{--tw-border-opacity: 1;border-color:rgb(15 217 116 / var(--tw-border-opacity))}.focus\:text-blue-700:focus{--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-4:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-blue-200:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(195 221 253 / var(--tw-ring-opacity))}.focus\:ring-blue-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(164 202 254 / var(--tw-ring-opacity))}.focus\:ring-blue-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(118 169 250 / var(--tw-ring-opacity))}.focus\:ring-blue-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(63 131 248 / var(--tw-ring-opacity))}.focus\:ring-blue-700:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(26 86 219 / var(--tw-ring-opacity))}.focus\:ring-cyan-200:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(165 243 252 / var(--tw-ring-opacity))}.focus\:ring-cyan-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(103 232 249 / var(--tw-ring-opacity))}.focus\:ring-gray-200:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(229 231 235 / var(--tw-ring-opacity))}.focus\:ring-gray-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity))}.focus\:ring-gray-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(156 163 175 / var(--tw-ring-opacity))}.focus\:ring-green-200:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(188 240 218 / var(--tw-ring-opacity))}.focus\:ring-green-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(132 225 188 / var(--tw-ring-opacity))}.focus\:ring-green-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(49 196 141 / var(--tw-ring-opacity))}.focus\:ring-lime-200:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(217 249 157 / var(--tw-ring-opacity))}.focus\:ring-lime-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(190 242 100 / var(--tw-ring-opacity))}.focus\:ring-pink-200:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(250 209 232 / var(--tw-ring-opacity))}.focus\:ring-pink-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(248 180 217 / var(--tw-ring-opacity))}.focus\:ring-purple-200:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(220 215 254 / var(--tw-ring-opacity))}.focus\:ring-purple-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(202 191 253 / var(--tw-ring-opacity))}.focus\:ring-red-100:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(253 232 232 / var(--tw-ring-opacity))}.focus\:ring-red-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(248 180 180 / var(--tw-ring-opacity))}.focus\:ring-red-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(249 128 128 / var(--tw-ring-opacity))}.focus\:ring-secondary:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(15 217 116 / var(--tw-ring-opacity))}.focus\:ring-teal-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(126 220 226 / var(--tw-ring-opacity))}.focus\:ring-yellow-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(250 202 21 / var(--tw-ring-opacity))}.focus\:ring-yellow-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(227 160 8 / var(--tw-ring-opacity))}.active\:scale-75:active{--tw-scale-x: .75;--tw-scale-y: .75;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\:scale-90:active{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\:scrollbar-thumb-secondary{--scrollbar-thumb-active: #0fd974 !important}:is(.dark .dark\:divide-gray-700)>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(55 65 81 / var(--tw-divide-opacity))}:is(.dark .dark\:border-bg-light){--tw-border-opacity: 1;border-color:rgb(226 237 255 / var(--tw-border-opacity))}:is(.dark .dark\:border-blue-500){--tw-border-opacity: 1;border-color:rgb(63 131 248 / var(--tw-border-opacity))}:is(.dark .dark\:border-gray-500){--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity))}:is(.dark .dark\:border-gray-600){--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity))}:is(.dark .dark\:border-gray-700){--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity))}:is(.dark .dark\:border-gray-800){--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity))}:is(.dark .dark\:border-gray-900){--tw-border-opacity: 1;border-color:rgb(17 24 39 / var(--tw-border-opacity))}:is(.dark .dark\:border-green-500){--tw-border-opacity: 1;border-color:rgb(14 159 110 / var(--tw-border-opacity))}:is(.dark .dark\:border-pink-400){--tw-border-opacity: 1;border-color:rgb(241 126 184 / var(--tw-border-opacity))}:is(.dark .dark\:border-pink-500){--tw-border-opacity: 1;border-color:rgb(231 70 148 / var(--tw-border-opacity))}:is(.dark .dark\:border-purple-400){--tw-border-opacity: 1;border-color:rgb(172 148 250 / var(--tw-border-opacity))}:is(.dark .dark\:border-purple-500){--tw-border-opacity: 1;border-color:rgb(144 97 249 / var(--tw-border-opacity))}:is(.dark .dark\:border-red-500){--tw-border-opacity: 1;border-color:rgb(240 82 82 / var(--tw-border-opacity))}:is(.dark .dark\:border-transparent){border-color:transparent}:is(.dark .dark\:border-yellow-300){--tw-border-opacity: 1;border-color:rgb(250 202 21 / var(--tw-border-opacity))}:is(.dark .dark\:bg-bg-dark){--tw-bg-opacity: 1;background-color:rgb(19 46 89 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-bg-dark-discussion){--tw-bg-opacity: 1;background-color:rgb(67 94 138 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-bg-dark-tone){--tw-bg-opacity: 1;background-color:rgb(37 71 125 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-bg-dark-tone-panel){--tw-bg-opacity: 1;background-color:rgb(67 103 163 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-black){--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-blue-200){--tw-bg-opacity: 1;background-color:rgb(195 221 253 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-blue-500){--tw-bg-opacity: 1;background-color:rgb(63 131 248 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-blue-600){--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-blue-700){--tw-bg-opacity: 1;background-color:rgb(26 86 219 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-blue-800){--tw-bg-opacity: 1;background-color:rgb(30 66 159 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-blue-900){--tw-bg-opacity: 1;background-color:rgb(35 56 118 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-300){--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-400){--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-500){--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-600){--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-700){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-800){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-800\/30){background-color:#1f29374d}:is(.dark .dark\:bg-gray-800\/50){background-color:#1f293780}:is(.dark .dark\:bg-gray-900){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-green-200){--tw-bg-opacity: 1;background-color:rgb(188 240 218 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-green-500){--tw-bg-opacity: 1;background-color:rgb(14 159 110 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-green-600){--tw-bg-opacity: 1;background-color:rgb(5 122 85 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-green-800){--tw-bg-opacity: 1;background-color:rgb(3 84 63 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-indigo-200){--tw-bg-opacity: 1;background-color:rgb(205 219 254 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-indigo-500){--tw-bg-opacity: 1;background-color:rgb(104 117 245 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-orange-700){--tw-bg-opacity: 1;background-color:rgb(180 52 3 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-orange-800){--tw-bg-opacity: 1;background-color:rgb(138 44 13 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-pink-200){--tw-bg-opacity: 1;background-color:rgb(250 209 232 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-pink-600){--tw-bg-opacity: 1;background-color:rgb(214 31 105 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-purple-200){--tw-bg-opacity: 1;background-color:rgb(220 215 254 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-purple-500){--tw-bg-opacity: 1;background-color:rgb(144 97 249 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-purple-600){--tw-bg-opacity: 1;background-color:rgb(126 58 242 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-red-200){--tw-bg-opacity: 1;background-color:rgb(251 213 213 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-red-500){--tw-bg-opacity: 1;background-color:rgb(240 82 82 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-red-600){--tw-bg-opacity: 1;background-color:rgb(224 36 36 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-red-800){--tw-bg-opacity: 1;background-color:rgb(155 28 28 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-yellow-200){--tw-bg-opacity: 1;background-color:rgb(252 233 106 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-opacity-70){--tw-bg-opacity: .7}:is(.dark .dark\:bg-opacity-80){--tw-bg-opacity: .8}:is(.dark .dark\:from-bg-dark){--tw-gradient-from: #132e59 var(--tw-gradient-from-position);--tw-gradient-to: rgb(19 46 89 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}:is(.dark .dark\:from-bg-dark-tone){--tw-gradient-from: #25477d var(--tw-gradient-from-position);--tw-gradient-to: rgb(37 71 125 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}:is(.dark .dark\:via-bg-dark){--tw-gradient-to: rgb(19 46 89 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #132e59 var(--tw-gradient-via-position), var(--tw-gradient-to)}:is(.dark .dark\:fill-gray-300){fill:#d1d5db}:is(.dark .dark\:fill-white){fill:#fff}:is(.dark .dark\:text-blue-200){--tw-text-opacity: 1;color:rgb(195 221 253 / var(--tw-text-opacity))}:is(.dark .dark\:text-blue-500){--tw-text-opacity: 1;color:rgb(63 131 248 / var(--tw-text-opacity))}:is(.dark .dark\:text-blue-800){--tw-text-opacity: 1;color:rgb(30 66 159 / var(--tw-text-opacity))}:is(.dark .dark\:text-gray-200){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}:is(.dark .dark\:text-gray-300){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}:is(.dark .dark\:text-gray-400){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}:is(.dark .dark\:text-gray-500){--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}:is(.dark .dark\:text-gray-600){--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}:is(.dark .dark\:text-gray-800){--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity))}:is(.dark .dark\:text-green-200){--tw-text-opacity: 1;color:rgb(188 240 218 / var(--tw-text-opacity))}:is(.dark .dark\:text-green-500){--tw-text-opacity: 1;color:rgb(14 159 110 / var(--tw-text-opacity))}:is(.dark .dark\:text-green-800){--tw-text-opacity: 1;color:rgb(3 84 63 / var(--tw-text-opacity))}:is(.dark .dark\:text-green-900){--tw-text-opacity: 1;color:rgb(1 71 55 / var(--tw-text-opacity))}:is(.dark .dark\:text-indigo-500){--tw-text-opacity: 1;color:rgb(104 117 245 / var(--tw-text-opacity))}:is(.dark .dark\:text-indigo-900){--tw-text-opacity: 1;color:rgb(54 47 120 / var(--tw-text-opacity))}:is(.dark .dark\:text-orange-200){--tw-text-opacity: 1;color:rgb(252 217 189 / var(--tw-text-opacity))}:is(.dark .dark\:text-pink-400){--tw-text-opacity: 1;color:rgb(241 126 184 / var(--tw-text-opacity))}:is(.dark .dark\:text-pink-500){--tw-text-opacity: 1;color:rgb(231 70 148 / var(--tw-text-opacity))}:is(.dark .dark\:text-pink-900){--tw-text-opacity: 1;color:rgb(117 26 61 / var(--tw-text-opacity))}:is(.dark .dark\:text-purple-400){--tw-text-opacity: 1;color:rgb(172 148 250 / var(--tw-text-opacity))}:is(.dark .dark\:text-purple-500){--tw-text-opacity: 1;color:rgb(144 97 249 / var(--tw-text-opacity))}:is(.dark .dark\:text-purple-900){--tw-text-opacity: 1;color:rgb(74 29 150 / var(--tw-text-opacity))}:is(.dark .dark\:text-red-200){--tw-text-opacity: 1;color:rgb(251 213 213 / var(--tw-text-opacity))}:is(.dark .dark\:text-red-500){--tw-text-opacity: 1;color:rgb(240 82 82 / var(--tw-text-opacity))}:is(.dark .dark\:text-red-800){--tw-text-opacity: 1;color:rgb(155 28 28 / var(--tw-text-opacity))}:is(.dark .dark\:text-red-900){--tw-text-opacity: 1;color:rgb(119 29 29 / var(--tw-text-opacity))}:is(.dark .dark\:text-slate-50){--tw-text-opacity: 1;color:rgb(248 250 252 / var(--tw-text-opacity))}:is(.dark .dark\:text-white){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}:is(.dark .dark\:text-yellow-300){--tw-text-opacity: 1;color:rgb(250 202 21 / var(--tw-text-opacity))}:is(.dark .dark\:text-yellow-500){--tw-text-opacity: 1;color:rgb(194 120 3 / var(--tw-text-opacity))}:is(.dark .dark\:text-yellow-800){--tw-text-opacity: 1;color:rgb(114 59 19 / var(--tw-text-opacity))}:is(.dark .dark\:text-yellow-900){--tw-text-opacity: 1;color:rgb(99 49 18 / var(--tw-text-opacity))}:is(.dark .dark\:placeholder-gray-400)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity))}:is(.dark .dark\:placeholder-gray-400)::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity))}:is(.dark .dark\:shadow-lg){--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}:is(.dark .dark\:shadow-blue-800\/80){--tw-shadow-color: rgb(30 66 159 / .8);--tw-shadow: var(--tw-shadow-colored)}:is(.dark .dark\:shadow-cyan-800\/80){--tw-shadow-color: rgb(21 94 117 / .8);--tw-shadow: var(--tw-shadow-colored)}:is(.dark .dark\:shadow-green-800\/80){--tw-shadow-color: rgb(3 84 63 / .8);--tw-shadow: var(--tw-shadow-colored)}:is(.dark .dark\:shadow-lime-800\/80){--tw-shadow-color: rgb(63 98 18 / .8);--tw-shadow: var(--tw-shadow-colored)}:is(.dark .dark\:shadow-pink-800\/80){--tw-shadow-color: rgb(153 21 75 / .8);--tw-shadow: var(--tw-shadow-colored)}:is(.dark .dark\:shadow-purple-800\/80){--tw-shadow-color: rgb(85 33 181 / .8);--tw-shadow: var(--tw-shadow-colored)}:is(.dark .dark\:shadow-red-800\/80){--tw-shadow-color: rgb(155 28 28 / .8);--tw-shadow: var(--tw-shadow-colored)}:is(.dark .dark\:shadow-teal-800\/80){--tw-shadow-color: rgb(5 80 92 / .8);--tw-shadow: var(--tw-shadow-colored)}:is(.dark .dark\:ring-gray-500){--tw-ring-opacity: 1;--tw-ring-color: rgb(107 114 128 / var(--tw-ring-opacity))}:is(.dark .dark\:ring-offset-gray-700){--tw-ring-offset-color: #374151}:is(.dark .dark\:ring-offset-gray-800){--tw-ring-offset-color: #1F2937}:is(.dark .dark\:scrollbar-track-bg-dark){--scrollbar-track: #132e59 !important}:is(.dark .dark\:scrollbar-track-bg-dark-tone){--scrollbar-track: #25477d !important}:is(.dark .dark\:scrollbar-thumb-bg-dark-tone){--scrollbar-thumb: #25477d !important}:is(.dark .dark\:scrollbar-thumb-bg-dark-tone-panel){--scrollbar-thumb: #4367a3 !important}:is(.dark .odd\:dark\:bg-bg-dark-tone):nth-child(odd){--tw-bg-opacity: 1;background-color:rgb(37 71 125 / var(--tw-bg-opacity))}:is(.dark .dark\:even\:bg-bg-dark-discussion-odd:nth-child(2n)){--tw-bg-opacity: 1;background-color:rgb(40 68 113 / var(--tw-bg-opacity))}:is(.dark .dark\:even\:bg-bg-dark-tone-panel:nth-child(2n)){--tw-bg-opacity: 1;background-color:rgb(67 103 163 / var(--tw-bg-opacity))}:is(.dark .group:hover .dark\:group-hover\:bg-gray-800\/60){background-color:#1f293799}:is(.dark .group:hover .dark\:group-hover\:text-white){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}:is(.dark .group:focus .dark\:group-focus\:ring-gray-800\/70){--tw-ring-color: rgb(31 41 55 / .7)}:is(.dark .dark\:hover\:border-gray-600:hover){--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity))}:is(.dark .dark\:hover\:border-primary:hover){--tw-border-opacity: 1;border-color:rgb(14 142 240 / var(--tw-border-opacity))}:is(.dark .dark\:hover\:bg-bg-dark-tone:hover){--tw-bg-opacity: 1;background-color:rgb(37 71 125 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-blue-300:hover){--tw-bg-opacity: 1;background-color:rgb(164 202 254 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-blue-600:hover){--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-blue-700:hover){--tw-bg-opacity: 1;background-color:rgb(26 86 219 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-gray-600:hover){--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-gray-700:hover){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-gray-800:hover){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-green-300:hover){--tw-bg-opacity: 1;background-color:rgb(132 225 188 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-green-600:hover){--tw-bg-opacity: 1;background-color:rgb(5 122 85 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-green-700:hover){--tw-bg-opacity: 1;background-color:rgb(4 108 78 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-pink-500:hover){--tw-bg-opacity: 1;background-color:rgb(231 70 148 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-pink-700:hover){--tw-bg-opacity: 1;background-color:rgb(191 18 93 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-primary:hover){--tw-bg-opacity: 1;background-color:rgb(14 142 240 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-purple-500:hover){--tw-bg-opacity: 1;background-color:rgb(144 97 249 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-purple-700:hover){--tw-bg-opacity: 1;background-color:rgb(108 43 217 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-red-300:hover){--tw-bg-opacity: 1;background-color:rgb(248 180 180 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-red-600:hover){--tw-bg-opacity: 1;background-color:rgb(224 36 36 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-red-700:hover){--tw-bg-opacity: 1;background-color:rgb(200 30 30 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-yellow-300:hover){--tw-bg-opacity: 1;background-color:rgb(250 202 21 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-yellow-400:hover){--tw-bg-opacity: 1;background-color:rgb(227 160 8 / var(--tw-bg-opacity))}:is(.dark .hover\:dark\:bg-bg-dark-tone):hover{--tw-bg-opacity: 1;background-color:rgb(37 71 125 / var(--tw-bg-opacity))}:is(.dark .hover\:dark\:bg-bg-dark-tone-panel):hover{--tw-bg-opacity: 1;background-color:rgb(67 103 163 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:fill-primary:hover){fill:#0e8ef0}:is(.dark .dark\:hover\:text-blue-500:hover){--tw-text-opacity: 1;color:rgb(63 131 248 / var(--tw-text-opacity))}:is(.dark .dark\:hover\:text-gray-300:hover){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}:is(.dark .dark\:hover\:text-gray-900:hover){--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}:is(.dark .dark\:hover\:text-white:hover){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}:is(.dark .dark\:hover\:scrollbar-thumb-primary){--scrollbar-thumb-hover: #0e8ef0 !important}:is(.dark .dark\:focus\:border-blue-500:focus){--tw-border-opacity: 1;border-color:rgb(63 131 248 / var(--tw-border-opacity))}:is(.dark .dark\:focus\:border-secondary:focus){--tw-border-opacity: 1;border-color:rgb(15 217 116 / var(--tw-border-opacity))}:is(.dark .dark\:focus\:text-white:focus){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}:is(.dark .dark\:focus\:ring-blue-500:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(63 131 248 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-blue-600:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(28 100 242 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-blue-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(30 66 159 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-cyan-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(21 94 117 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-gray-500:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(107 114 128 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-gray-600:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(75 85 99 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-gray-700:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(55 65 81 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-gray-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(31 41 55 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-green-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(3 84 63 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-lime-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(63 98 18 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-pink-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(153 21 75 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-pink-900:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(117 26 61 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-purple-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(85 33 181 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-purple-900:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(74 29 150 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-red-400:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(249 128 128 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-red-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(155 28 28 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-red-900:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(119 29 29 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-secondary:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(15 217 116 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-teal-700:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(3 102 114 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-teal-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(5 80 92 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-yellow-900:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(99 49 18 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-offset-gray-700:focus){--tw-ring-offset-color: #374151}@media (min-width: 640px){.sm\:mt-0{margin-top:0}.sm\:h-10{height:2.5rem}.sm\:h-6{height:1.5rem}.sm\:h-64{height:16rem}.sm\:w-1\/4{width:25%}.sm\:w-10{width:2.5rem}.sm\:w-6{width:1.5rem}.sm\:w-auto{width:auto}.sm\:flex-row{flex-direction:row}.sm\:rounded-lg{border-radius:.5rem}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:text-center{text-align:center}.sm\:text-xs{font-size:.75rem;line-height:1rem}}@media (min-width: 768px){.md\:inset-0{top:0;right:0;bottom:0;left:0}.md\:order-2{order:2}.md\:my-2{margin-top:.5rem;margin-bottom:.5rem}.md\:mr-6{margin-right:1.5rem}.md\:mt-0{margin-top:0}.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:h-auto{height:auto}.md\:h-full{height:100%}.md\:w-1\/4{width:25%}.md\:w-48{width:12rem}.md\:w-auto{width:auto}.md\:max-w-xl{max-width:36rem}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:items-center{align-items:center}.md\:justify-between{justify-content:space-between}.md\:space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * calc(1 - var(--tw-space-x-reverse)))}.md\:space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(2rem * var(--tw-space-x-reverse));margin-left:calc(2rem * calc(1 - var(--tw-space-x-reverse)))}.md\:rounded-none{border-radius:0}.md\:rounded-l-lg{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.md\:border-0{border-width:0px}.md\:bg-transparent{background-color:transparent}.md\:p-0{padding:0}.md\:p-6{padding:1.5rem}.md\:text-sm{font-size:.875rem;line-height:1.25rem}.md\:font-medium{font-weight:500}.md\:text-blue-700{--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity))}.md\:hover\:bg-transparent:hover{background-color:transparent}.md\:hover\:text-blue-700:hover{--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity))}:is(.dark .md\:dark\:bg-gray-900){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}:is(.dark .md\:dark\:hover\:bg-transparent:hover){background-color:transparent}:is(.dark .md\:dark\:hover\:text-white:hover){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}}@media (min-width: 1024px){.lg\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}}@media (min-width: 1280px){.xl\:h-80{height:20rem}.xl\:w-1\/6{width:16.666667%}}@media (min-width: 1536px){.\32xl\:h-96{height:24rem}} +*/.hljs-meta,.hljs-comment{color:#565f89}.hljs-tag,.hljs-doctag,.hljs-selector-id,.hljs-selector-class,.hljs-regexp,.hljs-template-tag,.hljs-selector-pseudo,.hljs-selector-attr,.hljs-variable.language_,.hljs-deletion{color:#f7768e}.hljs-variable,.hljs-template-variable,.hljs-number,.hljs-literal,.hljs-type,.hljs-params,.hljs-link{color:#ff9e64}.hljs-built_in,.hljs-attribute{color:#e0af68}.hljs-selector-tag{color:#2ac3de}.hljs-keyword,.hljs-title.function_,.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-subst,.hljs-property{color:#7dcfff}.hljs-selector-tag{color:#73daca}.hljs-quote,.hljs-string,.hljs-symbol,.hljs-bullet,.hljs-addition{color:#9ece6a}.hljs-code,.hljs-formula,.hljs-section{color:#7aa2f7}.hljs-name,.hljs-keyword,.hljs-operator,.hljs-char.escape_,.hljs-attr{color:#bb9af7}.hljs-punctuation{color:#c0caf5}.hljs{background:#1a1b26;color:#9aa5ce}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.code-container{display:flex;margin:0}.line-numbers{flex-shrink:0;padding-right:5px;color:#999;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap;margin:0}.code-content{flex-grow:1;margin:0}.hovered{transition:transform .3s cubic-bezier(.175,.885,.32,1.275);transform:scale(1.1)}.active{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%)}.overlay{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#0009;pointer-events:all}select{width:200px}body{background-color:#fafafa;font-family:sans-serif}.container{margin:4px auto;width:800px}.settings{position:fixed;top:0;right:0;width:250px;background-color:#fff;z-index:1000;display:none}.settings-button{cursor:pointer;padding:10px;border:1px solid #ddd;border-radius:5px;color:#333;font-size:14px}.settings-button:hover{background-color:#eee}.settings-button:active{background-color:#ddd}.slider-container{margin-top:20px}.slider-value{display:inline-block;margin-left:10px;color:#6b7280;font-size:14px}.small-button{padding:.5rem .75rem;font-size:.875rem}.active-tab{font-weight:700}.scrollbar[data-v-b19a05a8]{scrollbar-width:thin;scrollbar-color:var(--scrollbar-thumb-color) var(--scrollbar-track-color);white-space:pre-wrap;overflow-wrap:break-word}.scrollbar[data-v-b19a05a8]::-webkit-scrollbar{width:8px}.scrollbar[data-v-b19a05a8]::-webkit-scrollbar-track{background-color:var(--scrollbar-track-color)}.scrollbar[data-v-b19a05a8]::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-color);border-radius:4px}.scrollbar[data-v-b19a05a8]::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover-color)}.menu-container{position:relative;display:inline-block}.menu-button{background-color:#007bff;color:#fff;padding:10px;border:none;cursor:pointer;border-radius:4px}.menu-list{position:absolute;background-color:#fff;color:#000;border:1px solid #ccc;border-radius:4px;box-shadow:0 2px 4px #0003;padding:10px;max-width:500px;z-index:1000}.slide-enter-active,.slide-leave-active{transition:transform .2s}.slide-enter-to,.slide-leave-from{transform:translateY(-10px)}.menu-ul{list-style:none;padding:0;margin:0}.menu-li{cursor:pointer;display:flex;align-items:center;padding:5px}.menu-icon{width:20px;height:20px;margin-right:8px}.menu-command{min-width:200px;text-align:left}.selected-choice{background-color:#bde4ff}.heartbeat-text[data-v-86c6b6d4]{font-size:24px;animation:pulsate-86c6b6d4 1.5s infinite}@keyframes pulsate-86c6b6d4{0%{transform:scale(1);opacity:1}50%{transform:scale(1.1);opacity:.7}to{transform:scale(1);opacity:1}}.list-move[data-v-86c6b6d4],.list-enter-active[data-v-86c6b6d4],.list-leave-active[data-v-86c6b6d4]{transition:all .5s ease}.list-enter-from[data-v-86c6b6d4]{transform:translatey(-30px)}.list-leave-to[data-v-86c6b6d4]{opacity:0;transform:translatey(30px)}.list-leave-active[data-v-86c6b6d4]{position:absolute}.bounce-enter-active[data-v-86c6b6d4]{animation:bounce-in-86c6b6d4 .5s}.bounce-leave-active[data-v-86c6b6d4]{animation:bounce-in-86c6b6d4 .5s reverse}@keyframes bounce-in-86c6b6d4{0%{transform:scale(0)}50%{transform:scale(1.25)}to{transform:scale(1)}}.bg-primary-light[data-v-86c6b6d4]{background-color:#0ff}.hover[data-v-86c6b6d4]:bg-primary-light:hover{background-color:#7fffd4}.font-bold[data-v-86c6b6d4]{font-weight:700}.collapsible-section{cursor:pointer;margin-bottom:10px;font-weight:700}.collapsible-section:hover{color:#1a202c}.collapsible-section .toggle-icon{margin-right:.25rem}.collapsible-section .toggle-icon i{color:#4a5568}.collapsible-section .toggle-icon i:hover{color:#1a202c}.json-viewer{max-height:300px;max-width:700px;flex:auto;overflow-y:auto;padding:10px;background-color:#f1f1f1;border:1px solid #ccc;border-radius:4px}.json-viewer .toggle-icon{cursor:pointer;margin-right:.25rem}.json-viewer .toggle-icon i{color:#4a5568}.json-viewer .toggle-icon i:hover{color:#1a202c}.expand-button{margin-left:10px;margin-right:10px;background:none;border:none;padding:0;cursor:pointer}.htmljs{background:none}.bounce-enter-active[data-v-d16a58b9]{animation:bounce-in-d16a58b9 .5s}.bounce-leave-active[data-v-d16a58b9]{animation:bounce-in-d16a58b9 .5s reverse}@keyframes bounce-in-d16a58b9{0%{transform:scale(0)}50%{transform:scale(1.25)}to{transform:scale(1)}}.custom-scrollbar[data-v-52cfa09c]::-webkit-scrollbar{width:8px}.custom-scrollbar[data-v-52cfa09c]::-webkit-scrollbar-track{background-color:#f1f1f1}.custom-scrollbar[data-v-52cfa09c]::-webkit-scrollbar-thumb{background-color:#888;border-radius:4px}.custom-scrollbar[data-v-52cfa09c]::-webkit-scrollbar-thumb:hover{background-color:#555}.menu[data-v-52cfa09c]{display:flex;flex-direction:column;align-items:center}.commands-menu-items-wrapper[data-v-52cfa09c]{position:relative;display:flex;flex-direction:column;align-items:center}.commands-menu-items-wrapper>#commands-menu-items[data-v-52cfa09c]{top:calc(-100% - 2rem)}.list-move[data-v-6b91f51b],.list-enter-active[data-v-6b91f51b],.list-leave-active[data-v-6b91f51b]{transition:all .5s ease}.list-enter-from[data-v-6b91f51b]{transform:translatey(-30px)}.list-leave-to[data-v-6b91f51b]{opacity:0;transform:translatey(30px)}.list-leave-active[data-v-6b91f51b]{position:absolute}.slide-right-enter-active[data-v-7a271009],.slide-right-leave-active[data-v-7a271009]{transition:transform .3s ease}.slide-right-enter[data-v-7a271009],.slide-right-leave-to[data-v-7a271009]{transform:translate(-100%)}.fade-and-fly-enter-active[data-v-7a271009]{animation:fade-and-fly-enter-7a271009 .5s ease}.fade-and-fly-leave-active[data-v-7a271009]{animation:fade-and-fly-leave-7a271009 .5s ease}@keyframes fade-and-fly-enter-7a271009{0%{opacity:0;transform:translateY(20px) scale(.8)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes fade-and-fly-leave-7a271009{0%{opacity:1;transform:translateY(0) scale(1)}to{opacity:0;transform:translateY(-20px) scale(1.2)}}.list-move[data-v-7a271009],.list-enter-active[data-v-7a271009],.list-leave-active[data-v-7a271009]{transition:all .5s ease}.list-enter-from[data-v-7a271009]{transform:translatey(-30px)}.list-leave-to[data-v-7a271009]{opacity:0;transform:translatey(30px)}.list-leave-active[data-v-7a271009]{position:absolute}.container{display:flex;justify-content:flex-start;align-items:flex-start;flex-wrap:wrap}.floating-frame{margin:15px;float:left;height:auto;border:1px solid #000;border-radius:4px;overflow:hidden;z-index:5000;position:fixed;cursor:move;bottom:0;right:0}.handle{width:100%;height:20px;background:#ccc;cursor:move;text-align:center}.floating-frame img{width:100%;height:auto}.controls{margin-top:10px}#webglContainer{top:0;left:0}.floating-frame2{margin:15px;width:800px;height:auto;border:1px solid #000;border-radius:4px;overflow:hidden;min-height:200px;z-index:5000}:root{--baklava-control-color-primary: #e28b46;--baklava-control-color-error: #d00000;--baklava-control-color-background: #2c3748;--baklava-control-color-foreground: white;--baklava-control-color-hover: #455670;--baklava-control-color-active: #556986;--baklava-control-color-disabled-foreground: #666c75;--baklava-control-border-radius: 3px;--baklava-sidebar-color-background: #1b202c;--baklava-sidebar-color-foreground: white;--baklava-node-color-background: #1b202c;--baklava-node-color-foreground: white;--baklava-node-color-hover: #e28c4677;--baklava-node-color-selected: var(--baklava-control-color-primary);--baklava-node-color-resize-handle: var(--baklava-control-color-background);--baklava-node-title-color-background: #151a24;--baklava-node-title-color-foreground: white;--baklava-group-node-title-color-background: #215636;--baklava-group-node-title-color-foreground: white;--baklava-node-interface-port-tooltip-color-foreground: var(--baklava-control-color-primary);--baklava-node-interface-port-tooltip-color-background: var(--baklava-editor-background-pattern-black);--baklava-node-border-radius: 6px;--baklava-color-connection-default: #737f96;--baklava-color-connection-allowed: #48bc79;--baklava-color-connection-forbidden: #bc4848;--baklava-editor-background-pattern-default: #202b3c;--baklava-editor-background-pattern-line: #263140;--baklava-editor-background-pattern-black: #263140;--baklava-context-menu-background: #1b202c;--baklava-context-menu-shadow: 0 0 8px rgba(0, 0, 0, .65);--baklava-toolbar-background: #1b202caa;--baklava-toolbar-foreground: white;--baklava-node-palette-background: #1b202caa;--baklava-node-palette-foreground: white;--baklava-visual-transition: .1s linear}.baklava-button{background-color:var(--baklava-control-color-background);color:var(--baklava-control-color-foreground);transition:background-color var(--baklava-visual-transition);border:none;padding:.45em .35em;border-radius:var(--baklava-control-border-radius);font-size:inherit;cursor:pointer;overflow-x:hidden}.baklava-button:hover{background-color:var(--baklava-control-color-hover)}.baklava-button:active{background-color:var(--baklava-control-color-primary)}.baklava-button.--block{width:100%}.baklava-checkbox{display:flex;padding:.35em 0;cursor:pointer;overflow-x:hidden;align-items:center}.baklava-checkbox .__checkmark-container{display:flex;background-color:var(--baklava-control-color-background);border-radius:var(--baklava-control-border-radius);transition:background-color var(--baklava-visual-transition);width:18px;height:18px}.baklava-checkbox:hover .__checkmark-container{background-color:var(--baklava-control-color-hover)}.baklava-checkbox:active .__checkmark-container{background-color:var(--baklava-control-color-active)}.baklava-checkbox .__checkmark{stroke-dasharray:15;stroke-dashoffset:15;stroke:var(--baklava-control-color-foreground);stroke-width:2px;fill:none;transition:stroke-dashoffset var(--baklava-visual-transition)}.baklava-checkbox.--checked .__checkmark{stroke-dashoffset:0}.baklava-checkbox.--checked .__checkmark-container{background-color:var(--baklava-control-color-primary)}.baklava-checkbox .__label{margin-left:.5rem}.baklava-context-menu{color:var(--baklava-control-color-foreground);position:absolute;display:inline-block;z-index:100;background-color:var(--baklava-context-menu-background);box-shadow:var(--baklava-context-menu-shadow);border-radius:0 0 var(--baklava-control-border-radius) var(--baklava-control-border-radius);min-width:6rem;width:-moz-max-content;width:max-content}.baklava-context-menu>.item{display:flex;align-items:center;padding:.35em 1em;transition:background .05s linear;position:relative}.baklava-context-menu>.item>.__label{flex:1 1 auto}.baklava-context-menu>.item>.__submenu-icon{margin-left:.75rem}.baklava-context-menu>.item.--disabled{color:var(--baklava-control-color-hover)}.baklava-context-menu>.item:not(.--header):not(.--active):not(.--disabled):hover{background:var(--baklava-control-color-primary)}.baklava-context-menu>.item.--active{background:var(--baklava-control-color-primary)}.baklava-context-menu.--nested{left:100%;top:0}.baklava-context-menu.--flipped-x.--nested{left:unset;right:100%}.baklava-context-menu.--flipped-y.--nested{top:unset;bottom:0}.baklava-context-menu>.divider{margin:.35em 0;height:1px;background-color:var(--baklava-control-color-hover)}.baklava-icon{display:block;height:100%}.baklava-icon.--clickable{cursor:pointer;transition:color var(--baklava-visual-transition)}.baklava-icon.--clickable:hover{color:var(--baklava-control-color-primary)}.baklava-input{background-color:var(--baklava-control-color-background);color:var(--baklava-control-color-foreground);caret-color:var(--baklava-control-color-primary);border:none;border-radius:var(--baklava-control-border-radius);padding:.45em .75em;width:100%;transition:background-color var(--baklava-visual-transition);font-size:inherit;font:inherit}.baklava-input:hover{background-color:var(--baklava-control-color-hover)}.baklava-input:active{background-color:var(--baklava-control-color-active)}.baklava-input:focus-visible{outline:1px solid var(--baklava-control-color-primary)}.baklava-input[type=number]::-webkit-inner-spin-button,.baklava-input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.baklava-input.--invalid{box-shadow:0 0 2px 2px var(--baklava-control-color-error)}.baklava-num-input{background:var(--baklava-control-color-background);color:var(--baklava-control-color-foreground);border-radius:var(--baklava-control-border-radius);width:100%;display:grid;grid-template-columns:20px 1fr 20px}.baklava-num-input>.__button{display:flex;flex:0 0 auto;width:20px;justify-content:center;align-items:center;transition:background var(--baklava-visual-transition);cursor:pointer}.baklava-num-input>.__button:hover{background-color:var(--baklava-control-color-hover)}.baklava-num-input>.__button:active{background-color:var(--baklava-control-color-active)}.baklava-num-input>.__button.--dec{grid-area:1/1/span 1/span 1}.baklava-num-input>.__button.--dec>svg{transform:rotate(90deg)}.baklava-num-input>.__button.--inc{grid-area:1/3/span 1/span 1}.baklava-num-input>.__button.--inc>svg{transform:rotate(-90deg)}.baklava-num-input>.__button path{stroke:var(--baklava-control-color-foreground);fill:var(--baklava-control-color-foreground)}.baklava-num-input>.__content{grid-area:1/2/span 1/span 1;display:inline-flex;cursor:pointer;max-width:100%;min-width:0;align-items:center;transition:background-color var(--baklava-visual-transition)}.baklava-num-input>.__content:hover{background-color:var(--baklava-control-color-hover)}.baklava-num-input>.__content:active{background-color:var(--baklava-control-color-active)}.baklava-num-input>.__content>.__label,.baklava-num-input>.__content>.__value{margin:.35em 0;padding:0 .5em}.baklava-num-input>.__content>.__label{flex:1;min-width:0;overflow:hidden}.baklava-num-input>.__content>.__value{text-align:right}.baklava-num-input>.__content>input{background-color:var(--baklava-control-color-background);color:var(--baklava-control-color-foreground);caret-color:var(--baklava-control-color-primary);padding:.35em;width:100%}.baklava-select{width:100%;position:relative;color:var(--baklava-control-color-foreground)}.baklava-select.--open>.__selected{border-bottom-left-radius:0;border-bottom-right-radius:0}.baklava-select.--open>.__selected>.__icon{transform:rotate(180deg)}.baklava-select>.__selected{background-color:var(--baklava-control-color-background);padding:.35em .75em;border-radius:var(--baklava-control-border-radius);transition:background var(--baklava-visual-transition);min-height:1.7em;display:flex;align-items:center;cursor:pointer}.baklava-select>.__selected:hover{background:var(--baklava-control-color-hover)}.baklava-select>.__selected:active{background:var(--baklava-control-color-active)}.baklava-select>.__selected>.__text{flex:1 0 auto;flex-basis:0;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.baklava-select>.__selected>.__icon{flex:0 0 auto;display:flex;justify-content:center;align-items:center;transition:transform .25s ease;width:18px;height:18px}.baklava-select>.__selected>.__icon path{stroke:var(--baklava-control-color-foreground);fill:var(--baklava-control-color-foreground)}.baklava-select>.__dropdown{position:absolute;top:100%;left:0;right:0;z-index:10;background-color:var(--baklava-context-menu-background);filter:drop-shadow(0 0 4px black);border-radius:0 0 var(--baklava-control-border-radius) var(--baklava-control-border-radius);max-height:15em;overflow-y:scroll}.baklava-select>.__dropdown::-webkit-scrollbar{width:0px;background:transparent}.baklava-select>.__dropdown>.item{padding:.35em .35em .35em 1em;transition:background .05s linear}.baklava-select>.__dropdown>.item:not(.--header):not(.--active){cursor:pointer}.baklava-select>.__dropdown>.item:not(.--header):not(.--active):hover{background:var(--baklava-control-color-hover)}.baklava-select>.__dropdown>.item.--active{background:var(--baklava-control-color-primary)}.baklava-select>.__dropdown>.item.--header{color:var(--baklava-control-color-disabled-foreground);border-bottom:1px solid var(--baklava-control-color-disabled-foreground);padding:.5em .35em .5em 1em}.baklava-slider{background:var(--baklava-control-color-background);color:var(--baklava-control-color-foreground);border-radius:var(--baklava-control-border-radius);position:relative;cursor:pointer}.baklava-slider>.__content{display:flex;position:relative}.baklava-slider>.__content>.__label,.baklava-slider>.__content>.__value{flex:1 1 auto;margin:.35em 0;padding:0 .5em;text-overflow:ellipsis}.baklava-slider>.__content>.__value{text-align:right}.baklava-slider>.__content>input{background-color:var(--baklava-control-color-background);color:var(--baklava-control-color-foreground);caret-color:var(--baklava-control-color-primary);padding:.35em;width:100%}.baklava-slider>.__slider{position:absolute;top:0;bottom:0;left:0;background-color:var(--baklava-control-color-primary);border-radius:var(--baklava-control-border-radius)}.baklava-connection{stroke:var(--baklava-color-connection-default);stroke-width:2px;fill:none}.baklava-connection.--temporary{stroke-width:4px;stroke-dasharray:5 5;stroke-dashoffset:0;animation:dash 1s linear infinite;transform:translateY(-1px)}@keyframes dash{to{stroke-dashoffset:20}}.baklava-connection.--allowed{stroke:var(--baklava-color-connection-allowed)}.baklava-connection.--forbidden{stroke:var(--baklava-color-connection-forbidden)}.baklava-minimap{position:absolute;height:15%;width:15%;min-width:150px;max-width:90%;top:20px;right:20px;z-index:900}.baklava-editor{width:100%;height:100%;position:relative;overflow:hidden;outline:none!important;font-family:Lato,Segoe UI,Tahoma,Geneva,Verdana,sans-serif;font-size:15px;touch-action:none}.baklava-editor .background{background-color:var(--baklava-editor-background-pattern-default);background-image:linear-gradient(var(--baklava-editor-background-pattern-black) 2px,transparent 2px),linear-gradient(90deg,var(--baklava-editor-background-pattern-black) 2px,transparent 2px),linear-gradient(var(--baklava-editor-background-pattern-line) 1px,transparent 1px),linear-gradient(90deg,var(--baklava-editor-background-pattern-line) 1px,transparent 1px);background-repeat:repeat;width:100%;height:100%;pointer-events:none!important}.baklava-editor *:not(input):not(textarea){user-select:none;-moz-user-select:none;-webkit-user-select:none;touch-action:none}.baklava-editor .input-user-select{user-select:auto;-moz-user-select:auto;-webkit-user-select:auto}.baklava-editor *,.baklava-editor *:after,.baklava-editor *:before{box-sizing:border-box}.baklava-editor.--temporary-connection{cursor:crosshair}.baklava-editor .connections-container{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none!important}.baklava-editor .node-container{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.baklava-editor .node-container *{pointer-events:all}.baklava-ignore-mouse *{pointer-events:none!important}.baklava-ignore-mouse .__port{pointer-events:all!important}.baklava-node-interface{padding:.25em 0;position:relative}.baklava-node-interface .__port{position:absolute;width:10px;height:10px;background:white;border-radius:50%;top:calc(50% - 5px);cursor:crosshair}.baklava-node-interface .__port.--selected{outline:2px var(--baklava-color-connection-default) solid;outline-offset:4px}.baklava-node-interface.--input{text-align:left;padding-left:.5em}.baklava-node-interface.--input .__port{left:-1.1em}.baklava-node-interface.--output{text-align:right;padding-right:.5em}.baklava-node-interface.--output .__port{right:-1.1em}.baklava-node-interface .__tooltip{position:absolute;left:5px;top:15px;transform:translate(-50%);background:var(--baklava-node-interface-port-tooltip-color-background);color:var(--baklava-node-interface-port-tooltip-color-foreground);padding:.25em .5em;text-align:center;z-index:2}.baklava-node-palette{position:absolute;left:0;top:60px;width:250px;height:calc(100% - 60px);z-index:3;padding:2rem;overflow-y:auto;background:var(--baklava-node-palette-background);color:var(--baklava-node-palette-foreground)}.baklava-node-palette h1{margin-top:2rem}.baklava-node.--palette{position:unset;margin:1rem 0;cursor:grab}.baklava-node.--palette:first-child{margin-top:0}.baklava-node.--palette .__title{padding:.5rem;border-radius:var(--baklava-node-border-radius)}.baklava-dragged-node{position:absolute;width:calc(250px - 4rem);height:40px;z-index:4;pointer-events:none}.baklava-node{background:var(--baklava-node-color-background);color:var(--baklava-node-color-foreground);border:1px solid transparent;border-radius:var(--baklava-node-border-radius);position:absolute;box-shadow:0 0 4px #000c;transition:border-color var(--baklava-visual-transition),box-shadow var(--baklava-visual-transition);width:var(--width)}.baklava-node:hover{border-color:var(--baklava-node-color-hover)}.baklava-node:hover .__resize-handle:after{opacity:1}.baklava-node.--selected{z-index:5;border-color:var(--baklava-node-color-selected)}.baklava-node.--dragging{box-shadow:0 0 12px #000c}.baklava-node.--dragging>.__title{cursor:grabbing}.baklava-node>.__title{display:flex;background:var(--baklava-node-title-color-background);color:var(--baklava-node-title-color-foreground);padding:.4em .75em;border-radius:var(--baklava-node-border-radius) var(--baklava-node-border-radius) 0 0;cursor:grab}.baklava-node>.__title>*:first-child{flex-grow:1}.baklava-node>.__title>.__title-label{pointer-events:none}.baklava-node>.__title>.__menu{position:relative;cursor:initial}.baklava-node[data-node-type^=__baklava_]>.__title{background:var(--baklava-group-node-title-color-background);color:var(--baklava-group-node-title-color-foreground)}.baklava-node>.__content{padding:.75em}.baklava-node>.__content>div>div{margin:.5em 0}.baklava-node.--two-column>.__content{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto auto;grid-template-areas:". ." ". ."}.baklava-node.--two-column>.__content>.__inputs{grid-row:1;grid-column:1}.baklava-node.--two-column>.__content>.__outputs{grid-row:1;grid-column:2}.baklava-node .__resize-handle{position:absolute;right:0;bottom:0;width:1rem;height:1rem;transform:translate(50%);cursor:ew-resize}.baklava-node .__resize-handle:after{content:"";position:absolute;bottom:0;left:-.5rem;width:1rem;height:1rem;opacity:0;border-bottom-right-radius:var(--baklava-node-border-radius);transition:opacity var(--baklava-visual-transition);background:linear-gradient(-45deg,transparent 10%,var(--baklava-node-color-resize-handle) 10%,var(--baklava-node-color-resize-handle) 15%,transparent 15%,transparent 30%,var(--baklava-node-color-resize-handle) 30%,var(--baklava-node-color-resize-handle) 35%,transparent 35%,transparent 50%,var(--baklava-node-color-resize-handle) 50%,var(--baklava-node-color-resize-handle) 55%,transparent 55%)}.baklava-sidebar{position:absolute;height:100%;width:25%;min-width:300px;max-width:90%;top:0;right:0;z-index:1000;background-color:var(--baklava-sidebar-color-background);color:var(--baklava-sidebar-color-foreground);box-shadow:none;overflow-x:hidden;padding:1em;transform:translate(100%);transition:transform .5s;display:flex;flex-direction:column}.baklava-sidebar.--open{transform:translate(0);box-shadow:0 0 15px #000}.baklava-sidebar .__resizer{position:absolute;left:0;top:0;height:100%;width:4px;cursor:col-resize}.baklava-sidebar .__header{display:flex;align-items:center}.baklava-sidebar .__header .__node-name{margin-left:.5rem}.baklava-sidebar .__close{font-size:2em;border:none;background:none;color:inherit;cursor:pointer}.baklava-sidebar .__interface{margin:.5em 0}.baklava-toolbar{position:absolute;left:0;top:0;width:100%;height:60px;z-index:3;padding:.5rem 2rem;background:var(--baklava-toolbar-background);color:var(--baklava-toolbar-foreground);display:flex;align-items:center}.baklava-toolbar-entry{margin-left:.5rem;margin-right:.5rem}.baklava-toolbar-button{color:var(--baklava-toolbar-foreground);background:none;border:none;transition:color var(--baklava-visual-transition)}.baklava-toolbar-button:not([disabled]){cursor:pointer}.baklava-toolbar-button:hover:not([disabled]){color:var(--baklava-control-color-primary)}.baklava-toolbar-button[disabled]{color:var(--baklava-control-color-disabled-foreground)}.slide-fade-enter-active,.slide-fade-leave-active{transition:all .1s ease-out}.slide-fade-enter-from,.slide-fade-leave-to{transform:translateY(5px);opacity:0}.fade-enter-active,.fade-leave-active{transition:opacity .1s ease-out!important}.fade-enter-from,.fade-leave-to{opacity:0}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:PTSans,Roboto,sans-serif;font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}.tooltip-arrow,.tooltip-arrow:before{position:absolute;width:8px;height:8px;background:inherit}.tooltip-arrow{visibility:hidden}.tooltip-arrow:before{content:"";visibility:visible;transform:rotate(45deg)}[data-tooltip-style^=light]+.tooltip>.tooltip-arrow:before{border-style:solid;border-color:#e5e7eb}[data-tooltip-style^=light]+.tooltip[data-popper-placement^=top]>.tooltip-arrow:before{border-bottom-width:1px;border-right-width:1px}[data-tooltip-style^=light]+.tooltip[data-popper-placement^=right]>.tooltip-arrow:before{border-bottom-width:1px;border-left-width:1px}[data-tooltip-style^=light]+.tooltip[data-popper-placement^=bottom]>.tooltip-arrow:before{border-top-width:1px;border-left-width:1px}[data-tooltip-style^=light]+.tooltip[data-popper-placement^=left]>.tooltip-arrow:before{border-top-width:1px;border-right-width:1px}.tooltip[data-popper-placement^=top]>.tooltip-arrow{bottom:-4px}.tooltip[data-popper-placement^=bottom]>.tooltip-arrow{top:-4px}.tooltip[data-popper-placement^=left]>.tooltip-arrow{right:-4px}.tooltip[data-popper-placement^=right]>.tooltip-arrow{left:-4px}.tooltip.invisible>.tooltip-arrow:before{visibility:hidden}[data-popper-arrow],[data-popper-arrow]:before{position:absolute;width:8px;height:8px;background:inherit}[data-popper-arrow]{visibility:hidden}[data-popper-arrow]:before{content:"";visibility:visible;transform:rotate(45deg)}[data-popper-arrow]:after{content:"";visibility:visible;transform:rotate(45deg);position:absolute;width:9px;height:9px;background:inherit}[role=tooltip]>[data-popper-arrow]:before{border-style:solid;border-color:#e5e7eb}.dark [role=tooltip]>[data-popper-arrow]:before{border-style:solid;border-color:#4b5563}[role=tooltip]>[data-popper-arrow]:after{border-style:solid;border-color:#e5e7eb}.dark [role=tooltip]>[data-popper-arrow]:after{border-style:solid;border-color:#4b5563}[data-popover][role=tooltip][data-popper-placement^=top]>[data-popper-arrow]:before{border-bottom-width:1px;border-right-width:1px}[data-popover][role=tooltip][data-popper-placement^=top]>[data-popper-arrow]:after{border-bottom-width:1px;border-right-width:1px}[data-popover][role=tooltip][data-popper-placement^=right]>[data-popper-arrow]:before{border-bottom-width:1px;border-left-width:1px}[data-popover][role=tooltip][data-popper-placement^=right]>[data-popper-arrow]:after{border-bottom-width:1px;border-left-width:1px}[data-popover][role=tooltip][data-popper-placement^=bottom]>[data-popper-arrow]:before{border-top-width:1px;border-left-width:1px}[data-popover][role=tooltip][data-popper-placement^=bottom]>[data-popper-arrow]:after{border-top-width:1px;border-left-width:1px}[data-popover][role=tooltip][data-popper-placement^=left]>[data-popper-arrow]:before{border-top-width:1px;border-right-width:1px}[data-popover][role=tooltip][data-popper-placement^=left]>[data-popper-arrow]:after{border-top-width:1px;border-right-width:1px}[data-popover][role=tooltip][data-popper-placement^=top]>[data-popper-arrow]{bottom:-5px}[data-popover][role=tooltip][data-popper-placement^=bottom]>[data-popper-arrow]{top:-5px}[data-popover][role=tooltip][data-popper-placement^=left]>[data-popper-arrow]{right:-5px}[data-popover][role=tooltip][data-popper-placement^=right]>[data-popper-arrow]{left:-5px}[role=tooltip].invisible>[data-popper-arrow]:before{visibility:hidden}[role=tooltip].invisible>[data-popper-arrow]:after{visibility:hidden}[type=text],[type=email],[type=url],[type=password],[type=number],[type=date],[type=datetime-local],[type=month],[type=search],[type=tel],[type=time],[type=week],[multiple],textarea,select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#6b7280;border-width:1px;border-radius:0;padding:.5rem .75rem;font-size:1rem;line-height:1.5rem;--tw-shadow: 0 0 #0000}[type=text]:focus,[type=email]:focus,[type=url]:focus,[type=password]:focus,[type=number]:focus,[type=date]:focus,[type=datetime-local]:focus,[type=month]:focus,[type=search]:focus,[type=tel]:focus,[type=time]:focus,[type=week]:focus,[multiple]:focus,textarea:focus,select:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-inset: var(--tw-empty, );--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: #1C64F2;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-color:#1c64f2}input::-moz-placeholder,textarea::-moz-placeholder{color:#6b7280;opacity:1}input::placeholder,textarea::placeholder{color:#6b7280;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em}select:not([size]){background-image:url("data:image/svg+xml,%3csvg aria-hidden='true' xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 10 6'%3e %3cpath stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 1 4 4 4-4'/%3e %3c/svg%3e");background-position:right .75rem center;background-repeat:no-repeat;background-size:.75em .75em;padding-right:2.5rem;-webkit-print-color-adjust:exact;print-color-adjust:exact}[multiple]{background-image:initial;background-position:initial;background-repeat:unset;background-size:initial;padding-right:.75rem;-webkit-print-color-adjust:unset;print-color-adjust:unset}[type=checkbox],[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;-webkit-print-color-adjust:exact;print-color-adjust:exact;display:inline-block;vertical-align:middle;background-origin:border-box;-webkit-user-select:none;-moz-user-select:none;user-select:none;flex-shrink:0;height:1rem;width:1rem;color:#1c64f2;background-color:#fff;border-color:#6b7280;border-width:1px;--tw-shadow: 0 0 #0000}[type=checkbox]{border-radius:0}[type=radio]{border-radius:100%}[type=checkbox]:focus,[type=radio]:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-inset: var(--tw-empty, );--tw-ring-offset-width: 2px;--tw-ring-offset-color: #fff;--tw-ring-color: #1C64F2;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}[type=checkbox]:checked,[type=radio]:checked,.dark [type=checkbox]:checked,.dark [type=radio]:checked{border-color:transparent;background-color:currentColor;background-size:.55em .55em;background-position:center;background-repeat:no-repeat}[type=checkbox]:checked{background-image:url("data:image/svg+xml,%3csvg aria-hidden='true' xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 12'%3e %3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M1 5.917 5.724 10.5 15 1.5'/%3e %3c/svg%3e");background-repeat:no-repeat;background-size:.55em .55em;-webkit-print-color-adjust:exact;print-color-adjust:exact}[type=radio]:checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e");background-size:1em 1em}.dark [type=radio]:checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e");background-size:1em 1em}[type=checkbox]:indeterminate{background-image:url("data:image/svg+xml,%3csvg aria-hidden='true' xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 12'%3e %3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M1 5.917 5.724 10.5 15 1.5'/%3e %3c/svg%3e");background-color:currentColor;border-color:transparent;background-position:center;background-repeat:no-repeat;background-size:.55em .55em;-webkit-print-color-adjust:exact;print-color-adjust:exact}[type=checkbox]:indeterminate:hover,[type=checkbox]:indeterminate:focus{border-color:transparent;background-color:currentColor}[type=file]{background:unset;border-color:inherit;border-width:0;border-radius:0;padding:0;font-size:unset;line-height:inherit}[type=file]:focus{outline:1px auto inherit}input[type=file]::file-selector-button{color:#fff;background:#1F2937;border:0;font-weight:500;font-size:.875rem;cursor:pointer;padding:.625rem 1rem .625rem 2rem;margin-inline-start:-1rem;margin-inline-end:1rem}input[type=file]::file-selector-button:hover{background:#374151}.dark input[type=file]::file-selector-button{color:#fff;background:#4B5563}.dark input[type=file]::file-selector-button:hover{background:#6B7280}input[type=range]::-webkit-slider-thumb{height:1.25rem;width:1.25rem;background:#1C64F2;border-radius:9999px;border:0;appearance:none;-moz-appearance:none;-webkit-appearance:none;cursor:pointer}input[type=range]:disabled::-webkit-slider-thumb{background:#9CA3AF}.dark input[type=range]:disabled::-webkit-slider-thumb{background:#6B7280}input[type=range]:focus::-webkit-slider-thumb{outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-opacity: 1px;--tw-ring-color: rgb(164 202 254 / var(--tw-ring-opacity))}input[type=range]::-moz-range-thumb{height:1.25rem;width:1.25rem;background:#1C64F2;border-radius:9999px;border:0;appearance:none;-moz-appearance:none;-webkit-appearance:none;cursor:pointer}input[type=range]:disabled::-moz-range-thumb{background:#9CA3AF}.dark input[type=range]:disabled::-moz-range-thumb{background:#6B7280}input[type=range]::-moz-range-progress{background:#3F83F8}input[type=range]::-ms-fill-lower{background:#3F83F8}.toggle-bg:after{content:"";position:absolute;top:.125rem;left:.125rem;background:white;border-color:#d1d5db;border-width:1px;border-radius:9999px;height:1.25rem;width:1.25rem;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-duration:.15s;box-shadow:var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color)}input:checked+.toggle-bg:after{transform:translate(100%);border-color:#fff}input:checked+.toggle-bg{background:#1C64F2;border-color:#1c64f2}*{scrollbar-color:initial;scrollbar-width:initial}html{scroll-behavior:smooth}@font-face{font-family:Roboto;src:url(/assets/Roboto-Regular-7277cfb8.ttf) format("truetype")}@font-face{font-family:PTSans;src:url(/assets/PTSans-Regular-23b91352.ttf) format("truetype")}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(63 131 248 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(63 131 248 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%;margin-right:auto;margin-left:auto;padding-right:2rem;padding-left:2rem}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-y-0{top:0;bottom:0}.-bottom-1{bottom:-.25rem}.-bottom-1\.5{bottom:-.375rem}.-bottom-2{bottom:-.5rem}.-bottom-4{bottom:-1rem}.-left-1{left:-.25rem}.-left-1\.5{left:-.375rem}.-right-0{right:-0px}.-right-0\.5{right:-.125rem}.-right-1{right:-.25rem}.-right-1\.5{right:-.375rem}.-top-1{top:-.25rem}.-top-1\.5{top:-.375rem}.bottom-0{bottom:0}.bottom-16{bottom:4rem}.bottom-2{bottom:.5rem}.bottom-2\.5{bottom:.625rem}.bottom-5{bottom:1.25rem}.bottom-\[60px\]{bottom:60px}.left-0{left:0}.left-1\/2{left:50%}.left-2{left:.5rem}.left-7{left:1.75rem}.left-9{left:2.25rem}.right-0{right:0}.right-2{right:.5rem}.right-2\.5{right:.625rem}.right-3{right:.75rem}.top-0{top:0}.top-1\/2{top:50%}.top-3{top:.75rem}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.-m-1{margin:-.25rem}.-m-2{margin:-.5rem}.-m-4{margin:-1rem}.m-0{margin:0}.m-1{margin:.25rem}.m-2{margin:.5rem}.m-4{margin:1rem}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.-mx-1\.5{margin-left:-.375rem;margin-right:-.375rem}.-mx-2{margin-left:-.5rem;margin-right:-.5rem}.-mx-5{margin-left:-1.25rem;margin-right:-1.25rem}.-my-1{margin-top:-.25rem;margin-bottom:-.25rem}.-my-1\.5{margin-top:-.375rem;margin-bottom:-.375rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-1\.5{margin-left:.375rem;margin-right:.375rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-4{margin-top:1rem;margin-bottom:1rem}.-mb-px{margin-bottom:-1px}.mb-1{margin-bottom:.25rem}.mb-10{margin-bottom:2.5rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.ml-0{margin-left:0}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-5{margin-left:1.25rem}.ml-auto{margin-left:auto}.mr-0{margin-right:0}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-4{margin-right:1rem}.mt-0{margin-top:0}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-14{margin-top:3.5rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-3{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-0{height:0px}.h-0\.5{height:.125rem}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-32{height:8rem}.h-36{height:9rem}.h-4{height:1rem}.h-4\/5{height:80%}.h-48{height:12rem}.h-5{height:1.25rem}.h-56{height:14rem}.h-6{height:1.5rem}.h-60{height:15rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-96{height:24rem}.h-auto{height:auto}.h-full{height:100%}.h-modal{height:calc(100% - 2rem)}.h-px{height:1px}.h-screen{height:100vh}.max-h-6{max-height:1.5rem}.max-h-64{max-height:16rem}.max-h-96{max-height:24rem}.max-h-\[400px\]{max-height:400px}.max-h-full{max-height:100%}.max-h-screen{max-height:100vh}.min-h-\[900px\]{min-height:900px}.min-h-full{min-height:100%}.w-0{width:0px}.w-0\.5{width:.125rem}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-1\/2{width:50%}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-3\/5{width:60%}.w-36{width:9rem}.w-4{width:1rem}.w-4\/5{width:80%}.w-4\/6{width:66.666667%}.w-48{width:12rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-60{width:15rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-96{width:24rem}.w-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-px{width:1px}.w-screen{width:100vw}.min-w-\[23rem\]{min-width:23rem}.min-w-\[24rem\]{min-width:24rem}.min-w-\[300px\]{min-width:300px}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.max-w-6xl{max-width:72rem}.max-w-7xl{max-width:80rem}.max-w-\[23rem\]{max-width:23rem}.max-w-\[24rem\]{max-width:24rem}.max-w-\[300px\]{max-width:300px}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xl{max-width:36rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-none{flex:none}.flex-shrink{flex-shrink:1}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.flex-grow-0{flex-grow:0}.grow{flex-grow:1}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-0{--tw-translate-y: -0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-full{--tw-translate-y: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-1\/2{--tw-translate-y: 50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-full{--tw-translate-y: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-75{--tw-scale-x: .75;--tw-scale-y: .75;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform-none{transform:none}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.list-disc{list-style-type:disc}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.-space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(-1rem * var(--tw-space-x-reverse));margin-left:calc(-1rem * calc(1 - var(--tw-space-x-reverse)))}.-space-x-px>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(-1px * var(--tw-space-x-reverse));margin-left:calc(-1px * calc(1 - var(--tw-space-x-reverse)))}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse: 0;border-right-width:calc(1px * var(--tw-divide-x-reverse));border-left-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-gray-100>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(243 244 246 / var(--tw-divide-opacity))}.divide-gray-200>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(229 231 235 / var(--tw-divide-opacity))}.self-center{align-self:center}.self-stretch{align-self:stretch}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-hidden{overflow-y:hidden}.overflow-y-scroll{overflow-y:scroll}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.\!rounded-full{border-radius:9999px!important}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-b{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-b-lg{border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem}.rounded-l-lg{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.rounded-r-lg{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.rounded-t-xl{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-4{border-width:4px}.border-x-0{border-left-width:0px;border-right-width:0px}.border-b{border-bottom-width:1px}.border-b-0{border-bottom-width:0px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-t{border-top-width:1px}.border-t-0{border-top-width:0px}.border-t-4{border-top-width:4px}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-bg-dark{--tw-border-opacity: 1;border-color:rgb(19 46 89 / var(--tw-border-opacity))}.border-blue-300{--tw-border-opacity: 1;border-color:rgb(164 202 254 / var(--tw-border-opacity))}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(63 131 248 / var(--tw-border-opacity))}.border-blue-600{--tw-border-opacity: 1;border-color:rgb(28 100 242 / var(--tw-border-opacity))}.border-blue-700{--tw-border-opacity: 1;border-color:rgb(26 86 219 / var(--tw-border-opacity))}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.border-gray-500{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity))}.border-gray-600{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity))}.border-gray-700{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity))}.border-gray-800{--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity))}.border-green-500{--tw-border-opacity: 1;border-color:rgb(14 159 110 / var(--tw-border-opacity))}.border-green-600{--tw-border-opacity: 1;border-color:rgb(5 122 85 / var(--tw-border-opacity))}.border-green-700{--tw-border-opacity: 1;border-color:rgb(4 108 78 / var(--tw-border-opacity))}.border-pink-600{--tw-border-opacity: 1;border-color:rgb(214 31 105 / var(--tw-border-opacity))}.border-pink-700{--tw-border-opacity: 1;border-color:rgb(191 18 93 / var(--tw-border-opacity))}.border-primary{--tw-border-opacity: 1;border-color:rgb(14 142 240 / var(--tw-border-opacity))}.border-primary-light{--tw-border-opacity: 1;border-color:rgb(61 171 255 / var(--tw-border-opacity))}.border-purple-600{--tw-border-opacity: 1;border-color:rgb(126 58 242 / var(--tw-border-opacity))}.border-purple-700{--tw-border-opacity: 1;border-color:rgb(108 43 217 / var(--tw-border-opacity))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(240 82 82 / var(--tw-border-opacity))}.border-red-600{--tw-border-opacity: 1;border-color:rgb(224 36 36 / var(--tw-border-opacity))}.border-red-700{--tw-border-opacity: 1;border-color:rgb(200 30 30 / var(--tw-border-opacity))}.border-secondary{--tw-border-opacity: 1;border-color:rgb(15 217 116 / var(--tw-border-opacity))}.border-transparent{border-color:transparent}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity))}.border-yellow-400{--tw-border-opacity: 1;border-color:rgb(227 160 8 / var(--tw-border-opacity))}.border-yellow-500{--tw-border-opacity: 1;border-color:rgb(194 120 3 / var(--tw-border-opacity))}.bg-accent{--tw-bg-opacity: 1;background-color:rgb(240 112 14 / var(--tw-bg-opacity))}.bg-bg-dark-tone-panel{--tw-bg-opacity: 1;background-color:rgb(67 103 163 / var(--tw-bg-opacity))}.bg-bg-light{--tw-bg-opacity: 1;background-color:rgb(226 237 255 / var(--tw-bg-opacity))}.bg-bg-light-discussion{--tw-bg-opacity: 1;background-color:rgb(197 216 248 / var(--tw-bg-opacity))}.bg-bg-light-tone{--tw-bg-opacity: 1;background-color:rgb(185 210 247 / var(--tw-bg-opacity))}.bg-bg-light-tone-panel{--tw-bg-opacity: 1;background-color:rgb(143 181 239 / var(--tw-bg-opacity))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(225 239 254 / var(--tw-bg-opacity))}.bg-blue-200{--tw-bg-opacity: 1;background-color:rgb(195 221 253 / var(--tw-bg-opacity))}.bg-blue-300{--tw-bg-opacity: 1;background-color:rgb(164 202 254 / var(--tw-bg-opacity))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(235 245 255 / var(--tw-bg-opacity))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(63 131 248 / var(--tw-bg-opacity))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity))}.bg-blue-700{--tw-bg-opacity: 1;background-color:rgb(26 86 219 / var(--tw-bg-opacity))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity))}.bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}.bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(222 247 236 / var(--tw-bg-opacity))}.bg-green-200{--tw-bg-opacity: 1;background-color:rgb(188 240 218 / var(--tw-bg-opacity))}.bg-green-400{--tw-bg-opacity: 1;background-color:rgb(49 196 141 / var(--tw-bg-opacity))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(14 159 110 / var(--tw-bg-opacity))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(5 122 85 / var(--tw-bg-opacity))}.bg-green-700{--tw-bg-opacity: 1;background-color:rgb(4 108 78 / var(--tw-bg-opacity))}.bg-indigo-100{--tw-bg-opacity: 1;background-color:rgb(229 237 255 / var(--tw-bg-opacity))}.bg-indigo-200{--tw-bg-opacity: 1;background-color:rgb(205 219 254 / var(--tw-bg-opacity))}.bg-indigo-500{--tw-bg-opacity: 1;background-color:rgb(104 117 245 / var(--tw-bg-opacity))}.bg-indigo-600{--tw-bg-opacity: 1;background-color:rgb(88 80 236 / var(--tw-bg-opacity))}.bg-orange-100{--tw-bg-opacity: 1;background-color:rgb(254 236 220 / var(--tw-bg-opacity))}.bg-pink-100{--tw-bg-opacity: 1;background-color:rgb(252 232 243 / var(--tw-bg-opacity))}.bg-pink-200{--tw-bg-opacity: 1;background-color:rgb(250 209 232 / var(--tw-bg-opacity))}.bg-pink-700{--tw-bg-opacity: 1;background-color:rgb(191 18 93 / var(--tw-bg-opacity))}.bg-primary{--tw-bg-opacity: 1;background-color:rgb(14 142 240 / var(--tw-bg-opacity))}.bg-primary-light{--tw-bg-opacity: 1;background-color:rgb(61 171 255 / var(--tw-bg-opacity))}.bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(237 235 254 / var(--tw-bg-opacity))}.bg-purple-200{--tw-bg-opacity: 1;background-color:rgb(220 215 254 / var(--tw-bg-opacity))}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(144 97 249 / var(--tw-bg-opacity))}.bg-purple-600{--tw-bg-opacity: 1;background-color:rgb(126 58 242 / var(--tw-bg-opacity))}.bg-purple-700{--tw-bg-opacity: 1;background-color:rgb(108 43 217 / var(--tw-bg-opacity))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(253 232 232 / var(--tw-bg-opacity))}.bg-red-200{--tw-bg-opacity: 1;background-color:rgb(251 213 213 / var(--tw-bg-opacity))}.bg-red-400{--tw-bg-opacity: 1;background-color:rgb(249 128 128 / var(--tw-bg-opacity))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(240 82 82 / var(--tw-bg-opacity))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(224 36 36 / var(--tw-bg-opacity))}.bg-red-700{--tw-bg-opacity: 1;background-color:rgb(200 30 30 / var(--tw-bg-opacity))}.bg-secondary{--tw-bg-opacity: 1;background-color:rgb(15 217 116 / var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-white\/30{background-color:#ffffff4d}.bg-white\/50{background-color:#ffffff80}.bg-yellow-100{--tw-bg-opacity: 1;background-color:rgb(253 246 178 / var(--tw-bg-opacity))}.bg-yellow-200{--tw-bg-opacity: 1;background-color:rgb(252 233 106 / var(--tw-bg-opacity))}.bg-yellow-400{--tw-bg-opacity: 1;background-color:rgb(227 160 8 / var(--tw-bg-opacity))}.bg-opacity-50{--tw-bg-opacity: .5}.bg-opacity-70{--tw-bg-opacity: .7}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-bg-light{--tw-gradient-from: #e2edff var(--tw-gradient-from-position);--tw-gradient-to: rgb(226 237 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-bg-light-tone{--tw-gradient-from: #b9d2f7 var(--tw-gradient-from-position);--tw-gradient-to: rgb(185 210 247 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-blue-500{--tw-gradient-from: #3F83F8 var(--tw-gradient-from-position);--tw-gradient-to: rgb(63 131 248 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-cyan-500{--tw-gradient-from: #06b6d4 var(--tw-gradient-from-position);--tw-gradient-to: rgb(6 182 212 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-green-400{--tw-gradient-from: #31C48D var(--tw-gradient-from-position);--tw-gradient-to: rgb(49 196 141 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-green-500{--tw-gradient-from: #0E9F6E var(--tw-gradient-from-position);--tw-gradient-to: rgb(14 159 110 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-lime-500{--tw-gradient-from: #84cc16 var(--tw-gradient-from-position);--tw-gradient-to: rgb(132 204 22 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-pink-500{--tw-gradient-from: #E74694 var(--tw-gradient-from-position);--tw-gradient-to: rgb(231 70 148 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-500{--tw-gradient-from: #9061F9 var(--tw-gradient-from-position);--tw-gradient-to: rgb(144 97 249 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-600{--tw-gradient-from: #7E3AF2 var(--tw-gradient-from-position);--tw-gradient-to: rgb(126 58 242 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-red-200{--tw-gradient-from: #FBD5D5 var(--tw-gradient-from-position);--tw-gradient-to: rgb(251 213 213 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-red-500{--tw-gradient-from: #F05252 var(--tw-gradient-from-position);--tw-gradient-to: rgb(240 82 82 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-teal-200{--tw-gradient-from: #AFECEF var(--tw-gradient-from-position);--tw-gradient-to: rgb(175 236 239 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-teal-300{--tw-gradient-from: #7EDCE2 var(--tw-gradient-from-position);--tw-gradient-to: rgb(126 220 226 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-teal-500{--tw-gradient-from: #0694A2 var(--tw-gradient-from-position);--tw-gradient-to: rgb(6 148 162 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-5\%{--tw-gradient-from-position: 5%}.via-bg-light{--tw-gradient-to: rgb(226 237 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #e2edff var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-blue-600{--tw-gradient-to: rgb(28 100 242 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #1C64F2 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-cyan-600{--tw-gradient-to: rgb(8 145 178 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #0891b2 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-green-600{--tw-gradient-to: rgb(5 122 85 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #057A55 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-lime-600{--tw-gradient-to: rgb(101 163 13 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #65a30d var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-pink-600{--tw-gradient-to: rgb(214 31 105 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #D61F69 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-purple-600{--tw-gradient-to: rgb(126 58 242 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #7E3AF2 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-red-300{--tw-gradient-to: rgb(248 180 180 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #F8B4B4 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-red-600{--tw-gradient-to: rgb(224 36 36 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #E02424 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-teal-600{--tw-gradient-to: rgb(4 116 129 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #047481 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-10\%{--tw-gradient-via-position: 10%}.to-blue-500{--tw-gradient-to: #3F83F8 var(--tw-gradient-to-position)}.to-blue-600{--tw-gradient-to: #1C64F2 var(--tw-gradient-to-position)}.to-blue-700{--tw-gradient-to: #1A56DB var(--tw-gradient-to-position)}.to-cyan-700{--tw-gradient-to: #0e7490 var(--tw-gradient-to-position)}.to-green-700{--tw-gradient-to: #046C4E var(--tw-gradient-to-position)}.to-lime-200{--tw-gradient-to: #d9f99d var(--tw-gradient-to-position)}.to-lime-300{--tw-gradient-to: #bef264 var(--tw-gradient-to-position)}.to-lime-700{--tw-gradient-to: #4d7c0f var(--tw-gradient-to-position)}.to-orange-400{--tw-gradient-to: #FF8A4C var(--tw-gradient-to-position)}.to-pink-500{--tw-gradient-to: #E74694 var(--tw-gradient-to-position)}.to-pink-700{--tw-gradient-to: #BF125D var(--tw-gradient-to-position)}.to-purple-700{--tw-gradient-to: #6C2BD9 var(--tw-gradient-to-position)}.to-red-700{--tw-gradient-to: #C81E1E var(--tw-gradient-to-position)}.to-teal-700{--tw-gradient-to: #036672 var(--tw-gradient-to-position)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.to-yellow-200{--tw-gradient-to: #FCE96A var(--tw-gradient-to-position)}.to-100\%{--tw-gradient-to-position: 100%}.fill-blue-600{fill:#1c64f2}.fill-gray-300{fill:#d1d5db}.fill-gray-600{fill:#4b5563}.fill-green-500{fill:#0e9f6e}.fill-pink-600{fill:#d61f69}.fill-purple-600{fill:#7e3af2}.fill-red-600{fill:#e02424}.fill-secondary{fill:#0fd974}.fill-white{fill:#fff}.fill-yellow-400{fill:#e3a008}.object-cover{-o-object-fit:cover;object-fit:cover}.object-fill{-o-object-fit:fill;object-fit:fill}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-10{padding:2.5rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-0{padding-bottom:0}.pb-2{padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pl-10{padding-left:2.5rem}.pl-2{padding-left:.5rem}.pl-3{padding-left:.75rem}.pl-4{padding-left:1rem}.pr-10{padding-right:2.5rem}.pr-2{padding-right:.5rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pt-0{padding-top:0}.pt-16{padding-top:4rem}.pt-2{padding-top:.5rem}.pt-24{padding-top:6rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.align-bottom{vertical-align:bottom}.font-sans{font-family:PTSans,Roboto,sans-serif}.text-2xl{font-size:1.5rem;line-height:2rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-5xl{font-size:3rem;line-height:1}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.font-thin{font-weight:100}.uppercase{text-transform:uppercase}.leading-6{line-height:1.5rem}.leading-9{line-height:2.25rem}.leading-none{line-height:1}.leading-normal{line-height:1.5}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.text-blue-100{--tw-text-opacity: 1;color:rgb(225 239 254 / var(--tw-text-opacity))}.text-blue-400{--tw-text-opacity: 1;color:rgb(118 169 250 / var(--tw-text-opacity))}.text-blue-500{--tw-text-opacity: 1;color:rgb(63 131 248 / var(--tw-text-opacity))}.text-blue-600{--tw-text-opacity: 1;color:rgb(28 100 242 / var(--tw-text-opacity))}.text-blue-700{--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 66 159 / var(--tw-text-opacity))}.text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.text-green-200{--tw-text-opacity: 1;color:rgb(188 240 218 / var(--tw-text-opacity))}.text-green-500{--tw-text-opacity: 1;color:rgb(14 159 110 / var(--tw-text-opacity))}.text-green-600{--tw-text-opacity: 1;color:rgb(5 122 85 / var(--tw-text-opacity))}.text-green-700{--tw-text-opacity: 1;color:rgb(4 108 78 / var(--tw-text-opacity))}.text-green-800{--tw-text-opacity: 1;color:rgb(3 84 63 / var(--tw-text-opacity))}.text-green-900{--tw-text-opacity: 1;color:rgb(1 71 55 / var(--tw-text-opacity))}.text-indigo-500{--tw-text-opacity: 1;color:rgb(104 117 245 / var(--tw-text-opacity))}.text-indigo-700{--tw-text-opacity: 1;color:rgb(81 69 205 / var(--tw-text-opacity))}.text-indigo-800{--tw-text-opacity: 1;color:rgb(66 56 157 / var(--tw-text-opacity))}.text-indigo-900{--tw-text-opacity: 1;color:rgb(54 47 120 / var(--tw-text-opacity))}.text-orange-200{--tw-text-opacity: 1;color:rgb(252 217 189 / var(--tw-text-opacity))}.text-orange-500{--tw-text-opacity: 1;color:rgb(255 90 31 / var(--tw-text-opacity))}.text-pink-500{--tw-text-opacity: 1;color:rgb(231 70 148 / var(--tw-text-opacity))}.text-pink-600{--tw-text-opacity: 1;color:rgb(214 31 105 / var(--tw-text-opacity))}.text-pink-700{--tw-text-opacity: 1;color:rgb(191 18 93 / var(--tw-text-opacity))}.text-pink-800{--tw-text-opacity: 1;color:rgb(153 21 75 / var(--tw-text-opacity))}.text-pink-900{--tw-text-opacity: 1;color:rgb(117 26 61 / var(--tw-text-opacity))}.text-purple-500{--tw-text-opacity: 1;color:rgb(144 97 249 / var(--tw-text-opacity))}.text-purple-600{--tw-text-opacity: 1;color:rgb(126 58 242 / var(--tw-text-opacity))}.text-purple-700{--tw-text-opacity: 1;color:rgb(108 43 217 / var(--tw-text-opacity))}.text-purple-800{--tw-text-opacity: 1;color:rgb(85 33 181 / var(--tw-text-opacity))}.text-purple-900{--tw-text-opacity: 1;color:rgb(74 29 150 / var(--tw-text-opacity))}.text-red-200{--tw-text-opacity: 1;color:rgb(251 213 213 / var(--tw-text-opacity))}.text-red-400{--tw-text-opacity: 1;color:rgb(249 128 128 / var(--tw-text-opacity))}.text-red-500{--tw-text-opacity: 1;color:rgb(240 82 82 / var(--tw-text-opacity))}.text-red-600{--tw-text-opacity: 1;color:rgb(224 36 36 / var(--tw-text-opacity))}.text-red-700{--tw-text-opacity: 1;color:rgb(200 30 30 / var(--tw-text-opacity))}.text-red-800{--tw-text-opacity: 1;color:rgb(155 28 28 / var(--tw-text-opacity))}.text-red-900{--tw-text-opacity: 1;color:rgb(119 29 29 / var(--tw-text-opacity))}.text-secondary{--tw-text-opacity: 1;color:rgb(15 217 116 / var(--tw-text-opacity))}.text-slate-50{--tw-text-opacity: 1;color:rgb(248 250 252 / var(--tw-text-opacity))}.text-slate-950{--tw-text-opacity: 1;color:rgb(2 6 23 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(227 160 8 / var(--tw-text-opacity))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(194 120 3 / var(--tw-text-opacity))}.text-yellow-700{--tw-text-opacity: 1;color:rgb(142 75 16 / var(--tw-text-opacity))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(114 59 19 / var(--tw-text-opacity))}.text-yellow-900{--tw-text-opacity: 1;color:rgb(99 49 18 / var(--tw-text-opacity))}.text-opacity-95{--tw-text-opacity: .95}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-20{opacity:.2}.opacity-30{opacity:.3}.opacity-50{opacity:.5}.opacity-80{opacity:.8}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-inner{--tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / .05);--tw-shadow-colored: inset 0 2px 4px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-blue-500\/50{--tw-shadow-color: rgb(63 131 248 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-blue-800\/80{--tw-shadow-color: rgb(30 66 159 / .8);--tw-shadow: var(--tw-shadow-colored)}.shadow-cyan-500\/50{--tw-shadow-color: rgb(6 182 212 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-cyan-800\/80{--tw-shadow-color: rgb(21 94 117 / .8);--tw-shadow: var(--tw-shadow-colored)}.shadow-green-500\/50{--tw-shadow-color: rgb(14 159 110 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-green-800\/80{--tw-shadow-color: rgb(3 84 63 / .8);--tw-shadow: var(--tw-shadow-colored)}.shadow-lime-500\/50{--tw-shadow-color: rgb(132 204 22 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-lime-800\/80{--tw-shadow-color: rgb(63 98 18 / .8);--tw-shadow: var(--tw-shadow-colored)}.shadow-pink-500\/50{--tw-shadow-color: rgb(231 70 148 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-pink-800\/80{--tw-shadow-color: rgb(153 21 75 / .8);--tw-shadow: var(--tw-shadow-colored)}.shadow-purple-500\/50{--tw-shadow-color: rgb(144 97 249 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-purple-800\/80{--tw-shadow-color: rgb(85 33 181 / .8);--tw-shadow: var(--tw-shadow-colored)}.shadow-red-500\/50{--tw-shadow-color: rgb(240 82 82 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-red-800\/80{--tw-shadow-color: rgb(155 28 28 / .8);--tw-shadow: var(--tw-shadow-colored)}.shadow-teal-500\/50{--tw-shadow-color: rgb(6 148 162 / .5);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-blue-800{--tw-ring-opacity: 1;--tw-ring-color: rgb(30 66 159 / var(--tw-ring-opacity))}.ring-cyan-800{--tw-ring-opacity: 1;--tw-ring-color: rgb(21 94 117 / var(--tw-ring-opacity))}.ring-gray-300{--tw-ring-opacity: 1;--tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity))}.ring-gray-600{--tw-ring-opacity: 1;--tw-ring-color: rgb(75 85 99 / var(--tw-ring-opacity))}.ring-gray-800{--tw-ring-opacity: 1;--tw-ring-color: rgb(31 41 55 / var(--tw-ring-opacity))}.ring-green-800{--tw-ring-opacity: 1;--tw-ring-color: rgb(3 84 63 / var(--tw-ring-opacity))}.ring-pink-800{--tw-ring-opacity: 1;--tw-ring-color: rgb(153 21 75 / var(--tw-ring-opacity))}.ring-pink-900{--tw-ring-opacity: 1;--tw-ring-color: rgb(117 26 61 / var(--tw-ring-opacity))}.ring-purple-800{--tw-ring-opacity: 1;--tw-ring-color: rgb(85 33 181 / var(--tw-ring-opacity))}.ring-purple-900{--tw-ring-opacity: 1;--tw-ring-color: rgb(74 29 150 / var(--tw-ring-opacity))}.ring-red-400{--tw-ring-opacity: 1;--tw-ring-color: rgb(249 128 128 / var(--tw-ring-opacity))}.ring-red-900{--tw-ring-opacity: 1;--tw-ring-color: rgb(119 29 29 / var(--tw-ring-opacity))}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.drop-shadow-md{--tw-drop-shadow: drop-shadow(0 4px 3px rgb(0 0 0 / .07)) drop-shadow(0 2px 2px rgb(0 0 0 / .06));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.drop-shadow-sm{--tw-drop-shadow: drop-shadow(0 1px 1px rgb(0 0 0 / .05));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.grayscale{--tw-grayscale: grayscale(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.grayscale-0{--tw-grayscale: grayscale(0);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.duration-75{transition-duration:75ms}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.scrollbar{scrollbar-color:var(--scrollbar-thumb, initial) var(--scrollbar-track, initial)}.scrollbar::-webkit-scrollbar-track{background-color:var(--scrollbar-track);border-radius:var(--scrollbar-track-radius)}.scrollbar::-webkit-scrollbar-track:hover{background-color:var(--scrollbar-track-hover, var(--scrollbar-track))}.scrollbar::-webkit-scrollbar-track:active{background-color:var(--scrollbar-track-active, var(--scrollbar-track-hover, var(--scrollbar-track)))}.scrollbar::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb);border-radius:var(--scrollbar-thumb-radius)}.scrollbar::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover, var(--scrollbar-thumb))}.scrollbar::-webkit-scrollbar-thumb:active{background-color:var(--scrollbar-thumb-active, var(--scrollbar-thumb-hover, var(--scrollbar-thumb)))}.scrollbar::-webkit-scrollbar-corner{background-color:var(--scrollbar-corner);border-radius:var(--scrollbar-corner-radius)}.scrollbar::-webkit-scrollbar-corner:hover{background-color:var(--scrollbar-corner-hover, var(--scrollbar-corner))}.scrollbar::-webkit-scrollbar-corner:active{background-color:var(--scrollbar-corner-active, var(--scrollbar-corner-hover, var(--scrollbar-corner)))}.scrollbar{scrollbar-width:auto}.scrollbar::-webkit-scrollbar{display:block;width:var(--scrollbar-width, 16px);height:var(--scrollbar-height, 16px)}.scrollbar-thin{scrollbar-color:var(--scrollbar-thumb, initial) var(--scrollbar-track, initial)}.scrollbar-thin::-webkit-scrollbar-track{background-color:var(--scrollbar-track);border-radius:var(--scrollbar-track-radius)}.scrollbar-thin::-webkit-scrollbar-track:hover{background-color:var(--scrollbar-track-hover, var(--scrollbar-track))}.scrollbar-thin::-webkit-scrollbar-track:active{background-color:var(--scrollbar-track-active, var(--scrollbar-track-hover, var(--scrollbar-track)))}.scrollbar-thin::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb);border-radius:var(--scrollbar-thumb-radius)}.scrollbar-thin::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover, var(--scrollbar-thumb))}.scrollbar-thin::-webkit-scrollbar-thumb:active{background-color:var(--scrollbar-thumb-active, var(--scrollbar-thumb-hover, var(--scrollbar-thumb)))}.scrollbar-thin::-webkit-scrollbar-corner{background-color:var(--scrollbar-corner);border-radius:var(--scrollbar-corner-radius)}.scrollbar-thin::-webkit-scrollbar-corner:hover{background-color:var(--scrollbar-corner-hover, var(--scrollbar-corner))}.scrollbar-thin::-webkit-scrollbar-corner:active{background-color:var(--scrollbar-corner-active, var(--scrollbar-corner-hover, var(--scrollbar-corner)))}.scrollbar-thin{scrollbar-width:thin}.scrollbar-thin::-webkit-scrollbar{display:block;width:8px;height:8px}.scrollbar-track-bg-light{--scrollbar-track: #e2edff !important}.scrollbar-track-bg-light-tone{--scrollbar-track: #b9d2f7 !important}.scrollbar-thumb-bg-light-tone{--scrollbar-thumb: #b9d2f7 !important}.scrollbar-thumb-bg-light-tone-panel{--scrollbar-thumb: #8fb5ef !important}.no-scrollbar::-webkit-scrollbar{display:none}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}.display-none{display:none}h1{font-size:36px;font-weight:700}h2{font-size:24px;font-weight:700}h3{font-size:18px;font-weight:700}h4{font-size:18px;font-style:italic}p{font-size:16px;word-wrap:break-word;overflow-wrap:break-word;white-space:normal}ul{list-style-type:disc;margin-left:0}li{list-style-type:disc;margin-left:20px}ol{list-style-type:decimal;margin-left:20px}.odd\:bg-bg-light-tone:nth-child(odd){--tw-bg-opacity: 1;background-color:rgb(185 210 247 / var(--tw-bg-opacity))}.even\:bg-bg-light-discussion-odd:nth-child(2n){--tw-bg-opacity: 1;background-color:rgb(214 231 255 / var(--tw-bg-opacity))}.even\:bg-bg-light-tone-panel:nth-child(2n){--tw-bg-opacity: 1;background-color:rgb(143 181 239 / var(--tw-bg-opacity))}.group\/avatar:hover .group-hover\/avatar\:visible,.group:hover .group-hover\:visible{visibility:visible}.group:hover .group-hover\:block{display:block}.group:hover .group-hover\:-translate-y-10{--tw-translate-y: -2.5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:border-secondary{--tw-border-opacity: 1;border-color:rgb(15 217 116 / var(--tw-border-opacity))}.group:hover .group-hover\:bg-white\/50{background-color:#ffffff80}.group:hover .group-hover\:bg-opacity-0{--tw-bg-opacity: 0}.group:hover .group-hover\:from-cyan-500{--tw-gradient-from: #06b6d4 var(--tw-gradient-from-position);--tw-gradient-to: rgb(6 182 212 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.group:hover .group-hover\:from-green-400{--tw-gradient-from: #31C48D var(--tw-gradient-from-position);--tw-gradient-to: rgb(49 196 141 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.group:hover .group-hover\:from-pink-500{--tw-gradient-from: #E74694 var(--tw-gradient-from-position);--tw-gradient-to: rgb(231 70 148 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.group:hover .group-hover\:from-purple-500{--tw-gradient-from: #9061F9 var(--tw-gradient-from-position);--tw-gradient-to: rgb(144 97 249 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.group:hover .group-hover\:from-purple-600{--tw-gradient-from: #7E3AF2 var(--tw-gradient-from-position);--tw-gradient-to: rgb(126 58 242 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.group:hover .group-hover\:from-red-200{--tw-gradient-from: #FBD5D5 var(--tw-gradient-from-position);--tw-gradient-to: rgb(251 213 213 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.group:hover .group-hover\:from-teal-300{--tw-gradient-from: #7EDCE2 var(--tw-gradient-from-position);--tw-gradient-to: rgb(126 220 226 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.group:hover .group-hover\:via-red-300{--tw-gradient-to: rgb(248 180 180 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #F8B4B4 var(--tw-gradient-via-position), var(--tw-gradient-to)}.group:hover .group-hover\:to-blue-500{--tw-gradient-to: #3F83F8 var(--tw-gradient-to-position)}.group:hover .group-hover\:to-blue-600{--tw-gradient-to: #1C64F2 var(--tw-gradient-to-position)}.group:hover .group-hover\:to-lime-300{--tw-gradient-to: #bef264 var(--tw-gradient-to-position)}.group:hover .group-hover\:to-orange-400{--tw-gradient-to: #FF8A4C var(--tw-gradient-to-position)}.group:hover .group-hover\:to-pink-500{--tw-gradient-to: #E74694 var(--tw-gradient-to-position)}.group:hover .group-hover\:to-yellow-200{--tw-gradient-to: #FCE96A var(--tw-gradient-to-position)}.group:hover .group-hover\:text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.group\/avatar:hover .group-hover\/avatar\:opacity-100,.group:hover .group-hover\:opacity-100{opacity:1}.group:focus .group-focus\:outline-none{outline:2px solid transparent;outline-offset:2px}.group:focus .group-focus\:ring-4{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.group:focus .group-focus\:ring-white{--tw-ring-opacity: 1;--tw-ring-color: rgb(255 255 255 / var(--tw-ring-opacity))}.peer:checked~.peer-checked\:text-primary{--tw-text-opacity: 1;color:rgb(14 142 240 / var(--tw-text-opacity))}.hover\:z-10:hover{z-index:10}.hover\:z-20:hover{z-index:20}.hover\:block:hover{display:block}.hover\:h-8:hover{height:2rem}.hover\:-translate-y-2:hover{--tw-translate-y: -.5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-95:hover{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border-2:hover{border-width:2px}.hover\:border-solid:hover{border-style:solid}.hover\:border-gray-300:hover{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.hover\:border-gray-600:hover{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity))}.hover\:border-green-200:hover{--tw-border-opacity: 1;border-color:rgb(188 240 218 / var(--tw-border-opacity))}.hover\:border-primary:hover{--tw-border-opacity: 1;border-color:rgb(14 142 240 / var(--tw-border-opacity))}.hover\:border-primary-light:hover{--tw-border-opacity: 1;border-color:rgb(61 171 255 / var(--tw-border-opacity))}.hover\:border-secondary:hover{--tw-border-opacity: 1;border-color:rgb(15 217 116 / var(--tw-border-opacity))}.hover\:bg-bg-light-tone:hover{--tw-bg-opacity: 1;background-color:rgb(185 210 247 / var(--tw-bg-opacity))}.hover\:bg-bg-light-tone-panel:hover{--tw-bg-opacity: 1;background-color:rgb(143 181 239 / var(--tw-bg-opacity))}.hover\:bg-blue-100:hover{--tw-bg-opacity: 1;background-color:rgb(225 239 254 / var(--tw-bg-opacity))}.hover\:bg-blue-200:hover{--tw-bg-opacity: 1;background-color:rgb(195 221 253 / var(--tw-bg-opacity))}.hover\:bg-blue-300:hover{--tw-bg-opacity: 1;background-color:rgb(164 202 254 / var(--tw-bg-opacity))}.hover\:bg-blue-400:hover{--tw-bg-opacity: 1;background-color:rgb(118 169 250 / var(--tw-bg-opacity))}.hover\:bg-blue-600:hover{--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity))}.hover\:bg-blue-800:hover{--tw-bg-opacity: 1;background-color:rgb(30 66 159 / var(--tw-bg-opacity))}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.hover\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.hover\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.hover\:bg-gray-600:hover{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}.hover\:bg-gray-900:hover{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.hover\:bg-green-200:hover{--tw-bg-opacity: 1;background-color:rgb(188 240 218 / var(--tw-bg-opacity))}.hover\:bg-green-600:hover{--tw-bg-opacity: 1;background-color:rgb(5 122 85 / var(--tw-bg-opacity))}.hover\:bg-green-700:hover{--tw-bg-opacity: 1;background-color:rgb(4 108 78 / var(--tw-bg-opacity))}.hover\:bg-green-800:hover{--tw-bg-opacity: 1;background-color:rgb(3 84 63 / var(--tw-bg-opacity))}.hover\:bg-pink-800:hover{--tw-bg-opacity: 1;background-color:rgb(153 21 75 / var(--tw-bg-opacity))}.hover\:bg-primary:hover{--tw-bg-opacity: 1;background-color:rgb(14 142 240 / var(--tw-bg-opacity))}.hover\:bg-primary-light:hover{--tw-bg-opacity: 1;background-color:rgb(61 171 255 / var(--tw-bg-opacity))}.hover\:bg-purple-800:hover{--tw-bg-opacity: 1;background-color:rgb(85 33 181 / var(--tw-bg-opacity))}.hover\:bg-red-200:hover{--tw-bg-opacity: 1;background-color:rgb(251 213 213 / var(--tw-bg-opacity))}.hover\:bg-red-600:hover{--tw-bg-opacity: 1;background-color:rgb(224 36 36 / var(--tw-bg-opacity))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(200 30 30 / var(--tw-bg-opacity))}.hover\:bg-red-800:hover{--tw-bg-opacity: 1;background-color:rgb(155 28 28 / var(--tw-bg-opacity))}.hover\:bg-white:hover{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.hover\:bg-yellow-200:hover{--tw-bg-opacity: 1;background-color:rgb(252 233 106 / var(--tw-bg-opacity))}.hover\:bg-yellow-500:hover{--tw-bg-opacity: 1;background-color:rgb(194 120 3 / var(--tw-bg-opacity))}.hover\:bg-gradient-to-bl:hover{background-image:linear-gradient(to bottom left,var(--tw-gradient-stops))}.hover\:bg-gradient-to-br:hover{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.hover\:bg-gradient-to-l:hover{background-image:linear-gradient(to left,var(--tw-gradient-stops))}.hover\:from-teal-200:hover{--tw-gradient-from: #AFECEF var(--tw-gradient-from-position);--tw-gradient-to: rgb(175 236 239 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:to-lime-200:hover{--tw-gradient-to: #d9f99d var(--tw-gradient-to-position)}.hover\:fill-primary:hover{fill:#0e8ef0}.hover\:text-blue-400:hover{--tw-text-opacity: 1;color:rgb(118 169 250 / var(--tw-text-opacity))}.hover\:text-blue-600:hover{--tw-text-opacity: 1;color:rgb(28 100 242 / var(--tw-text-opacity))}.hover\:text-blue-700:hover{--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity))}.hover\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.hover\:text-gray-700:hover{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.hover\:text-gray-900:hover{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.hover\:text-green-500:hover{--tw-text-opacity: 1;color:rgb(14 159 110 / var(--tw-text-opacity))}.hover\:text-primary:hover{--tw-text-opacity: 1;color:rgb(14 142 240 / var(--tw-text-opacity))}.hover\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(240 82 82 / var(--tw-text-opacity))}.hover\:text-red-600:hover{--tw-text-opacity: 1;color:rgb(224 36 36 / var(--tw-text-opacity))}.hover\:text-secondary:hover{--tw-text-opacity: 1;color:rgb(15 217 116 / var(--tw-text-opacity))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.hover\:underline:hover{text-decoration-line:underline}.hover\:no-underline:hover{text-decoration-line:none}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:scrollbar-thumb-primary{--scrollbar-thumb-hover: #0e8ef0 !important}.focus\:z-10:focus{z-index:10}.focus\:border-blue-300:focus{--tw-border-opacity: 1;border-color:rgb(164 202 254 / var(--tw-border-opacity))}.focus\:border-blue-500:focus{--tw-border-opacity: 1;border-color:rgb(63 131 248 / var(--tw-border-opacity))}.focus\:border-secondary:focus{--tw-border-opacity: 1;border-color:rgb(15 217 116 / var(--tw-border-opacity))}.focus\:text-blue-700:focus{--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-4:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-blue-200:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(195 221 253 / var(--tw-ring-opacity))}.focus\:ring-blue-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(164 202 254 / var(--tw-ring-opacity))}.focus\:ring-blue-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(118 169 250 / var(--tw-ring-opacity))}.focus\:ring-blue-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(63 131 248 / var(--tw-ring-opacity))}.focus\:ring-blue-700:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(26 86 219 / var(--tw-ring-opacity))}.focus\:ring-cyan-200:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(165 243 252 / var(--tw-ring-opacity))}.focus\:ring-cyan-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(103 232 249 / var(--tw-ring-opacity))}.focus\:ring-gray-200:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(229 231 235 / var(--tw-ring-opacity))}.focus\:ring-gray-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity))}.focus\:ring-gray-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(156 163 175 / var(--tw-ring-opacity))}.focus\:ring-green-200:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(188 240 218 / var(--tw-ring-opacity))}.focus\:ring-green-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(132 225 188 / var(--tw-ring-opacity))}.focus\:ring-green-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(49 196 141 / var(--tw-ring-opacity))}.focus\:ring-lime-200:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(217 249 157 / var(--tw-ring-opacity))}.focus\:ring-lime-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(190 242 100 / var(--tw-ring-opacity))}.focus\:ring-pink-200:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(250 209 232 / var(--tw-ring-opacity))}.focus\:ring-pink-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(248 180 217 / var(--tw-ring-opacity))}.focus\:ring-purple-200:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(220 215 254 / var(--tw-ring-opacity))}.focus\:ring-purple-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(202 191 253 / var(--tw-ring-opacity))}.focus\:ring-red-100:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(253 232 232 / var(--tw-ring-opacity))}.focus\:ring-red-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(248 180 180 / var(--tw-ring-opacity))}.focus\:ring-red-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(249 128 128 / var(--tw-ring-opacity))}.focus\:ring-secondary:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(15 217 116 / var(--tw-ring-opacity))}.focus\:ring-teal-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(126 220 226 / var(--tw-ring-opacity))}.focus\:ring-yellow-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(250 202 21 / var(--tw-ring-opacity))}.focus\:ring-yellow-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(227 160 8 / var(--tw-ring-opacity))}.active\:scale-75:active{--tw-scale-x: .75;--tw-scale-y: .75;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\:scale-90:active{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\:scrollbar-thumb-secondary{--scrollbar-thumb-active: #0fd974 !important}:is(.dark .dark\:divide-gray-700)>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(55 65 81 / var(--tw-divide-opacity))}:is(.dark .dark\:border-bg-light){--tw-border-opacity: 1;border-color:rgb(226 237 255 / var(--tw-border-opacity))}:is(.dark .dark\:border-blue-500){--tw-border-opacity: 1;border-color:rgb(63 131 248 / var(--tw-border-opacity))}:is(.dark .dark\:border-gray-500){--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity))}:is(.dark .dark\:border-gray-600){--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity))}:is(.dark .dark\:border-gray-700){--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity))}:is(.dark .dark\:border-gray-800){--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity))}:is(.dark .dark\:border-gray-900){--tw-border-opacity: 1;border-color:rgb(17 24 39 / var(--tw-border-opacity))}:is(.dark .dark\:border-green-500){--tw-border-opacity: 1;border-color:rgb(14 159 110 / var(--tw-border-opacity))}:is(.dark .dark\:border-pink-400){--tw-border-opacity: 1;border-color:rgb(241 126 184 / var(--tw-border-opacity))}:is(.dark .dark\:border-pink-500){--tw-border-opacity: 1;border-color:rgb(231 70 148 / var(--tw-border-opacity))}:is(.dark .dark\:border-purple-400){--tw-border-opacity: 1;border-color:rgb(172 148 250 / var(--tw-border-opacity))}:is(.dark .dark\:border-purple-500){--tw-border-opacity: 1;border-color:rgb(144 97 249 / var(--tw-border-opacity))}:is(.dark .dark\:border-red-500){--tw-border-opacity: 1;border-color:rgb(240 82 82 / var(--tw-border-opacity))}:is(.dark .dark\:border-transparent){border-color:transparent}:is(.dark .dark\:border-yellow-300){--tw-border-opacity: 1;border-color:rgb(250 202 21 / var(--tw-border-opacity))}:is(.dark .dark\:bg-bg-dark){--tw-bg-opacity: 1;background-color:rgb(19 46 89 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-bg-dark-discussion){--tw-bg-opacity: 1;background-color:rgb(67 94 138 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-bg-dark-tone){--tw-bg-opacity: 1;background-color:rgb(37 71 125 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-bg-dark-tone-panel){--tw-bg-opacity: 1;background-color:rgb(67 103 163 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-black){--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-blue-200){--tw-bg-opacity: 1;background-color:rgb(195 221 253 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-blue-500){--tw-bg-opacity: 1;background-color:rgb(63 131 248 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-blue-600){--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-blue-700){--tw-bg-opacity: 1;background-color:rgb(26 86 219 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-blue-800){--tw-bg-opacity: 1;background-color:rgb(30 66 159 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-blue-900){--tw-bg-opacity: 1;background-color:rgb(35 56 118 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-300){--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-400){--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-500){--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-600){--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-700){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-800){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-800\/30){background-color:#1f29374d}:is(.dark .dark\:bg-gray-800\/50){background-color:#1f293780}:is(.dark .dark\:bg-gray-900){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-green-200){--tw-bg-opacity: 1;background-color:rgb(188 240 218 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-green-500){--tw-bg-opacity: 1;background-color:rgb(14 159 110 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-green-600){--tw-bg-opacity: 1;background-color:rgb(5 122 85 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-green-800){--tw-bg-opacity: 1;background-color:rgb(3 84 63 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-indigo-200){--tw-bg-opacity: 1;background-color:rgb(205 219 254 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-indigo-500){--tw-bg-opacity: 1;background-color:rgb(104 117 245 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-orange-700){--tw-bg-opacity: 1;background-color:rgb(180 52 3 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-orange-800){--tw-bg-opacity: 1;background-color:rgb(138 44 13 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-pink-200){--tw-bg-opacity: 1;background-color:rgb(250 209 232 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-pink-600){--tw-bg-opacity: 1;background-color:rgb(214 31 105 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-purple-200){--tw-bg-opacity: 1;background-color:rgb(220 215 254 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-purple-500){--tw-bg-opacity: 1;background-color:rgb(144 97 249 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-purple-600){--tw-bg-opacity: 1;background-color:rgb(126 58 242 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-red-200){--tw-bg-opacity: 1;background-color:rgb(251 213 213 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-red-500){--tw-bg-opacity: 1;background-color:rgb(240 82 82 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-red-600){--tw-bg-opacity: 1;background-color:rgb(224 36 36 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-red-800){--tw-bg-opacity: 1;background-color:rgb(155 28 28 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-yellow-200){--tw-bg-opacity: 1;background-color:rgb(252 233 106 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-opacity-70){--tw-bg-opacity: .7}:is(.dark .dark\:bg-opacity-80){--tw-bg-opacity: .8}:is(.dark .dark\:from-bg-dark){--tw-gradient-from: #132e59 var(--tw-gradient-from-position);--tw-gradient-to: rgb(19 46 89 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}:is(.dark .dark\:from-bg-dark-tone){--tw-gradient-from: #25477d var(--tw-gradient-from-position);--tw-gradient-to: rgb(37 71 125 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}:is(.dark .dark\:via-bg-dark){--tw-gradient-to: rgb(19 46 89 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #132e59 var(--tw-gradient-via-position), var(--tw-gradient-to)}:is(.dark .dark\:fill-gray-300){fill:#d1d5db}:is(.dark .dark\:fill-white){fill:#fff}:is(.dark .dark\:text-blue-200){--tw-text-opacity: 1;color:rgb(195 221 253 / var(--tw-text-opacity))}:is(.dark .dark\:text-blue-500){--tw-text-opacity: 1;color:rgb(63 131 248 / var(--tw-text-opacity))}:is(.dark .dark\:text-blue-800){--tw-text-opacity: 1;color:rgb(30 66 159 / var(--tw-text-opacity))}:is(.dark .dark\:text-gray-200){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}:is(.dark .dark\:text-gray-300){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}:is(.dark .dark\:text-gray-400){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}:is(.dark .dark\:text-gray-500){--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}:is(.dark .dark\:text-gray-600){--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}:is(.dark .dark\:text-gray-800){--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity))}:is(.dark .dark\:text-green-200){--tw-text-opacity: 1;color:rgb(188 240 218 / var(--tw-text-opacity))}:is(.dark .dark\:text-green-500){--tw-text-opacity: 1;color:rgb(14 159 110 / var(--tw-text-opacity))}:is(.dark .dark\:text-green-800){--tw-text-opacity: 1;color:rgb(3 84 63 / var(--tw-text-opacity))}:is(.dark .dark\:text-green-900){--tw-text-opacity: 1;color:rgb(1 71 55 / var(--tw-text-opacity))}:is(.dark .dark\:text-indigo-500){--tw-text-opacity: 1;color:rgb(104 117 245 / var(--tw-text-opacity))}:is(.dark .dark\:text-indigo-900){--tw-text-opacity: 1;color:rgb(54 47 120 / var(--tw-text-opacity))}:is(.dark .dark\:text-orange-200){--tw-text-opacity: 1;color:rgb(252 217 189 / var(--tw-text-opacity))}:is(.dark .dark\:text-pink-400){--tw-text-opacity: 1;color:rgb(241 126 184 / var(--tw-text-opacity))}:is(.dark .dark\:text-pink-500){--tw-text-opacity: 1;color:rgb(231 70 148 / var(--tw-text-opacity))}:is(.dark .dark\:text-pink-900){--tw-text-opacity: 1;color:rgb(117 26 61 / var(--tw-text-opacity))}:is(.dark .dark\:text-purple-400){--tw-text-opacity: 1;color:rgb(172 148 250 / var(--tw-text-opacity))}:is(.dark .dark\:text-purple-500){--tw-text-opacity: 1;color:rgb(144 97 249 / var(--tw-text-opacity))}:is(.dark .dark\:text-purple-900){--tw-text-opacity: 1;color:rgb(74 29 150 / var(--tw-text-opacity))}:is(.dark .dark\:text-red-200){--tw-text-opacity: 1;color:rgb(251 213 213 / var(--tw-text-opacity))}:is(.dark .dark\:text-red-500){--tw-text-opacity: 1;color:rgb(240 82 82 / var(--tw-text-opacity))}:is(.dark .dark\:text-red-800){--tw-text-opacity: 1;color:rgb(155 28 28 / var(--tw-text-opacity))}:is(.dark .dark\:text-red-900){--tw-text-opacity: 1;color:rgb(119 29 29 / var(--tw-text-opacity))}:is(.dark .dark\:text-slate-50){--tw-text-opacity: 1;color:rgb(248 250 252 / var(--tw-text-opacity))}:is(.dark .dark\:text-white){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}:is(.dark .dark\:text-yellow-300){--tw-text-opacity: 1;color:rgb(250 202 21 / var(--tw-text-opacity))}:is(.dark .dark\:text-yellow-500){--tw-text-opacity: 1;color:rgb(194 120 3 / var(--tw-text-opacity))}:is(.dark .dark\:text-yellow-800){--tw-text-opacity: 1;color:rgb(114 59 19 / var(--tw-text-opacity))}:is(.dark .dark\:text-yellow-900){--tw-text-opacity: 1;color:rgb(99 49 18 / var(--tw-text-opacity))}:is(.dark .dark\:placeholder-gray-400)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity))}:is(.dark .dark\:placeholder-gray-400)::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity))}:is(.dark .dark\:shadow-lg){--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}:is(.dark .dark\:shadow-blue-800\/80){--tw-shadow-color: rgb(30 66 159 / .8);--tw-shadow: var(--tw-shadow-colored)}:is(.dark .dark\:shadow-cyan-800\/80){--tw-shadow-color: rgb(21 94 117 / .8);--tw-shadow: var(--tw-shadow-colored)}:is(.dark .dark\:shadow-green-800\/80){--tw-shadow-color: rgb(3 84 63 / .8);--tw-shadow: var(--tw-shadow-colored)}:is(.dark .dark\:shadow-lime-800\/80){--tw-shadow-color: rgb(63 98 18 / .8);--tw-shadow: var(--tw-shadow-colored)}:is(.dark .dark\:shadow-pink-800\/80){--tw-shadow-color: rgb(153 21 75 / .8);--tw-shadow: var(--tw-shadow-colored)}:is(.dark .dark\:shadow-purple-800\/80){--tw-shadow-color: rgb(85 33 181 / .8);--tw-shadow: var(--tw-shadow-colored)}:is(.dark .dark\:shadow-red-800\/80){--tw-shadow-color: rgb(155 28 28 / .8);--tw-shadow: var(--tw-shadow-colored)}:is(.dark .dark\:shadow-teal-800\/80){--tw-shadow-color: rgb(5 80 92 / .8);--tw-shadow: var(--tw-shadow-colored)}:is(.dark .dark\:ring-gray-500){--tw-ring-opacity: 1;--tw-ring-color: rgb(107 114 128 / var(--tw-ring-opacity))}:is(.dark .dark\:ring-offset-gray-700){--tw-ring-offset-color: #374151}:is(.dark .dark\:ring-offset-gray-800){--tw-ring-offset-color: #1F2937}:is(.dark .dark\:scrollbar-track-bg-dark){--scrollbar-track: #132e59 !important}:is(.dark .dark\:scrollbar-track-bg-dark-tone){--scrollbar-track: #25477d !important}:is(.dark .dark\:scrollbar-thumb-bg-dark-tone){--scrollbar-thumb: #25477d !important}:is(.dark .dark\:scrollbar-thumb-bg-dark-tone-panel){--scrollbar-thumb: #4367a3 !important}:is(.dark .odd\:dark\:bg-bg-dark-tone):nth-child(odd){--tw-bg-opacity: 1;background-color:rgb(37 71 125 / var(--tw-bg-opacity))}:is(.dark .dark\:even\:bg-bg-dark-discussion-odd:nth-child(2n)){--tw-bg-opacity: 1;background-color:rgb(40 68 113 / var(--tw-bg-opacity))}:is(.dark .dark\:even\:bg-bg-dark-tone-panel:nth-child(2n)){--tw-bg-opacity: 1;background-color:rgb(67 103 163 / var(--tw-bg-opacity))}:is(.dark .group:hover .dark\:group-hover\:bg-gray-800\/60){background-color:#1f293799}:is(.dark .group:hover .dark\:group-hover\:text-white){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}:is(.dark .group:focus .dark\:group-focus\:ring-gray-800\/70){--tw-ring-color: rgb(31 41 55 / .7)}:is(.dark .dark\:hover\:border-gray-600:hover){--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity))}:is(.dark .dark\:hover\:border-primary:hover){--tw-border-opacity: 1;border-color:rgb(14 142 240 / var(--tw-border-opacity))}:is(.dark .dark\:hover\:bg-bg-dark-tone:hover){--tw-bg-opacity: 1;background-color:rgb(37 71 125 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-blue-300:hover){--tw-bg-opacity: 1;background-color:rgb(164 202 254 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-blue-600:hover){--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-blue-700:hover){--tw-bg-opacity: 1;background-color:rgb(26 86 219 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-gray-600:hover){--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-gray-700:hover){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-gray-800:hover){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-green-300:hover){--tw-bg-opacity: 1;background-color:rgb(132 225 188 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-green-600:hover){--tw-bg-opacity: 1;background-color:rgb(5 122 85 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-green-700:hover){--tw-bg-opacity: 1;background-color:rgb(4 108 78 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-pink-500:hover){--tw-bg-opacity: 1;background-color:rgb(231 70 148 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-pink-700:hover){--tw-bg-opacity: 1;background-color:rgb(191 18 93 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-primary:hover){--tw-bg-opacity: 1;background-color:rgb(14 142 240 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-purple-500:hover){--tw-bg-opacity: 1;background-color:rgb(144 97 249 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-purple-700:hover){--tw-bg-opacity: 1;background-color:rgb(108 43 217 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-red-300:hover){--tw-bg-opacity: 1;background-color:rgb(248 180 180 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-red-600:hover){--tw-bg-opacity: 1;background-color:rgb(224 36 36 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-red-700:hover){--tw-bg-opacity: 1;background-color:rgb(200 30 30 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-yellow-300:hover){--tw-bg-opacity: 1;background-color:rgb(250 202 21 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-yellow-400:hover){--tw-bg-opacity: 1;background-color:rgb(227 160 8 / var(--tw-bg-opacity))}:is(.dark .hover\:dark\:bg-bg-dark-tone):hover{--tw-bg-opacity: 1;background-color:rgb(37 71 125 / var(--tw-bg-opacity))}:is(.dark .hover\:dark\:bg-bg-dark-tone-panel):hover{--tw-bg-opacity: 1;background-color:rgb(67 103 163 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:fill-primary:hover){fill:#0e8ef0}:is(.dark .dark\:hover\:text-blue-500:hover){--tw-text-opacity: 1;color:rgb(63 131 248 / var(--tw-text-opacity))}:is(.dark .dark\:hover\:text-gray-300:hover){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}:is(.dark .dark\:hover\:text-gray-900:hover){--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}:is(.dark .dark\:hover\:text-white:hover){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}:is(.dark .dark\:hover\:scrollbar-thumb-primary){--scrollbar-thumb-hover: #0e8ef0 !important}:is(.dark .dark\:focus\:border-blue-500:focus){--tw-border-opacity: 1;border-color:rgb(63 131 248 / var(--tw-border-opacity))}:is(.dark .dark\:focus\:border-secondary:focus){--tw-border-opacity: 1;border-color:rgb(15 217 116 / var(--tw-border-opacity))}:is(.dark .dark\:focus\:text-white:focus){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}:is(.dark .dark\:focus\:ring-blue-500:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(63 131 248 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-blue-600:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(28 100 242 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-blue-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(30 66 159 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-cyan-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(21 94 117 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-gray-500:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(107 114 128 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-gray-600:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(75 85 99 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-gray-700:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(55 65 81 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-gray-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(31 41 55 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-green-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(3 84 63 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-lime-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(63 98 18 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-pink-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(153 21 75 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-pink-900:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(117 26 61 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-purple-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(85 33 181 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-purple-900:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(74 29 150 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-red-400:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(249 128 128 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-red-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(155 28 28 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-red-900:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(119 29 29 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-secondary:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(15 217 116 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-teal-700:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(3 102 114 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-teal-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(5 80 92 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-yellow-900:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(99 49 18 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-offset-gray-700:focus){--tw-ring-offset-color: #374151}@media (min-width: 640px){.sm\:mt-0{margin-top:0}.sm\:h-10{height:2.5rem}.sm\:h-6{height:1.5rem}.sm\:h-64{height:16rem}.sm\:w-1\/4{width:25%}.sm\:w-10{width:2.5rem}.sm\:w-6{width:1.5rem}.sm\:w-auto{width:auto}.sm\:flex-row{flex-direction:row}.sm\:rounded-lg{border-radius:.5rem}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:text-center{text-align:center}.sm\:text-xs{font-size:.75rem;line-height:1rem}}@media (min-width: 768px){.md\:inset-0{top:0;right:0;bottom:0;left:0}.md\:order-2{order:2}.md\:my-2{margin-top:.5rem;margin-bottom:.5rem}.md\:mr-6{margin-right:1.5rem}.md\:mt-0{margin-top:0}.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:h-auto{height:auto}.md\:h-full{height:100%}.md\:w-1\/4{width:25%}.md\:w-48{width:12rem}.md\:w-auto{width:auto}.md\:max-w-xl{max-width:36rem}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:items-center{align-items:center}.md\:justify-between{justify-content:space-between}.md\:space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * calc(1 - var(--tw-space-x-reverse)))}.md\:space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(2rem * var(--tw-space-x-reverse));margin-left:calc(2rem * calc(1 - var(--tw-space-x-reverse)))}.md\:rounded-none{border-radius:0}.md\:rounded-l-lg{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.md\:border-0{border-width:0px}.md\:bg-transparent{background-color:transparent}.md\:p-0{padding:0}.md\:p-6{padding:1.5rem}.md\:text-sm{font-size:.875rem;line-height:1.25rem}.md\:font-medium{font-weight:500}.md\:text-blue-700{--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity))}.md\:hover\:bg-transparent:hover{background-color:transparent}.md\:hover\:text-blue-700:hover{--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity))}:is(.dark .md\:dark\:bg-gray-900){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}:is(.dark .md\:dark\:hover\:bg-transparent:hover){background-color:transparent}:is(.dark .md\:dark\:hover\:text-white:hover){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}}@media (min-width: 1024px){.lg\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}}@media (min-width: 1280px){.xl\:h-80{height:20rem}.xl\:w-1\/6{width:16.666667%}}@media (min-width: 1536px){.\32xl\:h-96{height:24rem}} diff --git a/web/dist/assets/index-db831b95.js b/web/dist/assets/index-a1f2945d.js similarity index 93% rename from web/dist/assets/index-db831b95.js rename to web/dist/assets/index-a1f2945d.js index dd1a611d..290fe339 100644 --- a/web/dist/assets/index-db831b95.js +++ b/web/dist/assets/index-a1f2945d.js @@ -144,14 +144,14 @@ failed to uninstall!`,4,!1),this.$store.dispatch("refreshDiskUsage"))};Ye.on("un Endpoint error: `+i.message,4,!1),this.isLoading=!1}}):(this.$store.state.toast.showToast("Binding has no settings",4,!1),this.isLoading=!1))})}catch(e){this.isLoading=!1,this.$store.state.toast.showToast("Could not open binding settings. Endpoint error: "+e.message,4,!1)}},onReloadBinding(n){this.isLoading=!0,Ue.post("/reload_binding",{name:n.binding.folder}).then(e=>{if(e)return this.isLoading=!1,console.log("reload_binding",e),e.data.status?this.$store.state.toast.showToast("Binding reloaded successfully!",4,!0):this.$store.state.toast.showToast("Could not reinstall binding",4,!1),e.data;this.isLoading=!1}).catch(e=>(this.isLoading=!1,this.$store.state.toast.showToast(`Could not reinstall binding `+e.message,4,!1),{status:!1}))},onSettingsPersonality(n){try{this.isLoading=!0,Ue.get("/get_active_personality_settings").then(e=>{this.isLoading=!1,e&&(console.log("pers sett",e),e.data&&Object.keys(e.data).length>0?this.$store.state.universalForm.showForm(e.data,"Personality settings - "+n.personality.name,"Save changes","Cancel").then(t=>{try{Ue.post("/set_active_personality_settings",t).then(i=>{i&&i.data?(console.log("personality set with new settings",i.data),this.$store.state.toast.showToast("Personality settings updated successfully!",4,!0)):(this.$store.state.toast.showToast(`Did not get Personality settings responses. `+i,4,!1),this.isLoading=!1)})}catch(i){this.$store.state.toast.showToast(`Did not get Personality settings responses. - Endpoint error: `+i.message,4,!1),this.isLoading=!1}}):(this.$store.state.toast.showToast("Personality has no settings",4,!1),this.isLoading=!1))})}catch(e){this.isLoading=!1,this.$store.state.toast.showToast("Could not open personality settings. Endpoint error: "+e.message,4,!1)}},onMessageBoxOk(){console.log("OK button clicked")},update_personality_category(n,e){this.personality_category=n,e()},update_extension_category(n,e){this.extension_category=n,e()},refresh(){console.log("Refreshing"),this.$store.dispatch("refreshConfig").then(()=>{console.log(this.personality_category),this.api_get_req("list_personalities_categories").then(n=>{console.log("cats",n),this.persCatgArr=n,this.personalitiesFiltered=this.personalities.filter(e=>e.category===this.personality_category),this.personalitiesFiltered.sort()}),this.api_get_req("list_extensions_categories").then(n=>{console.log("cats",n),this.extCatgArr=n,console.log("this.$store.state.extensionsZoo",this.$store.state.extensionsZoo),console.log("this.extension_category",this.extension_category),this.extensionsFiltered=this.$store.state.extensionsZoo.filter(e=>e.category===this.extension_category),this.extensionsFiltered.sort(),console.log("this.extensionsFiltered",this.extensionsFiltered)})})},toggleAccordion(){this.showAccordion=!this.showAccordion},async update_setting(n,e,t){console.log("Updating setting",n,":",e),this.isLoading=!0;const i={setting_name:n,setting_value:e};let s=await Ue.post("/update_setting",i);if(s)return this.isLoading=!1,console.log("update_setting",s),s.status?this.$store.state.toast.showToast(`Setting updated successfully. + Endpoint error: `+i.message,4,!1),this.isLoading=!1}}):(this.$store.state.toast.showToast("Personality has no settings",4,!1),this.isLoading=!1))})}catch(e){this.isLoading=!1,this.$store.state.toast.showToast("Could not open personality settings. Endpoint error: "+e.message,4,!1)}},onMessageBoxOk(){console.log("OK button clicked")},update_personality_category(n,e){this.personality_category=n,e()},update_extension_category(n,e){this.extension_category=n,e()},refresh(){console.log("Refreshing"),this.$store.dispatch("refreshConfig").then(()=>{console.log(this.personality_category),this.api_get_req("list_personalities_categories").then(n=>{console.log("cats",n),this.persCatgArr=n,this.personalitiesFiltered=this.personalities.filter(e=>e.category===this.personality_category),this.personalitiesFiltered.sort()}),this.api_get_req("list_extensions_categories").then(n=>{console.log("cats",n),this.extCatgArr=n,console.log("this.$store.state.extensionsZoo",this.$store.state.extensionsZoo),console.log("this.extension_category",this.extension_category),this.extensionsFiltered=this.$store.state.extensionsZoo.filter(e=>e.category===this.extension_category),this.extensionsFiltered.sort(),console.log("this.extensionsFiltered",this.extensionsFiltered)})})},toggleAccordion(){this.showAccordion=!this.showAccordion},async update_setting(n,e,t){this.isLoading=!0;const i={setting_name:n,setting_value:e};console.log("Updating setting",n,":",e);let s=await Ue.post("/update_setting",i);if(s)return this.isLoading=!1,console.log("update_setting",s),s.status?this.$store.state.toast.showToast(`Setting updated successfully. `,4,!0):this.$store.state.toast.showToast(`Setting update failed. Please view the console for more details.`,4,!1),t!==void 0&&t(s),s.data;this.isLoading=!1},async refreshModelsZoo(){this.models_zoo=[],console.log("refreshing models"),this.is_loading_zoo=!0,await this.$store.dispatch("refreshModelsZoo"),console.log("ModelsZoo refreshed"),await this.$store.dispatch("refreshModels"),console.log("Models refreshed"),this.updateModelsZoo(),console.log("Models updated"),this.is_loading_zoo=!1},async updateModelsZoo(){let n=this.$store.state.modelsZoo;if(n.length==0)return;let e=n.findIndex(t=>t.name==this.configFile.model_name);e>0?this.imgModel=n[e].icon:this.imgModel=zi,console.log(`REFRESHING models using sorting ${this.sort_type}`),n.length>1?(this.sort_type==0?(n.sort((t,i)=>{const s=new Date(t.last_commit_time);return new Date(i.last_commit_time)-s}),console.log("Sorted")):this.sort_type==1?n.sort((t,i)=>i.rank-t.rank):this.sort_type==2?n.sort((t,i)=>t.name.localeCompare(i.name)):this.sort_type==3&&n.sort((t,i)=>t.name.localeCompare(i.name)),console.log("Sorted")):console.log("No sorting needed"),n.forEach(t=>{t.name==this.$store.state.config.model_name?t.selected=!0:t.selected=!1}),console.log("Selected models");for(let t=0;tr.name==i);if(s==-1)for(let r=0;ra.name==i),s!=-1)){s=r,console.log(`Found ${i} at index ${s}`);break}}if(s==-1){let r={};r.name=i,r.icon=this.imgBinding,r.isCustomModel=!0,r.isInstalled=!0,n.push(r)}else n[s].isInstalled=!0}console.log("Determined models"),n.sort((t,i)=>t.isInstalled&&!i.isInstalled?-1:!t.isInstalled&&i.isInstalled?1:0),console.log("Done"),this.models_zoo=this.$store.state.modelsZoo},update_binding(n){this.isLoading=!0,this.$store.state.modelsZoo=[],this.configFile.model_name=null,this.$store.state.config.model_name=null,console.log("updating binding_name"),this.update_setting("binding_name",n,async e=>{console.log("updated binding_name"),await this.$store.dispatch("refreshConfig"),this.models_zoo=[],this.mzc_collapsed=!0;const t=this.bindingsZoo.findIndex(s=>s.folder==n),i=this.bindingsZoo[t];i?i.installed=!0:i.installed=!1,this.settingsChanged=!0,this.isLoading=!1,Fe(()=>{Be.replace()}),console.log("updating model"),this.update_model(null).then(()=>{}),Fe(()=>{Be.replace()})}),Fe(()=>{Be.replace()})},async update_model(n){n||(this.isModelSelected=!1),this.isLoading=!0;let e=await this.update_setting("model_name",n);return this.isLoading=!1,Fe(()=>{Be.replace()}),e},applyConfiguration(){this.isLoading=!0,Ue.post("/apply_settings",{config:this.configFile}).then(n=>{this.isLoading=!1,n.data.status?(this.$store.state.toast.showToast("Configuration changed successfully.",4,!0),this.settingsChanged=!1):this.$store.state.toast.showToast("Configuration change failed.",4,!1),Fe(()=>{Be.replace()})})},save_configuration(){this.showConfirmation=!1,Ue.post("/save_settings",{}).then(n=>{if(n)return n.status||this.$store.state.messageBox.showMessage("Error: Couldn't save settings!"),n.data}).catch(n=>(console.log(n.message,"save_configuration"),this.$store.state.messageBox.showMessage("Couldn't save settings!"),{status:!1}))},reset_configuration(){this.$store.state.yesNoDialog.askQuestion(`Are you sure? This will delete all your configurations and get back to default configuration.`).then(n=>{n&&Ue.post("/reset_settings",{}).then(e=>{if(e)return e.status?this.$store.state.messageBox.showMessage("Settings have been reset correctly"):this.$store.state.messageBox.showMessage("Couldn't reset settings!"),e.data}).catch(e=>(console.log(e.message,"reset_configuration"),this.$store.state.messageBox.showMessage("Couldn't reset settings!"),{status:!1}))})},async api_get_req(n){try{const e=await Ue.get("/"+n);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - settings");return}},closeToast(){this.showToast=!1},async getPersonalitiesArr(){this.isLoading=!0,this.personalities=[];const n=await this.api_get_req("get_all_personalities"),e=this.$store.state.config,t=Object.keys(n);for(let i=0;i{const l=e.personalities.includes(s+"/"+a.folder);let c={};return c=a,c.category=s,c.language="",c.full_path=s+"/"+a.folder,c.isMounted=l,c});this.personalities.length==0?this.personalities=o:this.personalities=this.personalities.concat(o)}this.personalities.sort((i,s)=>i.name.localeCompare(s.name)),this.personalitiesFiltered=this.personalities.filter(i=>i.category===this.configFile.personality_category),this.personalitiesFiltered.sort(),console.log("per filtered",this.personalitiesFiltered),this.isLoading=!1},async getExtensionsArr(){this.isLoading=!0,this.extensions=[];const n=await this.api_get_req("get_all_extensions"),e=this.$store.state.config,t=Object.keys(n);for(let i=0;i{const l=e.extensions.includes(s+"/"+a.folder);let c={};return c=a,c.category=s,c.language="",c.full_path=s+"/"+a.folder,c.isMounted=l,c});this.extensions.length==0?this.extensions=o:this.extensions=this.extensions.concat(o)}this.extensions.sort((i,s)=>i.name.localeCompare(s.name)),this.extensions=this.extensions.filter(i=>i.category===this.configFile.personality_category),this.extensions.sort(),console.log("per filtered",this.extensionsFiltered),this.isLoading=!1},async filterPersonalities(){if(!this.searchPersonality){this.personalitiesFiltered=this.personalities.filter(t=>t.category===this.configFile.personality_category),this.personalitiesFiltered.sort(),this.searchPersonalityInProgress=!1;return}const n=this.searchPersonality.toLowerCase(),e=this.personalities.filter(t=>{if(t.name&&t.name.toLowerCase().includes(n)||t.description&&t.description.toLowerCase().includes(n)||t.full_path&&t.full_path.toLowerCase().includes(n))return t});e.length>0?this.personalitiesFiltered=e.sort():(this.personalitiesFiltered=this.personalities.filter(t=>t.category===this.configFile.personality_category),this.personalitiesFiltered.sort()),this.searchPersonalityInProgress=!1},async filterExtensions(){if(!this.searchExtension){this.personalitiesFiltered=this.extensions.filter(t=>t.category===this.extension_category),this.personalitiesFiltered.sort(),this.searchExtensionInProgress=!1;return}const n=this.searchExtension.toLowerCase(),e=this.personalities.filter(t=>{if(t.name&&t.name.toLowerCase().includes(n)||t.description&&t.description.toLowerCase().includes(n)||t.full_path&&t.full_path.toLowerCase().includes(n))return t});e.length>0?this.personalitiesFiltered=e.sort():(this.personalitiesFiltered=this.personalities.filter(t=>t.category===this.configFile.personality_category),this.personalitiesFiltered.sort()),this.searchExtensionInProgress=!1},async filterModels(){const n=this.searchModel.toLowerCase();this.is_loading_zoo=!0,console.log("filtering models"),console.log(this.models_zoo);const e=this.models_zoo.filter(t=>{if(t.name&&t.name.toLowerCase().includes(n)||t.description&&t.description.toLowerCase().includes(n)||t.category&&t.category.toLowerCase().includes(n))return t});this.is_loading_zoo=!1,e.length>0?this.modelsFiltered=e:this.modelsFiltered=[],this.searchModelInProgress=!1},computedFileSize(n){return Ki(n)},async mount_personality(n){if(!n)return{status:!1,error:"no personality - mount_personality"};try{const e={language:n.language?n.language:"",category:n.category?n.category:"",folder:n.folder?n.folder:""},t=await Ue.post("/mount_personality",e);if(t)return t.data}catch(e){console.log(e.message,"mount_personality - settings");return}},async unmount_personality(n){if(!n)return{status:!1,error:"no personality - unmount_personality"};const e={language:n.language,category:n.category,folder:n.folder};try{const t=await Ue.post("/unmount_personality",e);if(t)return t.data}catch(t){console.log(t.message,"unmount_personality - settings");return}},async select_personality(n){if(!n)return{status:!1,error:"no personality - select_personality"};let e=n.language==null?n.full_path:n.full_path+":"+n.language;console.log("pth",e);const i={id:this.configFile.personalities.findIndex(s=>s===e)};try{const s=await Ue.post("/select_personality",i);if(s)return this.$store.dispatch("refreshConfig").then(()=>{this.$store.dispatch("refreshPersonalitiesZoo").then(()=>{this.$store.dispatch("refreshMountedPersonalities")})}),s.data}catch(s){console.log(s.message,"select_personality - settings");return}},async mount_extension(n){if(!n)return{status:!1,error:"no extension - mount_extension"};try{const e={category:n.category,folder:n.folder},t=await Ue.post("/mount_extension",e);if(t)return t.data}catch(e){console.log(e.message,"mount_extension - settings");return}},async unmount_extension(n){if(!n)return{status:!1,error:"no extension - unmount_extension"};const e={language:n.language,category:n.category,folder:n.folder};try{const t=await Ue.post("/unmount_extension",e);if(t)return t.data}catch(t){console.log(t.message,"unmount_extension - settings");return}},async mountPersonality(n){if(this.isLoading=!0,console.log("mount pers",n),n.personality.disclaimer!=""&&this.$store.state.messageBox.showMessage(n.personality.disclaimer),!n)return;if(this.configFile.personalities.includes(n.personality.full_path)){this.isLoading=!1,this.$store.state.toast.showToast("Personality already mounted",4,!1);return}const e=await this.mount_personality(n.personality);console.log("mount_personality res",e),e&&e.status&&e.active_personality_id>-1&&e.personalities.includes(n.personality.full_path)?(this.configFile.personalities=e.personalities,this.$store.state.toast.showToast("Personality mounted",4,!0),n.isMounted=!0,(await this.select_personality(n.personality)).status&&this.$store.state.toast.showToast(`Selected personality: `+n.personality.name,4,!0),this.$store.dispatch("refreshMountedPersonalities")):(n.isMounted=!1,this.$store.state.toast.showToast(`Could not mount personality Error: `+e.error+` Response: -`+e,4,!1)),this.isLoading=!1},async unmountAll(){await Ue.get("/unmount_all_personalities"),this.$store.dispatch("refreshMountedPersonalities"),this.$store.state.toast.showToast("All personas unmounted",4,!0)},async unmountPersonality(n){if(this.isLoading=!0,!n)return;const e=await this.unmount_personality(n.personality||n);if(e.status){this.configFile.personalities=e.personalities,this.$store.state.toast.showToast("Personality unmounted",4,!0);const t=this.personalities.findIndex(a=>a.full_path==n.full_path),i=this.personalitiesFiltered.findIndex(a=>a.full_path==n.full_path),s=this.$refs.personalitiesZoo.findIndex(a=>a.full_path==n.full_path);console.log("ppp",this.personalities[t]),this.personalities[t].isMounted=!1,i>-1&&(this.personalitiesFiltered[i].isMounted=!1),s>-1&&(this.$refs.personalitiesZoo[s].isMounted=!1),this.$store.dispatch("refreshMountedPersonalities");const r=this.mountedPersArr[this.mountedPersArr.length-1];console.log(r,this.mountedPersArr.length),(await this.select_personality(n.personality)).status&&this.$store.state.toast.showToast(`Selected personality: +`+e,4,!1)),this.isLoading=!1},async unmountAll(){await Ue.get("/unmount_all_personalities"),this.$store.dispatch("refreshMountedPersonalities"),this.$store.dispatch("refreshConfig"),this.$store.state.toast.showToast("All personas unmounted",4,!0)},async unmountPersonality(n){if(this.isLoading=!0,!n)return;const e=await this.unmount_personality(n.personality||n);if(e.status){this.configFile.personalities=e.personalities,this.$store.state.toast.showToast("Personality unmounted",4,!0);const t=this.personalities.findIndex(a=>a.full_path==n.full_path),i=this.personalitiesFiltered.findIndex(a=>a.full_path==n.full_path),s=this.$refs.personalitiesZoo.findIndex(a=>a.full_path==n.full_path);console.log("ppp",this.personalities[t]),this.personalities[t].isMounted=!1,i>-1&&(this.personalitiesFiltered[i].isMounted=!1),s>-1&&(this.$refs.personalitiesZoo[s].isMounted=!1),this.$store.dispatch("refreshMountedPersonalities");const r=this.mountedPersArr[this.mountedPersArr.length-1];console.log(r,this.mountedPersArr.length),(await this.select_personality(n.personality)).status&&this.$store.state.toast.showToast(`Selected personality: `+r.name,4,!0)}else this.$store.state.toast.showToast(`Could not unmount personality Error: `+e.error,4,!1);this.isLoading=!1},async remountPersonality(n){await this.unmountPersonality(n),await this.mountPersonality(n)},async mountExtension(n){if(this.isLoading=!0,console.log("mount ext",n),!n)return;if(this.configFile.personalities.includes(n.extension.full_path)){this.isLoading=!1,this.$store.state.toast.showToast("Extension already mounted",4,!1);return}const e=await this.mount_extension(n.extension);console.log("mount_extension res",e),e&&e.status&&e.extensions.includes(n.extension.full_path)?(this.configFile.extensions=e.extensions,this.$store.state.toast.showToast("Extension mounted",4,!0),n.isMounted=!0,this.$store.dispatch("refreshMountedExtensions")):(n.isMounted=!1,this.$store.state.toast.showToast(`Could not mount extension Error: `+e.error+` @@ -160,17 +160,17 @@ Response: Error: `+e.error,4,!1);this.isLoading=!1},async remountExtension(n){await this.unmountExtension(n),await this.mountExtension(n)},onExtensionReinstall(n){console.log("on reinstall ",n),this.isLoading=!0,console.log(n),Ue.post("/reinstall_extension",{name:n.extension.full_path}).then(e=>{if(e)return this.isLoading=!1,console.log("reinstall_extension",e),e.data.status?this.$store.state.toast.showToast("Extension reinstalled successfully!",4,!0):this.$store.state.toast.showToast("Could not reinstall extension",4,!1),e.data;this.isLoading=!1}).catch(e=>(this.isLoading=!1,this.$store.state.toast.showToast(`Could not reinstall personality `+e.message,4,!1),{status:!1}))},onPersonalityReinstall(n){console.log("on reinstall ",n),this.isLoading=!0,Ue.post("/reinstall_personality",{name:n.personality.path}).then(e=>{if(e)return this.isLoading=!1,console.log("reinstall_personality",e),e.data.status?this.$store.state.toast.showToast("Personality reinstalled successfully!",4,!0):this.$store.state.toast.showToast("Could not reinstall personality",4,!1),e.data;this.isLoading=!1}).catch(e=>(this.isLoading=!1,this.$store.state.toast.showToast(`Could not reinstall personality `+e.message,4,!1),{status:!1}))},personalityImgPlacehodler(n){n.target.src=ca},extensionImgPlacehodler(n){n.target.src=Gnt},searchPersonality_func(){clearTimeout(this.searchPersonalityTimer),this.searchPersonality&&(this.searchPersonalityInProgress=!0,setTimeout(this.filterPersonalities,this.searchPersonalityTimerInterval))},searchModel_func(){this.filterModels()}},async mounted(){console.log("Getting voices"),this.getVoices(),console.log("Constructing"),this.load_everything(),this.getSeviceVoices()},activated(){},computed:{rendered_models_zoo:{get(){return this.searchModel?this.show_only_installed_models?this.modelsFiltered.filter(n=>n.isInstalled===!0):this.modelsFiltered.slice(0,Math.min(this.models_zoo.length,this.models_zoo_initialLoadCount)):(console.log("this.models_zoo"),console.log(this.models_zoo),console.log(this.models_zoo_initialLoadCount),this.show_only_installed_models?this.models_zoo.filter(n=>n.isInstalled===!0):this.models_zoo.slice(0,Math.min(this.models_zoo.length,this.models_zoo_initialLoadCount)))}},imgBinding:{get(){if(!this.isMounted)return zi;try{return this.$refs.bindingZoo[this.$refs.bindingZoo.findIndex(n=>n.binding.folder==this.configFile.binding_name)].$refs.imgElement.src}catch{return zi}}},imgModel:{get(){try{if(idx=this.$store.state.modelsZoo.findIndex(n=>n.name==this.$store.state.selectedModel),idx>=0)return this.$store.state.modelsZoo[idx].avatar}catch{}if(!this.isMounted)return zi;try{return this.$refs.bindingZoo[this.$refs.bindingZoo.findIndex(n=>n.binding.folder==this.configFile.binding_name)].$refs.imgElement.src}catch{return zi}}},isReady:{get(){return this.$store.state.ready}},audio_out_voice:{get(){return this.$store.state.config.audio_out_voice},set(n){this.$store.state.config.audio_out_voice=n}},audioLanguages(){return[{code:"en-US",name:"English (US)"},{code:"en-GB",name:"English (UK)"},{code:"es-ES",name:"Spanish (Spain)"},{code:"es-MX",name:"Spanish (Mexico)"},{code:"fr-FR",name:"French (France)"},{code:"fr-CA",name:"French (Canada)"},{code:"de-DE",name:"German (Germany)"},{code:"it-IT",name:"Italian (Italy)"},{code:"pt-BR",name:"Portuguese (Brazil)"},{code:"pt-PT",name:"Portuguese (Portugal)"},{code:"ru-RU",name:"Russian (Russia)"},{code:"zh-CN",name:"Chinese (China)"},{code:"ja-JP",name:"Japanese (Japan)"},{code:"ar-SA",name:"Arabic (Saudi Arabia)"},{code:"tr-TR",name:"Turkish (Turkey)"},{code:"ms-MY",name:"Malay (Malaysia)"},{code:"ko-KR",name:"Korean (South Korea)"},{code:"nl-NL",name:"Dutch (Netherlands)"},{code:"sv-SE",name:"Swedish (Sweden)"},{code:"da-DK",name:"Danish (Denmark)"},{code:"fi-FI",name:"Finnish (Finland)"},{code:"no-NO",name:"Norwegian (Norway)"},{code:"pl-PL",name:"Polish (Poland)"},{code:"el-GR",name:"Greek (Greece)"},{code:"hu-HU",name:"Hungarian (Hungary)"},{code:"cs-CZ",name:"Czech (Czech Republic)"},{code:"th-TH",name:"Thai (Thailand)"},{code:"hi-IN",name:"Hindi (India)"},{code:"he-IL",name:"Hebrew (Israel)"},{code:"id-ID",name:"Indonesian (Indonesia)"},{code:"vi-VN",name:"Vietnamese (Vietnam)"},{code:"uk-UA",name:"Ukrainian (Ukraine)"},{code:"ro-RO",name:"Romanian (Romania)"},{code:"bg-BG",name:"Bulgarian (Bulgaria)"},{code:"hr-HR",name:"Croatian (Croatia)"},{code:"sr-RS",name:"Serbian (Serbia)"},{code:"sk-SK",name:"Slovak (Slovakia)"},{code:"sl-SI",name:"Slovenian (Slovenia)"},{code:"et-EE",name:"Estonian (Estonia)"},{code:"lv-LV",name:"Latvian (Latvia)"},{code:"lt-LT",name:"Lithuanian (Lithuania)"},{code:"ka-GE",name:"Georgian (Georgia)"},{code:"hy-AM",name:"Armenian (Armenia)"},{code:"az-AZ",name:"Azerbaijani (Azerbaijan)"},{code:"kk-KZ",name:"Kazakh (Kazakhstan)"},{code:"uz-UZ",name:"Uzbek (Uzbekistan)"},{code:"kkj-CM",name:"Kako (Cameroon)"},{code:"my-MM",name:"Burmese (Myanmar)"},{code:"ne-NP",name:"Nepali (Nepal)"},{code:"si-LK",name:"Sinhala (Sri Lanka)"}]},configFile:{get(){return this.$store.state.config},set(n){this.$store.commit("setConfig",n)}},userName:{get(){return this.$store.state.config.user_name},set(n){this.$store.state.config.user_name=n}},user_avatar:{get(){return"/user_infos/"+this.$store.state.config.user_avatar},set(n){this.$store.state.config.user_avatar=n}},hardware_mode:{get(){return this.$store.state.config.hardware_mode},set(n){this.$store.state.config.hardware_mode=n}},auto_update:{get(){return this.$store.state.config.auto_update},set(n){this.$store.state.config.auto_update=n}},auto_speak:{get(){return this.$store.state.config.auto_speak},set(n){this.$store.state.config.auto_speak=n}},auto_read:{get(){return this.$store.state.config.auto_read},set(n){this.$store.state.config.auto_read=n}},enable_voice_service:{get(){return this.$store.state.config.enable_voice_service},set(n){this.$store.state.config.enable_voice_service=n}},current_language:{get(){return this.$store.state.config.current_language},set(n){console.log("Current voice set to ",n),this.$store.state.config.current_language=n}},current_voice:{get(){return this.$store.state.config.current_voice===null||this.$store.state.config.current_voice===void 0?(console.log("current voice",this.$store.state.config.current_voice),"main_voice"):this.$store.state.config.current_voice},set(n){n=="main_voice"||n===void 0?(console.log("Current voice set to None"),this.$store.state.config.current_voice=null):(console.log("Current voice set to ",n),this.$store.state.config.current_voice=n)}},audio_pitch:{get(){return this.$store.state.config.audio_pitch},set(n){this.$store.state.config.audio_pitch=n}},audio_in_language:{get(){return this.$store.state.config.audio_in_language},set(n){this.$store.state.config.audio_in_language=n}},use_user_name_in_discussions:{get(){return this.$store.state.config.use_user_name_in_discussions},set(n){this.$store.state.config.use_user_name_in_discussions=n}},db_path:{get(){return this.$store.state.config.db_path},set(n){this.$store.state.config.db_path=n}},personalities:{get(){return this.$store.state.personalities},set(n){this.$store.commit("setPersonalities",n)}},mountedPersArr:{get(){return this.$store.state.mountedPersArr},set(n){this.$store.commit("setMountedPers",n)}},mountedExtensions:{get(){return console.log("this.$store.state.mountedExtensions:",this.$store.state.mountedExtensions),this.$store.state.mountedExtensions},set(n){this.$store.commit("setActiveExtensions",n)}},bindingsZoo:{get(){return this.$store.state.bindingsZoo},set(n){this.$store.commit("setbindingsZoo",n)}},modelsArr:{get(){return this.$store.state.modelsArr},set(n){this.$store.commit("setModelsArr",n)}},models:{get(){return this.models_zoo},set(n){this.$store.commit("setModelsZoo",n)}},installed_models:{get(){return this.models_zoo},set(n){this.$store.commit("setModelsZoo",n)}},diskUsage:{get(){return this.$store.state.diskUsage},set(n){this.$store.commit("setDiskUsage",n)}},ramUsage:{get(){return this.$store.state.ramUsage},set(n){this.$store.commit("setRamUsage",n)}},vramUsage:{get(){return this.$store.state.vramUsage},set(n){this.$store.commit("setVramUsage",n)}},disk_available_space(){return this.computedFileSize(this.diskUsage.available_space)},disk_binding_models_usage(){return console.log(`this.diskUsage : ${this.diskUsage}`),this.computedFileSize(this.diskUsage.binding_models_usage)},disk_percent_usage(){return this.diskUsage.percent_usage},disk_total_space(){return this.computedFileSize(this.diskUsage.total_space)},ram_available_space(){return this.computedFileSize(this.ramUsage.available_space)},ram_usage(){return this.computedFileSize(this.ramUsage.ram_usage)},ram_percent_usage(){return this.ramUsage.percent_usage},ram_total_space(){return this.computedFileSize(this.ramUsage.total_space)},model_name(){if(this.isMounted)return this.configFile.model_name},binding_name(){if(!this.isMounted)return;const n=this.bindingsZoo.findIndex(e=>e.folder===this.configFile.binding_name);if(n>-1)return this.bindingsZoo[n].name},active_pesonality(){if(!this.isMounted)return;const n=this.personalities.findIndex(e=>e.full_path===this.configFile.personalities[this.configFile.active_personality_id]);if(n>-1)return this.personalities[n].name},speed_computed(){return Ki(this.addModel.speed)},total_size_computed(){return Ki(this.addModel.total_size)},downloaded_size_computed(){return Ki(this.addModel.downloaded_size)}},watch:{enable_voice_service(n){n||(this.configFile.auto_read=!1)},bec_collapsed(){Fe(()=>{Be.replace()})},pc_collapsed(){Fe(()=>{Be.replace()})},mc_collapsed(){Fe(()=>{Be.replace()})},sc_collapsed(){Fe(()=>{Be.replace()})},showConfirmation(){Fe(()=>{Be.replace()})},mzl_collapsed(){Fe(()=>{Be.replace()})},pzl_collapsed(){Fe(()=>{Be.replace()})},ezl_collapsed(){Fe(()=>{Be.replace()})},bzl_collapsed(){Fe(()=>{Be.replace()})},all_collapsed(n){this.collapseAll(n),Fe(()=>{Be.replace()})},settingsChanged(n){this.$store.state.settingsChanged=n,Fe(()=>{Be.replace()})},isLoading(){Fe(()=>{Be.replace()})},searchPersonality(n){n==""&&this.filterPersonalities()},mzdc_collapsed(){Fe(()=>{Be.replace()})}},async beforeRouteLeave(n){if(await this.$router.isReady(),this.settingsChanged)return await this.$store.state.yesNoDialog.askQuestion(`Did You forget to apply changes? -You need to apply changes before you leave, or else.`,"Apply configuration","Cancel")&&this.applyConfiguration(),!1}},be=n=>(lo("data-v-d96111fe"),n=n(),co(),n),ist={class:"container overflow-y-scroll flex flex-row shadow-lg p-10 pt-0 overflow-y-scroll w-full dark:bg-bg-dark scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},sst={class:"sticky top-0 z-10 flex flex-row mb-2 p-3 gap-3 w-full rounded-b-lg bg-bg-light-tone dark:bg-bg-dark-tone shadow-lg"},rst={key:0,class:"flex gap-3 flex-1 items-center duration-75"},ost=be(()=>_("i",{"data-feather":"x"},null,-1)),ast=[ost],lst=be(()=>_("i",{"data-feather":"check"},null,-1)),cst=[lst],dst={key:1,class:"flex gap-3 flex-1 items-center"},ust=be(()=>_("i",{"data-feather":"save"},null,-1)),pst=[ust],_st=be(()=>_("i",{"data-feather":"refresh-ccw"},null,-1)),hst=[_st],fst=be(()=>_("i",{"data-feather":"list"},null,-1)),mst=[fst],gst={class:"flex gap-3 flex-1 items-center justify-end"},Est=be(()=>_("i",{"data-feather":"trash-2"},null,-1)),bst=[Est],Sst=be(()=>_("i",{"data-feather":"refresh-ccw"},null,-1)),vst=[Sst],yst=be(()=>_("i",{"data-feather":"arrow-up-circle"},null,-1)),Tst={key:0},xst=be(()=>_("i",{"data-feather":"alert-circle"},null,-1)),Cst=[xst],Rst={class:"flex gap-3 items-center"},Ast={key:0,class:"flex gap-3 items-center"},wst=be(()=>_("p",{class:"text-red-600 font-bold"},"Apply changes:",-1)),Nst=be(()=>_("i",{"data-feather":"check"},null,-1)),Ost=[Nst],Ist={key:1,role:"status"},Mst=be(()=>_("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[_("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),_("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})],-1)),Dst=be(()=>_("span",{class:"sr-only"},"Loading...",-1)),Lst={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},kst={class:"flex flex-row p-3"},Pst=be(()=>_("i",{"data-feather":"chevron-right"},null,-1)),Ust=[Pst],Fst=be(()=>_("i",{"data-feather":"chevron-down"},null,-1)),Bst=[Fst],Gst=be(()=>_("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," System status",-1)),Vst=be(()=>_("div",{class:"mr-2"},"|",-1)),zst={class:"text-base font-semibold cursor-pointer select-none items-center"},Hst={class:"flex gap-2 items-center"},qst={key:0},Yst={class:"flex gap-2 items-center"},$st=["src"],Wst={class:"font-bold font-large text-lg"},Kst={key:1},jst={class:"flex gap-2 items-center"},Qst=["src"],Xst={class:"font-bold font-large text-lg"},Zst=be(()=>_("i",{"data-feather":"cpu",title:"CPU Ram",class:"w-5 h-5 mx-1 flex-shrink-0"},null,-1)),Jst={class:"font-bold font-large text-lg"},ert=be(()=>_("i",{"data-feather":"hard-drive",title:"Hard drive",class:"w-5 h-5 mx-1 flex-shrink-0"},null,-1)),trt={class:"font-bold font-large text-lg"},nrt={class:"mb-2"},irt=be(()=>_("label",{class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},[_("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[_("path",{fill:"currentColor",d:"M17 17H7V7h10m4 4V9h-2V7a2 2 0 0 0-2-2h-2V3h-2v2h-2V3H9v2H7c-1.11 0-2 .89-2 2v2H3v2h2v2H3v2h2v2a2 2 0 0 0 2 2h2v2h2v-2h2v2h2v-2h2a2 2 0 0 0 2-2v-2h2v-2h-2v-2m-6 2h-2v-2h2m2-2H9v6h6V9Z"})]),je(" CPU Ram usage: ")],-1)),srt={class:"flex flex-col mx-2"},rrt=be(()=>_("b",null,"Avaliable ram: ",-1)),ort=be(()=>_("b",null,"Ram usage: ",-1)),art={class:"p-2"},lrt={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},crt={class:"mb-2"},drt=be(()=>_("label",{class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},[_("i",{"data-feather":"hard-drive",class:"w-5 h-5"}),je(" Disk usage: ")],-1)),urt={class:"flex flex-col mx-2"},prt=be(()=>_("b",null,"Avaliable disk space: ",-1)),_rt=be(()=>_("b",null,"Disk usage: ",-1)),hrt={class:"p-2"},frt={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},mrt={class:"mb-2"},grt={class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},Ert=["src"],brt={class:"flex flex-col mx-2"},Srt=be(()=>_("b",null,"Model: ",-1)),vrt=be(()=>_("b",null,"Avaliable vram: ",-1)),yrt=be(()=>_("b",null,"GPU usage: ",-1)),Trt={class:"p-2"},xrt={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},Crt={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},Rrt={class:"flex flex-row p-3"},Art=be(()=>_("i",{"data-feather":"chevron-right"},null,-1)),wrt=[Art],Nrt=be(()=>_("i",{"data-feather":"chevron-down"},null,-1)),Ort=[Nrt],Irt=be(()=>_("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Main configurations",-1)),Mrt={class:"flex flex-col mb-2 px-3 pb-2"},Drt={class:"expand-to-fit bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Lrt=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"hardware_mode",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Hardware mode:")],-1)),krt={class:"text-center items-center"},Prt={class:"flex flex-row"},Urt=be(()=>_("option",{value:"cpu"},"CPU",-1)),Frt=be(()=>_("option",{value:"cpu-noavx"},"CPU (No AVX)",-1)),Brt=be(()=>_("option",{value:"nvidia-tensorcores"},"NVIDIA (Tensor Cores)",-1)),Grt=be(()=>_("option",{value:"nvidia"},"NVIDIA",-1)),Vrt=be(()=>_("option",{value:"amd-noavx"},"AMD (No AVX)",-1)),zrt=be(()=>_("option",{value:"amd"},"AMD",-1)),Hrt=be(()=>_("option",{value:"apple-intel"},"Apple Intel",-1)),qrt=be(()=>_("option",{value:"apple-silicon"},"Apple Silicon",-1)),Yrt=[Urt,Frt,Brt,Grt,Vrt,zrt,Hrt,qrt],$rt=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"db_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Host:")],-1)),Wrt={style:{width:"100%"}},Krt=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"db_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Port:")],-1)),jrt={style:{width:"100%"}},Qrt=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"db_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Database path:")],-1)),Xrt={style:{width:"100%"}},Zrt=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"auto_show_browser",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto show browser:")],-1)),Jrt={class:"flex flex-row"},eot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"activate_debug",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate debug mode:")],-1)),tot={class:"flex flex-row"},not=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"auto_save",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto save:")],-1)),iot={class:"flex flex-row"},sot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"auto_update",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto update:")],-1)),rot={class:"flex flex-row"},oot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"auto_update",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto title:")],-1)),aot={class:"flex flex-row"},lot={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},cot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"user_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User name:")],-1)),dot={style:{width:"100%"}},uot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"user_description",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User description:")],-1)),pot={style:{width:"100%"}},_ot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"user_description",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use user description in discussion:")],-1)),hot={style:{width:"100%"}},fot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"user_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User avatar:")],-1)),mot={style:{width:"100%"}},got={for:"avatar-upload"},Eot=["src"],bot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"use_user_name_in_discussions",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use User Name in discussions:")],-1)),Sot={class:"flex flex-row"},vot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"min_n_predict",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Minimum number of output tokens space (forces the model to have more space to speak):")],-1)),yot={style:{width:"100%"}},Tot={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},xot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"use_files",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate files support:")],-1)),Cot={class:"flex flex-row"},Rot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"use_discussions_history",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate discussion vectorization:")],-1)),Aot={class:"flex flex-row"},wot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"summerize_discussion",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate Continuous Learning from discussions:")],-1)),Not={class:"flex flex-row"},Oot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"data_vectorization_visualize_on_vectorization",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"show vectorized data:")],-1)),Iot={class:"flex flex-row"},Mot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"data_vectorization_activate",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate data Vectorization:")],-1)),Dot={class:"flex flex-row"},Lot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"data_vectorization_build_keys_words",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Build keywords when querying the vectorized database:")],-1)),kot={class:"flex flex-row"},Pot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"data_vectorization_method",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization method:")],-1)),Uot=be(()=>_("option",{value:"tfidf_vectorizer"},"tfidf Vectorizer",-1)),Fot=be(()=>_("option",{value:"model_embedding"},"Model Embedding",-1)),Bot=[Uot,Fot],Got=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"data_visualization_method",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data visualization method:")],-1)),Vot=be(()=>_("option",{value:"PCA"},"PCA",-1)),zot=be(()=>_("option",{value:"TSNE"},"TSNE",-1)),Hot=[Vot,zot],qot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"data_vectorization_save_db",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Save the new files to the database (The database wil always grow and continue to be the same over many sessions):")],-1)),Yot={class:"flex flex-row"},$ot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"data_vectorization_chunk_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization chunk size(tokens):")],-1)),Wot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"data_vectorization_overlap_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization overlap size(tokens):")],-1)),Kot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"data_vectorization_overlap_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Number of chunks to use for each message:")],-1)),jot={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Qot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"pdf_latex_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"PDF LaTeX path:")],-1)),Xot={class:"flex flex-row"},Zot={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Jot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"positive_boost",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Positive Boost:")],-1)),eat={class:"flex flex-row"},tat=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"negative_boost",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Negative Boost:")],-1)),nat={class:"flex flex-row"},iat=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"force_output_language_to_be",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Force AI to answer in this language:")],-1)),sat={class:"flex flex-row"},rat={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},oat=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"audio_auto_send_input",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Send audio input automatically:")],-1)),aat={class:"flex flex-row"},lat=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"auto_speak",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable auto speak:")],-1)),cat={class:"flex flex-row"},dat=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"audio_pitch",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"audio pitch:")],-1)),uat=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"audio_silenceTimer",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"audio in silence timer (ms):")],-1)),pat=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"audio_in_language",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Input Audio Language:")],-1)),_at=["value"],hat=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"audio_out_voice",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Output Audio Voice:")],-1)),fat=["value"],mat={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},gat={class:"flex flex-row p-3"},Eat=be(()=>_("i",{"data-feather":"chevron-right"},null,-1)),bat=[Eat],Sat=be(()=>_("i",{"data-feather":"chevron-down"},null,-1)),vat=[Sat],yat=be(()=>_("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Servers configurations",-1)),Tat={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},xat=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"enable_sd_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable sd service:")],-1)),Cat={class:"flex flex-row"},Rat=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"install_sd_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Reinstall SD service:")],-1)),Aat={class:"flex flex-row"},wat=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"sd_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"sd base url:")],-1)),Nat={class:"flex flex-row"},Oat={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Iat=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"enable_voice_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable voice service:")],-1)),Mat={class:"flex flex-row"},Dat=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"install_xtts_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Reinstall xTTS service:")],-1)),Lat={class:"flex flex-row"},kat=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"xtts_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"xtts base url:")],-1)),Pat={class:"flex flex-row"},Uat=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"current_language",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Current language:")],-1)),Fat={class:"flex flex-row"},Bat=["disabled"],Gat=["value"],Vat=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"current_voice",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Current voice:")],-1)),zat={class:"flex flex-row"},Hat=["disabled"],qat=["value"],Yat=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"auto_read",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable auto read:")],-1)),$at={class:"flex flex-row"},Wat=["disabled"],Kat={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},jat={class:"flex flex-row p-3"},Qat=be(()=>_("i",{"data-feather":"chevron-right"},null,-1)),Xat=[Qat],Zat=be(()=>_("i",{"data-feather":"chevron-down"},null,-1)),Jat=[Zat],elt=be(()=>_("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Binding zoo",-1)),tlt={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},nlt=be(()=>_("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),ilt={key:1,class:"mr-2"},slt={key:2,class:"text-base font-semibold cursor-pointer select-none items-center"},rlt={class:"flex gap-1 items-center"},olt=["src"],alt={class:"font-bold font-large text-lg line-clamp-1"},llt={key:0,class:"mb-2"},clt={for:"binding",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},dlt=be(()=>_("i",{"data-feather":"chevron-up"},null,-1)),ult=[dlt],plt=be(()=>_("i",{"data-feather":"chevron-down"},null,-1)),_lt=[plt],hlt={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},flt={class:"flex flex-row p-3"},mlt=be(()=>_("i",{"data-feather":"chevron-right"},null,-1)),glt=[mlt],Elt=be(()=>_("i",{"data-feather":"chevron-down"},null,-1)),blt=[Elt],Slt=be(()=>_("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Models zoo",-1)),vlt={class:"flex flex-row items-center"},ylt={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},Tlt=be(()=>_("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),xlt={key:1,class:"text-base text-red-600 flex gap-3 items-center mr-2"},Clt=be(()=>_("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),Rlt={key:2,class:"mr-2"},Alt={key:3,class:"text-base font-semibold cursor-pointer select-none items-center"},wlt={class:"flex gap-1 items-center"},Nlt=["src"],Olt={class:"font-bold font-large text-lg line-clamp-1"},Ilt={class:"mx-2 mb-4"},Mlt={class:"relative"},Dlt={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},Llt={key:0},klt=be(()=>_("div",{role:"status"},[_("svg",{"aria-hidden":"true",class:"inline w-4 h-4 mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[_("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),_("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),_("span",{class:"sr-only"},"Loading...")],-1)),Plt=[klt],Ult={key:1},Flt=be(()=>_("svg",{"aria-hidden":"true",class:"w-5 h-5 text-gray-500 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[_("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)),Blt=[Flt],Glt=be(()=>_("label",{for:"only_installed"},"Show only installed models",-1)),Vlt=be(()=>_("a",{href:"https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard",target:"_blank",class:"mb-4 font-bold underline text-blue-500 pb-4"},"Hugging face Leaderboard",-1)),zlt={key:0,role:"status",class:"text-center w-full display: flex;align-items: center;"},Hlt=be(()=>_("svg",{"aria-hidden":"true",class:"text-center w-full display: flex;align-items: center; h-20 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[_("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),_("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})],-1)),qlt=be(()=>_("p",{class:"heartbeat-text"},"Loading models Zoo",-1)),Ylt=[Hlt,qlt],$lt={key:1,class:"mb-2"},Wlt={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},Klt=be(()=>_("i",{"data-feather":"chevron-up"},null,-1)),jlt=[Klt],Qlt=be(()=>_("i",{"data-feather":"chevron-down"},null,-1)),Xlt=[Qlt],Zlt={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},Jlt={class:"flex flex-row p-3"},ect=be(()=>_("i",{"data-feather":"chevron-right"},null,-1)),tct=[ect],nct=be(()=>_("i",{"data-feather":"chevron-down"},null,-1)),ict=[nct],sct=be(()=>_("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Add models for binding",-1)),rct={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},oct=be(()=>_("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),act={key:1,class:"mr-2"},lct={key:2,class:"text-base font-semibold cursor-pointer select-none items-center"},cct={class:"flex gap-1 items-center"},dct=["src"],uct={class:"font-bold font-large text-lg line-clamp-1"},pct={class:"mb-2"},_ct={class:"p-2"},hct={class:"mb-3"},fct=be(()=>_("label",{class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},"Create a reference from local file path:",-1)),mct={key:0},gct={class:"mb-3"},Ect=be(()=>_("label",{class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},"Download from web:",-1)),bct={key:1,class:"relative flex flex-col items-center justify-center flex-grow h-full"},Sct=be(()=>_("div",{role:"status",class:"justify-center"},null,-1)),vct={class:"relative flex flex-row flex-grow items-center w-full h-full bottom-0"},yct={class:"w-full p-2"},Tct={class:"flex justify-between mb-1"},xct=Ru(' Downloading Loading...',1),Cct={class:"text-sm font-medium text-blue-700 dark:text-white"},Rct=["title"],Act={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},wct={class:"flex justify-between mb-1"},Nct={class:"text-base font-medium text-blue-700 dark:text-white"},Oct={class:"text-sm font-medium text-blue-700 dark:text-white"},Ict={class:"flex flex-grow"},Mct={class:"flex flex-row flex-grow gap-3"},Dct={class:"p-2 text-center grow"},Lct={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},kct={class:"flex flex-row p-3 items-center"},Pct=be(()=>_("i",{"data-feather":"chevron-right"},null,-1)),Uct=[Pct],Fct=be(()=>_("i",{"data-feather":"chevron-down"},null,-1)),Bct=[Fct],Gct=be(()=>_("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Personalities zoo",-1)),Vct={key:0,class:"mr-2"},zct={class:"mr-2 font-bold font-large text-lg line-clamp-1"},Hct={key:1,class:"mr-2"},qct={key:2,class:"text-base font-semibold cursor-pointer select-none items-center flex flex-row"},Yct={key:0,class:"flex -space-x-4 items-center"},$ct={class:"group items-center flex flex-row"},Wct=["onClick"],Kct=["src","title"],jct=["onClick"],Qct=be(()=>_("span",{class:"hidden group-hover:block top-0 left-7 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2 border-transparent",title:"Unmount personality"},[_("svg",{"aria-hidden":"true",class:"w-4 h-4 text-red-600 hover:text-red-500",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[_("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})])],-1)),Xct=[Qct],Zct=be(()=>_("svg",{"aria-hidden":"true",class:"w-4 h-4 text-red-600 hover:text-red-500",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[_("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)),Jct=[Zct],edt={class:"mx-2 mb-4"},tdt=be(()=>_("label",{for:"personality-search",class:"mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white"},"Search",-1)),ndt={class:"relative"},idt={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},sdt={key:0},rdt=be(()=>_("div",{role:"status"},[_("svg",{"aria-hidden":"true",class:"inline w-4 h-4 mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[_("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),_("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),_("span",{class:"sr-only"},"Loading...")],-1)),odt=[rdt],adt={key:1},ldt=be(()=>_("svg",{"aria-hidden":"true",class:"w-5 h-5 text-gray-500 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[_("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)),cdt=[ldt],ddt={key:0,class:"mx-2 mb-4"},udt={for:"persCat",class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},pdt=["selected"],_dt={key:0,class:"mb-2"},hdt={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},fdt=be(()=>_("i",{"data-feather":"chevron-up"},null,-1)),mdt=[fdt],gdt=be(()=>_("i",{"data-feather":"chevron-down"},null,-1)),Edt=[gdt],bdt={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},Sdt={class:"flex flex-row p-3 items-center"},vdt=be(()=>_("i",{"data-feather":"chevron-right"},null,-1)),ydt=[vdt],Tdt=be(()=>_("i",{"data-feather":"chevron-down"},null,-1)),xdt=[Tdt],Cdt=be(()=>_("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Extensions zoo",-1)),Rdt={key:0,class:"mr-2"},Adt={key:1,class:"text-base font-semibold cursor-pointer select-none items-center flex flex-row"},wdt={key:0,class:"flex -space-x-4 items-center"},Ndt={class:"group items-center flex flex-row"},Odt=["src","title"],Idt=["onClick"],Mdt=be(()=>_("span",{class:"hidden group-hover:block top-0 left-7 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2 border-transparent",title:"Unmount personality"},[_("svg",{"aria-hidden":"true",class:"w-4 h-4 text-red-600 hover:text-red-500",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[_("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})])],-1)),Ddt=[Mdt],Ldt={class:"mx-2 mb-4"},kdt=be(()=>_("label",{for:"personality-search",class:"mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white"},"Search",-1)),Pdt={class:"relative"},Udt={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},Fdt={key:0},Bdt=be(()=>_("div",{role:"status"},[_("svg",{"aria-hidden":"true",class:"inline w-4 h-4 mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[_("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),_("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),_("span",{class:"sr-only"},"Loading...")],-1)),Gdt=[Bdt],Vdt={key:1},zdt=be(()=>_("svg",{"aria-hidden":"true",class:"w-5 h-5 text-gray-500 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[_("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)),Hdt=[zdt],qdt={key:0,class:"mx-2 mb-4"},Ydt={for:"extCat",class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},$dt=["selected"],Wdt={key:0,class:"mb-2"},Kdt={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},jdt=be(()=>_("i",{"data-feather":"chevron-up"},null,-1)),Qdt=[jdt],Xdt=be(()=>_("i",{"data-feather":"chevron-down"},null,-1)),Zdt=[Xdt],Jdt={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},eut={class:"flex flex-row p-3 items-center"},tut=be(()=>_("i",{"data-feather":"chevron-right"},null,-1)),nut=[tut],iut=be(()=>_("i",{"data-feather":"chevron-down"},null,-1)),sut=[iut],rut=be(()=>_("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Mounted Extensions Priority",-1)),out={class:"flex flex-col mb-2 p-3 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},aut={class:"flex flex-row"},lut=be(()=>_("i",{"data-feather":"chevron-right"},null,-1)),cut=[lut],dut=be(()=>_("i",{"data-feather":"chevron-down"},null,-1)),uut=[dut],put=be(()=>_("h3",{class:"text-lg font-semibold cursor-pointer select-none"}," Model Configuration",-1)),_ut={class:"m-2"},hut={class:"flex flex-row gap-2 items-center"},fut=be(()=>_("label",{for:"override-model-parameters",class:"block text-sm font-medium"}," Override personality model parameters ",-1)),mut={class:"m-2"},gut=be(()=>_("label",{for:"seed",class:"block mb-2 text-sm font-medium"}," Seed: ",-1)),Eut={class:"m-2"},but={class:"flex flex-col align-bottom"},Sut={class:"relative"},vut=be(()=>_("p",{class:"absolute left-0 mt-6"},[_("label",{for:"temperature",class:"text-sm font-medium"}," Temperature: ")],-1)),yut={class:"absolute right-0"},Tut={class:"m-2"},xut={class:"flex flex-col align-bottom"},Cut={class:"relative"},Rut=be(()=>_("p",{class:"absolute left-0 mt-6"},[_("label",{for:"predict",class:"text-sm font-medium"}," N Predict: ")],-1)),Aut={class:"absolute right-0"},wut={class:"m-2"},Nut={class:"flex flex-col align-bottom"},Out={class:"relative"},Iut=be(()=>_("p",{class:"absolute left-0 mt-6"},[_("label",{for:"top_k",class:"text-sm font-medium"}," Top-K: ")],-1)),Mut={class:"absolute right-0"},Dut={class:"m-2"},Lut={class:"flex flex-col align-bottom"},kut={class:"relative"},Put=be(()=>_("p",{class:"absolute left-0 mt-6"},[_("label",{for:"top_p",class:"text-sm font-medium"}," Top-P: ")],-1)),Uut={class:"absolute right-0"},Fut={class:"m-2"},But={class:"flex flex-col align-bottom"},Gut={class:"relative"},Vut=be(()=>_("p",{class:"absolute left-0 mt-6"},[_("label",{for:"repeat_penalty",class:"text-sm font-medium"}," Repeat penalty: ")],-1)),zut={class:"absolute right-0"},Hut={class:"m-2"},qut={class:"flex flex-col align-bottom"},Yut={class:"relative"},$ut=be(()=>_("p",{class:"absolute left-0 mt-6"},[_("label",{for:"repeat_last_n",class:"text-sm font-medium"}," Repeat last N: ")],-1)),Wut={class:"absolute right-0"};function Kut(n,e,t,i,s,r){const o=_t("Card"),a=_t("BindingEntry"),l=_t("RadioOptions"),c=_t("model-entry"),d=_t("personality-entry"),u=_t("ExtensionEntry"),h=_t("AddModelDialog"),m=_t("ChoiceDialog");return O(),D($e,null,[_("div",ist,[_("div",sst,[s.showConfirmation?(O(),D("div",rst,[_("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel",type:"button",onClick:e[0]||(e[0]=Te(f=>s.showConfirmation=!1,["stop"]))},ast),_("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm save changes",type:"button",onClick:e[1]||(e[1]=Te(f=>r.save_configuration(),["stop"]))},cst)])):j("",!0),s.showConfirmation?j("",!0):(O(),D("div",dst,[_("button",{title:"Save configuration",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[2]||(e[2]=f=>s.showConfirmation=!0)},pst),_("button",{title:"Reset configuration",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[3]||(e[3]=f=>r.reset_configuration())},hst),_("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Collapse / Expand all panels",type:"button",onClick:e[4]||(e[4]=Te(f=>s.all_collapsed=!s.all_collapsed,["stop"]))},mst)])),_("div",gst,[_("button",{title:"Clear uploads",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[5]||(e[5]=f=>r.api_get_req("clear_uploads").then(b=>{b.status?this.$store.state.toast.showToast("Success!",4,!0):this.$store.state.toast.showToast(["failed!"],4,!1)}))},bst),_("button",{title:"Restart program",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[6]||(e[6]=f=>r.api_get_req("restart_program").then(b=>{b.status?this.$store.state.toast.showToast("Success!",4,!0):this.$store.state.toast.showToast(["failed!"],4,!1)}))},vst),_("button",{title:"Upgrade program ",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[7]||(e[7]=f=>r.api_get_req("update_software").then(b=>{b.status?this.$store.state.toast.showToast("Success!",4,!0):this.$store.state.toast.showToast("Success!",4,!0)}))},[yst,s.has_updates?(O(),D("div",Tst,Cst)):j("",!0)]),_("div",Rst,[s.settingsChanged?(O(),D("div",Ast,[wst,s.isLoading?j("",!0):(O(),D("button",{key:0,class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Apply changes",type:"button",onClick:e[8]||(e[8]=Te(f=>r.applyConfiguration(),["stop"]))},Ost))])):j("",!0),s.isLoading?(O(),D("div",Ist,[_("p",null,he(s.loading_text),1),Mst,Dst])):j("",!0)])])]),_("div",{class:He(s.isLoading?"pointer-events-none opacity-30 w-full":"w-full")},[_("div",Lst,[_("div",kst,[_("button",{onClick:e[9]||(e[9]=Te(f=>s.sc_collapsed=!s.sc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[xe(_("div",null,Ust,512),[[At,s.sc_collapsed]]),xe(_("div",null,Bst,512),[[At,!s.sc_collapsed]]),Gst,Vst,_("div",zst,[_("div",Hst,[_("div",null,[r.vramUsage&&r.vramUsage.gpus&&r.vramUsage.gpus.length==1?(O(),D("div",qst,[(O(!0),D($e,null,lt(r.vramUsage.gpus,f=>(O(),D("div",Yst,[_("img",{src:s.SVGGPU,width:"25",height:"25"},null,8,$st),_("h3",Wst,[_("div",null,he(r.computedFileSize(f.used_vram))+" / "+he(r.computedFileSize(f.total_vram))+" ("+he(f.percentage)+"%) ",1)])]))),256))])):j("",!0),r.vramUsage&&r.vramUsage.gpus&&r.vramUsage.gpus.length>1?(O(),D("div",Kst,[_("div",jst,[_("img",{src:s.SVGGPU,width:"25",height:"25"},null,8,Qst),_("h3",Xst,[_("div",null,he(r.vramUsage.gpus.length)+"x ",1)])])])):j("",!0)]),Zst,_("h3",Jst,[_("div",null,he(r.ram_usage)+" / "+he(r.ram_total_space)+" ("+he(r.ram_percent_usage)+"%)",1)]),ert,_("h3",trt,[_("div",null,he(r.disk_binding_models_usage)+" / "+he(r.disk_total_space)+" ("+he(r.disk_percent_usage)+"%)",1)])])])])]),_("div",{class:He([{hidden:s.sc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[_("div",nrt,[irt,_("div",srt,[_("div",null,[rrt,je(he(r.ram_available_space),1)]),_("div",null,[ort,je(" "+he(r.ram_usage)+" / "+he(r.ram_total_space)+" ("+he(r.ram_percent_usage)+")% ",1)])]),_("div",art,[_("div",lrt,[_("div",{class:"bg-blue-600 h-2.5 rounded-full",style:Xt("width: "+r.ram_percent_usage+"%;")},null,4)])])]),_("div",crt,[drt,_("div",urt,[_("div",null,[prt,je(he(r.disk_available_space),1)]),_("div",null,[_rt,je(" "+he(r.disk_binding_models_usage)+" / "+he(r.disk_total_space)+" ("+he(r.disk_percent_usage)+"%)",1)])]),_("div",hrt,[_("div",frt,[_("div",{class:"bg-blue-600 h-2.5 rounded-full",style:Xt("width: "+r.disk_percent_usage+"%;")},null,4)])])]),(O(!0),D($e,null,lt(r.vramUsage.gpus,f=>(O(),D("div",mrt,[_("label",grt,[_("img",{src:s.SVGGPU,width:"25",height:"25"},null,8,Ert),je(" GPU usage: ")]),_("div",brt,[_("div",null,[Srt,je(he(f.gpu_model),1)]),_("div",null,[vrt,je(he(this.computedFileSize(f.available_space)),1)]),_("div",null,[yrt,je(" "+he(this.computedFileSize(f.used_vram))+" / "+he(this.computedFileSize(f.total_vram))+" ("+he(f.percentage)+"%)",1)])]),_("div",Trt,[_("div",xrt,[_("div",{class:"bg-blue-600 h-2.5 rounded-full",style:Xt("width: "+f.percentage+"%;")},null,4)])])]))),256))],2)]),_("div",Crt,[_("div",Rrt,[_("button",{onClick:e[10]||(e[10]=Te(f=>s.minconf_collapsed=!s.minconf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[xe(_("div",null,wrt,512),[[At,s.minconf_collapsed]]),xe(_("div",null,Ort,512),[[At,!s.minconf_collapsed]]),Irt])]),_("div",{class:He([{hidden:s.minconf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[_("div",Mrt,[Ie(o,{title:"General",is_subcard:!0,class:"pb-2 m-2"},{default:ot(()=>[_("table",Drt,[_("tr",null,[Lrt,_("td",krt,[_("div",Prt,[xe(_("select",{id:"hardware_mode",required:"","onUpdate:modelValue":e[11]||(e[11]=f=>r.configFile.hardware_mode=f),onChange:e[12]||(e[12]=f=>s.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},Yrt,544),[[ei,r.configFile.hardware_mode]])])])]),_("tr",null,[$rt,_("td",Wrt,[xe(_("input",{type:"text",id:"host",required:"","onUpdate:modelValue":e[13]||(e[13]=f=>r.configFile.host=f),onChange:e[14]||(e[14]=f=>s.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Xe,r.configFile.host]])])]),_("tr",null,[Krt,_("td",jrt,[xe(_("input",{type:"number",step:"1",id:"port",required:"","onUpdate:modelValue":e[15]||(e[15]=f=>r.configFile.port=f),onChange:e[16]||(e[16]=f=>s.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Xe,r.configFile.port]])])]),_("tr",null,[Qrt,_("td",Xrt,[xe(_("input",{type:"text",id:"db_path",required:"","onUpdate:modelValue":e[17]||(e[17]=f=>r.configFile.db_path=f),onChange:e[18]||(e[18]=f=>s.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Xe,r.configFile.db_path]])])]),_("tr",null,[Zrt,_("td",null,[_("div",Jrt,[xe(_("input",{type:"checkbox",id:"auto_show_browser",required:"","onUpdate:modelValue":e[19]||(e[19]=f=>r.configFile.auto_show_browser=f),onChange:e[20]||(e[20]=f=>s.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.auto_show_browser]])])])]),_("tr",null,[eot,_("td",null,[_("div",tot,[xe(_("input",{type:"checkbox",id:"activate_debug",required:"","onUpdate:modelValue":e[21]||(e[21]=f=>r.configFile.debug=f),onChange:e[22]||(e[22]=f=>s.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.debug]])])])]),_("tr",null,[not,_("td",null,[_("div",iot,[xe(_("input",{type:"checkbox",id:"auto_save",required:"","onUpdate:modelValue":e[23]||(e[23]=f=>r.configFile.auto_save=f),onChange:e[24]||(e[24]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.auto_save]])])])]),_("tr",null,[sot,_("td",null,[_("div",rot,[xe(_("input",{type:"checkbox",id:"auto_update",required:"","onUpdate:modelValue":e[25]||(e[25]=f=>r.configFile.auto_update=f),onChange:e[26]||(e[26]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.auto_update]])])])]),_("tr",null,[oot,_("td",null,[_("div",aot,[xe(_("input",{type:"checkbox",id:"auto_title",required:"","onUpdate:modelValue":e[27]||(e[27]=f=>r.configFile.auto_title=f),onChange:e[28]||(e[28]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.auto_title]])])])])])]),_:1}),Ie(o,{title:"User",is_subcard:!0,class:"pb-2 m-2"},{default:ot(()=>[_("table",lot,[_("tr",null,[cot,_("td",dot,[xe(_("input",{type:"text",id:"user_name",required:"","onUpdate:modelValue":e[29]||(e[29]=f=>r.configFile.user_name=f),onChange:e[30]||(e[30]=f=>s.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Xe,r.configFile.user_name]])])]),_("tr",null,[uot,_("td",pot,[xe(_("textarea",{id:"user_description",required:"","onUpdate:modelValue":e[31]||(e[31]=f=>r.configFile.user_description=f),onChange:e[32]||(e[32]=f=>s.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Xe,r.configFile.user_description]])])]),_("tr",null,[_ot,_("td",hot,[xe(_("input",{type:"checkbox",id:"override_personality_model_parameters",required:"","onUpdate:modelValue":e[33]||(e[33]=f=>r.configFile.override_personality_model_parameters=f),onChange:e[34]||(e[34]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.override_personality_model_parameters]])])]),_("tr",null,[fot,_("td",mot,[_("label",got,[_("img",{src:"/user_infos/"+r.configFile.user_avatar,class:"w-50 h-50 rounded-full",style:{"max-width":"50px","max-height":"50px",cursor:"pointer"}},null,8,Eot)]),_("input",{type:"file",id:"avatar-upload",style:{display:"none"},onChange:e[35]||(e[35]=(...f)=>r.uploadAvatar&&r.uploadAvatar(...f))},null,32)])]),_("tr",null,[bot,_("td",null,[_("div",Sot,[xe(_("input",{type:"checkbox",id:"use_user_name_in_discussions",required:"","onUpdate:modelValue":e[36]||(e[36]=f=>r.configFile.use_user_name_in_discussions=f),onChange:e[37]||(e[37]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.use_user_name_in_discussions]])])])]),_("tr",null,[vot,_("td",yot,[xe(_("input",{type:"number",id:"min_n_predict",required:"","onUpdate:modelValue":e[38]||(e[38]=f=>r.configFile.min_n_predict=f),onChange:e[39]||(e[39]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Xe,r.configFile.min_n_predict]])])])])]),_:1}),Ie(o,{title:"Data Vectorization",is_subcard:!0,class:"pb-2 m-2"},{default:ot(()=>[_("table",Tot,[_("tr",null,[xot,_("td",null,[_("div",Cot,[xe(_("input",{type:"checkbox",id:"use_files",required:"","onUpdate:modelValue":e[40]||(e[40]=f=>r.configFile.use_files=f),onChange:e[41]||(e[41]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.use_files]])])])]),_("tr",null,[Rot,_("td",null,[_("div",Aot,[xe(_("input",{type:"checkbox",id:"use_discussions_history",required:"","onUpdate:modelValue":e[42]||(e[42]=f=>r.configFile.use_discussions_history=f),onChange:e[43]||(e[43]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.use_discussions_history]])])])]),_("tr",null,[wot,_("td",null,[_("div",Not,[xe(_("input",{type:"checkbox",id:"summerize_discussion",required:"","onUpdate:modelValue":e[44]||(e[44]=f=>r.configFile.summerize_discussion=f),onChange:e[45]||(e[45]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.summerize_discussion]])])])]),_("tr",null,[Oot,_("td",null,[_("div",Iot,[xe(_("input",{type:"checkbox",id:"data_vectorization_visualize_on_vectorization",required:"","onUpdate:modelValue":e[46]||(e[46]=f=>r.configFile.data_vectorization_visualize_on_vectorization=f),onChange:e[47]||(e[47]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.data_vectorization_visualize_on_vectorization]])])])]),_("tr",null,[Mot,_("td",null,[_("div",Dot,[xe(_("input",{type:"checkbox",id:"data_vectorization_activate",required:"","onUpdate:modelValue":e[48]||(e[48]=f=>r.configFile.data_vectorization_activate=f),onChange:e[49]||(e[49]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.data_vectorization_activate]])])])]),_("tr",null,[Lot,_("td",null,[_("div",kot,[xe(_("input",{type:"checkbox",id:"data_vectorization_build_keys_words",required:"","onUpdate:modelValue":e[50]||(e[50]=f=>r.configFile.data_vectorization_build_keys_words=f),onChange:e[51]||(e[51]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.data_vectorization_build_keys_words]])])])]),_("tr",null,[Pot,_("td",null,[xe(_("select",{id:"data_vectorization_method",required:"","onUpdate:modelValue":e[52]||(e[52]=f=>r.configFile.data_vectorization_method=f),onChange:e[53]||(e[53]=f=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},Bot,544),[[ei,r.configFile.data_vectorization_method]])])]),_("tr",null,[Got,_("td",null,[xe(_("select",{id:"data_visualization_method",required:"","onUpdate:modelValue":e[54]||(e[54]=f=>r.configFile.data_visualization_method=f),onChange:e[55]||(e[55]=f=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},Hot,544),[[ei,r.configFile.data_visualization_method]])])]),_("tr",null,[qot,_("td",null,[_("div",Yot,[xe(_("input",{type:"checkbox",id:"data_vectorization_save_db",required:"","onUpdate:modelValue":e[56]||(e[56]=f=>r.configFile.data_vectorization_save_db=f),onChange:e[57]||(e[57]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.data_vectorization_save_db]])])])]),_("tr",null,[$ot,_("td",null,[xe(_("input",{id:"data_vectorization_chunk_size","onUpdate:modelValue":e[58]||(e[58]=f=>r.configFile.data_vectorization_chunk_size=f),onChange:e[59]||(e[59]=f=>s.settingsChanged=!0),type:"range",min:"0",max:"64000",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.data_vectorization_chunk_size]]),xe(_("input",{"onUpdate:modelValue":e[60]||(e[60]=f=>r.configFile.data_vectorization_chunk_size=f),type:"number",onChange:e[61]||(e[61]=f=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Xe,r.configFile.data_vectorization_chunk_size]])])]),_("tr",null,[Wot,_("td",null,[xe(_("input",{id:"data_vectorization_overlap_size","onUpdate:modelValue":e[62]||(e[62]=f=>r.configFile.data_vectorization_overlap_size=f),onChange:e[63]||(e[63]=f=>s.settingsChanged=!0),type:"range",min:"0",max:"64000",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.data_vectorization_overlap_size]]),xe(_("input",{"onUpdate:modelValue":e[64]||(e[64]=f=>r.configFile.data_vectorization_overlap_size=f),type:"number",onChange:e[65]||(e[65]=f=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Xe,r.configFile.data_vectorization_overlap_size]])])]),_("tr",null,[Kot,_("td",null,[xe(_("input",{id:"data_vectorization_nb_chunks","onUpdate:modelValue":e[66]||(e[66]=f=>r.configFile.data_vectorization_nb_chunks=f),onChange:e[67]||(e[67]=f=>s.settingsChanged=!0),type:"range",min:"0",max:"1000",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.data_vectorization_nb_chunks]]),xe(_("input",{"onUpdate:modelValue":e[68]||(e[68]=f=>r.configFile.data_vectorization_nb_chunks=f),type:"number",onChange:e[69]||(e[69]=f=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Xe,r.configFile.data_vectorization_nb_chunks]])])])])]),_:1}),Ie(o,{title:"Latex",is_subcard:!0,class:"pb-2 m-2"},{default:ot(()=>[_("table",jot,[_("tr",null,[Qot,_("td",null,[_("div",Xot,[xe(_("input",{type:"text",id:"pdf_latex_path",required:"","onUpdate:modelValue":e[70]||(e[70]=f=>r.configFile.pdf_latex_path=f),onChange:e[71]||(e[71]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Xe,r.configFile.pdf_latex_path]])])])])])]),_:1}),Ie(o,{title:"Boost",is_subcard:!0,class:"pb-2 m-2"},{default:ot(()=>[_("table",Zot,[_("tr",null,[Jot,_("td",null,[_("div",eat,[xe(_("input",{type:"text",id:"positive_boost",required:"","onUpdate:modelValue":e[72]||(e[72]=f=>r.configFile.positive_boost=f),onChange:e[73]||(e[73]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Xe,r.configFile.positive_boost]])])])]),_("tr",null,[tat,_("td",null,[_("div",nat,[xe(_("input",{type:"text",id:"negative_boost",required:"","onUpdate:modelValue":e[74]||(e[74]=f=>r.configFile.negative_boost=f),onChange:e[75]||(e[75]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Xe,r.configFile.negative_boost]])])])]),_("tr",null,[iat,_("td",null,[_("div",sat,[xe(_("input",{type:"text",id:"force_output_language_to_be",required:"","onUpdate:modelValue":e[76]||(e[76]=f=>r.configFile.force_output_language_to_be=f),onChange:e[77]||(e[77]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Xe,r.configFile.force_output_language_to_be]])])])])])]),_:1}),Ie(o,{title:"Browser Audio",is_subcard:!0,class:"pb-2 m-2"},{default:ot(()=>[_("table",rat,[_("tr",null,[oat,_("td",null,[_("div",aat,[xe(_("input",{type:"checkbox",id:"audio_auto_send_input",required:"","onUpdate:modelValue":e[78]||(e[78]=f=>r.configFile.audio_auto_send_input=f),onChange:e[79]||(e[79]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.audio_auto_send_input]])])])]),_("tr",null,[lat,_("td",null,[_("div",cat,[xe(_("input",{type:"checkbox",id:"auto_speak",required:"","onUpdate:modelValue":e[80]||(e[80]=f=>r.configFile.auto_speak=f),onChange:e[81]||(e[81]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.auto_speak]])])])]),_("tr",null,[dat,_("td",null,[xe(_("input",{id:"audio_pitch","onUpdate:modelValue":e[82]||(e[82]=f=>r.configFile.audio_pitch=f),onChange:e[83]||(e[83]=f=>s.settingsChanged=!0),type:"range",min:"0",max:"10",step:"0.1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.audio_pitch]]),xe(_("input",{"onUpdate:modelValue":e[84]||(e[84]=f=>r.configFile.audio_pitch=f),onChange:e[85]||(e[85]=f=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Xe,r.configFile.audio_pitch]])])]),_("tr",null,[uat,_("td",null,[xe(_("input",{id:"audio_silenceTimer","onUpdate:modelValue":e[86]||(e[86]=f=>r.configFile.audio_silenceTimer=f),onChange:e[87]||(e[87]=f=>s.settingsChanged=!0),type:"range",min:"0",max:"10000",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.audio_silenceTimer]]),xe(_("input",{"onUpdate:modelValue":e[88]||(e[88]=f=>r.configFile.audio_silenceTimer=f),onChange:e[89]||(e[89]=f=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Xe,r.configFile.audio_silenceTimer]])])]),_("tr",null,[pat,_("td",null,[xe(_("select",{id:"audio_in_language","onUpdate:modelValue":e[90]||(e[90]=f=>r.configFile.audio_in_language=f),onChange:e[91]||(e[91]=f=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(O(!0),D($e,null,lt(r.audioLanguages,f=>(O(),D("option",{key:f.code,value:f.code},he(f.name),9,_at))),128))],544),[[ei,r.configFile.audio_in_language]])])]),_("tr",null,[hat,_("td",null,[xe(_("select",{id:"audio_out_voice","onUpdate:modelValue":e[92]||(e[92]=f=>r.configFile.audio_out_voice=f),onChange:e[93]||(e[93]=f=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(O(!0),D($e,null,lt(s.audioVoices,f=>(O(),D("option",{key:f.name,value:f.name},he(f.name),9,fat))),128))],544),[[ei,r.configFile.audio_out_voice]])])])])]),_:1})])],2)]),_("div",mat,[_("div",gat,[_("button",{onClick:e[94]||(e[94]=Te(f=>s.servers_conf_collapsed=!s.servers_conf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[xe(_("div",null,bat,512),[[At,s.servers_conf_collapsed]]),xe(_("div",null,vat,512),[[At,!s.servers_conf_collapsed]]),yat])]),_("div",{class:He([{hidden:s.servers_conf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[Ie(o,{title:"Stable diffusion service",is_subcard:!0,class:"pb-2 m-2"},{default:ot(()=>[_("table",Tat,[_("tr",null,[xat,_("td",null,[_("div",Cat,[xe(_("input",{type:"checkbox",id:"enable_sd_service",required:"","onUpdate:modelValue":e[95]||(e[95]=f=>r.configFile.enable_sd_service=f),onChange:e[96]||(e[96]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.enable_sd_service]])])])]),_("tr",null,[Rat,_("td",null,[_("div",Aat,[_("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[97]||(e[97]=(...f)=>r.reinstallSDService&&r.reinstallSDService(...f))},"Reinstall sd service")])])]),_("tr",null,[wat,_("td",null,[_("div",Nat,[xe(_("input",{type:"text",id:"sd_base_url",required:"","onUpdate:modelValue":e[98]||(e[98]=f=>r.configFile.sd_base_url=f),onChange:e[99]||(e[99]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Xe,r.configFile.sd_base_url]])])])])])]),_:1}),Ie(o,{title:"XTTS service",is_subcard:!0,class:"pb-2 m-2"},{default:ot(()=>[_("table",Oat,[_("tr",null,[Iat,_("td",null,[_("div",Mat,[xe(_("input",{type:"checkbox",id:"enable_voice_service",required:"","onUpdate:modelValue":e[100]||(e[100]=f=>r.configFile.enable_voice_service=f),onChange:e[101]||(e[101]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.enable_voice_service]])])])]),_("tr",null,[Dat,_("td",null,[_("div",Lat,[_("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[102]||(e[102]=(...f)=>r.reinstallAudioService&&r.reinstallAudioService(...f))},"Reinstall xtts service")])])]),_("tr",null,[kat,_("td",null,[_("div",Pat,[xe(_("input",{type:"text",id:"xtts_base_url",required:"","onUpdate:modelValue":e[103]||(e[103]=f=>r.configFile.xtts_base_url=f),onChange:e[104]||(e[104]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Xe,r.configFile.xtts_base_url]])])])]),_("tr",null,[Uat,_("td",null,[_("div",Fat,[xe(_("select",{"onUpdate:modelValue":e[105]||(e[105]=f=>r.current_language=f),onChange:e[106]||(e[106]=f=>s.settingsChanged=!0),disabled:!r.enable_voice_service},[(O(!0),D($e,null,lt(s.voice_languages,(f,b)=>(O(),D("option",{key:b,value:f},he(b),9,Gat))),128))],40,Bat),[[ei,r.current_language]])])])]),_("tr",null,[Vat,_("td",null,[_("div",zat,[xe(_("select",{"onUpdate:modelValue":e[107]||(e[107]=f=>r.current_voice=f),onChange:e[108]||(e[108]=f=>s.settingsChanged=!0),disabled:!r.enable_voice_service},[(O(!0),D($e,null,lt(s.voices,f=>(O(),D("option",{key:f,value:f},he(f),9,qat))),128))],40,Hat),[[ei,r.current_voice]])])])]),_("tr",null,[Yat,_("td",null,[_("div",$at,[xe(_("input",{type:"checkbox",id:"auto_read",required:"","onUpdate:modelValue":e[109]||(e[109]=f=>r.configFile.auto_read=f),onChange:e[110]||(e[110]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",disabled:!r.enable_voice_service},null,40,Wat),[[Pt,r.configFile.auto_read]])])])])])]),_:1})],2)]),_("div",Kat,[_("div",jat,[_("button",{onClick:e[111]||(e[111]=Te(f=>s.bzc_collapsed=!s.bzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[xe(_("div",null,Xat,512),[[At,s.bzc_collapsed]]),xe(_("div",null,Jat,512),[[At,!s.bzc_collapsed]]),elt,r.configFile.binding_name?j("",!0):(O(),D("div",tlt,[nlt,je(" No binding selected! ")])),r.configFile.binding_name?(O(),D("div",ilt,"|")):j("",!0),r.configFile.binding_name?(O(),D("div",slt,[_("div",rlt,[_("img",{src:r.imgBinding,class:"w-8 h-8 rounded-full object-fill text-blue-700"},null,8,olt),_("h3",alt,he(r.binding_name),1)])])):j("",!0)])]),_("div",{class:He([{hidden:s.bzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[r.bindingsZoo&&r.bindingsZoo.length>0?(O(),D("div",llt,[_("label",clt," Bindings: ("+he(r.bindingsZoo.length)+") ",1),_("div",{class:He(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",s.bzl_collapsed?"":"max-h-96"])},[Ie(ys,{name:"list"},{default:ot(()=>[(O(!0),D($e,null,lt(r.bindingsZoo,(f,b)=>(O(),Ot(a,{ref_for:!0,ref:"bindingZoo",key:"index-"+b+"-"+f.folder,binding:f,"on-selected":r.onBindingSelected,"on-reinstall":r.onReinstallBinding,"on-unInstall":r.onUnInstallBinding,"on-install":r.onInstallBinding,"on-settings":r.onSettingsBinding,"on-reload-binding":r.onReloadBinding,selected:f.folder===r.configFile.binding_name},null,8,["binding","on-selected","on-reinstall","on-unInstall","on-install","on-settings","on-reload-binding","selected"]))),128))]),_:1})],2)])):j("",!0),s.bzl_collapsed?(O(),D("button",{key:1,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Collapse",type:"button",onClick:e[112]||(e[112]=f=>s.bzl_collapsed=!s.bzl_collapsed)},ult)):(O(),D("button",{key:2,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Expand",type:"button",onClick:e[113]||(e[113]=f=>s.bzl_collapsed=!s.bzl_collapsed)},_lt))],2)]),_("div",hlt,[_("div",flt,[_("button",{onClick:e[114]||(e[114]=Te(f=>r.modelsZooToggleCollapse(),["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[xe(_("div",null,glt,512),[[At,s.mzc_collapsed]]),xe(_("div",null,blt,512),[[At,!s.mzc_collapsed]]),Slt,_("div",vlt,[r.configFile.binding_name?j("",!0):(O(),D("div",ylt,[Tlt,je(" Select binding first! ")])),!s.isModelSelected&&r.configFile.binding_name?(O(),D("div",xlt,[Clt,je(" No model selected! ")])):j("",!0),r.configFile.model_name?(O(),D("div",Rlt,"|")):j("",!0),r.configFile.model_name?(O(),D("div",Alt,[_("div",wlt,[_("img",{src:r.imgModel,class:"w-8 h-8 rounded-lg object-fill"},null,8,Nlt),_("h3",Olt,he(r.configFile.model_name),1)])])):j("",!0)])])]),_("div",{class:He([{hidden:s.mzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[_("div",Ilt,[_("div",Mlt,[_("div",Dlt,[s.searchModelInProgress?(O(),D("div",Llt,Plt)):j("",!0),s.searchModelInProgress?j("",!0):(O(),D("div",Ult,Blt))]),xe(_("input",{type:"search",class:"block w-full p-4 pl-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Search models...",required:"","onUpdate:modelValue":e[115]||(e[115]=f=>s.searchModel=f),onKeyup:e[116]||(e[116]=mr((...f)=>r.searchModel_func&&r.searchModel_func(...f),["enter"]))},null,544),[[Xe,s.searchModel]]),s.searchModel?(O(),D("button",{key:0,onClick:e[117]||(e[117]=Te(f=>s.searchModel="",["stop"])),type:"button",class:"text-white absolute right-2.5 bottom-2.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"}," Clear search")):j("",!0)])]),_("div",null,[xe(_("input",{"onUpdate:modelValue":e[118]||(e[118]=f=>s.show_only_installed_models=f),class:"m-2 p-2",type:"checkbox",ref:"only_installed"},null,512),[[Pt,s.show_only_installed_models]]),Glt]),_("div",null,[Ie(l,{radioOptions:s.sortOptions,onRadioSelected:r.handleRadioSelected},null,8,["radioOptions","onRadioSelected"])]),Vlt,s.is_loading_zoo?(O(),D("div",zlt,Ylt)):j("",!0),s.models_zoo&&s.models_zoo.length>0?(O(),D("div",$lt,[_("label",Wlt," Models: ("+he(s.models_zoo.length)+") ",1),_("div",{class:He(["overflow-y-auto p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4 overflow-y-scroll w-full dark:bg-bg-dark scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",s.mzl_collapsed?"":"max-h-96"])},[Ie(ys,{name:"list"},{default:ot(()=>[(O(!0),D($e,null,lt(r.rendered_models_zoo,(f,b)=>(O(),Ot(c,{ref_for:!0,ref:"modelZoo",key:"index-"+b+"-"+f.name,model:f,"is-installed":f.isInstalled,"on-install":r.onInstall,"on-uninstall":r.onUninstall,"on-selected":r.onModelSelected,selected:f.name===r.configFile.model_name,model_type:f.model_type,"on-copy":r.onCopy,"on-copy-link":r.onCopyLink,"on-cancel-install":r.onCancelInstall},null,8,["model","is-installed","on-install","on-uninstall","on-selected","selected","model_type","on-copy","on-copy-link","on-cancel-install"]))),128)),_("button",{ref:"load_more_models",class:"relative items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 select-none",onClick:e[119]||(e[119]=(...f)=>r.load_more_models&&r.load_more_models(...f))},"Load more models",512)]),_:1})],2)])):j("",!0),s.mzl_collapsed?(O(),D("button",{key:2,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Collapse",type:"button",onClick:e[120]||(e[120]=(...f)=>r.open_mzl&&r.open_mzl(...f))},jlt)):(O(),D("button",{key:3,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Expand",type:"button",onClick:e[121]||(e[121]=(...f)=>r.open_mzl&&r.open_mzl(...f))},Xlt))],2)]),_("div",Zlt,[_("div",Jlt,[_("button",{onClick:e[122]||(e[122]=Te(f=>s.mzdc_collapsed=!s.mzdc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[xe(_("div",null,tct,512),[[At,s.mzdc_collapsed]]),xe(_("div",null,ict,512),[[At,!s.mzdc_collapsed]]),sct,r.binding_name?j("",!0):(O(),D("div",rct,[oct,je(" No binding selected! ")])),r.configFile.binding_name?(O(),D("div",act,"|")):j("",!0),r.configFile.binding_name?(O(),D("div",lct,[_("div",cct,[_("img",{src:r.imgBinding,class:"w-8 h-8 rounded-full object-fill text-blue-700"},null,8,dct),_("h3",uct,he(r.binding_name),1)])])):j("",!0)])]),_("div",{class:He([{hidden:s.mzdc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[_("div",pct,[_("div",_ct,[_("div",null,[_("div",hct,[fct,xe(_("input",{type:"text","onUpdate:modelValue":e[123]||(e[123]=f=>s.reference_path=f),class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter Path ...",required:""},null,512),[[Xe,s.reference_path]])]),_("button",{type:"button",onClick:e[124]||(e[124]=Te(f=>r.onCreateReference(),["stop"])),class:"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},"Add reference")]),s.modelDownlaodInProgress?j("",!0):(O(),D("div",mct,[_("div",gct,[Ect,xe(_("input",{type:"text","onUpdate:modelValue":e[125]||(e[125]=f=>s.addModel.url=f),class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter URL ...",required:""},null,512),[[Xe,s.addModel.url]])]),_("button",{type:"button",onClick:e[126]||(e[126]=Te(f=>r.onInstallAddModel(),["stop"])),class:"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},"Download")])),s.modelDownlaodInProgress?(O(),D("div",bct,[Sct,_("div",vct,[_("div",yct,[_("div",Tct,[xct,_("span",Cct,he(Math.floor(s.addModel.progress))+"%",1)]),_("div",{class:"mx-1 opacity-80 line-clamp-1",title:s.addModel.url},he(s.addModel.url),9,Rct),_("div",Act,[_("div",{class:"bg-blue-600 h-2.5 rounded-full",style:Xt({width:s.addModel.progress+"%"})},null,4)]),_("div",wct,[_("span",Nct,"Download speed: "+he(r.speed_computed)+"/s",1),_("span",Oct,he(r.downloaded_size_computed)+"/"+he(r.total_size_computed),1)])])]),_("div",Ict,[_("div",Mct,[_("div",Dct,[_("button",{onClick:e[127]||(e[127]=Te((...f)=>r.onCancelInstall&&r.onCancelInstall(...f),["stop"])),type:"button",title:"Cancel download",class:"text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600"}," Cancel ")])])])])):j("",!0)])])],2)]),_("div",Lct,[_("div",kct,[_("button",{onClick:e[130]||(e[130]=Te(f=>s.pzc_collapsed=!s.pzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 text-left w-full flex items-center"},[xe(_("div",null,Uct,512),[[At,s.pzc_collapsed]]),xe(_("div",null,Bct,512),[[At,!s.pzc_collapsed]]),Gct,r.configFile.personalities?(O(),D("div",Vct,"|")):j("",!0),_("div",zct,he(r.active_pesonality),1),r.configFile.personalities?(O(),D("div",Hct,"|")):j("",!0),r.configFile.personalities?(O(),D("div",qct,[r.mountedPersArr.length>0?(O(),D("div",Yct,[(O(!0),D($e,null,lt(r.mountedPersArr,(f,b)=>(O(),D("div",{class:"relative hover:-translate-y-2 duration-300 hover:z-10 shrink-0",key:b+"-"+f.name,ref_for:!0,ref:"mountedPersonalities"},[_("div",$ct,[_("button",{onClick:Te(E=>r.onPersonalitySelected(f),["stop"])},[_("img",{src:s.bUrl+f.avatar,onError:e[128]||(e[128]=(...E)=>r.personalityImgPlacehodler&&r.personalityImgPlacehodler(...E)),class:He(["w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 group-hover:border-secondary",r.configFile.active_personality_id==r.configFile.personalities.indexOf(f.full_path)?"border-secondary":"border-transparent z-0"]),title:f.name},null,42,Kct)],8,Wct),_("button",{onClick:Te(E=>r.unmountPersonality(f),["stop"])},Xct,8,jct)])]))),128))])):j("",!0)])):j("",!0),_("button",{onClick:e[129]||(e[129]=Te(f=>r.unmountAll(),["stop"])),class:"bg-bg-light hover:border-green-200 ml-5 dark:bg-bg-dark rounded-full border-2 border-transparent",title:"Unmount All"},Jct)])]),_("div",{class:He([{hidden:s.pzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[_("div",edt,[tdt,_("div",ndt,[_("div",idt,[s.searchPersonalityInProgress?(O(),D("div",sdt,odt)):j("",!0),s.searchPersonalityInProgress?j("",!0):(O(),D("div",adt,cdt))]),xe(_("input",{type:"search",id:"personality-search",class:"block w-full p-4 pl-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Search personality...",required:"","onUpdate:modelValue":e[131]||(e[131]=f=>s.searchPersonality=f),onKeyup:e[132]||(e[132]=Te((...f)=>r.searchPersonality_func&&r.searchPersonality_func(...f),["stop"]))},null,544),[[Xe,s.searchPersonality]]),s.searchPersonality?(O(),D("button",{key:0,onClick:e[133]||(e[133]=Te(f=>s.searchPersonality="",["stop"])),type:"button",class:"text-white absolute right-2.5 bottom-2.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"}," Clear search")):j("",!0)])]),s.searchPersonality?j("",!0):(O(),D("div",ddt,[_("label",udt," Personalities Category: ("+he(s.persCatgArr.length)+") ",1),_("select",{id:"persCat",onChange:e[134]||(e[134]=f=>r.update_personality_category(f.target.value,r.refresh)),class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},[(O(!0),D($e,null,lt(s.persCatgArr,(f,b)=>(O(),D("option",{key:b,selected:f==this.configFile.personality_category},he(f),9,pdt))),128))],32)])),_("div",null,[s.personalitiesFiltered.length>0?(O(),D("div",_dt,[_("label",hdt,he(s.searchPersonality?"Search results":"Personalities")+": ("+he(s.personalitiesFiltered.length)+") ",1),_("div",{class:He(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",s.pzl_collapsed?"":"max-h-96"])},[Ie(ys,{name:"bounce"},{default:ot(()=>[(O(!0),D($e,null,lt(s.personalitiesFiltered,(f,b)=>(O(),Ot(d,{ref_for:!0,ref:"personalitiesZoo",key:"index-"+b+"-"+f.name,personality:f,select_language:!0,full_path:f.full_path,selected:r.configFile.active_personality_id==r.configFile.personalities.findIndex(E=>E===f.full_path||E===f.full_path+":"+f.language),"on-selected":r.onPersonalitySelected,"on-mount":r.mountPersonality,"on-un-mount":r.unmountPersonality,"on-remount":r.remountPersonality,"on-reinstall":r.onPersonalityReinstall,"on-settings":r.onSettingsPersonality,"on-copy-personality-name":r.onCopyPersonalityName},null,8,["personality","full_path","selected","on-selected","on-mount","on-un-mount","on-remount","on-reinstall","on-settings","on-copy-personality-name"]))),128))]),_:1})],2)])):j("",!0)]),s.pzl_collapsed?(O(),D("button",{key:1,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Collapse",type:"button",onClick:e[135]||(e[135]=f=>s.pzl_collapsed=!s.pzl_collapsed)},mdt)):(O(),D("button",{key:2,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Expand",type:"button",onClick:e[136]||(e[136]=f=>s.pzl_collapsed=!s.pzl_collapsed)},Edt))],2)]),_("div",bdt,[_("div",Sdt,[_("button",{onClick:e[138]||(e[138]=Te(f=>s.ezc_collapsed=!s.ezc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 text-left w-full flex items-center"},[xe(_("div",null,ydt,512),[[At,s.ezc_collapsed]]),xe(_("div",null,xdt,512),[[At,!s.ezc_collapsed]]),Cdt,r.configFile.extensions?(O(),D("div",Rdt,"|")):j("",!0),r.configFile.extensions?(O(),D("div",Adt,[r.mountedExtensions.length>0?(O(),D("div",wdt,[(O(!0),D($e,null,lt(r.mountedExtensions,(f,b)=>(O(),D("div",{class:"relative hover:-translate-y-2 duration-300 hover:z-10 shrink-0",key:b+"-"+f.name,ref_for:!0,ref:"mountedExtensions"},[_("div",Ndt,[_("button",null,[_("img",{src:s.bUrl+f.avatar,onError:e[137]||(e[137]=(...E)=>r.extensionImgPlacehodler&&r.extensionImgPlacehodler(...E)),class:He(["w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 group-hover:border-secondary","border-transparent z-0"]),title:f.name},null,40,Odt)]),_("button",{onClick:Te(E=>r.unmountExtension(f),["stop"])},Ddt,8,Idt)])]))),128))])):j("",!0)])):j("",!0)])]),_("div",{class:He([{hidden:s.ezc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[_("div",Ldt,[kdt,_("div",Pdt,[_("div",Udt,[s.searchExtensionInProgress?(O(),D("div",Fdt,Gdt)):j("",!0),s.searchExtensionInProgress?j("",!0):(O(),D("div",Vdt,Hdt))]),xe(_("input",{type:"search",id:"personality-search",class:"block w-full p-4 pl-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Search extension...",required:"","onUpdate:modelValue":e[139]||(e[139]=f=>s.searchExtension=f),onKeyup:e[140]||(e[140]=Te((...f)=>n.searchExtension_func&&n.searchExtension_func(...f),["stop"]))},null,544),[[Xe,s.searchExtension]]),s.searchExtension?(O(),D("button",{key:0,onClick:e[141]||(e[141]=Te(f=>s.searchExtension="",["stop"])),type:"button",class:"text-white absolute right-2.5 bottom-2.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"}," Clear search")):j("",!0)])]),s.searchExtension?j("",!0):(O(),D("div",qdt,[_("label",Ydt," Extensions Category: ("+he(s.extCatgArr.length)+") ",1),_("select",{id:"extCat",onChange:e[142]||(e[142]=f=>r.update_extension_category(f.target.value,r.refresh)),class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},[(O(!0),D($e,null,lt(s.extCatgArr,(f,b)=>(O(),D("option",{key:b,selected:f==this.extension_category},he(f),9,$dt))),128))],32)])),_("div",null,[s.extensionsFiltered.length>0?(O(),D("div",Wdt,[_("label",Kdt,he(s.searchExtension?"Search results":"Personalities")+": ("+he(s.extensionsFiltered.length)+") ",1),_("div",{class:He(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",s.ezl_collapsed?"":"max-h-96"])},[(O(!0),D($e,null,lt(s.extensionsFiltered,(f,b)=>(O(),Ot(u,{ref_for:!0,ref:"extensionsZoo",key:"index-"+b+"-"+f.name,extension:f,select_language:!0,full_path:f.full_path,"on-mount":r.mountExtension,"on-un-mount":r.unmountExtension,"on-remount":r.remountExtension,"on-reinstall":r.onExtensionReinstall,"on-settings":r.onSettingsExtension},null,8,["extension","full_path","on-mount","on-un-mount","on-remount","on-reinstall","on-settings"]))),128))],2)])):j("",!0)]),s.ezc_collapsed?(O(),D("button",{key:1,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Collapse",type:"button",onClick:e[143]||(e[143]=f=>s.ezl_collapsed=!s.ezl_collapsed)},Qdt)):(O(),D("button",{key:2,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Expand",type:"button",onClick:e[144]||(e[144]=f=>s.ezl_collapsed=!s.ezl_collapsed)},Zdt))],2)]),_("div",Jdt,[_("div",eut,[_("button",{onClick:e[145]||(e[145]=Te(f=>s.mep_collapsed=!s.mep_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 text-left w-full flex items-center"},[xe(_("div",null,nut,512),[[At,s.mep_collapsed]]),xe(_("div",null,sut,512),[[At,!s.mep_collapsed]]),rut])]),_("div",{class:He([{hidden:s.mep_collapsed},"flex flex-col mb-2 px-3 pb-0"])},null,2)]),_("div",out,[_("div",aut,[_("button",{onClick:e[146]||(e[146]=Te(f=>s.mc_collapsed=!s.mc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[xe(_("div",null,cut,512),[[At,s.mc_collapsed]]),xe(_("div",null,uut,512),[[At,!s.mc_collapsed]]),put])]),_("div",{class:He([{hidden:s.mc_collapsed},"flex flex-col mb-2 p-2"])},[_("div",_ut,[_("div",hut,[xe(_("input",{id:"override-model-parameters",type:"checkbox",class:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-700 dark:focus:ring-offset-gray-700 focus:ring-2 dark:bg-gray-600 dark:border-gray-500",onClick:e[147]||(e[147]=Te(()=>{},["stop"])),"onUpdate:modelValue":e[148]||(e[148]=f=>r.configFile.override_personality_model_parameters=f),onChange:e[149]||(e[149]=f=>r.update_setting("override_personality_model_parameters",r.configFile.override_personality_model_parameters))},null,544),[[Pt,r.configFile.override_personality_model_parameters]]),fut])]),_("div",{class:He(r.configFile.override_personality_model_parameters?"":"pointer-events-none opacity-30")},[_("div",mut,[gut,xe(_("input",{type:"text",id:"seed","onUpdate:modelValue":e[150]||(e[150]=f=>r.configFile.seed=f),class:"bg-gray-50 border border-gray-300 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,512),[[Xe,r.configFile.seed]])]),_("div",Eut,[_("div",but,[_("div",Sut,[vut,_("p",yut,[xe(_("input",{type:"text",id:"temp-val","onUpdate:modelValue":e[151]||(e[151]=f=>r.configFile.temperature=f),onChange:e[152]||(e[152]=f=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.temperature]])])]),xe(_("input",{id:"temperature",onChange:e[153]||(e[153]=f=>s.settingsChanged=!0),type:"range","onUpdate:modelValue":e[154]||(e[154]=f=>r.configFile.temperature=f),min:"0",max:"5",step:"0.1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.temperature]])])]),_("div",Tut,[_("div",xut,[_("div",Cut,[Rut,_("p",Aut,[xe(_("input",{type:"text",id:"predict-val","onUpdate:modelValue":e[155]||(e[155]=f=>r.configFile.n_predict=f),onChange:e[156]||(e[156]=f=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.n_predict]])])]),xe(_("input",{id:"predict",type:"range",onChange:e[157]||(e[157]=f=>s.settingsChanged=!0),"onUpdate:modelValue":e[158]||(e[158]=f=>r.configFile.n_predict=f),min:"0",max:"2048",step:"32",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.n_predict]])])]),_("div",wut,[_("div",Nut,[_("div",Out,[Iut,_("p",Mut,[xe(_("input",{type:"text",id:"top_k-val","onUpdate:modelValue":e[159]||(e[159]=f=>r.configFile.top_k=f),onChange:e[160]||(e[160]=f=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.top_k]])])]),xe(_("input",{id:"top_k",type:"range",onChange:e[161]||(e[161]=f=>s.settingsChanged=!0),"onUpdate:modelValue":e[162]||(e[162]=f=>r.configFile.top_k=f),min:"0",max:"100",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.top_k]])])]),_("div",Dut,[_("div",Lut,[_("div",kut,[Put,_("p",Uut,[xe(_("input",{type:"text",id:"top_p-val","onUpdate:modelValue":e[163]||(e[163]=f=>r.configFile.top_p=f),onChange:e[164]||(e[164]=f=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.top_p]])])]),xe(_("input",{id:"top_p",type:"range","onUpdate:modelValue":e[165]||(e[165]=f=>r.configFile.top_p=f),min:"0",max:"1",step:"0.01",onChange:e[166]||(e[166]=f=>s.settingsChanged=!0),class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.top_p]])])]),_("div",Fut,[_("div",But,[_("div",Gut,[Vut,_("p",zut,[xe(_("input",{type:"text",id:"repeat_penalty-val","onUpdate:modelValue":e[167]||(e[167]=f=>r.configFile.repeat_penalty=f),onChange:e[168]||(e[168]=f=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.repeat_penalty]])])]),xe(_("input",{id:"repeat_penalty",onChange:e[169]||(e[169]=f=>s.settingsChanged=!0),type:"range","onUpdate:modelValue":e[170]||(e[170]=f=>r.configFile.repeat_penalty=f),min:"0",max:"2",step:"0.01",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.repeat_penalty]])])]),_("div",Hut,[_("div",qut,[_("div",Yut,[$ut,_("p",Wut,[xe(_("input",{type:"text",id:"repeat_last_n-val","onUpdate:modelValue":e[171]||(e[171]=f=>r.configFile.repeat_last_n=f),onChange:e[172]||(e[172]=f=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.repeat_last_n]])])]),xe(_("input",{id:"repeat_last_n",type:"range","onUpdate:modelValue":e[173]||(e[173]=f=>r.configFile.repeat_last_n=f),min:"0",max:"100",step:"1",onChange:e[174]||(e[174]=f=>s.settingsChanged=!0),class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.repeat_last_n]])])])],2)],2)])],2)]),Ie(h,{ref:"addmodeldialog"},null,512),Ie(m,{class:"z-20",show:s.variantSelectionDialogVisible,choices:s.variant_choices,onChoiceSelected:r.onVariantChoiceSelected,onCloseDialog:r.oncloseVariantChoiceDialog,onChoiceValidated:r.onvalidateVariantChoice},null,8,["show","choices","onChoiceSelected","onCloseDialog","onChoiceValidated"])],64)}const jut=gt(nst,[["render",Kut],["__scopeId","data-v-d96111fe"]]),Qut={components:{ClipBoardTextInput:sb,Card:dc},data(){return{dataset_path:"",max_length:1024,batch_size:4,lr:5e-5,num_epochs:2,selectedFolder:"",selectedDataset:""}},methods:{submitForm(){const n={model_name:this.selectedModel,dataset_file:this.selectedDataset,max_length:this.max_length,batch_size:this.batch_size,lr:this.lr,num_epochs:this.num_epochs,output_dir:this.selectedFolder};Ue.post("/start_training",n).then(e=>{})},openFolderSelector(){this.$refs.folder_selector.click()},selectOutputDirectory(n){var t;console.log("here");const e=(t=n.target.files[0])==null?void 0:t.path;console.log(e),e&&(this.selectedFolder=e)},selectDataset(n){const e=n.target.files;e.length>0&&(this.selectedDataset=e[0])}},computed:{selectedModel:{get(){return this.$store.state.selectedModel}},models:{get(){return this.$store.state.modelsArr}}},watch:{model_name(n){console.log("watching model_name",n),this.$refs.clipboardInput.inputValue=n}}},Xut={key:0,class:"container overflow-y-scroll flex flex-col no-scrollbar shadow-lg p-10 pt-2 bg-bg-light-tone dark:bg-bg-dark-tone"},Zut={class:"mb-4"},Jut=_("label",{for:"model_name",class:"text-sm"},"Model Name:",-1),ept=["value"],tpt={class:"mb-4"},npt=_("label",{for:"dataset_path",class:"text-sm"},"Dataset:",-1),ipt={class:"mb-4"},spt=_("label",{for:"lr",class:"text-sm"},"Learning Rate:",-1),rpt={class:"mb-4"},opt=_("label",{for:"num_epochs",class:"text-sm"},"Number of Epochs:",-1),apt={class:"mb-4"},lpt=_("label",{for:"max_length",class:"text-sm"},"Max Length:",-1),cpt={class:"mb-4"},dpt=_("label",{for:"batch_size",class:"text-sm"},"Batch Size:",-1),upt={class:"mb-4"},ppt=_("label",{for:"output_dir",class:"text-sm"},"Output Directory:",-1),_pt=_("button",{class:"bg-blue-500 text-white px-4 py-2 rounded"},"Start training",-1),hpt={key:1};function fpt(n,e,t,i,s,r){const o=_t("Card"),a=_t("ClipBoardTextInput");return r.selectedModel!==null&&r.selectedModel.toLowerCase().includes("gptq")?(O(),D("div",Xut,[_("form",{onSubmit:e[2]||(e[2]=Te((...l)=>r.submitForm&&r.submitForm(...l),["prevent"])),class:""},[Ie(o,{title:"Training configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:ot(()=>[Ie(o,{title:"Model",class:"",isHorizontal:!1},{default:ot(()=>[_("div",Zut,[Jut,xe(_("select",{"onUpdate:modelValue":e[0]||(e[0]=l=>r.selectedModel=l),onChange:e[1]||(e[1]=(...l)=>n.setModel&&n.setModel(...l)),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},[(O(!0),D($e,null,lt(r.models,l=>(O(),D("option",{key:l,value:l},he(l),9,ept))),128))],544),[[ei,r.selectedModel]])])]),_:1}),Ie(o,{title:"Data",isHorizontal:!1},{default:ot(()=>[_("div",tpt,[npt,Ie(a,{id:"model_path",inputType:"file",value:s.dataset_path,onchange:"selectDataset()"},null,8,["value"])])]),_:1}),Ie(o,{title:"Training",isHorizontal:!1},{default:ot(()=>[_("div",ipt,[spt,Ie(a,{id:"model_path",inputType:"integer",value:s.lr},null,8,["value"])]),_("div",rpt,[opt,Ie(a,{id:"model_path",inputType:"integer",value:s.num_epochs},null,8,["value"])]),_("div",apt,[lpt,Ie(a,{id:"model_path",inputType:"integer",value:s.max_length},null,8,["value"])]),_("div",cpt,[dpt,Ie(a,{id:"model_path",inputType:"integer",value:s.batch_size},null,8,["value"])])]),_:1}),Ie(o,{title:"Output",isHorizontal:!1},{default:ot(()=>[_("div",upt,[ppt,Ie(a,{id:"model_path",inputType:"text",value:n.output_dir},null,8,["value"])])]),_:1})]),_:1}),Ie(o,{disableHoverAnimation:!0,disableFocus:!0},{default:ot(()=>[_pt]),_:1})],32)])):(O(),D("div",hpt,[Ie(o,{title:"Info",class:"",isHorizontal:!1},{default:ot(()=>[je(" Only GPTQ models are supported for QLora fine tuning. Please select a GPTQ compatible binding. ")]),_:1})]))}const mpt=gt(Qut,[["render",fpt]]),gpt={components:{ClipBoardTextInput:sb,Card:dc},data(){return{model_name:"jondurbin/airoboros-7b-gpt4",tokenizer_name:"jondurbin/airoboros-7b-gpt4",dataset_path:"",max_length:1024,batch_size:4,lr:5e-5,num_epochs:2,selectedFolder:"",selectedDatasetPath:""}},methods:{submitForm(){this.model_name,this.tokenizer_name,this.selectedDatasetPath,this.max_length,this.batch_size,this.lr,this.num_epochs,this.selectedFolder},openFolderSelector(){this.$refs.folder_selector.click()},selectOutputDirectory(n){var t;console.log("here");const e=(t=n.target.files[0])==null?void 0:t.path;console.log(e),e&&(this.selectedFolder=e)},selectDatasetPath(n){const e=n.target.files;e.length>0&&(this.selectedDatasetPath=e[0].webkitRelativePath)}}},Ept={class:"container overflow-y-scroll flex flex-col no-scrollbar shadow-lg p-10 pt-2 bg-bg-light-tone dark:bg-bg-dark-tone"},bpt={class:"mb-4"},Spt=_("label",{for:"model_name",class:"text-sm"},"Model Name:",-1),vpt={class:"mb-4"},ypt=_("label",{for:"tokenizer_name",class:"text-sm"},"Tokenizer Name:",-1),Tpt=_("button",{type:"submit",class:"bg-blue-500 text-white px-4 py-2 rounded"},"Quantize LLM",-1);function xpt(n,e,t,i,s,r){const o=_t("ClipBoardTextInput"),a=_t("Card");return O(),D("div",Ept,[_("form",{onSubmit:e[0]||(e[0]=Te((...l)=>r.submitForm&&r.submitForm(...l),["prevent"])),class:"max-w-md mx-auto"},[Ie(a,{title:"Quantizing configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:ot(()=>[Ie(a,{title:"Model",class:"",isHorizontal:!1},{default:ot(()=>[_("div",bpt,[Spt,Ie(o,{id:"model_path",inputType:"text",value:s.model_name},null,8,["value"])]),_("div",vpt,[ypt,Ie(o,{id:"model_path",inputType:"text",value:s.tokenizer_name},null,8,["value"])])]),_:1})]),_:1}),Ie(a,{disableHoverAnimation:!0,disableFocus:!0},{default:ot(()=>[Tpt]),_:1})],32)])}const Cpt=gt(gpt,[["render",xpt]]),Rpt={data(){return{show:!1,prompt:"",inputText:""}},methods:{showPanel(){this.show=!0},ok(){this.show=!1,this.$emit("ok",this.inputText)},cancel(){this.show=!1,this.inputText=""}},props:{promptText:{type:String,required:!0}},watch:{promptText(n){this.prompt=n}}},Apt={key:0,class:"fixed top-0 left-0 w-full h-full flex justify-center items-center bg-black bg-opacity-50"},wpt={class:"bg-white p-8 rounded"},Npt={class:"text-xl font-bold mb-4"};function Opt(n,e,t,i,s,r){return O(),D("div",null,[s.show?(O(),D("div",Apt,[_("div",wpt,[_("h2",Npt,he(t.promptText),1),xe(_("input",{type:"text","onUpdate:modelValue":e[0]||(e[0]=o=>s.inputText=o),class:"border border-gray-300 px-4 py-2 rounded mb-4"},null,512),[[Xe,s.inputText]]),_("button",{onClick:e[1]||(e[1]=(...o)=>r.ok&&r.ok(...o)),class:"bg-blue-500 text-white px-4 py-2 rounded mr-2"},"OK"),_("button",{onClick:e[2]||(e[2]=(...o)=>r.cancel&&r.cancel(...o)),class:"bg-gray-500 text-white px-4 py-2 rounded"},"Cancel")])])):j("",!0)])}const MN=gt(Rpt,[["render",Opt]]),Ipt={props:{htmlContent:{type:String,required:!0}}},Mpt=["innerHTML"];function Dpt(n,e,t,i,s,r){return O(),D("div",null,[_("div",{innerHTML:t.htmlContent},null,8,Mpt)])}const Lpt=gt(Ipt,[["render",Dpt]]);const kpt={props:{jsonData:{type:[Object,Array,String],default:null},jsonFormText:{type:String,default:"JSON Form"}},data(){return{collapsed:!0}},computed:{formattedJson(){return typeof this.jsonData=="string"?JSON.stringify(JSON.parse(this.jsonData),null," ").replace(/\n/g,"
"):JSON.stringify(this.jsonData,null," ").replace(/\n/g,"
")},isObject(){return typeof this.jsonData=="object"&&this.jsonData!==null},isContentPresent(){return this.jsonData!==null&&(typeof this.jsonData!="string"||this.jsonData.trim()!=="")}},methods:{toggleCollapsed(){this.collapsed=!this.collapsed},toggleCollapsible(){this.collapsed=!this.collapsed}}},Ppt={key:0},Upt={class:"toggle-icon mr-1"},Fpt={key:0,class:"fas fa-plus-circle text-gray-600"},Bpt={key:1,class:"fas fa-minus-circle text-gray-600"},Gpt={class:"json-viewer max-h-64 overflow-auto p-4 bg-gray-100 border border-gray-300 rounded dark:bg-gray-600"},Vpt={key:0,class:"fas fa-plus-circle text-gray-600"},zpt={key:1,class:"fas fa-minus-circle text-gray-600"},Hpt=["innerHTML"];function qpt(n,e,t,i,s,r){return r.isContentPresent?(O(),D("div",Ppt,[_("div",{class:"collapsible-section cursor-pointer mb-4 font-bold hover:text-gray-900",onClick:e[0]||(e[0]=(...o)=>r.toggleCollapsible&&r.toggleCollapsible(...o))},[_("span",Upt,[s.collapsed?(O(),D("i",Fpt)):(O(),D("i",Bpt))]),je(" "+he(t.jsonFormText),1)]),xe(_("div",null,[_("div",Gpt,[r.isObject?(O(),D("span",{key:0,onClick:e[1]||(e[1]=(...o)=>r.toggleCollapsed&&r.toggleCollapsed(...o)),class:"toggle-icon cursor-pointer mr-1"},[s.collapsed?(O(),D("i",Vpt)):(O(),D("i",zpt))])):j("",!0),_("pre",{innerHTML:r.formattedJson},null,8,Hpt)])],512),[[At,!s.collapsed]])])):j("",!0)}const Ypt=gt(kpt,[["render",qpt]]),$pt={props:{done:{type:Boolean,required:!0},message:{type:String,required:!0},status:{type:Boolean,required:!0}}},Wpt={class:"step flex items-center mb-4"},Kpt={class:"flex items-center justify-center w-6 h-6 mr-2"},jpt={key:0},Qpt=_("i",{"data-feather":"square",class:"text-gray-400 w-4 h-4"},null,-1),Xpt=[Qpt],Zpt={key:1},Jpt=_("i",{"data-feather":"check-square",class:"text-green-500 w-4 h-4"},null,-1),e_t=[Jpt],t_t={key:2},n_t=_("i",{"data-feather":"x-square",class:"text-red-500 w-4 h-4"},null,-1),i_t=[n_t],s_t={key:0,role:"status"},r_t=_("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[_("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),_("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})],-1),o_t=[r_t];function a_t(n,e,t,i,s,r){return O(),D("div",Wpt,[_("div",Kpt,[t.done?j("",!0):(O(),D("div",jpt,Xpt)),t.done&&t.status?(O(),D("div",Zpt,e_t)):j("",!0),t.done&&!t.status?(O(),D("div",t_t,i_t)):j("",!0)]),t.done?j("",!0):(O(),D("div",s_t,o_t)),_("div",{class:He(["content flex-1 px-2",{"text-green-500":t.done,"text-yellow-500":!t.done}])},he(t.message),3)])}const l_t=gt($pt,[["render",a_t]]);const nC="/",c_t={name:"Message",emits:["copy","delete","rankUp","rankDown","updateMessage","resendMessage","continueMessage"],components:{MarkdownRenderer:vN,Step:l_t,RenderHTMLJS:Lpt,JsonViewer:Ypt,DynamicUIRenderer:IN},props:{host:{type:String,required:!1,default:"http://localhost:9600"},message:Object,avatar:""},data(){return{isSynthesizingVoice:!1,cpp_block:CN,html5_block:RN,LaTeX_block:AN,json_block:xN,javascript_block:TN,python_block:yN,bash_block:wN,audio_url:null,audio:null,msg:null,isSpeaking:!1,speechSynthesis:null,voices:[],expanded:!1,showConfirmation:!1,editMsgMode_:!1,deleteMsgMode:!1,mdRenderHeight:Number}},mounted(){"speechSynthesis"in window?(this.speechSynthesis=window.speechSynthesis,this.voices=this.speechSynthesis.getVoices(),this.voices.length===0&&this.speechSynthesis.addEventListener("voiceschanged",this.onVoicesChanged)):console.error("Speech synthesis is not supported in this browser."),Fe(()=>{Be.replace(),this.mdRenderHeight=this.$refs.mdRender.$el.offsetHeight}),this.message.hasOwnProperty("metadata")&&this.message.metadata!=null&&(this.audio_url=this.message.metadata.hasOwnProperty("audio_url")?this.message.metadata.audio_url:null)},methods:{insertTab(n){const e=n.target,t=e.selectionStart,i=e.selectionEnd,s=n.shiftKey;if(t===i)if(s){if(e.value.substring(t-4,t)==" "){const r=e.value.substring(0,t-4),o=e.value.substring(i),a=r+o;this.message.content=a,this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t-4})}}else{const r=e.value.substring(0,t),o=e.value.substring(i),a=r+" "+o;this.message.content=a,this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t+4})}else{const o=e.value.substring(t,i).split(` +You need to apply changes before you leave, or else.`,"Apply configuration","Cancel")&&this.applyConfiguration(),!1}},be=n=>(lo("data-v-86c6b6d4"),n=n(),co(),n),ist={class:"container overflow-y-scroll flex flex-row shadow-lg p-10 pt-0 overflow-y-scroll w-full dark:bg-bg-dark scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},sst={class:"sticky top-0 z-10 flex flex-row mb-2 p-3 gap-3 w-full rounded-b-lg bg-bg-light-tone dark:bg-bg-dark-tone shadow-lg"},rst={key:0,class:"flex gap-3 flex-1 items-center duration-75"},ost=be(()=>_("i",{"data-feather":"x"},null,-1)),ast=[ost],lst=be(()=>_("i",{"data-feather":"check"},null,-1)),cst=[lst],dst={key:1,class:"flex gap-3 flex-1 items-center"},ust=be(()=>_("i",{"data-feather":"save"},null,-1)),pst=[ust],_st=be(()=>_("i",{"data-feather":"refresh-ccw"},null,-1)),hst=[_st],fst=be(()=>_("i",{"data-feather":"list"},null,-1)),mst=[fst],gst={class:"flex gap-3 flex-1 items-center justify-end"},Est=be(()=>_("i",{"data-feather":"trash-2"},null,-1)),bst=[Est],Sst=be(()=>_("i",{"data-feather":"refresh-ccw"},null,-1)),vst=[Sst],yst=be(()=>_("i",{"data-feather":"arrow-up-circle"},null,-1)),Tst={key:0},xst=be(()=>_("i",{"data-feather":"alert-circle"},null,-1)),Cst=[xst],Rst={class:"flex gap-3 items-center"},Ast={key:0,class:"flex gap-3 items-center"},wst=be(()=>_("p",{class:"text-red-600 font-bold"},"Apply changes:",-1)),Nst=be(()=>_("i",{"data-feather":"check"},null,-1)),Ost=[Nst],Ist={key:1,role:"status"},Mst=be(()=>_("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[_("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),_("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})],-1)),Dst=be(()=>_("span",{class:"sr-only"},"Loading...",-1)),Lst={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},kst={class:"flex flex-row p-3"},Pst=be(()=>_("i",{"data-feather":"chevron-right"},null,-1)),Ust=[Pst],Fst=be(()=>_("i",{"data-feather":"chevron-down"},null,-1)),Bst=[Fst],Gst=be(()=>_("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," System status",-1)),Vst=be(()=>_("div",{class:"mr-2"},"|",-1)),zst={class:"text-base font-semibold cursor-pointer select-none items-center"},Hst={class:"flex gap-2 items-center"},qst={key:0},Yst={class:"flex gap-2 items-center"},$st=["src"],Wst={class:"font-bold font-large text-lg"},Kst={key:1},jst={class:"flex gap-2 items-center"},Qst=["src"],Xst={class:"font-bold font-large text-lg"},Zst=be(()=>_("i",{"data-feather":"cpu",title:"CPU Ram",class:"w-5 h-5 mx-1 flex-shrink-0"},null,-1)),Jst={class:"font-bold font-large text-lg"},ert=be(()=>_("i",{"data-feather":"hard-drive",title:"Hard drive",class:"w-5 h-5 mx-1 flex-shrink-0"},null,-1)),trt={class:"font-bold font-large text-lg"},nrt={class:"mb-2"},irt=be(()=>_("label",{class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},[_("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[_("path",{fill:"currentColor",d:"M17 17H7V7h10m4 4V9h-2V7a2 2 0 0 0-2-2h-2V3h-2v2h-2V3H9v2H7c-1.11 0-2 .89-2 2v2H3v2h2v2H3v2h2v2a2 2 0 0 0 2 2h2v2h2v-2h2v2h2v-2h2a2 2 0 0 0 2-2v-2h2v-2h-2v-2m-6 2h-2v-2h2m2-2H9v6h6V9Z"})]),je(" CPU Ram usage: ")],-1)),srt={class:"flex flex-col mx-2"},rrt=be(()=>_("b",null,"Avaliable ram: ",-1)),ort=be(()=>_("b",null,"Ram usage: ",-1)),art={class:"p-2"},lrt={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},crt={class:"mb-2"},drt=be(()=>_("label",{class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},[_("i",{"data-feather":"hard-drive",class:"w-5 h-5"}),je(" Disk usage: ")],-1)),urt={class:"flex flex-col mx-2"},prt=be(()=>_("b",null,"Avaliable disk space: ",-1)),_rt=be(()=>_("b",null,"Disk usage: ",-1)),hrt={class:"p-2"},frt={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},mrt={class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},grt=["src"],Ert={class:"flex flex-col mx-2"},brt=be(()=>_("b",null,"Model: ",-1)),Srt=be(()=>_("b",null,"Avaliable vram: ",-1)),vrt=be(()=>_("b",null,"GPU usage: ",-1)),yrt={class:"p-2"},Trt={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},xrt={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},Crt={class:"flex flex-row p-3"},Rrt=be(()=>_("i",{"data-feather":"chevron-right"},null,-1)),Art=[Rrt],wrt=be(()=>_("i",{"data-feather":"chevron-down"},null,-1)),Nrt=[wrt],Ort=be(()=>_("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Main configurations",-1)),Irt={class:"flex flex-col mb-2 px-3 pb-2"},Mrt={class:"expand-to-fit bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Drt=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"hardware_mode",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Hardware mode:")],-1)),Lrt={class:"text-center items-center"},krt={class:"flex flex-row"},Prt=be(()=>_("option",{value:"cpu"},"CPU",-1)),Urt=be(()=>_("option",{value:"cpu-noavx"},"CPU (No AVX)",-1)),Frt=be(()=>_("option",{value:"nvidia-tensorcores"},"NVIDIA (Tensor Cores)",-1)),Brt=be(()=>_("option",{value:"nvidia"},"NVIDIA",-1)),Grt=be(()=>_("option",{value:"amd-noavx"},"AMD (No AVX)",-1)),Vrt=be(()=>_("option",{value:"amd"},"AMD",-1)),zrt=be(()=>_("option",{value:"apple-intel"},"Apple Intel",-1)),Hrt=be(()=>_("option",{value:"apple-silicon"},"Apple Silicon",-1)),qrt=[Prt,Urt,Frt,Brt,Grt,Vrt,zrt,Hrt],Yrt=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"db_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Host:")],-1)),$rt={style:{width:"100%"}},Wrt=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"db_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Port:")],-1)),Krt={style:{width:"100%"}},jrt=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"db_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Database path:")],-1)),Qrt={style:{width:"100%"}},Xrt=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"auto_show_browser",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto show browser:")],-1)),Zrt={class:"flex flex-row"},Jrt=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"activate_debug",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate debug mode:")],-1)),eot={class:"flex flex-row"},tot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"auto_save",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto save:")],-1)),not={class:"flex flex-row"},iot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"auto_update",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto update:")],-1)),sot={class:"flex flex-row"},rot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"auto_update",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto title:")],-1)),oot={class:"flex flex-row"},aot={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},lot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"user_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User name:")],-1)),cot={style:{width:"100%"}},dot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"user_description",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User description:")],-1)),uot={style:{width:"100%"}},pot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"user_description",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use user description in discussion:")],-1)),_ot={style:{width:"100%"}},hot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"user_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User avatar:")],-1)),fot={style:{width:"100%"}},mot={for:"avatar-upload"},got=["src"],Eot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"use_user_name_in_discussions",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use User Name in discussions:")],-1)),bot={class:"flex flex-row"},Sot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"min_n_predict",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Minimum number of output tokens space (forces the model to have more space to speak):")],-1)),vot={style:{width:"100%"}},yot={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Tot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"use_files",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate files support:")],-1)),xot={class:"flex flex-row"},Cot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"use_discussions_history",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate discussion vectorization:")],-1)),Rot={class:"flex flex-row"},Aot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"summerize_discussion",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate Continuous Learning from discussions:")],-1)),wot={class:"flex flex-row"},Not=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"data_vectorization_visualize_on_vectorization",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"show vectorized data:")],-1)),Oot={class:"flex flex-row"},Iot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"data_vectorization_activate",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate data Vectorization:")],-1)),Mot={class:"flex flex-row"},Dot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"data_vectorization_build_keys_words",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Build keywords when querying the vectorized database:")],-1)),Lot={class:"flex flex-row"},kot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"data_vectorization_method",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization method:")],-1)),Pot=be(()=>_("option",{value:"tfidf_vectorizer"},"tfidf Vectorizer",-1)),Uot=be(()=>_("option",{value:"model_embedding"},"Model Embedding",-1)),Fot=[Pot,Uot],Bot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"data_visualization_method",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data visualization method:")],-1)),Got=be(()=>_("option",{value:"PCA"},"PCA",-1)),Vot=be(()=>_("option",{value:"TSNE"},"TSNE",-1)),zot=[Got,Vot],Hot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"data_vectorization_save_db",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Save the new files to the database (The database wil always grow and continue to be the same over many sessions):")],-1)),qot={class:"flex flex-row"},Yot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"data_vectorization_chunk_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization chunk size(tokens):")],-1)),$ot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"data_vectorization_overlap_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization overlap size(tokens):")],-1)),Wot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"data_vectorization_overlap_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Number of chunks to use for each message:")],-1)),Kot={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},jot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"pdf_latex_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"PDF LaTeX path:")],-1)),Qot={class:"flex flex-row"},Xot={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Zot=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"positive_boost",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Positive Boost:")],-1)),Jot={class:"flex flex-row"},eat=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"negative_boost",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Negative Boost:")],-1)),tat={class:"flex flex-row"},nat=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"force_output_language_to_be",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Force AI to answer in this language:")],-1)),iat={class:"flex flex-row"},sat={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},rat=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"audio_auto_send_input",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Send audio input automatically:")],-1)),oat={class:"flex flex-row"},aat=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"auto_speak",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable auto speak:")],-1)),lat={class:"flex flex-row"},cat=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"audio_pitch",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"audio pitch:")],-1)),dat=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"audio_silenceTimer",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"audio in silence timer (ms):")],-1)),uat=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"audio_in_language",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Input Audio Language:")],-1)),pat=["value"],_at=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"audio_out_voice",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Output Audio Voice:")],-1)),hat=["value"],fat={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},mat={class:"flex flex-row p-3"},gat=be(()=>_("i",{"data-feather":"chevron-right"},null,-1)),Eat=[gat],bat=be(()=>_("i",{"data-feather":"chevron-down"},null,-1)),Sat=[bat],vat=be(()=>_("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Servers configurations",-1)),yat={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Tat=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"enable_sd_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable sd service:")],-1)),xat={class:"flex flex-row"},Cat=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"install_sd_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Reinstall SD service:")],-1)),Rat={class:"flex flex-row"},Aat=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"sd_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"sd base url:")],-1)),wat={class:"flex flex-row"},Nat={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Oat=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"enable_voice_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable voice service:")],-1)),Iat={class:"flex flex-row"},Mat=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"install_xtts_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Reinstall xTTS service:")],-1)),Dat={class:"flex flex-row"},Lat=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"xtts_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"xtts base url:")],-1)),kat={class:"flex flex-row"},Pat=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"current_language",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Current language:")],-1)),Uat={class:"flex flex-row"},Fat=["disabled"],Bat=["value"],Gat=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"current_voice",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Current voice:")],-1)),Vat={class:"flex flex-row"},zat=["disabled"],Hat=["value"],qat=be(()=>_("td",{style:{"min-width":"200px"}},[_("label",{for:"auto_read",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable auto read:")],-1)),Yat={class:"flex flex-row"},$at=["disabled"],Wat={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},Kat={class:"flex flex-row p-3"},jat=be(()=>_("i",{"data-feather":"chevron-right"},null,-1)),Qat=[jat],Xat=be(()=>_("i",{"data-feather":"chevron-down"},null,-1)),Zat=[Xat],Jat=be(()=>_("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Binding zoo",-1)),elt={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},tlt=be(()=>_("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),nlt={key:1,class:"mr-2"},ilt={key:2,class:"text-base font-semibold cursor-pointer select-none items-center"},slt={class:"flex gap-1 items-center"},rlt=["src"],olt={class:"font-bold font-large text-lg line-clamp-1"},alt={key:0,class:"mb-2"},llt={for:"binding",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},clt=be(()=>_("i",{"data-feather":"chevron-up"},null,-1)),dlt=[clt],ult=be(()=>_("i",{"data-feather":"chevron-down"},null,-1)),plt=[ult],_lt={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},hlt={class:"flex flex-row p-3"},flt=be(()=>_("i",{"data-feather":"chevron-right"},null,-1)),mlt=[flt],glt=be(()=>_("i",{"data-feather":"chevron-down"},null,-1)),Elt=[glt],blt=be(()=>_("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Models zoo",-1)),Slt={class:"flex flex-row items-center"},vlt={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},ylt=be(()=>_("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),Tlt={key:1,class:"text-base text-red-600 flex gap-3 items-center mr-2"},xlt=be(()=>_("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),Clt={key:2,class:"mr-2"},Rlt={key:3,class:"text-base font-semibold cursor-pointer select-none items-center"},Alt={class:"flex gap-1 items-center"},wlt=["src"],Nlt={class:"font-bold font-large text-lg line-clamp-1"},Olt={class:"mx-2 mb-4"},Ilt={class:"relative"},Mlt={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},Dlt={key:0},Llt=be(()=>_("div",{role:"status"},[_("svg",{"aria-hidden":"true",class:"inline w-4 h-4 mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[_("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),_("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),_("span",{class:"sr-only"},"Loading...")],-1)),klt=[Llt],Plt={key:1},Ult=be(()=>_("svg",{"aria-hidden":"true",class:"w-5 h-5 text-gray-500 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[_("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)),Flt=[Ult],Blt=be(()=>_("label",{for:"only_installed"},"Show only installed models",-1)),Glt=be(()=>_("a",{href:"https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard",target:"_blank",class:"mb-4 font-bold underline text-blue-500 pb-4"},"Hugging face Leaderboard",-1)),Vlt={key:0,role:"status",class:"text-center w-full display: flex;align-items: center;"},zlt=be(()=>_("svg",{"aria-hidden":"true",class:"text-center w-full display: flex;align-items: center; h-20 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[_("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),_("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})],-1)),Hlt=be(()=>_("p",{class:"heartbeat-text"},"Loading models Zoo",-1)),qlt=[zlt,Hlt],Ylt={key:1,class:"mb-2"},$lt={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},Wlt=be(()=>_("i",{"data-feather":"chevron-up"},null,-1)),Klt=[Wlt],jlt=be(()=>_("i",{"data-feather":"chevron-down"},null,-1)),Qlt=[jlt],Xlt={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},Zlt={class:"flex flex-row p-3"},Jlt=be(()=>_("i",{"data-feather":"chevron-right"},null,-1)),ect=[Jlt],tct=be(()=>_("i",{"data-feather":"chevron-down"},null,-1)),nct=[tct],ict=be(()=>_("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Add models for binding",-1)),sct={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},rct=be(()=>_("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),oct={key:1,class:"mr-2"},act={key:2,class:"text-base font-semibold cursor-pointer select-none items-center"},lct={class:"flex gap-1 items-center"},cct=["src"],dct={class:"font-bold font-large text-lg line-clamp-1"},uct={class:"mb-2"},pct={class:"p-2"},_ct={class:"mb-3"},hct=be(()=>_("label",{class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},"Create a reference from local file path:",-1)),fct={key:0},mct={class:"mb-3"},gct=be(()=>_("label",{class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},"Download from web:",-1)),Ect={key:1,class:"relative flex flex-col items-center justify-center flex-grow h-full"},bct=be(()=>_("div",{role:"status",class:"justify-center"},null,-1)),Sct={class:"relative flex flex-row flex-grow items-center w-full h-full bottom-0"},vct={class:"w-full p-2"},yct={class:"flex justify-between mb-1"},Tct=Ru(' Downloading Loading...',1),xct={class:"text-sm font-medium text-blue-700 dark:text-white"},Cct=["title"],Rct={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},Act={class:"flex justify-between mb-1"},wct={class:"text-base font-medium text-blue-700 dark:text-white"},Nct={class:"text-sm font-medium text-blue-700 dark:text-white"},Oct={class:"flex flex-grow"},Ict={class:"flex flex-row flex-grow gap-3"},Mct={class:"p-2 text-center grow"},Dct={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},Lct={class:"flex flex-row p-3 items-center"},kct=be(()=>_("i",{"data-feather":"chevron-right"},null,-1)),Pct=[kct],Uct=be(()=>_("i",{"data-feather":"chevron-down"},null,-1)),Fct=[Uct],Bct=be(()=>_("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Personalities zoo",-1)),Gct={key:0,class:"mr-2"},Vct={class:"mr-2 font-bold font-large text-lg line-clamp-1"},zct={key:1,class:"mr-2"},Hct={key:2,class:"text-base font-semibold cursor-pointer select-none items-center flex flex-row"},qct={key:0,class:"flex -space-x-4 items-center"},Yct={class:"group items-center flex flex-row"},$ct=["onClick"],Wct=["src","title"],Kct=["onClick"],jct=be(()=>_("span",{class:"hidden group-hover:block top-0 left-7 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2 border-transparent",title:"Unmount personality"},[_("svg",{"aria-hidden":"true",class:"w-4 h-4 text-red-600 hover:text-red-500",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[_("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})])],-1)),Qct=[jct],Xct=be(()=>_("svg",{"aria-hidden":"true",class:"w-4 h-4 text-red-600 hover:text-red-500",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[_("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)),Zct=[Xct],Jct={class:"mx-2 mb-4"},edt=be(()=>_("label",{for:"personality-search",class:"mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white"},"Search",-1)),tdt={class:"relative"},ndt={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},idt={key:0},sdt=be(()=>_("div",{role:"status"},[_("svg",{"aria-hidden":"true",class:"inline w-4 h-4 mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[_("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),_("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),_("span",{class:"sr-only"},"Loading...")],-1)),rdt=[sdt],odt={key:1},adt=be(()=>_("svg",{"aria-hidden":"true",class:"w-5 h-5 text-gray-500 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[_("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)),ldt=[adt],cdt={key:0,class:"mx-2 mb-4"},ddt={for:"persCat",class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},udt=["selected"],pdt={key:0,class:"mb-2"},_dt={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},hdt=be(()=>_("i",{"data-feather":"chevron-up"},null,-1)),fdt=[hdt],mdt=be(()=>_("i",{"data-feather":"chevron-down"},null,-1)),gdt=[mdt],Edt={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},bdt={class:"flex flex-row p-3 items-center"},Sdt=be(()=>_("i",{"data-feather":"chevron-right"},null,-1)),vdt=[Sdt],ydt=be(()=>_("i",{"data-feather":"chevron-down"},null,-1)),Tdt=[ydt],xdt=be(()=>_("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Extensions zoo",-1)),Cdt={key:0,class:"mr-2"},Rdt={key:1,class:"text-base font-semibold cursor-pointer select-none items-center flex flex-row"},Adt={key:0,class:"flex -space-x-4 items-center"},wdt={class:"group items-center flex flex-row"},Ndt=["src","title"],Odt=["onClick"],Idt=be(()=>_("span",{class:"hidden group-hover:block top-0 left-7 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2 border-transparent",title:"Unmount personality"},[_("svg",{"aria-hidden":"true",class:"w-4 h-4 text-red-600 hover:text-red-500",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[_("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})])],-1)),Mdt=[Idt],Ddt={class:"mx-2 mb-4"},Ldt=be(()=>_("label",{for:"personality-search",class:"mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white"},"Search",-1)),kdt={class:"relative"},Pdt={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},Udt={key:0},Fdt=be(()=>_("div",{role:"status"},[_("svg",{"aria-hidden":"true",class:"inline w-4 h-4 mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[_("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),_("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),_("span",{class:"sr-only"},"Loading...")],-1)),Bdt=[Fdt],Gdt={key:1},Vdt=be(()=>_("svg",{"aria-hidden":"true",class:"w-5 h-5 text-gray-500 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[_("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)),zdt=[Vdt],Hdt={key:0,class:"mx-2 mb-4"},qdt={for:"extCat",class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},Ydt=["selected"],$dt={key:0,class:"mb-2"},Wdt={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},Kdt=be(()=>_("i",{"data-feather":"chevron-up"},null,-1)),jdt=[Kdt],Qdt=be(()=>_("i",{"data-feather":"chevron-down"},null,-1)),Xdt=[Qdt],Zdt={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},Jdt={class:"flex flex-row p-3 items-center"},eut=be(()=>_("i",{"data-feather":"chevron-right"},null,-1)),tut=[eut],nut=be(()=>_("i",{"data-feather":"chevron-down"},null,-1)),iut=[nut],sut=be(()=>_("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Mounted Extensions Priority",-1)),rut={class:"flex flex-col mb-2 p-3 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},out={class:"flex flex-row"},aut=be(()=>_("i",{"data-feather":"chevron-right"},null,-1)),lut=[aut],cut=be(()=>_("i",{"data-feather":"chevron-down"},null,-1)),dut=[cut],uut=be(()=>_("h3",{class:"text-lg font-semibold cursor-pointer select-none"}," Model Configuration",-1)),put={class:"m-2"},_ut={class:"flex flex-row gap-2 items-center"},hut=be(()=>_("label",{for:"override-model-parameters",class:"block text-sm font-medium"}," Override personality model parameters ",-1)),fut={class:"m-2"},mut=be(()=>_("label",{for:"seed",class:"block mb-2 text-sm font-medium"}," Seed: ",-1)),gut={class:"m-2"},Eut={class:"flex flex-col align-bottom"},but={class:"relative"},Sut=be(()=>_("p",{class:"absolute left-0 mt-6"},[_("label",{for:"temperature",class:"text-sm font-medium"}," Temperature: ")],-1)),vut={class:"absolute right-0"},yut={class:"m-2"},Tut={class:"flex flex-col align-bottom"},xut={class:"relative"},Cut=be(()=>_("p",{class:"absolute left-0 mt-6"},[_("label",{for:"predict",class:"text-sm font-medium"}," N Predict: ")],-1)),Rut={class:"absolute right-0"},Aut={class:"m-2"},wut={class:"flex flex-col align-bottom"},Nut={class:"relative"},Out=be(()=>_("p",{class:"absolute left-0 mt-6"},[_("label",{for:"top_k",class:"text-sm font-medium"}," Top-K: ")],-1)),Iut={class:"absolute right-0"},Mut={class:"m-2"},Dut={class:"flex flex-col align-bottom"},Lut={class:"relative"},kut=be(()=>_("p",{class:"absolute left-0 mt-6"},[_("label",{for:"top_p",class:"text-sm font-medium"}," Top-P: ")],-1)),Put={class:"absolute right-0"},Uut={class:"m-2"},Fut={class:"flex flex-col align-bottom"},But={class:"relative"},Gut=be(()=>_("p",{class:"absolute left-0 mt-6"},[_("label",{for:"repeat_penalty",class:"text-sm font-medium"}," Repeat penalty: ")],-1)),Vut={class:"absolute right-0"},zut={class:"m-2"},Hut={class:"flex flex-col align-bottom"},qut={class:"relative"},Yut=be(()=>_("p",{class:"absolute left-0 mt-6"},[_("label",{for:"repeat_last_n",class:"text-sm font-medium"}," Repeat last N: ")],-1)),$ut={class:"absolute right-0"};function Wut(n,e,t,i,s,r){const o=_t("Card"),a=_t("BindingEntry"),l=_t("RadioOptions"),c=_t("model-entry"),d=_t("personality-entry"),u=_t("ExtensionEntry"),h=_t("AddModelDialog"),m=_t("ChoiceDialog");return O(),D($e,null,[_("div",ist,[_("div",sst,[s.showConfirmation?(O(),D("div",rst,[_("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel",type:"button",onClick:e[0]||(e[0]=Te(f=>s.showConfirmation=!1,["stop"]))},ast),_("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm save changes",type:"button",onClick:e[1]||(e[1]=Te(f=>r.save_configuration(),["stop"]))},cst)])):j("",!0),s.showConfirmation?j("",!0):(O(),D("div",dst,[_("button",{title:"Save configuration",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[2]||(e[2]=f=>s.showConfirmation=!0)},pst),_("button",{title:"Reset configuration",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[3]||(e[3]=f=>r.reset_configuration())},hst),_("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Collapse / Expand all panels",type:"button",onClick:e[4]||(e[4]=Te(f=>s.all_collapsed=!s.all_collapsed,["stop"]))},mst)])),_("div",gst,[_("button",{title:"Clear uploads",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[5]||(e[5]=f=>r.api_get_req("clear_uploads").then(b=>{b.status?this.$store.state.toast.showToast("Success!",4,!0):this.$store.state.toast.showToast(["failed!"],4,!1)}))},bst),_("button",{title:"Restart program",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[6]||(e[6]=f=>r.api_get_req("restart_program").then(b=>{b.status?this.$store.state.toast.showToast("Success!",4,!0):this.$store.state.toast.showToast(["failed!"],4,!1)}))},vst),_("button",{title:"Upgrade program ",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[7]||(e[7]=f=>r.api_get_req("update_software").then(b=>{b.status?this.$store.state.toast.showToast("Success!",4,!0):this.$store.state.toast.showToast("Success!",4,!0)}))},[yst,s.has_updates?(O(),D("div",Tst,Cst)):j("",!0)]),_("div",Rst,[s.settingsChanged?(O(),D("div",Ast,[wst,s.isLoading?j("",!0):(O(),D("button",{key:0,class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Apply changes",type:"button",onClick:e[8]||(e[8]=Te(f=>r.applyConfiguration(),["stop"]))},Ost))])):j("",!0),s.isLoading?(O(),D("div",Ist,[_("p",null,he(s.loading_text),1),Mst,Dst])):j("",!0)])])]),_("div",{class:He(s.isLoading?"pointer-events-none opacity-30 w-full":"w-full")},[_("div",Lst,[_("div",kst,[_("button",{onClick:e[9]||(e[9]=Te(f=>s.sc_collapsed=!s.sc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[xe(_("div",null,Ust,512),[[At,s.sc_collapsed]]),xe(_("div",null,Bst,512),[[At,!s.sc_collapsed]]),Gst,Vst,_("div",zst,[_("div",Hst,[_("div",null,[r.vramUsage&&r.vramUsage.gpus&&r.vramUsage.gpus.length==1?(O(),D("div",qst,[(O(!0),D($e,null,lt(r.vramUsage.gpus,f=>(O(),D("div",Yst,[_("img",{src:s.SVGGPU,width:"25",height:"25"},null,8,$st),_("h3",Wst,[_("div",null,he(r.computedFileSize(f.used_vram))+" / "+he(r.computedFileSize(f.total_vram))+" ("+he(f.percentage)+"%) ",1)])]))),256))])):j("",!0),r.vramUsage&&r.vramUsage.gpus&&r.vramUsage.gpus.length>1?(O(),D("div",Kst,[_("div",jst,[_("img",{src:s.SVGGPU,width:"25",height:"25"},null,8,Qst),_("h3",Xst,[_("div",null,he(r.vramUsage.gpus.length)+"x ",1)])])])):j("",!0)]),Zst,_("h3",Jst,[_("div",null,he(r.ram_usage)+" / "+he(r.ram_total_space)+" ("+he(r.ram_percent_usage)+"%)",1)]),ert,_("h3",trt,[_("div",null,he(r.disk_binding_models_usage)+" / "+he(r.disk_total_space)+" ("+he(r.disk_percent_usage)+"%)",1)])])])])]),_("div",{class:He([{hidden:s.sc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[_("div",nrt,[irt,_("div",srt,[_("div",null,[rrt,je(he(r.ram_available_space),1)]),_("div",null,[ort,je(" "+he(r.ram_usage)+" / "+he(r.ram_total_space)+" ("+he(r.ram_percent_usage)+")% ",1)])]),_("div",art,[_("div",lrt,[_("div",{class:"bg-blue-600 h-2.5 rounded-full",style:Xt("width: "+r.ram_percent_usage+"%;")},null,4)])])]),_("div",crt,[drt,_("div",urt,[_("div",null,[prt,je(he(r.disk_available_space),1)]),_("div",null,[_rt,je(" "+he(r.disk_binding_models_usage)+" / "+he(r.disk_total_space)+" ("+he(r.disk_percent_usage)+"%)",1)])]),_("div",hrt,[_("div",frt,[_("div",{class:"bg-blue-600 h-2.5 rounded-full",style:Xt("width: "+r.disk_percent_usage+"%;")},null,4)])])]),(O(!0),D($e,null,lt(r.vramUsage.gpus,f=>(O(),D("div",{class:"mb-2",key:f},[_("label",mrt,[_("img",{src:s.SVGGPU,width:"25",height:"25"},null,8,grt),je(" GPU usage: ")]),_("div",Ert,[_("div",null,[brt,je(he(f.gpu_model),1)]),_("div",null,[Srt,je(he(this.computedFileSize(f.available_space)),1)]),_("div",null,[vrt,je(" "+he(this.computedFileSize(f.used_vram))+" / "+he(this.computedFileSize(f.total_vram))+" ("+he(f.percentage)+"%)",1)])]),_("div",yrt,[_("div",Trt,[_("div",{class:"bg-blue-600 h-2.5 rounded-full",style:Xt("width: "+f.percentage+"%;")},null,4)])])]))),128))],2)]),_("div",xrt,[_("div",Crt,[_("button",{onClick:e[10]||(e[10]=Te(f=>s.minconf_collapsed=!s.minconf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[xe(_("div",null,Art,512),[[At,s.minconf_collapsed]]),xe(_("div",null,Nrt,512),[[At,!s.minconf_collapsed]]),Ort])]),_("div",{class:He([{hidden:s.minconf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[_("div",Irt,[Ie(o,{title:"General",is_subcard:!0,class:"pb-2 m-2"},{default:ot(()=>[_("table",Mrt,[_("tr",null,[Drt,_("td",Lrt,[_("div",krt,[xe(_("select",{id:"hardware_mode",required:"","onUpdate:modelValue":e[11]||(e[11]=f=>r.configFile.hardware_mode=f),onChange:e[12]||(e[12]=f=>s.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},qrt,544),[[ei,r.configFile.hardware_mode]])])])]),_("tr",null,[Yrt,_("td",$rt,[xe(_("input",{type:"text",id:"host",required:"","onUpdate:modelValue":e[13]||(e[13]=f=>r.configFile.host=f),onChange:e[14]||(e[14]=f=>s.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Xe,r.configFile.host]])])]),_("tr",null,[Wrt,_("td",Krt,[xe(_("input",{type:"number",step:"1",id:"port",required:"","onUpdate:modelValue":e[15]||(e[15]=f=>r.configFile.port=f),onChange:e[16]||(e[16]=f=>s.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Xe,r.configFile.port]])])]),_("tr",null,[jrt,_("td",Qrt,[xe(_("input",{type:"text",id:"db_path",required:"","onUpdate:modelValue":e[17]||(e[17]=f=>r.configFile.db_path=f),onChange:e[18]||(e[18]=f=>s.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Xe,r.configFile.db_path]])])]),_("tr",null,[Xrt,_("td",null,[_("div",Zrt,[xe(_("input",{type:"checkbox",id:"auto_show_browser",required:"","onUpdate:modelValue":e[19]||(e[19]=f=>r.configFile.auto_show_browser=f),onChange:e[20]||(e[20]=f=>s.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.auto_show_browser]])])])]),_("tr",null,[Jrt,_("td",null,[_("div",eot,[xe(_("input",{type:"checkbox",id:"activate_debug",required:"","onUpdate:modelValue":e[21]||(e[21]=f=>r.configFile.debug=f),onChange:e[22]||(e[22]=f=>s.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.debug]])])])]),_("tr",null,[tot,_("td",null,[_("div",not,[xe(_("input",{type:"checkbox",id:"auto_save",required:"","onUpdate:modelValue":e[23]||(e[23]=f=>r.configFile.auto_save=f),onChange:e[24]||(e[24]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.auto_save]])])])]),_("tr",null,[iot,_("td",null,[_("div",sot,[xe(_("input",{type:"checkbox",id:"auto_update",required:"","onUpdate:modelValue":e[25]||(e[25]=f=>r.configFile.auto_update=f),onChange:e[26]||(e[26]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.auto_update]])])])]),_("tr",null,[rot,_("td",null,[_("div",oot,[xe(_("input",{type:"checkbox",id:"auto_title",required:"","onUpdate:modelValue":e[27]||(e[27]=f=>r.configFile.auto_title=f),onChange:e[28]||(e[28]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.auto_title]])])])])])]),_:1}),Ie(o,{title:"User",is_subcard:!0,class:"pb-2 m-2"},{default:ot(()=>[_("table",aot,[_("tr",null,[lot,_("td",cot,[xe(_("input",{type:"text",id:"user_name",required:"","onUpdate:modelValue":e[29]||(e[29]=f=>r.configFile.user_name=f),onChange:e[30]||(e[30]=f=>s.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Xe,r.configFile.user_name]])])]),_("tr",null,[dot,_("td",uot,[xe(_("textarea",{id:"user_description",required:"","onUpdate:modelValue":e[31]||(e[31]=f=>r.configFile.user_description=f),onChange:e[32]||(e[32]=f=>s.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Xe,r.configFile.user_description]])])]),_("tr",null,[pot,_("td",_ot,[xe(_("input",{type:"checkbox",id:"override_personality_model_parameters",required:"","onUpdate:modelValue":e[33]||(e[33]=f=>r.configFile.override_personality_model_parameters=f),onChange:e[34]||(e[34]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.override_personality_model_parameters]])])]),_("tr",null,[hot,_("td",fot,[_("label",mot,[_("img",{src:"/user_infos/"+r.configFile.user_avatar,class:"w-50 h-50 rounded-full",style:{"max-width":"50px","max-height":"50px",cursor:"pointer"}},null,8,got)]),_("input",{type:"file",id:"avatar-upload",style:{display:"none"},onChange:e[35]||(e[35]=(...f)=>r.uploadAvatar&&r.uploadAvatar(...f))},null,32)])]),_("tr",null,[Eot,_("td",null,[_("div",bot,[xe(_("input",{type:"checkbox",id:"use_user_name_in_discussions",required:"","onUpdate:modelValue":e[36]||(e[36]=f=>r.configFile.use_user_name_in_discussions=f),onChange:e[37]||(e[37]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.use_user_name_in_discussions]])])])]),_("tr",null,[Sot,_("td",vot,[xe(_("input",{type:"number",id:"min_n_predict",required:"","onUpdate:modelValue":e[38]||(e[38]=f=>r.configFile.min_n_predict=f),onChange:e[39]||(e[39]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Xe,r.configFile.min_n_predict]])])])])]),_:1}),Ie(o,{title:"Data Vectorization",is_subcard:!0,class:"pb-2 m-2"},{default:ot(()=>[_("table",yot,[_("tr",null,[Tot,_("td",null,[_("div",xot,[xe(_("input",{type:"checkbox",id:"use_files",required:"","onUpdate:modelValue":e[40]||(e[40]=f=>r.configFile.use_files=f),onChange:e[41]||(e[41]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.use_files]])])])]),_("tr",null,[Cot,_("td",null,[_("div",Rot,[xe(_("input",{type:"checkbox",id:"use_discussions_history",required:"","onUpdate:modelValue":e[42]||(e[42]=f=>r.configFile.use_discussions_history=f),onChange:e[43]||(e[43]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.use_discussions_history]])])])]),_("tr",null,[Aot,_("td",null,[_("div",wot,[xe(_("input",{type:"checkbox",id:"summerize_discussion",required:"","onUpdate:modelValue":e[44]||(e[44]=f=>r.configFile.summerize_discussion=f),onChange:e[45]||(e[45]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.summerize_discussion]])])])]),_("tr",null,[Not,_("td",null,[_("div",Oot,[xe(_("input",{type:"checkbox",id:"data_vectorization_visualize_on_vectorization",required:"","onUpdate:modelValue":e[46]||(e[46]=f=>r.configFile.data_vectorization_visualize_on_vectorization=f),onChange:e[47]||(e[47]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.data_vectorization_visualize_on_vectorization]])])])]),_("tr",null,[Iot,_("td",null,[_("div",Mot,[xe(_("input",{type:"checkbox",id:"data_vectorization_activate",required:"","onUpdate:modelValue":e[48]||(e[48]=f=>r.configFile.data_vectorization_activate=f),onChange:e[49]||(e[49]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.data_vectorization_activate]])])])]),_("tr",null,[Dot,_("td",null,[_("div",Lot,[xe(_("input",{type:"checkbox",id:"data_vectorization_build_keys_words",required:"","onUpdate:modelValue":e[50]||(e[50]=f=>r.configFile.data_vectorization_build_keys_words=f),onChange:e[51]||(e[51]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.data_vectorization_build_keys_words]])])])]),_("tr",null,[kot,_("td",null,[xe(_("select",{id:"data_vectorization_method",required:"","onUpdate:modelValue":e[52]||(e[52]=f=>r.configFile.data_vectorization_method=f),onChange:e[53]||(e[53]=f=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},Fot,544),[[ei,r.configFile.data_vectorization_method]])])]),_("tr",null,[Bot,_("td",null,[xe(_("select",{id:"data_visualization_method",required:"","onUpdate:modelValue":e[54]||(e[54]=f=>r.configFile.data_visualization_method=f),onChange:e[55]||(e[55]=f=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},zot,544),[[ei,r.configFile.data_visualization_method]])])]),_("tr",null,[Hot,_("td",null,[_("div",qot,[xe(_("input",{type:"checkbox",id:"data_vectorization_save_db",required:"","onUpdate:modelValue":e[56]||(e[56]=f=>r.configFile.data_vectorization_save_db=f),onChange:e[57]||(e[57]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.data_vectorization_save_db]])])])]),_("tr",null,[Yot,_("td",null,[xe(_("input",{id:"data_vectorization_chunk_size","onUpdate:modelValue":e[58]||(e[58]=f=>r.configFile.data_vectorization_chunk_size=f),onChange:e[59]||(e[59]=f=>s.settingsChanged=!0),type:"range",min:"0",max:"64000",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.data_vectorization_chunk_size]]),xe(_("input",{"onUpdate:modelValue":e[60]||(e[60]=f=>r.configFile.data_vectorization_chunk_size=f),type:"number",onChange:e[61]||(e[61]=f=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Xe,r.configFile.data_vectorization_chunk_size]])])]),_("tr",null,[$ot,_("td",null,[xe(_("input",{id:"data_vectorization_overlap_size","onUpdate:modelValue":e[62]||(e[62]=f=>r.configFile.data_vectorization_overlap_size=f),onChange:e[63]||(e[63]=f=>s.settingsChanged=!0),type:"range",min:"0",max:"64000",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.data_vectorization_overlap_size]]),xe(_("input",{"onUpdate:modelValue":e[64]||(e[64]=f=>r.configFile.data_vectorization_overlap_size=f),type:"number",onChange:e[65]||(e[65]=f=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Xe,r.configFile.data_vectorization_overlap_size]])])]),_("tr",null,[Wot,_("td",null,[xe(_("input",{id:"data_vectorization_nb_chunks","onUpdate:modelValue":e[66]||(e[66]=f=>r.configFile.data_vectorization_nb_chunks=f),onChange:e[67]||(e[67]=f=>s.settingsChanged=!0),type:"range",min:"0",max:"1000",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.data_vectorization_nb_chunks]]),xe(_("input",{"onUpdate:modelValue":e[68]||(e[68]=f=>r.configFile.data_vectorization_nb_chunks=f),type:"number",onChange:e[69]||(e[69]=f=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Xe,r.configFile.data_vectorization_nb_chunks]])])])])]),_:1}),Ie(o,{title:"Latex",is_subcard:!0,class:"pb-2 m-2"},{default:ot(()=>[_("table",Kot,[_("tr",null,[jot,_("td",null,[_("div",Qot,[xe(_("input",{type:"text",id:"pdf_latex_path",required:"","onUpdate:modelValue":e[70]||(e[70]=f=>r.configFile.pdf_latex_path=f),onChange:e[71]||(e[71]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Xe,r.configFile.pdf_latex_path]])])])])])]),_:1}),Ie(o,{title:"Boost",is_subcard:!0,class:"pb-2 m-2"},{default:ot(()=>[_("table",Xot,[_("tr",null,[Zot,_("td",null,[_("div",Jot,[xe(_("input",{type:"text",id:"positive_boost",required:"","onUpdate:modelValue":e[72]||(e[72]=f=>r.configFile.positive_boost=f),onChange:e[73]||(e[73]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Xe,r.configFile.positive_boost]])])])]),_("tr",null,[eat,_("td",null,[_("div",tat,[xe(_("input",{type:"text",id:"negative_boost",required:"","onUpdate:modelValue":e[74]||(e[74]=f=>r.configFile.negative_boost=f),onChange:e[75]||(e[75]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Xe,r.configFile.negative_boost]])])])]),_("tr",null,[nat,_("td",null,[_("div",iat,[xe(_("input",{type:"text",id:"force_output_language_to_be",required:"","onUpdate:modelValue":e[76]||(e[76]=f=>r.configFile.force_output_language_to_be=f),onChange:e[77]||(e[77]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Xe,r.configFile.force_output_language_to_be]])])])])])]),_:1}),Ie(o,{title:"Browser Audio",is_subcard:!0,class:"pb-2 m-2"},{default:ot(()=>[_("table",sat,[_("tr",null,[rat,_("td",null,[_("div",oat,[xe(_("input",{type:"checkbox",id:"audio_auto_send_input",required:"","onUpdate:modelValue":e[78]||(e[78]=f=>r.configFile.audio_auto_send_input=f),onChange:e[79]||(e[79]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.audio_auto_send_input]])])])]),_("tr",null,[aat,_("td",null,[_("div",lat,[xe(_("input",{type:"checkbox",id:"auto_speak",required:"","onUpdate:modelValue":e[80]||(e[80]=f=>r.configFile.auto_speak=f),onChange:e[81]||(e[81]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.auto_speak]])])])]),_("tr",null,[cat,_("td",null,[xe(_("input",{id:"audio_pitch","onUpdate:modelValue":e[82]||(e[82]=f=>r.configFile.audio_pitch=f),onChange:e[83]||(e[83]=f=>s.settingsChanged=!0),type:"range",min:"0",max:"10",step:"0.1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.audio_pitch]]),xe(_("input",{"onUpdate:modelValue":e[84]||(e[84]=f=>r.configFile.audio_pitch=f),onChange:e[85]||(e[85]=f=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Xe,r.configFile.audio_pitch]])])]),_("tr",null,[dat,_("td",null,[xe(_("input",{id:"audio_silenceTimer","onUpdate:modelValue":e[86]||(e[86]=f=>r.configFile.audio_silenceTimer=f),onChange:e[87]||(e[87]=f=>s.settingsChanged=!0),type:"range",min:"0",max:"10000",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.audio_silenceTimer]]),xe(_("input",{"onUpdate:modelValue":e[88]||(e[88]=f=>r.configFile.audio_silenceTimer=f),onChange:e[89]||(e[89]=f=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Xe,r.configFile.audio_silenceTimer]])])]),_("tr",null,[uat,_("td",null,[xe(_("select",{id:"audio_in_language","onUpdate:modelValue":e[90]||(e[90]=f=>r.configFile.audio_in_language=f),onChange:e[91]||(e[91]=f=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(O(!0),D($e,null,lt(r.audioLanguages,f=>(O(),D("option",{key:f.code,value:f.code},he(f.name),9,pat))),128))],544),[[ei,r.configFile.audio_in_language]])])]),_("tr",null,[_at,_("td",null,[xe(_("select",{id:"audio_out_voice","onUpdate:modelValue":e[92]||(e[92]=f=>r.configFile.audio_out_voice=f),onChange:e[93]||(e[93]=f=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(O(!0),D($e,null,lt(s.audioVoices,f=>(O(),D("option",{key:f.name,value:f.name},he(f.name),9,hat))),128))],544),[[ei,r.configFile.audio_out_voice]])])])])]),_:1})])],2)]),_("div",fat,[_("div",mat,[_("button",{onClick:e[94]||(e[94]=Te(f=>s.servers_conf_collapsed=!s.servers_conf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[xe(_("div",null,Eat,512),[[At,s.servers_conf_collapsed]]),xe(_("div",null,Sat,512),[[At,!s.servers_conf_collapsed]]),vat])]),_("div",{class:He([{hidden:s.servers_conf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[Ie(o,{title:"Stable diffusion service",is_subcard:!0,class:"pb-2 m-2"},{default:ot(()=>[_("table",yat,[_("tr",null,[Tat,_("td",null,[_("div",xat,[xe(_("input",{type:"checkbox",id:"enable_sd_service",required:"","onUpdate:modelValue":e[95]||(e[95]=f=>r.configFile.enable_sd_service=f),onChange:e[96]||(e[96]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.enable_sd_service]])])])]),_("tr",null,[Cat,_("td",null,[_("div",Rat,[_("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[97]||(e[97]=(...f)=>r.reinstallSDService&&r.reinstallSDService(...f))},"Reinstall sd service")])])]),_("tr",null,[Aat,_("td",null,[_("div",wat,[xe(_("input",{type:"text",id:"sd_base_url",required:"","onUpdate:modelValue":e[98]||(e[98]=f=>r.configFile.sd_base_url=f),onChange:e[99]||(e[99]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Xe,r.configFile.sd_base_url]])])])])])]),_:1}),Ie(o,{title:"XTTS service",is_subcard:!0,class:"pb-2 m-2"},{default:ot(()=>[_("table",Nat,[_("tr",null,[Oat,_("td",null,[_("div",Iat,[xe(_("input",{type:"checkbox",id:"enable_voice_service",required:"","onUpdate:modelValue":e[100]||(e[100]=f=>r.configFile.enable_voice_service=f),onChange:e[101]||(e[101]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pt,r.configFile.enable_voice_service]])])])]),_("tr",null,[Mat,_("td",null,[_("div",Dat,[_("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[102]||(e[102]=(...f)=>r.reinstallAudioService&&r.reinstallAudioService(...f))},"Reinstall xtts service")])])]),_("tr",null,[Lat,_("td",null,[_("div",kat,[xe(_("input",{type:"text",id:"xtts_base_url",required:"","onUpdate:modelValue":e[103]||(e[103]=f=>r.configFile.xtts_base_url=f),onChange:e[104]||(e[104]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Xe,r.configFile.xtts_base_url]])])])]),_("tr",null,[Pat,_("td",null,[_("div",Uat,[xe(_("select",{"onUpdate:modelValue":e[105]||(e[105]=f=>r.current_language=f),onChange:e[106]||(e[106]=f=>s.settingsChanged=!0),disabled:!r.enable_voice_service},[(O(!0),D($e,null,lt(s.voice_languages,(f,b)=>(O(),D("option",{key:b,value:f},he(b),9,Bat))),128))],40,Fat),[[ei,r.current_language]])])])]),_("tr",null,[Gat,_("td",null,[_("div",Vat,[xe(_("select",{"onUpdate:modelValue":e[107]||(e[107]=f=>r.current_voice=f),onChange:e[108]||(e[108]=f=>s.settingsChanged=!0),disabled:!r.enable_voice_service},[(O(!0),D($e,null,lt(s.voices,f=>(O(),D("option",{key:f,value:f},he(f),9,Hat))),128))],40,zat),[[ei,r.current_voice]])])])]),_("tr",null,[qat,_("td",null,[_("div",Yat,[xe(_("input",{type:"checkbox",id:"auto_read",required:"","onUpdate:modelValue":e[109]||(e[109]=f=>r.configFile.auto_read=f),onChange:e[110]||(e[110]=f=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",disabled:!r.enable_voice_service},null,40,$at),[[Pt,r.configFile.auto_read]])])])])])]),_:1})],2)]),_("div",Wat,[_("div",Kat,[_("button",{onClick:e[111]||(e[111]=Te(f=>s.bzc_collapsed=!s.bzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[xe(_("div",null,Qat,512),[[At,s.bzc_collapsed]]),xe(_("div",null,Zat,512),[[At,!s.bzc_collapsed]]),Jat,r.configFile.binding_name?j("",!0):(O(),D("div",elt,[tlt,je(" No binding selected! ")])),r.configFile.binding_name?(O(),D("div",nlt,"|")):j("",!0),r.configFile.binding_name?(O(),D("div",ilt,[_("div",slt,[_("img",{src:r.imgBinding,class:"w-8 h-8 rounded-full object-fill text-blue-700"},null,8,rlt),_("h3",olt,he(r.binding_name),1)])])):j("",!0)])]),_("div",{class:He([{hidden:s.bzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[r.bindingsZoo&&r.bindingsZoo.length>0?(O(),D("div",alt,[_("label",llt," Bindings: ("+he(r.bindingsZoo.length)+") ",1),_("div",{class:He(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",s.bzl_collapsed?"":"max-h-96"])},[Ie(ys,{name:"list"},{default:ot(()=>[(O(!0),D($e,null,lt(r.bindingsZoo,(f,b)=>(O(),Ot(a,{ref_for:!0,ref:"bindingZoo",key:"index-"+b+"-"+f.folder,binding:f,"on-selected":r.onBindingSelected,"on-reinstall":r.onReinstallBinding,"on-unInstall":r.onUnInstallBinding,"on-install":r.onInstallBinding,"on-settings":r.onSettingsBinding,"on-reload-binding":r.onReloadBinding,selected:f.folder===r.configFile.binding_name},null,8,["binding","on-selected","on-reinstall","on-unInstall","on-install","on-settings","on-reload-binding","selected"]))),128))]),_:1})],2)])):j("",!0),s.bzl_collapsed?(O(),D("button",{key:1,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Collapse",type:"button",onClick:e[112]||(e[112]=f=>s.bzl_collapsed=!s.bzl_collapsed)},dlt)):(O(),D("button",{key:2,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Expand",type:"button",onClick:e[113]||(e[113]=f=>s.bzl_collapsed=!s.bzl_collapsed)},plt))],2)]),_("div",_lt,[_("div",hlt,[_("button",{onClick:e[114]||(e[114]=Te(f=>r.modelsZooToggleCollapse(),["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[xe(_("div",null,mlt,512),[[At,s.mzc_collapsed]]),xe(_("div",null,Elt,512),[[At,!s.mzc_collapsed]]),blt,_("div",Slt,[r.configFile.binding_name?j("",!0):(O(),D("div",vlt,[ylt,je(" Select binding first! ")])),!s.isModelSelected&&r.configFile.binding_name?(O(),D("div",Tlt,[xlt,je(" No model selected! ")])):j("",!0),r.configFile.model_name?(O(),D("div",Clt,"|")):j("",!0),r.configFile.model_name?(O(),D("div",Rlt,[_("div",Alt,[_("img",{src:r.imgModel,class:"w-8 h-8 rounded-lg object-fill"},null,8,wlt),_("h3",Nlt,he(r.configFile.model_name),1)])])):j("",!0)])])]),_("div",{class:He([{hidden:s.mzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[_("div",Olt,[_("div",Ilt,[_("div",Mlt,[s.searchModelInProgress?(O(),D("div",Dlt,klt)):j("",!0),s.searchModelInProgress?j("",!0):(O(),D("div",Plt,Flt))]),xe(_("input",{type:"search",class:"block w-full p-4 pl-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Search models...",required:"","onUpdate:modelValue":e[115]||(e[115]=f=>s.searchModel=f),onKeyup:e[116]||(e[116]=mr((...f)=>r.searchModel_func&&r.searchModel_func(...f),["enter"]))},null,544),[[Xe,s.searchModel]]),s.searchModel?(O(),D("button",{key:0,onClick:e[117]||(e[117]=Te(f=>s.searchModel="",["stop"])),type:"button",class:"text-white absolute right-2.5 bottom-2.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"}," Clear search")):j("",!0)])]),_("div",null,[xe(_("input",{"onUpdate:modelValue":e[118]||(e[118]=f=>s.show_only_installed_models=f),class:"m-2 p-2",type:"checkbox",ref:"only_installed"},null,512),[[Pt,s.show_only_installed_models]]),Blt]),_("div",null,[Ie(l,{radioOptions:s.sortOptions,onRadioSelected:r.handleRadioSelected},null,8,["radioOptions","onRadioSelected"])]),Glt,s.is_loading_zoo?(O(),D("div",Vlt,qlt)):j("",!0),s.models_zoo&&s.models_zoo.length>0?(O(),D("div",Ylt,[_("label",$lt," Models: ("+he(s.models_zoo.length)+") ",1),_("div",{class:He(["overflow-y-auto p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4 overflow-y-scroll w-full dark:bg-bg-dark scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",s.mzl_collapsed?"":"max-h-96"])},[Ie(ys,{name:"list"},{default:ot(()=>[(O(!0),D($e,null,lt(r.rendered_models_zoo,(f,b)=>(O(),Ot(c,{ref_for:!0,ref:"modelZoo",key:"index-"+b+"-"+f.name,model:f,"is-installed":f.isInstalled,"on-install":r.onInstall,"on-uninstall":r.onUninstall,"on-selected":r.onModelSelected,selected:f.name===r.configFile.model_name,model_type:f.model_type,"on-copy":r.onCopy,"on-copy-link":r.onCopyLink,"on-cancel-install":r.onCancelInstall},null,8,["model","is-installed","on-install","on-uninstall","on-selected","selected","model_type","on-copy","on-copy-link","on-cancel-install"]))),128)),_("button",{ref:"load_more_models",class:"relative items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 select-none",onClick:e[119]||(e[119]=(...f)=>r.load_more_models&&r.load_more_models(...f))},"Load more models",512)]),_:1})],2)])):j("",!0),s.mzl_collapsed?(O(),D("button",{key:2,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Collapse",type:"button",onClick:e[120]||(e[120]=(...f)=>r.open_mzl&&r.open_mzl(...f))},Klt)):(O(),D("button",{key:3,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Expand",type:"button",onClick:e[121]||(e[121]=(...f)=>r.open_mzl&&r.open_mzl(...f))},Qlt))],2)]),_("div",Xlt,[_("div",Zlt,[_("button",{onClick:e[122]||(e[122]=Te(f=>s.mzdc_collapsed=!s.mzdc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[xe(_("div",null,ect,512),[[At,s.mzdc_collapsed]]),xe(_("div",null,nct,512),[[At,!s.mzdc_collapsed]]),ict,r.binding_name?j("",!0):(O(),D("div",sct,[rct,je(" No binding selected! ")])),r.configFile.binding_name?(O(),D("div",oct,"|")):j("",!0),r.configFile.binding_name?(O(),D("div",act,[_("div",lct,[_("img",{src:r.imgBinding,class:"w-8 h-8 rounded-full object-fill text-blue-700"},null,8,cct),_("h3",dct,he(r.binding_name),1)])])):j("",!0)])]),_("div",{class:He([{hidden:s.mzdc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[_("div",uct,[_("div",pct,[_("div",null,[_("div",_ct,[hct,xe(_("input",{type:"text","onUpdate:modelValue":e[123]||(e[123]=f=>s.reference_path=f),class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter Path ...",required:""},null,512),[[Xe,s.reference_path]])]),_("button",{type:"button",onClick:e[124]||(e[124]=Te(f=>r.onCreateReference(),["stop"])),class:"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},"Add reference")]),s.modelDownlaodInProgress?j("",!0):(O(),D("div",fct,[_("div",mct,[gct,xe(_("input",{type:"text","onUpdate:modelValue":e[125]||(e[125]=f=>s.addModel.url=f),class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter URL ...",required:""},null,512),[[Xe,s.addModel.url]])]),_("button",{type:"button",onClick:e[126]||(e[126]=Te(f=>r.onInstallAddModel(),["stop"])),class:"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},"Download")])),s.modelDownlaodInProgress?(O(),D("div",Ect,[bct,_("div",Sct,[_("div",vct,[_("div",yct,[Tct,_("span",xct,he(Math.floor(s.addModel.progress))+"%",1)]),_("div",{class:"mx-1 opacity-80 line-clamp-1",title:s.addModel.url},he(s.addModel.url),9,Cct),_("div",Rct,[_("div",{class:"bg-blue-600 h-2.5 rounded-full",style:Xt({width:s.addModel.progress+"%"})},null,4)]),_("div",Act,[_("span",wct,"Download speed: "+he(r.speed_computed)+"/s",1),_("span",Nct,he(r.downloaded_size_computed)+"/"+he(r.total_size_computed),1)])])]),_("div",Oct,[_("div",Ict,[_("div",Mct,[_("button",{onClick:e[127]||(e[127]=Te((...f)=>r.onCancelInstall&&r.onCancelInstall(...f),["stop"])),type:"button",title:"Cancel download",class:"text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600"}," Cancel ")])])])])):j("",!0)])])],2)]),_("div",Dct,[_("div",Lct,[_("button",{onClick:e[130]||(e[130]=Te(f=>s.pzc_collapsed=!s.pzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 text-left w-full flex items-center"},[xe(_("div",null,Pct,512),[[At,s.pzc_collapsed]]),xe(_("div",null,Fct,512),[[At,!s.pzc_collapsed]]),Bct,r.configFile.personalities?(O(),D("div",Gct,"|")):j("",!0),_("div",Vct,he(r.active_pesonality),1),r.configFile.personalities?(O(),D("div",zct,"|")):j("",!0),r.configFile.personalities?(O(),D("div",Hct,[r.mountedPersArr.length>0?(O(),D("div",qct,[(O(!0),D($e,null,lt(r.mountedPersArr,(f,b)=>(O(),D("div",{class:"relative hover:-translate-y-2 duration-300 hover:z-10 shrink-0",key:b+"-"+f.name,ref_for:!0,ref:"mountedPersonalities"},[_("div",Yct,[_("button",{onClick:Te(E=>r.onPersonalitySelected(f),["stop"])},[_("img",{src:s.bUrl+f.avatar,onError:e[128]||(e[128]=(...E)=>r.personalityImgPlacehodler&&r.personalityImgPlacehodler(...E)),class:He(["w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 group-hover:border-secondary",r.configFile.active_personality_id==r.configFile.personalities.indexOf(f.full_path)?"border-secondary":"border-transparent z-0"]),title:f.name},null,42,Wct)],8,$ct),_("button",{onClick:Te(E=>r.unmountPersonality(f),["stop"])},Qct,8,Kct)])]))),128))])):j("",!0)])):j("",!0),_("button",{onClick:e[129]||(e[129]=Te(f=>r.unmountAll(),["stop"])),class:"bg-bg-light hover:border-green-200 ml-5 dark:bg-bg-dark rounded-full border-2 border-transparent",title:"Unmount All"},Zct)])]),_("div",{class:He([{hidden:s.pzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[_("div",Jct,[edt,_("div",tdt,[_("div",ndt,[s.searchPersonalityInProgress?(O(),D("div",idt,rdt)):j("",!0),s.searchPersonalityInProgress?j("",!0):(O(),D("div",odt,ldt))]),xe(_("input",{type:"search",id:"personality-search",class:"block w-full p-4 pl-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Search personality...",required:"","onUpdate:modelValue":e[131]||(e[131]=f=>s.searchPersonality=f),onKeyup:e[132]||(e[132]=Te((...f)=>r.searchPersonality_func&&r.searchPersonality_func(...f),["stop"]))},null,544),[[Xe,s.searchPersonality]]),s.searchPersonality?(O(),D("button",{key:0,onClick:e[133]||(e[133]=Te(f=>s.searchPersonality="",["stop"])),type:"button",class:"text-white absolute right-2.5 bottom-2.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"}," Clear search")):j("",!0)])]),s.searchPersonality?j("",!0):(O(),D("div",cdt,[_("label",ddt," Personalities Category: ("+he(s.persCatgArr.length)+") ",1),_("select",{id:"persCat",onChange:e[134]||(e[134]=f=>r.update_personality_category(f.target.value,r.refresh)),class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},[(O(!0),D($e,null,lt(s.persCatgArr,(f,b)=>(O(),D("option",{key:b,selected:f==this.configFile.personality_category},he(f),9,udt))),128))],32)])),_("div",null,[s.personalitiesFiltered.length>0?(O(),D("div",pdt,[_("label",_dt,he(s.searchPersonality?"Search results":"Personalities")+": ("+he(s.personalitiesFiltered.length)+") ",1),_("div",{class:He(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",s.pzl_collapsed?"":"max-h-96"])},[Ie(ys,{name:"bounce"},{default:ot(()=>[(O(!0),D($e,null,lt(s.personalitiesFiltered,(f,b)=>(O(),Ot(d,{ref_for:!0,ref:"personalitiesZoo",key:"index-"+b+"-"+f.name,personality:f,select_language:!0,full_path:f.full_path,selected:r.configFile.active_personality_id==r.configFile.personalities.findIndex(E=>E===f.full_path||E===f.full_path+":"+f.language),"on-selected":r.onPersonalitySelected,"on-mount":r.mountPersonality,"on-un-mount":r.unmountPersonality,"on-remount":r.remountPersonality,"on-reinstall":r.onPersonalityReinstall,"on-settings":r.onSettingsPersonality,"on-copy-personality-name":r.onCopyPersonalityName},null,8,["personality","full_path","selected","on-selected","on-mount","on-un-mount","on-remount","on-reinstall","on-settings","on-copy-personality-name"]))),128))]),_:1})],2)])):j("",!0)]),s.pzl_collapsed?(O(),D("button",{key:1,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Collapse",type:"button",onClick:e[135]||(e[135]=f=>s.pzl_collapsed=!s.pzl_collapsed)},fdt)):(O(),D("button",{key:2,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Expand",type:"button",onClick:e[136]||(e[136]=f=>s.pzl_collapsed=!s.pzl_collapsed)},gdt))],2)]),_("div",Edt,[_("div",bdt,[_("button",{onClick:e[138]||(e[138]=Te(f=>s.ezc_collapsed=!s.ezc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 text-left w-full flex items-center"},[xe(_("div",null,vdt,512),[[At,s.ezc_collapsed]]),xe(_("div",null,Tdt,512),[[At,!s.ezc_collapsed]]),xdt,r.configFile.extensions?(O(),D("div",Cdt,"|")):j("",!0),r.configFile.extensions?(O(),D("div",Rdt,[r.mountedExtensions.length>0?(O(),D("div",Adt,[(O(!0),D($e,null,lt(r.mountedExtensions,(f,b)=>(O(),D("div",{class:"relative hover:-translate-y-2 duration-300 hover:z-10 shrink-0",key:b+"-"+f.name,ref_for:!0,ref:"mountedExtensions"},[_("div",wdt,[_("button",null,[_("img",{src:s.bUrl+f.avatar,onError:e[137]||(e[137]=(...E)=>r.extensionImgPlacehodler&&r.extensionImgPlacehodler(...E)),class:He(["w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 group-hover:border-secondary","border-transparent z-0"]),title:f.name},null,40,Ndt)]),_("button",{onClick:Te(E=>r.unmountExtension(f),["stop"])},Mdt,8,Odt)])]))),128))])):j("",!0)])):j("",!0)])]),_("div",{class:He([{hidden:s.ezc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[_("div",Ddt,[Ldt,_("div",kdt,[_("div",Pdt,[s.searchExtensionInProgress?(O(),D("div",Udt,Bdt)):j("",!0),s.searchExtensionInProgress?j("",!0):(O(),D("div",Gdt,zdt))]),xe(_("input",{type:"search",id:"personality-search",class:"block w-full p-4 pl-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Search extension...",required:"","onUpdate:modelValue":e[139]||(e[139]=f=>s.searchExtension=f),onKeyup:e[140]||(e[140]=Te((...f)=>n.searchExtension_func&&n.searchExtension_func(...f),["stop"]))},null,544),[[Xe,s.searchExtension]]),s.searchExtension?(O(),D("button",{key:0,onClick:e[141]||(e[141]=Te(f=>s.searchExtension="",["stop"])),type:"button",class:"text-white absolute right-2.5 bottom-2.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"}," Clear search")):j("",!0)])]),s.searchExtension?j("",!0):(O(),D("div",Hdt,[_("label",qdt," Extensions Category: ("+he(s.extCatgArr.length)+") ",1),_("select",{id:"extCat",onChange:e[142]||(e[142]=f=>r.update_extension_category(f.target.value,r.refresh)),class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},[(O(!0),D($e,null,lt(s.extCatgArr,(f,b)=>(O(),D("option",{key:b,selected:f==this.extension_category},he(f),9,Ydt))),128))],32)])),_("div",null,[s.extensionsFiltered.length>0?(O(),D("div",$dt,[_("label",Wdt,he(s.searchExtension?"Search results":"Personalities")+": ("+he(s.extensionsFiltered.length)+") ",1),_("div",{class:He(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",s.ezl_collapsed?"":"max-h-96"])},[(O(!0),D($e,null,lt(s.extensionsFiltered,(f,b)=>(O(),Ot(u,{ref_for:!0,ref:"extensionsZoo",key:"index-"+b+"-"+f.name,extension:f,select_language:!0,full_path:f.full_path,"on-mount":r.mountExtension,"on-un-mount":r.unmountExtension,"on-remount":r.remountExtension,"on-reinstall":r.onExtensionReinstall,"on-settings":r.onSettingsExtension},null,8,["extension","full_path","on-mount","on-un-mount","on-remount","on-reinstall","on-settings"]))),128))],2)])):j("",!0)]),s.ezc_collapsed?(O(),D("button",{key:1,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Collapse",type:"button",onClick:e[143]||(e[143]=f=>s.ezl_collapsed=!s.ezl_collapsed)},jdt)):(O(),D("button",{key:2,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Expand",type:"button",onClick:e[144]||(e[144]=f=>s.ezl_collapsed=!s.ezl_collapsed)},Xdt))],2)]),_("div",Zdt,[_("div",Jdt,[_("button",{onClick:e[145]||(e[145]=Te(f=>s.mep_collapsed=!s.mep_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 text-left w-full flex items-center"},[xe(_("div",null,tut,512),[[At,s.mep_collapsed]]),xe(_("div",null,iut,512),[[At,!s.mep_collapsed]]),sut])]),_("div",{class:He([{hidden:s.mep_collapsed},"flex flex-col mb-2 px-3 pb-0"])},null,2)]),_("div",rut,[_("div",out,[_("button",{onClick:e[146]||(e[146]=Te(f=>s.mc_collapsed=!s.mc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[xe(_("div",null,lut,512),[[At,s.mc_collapsed]]),xe(_("div",null,dut,512),[[At,!s.mc_collapsed]]),uut])]),_("div",{class:He([{hidden:s.mc_collapsed},"flex flex-col mb-2 p-2"])},[_("div",put,[_("div",_ut,[xe(_("input",{id:"override-model-parameters",type:"checkbox",class:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-700 dark:focus:ring-offset-gray-700 focus:ring-2 dark:bg-gray-600 dark:border-gray-500",onClick:e[147]||(e[147]=Te(()=>{},["stop"])),"onUpdate:modelValue":e[148]||(e[148]=f=>r.configFile.override_personality_model_parameters=f),onChange:e[149]||(e[149]=f=>r.update_setting("override_personality_model_parameters",r.configFile.override_personality_model_parameters))},null,544),[[Pt,r.configFile.override_personality_model_parameters]]),hut])]),_("div",{class:He(r.configFile.override_personality_model_parameters?"":"pointer-events-none opacity-30")},[_("div",fut,[mut,xe(_("input",{type:"text",id:"seed","onUpdate:modelValue":e[150]||(e[150]=f=>r.configFile.seed=f),class:"bg-gray-50 border border-gray-300 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,512),[[Xe,r.configFile.seed]])]),_("div",gut,[_("div",Eut,[_("div",but,[Sut,_("p",vut,[xe(_("input",{type:"text",id:"temp-val","onUpdate:modelValue":e[151]||(e[151]=f=>r.configFile.temperature=f),onChange:e[152]||(e[152]=f=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.temperature]])])]),xe(_("input",{id:"temperature",onChange:e[153]||(e[153]=f=>s.settingsChanged=!0),type:"range","onUpdate:modelValue":e[154]||(e[154]=f=>r.configFile.temperature=f),min:"0",max:"5",step:"0.1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.temperature]])])]),_("div",yut,[_("div",Tut,[_("div",xut,[Cut,_("p",Rut,[xe(_("input",{type:"text",id:"predict-val","onUpdate:modelValue":e[155]||(e[155]=f=>r.configFile.n_predict=f),onChange:e[156]||(e[156]=f=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.n_predict]])])]),xe(_("input",{id:"predict",type:"range",onChange:e[157]||(e[157]=f=>s.settingsChanged=!0),"onUpdate:modelValue":e[158]||(e[158]=f=>r.configFile.n_predict=f),min:"0",max:"2048",step:"32",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.n_predict]])])]),_("div",Aut,[_("div",wut,[_("div",Nut,[Out,_("p",Iut,[xe(_("input",{type:"text",id:"top_k-val","onUpdate:modelValue":e[159]||(e[159]=f=>r.configFile.top_k=f),onChange:e[160]||(e[160]=f=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.top_k]])])]),xe(_("input",{id:"top_k",type:"range",onChange:e[161]||(e[161]=f=>s.settingsChanged=!0),"onUpdate:modelValue":e[162]||(e[162]=f=>r.configFile.top_k=f),min:"0",max:"100",step:"1",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.top_k]])])]),_("div",Mut,[_("div",Dut,[_("div",Lut,[kut,_("p",Put,[xe(_("input",{type:"text",id:"top_p-val","onUpdate:modelValue":e[163]||(e[163]=f=>r.configFile.top_p=f),onChange:e[164]||(e[164]=f=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.top_p]])])]),xe(_("input",{id:"top_p",type:"range","onUpdate:modelValue":e[165]||(e[165]=f=>r.configFile.top_p=f),min:"0",max:"1",step:"0.01",onChange:e[166]||(e[166]=f=>s.settingsChanged=!0),class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.top_p]])])]),_("div",Uut,[_("div",Fut,[_("div",But,[Gut,_("p",Vut,[xe(_("input",{type:"text",id:"repeat_penalty-val","onUpdate:modelValue":e[167]||(e[167]=f=>r.configFile.repeat_penalty=f),onChange:e[168]||(e[168]=f=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.repeat_penalty]])])]),xe(_("input",{id:"repeat_penalty",onChange:e[169]||(e[169]=f=>s.settingsChanged=!0),type:"range","onUpdate:modelValue":e[170]||(e[170]=f=>r.configFile.repeat_penalty=f),min:"0",max:"2",step:"0.01",class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.repeat_penalty]])])]),_("div",zut,[_("div",Hut,[_("div",qut,[Yut,_("p",$ut,[xe(_("input",{type:"text",id:"repeat_last_n-val","onUpdate:modelValue":e[171]||(e[171]=f=>r.configFile.repeat_last_n=f),onChange:e[172]||(e[172]=f=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.repeat_last_n]])])]),xe(_("input",{id:"repeat_last_n",type:"range","onUpdate:modelValue":e[173]||(e[173]=f=>r.configFile.repeat_last_n=f),min:"0",max:"100",step:"1",onChange:e[174]||(e[174]=f=>s.settingsChanged=!0),class:"flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Xe,r.configFile.repeat_last_n]])])])],2)],2)])],2)]),Ie(h,{ref:"addmodeldialog"},null,512),Ie(m,{class:"z-20",show:s.variantSelectionDialogVisible,choices:s.variant_choices,onChoiceSelected:r.onVariantChoiceSelected,onCloseDialog:r.oncloseVariantChoiceDialog,onChoiceValidated:r.onvalidateVariantChoice},null,8,["show","choices","onChoiceSelected","onCloseDialog","onChoiceValidated"])],64)}const Kut=gt(nst,[["render",Wut],["__scopeId","data-v-86c6b6d4"]]),jut={components:{ClipBoardTextInput:sb,Card:dc},data(){return{dataset_path:"",max_length:1024,batch_size:4,lr:5e-5,num_epochs:2,selectedFolder:"",selectedDataset:""}},methods:{submitForm(){const n={model_name:this.selectedModel,dataset_file:this.selectedDataset,max_length:this.max_length,batch_size:this.batch_size,lr:this.lr,num_epochs:this.num_epochs,output_dir:this.selectedFolder};Ue.post("/start_training",n).then(e=>{})},openFolderSelector(){this.$refs.folder_selector.click()},selectOutputDirectory(n){var t;console.log("here");const e=(t=n.target.files[0])==null?void 0:t.path;console.log(e),e&&(this.selectedFolder=e)},selectDataset(n){const e=n.target.files;e.length>0&&(this.selectedDataset=e[0])}},computed:{selectedModel:{get(){return this.$store.state.selectedModel}},models:{get(){return this.$store.state.modelsArr}}},watch:{model_name(n){console.log("watching model_name",n),this.$refs.clipboardInput.inputValue=n}}},Qut={key:0,class:"container overflow-y-scroll flex flex-col no-scrollbar shadow-lg p-10 pt-2 bg-bg-light-tone dark:bg-bg-dark-tone"},Xut={class:"mb-4"},Zut=_("label",{for:"model_name",class:"text-sm"},"Model Name:",-1),Jut=["value"],ept={class:"mb-4"},tpt=_("label",{for:"dataset_path",class:"text-sm"},"Dataset:",-1),npt={class:"mb-4"},ipt=_("label",{for:"lr",class:"text-sm"},"Learning Rate:",-1),spt={class:"mb-4"},rpt=_("label",{for:"num_epochs",class:"text-sm"},"Number of Epochs:",-1),opt={class:"mb-4"},apt=_("label",{for:"max_length",class:"text-sm"},"Max Length:",-1),lpt={class:"mb-4"},cpt=_("label",{for:"batch_size",class:"text-sm"},"Batch Size:",-1),dpt={class:"mb-4"},upt=_("label",{for:"output_dir",class:"text-sm"},"Output Directory:",-1),ppt=_("button",{class:"bg-blue-500 text-white px-4 py-2 rounded"},"Start training",-1),_pt={key:1};function hpt(n,e,t,i,s,r){const o=_t("Card"),a=_t("ClipBoardTextInput");return r.selectedModel!==null&&r.selectedModel.toLowerCase().includes("gptq")?(O(),D("div",Qut,[_("form",{onSubmit:e[2]||(e[2]=Te((...l)=>r.submitForm&&r.submitForm(...l),["prevent"])),class:""},[Ie(o,{title:"Training configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:ot(()=>[Ie(o,{title:"Model",class:"",isHorizontal:!1},{default:ot(()=>[_("div",Xut,[Zut,xe(_("select",{"onUpdate:modelValue":e[0]||(e[0]=l=>r.selectedModel=l),onChange:e[1]||(e[1]=(...l)=>n.setModel&&n.setModel(...l)),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},[(O(!0),D($e,null,lt(r.models,l=>(O(),D("option",{key:l,value:l},he(l),9,Jut))),128))],544),[[ei,r.selectedModel]])])]),_:1}),Ie(o,{title:"Data",isHorizontal:!1},{default:ot(()=>[_("div",ept,[tpt,Ie(a,{id:"model_path",inputType:"file",value:s.dataset_path,onchange:"selectDataset()"},null,8,["value"])])]),_:1}),Ie(o,{title:"Training",isHorizontal:!1},{default:ot(()=>[_("div",npt,[ipt,Ie(a,{id:"model_path",inputType:"integer",value:s.lr},null,8,["value"])]),_("div",spt,[rpt,Ie(a,{id:"model_path",inputType:"integer",value:s.num_epochs},null,8,["value"])]),_("div",opt,[apt,Ie(a,{id:"model_path",inputType:"integer",value:s.max_length},null,8,["value"])]),_("div",lpt,[cpt,Ie(a,{id:"model_path",inputType:"integer",value:s.batch_size},null,8,["value"])])]),_:1}),Ie(o,{title:"Output",isHorizontal:!1},{default:ot(()=>[_("div",dpt,[upt,Ie(a,{id:"model_path",inputType:"text",value:n.output_dir},null,8,["value"])])]),_:1})]),_:1}),Ie(o,{disableHoverAnimation:!0,disableFocus:!0},{default:ot(()=>[ppt]),_:1})],32)])):(O(),D("div",_pt,[Ie(o,{title:"Info",class:"",isHorizontal:!1},{default:ot(()=>[je(" Only GPTQ models are supported for QLora fine tuning. Please select a GPTQ compatible binding. ")]),_:1})]))}const fpt=gt(jut,[["render",hpt]]),mpt={components:{ClipBoardTextInput:sb,Card:dc},data(){return{model_name:"jondurbin/airoboros-7b-gpt4",tokenizer_name:"jondurbin/airoboros-7b-gpt4",dataset_path:"",max_length:1024,batch_size:4,lr:5e-5,num_epochs:2,selectedFolder:"",selectedDatasetPath:""}},methods:{submitForm(){this.model_name,this.tokenizer_name,this.selectedDatasetPath,this.max_length,this.batch_size,this.lr,this.num_epochs,this.selectedFolder},openFolderSelector(){this.$refs.folder_selector.click()},selectOutputDirectory(n){var t;console.log("here");const e=(t=n.target.files[0])==null?void 0:t.path;console.log(e),e&&(this.selectedFolder=e)},selectDatasetPath(n){const e=n.target.files;e.length>0&&(this.selectedDatasetPath=e[0].webkitRelativePath)}}},gpt={class:"container overflow-y-scroll flex flex-col no-scrollbar shadow-lg p-10 pt-2 bg-bg-light-tone dark:bg-bg-dark-tone"},Ept={class:"mb-4"},bpt=_("label",{for:"model_name",class:"text-sm"},"Model Name:",-1),Spt={class:"mb-4"},vpt=_("label",{for:"tokenizer_name",class:"text-sm"},"Tokenizer Name:",-1),ypt=_("button",{type:"submit",class:"bg-blue-500 text-white px-4 py-2 rounded"},"Quantize LLM",-1);function Tpt(n,e,t,i,s,r){const o=_t("ClipBoardTextInput"),a=_t("Card");return O(),D("div",gpt,[_("form",{onSubmit:e[0]||(e[0]=Te((...l)=>r.submitForm&&r.submitForm(...l),["prevent"])),class:"max-w-md mx-auto"},[Ie(a,{title:"Quantizing configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:ot(()=>[Ie(a,{title:"Model",class:"",isHorizontal:!1},{default:ot(()=>[_("div",Ept,[bpt,Ie(o,{id:"model_path",inputType:"text",value:s.model_name},null,8,["value"])]),_("div",Spt,[vpt,Ie(o,{id:"model_path",inputType:"text",value:s.tokenizer_name},null,8,["value"])])]),_:1})]),_:1}),Ie(a,{disableHoverAnimation:!0,disableFocus:!0},{default:ot(()=>[ypt]),_:1})],32)])}const xpt=gt(mpt,[["render",Tpt]]),Cpt={data(){return{show:!1,prompt:"",inputText:""}},methods:{showPanel(){this.show=!0},ok(){this.show=!1,this.$emit("ok",this.inputText)},cancel(){this.show=!1,this.inputText=""}},props:{promptText:{type:String,required:!0}},watch:{promptText(n){this.prompt=n}}},Rpt={key:0,class:"fixed top-0 left-0 w-full h-full flex justify-center items-center bg-black bg-opacity-50"},Apt={class:"bg-white p-8 rounded"},wpt={class:"text-xl font-bold mb-4"};function Npt(n,e,t,i,s,r){return O(),D("div",null,[s.show?(O(),D("div",Rpt,[_("div",Apt,[_("h2",wpt,he(t.promptText),1),xe(_("input",{type:"text","onUpdate:modelValue":e[0]||(e[0]=o=>s.inputText=o),class:"border border-gray-300 px-4 py-2 rounded mb-4"},null,512),[[Xe,s.inputText]]),_("button",{onClick:e[1]||(e[1]=(...o)=>r.ok&&r.ok(...o)),class:"bg-blue-500 text-white px-4 py-2 rounded mr-2"},"OK"),_("button",{onClick:e[2]||(e[2]=(...o)=>r.cancel&&r.cancel(...o)),class:"bg-gray-500 text-white px-4 py-2 rounded"},"Cancel")])])):j("",!0)])}const MN=gt(Cpt,[["render",Npt]]),Opt={props:{htmlContent:{type:String,required:!0}}},Ipt=["innerHTML"];function Mpt(n,e,t,i,s,r){return O(),D("div",null,[_("div",{innerHTML:t.htmlContent},null,8,Ipt)])}const Dpt=gt(Opt,[["render",Mpt]]);const Lpt={props:{jsonData:{type:[Object,Array,String],default:null},jsonFormText:{type:String,default:"JSON Form"}},data(){return{collapsed:!0}},computed:{formattedJson(){return typeof this.jsonData=="string"?JSON.stringify(JSON.parse(this.jsonData),null," ").replace(/\n/g,"
"):JSON.stringify(this.jsonData,null," ").replace(/\n/g,"
")},isObject(){return typeof this.jsonData=="object"&&this.jsonData!==null},isContentPresent(){return this.jsonData!==null&&(typeof this.jsonData!="string"||this.jsonData.trim()!=="")}},methods:{toggleCollapsed(){this.collapsed=!this.collapsed},toggleCollapsible(){this.collapsed=!this.collapsed}}},kpt={key:0},Ppt={class:"toggle-icon mr-1"},Upt={key:0,class:"fas fa-plus-circle text-gray-600"},Fpt={key:1,class:"fas fa-minus-circle text-gray-600"},Bpt={class:"json-viewer max-h-64 overflow-auto p-4 bg-gray-100 border border-gray-300 rounded dark:bg-gray-600"},Gpt={key:0,class:"fas fa-plus-circle text-gray-600"},Vpt={key:1,class:"fas fa-minus-circle text-gray-600"},zpt=["innerHTML"];function Hpt(n,e,t,i,s,r){return r.isContentPresent?(O(),D("div",kpt,[_("div",{class:"collapsible-section cursor-pointer mb-4 font-bold hover:text-gray-900",onClick:e[0]||(e[0]=(...o)=>r.toggleCollapsible&&r.toggleCollapsible(...o))},[_("span",Ppt,[s.collapsed?(O(),D("i",Upt)):(O(),D("i",Fpt))]),je(" "+he(t.jsonFormText),1)]),xe(_("div",null,[_("div",Bpt,[r.isObject?(O(),D("span",{key:0,onClick:e[1]||(e[1]=(...o)=>r.toggleCollapsed&&r.toggleCollapsed(...o)),class:"toggle-icon cursor-pointer mr-1"},[s.collapsed?(O(),D("i",Gpt)):(O(),D("i",Vpt))])):j("",!0),_("pre",{innerHTML:r.formattedJson},null,8,zpt)])],512),[[At,!s.collapsed]])])):j("",!0)}const qpt=gt(Lpt,[["render",Hpt]]),Ypt={props:{done:{type:Boolean,required:!0},message:{type:String,required:!0},status:{type:Boolean,required:!0}}},$pt={class:"step flex items-center mb-4"},Wpt={class:"flex items-center justify-center w-6 h-6 mr-2"},Kpt={key:0},jpt=_("i",{"data-feather":"square",class:"text-gray-400 w-4 h-4"},null,-1),Qpt=[jpt],Xpt={key:1},Zpt=_("i",{"data-feather":"check-square",class:"text-green-500 w-4 h-4"},null,-1),Jpt=[Zpt],e_t={key:2},t_t=_("i",{"data-feather":"x-square",class:"text-red-500 w-4 h-4"},null,-1),n_t=[t_t],i_t={key:0,role:"status"},s_t=_("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[_("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),_("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})],-1),r_t=[s_t];function o_t(n,e,t,i,s,r){return O(),D("div",$pt,[_("div",Wpt,[t.done?j("",!0):(O(),D("div",Kpt,Qpt)),t.done&&t.status?(O(),D("div",Xpt,Jpt)):j("",!0),t.done&&!t.status?(O(),D("div",e_t,n_t)):j("",!0)]),t.done?j("",!0):(O(),D("div",i_t,r_t)),_("div",{class:He(["content flex-1 px-2",{"text-green-500":t.done,"text-yellow-500":!t.done}])},he(t.message),3)])}const a_t=gt(Ypt,[["render",o_t]]);const nC="/",l_t={name:"Message",emits:["copy","delete","rankUp","rankDown","updateMessage","resendMessage","continueMessage"],components:{MarkdownRenderer:vN,Step:a_t,RenderHTMLJS:Dpt,JsonViewer:qpt,DynamicUIRenderer:IN},props:{host:{type:String,required:!1,default:"http://localhost:9600"},message:Object,avatar:""},data(){return{isSynthesizingVoice:!1,cpp_block:CN,html5_block:RN,LaTeX_block:AN,json_block:xN,javascript_block:TN,python_block:yN,bash_block:wN,audio_url:null,audio:null,msg:null,isSpeaking:!1,speechSynthesis:null,voices:[],expanded:!1,showConfirmation:!1,editMsgMode_:!1,deleteMsgMode:!1,mdRenderHeight:Number}},mounted(){"speechSynthesis"in window?(this.speechSynthesis=window.speechSynthesis,this.voices=this.speechSynthesis.getVoices(),this.voices.length===0&&this.speechSynthesis.addEventListener("voiceschanged",this.onVoicesChanged)):console.error("Speech synthesis is not supported in this browser."),Fe(()=>{Be.replace(),this.mdRenderHeight=this.$refs.mdRender.$el.offsetHeight}),this.message.hasOwnProperty("metadata")&&this.message.metadata!=null&&(this.audio_url=this.message.metadata.hasOwnProperty("audio_url")?this.message.metadata.audio_url:null)},methods:{insertTab(n){const e=n.target,t=e.selectionStart,i=e.selectionEnd,s=n.shiftKey;if(t===i)if(s){if(e.value.substring(t-4,t)==" "){const r=e.value.substring(0,t-4),o=e.value.substring(i),a=r+o;this.message.content=a,this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t-4})}}else{const r=e.value.substring(0,t),o=e.value.substring(i),a=r+" "+o;this.message.content=a,this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t+4})}else{const o=e.value.substring(t,i).split(` `).map(d=>d.trim()===""?d:s?d.startsWith(" ")?d.substring(4):d:" "+d),a=e.value.substring(0,t),l=e.value.substring(i),c=a+o.join(` `)+l;this.message.content=c,this.$nextTick(()=>{e.selectionStart=t,e.selectionEnd=i+o.length*4})}n.preventDefault()},onVoicesChanged(){this.voices=this.speechSynthesis.getVoices()},read(){this.isSynthesizingVoice?(this.$refs.audio_player.pause(),this.isSynthesizingVoice=!1):(this.isSynthesizingVoice=!0,Ue.post("./text2Audio",{text:this.message.content}).then(n=>{let e=n.data.url;console.log(e),this.audio_url=e,this.$emit("updateMessage",this.message.id,this.message.content,this.audio_url)}).catch(n=>{this.$store.state.toast.showToast(`Error: ${n}`,4,!1),this.isSynthesizingVoice=!1}))},speak(){if(this.msg){this.speechSynthesis.cancel(),this.msg=null,this.isSpeaking=!1;return}let n=0;console.log("voice on"),this.isSpeaking=!0;const e=200;this.message.content,this.msg=new SpeechSynthesisUtterance,this.msg.pitch=this.$store.state.config.audio_pitch,this.voices.length>0&&(this.msg.voice=this.voices.filter(s=>s.name===this.$store.state.config.audio_out_voice)[0]);const t=s=>{let r=this.message.content.substring(s,s+e);const o=[".","!","?",` `];let a=-1;return o.forEach(l=>{const c=r.lastIndexOf(l);c>a&&(a=c)}),a==-1&&(a=r.length),console.log(a),a+s+1},i=()=>{if(this.message.content.includes(".")){const s=t(n),r=this.message.content.substring(n,s);this.msg.text=r,n=s+1,this.msg.onend=o=>{n{i()},1):(this.isSpeaking=!1,console.log("voice off :",this.message.content.length," ",s))},this.speechSynthesis.speak(this.msg)}else setTimeout(()=>{i()},1)};i()},toggleModel(){this.expanded=!this.expanded},addBlock(n){let e=this.$refs.mdTextarea.selectionStart,t=this.$refs.mdTextarea.selectionEnd;e==t?speechSynthesis==0||this.message.content[e-1]==` `?(this.message.content=this.message.content.slice(0,e)+"```"+n+"\n\n```\n"+this.message.content.slice(e),e=e+4+n.length):(this.message.content=this.message.content.slice(0,e)+"\n```"+n+"\n\n```\n"+this.message.content.slice(e),e=e+3+n.length):speechSynthesis==0||this.message.content[e-1]==` `?(this.message.content=this.message.content.slice(0,e)+"```"+n+` `+this.message.content.slice(e,t)+"\n```\n"+this.message.content.slice(t),e=e+4+n.length):(this.message.content=this.message.content.slice(0,e)+"\n```"+n+` -`+this.message.content.slice(e,t)+"\n```\n"+this.message.content.slice(t),p=p+3+n.length),this.$refs.mdTextarea.focus(),this.$refs.mdTextarea.selectionStart=this.$refs.mdTextarea.selectionEnd=p},copyContentToClipboard(){this.$emit("copy",this)},deleteMsg(){this.$emit("delete",this.message.id),this.deleteMsgMode=!1},rankUp(){this.$emit("rankUp",this.message.id)},rankDown(){this.$emit("rankDown",this.message.id)},updateMessage(){this.$emit("updateMessage",this.message.id,this.message.content,this.audio_url),this.editMsgMode=!1},resendMessage(n){this.$emit("resendMessage",this.message.id,this.message.content,n)},continueMessage(){this.$emit("continueMessage",this.message.id,this.message.content)},getImgUrl(){return this.avatar?(console.log("Avatar:",nC+this.avatar),nC+this.avatar):(console.log("No avatar found"),ca)},defaultImg(n){n.target.src=ca},parseDate(n){let e=new Date(Date.parse(n)),i=Math.floor((new Date-e)/1e3);return i<=1?"just now":i<20?i+" seconds ago":i<40?"half a minute ago":i<60?"less than a minute ago":i<=90?"one minute ago":i<=3540?Math.round(i/60)+" minutes ago":i<=5400?"1 hour ago":i<=86400?Math.round(i/3600)+" hours ago":i<=129600?"1 day ago":i<604800?Math.round(i/86400)+" days ago":i<=777600?"1 week ago":n},prettyDate(n){let e=new Date((n||"").replace(/-/g,"/").replace(/[TZ]/g," ")),t=(new Date().getTime()-e.getTime())/1e3,i=Math.floor(t/86400);if(!(isNaN(i)||i<0||i>=31))return i==0&&(t<60&&"just now"||t<120&&"1 minute ago"||t<3600&&Math.floor(t/60)+" minutes ago"||t<7200&&"1 hour ago"||t<86400&&Math.floor(t/3600)+" hours ago")||i==1&&"Yesterday"||i<7&&i+" days ago"||i<31&&Math.ceil(i/7)+" weeks ago"},checkForFullSentence(){if(this.message.content.trim().split(" ").length>3){this.speak();return}}},watch:{audio_url(n){n&&(this.$refs.audio_player.src=n)},"message.content":function(n){this.$store.state.config.auto_speak&&(this.isSpeaking||this.checkForFullSentence())},"message.ui":function(n){console.log("ui changed"),console.log(this.message.ui)},showConfirmation(){Fe(()=>{Be.replace()})},deleteMsgMode(){Fe(()=>{Be.replace()})}},computed:{editMsgMode:{get(){return this.message.hasOwnProperty("open")?this.editMsgMode_||this.message.open:this.editMsgMode_},set(n){this.message.open=n,this.editMsgMode_=n,Fe(()=>{Be.replace()})}},isTalking:{get(){return this.isSpeaking}},created_at(){return this.prettyDate(this.message.created_at)},created_at_parsed(){return new Date(Date.parse(this.message.created_at)).toLocaleString()},finished_generating_at_parsed(){return new Date(Date.parse(this.message.finished_generating_at)).toLocaleString()},time_spent(){const n=new Date(Date.parse(this.message.created_at)),e=new Date(Date.parse(this.message.finished_generating_at));if(e.getTime()===n.getTime()||!e.getTime())return;let i=e.getTime()-n.getTime();const s=Math.floor(i/(1e3*60*60));i-=s*(1e3*60*60);const r=Math.floor(i/(1e3*60));i-=r*(1e3*60);const o=Math.floor(i/1e3);i-=o*1e3;function a(c){return c<10&&(c="0"+c),c}return a(s)+"h:"+a(r)+"m:"+a(o)+"s"}}},d_t={class:"relative w-full group rounded-lg m-2 shadow-lg hover:border-primary dark:hover:border-primary hover:border-solid hover:border-2 border-2 border-transparent even:bg-bg-light-discussion-odd dark:even:bg-bg-dark-discussion-odd flex flex-col flex-grow flex-wrap overflow-visible p-4 pb-2"},u_t={class:"flex flex-row gap-2"},p_t={class:"flex-shrink-0"},__t={class:"group/avatar"},h_t=["src","data-popover-target"],f_t={class:"flex flex-col w-full flex-grow-0"},m_t={class:"flex flex-row flex-grow items-start"},g_t={class:"flex flex-col mb-2"},E_t={class:"drop-shadow-sm text-lg text-opacity-95 font-bold grow"},b_t=["title"],S_t=_("div",{class:"flex-grow"},null,-1),v_t={class:"flex-row justify-end mx-2"},y_t={class:"invisible group-hover:visible flex flex-row"},T_t={key:0,class:"flex items-center duration-75"},x_t=_("i",{"data-feather":"x"},null,-1),C_t=[x_t],R_t=_("i",{"data-feather":"check"},null,-1),A_t=[R_t],w_t=_("i",{"data-feather":"edit"},null,-1),N_t=[w_t],O_t=["src"],I_t=["src"],M_t=["src"],D_t=["src"],L_t=["src"],k_t=["src"],P_t=["src"],U_t=_("i",{"data-feather":"copy"},null,-1),F_t=[U_t],B_t=_("i",{"data-feather":"send"},null,-1),G_t=[B_t],V_t=_("i",{"data-feather":"send"},null,-1),z_t=[V_t],H_t=_("i",{"data-feather":"fast-forward"},null,-1),q_t=[H_t],Y_t={key:12,class:"flex items-center duration-75"},$_t=_("i",{"data-feather":"x"},null,-1),W_t=[$_t],K_t=_("i",{"data-feather":"check"},null,-1),j_t=[K_t],Q_t=_("i",{"data-feather":"trash"},null,-1),X_t=[Q_t],Z_t=_("i",{"data-feather":"thumbs-up"},null,-1),J_t=[Z_t],eht={class:"flex flex-row items-center"},tht=_("i",{"data-feather":"thumbs-down"},null,-1),nht=[tht],iht={class:"flex flex-row items-center"},sht=_("i",{"data-feather":"volume-2"},null,-1),rht=[sht],oht={key:14,class:"flex flex-row items-center"},aht=_("i",{"data-feather":"voicemail"},null,-1),lht=[aht],cht={key:1,"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101 cursor-pointer",title:"Generating voice, please stand by ...",fill:"none",xmlns:"http://www.w3.org/2000/svg"},dht=_("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"},null,-1),uht=_("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"},null,-1),pht=[dht,uht],_ht={class:"overflow-x-auto w-full"},hht={class:"flex flex-col items-start w-full"},fht={class:"flex flex-col items-start w-full"},mht={key:1},ght=["src"],Eht={class:"text-sm text-gray-400 mt-2"},bht={class:"flex flex-row items-center gap-2"},Sht={key:0},vht={class:"font-thin"},yht={key:1},Tht={class:"font-thin"},xht={key:2},Cht={class:"font-thin"},Rht={key:3},Aht=["title"];function wht(n,e,t,i,s,r){const o=_t("Step"),a=_t("RenderHTMLJS"),l=_t("MarkdownRenderer"),c=_t("JsonViewer"),d=_t("DynamicUIRenderer");return O(),D("div",d_t,[_("div",u_t,[_("div",p_t,[_("div",__t,[_("img",{src:r.getImgUrl(),onError:e[0]||(e[0]=u=>r.defaultImg(u)),"data-popover-target":"avatar"+t.message.id,"data-popover-placement":"bottom",class:"w-10 h-10 rounded-full object-fill text-red-700"},null,40,h_t)])]),_("div",f_t,[_("div",m_t,[_("div",g_t,[_("div",E_t,he(t.message.sender)+" ",1),t.message.created_at?(O(),D("div",{key:0,class:"text-sm text-gray-400 font-thin",title:"Created at: "+r.created_at_parsed},he(r.created_at),9,b_t)):j("",!0)]),S_t,_("div",v_t,[_("div",y_t,[r.editMsgMode?(O(),D("div",T_t,[_("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90 p-2",title:"Cancel edit",type:"button",onClick:e[1]||(e[1]=Te(u=>r.editMsgMode=!1,["stop"]))},C_t),_("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 p-2",title:"Update message",type:"button",onClick:e[2]||(e[2]=Te((...u)=>r.updateMessage&&r.updateMessage(...u),["stop"]))},A_t)])):j("",!0),r.editMsgMode?j("",!0):(O(),D("div",{key:1,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Edit message",onClick:e[3]||(e[3]=Te(u=>r.editMsgMode=!0,["stop"]))},N_t)),r.editMsgMode?(O(),D("div",{key:2,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer hover:border-2",title:"Add python block",onClick:e[4]||(e[4]=Te(u=>r.addBlock("python"),["stop"]))},[_("img",{src:s.python_block,width:"25",height:"25"},null,8,O_t)])):j("",!0),r.editMsgMode?(O(),D("div",{key:3,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add javascript block",onClick:e[5]||(e[5]=Te(u=>r.addBlock("javascript"),["stop"]))},[_("img",{src:s.javascript_block,width:"25",height:"25"},null,8,I_t)])):j("",!0),r.editMsgMode?(O(),D("div",{key:4,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add json block",onClick:e[6]||(e[6]=Te(u=>r.addBlock("json"),["stop"]))},[_("img",{src:s.json_block,width:"25",height:"25"},null,8,M_t)])):j("",!0),r.editMsgMode?(O(),D("div",{key:5,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add c++ block",onClick:e[7]||(e[7]=Te(u=>r.addBlock("c++"),["stop"]))},[_("img",{src:s.cpp_block,width:"25",height:"25"},null,8,D_t)])):j("",!0),r.editMsgMode?(O(),D("div",{key:6,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add html block",onClick:e[8]||(e[8]=Te(u=>r.addBlock("html"),["stop"]))},[_("img",{src:s.html5_block,width:"25",height:"25"},null,8,L_t)])):j("",!0),r.editMsgMode?(O(),D("div",{key:7,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add LaTex block",onClick:e[9]||(e[9]=Te(u=>r.addBlock("latex"),["stop"]))},[_("img",{src:s.LaTeX_block,width:"25",height:"25"},null,8,k_t)])):j("",!0),r.editMsgMode?(O(),D("div",{key:8,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add bash block",onClick:e[10]||(e[10]=Te(u=>r.addBlock("bash"),["stop"]))},[_("img",{src:s.bash_block,width:"25",height:"25"},null,8,P_t)])):j("",!0),_("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Copy message to clipboard",onClick:e[11]||(e[11]=Te(u=>r.copyContentToClipboard(),["stop"]))},F_t),!r.editMsgMode&&t.message.sender!=this.$store.state.mountedPers.name?(O(),D("div",{key:9,class:He(["text-lg text-red-500 hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",{"text-5xl":r.editMsgMode}]),title:"Resend message with full context",onClick:e[12]||(e[12]=Te(u=>r.resendMessage("full_context"),["stop"]))},G_t,2)):j("",!0),!r.editMsgMode&&t.message.sender!=this.$store.state.mountedPers.name?(O(),D("div",{key:10,class:He(["text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",{"text-5xl":r.editMsgMode}]),title:"Resend message without the full context",onClick:e[13]||(e[13]=Te(u=>r.resendMessage("simple_question"),["stop"]))},z_t,2)):j("",!0),!r.editMsgMode&&t.message.sender==this.$store.state.mountedPers.name?(O(),D("div",{key:11,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Resend message",onClick:e[14]||(e[14]=Te(u=>r.continueMessage(),["stop"]))},q_t)):j("",!0),s.deleteMsgMode?(O(),D("div",Y_t,[_("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"Cancel removal",type:"button",onClick:e[15]||(e[15]=Te(u=>s.deleteMsgMode=!1,["stop"]))},W_t),_("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Confirm removal",type:"button",onClick:e[16]||(e[16]=Te(u=>r.deleteMsg(),["stop"]))},j_t)])):j("",!0),!r.editMsgMode&&!s.deleteMsgMode?(O(),D("div",{key:13,class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"Remove message",onClick:e[17]||(e[17]=u=>s.deleteMsgMode=!0)},X_t)):j("",!0),_("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Upvote",onClick:e[18]||(e[18]=Te(u=>r.rankUp(),["stop"]))},J_t),_("div",eht,[_("div",{class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"Downvote",onClick:e[19]||(e[19]=Te(u=>r.rankDown(),["stop"]))},nht),t.message.rank!=0?(O(),D("div",{key:0,class:He(["rounded-full px-2 text-sm flex items-center justify-center font-bold cursor-pointer",t.message.rank>0?"bg-secondary":"bg-red-600"]),title:"Rank"},he(t.message.rank),3)):j("",!0)]),_("div",iht,[_("div",{class:He(["text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",{"text-red-500":r.isTalking}]),title:"speak",onClick:e[20]||(e[20]=Te(u=>r.speak(),["stop"]))},rht,2)]),this.$store.state.config.enable_voice_service?(O(),D("div",oht,[s.isSynthesizingVoice?(O(),D("svg",cht,pht)):(O(),D("div",{key:0,class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"read",onClick:e[21]||(e[21]=Te(u=>r.read(),["stop"]))},lht))])):j("",!0)])])]),_("div",_ht,[_("div",hht,[(O(!0),D($e,null,lt(t.message.steps,(u,h)=>(O(),D("div",{key:"step-"+t.message.id+"-"+h,class:"step font-bold",style:Xt({backgroundColor:u.done?"transparent":"inherit"})},[Ie(o,{done:u.done,message:u.message,status:u.status},null,8,["done","message","status"])],4))),128))]),_("div",fht,[(O(!0),D($e,null,lt(t.message.html_js_s,(u,h)=>(O(),D("div",{key:"htmljs-"+t.message.id+"-"+h,class:"htmljs font-bold",style:Xt({backgroundColor:n.step.done?"transparent":"inherit"})},[Ie(a,{htmlContent:u},null,8,["htmlContent"])],4))),128))]),r.editMsgMode?j("",!0):(O(),Ot(l,{key:0,ref:"mdRender",host:t.host,"markdown-text":t.message.content,message_id:t.message.id,discussion_id:t.message.discussion_id},null,8,["host","markdown-text","message_id","discussion_id"])),_("div",null,[t.message.open?xe((O(),D("textarea",{key:0,ref:"mdTextarea",onKeydown:e[22]||(e[22]=mr(Te((...u)=>r.insertTab&&r.insertTab(...u),["prevent"]),["tab"])),class:"block min-h-[900px] p-2.5 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 overflow-y-scroll flex flex-col shadow-lg p-10 pt-0 overflow-y-scroll dark:bg-bg-dark scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",rows:4,style:Xt({minHeight:s.mdRenderHeight+"px"}),placeholder:"Enter message here...","onUpdate:modelValue":e[23]||(e[23]=u=>t.message.content=u)},`\r - `,36)),[[Xe,t.message.content]]):j("",!0)]),t.message.metadata!==null?(O(),D("div",mht,[(O(!0),D($e,null,lt(t.message.metadata,(u,h)=>(O(),D("div",{key:"json-"+t.message.id+"-"+h,class:"json font-bold"},[Ie(c,{jsonFormText:u.title,jsonData:u.content},null,8,["jsonFormText","jsonData"])]))),128))])):j("",!0),t.message.ui!==null&&t.message.ui!==void 0&&t.message.ui!==""?(O(),Ot(d,{key:2,class:"w-full h-full",code:t.message.ui},null,8,["code"])):j("",!0),s.audio_url!=null?(O(),D("audio",{controls:"",autoplay:"",key:s.audio_url},[_("source",{src:s.audio_url,type:"audio/wav",ref:"audio_player"},null,8,ght),je(" Your browser does not support the audio element. ")])):j("",!0)]),_("div",Eht,[_("div",bht,[t.message.binding?(O(),D("p",Sht,[je("Binding: "),_("span",vht,he(t.message.binding),1)])):j("",!0),t.message.model?(O(),D("p",yht,[je("Model: "),_("span",Tht,he(t.message.model),1)])):j("",!0),t.message.seed?(O(),D("p",xht,[je("Seed: "),_("span",Cht,he(t.message.seed),1)])):j("",!0),r.time_spent?(O(),D("p",Rht,[je("Time spent: "),_("span",{class:"font-thin",title:"Finished generating: "+r.finished_generating_at_parsed},he(r.time_spent),9,Aht)])):j("",!0)])])])])])}const DN=gt(c_t,[["render",wht]]),Nht="/";Ue.defaults.baseURL="/";const Oht={name:"MountedPersonalities",props:{onShowPersList:Function,onReady:Function},components:{Toast:rc,UniversalForm:oc},data(){return{bUrl:Nht,isMounted:!1,show:!1}},async mounted(){await this.constructor(),this.isMounted=!0},async activated(){this.isMounted&&await this.constructor()},computed:{configFile:{get(){return this.$store.state.config},set(n){this.$store.commit("setConfig",n)}},mountedPers:{get(){return this.$store.state.mountedPers},set(n){this.$store.commit("setMountedPers",n)}},personalities:{get(){return this.$store.state.personalities},set(n){this.$store.commit("setPersonalities",n)}},mountedPersArr:{get(){return this.$store.state.mountedPersArr},set(n){this.$store.commit("setMountedPers",n)}}},methods:{onSettingsPersonality(n){try{Ue.get("/get_active_personality_settings").then(e=>{e&&(console.log("pers sett",e),e.data&&Object.keys(e.data).length>0?this.$refs.universalForm.showForm(e.data,"Personality settings - "+n.name,"Save changes","Cancel").then(t=>{try{Ue.post("/set_active_personality_settings",t).then(i=>{i&&i.data?(console.log("personality set with new settings",i.data),this.$refs.toast.showToast("Personality settings updated successfully!",4,!0)):this.$refs.toast.showToast(`Did not get Personality settings responses. +`+this.message.content.slice(e,t)+"\n```\n"+this.message.content.slice(t),p=p+3+n.length),this.$refs.mdTextarea.focus(),this.$refs.mdTextarea.selectionStart=this.$refs.mdTextarea.selectionEnd=p},copyContentToClipboard(){this.$emit("copy",this)},deleteMsg(){this.$emit("delete",this.message.id),this.deleteMsgMode=!1},rankUp(){this.$emit("rankUp",this.message.id)},rankDown(){this.$emit("rankDown",this.message.id)},updateMessage(){this.$emit("updateMessage",this.message.id,this.message.content,this.audio_url),this.editMsgMode=!1},resendMessage(n){this.$emit("resendMessage",this.message.id,this.message.content,n)},continueMessage(){this.$emit("continueMessage",this.message.id,this.message.content)},getImgUrl(){return this.avatar?(console.log("Avatar:",nC+this.avatar),nC+this.avatar):(console.log("No avatar found"),ca)},defaultImg(n){n.target.src=ca},parseDate(n){let e=new Date(Date.parse(n)),i=Math.floor((new Date-e)/1e3);return i<=1?"just now":i<20?i+" seconds ago":i<40?"half a minute ago":i<60?"less than a minute ago":i<=90?"one minute ago":i<=3540?Math.round(i/60)+" minutes ago":i<=5400?"1 hour ago":i<=86400?Math.round(i/3600)+" hours ago":i<=129600?"1 day ago":i<604800?Math.round(i/86400)+" days ago":i<=777600?"1 week ago":n},prettyDate(n){let e=new Date((n||"").replace(/-/g,"/").replace(/[TZ]/g," ")),t=(new Date().getTime()-e.getTime())/1e3,i=Math.floor(t/86400);if(!(isNaN(i)||i<0||i>=31))return i==0&&(t<60&&"just now"||t<120&&"1 minute ago"||t<3600&&Math.floor(t/60)+" minutes ago"||t<7200&&"1 hour ago"||t<86400&&Math.floor(t/3600)+" hours ago")||i==1&&"Yesterday"||i<7&&i+" days ago"||i<31&&Math.ceil(i/7)+" weeks ago"},checkForFullSentence(){if(this.message.content.trim().split(" ").length>3){this.speak();return}}},watch:{audio_url(n){n&&(this.$refs.audio_player.src=n)},"message.content":function(n){this.$store.state.config.auto_speak&&(this.isSpeaking||this.checkForFullSentence())},"message.ui":function(n){console.log("ui changed"),console.log(this.message.ui)},showConfirmation(){Fe(()=>{Be.replace()})},deleteMsgMode(){Fe(()=>{Be.replace()})}},computed:{editMsgMode:{get(){return this.message.hasOwnProperty("open")?this.editMsgMode_||this.message.open:this.editMsgMode_},set(n){this.message.open=n,this.editMsgMode_=n,Fe(()=>{Be.replace()})}},isTalking:{get(){return this.isSpeaking}},created_at(){return this.prettyDate(this.message.created_at)},created_at_parsed(){return new Date(Date.parse(this.message.created_at)).toLocaleString()},finished_generating_at_parsed(){return new Date(Date.parse(this.message.finished_generating_at)).toLocaleString()},time_spent(){const n=new Date(Date.parse(this.message.created_at)),e=new Date(Date.parse(this.message.finished_generating_at));if(e.getTime()===n.getTime()||!e.getTime())return;let i=e.getTime()-n.getTime();const s=Math.floor(i/(1e3*60*60));i-=s*(1e3*60*60);const r=Math.floor(i/(1e3*60));i-=r*(1e3*60);const o=Math.floor(i/1e3);i-=o*1e3;function a(c){return c<10&&(c="0"+c),c}return a(s)+"h:"+a(r)+"m:"+a(o)+"s"}}},c_t={class:"relative w-full group rounded-lg m-2 shadow-lg hover:border-primary dark:hover:border-primary hover:border-solid hover:border-2 border-2 border-transparent even:bg-bg-light-discussion-odd dark:even:bg-bg-dark-discussion-odd flex flex-col flex-grow flex-wrap overflow-visible p-4 pb-2"},d_t={class:"flex flex-row gap-2"},u_t={class:"flex-shrink-0"},p_t={class:"group/avatar"},__t=["src","data-popover-target"],h_t={class:"flex flex-col w-full flex-grow-0"},f_t={class:"flex flex-row flex-grow items-start"},m_t={class:"flex flex-col mb-2"},g_t={class:"drop-shadow-sm text-lg text-opacity-95 font-bold grow"},E_t=["title"],b_t=_("div",{class:"flex-grow"},null,-1),S_t={class:"flex-row justify-end mx-2"},v_t={class:"invisible group-hover:visible flex flex-row"},y_t={key:0,class:"flex items-center duration-75"},T_t=_("i",{"data-feather":"x"},null,-1),x_t=[T_t],C_t=_("i",{"data-feather":"check"},null,-1),R_t=[C_t],A_t=_("i",{"data-feather":"edit"},null,-1),w_t=[A_t],N_t=["src"],O_t=["src"],I_t=["src"],M_t=["src"],D_t=["src"],L_t=["src"],k_t=["src"],P_t=_("i",{"data-feather":"copy"},null,-1),U_t=[P_t],F_t=_("i",{"data-feather":"send"},null,-1),B_t=[F_t],G_t=_("i",{"data-feather":"send"},null,-1),V_t=[G_t],z_t=_("i",{"data-feather":"fast-forward"},null,-1),H_t=[z_t],q_t={key:12,class:"flex items-center duration-75"},Y_t=_("i",{"data-feather":"x"},null,-1),$_t=[Y_t],W_t=_("i",{"data-feather":"check"},null,-1),K_t=[W_t],j_t=_("i",{"data-feather":"trash"},null,-1),Q_t=[j_t],X_t=_("i",{"data-feather":"thumbs-up"},null,-1),Z_t=[X_t],J_t={class:"flex flex-row items-center"},eht=_("i",{"data-feather":"thumbs-down"},null,-1),tht=[eht],nht={class:"flex flex-row items-center"},iht=_("i",{"data-feather":"volume-2"},null,-1),sht=[iht],rht={key:14,class:"flex flex-row items-center"},oht=_("i",{"data-feather":"voicemail"},null,-1),aht=[oht],lht={key:1,"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101 cursor-pointer",title:"Generating voice, please stand by ...",fill:"none",xmlns:"http://www.w3.org/2000/svg"},cht=_("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"},null,-1),dht=_("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"},null,-1),uht=[cht,dht],pht={class:"overflow-x-auto w-full"},_ht={class:"flex flex-col items-start w-full"},hht={class:"flex flex-col items-start w-full"},fht={key:1},mht=["src"],ght={class:"text-sm text-gray-400 mt-2"},Eht={class:"flex flex-row items-center gap-2"},bht={key:0},Sht={class:"font-thin"},vht={key:1},yht={class:"font-thin"},Tht={key:2},xht={class:"font-thin"},Cht={key:3},Rht=["title"];function Aht(n,e,t,i,s,r){const o=_t("Step"),a=_t("RenderHTMLJS"),l=_t("MarkdownRenderer"),c=_t("JsonViewer"),d=_t("DynamicUIRenderer");return O(),D("div",c_t,[_("div",d_t,[_("div",u_t,[_("div",p_t,[_("img",{src:r.getImgUrl(),onError:e[0]||(e[0]=u=>r.defaultImg(u)),"data-popover-target":"avatar"+t.message.id,"data-popover-placement":"bottom",class:"w-10 h-10 rounded-full object-fill text-red-700"},null,40,__t)])]),_("div",h_t,[_("div",f_t,[_("div",m_t,[_("div",g_t,he(t.message.sender)+" ",1),t.message.created_at?(O(),D("div",{key:0,class:"text-sm text-gray-400 font-thin",title:"Created at: "+r.created_at_parsed},he(r.created_at),9,E_t)):j("",!0)]),b_t,_("div",S_t,[_("div",v_t,[r.editMsgMode?(O(),D("div",y_t,[_("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90 p-2",title:"Cancel edit",type:"button",onClick:e[1]||(e[1]=Te(u=>r.editMsgMode=!1,["stop"]))},x_t),_("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 p-2",title:"Update message",type:"button",onClick:e[2]||(e[2]=Te((...u)=>r.updateMessage&&r.updateMessage(...u),["stop"]))},R_t)])):j("",!0),r.editMsgMode?j("",!0):(O(),D("div",{key:1,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Edit message",onClick:e[3]||(e[3]=Te(u=>r.editMsgMode=!0,["stop"]))},w_t)),r.editMsgMode?(O(),D("div",{key:2,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer hover:border-2",title:"Add python block",onClick:e[4]||(e[4]=Te(u=>r.addBlock("python"),["stop"]))},[_("img",{src:s.python_block,width:"25",height:"25"},null,8,N_t)])):j("",!0),r.editMsgMode?(O(),D("div",{key:3,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add javascript block",onClick:e[5]||(e[5]=Te(u=>r.addBlock("javascript"),["stop"]))},[_("img",{src:s.javascript_block,width:"25",height:"25"},null,8,O_t)])):j("",!0),r.editMsgMode?(O(),D("div",{key:4,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add json block",onClick:e[6]||(e[6]=Te(u=>r.addBlock("json"),["stop"]))},[_("img",{src:s.json_block,width:"25",height:"25"},null,8,I_t)])):j("",!0),r.editMsgMode?(O(),D("div",{key:5,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add c++ block",onClick:e[7]||(e[7]=Te(u=>r.addBlock("c++"),["stop"]))},[_("img",{src:s.cpp_block,width:"25",height:"25"},null,8,M_t)])):j("",!0),r.editMsgMode?(O(),D("div",{key:6,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add html block",onClick:e[8]||(e[8]=Te(u=>r.addBlock("html"),["stop"]))},[_("img",{src:s.html5_block,width:"25",height:"25"},null,8,D_t)])):j("",!0),r.editMsgMode?(O(),D("div",{key:7,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add LaTex block",onClick:e[9]||(e[9]=Te(u=>r.addBlock("latex"),["stop"]))},[_("img",{src:s.LaTeX_block,width:"25",height:"25"},null,8,L_t)])):j("",!0),r.editMsgMode?(O(),D("div",{key:8,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add bash block",onClick:e[10]||(e[10]=Te(u=>r.addBlock("bash"),["stop"]))},[_("img",{src:s.bash_block,width:"25",height:"25"},null,8,k_t)])):j("",!0),_("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Copy message to clipboard",onClick:e[11]||(e[11]=Te(u=>r.copyContentToClipboard(),["stop"]))},U_t),!r.editMsgMode&&t.message.sender!=this.$store.state.mountedPers.name?(O(),D("div",{key:9,class:He(["text-lg text-red-500 hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",{"text-5xl":r.editMsgMode}]),title:"Resend message with full context",onClick:e[12]||(e[12]=Te(u=>r.resendMessage("full_context"),["stop"]))},B_t,2)):j("",!0),!r.editMsgMode&&t.message.sender!=this.$store.state.mountedPers.name?(O(),D("div",{key:10,class:He(["text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",{"text-5xl":r.editMsgMode}]),title:"Resend message without the full context",onClick:e[13]||(e[13]=Te(u=>r.resendMessage("simple_question"),["stop"]))},V_t,2)):j("",!0),!r.editMsgMode&&t.message.sender==this.$store.state.mountedPers.name?(O(),D("div",{key:11,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Resend message",onClick:e[14]||(e[14]=Te(u=>r.continueMessage(),["stop"]))},H_t)):j("",!0),s.deleteMsgMode?(O(),D("div",q_t,[_("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"Cancel removal",type:"button",onClick:e[15]||(e[15]=Te(u=>s.deleteMsgMode=!1,["stop"]))},$_t),_("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Confirm removal",type:"button",onClick:e[16]||(e[16]=Te(u=>r.deleteMsg(),["stop"]))},K_t)])):j("",!0),!r.editMsgMode&&!s.deleteMsgMode?(O(),D("div",{key:13,class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"Remove message",onClick:e[17]||(e[17]=u=>s.deleteMsgMode=!0)},Q_t)):j("",!0),_("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Upvote",onClick:e[18]||(e[18]=Te(u=>r.rankUp(),["stop"]))},Z_t),_("div",J_t,[_("div",{class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"Downvote",onClick:e[19]||(e[19]=Te(u=>r.rankDown(),["stop"]))},tht),t.message.rank!=0?(O(),D("div",{key:0,class:He(["rounded-full px-2 text-sm flex items-center justify-center font-bold cursor-pointer",t.message.rank>0?"bg-secondary":"bg-red-600"]),title:"Rank"},he(t.message.rank),3)):j("",!0)]),_("div",nht,[_("div",{class:He(["text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",{"text-red-500":r.isTalking}]),title:"speak",onClick:e[20]||(e[20]=Te(u=>r.speak(),["stop"]))},sht,2)]),this.$store.state.config.enable_voice_service?(O(),D("div",rht,[s.isSynthesizingVoice?(O(),D("svg",lht,uht)):(O(),D("div",{key:0,class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"read",onClick:e[21]||(e[21]=Te(u=>r.read(),["stop"]))},aht))])):j("",!0)])])]),_("div",pht,[_("div",_ht,[(O(!0),D($e,null,lt(t.message.steps,(u,h)=>(O(),D("div",{key:"step-"+t.message.id+"-"+h,class:"step font-bold",style:Xt({backgroundColor:u.done?"transparent":"inherit"})},[Ie(o,{done:u.done,message:u.message,status:u.status},null,8,["done","message","status"])],4))),128))]),_("div",hht,[(O(!0),D($e,null,lt(t.message.html_js_s,(u,h)=>(O(),D("div",{key:"htmljs-"+t.message.id+"-"+h,class:"htmljs font-bold",style:Xt({backgroundColor:n.step.done?"transparent":"inherit"})},[Ie(a,{htmlContent:u},null,8,["htmlContent"])],4))),128))]),r.editMsgMode?j("",!0):(O(),Ot(l,{key:0,ref:"mdRender",host:t.host,"markdown-text":t.message.content,message_id:t.message.id,discussion_id:t.message.discussion_id},null,8,["host","markdown-text","message_id","discussion_id"])),_("div",null,[t.message.open?xe((O(),D("textarea",{key:0,ref:"mdTextarea",onKeydown:e[22]||(e[22]=mr(Te((...u)=>r.insertTab&&r.insertTab(...u),["prevent"]),["tab"])),class:"block min-h-[900px] p-2.5 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 overflow-y-scroll flex flex-col shadow-lg p-10 pt-0 overflow-y-scroll dark:bg-bg-dark scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",rows:4,style:Xt({minHeight:s.mdRenderHeight+"px"}),placeholder:"Enter message here...","onUpdate:modelValue":e[23]||(e[23]=u=>t.message.content=u)},`\r + `,36)),[[Xe,t.message.content]]):j("",!0)]),t.message.metadata!==null?(O(),D("div",fht,[(O(!0),D($e,null,lt(t.message.metadata,(u,h)=>(O(),D("div",{key:"json-"+t.message.id+"-"+h,class:"json font-bold"},[Ie(c,{jsonFormText:u.title,jsonData:u.content},null,8,["jsonFormText","jsonData"])]))),128))])):j("",!0),t.message.ui!==null&&t.message.ui!==void 0&&t.message.ui!==""?(O(),Ot(d,{key:2,class:"w-full h-full",code:t.message.ui},null,8,["code"])):j("",!0),s.audio_url!=null?(O(),D("audio",{controls:"",autoplay:"",key:s.audio_url},[_("source",{src:s.audio_url,type:"audio/wav",ref:"audio_player"},null,8,mht),je(" Your browser does not support the audio element. ")])):j("",!0)]),_("div",ght,[_("div",Eht,[t.message.binding?(O(),D("p",bht,[je("Binding: "),_("span",Sht,he(t.message.binding),1)])):j("",!0),t.message.model?(O(),D("p",vht,[je("Model: "),_("span",yht,he(t.message.model),1)])):j("",!0),t.message.seed?(O(),D("p",Tht,[je("Seed: "),_("span",xht,he(t.message.seed),1)])):j("",!0),r.time_spent?(O(),D("p",Cht,[je("Time spent: "),_("span",{class:"font-thin",title:"Finished generating: "+r.finished_generating_at_parsed},he(r.time_spent),9,Rht)])):j("",!0)])])])])])}const DN=gt(l_t,[["render",Aht]]),wht="/";Ue.defaults.baseURL="/";const Nht={name:"MountedPersonalities",props:{onShowPersList:Function,onReady:Function},components:{Toast:rc,UniversalForm:oc},data(){return{bUrl:wht,isMounted:!1,show:!1}},async mounted(){await this.constructor(),this.isMounted=!0},async activated(){this.isMounted&&await this.constructor()},computed:{configFile:{get(){return this.$store.state.config},set(n){this.$store.commit("setConfig",n)}},mountedPers:{get(){return this.$store.state.mountedPers},set(n){this.$store.commit("setMountedPers",n)}},personalities:{get(){return this.$store.state.personalities},set(n){this.$store.commit("setPersonalities",n)}},mountedPersArr:{get(){return this.$store.state.mountedPersArr},set(n){this.$store.commit("setMountedPers",n)}}},methods:{onSettingsPersonality(n){try{Ue.get("/get_active_personality_settings").then(e=>{e&&(console.log("pers sett",e),e.data&&Object.keys(e.data).length>0?this.$refs.universalForm.showForm(e.data,"Personality settings - "+n.name,"Save changes","Cancel").then(t=>{try{Ue.post("/set_active_personality_settings",t).then(i=>{i&&i.data?(console.log("personality set with new settings",i.data),this.$refs.toast.showToast("Personality settings updated successfully!",4,!0)):this.$refs.toast.showToast(`Did not get Personality settings responses. `+i,4,!1)})}catch(i){this.$refs.toast.showToast(`Did not get Personality settings responses. - Endpoint error: `+i.message,4,!1)}}):this.$refs.toast.showToast("Personality has no settings",4,!1))})}catch(e){this.$refs.toast.showToast("Could not open personality settings. Endpoint error: "+e.message,4,!1)}},toggleShowPersList(){this.onShowPersList()},async constructor(){for(Fe(()=>{Be.replace()});this.$store.state.ready===!1;)await new Promise(n=>setTimeout(n,100));this.onReady()},async api_get_req(n){try{const e=await Ue.get("/"+n);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - mountedPersonalities");return}},personalityImgPlacehodler(n){n.target.src=pc}}},Iht={class:"w-fit select-none"},Mht={key:0,class:"flex -space-x-4"},Dht=["src","title"],Lht={key:1,class:"flex -space-x-4"},kht=["src","title"],Pht={key:2,title:"Loading personalities"},Uht=_("div",{role:"status"},[_("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[_("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),_("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),_("span",{class:"sr-only"},"Loading...")],-1),Fht=[Uht];function Bht(n,e,t,i,s,r){const o=_t("UniversalForm");return O(),D($e,null,[_("div",Iht,[r.mountedPersArr.length>1?(O(),D("div",Mht,[_("img",{src:s.bUrl+r.mountedPers.avatar,onError:e[0]||(e[0]=(...a)=>r.personalityImgPlacehodler&&r.personalityImgPlacehodler(...a)),class:"w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:z-20 hover:-translate-y-2 duration-150 border-secondary cursor-pointer",title:"Active personality: "+r.mountedPers.name,onClick:e[1]||(e[1]=a=>r.onSettingsPersonality(r.mountedPers))},null,40,Dht),_("div",{class:"flex items-center justify-center w-8 h-8 cursor-pointer text-xs font-medium bg-bg-light dark:bg-bg-dark border-2 hover:border-secondary rounded-full hover:bg-bg-light-tone dark:hover:bg-bg-dark-tone dark:border-gray-800 hover:z-20 hover:-translate-y-2 duration-150 active:scale-90",onClick:e[2]||(e[2]=Te((...a)=>r.toggleShowPersList&&r.toggleShowPersList(...a),["stop"])),title:"Click to show more"},"+"+he(r.mountedPersArr.length-1),1)])):j("",!0),r.mountedPersArr.length==1?(O(),D("div",Lht,[_("img",{src:s.bUrl+this.$store.state.mountedPers.avatar,onError:e[3]||(e[3]=(...a)=>r.personalityImgPlacehodler&&r.personalityImgPlacehodler(...a)),class:"w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:z-20 cursor-pointer border-secondary",title:"Active personality: "+this.$store.state.mountedPers.name,onClick:e[4]||(e[4]=Te((...a)=>r.toggleShowPersList&&r.toggleShowPersList(...a),["stop"]))},null,40,kht)])):j("",!0),r.mountedPersArr.length==0?(O(),D("div",Pht,Fht)):j("",!0)]),Ie(o,{ref:"universalForm",class:"z-20"},null,512)],64)}const Ght=gt(Oht,[["render",Bht]]);const Vht="/";Ue.defaults.baseURL="/";const zht={props:{onTalk:Function,onMounted:Function,onUnmounted:Function,onRemounted:Function,discussionPersonalities:Array,onShowPersList:Function},components:{PersonalityEntry:ON,Toast:rc,UniversalForm:oc},name:"MountedPersonalitiesList",data(){return{bUrl:Vht,isMounted:!1,isLoading:!1}},async mounted(){await this.constructor(),this.isMounted=!0},async activated(){this.isMounted&&await this.constructor()},computed:{configFile:{get(){return this.$store.state.config},set(n){this.$store.commit("setConfig",n)}},personalities:{get(){return this.$store.state.personalities},set(n){this.$store.commit("setPersonalities",n)}},mountedPersArr:{get(){return this.$store.state.mountedPersArr},set(n){this.$store.commit("setMountedPers",n)}}},methods:{toggleShowPersList(){this.onShowPersList()},async constructor(){},async api_get_req(n){try{const e=await Ue.get("/"+n);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - mountedPersonalities");return}},personalityImgPlacehodler(n){n.target.src=pc},onPersonalityReinstall(n){console.log("on reinstall ",n),this.isLoading=!0,Ue.post("/reinstall_personality",{name:n.personality.full_path}).then(e=>{if(e)return this.isLoading=!1,console.log("reinstall_personality",e),e.data.status?this.$refs.toast.showToast("Personality reinstalled successfully!",4,!0):this.$refs.toast.showToast("Could not reinstall personality",4,!1),e.data;this.isLoading=!1}).catch(e=>(this.isLoading=!1,this.$refs.toast.showToast(`Could not reinstall personality + Endpoint error: `+i.message,4,!1)}}):this.$refs.toast.showToast("Personality has no settings",4,!1))})}catch(e){this.$refs.toast.showToast("Could not open personality settings. Endpoint error: "+e.message,4,!1)}},toggleShowPersList(){this.onShowPersList()},async constructor(){for(Fe(()=>{Be.replace()});this.$store.state.ready===!1;)await new Promise(n=>setTimeout(n,100));this.onReady()},async api_get_req(n){try{const e=await Ue.get("/"+n);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - mountedPersonalities");return}},personalityImgPlacehodler(n){n.target.src=pc}}},Oht={class:"w-fit select-none"},Iht={key:0,class:"flex -space-x-4"},Mht=["src","title"],Dht={key:1,class:"flex -space-x-4"},Lht=["src","title"],kht={key:2,title:"Loading personalities"},Pht=_("div",{role:"status"},[_("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[_("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),_("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),_("span",{class:"sr-only"},"Loading...")],-1),Uht=[Pht];function Fht(n,e,t,i,s,r){const o=_t("UniversalForm");return O(),D($e,null,[_("div",Oht,[r.mountedPersArr.length>1?(O(),D("div",Iht,[_("img",{src:s.bUrl+r.mountedPers.avatar,onError:e[0]||(e[0]=(...a)=>r.personalityImgPlacehodler&&r.personalityImgPlacehodler(...a)),class:"w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:z-20 hover:-translate-y-2 duration-150 border-secondary cursor-pointer",title:"Active personality: "+r.mountedPers.name,onClick:e[1]||(e[1]=a=>r.onSettingsPersonality(r.mountedPers))},null,40,Mht),_("div",{class:"flex items-center justify-center w-8 h-8 cursor-pointer text-xs font-medium bg-bg-light dark:bg-bg-dark border-2 hover:border-secondary rounded-full hover:bg-bg-light-tone dark:hover:bg-bg-dark-tone dark:border-gray-800 hover:z-20 hover:-translate-y-2 duration-150 active:scale-90",onClick:e[2]||(e[2]=Te((...a)=>r.toggleShowPersList&&r.toggleShowPersList(...a),["stop"])),title:"Click to show more"},"+"+he(r.mountedPersArr.length-1),1)])):j("",!0),r.mountedPersArr.length==1?(O(),D("div",Dht,[_("img",{src:s.bUrl+this.$store.state.mountedPers.avatar,onError:e[3]||(e[3]=(...a)=>r.personalityImgPlacehodler&&r.personalityImgPlacehodler(...a)),class:"w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:z-20 cursor-pointer border-secondary",title:"Active personality: "+this.$store.state.mountedPers.name,onClick:e[4]||(e[4]=Te((...a)=>r.toggleShowPersList&&r.toggleShowPersList(...a),["stop"]))},null,40,Lht)])):j("",!0),r.mountedPersArr.length==0?(O(),D("div",kht,Uht)):j("",!0)]),Ie(o,{ref:"universalForm",class:"z-20"},null,512)],64)}const Bht=gt(Nht,[["render",Fht]]);const Ght="/";Ue.defaults.baseURL="/";const Vht={props:{onTalk:Function,onMounted:Function,onUnmounted:Function,onRemounted:Function,discussionPersonalities:Array,onShowPersList:Function},components:{PersonalityEntry:ON,Toast:rc,UniversalForm:oc},name:"MountedPersonalitiesList",data(){return{bUrl:Ght,isMounted:!1,isLoading:!1}},async mounted(){await this.constructor(),this.isMounted=!0},async activated(){this.isMounted&&await this.constructor()},computed:{configFile:{get(){return this.$store.state.config},set(n){this.$store.commit("setConfig",n)}},personalities:{get(){return this.$store.state.personalities},set(n){this.$store.commit("setPersonalities",n)}},mountedPersArr:{get(){return this.$store.state.mountedPersArr},set(n){this.$store.commit("setMountedPers",n)}}},methods:{toggleShowPersList(){this.onShowPersList()},async constructor(){},async api_get_req(n){try{const e=await Ue.get("/"+n);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - mountedPersonalities");return}},personalityImgPlacehodler(n){n.target.src=pc},onPersonalityReinstall(n){console.log("on reinstall ",n),this.isLoading=!0,Ue.post("/reinstall_personality",{name:n.personality.full_path}).then(e=>{if(e)return this.isLoading=!1,console.log("reinstall_personality",e),e.data.status?this.$refs.toast.showToast("Personality reinstalled successfully!",4,!0):this.$refs.toast.showToast("Could not reinstall personality",4,!1),e.data;this.isLoading=!1}).catch(e=>(this.isLoading=!1,this.$refs.toast.showToast(`Could not reinstall personality `+e.message,4,!1),{status:!1}))},onPersonalityMounted(n){this.mountPersonality(n)},onPersonalityUnMounted(n){this.unmountPersonality(n)},onPersonalityRemount(n){this.reMountPersonality(n)},async handleOnTalk(n){if(Be.replace(),console.log("ppa",n),n){if(n.isMounted){const e=await this.select_personality(n);e&&e.status&&(await this.constructor(),this.$refs.toast.showToast(`Selected personality: `+n.name,4,!0))}else this.onPersonalityMounted(n);this.onTalk(n)}},async onPersonalitySelected(n){if(Be.replace(),console.log("Selected personality : ",JSON.stringify(n.personality)),n){if(n.selected){this.$refs.toast.showToast("Personality already selected",4,!0);return}if(n.isMounted){const e=await this.select_personality(n);e&&e.status&&(await this.constructor(),this.$refs.toast.showToast(`Selected personality: `+n.name,4,!0))}else this.onPersonalityMounted(n)}},onSettingsPersonality(n){try{Ue.get("/get_active_personality_settings").then(e=>{e&&(console.log("pers sett",e),e.data&&Object.keys(e.data).length>0?this.$refs.universalForm.showForm(e.data,"Personality settings - "+n.personality.name,"Save changes","Cancel").then(t=>{try{Ue.post("/set_active_personality_settings",t).then(i=>{i&&i.data?(console.log("personality set with new settings",i.data),this.$refs.toast.showToast("Personality settings updated successfully!",4,!0)):this.$refs.toast.showToast(`Did not get Personality settings responses. @@ -180,17 +180,17 @@ You need to apply changes before you leave, or else.`,"Apply configuration","Can Error: `+e.error,4,!1))},async reMountPersonality(n){if(console.log("remount pers",n),!n)return;if(!this.configFile.personalities.includes(n.personality.full_path)){this.$refs.toast.showToast("Personality not mounted",4,!1);return}const e=await this.remount_personality(n.personality);console.log("remount_personality res",e),e.status?(this.configFile.personalities=e.personalities,this.$refs.toast.showToast("Personality remounted",4,!0),n.isMounted=!0,this.onMounted(this),(await this.select_personality(n.personality)).status&&this.$refs.toast.showToast(`Selected personality: `+n.personality.name,4,!0),this.getMountedPersonalities()):(n.isMounted=!1,this.$refs.toast.showToast(`Could not mount personality Error: `+e.error,4,!1))},async unmountPersonality(n){if(!n)return;console.log(`Unmounting ${JSON.stringify(n.personality)}`);const e=await this.unmount_personality(n.personality);if(e.status){console.log("unmount response",e),this.configFile.active_personality_id=e.active_personality_id,this.configFile.personalities=e.personalities;const t=this.configFile.personalities[this.configFile.active_personality_id],i=this.personalities.findIndex(a=>a.full_path==t),s=this.$refs.personalitiesZoo.findIndex(a=>a.full_path==n.full_path),r=this.personalities[i];r.isMounted=!1,r.selected=!0,this.$refs.personalitiesZoo[s].isMounted=!1,this.getMountedPersonalities(),(await this.select_personality(r)).status&&Be.replace(),this.$refs.toast.showToast("Personality unmounted",4,!0),this.onUnMounted(this)}else this.$refs.toast.showToast(`Could not unmount personality -Error: `+e.error,4,!1)},getMountedPersonalities(){this.isLoading=!0;let n=[];console.log(this.configFile.personalities.length);for(let e=0;er.full_path==t),s=this.personalities[i];if(s)console.log("adding from config"),n.push(s);else{console.log("adding default");const r=this.personalities.findIndex(a=>a.full_path=="english/generic/lollms"),o=this.personalities[r];n.push(o)}}if(this.mountedPersArr=[],this.mountedPersArr=n,console.log("discussionPersonalities",this.discussionPersonalities),this.discussionPersonalities!=null&&this.discussionPersonalities.length>0)for(let e=0;es.full_path==t);if(console.log("discussionPersonalities -includes",i),console.log("discussionPersonalities -mounted list",this.mountedPersArr),i==-1){const s=this.personalities.findIndex(o=>o.full_path==t),r=this.personalities[s];console.log("adding discucc121",r,t),r&&(this.mountedPersArr.push(r),console.log("adding discucc",r))}}this.isLoading=!1,console.log("getMountedPersonalities",this.mountedPersArr),console.log("fig",this.configFile)}}},ob=n=>(lo("data-v-d16a58b9"),n=n(),co(),n),Hht={class:"text-left overflow-visible text-base font-semibold cursor-pointer select-none items-center flex flex-col flex-grow w-full overflow-x-auto scrollbar-thin scrollbar-track-bg-light scrollbar-thumb-bg-light-tone hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark dark:scrollbar-thumb-bg-dark-tone dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},qht={key:0,role:"status",class:"flex justify-center overflow-y-hidden"},Yht=ob(()=>_("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[_("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),_("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})],-1)),$ht=ob(()=>_("span",{class:"sr-only"},"Loading...",-1)),Wht=[Yht,$ht],Kht=ob(()=>_("i",{"data-feather":"chevron-down"},null,-1)),jht=[Kht],Qht={class:"block my-2 text-sm font-medium text-gray-900 dark:text-white"},Xht={class:"overflow-y-auto no-scrollbar pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4 max-h-96"};function Zht(n,e,t,i,s,r){const o=_t("personality-entry"),a=_t("Toast"),l=_t("UniversalForm");return O(),D("div",Hht,[s.isLoading?(O(),D("div",qht,Wht)):j("",!0),_("div",null,[r.mountedPersArr.length>0?(O(),D("div",{key:0,class:He(s.isLoading?"pointer-events-none opacity-30 cursor-default":"")},[_("button",{class:"mt-0 w-full text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Close personality list",type:"button",onClick:e[0]||(e[0]=Te((...c)=>r.toggleShowPersList&&r.toggleShowPersList(...c),["stop"]))},jht),_("label",Qht," Mounted Personalities: ("+he(r.mountedPersArr.length)+") ",1),_("div",Xht,[Ie(ys,{name:"bounce"},{default:ot(()=>[(O(!0),D($e,null,lt(this.$store.state.mountedPersArr,(c,d)=>(O(),Ot(o,{ref_for:!0,ref:"personalitiesZoo",key:"index-"+d+"-"+c.name,personality:c,full_path:c.full_path,select_language:!1,selected:r.configFile.personalities[r.configFile.active_personality_id]===c.full_path||r.configFile.personalities[r.configFile.active_personality_id]===c.full_path+":"+c.language,"on-selected":r.onPersonalitySelected,"on-mount":r.onPersonalityMounted,"on-un-mount":r.onPersonalityUnMounted,"on-remount":r.onPersonalityRemount,"on-settings":r.onSettingsPersonality,"on-reinstall":r.onPersonalityReinstall,"on-talk":r.handleOnTalk},null,8,["personality","full_path","selected","on-selected","on-mount","on-un-mount","on-remount","on-settings","on-reinstall","on-talk"]))),128))]),_:1})])],2)):j("",!0)]),Ie(a,{ref:"toast"},null,512),Ie(l,{ref:"universalForm",class:"z-20"},null,512)])}const Jht=gt(zht,[["render",Zht],["__scopeId","data-v-d16a58b9"]]);const eft={components:{InteractiveMenu:uc},props:{commandsList:{type:Array,required:!0},sendCommand:Function,onShowToastMessage:Function},data(){return{loading:!1,selectedFile:null,showMenu:!1,showHelpText:!1,helpText:"",commands:[]}},async mounted(){nextTick(()=>{Be.replace()})},methods:{isHTML(n){const t=new DOMParser().parseFromString(n,"text/html");return Array.from(t.body.childNodes).some(i=>i.nodeType===Node.ELEMENT_NODE)},selectFile(n,e){const t=document.createElement("input");t.type="file",t.accept=n,t.onchange=i=>{this.selectedFile=i.target.files[0],console.log("File selected"),e()},t.click()},uploadFile(){new FormData().append("file",this.selectedFile),console.log("Uploading file"),this.loading=!0;const e=new FileReader;e.onload=()=>{const t={filename:this.selectedFile.name,fileData:e.result};Ye.on("file_received",i=>{i.status?this.onShowToastMessage("File uploaded successfully",4,!0):this.onShowToastMessage(`Couldn't upload file -`+i.error,4,!1),this.loading=!1,Ye.off("file_received")}),Ye.emit("send_file",t)},e.readAsDataURL(this.selectedFile)},async constructor(){nextTick(()=>{Be.replace()})},toggleMenu(){this.showMenu=!this.showMenu},execute_cmd(n){this.showMenu=!this.showMenu,n.hasOwnProperty("is_file")?(console.log("Need to send a file."),this.selectFile(n.hasOwnProperty("file_types")?n.file_types:"*",()=>{this.selectedFile!=null&&this.uploadFile()})):this.sendCommand(n.value)},handleClickOutside(n){const e=this.$el.querySelector(".commands-menu-items-wrapper");e&&!e.contains(n.target)&&(this.showMenu=!1)}},mounted(){this.commands=this.commandsList,document.addEventListener("click",this.handleClickOutside)},beforeUnmount(){document.removeEventListener("click",this.handleClickOutside)}},tft=n=>(lo("data-v-52cfa09c"),n=n(),co(),n),nft={key:0,title:"Loading..",class:"flex flex-row flex-grow justify-end"},ift=tft(()=>_("div",{role:"status"},[_("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[_("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),_("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),_("span",{class:"sr-only"},"Loading...")],-1)),sft=[ift];function rft(n,e,t,i,s,r){const o=_t("InteractiveMenu");return s.loading?(O(),D("div",nft,sft)):(O(),Ot(o,{key:1,commands:t.commandsList,execute_cmd:r.execute_cmd},null,8,["commands","execute_cmd"]))}const oft=gt(eft,[["render",rft],["__scopeId","data-v-52cfa09c"]]);console.log("modelImgPlaceholder:",zi);const aft="/",lft={name:"ChatBox",emits:["messageSentEvent","sendCMDEvent","stopGenerating","loaded","createEmptyUserMessage","createEmptyAIMessage","personalitySelected","addWebLink"],props:{onTalk:Function,discussionList:Array,loading:!1,onShowToastMessage:Function},components:{UniversalForm:oc,MountedPersonalities:Ght,MountedPersonalitiesList:Jht,PersonalitiesCommands:oft,InteractiveMenu:uc},setup(){},data(){return{modelImgPlaceholder:zi,bUrl:aft,message:"",selecting_model:!1,selectedModel:"",isLesteningToVoice:!1,filesList:[],isFileSentList:[],totalSize:0,showfilesList:!0,showPersonalities:!1,personalities_ready:!1,models_menu_icon:""}},computed:{currentModel(){if(this.$store.state.currentModel!=null)return console.log("Model found"),this.$store.state.currentModel;{console.log("No model found");let n={};return n.name="unknown",n}},installedModels(){return this.$store.state.installedModels},model_name(){return this.$store.state.config.model_name},config(){return this.$store.state.config},mountedPers(){return this.$store.state.mountedPers},allDiscussionPersonalities(){if(this.discussionList.length>0){let n=[];for(let e=0;e{this.isLoading=!1,n&&(console.log("binding sett",n),n.data&&Object.keys(n.data).length>0?this.$refs.universalForm.showForm(n.data,"Binding settings ","Save changes","Cancel").then(e=>{try{Ue.post("/set_active_binding_settings",e).then(t=>{t&&t.data?(console.log("binding set with new settings",t.data),this.$store.state.toast.showToast("Binding settings updated successfully!",4,!0)):(this.$store.state.toast.showToast(`Did not get binding settings responses. +Error: `+e.error,4,!1)},getMountedPersonalities(){this.isLoading=!0;let n=[];console.log(this.configFile.personalities.length);for(let e=0;er.full_path==t),s=this.personalities[i];if(s)console.log("adding from config"),n.push(s);else{console.log("adding default");const r=this.personalities.findIndex(a=>a.full_path=="english/generic/lollms"),o=this.personalities[r];n.push(o)}}if(this.mountedPersArr=[],this.mountedPersArr=n,console.log("discussionPersonalities",this.discussionPersonalities),this.discussionPersonalities!=null&&this.discussionPersonalities.length>0)for(let e=0;es.full_path==t);if(console.log("discussionPersonalities -includes",i),console.log("discussionPersonalities -mounted list",this.mountedPersArr),i==-1){const s=this.personalities.findIndex(o=>o.full_path==t),r=this.personalities[s];console.log("adding discucc121",r,t),r&&(this.mountedPersArr.push(r),console.log("adding discucc",r))}}this.isLoading=!1,console.log("getMountedPersonalities",this.mountedPersArr),console.log("fig",this.configFile)}}},ob=n=>(lo("data-v-d16a58b9"),n=n(),co(),n),zht={class:"text-left overflow-visible text-base font-semibold cursor-pointer select-none items-center flex flex-col flex-grow w-full overflow-x-auto scrollbar-thin scrollbar-track-bg-light scrollbar-thumb-bg-light-tone hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark dark:scrollbar-thumb-bg-dark-tone dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},Hht={key:0,role:"status",class:"flex justify-center overflow-y-hidden"},qht=ob(()=>_("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[_("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),_("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})],-1)),Yht=ob(()=>_("span",{class:"sr-only"},"Loading...",-1)),$ht=[qht,Yht],Wht=ob(()=>_("i",{"data-feather":"chevron-down"},null,-1)),Kht=[Wht],jht={class:"block my-2 text-sm font-medium text-gray-900 dark:text-white"},Qht={class:"overflow-y-auto no-scrollbar pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4 max-h-96"};function Xht(n,e,t,i,s,r){const o=_t("personality-entry"),a=_t("Toast"),l=_t("UniversalForm");return O(),D("div",zht,[s.isLoading?(O(),D("div",Hht,$ht)):j("",!0),_("div",null,[r.mountedPersArr.length>0?(O(),D("div",{key:0,class:He(s.isLoading?"pointer-events-none opacity-30 cursor-default":"")},[_("button",{class:"mt-0 w-full text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Close personality list",type:"button",onClick:e[0]||(e[0]=Te((...c)=>r.toggleShowPersList&&r.toggleShowPersList(...c),["stop"]))},Kht),_("label",jht," Mounted Personalities: ("+he(r.mountedPersArr.length)+") ",1),_("div",Qht,[Ie(ys,{name:"bounce"},{default:ot(()=>[(O(!0),D($e,null,lt(this.$store.state.mountedPersArr,(c,d)=>(O(),Ot(o,{ref_for:!0,ref:"personalitiesZoo",key:"index-"+d+"-"+c.name,personality:c,full_path:c.full_path,select_language:!1,selected:r.configFile.personalities[r.configFile.active_personality_id]===c.full_path||r.configFile.personalities[r.configFile.active_personality_id]===c.full_path+":"+c.language,"on-selected":r.onPersonalitySelected,"on-mount":r.onPersonalityMounted,"on-un-mount":r.onPersonalityUnMounted,"on-remount":r.onPersonalityRemount,"on-settings":r.onSettingsPersonality,"on-reinstall":r.onPersonalityReinstall,"on-talk":r.handleOnTalk},null,8,["personality","full_path","selected","on-selected","on-mount","on-un-mount","on-remount","on-settings","on-reinstall","on-talk"]))),128))]),_:1})])],2)):j("",!0)]),Ie(a,{ref:"toast"},null,512),Ie(l,{ref:"universalForm",class:"z-20"},null,512)])}const Zht=gt(Vht,[["render",Xht],["__scopeId","data-v-d16a58b9"]]);const Jht={components:{InteractiveMenu:uc},props:{commandsList:{type:Array,required:!0},sendCommand:Function,onShowToastMessage:Function},data(){return{loading:!1,selectedFile:null,showMenu:!1,showHelpText:!1,helpText:"",commands:[]}},async mounted(){nextTick(()=>{Be.replace()})},methods:{isHTML(n){const t=new DOMParser().parseFromString(n,"text/html");return Array.from(t.body.childNodes).some(i=>i.nodeType===Node.ELEMENT_NODE)},selectFile(n,e){const t=document.createElement("input");t.type="file",t.accept=n,t.onchange=i=>{this.selectedFile=i.target.files[0],console.log("File selected"),e()},t.click()},uploadFile(){new FormData().append("file",this.selectedFile),console.log("Uploading file"),this.loading=!0;const e=new FileReader;e.onload=()=>{const t={filename:this.selectedFile.name,fileData:e.result};Ye.on("file_received",i=>{i.status?this.onShowToastMessage("File uploaded successfully",4,!0):this.onShowToastMessage(`Couldn't upload file +`+i.error,4,!1),this.loading=!1,Ye.off("file_received")}),Ye.emit("send_file",t)},e.readAsDataURL(this.selectedFile)},async constructor(){nextTick(()=>{Be.replace()})},toggleMenu(){this.showMenu=!this.showMenu},execute_cmd(n){this.showMenu=!this.showMenu,n.hasOwnProperty("is_file")?(console.log("Need to send a file."),this.selectFile(n.hasOwnProperty("file_types")?n.file_types:"*",()=>{this.selectedFile!=null&&this.uploadFile()})):this.sendCommand(n.value)},handleClickOutside(n){const e=this.$el.querySelector(".commands-menu-items-wrapper");e&&!e.contains(n.target)&&(this.showMenu=!1)}},mounted(){this.commands=this.commandsList,document.addEventListener("click",this.handleClickOutside)},beforeUnmount(){document.removeEventListener("click",this.handleClickOutside)}},eft=n=>(lo("data-v-52cfa09c"),n=n(),co(),n),tft={key:0,title:"Loading..",class:"flex flex-row flex-grow justify-end"},nft=eft(()=>_("div",{role:"status"},[_("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[_("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),_("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),_("span",{class:"sr-only"},"Loading...")],-1)),ift=[nft];function sft(n,e,t,i,s,r){const o=_t("InteractiveMenu");return s.loading?(O(),D("div",tft,ift)):(O(),Ot(o,{key:1,commands:t.commandsList,execute_cmd:r.execute_cmd},null,8,["commands","execute_cmd"]))}const rft=gt(Jht,[["render",sft],["__scopeId","data-v-52cfa09c"]]);console.log("modelImgPlaceholder:",zi);const oft="/",aft={name:"ChatBox",emits:["messageSentEvent","sendCMDEvent","stopGenerating","loaded","createEmptyUserMessage","createEmptyAIMessage","personalitySelected","addWebLink"],props:{onTalk:Function,discussionList:Array,loading:!1,onShowToastMessage:Function},components:{UniversalForm:oc,MountedPersonalities:Bht,MountedPersonalitiesList:Zht,PersonalitiesCommands:rft,InteractiveMenu:uc},setup(){},data(){return{modelImgPlaceholder:zi,bUrl:oft,message:"",selecting_model:!1,selectedModel:"",isLesteningToVoice:!1,filesList:[],isFileSentList:[],totalSize:0,showfilesList:!0,showPersonalities:!1,personalities_ready:!1,models_menu_icon:""}},computed:{currentModel(){if(this.$store.state.currentModel!=null)return console.log("Model found"),this.$store.state.currentModel;{console.log("No model found");let n={};return n.name="unknown",n}},installedModels(){return this.$store.state.installedModels},model_name(){return this.$store.state.config.model_name},config(){return this.$store.state.config},mountedPers(){return this.$store.state.mountedPers},allDiscussionPersonalities(){if(this.discussionList.length>0){let n=[];for(let e=0;e{this.isLoading=!1,n&&(console.log("binding sett",n),n.data&&Object.keys(n.data).length>0?this.$refs.universalForm.showForm(n.data,"Binding settings ","Save changes","Cancel").then(e=>{try{Ue.post("/set_active_binding_settings",e).then(t=>{t&&t.data?(console.log("binding set with new settings",t.data),this.$store.state.toast.showToast("Binding settings updated successfully!",4,!0)):(this.$store.state.toast.showToast(`Did not get binding settings responses. `+t,4,!1),this.isLoading=!1)})}catch(t){this.$store.state.toast.showToast(`Did not get binding settings responses. Endpoint error: `+t.message,4,!1),this.isLoading=!1}}):(this.$store.state.toast.showToast("Binding has no settings",4,!1),this.isLoading=!1))})}catch(n){this.isLoading=!1,this.$store.state.toast.showToast("Could not open binding settings. Endpoint error: "+n.message,4,!1)}},async unmountPersonality(n){if(this.loading=!0,!n)return;const e=await this.unmount_personality(n.personality||n);if(e.status){this.$store.state.config.personalities=e.personalities,this.$store.state.toast.showToast("Personality unmounted",4,!0),this.$store.dispatch("refreshMountedPersonalities");const t=this.$store.state.mountedPersArr[this.$store.state.mountedPersArr.length-1];console.log(t,this.$store.state.mountedPersArr.length),(await this.select_personality(n.personality)).status&&this.$store.state.toast.showToast(`Selected personality: `+t.name,4,!0)}else this.$store.state.toast.showToast(`Could not unmount personality Error: `+e.error,4,!1);this.loading=!1},async unmount_personality(n){if(!n)return{status:!1,error:"no personality - unmount_personality"};const e={language:n.language,category:n.category,folder:n.folder};try{const t=await Ue.post("/unmount_personality",e);if(t)return t.data}catch(t){console.log(t.message,"unmount_personality - settings");return}},async onPersonalitySelected(n){if(console.log("on pers",n),console.log("selecting ",n),n){if(n.selected){this.$store.state.toast.showToast("Personality already selected",4,!0);return}const e=n.language===null?n.full_path:n.full_path+":"+n.language;if(console.log("pers_path",e),console.log("this.$store.state.config.personalities",this.$store.state.config.personalities),this.$store.state.config.personalities.includes(e)){const t=await this.select_personality(n);console.log("pers is mounted",t),t&&t.status&&t.active_personality_id>-1?this.$store.state.toast.showToast(`Selected personality: `+n.name,4,!0):this.$store.state.toast.showToast(`Error on select personality: -`+n.name,4,!1)}else console.log("mounting pers");this.$emit("personalitySelected"),Fe(()=>{Be.replace()})}},async select_personality(n){if(!n)return{status:!1,error:"no personality - select_personality"};const e=n.language===null?n.full_path:n.full_path+":"+n.language;console.log("Selecting personality ",e);const i={id:this.$store.state.config.personalities.findIndex(s=>s===e)};try{const s=await Ue.post("/select_personality",i);if(s)return this.$store.dispatch("refreshConfig").then(()=>{this.$store.dispatch("refreshPersonalitiesZoo").then(()=>{this.$store.dispatch("refreshMountedPersonalities")})}),s.data}catch(s){console.log(s.message,"select_personality - settings");return}},emitloaded(){this.$emit("loaded")},showModels(n){n.preventDefault();const e=this.$refs.modelsSelectionList;console.log(e);const t=new MouseEvent("click");e.dispatchEvent(t)},setModel(n){console.log("Setting model to "+n.name),this.selecting_model=!0,this.selectedModel=n,Ue.post("/update_setting",{setting_name:"model_name",setting_value:n.name}).then(async e=>{console.log("UPDATED"),console.log(e),await this.$store.dispatch("refreshConfig"),await this.$store.dispatch("refreshModels"),this.$store.state.toast.showToast(`Model changed to ${this.currentModel.name}`,4,!0),this.selecting_model=!1}).catch(e=>{this.$store.state.toast.showToast(`Error ${e}`,4,!0),this.selecting_model=!1})},clear_files(){Ue.get("/clear_personality_files_list").then(n=>{console.log(n),n.data.state?(this.$store.state.toast.showToast("File uploaded successfully",4,!0),this.filesList.length=0,this.isFileSentList.length=0):this.$store.state.toast.showToast("Files couldn't be removed",4,!1)})},send_file(n,e){const t=new FileReader,i=24*1024;let s=0,r=0;t.onloadend=()=>{if(t.error){console.error("Error reading file:",t.error);return}const a=t.result,l=s+a.byteLength>=n.size;Ye.emit("send_file_chunk",{filename:n.name,chunk:a,offset:s,isLastChunk:l,chunkIndex:r}),s+=a.byteLength,r++,l?(console.log("File sent successfully"),this.isFileSentList[this.filesList.length-1]=!0,console.log(this.isFileSentList),this.$store.state.toast.showToast("File uploaded successfully",4,!0),this.loading=!1,e()):o()};function o(){const a=n.slice(s,s+i);t.readAsArrayBuffer(a)}console.log("Uploading file"),o()},makeAnEmptyUserMessage(){this.$emit("createEmptyUserMessage",this.message),this.message=""},makeAnEmptyAIMessage(){this.$emit("createEmptyAIMessage")},startSpeechRecognition(){"SpeechRecognition"in window||"webkitSpeechRecognition"in window?(this.recognition=new(window.SpeechRecognition||window.webkitSpeechRecognition),this.recognition.lang=this.$store.state.config.audio_in_language,this.recognition.interimResults=!0,this.recognition.onstart=()=>{this.isLesteningToVoice=!0,this.silenceTimer=setTimeout(()=>{this.recognition.stop()},this.silenceTimeout)},this.recognition.onresult=n=>{let e="";for(let t=n.resultIndex;t{this.recognition.stop()},this.silenceTimeout)},this.recognition.onerror=n=>{console.error("Speech recognition error:",n.error),this.isLesteningToVoice=!1,clearTimeout(this.silenceTimer)},this.recognition.onend=()=>{console.log("Speech recognition ended."),this.isLesteningToVoice=!1,clearTimeout(this.silenceTimer),this.submit()},this.recognition.start()):console.error("Speech recognition is not supported in this browser.")},onPersonalitiesReadyFun(){this.personalities_ready=!0},onShowPersListFun(n){this.showPersonalities=!this.showPersonalities},handleOnTalk(n){this.showPersonalities=!1,this.onTalk(n)},onMountFun(n){console.log("Mounting personality"),this.$refs.mountedPers.constructor()},onUnmountFun(n){console.log("Unmounting personality"),this.$refs.mountedPers.constructor()},onRemount(n){console.log("Remounting chat"),this.$refs.mountedPers.constructor()},computedFileSize(n){return Fe(()=>{Be.replace()}),Ki(n)},removeItem(n){this.filesList=this.filesList.filter(e=>e!=n)},sendMessageEvent(n){this.filesList.length=0,this.$emit("messageSentEvent",n)},sendCMDEvent(n){this.$emit("sendCMDEvent",n)},addWebLink(){console.log("Emitting addWebLink"),this.$emit("addWebLink")},takePicture(){Ye.emit("take_picture"),Ye.on("picture_taken",()=>{Ue.get("/get_current_personality_files_list").then(n=>{this.filesList=n.data.files,this.isFileSentList=n.data.files.map(e=>!0),console.log(`Files recovered: ${this.filesList}`)})})},submitOnEnter(n){this.loading||n.which===13&&(n.preventDefault(),n.repeat||(this.sendMessageEvent(this.message),this.message=""))},submit(){this.message&&(this.sendMessageEvent(this.message),this.message="")},stopGenerating(){this.$emit("stopGenerating")},addFiles(n){console.log("Adding files");const e=[...n.target.files];let t=0;const i=()=>{if(t>=e.length){console.log(`Files_list: ${this.filesList}`);return}const s=e[t];this.filesList.push(s),this.isFileSentList.push(!1),this.send_file(s,()=>{t++,i()})};i()}},watch:{installedModels:{immediate:!0,handler(n){this.$nextTick(()=>{this.installedModels=n})}},model_name:{immediate:!0,handler(n){this.$nextTick(()=>{this.model_name=n})}},showfilesList(){Fe(()=>{Be.replace()})},loading(n,e){Fe(()=>{Be.replace()})},filesList:{handler(n,e){let t=0;if(n.length>0)for(let i=0;i{Be.replace()})},activated(){Fe(()=>{Be.replace()})}},Jt=n=>(lo("data-v-6b91f51b"),n=n(),co(),n),cft={class:"absolute bottom-0 min-w-96 w-full justify-center text-center p-4"},dft={key:0,class:"flex items-center justify-center w-full"},uft={class:"flex flex-row p-2 rounded-t-lg"},pft=Jt(()=>_("label",{for:"chat",class:"sr-only"},"Send message",-1)),_ft={class:"px-3 py-3 rounded-lg bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel shadow-lg"},hft={class:"flex flex-col gap-2"},fft={class:"flex"},mft=["title"],gft=Jt(()=>_("i",{"data-feather":"list"},null,-1)),Eft=[gft],bft={key:0},Sft={class:"flex flex-col max-h-64"},vft=["title"],yft={class:"flex flex-row items-center gap-1 text-left p-2 text-sm font-medium bg-bg-dark-tone-panel dark:bg-bg-dark-tone rounded-lg hover:bg-primary dark:hover:bg-primary"},Tft={key:0,filesList:"",role:"status"},xft=Jt(()=>_("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[_("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),_("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})],-1)),Cft=Jt(()=>_("span",{class:"sr-only"},"Loading...",-1)),Rft=[xft,Cft],Aft=Jt(()=>_("div",null,[_("i",{"data-feather":"file",class:"w-5 h-5"})],-1)),wft=Jt(()=>_("div",{class:"grow"},null,-1)),Nft={class:"flex flex-row items-center"},Oft={class:"whitespace-nowrap"},Ift=["onClick"],Mft=Jt(()=>_("i",{"data-feather":"x",class:"w-5 h-5"},null,-1)),Dft=[Mft],Lft={key:1,class:"flex items-center mx-1"},kft={class:"whitespace-nowrap flex flex-row gap-2"},Pft=Jt(()=>_("p",{class:"font-bold"}," Total size: ",-1)),Uft=Jt(()=>_("div",{class:"grow"},null,-1)),Fft=Jt(()=>_("i",{"data-feather":"trash",class:"w-5 h-5"},null,-1)),Bft=[Fft],Gft={key:2,class:"mx-1"},Vft={class:"flex flex-row flex-grow items-center gap-2 overflow-visible"},zft={key:0,title:"Selecting model",class:"flex flex-row flex-grow justify-end"},Hft=Jt(()=>_("div",{role:"status"},[_("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[_("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),_("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),_("span",{class:"sr-only"},"Selecting model...")],-1)),qft=[Hft],Yft={key:1,class:"w-fit group relative"},$ft={class:"group w-full inline-flex absolute opacity-0 group-hover:opacity-100 transform group-hover:-translate-y-10 group-hover:translate-x-15 transition-all duration-300"},Wft={key:0,class:"group items-center flex flex-row"},Kft=["onClick"],jft=["src","title"],Qft={class:"group items-center flex flex-row"},Xft=["src","title"],Zft={class:"w-fit group relative"},Jft={class:"group w-full inline-flex absolute opacity-0 group-hover:opacity-100 transform group-hover:-translate-y-10 group-hover:translate-x-15 transition-all duration-300"},emt={key:0,class:"group items-center flex flex-row"},tmt=["onClick"],nmt=["src","title"],imt=["onClick"],smt=Jt(()=>_("span",{class:"hidden hover:block top-3 left-9 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2 border-transparent",title:"Unmount personality"},[_("svg",{"aria-hidden":"true",class:"w-4 h-4 text-red-600 hover:text-red-500",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[_("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})])],-1)),rmt=[smt],omt={class:"w-fit"},amt={class:"relative grow"},lmt={class:"inline-flex justify-center rounded-full"},cmt=Jt(()=>_("i",{"data-feather":"mic"},null,-1)),dmt=[cmt],umt=Jt(()=>_("i",{"data-feather":"file-plus"},null,-1)),pmt=[umt],_mt=Jt(()=>_("i",{"data-feather":"camera"},null,-1)),hmt=[_mt],fmt=Jt(()=>_("i",{"data-feather":"globe"},null,-1)),mmt=[fmt],gmt=Jt(()=>_("i",{"data-feather":"message-square"},null,-1)),Emt=Jt(()=>_("span",{class:"sr-only"},"New empty User message",-1)),bmt=[gmt,Emt],Smt=Jt(()=>_("i",{"data-feather":"message-square"},null,-1)),vmt=Jt(()=>_("span",{class:"sr-only"},"New empty message",-1)),ymt=[Smt,vmt],Tmt=Jt(()=>_("i",{"data-feather":"send"},null,-1)),xmt=Jt(()=>_("span",{class:"sr-only"},"Send message",-1)),Cmt=[Tmt,xmt],Rmt={key:4,title:"Waiting for reply"},Amt=Jt(()=>_("div",{role:"status"},[_("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[_("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),_("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),_("span",{class:"sr-only"},"Loading...")],-1)),wmt=[Amt];function Nmt(n,e,t,i,s,r){const o=_t("MountedPersonalitiesList"),a=_t("MountedPersonalities"),l=_t("PersonalitiesCommands"),c=_t("UniversalForm");return O(),D($e,null,[_("div",cft,[t.loading?(O(),D("div",dft,[_("div",uft,[_("button",{type:"button",class:"bg-red-500 dark:bg-red-800 hover:bg-red-600 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 mr-2 mb-2 dark:hover:bg-bg-dark-tone focus:outline-none dark:focus:ring-blue-800",onClick:e[0]||(e[0]=Te((...d)=>r.stopGenerating&&r.stopGenerating(...d),["stop"]))}," Stop generating ")])])):j("",!0),_("form",null,[pft,_("div",_ft,[_("div",hft,[_("div",fft,[s.filesList.length>0?(O(),D("button",{key:0,class:"mx-1 w-full text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:s.showfilesList?"Hide file list":"Show file list",type:"button",onClick:e[1]||(e[1]=Te(d=>s.showfilesList=!s.showfilesList,["stop"]))},Eft,8,mft)):j("",!0)]),s.filesList.length>0&&s.showfilesList==!0?(O(),D("div",bft,[_("div",Sft,[Ie(ys,{name:"list",tag:"div",class:"flex flex-col flex-grow overflow-y-auto scrollbar-thin scrollbar-track-bg-light scrollbar-thumb-bg-light-tone hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark dark:scrollbar-thumb-bg-dark-tone dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},{default:ot(()=>[(O(!0),D($e,null,lt(s.filesList,(d,u)=>(O(),D("div",{key:u+"-"+d.name},[_("div",{class:"m-1",title:d.name},[_("div",yft,[s.isFileSentList[u]?j("",!0):(O(),D("div",Tft,Rft)),Aft,_("div",{class:He(["line-clamp-1 w-3/5",s.isFileSentList[u]?"text-green-200":"text-red-200"])},he(d.name),3),wft,_("div",Nft,[_("p",Oft,he(r.computedFileSize(d.size)),1),_("button",{type:"button",title:"Remove item",class:"flex items-center p-0.5 text-sm rounded-sm hover:text-red-600 active:scale-75",onClick:h=>r.removeItem(d)},Dft,8,Ift)])])],8,vft)]))),128))]),_:1})])])):j("",!0),s.filesList.length>0?(O(),D("div",Lft,[_("div",kft,[Pft,je(" "+he(s.totalSize)+" ("+he(s.filesList.length)+") ",1)]),Uft,_("button",{type:"button",title:"Clear all",class:"flex items-center p-0.5 text-sm rounded-sm hover:text-red-600 active:scale-75",onClick:e[2]||(e[2]=(...d)=>r.clear_files&&r.clear_files(...d))},Bft)])):j("",!0),s.showPersonalities?(O(),D("div",Gft,[Ie(o,{ref:"mountedPersList",onShowPersList:r.onShowPersListFun,"on-mounted":r.onMountFun,"on-un-mounted":r.onUnmountFun,"on-remounted":n.onRemountFun,"on-talk":r.handleOnTalk,discussionPersonalities:r.allDiscussionPersonalities},null,8,["onShowPersList","on-mounted","on-un-mounted","on-remounted","on-talk","discussionPersonalities"])])):j("",!0),_("div",Vft,[s.selecting_model?(O(),D("div",zft,qft)):j("",!0),t.loading?j("",!0):(O(),D("div",Yft,[_("div",$ft,[(O(!0),D($e,null,lt(r.installedModels,(d,u)=>(O(),D("div",{class:"w-full",key:u+"-"+d.name,ref_for:!0,ref:"installedModels"},[d.name!=r.model_name?(O(),D("div",Wft,[_("button",{onClick:Te(h=>r.setModel(d),["prevent"]),class:"w-8 h-8"},[_("img",{src:d.icon?d.icon:s.modelImgPlaceholder,onError:e[3]||(e[3]=(...h)=>s.modelImgPlaceholder&&s.modelImgPlaceholder(...h)),class:"w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:border-secondary",title:d.name},null,40,jft)],8,Kft)])):j("",!0)]))),128))]),_("div",Qft,[_("button",{onClick:e[5]||(e[5]=Te(d=>r.showModelConfig(),["prevent"])),class:"w-8 h-8"},[_("img",{src:r.currentModel.icon?r.currentModel.icon:s.modelImgPlaceholder,onError:e[4]||(e[4]=(...d)=>s.modelImgPlaceholder&&s.modelImgPlaceholder(...d)),class:"w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:border-secondary",title:r.currentModel?r.currentModel.name:"unknown"},null,40,Xft)])])])),_("div",Zft,[_("div",Jft,[(O(!0),D($e,null,lt(this.$store.state.mountedPersArr,(d,u)=>(O(),D("div",{class:"w-full",key:u+"-"+d.name,ref_for:!0,ref:"mountedPersonalities"},[u!=this.$store.state.config.active_personality_id?(O(),D("div",emt,[_("button",{onClick:Te(h=>r.onPersonalitySelected(d),["prevent"]),class:"w-8 h-8"},[_("img",{src:s.bUrl+d.avatar,onError:e[6]||(e[6]=(...h)=>n.personalityImgPlacehodler&&n.personalityImgPlacehodler(...h)),class:He(["w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:border-secondary",this.$store.state.active_personality_id==this.$store.state.personalities.indexOf(d.full_path)?"border-secondary":"border-transparent z-0"]),title:d.name},null,42,nmt)],8,tmt),_("button",{onClick:Te(h=>r.unmountPersonality(d),["prevent"])},rmt,8,imt)])):j("",!0)]))),128))]),Ie(a,{ref:"mountedPers",onShowPersList:r.onShowPersListFun,onReady:r.onPersonalitiesReadyFun},null,8,["onShowPersList","onReady"])]),_("div",omt,[s.personalities_ready&&this.$store.state.mountedPersArr[this.$store.state.config.active_personality_id].commands!=""?(O(),Ot(l,{key:0,commandsList:this.$store.state.mountedPersArr[this.$store.state.config.active_personality_id].commands,sendCommand:r.sendCMDEvent,"on-show-toast-message":t.onShowToastMessage,ref:"personalityCMD"},null,8,["commandsList","sendCommand","on-show-toast-message"])):j("",!0)]),_("div",amt,[xe(_("textarea",{id:"chat",rows:"1","onUpdate:modelValue":e[7]||(e[7]=d=>s.message=d),title:"Hold SHIFT + ENTER to add new line",class:"inline-block no-scrollbar p-2.5 w-full text-sm text-gray-900 bg-bg-light rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-bg-dark dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Send message...",onKeydown:e[8]||(e[8]=mr(Te(d=>r.submitOnEnter(d),["exact"]),["enter"]))},`\r +`+n.name,4,!1)}else console.log("mounting pers");this.$emit("personalitySelected"),Fe(()=>{Be.replace()})}},async select_personality(n){if(!n)return{status:!1,error:"no personality - select_personality"};const e=n.language===null?n.full_path:n.full_path+":"+n.language;console.log("Selecting personality ",e);const i={id:this.$store.state.config.personalities.findIndex(s=>s===e)};try{const s=await Ue.post("/select_personality",i);if(s)return this.$store.dispatch("refreshConfig").then(()=>{this.$store.dispatch("refreshPersonalitiesZoo").then(()=>{this.$store.dispatch("refreshMountedPersonalities")})}),s.data}catch(s){console.log(s.message,"select_personality - settings");return}},emitloaded(){this.$emit("loaded")},showModels(n){n.preventDefault();const e=this.$refs.modelsSelectionList;console.log(e);const t=new MouseEvent("click");e.dispatchEvent(t)},setModel(n){console.log("Setting model to "+n.name),this.selecting_model=!0,this.selectedModel=n,Ue.post("/update_setting",{setting_name:"model_name",setting_value:n.name}).then(async e=>{console.log("UPDATED"),console.log(e),await this.$store.dispatch("refreshConfig"),await this.$store.dispatch("refreshModels"),this.$store.state.toast.showToast(`Model changed to ${this.currentModel.name}`,4,!0),this.selecting_model=!1}).catch(e=>{this.$store.state.toast.showToast(`Error ${e}`,4,!0),this.selecting_model=!1})},clear_files(){Ue.get("/clear_personality_files_list").then(n=>{console.log(n),n.data.state?(this.$store.state.toast.showToast("File uploaded successfully",4,!0),this.filesList.length=0,this.isFileSentList.length=0):this.$store.state.toast.showToast("Files couldn't be removed",4,!1)})},send_file(n,e){const t=new FileReader,i=24*1024;let s=0,r=0;t.onloadend=()=>{if(t.error){console.error("Error reading file:",t.error);return}const a=t.result,l=s+a.byteLength>=n.size;Ye.emit("send_file_chunk",{filename:n.name,chunk:a,offset:s,isLastChunk:l,chunkIndex:r}),s+=a.byteLength,r++,l?(console.log("File sent successfully"),this.isFileSentList[this.filesList.length-1]=!0,console.log(this.isFileSentList),this.$store.state.toast.showToast("File uploaded successfully",4,!0),this.loading=!1,e()):o()};function o(){const a=n.slice(s,s+i);t.readAsArrayBuffer(a)}console.log("Uploading file"),o()},makeAnEmptyUserMessage(){this.$emit("createEmptyUserMessage",this.message),this.message=""},makeAnEmptyAIMessage(){this.$emit("createEmptyAIMessage")},startSpeechRecognition(){"SpeechRecognition"in window||"webkitSpeechRecognition"in window?(this.recognition=new(window.SpeechRecognition||window.webkitSpeechRecognition),this.recognition.lang=this.$store.state.config.audio_in_language,this.recognition.interimResults=!0,this.recognition.onstart=()=>{this.isLesteningToVoice=!0,this.silenceTimer=setTimeout(()=>{this.recognition.stop()},this.silenceTimeout)},this.recognition.onresult=n=>{let e="";for(let t=n.resultIndex;t{this.recognition.stop()},this.silenceTimeout)},this.recognition.onerror=n=>{console.error("Speech recognition error:",n.error),this.isLesteningToVoice=!1,clearTimeout(this.silenceTimer)},this.recognition.onend=()=>{console.log("Speech recognition ended."),this.isLesteningToVoice=!1,clearTimeout(this.silenceTimer),this.submit()},this.recognition.start()):console.error("Speech recognition is not supported in this browser.")},onPersonalitiesReadyFun(){this.personalities_ready=!0},onShowPersListFun(n){this.showPersonalities=!this.showPersonalities},handleOnTalk(n){this.showPersonalities=!1,this.onTalk(n)},onMountFun(n){console.log("Mounting personality"),this.$refs.mountedPers.constructor()},onUnmountFun(n){console.log("Unmounting personality"),this.$refs.mountedPers.constructor()},onRemount(n){console.log("Remounting chat"),this.$refs.mountedPers.constructor()},computedFileSize(n){return Fe(()=>{Be.replace()}),Ki(n)},removeItem(n){this.filesList=this.filesList.filter(e=>e!=n)},sendMessageEvent(n){this.filesList.length=0,this.$emit("messageSentEvent",n)},sendCMDEvent(n){this.$emit("sendCMDEvent",n)},addWebLink(){console.log("Emitting addWebLink"),this.$emit("addWebLink")},takePicture(){Ye.emit("take_picture"),Ye.on("picture_taken",()=>{Ue.get("/get_current_personality_files_list").then(n=>{this.filesList=n.data.files,this.isFileSentList=n.data.files.map(e=>!0),console.log(`Files recovered: ${this.filesList}`)})})},submitOnEnter(n){this.loading||n.which===13&&(n.preventDefault(),n.repeat||(this.sendMessageEvent(this.message),this.message=""))},submit(){this.message&&(this.sendMessageEvent(this.message),this.message="")},stopGenerating(){this.$emit("stopGenerating")},addFiles(n){console.log("Adding files");const e=[...n.target.files];let t=0;const i=()=>{if(t>=e.length){console.log(`Files_list: ${this.filesList}`);return}const s=e[t];this.filesList.push(s),this.isFileSentList.push(!1),this.send_file(s,()=>{t++,i()})};i()}},watch:{installedModels:{immediate:!0,handler(n){this.$nextTick(()=>{this.installedModels=n})}},model_name:{immediate:!0,handler(n){this.$nextTick(()=>{this.model_name=n})}},showfilesList(){Fe(()=>{Be.replace()})},loading(n,e){Fe(()=>{Be.replace()})},filesList:{handler(n,e){let t=0;if(n.length>0)for(let i=0;i{Be.replace()})},activated(){Fe(()=>{Be.replace()})}},Jt=n=>(lo("data-v-6b91f51b"),n=n(),co(),n),lft={class:"absolute bottom-0 min-w-96 w-full justify-center text-center p-4"},cft={key:0,class:"flex items-center justify-center w-full"},dft={class:"flex flex-row p-2 rounded-t-lg"},uft=Jt(()=>_("label",{for:"chat",class:"sr-only"},"Send message",-1)),pft={class:"px-3 py-3 rounded-lg bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel shadow-lg"},_ft={class:"flex flex-col gap-2"},hft={class:"flex"},fft=["title"],mft=Jt(()=>_("i",{"data-feather":"list"},null,-1)),gft=[mft],Eft={key:0},bft={class:"flex flex-col max-h-64"},Sft=["title"],vft={class:"flex flex-row items-center gap-1 text-left p-2 text-sm font-medium bg-bg-dark-tone-panel dark:bg-bg-dark-tone rounded-lg hover:bg-primary dark:hover:bg-primary"},yft={key:0,filesList:"",role:"status"},Tft=Jt(()=>_("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[_("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),_("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})],-1)),xft=Jt(()=>_("span",{class:"sr-only"},"Loading...",-1)),Cft=[Tft,xft],Rft=Jt(()=>_("div",null,[_("i",{"data-feather":"file",class:"w-5 h-5"})],-1)),Aft=Jt(()=>_("div",{class:"grow"},null,-1)),wft={class:"flex flex-row items-center"},Nft={class:"whitespace-nowrap"},Oft=["onClick"],Ift=Jt(()=>_("i",{"data-feather":"x",class:"w-5 h-5"},null,-1)),Mft=[Ift],Dft={key:1,class:"flex items-center mx-1"},Lft={class:"whitespace-nowrap flex flex-row gap-2"},kft=Jt(()=>_("p",{class:"font-bold"}," Total size: ",-1)),Pft=Jt(()=>_("div",{class:"grow"},null,-1)),Uft=Jt(()=>_("i",{"data-feather":"trash",class:"w-5 h-5"},null,-1)),Fft=[Uft],Bft={key:2,class:"mx-1"},Gft={class:"flex flex-row flex-grow items-center gap-2 overflow-visible"},Vft={key:0,title:"Selecting model",class:"flex flex-row flex-grow justify-end"},zft=Jt(()=>_("div",{role:"status"},[_("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[_("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),_("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),_("span",{class:"sr-only"},"Selecting model...")],-1)),Hft=[zft],qft={key:1,class:"w-fit group relative"},Yft={class:"group w-full inline-flex absolute opacity-0 group-hover:opacity-100 transform group-hover:-translate-y-10 group-hover:translate-x-15 transition-all duration-300"},$ft={key:0,class:"group items-center flex flex-row"},Wft=["onClick"],Kft=["src","title"],jft={class:"group items-center flex flex-row"},Qft=["src","title"],Xft={class:"w-fit group relative"},Zft={class:"group w-full inline-flex absolute opacity-0 group-hover:opacity-100 transform group-hover:-translate-y-10 group-hover:translate-x-15 transition-all duration-300"},Jft={key:0,class:"group items-center flex flex-row"},emt=["onClick"],tmt=["src","title"],nmt=["onClick"],imt=Jt(()=>_("span",{class:"hidden hover:block top-3 left-9 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2 border-transparent",title:"Unmount personality"},[_("svg",{"aria-hidden":"true",class:"w-4 h-4 text-red-600 hover:text-red-500",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[_("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})])],-1)),smt=[imt],rmt={class:"w-fit"},omt={class:"relative grow"},amt={class:"inline-flex justify-center rounded-full"},lmt=Jt(()=>_("i",{"data-feather":"mic"},null,-1)),cmt=[lmt],dmt=Jt(()=>_("i",{"data-feather":"file-plus"},null,-1)),umt=[dmt],pmt=Jt(()=>_("i",{"data-feather":"camera"},null,-1)),_mt=[pmt],hmt=Jt(()=>_("i",{"data-feather":"globe"},null,-1)),fmt=[hmt],mmt=Jt(()=>_("i",{"data-feather":"message-square"},null,-1)),gmt=Jt(()=>_("span",{class:"sr-only"},"New empty User message",-1)),Emt=[mmt,gmt],bmt=Jt(()=>_("i",{"data-feather":"message-square"},null,-1)),Smt=Jt(()=>_("span",{class:"sr-only"},"New empty message",-1)),vmt=[bmt,Smt],ymt=Jt(()=>_("i",{"data-feather":"send"},null,-1)),Tmt=Jt(()=>_("span",{class:"sr-only"},"Send message",-1)),xmt=[ymt,Tmt],Cmt={key:4,title:"Waiting for reply"},Rmt=Jt(()=>_("div",{role:"status"},[_("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[_("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),_("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),_("span",{class:"sr-only"},"Loading...")],-1)),Amt=[Rmt];function wmt(n,e,t,i,s,r){const o=_t("MountedPersonalitiesList"),a=_t("MountedPersonalities"),l=_t("PersonalitiesCommands"),c=_t("UniversalForm");return O(),D($e,null,[_("div",lft,[t.loading?(O(),D("div",cft,[_("div",dft,[_("button",{type:"button",class:"bg-red-500 dark:bg-red-800 hover:bg-red-600 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 mr-2 mb-2 dark:hover:bg-bg-dark-tone focus:outline-none dark:focus:ring-blue-800",onClick:e[0]||(e[0]=Te((...d)=>r.stopGenerating&&r.stopGenerating(...d),["stop"]))}," Stop generating ")])])):j("",!0),_("form",null,[uft,_("div",pft,[_("div",_ft,[_("div",hft,[s.filesList.length>0?(O(),D("button",{key:0,class:"mx-1 w-full text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:s.showfilesList?"Hide file list":"Show file list",type:"button",onClick:e[1]||(e[1]=Te(d=>s.showfilesList=!s.showfilesList,["stop"]))},gft,8,fft)):j("",!0)]),s.filesList.length>0&&s.showfilesList==!0?(O(),D("div",Eft,[_("div",bft,[Ie(ys,{name:"list",tag:"div",class:"flex flex-col flex-grow overflow-y-auto scrollbar-thin scrollbar-track-bg-light scrollbar-thumb-bg-light-tone hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark dark:scrollbar-thumb-bg-dark-tone dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},{default:ot(()=>[(O(!0),D($e,null,lt(s.filesList,(d,u)=>(O(),D("div",{key:u+"-"+d.name},[_("div",{class:"m-1",title:d.name},[_("div",vft,[s.isFileSentList[u]?j("",!0):(O(),D("div",yft,Cft)),Rft,_("div",{class:He(["line-clamp-1 w-3/5",s.isFileSentList[u]?"text-green-200":"text-red-200"])},he(d.name),3),Aft,_("div",wft,[_("p",Nft,he(r.computedFileSize(d.size)),1),_("button",{type:"button",title:"Remove item",class:"flex items-center p-0.5 text-sm rounded-sm hover:text-red-600 active:scale-75",onClick:h=>r.removeItem(d)},Mft,8,Oft)])])],8,Sft)]))),128))]),_:1})])])):j("",!0),s.filesList.length>0?(O(),D("div",Dft,[_("div",Lft,[kft,je(" "+he(s.totalSize)+" ("+he(s.filesList.length)+") ",1)]),Pft,_("button",{type:"button",title:"Clear all",class:"flex items-center p-0.5 text-sm rounded-sm hover:text-red-600 active:scale-75",onClick:e[2]||(e[2]=(...d)=>r.clear_files&&r.clear_files(...d))},Fft)])):j("",!0),s.showPersonalities?(O(),D("div",Bft,[Ie(o,{ref:"mountedPersList",onShowPersList:r.onShowPersListFun,"on-mounted":r.onMountFun,"on-un-mounted":r.onUnmountFun,"on-remounted":n.onRemountFun,"on-talk":r.handleOnTalk,discussionPersonalities:r.allDiscussionPersonalities},null,8,["onShowPersList","on-mounted","on-un-mounted","on-remounted","on-talk","discussionPersonalities"])])):j("",!0),_("div",Gft,[s.selecting_model?(O(),D("div",Vft,Hft)):j("",!0),t.loading?j("",!0):(O(),D("div",qft,[_("div",Yft,[(O(!0),D($e,null,lt(r.installedModels,(d,u)=>(O(),D("div",{class:"w-full",key:u+"-"+d.name,ref_for:!0,ref:"installedModels"},[d.name!=r.model_name?(O(),D("div",$ft,[_("button",{onClick:Te(h=>r.setModel(d),["prevent"]),class:"w-8 h-8"},[_("img",{src:d.icon?d.icon:s.modelImgPlaceholder,onError:e[3]||(e[3]=(...h)=>s.modelImgPlaceholder&&s.modelImgPlaceholder(...h)),class:"w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:border-secondary",title:d.name},null,40,Kft)],8,Wft)])):j("",!0)]))),128))]),_("div",jft,[_("button",{onClick:e[5]||(e[5]=Te(d=>r.showModelConfig(),["prevent"])),class:"w-8 h-8"},[_("img",{src:r.currentModel.icon?r.currentModel.icon:s.modelImgPlaceholder,onError:e[4]||(e[4]=(...d)=>s.modelImgPlaceholder&&s.modelImgPlaceholder(...d)),class:"w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:border-secondary",title:r.currentModel?r.currentModel.name:"unknown"},null,40,Qft)])])])),_("div",Xft,[_("div",Zft,[(O(!0),D($e,null,lt(this.$store.state.mountedPersArr,(d,u)=>(O(),D("div",{class:"w-full",key:u+"-"+d.name,ref_for:!0,ref:"mountedPersonalities"},[u!=this.$store.state.config.active_personality_id?(O(),D("div",Jft,[_("button",{onClick:Te(h=>r.onPersonalitySelected(d),["prevent"]),class:"w-8 h-8"},[_("img",{src:s.bUrl+d.avatar,onError:e[6]||(e[6]=(...h)=>n.personalityImgPlacehodler&&n.personalityImgPlacehodler(...h)),class:He(["w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:border-secondary",this.$store.state.active_personality_id==this.$store.state.personalities.indexOf(d.full_path)?"border-secondary":"border-transparent z-0"]),title:d.name},null,42,tmt)],8,emt),_("button",{onClick:Te(h=>r.unmountPersonality(d),["prevent"])},smt,8,nmt)])):j("",!0)]))),128))]),Ie(a,{ref:"mountedPers",onShowPersList:r.onShowPersListFun,onReady:r.onPersonalitiesReadyFun},null,8,["onShowPersList","onReady"])]),_("div",rmt,[s.personalities_ready&&this.$store.state.mountedPersArr[this.$store.state.config.active_personality_id].commands!=""?(O(),Ot(l,{key:0,commandsList:this.$store.state.mountedPersArr[this.$store.state.config.active_personality_id].commands,sendCommand:r.sendCMDEvent,"on-show-toast-message":t.onShowToastMessage,ref:"personalityCMD"},null,8,["commandsList","sendCommand","on-show-toast-message"])):j("",!0)]),_("div",omt,[xe(_("textarea",{id:"chat",rows:"1","onUpdate:modelValue":e[7]||(e[7]=d=>s.message=d),title:"Hold SHIFT + ENTER to add new line",class:"inline-block no-scrollbar p-2.5 w-full text-sm text-gray-900 bg-bg-light rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-bg-dark dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Send message...",onKeydown:e[8]||(e[8]=mr(Te(d=>r.submitOnEnter(d),["exact"]),["enter"]))},`\r \r \r - `,544),[[Xe,s.message]])]),_("div",lmt,[t.loading?j("",!0):(O(),D("button",{key:0,type:"button",onClick:e[9]||(e[9]=(...d)=>r.startSpeechRecognition&&r.startSpeechRecognition(...d)),title:"Press and talk",class:He([{"text-red-500":s.isLesteningToVoice},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer"])},dmt,2)),_("input",{type:"file",ref:"fileDialog",style:{display:"none"},onChange:e[10]||(e[10]=(...d)=>r.addFiles&&r.addFiles(...d)),multiple:""},null,544),_("button",{type:"button",onClick:e[11]||(e[11]=Te(d=>n.$refs.fileDialog.click(),["stop"])),title:"Add files",class:"m-1 w-6 hover:text-secondary duration-75 active:scale-90"},pmt),_("button",{type:"button",onClick:e[12]||(e[12]=Te((...d)=>r.takePicture&&r.takePicture(...d),["stop"])),title:"take a shot from camera",class:"m-1 w-6 hover:text-secondary duration-75 active:scale-90"},hmt),_("button",{type:"button",onClick:e[13]||(e[13]=Te((...d)=>r.addWebLink&&r.addWebLink(...d),["stop"])),title:"add web link",class:"m-1 w-6 hover:text-secondary duration-75 active:scale-90"},mmt),t.loading?j("",!0):(O(),D("button",{key:1,type:"button",onClick:e[14]||(e[14]=(...d)=>r.makeAnEmptyUserMessage&&r.makeAnEmptyUserMessage(...d)),title:"New empty user message",class:"w-6 text-blue-400 hover:text-secondary duration-75 active:scale-90"},bmt)),t.loading?j("",!0):(O(),D("button",{key:2,type:"button",onClick:e[15]||(e[15]=(...d)=>r.makeAnEmptyAIMessage&&r.makeAnEmptyAIMessage(...d)),title:"New empty ai message",class:"w-6 text-red-400 hover:text-secondary duration-75 active:scale-90"},ymt)),t.loading?j("",!0):(O(),D("button",{key:3,type:"button",onClick:e[16]||(e[16]=(...d)=>r.submit&&r.submit(...d)),title:"Send",class:"w-6 hover:text-secondary duration-75 active:scale-90"},Cmt)),t.loading?(O(),D("div",Rmt,wmt)):j("",!0)])])])])])]),Ie(c,{ref:"universalForm",class:"z-20"},null,512)],64)}const LN=gt(lft,[["render",Nmt],["__scopeId","data-v-6b91f51b"]]),Omt={name:"WelcomeComponent",setup(){return{}}},Imt={class:"flex flex-col text-center"},Mmt=Ru('
Logo

Lord of Large Language and Multimodal Systems

One tool to rule them all


Welcome

Please create a new discussion or select existing one to start

',1),Dmt=[Mmt];function Lmt(n,e,t,i,s,r){return O(),D("div",Imt,Dmt)}const kN=gt(Omt,[["render",Lmt]]);var kmt=function(){function n(e,t){t===void 0&&(t=[]),this._eventType=e,this._eventFunctions=t}return n.prototype.init=function(){var e=this;this._eventFunctions.forEach(function(t){typeof window<"u"&&window.addEventListener(e._eventType,t)})},n}(),$d=globalThis&&globalThis.__assign||function(){return $d=Object.assign||function(n){for(var e,t=1,i=arguments.length;t"u")return!1;var e=ni(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function Kmt(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},s=e.attributes[t]||{},r=e.elements[t];!gi(r)||!Zi(r)||(Object.assign(r.style,i),Object.keys(s).forEach(function(o){var a=s[o];a===!1?r.removeAttribute(o):r.setAttribute(o,a===!0?"":a)}))})}function jmt(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(i){var s=e.elements[i],r=e.attributes[i]||{},o=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:t[i]),a=o.reduce(function(l,c){return l[c]="",l},{});!gi(s)||!Zi(s)||(Object.assign(s.style,a),Object.keys(r).forEach(function(l){s.removeAttribute(l)}))})}}const Qmt={name:"applyStyles",enabled:!0,phase:"write",fn:Kmt,effect:jmt,requires:["computeStyles"]};function ji(n){return n.split("-")[0]}var Kr=Math.max,Qd=Math.min,_a=Math.round;function Lg(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function zN(){return!/^((?!chrome|android).)*safari/i.test(Lg())}function ha(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var i=n.getBoundingClientRect(),s=1,r=1;e&&gi(n)&&(s=n.offsetWidth>0&&_a(i.width)/n.offsetWidth||1,r=n.offsetHeight>0&&_a(i.height)/n.offsetHeight||1);var o=no(n)?ni(n):window,a=o.visualViewport,l=!zN()&&t,c=(i.left+(l&&a?a.offsetLeft:0))/s,d=(i.top+(l&&a?a.offsetTop:0))/r,u=i.width/s,h=i.height/r;return{width:u,height:h,top:d,right:c+u,bottom:d+h,left:c,x:c,y:d}}function _b(n){var e=ha(n),t=n.offsetWidth,i=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:i}}function HN(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&pb(t)){var i=e;do{if(i&&n.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Ns(n){return ni(n).getComputedStyle(n)}function Xmt(n){return["table","td","th"].indexOf(Zi(n))>=0}function Er(n){return((no(n)?n.ownerDocument:n.document)||window.document).documentElement}function Wu(n){return Zi(n)==="html"?n:n.assignedSlot||n.parentNode||(pb(n)?n.host:null)||Er(n)}function oC(n){return!gi(n)||Ns(n).position==="fixed"?null:n.offsetParent}function Zmt(n){var e=/firefox/i.test(Lg()),t=/Trident/i.test(Lg());if(t&&gi(n)){var i=Ns(n);if(i.position==="fixed")return null}var s=Wu(n);for(pb(s)&&(s=s.host);gi(s)&&["html","body"].indexOf(Zi(s))<0;){var r=Ns(s);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||e&&r.willChange==="filter"||e&&r.filter&&r.filter!=="none")return s;s=s.parentNode}return null}function hc(n){for(var e=ni(n),t=oC(n);t&&Xmt(t)&&Ns(t).position==="static";)t=oC(t);return t&&(Zi(t)==="html"||Zi(t)==="body"&&Ns(t).position==="static")?e:t||Zmt(n)||e}function hb(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function Cl(n,e,t){return Kr(n,Qd(e,t))}function Jmt(n,e,t){var i=Cl(n,e,t);return i>t?t:i}function qN(){return{top:0,right:0,bottom:0,left:0}}function YN(n){return Object.assign({},qN(),n)}function $N(n,e){return e.reduce(function(t,i){return t[i]=n,t},{})}var egt=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,YN(typeof e!="number"?e:$N(e,_c))};function tgt(n){var e,t=n.state,i=n.name,s=n.options,r=t.elements.arrow,o=t.modifiersData.popperOffsets,a=ji(t.placement),l=hb(a),c=[$n,Si].indexOf(a)>=0,d=c?"height":"width";if(!(!r||!o)){var u=egt(s.padding,t),h=_b(r),m=l==="y"?Yn:$n,f=l==="y"?bi:Si,b=t.rects.reference[d]+t.rects.reference[l]-o[l]-t.rects.popper[d],E=o[l]-t.rects.reference[l],g=hc(r),S=g?l==="y"?g.clientHeight||0:g.clientWidth||0:0,y=b/2-E/2,T=u[m],C=S-h[d]-u[f],x=S/2-h[d]/2+y,w=Cl(T,x,C),R=l;t.modifiersData[i]=(e={},e[R]=w,e.centerOffset=w-x,e)}}function ngt(n){var e=n.state,t=n.options,i=t.element,s=i===void 0?"[data-popper-arrow]":i;s!=null&&(typeof s=="string"&&(s=e.elements.popper.querySelector(s),!s)||HN(e.elements.popper,s)&&(e.elements.arrow=s))}const igt={name:"arrow",enabled:!0,phase:"main",fn:tgt,effect:ngt,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function fa(n){return n.split("-")[1]}var sgt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function rgt(n,e){var t=n.x,i=n.y,s=e.devicePixelRatio||1;return{x:_a(t*s)/s||0,y:_a(i*s)/s||0}}function aC(n){var e,t=n.popper,i=n.popperRect,s=n.placement,r=n.variation,o=n.offsets,a=n.position,l=n.gpuAcceleration,c=n.adaptive,d=n.roundOffsets,u=n.isFixed,h=o.x,m=h===void 0?0:h,f=o.y,b=f===void 0?0:f,E=typeof d=="function"?d({x:m,y:b}):{x:m,y:b};m=E.x,b=E.y;var g=o.hasOwnProperty("x"),S=o.hasOwnProperty("y"),y=$n,T=Yn,C=window;if(c){var x=hc(t),w="clientHeight",R="clientWidth";if(x===ni(t)&&(x=Er(t),Ns(x).position!=="static"&&a==="absolute"&&(w="scrollHeight",R="scrollWidth")),x=x,s===Yn||(s===$n||s===Si)&&r===Kl){T=bi;var v=u&&x===C&&C.visualViewport?C.visualViewport.height:x[w];b-=v-i.height,b*=l?1:-1}if(s===$n||(s===Yn||s===bi)&&r===Kl){y=Si;var A=u&&x===C&&C.visualViewport?C.visualViewport.width:x[R];m-=A-i.width,m*=l?1:-1}}var P=Object.assign({position:a},c&&sgt),U=d===!0?rgt({x:m,y:b},ni(t)):{x:m,y:b};if(m=U.x,b=U.y,l){var Y;return Object.assign({},P,(Y={},Y[T]=S?"0":"",Y[y]=g?"0":"",Y.transform=(C.devicePixelRatio||1)<=1?"translate("+m+"px, "+b+"px)":"translate3d("+m+"px, "+b+"px, 0)",Y))}return Object.assign({},P,(e={},e[T]=S?b+"px":"",e[y]=g?m+"px":"",e.transform="",e))}function ogt(n){var e=n.state,t=n.options,i=t.gpuAcceleration,s=i===void 0?!0:i,r=t.adaptive,o=r===void 0?!0:r,a=t.roundOffsets,l=a===void 0?!0:a,c={placement:ji(e.placement),variation:fa(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,aC(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,aC(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const agt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:ogt,data:{}};var Lc={passive:!0};function lgt(n){var e=n.state,t=n.instance,i=n.options,s=i.scroll,r=s===void 0?!0:s,o=i.resize,a=o===void 0?!0:o,l=ni(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&c.forEach(function(d){d.addEventListener("scroll",t.update,Lc)}),a&&l.addEventListener("resize",t.update,Lc),function(){r&&c.forEach(function(d){d.removeEventListener("scroll",t.update,Lc)}),a&&l.removeEventListener("resize",t.update,Lc)}}const cgt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:lgt,data:{}};var dgt={left:"right",right:"left",bottom:"top",top:"bottom"};function Ad(n){return n.replace(/left|right|bottom|top/g,function(e){return dgt[e]})}var ugt={start:"end",end:"start"};function lC(n){return n.replace(/start|end/g,function(e){return ugt[e]})}function fb(n){var e=ni(n),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function mb(n){return ha(Er(n)).left+fb(n).scrollLeft}function pgt(n,e){var t=ni(n),i=Er(n),s=t.visualViewport,r=i.clientWidth,o=i.clientHeight,a=0,l=0;if(s){r=s.width,o=s.height;var c=zN();(c||!c&&e==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:r,height:o,x:a+mb(n),y:l}}function _gt(n){var e,t=Er(n),i=fb(n),s=(e=n.ownerDocument)==null?void 0:e.body,r=Kr(t.scrollWidth,t.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=Kr(t.scrollHeight,t.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-i.scrollLeft+mb(n),l=-i.scrollTop;return Ns(s||t).direction==="rtl"&&(a+=Kr(t.clientWidth,s?s.clientWidth:0)-r),{width:r,height:o,x:a,y:l}}function gb(n){var e=Ns(n),t=e.overflow,i=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+s+i)}function WN(n){return["html","body","#document"].indexOf(Zi(n))>=0?n.ownerDocument.body:gi(n)&&gb(n)?n:WN(Wu(n))}function Rl(n,e){var t;e===void 0&&(e=[]);var i=WN(n),s=i===((t=n.ownerDocument)==null?void 0:t.body),r=ni(i),o=s?[r].concat(r.visualViewport||[],gb(i)?i:[]):i,a=e.concat(o);return s?a:a.concat(Rl(Wu(o)))}function kg(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function hgt(n,e){var t=ha(n,!1,e==="fixed");return t.top=t.top+n.clientTop,t.left=t.left+n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top,t}function cC(n,e,t){return e===GN?kg(pgt(n,t)):no(e)?hgt(e,t):kg(_gt(Er(n)))}function fgt(n){var e=Rl(Wu(n)),t=["absolute","fixed"].indexOf(Ns(n).position)>=0,i=t&&gi(n)?hc(n):n;return no(i)?e.filter(function(s){return no(s)&&HN(s,i)&&Zi(s)!=="body"}):[]}function mgt(n,e,t,i){var s=e==="clippingParents"?fgt(n):[].concat(e),r=[].concat(s,[t]),o=r[0],a=r.reduce(function(l,c){var d=cC(n,c,i);return l.top=Kr(d.top,l.top),l.right=Qd(d.right,l.right),l.bottom=Qd(d.bottom,l.bottom),l.left=Kr(d.left,l.left),l},cC(n,o,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function KN(n){var e=n.reference,t=n.element,i=n.placement,s=i?ji(i):null,r=i?fa(i):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,l;switch(s){case Yn:l={x:o,y:e.y-t.height};break;case bi:l={x:o,y:e.y+e.height};break;case Si:l={x:e.x+e.width,y:a};break;case $n:l={x:e.x-t.width,y:a};break;default:l={x:e.x,y:e.y}}var c=s?hb(s):null;if(c!=null){var d=c==="y"?"height":"width";switch(r){case pa:l[c]=l[c]-(e[d]/2-t[d]/2);break;case Kl:l[c]=l[c]+(e[d]/2-t[d]/2);break}}return l}function jl(n,e){e===void 0&&(e={});var t=e,i=t.placement,s=i===void 0?n.placement:i,r=t.strategy,o=r===void 0?n.strategy:r,a=t.boundary,l=a===void 0?Pmt:a,c=t.rootBoundary,d=c===void 0?GN:c,u=t.elementContext,h=u===void 0?rl:u,m=t.altBoundary,f=m===void 0?!1:m,b=t.padding,E=b===void 0?0:b,g=YN(typeof E!="number"?E:$N(E,_c)),S=h===rl?Umt:rl,y=n.rects.popper,T=n.elements[f?S:h],C=mgt(no(T)?T:T.contextElement||Er(n.elements.popper),l,d,o),x=ha(n.elements.reference),w=KN({reference:x,element:y,strategy:"absolute",placement:s}),R=kg(Object.assign({},y,w)),v=h===rl?R:x,A={top:C.top-v.top+g.top,bottom:v.bottom-C.bottom+g.bottom,left:C.left-v.left+g.left,right:v.right-C.right+g.right},P=n.modifiersData.offset;if(h===rl&&P){var U=P[s];Object.keys(A).forEach(function(Y){var L=[Si,bi].indexOf(Y)>=0?1:-1,H=[Yn,bi].indexOf(Y)>=0?"y":"x";A[Y]+=U[H]*L})}return A}function ggt(n,e){e===void 0&&(e={});var t=e,i=t.placement,s=t.boundary,r=t.rootBoundary,o=t.padding,a=t.flipVariations,l=t.allowedAutoPlacements,c=l===void 0?VN:l,d=fa(i),u=d?a?rC:rC.filter(function(f){return fa(f)===d}):_c,h=u.filter(function(f){return c.indexOf(f)>=0});h.length===0&&(h=u);var m=h.reduce(function(f,b){return f[b]=jl(n,{placement:b,boundary:s,rootBoundary:r,padding:o})[ji(b)],f},{});return Object.keys(m).sort(function(f,b){return m[f]-m[b]})}function Egt(n){if(ji(n)===ub)return[];var e=Ad(n);return[lC(n),e,lC(e)]}function bgt(n){var e=n.state,t=n.options,i=n.name;if(!e.modifiersData[i]._skip){for(var s=t.mainAxis,r=s===void 0?!0:s,o=t.altAxis,a=o===void 0?!0:o,l=t.fallbackPlacements,c=t.padding,d=t.boundary,u=t.rootBoundary,h=t.altBoundary,m=t.flipVariations,f=m===void 0?!0:m,b=t.allowedAutoPlacements,E=e.options.placement,g=ji(E),S=g===E,y=l||(S||!f?[Ad(E)]:Egt(E)),T=[E].concat(y).reduce(function(_e,me){return _e.concat(ji(me)===ub?ggt(e,{placement:me,boundary:d,rootBoundary:u,padding:c,flipVariations:f,allowedAutoPlacements:b}):me)},[]),C=e.rects.reference,x=e.rects.popper,w=new Map,R=!0,v=T[0],A=0;A=0,H=L?"width":"height",B=jl(e,{placement:P,boundary:d,rootBoundary:u,altBoundary:h,padding:c}),k=L?Y?Si:$n:Y?bi:Yn;C[H]>x[H]&&(k=Ad(k));var $=Ad(k),K=[];if(r&&K.push(B[U]<=0),a&&K.push(B[k]<=0,B[$]<=0),K.every(function(_e){return _e})){v=P,R=!1;break}w.set(P,K)}if(R)for(var W=f?3:1,le=function(me){var Ce=T.find(function(X){var ue=w.get(X);if(ue)return ue.slice(0,me).every(function(Z){return Z})});if(Ce)return v=Ce,"break"},J=W;J>0;J--){var ee=le(J);if(ee==="break")break}e.placement!==v&&(e.modifiersData[i]._skip=!0,e.placement=v,e.reset=!0)}}const Sgt={name:"flip",enabled:!0,phase:"main",fn:bgt,requiresIfExists:["offset"],data:{_skip:!1}};function dC(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function uC(n){return[Yn,Si,bi,$n].some(function(e){return n[e]>=0})}function vgt(n){var e=n.state,t=n.name,i=e.rects.reference,s=e.rects.popper,r=e.modifiersData.preventOverflow,o=jl(e,{elementContext:"reference"}),a=jl(e,{altBoundary:!0}),l=dC(o,i),c=dC(a,s,r),d=uC(l),u=uC(c);e.modifiersData[t]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}const ygt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:vgt};function Tgt(n,e,t){var i=ji(n),s=[$n,Yn].indexOf(i)>=0?-1:1,r=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,o=r[0],a=r[1];return o=o||0,a=(a||0)*s,[$n,Si].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}function xgt(n){var e=n.state,t=n.options,i=n.name,s=t.offset,r=s===void 0?[0,0]:s,o=VN.reduce(function(d,u){return d[u]=Tgt(u,e.rects,r),d},{}),a=o[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[i]=o}const Cgt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:xgt};function Rgt(n){var e=n.state,t=n.name;e.modifiersData[t]=KN({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const Agt={name:"popperOffsets",enabled:!0,phase:"read",fn:Rgt,data:{}};function wgt(n){return n==="x"?"y":"x"}function Ngt(n){var e=n.state,t=n.options,i=n.name,s=t.mainAxis,r=s===void 0?!0:s,o=t.altAxis,a=o===void 0?!1:o,l=t.boundary,c=t.rootBoundary,d=t.altBoundary,u=t.padding,h=t.tether,m=h===void 0?!0:h,f=t.tetherOffset,b=f===void 0?0:f,E=jl(e,{boundary:l,rootBoundary:c,padding:u,altBoundary:d}),g=ji(e.placement),S=fa(e.placement),y=!S,T=hb(g),C=wgt(T),x=e.modifiersData.popperOffsets,w=e.rects.reference,R=e.rects.popper,v=typeof b=="function"?b(Object.assign({},e.rects,{placement:e.placement})):b,A=typeof v=="number"?{mainAxis:v,altAxis:v}:Object.assign({mainAxis:0,altAxis:0},v),P=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,U={x:0,y:0};if(x){if(r){var Y,L=T==="y"?Yn:$n,H=T==="y"?bi:Si,B=T==="y"?"height":"width",k=x[T],$=k+E[L],K=k-E[H],W=m?-R[B]/2:0,le=S===pa?w[B]:R[B],J=S===pa?-R[B]:-w[B],ee=e.elements.arrow,_e=m&&ee?_b(ee):{width:0,height:0},me=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:qN(),Ce=me[L],X=me[H],ue=Cl(0,w[B],_e[B]),Z=y?w[B]/2-W-ue-Ce-A.mainAxis:le-ue-Ce-A.mainAxis,ge=y?-w[B]/2+W+ue+X+A.mainAxis:J+ue+X+A.mainAxis,Oe=e.elements.arrow&&hc(e.elements.arrow),M=Oe?T==="y"?Oe.clientTop||0:Oe.clientLeft||0:0,G=(Y=P==null?void 0:P[T])!=null?Y:0,q=k+Z-G-M,oe=k+ge-G,ne=Cl(m?Qd($,q):$,k,m?Kr(K,oe):K);x[T]=ne,U[T]=ne-k}if(a){var ve,we=T==="x"?Yn:$n,V=T==="x"?bi:Si,ce=x[C],ie=C==="y"?"height":"width",re=ce+E[we],I=ce-E[V],N=[Yn,$n].indexOf(g)!==-1,z=(ve=P==null?void 0:P[C])!=null?ve:0,de=N?re:ce-w[ie]-R[ie]-z+A.altAxis,Q=N?ce+w[ie]+R[ie]-z-A.altAxis:I,te=m&&N?Jmt(de,ce,Q):Cl(m?de:re,ce,m?Q:I);x[C]=te,U[C]=te-ce}e.modifiersData[i]=U}}const Ogt={name:"preventOverflow",enabled:!0,phase:"main",fn:Ngt,requiresIfExists:["offset"]};function Igt(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function Mgt(n){return n===ni(n)||!gi(n)?fb(n):Igt(n)}function Dgt(n){var e=n.getBoundingClientRect(),t=_a(e.width)/n.offsetWidth||1,i=_a(e.height)/n.offsetHeight||1;return t!==1||i!==1}function Lgt(n,e,t){t===void 0&&(t=!1);var i=gi(e),s=gi(e)&&Dgt(e),r=Er(e),o=ha(n,s,t),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!t)&&((Zi(e)!=="body"||gb(r))&&(a=Mgt(e)),gi(e)?(l=ha(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):r&&(l.x=mb(r))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function kgt(n){var e=new Map,t=new Set,i=[];n.forEach(function(r){e.set(r.name,r)});function s(r){t.add(r.name);var o=[].concat(r.requires||[],r.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var l=e.get(a);l&&s(l)}}),i.push(r)}return n.forEach(function(r){t.has(r.name)||s(r)}),i}function Pgt(n){var e=kgt(n);return Wmt.reduce(function(t,i){return t.concat(e.filter(function(s){return s.phase===i}))},[])}function Ugt(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function Fgt(n){var e=n.reduce(function(t,i){var s=t[i.name];return t[i.name]=s?Object.assign({},s,i,{options:Object.assign({},s.options,i.options),data:Object.assign({},s.data,i.data)}):i,t},{});return Object.keys(e).map(function(t){return e[t]})}var pC={placement:"bottom",modifiers:[],strategy:"absolute"};function _C(){for(var n=arguments.length,e=new Array(n),t=0;t(lo("data-v-7a271009"),n=n(),co(),n),Ygt={key:0,class:"fixed top-0 left-0 w-screen h-screen flex items-center justify-center"},$gt={class:"flex flex-col text-center"},Wgt={class:"flex flex-col text-center items-center"},Kgt={class:"flex items-center gap-3 text-5xl drop-shadow-md align-middle pt-24"},jgt=Bt(()=>_("img",{class:"w-24 animate-bounce",title:"LoLLMS WebUI",src:ca,alt:"Logo"},null,-1)),Qgt={class:"flex flex-col items-start"},Xgt={class:"text-2xl"},Zgt=Bt(()=>_("p",{class:"text-gray-400 text-base"},"One tool to rule them all",-1)),Jgt=Bt(()=>_("p",{class:"text-gray-400 text-base"},"by ParisNeo",-1)),eEt=Bt(()=>_("hr",{class:"mt-1 w-96 h-1 mx-auto my-2 md:my-2 dark:bg-bg-dark-tone-panel bg-bg-light-tone-panel border-0 rounded"},null,-1)),tEt=Bt(()=>_("p",{class:"text-2xl mb-10"},"Welcome",-1)),nEt={role:"status",class:"text-center w-full display: flex; flex-row align-items: center;"},iEt={class:"text-2xl animate-pulse mt-2"},sEt=Bt(()=>_("i",{"data-feather":"chevron-right"},null,-1)),rEt=[sEt],oEt=Bt(()=>_("i",{"data-feather":"chevron-left"},null,-1)),aEt=[oEt],lEt={key:0,class:"relative flex flex-col no-scrollbar shadow-lg min-w-[24rem] max-w-[24rem] bg-bg-light-tone dark:bg-bg-dark-tone"},cEt={class:"sticky z-10 top-0 bg-bg-light-tone dark:bg-bg-dark-tone shadow-md"},dEt={class:"flex-row p-4 flex items-center gap-3 flex-0"},uEt=Bt(()=>_("i",{"data-feather":"plus"},null,-1)),pEt=[uEt],_Et=Bt(()=>_("i",{"data-feather":"check-square"},null,-1)),hEt=[_Et],fEt=Bt(()=>_("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Reset database, remove all discussions"},[_("i",{"data-feather":"refresh-ccw"})],-1)),mEt=Bt(()=>_("i",{"data-feather":"database"},null,-1)),gEt=[mEt],EEt=Bt(()=>_("i",{"data-feather":"log-in"},null,-1)),bEt=[EEt],SEt={key:0,class:"dropdown"},vEt=Bt(()=>_("i",{"data-feather":"search"},null,-1)),yEt=[vEt],TEt=Bt(()=>_("i",{"data-feather":"save"},null,-1)),xEt=[TEt],CEt={key:2,class:"flex gap-3 flex-1 items-center duration-75"},REt=Bt(()=>_("i",{"data-feather":"x"},null,-1)),AEt=[REt],wEt=Bt(()=>_("i",{"data-feather":"check"},null,-1)),NEt=[wEt],OEt=["src"],IEt=["src"],MEt=["src"],DEt={key:4,title:"Loading..",class:"flex flex-row flex-grow justify-end"},LEt=Bt(()=>_("div",{role:"status"},[_("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[_("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),_("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),_("span",{class:"sr-only"},"Loading...")],-1)),kEt=[LEt],PEt={key:0,class:"flex-row items-center gap-3 flex-0 w-full"},UEt={class:"p-4 pt-2"},FEt={class:"relative"},BEt=Bt(()=>_("div",{class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},[_("div",{class:"scale-75"},[_("i",{"data-feather":"search"})])],-1)),GEt={class:"absolute inset-y-0 right-0 flex items-center pr-3"},VEt=Bt(()=>_("i",{"data-feather":"x"},null,-1)),zEt=[VEt],HEt={key:1,class:"h-px bg-bg-light p-0 mb-4 px-4 mx-4 border-0 dark:bg-bg-dark"},qEt={key:2,class:"flex flex-row flex-grow p-4 pt-0 items-center"},YEt={class:"flex flex-row flex-grow"},$Et={key:0},WEt={class:"flex flex-row"},KEt={key:0,class:"flex gap-3"},jEt=Bt(()=>_("i",{"data-feather":"trash"},null,-1)),QEt=[jEt],XEt={key:1,class:"flex gap-3 mx-3 flex-1 items-center justify-end group-hover:visible duration-75"},ZEt=Bt(()=>_("i",{"data-feather":"check"},null,-1)),JEt=[ZEt],ebt=Bt(()=>_("i",{"data-feather":"x"},null,-1)),tbt=[ebt],nbt={class:"flex gap-3"},ibt=Bt(()=>_("i",{"data-feather":"log-out"},null,-1)),sbt=[ibt],rbt=Bt(()=>_("i",{"data-feather":"bookmark"},null,-1)),obt=[rbt],abt=Bt(()=>_("i",{"data-feather":"list"},null,-1)),lbt=[abt],cbt={class:"relative flex flex-row flex-grow mb-10 z-0 w-full"},dbt={key:1,class:"gap-2 py-2 my-2 hover:shadow-md hover:bg-primary-light dark:hover:bg-primary rounded-md p-2 duration-75 group cursor-pointer"},ubt=Bt(()=>_("p",{class:"px-3"},"No discussions are found",-1)),pbt=[ubt],_bt=Bt(()=>_("div",{class:"sticky bottom-0 bg-gradient-to-t pointer-events-none from-bg-light-tone dark:from-bg-dark-tone flex flex-grow"},null,-1)),hbt={class:"ml-2"},fbt={key:1,class:"relative flex flex-col flex-grow w-full"},mbt={class:"container pt-4 pb-50 mb-50 w-full"},gbt=Bt(()=>_("div",null,[_("br"),_("br"),_("br"),_("br"),_("br"),_("br"),_("br")],-1)),Ebt=Bt(()=>_("div",{class:"absolute w-full bottom-0 bg-transparent p-10 pt-16 bg-gradient-to-t from-bg-light dark:from-bg-dark from-5% via-bg-light dark:via-bg-dark via-10% to-transparent to-100%"},null,-1)),bbt={key:0,class:"bottom-0 flex flex-row items-center justify-center"},Sbt={role:"status",class:"fixed m-0 p-2 left-2 bottom-2 min-w-[24rem] max-w-[24rem] h-20 flex flex-col justify-center items-center pb-4 bg-blue-500 rounded-lg shadow-lg z-50 background-a"},vbt={class:"text-2xl animate-pulse mt-2 text-white"},ybt={setup(){},data(){return{host:"",progress_visibility_val:!0,progress_value:0,msgTypes:{MSG_TYPE_CHUNK:0,MSG_TYPE_FULL:1,MSG_TYPE_FULL_INVISIBLE_TO_AI:2,MSG_TYPE_FULL_INVISIBLE_TO_USER:3,MSG_TYPE_EXCEPTION:4,MSG_TYPE_WARNING:5,MSG_TYPE_INFO:6,MSG_TYPE_STEP:7,MSG_TYPE_STEP_START:8,MSG_TYPE_STEP_PROGRESS:9,MSG_TYPE_STEP_END:10,MSG_TYPE_JSON_INFOS:11,MSG_TYPE_REF:12,MSG_TYPE_CODE:13,MSG_TYPE_UI:14,MSG_TYPE_NEW_MESSAGE:15,MSG_TYPE_FINISHED_MESSAGE:17},senderTypes:{SENDER_TYPES_USER:0,SENDER_TYPES_AI:1,SENDER_TYPES_SYSTEM:2},list:[],tempList:[],currentDiscussion:{},discussionArr:[],loading:!1,filterTitle:"",filterInProgress:!1,isCreated:!1,isCheckbox:!1,isSelectAll:!1,showSaveConfirmation:!1,showBrainConfirmation:!1,showConfirmation:!1,chime:new Audio("chime_aud.wav"),showToast:!1,isSearch:!1,isDiscussionBottom:!1,personalityAvatars:[],fileList:[],database_selectorDialogVisible:!1,isDragOverDiscussion:!1,isDragOverChat:!1,panelCollapsed:!1,isOpen:!1,discussion_id:0}},methods:{add_webpage(){console.log("addWebLink received"),this.$refs.web_url_input_box.showPanel()},handleOk(){console.log("OK"),Ye.on("web_page_added",()=>{Ue.get("/get_current_personality_files_list").then(n=>{this.filesList=n.data.files,console.log("this.filesList",this.filesList),this.isFileSentList=n.data.files.map(e=>!0),console.log(`Files recovered: ${this.filesList}`)})}),Ye.emit("add_webpage",{url:this.$refs.web_url_input_box.inputText})},show_progress(n){this.progress_visibility_val=!0},hide_progress(n){this.progress_visibility_val=!1},update_progress(n){console.log("Progress update"),this.progress_value=n.value},onSettingsBinding(){try{this.isLoading=!0,Ue.get("/get_active_binding_settings").then(n=>{this.isLoading=!1,n&&(n.data&&Object.keys(n.data).length>0?this.$store.state.universalForm.showForm(n.data,"Binding settings - "+bindingEntry.binding.name,"Save changes","Cancel").then(e=>{try{Ue.post("/set_active_binding_settings",e).then(t=>{t&&t.data?(console.log("binding set with new settings",t.data),this.$store.state.toast.showToast("Binding settings updated successfully!",4,!0)):(this.$store.state.toast.showToast(`Did not get binding settings responses. + `,544),[[Xe,s.message]])]),_("div",amt,[t.loading?j("",!0):(O(),D("button",{key:0,type:"button",onClick:e[9]||(e[9]=(...d)=>r.startSpeechRecognition&&r.startSpeechRecognition(...d)),title:"Press and talk",class:He([{"text-red-500":s.isLesteningToVoice},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer"])},cmt,2)),_("input",{type:"file",ref:"fileDialog",style:{display:"none"},onChange:e[10]||(e[10]=(...d)=>r.addFiles&&r.addFiles(...d)),multiple:""},null,544),_("button",{type:"button",onClick:e[11]||(e[11]=Te(d=>n.$refs.fileDialog.click(),["stop"])),title:"Add files",class:"m-1 w-6 hover:text-secondary duration-75 active:scale-90"},umt),_("button",{type:"button",onClick:e[12]||(e[12]=Te((...d)=>r.takePicture&&r.takePicture(...d),["stop"])),title:"take a shot from camera",class:"m-1 w-6 hover:text-secondary duration-75 active:scale-90"},_mt),_("button",{type:"button",onClick:e[13]||(e[13]=Te((...d)=>r.addWebLink&&r.addWebLink(...d),["stop"])),title:"add web link",class:"m-1 w-6 hover:text-secondary duration-75 active:scale-90"},fmt),t.loading?j("",!0):(O(),D("button",{key:1,type:"button",onClick:e[14]||(e[14]=(...d)=>r.makeAnEmptyUserMessage&&r.makeAnEmptyUserMessage(...d)),title:"New empty user message",class:"w-6 text-blue-400 hover:text-secondary duration-75 active:scale-90"},Emt)),t.loading?j("",!0):(O(),D("button",{key:2,type:"button",onClick:e[15]||(e[15]=(...d)=>r.makeAnEmptyAIMessage&&r.makeAnEmptyAIMessage(...d)),title:"New empty ai message",class:"w-6 text-red-400 hover:text-secondary duration-75 active:scale-90"},vmt)),t.loading?j("",!0):(O(),D("button",{key:3,type:"button",onClick:e[16]||(e[16]=(...d)=>r.submit&&r.submit(...d)),title:"Send",class:"w-6 hover:text-secondary duration-75 active:scale-90"},xmt)),t.loading?(O(),D("div",Cmt,Amt)):j("",!0)])])])])])]),Ie(c,{ref:"universalForm",class:"z-20"},null,512)],64)}const LN=gt(aft,[["render",wmt],["__scopeId","data-v-6b91f51b"]]),Nmt={name:"WelcomeComponent",setup(){return{}}},Omt={class:"flex flex-col text-center"},Imt=Ru('
Logo

Lord of Large Language and Multimodal Systems

One tool to rule them all


Welcome

Please create a new discussion or select existing one to start

',1),Mmt=[Imt];function Dmt(n,e,t,i,s,r){return O(),D("div",Omt,Mmt)}const kN=gt(Nmt,[["render",Dmt]]);var Lmt=function(){function n(e,t){t===void 0&&(t=[]),this._eventType=e,this._eventFunctions=t}return n.prototype.init=function(){var e=this;this._eventFunctions.forEach(function(t){typeof window<"u"&&window.addEventListener(e._eventType,t)})},n}(),$d=globalThis&&globalThis.__assign||function(){return $d=Object.assign||function(n){for(var e,t=1,i=arguments.length;t"u")return!1;var e=ni(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function Wmt(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},s=e.attributes[t]||{},r=e.elements[t];!gi(r)||!Zi(r)||(Object.assign(r.style,i),Object.keys(s).forEach(function(o){var a=s[o];a===!1?r.removeAttribute(o):r.setAttribute(o,a===!0?"":a)}))})}function Kmt(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(i){var s=e.elements[i],r=e.attributes[i]||{},o=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:t[i]),a=o.reduce(function(l,c){return l[c]="",l},{});!gi(s)||!Zi(s)||(Object.assign(s.style,a),Object.keys(r).forEach(function(l){s.removeAttribute(l)}))})}}const jmt={name:"applyStyles",enabled:!0,phase:"write",fn:Wmt,effect:Kmt,requires:["computeStyles"]};function ji(n){return n.split("-")[0]}var Kr=Math.max,Qd=Math.min,_a=Math.round;function Lg(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function zN(){return!/^((?!chrome|android).)*safari/i.test(Lg())}function ha(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var i=n.getBoundingClientRect(),s=1,r=1;e&&gi(n)&&(s=n.offsetWidth>0&&_a(i.width)/n.offsetWidth||1,r=n.offsetHeight>0&&_a(i.height)/n.offsetHeight||1);var o=no(n)?ni(n):window,a=o.visualViewport,l=!zN()&&t,c=(i.left+(l&&a?a.offsetLeft:0))/s,d=(i.top+(l&&a?a.offsetTop:0))/r,u=i.width/s,h=i.height/r;return{width:u,height:h,top:d,right:c+u,bottom:d+h,left:c,x:c,y:d}}function _b(n){var e=ha(n),t=n.offsetWidth,i=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:i}}function HN(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&pb(t)){var i=e;do{if(i&&n.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Ns(n){return ni(n).getComputedStyle(n)}function Qmt(n){return["table","td","th"].indexOf(Zi(n))>=0}function Er(n){return((no(n)?n.ownerDocument:n.document)||window.document).documentElement}function Wu(n){return Zi(n)==="html"?n:n.assignedSlot||n.parentNode||(pb(n)?n.host:null)||Er(n)}function oC(n){return!gi(n)||Ns(n).position==="fixed"?null:n.offsetParent}function Xmt(n){var e=/firefox/i.test(Lg()),t=/Trident/i.test(Lg());if(t&&gi(n)){var i=Ns(n);if(i.position==="fixed")return null}var s=Wu(n);for(pb(s)&&(s=s.host);gi(s)&&["html","body"].indexOf(Zi(s))<0;){var r=Ns(s);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||e&&r.willChange==="filter"||e&&r.filter&&r.filter!=="none")return s;s=s.parentNode}return null}function hc(n){for(var e=ni(n),t=oC(n);t&&Qmt(t)&&Ns(t).position==="static";)t=oC(t);return t&&(Zi(t)==="html"||Zi(t)==="body"&&Ns(t).position==="static")?e:t||Xmt(n)||e}function hb(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function Cl(n,e,t){return Kr(n,Qd(e,t))}function Zmt(n,e,t){var i=Cl(n,e,t);return i>t?t:i}function qN(){return{top:0,right:0,bottom:0,left:0}}function YN(n){return Object.assign({},qN(),n)}function $N(n,e){return e.reduce(function(t,i){return t[i]=n,t},{})}var Jmt=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,YN(typeof e!="number"?e:$N(e,_c))};function egt(n){var e,t=n.state,i=n.name,s=n.options,r=t.elements.arrow,o=t.modifiersData.popperOffsets,a=ji(t.placement),l=hb(a),c=[$n,Si].indexOf(a)>=0,d=c?"height":"width";if(!(!r||!o)){var u=Jmt(s.padding,t),h=_b(r),m=l==="y"?Yn:$n,f=l==="y"?bi:Si,b=t.rects.reference[d]+t.rects.reference[l]-o[l]-t.rects.popper[d],E=o[l]-t.rects.reference[l],g=hc(r),S=g?l==="y"?g.clientHeight||0:g.clientWidth||0:0,y=b/2-E/2,T=u[m],C=S-h[d]-u[f],x=S/2-h[d]/2+y,w=Cl(T,x,C),R=l;t.modifiersData[i]=(e={},e[R]=w,e.centerOffset=w-x,e)}}function tgt(n){var e=n.state,t=n.options,i=t.element,s=i===void 0?"[data-popper-arrow]":i;s!=null&&(typeof s=="string"&&(s=e.elements.popper.querySelector(s),!s)||HN(e.elements.popper,s)&&(e.elements.arrow=s))}const ngt={name:"arrow",enabled:!0,phase:"main",fn:egt,effect:tgt,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function fa(n){return n.split("-")[1]}var igt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function sgt(n,e){var t=n.x,i=n.y,s=e.devicePixelRatio||1;return{x:_a(t*s)/s||0,y:_a(i*s)/s||0}}function aC(n){var e,t=n.popper,i=n.popperRect,s=n.placement,r=n.variation,o=n.offsets,a=n.position,l=n.gpuAcceleration,c=n.adaptive,d=n.roundOffsets,u=n.isFixed,h=o.x,m=h===void 0?0:h,f=o.y,b=f===void 0?0:f,E=typeof d=="function"?d({x:m,y:b}):{x:m,y:b};m=E.x,b=E.y;var g=o.hasOwnProperty("x"),S=o.hasOwnProperty("y"),y=$n,T=Yn,C=window;if(c){var x=hc(t),w="clientHeight",R="clientWidth";if(x===ni(t)&&(x=Er(t),Ns(x).position!=="static"&&a==="absolute"&&(w="scrollHeight",R="scrollWidth")),x=x,s===Yn||(s===$n||s===Si)&&r===Kl){T=bi;var v=u&&x===C&&C.visualViewport?C.visualViewport.height:x[w];b-=v-i.height,b*=l?1:-1}if(s===$n||(s===Yn||s===bi)&&r===Kl){y=Si;var A=u&&x===C&&C.visualViewport?C.visualViewport.width:x[R];m-=A-i.width,m*=l?1:-1}}var P=Object.assign({position:a},c&&igt),U=d===!0?sgt({x:m,y:b},ni(t)):{x:m,y:b};if(m=U.x,b=U.y,l){var Y;return Object.assign({},P,(Y={},Y[T]=S?"0":"",Y[y]=g?"0":"",Y.transform=(C.devicePixelRatio||1)<=1?"translate("+m+"px, "+b+"px)":"translate3d("+m+"px, "+b+"px, 0)",Y))}return Object.assign({},P,(e={},e[T]=S?b+"px":"",e[y]=g?m+"px":"",e.transform="",e))}function rgt(n){var e=n.state,t=n.options,i=t.gpuAcceleration,s=i===void 0?!0:i,r=t.adaptive,o=r===void 0?!0:r,a=t.roundOffsets,l=a===void 0?!0:a,c={placement:ji(e.placement),variation:fa(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,aC(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,aC(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const ogt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:rgt,data:{}};var Lc={passive:!0};function agt(n){var e=n.state,t=n.instance,i=n.options,s=i.scroll,r=s===void 0?!0:s,o=i.resize,a=o===void 0?!0:o,l=ni(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&c.forEach(function(d){d.addEventListener("scroll",t.update,Lc)}),a&&l.addEventListener("resize",t.update,Lc),function(){r&&c.forEach(function(d){d.removeEventListener("scroll",t.update,Lc)}),a&&l.removeEventListener("resize",t.update,Lc)}}const lgt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:agt,data:{}};var cgt={left:"right",right:"left",bottom:"top",top:"bottom"};function Ad(n){return n.replace(/left|right|bottom|top/g,function(e){return cgt[e]})}var dgt={start:"end",end:"start"};function lC(n){return n.replace(/start|end/g,function(e){return dgt[e]})}function fb(n){var e=ni(n),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function mb(n){return ha(Er(n)).left+fb(n).scrollLeft}function ugt(n,e){var t=ni(n),i=Er(n),s=t.visualViewport,r=i.clientWidth,o=i.clientHeight,a=0,l=0;if(s){r=s.width,o=s.height;var c=zN();(c||!c&&e==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:r,height:o,x:a+mb(n),y:l}}function pgt(n){var e,t=Er(n),i=fb(n),s=(e=n.ownerDocument)==null?void 0:e.body,r=Kr(t.scrollWidth,t.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=Kr(t.scrollHeight,t.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-i.scrollLeft+mb(n),l=-i.scrollTop;return Ns(s||t).direction==="rtl"&&(a+=Kr(t.clientWidth,s?s.clientWidth:0)-r),{width:r,height:o,x:a,y:l}}function gb(n){var e=Ns(n),t=e.overflow,i=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+s+i)}function WN(n){return["html","body","#document"].indexOf(Zi(n))>=0?n.ownerDocument.body:gi(n)&&gb(n)?n:WN(Wu(n))}function Rl(n,e){var t;e===void 0&&(e=[]);var i=WN(n),s=i===((t=n.ownerDocument)==null?void 0:t.body),r=ni(i),o=s?[r].concat(r.visualViewport||[],gb(i)?i:[]):i,a=e.concat(o);return s?a:a.concat(Rl(Wu(o)))}function kg(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function _gt(n,e){var t=ha(n,!1,e==="fixed");return t.top=t.top+n.clientTop,t.left=t.left+n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top,t}function cC(n,e,t){return e===GN?kg(ugt(n,t)):no(e)?_gt(e,t):kg(pgt(Er(n)))}function hgt(n){var e=Rl(Wu(n)),t=["absolute","fixed"].indexOf(Ns(n).position)>=0,i=t&&gi(n)?hc(n):n;return no(i)?e.filter(function(s){return no(s)&&HN(s,i)&&Zi(s)!=="body"}):[]}function fgt(n,e,t,i){var s=e==="clippingParents"?hgt(n):[].concat(e),r=[].concat(s,[t]),o=r[0],a=r.reduce(function(l,c){var d=cC(n,c,i);return l.top=Kr(d.top,l.top),l.right=Qd(d.right,l.right),l.bottom=Qd(d.bottom,l.bottom),l.left=Kr(d.left,l.left),l},cC(n,o,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function KN(n){var e=n.reference,t=n.element,i=n.placement,s=i?ji(i):null,r=i?fa(i):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,l;switch(s){case Yn:l={x:o,y:e.y-t.height};break;case bi:l={x:o,y:e.y+e.height};break;case Si:l={x:e.x+e.width,y:a};break;case $n:l={x:e.x-t.width,y:a};break;default:l={x:e.x,y:e.y}}var c=s?hb(s):null;if(c!=null){var d=c==="y"?"height":"width";switch(r){case pa:l[c]=l[c]-(e[d]/2-t[d]/2);break;case Kl:l[c]=l[c]+(e[d]/2-t[d]/2);break}}return l}function jl(n,e){e===void 0&&(e={});var t=e,i=t.placement,s=i===void 0?n.placement:i,r=t.strategy,o=r===void 0?n.strategy:r,a=t.boundary,l=a===void 0?kmt:a,c=t.rootBoundary,d=c===void 0?GN:c,u=t.elementContext,h=u===void 0?rl:u,m=t.altBoundary,f=m===void 0?!1:m,b=t.padding,E=b===void 0?0:b,g=YN(typeof E!="number"?E:$N(E,_c)),S=h===rl?Pmt:rl,y=n.rects.popper,T=n.elements[f?S:h],C=fgt(no(T)?T:T.contextElement||Er(n.elements.popper),l,d,o),x=ha(n.elements.reference),w=KN({reference:x,element:y,strategy:"absolute",placement:s}),R=kg(Object.assign({},y,w)),v=h===rl?R:x,A={top:C.top-v.top+g.top,bottom:v.bottom-C.bottom+g.bottom,left:C.left-v.left+g.left,right:v.right-C.right+g.right},P=n.modifiersData.offset;if(h===rl&&P){var U=P[s];Object.keys(A).forEach(function(Y){var L=[Si,bi].indexOf(Y)>=0?1:-1,H=[Yn,bi].indexOf(Y)>=0?"y":"x";A[Y]+=U[H]*L})}return A}function mgt(n,e){e===void 0&&(e={});var t=e,i=t.placement,s=t.boundary,r=t.rootBoundary,o=t.padding,a=t.flipVariations,l=t.allowedAutoPlacements,c=l===void 0?VN:l,d=fa(i),u=d?a?rC:rC.filter(function(f){return fa(f)===d}):_c,h=u.filter(function(f){return c.indexOf(f)>=0});h.length===0&&(h=u);var m=h.reduce(function(f,b){return f[b]=jl(n,{placement:b,boundary:s,rootBoundary:r,padding:o})[ji(b)],f},{});return Object.keys(m).sort(function(f,b){return m[f]-m[b]})}function ggt(n){if(ji(n)===ub)return[];var e=Ad(n);return[lC(n),e,lC(e)]}function Egt(n){var e=n.state,t=n.options,i=n.name;if(!e.modifiersData[i]._skip){for(var s=t.mainAxis,r=s===void 0?!0:s,o=t.altAxis,a=o===void 0?!0:o,l=t.fallbackPlacements,c=t.padding,d=t.boundary,u=t.rootBoundary,h=t.altBoundary,m=t.flipVariations,f=m===void 0?!0:m,b=t.allowedAutoPlacements,E=e.options.placement,g=ji(E),S=g===E,y=l||(S||!f?[Ad(E)]:ggt(E)),T=[E].concat(y).reduce(function(_e,me){return _e.concat(ji(me)===ub?mgt(e,{placement:me,boundary:d,rootBoundary:u,padding:c,flipVariations:f,allowedAutoPlacements:b}):me)},[]),C=e.rects.reference,x=e.rects.popper,w=new Map,R=!0,v=T[0],A=0;A=0,H=L?"width":"height",B=jl(e,{placement:P,boundary:d,rootBoundary:u,altBoundary:h,padding:c}),k=L?Y?Si:$n:Y?bi:Yn;C[H]>x[H]&&(k=Ad(k));var $=Ad(k),K=[];if(r&&K.push(B[U]<=0),a&&K.push(B[k]<=0,B[$]<=0),K.every(function(_e){return _e})){v=P,R=!1;break}w.set(P,K)}if(R)for(var W=f?3:1,le=function(me){var Ce=T.find(function(X){var ue=w.get(X);if(ue)return ue.slice(0,me).every(function(Z){return Z})});if(Ce)return v=Ce,"break"},J=W;J>0;J--){var ee=le(J);if(ee==="break")break}e.placement!==v&&(e.modifiersData[i]._skip=!0,e.placement=v,e.reset=!0)}}const bgt={name:"flip",enabled:!0,phase:"main",fn:Egt,requiresIfExists:["offset"],data:{_skip:!1}};function dC(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function uC(n){return[Yn,Si,bi,$n].some(function(e){return n[e]>=0})}function Sgt(n){var e=n.state,t=n.name,i=e.rects.reference,s=e.rects.popper,r=e.modifiersData.preventOverflow,o=jl(e,{elementContext:"reference"}),a=jl(e,{altBoundary:!0}),l=dC(o,i),c=dC(a,s,r),d=uC(l),u=uC(c);e.modifiersData[t]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}const vgt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Sgt};function ygt(n,e,t){var i=ji(n),s=[$n,Yn].indexOf(i)>=0?-1:1,r=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,o=r[0],a=r[1];return o=o||0,a=(a||0)*s,[$n,Si].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}function Tgt(n){var e=n.state,t=n.options,i=n.name,s=t.offset,r=s===void 0?[0,0]:s,o=VN.reduce(function(d,u){return d[u]=ygt(u,e.rects,r),d},{}),a=o[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[i]=o}const xgt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Tgt};function Cgt(n){var e=n.state,t=n.name;e.modifiersData[t]=KN({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const Rgt={name:"popperOffsets",enabled:!0,phase:"read",fn:Cgt,data:{}};function Agt(n){return n==="x"?"y":"x"}function wgt(n){var e=n.state,t=n.options,i=n.name,s=t.mainAxis,r=s===void 0?!0:s,o=t.altAxis,a=o===void 0?!1:o,l=t.boundary,c=t.rootBoundary,d=t.altBoundary,u=t.padding,h=t.tether,m=h===void 0?!0:h,f=t.tetherOffset,b=f===void 0?0:f,E=jl(e,{boundary:l,rootBoundary:c,padding:u,altBoundary:d}),g=ji(e.placement),S=fa(e.placement),y=!S,T=hb(g),C=Agt(T),x=e.modifiersData.popperOffsets,w=e.rects.reference,R=e.rects.popper,v=typeof b=="function"?b(Object.assign({},e.rects,{placement:e.placement})):b,A=typeof v=="number"?{mainAxis:v,altAxis:v}:Object.assign({mainAxis:0,altAxis:0},v),P=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,U={x:0,y:0};if(x){if(r){var Y,L=T==="y"?Yn:$n,H=T==="y"?bi:Si,B=T==="y"?"height":"width",k=x[T],$=k+E[L],K=k-E[H],W=m?-R[B]/2:0,le=S===pa?w[B]:R[B],J=S===pa?-R[B]:-w[B],ee=e.elements.arrow,_e=m&&ee?_b(ee):{width:0,height:0},me=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:qN(),Ce=me[L],X=me[H],ue=Cl(0,w[B],_e[B]),Z=y?w[B]/2-W-ue-Ce-A.mainAxis:le-ue-Ce-A.mainAxis,ge=y?-w[B]/2+W+ue+X+A.mainAxis:J+ue+X+A.mainAxis,Oe=e.elements.arrow&&hc(e.elements.arrow),M=Oe?T==="y"?Oe.clientTop||0:Oe.clientLeft||0:0,G=(Y=P==null?void 0:P[T])!=null?Y:0,q=k+Z-G-M,oe=k+ge-G,ne=Cl(m?Qd($,q):$,k,m?Kr(K,oe):K);x[T]=ne,U[T]=ne-k}if(a){var ve,we=T==="x"?Yn:$n,V=T==="x"?bi:Si,ce=x[C],ie=C==="y"?"height":"width",re=ce+E[we],I=ce-E[V],N=[Yn,$n].indexOf(g)!==-1,z=(ve=P==null?void 0:P[C])!=null?ve:0,de=N?re:ce-w[ie]-R[ie]-z+A.altAxis,Q=N?ce+w[ie]+R[ie]-z-A.altAxis:I,te=m&&N?Zmt(de,ce,Q):Cl(m?de:re,ce,m?Q:I);x[C]=te,U[C]=te-ce}e.modifiersData[i]=U}}const Ngt={name:"preventOverflow",enabled:!0,phase:"main",fn:wgt,requiresIfExists:["offset"]};function Ogt(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function Igt(n){return n===ni(n)||!gi(n)?fb(n):Ogt(n)}function Mgt(n){var e=n.getBoundingClientRect(),t=_a(e.width)/n.offsetWidth||1,i=_a(e.height)/n.offsetHeight||1;return t!==1||i!==1}function Dgt(n,e,t){t===void 0&&(t=!1);var i=gi(e),s=gi(e)&&Mgt(e),r=Er(e),o=ha(n,s,t),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!t)&&((Zi(e)!=="body"||gb(r))&&(a=Igt(e)),gi(e)?(l=ha(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):r&&(l.x=mb(r))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function Lgt(n){var e=new Map,t=new Set,i=[];n.forEach(function(r){e.set(r.name,r)});function s(r){t.add(r.name);var o=[].concat(r.requires||[],r.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var l=e.get(a);l&&s(l)}}),i.push(r)}return n.forEach(function(r){t.has(r.name)||s(r)}),i}function kgt(n){var e=Lgt(n);return $mt.reduce(function(t,i){return t.concat(e.filter(function(s){return s.phase===i}))},[])}function Pgt(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function Ugt(n){var e=n.reduce(function(t,i){var s=t[i.name];return t[i.name]=s?Object.assign({},s,i,{options:Object.assign({},s.options,i.options),data:Object.assign({},s.data,i.data)}):i,t},{});return Object.keys(e).map(function(t){return e[t]})}var pC={placement:"bottom",modifiers:[],strategy:"absolute"};function _C(){for(var n=arguments.length,e=new Array(n),t=0;t(lo("data-v-7a271009"),n=n(),co(),n),qgt={key:0,class:"fixed top-0 left-0 w-screen h-screen flex items-center justify-center"},Ygt={class:"flex flex-col text-center"},$gt={class:"flex flex-col text-center items-center"},Wgt={class:"flex items-center gap-3 text-5xl drop-shadow-md align-middle pt-24"},Kgt=Bt(()=>_("img",{class:"w-24 animate-bounce",title:"LoLLMS WebUI",src:ca,alt:"Logo"},null,-1)),jgt={class:"flex flex-col items-start"},Qgt={class:"text-2xl"},Xgt=Bt(()=>_("p",{class:"text-gray-400 text-base"},"One tool to rule them all",-1)),Zgt=Bt(()=>_("p",{class:"text-gray-400 text-base"},"by ParisNeo",-1)),Jgt=Bt(()=>_("hr",{class:"mt-1 w-96 h-1 mx-auto my-2 md:my-2 dark:bg-bg-dark-tone-panel bg-bg-light-tone-panel border-0 rounded"},null,-1)),eEt=Bt(()=>_("p",{class:"text-2xl mb-10"},"Welcome",-1)),tEt={role:"status",class:"text-center w-full display: flex; flex-row align-items: center;"},nEt={class:"text-2xl animate-pulse mt-2"},iEt=Bt(()=>_("i",{"data-feather":"chevron-right"},null,-1)),sEt=[iEt],rEt=Bt(()=>_("i",{"data-feather":"chevron-left"},null,-1)),oEt=[rEt],aEt={key:0,class:"relative flex flex-col no-scrollbar shadow-lg min-w-[24rem] max-w-[24rem] bg-bg-light-tone dark:bg-bg-dark-tone"},lEt={class:"sticky z-10 top-0 bg-bg-light-tone dark:bg-bg-dark-tone shadow-md"},cEt={class:"flex-row p-4 flex items-center gap-3 flex-0"},dEt=Bt(()=>_("i",{"data-feather":"plus"},null,-1)),uEt=[dEt],pEt=Bt(()=>_("i",{"data-feather":"check-square"},null,-1)),_Et=[pEt],hEt=Bt(()=>_("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Reset database, remove all discussions"},[_("i",{"data-feather":"refresh-ccw"})],-1)),fEt=Bt(()=>_("i",{"data-feather":"database"},null,-1)),mEt=[fEt],gEt=Bt(()=>_("i",{"data-feather":"log-in"},null,-1)),EEt=[gEt],bEt={key:0,class:"dropdown"},SEt=Bt(()=>_("i",{"data-feather":"search"},null,-1)),vEt=[SEt],yEt=Bt(()=>_("i",{"data-feather":"save"},null,-1)),TEt=[yEt],xEt={key:2,class:"flex gap-3 flex-1 items-center duration-75"},CEt=Bt(()=>_("i",{"data-feather":"x"},null,-1)),REt=[CEt],AEt=Bt(()=>_("i",{"data-feather":"check"},null,-1)),wEt=[AEt],NEt=["src"],OEt=["src"],IEt=["src"],MEt={key:4,title:"Loading..",class:"flex flex-row flex-grow justify-end"},DEt=Bt(()=>_("div",{role:"status"},[_("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[_("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),_("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),_("span",{class:"sr-only"},"Loading...")],-1)),LEt=[DEt],kEt={key:0,class:"flex-row items-center gap-3 flex-0 w-full"},PEt={class:"p-4 pt-2"},UEt={class:"relative"},FEt=Bt(()=>_("div",{class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},[_("div",{class:"scale-75"},[_("i",{"data-feather":"search"})])],-1)),BEt={class:"absolute inset-y-0 right-0 flex items-center pr-3"},GEt=Bt(()=>_("i",{"data-feather":"x"},null,-1)),VEt=[GEt],zEt={key:1,class:"h-px bg-bg-light p-0 mb-4 px-4 mx-4 border-0 dark:bg-bg-dark"},HEt={key:2,class:"flex flex-row flex-grow p-4 pt-0 items-center"},qEt={class:"flex flex-row flex-grow"},YEt={key:0},$Et={class:"flex flex-row"},WEt={key:0,class:"flex gap-3"},KEt=Bt(()=>_("i",{"data-feather":"trash"},null,-1)),jEt=[KEt],QEt={key:1,class:"flex gap-3 mx-3 flex-1 items-center justify-end group-hover:visible duration-75"},XEt=Bt(()=>_("i",{"data-feather":"check"},null,-1)),ZEt=[XEt],JEt=Bt(()=>_("i",{"data-feather":"x"},null,-1)),ebt=[JEt],tbt={class:"flex gap-3"},nbt=Bt(()=>_("i",{"data-feather":"log-out"},null,-1)),ibt=[nbt],sbt=Bt(()=>_("i",{"data-feather":"bookmark"},null,-1)),rbt=[sbt],obt=Bt(()=>_("i",{"data-feather":"list"},null,-1)),abt=[obt],lbt={class:"relative flex flex-row flex-grow mb-10 z-0 w-full"},cbt={key:1,class:"gap-2 py-2 my-2 hover:shadow-md hover:bg-primary-light dark:hover:bg-primary rounded-md p-2 duration-75 group cursor-pointer"},dbt=Bt(()=>_("p",{class:"px-3"},"No discussions are found",-1)),ubt=[dbt],pbt=Bt(()=>_("div",{class:"sticky bottom-0 bg-gradient-to-t pointer-events-none from-bg-light-tone dark:from-bg-dark-tone flex flex-grow"},null,-1)),_bt={class:"ml-2"},hbt={key:1,class:"relative flex flex-col flex-grow w-full"},fbt={class:"container pt-4 pb-50 mb-50 w-full"},mbt=Bt(()=>_("div",null,[_("br"),_("br"),_("br"),_("br"),_("br"),_("br"),_("br")],-1)),gbt=Bt(()=>_("div",{class:"absolute w-full bottom-0 bg-transparent p-10 pt-16 bg-gradient-to-t from-bg-light dark:from-bg-dark from-5% via-bg-light dark:via-bg-dark via-10% to-transparent to-100%"},null,-1)),Ebt={key:0,class:"bottom-0 flex flex-row items-center justify-center"},bbt={role:"status",class:"fixed m-0 p-2 left-2 bottom-2 min-w-[24rem] max-w-[24rem] h-20 flex flex-col justify-center items-center pb-4 bg-blue-500 rounded-lg shadow-lg z-50 background-a"},Sbt={class:"text-2xl animate-pulse mt-2 text-white"},vbt={setup(){},data(){return{host:"",progress_visibility_val:!0,progress_value:0,msgTypes:{MSG_TYPE_CHUNK:0,MSG_TYPE_FULL:1,MSG_TYPE_FULL_INVISIBLE_TO_AI:2,MSG_TYPE_FULL_INVISIBLE_TO_USER:3,MSG_TYPE_EXCEPTION:4,MSG_TYPE_WARNING:5,MSG_TYPE_INFO:6,MSG_TYPE_STEP:7,MSG_TYPE_STEP_START:8,MSG_TYPE_STEP_PROGRESS:9,MSG_TYPE_STEP_END:10,MSG_TYPE_JSON_INFOS:11,MSG_TYPE_REF:12,MSG_TYPE_CODE:13,MSG_TYPE_UI:14,MSG_TYPE_NEW_MESSAGE:15,MSG_TYPE_FINISHED_MESSAGE:17},senderTypes:{SENDER_TYPES_USER:0,SENDER_TYPES_AI:1,SENDER_TYPES_SYSTEM:2},list:[],tempList:[],currentDiscussion:{},discussionArr:[],loading:!1,filterTitle:"",filterInProgress:!1,isCreated:!1,isCheckbox:!1,isSelectAll:!1,showSaveConfirmation:!1,showBrainConfirmation:!1,showConfirmation:!1,chime:new Audio("chime_aud.wav"),showToast:!1,isSearch:!1,isDiscussionBottom:!1,personalityAvatars:[],fileList:[],database_selectorDialogVisible:!1,isDragOverDiscussion:!1,isDragOverChat:!1,panelCollapsed:!1,isOpen:!1,discussion_id:0}},methods:{add_webpage(){console.log("addWebLink received"),this.$refs.web_url_input_box.showPanel()},handleOk(){console.log("OK"),Ye.on("web_page_added",()=>{Ue.get("/get_current_personality_files_list").then(n=>{this.filesList=n.data.files,console.log("this.filesList",this.filesList),this.isFileSentList=n.data.files.map(e=>!0),console.log(`Files recovered: ${this.filesList}`)})}),Ye.emit("add_webpage",{url:this.$refs.web_url_input_box.inputText})},show_progress(n){this.progress_visibility_val=!0},hide_progress(n){this.progress_visibility_val=!1},update_progress(n){console.log("Progress update"),this.progress_value=n.value},onSettingsBinding(){try{this.isLoading=!0,Ue.get("/get_active_binding_settings").then(n=>{this.isLoading=!1,n&&(n.data&&Object.keys(n.data).length>0?this.$store.state.universalForm.showForm(n.data,"Binding settings - "+bindingEntry.binding.name,"Save changes","Cancel").then(e=>{try{Ue.post("/set_active_binding_settings",e).then(t=>{t&&t.data?(console.log("binding set with new settings",t.data),this.$store.state.toast.showToast("Binding settings updated successfully!",4,!0)):(this.$store.state.toast.showToast(`Did not get binding settings responses. `+t,4,!1),this.isLoading=!1)})}catch(t){this.$store.state.toast.showToast(`Did not get binding settings responses. Endpoint error: `+t.message,4,!1),this.isLoading=!1}}):(this.$store.state.toast.showToast("Binding has no settings",4,!1),this.isLoading=!1))})}catch(n){this.isLoading=!1,this.$store.state.toast.showToast("Could not open binding settings. Endpoint error: "+n.message,4,!1)}},showDatabaseSelector(){this.database_selectorDialogVisible=!0},async ondatabase_selectorDialogSelected(n){console.log("Selected:",n)},onclosedatabase_selectorDialog(){this.database_selectorDialogVisible=!1},async onvalidatedatabase_selectorChoice(n){if(this.database_selectorDialogVisible=!1,(await Ue.post("/select_database",{name:n})).status){console.log("Selected database"),this.$store.state.config=await Ue.get("/get_config"),console.log("new config loaded :",this.$store.state.config);let t=await Ue.get("/list_databases").data;console.log("New list of database: ",t),this.$store.state.databases=t,console.log("New list of database: ",this.$store.state.databases),location.reload()}},async toggleLTM(){this.$store.state.config.use_discussions_history=!this.$store.state.config.use_discussions_history,await this.applyConfiguration(),Ye.emit("upgrade_vectorization")},async applyConfiguration(){this.loading=!0;const n=await Ue.post("/apply_settings",{config:this.$store.state.config});this.loading=!1,n.data.status?this.$store.state.toast.showToast("Configuration changed successfully.",4,!0):this.$store.state.toast.showToast("Configuration change failed.",4,!1),Fe(()=>{Be.replace()})},save_configuration(){this.showConfirmation=!1,Ue.post("/save_settings",{}).then(n=>{if(n)return n.status?this.$store.state.toast.showToast("Settings saved!",4,!0):this.$store.state.messageBox.showMessage("Error: Couldn't save settings!"),n.data}).catch(n=>(console.log(n.message,"save_configuration"),this.$store.state.messageBox.showMessage("Couldn't save settings!"),{status:!1}))},showToastMessage(n,e,t){console.log("sending",n),this.$store.state.toast.showToast(n,e,t)},togglePanel(){this.panelCollapsed=!this.panelCollapsed},toggleDropdown(){this.isOpen=!this.isOpen},importChatGPT(){},async api_get_req(n){try{const e=await Ue.get("/"+n);if(e)return e.data}catch(e){console.log(e.message,"api_get_req");return}},async list_discussions(){try{const n=await Ue.get("/list_discussions");if(n)return this.createDiscussionList(n.data),n.data}catch(n){return console.log("Error: Could not list discussions",n.message),[]}},load_discussion(n,e){n&&(console.log("Loading discussion",n),this.loading=!0,this.discussionArr=[],this.setDiscussionLoading(n,this.loading),Ye.on("discussion",t=>{this.loading=!1,this.setDiscussionLoading(n,this.loading),t&&(this.discussionArr=t.filter(i=>i.message_type==this.msgTypes.MSG_TYPE_CHUNK||i.message_type==this.msgTypes.MSG_TYPE_FULL||i.message_type==this.msgTypes.MSG_TYPE_FULL_INVISIBLE_TO_AI||i.message_type==this.msgTypes.MSG_TYPE_CODE||i.message_type==this.msgTypes.MSG_TYPE_JSON_INFOS||i.message_type==this.msgTypes.MSG_TYPE_UI),console.log("this.discussionArr"),console.log(this.discussionArr),e&&e()),Ye.off("discussion")}),Ye.emit("load_discussion",{id:n}))},recoverFiles(){console.log("Recovering files"),Ue.get("/get_current_personality_files_list").then(n=>{this.$refs.chatBox.filesList=n.data.files,this.$refs.chatBox.isFileSentList=n.data.files.map(e=>!0),console.log(`Files recovered: ${this.$refs.chatBox.filesList}`)})},new_discussion(n){try{this.loading=!0,Ye.on("discussion_created",e=>{Ye.off("discussion_created"),this.list_discussions().then(()=>{const t=this.list.findIndex(s=>s.id==e.id),i=this.list[t];this.selectDiscussion(i),this.load_discussion(e.id,()=>{this.loading=!1,Ue.get("/get_current_personality_files_list").then(s=>{console.log("Files recovered"),this.fileList=s.files}),Fe(()=>{const s=document.getElementById("dis-"+e.id);this.scrollToElement(s),console.log("Scrolling tp "+s)})})})}),console.log("new_discussion ",n),Ye.emit("new_discussion",{title:n})}catch(e){return console.log("Error: Could not create new discussion",e.message),{}}},async delete_discussion(n){try{n&&(this.loading=!0,this.setDiscussionLoading(n,this.loading),await Ue.post("/delete_discussion",{client_id:this.client_id,id:n}),this.loading=!1,this.setDiscussionLoading(n,this.loading))}catch(e){console.log("Error: Could not delete discussion",e.message),this.loading=!1,this.setDiscussionLoading(n,this.loading)}},async edit_title(n,e){try{if(n){this.loading=!0,this.setDiscussionLoading(n,this.loading);const t=await Ue.post("/edit_title",{client_id:this.client_id,id:n,title:e});if(this.loading=!1,this.setDiscussionLoading(n,this.loading),t.status==200){const i=this.list.findIndex(r=>r.id==n),s=this.list[i];s.title=e,this.tempList=this.list}}}catch(t){console.log("Error: Could not edit title",t.message),this.loading=!1,this.setDiscussionLoading(n,this.loading)}},async make_title(n){try{if(n){this.loading=!0,this.setDiscussionLoading(n,this.loading);const e=await Ue.post("/make_title",{client_id:this.client_id,id:n});if(console.log("Making title:",e),this.loading=!1,this.setDiscussionLoading(n,this.loading),e.status==200){const t=this.list.findIndex(s=>s.id==n),i=this.list[t];i.title=e.data.title,this.tempList=this.list}}}catch(e){console.log("Error: Could not edit title",e.message),this.loading=!1,this.setDiscussionLoading(n,this.loading)}},async delete_message(n){try{const e=await Ue.get("/delete_message",{params:{client_id:this.client_id,id:n}});if(e)return e.data}catch(e){return console.log("Error: Could delete message",e.message),{}}},async stop_gen(){try{if(Ye.emit("cancel_generation"),res)return res.data}catch(n){return console.log("Error: Could not stop generating",n.message),{}}},async message_rank_up(n){try{const e=await Ue.get("/message_rank_up",{params:{client_id:this.client_id,id:n}});if(e)return e.data}catch(e){return console.log("Error: Could not rank up message",e.message),{}}},async message_rank_down(n){try{const e=await Ue.get("/message_rank_down",{params:{client_id:this.client_id,id:n}});if(e)return e.data}catch(e){return console.log("Error: Could not rank down message",e.message),{}}},async edit_message(n,e,t){try{const i=await Ue.get("/edit_message",{params:{client_id:this.client_id,id:n,message:e,metadata:{audio_url:t}}});if(i)return i.data}catch(i){return console.log("Error: Could not update message",i.message),{}}},async export_multiple_discussions(n,e){try{if(n.length>0){const t=await Ue.post("/export_multiple_discussions",{discussion_ids:n,export_format:e});if(t)return t.data}}catch(t){return console.log("Error: Could not export multiple discussions",t.message),{}}},async import_multiple_discussions(n){try{if(n.length>0){console.log("sending import",n);const e=await Ue.post("/import_multiple_discussions",{jArray:n});if(e)return console.log("import response",e.data),e.data}}catch(e){console.log("Error: Could not import multiple discussions",e.message);return}},filterDiscussions(){this.filterInProgress||(this.filterInProgress=!0,setTimeout(()=>{this.filterTitle?this.list=this.tempList.filter(n=>n.title&&n.title.includes(this.filterTitle)):this.list=this.tempList,this.filterInProgress=!1},100))},async selectDiscussion(n){if(this.isGenerating){this.$store.state.toast.showToast("You are currently generating a text. Please wait for text generation to finish or stop it before trying to select another discussion",4,!1);return}n&&(this.currentDiscussion===void 0?(this.currentDiscussion=n,this.setPageTitle(n),localStorage.setItem("selected_discussion",this.currentDiscussion.id),this.load_discussion(n.id,()=>{this.discussionArr.length>1&&(this.currentDiscussion.title===""||this.currentDiscussion.title===null)&&this.changeTitleUsingUserMSG(this.currentDiscussion.id,this.discussionArr[1].content)})):this.currentDiscussion.id!=n.id&&(console.log("item",n),console.log("this.currentDiscussion",this.currentDiscussion),this.currentDiscussion=n,console.log("this.currentDiscussion",this.currentDiscussion),this.setPageTitle(n),localStorage.setItem("selected_discussion",this.currentDiscussion.id),this.load_discussion(n.id,()=>{this.discussionArr.length>1&&(this.currentDiscussion.title===""||this.currentDiscussion.title===null)&&this.changeTitleUsingUserMSG(this.currentDiscussion.id,this.discussionArr[1].content)})),Fe(()=>{const e=document.getElementById("dis-"+this.currentDiscussion.id);this.scrollToElementInContainer(e,"leftPanel");const t=document.getElementById("messages-list");this.scrollBottom(t)}))},scrollToElement(n){n?n.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"}):console.log("Error: scrollToElement")},scrollToElementInContainer(n,e){try{const t=n.offsetTop;document.getElementById(e).scrollTo({top:t,behavior:"smooth"})}catch{}},scrollBottom(n){n?n.scrollTo({top:n.scrollHeight,behavior:"smooth"}):console.log("Error: scrollBottom")},scrollTop(n){n?n.scrollTo({top:0,behavior:"smooth"}):console.log("Error: scrollTop")},createUserMsg(n){let e={content:n.message,id:n.id,rank:0,sender:n.user,created_at:n.created_at,steps:[],html_js_s:[]};this.discussionArr.push(e),Fe(()=>{const t=document.getElementById("messages-list");this.scrollBottom(t)})},updateLastUserMsg(n){const e=this.discussionArr.indexOf(i=>i.id=n.user_id),t={binding:n.binding,content:n.message,created_at:n.created_at,type:n.type,finished_generating_at:n.finished_generating_at,id:n.user_id,model:n.model,personality:n.personality,sender:n.user,steps:[]};e!==-1&&(this.discussionArr[e]=t)},socketIOConnected(){return console.log("socketIOConnected"),this.$store.state.isConnected=!0,!0},socketIODisconnected(){return console.log("socketIOConnected"),this.currentDiscussion=null,this.$store.dispatch("refreshModels"),this.$store.state.isConnected=!1,!0},new_message(n){console.log("Making a new message"),console.log("New message",n);let e={sender:n.sender,message_type:n.message_type,sender_type:n.sender_type,content:n.content,id:n.id,discussion_id:n.discussion_id,parent_id:n.parent_id,binding:n.binding,model:n.model,personality:n.personality,created_at:n.created_at,finished_generating_at:n.finished_generating_at,rank:0,ui:n.ui,steps:[],parameters:n.parameters,metadata:n.metadata,open:n.open};console.log(e),this.discussionArr.push(e),(this.currentDiscussion.title===""||this.currentDiscussion.title===null)&&this.changeTitleUsingUserMSG(this.currentDiscussion.id,n.message),console.log("infos",n)},talk(n){this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),Ue.get("/get_generation_status",{}).then(e=>{e&&(e.data.status?console.log("Already generating"):(console.log("Generating message from ",e.data.status),Ye.emit("generate_msg_from",{id:-1}),this.discussionArr.length>0&&Number(this.discussionArr[this.discussionArr.length-1].id)+1))}).catch(e=>{console.log("Error: Could not get generation status",e)})},createEmptyUserMessage(n){Ye.emit("create_empty_message",{type:0,message:n})},createEmptyAIMessage(){Ye.emit("create_empty_message",{type:1})},sendMsg(n){if(!n){this.$store.state.toast.showToast("Message contains no content!",4,!1);return}this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),Ue.get("/get_generation_status",{}).then(e=>{if(e)if(e.data.status)console.log("Already generating");else{Ye.emit("generate_msg",{prompt:n});let t=0;this.discussionArr.length>0&&(t=Number(this.discussionArr[this.discussionArr.length-1].id)+1);let i={message:n,id:t,rank:0,user:this.$store.state.config.user_name,created_at:new Date().toLocaleString(),sender:this.$store.state.config.user_name,message_type:this.msgTypes.MSG_TYPE_FULL,sender_type:this.senderTypes.SENDER_TYPES_USER,content:n,id:t,discussion_id:this.discussion_id,parent_id:t,binding:"",model:"",personality:"",created_at:new Date().toLocaleString(),finished_generating_at:new Date().toLocaleString(),rank:0,steps:[],parameters:null,metadata:[],ui:null};this.createUserMsg(i)}}).catch(e=>{console.log("Error: Could not get generation status",e)})},sendCmd(n){this.isGenerating=!0,Ye.emit("execute_command",{command:n,parameters:[]})},notify(n){self.isGenerating=!1,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),Fe(()=>{const e=document.getElementById("messages-list");this.scrollBottom(e)}),n.display_type==0?this.$store.state.toast.showToast(n.content,n.duration,n.notification_type):n.display_type==1?this.$store.state.messageBox.showMessage(n.content):n.display_type==2?(this.$store.state.messageBox.hideMessage(),this.$store.state.yesNoDialog.askQuestion(n.content,"Yes","No").then(e=>{Ye.emit("yesNoRes",{yesRes:e})})):n.display_type==3?this.$store.state.messageBox.showBlockingMessage(n.content):n.display_type==4&&this.$store.state.messageBox.hideMessage(),this.chime.play()},streamMessageContent(n){if(this.discussion_id=n.discussion_id,this.setDiscussionLoading(this.discussion_id,!0),this.currentDiscussion.id==this.discussion_id){const e=this.discussionArr.findIndex(i=>i.id==n.id),t=this.discussionArr[e];if(t&&(n.message_type==this.msgTypes.MSG_TYPE_FULL||n.message_type==this.msgTypes.MSG_TYPE_FULL_INVISIBLE_TO_AI))t.content=n.content,t.finished_generating_at=n.finished_generating_at;else if(t&&n.message_type==this.msgTypes.MSG_TYPE_CHUNK)t.content+=n.content;else if(n.message_type==this.msgTypes.MSG_TYPE_STEP)t.steps.push({message:n.content,done:!0,status:!0});else if(n.message_type==this.msgTypes.MSG_TYPE_STEP_START)t.steps.push({message:n.content,done:!1,status:!0});else if(n.message_type==this.msgTypes.MSG_TYPE_STEP_END){const i=t.steps.find(s=>s.message===n.content);if(i){i.done=!0;try{console.log(n.parameters);const s=n.parameters;i.status=s.status,console.log(s)}catch(s){console.error("Error parsing JSON:",s.message)}}}else n.message_type==this.msgTypes.MSG_TYPE_JSON_INFOS?(console.log("JSON message"),console.log(n.metadata),t.metadata=n.metadata):n.message_type==this.msgTypes.MSG_TYPE_UI?(console.log("UI message"),t.ui=n.ui,console.log(t.ui)):n.message_type==this.msgTypes.MSG_TYPE_EXCEPTION&&this.$store.state.toast.showToast(n.content,5,!1)}this.$nextTick(()=>{Be.replace()})},async changeTitleUsingUserMSG(n,e){const t=this.list.findIndex(s=>s.id==n),i=this.list[t];e&&(i.title=e,this.tempList=this.list,await this.edit_title(n,e))},async createNewDiscussion(){this.new_discussion(null)},loadLastUsedDiscussion(){console.log("Loading last discussion");const n=localStorage.getItem("selected_discussion");if(console.log("Last discussion id: ",n),n){const e=this.list.findIndex(i=>i.id==n),t=this.list[e];t&&this.selectDiscussion(t)}},onCopyPersonalityName(n){this.$store.state.toast.showToast("Copied name to clipboard!",4,!0),navigator.clipboard.writeText(n.name)},async deleteDiscussion(n){await this.delete_discussion(n),this.currentDiscussion.id==n&&(this.currentDiscussion={},this.discussionArr=[],this.setPageTitle()),this.list.splice(this.list.findIndex(e=>e.id==n),1),this.createDiscussionList(this.list)},async deleteDiscussionMulti(){const n=this.selectedDiscussions;for(let e=0;ei.id==t.id),1)}this.tempList=this.list,this.isCheckbox=!1,this.$store.state.toast.showToast("Removed ("+n.length+") items",4,!0),this.showConfirmation=!1,console.log("Multi delete done")},async deleteMessage(n){await this.delete_message(n).then(()=>{this.discussionArr.splice(this.discussionArr.findIndex(e=>e.id==n),1)}).catch(()=>{this.$store.state.toast.showToast("Could not remove message",4,!1),console.log("Error: Could not delete message")})},async editTitle(n){const e=this.list.findIndex(i=>i.id==n.id),t=this.list[e];t.title=n.title,t.loading=!0,await this.edit_title(n.id,n.title),t.loading=!1},async makeTitle(n){this.list.findIndex(e=>e.id==n.id),await this.make_title(n.id)},checkUncheckDiscussion(n,e){const t=this.list.findIndex(s=>s.id==e),i=this.list[t];i.checkBoxValue=n.target.checked,this.tempList=this.list},selectAllDiscussions(){this.isSelectAll=!this.tempList.filter(n=>n.checkBoxValue==!1).length>0;for(let n=0;n({id:t.id,title:t.title,selected:!1,loading:!1,checkBoxValue:!1})).sort(function(t,i){return i.id-t.id});this.list=e,this.tempList=e}},setDiscussionLoading(n,e){try{const t=this.list.findIndex(s=>s.id==n),i=this.list[t];i.loading=e}catch{console.log("Error setting discussion loading")}},setPageTitle(n){if(n)if(n.id){const e=n.title?n.title==="untitled"?"New discussion":n.title:"New discussion";document.title="LoLLMS WebUI - "+e}else{const e=n||"Welcome";document.title="LoLLMS WebUI - "+e}else{const e=n||"Welcome";document.title="LoLLMS WebUI - "+e}},async rankUpMessage(n){await this.message_rank_up(n).then(e=>{const t=this.discussionArr[this.discussionArr.findIndex(i=>i.id==n)];t.rank=e.new_rank}).catch(()=>{this.$store.state.toast.showToast("Could not rank up message",4,!1),console.log("Error: Could not rank up message")})},async rankDownMessage(n){await this.message_rank_down(n).then(e=>{const t=this.discussionArr[this.discussionArr.findIndex(i=>i.id==n)];t.rank=e.new_rank}).catch(()=>{this.$store.state.toast.showToast("Could not rank down message",4,!1),console.log("Error: Could not rank down message")})},async updateMessage(n,e,t){await this.edit_message(n,e,t).then(()=>{const i=this.discussionArr[this.discussionArr.findIndex(s=>s.id==n)];i.content=e}).catch(()=>{this.$store.state.toast.showToast("Could not update message",4,!1),console.log("Error: Could not update message")})},resendMessage(n,e,t){Fe(()=>{Be.replace()}),this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),Ue.get("/get_generation_status",{}).then(i=>{i&&(i.data.status?(this.$store.state.toast.showToast("The server is busy. Wait",4,!1),console.log("Already generating")):Ye.emit("generate_msg_from",{prompt:e,id:n,msg_type:t}))}).catch(i=>{console.log("Error: Could not get generation status",i)})},continueMessage(n,e){Fe(()=>{Be.replace()}),this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),Ue.get("/get_generation_status",{}).then(t=>{t&&(t.data.status?console.log("Already generating"):Ye.emit("continue_generate_msg_from",{prompt:e,id:n}))}).catch(t=>{console.log("Error: Could not get generation status",t)})},stopGenerating(){this.stop_gen(),this.isGenerating=!1,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),console.log("Stopped generating"),Fe(()=>{const n=document.getElementById("messages-list");this.scrollBottom(n)})},finalMsgEvent(n){if(console.log("final",n),n.parent_id,this.discussion_id=n.discussion_id,this.currentDiscussion.id==this.discussion_id){const e=this.discussionArr.findIndex(t=>t.id==n.id);this.discussionArr[e].content=n.content,this.discussionArr[e].finished_generating_at=n.finished_generating_at}Fe(()=>{const e=document.getElementById("messages-list");this.scrollBottom(e)}),this.isGenerating=!1,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),this.chime.play()},copyToClipBoard(n){this.$store.state.toast.showToast("Copied to clipboard successfully",4,!0);let e="";n.message.binding&&(e=`Binding: ${n.message.binding}`);let t="";n.message.personality&&(t=` Personality: ${n.message.personality}`);let i="";n.created_at_parsed&&(i=` @@ -201,15 +201,15 @@ ${s} ${l}`;navigator.clipboard.writeText(c),Fe(()=>{Be.replace()})},closeToast(){this.showToast=!1},saveJSONtoFile(n,e){e=e||"data.json";const t=document.createElement("a");t.href=URL.createObjectURL(new Blob([JSON.stringify(n,null,2)],{type:"text/plain"})),t.setAttribute("download",e),document.body.appendChild(t),t.click(),document.body.removeChild(t)},saveMarkdowntoFile(n,e){e=e||"data.md";const t=document.createElement("a");t.href=URL.createObjectURL(new Blob([n],{type:"text/plain"})),t.setAttribute("download",e),document.body.appendChild(t),t.click(),document.body.removeChild(t)},parseJsonObj(n){try{return JSON.parse(n)}catch(e){return this.$store.state.toast.showToast(`Could not parse JSON. `+e.message,4,!1),null}},async parseJsonFile(n){return new Promise((e,t)=>{const i=new FileReader;i.onload=s=>e(this.parseJsonObj(s.target.result)),i.onerror=s=>t(s),i.readAsText(n)})},async exportDiscussionsAsMarkdown(){const n=this.list.filter(e=>e.checkBoxValue==!0).map(e=>e.id);if(n.length>0){console.log("export",n);let e=new Date;const t=e.getFullYear(),i=(e.getMonth()+1).toString().padStart(2,"0"),s=e.getDate().toString().padStart(2,"0"),r=e.getHours().toString().padStart(2,"0"),o=e.getMinutes().toString().padStart(2,"0"),a=e.getSeconds().toString().padStart(2,"0"),c="discussions_export_"+(t+"."+i+"."+s+"."+r+o+a)+".md";this.loading=!0;const d=await this.export_multiple_discussions(n,"markdown");d?(this.saveMarkdowntoFile(d,c),this.$store.state.toast.showToast("Successfully exported",4,!0),this.isCheckbox=!1):this.$store.state.toast.showToast("Failed to export discussions",4,!1),this.loading=!1}},async exportDiscussionsAsJson(){const n=this.list.filter(e=>e.checkBoxValue==!0).map(e=>e.id);if(n.length>0){console.log("export",n);let e=new Date;const t=e.getFullYear(),i=(e.getMonth()+1).toString().padStart(2,"0"),s=e.getDate().toString().padStart(2,"0"),r=e.getHours().toString().padStart(2,"0"),o=e.getMinutes().toString().padStart(2,"0"),a=e.getSeconds().toString().padStart(2,"0"),c="discussions_export_"+(t+"."+i+"."+s+"."+r+o+a)+".json";this.loading=!0;const d=await this.export_multiple_discussions(n,"json");d?(this.saveJSONtoFile(d,c),this.$store.state.toast.showToast("Successfully exported",4,!0),this.isCheckbox=!1):this.$store.state.toast.showToast("Failed to export discussions",4,!1),this.loading=!1}},async importDiscussions(n){const e=await this.parseJsonFile(n.target.files[0]);await this.import_multiple_discussions(e)?(this.$store.state.toast.showToast("Successfully imported ("+e.length+")",4,!0),await this.list_discussions()):this.$store.state.toast.showToast("Failed to import discussions",4,!1)},async getPersonalityAvatars(){for(;this.$store.state.personalities===null;)await new Promise(e=>setTimeout(e,100));let n=this.$store.state.personalities;this.personalityAvatars=n.map(e=>({name:e.name,avatar:e.avatar}))},getAvatar(n){if(n.toLowerCase().trim()==this.$store.state.config.user_name.toLowerCase().trim())return"user_infos/"+this.$store.state.config.user_avatar;const e=this.personalityAvatars.findIndex(i=>i.name===n),t=this.personalityAvatars[e];if(t)return console.log("Avatar",t.avatar),t.avatar},setFileListChat(n){try{this.$refs.chatBox.fileList=this.$refs.chatBox.fileList.concat(n)}catch(e){this.$store.state.toast.showToast(`Failed to set filelist in chatbox -`+e.message,4,!1)}this.isDragOverChat=!1},async setFileListDiscussion(n){if(n.length>1){this.$store.state.toast.showToast("Failed to import discussions. Too many files",4,!1);return}const e=await this.parseJsonFile(n[0]);await this.import_multiple_discussions(e)?(this.$store.state.toast.showToast("Successfully imported ("+e.length+")",4,!0),await this.list_discussions()):this.$store.state.toast.showToast("Failed to import discussions",4,!1),this.isDragOverDiscussion=!1}},async created(){for(this.$nextTick(()=>{Be.replace()}),Ye.on("disucssion_renamed",n=>{console.log("Received new title",n.discussion_id,n.title);const e=this.list.findIndex(i=>i.id==n.discussion_id),t=this.list[e];t.title=n.title}),Ye.onclose=n=>{console.log("WebSocket connection closed:",n.code,n.reason),this.socketIODisconnected()},Ye.on("connect_error",n=>{n.message==="ERR_CONNECTION_REFUSED"?console.error("Connection refused. The server is not available."):console.error("Connection error:",n),this.$store.state.isConnected=!1}),Ye.onerror=n=>{console.log("WebSocket connection error:",n.code,n.reason),this.socketIODisconnected(),Ye.disconnect()},Ye.on("connected",this.socketIOConnected),Ye.on("disconnected",this.socketIODisconnected),console.log("Added events"),console.log("Waiting to be ready");this.$store.state.ready===!1;)await new Promise(n=>setTimeout(n,100)),console.log(this.$store.state.ready);console.log("Ready"),this.setPageTitle(),await this.list_discussions(),this.loadLastUsedDiscussion(),Ye.on("show_progress",this.show_progress),Ye.on("hide_progress",this.hide_progress),Ye.on("update_progress",this.update_progress),Ye.on("notification",this.notify),Ye.on("new_message",this.new_message),Ye.on("update_message",this.streamMessageContent),Ye.on("close_message",this.finalMsgEvent),Ye.onopen=()=>{console.log("WebSocket connection established."),this.currentDiscussion!=null&&(this.setPageTitle(item),localStorage.setItem("selected_discussion",this.currentDiscussion.id),this.load_discussion(item.id,()=>{this.discussionArr.length>1&&(this.currentDiscussion.title===""||this.currentDiscussion.title===null)&&this.changeTitleUsingUserMSG(this.currentDiscussion.id,this.discussionArr[1].content)}))},this.isCreated=!0},async mounted(){this.$nextTick(()=>{Be.replace()})},async activated(){for(;this.isReady===!1;)await new Promise(n=>setTimeout(n,100));await this.getPersonalityAvatars(),console.log("Avatars found:",this.personalityAvatars),this.isCreated&&Fe(()=>{const n=document.getElementById("messages-list");this.scrollBottom(n)})},components:{Discussion:UE,Message:DN,ChatBox:LN,WelcomeComponent:kN,ChoiceDialog:rb,ProgressBar:ql,InputBox:MN},watch:{progress_visibility_val(n){console.log("progress_visibility changed")},filterTitle(n){n==""&&(this.filterInProgress=!0,this.list=this.tempList,this.filterInProgress=!1)},isCheckbox(n){Fe(()=>{Be.replace()}),n||(this.isSelectAll=!1)},socketConnected(n){console.log("Websocket connected (watch)",n)},showConfirmation(){Fe(()=>{Be.replace()})},isSearch(){Fe(()=>{Be.replace()})}},computed:{progress_visibility:{get(){return self.progress_visibility_val}},version_info:{get(){return this.$store.state.version!=null&&this.$store.state.version!="unknown"?" v"+this.$store.state.version:""}},loading_infos:{get(){return this.$store.state.loading_infos}},loading_progress:{get(){return this.$store.state.loading_progress}},isModelOk:{get(){return this.$store.state.isModelOk},set(n){this.$store.state.isModelOk=n}},isGenerating:{get(){return this.$store.state.isGenerating},set(n){this.$store.state.isGenerating=n}},formatted_database_name(){const n=this.$store.state.config.db_path;return n.slice(0,n.length-3)},UseDiscussionHistory(){return this.$store.state.config.use_discussions_history},isReady:{get(){return this.$store.state.ready}},databases(){return this.$store.state.databases},client_id(){return Ye.id},isReady(){return console.log("verify ready",this.isCreated),this.isCreated},showPanel(){return this.$store.state.ready&&!this.panelCollapsed},socketConnected(){return console.log(" --- > Websocket connected"),this.$store.commit("setIsConnected",!0),!0},socketDisconnected(){return this.$store.commit("setIsConnected",!1),console.log(" --- > Websocket disconnected"),!0},selectedDiscussions(){return Fe(()=>{Be.replace()}),this.list.filter(n=>n.checkBoxValue==!0)}}},Tbt=Object.assign(ybt,{__name:"DiscussionsView",setup(n){return Ms(()=>{tO()}),Ue.defaults.baseURL="/",(e,t)=>(O(),D($e,null,[Ie(ws,{name:"fade-and-fly"},{default:ot(()=>[e.isReady?j("",!0):(O(),D("div",Ygt,[_("div",$gt,[_("div",Wgt,[_("div",Kgt,[jgt,_("div",Qgt,[_("p",Xgt,"Lord of Large Language and Multimodal Systems "+he(e.version_info),1),Zgt,Jgt])]),eEt,tEt,_("div",nEt,[Ie(ql,{ref:"loading_progress",progress:e.loading_progress},null,8,["progress"]),_("p",iEt,he(e.loading_infos)+" ...",1)])])])]))]),_:1}),e.isReady?(O(),D("button",{key:0,onClick:t[0]||(t[0]=(...i)=>e.togglePanel&&e.togglePanel(...i)),class:"absolute top-0 left-0 z-50 p-2 m-2 bg-white rounded-full shadow-md bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-primary-light dark:hover:bg-primary"},[xe(_("div",null,rEt,512),[[At,e.panelCollapsed]]),xe(_("div",null,aEt,512),[[At,!e.panelCollapsed]])])):j("",!0),Ie(ws,{name:"slide-right"},{default:ot(()=>[e.showPanel?(O(),D("div",lEt,[_("div",{id:"leftPanel",class:"flex flex-col flex-grow overflow-y-scroll no-scrollbar",onDragover:t[22]||(t[22]=Te(i=>e.setDropZoneDiscussion(),["stop","prevent"]))},[_("div",cEt,[_("div",dEt,[_("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Create new discussion",type:"button",onClick:t[1]||(t[1]=i=>e.createNewDiscussion())},pEt),_("button",{class:He(["text-2xl hover:text-secondary duration-75 active:scale-90",e.isCheckbox?"text-secondary":""]),title:"Edit discussion list",type:"button",onClick:t[2]||(t[2]=i=>e.isCheckbox=!e.isCheckbox)},hEt,2),fEt,_("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Export database",type:"button",onClick:t[3]||(t[3]=Te(i=>e.database_selectorDialogVisible=!0,["stop"]))},gEt),_("input",{type:"file",ref:"fileDialog",style:{display:"none"},onChange:t[4]||(t[4]=(...i)=>e.importDiscussions&&e.importDiscussions(...i))},null,544),_("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Import discussions",type:"button",onClick:t[5]||(t[5]=Te(i=>e.$refs.fileDialog.click(),["stop"]))},bEt),e.isOpen?(O(),D("div",SEt,[_("button",{onClick:t[6]||(t[6]=(...i)=>e.importDiscussions&&e.importDiscussions(...i))},"LOLLMS"),_("button",{onClick:t[7]||(t[7]=(...i)=>e.importChatGPT&&e.importChatGPT(...i))},"ChatGPT")])):j("",!0),_("button",{class:He(["text-2xl hover:text-secondary duration-75 active:scale-90",e.isSearch?"text-secondary":""]),title:"Filter discussions",type:"button",onClick:t[8]||(t[8]=i=>e.isSearch=!e.isSearch)},yEt,2),e.showSaveConfirmation?j("",!0):(O(),D("button",{key:1,title:"Save configuration",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:t[9]||(t[9]=i=>e.showSaveConfirmation=!0)},xEt)),e.showSaveConfirmation?(O(),D("div",CEt,[_("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel",type:"button",onClick:t[10]||(t[10]=Te(i=>e.showSaveConfirmation=!1,["stop"]))},AEt),_("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm save changes",type:"button",onClick:t[11]||(t[11]=Te(i=>e.save_configuration(),["stop"]))},NEt)])):j("",!0),e.showBrainConfirmation?j("",!0):(O(),D("button",{key:3,title:"Activate Long term Memory",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:t[12]||(t[12]=i=>e.toggleLTM())},[e.loading?(O(),D("img",{key:0,src:vt(Hgt),width:"25",height:"25",class:"animate-pulse",title:"Applying config, please stand by..."},null,8,OEt)):e.UseDiscussionHistory?(O(),D("img",{key:1,src:vt(qgt),width:"25",height:"25"},null,8,IEt)):(O(),D("img",{key:2,src:vt(zgt),width:"25",height:"25"},null,8,MEt))])),e.loading?(O(),D("div",DEt,kEt)):j("",!0)]),e.isSearch?(O(),D("div",PEt,[_("div",UEt,[_("div",FEt,[BEt,_("div",GEt,[_("div",{class:He(["hover:text-secondary duration-75 active:scale-90",e.filterTitle?"visible":"invisible"]),title:"Clear",onClick:t[13]||(t[13]=i=>e.filterTitle="")},zEt,2)]),xe(_("input",{type:"search",id:"default-search",class:"block w-full p-2 pl-10 pr-10 text-sm border border-gray-300 rounded-lg bg-bg-light focus:ring-secondary focus:border-secondary dark:bg-bg-dark dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-secondary dark:focus:border-secondary",placeholder:"Search...",title:"Filter discussions by title","onUpdate:modelValue":t[14]||(t[14]=i=>e.filterTitle=i),onInput:t[15]||(t[15]=i=>e.filterDiscussions())},null,544),[[Xe,e.filterTitle]])])])])):j("",!0),e.isCheckbox?(O(),D("hr",HEt)):j("",!0),e.isCheckbox?(O(),D("div",qEt,[_("div",YEt,[e.selectedDiscussions.length>0?(O(),D("p",$Et,"Selected: "+he(e.selectedDiscussions.length),1)):j("",!0)]),_("div",WEt,[e.selectedDiscussions.length>0?(O(),D("div",KEt,[e.showConfirmation?j("",!0):(O(),D("button",{key:0,class:"flex mx-3 flex-1 text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Remove selected",type:"button",onClick:t[16]||(t[16]=Te(i=>e.showConfirmation=!0,["stop"]))},QEt)),e.showConfirmation?(O(),D("div",XEt,[_("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm removal",type:"button",onClick:t[17]||(t[17]=Te((...i)=>e.deleteDiscussionMulti&&e.deleteDiscussionMulti(...i),["stop"]))},JEt),_("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel removal",type:"button",onClick:t[18]||(t[18]=Te(i=>e.showConfirmation=!1,["stop"]))},tbt)])):j("",!0)])):j("",!0),_("div",nbt,[_("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Export selected to a json file",type:"button",onClick:t[19]||(t[19]=Te((...i)=>e.exportDiscussionsAsJson&&e.exportDiscussionsAsJson(...i),["stop"]))},sbt),_("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Export selected to a martkdown file",type:"button",onClick:t[20]||(t[20]=Te((...i)=>e.exportDiscussionsAsMarkdown&&e.exportDiscussionsAsMarkdown(...i),["stop"]))},obt),_("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Select All",type:"button",onClick:t[21]||(t[21]=Te((...i)=>e.selectAllDiscussions&&e.selectAllDiscussions(...i),["stop"]))},lbt)])])])):j("",!0)]),_("div",cbt,[_("div",{class:He(["mx-4 flex flex-col flex-grow w-full",e.isDragOverDiscussion?"pointer-events-none":""])},[_("div",{id:"dis-list",class:He([e.filterInProgress?"opacity-20 pointer-events-none":"","flex flex-col flex-grow w-full"])},[e.list.length>0?(O(),Ot(ys,{key:0,name:"list"},{default:ot(()=>[(O(!0),D($e,null,lt(e.list,(i,s)=>(O(),Ot(UE,{key:i.id,id:i.id,title:i.title,selected:e.currentDiscussion.id==i.id,loading:i.loading,isCheckbox:e.isCheckbox,checkBoxValue:i.checkBoxValue,onSelect:r=>e.selectDiscussion(i),onDelete:r=>e.deleteDiscussion(i.id),onEditTitle:e.editTitle,onMakeTitle:e.makeTitle,onChecked:e.checkUncheckDiscussion},null,8,["id","title","selected","loading","isCheckbox","checkBoxValue","onSelect","onDelete","onEditTitle","onMakeTitle","onChecked"]))),128))]),_:1})):j("",!0),e.list.length<1?(O(),D("div",dbt,pbt)):j("",!0),_bt],2)],2)])],32),_("div",{class:"absolute bottom-0 left-0 w-full bg-blue-200 dark:bg-blue-800 text-white py-2 cursor-pointer hover:text-green-500",onClick:t[23]||(t[23]=(...i)=>e.showDatabaseSelector&&e.showDatabaseSelector(...i))},[_("p",hbt,"Current database: "+he(e.formatted_database_name),1)])])):j("",!0)]),_:1}),e.isReady?(O(),D("div",fbt,[_("div",{id:"messages-list",class:He(["w-full z-0 flex flex-col flex-grow overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",e.isDragOverChat?"pointer-events-none":""])},[_("div",mbt,[e.discussionArr.length>0?(O(),Ot(ys,{key:0,name:"list"},{default:ot(()=>[(O(!0),D($e,null,lt(e.discussionArr,(i,s)=>(O(),Ot(DN,{key:i.id,message:i,id:"msg-"+i.id,host:e.host,ref_for:!0,ref:"messages",onCopy:e.copyToClipBoard,onDelete:e.deleteMessage,onRankUp:e.rankUpMessage,onRankDown:e.rankDownMessage,onUpdateMessage:e.updateMessage,onResendMessage:e.resendMessage,onContinueMessage:e.continueMessage,avatar:e.getAvatar(i.sender)},null,8,["message","id","host","onCopy","onDelete","onRankUp","onRankDown","onUpdateMessage","onResendMessage","onContinueMessage","avatar"]))),128))]),_:1})):j("",!0),e.currentDiscussion.id?j("",!0):(O(),Ot(kN,{key:1})),gbt]),Ebt,e.currentDiscussion.id?(O(),D("div",bbt,[Ie(LN,{ref:"chatBox",loading:e.isGenerating,discussionList:e.discussionArr,"on-show-toast-message":e.showToastMessage,"on-talk":e.talk,onPersonalitySelected:e.recoverFiles,onMessageSentEvent:e.sendMsg,onSendCMDEvent:e.sendCmd,onAddWebLink:e.add_webpage,onCreateEmptyUserMessage:e.createEmptyUserMessage,onCreateEmptyAIMessage:e.createEmptyAIMessage,onStopGenerating:e.stopGenerating,onLoaded:e.recoverFiles},null,8,["loading","discussionList","on-show-toast-message","on-talk","onPersonalitySelected","onMessageSentEvent","onSendCMDEvent","onAddWebLink","onCreateEmptyUserMessage","onCreateEmptyAIMessage","onStopGenerating","onLoaded"])])):j("",!0)],2)])):j("",!0),Ie(rb,{reference:"database_selector",class:"z-20",show:e.database_selectorDialogVisible,choices:e.databases,onChoiceSelected:e.ondatabase_selectorDialogSelected,onCloseDialog:e.onclosedatabase_selectorDialog,onChoiceValidated:e.onvalidatedatabase_selectorChoice},null,8,["show","choices","onChoiceSelected","onCloseDialog","onChoiceValidated"]),xe(_("div",Sbt,[Ie(ql,{ref:"progress",progress:e.progress_value,class:"w-full h-4"},null,8,["progress"]),_("p",vbt,he(e.loading_infos)+" ...",1)],512),[[At,e.progress_visibility]]),Ie(MN,{"prompt-text":"Enter the url to the page to use as discussion support",onOk:e.handleOk,ref:"web_url_input_box"},null,8,["onOk"])],64))}}),xbt=gt(Tbt,[["__scopeId","data-v-7a271009"]]);/** +`+e.message,4,!1)}this.isDragOverChat=!1},async setFileListDiscussion(n){if(n.length>1){this.$store.state.toast.showToast("Failed to import discussions. Too many files",4,!1);return}const e=await this.parseJsonFile(n[0]);await this.import_multiple_discussions(e)?(this.$store.state.toast.showToast("Successfully imported ("+e.length+")",4,!0),await this.list_discussions()):this.$store.state.toast.showToast("Failed to import discussions",4,!1),this.isDragOverDiscussion=!1}},async created(){for(this.$nextTick(()=>{Be.replace()}),Ye.on("disucssion_renamed",n=>{console.log("Received new title",n.discussion_id,n.title);const e=this.list.findIndex(i=>i.id==n.discussion_id),t=this.list[e];t.title=n.title}),Ye.onclose=n=>{console.log("WebSocket connection closed:",n.code,n.reason),this.socketIODisconnected()},Ye.on("connect_error",n=>{n.message==="ERR_CONNECTION_REFUSED"?console.error("Connection refused. The server is not available."):console.error("Connection error:",n),this.$store.state.isConnected=!1}),Ye.onerror=n=>{console.log("WebSocket connection error:",n.code,n.reason),this.socketIODisconnected(),Ye.disconnect()},Ye.on("connected",this.socketIOConnected),Ye.on("disconnected",this.socketIODisconnected),console.log("Added events"),console.log("Waiting to be ready");this.$store.state.ready===!1;)await new Promise(n=>setTimeout(n,100)),console.log(this.$store.state.ready);console.log("Ready"),this.setPageTitle(),await this.list_discussions(),this.loadLastUsedDiscussion(),Ye.on("show_progress",this.show_progress),Ye.on("hide_progress",this.hide_progress),Ye.on("update_progress",this.update_progress),Ye.on("notification",this.notify),Ye.on("new_message",this.new_message),Ye.on("update_message",this.streamMessageContent),Ye.on("close_message",this.finalMsgEvent),Ye.onopen=()=>{console.log("WebSocket connection established."),this.currentDiscussion!=null&&(this.setPageTitle(item),localStorage.setItem("selected_discussion",this.currentDiscussion.id),this.load_discussion(item.id,()=>{this.discussionArr.length>1&&(this.currentDiscussion.title===""||this.currentDiscussion.title===null)&&this.changeTitleUsingUserMSG(this.currentDiscussion.id,this.discussionArr[1].content)}))},this.isCreated=!0},async mounted(){this.$nextTick(()=>{Be.replace()})},async activated(){for(;this.isReady===!1;)await new Promise(n=>setTimeout(n,100));await this.getPersonalityAvatars(),console.log("Avatars found:",this.personalityAvatars),this.isCreated&&Fe(()=>{const n=document.getElementById("messages-list");this.scrollBottom(n)})},components:{Discussion:UE,Message:DN,ChatBox:LN,WelcomeComponent:kN,ChoiceDialog:rb,ProgressBar:ql,InputBox:MN},watch:{progress_visibility_val(n){console.log("progress_visibility changed")},filterTitle(n){n==""&&(this.filterInProgress=!0,this.list=this.tempList,this.filterInProgress=!1)},isCheckbox(n){Fe(()=>{Be.replace()}),n||(this.isSelectAll=!1)},socketConnected(n){console.log("Websocket connected (watch)",n)},showConfirmation(){Fe(()=>{Be.replace()})},isSearch(){Fe(()=>{Be.replace()})}},computed:{progress_visibility:{get(){return self.progress_visibility_val}},version_info:{get(){return this.$store.state.version!=null&&this.$store.state.version!="unknown"?" v"+this.$store.state.version:""}},loading_infos:{get(){return this.$store.state.loading_infos}},loading_progress:{get(){return this.$store.state.loading_progress}},isModelOk:{get(){return this.$store.state.isModelOk},set(n){this.$store.state.isModelOk=n}},isGenerating:{get(){return this.$store.state.isGenerating},set(n){this.$store.state.isGenerating=n}},formatted_database_name(){const n=this.$store.state.config.db_path;return n.slice(0,n.length-3)},UseDiscussionHistory(){return this.$store.state.config.use_discussions_history},isReady:{get(){return this.$store.state.ready}},databases(){return this.$store.state.databases},client_id(){return Ye.id},isReady(){return console.log("verify ready",this.isCreated),this.isCreated},showPanel(){return this.$store.state.ready&&!this.panelCollapsed},socketConnected(){return console.log(" --- > Websocket connected"),this.$store.commit("setIsConnected",!0),!0},socketDisconnected(){return this.$store.commit("setIsConnected",!1),console.log(" --- > Websocket disconnected"),!0},selectedDiscussions(){return Fe(()=>{Be.replace()}),this.list.filter(n=>n.checkBoxValue==!0)}}},ybt=Object.assign(vbt,{__name:"DiscussionsView",setup(n){return Ms(()=>{tO()}),Ue.defaults.baseURL="/",(e,t)=>(O(),D($e,null,[Ie(ws,{name:"fade-and-fly"},{default:ot(()=>[e.isReady?j("",!0):(O(),D("div",qgt,[_("div",Ygt,[_("div",$gt,[_("div",Wgt,[Kgt,_("div",jgt,[_("p",Qgt,"Lord of Large Language and Multimodal Systems "+he(e.version_info),1),Xgt,Zgt])]),Jgt,eEt,_("div",tEt,[Ie(ql,{ref:"loading_progress",progress:e.loading_progress},null,8,["progress"]),_("p",nEt,he(e.loading_infos)+" ...",1)])])])]))]),_:1}),e.isReady?(O(),D("button",{key:0,onClick:t[0]||(t[0]=(...i)=>e.togglePanel&&e.togglePanel(...i)),class:"absolute top-0 left-0 z-50 p-2 m-2 bg-white rounded-full shadow-md bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-primary-light dark:hover:bg-primary"},[xe(_("div",null,sEt,512),[[At,e.panelCollapsed]]),xe(_("div",null,oEt,512),[[At,!e.panelCollapsed]])])):j("",!0),Ie(ws,{name:"slide-right"},{default:ot(()=>[e.showPanel?(O(),D("div",aEt,[_("div",{id:"leftPanel",class:"flex flex-col flex-grow overflow-y-scroll no-scrollbar",onDragover:t[22]||(t[22]=Te(i=>e.setDropZoneDiscussion(),["stop","prevent"]))},[_("div",lEt,[_("div",cEt,[_("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Create new discussion",type:"button",onClick:t[1]||(t[1]=i=>e.createNewDiscussion())},uEt),_("button",{class:He(["text-2xl hover:text-secondary duration-75 active:scale-90",e.isCheckbox?"text-secondary":""]),title:"Edit discussion list",type:"button",onClick:t[2]||(t[2]=i=>e.isCheckbox=!e.isCheckbox)},_Et,2),hEt,_("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Export database",type:"button",onClick:t[3]||(t[3]=Te(i=>e.database_selectorDialogVisible=!0,["stop"]))},mEt),_("input",{type:"file",ref:"fileDialog",style:{display:"none"},onChange:t[4]||(t[4]=(...i)=>e.importDiscussions&&e.importDiscussions(...i))},null,544),_("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Import discussions",type:"button",onClick:t[5]||(t[5]=Te(i=>e.$refs.fileDialog.click(),["stop"]))},EEt),e.isOpen?(O(),D("div",bEt,[_("button",{onClick:t[6]||(t[6]=(...i)=>e.importDiscussions&&e.importDiscussions(...i))},"LOLLMS"),_("button",{onClick:t[7]||(t[7]=(...i)=>e.importChatGPT&&e.importChatGPT(...i))},"ChatGPT")])):j("",!0),_("button",{class:He(["text-2xl hover:text-secondary duration-75 active:scale-90",e.isSearch?"text-secondary":""]),title:"Filter discussions",type:"button",onClick:t[8]||(t[8]=i=>e.isSearch=!e.isSearch)},vEt,2),e.showSaveConfirmation?j("",!0):(O(),D("button",{key:1,title:"Save configuration",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:t[9]||(t[9]=i=>e.showSaveConfirmation=!0)},TEt)),e.showSaveConfirmation?(O(),D("div",xEt,[_("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel",type:"button",onClick:t[10]||(t[10]=Te(i=>e.showSaveConfirmation=!1,["stop"]))},REt),_("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm save changes",type:"button",onClick:t[11]||(t[11]=Te(i=>e.save_configuration(),["stop"]))},wEt)])):j("",!0),e.showBrainConfirmation?j("",!0):(O(),D("button",{key:3,title:"Activate Long term Memory",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:t[12]||(t[12]=i=>e.toggleLTM())},[e.loading?(O(),D("img",{key:0,src:vt(zgt),width:"25",height:"25",class:"animate-pulse",title:"Applying config, please stand by..."},null,8,NEt)):e.UseDiscussionHistory?(O(),D("img",{key:1,src:vt(Hgt),width:"25",height:"25"},null,8,OEt)):(O(),D("img",{key:2,src:vt(Vgt),width:"25",height:"25"},null,8,IEt))])),e.loading?(O(),D("div",MEt,LEt)):j("",!0)]),e.isSearch?(O(),D("div",kEt,[_("div",PEt,[_("div",UEt,[FEt,_("div",BEt,[_("div",{class:He(["hover:text-secondary duration-75 active:scale-90",e.filterTitle?"visible":"invisible"]),title:"Clear",onClick:t[13]||(t[13]=i=>e.filterTitle="")},VEt,2)]),xe(_("input",{type:"search",id:"default-search",class:"block w-full p-2 pl-10 pr-10 text-sm border border-gray-300 rounded-lg bg-bg-light focus:ring-secondary focus:border-secondary dark:bg-bg-dark dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-secondary dark:focus:border-secondary",placeholder:"Search...",title:"Filter discussions by title","onUpdate:modelValue":t[14]||(t[14]=i=>e.filterTitle=i),onInput:t[15]||(t[15]=i=>e.filterDiscussions())},null,544),[[Xe,e.filterTitle]])])])])):j("",!0),e.isCheckbox?(O(),D("hr",zEt)):j("",!0),e.isCheckbox?(O(),D("div",HEt,[_("div",qEt,[e.selectedDiscussions.length>0?(O(),D("p",YEt,"Selected: "+he(e.selectedDiscussions.length),1)):j("",!0)]),_("div",$Et,[e.selectedDiscussions.length>0?(O(),D("div",WEt,[e.showConfirmation?j("",!0):(O(),D("button",{key:0,class:"flex mx-3 flex-1 text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Remove selected",type:"button",onClick:t[16]||(t[16]=Te(i=>e.showConfirmation=!0,["stop"]))},jEt)),e.showConfirmation?(O(),D("div",QEt,[_("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm removal",type:"button",onClick:t[17]||(t[17]=Te((...i)=>e.deleteDiscussionMulti&&e.deleteDiscussionMulti(...i),["stop"]))},ZEt),_("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel removal",type:"button",onClick:t[18]||(t[18]=Te(i=>e.showConfirmation=!1,["stop"]))},ebt)])):j("",!0)])):j("",!0),_("div",tbt,[_("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Export selected to a json file",type:"button",onClick:t[19]||(t[19]=Te((...i)=>e.exportDiscussionsAsJson&&e.exportDiscussionsAsJson(...i),["stop"]))},ibt),_("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Export selected to a martkdown file",type:"button",onClick:t[20]||(t[20]=Te((...i)=>e.exportDiscussionsAsMarkdown&&e.exportDiscussionsAsMarkdown(...i),["stop"]))},rbt),_("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Select All",type:"button",onClick:t[21]||(t[21]=Te((...i)=>e.selectAllDiscussions&&e.selectAllDiscussions(...i),["stop"]))},abt)])])])):j("",!0)]),_("div",lbt,[_("div",{class:He(["mx-4 flex flex-col flex-grow w-full",e.isDragOverDiscussion?"pointer-events-none":""])},[_("div",{id:"dis-list",class:He([e.filterInProgress?"opacity-20 pointer-events-none":"","flex flex-col flex-grow w-full"])},[e.list.length>0?(O(),Ot(ys,{key:0,name:"list"},{default:ot(()=>[(O(!0),D($e,null,lt(e.list,(i,s)=>(O(),Ot(UE,{key:i.id,id:i.id,title:i.title,selected:e.currentDiscussion.id==i.id,loading:i.loading,isCheckbox:e.isCheckbox,checkBoxValue:i.checkBoxValue,onSelect:r=>e.selectDiscussion(i),onDelete:r=>e.deleteDiscussion(i.id),onEditTitle:e.editTitle,onMakeTitle:e.makeTitle,onChecked:e.checkUncheckDiscussion},null,8,["id","title","selected","loading","isCheckbox","checkBoxValue","onSelect","onDelete","onEditTitle","onMakeTitle","onChecked"]))),128))]),_:1})):j("",!0),e.list.length<1?(O(),D("div",cbt,ubt)):j("",!0),pbt],2)],2)])],32),_("div",{class:"absolute bottom-0 left-0 w-full bg-blue-200 dark:bg-blue-800 text-white py-2 cursor-pointer hover:text-green-500",onClick:t[23]||(t[23]=(...i)=>e.showDatabaseSelector&&e.showDatabaseSelector(...i))},[_("p",_bt,"Current database: "+he(e.formatted_database_name),1)])])):j("",!0)]),_:1}),e.isReady?(O(),D("div",hbt,[_("div",{id:"messages-list",class:He(["w-full z-0 flex flex-col flex-grow overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",e.isDragOverChat?"pointer-events-none":""])},[_("div",fbt,[e.discussionArr.length>0?(O(),Ot(ys,{key:0,name:"list"},{default:ot(()=>[(O(!0),D($e,null,lt(e.discussionArr,(i,s)=>(O(),Ot(DN,{key:i.id,message:i,id:"msg-"+i.id,host:e.host,ref_for:!0,ref:"messages",onCopy:e.copyToClipBoard,onDelete:e.deleteMessage,onRankUp:e.rankUpMessage,onRankDown:e.rankDownMessage,onUpdateMessage:e.updateMessage,onResendMessage:e.resendMessage,onContinueMessage:e.continueMessage,avatar:e.getAvatar(i.sender)},null,8,["message","id","host","onCopy","onDelete","onRankUp","onRankDown","onUpdateMessage","onResendMessage","onContinueMessage","avatar"]))),128))]),_:1})):j("",!0),e.currentDiscussion.id?j("",!0):(O(),Ot(kN,{key:1})),mbt]),gbt,e.currentDiscussion.id?(O(),D("div",Ebt,[Ie(LN,{ref:"chatBox",loading:e.isGenerating,discussionList:e.discussionArr,"on-show-toast-message":e.showToastMessage,"on-talk":e.talk,onPersonalitySelected:e.recoverFiles,onMessageSentEvent:e.sendMsg,onSendCMDEvent:e.sendCmd,onAddWebLink:e.add_webpage,onCreateEmptyUserMessage:e.createEmptyUserMessage,onCreateEmptyAIMessage:e.createEmptyAIMessage,onStopGenerating:e.stopGenerating,onLoaded:e.recoverFiles},null,8,["loading","discussionList","on-show-toast-message","on-talk","onPersonalitySelected","onMessageSentEvent","onSendCMDEvent","onAddWebLink","onCreateEmptyUserMessage","onCreateEmptyAIMessage","onStopGenerating","onLoaded"])])):j("",!0)],2)])):j("",!0),Ie(rb,{reference:"database_selector",class:"z-20",show:e.database_selectorDialogVisible,choices:e.databases,onChoiceSelected:e.ondatabase_selectorDialogSelected,onCloseDialog:e.onclosedatabase_selectorDialog,onChoiceValidated:e.onvalidatedatabase_selectorChoice},null,8,["show","choices","onChoiceSelected","onCloseDialog","onChoiceValidated"]),xe(_("div",bbt,[Ie(ql,{ref:"progress",progress:e.progress_value,class:"w-full h-4"},null,8,["progress"]),_("p",Sbt,he(e.loading_infos)+" ...",1)],512),[[At,e.progress_visibility]]),Ie(MN,{"prompt-text":"Enter the url to the page to use as discussion support",onOk:e.handleOk,ref:"web_url_input_box"},null,8,["onOk"])],64))}}),Tbt=gt(ybt,[["__scopeId","data-v-7a271009"]]);/** * @license * Copyright 2010-2023 Three.js Authors * SPDX-License-Identifier: MIT - */const Rb="159",Cbt=0,fC=1,Rbt=2,nO=1,Abt=2,gs=3,Os=0,Wn=1,Hi=2,dr=0,Jo=1,mC=2,gC=3,EC=4,wbt=5,Gr=100,Nbt=101,Obt=102,bC=103,SC=104,Ibt=200,Mbt=201,Dbt=202,Lbt=203,Fg=204,Bg=205,kbt=206,Pbt=207,Ubt=208,Fbt=209,Bbt=210,Gbt=211,Vbt=212,zbt=213,Hbt=214,qbt=0,Ybt=1,$bt=2,nu=3,Wbt=4,Kbt=5,jbt=6,Qbt=7,Ab=0,Xbt=1,Zbt=2,ur=0,Jbt=1,eSt=2,tSt=3,nSt=4,iSt=5,vC="attached",sSt="detached",iO=300,ma=301,ga=302,Gg=303,Vg=304,Ku=306,Ea=1e3,di=1001,iu=1002,gn=1003,zg=1004,wd=1005,qn=1006,sO=1007,io=1008,pr=1009,rSt=1010,oSt=1011,wb=1012,rO=1013,or=1014,Ss=1015,Ql=1016,oO=1017,aO=1018,jr=1020,aSt=1021,ui=1023,lSt=1024,cSt=1025,Qr=1026,ba=1027,dSt=1028,lO=1029,uSt=1030,cO=1031,dO=1033,Em=33776,bm=33777,Sm=33778,vm=33779,yC=35840,TC=35841,xC=35842,CC=35843,uO=36196,RC=37492,AC=37496,wC=37808,NC=37809,OC=37810,IC=37811,MC=37812,DC=37813,LC=37814,kC=37815,PC=37816,UC=37817,FC=37818,BC=37819,GC=37820,VC=37821,ym=36492,zC=36494,HC=36495,pSt=36283,qC=36284,YC=36285,$C=36286,Xl=2300,Sa=2301,Tm=2302,WC=2400,KC=2401,jC=2402,_St=2500,hSt=0,pO=1,Hg=2,_O=3e3,Xr=3001,fSt=3200,mSt=3201,Nb=0,gSt=1,pi="",tn="srgb",Cn="srgb-linear",Ob="display-p3",ju="display-p3-linear",su="linear",$t="srgb",ru="rec709",ou="p3",yo=7680,QC=519,ESt=512,bSt=513,SSt=514,hO=515,vSt=516,ySt=517,TSt=518,xSt=519,qg=35044,XC="300 es",Yg=1035,vs=2e3,au=2001;class Va{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const s=this._listeners[e];if(s!==void 0){const r=s.indexOf(t);r!==-1&&s.splice(r,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const i=this._listeners[e.type];if(i!==void 0){e.target=this;const s=i.slice(0);for(let r=0,o=s.length;r>8&255]+An[n>>16&255]+An[n>>24&255]+"-"+An[e&255]+An[e>>8&255]+"-"+An[e>>16&15|64]+An[e>>24&255]+"-"+An[t&63|128]+An[t>>8&255]+"-"+An[t>>16&255]+An[t>>24&255]+An[i&255]+An[i>>8&255]+An[i>>16&255]+An[i>>24&255]).toLowerCase()}function On(n,e,t){return Math.max(e,Math.min(t,n))}function Ib(n,e){return(n%e+e)%e}function CSt(n,e,t,i,s){return i+(n-e)*(s-i)/(t-e)}function RSt(n,e,t){return n!==e?(t-n)/(e-n):0}function Nl(n,e,t){return(1-t)*n+t*e}function ASt(n,e,t,i){return Nl(n,e,1-Math.exp(-t*i))}function wSt(n,e=1){return e-Math.abs(Ib(n,e*2)-e)}function NSt(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function OSt(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function ISt(n,e){return n+Math.floor(Math.random()*(e-n+1))}function MSt(n,e){return n+Math.random()*(e-n)}function DSt(n){return n*(.5-Math.random())}function LSt(n){n!==void 0&&(ZC=n);let e=ZC+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function kSt(n){return n*wl}function PSt(n){return n*va}function $g(n){return(n&n-1)===0&&n!==0}function USt(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function lu(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function FSt(n,e,t,i,s){const r=Math.cos,o=Math.sin,a=r(t/2),l=o(t/2),c=r((e+i)/2),d=o((e+i)/2),u=r((e-i)/2),h=o((e-i)/2),m=r((i-e)/2),f=o((i-e)/2);switch(s){case"XYX":n.set(a*d,l*u,l*h,a*c);break;case"YZY":n.set(l*h,a*d,l*u,a*c);break;case"ZXZ":n.set(l*u,l*h,a*d,a*c);break;case"XZX":n.set(a*d,l*f,l*m,a*c);break;case"YXY":n.set(l*m,a*d,l*f,a*c);break;case"ZYZ":n.set(l*f,l*m,a*d,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}}function qi(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Gt(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const BSt={DEG2RAD:wl,RAD2DEG:va,generateUUID:Mi,clamp:On,euclideanModulo:Ib,mapLinear:CSt,inverseLerp:RSt,lerp:Nl,damp:ASt,pingpong:wSt,smoothstep:NSt,smootherstep:OSt,randInt:ISt,randFloat:MSt,randFloatSpread:DSt,seededRandom:LSt,degToRad:kSt,radToDeg:PSt,isPowerOfTwo:$g,ceilPowerOfTwo:USt,floorPowerOfTwo:lu,setQuaternionFromProperEuler:FSt,normalize:Gt,denormalize:qi};class Rt{constructor(e=0,t=0){Rt.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6],this.y=s[1]*t+s[4]*i+s[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(On(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),s=Math.sin(t),r=this.x-e.x,o=this.y-e.y;return this.x=r*i-o*s+e.x,this.y=r*s+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class yt{constructor(e,t,i,s,r,o,a,l,c){yt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,s,r,o,a,l,c)}set(e,t,i,s,r,o,a,l,c){const d=this.elements;return d[0]=e,d[1]=s,d[2]=a,d[3]=t,d[4]=r,d[5]=l,d[6]=i,d[7]=o,d[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,s=t.elements,r=this.elements,o=i[0],a=i[3],l=i[6],c=i[1],d=i[4],u=i[7],h=i[2],m=i[5],f=i[8],b=s[0],E=s[3],g=s[6],S=s[1],y=s[4],T=s[7],C=s[2],x=s[5],w=s[8];return r[0]=o*b+a*S+l*C,r[3]=o*E+a*y+l*x,r[6]=o*g+a*T+l*w,r[1]=c*b+d*S+u*C,r[4]=c*E+d*y+u*x,r[7]=c*g+d*T+u*w,r[2]=h*b+m*S+f*C,r[5]=h*E+m*y+f*x,r[8]=h*g+m*T+f*w,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8];return t*o*d-t*a*c-i*r*d+i*a*l+s*r*c-s*o*l}invert(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8],u=d*o-a*c,h=a*l-d*r,m=c*r-o*l,f=t*u+i*h+s*m;if(f===0)return this.set(0,0,0,0,0,0,0,0,0);const b=1/f;return e[0]=u*b,e[1]=(s*c-d*i)*b,e[2]=(a*i-s*o)*b,e[3]=h*b,e[4]=(d*t-s*l)*b,e[5]=(s*r-a*t)*b,e[6]=m*b,e[7]=(i*l-c*t)*b,e[8]=(o*t-i*r)*b,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,s,r,o,a){const l=Math.cos(r),c=Math.sin(r);return this.set(i*l,i*c,-i*(l*o+c*a)+o+e,-s*c,s*l,-s*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(xm.makeScale(e,t)),this}rotate(e){return this.premultiply(xm.makeRotation(-e)),this}translate(e,t){return this.premultiply(xm.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let s=0;s<9;s++)if(t[s]!==i[s])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const xm=new yt;function fO(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}function Zl(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function GSt(){const n=Zl("canvas");return n.style.display="block",n}const JC={};function Ol(n){n in JC||(JC[n]=!0,console.warn(n))}const e1=new yt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),t1=new yt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Gc={[Cn]:{transfer:su,primaries:ru,toReference:n=>n,fromReference:n=>n},[tn]:{transfer:$t,primaries:ru,toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[ju]:{transfer:su,primaries:ou,toReference:n=>n.applyMatrix3(t1),fromReference:n=>n.applyMatrix3(e1)},[Ob]:{transfer:$t,primaries:ou,toReference:n=>n.convertSRGBToLinear().applyMatrix3(t1),fromReference:n=>n.applyMatrix3(e1).convertLinearToSRGB()}},VSt=new Set([Cn,ju]),kt={enabled:!0,_workingColorSpace:Cn,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(n){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!n},get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!VSt.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,e,t){if(this.enabled===!1||e===t||!e||!t)return n;const i=Gc[e].toReference,s=Gc[t].fromReference;return s(i(n))},fromWorkingColorSpace:function(n,e){return this.convert(n,this._workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this._workingColorSpace)},getPrimaries:function(n){return Gc[n].primaries},getTransfer:function(n){return n===pi?su:Gc[n].transfer}};function ea(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Cm(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let To;class mO{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{To===void 0&&(To=Zl("canvas")),To.width=e.width,To.height=e.height;const i=To.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=To}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Zl("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const s=i.getImageData(0,0,e.width,e.height),r=s.data;for(let o=0;o0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==iO)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Ea:e.x=e.x-Math.floor(e.x);break;case di:e.x=e.x<0?0:1;break;case iu:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Ea:e.y=e.y-Math.floor(e.y);break;case di:e.y=e.y<0?0:1;break;case iu:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return Ol("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===tn?Xr:_O}set encoding(e){Ol("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===Xr?tn:pi}}xn.DEFAULT_IMAGE=null;xn.DEFAULT_MAPPING=iO;xn.DEFAULT_ANISOTROPY=1;class Ht{constructor(e=0,t=0,i=0,s=1){Ht.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=s}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,s){return this.x=e,this.y=t,this.z=i,this.w=s,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,s=this.z,r=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*s+o[12]*r,this.y=o[1]*t+o[5]*i+o[9]*s+o[13]*r,this.z=o[2]*t+o[6]*i+o[10]*s+o[14]*r,this.w=o[3]*t+o[7]*i+o[11]*s+o[15]*r,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,s,r;const l=e.elements,c=l[0],d=l[4],u=l[8],h=l[1],m=l[5],f=l[9],b=l[2],E=l[6],g=l[10];if(Math.abs(d-h)<.01&&Math.abs(u-b)<.01&&Math.abs(f-E)<.01){if(Math.abs(d+h)<.1&&Math.abs(u+b)<.1&&Math.abs(f+E)<.1&&Math.abs(c+m+g-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const y=(c+1)/2,T=(m+1)/2,C=(g+1)/2,x=(d+h)/4,w=(u+b)/4,R=(f+E)/4;return y>T&&y>C?y<.01?(i=0,s=.707106781,r=.707106781):(i=Math.sqrt(y),s=x/i,r=w/i):T>C?T<.01?(i=.707106781,s=0,r=.707106781):(s=Math.sqrt(T),i=x/s,r=R/s):C<.01?(i=.707106781,s=.707106781,r=0):(r=Math.sqrt(C),i=w/r,s=R/r),this.set(i,s,r,t),this}let S=Math.sqrt((E-f)*(E-f)+(u-b)*(u-b)+(h-d)*(h-d));return Math.abs(S)<.001&&(S=1),this.x=(E-f)/S,this.y=(u-b)/S,this.z=(h-d)/S,this.w=Math.acos((c+m+g-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class qSt extends Va{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Ht(0,0,e,t),this.scissorTest=!1,this.viewport=new Ht(0,0,e,t);const s={width:e,height:t,depth:1};i.encoding!==void 0&&(Ol("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),i.colorSpace=i.encoding===Xr?tn:pi),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:qn,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},i),this.texture=new xn(s,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=i.generateMipmaps,this.texture.internalFormat=i.internalFormat,this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.depthTexture=i.depthTexture,this.samples=i.samples}setSize(e,t,i=1){(this.width!==e||this.height!==t||this.depth!==i)&&(this.width=e,this.height=t,this.depth=i,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=i,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new gO(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class so extends qSt{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}}class EO extends xn{constructor(e=null,t=1,i=1,s=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:s},this.magFilter=gn,this.minFilter=gn,this.wrapR=di,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class YSt extends xn{constructor(e=null,t=1,i=1,s=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:s},this.magFilter=gn,this.minFilter=gn,this.wrapR=di,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class br{constructor(e=0,t=0,i=0,s=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=s}static slerpFlat(e,t,i,s,r,o,a){let l=i[s+0],c=i[s+1],d=i[s+2],u=i[s+3];const h=r[o+0],m=r[o+1],f=r[o+2],b=r[o+3];if(a===0){e[t+0]=l,e[t+1]=c,e[t+2]=d,e[t+3]=u;return}if(a===1){e[t+0]=h,e[t+1]=m,e[t+2]=f,e[t+3]=b;return}if(u!==b||l!==h||c!==m||d!==f){let E=1-a;const g=l*h+c*m+d*f+u*b,S=g>=0?1:-1,y=1-g*g;if(y>Number.EPSILON){const C=Math.sqrt(y),x=Math.atan2(C,g*S);E=Math.sin(E*x)/C,a=Math.sin(a*x)/C}const T=a*S;if(l=l*E+h*T,c=c*E+m*T,d=d*E+f*T,u=u*E+b*T,E===1-a){const C=1/Math.sqrt(l*l+c*c+d*d+u*u);l*=C,c*=C,d*=C,u*=C}}e[t]=l,e[t+1]=c,e[t+2]=d,e[t+3]=u}static multiplyQuaternionsFlat(e,t,i,s,r,o){const a=i[s],l=i[s+1],c=i[s+2],d=i[s+3],u=r[o],h=r[o+1],m=r[o+2],f=r[o+3];return e[t]=a*f+d*u+l*m-c*h,e[t+1]=l*f+d*h+c*u-a*m,e[t+2]=c*f+d*m+a*h-l*u,e[t+3]=d*f-a*u-l*h-c*m,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,s){return this._x=e,this._y=t,this._z=i,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){const i=e._x,s=e._y,r=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(i/2),d=a(s/2),u=a(r/2),h=l(i/2),m=l(s/2),f=l(r/2);switch(o){case"XYZ":this._x=h*d*u+c*m*f,this._y=c*m*u-h*d*f,this._z=c*d*f+h*m*u,this._w=c*d*u-h*m*f;break;case"YXZ":this._x=h*d*u+c*m*f,this._y=c*m*u-h*d*f,this._z=c*d*f-h*m*u,this._w=c*d*u+h*m*f;break;case"ZXY":this._x=h*d*u-c*m*f,this._y=c*m*u+h*d*f,this._z=c*d*f+h*m*u,this._w=c*d*u-h*m*f;break;case"ZYX":this._x=h*d*u-c*m*f,this._y=c*m*u+h*d*f,this._z=c*d*f-h*m*u,this._w=c*d*u+h*m*f;break;case"YZX":this._x=h*d*u+c*m*f,this._y=c*m*u+h*d*f,this._z=c*d*f-h*m*u,this._w=c*d*u-h*m*f;break;case"XZY":this._x=h*d*u-c*m*f,this._y=c*m*u-h*d*f,this._z=c*d*f+h*m*u,this._w=c*d*u+h*m*f;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,s=Math.sin(i);return this._x=e.x*s,this._y=e.y*s,this._z=e.z*s,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],s=t[4],r=t[8],o=t[1],a=t[5],l=t[9],c=t[2],d=t[6],u=t[10],h=i+a+u;if(h>0){const m=.5/Math.sqrt(h+1);this._w=.25/m,this._x=(d-l)*m,this._y=(r-c)*m,this._z=(o-s)*m}else if(i>a&&i>u){const m=2*Math.sqrt(1+i-a-u);this._w=(d-l)/m,this._x=.25*m,this._y=(s+o)/m,this._z=(r+c)/m}else if(a>u){const m=2*Math.sqrt(1+a-i-u);this._w=(r-c)/m,this._x=(s+o)/m,this._y=.25*m,this._z=(l+d)/m}else{const m=2*Math.sqrt(1+u-i-a);this._w=(o-s)/m,this._x=(r+c)/m,this._y=(l+d)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(On(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const s=Math.min(1,t/i);return this.slerp(e,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,s=e._y,r=e._z,o=e._w,a=t._x,l=t._y,c=t._z,d=t._w;return this._x=i*d+o*a+s*c-r*l,this._y=s*d+o*l+r*a-i*c,this._z=r*d+o*c+i*l-s*a,this._w=o*d-i*a-s*l-r*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,s=this._y,r=this._z,o=this._w;let a=o*e._w+i*e._x+s*e._y+r*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=s,this._z=r,this;const l=1-a*a;if(l<=Number.EPSILON){const m=1-t;return this._w=m*o+t*this._w,this._x=m*i+t*this._x,this._y=m*s+t*this._y,this._z=m*r+t*this._z,this.normalize(),this._onChangeCallback(),this}const c=Math.sqrt(l),d=Math.atan2(c,a),u=Math.sin((1-t)*d)/c,h=Math.sin(t*d)/c;return this._w=o*u+this._w*h,this._x=i*u+this._x*h,this._y=s*u+this._y*h,this._z=r*u+this._z*h,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=Math.random(),t=Math.sqrt(1-e),i=Math.sqrt(e),s=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(t*Math.cos(s),i*Math.sin(r),i*Math.cos(r),t*Math.sin(s))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class pe{constructor(e=0,t=0,i=0){pe.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(n1.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(n1.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6]*s,this.y=r[1]*t+r[4]*i+r[7]*s,this.z=r[2]*t+r[5]*i+r[8]*s,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,s=this.z,r=e.elements,o=1/(r[3]*t+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*t+r[4]*i+r[8]*s+r[12])*o,this.y=(r[1]*t+r[5]*i+r[9]*s+r[13])*o,this.z=(r[2]*t+r[6]*i+r[10]*s+r[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,s=this.z,r=e.x,o=e.y,a=e.z,l=e.w,c=2*(o*s-a*i),d=2*(a*t-r*s),u=2*(r*i-o*t);return this.x=t+l*c+o*u-a*d,this.y=i+l*d+a*c-r*u,this.z=s+l*u+r*d-o*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[4]*i+r[8]*s,this.y=r[1]*t+r[5]*i+r[9]*s,this.z=r[2]*t+r[6]*i+r[10]*s,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,s=e.y,r=e.z,o=t.x,a=t.y,l=t.z;return this.x=s*l-r*a,this.y=r*o-i*l,this.z=i*a-s*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return Am.copy(this).projectOnVector(e),this.sub(Am)}reflect(e){return this.sub(Am.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(On(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,s=this.z-e.z;return t*t+i*i+s*s}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const s=Math.sin(t)*e;return this.x=s*Math.sin(i),this.y=Math.cos(t)*e,this.z=s*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),s=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=s,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,t=Math.random()*Math.PI*2,i=Math.sqrt(1-e**2);return this.x=i*Math.cos(t),this.y=i*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Am=new pe,n1=new br;class Ps{constructor(e=new pe(1/0,1/0,1/0),t=new pe(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Ti),Ti.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(ol),zc.subVectors(this.max,ol),xo.subVectors(e.a,ol),Co.subVectors(e.b,ol),Ro.subVectors(e.c,ol),zs.subVectors(Co,xo),Hs.subVectors(Ro,Co),wr.subVectors(xo,Ro);let t=[0,-zs.z,zs.y,0,-Hs.z,Hs.y,0,-wr.z,wr.y,zs.z,0,-zs.x,Hs.z,0,-Hs.x,wr.z,0,-wr.x,-zs.y,zs.x,0,-Hs.y,Hs.x,0,-wr.y,wr.x,0];return!wm(t,xo,Co,Ro,zc)||(t=[1,0,0,0,1,0,0,0,1],!wm(t,xo,Co,Ro,zc))?!1:(Hc.crossVectors(zs,Hs),t=[Hc.x,Hc.y,Hc.z],wm(t,xo,Co,Ro,zc))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Ti).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Ti).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(ds[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ds[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ds[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ds[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ds[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ds[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ds[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ds[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ds),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const ds=[new pe,new pe,new pe,new pe,new pe,new pe,new pe,new pe],Ti=new pe,Vc=new Ps,xo=new pe,Co=new pe,Ro=new pe,zs=new pe,Hs=new pe,wr=new pe,ol=new pe,zc=new pe,Hc=new pe,Nr=new pe;function wm(n,e,t,i,s){for(let r=0,o=n.length-3;r<=o;r+=3){Nr.fromArray(n,r);const a=s.x*Math.abs(Nr.x)+s.y*Math.abs(Nr.y)+s.z*Math.abs(Nr.z),l=e.dot(Nr),c=t.dot(Nr),d=i.dot(Nr);if(Math.max(-Math.max(l,c,d),Math.min(l,c,d))>a)return!1}return!0}const $St=new Ps,al=new pe,Nm=new pe;class ns{constructor(e=new pe,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):$St.setFromPoints(e).getCenter(i);let s=0;for(let r=0,o=e.length;rthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;al.subVectors(e,this.center);const t=al.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),s=(i-this.radius)*.5;this.center.addScaledVector(al,s/i),this.radius+=s}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Nm.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(al.copy(e.center).add(Nm)),this.expandByPoint(al.copy(e.center).sub(Nm))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const us=new pe,Om=new pe,qc=new pe,qs=new pe,Im=new pe,Yc=new pe,Mm=new pe;class Qu{constructor(e=new pe,t=new pe(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,us)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=us.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(us.copy(this.origin).addScaledVector(this.direction,t),us.distanceToSquared(e))}distanceSqToSegment(e,t,i,s){Om.copy(e).add(t).multiplyScalar(.5),qc.copy(t).sub(e).normalize(),qs.copy(this.origin).sub(Om);const r=e.distanceTo(t)*.5,o=-this.direction.dot(qc),a=qs.dot(this.direction),l=-qs.dot(qc),c=qs.lengthSq(),d=Math.abs(1-o*o);let u,h,m,f;if(d>0)if(u=o*l-a,h=o*a-l,f=r*d,u>=0)if(h>=-f)if(h<=f){const b=1/d;u*=b,h*=b,m=u*(u+o*h+2*a)+h*(o*u+h+2*l)+c}else h=r,u=Math.max(0,-(o*h+a)),m=-u*u+h*(h+2*l)+c;else h=-r,u=Math.max(0,-(o*h+a)),m=-u*u+h*(h+2*l)+c;else h<=-f?(u=Math.max(0,-(-o*r+a)),h=u>0?-r:Math.min(Math.max(-r,-l),r),m=-u*u+h*(h+2*l)+c):h<=f?(u=0,h=Math.min(Math.max(-r,-l),r),m=h*(h+2*l)+c):(u=Math.max(0,-(o*r+a)),h=u>0?r:Math.min(Math.max(-r,-l),r),m=-u*u+h*(h+2*l)+c);else h=o>0?-r:r,u=Math.max(0,-(o*h+a)),m=-u*u+h*(h+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,u),s&&s.copy(Om).addScaledVector(qc,h),m}intersectSphere(e,t){us.subVectors(e.center,this.origin);const i=us.dot(this.direction),s=us.dot(us)-i*i,r=e.radius*e.radius;if(s>r)return null;const o=Math.sqrt(r-s),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,s,r,o,a,l;const c=1/this.direction.x,d=1/this.direction.y,u=1/this.direction.z,h=this.origin;return c>=0?(i=(e.min.x-h.x)*c,s=(e.max.x-h.x)*c):(i=(e.max.x-h.x)*c,s=(e.min.x-h.x)*c),d>=0?(r=(e.min.y-h.y)*d,o=(e.max.y-h.y)*d):(r=(e.max.y-h.y)*d,o=(e.min.y-h.y)*d),i>o||r>s||((r>i||isNaN(i))&&(i=r),(o=0?(a=(e.min.z-h.z)*u,l=(e.max.z-h.z)*u):(a=(e.max.z-h.z)*u,l=(e.min.z-h.z)*u),i>l||a>s)||((a>i||i!==i)&&(i=a),(l=0?i:s,t)}intersectsBox(e){return this.intersectBox(e,us)!==null}intersectTriangle(e,t,i,s,r){Im.subVectors(t,e),Yc.subVectors(i,e),Mm.crossVectors(Im,Yc);let o=this.direction.dot(Mm),a;if(o>0){if(s)return null;a=1}else if(o<0)a=-1,o=-o;else return null;qs.subVectors(this.origin,e);const l=a*this.direction.dot(Yc.crossVectors(qs,Yc));if(l<0)return null;const c=a*this.direction.dot(Im.cross(qs));if(c<0||l+c>o)return null;const d=-a*qs.dot(Mm);return d<0?null:this.at(d/o,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Tt{constructor(e,t,i,s,r,o,a,l,c,d,u,h,m,f,b,E){Tt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,s,r,o,a,l,c,d,u,h,m,f,b,E)}set(e,t,i,s,r,o,a,l,c,d,u,h,m,f,b,E){const g=this.elements;return g[0]=e,g[4]=t,g[8]=i,g[12]=s,g[1]=r,g[5]=o,g[9]=a,g[13]=l,g[2]=c,g[6]=d,g[10]=u,g[14]=h,g[3]=m,g[7]=f,g[11]=b,g[15]=E,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Tt().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,s=1/Ao.setFromMatrixColumn(e,0).length(),r=1/Ao.setFromMatrixColumn(e,1).length(),o=1/Ao.setFromMatrixColumn(e,2).length();return t[0]=i[0]*s,t[1]=i[1]*s,t[2]=i[2]*s,t[3]=0,t[4]=i[4]*r,t[5]=i[5]*r,t[6]=i[6]*r,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,s=e.y,r=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(s),c=Math.sin(s),d=Math.cos(r),u=Math.sin(r);if(e.order==="XYZ"){const h=o*d,m=o*u,f=a*d,b=a*u;t[0]=l*d,t[4]=-l*u,t[8]=c,t[1]=m+f*c,t[5]=h-b*c,t[9]=-a*l,t[2]=b-h*c,t[6]=f+m*c,t[10]=o*l}else if(e.order==="YXZ"){const h=l*d,m=l*u,f=c*d,b=c*u;t[0]=h+b*a,t[4]=f*a-m,t[8]=o*c,t[1]=o*u,t[5]=o*d,t[9]=-a,t[2]=m*a-f,t[6]=b+h*a,t[10]=o*l}else if(e.order==="ZXY"){const h=l*d,m=l*u,f=c*d,b=c*u;t[0]=h-b*a,t[4]=-o*u,t[8]=f+m*a,t[1]=m+f*a,t[5]=o*d,t[9]=b-h*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const h=o*d,m=o*u,f=a*d,b=a*u;t[0]=l*d,t[4]=f*c-m,t[8]=h*c+b,t[1]=l*u,t[5]=b*c+h,t[9]=m*c-f,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const h=o*l,m=o*c,f=a*l,b=a*c;t[0]=l*d,t[4]=b-h*u,t[8]=f*u+m,t[1]=u,t[5]=o*d,t[9]=-a*d,t[2]=-c*d,t[6]=m*u+f,t[10]=h-b*u}else if(e.order==="XZY"){const h=o*l,m=o*c,f=a*l,b=a*c;t[0]=l*d,t[4]=-u,t[8]=c*d,t[1]=h*u+b,t[5]=o*d,t[9]=m*u-f,t[2]=f*u-m,t[6]=a*d,t[10]=b*u+h}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(WSt,e,KSt)}lookAt(e,t,i){const s=this.elements;return Xn.subVectors(e,t),Xn.lengthSq()===0&&(Xn.z=1),Xn.normalize(),Ys.crossVectors(i,Xn),Ys.lengthSq()===0&&(Math.abs(i.z)===1?Xn.x+=1e-4:Xn.z+=1e-4,Xn.normalize(),Ys.crossVectors(i,Xn)),Ys.normalize(),$c.crossVectors(Xn,Ys),s[0]=Ys.x,s[4]=$c.x,s[8]=Xn.x,s[1]=Ys.y,s[5]=$c.y,s[9]=Xn.y,s[2]=Ys.z,s[6]=$c.z,s[10]=Xn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,s=t.elements,r=this.elements,o=i[0],a=i[4],l=i[8],c=i[12],d=i[1],u=i[5],h=i[9],m=i[13],f=i[2],b=i[6],E=i[10],g=i[14],S=i[3],y=i[7],T=i[11],C=i[15],x=s[0],w=s[4],R=s[8],v=s[12],A=s[1],P=s[5],U=s[9],Y=s[13],L=s[2],H=s[6],B=s[10],k=s[14],$=s[3],K=s[7],W=s[11],le=s[15];return r[0]=o*x+a*A+l*L+c*$,r[4]=o*w+a*P+l*H+c*K,r[8]=o*R+a*U+l*B+c*W,r[12]=o*v+a*Y+l*k+c*le,r[1]=d*x+u*A+h*L+m*$,r[5]=d*w+u*P+h*H+m*K,r[9]=d*R+u*U+h*B+m*W,r[13]=d*v+u*Y+h*k+m*le,r[2]=f*x+b*A+E*L+g*$,r[6]=f*w+b*P+E*H+g*K,r[10]=f*R+b*U+E*B+g*W,r[14]=f*v+b*Y+E*k+g*le,r[3]=S*x+y*A+T*L+C*$,r[7]=S*w+y*P+T*H+C*K,r[11]=S*R+y*U+T*B+C*W,r[15]=S*v+y*Y+T*k+C*le,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],s=e[8],r=e[12],o=e[1],a=e[5],l=e[9],c=e[13],d=e[2],u=e[6],h=e[10],m=e[14],f=e[3],b=e[7],E=e[11],g=e[15];return f*(+r*l*u-s*c*u-r*a*h+i*c*h+s*a*m-i*l*m)+b*(+t*l*m-t*c*h+r*o*h-s*o*m+s*c*d-r*l*d)+E*(+t*c*u-t*a*m-r*o*u+i*o*m+r*a*d-i*c*d)+g*(-s*a*d-t*l*u+t*a*h+s*o*u-i*o*h+i*l*d)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const s=this.elements;return e.isVector3?(s[12]=e.x,s[13]=e.y,s[14]=e.z):(s[12]=e,s[13]=t,s[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8],u=e[9],h=e[10],m=e[11],f=e[12],b=e[13],E=e[14],g=e[15],S=u*E*c-b*h*c+b*l*m-a*E*m-u*l*g+a*h*g,y=f*h*c-d*E*c-f*l*m+o*E*m+d*l*g-o*h*g,T=d*b*c-f*u*c+f*a*m-o*b*m-d*a*g+o*u*g,C=f*u*l-d*b*l-f*a*h+o*b*h+d*a*E-o*u*E,x=t*S+i*y+s*T+r*C;if(x===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const w=1/x;return e[0]=S*w,e[1]=(b*h*r-u*E*r-b*s*m+i*E*m+u*s*g-i*h*g)*w,e[2]=(a*E*r-b*l*r+b*s*c-i*E*c-a*s*g+i*l*g)*w,e[3]=(u*l*r-a*h*r-u*s*c+i*h*c+a*s*m-i*l*m)*w,e[4]=y*w,e[5]=(d*E*r-f*h*r+f*s*m-t*E*m-d*s*g+t*h*g)*w,e[6]=(f*l*r-o*E*r-f*s*c+t*E*c+o*s*g-t*l*g)*w,e[7]=(o*h*r-d*l*r+d*s*c-t*h*c-o*s*m+t*l*m)*w,e[8]=T*w,e[9]=(f*u*r-d*b*r-f*i*m+t*b*m+d*i*g-t*u*g)*w,e[10]=(o*b*r-f*a*r+f*i*c-t*b*c-o*i*g+t*a*g)*w,e[11]=(d*a*r-o*u*r-d*i*c+t*u*c+o*i*m-t*a*m)*w,e[12]=C*w,e[13]=(d*b*s-f*u*s+f*i*h-t*b*h-d*i*E+t*u*E)*w,e[14]=(f*a*s-o*b*s-f*i*l+t*b*l+o*i*E-t*a*E)*w,e[15]=(o*u*s-d*a*s+d*i*l-t*u*l-o*i*h+t*a*h)*w,this}scale(e){const t=this.elements,i=e.x,s=e.y,r=e.z;return t[0]*=i,t[4]*=s,t[8]*=r,t[1]*=i,t[5]*=s,t[9]*=r,t[2]*=i,t[6]*=s,t[10]*=r,t[3]*=i,t[7]*=s,t[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],s=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,s))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),s=Math.sin(t),r=1-i,o=e.x,a=e.y,l=e.z,c=r*o,d=r*a;return this.set(c*o+i,c*a-s*l,c*l+s*a,0,c*a+s*l,d*a+i,d*l-s*o,0,c*l-s*a,d*l+s*o,r*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,s,r,o){return this.set(1,i,r,0,e,1,o,0,t,s,1,0,0,0,0,1),this}compose(e,t,i){const s=this.elements,r=t._x,o=t._y,a=t._z,l=t._w,c=r+r,d=o+o,u=a+a,h=r*c,m=r*d,f=r*u,b=o*d,E=o*u,g=a*u,S=l*c,y=l*d,T=l*u,C=i.x,x=i.y,w=i.z;return s[0]=(1-(b+g))*C,s[1]=(m+T)*C,s[2]=(f-y)*C,s[3]=0,s[4]=(m-T)*x,s[5]=(1-(h+g))*x,s[6]=(E+S)*x,s[7]=0,s[8]=(f+y)*w,s[9]=(E-S)*w,s[10]=(1-(h+b))*w,s[11]=0,s[12]=e.x,s[13]=e.y,s[14]=e.z,s[15]=1,this}decompose(e,t,i){const s=this.elements;let r=Ao.set(s[0],s[1],s[2]).length();const o=Ao.set(s[4],s[5],s[6]).length(),a=Ao.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),e.x=s[12],e.y=s[13],e.z=s[14],xi.copy(this);const c=1/r,d=1/o,u=1/a;return xi.elements[0]*=c,xi.elements[1]*=c,xi.elements[2]*=c,xi.elements[4]*=d,xi.elements[5]*=d,xi.elements[6]*=d,xi.elements[8]*=u,xi.elements[9]*=u,xi.elements[10]*=u,t.setFromRotationMatrix(xi),i.x=r,i.y=o,i.z=a,this}makePerspective(e,t,i,s,r,o,a=vs){const l=this.elements,c=2*r/(t-e),d=2*r/(i-s),u=(t+e)/(t-e),h=(i+s)/(i-s);let m,f;if(a===vs)m=-(o+r)/(o-r),f=-2*o*r/(o-r);else if(a===au)m=-o/(o-r),f=-o*r/(o-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=c,l[4]=0,l[8]=u,l[12]=0,l[1]=0,l[5]=d,l[9]=h,l[13]=0,l[2]=0,l[6]=0,l[10]=m,l[14]=f,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,s,r,o,a=vs){const l=this.elements,c=1/(t-e),d=1/(i-s),u=1/(o-r),h=(t+e)*c,m=(i+s)*d;let f,b;if(a===vs)f=(o+r)*u,b=-2*u;else if(a===au)f=r*u,b=-1*u;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-h,l[1]=0,l[5]=2*d,l[9]=0,l[13]=-m,l[2]=0,l[6]=0,l[10]=b,l[14]=-f,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let s=0;s<16;s++)if(t[s]!==i[s])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const Ao=new pe,xi=new Tt,WSt=new pe(0,0,0),KSt=new pe(1,1,1),Ys=new pe,$c=new pe,Xn=new pe,i1=new Tt,s1=new br;class Xu{constructor(e=0,t=0,i=0,s=Xu.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=s}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,s=this._order){return this._x=e,this._y=t,this._z=i,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const s=e.elements,r=s[0],o=s[4],a=s[8],l=s[1],c=s[5],d=s[9],u=s[2],h=s[6],m=s[10];switch(t){case"XYZ":this._y=Math.asin(On(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-d,m),this._z=Math.atan2(-o,r)):(this._x=Math.atan2(h,c),this._z=0);break;case"YXZ":this._x=Math.asin(-On(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(a,m),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(On(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-u,m),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,r));break;case"ZYX":this._y=Math.asin(-On(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(h,m),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(On(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-d,c),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(a,m));break;case"XZY":this._z=Math.asin(-On(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(h,c),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-d,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return i1.makeRotationFromQuaternion(e),this.setFromRotationMatrix(i1,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return s1.setFromEuler(this),this.setFromQuaternion(s1,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Xu.DEFAULT_ORDER="XYZ";class bO{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let i=0;i0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.visibility=this._visibility,s.active=this._active,s.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),s.maxGeometryCount=this._maxGeometryCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.geometryCount=this._geometryCount,s.matricesTexture=this._matricesTexture.toJSON(e),this.boundingSphere!==null&&(s.boundingSphere={center:s.boundingSphere.center.toArray(),radius:s.boundingSphere.radius}),this.boundingBox!==null&&(s.boundingBox={min:s.boundingBox.min.toArray(),max:s.boundingBox.max.toArray()}));function r(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let c=0,d=l.length;c0){s.children=[];for(let a=0;a0){s.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),d.length>0&&(i.images=d),u.length>0&&(i.shapes=u),h.length>0&&(i.skeletons=h),m.length>0&&(i.animations=m),f.length>0&&(i.nodes=f)}return i.object=s,i;function o(a){const l=[];for(const c in a){const d=a[c];delete d.metadata,l.push(d)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(e,t,i,s,r){Ci.subVectors(s,t),_s.subVectors(i,t),Dm.subVectors(e,t);const o=Ci.dot(Ci),a=Ci.dot(_s),l=Ci.dot(Dm),c=_s.dot(_s),d=_s.dot(Dm),u=o*c-a*a;if(u===0)return r.set(-2,-1,-1);const h=1/u,m=(c*l-a*d)*h,f=(o*d-a*l)*h;return r.set(1-m-f,f,m)}static containsPoint(e,t,i,s){return this.getBarycoord(e,t,i,s,hs),hs.x>=0&&hs.y>=0&&hs.x+hs.y<=1}static getUV(e,t,i,s,r,o,a,l){return Kc===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Kc=!0),this.getInterpolation(e,t,i,s,r,o,a,l)}static getInterpolation(e,t,i,s,r,o,a,l){return this.getBarycoord(e,t,i,s,hs),l.setScalar(0),l.addScaledVector(r,hs.x),l.addScaledVector(o,hs.y),l.addScaledVector(a,hs.z),l}static isFrontFacing(e,t,i,s){return Ci.subVectors(i,t),_s.subVectors(e,t),Ci.cross(_s).dot(s)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,s){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[s]),this}setFromAttributeAndIndices(e,t,i,s){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,s),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Ci.subVectors(this.c,this.b),_s.subVectors(this.a,this.b),Ci.cross(_s).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Ai.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Ai.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,i,s,r){return Kc===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Kc=!0),Ai.getInterpolation(e,this.a,this.b,this.c,t,i,s,r)}getInterpolation(e,t,i,s,r){return Ai.getInterpolation(e,this.a,this.b,this.c,t,i,s,r)}containsPoint(e){return Ai.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Ai.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,s=this.b,r=this.c;let o,a;No.subVectors(s,i),Oo.subVectors(r,i),Lm.subVectors(e,i);const l=No.dot(Lm),c=Oo.dot(Lm);if(l<=0&&c<=0)return t.copy(i);km.subVectors(e,s);const d=No.dot(km),u=Oo.dot(km);if(d>=0&&u<=d)return t.copy(s);const h=l*u-d*c;if(h<=0&&l>=0&&d<=0)return o=l/(l-d),t.copy(i).addScaledVector(No,o);Pm.subVectors(e,r);const m=No.dot(Pm),f=Oo.dot(Pm);if(f>=0&&m<=f)return t.copy(r);const b=m*c-l*f;if(b<=0&&c>=0&&f<=0)return a=c/(c-f),t.copy(i).addScaledVector(Oo,a);const E=d*f-m*u;if(E<=0&&u-d>=0&&m-f>=0)return c1.subVectors(r,s),a=(u-d)/(u-d+(m-f)),t.copy(s).addScaledVector(c1,a);const g=1/(E+b+h);return o=b*g,a=h*g,t.copy(i).addScaledVector(No,o).addScaledVector(Oo,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const SO={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},$s={h:0,s:0,l:0},jc={h:0,s:0,l:0};function Um(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class ut{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const s=e;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=tn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,kt.toWorkingColorSpace(this,t),this}setRGB(e,t,i,s=kt.workingColorSpace){return this.r=e,this.g=t,this.b=i,kt.toWorkingColorSpace(this,s),this}setHSL(e,t,i,s=kt.workingColorSpace){if(e=Ib(e,1),t=On(t,0,1),i=On(i,0,1),t===0)this.r=this.g=this.b=i;else{const r=i<=.5?i*(1+t):i+t-i*t,o=2*i-r;this.r=Um(o,r,e+1/3),this.g=Um(o,r,e),this.b=Um(o,r,e-1/3)}return kt.toWorkingColorSpace(this,s),this}setStyle(e,t=tn){function i(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const o=s[1],a=s[2];switch(o){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=s[1],o=r.length;if(o===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(r,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=tn){const i=SO[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=ea(e.r),this.g=ea(e.g),this.b=ea(e.b),this}copyLinearToSRGB(e){return this.r=Cm(e.r),this.g=Cm(e.g),this.b=Cm(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=tn){return kt.fromWorkingColorSpace(wn.copy(this),e),Math.round(On(wn.r*255,0,255))*65536+Math.round(On(wn.g*255,0,255))*256+Math.round(On(wn.b*255,0,255))}getHexString(e=tn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=kt.workingColorSpace){kt.fromWorkingColorSpace(wn.copy(this),t);const i=wn.r,s=wn.g,r=wn.b,o=Math.max(i,s,r),a=Math.min(i,s,r);let l,c;const d=(a+o)/2;if(a===o)l=0,c=0;else{const u=o-a;switch(c=d<=.5?u/(o+a):u/(2-o-a),o){case i:l=(s-r)/u+(s0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const s=this[t];if(s===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(i):s&&s.isVector3&&i&&i.isVector3?s.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Jo&&(i.blending=this.blending),this.side!==Os&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==Fg&&(i.blendSrc=this.blendSrc),this.blendDst!==Bg&&(i.blendDst=this.blendDst),this.blendEquation!==Gr&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==nu&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==QC&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==yo&&(i.stencilFail=this.stencilFail),this.stencilZFail!==yo&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==yo&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function s(r){const o=[];for(const a in r){const l=r[a];delete l.metadata,o.push(l)}return o}if(t){const r=s(e.textures),o=s(e.images);r.length>0&&(i.textures=r),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const s=t.length;i=new Array(s);for(let r=0;r!==s;++r)i[r]=t[r].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class ar extends Di{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ut(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Ab,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const rn=new pe,Qc=new Rt;class Gn{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=qg,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Ss,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return console.warn('THREE.BufferAttribute: "updateRange" is deprecated and removed in r169. Use "addUpdateRange()" instead.'),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let s=0,r=this.itemSize;s0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const l in i){const c=i[l];e.data.attributes[l]=c.toJSON(e.data)}const s={};let r=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],d=[];for(let u=0,h=c.length;u0&&(s[l]=d,r=!0)}r&&(e.data.morphAttributes=s,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone(t));const s=e.attributes;for(const c in s){const d=s[c];this.setAttribute(c,d.clone(t))}const r=e.morphAttributes;for(const c in r){const d=[],u=r[c];for(let h=0,m=u.length;h0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;r(e.far-e.near)**2))&&(d1.copy(r).invert(),Or.copy(e.ray).applyMatrix4(d1),!(i.boundingBox!==null&&Or.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Or)))}_computeIntersections(e,t,i){let s;const r=this.geometry,o=this.material,a=r.index,l=r.attributes.position,c=r.attributes.uv,d=r.attributes.uv1,u=r.attributes.normal,h=r.groups,m=r.drawRange;if(a!==null)if(Array.isArray(o))for(let f=0,b=h.length;ft.far?null:{distance:c,point:id.clone(),object:n}}function sd(n,e,t,i,s,r,o,a,l,c){n.getVertexPosition(a,Mo),n.getVertexPosition(l,Do),n.getVertexPosition(c,Lo);const d=nvt(n,e,t,i,Mo,Do,Lo,nd);if(d){s&&(Jc.fromBufferAttribute(s,a),ed.fromBufferAttribute(s,l),td.fromBufferAttribute(s,c),d.uv=Ai.getInterpolation(nd,Mo,Do,Lo,Jc,ed,td,new Rt)),r&&(Jc.fromBufferAttribute(r,a),ed.fromBufferAttribute(r,l),td.fromBufferAttribute(r,c),d.uv1=Ai.getInterpolation(nd,Mo,Do,Lo,Jc,ed,td,new Rt),d.uv2=d.uv1),o&&(p1.fromBufferAttribute(o,a),_1.fromBufferAttribute(o,l),h1.fromBufferAttribute(o,c),d.normal=Ai.getInterpolation(nd,Mo,Do,Lo,p1,_1,h1,new pe),d.normal.dot(i.direction)>0&&d.normal.multiplyScalar(-1));const u={a,b:l,c,normal:new pe,materialIndex:0};Ai.getNormal(Mo,Do,Lo,u.normal),d.face=u}return d}class _r extends is{constructor(e=1,t=1,i=1,s=1,r=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:s,heightSegments:r,depthSegments:o};const a=this;s=Math.floor(s),r=Math.floor(r),o=Math.floor(o);const l=[],c=[],d=[],u=[];let h=0,m=0;f("z","y","x",-1,-1,i,t,e,o,r,0),f("z","y","x",1,-1,i,t,-e,o,r,1),f("x","z","y",1,1,e,i,t,s,o,2),f("x","z","y",1,-1,e,i,-t,s,o,3),f("x","y","z",1,-1,e,t,i,s,r,4),f("x","y","z",-1,-1,e,t,-i,s,r,5),this.setIndex(l),this.setAttribute("position",new xs(c,3)),this.setAttribute("normal",new xs(d,3)),this.setAttribute("uv",new xs(u,2));function f(b,E,g,S,y,T,C,x,w,R,v){const A=T/w,P=C/R,U=T/2,Y=C/2,L=x/2,H=w+1,B=R+1;let k=0,$=0;const K=new pe;for(let W=0;W0?1:-1,d.push(K.x,K.y,K.z),u.push(J/w),u.push(1-W/R),k+=1}}for(let W=0;W>8&255]+An[n>>16&255]+An[n>>24&255]+"-"+An[e&255]+An[e>>8&255]+"-"+An[e>>16&15|64]+An[e>>24&255]+"-"+An[t&63|128]+An[t>>8&255]+"-"+An[t>>16&255]+An[t>>24&255]+An[i&255]+An[i>>8&255]+An[i>>16&255]+An[i>>24&255]).toLowerCase()}function On(n,e,t){return Math.max(e,Math.min(t,n))}function Ib(n,e){return(n%e+e)%e}function xSt(n,e,t,i,s){return i+(n-e)*(s-i)/(t-e)}function CSt(n,e,t){return n!==e?(t-n)/(e-n):0}function Nl(n,e,t){return(1-t)*n+t*e}function RSt(n,e,t,i){return Nl(n,e,1-Math.exp(-t*i))}function ASt(n,e=1){return e-Math.abs(Ib(n,e*2)-e)}function wSt(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function NSt(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function OSt(n,e){return n+Math.floor(Math.random()*(e-n+1))}function ISt(n,e){return n+Math.random()*(e-n)}function MSt(n){return n*(.5-Math.random())}function DSt(n){n!==void 0&&(ZC=n);let e=ZC+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function LSt(n){return n*wl}function kSt(n){return n*va}function $g(n){return(n&n-1)===0&&n!==0}function PSt(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function lu(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function USt(n,e,t,i,s){const r=Math.cos,o=Math.sin,a=r(t/2),l=o(t/2),c=r((e+i)/2),d=o((e+i)/2),u=r((e-i)/2),h=o((e-i)/2),m=r((i-e)/2),f=o((i-e)/2);switch(s){case"XYX":n.set(a*d,l*u,l*h,a*c);break;case"YZY":n.set(l*h,a*d,l*u,a*c);break;case"ZXZ":n.set(l*u,l*h,a*d,a*c);break;case"XZX":n.set(a*d,l*f,l*m,a*c);break;case"YXY":n.set(l*m,a*d,l*f,a*c);break;case"ZYZ":n.set(l*f,l*m,a*d,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}}function qi(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Gt(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const FSt={DEG2RAD:wl,RAD2DEG:va,generateUUID:Mi,clamp:On,euclideanModulo:Ib,mapLinear:xSt,inverseLerp:CSt,lerp:Nl,damp:RSt,pingpong:ASt,smoothstep:wSt,smootherstep:NSt,randInt:OSt,randFloat:ISt,randFloatSpread:MSt,seededRandom:DSt,degToRad:LSt,radToDeg:kSt,isPowerOfTwo:$g,ceilPowerOfTwo:PSt,floorPowerOfTwo:lu,setQuaternionFromProperEuler:USt,normalize:Gt,denormalize:qi};class Rt{constructor(e=0,t=0){Rt.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6],this.y=s[1]*t+s[4]*i+s[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(On(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),s=Math.sin(t),r=this.x-e.x,o=this.y-e.y;return this.x=r*i-o*s+e.x,this.y=r*s+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class yt{constructor(e,t,i,s,r,o,a,l,c){yt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,s,r,o,a,l,c)}set(e,t,i,s,r,o,a,l,c){const d=this.elements;return d[0]=e,d[1]=s,d[2]=a,d[3]=t,d[4]=r,d[5]=l,d[6]=i,d[7]=o,d[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,s=t.elements,r=this.elements,o=i[0],a=i[3],l=i[6],c=i[1],d=i[4],u=i[7],h=i[2],m=i[5],f=i[8],b=s[0],E=s[3],g=s[6],S=s[1],y=s[4],T=s[7],C=s[2],x=s[5],w=s[8];return r[0]=o*b+a*S+l*C,r[3]=o*E+a*y+l*x,r[6]=o*g+a*T+l*w,r[1]=c*b+d*S+u*C,r[4]=c*E+d*y+u*x,r[7]=c*g+d*T+u*w,r[2]=h*b+m*S+f*C,r[5]=h*E+m*y+f*x,r[8]=h*g+m*T+f*w,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8];return t*o*d-t*a*c-i*r*d+i*a*l+s*r*c-s*o*l}invert(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8],u=d*o-a*c,h=a*l-d*r,m=c*r-o*l,f=t*u+i*h+s*m;if(f===0)return this.set(0,0,0,0,0,0,0,0,0);const b=1/f;return e[0]=u*b,e[1]=(s*c-d*i)*b,e[2]=(a*i-s*o)*b,e[3]=h*b,e[4]=(d*t-s*l)*b,e[5]=(s*r-a*t)*b,e[6]=m*b,e[7]=(i*l-c*t)*b,e[8]=(o*t-i*r)*b,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,s,r,o,a){const l=Math.cos(r),c=Math.sin(r);return this.set(i*l,i*c,-i*(l*o+c*a)+o+e,-s*c,s*l,-s*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(xm.makeScale(e,t)),this}rotate(e){return this.premultiply(xm.makeRotation(-e)),this}translate(e,t){return this.premultiply(xm.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let s=0;s<9;s++)if(t[s]!==i[s])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const xm=new yt;function fO(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}function Zl(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function BSt(){const n=Zl("canvas");return n.style.display="block",n}const JC={};function Ol(n){n in JC||(JC[n]=!0,console.warn(n))}const e1=new yt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),t1=new yt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Gc={[Cn]:{transfer:su,primaries:ru,toReference:n=>n,fromReference:n=>n},[tn]:{transfer:$t,primaries:ru,toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[ju]:{transfer:su,primaries:ou,toReference:n=>n.applyMatrix3(t1),fromReference:n=>n.applyMatrix3(e1)},[Ob]:{transfer:$t,primaries:ou,toReference:n=>n.convertSRGBToLinear().applyMatrix3(t1),fromReference:n=>n.applyMatrix3(e1).convertLinearToSRGB()}},GSt=new Set([Cn,ju]),kt={enabled:!0,_workingColorSpace:Cn,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(n){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!n},get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!GSt.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,e,t){if(this.enabled===!1||e===t||!e||!t)return n;const i=Gc[e].toReference,s=Gc[t].fromReference;return s(i(n))},fromWorkingColorSpace:function(n,e){return this.convert(n,this._workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this._workingColorSpace)},getPrimaries:function(n){return Gc[n].primaries},getTransfer:function(n){return n===pi?su:Gc[n].transfer}};function ea(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Cm(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let To;class mO{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{To===void 0&&(To=Zl("canvas")),To.width=e.width,To.height=e.height;const i=To.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=To}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Zl("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const s=i.getImageData(0,0,e.width,e.height),r=s.data;for(let o=0;o0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==iO)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Ea:e.x=e.x-Math.floor(e.x);break;case di:e.x=e.x<0?0:1;break;case iu:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Ea:e.y=e.y-Math.floor(e.y);break;case di:e.y=e.y<0?0:1;break;case iu:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return Ol("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===tn?Xr:_O}set encoding(e){Ol("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===Xr?tn:pi}}xn.DEFAULT_IMAGE=null;xn.DEFAULT_MAPPING=iO;xn.DEFAULT_ANISOTROPY=1;class Ht{constructor(e=0,t=0,i=0,s=1){Ht.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=s}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,s){return this.x=e,this.y=t,this.z=i,this.w=s,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,s=this.z,r=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*s+o[12]*r,this.y=o[1]*t+o[5]*i+o[9]*s+o[13]*r,this.z=o[2]*t+o[6]*i+o[10]*s+o[14]*r,this.w=o[3]*t+o[7]*i+o[11]*s+o[15]*r,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,s,r;const l=e.elements,c=l[0],d=l[4],u=l[8],h=l[1],m=l[5],f=l[9],b=l[2],E=l[6],g=l[10];if(Math.abs(d-h)<.01&&Math.abs(u-b)<.01&&Math.abs(f-E)<.01){if(Math.abs(d+h)<.1&&Math.abs(u+b)<.1&&Math.abs(f+E)<.1&&Math.abs(c+m+g-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const y=(c+1)/2,T=(m+1)/2,C=(g+1)/2,x=(d+h)/4,w=(u+b)/4,R=(f+E)/4;return y>T&&y>C?y<.01?(i=0,s=.707106781,r=.707106781):(i=Math.sqrt(y),s=x/i,r=w/i):T>C?T<.01?(i=.707106781,s=0,r=.707106781):(s=Math.sqrt(T),i=x/s,r=R/s):C<.01?(i=.707106781,s=.707106781,r=0):(r=Math.sqrt(C),i=w/r,s=R/r),this.set(i,s,r,t),this}let S=Math.sqrt((E-f)*(E-f)+(u-b)*(u-b)+(h-d)*(h-d));return Math.abs(S)<.001&&(S=1),this.x=(E-f)/S,this.y=(u-b)/S,this.z=(h-d)/S,this.w=Math.acos((c+m+g-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class HSt extends Va{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Ht(0,0,e,t),this.scissorTest=!1,this.viewport=new Ht(0,0,e,t);const s={width:e,height:t,depth:1};i.encoding!==void 0&&(Ol("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),i.colorSpace=i.encoding===Xr?tn:pi),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:qn,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},i),this.texture=new xn(s,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=i.generateMipmaps,this.texture.internalFormat=i.internalFormat,this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.depthTexture=i.depthTexture,this.samples=i.samples}setSize(e,t,i=1){(this.width!==e||this.height!==t||this.depth!==i)&&(this.width=e,this.height=t,this.depth=i,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=i,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new gO(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class so extends HSt{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}}class EO extends xn{constructor(e=null,t=1,i=1,s=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:s},this.magFilter=gn,this.minFilter=gn,this.wrapR=di,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class qSt extends xn{constructor(e=null,t=1,i=1,s=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:s},this.magFilter=gn,this.minFilter=gn,this.wrapR=di,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class br{constructor(e=0,t=0,i=0,s=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=s}static slerpFlat(e,t,i,s,r,o,a){let l=i[s+0],c=i[s+1],d=i[s+2],u=i[s+3];const h=r[o+0],m=r[o+1],f=r[o+2],b=r[o+3];if(a===0){e[t+0]=l,e[t+1]=c,e[t+2]=d,e[t+3]=u;return}if(a===1){e[t+0]=h,e[t+1]=m,e[t+2]=f,e[t+3]=b;return}if(u!==b||l!==h||c!==m||d!==f){let E=1-a;const g=l*h+c*m+d*f+u*b,S=g>=0?1:-1,y=1-g*g;if(y>Number.EPSILON){const C=Math.sqrt(y),x=Math.atan2(C,g*S);E=Math.sin(E*x)/C,a=Math.sin(a*x)/C}const T=a*S;if(l=l*E+h*T,c=c*E+m*T,d=d*E+f*T,u=u*E+b*T,E===1-a){const C=1/Math.sqrt(l*l+c*c+d*d+u*u);l*=C,c*=C,d*=C,u*=C}}e[t]=l,e[t+1]=c,e[t+2]=d,e[t+3]=u}static multiplyQuaternionsFlat(e,t,i,s,r,o){const a=i[s],l=i[s+1],c=i[s+2],d=i[s+3],u=r[o],h=r[o+1],m=r[o+2],f=r[o+3];return e[t]=a*f+d*u+l*m-c*h,e[t+1]=l*f+d*h+c*u-a*m,e[t+2]=c*f+d*m+a*h-l*u,e[t+3]=d*f-a*u-l*h-c*m,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,s){return this._x=e,this._y=t,this._z=i,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){const i=e._x,s=e._y,r=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(i/2),d=a(s/2),u=a(r/2),h=l(i/2),m=l(s/2),f=l(r/2);switch(o){case"XYZ":this._x=h*d*u+c*m*f,this._y=c*m*u-h*d*f,this._z=c*d*f+h*m*u,this._w=c*d*u-h*m*f;break;case"YXZ":this._x=h*d*u+c*m*f,this._y=c*m*u-h*d*f,this._z=c*d*f-h*m*u,this._w=c*d*u+h*m*f;break;case"ZXY":this._x=h*d*u-c*m*f,this._y=c*m*u+h*d*f,this._z=c*d*f+h*m*u,this._w=c*d*u-h*m*f;break;case"ZYX":this._x=h*d*u-c*m*f,this._y=c*m*u+h*d*f,this._z=c*d*f-h*m*u,this._w=c*d*u+h*m*f;break;case"YZX":this._x=h*d*u+c*m*f,this._y=c*m*u+h*d*f,this._z=c*d*f-h*m*u,this._w=c*d*u-h*m*f;break;case"XZY":this._x=h*d*u-c*m*f,this._y=c*m*u-h*d*f,this._z=c*d*f+h*m*u,this._w=c*d*u+h*m*f;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,s=Math.sin(i);return this._x=e.x*s,this._y=e.y*s,this._z=e.z*s,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],s=t[4],r=t[8],o=t[1],a=t[5],l=t[9],c=t[2],d=t[6],u=t[10],h=i+a+u;if(h>0){const m=.5/Math.sqrt(h+1);this._w=.25/m,this._x=(d-l)*m,this._y=(r-c)*m,this._z=(o-s)*m}else if(i>a&&i>u){const m=2*Math.sqrt(1+i-a-u);this._w=(d-l)/m,this._x=.25*m,this._y=(s+o)/m,this._z=(r+c)/m}else if(a>u){const m=2*Math.sqrt(1+a-i-u);this._w=(r-c)/m,this._x=(s+o)/m,this._y=.25*m,this._z=(l+d)/m}else{const m=2*Math.sqrt(1+u-i-a);this._w=(o-s)/m,this._x=(r+c)/m,this._y=(l+d)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(On(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const s=Math.min(1,t/i);return this.slerp(e,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,s=e._y,r=e._z,o=e._w,a=t._x,l=t._y,c=t._z,d=t._w;return this._x=i*d+o*a+s*c-r*l,this._y=s*d+o*l+r*a-i*c,this._z=r*d+o*c+i*l-s*a,this._w=o*d-i*a-s*l-r*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,s=this._y,r=this._z,o=this._w;let a=o*e._w+i*e._x+s*e._y+r*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=s,this._z=r,this;const l=1-a*a;if(l<=Number.EPSILON){const m=1-t;return this._w=m*o+t*this._w,this._x=m*i+t*this._x,this._y=m*s+t*this._y,this._z=m*r+t*this._z,this.normalize(),this._onChangeCallback(),this}const c=Math.sqrt(l),d=Math.atan2(c,a),u=Math.sin((1-t)*d)/c,h=Math.sin(t*d)/c;return this._w=o*u+this._w*h,this._x=i*u+this._x*h,this._y=s*u+this._y*h,this._z=r*u+this._z*h,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=Math.random(),t=Math.sqrt(1-e),i=Math.sqrt(e),s=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(t*Math.cos(s),i*Math.sin(r),i*Math.cos(r),t*Math.sin(s))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class pe{constructor(e=0,t=0,i=0){pe.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(n1.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(n1.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6]*s,this.y=r[1]*t+r[4]*i+r[7]*s,this.z=r[2]*t+r[5]*i+r[8]*s,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,s=this.z,r=e.elements,o=1/(r[3]*t+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*t+r[4]*i+r[8]*s+r[12])*o,this.y=(r[1]*t+r[5]*i+r[9]*s+r[13])*o,this.z=(r[2]*t+r[6]*i+r[10]*s+r[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,s=this.z,r=e.x,o=e.y,a=e.z,l=e.w,c=2*(o*s-a*i),d=2*(a*t-r*s),u=2*(r*i-o*t);return this.x=t+l*c+o*u-a*d,this.y=i+l*d+a*c-r*u,this.z=s+l*u+r*d-o*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[4]*i+r[8]*s,this.y=r[1]*t+r[5]*i+r[9]*s,this.z=r[2]*t+r[6]*i+r[10]*s,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,s=e.y,r=e.z,o=t.x,a=t.y,l=t.z;return this.x=s*l-r*a,this.y=r*o-i*l,this.z=i*a-s*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return Am.copy(this).projectOnVector(e),this.sub(Am)}reflect(e){return this.sub(Am.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(On(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,s=this.z-e.z;return t*t+i*i+s*s}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const s=Math.sin(t)*e;return this.x=s*Math.sin(i),this.y=Math.cos(t)*e,this.z=s*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),s=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=s,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,t=Math.random()*Math.PI*2,i=Math.sqrt(1-e**2);return this.x=i*Math.cos(t),this.y=i*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Am=new pe,n1=new br;class Ps{constructor(e=new pe(1/0,1/0,1/0),t=new pe(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Ti),Ti.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(ol),zc.subVectors(this.max,ol),xo.subVectors(e.a,ol),Co.subVectors(e.b,ol),Ro.subVectors(e.c,ol),zs.subVectors(Co,xo),Hs.subVectors(Ro,Co),wr.subVectors(xo,Ro);let t=[0,-zs.z,zs.y,0,-Hs.z,Hs.y,0,-wr.z,wr.y,zs.z,0,-zs.x,Hs.z,0,-Hs.x,wr.z,0,-wr.x,-zs.y,zs.x,0,-Hs.y,Hs.x,0,-wr.y,wr.x,0];return!wm(t,xo,Co,Ro,zc)||(t=[1,0,0,0,1,0,0,0,1],!wm(t,xo,Co,Ro,zc))?!1:(Hc.crossVectors(zs,Hs),t=[Hc.x,Hc.y,Hc.z],wm(t,xo,Co,Ro,zc))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Ti).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Ti).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(ds[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ds[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ds[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ds[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ds[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ds[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ds[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ds[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ds),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const ds=[new pe,new pe,new pe,new pe,new pe,new pe,new pe,new pe],Ti=new pe,Vc=new Ps,xo=new pe,Co=new pe,Ro=new pe,zs=new pe,Hs=new pe,wr=new pe,ol=new pe,zc=new pe,Hc=new pe,Nr=new pe;function wm(n,e,t,i,s){for(let r=0,o=n.length-3;r<=o;r+=3){Nr.fromArray(n,r);const a=s.x*Math.abs(Nr.x)+s.y*Math.abs(Nr.y)+s.z*Math.abs(Nr.z),l=e.dot(Nr),c=t.dot(Nr),d=i.dot(Nr);if(Math.max(-Math.max(l,c,d),Math.min(l,c,d))>a)return!1}return!0}const YSt=new Ps,al=new pe,Nm=new pe;class ns{constructor(e=new pe,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):YSt.setFromPoints(e).getCenter(i);let s=0;for(let r=0,o=e.length;rthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;al.subVectors(e,this.center);const t=al.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),s=(i-this.radius)*.5;this.center.addScaledVector(al,s/i),this.radius+=s}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Nm.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(al.copy(e.center).add(Nm)),this.expandByPoint(al.copy(e.center).sub(Nm))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const us=new pe,Om=new pe,qc=new pe,qs=new pe,Im=new pe,Yc=new pe,Mm=new pe;class Qu{constructor(e=new pe,t=new pe(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,us)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=us.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(us.copy(this.origin).addScaledVector(this.direction,t),us.distanceToSquared(e))}distanceSqToSegment(e,t,i,s){Om.copy(e).add(t).multiplyScalar(.5),qc.copy(t).sub(e).normalize(),qs.copy(this.origin).sub(Om);const r=e.distanceTo(t)*.5,o=-this.direction.dot(qc),a=qs.dot(this.direction),l=-qs.dot(qc),c=qs.lengthSq(),d=Math.abs(1-o*o);let u,h,m,f;if(d>0)if(u=o*l-a,h=o*a-l,f=r*d,u>=0)if(h>=-f)if(h<=f){const b=1/d;u*=b,h*=b,m=u*(u+o*h+2*a)+h*(o*u+h+2*l)+c}else h=r,u=Math.max(0,-(o*h+a)),m=-u*u+h*(h+2*l)+c;else h=-r,u=Math.max(0,-(o*h+a)),m=-u*u+h*(h+2*l)+c;else h<=-f?(u=Math.max(0,-(-o*r+a)),h=u>0?-r:Math.min(Math.max(-r,-l),r),m=-u*u+h*(h+2*l)+c):h<=f?(u=0,h=Math.min(Math.max(-r,-l),r),m=h*(h+2*l)+c):(u=Math.max(0,-(o*r+a)),h=u>0?r:Math.min(Math.max(-r,-l),r),m=-u*u+h*(h+2*l)+c);else h=o>0?-r:r,u=Math.max(0,-(o*h+a)),m=-u*u+h*(h+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,u),s&&s.copy(Om).addScaledVector(qc,h),m}intersectSphere(e,t){us.subVectors(e.center,this.origin);const i=us.dot(this.direction),s=us.dot(us)-i*i,r=e.radius*e.radius;if(s>r)return null;const o=Math.sqrt(r-s),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,s,r,o,a,l;const c=1/this.direction.x,d=1/this.direction.y,u=1/this.direction.z,h=this.origin;return c>=0?(i=(e.min.x-h.x)*c,s=(e.max.x-h.x)*c):(i=(e.max.x-h.x)*c,s=(e.min.x-h.x)*c),d>=0?(r=(e.min.y-h.y)*d,o=(e.max.y-h.y)*d):(r=(e.max.y-h.y)*d,o=(e.min.y-h.y)*d),i>o||r>s||((r>i||isNaN(i))&&(i=r),(o=0?(a=(e.min.z-h.z)*u,l=(e.max.z-h.z)*u):(a=(e.max.z-h.z)*u,l=(e.min.z-h.z)*u),i>l||a>s)||((a>i||i!==i)&&(i=a),(l=0?i:s,t)}intersectsBox(e){return this.intersectBox(e,us)!==null}intersectTriangle(e,t,i,s,r){Im.subVectors(t,e),Yc.subVectors(i,e),Mm.crossVectors(Im,Yc);let o=this.direction.dot(Mm),a;if(o>0){if(s)return null;a=1}else if(o<0)a=-1,o=-o;else return null;qs.subVectors(this.origin,e);const l=a*this.direction.dot(Yc.crossVectors(qs,Yc));if(l<0)return null;const c=a*this.direction.dot(Im.cross(qs));if(c<0||l+c>o)return null;const d=-a*qs.dot(Mm);return d<0?null:this.at(d/o,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Tt{constructor(e,t,i,s,r,o,a,l,c,d,u,h,m,f,b,E){Tt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,s,r,o,a,l,c,d,u,h,m,f,b,E)}set(e,t,i,s,r,o,a,l,c,d,u,h,m,f,b,E){const g=this.elements;return g[0]=e,g[4]=t,g[8]=i,g[12]=s,g[1]=r,g[5]=o,g[9]=a,g[13]=l,g[2]=c,g[6]=d,g[10]=u,g[14]=h,g[3]=m,g[7]=f,g[11]=b,g[15]=E,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Tt().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,s=1/Ao.setFromMatrixColumn(e,0).length(),r=1/Ao.setFromMatrixColumn(e,1).length(),o=1/Ao.setFromMatrixColumn(e,2).length();return t[0]=i[0]*s,t[1]=i[1]*s,t[2]=i[2]*s,t[3]=0,t[4]=i[4]*r,t[5]=i[5]*r,t[6]=i[6]*r,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,s=e.y,r=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(s),c=Math.sin(s),d=Math.cos(r),u=Math.sin(r);if(e.order==="XYZ"){const h=o*d,m=o*u,f=a*d,b=a*u;t[0]=l*d,t[4]=-l*u,t[8]=c,t[1]=m+f*c,t[5]=h-b*c,t[9]=-a*l,t[2]=b-h*c,t[6]=f+m*c,t[10]=o*l}else if(e.order==="YXZ"){const h=l*d,m=l*u,f=c*d,b=c*u;t[0]=h+b*a,t[4]=f*a-m,t[8]=o*c,t[1]=o*u,t[5]=o*d,t[9]=-a,t[2]=m*a-f,t[6]=b+h*a,t[10]=o*l}else if(e.order==="ZXY"){const h=l*d,m=l*u,f=c*d,b=c*u;t[0]=h-b*a,t[4]=-o*u,t[8]=f+m*a,t[1]=m+f*a,t[5]=o*d,t[9]=b-h*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const h=o*d,m=o*u,f=a*d,b=a*u;t[0]=l*d,t[4]=f*c-m,t[8]=h*c+b,t[1]=l*u,t[5]=b*c+h,t[9]=m*c-f,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const h=o*l,m=o*c,f=a*l,b=a*c;t[0]=l*d,t[4]=b-h*u,t[8]=f*u+m,t[1]=u,t[5]=o*d,t[9]=-a*d,t[2]=-c*d,t[6]=m*u+f,t[10]=h-b*u}else if(e.order==="XZY"){const h=o*l,m=o*c,f=a*l,b=a*c;t[0]=l*d,t[4]=-u,t[8]=c*d,t[1]=h*u+b,t[5]=o*d,t[9]=m*u-f,t[2]=f*u-m,t[6]=a*d,t[10]=b*u+h}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose($St,e,WSt)}lookAt(e,t,i){const s=this.elements;return Xn.subVectors(e,t),Xn.lengthSq()===0&&(Xn.z=1),Xn.normalize(),Ys.crossVectors(i,Xn),Ys.lengthSq()===0&&(Math.abs(i.z)===1?Xn.x+=1e-4:Xn.z+=1e-4,Xn.normalize(),Ys.crossVectors(i,Xn)),Ys.normalize(),$c.crossVectors(Xn,Ys),s[0]=Ys.x,s[4]=$c.x,s[8]=Xn.x,s[1]=Ys.y,s[5]=$c.y,s[9]=Xn.y,s[2]=Ys.z,s[6]=$c.z,s[10]=Xn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,s=t.elements,r=this.elements,o=i[0],a=i[4],l=i[8],c=i[12],d=i[1],u=i[5],h=i[9],m=i[13],f=i[2],b=i[6],E=i[10],g=i[14],S=i[3],y=i[7],T=i[11],C=i[15],x=s[0],w=s[4],R=s[8],v=s[12],A=s[1],P=s[5],U=s[9],Y=s[13],L=s[2],H=s[6],B=s[10],k=s[14],$=s[3],K=s[7],W=s[11],le=s[15];return r[0]=o*x+a*A+l*L+c*$,r[4]=o*w+a*P+l*H+c*K,r[8]=o*R+a*U+l*B+c*W,r[12]=o*v+a*Y+l*k+c*le,r[1]=d*x+u*A+h*L+m*$,r[5]=d*w+u*P+h*H+m*K,r[9]=d*R+u*U+h*B+m*W,r[13]=d*v+u*Y+h*k+m*le,r[2]=f*x+b*A+E*L+g*$,r[6]=f*w+b*P+E*H+g*K,r[10]=f*R+b*U+E*B+g*W,r[14]=f*v+b*Y+E*k+g*le,r[3]=S*x+y*A+T*L+C*$,r[7]=S*w+y*P+T*H+C*K,r[11]=S*R+y*U+T*B+C*W,r[15]=S*v+y*Y+T*k+C*le,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],s=e[8],r=e[12],o=e[1],a=e[5],l=e[9],c=e[13],d=e[2],u=e[6],h=e[10],m=e[14],f=e[3],b=e[7],E=e[11],g=e[15];return f*(+r*l*u-s*c*u-r*a*h+i*c*h+s*a*m-i*l*m)+b*(+t*l*m-t*c*h+r*o*h-s*o*m+s*c*d-r*l*d)+E*(+t*c*u-t*a*m-r*o*u+i*o*m+r*a*d-i*c*d)+g*(-s*a*d-t*l*u+t*a*h+s*o*u-i*o*h+i*l*d)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const s=this.elements;return e.isVector3?(s[12]=e.x,s[13]=e.y,s[14]=e.z):(s[12]=e,s[13]=t,s[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8],u=e[9],h=e[10],m=e[11],f=e[12],b=e[13],E=e[14],g=e[15],S=u*E*c-b*h*c+b*l*m-a*E*m-u*l*g+a*h*g,y=f*h*c-d*E*c-f*l*m+o*E*m+d*l*g-o*h*g,T=d*b*c-f*u*c+f*a*m-o*b*m-d*a*g+o*u*g,C=f*u*l-d*b*l-f*a*h+o*b*h+d*a*E-o*u*E,x=t*S+i*y+s*T+r*C;if(x===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const w=1/x;return e[0]=S*w,e[1]=(b*h*r-u*E*r-b*s*m+i*E*m+u*s*g-i*h*g)*w,e[2]=(a*E*r-b*l*r+b*s*c-i*E*c-a*s*g+i*l*g)*w,e[3]=(u*l*r-a*h*r-u*s*c+i*h*c+a*s*m-i*l*m)*w,e[4]=y*w,e[5]=(d*E*r-f*h*r+f*s*m-t*E*m-d*s*g+t*h*g)*w,e[6]=(f*l*r-o*E*r-f*s*c+t*E*c+o*s*g-t*l*g)*w,e[7]=(o*h*r-d*l*r+d*s*c-t*h*c-o*s*m+t*l*m)*w,e[8]=T*w,e[9]=(f*u*r-d*b*r-f*i*m+t*b*m+d*i*g-t*u*g)*w,e[10]=(o*b*r-f*a*r+f*i*c-t*b*c-o*i*g+t*a*g)*w,e[11]=(d*a*r-o*u*r-d*i*c+t*u*c+o*i*m-t*a*m)*w,e[12]=C*w,e[13]=(d*b*s-f*u*s+f*i*h-t*b*h-d*i*E+t*u*E)*w,e[14]=(f*a*s-o*b*s-f*i*l+t*b*l+o*i*E-t*a*E)*w,e[15]=(o*u*s-d*a*s+d*i*l-t*u*l-o*i*h+t*a*h)*w,this}scale(e){const t=this.elements,i=e.x,s=e.y,r=e.z;return t[0]*=i,t[4]*=s,t[8]*=r,t[1]*=i,t[5]*=s,t[9]*=r,t[2]*=i,t[6]*=s,t[10]*=r,t[3]*=i,t[7]*=s,t[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],s=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,s))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),s=Math.sin(t),r=1-i,o=e.x,a=e.y,l=e.z,c=r*o,d=r*a;return this.set(c*o+i,c*a-s*l,c*l+s*a,0,c*a+s*l,d*a+i,d*l-s*o,0,c*l-s*a,d*l+s*o,r*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,s,r,o){return this.set(1,i,r,0,e,1,o,0,t,s,1,0,0,0,0,1),this}compose(e,t,i){const s=this.elements,r=t._x,o=t._y,a=t._z,l=t._w,c=r+r,d=o+o,u=a+a,h=r*c,m=r*d,f=r*u,b=o*d,E=o*u,g=a*u,S=l*c,y=l*d,T=l*u,C=i.x,x=i.y,w=i.z;return s[0]=(1-(b+g))*C,s[1]=(m+T)*C,s[2]=(f-y)*C,s[3]=0,s[4]=(m-T)*x,s[5]=(1-(h+g))*x,s[6]=(E+S)*x,s[7]=0,s[8]=(f+y)*w,s[9]=(E-S)*w,s[10]=(1-(h+b))*w,s[11]=0,s[12]=e.x,s[13]=e.y,s[14]=e.z,s[15]=1,this}decompose(e,t,i){const s=this.elements;let r=Ao.set(s[0],s[1],s[2]).length();const o=Ao.set(s[4],s[5],s[6]).length(),a=Ao.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),e.x=s[12],e.y=s[13],e.z=s[14],xi.copy(this);const c=1/r,d=1/o,u=1/a;return xi.elements[0]*=c,xi.elements[1]*=c,xi.elements[2]*=c,xi.elements[4]*=d,xi.elements[5]*=d,xi.elements[6]*=d,xi.elements[8]*=u,xi.elements[9]*=u,xi.elements[10]*=u,t.setFromRotationMatrix(xi),i.x=r,i.y=o,i.z=a,this}makePerspective(e,t,i,s,r,o,a=vs){const l=this.elements,c=2*r/(t-e),d=2*r/(i-s),u=(t+e)/(t-e),h=(i+s)/(i-s);let m,f;if(a===vs)m=-(o+r)/(o-r),f=-2*o*r/(o-r);else if(a===au)m=-o/(o-r),f=-o*r/(o-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=c,l[4]=0,l[8]=u,l[12]=0,l[1]=0,l[5]=d,l[9]=h,l[13]=0,l[2]=0,l[6]=0,l[10]=m,l[14]=f,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,s,r,o,a=vs){const l=this.elements,c=1/(t-e),d=1/(i-s),u=1/(o-r),h=(t+e)*c,m=(i+s)*d;let f,b;if(a===vs)f=(o+r)*u,b=-2*u;else if(a===au)f=r*u,b=-1*u;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-h,l[1]=0,l[5]=2*d,l[9]=0,l[13]=-m,l[2]=0,l[6]=0,l[10]=b,l[14]=-f,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let s=0;s<16;s++)if(t[s]!==i[s])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const Ao=new pe,xi=new Tt,$St=new pe(0,0,0),WSt=new pe(1,1,1),Ys=new pe,$c=new pe,Xn=new pe,i1=new Tt,s1=new br;class Xu{constructor(e=0,t=0,i=0,s=Xu.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=s}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,s=this._order){return this._x=e,this._y=t,this._z=i,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const s=e.elements,r=s[0],o=s[4],a=s[8],l=s[1],c=s[5],d=s[9],u=s[2],h=s[6],m=s[10];switch(t){case"XYZ":this._y=Math.asin(On(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-d,m),this._z=Math.atan2(-o,r)):(this._x=Math.atan2(h,c),this._z=0);break;case"YXZ":this._x=Math.asin(-On(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(a,m),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(On(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-u,m),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,r));break;case"ZYX":this._y=Math.asin(-On(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(h,m),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(On(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-d,c),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(a,m));break;case"XZY":this._z=Math.asin(-On(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(h,c),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-d,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return i1.makeRotationFromQuaternion(e),this.setFromRotationMatrix(i1,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return s1.setFromEuler(this),this.setFromQuaternion(s1,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Xu.DEFAULT_ORDER="XYZ";class bO{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let i=0;i0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.visibility=this._visibility,s.active=this._active,s.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),s.maxGeometryCount=this._maxGeometryCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.geometryCount=this._geometryCount,s.matricesTexture=this._matricesTexture.toJSON(e),this.boundingSphere!==null&&(s.boundingSphere={center:s.boundingSphere.center.toArray(),radius:s.boundingSphere.radius}),this.boundingBox!==null&&(s.boundingBox={min:s.boundingBox.min.toArray(),max:s.boundingBox.max.toArray()}));function r(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let c=0,d=l.length;c0){s.children=[];for(let a=0;a0){s.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),d.length>0&&(i.images=d),u.length>0&&(i.shapes=u),h.length>0&&(i.skeletons=h),m.length>0&&(i.animations=m),f.length>0&&(i.nodes=f)}return i.object=s,i;function o(a){const l=[];for(const c in a){const d=a[c];delete d.metadata,l.push(d)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(e,t,i,s,r){Ci.subVectors(s,t),_s.subVectors(i,t),Dm.subVectors(e,t);const o=Ci.dot(Ci),a=Ci.dot(_s),l=Ci.dot(Dm),c=_s.dot(_s),d=_s.dot(Dm),u=o*c-a*a;if(u===0)return r.set(-2,-1,-1);const h=1/u,m=(c*l-a*d)*h,f=(o*d-a*l)*h;return r.set(1-m-f,f,m)}static containsPoint(e,t,i,s){return this.getBarycoord(e,t,i,s,hs),hs.x>=0&&hs.y>=0&&hs.x+hs.y<=1}static getUV(e,t,i,s,r,o,a,l){return Kc===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Kc=!0),this.getInterpolation(e,t,i,s,r,o,a,l)}static getInterpolation(e,t,i,s,r,o,a,l){return this.getBarycoord(e,t,i,s,hs),l.setScalar(0),l.addScaledVector(r,hs.x),l.addScaledVector(o,hs.y),l.addScaledVector(a,hs.z),l}static isFrontFacing(e,t,i,s){return Ci.subVectors(i,t),_s.subVectors(e,t),Ci.cross(_s).dot(s)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,s){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[s]),this}setFromAttributeAndIndices(e,t,i,s){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,s),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Ci.subVectors(this.c,this.b),_s.subVectors(this.a,this.b),Ci.cross(_s).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Ai.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Ai.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,i,s,r){return Kc===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Kc=!0),Ai.getInterpolation(e,this.a,this.b,this.c,t,i,s,r)}getInterpolation(e,t,i,s,r){return Ai.getInterpolation(e,this.a,this.b,this.c,t,i,s,r)}containsPoint(e){return Ai.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Ai.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,s=this.b,r=this.c;let o,a;No.subVectors(s,i),Oo.subVectors(r,i),Lm.subVectors(e,i);const l=No.dot(Lm),c=Oo.dot(Lm);if(l<=0&&c<=0)return t.copy(i);km.subVectors(e,s);const d=No.dot(km),u=Oo.dot(km);if(d>=0&&u<=d)return t.copy(s);const h=l*u-d*c;if(h<=0&&l>=0&&d<=0)return o=l/(l-d),t.copy(i).addScaledVector(No,o);Pm.subVectors(e,r);const m=No.dot(Pm),f=Oo.dot(Pm);if(f>=0&&m<=f)return t.copy(r);const b=m*c-l*f;if(b<=0&&c>=0&&f<=0)return a=c/(c-f),t.copy(i).addScaledVector(Oo,a);const E=d*f-m*u;if(E<=0&&u-d>=0&&m-f>=0)return c1.subVectors(r,s),a=(u-d)/(u-d+(m-f)),t.copy(s).addScaledVector(c1,a);const g=1/(E+b+h);return o=b*g,a=h*g,t.copy(i).addScaledVector(No,o).addScaledVector(Oo,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const SO={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},$s={h:0,s:0,l:0},jc={h:0,s:0,l:0};function Um(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class ut{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const s=e;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=tn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,kt.toWorkingColorSpace(this,t),this}setRGB(e,t,i,s=kt.workingColorSpace){return this.r=e,this.g=t,this.b=i,kt.toWorkingColorSpace(this,s),this}setHSL(e,t,i,s=kt.workingColorSpace){if(e=Ib(e,1),t=On(t,0,1),i=On(i,0,1),t===0)this.r=this.g=this.b=i;else{const r=i<=.5?i*(1+t):i+t-i*t,o=2*i-r;this.r=Um(o,r,e+1/3),this.g=Um(o,r,e),this.b=Um(o,r,e-1/3)}return kt.toWorkingColorSpace(this,s),this}setStyle(e,t=tn){function i(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const o=s[1],a=s[2];switch(o){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=s[1],o=r.length;if(o===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(r,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=tn){const i=SO[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=ea(e.r),this.g=ea(e.g),this.b=ea(e.b),this}copyLinearToSRGB(e){return this.r=Cm(e.r),this.g=Cm(e.g),this.b=Cm(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=tn){return kt.fromWorkingColorSpace(wn.copy(this),e),Math.round(On(wn.r*255,0,255))*65536+Math.round(On(wn.g*255,0,255))*256+Math.round(On(wn.b*255,0,255))}getHexString(e=tn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=kt.workingColorSpace){kt.fromWorkingColorSpace(wn.copy(this),t);const i=wn.r,s=wn.g,r=wn.b,o=Math.max(i,s,r),a=Math.min(i,s,r);let l,c;const d=(a+o)/2;if(a===o)l=0,c=0;else{const u=o-a;switch(c=d<=.5?u/(o+a):u/(2-o-a),o){case i:l=(s-r)/u+(s0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const s=this[t];if(s===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(i):s&&s.isVector3&&i&&i.isVector3?s.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Jo&&(i.blending=this.blending),this.side!==Os&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==Fg&&(i.blendSrc=this.blendSrc),this.blendDst!==Bg&&(i.blendDst=this.blendDst),this.blendEquation!==Gr&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==nu&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==QC&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==yo&&(i.stencilFail=this.stencilFail),this.stencilZFail!==yo&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==yo&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function s(r){const o=[];for(const a in r){const l=r[a];delete l.metadata,o.push(l)}return o}if(t){const r=s(e.textures),o=s(e.images);r.length>0&&(i.textures=r),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const s=t.length;i=new Array(s);for(let r=0;r!==s;++r)i[r]=t[r].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class ar extends Di{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ut(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Ab,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const rn=new pe,Qc=new Rt;class Gn{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=qg,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Ss,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return console.warn('THREE.BufferAttribute: "updateRange" is deprecated and removed in r169. Use "addUpdateRange()" instead.'),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let s=0,r=this.itemSize;s0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const l in i){const c=i[l];e.data.attributes[l]=c.toJSON(e.data)}const s={};let r=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],d=[];for(let u=0,h=c.length;u0&&(s[l]=d,r=!0)}r&&(e.data.morphAttributes=s,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone(t));const s=e.attributes;for(const c in s){const d=s[c];this.setAttribute(c,d.clone(t))}const r=e.morphAttributes;for(const c in r){const d=[],u=r[c];for(let h=0,m=u.length;h0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;r(e.far-e.near)**2))&&(d1.copy(r).invert(),Or.copy(e.ray).applyMatrix4(d1),!(i.boundingBox!==null&&Or.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Or)))}_computeIntersections(e,t,i){let s;const r=this.geometry,o=this.material,a=r.index,l=r.attributes.position,c=r.attributes.uv,d=r.attributes.uv1,u=r.attributes.normal,h=r.groups,m=r.drawRange;if(a!==null)if(Array.isArray(o))for(let f=0,b=h.length;ft.far?null:{distance:c,point:id.clone(),object:n}}function sd(n,e,t,i,s,r,o,a,l,c){n.getVertexPosition(a,Mo),n.getVertexPosition(l,Do),n.getVertexPosition(c,Lo);const d=tvt(n,e,t,i,Mo,Do,Lo,nd);if(d){s&&(Jc.fromBufferAttribute(s,a),ed.fromBufferAttribute(s,l),td.fromBufferAttribute(s,c),d.uv=Ai.getInterpolation(nd,Mo,Do,Lo,Jc,ed,td,new Rt)),r&&(Jc.fromBufferAttribute(r,a),ed.fromBufferAttribute(r,l),td.fromBufferAttribute(r,c),d.uv1=Ai.getInterpolation(nd,Mo,Do,Lo,Jc,ed,td,new Rt),d.uv2=d.uv1),o&&(p1.fromBufferAttribute(o,a),_1.fromBufferAttribute(o,l),h1.fromBufferAttribute(o,c),d.normal=Ai.getInterpolation(nd,Mo,Do,Lo,p1,_1,h1,new pe),d.normal.dot(i.direction)>0&&d.normal.multiplyScalar(-1));const u={a,b:l,c,normal:new pe,materialIndex:0};Ai.getNormal(Mo,Do,Lo,u.normal),d.face=u}return d}class _r extends is{constructor(e=1,t=1,i=1,s=1,r=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:s,heightSegments:r,depthSegments:o};const a=this;s=Math.floor(s),r=Math.floor(r),o=Math.floor(o);const l=[],c=[],d=[],u=[];let h=0,m=0;f("z","y","x",-1,-1,i,t,e,o,r,0),f("z","y","x",1,-1,i,t,-e,o,r,1),f("x","z","y",1,1,e,i,t,s,o,2),f("x","z","y",1,-1,e,i,-t,s,o,3),f("x","y","z",1,-1,e,t,i,s,r,4),f("x","y","z",-1,-1,e,t,-i,s,r,5),this.setIndex(l),this.setAttribute("position",new xs(c,3)),this.setAttribute("normal",new xs(d,3)),this.setAttribute("uv",new xs(u,2));function f(b,E,g,S,y,T,C,x,w,R,v){const A=T/w,P=C/R,U=T/2,Y=C/2,L=x/2,H=w+1,B=R+1;let k=0,$=0;const K=new pe;for(let W=0;W0?1:-1,d.push(K.x,K.y,K.z),u.push(J/w),u.push(1-W/R),k+=1}}for(let W=0;W0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const s in this.extensions)this.extensions[s]===!0&&(i[s]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class xO extends Zt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Tt,this.projectionMatrix=new Tt,this.projectionMatrixInverse=new Tt,this.coordinateSystem=vs}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class Un extends xO{constructor(e=50,t=1,i=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=s,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=va*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(wl*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return va*2*Math.atan(Math.tan(wl*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,i,s,r,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=s,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(wl*.5*this.fov)/this.zoom,i=2*t,s=this.aspect*i,r=-.5*s;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,c=o.fullHeight;r+=o.offsetX*s/l,t-=o.offsetY*i/c,s*=o.width/l,i*=o.height/c}const a=this.filmOffset;a!==0&&(r+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const ko=-90,Po=1;class avt extends Zt{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const s=new Un(ko,Po,e,t);s.layers=this.layers,this.add(s);const r=new Un(ko,Po,e,t);r.layers=this.layers,this.add(r);const o=new Un(ko,Po,e,t);o.layers=this.layers,this.add(o);const a=new Un(ko,Po,e,t);a.layers=this.layers,this.add(a);const l=new Un(ko,Po,e,t);l.layers=this.layers,this.add(l);const c=new Un(ko,Po,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,s,r,o,a,l]=t;for(const c of t)this.remove(c);if(e===vs)i.up.set(0,1,0),i.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===au)i.up.set(0,-1,0),i.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of t)this.add(c),c.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:s}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[r,o,a,l,c,d]=this.children,u=e.getRenderTarget(),h=e.getActiveCubeFace(),m=e.getActiveMipmapLevel(),f=e.xr.enabled;e.xr.enabled=!1;const b=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,s),e.render(t,r),e.setRenderTarget(i,1,s),e.render(t,o),e.setRenderTarget(i,2,s),e.render(t,a),e.setRenderTarget(i,3,s),e.render(t,l),e.setRenderTarget(i,4,s),e.render(t,c),i.texture.generateMipmaps=b,e.setRenderTarget(i,5,s),e.render(t,d),e.setRenderTarget(u,h,m),e.xr.enabled=f,i.texture.needsPMREMUpdate=!0}}class CO extends xn{constructor(e,t,i,s,r,o,a,l,c,d){e=e!==void 0?e:[],t=t!==void 0?t:ma,super(e,t,i,s,r,o,a,l,c,d),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class lvt extends so{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},s=[i,i,i,i,i,i];t.encoding!==void 0&&(Ol("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===Xr?tn:pi),this.texture=new CO(s,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:qn}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` +}`;class ro extends Di{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=svt,this.fragmentShader=rvt,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=ya(e.uniforms),this.uniformsGroups=nvt(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const s in this.uniforms){const o=this.uniforms[s].value;o&&o.isTexture?t.uniforms[s]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[s]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[s]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[s]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[s]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[s]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[s]={type:"m4",value:o.toArray()}:t.uniforms[s]={value:o}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const s in this.extensions)this.extensions[s]===!0&&(i[s]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class xO extends Zt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Tt,this.projectionMatrix=new Tt,this.projectionMatrixInverse=new Tt,this.coordinateSystem=vs}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class Un extends xO{constructor(e=50,t=1,i=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=s,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=va*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(wl*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return va*2*Math.atan(Math.tan(wl*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,i,s,r,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=s,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(wl*.5*this.fov)/this.zoom,i=2*t,s=this.aspect*i,r=-.5*s;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,c=o.fullHeight;r+=o.offsetX*s/l,t-=o.offsetY*i/c,s*=o.width/l,i*=o.height/c}const a=this.filmOffset;a!==0&&(r+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const ko=-90,Po=1;class ovt extends Zt{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const s=new Un(ko,Po,e,t);s.layers=this.layers,this.add(s);const r=new Un(ko,Po,e,t);r.layers=this.layers,this.add(r);const o=new Un(ko,Po,e,t);o.layers=this.layers,this.add(o);const a=new Un(ko,Po,e,t);a.layers=this.layers,this.add(a);const l=new Un(ko,Po,e,t);l.layers=this.layers,this.add(l);const c=new Un(ko,Po,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,s,r,o,a,l]=t;for(const c of t)this.remove(c);if(e===vs)i.up.set(0,1,0),i.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===au)i.up.set(0,-1,0),i.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of t)this.add(c),c.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:s}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[r,o,a,l,c,d]=this.children,u=e.getRenderTarget(),h=e.getActiveCubeFace(),m=e.getActiveMipmapLevel(),f=e.xr.enabled;e.xr.enabled=!1;const b=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,s),e.render(t,r),e.setRenderTarget(i,1,s),e.render(t,o),e.setRenderTarget(i,2,s),e.render(t,a),e.setRenderTarget(i,3,s),e.render(t,l),e.setRenderTarget(i,4,s),e.render(t,c),i.texture.generateMipmaps=b,e.setRenderTarget(i,5,s),e.render(t,d),e.setRenderTarget(u,h,m),e.xr.enabled=f,i.texture.needsPMREMUpdate=!0}}class CO extends xn{constructor(e,t,i,s,r,o,a,l,c,d){e=e!==void 0?e:[],t=t!==void 0?t:ma,super(e,t,i,s,r,o,a,l,c,d),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class avt extends so{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},s=[i,i,i,i,i,i];t.encoding!==void 0&&(Ol("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===Xr?tn:pi),this.texture=new CO(s,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:qn}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; @@ -244,9 +244,9 @@ ${l}`;navigator.clipboard.writeText(c),Fe(()=>{Be.replace()})},closeToast(){this gl_FragColor = texture2D( tEquirect, sampleUV ); } - `},s=new _r(5,5,5),r=new ro({name:"CubemapFromEquirect",uniforms:ya(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Wn,blending:dr});r.uniforms.tEquirect.value=t;const o=new Fn(s,r),a=t.minFilter;return t.minFilter===io&&(t.minFilter=qn),new avt(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,i,s){const r=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,s);e.setRenderTarget(r)}}const Gm=new pe,cvt=new pe,dvt=new yt;class Lr{constructor(e=new pe(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,s){return this.normal.set(e,t,i),this.constant=s,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const s=Gm.subVectors(i,t).cross(cvt.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(s,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const i=e.delta(Gm),s=this.normal.dot(i);if(s===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const r=-(e.start.dot(this.normal)+this.constant)/s;return r<0||r>1?null:t.copy(e.start).addScaledVector(i,r)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||dvt.getNormalMatrix(e),s=this.coplanarPoint(Gm).applyMatrix4(e),r=this.normal.applyMatrix3(i).normalize();return this.constant=-s.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Ir=new ns,rd=new pe;class Mb{constructor(e=new Lr,t=new Lr,i=new Lr,s=new Lr,r=new Lr,o=new Lr){this.planes=[e,t,i,s,r,o]}set(e,t,i,s,r,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(s),a[4].copy(r),a[5].copy(o),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=vs){const i=this.planes,s=e.elements,r=s[0],o=s[1],a=s[2],l=s[3],c=s[4],d=s[5],u=s[6],h=s[7],m=s[8],f=s[9],b=s[10],E=s[11],g=s[12],S=s[13],y=s[14],T=s[15];if(i[0].setComponents(l-r,h-c,E-m,T-g).normalize(),i[1].setComponents(l+r,h+c,E+m,T+g).normalize(),i[2].setComponents(l+o,h+d,E+f,T+S).normalize(),i[3].setComponents(l-o,h-d,E-f,T-S).normalize(),i[4].setComponents(l-a,h-u,E-b,T-y).normalize(),t===vs)i[5].setComponents(l+a,h+u,E+b,T+y).normalize();else if(t===au)i[5].setComponents(a,u,b,y).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Ir.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Ir.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Ir)}intersectsSprite(e){return Ir.center.set(0,0,0),Ir.radius=.7071067811865476,Ir.applyMatrix4(e.matrixWorld),this.intersectsSphere(Ir)}intersectsSphere(e){const t=this.planes,i=e.center,s=-e.radius;for(let r=0;r<6;r++)if(t[r].distanceToPoint(i)0?e.max.x:e.min.x,rd.y=s.normal.y>0?e.max.y:e.min.y,rd.z=s.normal.z>0?e.max.z:e.min.z,s.distanceToPoint(rd)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function RO(){let n=null,e=!1,t=null,i=null;function s(r,o){t(r,o),i=n.requestAnimationFrame(s)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(s),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(r){t=r},setContext:function(r){n=r}}}function uvt(n,e){const t=e.isWebGL2,i=new WeakMap;function s(c,d){const u=c.array,h=c.usage,m=u.byteLength,f=n.createBuffer();n.bindBuffer(d,f),n.bufferData(d,u,h),c.onUploadCallback();let b;if(u instanceof Float32Array)b=n.FLOAT;else if(u instanceof Uint16Array)if(c.isFloat16BufferAttribute)if(t)b=n.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else b=n.UNSIGNED_SHORT;else if(u instanceof Int16Array)b=n.SHORT;else if(u instanceof Uint32Array)b=n.UNSIGNED_INT;else if(u instanceof Int32Array)b=n.INT;else if(u instanceof Int8Array)b=n.BYTE;else if(u instanceof Uint8Array)b=n.UNSIGNED_BYTE;else if(u instanceof Uint8ClampedArray)b=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+u);return{buffer:f,type:b,bytesPerElement:u.BYTES_PER_ELEMENT,version:c.version,size:m}}function r(c,d,u){const h=d.array,m=d._updateRange,f=d.updateRanges;if(n.bindBuffer(u,c),m.count===-1&&f.length===0&&n.bufferSubData(u,0,h),f.length!==0){for(let b=0,E=f.length;b1?null:t.copy(e.start).addScaledVector(i,r)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||cvt.getNormalMatrix(e),s=this.coplanarPoint(Gm).applyMatrix4(e),r=this.normal.applyMatrix3(i).normalize();return this.constant=-s.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Ir=new ns,rd=new pe;class Mb{constructor(e=new Lr,t=new Lr,i=new Lr,s=new Lr,r=new Lr,o=new Lr){this.planes=[e,t,i,s,r,o]}set(e,t,i,s,r,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(s),a[4].copy(r),a[5].copy(o),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=vs){const i=this.planes,s=e.elements,r=s[0],o=s[1],a=s[2],l=s[3],c=s[4],d=s[5],u=s[6],h=s[7],m=s[8],f=s[9],b=s[10],E=s[11],g=s[12],S=s[13],y=s[14],T=s[15];if(i[0].setComponents(l-r,h-c,E-m,T-g).normalize(),i[1].setComponents(l+r,h+c,E+m,T+g).normalize(),i[2].setComponents(l+o,h+d,E+f,T+S).normalize(),i[3].setComponents(l-o,h-d,E-f,T-S).normalize(),i[4].setComponents(l-a,h-u,E-b,T-y).normalize(),t===vs)i[5].setComponents(l+a,h+u,E+b,T+y).normalize();else if(t===au)i[5].setComponents(a,u,b,y).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Ir.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Ir.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Ir)}intersectsSprite(e){return Ir.center.set(0,0,0),Ir.radius=.7071067811865476,Ir.applyMatrix4(e.matrixWorld),this.intersectsSphere(Ir)}intersectsSphere(e){const t=this.planes,i=e.center,s=-e.radius;for(let r=0;r<6;r++)if(t[r].distanceToPoint(i)0?e.max.x:e.min.x,rd.y=s.normal.y>0?e.max.y:e.min.y,rd.z=s.normal.z>0?e.max.z:e.min.z,s.distanceToPoint(rd)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function RO(){let n=null,e=!1,t=null,i=null;function s(r,o){t(r,o),i=n.requestAnimationFrame(s)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(s),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(r){t=r},setContext:function(r){n=r}}}function dvt(n,e){const t=e.isWebGL2,i=new WeakMap;function s(c,d){const u=c.array,h=c.usage,m=u.byteLength,f=n.createBuffer();n.bindBuffer(d,f),n.bufferData(d,u,h),c.onUploadCallback();let b;if(u instanceof Float32Array)b=n.FLOAT;else if(u instanceof Uint16Array)if(c.isFloat16BufferAttribute)if(t)b=n.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else b=n.UNSIGNED_SHORT;else if(u instanceof Int16Array)b=n.SHORT;else if(u instanceof Uint32Array)b=n.UNSIGNED_INT;else if(u instanceof Int32Array)b=n.INT;else if(u instanceof Int8Array)b=n.BYTE;else if(u instanceof Uint8Array)b=n.UNSIGNED_BYTE;else if(u instanceof Uint8ClampedArray)b=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+u);return{buffer:f,type:b,bytesPerElement:u.BYTES_PER_ELEMENT,version:c.version,size:m}}function r(c,d,u){const h=d.array,m=d._updateRange,f=d.updateRanges;if(n.bindBuffer(u,c),m.count===-1&&f.length===0&&n.bufferSubData(u,0,h),f.length!==0){for(let b=0,E=f.length;b{Be.replace()})},closeToast(){this : cases.z; return clamp( threshold , 1.0e-6, 1.0 ); } -#endif`,hvt=`#ifdef USE_ALPHAMAP +#endif`,_vt=`#ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g; -#endif`,fvt=`#ifdef USE_ALPHAMAP +#endif`,hvt=`#ifdef USE_ALPHAMAP uniform sampler2D alphaMap; -#endif`,mvt=`#ifdef USE_ALPHATEST +#endif`,fvt=`#ifdef USE_ALPHATEST if ( diffuseColor.a < alphaTest ) discard; -#endif`,gvt=`#ifdef USE_ALPHATEST +#endif`,mvt=`#ifdef USE_ALPHATEST uniform float alphaTest; -#endif`,Evt=`#ifdef USE_AOMAP +#endif`,gvt=`#ifdef USE_AOMAP float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0; reflectedLight.indirectDiffuse *= ambientOcclusion; #if defined( USE_CLEARCOAT ) @@ -302,10 +302,10 @@ ${l}`;navigator.clipboard.writeText(c),Fe(()=>{Be.replace()})},closeToast(){this float dotNV = saturate( dot( geometryNormal, geometryViewDir ) ); reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness ); #endif -#endif`,bvt=`#ifdef USE_AOMAP +#endif`,Evt=`#ifdef USE_AOMAP uniform sampler2D aoMap; uniform float aoMapIntensity; -#endif`,Svt=`#ifdef USE_BATCHING +#endif`,bvt=`#ifdef USE_BATCHING attribute float batchId; uniform highp sampler2D batchingTexture; mat4 getBatchingMatrix( const in float i ) { @@ -319,15 +319,15 @@ ${l}`;navigator.clipboard.writeText(c),Fe(()=>{Be.replace()})},closeToast(){this vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 ); return mat4( v1, v2, v3, v4 ); } -#endif`,vvt=`#ifdef USE_BATCHING +#endif`,Svt=`#ifdef USE_BATCHING mat4 batchingMatrix = getBatchingMatrix( batchId ); -#endif`,yvt=`vec3 transformed = vec3( position ); +#endif`,vvt=`vec3 transformed = vec3( position ); #ifdef USE_ALPHAHASH vPosition = vec3( position ); -#endif`,Tvt=`vec3 objectNormal = vec3( normal ); +#endif`,yvt=`vec3 objectNormal = vec3( normal ); #ifdef USE_TANGENT vec3 objectTangent = vec3( tangent.xyz ); -#endif`,xvt=`float G_BlinnPhong_Implicit( ) { +#endif`,Tvt=`float G_BlinnPhong_Implicit( ) { return 0.25; } float D_BlinnPhong( const in float shininess, const in float dotNH ) { @@ -341,7 +341,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve float G = G_BlinnPhong_Implicit( ); float D = D_BlinnPhong( shininess, dotNH ); return F * ( G * D ); -} // validated`,Cvt=`#ifdef USE_IRIDESCENCE +} // validated`,xvt=`#ifdef USE_IRIDESCENCE const mat3 XYZ_TO_REC709 = mat3( 3.2404542, -0.9692660, 0.0556434, -1.5371385, 1.8760108, -0.2040259, @@ -404,7 +404,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve } return max( I, vec3( 0.0 ) ); } -#endif`,Rvt=`#ifdef USE_BUMPMAP +#endif`,Cvt=`#ifdef USE_BUMPMAP uniform sampler2D bumpMap; uniform float bumpScale; vec2 dHdxy_fwd() { @@ -425,7 +425,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); return normalize( abs( fDet ) * surf_norm - vGrad ); } -#endif`,Avt=`#if NUM_CLIPPING_PLANES > 0 +#endif`,Rvt=`#if NUM_CLIPPING_PLANES > 0 vec4 plane; #pragma unroll_loop_start for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { @@ -443,26 +443,26 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve #pragma unroll_loop_end if ( clipped ) discard; #endif -#endif`,wvt=`#if NUM_CLIPPING_PLANES > 0 +#endif`,Avt=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,Nvt=`#if NUM_CLIPPING_PLANES > 0 +#endif`,wvt=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; -#endif`,Ovt=`#if NUM_CLIPPING_PLANES > 0 +#endif`,Nvt=`#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; -#endif`,Ivt=`#if defined( USE_COLOR_ALPHA ) +#endif`,Ovt=`#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; -#endif`,Mvt=`#if defined( USE_COLOR_ALPHA ) +#endif`,Ivt=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; -#endif`,Dvt=`#if defined( USE_COLOR_ALPHA ) +#endif`,Mvt=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) varying vec3 vColor; -#endif`,Lvt=`#if defined( USE_COLOR_ALPHA ) +#endif`,Dvt=`#if defined( USE_COLOR_ALPHA ) vColor = vec4( 1.0 ); #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) vColor = vec3( 1.0 ); @@ -472,7 +472,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve #endif #ifdef USE_INSTANCING_COLOR vColor.xyz *= instanceColor.xyz; -#endif`,kvt=`#define PI 3.141592653589793 +#endif`,Lvt=`#define PI 3.141592653589793 #define PI2 6.283185307179586 #define PI_HALF 1.5707963267948966 #define RECIPROCAL_PI 0.3183098861837907 @@ -550,7 +550,7 @@ vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); -} // validated`,Pvt=`#ifdef ENVMAP_TYPE_CUBE_UV +} // validated`,kvt=`#ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_minMipLevel 4.0 #define cubeUV_minTileSize 16.0 float getFace( vec3 direction ) { @@ -648,7 +648,7 @@ float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { return vec4( mix( color0, color1, mipF ), 1.0 ); } } -#endif`,Uvt=`vec3 transformedNormal = objectNormal; +#endif`,Pvt=`vec3 transformedNormal = objectNormal; #ifdef USE_TANGENT vec3 transformedTangent = objectTangent; #endif @@ -677,18 +677,18 @@ transformedNormal = normalMatrix * transformedNormal; #ifdef FLIP_SIDED transformedTangent = - transformedTangent; #endif -#endif`,Fvt=`#ifdef USE_DISPLACEMENTMAP +#endif`,Uvt=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; -#endif`,Bvt=`#ifdef USE_DISPLACEMENTMAP +#endif`,Fvt=`#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); -#endif`,Gvt=`#ifdef USE_EMISSIVEMAP +#endif`,Bvt=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,Vvt=`#ifdef USE_EMISSIVEMAP +#endif`,Gvt=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; -#endif`,zvt="gl_FragColor = linearToOutputTexel( gl_FragColor );",Hvt=` +#endif`,Vvt="gl_FragColor = linearToOutputTexel( gl_FragColor );",zvt=` const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3( vec3( 0.8224621, 0.177538, 0.0 ), vec3( 0.0331941, 0.9668058, 0.0 ), @@ -716,7 +716,7 @@ vec4 LinearToLinear( in vec4 value ) { } vec4 LinearTosRGB( in vec4 value ) { return sRGBTransferOETF( value ); -}`,qvt=`#ifdef USE_ENVMAP +}`,Hvt=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vec3 cameraToFrag; if ( isOrthographic ) { @@ -745,7 +745,7 @@ vec4 LinearTosRGB( in vec4 value ) { #elif defined( ENVMAP_BLENDING_ADD ) outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif -#endif`,Yvt=`#ifdef USE_ENVMAP +#endif`,qvt=`#ifdef USE_ENVMAP uniform float envMapIntensity; uniform float flipEnvMap; #ifdef ENVMAP_TYPE_CUBE @@ -754,7 +754,7 @@ vec4 LinearTosRGB( in vec4 value ) { uniform sampler2D envMap; #endif -#endif`,$vt=`#ifdef USE_ENVMAP +#endif`,Yvt=`#ifdef USE_ENVMAP uniform float reflectivity; #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS @@ -765,7 +765,7 @@ vec4 LinearTosRGB( in vec4 value ) { #else varying vec3 vReflect; #endif -#endif`,Wvt=`#ifdef USE_ENVMAP +#endif`,$vt=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS #endif @@ -776,7 +776,7 @@ vec4 LinearTosRGB( in vec4 value ) { varying vec3 vReflect; uniform float refractionRatio; #endif -#endif`,Kvt=`#ifdef USE_ENVMAP +#endif`,Wvt=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vWorldPosition = worldPosition.xyz; #else @@ -793,18 +793,18 @@ vec4 LinearTosRGB( in vec4 value ) { vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); #endif #endif -#endif`,jvt=`#ifdef USE_FOG +#endif`,Kvt=`#ifdef USE_FOG vFogDepth = - mvPosition.z; -#endif`,Qvt=`#ifdef USE_FOG +#endif`,jvt=`#ifdef USE_FOG varying float vFogDepth; -#endif`,Xvt=`#ifdef USE_FOG +#endif`,Qvt=`#ifdef USE_FOG #ifdef FOG_EXP2 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); #else float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); #endif gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,Zvt=`#ifdef USE_FOG +#endif`,Xvt=`#ifdef USE_FOG uniform vec3 fogColor; varying float vFogDepth; #ifdef FOG_EXP2 @@ -813,7 +813,7 @@ vec4 LinearTosRGB( in vec4 value ) { uniform float fogNear; uniform float fogFar; #endif -#endif`,Jvt=`#ifdef USE_GRADIENTMAP +#endif`,Zvt=`#ifdef USE_GRADIENTMAP uniform sampler2D gradientMap; #endif vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { @@ -825,16 +825,16 @@ vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { vec2 fw = fwidth( coord ) * 0.5; return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); #endif -}`,eyt=`#ifdef USE_LIGHTMAP +}`,Jvt=`#ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; reflectedLight.indirectDiffuse += lightMapIrradiance; -#endif`,tyt=`#ifdef USE_LIGHTMAP +#endif`,eyt=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; -#endif`,nyt=`LambertMaterial material; +#endif`,tyt=`LambertMaterial material; material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,iyt=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,nyt=`varying vec3 vViewPosition; struct LambertMaterial { vec3 diffuseColor; float specularStrength; @@ -848,7 +848,7 @@ void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometr reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Lambert -#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,syt=`uniform bool receiveShadow; +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,iyt=`uniform bool receiveShadow; uniform vec3 ambientLightColor; #if defined( USE_LIGHT_PROBES ) uniform vec3 lightProbe[ 9 ]; @@ -971,7 +971,7 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); return irradiance; } -#endif`,ryt=`#ifdef USE_ENVMAP +#endif`,syt=`#ifdef USE_ENVMAP vec3 getIBLIrradiance( const in vec3 normal ) { #ifdef ENVMAP_TYPE_CUBE_UV vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); @@ -1004,8 +1004,8 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi #endif } #endif -#endif`,oyt=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,ayt=`varying vec3 vViewPosition; +#endif`,ryt=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,oyt=`varying vec3 vViewPosition; struct ToonMaterial { vec3 diffuseColor; }; @@ -1017,11 +1017,11 @@ void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPo reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,lyt=`BlinnPhongMaterial material; +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,ayt=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; -material.specularStrength = specularStrength;`,cyt=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,lyt=`varying vec3 vViewPosition; struct BlinnPhongMaterial { vec3 diffuseColor; vec3 specularColor; @@ -1038,7 +1038,7 @@ void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geom reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,dyt=`PhysicalMaterial material; +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,cyt=`PhysicalMaterial material; material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); @@ -1121,7 +1121,7 @@ material.roughness = min( material.roughness, 1.0 ); material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; -#endif`,uyt=`struct PhysicalMaterial { +#endif`,dyt=`struct PhysicalMaterial { vec3 diffuseColor; float roughness; vec3 specularColor; @@ -1421,7 +1421,7 @@ void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradia #define RE_IndirectSpecular RE_IndirectSpecular_Physical float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,pyt=` +}`,uyt=` vec3 geometryPosition = - vViewPosition; vec3 geometryNormal = normal; vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); @@ -1536,7 +1536,7 @@ IncidentLight directLight; #if defined( RE_IndirectSpecular ) vec3 radiance = vec3( 0.0 ); vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,_yt=`#if defined( RE_IndirectDiffuse ) +#endif`,pyt=`#if defined( RE_IndirectDiffuse ) #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; @@ -1555,25 +1555,25 @@ IncidentLight directLight; #ifdef USE_CLEARCOAT clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); #endif -#endif`,hyt=`#if defined( RE_IndirectDiffuse ) +#endif`,_yt=`#if defined( RE_IndirectDiffuse ) RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); #endif #if defined( RE_IndirectSpecular ) RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); -#endif`,fyt=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) +#endif`,hyt=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,myt=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) +#endif`,fyt=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; -#endif`,gyt=`#ifdef USE_LOGDEPTHBUF +#endif`,myt=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT varying float vFragDepth; varying float vIsPerspective; #else uniform float logDepthBufFC; #endif -#endif`,Eyt=`#ifdef USE_LOGDEPTHBUF +#endif`,gyt=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); @@ -1583,16 +1583,16 @@ IncidentLight directLight; gl_Position.z *= gl_Position.w; } #endif -#endif`,byt=`#ifdef USE_MAP +#endif`,Eyt=`#ifdef USE_MAP vec4 sampledDiffuseColor = texture2D( map, vMapUv ); #ifdef DECODE_VIDEO_TEXTURE sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); #endif diffuseColor *= sampledDiffuseColor; -#endif`,Syt=`#ifdef USE_MAP +#endif`,byt=`#ifdef USE_MAP uniform sampler2D map; -#endif`,vyt=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) +#endif`,Syt=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) #if defined( USE_POINTS_UV ) vec2 uv = vUv; #else @@ -1604,7 +1604,7 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,yyt=`#if defined( USE_POINTS_UV ) +#endif`,vyt=`#if defined( USE_POINTS_UV ) varying vec2 vUv; #else #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) @@ -1616,13 +1616,13 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP uniform sampler2D alphaMap; -#endif`,Tyt=`float metalnessFactor = metalness; +#endif`,yyt=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); metalnessFactor *= texelMetalness.b; -#endif`,xyt=`#ifdef USE_METALNESSMAP +#endif`,Tyt=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; -#endif`,Cyt=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) +#endif`,xyt=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) vColor *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { #if defined( USE_COLOR_ALPHA ) @@ -1631,7 +1631,7 @@ IncidentLight directLight; if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; #endif } -#endif`,Ryt=`#ifdef USE_MORPHNORMALS +#endif`,Cyt=`#ifdef USE_MORPHNORMALS objectNormal *= morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { @@ -1643,7 +1643,7 @@ IncidentLight directLight; objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; #endif -#endif`,Ayt=`#ifdef USE_MORPHTARGETS +#endif`,Ryt=`#ifdef USE_MORPHTARGETS uniform float morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; @@ -1663,7 +1663,7 @@ IncidentLight directLight; uniform float morphTargetInfluences[ 4 ]; #endif #endif -#endif`,wyt=`#ifdef USE_MORPHTARGETS +#endif`,Ayt=`#ifdef USE_MORPHTARGETS transformed *= morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { @@ -1681,7 +1681,7 @@ IncidentLight directLight; transformed += morphTarget7 * morphTargetInfluences[ 7 ]; #endif #endif -#endif`,Nyt=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#endif`,wyt=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; #ifdef FLAT_SHADED vec3 fdx = dFdx( vViewPosition ); vec3 fdy = dFdy( vViewPosition ); @@ -1722,7 +1722,7 @@ IncidentLight directLight; tbn2[1] *= faceDirection; #endif #endif -vec3 nonPerturbedNormal = normal;`,Oyt=`#ifdef USE_NORMALMAP_OBJECTSPACE +vec3 nonPerturbedNormal = normal;`,Nyt=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; #ifdef FLIP_SIDED normal = - normal; @@ -1737,6 +1737,12 @@ vec3 nonPerturbedNormal = normal;`,Oyt=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = normalize( tbn * mapN ); #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); +#endif`,Oyt=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif #endif`,Iyt=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT @@ -1744,18 +1750,12 @@ vec3 nonPerturbedNormal = normal;`,Oyt=`#ifdef USE_NORMALMAP_OBJECTSPACE varying vec3 vBitangent; #endif #endif`,Myt=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif`,Dyt=`#ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif -#endif`,Lyt=`#ifdef USE_NORMALMAP +#endif`,Dyt=`#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; #endif @@ -1777,13 +1777,13 @@ vec3 nonPerturbedNormal = normal;`,Oyt=`#ifdef USE_NORMALMAP_OBJECTSPACE float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); return mat3( T * scale, B * scale, N ); } -#endif`,kyt=`#ifdef USE_CLEARCOAT +#endif`,Lyt=`#ifdef USE_CLEARCOAT vec3 clearcoatNormal = nonPerturbedNormal; -#endif`,Pyt=`#ifdef USE_CLEARCOAT_NORMALMAP +#endif`,kyt=`#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; clearcoatNormal = normalize( tbn2 * clearcoatMapN ); -#endif`,Uyt=`#ifdef USE_CLEARCOATMAP +#endif`,Pyt=`#ifdef USE_CLEARCOATMAP uniform sampler2D clearcoatMap; #endif #ifdef USE_CLEARCOAT_NORMALMAP @@ -1792,18 +1792,18 @@ vec3 nonPerturbedNormal = normal;`,Oyt=`#ifdef USE_NORMALMAP_OBJECTSPACE #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP uniform sampler2D clearcoatRoughnessMap; -#endif`,Fyt=`#ifdef USE_IRIDESCENCEMAP +#endif`,Uyt=`#ifdef USE_IRIDESCENCEMAP uniform sampler2D iridescenceMap; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform sampler2D iridescenceThicknessMap; -#endif`,Byt=`#ifdef OPAQUE +#endif`,Fyt=`#ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= material.transmissionAlpha; #endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,Gyt=`vec3 packNormalToRGB( const in vec3 normal ) { +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,Byt=`vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { @@ -1844,9 +1844,9 @@ float viewZToPerspectiveDepth( const in float viewZ, const in float near, const } float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * depth - far ); -}`,Vyt=`#ifdef PREMULTIPLIED_ALPHA +}`,Gyt=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; -#endif`,zyt=`vec4 mvPosition = vec4( transformed, 1.0 ); +#endif`,Vyt=`vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING mvPosition = batchingMatrix * mvPosition; #endif @@ -1854,22 +1854,22 @@ float perspectiveDepthToViewZ( const in float depth, const in float near, const mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,Hyt=`#ifdef DITHERING +gl_Position = projectionMatrix * mvPosition;`,zyt=`#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,qyt=`#ifdef DITHERING +#endif`,Hyt=`#ifdef DITHERING vec3 dithering( vec3 color ) { float grid_position = rand( gl_FragCoord.xy ); vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); return color + dither_shift_RGB; } -#endif`,Yyt=`float roughnessFactor = roughness; +#endif`,qyt=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); roughnessFactor *= texelRoughness.g; -#endif`,$yt=`#ifdef USE_ROUGHNESSMAP +#endif`,Yyt=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; -#endif`,Wyt=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,$yt=`#if NUM_SPOT_LIGHT_COORDS > 0 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #if NUM_SPOT_LIGHT_MAPS > 0 @@ -2046,7 +2046,7 @@ gl_Position = projectionMatrix * mvPosition;`,Hyt=`#ifdef DITHERING return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); #endif } -#endif`,Kyt=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,Wyt=`#if NUM_SPOT_LIGHT_COORDS > 0 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif @@ -2084,7 +2084,7 @@ gl_Position = projectionMatrix * mvPosition;`,Hyt=`#ifdef DITHERING }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif -#endif`,jyt=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) +#endif`,Kyt=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); vec4 shadowWorldPosition; #endif @@ -2116,7 +2116,7 @@ gl_Position = projectionMatrix * mvPosition;`,Hyt=`#ifdef DITHERING vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end -#endif`,Qyt=`float getShadowMask() { +#endif`,jyt=`float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 @@ -2148,12 +2148,12 @@ gl_Position = projectionMatrix * mvPosition;`,Hyt=`#ifdef DITHERING #endif #endif return shadow; -}`,Xyt=`#ifdef USE_SKINNING +}`,Qyt=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,Zyt=`#ifdef USE_SKINNING +#endif`,Xyt=`#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; uniform highp sampler2D boneTexture; @@ -2168,7 +2168,7 @@ gl_Position = projectionMatrix * mvPosition;`,Hyt=`#ifdef DITHERING vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); return mat4( v1, v2, v3, v4 ); } -#endif`,Jyt=`#ifdef USE_SKINNING +#endif`,Zyt=`#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; @@ -2176,7 +2176,7 @@ gl_Position = projectionMatrix * mvPosition;`,Hyt=`#ifdef DITHERING skinned += boneMatZ * skinVertex * skinWeight.z; skinned += boneMatW * skinVertex * skinWeight.w; transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,eTt=`#ifdef USE_SKINNING +#endif`,Jyt=`#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; @@ -2187,17 +2187,17 @@ gl_Position = projectionMatrix * mvPosition;`,Hyt=`#ifdef DITHERING #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif -#endif`,tTt=`float specularStrength; +#endif`,eTt=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; -#endif`,nTt=`#ifdef USE_SPECULARMAP +#endif`,tTt=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; -#endif`,iTt=`#if defined( TONE_MAPPING ) +#endif`,nTt=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,sTt=`#ifndef saturate +#endif`,iTt=`#ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif uniform float toneMappingExposure; @@ -2233,7 +2233,7 @@ vec3 ACESFilmicToneMapping( vec3 color ) { color = ACESOutputMat * color; return saturate( color ); } -vec3 CustomToneMapping( vec3 color ) { return color; }`,rTt=`#ifdef USE_TRANSMISSION +vec3 CustomToneMapping( vec3 color ) { return color; }`,sTt=`#ifdef USE_TRANSMISSION material.transmission = transmission; material.transmissionAlpha = 1.0; material.thickness = thickness; @@ -2254,7 +2254,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,rTt=`#ifdef USE_TRANSMIS material.attenuationColor, material.attenuationDistance ); material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); -#endif`,oTt=`#ifdef USE_TRANSMISSION +#endif`,rTt=`#ifdef USE_TRANSMISSION uniform float transmission; uniform float thickness; uniform float attenuationDistance; @@ -2360,7 +2360,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,rTt=`#ifdef USE_TRANSMIS float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); } -#endif`,aTt=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,oTt=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -2430,7 +2430,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,rTt=`#ifdef USE_TRANSMIS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,lTt=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,aTt=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -2524,7 +2524,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,rTt=`#ifdef USE_TRANSMIS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,cTt=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,lTt=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) vUv = vec3( uv, 1 ).xy; #endif #ifdef USE_MAP @@ -2595,7 +2595,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,rTt=`#ifdef USE_TRANSMIS #endif #ifdef USE_THICKNESSMAP vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; -#endif`,dTt=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 +#endif`,cTt=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 vec4 worldPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING worldPosition = batchingMatrix * worldPosition; @@ -2604,12 +2604,12 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,rTt=`#ifdef USE_TRANSMIS worldPosition = instanceMatrix * worldPosition; #endif worldPosition = modelMatrix * worldPosition; -#endif`;const uTt=`varying vec2 vUv; +#endif`;const dTt=`varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,pTt=`uniform sampler2D t2D; +}`,uTt=`uniform sampler2D t2D; uniform float backgroundIntensity; varying vec2 vUv; void main() { @@ -2621,14 +2621,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,_Tt=`varying vec3 vWorldDirection; +}`,pTt=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,hTt=`#ifdef ENVMAP_TYPE_CUBE +}`,_Tt=`#ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #elif defined( ENVMAP_TYPE_CUBE_UV ) uniform sampler2D envMap; @@ -2650,14 +2650,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,fTt=`varying vec3 vWorldDirection; +}`,hTt=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,mTt=`uniform samplerCube tCube; +}`,fTt=`uniform samplerCube tCube; uniform float tFlip; uniform float opacity; varying vec3 vWorldDirection; @@ -2667,7 +2667,7 @@ void main() { gl_FragColor.a *= opacity; #include #include -}`,gTt=`#include +}`,mTt=`#include #include #include #include @@ -2693,7 +2693,7 @@ void main() { #include #include vHighPrecisionZW = gl_Position.zw; -}`,ETt=`#if DEPTH_PACKING == 3200 +}`,gTt=`#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include @@ -2723,7 +2723,7 @@ void main() { #elif DEPTH_PACKING == 3201 gl_FragColor = packDepthToRGBA( fragCoordZ ); #endif -}`,bTt=`#define DISTANCE +}`,ETt=`#define DISTANCE varying vec3 vWorldPosition; #include #include @@ -2749,7 +2749,7 @@ void main() { #include #include vWorldPosition = worldPosition.xyz; -}`,STt=`#define DISTANCE +}`,bTt=`#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; @@ -2773,13 +2773,13 @@ void main () { dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = packDepthToRGBA( dist ); -}`,vTt=`varying vec3 vWorldDirection; +}`,STt=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include -}`,yTt=`uniform sampler2D tEquirect; +}`,vTt=`uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { @@ -2788,7 +2788,7 @@ void main() { gl_FragColor = texture2D( tEquirect, sampleUV ); #include #include -}`,TTt=`uniform float scale; +}`,yTt=`uniform float scale; attribute float lineDistance; varying float vLineDistance; #include @@ -2809,7 +2809,7 @@ void main() { #include #include #include -}`,xTt=`uniform vec3 diffuse; +}`,TTt=`uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; @@ -2837,7 +2837,7 @@ void main() { #include #include #include -}`,CTt=`#include +}`,xTt=`#include #include #include #include @@ -2868,7 +2868,7 @@ void main() { #include #include #include -}`,RTt=`uniform vec3 diffuse; +}`,CTt=`uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; @@ -2916,7 +2916,7 @@ void main() { #include #include #include -}`,ATt=`#define LAMBERT +}`,RTt=`#define LAMBERT varying vec3 vViewPosition; #include #include @@ -2954,7 +2954,7 @@ void main() { #include #include #include -}`,wTt=`#define LAMBERT +}`,ATt=`#define LAMBERT uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -3011,7 +3011,7 @@ void main() { #include #include #include -}`,NTt=`#define MATCAP +}`,wTt=`#define MATCAP varying vec3 vViewPosition; #include #include @@ -3044,7 +3044,7 @@ void main() { #include #include vViewPosition = - mvPosition.xyz; -}`,OTt=`#define MATCAP +}`,NTt=`#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; @@ -3090,7 +3090,7 @@ void main() { #include #include #include -}`,ITt=`#define NORMAL +}`,OTt=`#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; #endif @@ -3122,7 +3122,7 @@ void main() { #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) vViewPosition = - mvPosition.xyz; #endif -}`,MTt=`#define NORMAL +}`,ITt=`#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; @@ -3143,7 +3143,7 @@ void main() { #ifdef OPAQUE gl_FragColor.a = 1.0; #endif -}`,DTt=`#define PHONG +}`,MTt=`#define PHONG varying vec3 vViewPosition; #include #include @@ -3181,7 +3181,7 @@ void main() { #include #include #include -}`,LTt=`#define PHONG +}`,DTt=`#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; @@ -3240,7 +3240,7 @@ void main() { #include #include #include -}`,kTt=`#define STANDARD +}`,LTt=`#define STANDARD varying vec3 vViewPosition; #ifdef USE_TRANSMISSION varying vec3 vWorldPosition; @@ -3282,7 +3282,7 @@ void main() { #ifdef USE_TRANSMISSION vWorldPosition = worldPosition.xyz; #endif -}`,PTt=`#define STANDARD +}`,kTt=`#define STANDARD #ifdef PHYSICAL #define IOR #define USE_SPECULAR @@ -3404,7 +3404,7 @@ void main() { #include #include #include -}`,UTt=`#define TOON +}`,PTt=`#define TOON varying vec3 vViewPosition; #include #include @@ -3440,7 +3440,7 @@ void main() { #include #include #include -}`,FTt=`#define TOON +}`,UTt=`#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -3493,7 +3493,7 @@ void main() { #include #include #include -}`,BTt=`uniform float size; +}`,FTt=`uniform float size; uniform float scale; #include #include @@ -3523,7 +3523,7 @@ void main() { #include #include #include -}`,GTt=`uniform vec3 diffuse; +}`,BTt=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3548,7 +3548,7 @@ void main() { #include #include #include -}`,VTt=`#include +}`,GTt=`#include #include #include #include @@ -3570,7 +3570,7 @@ void main() { #include #include #include -}`,zTt=`uniform vec3 color; +}`,VTt=`uniform vec3 color; uniform float opacity; #include #include @@ -3586,7 +3586,7 @@ void main() { #include #include #include -}`,HTt=`uniform float rotation; +}`,zTt=`uniform float rotation; uniform vec2 center; #include #include @@ -3612,7 +3612,7 @@ void main() { #include #include #include -}`,qTt=`uniform vec3 diffuse; +}`,HTt=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3637,7 +3637,7 @@ void main() { #include #include #include -}`,St={alphahash_fragment:pvt,alphahash_pars_fragment:_vt,alphamap_fragment:hvt,alphamap_pars_fragment:fvt,alphatest_fragment:mvt,alphatest_pars_fragment:gvt,aomap_fragment:Evt,aomap_pars_fragment:bvt,batching_pars_vertex:Svt,batching_vertex:vvt,begin_vertex:yvt,beginnormal_vertex:Tvt,bsdfs:xvt,iridescence_fragment:Cvt,bumpmap_pars_fragment:Rvt,clipping_planes_fragment:Avt,clipping_planes_pars_fragment:wvt,clipping_planes_pars_vertex:Nvt,clipping_planes_vertex:Ovt,color_fragment:Ivt,color_pars_fragment:Mvt,color_pars_vertex:Dvt,color_vertex:Lvt,common:kvt,cube_uv_reflection_fragment:Pvt,defaultnormal_vertex:Uvt,displacementmap_pars_vertex:Fvt,displacementmap_vertex:Bvt,emissivemap_fragment:Gvt,emissivemap_pars_fragment:Vvt,colorspace_fragment:zvt,colorspace_pars_fragment:Hvt,envmap_fragment:qvt,envmap_common_pars_fragment:Yvt,envmap_pars_fragment:$vt,envmap_pars_vertex:Wvt,envmap_physical_pars_fragment:ryt,envmap_vertex:Kvt,fog_vertex:jvt,fog_pars_vertex:Qvt,fog_fragment:Xvt,fog_pars_fragment:Zvt,gradientmap_pars_fragment:Jvt,lightmap_fragment:eyt,lightmap_pars_fragment:tyt,lights_lambert_fragment:nyt,lights_lambert_pars_fragment:iyt,lights_pars_begin:syt,lights_toon_fragment:oyt,lights_toon_pars_fragment:ayt,lights_phong_fragment:lyt,lights_phong_pars_fragment:cyt,lights_physical_fragment:dyt,lights_physical_pars_fragment:uyt,lights_fragment_begin:pyt,lights_fragment_maps:_yt,lights_fragment_end:hyt,logdepthbuf_fragment:fyt,logdepthbuf_pars_fragment:myt,logdepthbuf_pars_vertex:gyt,logdepthbuf_vertex:Eyt,map_fragment:byt,map_pars_fragment:Syt,map_particle_fragment:vyt,map_particle_pars_fragment:yyt,metalnessmap_fragment:Tyt,metalnessmap_pars_fragment:xyt,morphcolor_vertex:Cyt,morphnormal_vertex:Ryt,morphtarget_pars_vertex:Ayt,morphtarget_vertex:wyt,normal_fragment_begin:Nyt,normal_fragment_maps:Oyt,normal_pars_fragment:Iyt,normal_pars_vertex:Myt,normal_vertex:Dyt,normalmap_pars_fragment:Lyt,clearcoat_normal_fragment_begin:kyt,clearcoat_normal_fragment_maps:Pyt,clearcoat_pars_fragment:Uyt,iridescence_pars_fragment:Fyt,opaque_fragment:Byt,packing:Gyt,premultiplied_alpha_fragment:Vyt,project_vertex:zyt,dithering_fragment:Hyt,dithering_pars_fragment:qyt,roughnessmap_fragment:Yyt,roughnessmap_pars_fragment:$yt,shadowmap_pars_fragment:Wyt,shadowmap_pars_vertex:Kyt,shadowmap_vertex:jyt,shadowmask_pars_fragment:Qyt,skinbase_vertex:Xyt,skinning_pars_vertex:Zyt,skinning_vertex:Jyt,skinnormal_vertex:eTt,specularmap_fragment:tTt,specularmap_pars_fragment:nTt,tonemapping_fragment:iTt,tonemapping_pars_fragment:sTt,transmission_fragment:rTt,transmission_pars_fragment:oTt,uv_pars_fragment:aTt,uv_pars_vertex:lTt,uv_vertex:cTt,worldpos_vertex:dTt,background_vert:uTt,background_frag:pTt,backgroundCube_vert:_Tt,backgroundCube_frag:hTt,cube_vert:fTt,cube_frag:mTt,depth_vert:gTt,depth_frag:ETt,distanceRGBA_vert:bTt,distanceRGBA_frag:STt,equirect_vert:vTt,equirect_frag:yTt,linedashed_vert:TTt,linedashed_frag:xTt,meshbasic_vert:CTt,meshbasic_frag:RTt,meshlambert_vert:ATt,meshlambert_frag:wTt,meshmatcap_vert:NTt,meshmatcap_frag:OTt,meshnormal_vert:ITt,meshnormal_frag:MTt,meshphong_vert:DTt,meshphong_frag:LTt,meshphysical_vert:kTt,meshphysical_frag:PTt,meshtoon_vert:UTt,meshtoon_frag:FTt,points_vert:BTt,points_frag:GTt,shadow_vert:VTt,shadow_frag:zTt,sprite_vert:HTt,sprite_frag:qTt},ze={common:{diffuse:{value:new ut(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new yt},alphaMap:{value:null},alphaMapTransform:{value:new yt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new yt}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new yt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new yt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new yt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new yt},normalScale:{value:new Rt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new yt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new yt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new yt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new yt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ut(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new ut(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new yt},alphaTest:{value:0},uvTransform:{value:new yt}},sprite:{diffuse:{value:new ut(16777215)},opacity:{value:1},center:{value:new Rt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new yt},alphaMap:{value:null},alphaMapTransform:{value:new yt},alphaTest:{value:0}}},Gi={basic:{uniforms:Pn([ze.common,ze.specularmap,ze.envmap,ze.aomap,ze.lightmap,ze.fog]),vertexShader:St.meshbasic_vert,fragmentShader:St.meshbasic_frag},lambert:{uniforms:Pn([ze.common,ze.specularmap,ze.envmap,ze.aomap,ze.lightmap,ze.emissivemap,ze.bumpmap,ze.normalmap,ze.displacementmap,ze.fog,ze.lights,{emissive:{value:new ut(0)}}]),vertexShader:St.meshlambert_vert,fragmentShader:St.meshlambert_frag},phong:{uniforms:Pn([ze.common,ze.specularmap,ze.envmap,ze.aomap,ze.lightmap,ze.emissivemap,ze.bumpmap,ze.normalmap,ze.displacementmap,ze.fog,ze.lights,{emissive:{value:new ut(0)},specular:{value:new ut(1118481)},shininess:{value:30}}]),vertexShader:St.meshphong_vert,fragmentShader:St.meshphong_frag},standard:{uniforms:Pn([ze.common,ze.envmap,ze.aomap,ze.lightmap,ze.emissivemap,ze.bumpmap,ze.normalmap,ze.displacementmap,ze.roughnessmap,ze.metalnessmap,ze.fog,ze.lights,{emissive:{value:new ut(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:St.meshphysical_vert,fragmentShader:St.meshphysical_frag},toon:{uniforms:Pn([ze.common,ze.aomap,ze.lightmap,ze.emissivemap,ze.bumpmap,ze.normalmap,ze.displacementmap,ze.gradientmap,ze.fog,ze.lights,{emissive:{value:new ut(0)}}]),vertexShader:St.meshtoon_vert,fragmentShader:St.meshtoon_frag},matcap:{uniforms:Pn([ze.common,ze.bumpmap,ze.normalmap,ze.displacementmap,ze.fog,{matcap:{value:null}}]),vertexShader:St.meshmatcap_vert,fragmentShader:St.meshmatcap_frag},points:{uniforms:Pn([ze.points,ze.fog]),vertexShader:St.points_vert,fragmentShader:St.points_frag},dashed:{uniforms:Pn([ze.common,ze.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:St.linedashed_vert,fragmentShader:St.linedashed_frag},depth:{uniforms:Pn([ze.common,ze.displacementmap]),vertexShader:St.depth_vert,fragmentShader:St.depth_frag},normal:{uniforms:Pn([ze.common,ze.bumpmap,ze.normalmap,ze.displacementmap,{opacity:{value:1}}]),vertexShader:St.meshnormal_vert,fragmentShader:St.meshnormal_frag},sprite:{uniforms:Pn([ze.sprite,ze.fog]),vertexShader:St.sprite_vert,fragmentShader:St.sprite_frag},background:{uniforms:{uvTransform:{value:new yt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:St.background_vert,fragmentShader:St.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:St.backgroundCube_vert,fragmentShader:St.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:St.cube_vert,fragmentShader:St.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:St.equirect_vert,fragmentShader:St.equirect_frag},distanceRGBA:{uniforms:Pn([ze.common,ze.displacementmap,{referencePosition:{value:new pe},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:St.distanceRGBA_vert,fragmentShader:St.distanceRGBA_frag},shadow:{uniforms:Pn([ze.lights,ze.fog,{color:{value:new ut(0)},opacity:{value:1}}]),vertexShader:St.shadow_vert,fragmentShader:St.shadow_frag}};Gi.physical={uniforms:Pn([Gi.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new yt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new yt},clearcoatNormalScale:{value:new Rt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new yt},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new yt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new yt},sheen:{value:0},sheenColor:{value:new ut(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new yt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new yt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new yt},transmissionSamplerSize:{value:new Rt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new yt},attenuationDistance:{value:0},attenuationColor:{value:new ut(0)},specularColor:{value:new ut(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new yt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new yt},anisotropyVector:{value:new Rt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new yt}}]),vertexShader:St.meshphysical_vert,fragmentShader:St.meshphysical_frag};const od={r:0,b:0,g:0};function YTt(n,e,t,i,s,r,o){const a=new ut(0);let l=r===!0?0:1,c,d,u=null,h=0,m=null;function f(E,g){let S=!1,y=g.isScene===!0?g.background:null;y&&y.isTexture&&(y=(g.backgroundBlurriness>0?t:e).get(y)),y===null?b(a,l):y&&y.isColor&&(b(y,1),S=!0);const T=n.xr.getEnvironmentBlendMode();T==="additive"?i.buffers.color.setClear(0,0,0,1,o):T==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(n.autoClear||S)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),y&&(y.isCubeTexture||y.mapping===Ku)?(d===void 0&&(d=new Fn(new _r(1,1,1),new ro({name:"BackgroundCubeMaterial",uniforms:ya(Gi.backgroundCube.uniforms),vertexShader:Gi.backgroundCube.vertexShader,fragmentShader:Gi.backgroundCube.fragmentShader,side:Wn,depthTest:!1,depthWrite:!1,fog:!1})),d.geometry.deleteAttribute("normal"),d.geometry.deleteAttribute("uv"),d.onBeforeRender=function(C,x,w){this.matrixWorld.copyPosition(w.matrixWorld)},Object.defineProperty(d.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(d)),d.material.uniforms.envMap.value=y,d.material.uniforms.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,d.material.uniforms.backgroundBlurriness.value=g.backgroundBlurriness,d.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,d.material.toneMapped=kt.getTransfer(y.colorSpace)!==$t,(u!==y||h!==y.version||m!==n.toneMapping)&&(d.material.needsUpdate=!0,u=y,h=y.version,m=n.toneMapping),d.layers.enableAll(),E.unshift(d,d.geometry,d.material,0,0,null)):y&&y.isTexture&&(c===void 0&&(c=new Fn(new Db(2,2),new ro({name:"BackgroundMaterial",uniforms:ya(Gi.background.uniforms),vertexShader:Gi.background.vertexShader,fragmentShader:Gi.background.fragmentShader,side:Os,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(c)),c.material.uniforms.t2D.value=y,c.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,c.material.toneMapped=kt.getTransfer(y.colorSpace)!==$t,y.matrixAutoUpdate===!0&&y.updateMatrix(),c.material.uniforms.uvTransform.value.copy(y.matrix),(u!==y||h!==y.version||m!==n.toneMapping)&&(c.material.needsUpdate=!0,u=y,h=y.version,m=n.toneMapping),c.layers.enableAll(),E.unshift(c,c.geometry,c.material,0,0,null))}function b(E,g){E.getRGB(od,TO(n)),i.buffers.color.setClear(od.r,od.g,od.b,g,o)}return{getClearColor:function(){return a},setClearColor:function(E,g=1){a.set(E),l=g,b(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(E){l=E,b(a,l)},render:f}}function $Tt(n,e,t,i){const s=n.getParameter(n.MAX_VERTEX_ATTRIBS),r=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||r!==null,a={},l=E(null);let c=l,d=!1;function u(L,H,B,k,$){let K=!1;if(o){const W=b(k,B,H);c!==W&&(c=W,m(c.object)),K=g(L,k,B,$),K&&S(L,k,B,$)}else{const W=H.wireframe===!0;(c.geometry!==k.id||c.program!==B.id||c.wireframe!==W)&&(c.geometry=k.id,c.program=B.id,c.wireframe=W,K=!0)}$!==null&&t.update($,n.ELEMENT_ARRAY_BUFFER),(K||d)&&(d=!1,R(L,H,B,k),$!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get($).buffer))}function h(){return i.isWebGL2?n.createVertexArray():r.createVertexArrayOES()}function m(L){return i.isWebGL2?n.bindVertexArray(L):r.bindVertexArrayOES(L)}function f(L){return i.isWebGL2?n.deleteVertexArray(L):r.deleteVertexArrayOES(L)}function b(L,H,B){const k=B.wireframe===!0;let $=a[L.id];$===void 0&&($={},a[L.id]=$);let K=$[H.id];K===void 0&&(K={},$[H.id]=K);let W=K[k];return W===void 0&&(W=E(h()),K[k]=W),W}function E(L){const H=[],B=[],k=[];for(let $=0;$=0){const _e=$[J];let me=K[J];if(me===void 0&&(J==="instanceMatrix"&&L.instanceMatrix&&(me=L.instanceMatrix),J==="instanceColor"&&L.instanceColor&&(me=L.instanceColor)),_e===void 0||_e.attribute!==me||me&&_e.data!==me.data)return!0;W++}return c.attributesNum!==W||c.index!==k}function S(L,H,B,k){const $={},K=H.attributes;let W=0;const le=B.getAttributes();for(const J in le)if(le[J].location>=0){let _e=K[J];_e===void 0&&(J==="instanceMatrix"&&L.instanceMatrix&&(_e=L.instanceMatrix),J==="instanceColor"&&L.instanceColor&&(_e=L.instanceColor));const me={};me.attribute=_e,_e&&_e.data&&(me.data=_e.data),$[J]=me,W++}c.attributes=$,c.attributesNum=W,c.index=k}function y(){const L=c.newAttributes;for(let H=0,B=L.length;H=0){let ee=$[le];if(ee===void 0&&(le==="instanceMatrix"&&L.instanceMatrix&&(ee=L.instanceMatrix),le==="instanceColor"&&L.instanceColor&&(ee=L.instanceColor)),ee!==void 0){const _e=ee.normalized,me=ee.itemSize,Ce=t.get(ee);if(Ce===void 0)continue;const X=Ce.buffer,ue=Ce.type,Z=Ce.bytesPerElement,ge=i.isWebGL2===!0&&(ue===n.INT||ue===n.UNSIGNED_INT||ee.gpuType===rO);if(ee.isInterleavedBufferAttribute){const Oe=ee.data,M=Oe.stride,G=ee.offset;if(Oe.isInstancedInterleavedBuffer){for(let q=0;q0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";w="mediump"}return w==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&n.constructor.name==="WebGL2RenderingContext";let a=t.precision!==void 0?t.precision:"highp";const l=r(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const c=o||e.has("WEBGL_draw_buffers"),d=t.logarithmicDepthBuffer===!0,u=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),h=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),m=n.getParameter(n.MAX_TEXTURE_SIZE),f=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),b=n.getParameter(n.MAX_VERTEX_ATTRIBS),E=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),g=n.getParameter(n.MAX_VARYING_VECTORS),S=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),y=h>0,T=o||e.has("OES_texture_float"),C=y&&T,x=o?n.getParameter(n.MAX_SAMPLES):0;return{isWebGL2:o,drawBuffers:c,getMaxAnisotropy:s,getMaxPrecision:r,precision:a,logarithmicDepthBuffer:d,maxTextures:u,maxVertexTextures:h,maxTextureSize:m,maxCubemapSize:f,maxAttributes:b,maxVertexUniforms:E,maxVaryings:g,maxFragmentUniforms:S,vertexTextures:y,floatFragmentTextures:T,floatVertexTextures:C,maxSamples:x}}function jTt(n){const e=this;let t=null,i=0,s=!1,r=!1;const o=new Lr,a=new yt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(u,h){const m=u.length!==0||h||i!==0||s;return s=h,i=u.length,m},this.beginShadows=function(){r=!0,d(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(u,h){t=d(u,h,0)},this.setState=function(u,h,m){const f=u.clippingPlanes,b=u.clipIntersection,E=u.clipShadows,g=n.get(u);if(!s||f===null||f.length===0||r&&!E)r?d(null):c();else{const S=r?0:i,y=S*4;let T=g.clippingState||null;l.value=T,T=d(f,h,y,m);for(let C=0;C!==y;++C)T[C]=t[C];g.clippingState=T,this.numIntersection=b?this.numPlanes:0,this.numPlanes+=S}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function d(u,h,m,f){const b=u!==null?u.length:0;let E=null;if(b!==0){if(E=l.value,f!==!0||E===null){const g=m+b*4,S=h.matrixWorldInverse;a.getNormalMatrix(S),(E===null||E.length0){const c=new lvt(l.height/2);return c.fromEquirectangularTexture(n,o),e.set(o,c),o.addEventListener("dispose",s),t(c.texture,o.mapping)}else return null}}return o}function s(o){const a=o.target;a.removeEventListener("dispose",s);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function r(){e=new WeakMap}return{get:i,dispose:r}}class Lb extends xO{constructor(e=-1,t=1,i=1,s=-1,r=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=s,this.near=r,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,s,r,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=s,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,s=(this.top+this.bottom)/2;let r=i-e,o=i+e,a=s+t,l=s-t;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,d=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=c*this.view.offsetX,o=r+c*this.view.width,a-=d*this.view.offsetY,l=a-d*this.view.height}this.projectionMatrix.makeOrthographic(r,o,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const Ho=4,f1=[.125,.215,.35,.446,.526,.582],Vr=20,Vm=new Lb,m1=new ut;let zm=null,Hm=0,qm=0;const kr=(1+Math.sqrt(5))/2,Uo=1/kr,g1=[new pe(1,1,1),new pe(-1,1,1),new pe(1,1,-1),new pe(-1,1,-1),new pe(0,kr,Uo),new pe(0,kr,-Uo),new pe(Uo,0,kr),new pe(-Uo,0,kr),new pe(kr,Uo,0),new pe(-kr,Uo,0)];class E1{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,s=100){zm=this._renderer.getRenderTarget(),Hm=this._renderer.getActiveCubeFace(),qm=this._renderer.getActiveMipmapLevel(),this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(e,i,s,r),t>0&&this._blur(r,0,0,t),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=v1(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=S1(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?y:0,y,y),d.setRenderTarget(s),b&&d.render(f,a),d.render(e,a)}f.geometry.dispose(),f.material.dispose(),d.toneMapping=h,d.autoClear=u,e.background=E}_textureToCubeUV(e,t){const i=this._renderer,s=e.mapping===ma||e.mapping===ga;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=v1()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=S1());const r=s?this._cubemapMaterial:this._equirectMaterial,o=new Fn(this._lodPlanes[0],r),a=r.uniforms;a.envMap.value=e;const l=this._cubeSize;ad(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,Vm)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let s=1;sVr&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${E} samples when the maximum is set to ${Vr}`);const g=[];let S=0;for(let w=0;wy-Ho?s-y+Ho:0),x=4*(this._cubeSize-T);ad(t,C,x,3*T,2*T),l.setRenderTarget(t),l.render(u,Vm)}}function XTt(n){const e=[],t=[],i=[];let s=n;const r=n-Ho+1+f1.length;for(let o=0;on-Ho?l=f1[o-n+Ho-1]:o===0&&(l=0),i.push(l);const c=1/(a-2),d=-c,u=1+c,h=[d,d,u,d,u,u,d,d,u,u,d,u],m=6,f=6,b=3,E=2,g=1,S=new Float32Array(b*f*m),y=new Float32Array(E*f*m),T=new Float32Array(g*f*m);for(let x=0;x2?0:-1,v=[w,R,0,w+2/3,R,0,w+2/3,R+1,0,w,R,0,w+2/3,R+1,0,w,R+1,0];S.set(v,b*f*x),y.set(h,E*f*x);const A=[x,x,x,x,x,x];T.set(A,g*f*x)}const C=new is;C.setAttribute("position",new Gn(S,b)),C.setAttribute("uv",new Gn(y,E)),C.setAttribute("faceIndex",new Gn(T,g)),e.push(C),s>Ho&&s--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function b1(n,e,t){const i=new so(n,e,t);return i.texture.mapping=Ku,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function ad(n,e,t,i,s){n.viewport.set(e,t,i,s),n.scissor.set(e,t,i,s)}function ZTt(n,e,t){const i=new Float32Array(Vr),s=new pe(0,1,0);return new ro({name:"SphericalGaussianBlur",defines:{n:Vr,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:kb(),fragmentShader:` +}`,St={alphahash_fragment:uvt,alphahash_pars_fragment:pvt,alphamap_fragment:_vt,alphamap_pars_fragment:hvt,alphatest_fragment:fvt,alphatest_pars_fragment:mvt,aomap_fragment:gvt,aomap_pars_fragment:Evt,batching_pars_vertex:bvt,batching_vertex:Svt,begin_vertex:vvt,beginnormal_vertex:yvt,bsdfs:Tvt,iridescence_fragment:xvt,bumpmap_pars_fragment:Cvt,clipping_planes_fragment:Rvt,clipping_planes_pars_fragment:Avt,clipping_planes_pars_vertex:wvt,clipping_planes_vertex:Nvt,color_fragment:Ovt,color_pars_fragment:Ivt,color_pars_vertex:Mvt,color_vertex:Dvt,common:Lvt,cube_uv_reflection_fragment:kvt,defaultnormal_vertex:Pvt,displacementmap_pars_vertex:Uvt,displacementmap_vertex:Fvt,emissivemap_fragment:Bvt,emissivemap_pars_fragment:Gvt,colorspace_fragment:Vvt,colorspace_pars_fragment:zvt,envmap_fragment:Hvt,envmap_common_pars_fragment:qvt,envmap_pars_fragment:Yvt,envmap_pars_vertex:$vt,envmap_physical_pars_fragment:syt,envmap_vertex:Wvt,fog_vertex:Kvt,fog_pars_vertex:jvt,fog_fragment:Qvt,fog_pars_fragment:Xvt,gradientmap_pars_fragment:Zvt,lightmap_fragment:Jvt,lightmap_pars_fragment:eyt,lights_lambert_fragment:tyt,lights_lambert_pars_fragment:nyt,lights_pars_begin:iyt,lights_toon_fragment:ryt,lights_toon_pars_fragment:oyt,lights_phong_fragment:ayt,lights_phong_pars_fragment:lyt,lights_physical_fragment:cyt,lights_physical_pars_fragment:dyt,lights_fragment_begin:uyt,lights_fragment_maps:pyt,lights_fragment_end:_yt,logdepthbuf_fragment:hyt,logdepthbuf_pars_fragment:fyt,logdepthbuf_pars_vertex:myt,logdepthbuf_vertex:gyt,map_fragment:Eyt,map_pars_fragment:byt,map_particle_fragment:Syt,map_particle_pars_fragment:vyt,metalnessmap_fragment:yyt,metalnessmap_pars_fragment:Tyt,morphcolor_vertex:xyt,morphnormal_vertex:Cyt,morphtarget_pars_vertex:Ryt,morphtarget_vertex:Ayt,normal_fragment_begin:wyt,normal_fragment_maps:Nyt,normal_pars_fragment:Oyt,normal_pars_vertex:Iyt,normal_vertex:Myt,normalmap_pars_fragment:Dyt,clearcoat_normal_fragment_begin:Lyt,clearcoat_normal_fragment_maps:kyt,clearcoat_pars_fragment:Pyt,iridescence_pars_fragment:Uyt,opaque_fragment:Fyt,packing:Byt,premultiplied_alpha_fragment:Gyt,project_vertex:Vyt,dithering_fragment:zyt,dithering_pars_fragment:Hyt,roughnessmap_fragment:qyt,roughnessmap_pars_fragment:Yyt,shadowmap_pars_fragment:$yt,shadowmap_pars_vertex:Wyt,shadowmap_vertex:Kyt,shadowmask_pars_fragment:jyt,skinbase_vertex:Qyt,skinning_pars_vertex:Xyt,skinning_vertex:Zyt,skinnormal_vertex:Jyt,specularmap_fragment:eTt,specularmap_pars_fragment:tTt,tonemapping_fragment:nTt,tonemapping_pars_fragment:iTt,transmission_fragment:sTt,transmission_pars_fragment:rTt,uv_pars_fragment:oTt,uv_pars_vertex:aTt,uv_vertex:lTt,worldpos_vertex:cTt,background_vert:dTt,background_frag:uTt,backgroundCube_vert:pTt,backgroundCube_frag:_Tt,cube_vert:hTt,cube_frag:fTt,depth_vert:mTt,depth_frag:gTt,distanceRGBA_vert:ETt,distanceRGBA_frag:bTt,equirect_vert:STt,equirect_frag:vTt,linedashed_vert:yTt,linedashed_frag:TTt,meshbasic_vert:xTt,meshbasic_frag:CTt,meshlambert_vert:RTt,meshlambert_frag:ATt,meshmatcap_vert:wTt,meshmatcap_frag:NTt,meshnormal_vert:OTt,meshnormal_frag:ITt,meshphong_vert:MTt,meshphong_frag:DTt,meshphysical_vert:LTt,meshphysical_frag:kTt,meshtoon_vert:PTt,meshtoon_frag:UTt,points_vert:FTt,points_frag:BTt,shadow_vert:GTt,shadow_frag:VTt,sprite_vert:zTt,sprite_frag:HTt},ze={common:{diffuse:{value:new ut(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new yt},alphaMap:{value:null},alphaMapTransform:{value:new yt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new yt}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new yt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new yt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new yt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new yt},normalScale:{value:new Rt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new yt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new yt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new yt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new yt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ut(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new ut(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new yt},alphaTest:{value:0},uvTransform:{value:new yt}},sprite:{diffuse:{value:new ut(16777215)},opacity:{value:1},center:{value:new Rt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new yt},alphaMap:{value:null},alphaMapTransform:{value:new yt},alphaTest:{value:0}}},Gi={basic:{uniforms:Pn([ze.common,ze.specularmap,ze.envmap,ze.aomap,ze.lightmap,ze.fog]),vertexShader:St.meshbasic_vert,fragmentShader:St.meshbasic_frag},lambert:{uniforms:Pn([ze.common,ze.specularmap,ze.envmap,ze.aomap,ze.lightmap,ze.emissivemap,ze.bumpmap,ze.normalmap,ze.displacementmap,ze.fog,ze.lights,{emissive:{value:new ut(0)}}]),vertexShader:St.meshlambert_vert,fragmentShader:St.meshlambert_frag},phong:{uniforms:Pn([ze.common,ze.specularmap,ze.envmap,ze.aomap,ze.lightmap,ze.emissivemap,ze.bumpmap,ze.normalmap,ze.displacementmap,ze.fog,ze.lights,{emissive:{value:new ut(0)},specular:{value:new ut(1118481)},shininess:{value:30}}]),vertexShader:St.meshphong_vert,fragmentShader:St.meshphong_frag},standard:{uniforms:Pn([ze.common,ze.envmap,ze.aomap,ze.lightmap,ze.emissivemap,ze.bumpmap,ze.normalmap,ze.displacementmap,ze.roughnessmap,ze.metalnessmap,ze.fog,ze.lights,{emissive:{value:new ut(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:St.meshphysical_vert,fragmentShader:St.meshphysical_frag},toon:{uniforms:Pn([ze.common,ze.aomap,ze.lightmap,ze.emissivemap,ze.bumpmap,ze.normalmap,ze.displacementmap,ze.gradientmap,ze.fog,ze.lights,{emissive:{value:new ut(0)}}]),vertexShader:St.meshtoon_vert,fragmentShader:St.meshtoon_frag},matcap:{uniforms:Pn([ze.common,ze.bumpmap,ze.normalmap,ze.displacementmap,ze.fog,{matcap:{value:null}}]),vertexShader:St.meshmatcap_vert,fragmentShader:St.meshmatcap_frag},points:{uniforms:Pn([ze.points,ze.fog]),vertexShader:St.points_vert,fragmentShader:St.points_frag},dashed:{uniforms:Pn([ze.common,ze.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:St.linedashed_vert,fragmentShader:St.linedashed_frag},depth:{uniforms:Pn([ze.common,ze.displacementmap]),vertexShader:St.depth_vert,fragmentShader:St.depth_frag},normal:{uniforms:Pn([ze.common,ze.bumpmap,ze.normalmap,ze.displacementmap,{opacity:{value:1}}]),vertexShader:St.meshnormal_vert,fragmentShader:St.meshnormal_frag},sprite:{uniforms:Pn([ze.sprite,ze.fog]),vertexShader:St.sprite_vert,fragmentShader:St.sprite_frag},background:{uniforms:{uvTransform:{value:new yt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:St.background_vert,fragmentShader:St.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:St.backgroundCube_vert,fragmentShader:St.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:St.cube_vert,fragmentShader:St.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:St.equirect_vert,fragmentShader:St.equirect_frag},distanceRGBA:{uniforms:Pn([ze.common,ze.displacementmap,{referencePosition:{value:new pe},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:St.distanceRGBA_vert,fragmentShader:St.distanceRGBA_frag},shadow:{uniforms:Pn([ze.lights,ze.fog,{color:{value:new ut(0)},opacity:{value:1}}]),vertexShader:St.shadow_vert,fragmentShader:St.shadow_frag}};Gi.physical={uniforms:Pn([Gi.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new yt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new yt},clearcoatNormalScale:{value:new Rt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new yt},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new yt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new yt},sheen:{value:0},sheenColor:{value:new ut(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new yt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new yt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new yt},transmissionSamplerSize:{value:new Rt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new yt},attenuationDistance:{value:0},attenuationColor:{value:new ut(0)},specularColor:{value:new ut(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new yt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new yt},anisotropyVector:{value:new Rt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new yt}}]),vertexShader:St.meshphysical_vert,fragmentShader:St.meshphysical_frag};const od={r:0,b:0,g:0};function qTt(n,e,t,i,s,r,o){const a=new ut(0);let l=r===!0?0:1,c,d,u=null,h=0,m=null;function f(E,g){let S=!1,y=g.isScene===!0?g.background:null;y&&y.isTexture&&(y=(g.backgroundBlurriness>0?t:e).get(y)),y===null?b(a,l):y&&y.isColor&&(b(y,1),S=!0);const T=n.xr.getEnvironmentBlendMode();T==="additive"?i.buffers.color.setClear(0,0,0,1,o):T==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(n.autoClear||S)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),y&&(y.isCubeTexture||y.mapping===Ku)?(d===void 0&&(d=new Fn(new _r(1,1,1),new ro({name:"BackgroundCubeMaterial",uniforms:ya(Gi.backgroundCube.uniforms),vertexShader:Gi.backgroundCube.vertexShader,fragmentShader:Gi.backgroundCube.fragmentShader,side:Wn,depthTest:!1,depthWrite:!1,fog:!1})),d.geometry.deleteAttribute("normal"),d.geometry.deleteAttribute("uv"),d.onBeforeRender=function(C,x,w){this.matrixWorld.copyPosition(w.matrixWorld)},Object.defineProperty(d.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(d)),d.material.uniforms.envMap.value=y,d.material.uniforms.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,d.material.uniforms.backgroundBlurriness.value=g.backgroundBlurriness,d.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,d.material.toneMapped=kt.getTransfer(y.colorSpace)!==$t,(u!==y||h!==y.version||m!==n.toneMapping)&&(d.material.needsUpdate=!0,u=y,h=y.version,m=n.toneMapping),d.layers.enableAll(),E.unshift(d,d.geometry,d.material,0,0,null)):y&&y.isTexture&&(c===void 0&&(c=new Fn(new Db(2,2),new ro({name:"BackgroundMaterial",uniforms:ya(Gi.background.uniforms),vertexShader:Gi.background.vertexShader,fragmentShader:Gi.background.fragmentShader,side:Os,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(c)),c.material.uniforms.t2D.value=y,c.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,c.material.toneMapped=kt.getTransfer(y.colorSpace)!==$t,y.matrixAutoUpdate===!0&&y.updateMatrix(),c.material.uniforms.uvTransform.value.copy(y.matrix),(u!==y||h!==y.version||m!==n.toneMapping)&&(c.material.needsUpdate=!0,u=y,h=y.version,m=n.toneMapping),c.layers.enableAll(),E.unshift(c,c.geometry,c.material,0,0,null))}function b(E,g){E.getRGB(od,TO(n)),i.buffers.color.setClear(od.r,od.g,od.b,g,o)}return{getClearColor:function(){return a},setClearColor:function(E,g=1){a.set(E),l=g,b(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(E){l=E,b(a,l)},render:f}}function YTt(n,e,t,i){const s=n.getParameter(n.MAX_VERTEX_ATTRIBS),r=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||r!==null,a={},l=E(null);let c=l,d=!1;function u(L,H,B,k,$){let K=!1;if(o){const W=b(k,B,H);c!==W&&(c=W,m(c.object)),K=g(L,k,B,$),K&&S(L,k,B,$)}else{const W=H.wireframe===!0;(c.geometry!==k.id||c.program!==B.id||c.wireframe!==W)&&(c.geometry=k.id,c.program=B.id,c.wireframe=W,K=!0)}$!==null&&t.update($,n.ELEMENT_ARRAY_BUFFER),(K||d)&&(d=!1,R(L,H,B,k),$!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get($).buffer))}function h(){return i.isWebGL2?n.createVertexArray():r.createVertexArrayOES()}function m(L){return i.isWebGL2?n.bindVertexArray(L):r.bindVertexArrayOES(L)}function f(L){return i.isWebGL2?n.deleteVertexArray(L):r.deleteVertexArrayOES(L)}function b(L,H,B){const k=B.wireframe===!0;let $=a[L.id];$===void 0&&($={},a[L.id]=$);let K=$[H.id];K===void 0&&(K={},$[H.id]=K);let W=K[k];return W===void 0&&(W=E(h()),K[k]=W),W}function E(L){const H=[],B=[],k=[];for(let $=0;$=0){const _e=$[J];let me=K[J];if(me===void 0&&(J==="instanceMatrix"&&L.instanceMatrix&&(me=L.instanceMatrix),J==="instanceColor"&&L.instanceColor&&(me=L.instanceColor)),_e===void 0||_e.attribute!==me||me&&_e.data!==me.data)return!0;W++}return c.attributesNum!==W||c.index!==k}function S(L,H,B,k){const $={},K=H.attributes;let W=0;const le=B.getAttributes();for(const J in le)if(le[J].location>=0){let _e=K[J];_e===void 0&&(J==="instanceMatrix"&&L.instanceMatrix&&(_e=L.instanceMatrix),J==="instanceColor"&&L.instanceColor&&(_e=L.instanceColor));const me={};me.attribute=_e,_e&&_e.data&&(me.data=_e.data),$[J]=me,W++}c.attributes=$,c.attributesNum=W,c.index=k}function y(){const L=c.newAttributes;for(let H=0,B=L.length;H=0){let ee=$[le];if(ee===void 0&&(le==="instanceMatrix"&&L.instanceMatrix&&(ee=L.instanceMatrix),le==="instanceColor"&&L.instanceColor&&(ee=L.instanceColor)),ee!==void 0){const _e=ee.normalized,me=ee.itemSize,Ce=t.get(ee);if(Ce===void 0)continue;const X=Ce.buffer,ue=Ce.type,Z=Ce.bytesPerElement,ge=i.isWebGL2===!0&&(ue===n.INT||ue===n.UNSIGNED_INT||ee.gpuType===rO);if(ee.isInterleavedBufferAttribute){const Oe=ee.data,M=Oe.stride,G=ee.offset;if(Oe.isInstancedInterleavedBuffer){for(let q=0;q0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";w="mediump"}return w==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&n.constructor.name==="WebGL2RenderingContext";let a=t.precision!==void 0?t.precision:"highp";const l=r(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const c=o||e.has("WEBGL_draw_buffers"),d=t.logarithmicDepthBuffer===!0,u=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),h=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),m=n.getParameter(n.MAX_TEXTURE_SIZE),f=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),b=n.getParameter(n.MAX_VERTEX_ATTRIBS),E=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),g=n.getParameter(n.MAX_VARYING_VECTORS),S=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),y=h>0,T=o||e.has("OES_texture_float"),C=y&&T,x=o?n.getParameter(n.MAX_SAMPLES):0;return{isWebGL2:o,drawBuffers:c,getMaxAnisotropy:s,getMaxPrecision:r,precision:a,logarithmicDepthBuffer:d,maxTextures:u,maxVertexTextures:h,maxTextureSize:m,maxCubemapSize:f,maxAttributes:b,maxVertexUniforms:E,maxVaryings:g,maxFragmentUniforms:S,vertexTextures:y,floatFragmentTextures:T,floatVertexTextures:C,maxSamples:x}}function KTt(n){const e=this;let t=null,i=0,s=!1,r=!1;const o=new Lr,a=new yt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(u,h){const m=u.length!==0||h||i!==0||s;return s=h,i=u.length,m},this.beginShadows=function(){r=!0,d(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(u,h){t=d(u,h,0)},this.setState=function(u,h,m){const f=u.clippingPlanes,b=u.clipIntersection,E=u.clipShadows,g=n.get(u);if(!s||f===null||f.length===0||r&&!E)r?d(null):c();else{const S=r?0:i,y=S*4;let T=g.clippingState||null;l.value=T,T=d(f,h,y,m);for(let C=0;C!==y;++C)T[C]=t[C];g.clippingState=T,this.numIntersection=b?this.numPlanes:0,this.numPlanes+=S}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function d(u,h,m,f){const b=u!==null?u.length:0;let E=null;if(b!==0){if(E=l.value,f!==!0||E===null){const g=m+b*4,S=h.matrixWorldInverse;a.getNormalMatrix(S),(E===null||E.length0){const c=new avt(l.height/2);return c.fromEquirectangularTexture(n,o),e.set(o,c),o.addEventListener("dispose",s),t(c.texture,o.mapping)}else return null}}return o}function s(o){const a=o.target;a.removeEventListener("dispose",s);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function r(){e=new WeakMap}return{get:i,dispose:r}}class Lb extends xO{constructor(e=-1,t=1,i=1,s=-1,r=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=s,this.near=r,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,s,r,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=s,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,s=(this.top+this.bottom)/2;let r=i-e,o=i+e,a=s+t,l=s-t;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,d=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=c*this.view.offsetX,o=r+c*this.view.width,a-=d*this.view.offsetY,l=a-d*this.view.height}this.projectionMatrix.makeOrthographic(r,o,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const Ho=4,f1=[.125,.215,.35,.446,.526,.582],Vr=20,Vm=new Lb,m1=new ut;let zm=null,Hm=0,qm=0;const kr=(1+Math.sqrt(5))/2,Uo=1/kr,g1=[new pe(1,1,1),new pe(-1,1,1),new pe(1,1,-1),new pe(-1,1,-1),new pe(0,kr,Uo),new pe(0,kr,-Uo),new pe(Uo,0,kr),new pe(-Uo,0,kr),new pe(kr,Uo,0),new pe(-kr,Uo,0)];class E1{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,s=100){zm=this._renderer.getRenderTarget(),Hm=this._renderer.getActiveCubeFace(),qm=this._renderer.getActiveMipmapLevel(),this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(e,i,s,r),t>0&&this._blur(r,0,0,t),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=v1(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=S1(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?y:0,y,y),d.setRenderTarget(s),b&&d.render(f,a),d.render(e,a)}f.geometry.dispose(),f.material.dispose(),d.toneMapping=h,d.autoClear=u,e.background=E}_textureToCubeUV(e,t){const i=this._renderer,s=e.mapping===ma||e.mapping===ga;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=v1()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=S1());const r=s?this._cubemapMaterial:this._equirectMaterial,o=new Fn(this._lodPlanes[0],r),a=r.uniforms;a.envMap.value=e;const l=this._cubeSize;ad(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,Vm)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let s=1;sVr&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${E} samples when the maximum is set to ${Vr}`);const g=[];let S=0;for(let w=0;wy-Ho?s-y+Ho:0),x=4*(this._cubeSize-T);ad(t,C,x,3*T,2*T),l.setRenderTarget(t),l.render(u,Vm)}}function QTt(n){const e=[],t=[],i=[];let s=n;const r=n-Ho+1+f1.length;for(let o=0;on-Ho?l=f1[o-n+Ho-1]:o===0&&(l=0),i.push(l);const c=1/(a-2),d=-c,u=1+c,h=[d,d,u,d,u,u,d,d,u,u,d,u],m=6,f=6,b=3,E=2,g=1,S=new Float32Array(b*f*m),y=new Float32Array(E*f*m),T=new Float32Array(g*f*m);for(let x=0;x2?0:-1,v=[w,R,0,w+2/3,R,0,w+2/3,R+1,0,w,R,0,w+2/3,R+1,0,w,R+1,0];S.set(v,b*f*x),y.set(h,E*f*x);const A=[x,x,x,x,x,x];T.set(A,g*f*x)}const C=new is;C.setAttribute("position",new Gn(S,b)),C.setAttribute("uv",new Gn(y,E)),C.setAttribute("faceIndex",new Gn(T,g)),e.push(C),s>Ho&&s--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function b1(n,e,t){const i=new so(n,e,t);return i.texture.mapping=Ku,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function ad(n,e,t,i,s){n.viewport.set(e,t,i,s),n.scissor.set(e,t,i,s)}function XTt(n,e,t){const i=new Float32Array(Vr),s=new pe(0,1,0);return new ro({name:"SphericalGaussianBlur",defines:{n:Vr,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:kb(),fragmentShader:` precision mediump float; precision mediump int; @@ -3787,26 +3787,26 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function JTt(n){let e=new WeakMap,t=null;function i(a){if(a&&a.isTexture){const l=a.mapping,c=l===Gg||l===Vg,d=l===ma||l===ga;if(c||d)if(a.isRenderTargetTexture&&a.needsPMREMUpdate===!0){a.needsPMREMUpdate=!1;let u=e.get(a);return t===null&&(t=new E1(n)),u=c?t.fromEquirectangular(a,u):t.fromCubemap(a,u),e.set(a,u),u.texture}else{if(e.has(a))return e.get(a).texture;{const u=a.image;if(c&&u&&u.height>0||d&&u&&s(u)){t===null&&(t=new E1(n));const h=c?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,h),a.addEventListener("dispose",r),h.texture}else return null}}}return a}function s(a){let l=0;const c=6;for(let d=0;de.maxTextureSize&&(P=Math.ceil(A/e.maxTextureSize),A=e.maxTextureSize);const U=new Float32Array(A*P*4*b),Y=new EO(U,A,P,b);Y.type=Ss,Y.needsUpdate=!0;const L=v*4;for(let B=0;B0)return n;const s=e*t;let r=y1[s];if(r===void 0&&(r=new Float32Array(s),y1[s]=r),e!==0){i.toArray(r,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(r,a)}return r}function _n(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t0||d&&u&&s(u)){t===null&&(t=new E1(n));const h=c?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,h),a.addEventListener("dispose",r),h.texture}else return null}}}return a}function s(a){let l=0;const c=6;for(let d=0;de.maxTextureSize&&(P=Math.ceil(A/e.maxTextureSize),A=e.maxTextureSize);const U=new Float32Array(A*P*4*b),Y=new EO(U,A,P,b);Y.type=Ss,Y.needsUpdate=!0;const L=v*4;for(let B=0;B0)return n;const s=e*t;let r=y1[s];if(r===void 0&&(r=new Float32Array(s),y1[s]=r),e!==0){i.toArray(r,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(r,a)}return r}function _n(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t":" "} ${a}: ${t[o]}`)}return i.join(` -`)}function txt(n){const e=kt.getPrimaries(kt.workingColorSpace),t=kt.getPrimaries(n);let i;switch(e===t?i="":e===ou&&t===ru?i="LinearDisplayP3ToLinearSRGB":e===ru&&t===ou&&(i="LinearSRGBToLinearDisplayP3"),n){case Cn:case ju:return[i,"LinearTransferOETF"];case tn:case Ob:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),[i,"LinearTransferOETF"]}}function N1(n,e,t){const i=n.getShaderParameter(e,n.COMPILE_STATUS),s=n.getShaderInfoLog(e).trim();if(i&&s==="")return"";const r=/ERROR: 0:(\d+)/.exec(s);if(r){const o=parseInt(r[1]);return t.toUpperCase()+` +`)}function ext(n){const e=kt.getPrimaries(kt.workingColorSpace),t=kt.getPrimaries(n);let i;switch(e===t?i="":e===ou&&t===ru?i="LinearDisplayP3ToLinearSRGB":e===ru&&t===ou&&(i="LinearSRGBToLinearDisplayP3"),n){case Cn:case ju:return[i,"LinearTransferOETF"];case tn:case Ob:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),[i,"LinearTransferOETF"]}}function N1(n,e,t){const i=n.getShaderParameter(e,n.COMPILE_STATUS),s=n.getShaderInfoLog(e).trim();if(i&&s==="")return"";const r=/ERROR: 0:(\d+)/.exec(s);if(r){const o=parseInt(r[1]);return t.toUpperCase()+` `+s+` -`+ext(n.getShaderSource(e),o)}else return s}function nxt(n,e){const t=txt(e);return`vec4 ${n}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function ixt(n,e){let t;switch(e){case Jbt:t="Linear";break;case eSt:t="Reinhard";break;case tSt:t="OptimizedCineon";break;case nSt:t="ACESFilmic";break;case iSt:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function sxt(n){return[n.extensionDerivatives||n.envMapCubeUVHeight||n.bumpMap||n.normalMapTangentSpace||n.clearcoatNormalMap||n.flatShading||n.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(n.extensionFragDepth||n.logarithmicDepthBuffer)&&n.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",n.extensionDrawBuffers&&n.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(n.extensionShaderTextureLOD||n.envMap||n.transmission)&&n.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(El).join(` -`)}function rxt(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` -`)}function oxt(n,e){const t={},i=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let s=0;s/gm;function Wg(n){return n.replace(axt,cxt)}const lxt=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function cxt(n,e){let t=St[e];if(t===void 0){const i=lxt.get(e);if(i!==void 0)t=St[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return Wg(t)}const dxt=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function M1(n){return n.replace(dxt,uxt)}function uxt(n,e,t,i){let s="";for(let r=parseInt(e);r/gm;function Wg(n){return n.replace(oxt,lxt)}const axt=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function lxt(n,e){let t=St[e];if(t===void 0){const i=axt.get(e);if(i!==void 0)t=St[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return Wg(t)}const cxt=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function M1(n){return n.replace(cxt,dxt)}function dxt(n,e,t,i){let s="";for(let r=parseInt(e);r0&&(E+=` `),g=[m,"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,f].filter(El).join(` `),g.length>0&&(g+=` `)):(E=[D1(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,f,t.batching?"#define USE_BATCHING":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+d:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` `].filter(El).join(` -`),g=[m,D1(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,f,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+d:"",t.envMap?"#define "+u:"",h?"#define CUBEUV_TEXEL_WIDTH "+h.texelWidth:"",h?"#define CUBEUV_TEXEL_HEIGHT "+h.texelHeight:"",h?"#define CUBEUV_MAX_MIP "+h.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==ur?"#define TONE_MAPPING":"",t.toneMapping!==ur?St.tonemapping_pars_fragment:"",t.toneMapping!==ur?ixt("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",St.colorspace_pars_fragment,nxt("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` +`),g=[m,D1(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,f,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+d:"",t.envMap?"#define "+u:"",h?"#define CUBEUV_TEXEL_WIDTH "+h.texelWidth:"",h?"#define CUBEUV_TEXEL_HEIGHT "+h.texelHeight:"",h?"#define CUBEUV_MAX_MIP "+h.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==ur?"#define TONE_MAPPING":"",t.toneMapping!==ur?St.tonemapping_pars_fragment:"",t.toneMapping!==ur?nxt("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",St.colorspace_pars_fragment,txt("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` `].filter(El).join(` `)),o=Wg(o),o=O1(o,t),o=I1(o,t),a=Wg(a),a=O1(a,t),a=I1(a,t),o=M1(o),a=M1(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(S=`#version 300 es `,E=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` @@ -3817,9 +3817,9 @@ precision `+n.precision+" int;";return n.precision==="highp"?e+=` Program Info Log: `+U+` `+k+` -`+$)}else U!==""?console.warn("THREE.WebGLProgram: Program Info Log:",U):(Y===""||L==="")&&(B=!1);B&&(P.diagnostics={runnable:H,programLog:U,vertexShader:{log:Y,prefix:E},fragmentShader:{log:L,prefix:g}})}s.deleteShader(C),s.deleteShader(x),R=new Nd(s,b),v=oxt(s,b)}let R;this.getUniforms=function(){return R===void 0&&w(this),R};let v;this.getAttributes=function(){return v===void 0&&w(this),v};let A=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return A===!1&&(A=s.getProgramParameter(b,Z0t)),A},this.destroy=function(){i.releaseStatesOfProgram(this),s.deleteProgram(b),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=J0t++,this.cacheKey=e,this.usedTimes=1,this.program=b,this.vertexShader=C,this.fragmentShader=x,this}let Ext=0;class bxt{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,s=this._getShaderStage(t),r=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(s)===!1&&(o.add(s),s.usedTimes++),o.has(r)===!1&&(o.add(r),r.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){const t=this.shaderCache;let i=t.get(e);return i===void 0&&(i=new Sxt(e),t.set(e,i)),i}}class Sxt{constructor(e){this.id=Ext++,this.code=e,this.usedTimes=0}}function vxt(n,e,t,i,s,r,o){const a=new bO,l=new bxt,c=[],d=s.isWebGL2,u=s.logarithmicDepthBuffer,h=s.vertexTextures;let m=s.precision;const f={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function b(v){return v===0?"uv":`uv${v}`}function E(v,A,P,U,Y){const L=U.fog,H=Y.geometry,B=v.isMeshStandardMaterial?U.environment:null,k=(v.isMeshStandardMaterial?t:e).get(v.envMap||B),$=k&&k.mapping===Ku?k.image.height:null,K=f[v.type];v.precision!==null&&(m=s.getMaxPrecision(v.precision),m!==v.precision&&console.warn("THREE.WebGLProgram.getParameters:",v.precision,"not supported, using",m,"instead."));const W=H.morphAttributes.position||H.morphAttributes.normal||H.morphAttributes.color,le=W!==void 0?W.length:0;let J=0;H.morphAttributes.position!==void 0&&(J=1),H.morphAttributes.normal!==void 0&&(J=2),H.morphAttributes.color!==void 0&&(J=3);let ee,_e,me,Ce;if(K){const dn=Gi[K];ee=dn.vertexShader,_e=dn.fragmentShader}else ee=v.vertexShader,_e=v.fragmentShader,l.update(v),me=l.getVertexShaderID(v),Ce=l.getFragmentShaderID(v);const X=n.getRenderTarget(),ue=Y.isInstancedMesh===!0,Z=Y.isBatchedMesh===!0,ge=!!v.map,Oe=!!v.matcap,M=!!k,G=!!v.aoMap,q=!!v.lightMap,oe=!!v.bumpMap,ne=!!v.normalMap,ve=!!v.displacementMap,we=!!v.emissiveMap,V=!!v.metalnessMap,ce=!!v.roughnessMap,ie=v.anisotropy>0,re=v.clearcoat>0,I=v.iridescence>0,N=v.sheen>0,z=v.transmission>0,de=ie&&!!v.anisotropyMap,Q=re&&!!v.clearcoatMap,te=re&&!!v.clearcoatNormalMap,Re=re&&!!v.clearcoatRoughnessMap,Se=I&&!!v.iridescenceMap,Le=I&&!!v.iridescenceThicknessMap,Ve=N&&!!v.sheenColorMap,nt=N&&!!v.sheenRoughnessMap,De=!!v.specularMap,it=!!v.specularColorMap,Qe=!!v.specularIntensityMap,Ge=z&&!!v.transmissionMap,Ze=z&&!!v.thicknessMap,We=!!v.gradientMap,ht=!!v.alphaMap,ae=v.alphaTest>0,qe=!!v.alphaHash,ke=!!v.extensions,Ne=!!H.attributes.uv1,Pe=!!H.attributes.uv2,rt=!!H.attributes.uv3;let Et=ur;return v.toneMapped&&(X===null||X.isXRRenderTarget===!0)&&(Et=n.toneMapping),{isWebGL2:d,shaderID:K,shaderType:v.type,shaderName:v.name,vertexShader:ee,fragmentShader:_e,defines:v.defines,customVertexShaderID:me,customFragmentShaderID:Ce,isRawShaderMaterial:v.isRawShaderMaterial===!0,glslVersion:v.glslVersion,precision:m,batching:Z,instancing:ue,instancingColor:ue&&Y.instanceColor!==null,supportsVertexTextures:h,outputColorSpace:X===null?n.outputColorSpace:X.isXRRenderTarget===!0?X.texture.colorSpace:Cn,map:ge,matcap:Oe,envMap:M,envMapMode:M&&k.mapping,envMapCubeUVHeight:$,aoMap:G,lightMap:q,bumpMap:oe,normalMap:ne,displacementMap:h&&ve,emissiveMap:we,normalMapObjectSpace:ne&&v.normalMapType===gSt,normalMapTangentSpace:ne&&v.normalMapType===Nb,metalnessMap:V,roughnessMap:ce,anisotropy:ie,anisotropyMap:de,clearcoat:re,clearcoatMap:Q,clearcoatNormalMap:te,clearcoatRoughnessMap:Re,iridescence:I,iridescenceMap:Se,iridescenceThicknessMap:Le,sheen:N,sheenColorMap:Ve,sheenRoughnessMap:nt,specularMap:De,specularColorMap:it,specularIntensityMap:Qe,transmission:z,transmissionMap:Ge,thicknessMap:Ze,gradientMap:We,opaque:v.transparent===!1&&v.blending===Jo,alphaMap:ht,alphaTest:ae,alphaHash:qe,combine:v.combine,mapUv:ge&&b(v.map.channel),aoMapUv:G&&b(v.aoMap.channel),lightMapUv:q&&b(v.lightMap.channel),bumpMapUv:oe&&b(v.bumpMap.channel),normalMapUv:ne&&b(v.normalMap.channel),displacementMapUv:ve&&b(v.displacementMap.channel),emissiveMapUv:we&&b(v.emissiveMap.channel),metalnessMapUv:V&&b(v.metalnessMap.channel),roughnessMapUv:ce&&b(v.roughnessMap.channel),anisotropyMapUv:de&&b(v.anisotropyMap.channel),clearcoatMapUv:Q&&b(v.clearcoatMap.channel),clearcoatNormalMapUv:te&&b(v.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Re&&b(v.clearcoatRoughnessMap.channel),iridescenceMapUv:Se&&b(v.iridescenceMap.channel),iridescenceThicknessMapUv:Le&&b(v.iridescenceThicknessMap.channel),sheenColorMapUv:Ve&&b(v.sheenColorMap.channel),sheenRoughnessMapUv:nt&&b(v.sheenRoughnessMap.channel),specularMapUv:De&&b(v.specularMap.channel),specularColorMapUv:it&&b(v.specularColorMap.channel),specularIntensityMapUv:Qe&&b(v.specularIntensityMap.channel),transmissionMapUv:Ge&&b(v.transmissionMap.channel),thicknessMapUv:Ze&&b(v.thicknessMap.channel),alphaMapUv:ht&&b(v.alphaMap.channel),vertexTangents:!!H.attributes.tangent&&(ne||ie),vertexColors:v.vertexColors,vertexAlphas:v.vertexColors===!0&&!!H.attributes.color&&H.attributes.color.itemSize===4,vertexUv1s:Ne,vertexUv2s:Pe,vertexUv3s:rt,pointsUvs:Y.isPoints===!0&&!!H.attributes.uv&&(ge||ht),fog:!!L,useFog:v.fog===!0,fogExp2:L&&L.isFogExp2,flatShading:v.flatShading===!0,sizeAttenuation:v.sizeAttenuation===!0,logarithmicDepthBuffer:u,skinning:Y.isSkinnedMesh===!0,morphTargets:H.morphAttributes.position!==void 0,morphNormals:H.morphAttributes.normal!==void 0,morphColors:H.morphAttributes.color!==void 0,morphTargetsCount:le,morphTextureStride:J,numDirLights:A.directional.length,numPointLights:A.point.length,numSpotLights:A.spot.length,numSpotLightMaps:A.spotLightMap.length,numRectAreaLights:A.rectArea.length,numHemiLights:A.hemi.length,numDirLightShadows:A.directionalShadowMap.length,numPointLightShadows:A.pointShadowMap.length,numSpotLightShadows:A.spotShadowMap.length,numSpotLightShadowsWithMaps:A.numSpotLightShadowsWithMaps,numLightProbes:A.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:v.dithering,shadowMapEnabled:n.shadowMap.enabled&&P.length>0,shadowMapType:n.shadowMap.type,toneMapping:Et,useLegacyLights:n._useLegacyLights,decodeVideoTexture:ge&&v.map.isVideoTexture===!0&&kt.getTransfer(v.map.colorSpace)===$t,premultipliedAlpha:v.premultipliedAlpha,doubleSided:v.side===Hi,flipSided:v.side===Wn,useDepthPacking:v.depthPacking>=0,depthPacking:v.depthPacking||0,index0AttributeName:v.index0AttributeName,extensionDerivatives:ke&&v.extensions.derivatives===!0,extensionFragDepth:ke&&v.extensions.fragDepth===!0,extensionDrawBuffers:ke&&v.extensions.drawBuffers===!0,extensionShaderTextureLOD:ke&&v.extensions.shaderTextureLOD===!0,rendererExtensionFragDepth:d||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:d||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:d||i.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:v.customProgramCacheKey()}}function g(v){const A=[];if(v.shaderID?A.push(v.shaderID):(A.push(v.customVertexShaderID),A.push(v.customFragmentShaderID)),v.defines!==void 0)for(const P in v.defines)A.push(P),A.push(v.defines[P]);return v.isRawShaderMaterial===!1&&(S(A,v),y(A,v),A.push(n.outputColorSpace)),A.push(v.customProgramCacheKey),A.join()}function S(v,A){v.push(A.precision),v.push(A.outputColorSpace),v.push(A.envMapMode),v.push(A.envMapCubeUVHeight),v.push(A.mapUv),v.push(A.alphaMapUv),v.push(A.lightMapUv),v.push(A.aoMapUv),v.push(A.bumpMapUv),v.push(A.normalMapUv),v.push(A.displacementMapUv),v.push(A.emissiveMapUv),v.push(A.metalnessMapUv),v.push(A.roughnessMapUv),v.push(A.anisotropyMapUv),v.push(A.clearcoatMapUv),v.push(A.clearcoatNormalMapUv),v.push(A.clearcoatRoughnessMapUv),v.push(A.iridescenceMapUv),v.push(A.iridescenceThicknessMapUv),v.push(A.sheenColorMapUv),v.push(A.sheenRoughnessMapUv),v.push(A.specularMapUv),v.push(A.specularColorMapUv),v.push(A.specularIntensityMapUv),v.push(A.transmissionMapUv),v.push(A.thicknessMapUv),v.push(A.combine),v.push(A.fogExp2),v.push(A.sizeAttenuation),v.push(A.morphTargetsCount),v.push(A.morphAttributeCount),v.push(A.numDirLights),v.push(A.numPointLights),v.push(A.numSpotLights),v.push(A.numSpotLightMaps),v.push(A.numHemiLights),v.push(A.numRectAreaLights),v.push(A.numDirLightShadows),v.push(A.numPointLightShadows),v.push(A.numSpotLightShadows),v.push(A.numSpotLightShadowsWithMaps),v.push(A.numLightProbes),v.push(A.shadowMapType),v.push(A.toneMapping),v.push(A.numClippingPlanes),v.push(A.numClipIntersection),v.push(A.depthPacking)}function y(v,A){a.disableAll(),A.isWebGL2&&a.enable(0),A.supportsVertexTextures&&a.enable(1),A.instancing&&a.enable(2),A.instancingColor&&a.enable(3),A.matcap&&a.enable(4),A.envMap&&a.enable(5),A.normalMapObjectSpace&&a.enable(6),A.normalMapTangentSpace&&a.enable(7),A.clearcoat&&a.enable(8),A.iridescence&&a.enable(9),A.alphaTest&&a.enable(10),A.vertexColors&&a.enable(11),A.vertexAlphas&&a.enable(12),A.vertexUv1s&&a.enable(13),A.vertexUv2s&&a.enable(14),A.vertexUv3s&&a.enable(15),A.vertexTangents&&a.enable(16),A.anisotropy&&a.enable(17),A.alphaHash&&a.enable(18),A.batching&&a.enable(19),v.push(a.mask),a.disableAll(),A.fog&&a.enable(0),A.useFog&&a.enable(1),A.flatShading&&a.enable(2),A.logarithmicDepthBuffer&&a.enable(3),A.skinning&&a.enable(4),A.morphTargets&&a.enable(5),A.morphNormals&&a.enable(6),A.morphColors&&a.enable(7),A.premultipliedAlpha&&a.enable(8),A.shadowMapEnabled&&a.enable(9),A.useLegacyLights&&a.enable(10),A.doubleSided&&a.enable(11),A.flipSided&&a.enable(12),A.useDepthPacking&&a.enable(13),A.dithering&&a.enable(14),A.transmission&&a.enable(15),A.sheen&&a.enable(16),A.opaque&&a.enable(17),A.pointsUvs&&a.enable(18),A.decodeVideoTexture&&a.enable(19),v.push(a.mask)}function T(v){const A=f[v.type];let P;if(A){const U=Gi[A];P=svt.clone(U.uniforms)}else P=v.uniforms;return P}function C(v,A){let P;for(let U=0,Y=c.length;U0?i.push(g):m.transparent===!0?s.push(g):t.push(g)}function l(u,h,m,f,b,E){const g=o(u,h,m,f,b,E);m.transmission>0?i.unshift(g):m.transparent===!0?s.unshift(g):t.unshift(g)}function c(u,h){t.length>1&&t.sort(u||Txt),i.length>1&&i.sort(h||L1),s.length>1&&s.sort(h||L1)}function d(){for(let u=e,h=n.length;u=r.length?(o=new k1,r.push(o)):o=r[s],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function Cxt(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new pe,color:new ut};break;case"SpotLight":t={position:new pe,direction:new pe,color:new ut,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new pe,color:new ut,distance:0,decay:0};break;case"HemisphereLight":t={direction:new pe,skyColor:new ut,groundColor:new ut};break;case"RectAreaLight":t={color:new ut,position:new pe,halfWidth:new pe,halfHeight:new pe};break}return n[e.id]=t,t}}}function Rxt(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Rt};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Rt};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Rt,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let Axt=0;function wxt(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function Nxt(n,e){const t=new Cxt,i=Rxt(),s={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let d=0;d<9;d++)s.probe.push(new pe);const r=new pe,o=new Tt,a=new Tt;function l(d,u){let h=0,m=0,f=0;for(let U=0;U<9;U++)s.probe[U].set(0,0,0);let b=0,E=0,g=0,S=0,y=0,T=0,C=0,x=0,w=0,R=0,v=0;d.sort(wxt);const A=u===!0?Math.PI:1;for(let U=0,Y=d.length;U0&&(e.isWebGL2||n.has("OES_texture_float_linear")===!0?(s.rectAreaLTC1=ze.LTC_FLOAT_1,s.rectAreaLTC2=ze.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(s.rectAreaLTC1=ze.LTC_HALF_1,s.rectAreaLTC2=ze.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),s.ambient[0]=h,s.ambient[1]=m,s.ambient[2]=f;const P=s.hash;(P.directionalLength!==b||P.pointLength!==E||P.spotLength!==g||P.rectAreaLength!==S||P.hemiLength!==y||P.numDirectionalShadows!==T||P.numPointShadows!==C||P.numSpotShadows!==x||P.numSpotMaps!==w||P.numLightProbes!==v)&&(s.directional.length=b,s.spot.length=g,s.rectArea.length=S,s.point.length=E,s.hemi.length=y,s.directionalShadow.length=T,s.directionalShadowMap.length=T,s.pointShadow.length=C,s.pointShadowMap.length=C,s.spotShadow.length=x,s.spotShadowMap.length=x,s.directionalShadowMatrix.length=T,s.pointShadowMatrix.length=C,s.spotLightMatrix.length=x+w-R,s.spotLightMap.length=w,s.numSpotLightShadowsWithMaps=R,s.numLightProbes=v,P.directionalLength=b,P.pointLength=E,P.spotLength=g,P.rectAreaLength=S,P.hemiLength=y,P.numDirectionalShadows=T,P.numPointShadows=C,P.numSpotShadows=x,P.numSpotMaps=w,P.numLightProbes=v,s.version=Axt++)}function c(d,u){let h=0,m=0,f=0,b=0,E=0;const g=u.matrixWorldInverse;for(let S=0,y=d.length;S=a.length?(l=new P1(n,e),a.push(l)):l=a[o],l}function s(){t=new WeakMap}return{get:i,dispose:s}}class Ixt extends Di{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=fSt,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class Mxt extends Di{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const Dxt=`void main() { +`+$)}else U!==""?console.warn("THREE.WebGLProgram: Program Info Log:",U):(Y===""||L==="")&&(B=!1);B&&(P.diagnostics={runnable:H,programLog:U,vertexShader:{log:Y,prefix:E},fragmentShader:{log:L,prefix:g}})}s.deleteShader(C),s.deleteShader(x),R=new Nd(s,b),v=rxt(s,b)}let R;this.getUniforms=function(){return R===void 0&&w(this),R};let v;this.getAttributes=function(){return v===void 0&&w(this),v};let A=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return A===!1&&(A=s.getProgramParameter(b,X0t)),A},this.destroy=function(){i.releaseStatesOfProgram(this),s.deleteProgram(b),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=Z0t++,this.cacheKey=e,this.usedTimes=1,this.program=b,this.vertexShader=C,this.fragmentShader=x,this}let gxt=0;class Ext{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,s=this._getShaderStage(t),r=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(s)===!1&&(o.add(s),s.usedTimes++),o.has(r)===!1&&(o.add(r),r.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){const t=this.shaderCache;let i=t.get(e);return i===void 0&&(i=new bxt(e),t.set(e,i)),i}}class bxt{constructor(e){this.id=gxt++,this.code=e,this.usedTimes=0}}function Sxt(n,e,t,i,s,r,o){const a=new bO,l=new Ext,c=[],d=s.isWebGL2,u=s.logarithmicDepthBuffer,h=s.vertexTextures;let m=s.precision;const f={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function b(v){return v===0?"uv":`uv${v}`}function E(v,A,P,U,Y){const L=U.fog,H=Y.geometry,B=v.isMeshStandardMaterial?U.environment:null,k=(v.isMeshStandardMaterial?t:e).get(v.envMap||B),$=k&&k.mapping===Ku?k.image.height:null,K=f[v.type];v.precision!==null&&(m=s.getMaxPrecision(v.precision),m!==v.precision&&console.warn("THREE.WebGLProgram.getParameters:",v.precision,"not supported, using",m,"instead."));const W=H.morphAttributes.position||H.morphAttributes.normal||H.morphAttributes.color,le=W!==void 0?W.length:0;let J=0;H.morphAttributes.position!==void 0&&(J=1),H.morphAttributes.normal!==void 0&&(J=2),H.morphAttributes.color!==void 0&&(J=3);let ee,_e,me,Ce;if(K){const dn=Gi[K];ee=dn.vertexShader,_e=dn.fragmentShader}else ee=v.vertexShader,_e=v.fragmentShader,l.update(v),me=l.getVertexShaderID(v),Ce=l.getFragmentShaderID(v);const X=n.getRenderTarget(),ue=Y.isInstancedMesh===!0,Z=Y.isBatchedMesh===!0,ge=!!v.map,Oe=!!v.matcap,M=!!k,G=!!v.aoMap,q=!!v.lightMap,oe=!!v.bumpMap,ne=!!v.normalMap,ve=!!v.displacementMap,we=!!v.emissiveMap,V=!!v.metalnessMap,ce=!!v.roughnessMap,ie=v.anisotropy>0,re=v.clearcoat>0,I=v.iridescence>0,N=v.sheen>0,z=v.transmission>0,de=ie&&!!v.anisotropyMap,Q=re&&!!v.clearcoatMap,te=re&&!!v.clearcoatNormalMap,Re=re&&!!v.clearcoatRoughnessMap,Se=I&&!!v.iridescenceMap,Le=I&&!!v.iridescenceThicknessMap,Ve=N&&!!v.sheenColorMap,nt=N&&!!v.sheenRoughnessMap,De=!!v.specularMap,it=!!v.specularColorMap,Qe=!!v.specularIntensityMap,Ge=z&&!!v.transmissionMap,Ze=z&&!!v.thicknessMap,We=!!v.gradientMap,ht=!!v.alphaMap,ae=v.alphaTest>0,qe=!!v.alphaHash,ke=!!v.extensions,Ne=!!H.attributes.uv1,Pe=!!H.attributes.uv2,rt=!!H.attributes.uv3;let Et=ur;return v.toneMapped&&(X===null||X.isXRRenderTarget===!0)&&(Et=n.toneMapping),{isWebGL2:d,shaderID:K,shaderType:v.type,shaderName:v.name,vertexShader:ee,fragmentShader:_e,defines:v.defines,customVertexShaderID:me,customFragmentShaderID:Ce,isRawShaderMaterial:v.isRawShaderMaterial===!0,glslVersion:v.glslVersion,precision:m,batching:Z,instancing:ue,instancingColor:ue&&Y.instanceColor!==null,supportsVertexTextures:h,outputColorSpace:X===null?n.outputColorSpace:X.isXRRenderTarget===!0?X.texture.colorSpace:Cn,map:ge,matcap:Oe,envMap:M,envMapMode:M&&k.mapping,envMapCubeUVHeight:$,aoMap:G,lightMap:q,bumpMap:oe,normalMap:ne,displacementMap:h&&ve,emissiveMap:we,normalMapObjectSpace:ne&&v.normalMapType===mSt,normalMapTangentSpace:ne&&v.normalMapType===Nb,metalnessMap:V,roughnessMap:ce,anisotropy:ie,anisotropyMap:de,clearcoat:re,clearcoatMap:Q,clearcoatNormalMap:te,clearcoatRoughnessMap:Re,iridescence:I,iridescenceMap:Se,iridescenceThicknessMap:Le,sheen:N,sheenColorMap:Ve,sheenRoughnessMap:nt,specularMap:De,specularColorMap:it,specularIntensityMap:Qe,transmission:z,transmissionMap:Ge,thicknessMap:Ze,gradientMap:We,opaque:v.transparent===!1&&v.blending===Jo,alphaMap:ht,alphaTest:ae,alphaHash:qe,combine:v.combine,mapUv:ge&&b(v.map.channel),aoMapUv:G&&b(v.aoMap.channel),lightMapUv:q&&b(v.lightMap.channel),bumpMapUv:oe&&b(v.bumpMap.channel),normalMapUv:ne&&b(v.normalMap.channel),displacementMapUv:ve&&b(v.displacementMap.channel),emissiveMapUv:we&&b(v.emissiveMap.channel),metalnessMapUv:V&&b(v.metalnessMap.channel),roughnessMapUv:ce&&b(v.roughnessMap.channel),anisotropyMapUv:de&&b(v.anisotropyMap.channel),clearcoatMapUv:Q&&b(v.clearcoatMap.channel),clearcoatNormalMapUv:te&&b(v.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Re&&b(v.clearcoatRoughnessMap.channel),iridescenceMapUv:Se&&b(v.iridescenceMap.channel),iridescenceThicknessMapUv:Le&&b(v.iridescenceThicknessMap.channel),sheenColorMapUv:Ve&&b(v.sheenColorMap.channel),sheenRoughnessMapUv:nt&&b(v.sheenRoughnessMap.channel),specularMapUv:De&&b(v.specularMap.channel),specularColorMapUv:it&&b(v.specularColorMap.channel),specularIntensityMapUv:Qe&&b(v.specularIntensityMap.channel),transmissionMapUv:Ge&&b(v.transmissionMap.channel),thicknessMapUv:Ze&&b(v.thicknessMap.channel),alphaMapUv:ht&&b(v.alphaMap.channel),vertexTangents:!!H.attributes.tangent&&(ne||ie),vertexColors:v.vertexColors,vertexAlphas:v.vertexColors===!0&&!!H.attributes.color&&H.attributes.color.itemSize===4,vertexUv1s:Ne,vertexUv2s:Pe,vertexUv3s:rt,pointsUvs:Y.isPoints===!0&&!!H.attributes.uv&&(ge||ht),fog:!!L,useFog:v.fog===!0,fogExp2:L&&L.isFogExp2,flatShading:v.flatShading===!0,sizeAttenuation:v.sizeAttenuation===!0,logarithmicDepthBuffer:u,skinning:Y.isSkinnedMesh===!0,morphTargets:H.morphAttributes.position!==void 0,morphNormals:H.morphAttributes.normal!==void 0,morphColors:H.morphAttributes.color!==void 0,morphTargetsCount:le,morphTextureStride:J,numDirLights:A.directional.length,numPointLights:A.point.length,numSpotLights:A.spot.length,numSpotLightMaps:A.spotLightMap.length,numRectAreaLights:A.rectArea.length,numHemiLights:A.hemi.length,numDirLightShadows:A.directionalShadowMap.length,numPointLightShadows:A.pointShadowMap.length,numSpotLightShadows:A.spotShadowMap.length,numSpotLightShadowsWithMaps:A.numSpotLightShadowsWithMaps,numLightProbes:A.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:v.dithering,shadowMapEnabled:n.shadowMap.enabled&&P.length>0,shadowMapType:n.shadowMap.type,toneMapping:Et,useLegacyLights:n._useLegacyLights,decodeVideoTexture:ge&&v.map.isVideoTexture===!0&&kt.getTransfer(v.map.colorSpace)===$t,premultipliedAlpha:v.premultipliedAlpha,doubleSided:v.side===Hi,flipSided:v.side===Wn,useDepthPacking:v.depthPacking>=0,depthPacking:v.depthPacking||0,index0AttributeName:v.index0AttributeName,extensionDerivatives:ke&&v.extensions.derivatives===!0,extensionFragDepth:ke&&v.extensions.fragDepth===!0,extensionDrawBuffers:ke&&v.extensions.drawBuffers===!0,extensionShaderTextureLOD:ke&&v.extensions.shaderTextureLOD===!0,rendererExtensionFragDepth:d||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:d||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:d||i.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:v.customProgramCacheKey()}}function g(v){const A=[];if(v.shaderID?A.push(v.shaderID):(A.push(v.customVertexShaderID),A.push(v.customFragmentShaderID)),v.defines!==void 0)for(const P in v.defines)A.push(P),A.push(v.defines[P]);return v.isRawShaderMaterial===!1&&(S(A,v),y(A,v),A.push(n.outputColorSpace)),A.push(v.customProgramCacheKey),A.join()}function S(v,A){v.push(A.precision),v.push(A.outputColorSpace),v.push(A.envMapMode),v.push(A.envMapCubeUVHeight),v.push(A.mapUv),v.push(A.alphaMapUv),v.push(A.lightMapUv),v.push(A.aoMapUv),v.push(A.bumpMapUv),v.push(A.normalMapUv),v.push(A.displacementMapUv),v.push(A.emissiveMapUv),v.push(A.metalnessMapUv),v.push(A.roughnessMapUv),v.push(A.anisotropyMapUv),v.push(A.clearcoatMapUv),v.push(A.clearcoatNormalMapUv),v.push(A.clearcoatRoughnessMapUv),v.push(A.iridescenceMapUv),v.push(A.iridescenceThicknessMapUv),v.push(A.sheenColorMapUv),v.push(A.sheenRoughnessMapUv),v.push(A.specularMapUv),v.push(A.specularColorMapUv),v.push(A.specularIntensityMapUv),v.push(A.transmissionMapUv),v.push(A.thicknessMapUv),v.push(A.combine),v.push(A.fogExp2),v.push(A.sizeAttenuation),v.push(A.morphTargetsCount),v.push(A.morphAttributeCount),v.push(A.numDirLights),v.push(A.numPointLights),v.push(A.numSpotLights),v.push(A.numSpotLightMaps),v.push(A.numHemiLights),v.push(A.numRectAreaLights),v.push(A.numDirLightShadows),v.push(A.numPointLightShadows),v.push(A.numSpotLightShadows),v.push(A.numSpotLightShadowsWithMaps),v.push(A.numLightProbes),v.push(A.shadowMapType),v.push(A.toneMapping),v.push(A.numClippingPlanes),v.push(A.numClipIntersection),v.push(A.depthPacking)}function y(v,A){a.disableAll(),A.isWebGL2&&a.enable(0),A.supportsVertexTextures&&a.enable(1),A.instancing&&a.enable(2),A.instancingColor&&a.enable(3),A.matcap&&a.enable(4),A.envMap&&a.enable(5),A.normalMapObjectSpace&&a.enable(6),A.normalMapTangentSpace&&a.enable(7),A.clearcoat&&a.enable(8),A.iridescence&&a.enable(9),A.alphaTest&&a.enable(10),A.vertexColors&&a.enable(11),A.vertexAlphas&&a.enable(12),A.vertexUv1s&&a.enable(13),A.vertexUv2s&&a.enable(14),A.vertexUv3s&&a.enable(15),A.vertexTangents&&a.enable(16),A.anisotropy&&a.enable(17),A.alphaHash&&a.enable(18),A.batching&&a.enable(19),v.push(a.mask),a.disableAll(),A.fog&&a.enable(0),A.useFog&&a.enable(1),A.flatShading&&a.enable(2),A.logarithmicDepthBuffer&&a.enable(3),A.skinning&&a.enable(4),A.morphTargets&&a.enable(5),A.morphNormals&&a.enable(6),A.morphColors&&a.enable(7),A.premultipliedAlpha&&a.enable(8),A.shadowMapEnabled&&a.enable(9),A.useLegacyLights&&a.enable(10),A.doubleSided&&a.enable(11),A.flipSided&&a.enable(12),A.useDepthPacking&&a.enable(13),A.dithering&&a.enable(14),A.transmission&&a.enable(15),A.sheen&&a.enable(16),A.opaque&&a.enable(17),A.pointsUvs&&a.enable(18),A.decodeVideoTexture&&a.enable(19),v.push(a.mask)}function T(v){const A=f[v.type];let P;if(A){const U=Gi[A];P=ivt.clone(U.uniforms)}else P=v.uniforms;return P}function C(v,A){let P;for(let U=0,Y=c.length;U0?i.push(g):m.transparent===!0?s.push(g):t.push(g)}function l(u,h,m,f,b,E){const g=o(u,h,m,f,b,E);m.transmission>0?i.unshift(g):m.transparent===!0?s.unshift(g):t.unshift(g)}function c(u,h){t.length>1&&t.sort(u||yxt),i.length>1&&i.sort(h||L1),s.length>1&&s.sort(h||L1)}function d(){for(let u=e,h=n.length;u=r.length?(o=new k1,r.push(o)):o=r[s],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function xxt(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new pe,color:new ut};break;case"SpotLight":t={position:new pe,direction:new pe,color:new ut,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new pe,color:new ut,distance:0,decay:0};break;case"HemisphereLight":t={direction:new pe,skyColor:new ut,groundColor:new ut};break;case"RectAreaLight":t={color:new ut,position:new pe,halfWidth:new pe,halfHeight:new pe};break}return n[e.id]=t,t}}}function Cxt(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Rt};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Rt};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Rt,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let Rxt=0;function Axt(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function wxt(n,e){const t=new xxt,i=Cxt(),s={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let d=0;d<9;d++)s.probe.push(new pe);const r=new pe,o=new Tt,a=new Tt;function l(d,u){let h=0,m=0,f=0;for(let U=0;U<9;U++)s.probe[U].set(0,0,0);let b=0,E=0,g=0,S=0,y=0,T=0,C=0,x=0,w=0,R=0,v=0;d.sort(Axt);const A=u===!0?Math.PI:1;for(let U=0,Y=d.length;U0&&(e.isWebGL2||n.has("OES_texture_float_linear")===!0?(s.rectAreaLTC1=ze.LTC_FLOAT_1,s.rectAreaLTC2=ze.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(s.rectAreaLTC1=ze.LTC_HALF_1,s.rectAreaLTC2=ze.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),s.ambient[0]=h,s.ambient[1]=m,s.ambient[2]=f;const P=s.hash;(P.directionalLength!==b||P.pointLength!==E||P.spotLength!==g||P.rectAreaLength!==S||P.hemiLength!==y||P.numDirectionalShadows!==T||P.numPointShadows!==C||P.numSpotShadows!==x||P.numSpotMaps!==w||P.numLightProbes!==v)&&(s.directional.length=b,s.spot.length=g,s.rectArea.length=S,s.point.length=E,s.hemi.length=y,s.directionalShadow.length=T,s.directionalShadowMap.length=T,s.pointShadow.length=C,s.pointShadowMap.length=C,s.spotShadow.length=x,s.spotShadowMap.length=x,s.directionalShadowMatrix.length=T,s.pointShadowMatrix.length=C,s.spotLightMatrix.length=x+w-R,s.spotLightMap.length=w,s.numSpotLightShadowsWithMaps=R,s.numLightProbes=v,P.directionalLength=b,P.pointLength=E,P.spotLength=g,P.rectAreaLength=S,P.hemiLength=y,P.numDirectionalShadows=T,P.numPointShadows=C,P.numSpotShadows=x,P.numSpotMaps=w,P.numLightProbes=v,s.version=Rxt++)}function c(d,u){let h=0,m=0,f=0,b=0,E=0;const g=u.matrixWorldInverse;for(let S=0,y=d.length;S=a.length?(l=new P1(n,e),a.push(l)):l=a[o],l}function s(){t=new WeakMap}return{get:i,dispose:s}}class Oxt extends Di{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=hSt,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class Ixt extends Di{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const Mxt=`void main() { gl_Position = vec4( position, 1.0 ); -}`,Lxt=`uniform sampler2D shadow_pass; +}`,Dxt=`uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; #include @@ -3845,8 +3845,8 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function kxt(n,e,t){let i=new Mb;const s=new Rt,r=new Rt,o=new Ht,a=new Ixt({depthPacking:mSt}),l=new Mxt,c={},d=t.maxTextureSize,u={[Os]:Wn,[Wn]:Os,[Hi]:Hi},h=new ro({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Rt},radius:{value:4}},vertexShader:Dxt,fragmentShader:Lxt}),m=h.clone();m.defines.HORIZONTAL_PASS=1;const f=new is;f.setAttribute("position",new Gn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const b=new Fn(f,h),E=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=nO;let g=this.type;this.render=function(C,x,w){if(E.enabled===!1||E.autoUpdate===!1&&E.needsUpdate===!1||C.length===0)return;const R=n.getRenderTarget(),v=n.getActiveCubeFace(),A=n.getActiveMipmapLevel(),P=n.state;P.setBlending(dr),P.buffers.color.setClear(1,1,1,1),P.buffers.depth.setTest(!0),P.setScissorTest(!1);const U=g!==gs&&this.type===gs,Y=g===gs&&this.type!==gs;for(let L=0,H=C.length;Ld||s.y>d)&&(s.x>d&&(r.x=Math.floor(d/$.x),s.x=r.x*$.x,k.mapSize.x=r.x),s.y>d&&(r.y=Math.floor(d/$.y),s.y=r.y*$.y,k.mapSize.y=r.y)),k.map===null||U===!0||Y===!0){const W=this.type!==gs?{minFilter:gn,magFilter:gn}:{};k.map!==null&&k.map.dispose(),k.map=new so(s.x,s.y,W),k.map.texture.name=B.name+".shadowMap",k.camera.updateProjectionMatrix()}n.setRenderTarget(k.map),n.clear();const K=k.getViewportCount();for(let W=0;W0||x.map&&x.alphaTest>0){const P=v.uuid,U=x.uuid;let Y=c[P];Y===void 0&&(Y={},c[P]=Y);let L=Y[U];L===void 0&&(L=v.clone(),Y[U]=L),v=L}if(v.visible=x.visible,v.wireframe=x.wireframe,R===gs?v.side=x.shadowSide!==null?x.shadowSide:x.side:v.side=x.shadowSide!==null?x.shadowSide:u[x.side],v.alphaMap=x.alphaMap,v.alphaTest=x.alphaTest,v.map=x.map,v.clipShadows=x.clipShadows,v.clippingPlanes=x.clippingPlanes,v.clipIntersection=x.clipIntersection,v.displacementMap=x.displacementMap,v.displacementScale=x.displacementScale,v.displacementBias=x.displacementBias,v.wireframeLinewidth=x.wireframeLinewidth,v.linewidth=x.linewidth,w.isPointLight===!0&&v.isMeshDistanceMaterial===!0){const P=n.properties.get(v);P.light=w}return v}function T(C,x,w,R,v){if(C.visible===!1)return;if(C.layers.test(x.layers)&&(C.isMesh||C.isLine||C.isPoints)&&(C.castShadow||C.receiveShadow&&v===gs)&&(!C.frustumCulled||i.intersectsObject(C))){C.modelViewMatrix.multiplyMatrices(w.matrixWorldInverse,C.matrixWorld);const U=e.update(C),Y=C.material;if(Array.isArray(Y)){const L=U.groups;for(let H=0,B=L.length;H=1):W.indexOf("OpenGL ES")!==-1&&(K=parseFloat(/^OpenGL ES (\d)/.exec(W)[1]),$=K>=2);let le=null,J={};const ee=n.getParameter(n.SCISSOR_BOX),_e=n.getParameter(n.VIEWPORT),me=new Ht().fromArray(ee),Ce=new Ht().fromArray(_e);function X(ae,qe,ke,Ne){const Pe=new Uint8Array(4),rt=n.createTexture();n.bindTexture(ae,rt),n.texParameteri(ae,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(ae,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Et=0;Et"u"?!1:/OculusBrowser/g.test(navigator.userAgent),f=new WeakMap;let b;const E=new WeakMap;let g=!1;try{g=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function S(I,N){return g?new OffscreenCanvas(I,N):Zl("canvas")}function y(I,N,z,de){let Q=1;if((I.width>de||I.height>de)&&(Q=de/Math.max(I.width,I.height)),Q<1||N===!0)if(typeof HTMLImageElement<"u"&&I instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&I instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&I instanceof ImageBitmap){const te=N?lu:Math.floor,Re=te(Q*I.width),Se=te(Q*I.height);b===void 0&&(b=S(Re,Se));const Le=z?S(Re,Se):b;return Le.width=Re,Le.height=Se,Le.getContext("2d").drawImage(I,0,0,Re,Se),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+I.width+"x"+I.height+") to ("+Re+"x"+Se+")."),Le}else return"data"in I&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+I.width+"x"+I.height+")."),I;return I}function T(I){return $g(I.width)&&$g(I.height)}function C(I){return a?!1:I.wrapS!==di||I.wrapT!==di||I.minFilter!==gn&&I.minFilter!==qn}function x(I,N){return I.generateMipmaps&&N&&I.minFilter!==gn&&I.minFilter!==qn}function w(I){n.generateMipmap(I)}function R(I,N,z,de,Q=!1){if(a===!1)return N;if(I!==null){if(n[I]!==void 0)return n[I];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+I+"'")}let te=N;if(N===n.RED&&(z===n.FLOAT&&(te=n.R32F),z===n.HALF_FLOAT&&(te=n.R16F),z===n.UNSIGNED_BYTE&&(te=n.R8)),N===n.RED_INTEGER&&(z===n.UNSIGNED_BYTE&&(te=n.R8UI),z===n.UNSIGNED_SHORT&&(te=n.R16UI),z===n.UNSIGNED_INT&&(te=n.R32UI),z===n.BYTE&&(te=n.R8I),z===n.SHORT&&(te=n.R16I),z===n.INT&&(te=n.R32I)),N===n.RG&&(z===n.FLOAT&&(te=n.RG32F),z===n.HALF_FLOAT&&(te=n.RG16F),z===n.UNSIGNED_BYTE&&(te=n.RG8)),N===n.RGBA){const Re=Q?su:kt.getTransfer(de);z===n.FLOAT&&(te=n.RGBA32F),z===n.HALF_FLOAT&&(te=n.RGBA16F),z===n.UNSIGNED_BYTE&&(te=Re===$t?n.SRGB8_ALPHA8:n.RGBA8),z===n.UNSIGNED_SHORT_4_4_4_4&&(te=n.RGBA4),z===n.UNSIGNED_SHORT_5_5_5_1&&(te=n.RGB5_A1)}return(te===n.R16F||te===n.R32F||te===n.RG16F||te===n.RG32F||te===n.RGBA16F||te===n.RGBA32F)&&e.get("EXT_color_buffer_float"),te}function v(I,N,z){return x(I,z)===!0||I.isFramebufferTexture&&I.minFilter!==gn&&I.minFilter!==qn?Math.log2(Math.max(N.width,N.height))+1:I.mipmaps!==void 0&&I.mipmaps.length>0?I.mipmaps.length:I.isCompressedTexture&&Array.isArray(I.image)?N.mipmaps.length:1}function A(I){return I===gn||I===zg||I===wd?n.NEAREST:n.LINEAR}function P(I){const N=I.target;N.removeEventListener("dispose",P),Y(N),N.isVideoTexture&&f.delete(N)}function U(I){const N=I.target;N.removeEventListener("dispose",U),H(N)}function Y(I){const N=i.get(I);if(N.__webglInit===void 0)return;const z=I.source,de=E.get(z);if(de){const Q=de[N.__cacheKey];Q.usedTimes--,Q.usedTimes===0&&L(I),Object.keys(de).length===0&&E.delete(z)}i.remove(I)}function L(I){const N=i.get(I);n.deleteTexture(N.__webglTexture);const z=I.source,de=E.get(z);delete de[N.__cacheKey],o.memory.textures--}function H(I){const N=I.texture,z=i.get(I),de=i.get(N);if(de.__webglTexture!==void 0&&(n.deleteTexture(de.__webglTexture),o.memory.textures--),I.depthTexture&&I.depthTexture.dispose(),I.isWebGLCubeRenderTarget)for(let Q=0;Q<6;Q++){if(Array.isArray(z.__webglFramebuffer[Q]))for(let te=0;te=l&&console.warn("THREE.WebGLTextures: Trying to use "+I+" texture units while this GPU supports only "+l),B+=1,I}function K(I){const N=[];return N.push(I.wrapS),N.push(I.wrapT),N.push(I.wrapR||0),N.push(I.magFilter),N.push(I.minFilter),N.push(I.anisotropy),N.push(I.internalFormat),N.push(I.format),N.push(I.type),N.push(I.generateMipmaps),N.push(I.premultiplyAlpha),N.push(I.flipY),N.push(I.unpackAlignment),N.push(I.colorSpace),N.join()}function W(I,N){const z=i.get(I);if(I.isVideoTexture&&ie(I),I.isRenderTargetTexture===!1&&I.version>0&&z.__version!==I.version){const de=I.image;if(de===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(de.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Z(z,I,N);return}}t.bindTexture(n.TEXTURE_2D,z.__webglTexture,n.TEXTURE0+N)}function le(I,N){const z=i.get(I);if(I.version>0&&z.__version!==I.version){Z(z,I,N);return}t.bindTexture(n.TEXTURE_2D_ARRAY,z.__webglTexture,n.TEXTURE0+N)}function J(I,N){const z=i.get(I);if(I.version>0&&z.__version!==I.version){Z(z,I,N);return}t.bindTexture(n.TEXTURE_3D,z.__webglTexture,n.TEXTURE0+N)}function ee(I,N){const z=i.get(I);if(I.version>0&&z.__version!==I.version){ge(z,I,N);return}t.bindTexture(n.TEXTURE_CUBE_MAP,z.__webglTexture,n.TEXTURE0+N)}const _e={[Ea]:n.REPEAT,[di]:n.CLAMP_TO_EDGE,[iu]:n.MIRRORED_REPEAT},me={[gn]:n.NEAREST,[zg]:n.NEAREST_MIPMAP_NEAREST,[wd]:n.NEAREST_MIPMAP_LINEAR,[qn]:n.LINEAR,[sO]:n.LINEAR_MIPMAP_NEAREST,[io]:n.LINEAR_MIPMAP_LINEAR},Ce={[ESt]:n.NEVER,[xSt]:n.ALWAYS,[bSt]:n.LESS,[hO]:n.LEQUAL,[SSt]:n.EQUAL,[TSt]:n.GEQUAL,[vSt]:n.GREATER,[ySt]:n.NOTEQUAL};function X(I,N,z){if(z?(n.texParameteri(I,n.TEXTURE_WRAP_S,_e[N.wrapS]),n.texParameteri(I,n.TEXTURE_WRAP_T,_e[N.wrapT]),(I===n.TEXTURE_3D||I===n.TEXTURE_2D_ARRAY)&&n.texParameteri(I,n.TEXTURE_WRAP_R,_e[N.wrapR]),n.texParameteri(I,n.TEXTURE_MAG_FILTER,me[N.magFilter]),n.texParameteri(I,n.TEXTURE_MIN_FILTER,me[N.minFilter])):(n.texParameteri(I,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(I,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),(I===n.TEXTURE_3D||I===n.TEXTURE_2D_ARRAY)&&n.texParameteri(I,n.TEXTURE_WRAP_R,n.CLAMP_TO_EDGE),(N.wrapS!==di||N.wrapT!==di)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(I,n.TEXTURE_MAG_FILTER,A(N.magFilter)),n.texParameteri(I,n.TEXTURE_MIN_FILTER,A(N.minFilter)),N.minFilter!==gn&&N.minFilter!==qn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),N.compareFunction&&(n.texParameteri(I,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(I,n.TEXTURE_COMPARE_FUNC,Ce[N.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const de=e.get("EXT_texture_filter_anisotropic");if(N.magFilter===gn||N.minFilter!==wd&&N.minFilter!==io||N.type===Ss&&e.has("OES_texture_float_linear")===!1||a===!1&&N.type===Ql&&e.has("OES_texture_half_float_linear")===!1)return;(N.anisotropy>1||i.get(N).__currentAnisotropy)&&(n.texParameterf(I,de.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(N.anisotropy,s.getMaxAnisotropy())),i.get(N).__currentAnisotropy=N.anisotropy)}}function ue(I,N){let z=!1;I.__webglInit===void 0&&(I.__webglInit=!0,N.addEventListener("dispose",P));const de=N.source;let Q=E.get(de);Q===void 0&&(Q={},E.set(de,Q));const te=K(N);if(te!==I.__cacheKey){Q[te]===void 0&&(Q[te]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,z=!0),Q[te].usedTimes++;const Re=Q[I.__cacheKey];Re!==void 0&&(Q[I.__cacheKey].usedTimes--,Re.usedTimes===0&&L(N)),I.__cacheKey=te,I.__webglTexture=Q[te].texture}return z}function Z(I,N,z){let de=n.TEXTURE_2D;(N.isDataArrayTexture||N.isCompressedArrayTexture)&&(de=n.TEXTURE_2D_ARRAY),N.isData3DTexture&&(de=n.TEXTURE_3D);const Q=ue(I,N),te=N.source;t.bindTexture(de,I.__webglTexture,n.TEXTURE0+z);const Re=i.get(te);if(te.version!==Re.__version||Q===!0){t.activeTexture(n.TEXTURE0+z);const Se=kt.getPrimaries(kt.workingColorSpace),Le=N.colorSpace===pi?null:kt.getPrimaries(N.colorSpace),Ve=N.colorSpace===pi||Se===Le?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,N.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,N.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,N.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ve);const nt=C(N)&&T(N.image)===!1;let De=y(N.image,nt,!1,d);De=re(N,De);const it=T(De)||a,Qe=r.convert(N.format,N.colorSpace);let Ge=r.convert(N.type),Ze=R(N.internalFormat,Qe,Ge,N.colorSpace,N.isVideoTexture);X(de,N,it);let We;const ht=N.mipmaps,ae=a&&N.isVideoTexture!==!0&&Ze!==uO,qe=Re.__version===void 0||Q===!0,ke=v(N,De,it);if(N.isDepthTexture)Ze=n.DEPTH_COMPONENT,a?N.type===Ss?Ze=n.DEPTH_COMPONENT32F:N.type===or?Ze=n.DEPTH_COMPONENT24:N.type===jr?Ze=n.DEPTH24_STENCIL8:Ze=n.DEPTH_COMPONENT16:N.type===Ss&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),N.format===Qr&&Ze===n.DEPTH_COMPONENT&&N.type!==wb&&N.type!==or&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),N.type=or,Ge=r.convert(N.type)),N.format===ba&&Ze===n.DEPTH_COMPONENT&&(Ze=n.DEPTH_STENCIL,N.type!==jr&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),N.type=jr,Ge=r.convert(N.type))),qe&&(ae?t.texStorage2D(n.TEXTURE_2D,1,Ze,De.width,De.height):t.texImage2D(n.TEXTURE_2D,0,Ze,De.width,De.height,0,Qe,Ge,null));else if(N.isDataTexture)if(ht.length>0&&it){ae&&qe&&t.texStorage2D(n.TEXTURE_2D,ke,Ze,ht[0].width,ht[0].height);for(let Ne=0,Pe=ht.length;Ne>=1,Pe>>=1}}else if(ht.length>0&&it){ae&&qe&&t.texStorage2D(n.TEXTURE_2D,ke,Ze,ht[0].width,ht[0].height);for(let Ne=0,Pe=ht.length;Ne0&&qe++,t.texStorage2D(n.TEXTURE_CUBE_MAP,qe,We,De[0].width,De[0].height));for(let Ne=0;Ne<6;Ne++)if(nt){ht?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ne,0,0,0,De[Ne].width,De[Ne].height,Ge,Ze,De[Ne].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ne,0,We,De[Ne].width,De[Ne].height,0,Ge,Ze,De[Ne].data);for(let Pe=0;Pe>te),De=Math.max(1,N.height>>te);Q===n.TEXTURE_3D||Q===n.TEXTURE_2D_ARRAY?t.texImage3D(Q,te,Le,nt,De,N.depth,0,Re,Se,null):t.texImage2D(Q,te,Le,nt,De,0,Re,Se,null)}t.bindFramebuffer(n.FRAMEBUFFER,I),ce(N)?h.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,de,Q,i.get(z).__webglTexture,0,V(N)):(Q===n.TEXTURE_2D||Q>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&Q<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,de,Q,i.get(z).__webglTexture,te),t.bindFramebuffer(n.FRAMEBUFFER,null)}function M(I,N,z){if(n.bindRenderbuffer(n.RENDERBUFFER,I),N.depthBuffer&&!N.stencilBuffer){let de=a===!0?n.DEPTH_COMPONENT24:n.DEPTH_COMPONENT16;if(z||ce(N)){const Q=N.depthTexture;Q&&Q.isDepthTexture&&(Q.type===Ss?de=n.DEPTH_COMPONENT32F:Q.type===or&&(de=n.DEPTH_COMPONENT24));const te=V(N);ce(N)?h.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,te,de,N.width,N.height):n.renderbufferStorageMultisample(n.RENDERBUFFER,te,de,N.width,N.height)}else n.renderbufferStorage(n.RENDERBUFFER,de,N.width,N.height);n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,I)}else if(N.depthBuffer&&N.stencilBuffer){const de=V(N);z&&ce(N)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,de,n.DEPTH24_STENCIL8,N.width,N.height):ce(N)?h.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,de,n.DEPTH24_STENCIL8,N.width,N.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,N.width,N.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,I)}else{const de=N.isWebGLMultipleRenderTargets===!0?N.texture:[N.texture];for(let Q=0;Q0){z.__webglFramebuffer[Se]=[];for(let Le=0;Le0){z.__webglFramebuffer=[];for(let Se=0;Se0&&ce(I)===!1){const Se=te?N:[N];z.__webglMultisampledFramebuffer=n.createFramebuffer(),z.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,z.__webglMultisampledFramebuffer);for(let Le=0;Le0)for(let Le=0;Le0)for(let Le=0;Le0&&ce(I)===!1){const N=I.isWebGLMultipleRenderTargets?I.texture:[I.texture],z=I.width,de=I.height;let Q=n.COLOR_BUFFER_BIT;const te=[],Re=I.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Se=i.get(I),Le=I.isWebGLMultipleRenderTargets===!0;if(Le)for(let Ve=0;Ve0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&N.__useRenderToTexture!==!1}function ie(I){const N=o.render.frame;f.get(I)!==N&&(f.set(I,N),I.update())}function re(I,N){const z=I.colorSpace,de=I.format,Q=I.type;return I.isCompressedTexture===!0||I.isVideoTexture===!0||I.format===Yg||z!==Cn&&z!==pi&&(kt.getTransfer(z)===$t?a===!1?e.has("EXT_sRGB")===!0&&de===ui?(I.format=Yg,I.minFilter=qn,I.generateMipmaps=!1):N=mO.sRGBToLinear(N):(de!==ui||Q!==pr)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",z)),N}this.allocateTextureUnit=$,this.resetTextureUnits=k,this.setTexture2D=W,this.setTexture2DArray=le,this.setTexture3D=J,this.setTextureCube=ee,this.rebindTextures=oe,this.setupRenderTarget=ne,this.updateRenderTargetMipmap=ve,this.updateMultisampleRenderTarget=we,this.setupDepthRenderbuffer=q,this.setupFrameBufferTexture=Oe,this.useMultisampledRTT=ce}function Fxt(n,e,t){const i=t.isWebGL2;function s(r,o=pi){let a;const l=kt.getTransfer(o);if(r===pr)return n.UNSIGNED_BYTE;if(r===oO)return n.UNSIGNED_SHORT_4_4_4_4;if(r===aO)return n.UNSIGNED_SHORT_5_5_5_1;if(r===rSt)return n.BYTE;if(r===oSt)return n.SHORT;if(r===wb)return n.UNSIGNED_SHORT;if(r===rO)return n.INT;if(r===or)return n.UNSIGNED_INT;if(r===Ss)return n.FLOAT;if(r===Ql)return i?n.HALF_FLOAT:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(r===aSt)return n.ALPHA;if(r===ui)return n.RGBA;if(r===lSt)return n.LUMINANCE;if(r===cSt)return n.LUMINANCE_ALPHA;if(r===Qr)return n.DEPTH_COMPONENT;if(r===ba)return n.DEPTH_STENCIL;if(r===Yg)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(r===dSt)return n.RED;if(r===lO)return n.RED_INTEGER;if(r===uSt)return n.RG;if(r===cO)return n.RG_INTEGER;if(r===dO)return n.RGBA_INTEGER;if(r===Em||r===bm||r===Sm||r===vm)if(l===$t)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(r===Em)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===bm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===Sm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===vm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(r===Em)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===bm)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===Sm)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===vm)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(r===yC||r===TC||r===xC||r===CC)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(r===yC)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===TC)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===xC)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===CC)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(r===uO)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(r===RC||r===AC)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(r===RC)return l===$t?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(r===AC)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(r===wC||r===NC||r===OC||r===IC||r===MC||r===DC||r===LC||r===kC||r===PC||r===UC||r===FC||r===BC||r===GC||r===VC)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(r===wC)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===NC)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===OC)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===IC)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===MC)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===DC)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===LC)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===kC)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===PC)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===UC)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===FC)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===BC)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===GC)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===VC)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(r===ym||r===zC||r===HC)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(r===ym)return l===$t?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(r===zC)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(r===HC)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(r===pSt||r===qC||r===YC||r===$C)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(r===ym)return a.COMPRESSED_RED_RGTC1_EXT;if(r===qC)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(r===YC)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(r===$C)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return r===jr?i?n.UNSIGNED_INT_24_8:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):n[r]!==void 0?n[r]:null}return{convert:s}}class Bxt extends Un{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class qr extends Zt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Gxt={type:"move"};class $m{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new qr,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new qr,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new pe,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new pe),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new qr,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new pe,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new pe),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let s=null,r=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){o=!0;for(const b of e.hand.values()){const E=t.getJointPose(b,i),g=this._getHandJoint(c,b);E!==null&&(g.matrix.fromArray(E.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,g.jointRadius=E.radius),g.visible=E!==null}const d=c.joints["index-finger-tip"],u=c.joints["thumb-tip"],h=d.position.distanceTo(u.position),m=.02,f=.005;c.inputState.pinching&&h>m+f?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&h<=m-f&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(r=t.getPose(e.gripSpace,i),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(s=t.getPose(e.targetRaySpace,i),s===null&&r!==null&&(s=r),s!==null&&(a.matrix.fromArray(s.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,s.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(s.linearVelocity)):a.hasLinearVelocity=!1,s.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(s.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(Gxt)))}return a!==null&&(a.visible=s!==null),l!==null&&(l.visible=r!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new qr;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}class Vxt extends Va{constructor(e,t){super();const i=this;let s=null,r=1,o=null,a="local-floor",l=1,c=null,d=null,u=null,h=null,m=null,f=null;const b=t.getContextAttributes();let E=null,g=null;const S=[],y=[],T=new Rt;let C=null;const x=new Un;x.layers.enable(1),x.viewport=new Ht;const w=new Un;w.layers.enable(2),w.viewport=new Ht;const R=[x,w],v=new Bxt;v.layers.enable(1),v.layers.enable(2);let A=null,P=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ee){let _e=S[ee];return _e===void 0&&(_e=new $m,S[ee]=_e),_e.getTargetRaySpace()},this.getControllerGrip=function(ee){let _e=S[ee];return _e===void 0&&(_e=new $m,S[ee]=_e),_e.getGripSpace()},this.getHand=function(ee){let _e=S[ee];return _e===void 0&&(_e=new $m,S[ee]=_e),_e.getHandSpace()};function U(ee){const _e=y.indexOf(ee.inputSource);if(_e===-1)return;const me=S[_e];me!==void 0&&(me.update(ee.inputSource,ee.frame,c||o),me.dispatchEvent({type:ee.type,data:ee.inputSource}))}function Y(){s.removeEventListener("select",U),s.removeEventListener("selectstart",U),s.removeEventListener("selectend",U),s.removeEventListener("squeeze",U),s.removeEventListener("squeezestart",U),s.removeEventListener("squeezeend",U),s.removeEventListener("end",Y),s.removeEventListener("inputsourceschange",L);for(let ee=0;ee=0&&(y[Ce]=null,S[Ce].disconnect(me))}for(let _e=0;_e=y.length){y.push(me),Ce=ue;break}else if(y[ue]===null){y[ue]=me,Ce=ue;break}if(Ce===-1)break}const X=S[Ce];X&&X.connect(me)}}const H=new pe,B=new pe;function k(ee,_e,me){H.setFromMatrixPosition(_e.matrixWorld),B.setFromMatrixPosition(me.matrixWorld);const Ce=H.distanceTo(B),X=_e.projectionMatrix.elements,ue=me.projectionMatrix.elements,Z=X[14]/(X[10]-1),ge=X[14]/(X[10]+1),Oe=(X[9]+1)/X[5],M=(X[9]-1)/X[5],G=(X[8]-1)/X[0],q=(ue[8]+1)/ue[0],oe=Z*G,ne=Z*q,ve=Ce/(-G+q),we=ve*-G;_e.matrixWorld.decompose(ee.position,ee.quaternion,ee.scale),ee.translateX(we),ee.translateZ(ve),ee.matrixWorld.compose(ee.position,ee.quaternion,ee.scale),ee.matrixWorldInverse.copy(ee.matrixWorld).invert();const V=Z+ve,ce=ge+ve,ie=oe-we,re=ne+(Ce-we),I=Oe*ge/ce*V,N=M*ge/ce*V;ee.projectionMatrix.makePerspective(ie,re,I,N,V,ce),ee.projectionMatrixInverse.copy(ee.projectionMatrix).invert()}function $(ee,_e){_e===null?ee.matrixWorld.copy(ee.matrix):ee.matrixWorld.multiplyMatrices(_e.matrixWorld,ee.matrix),ee.matrixWorldInverse.copy(ee.matrixWorld).invert()}this.updateCamera=function(ee){if(s===null)return;v.near=w.near=x.near=ee.near,v.far=w.far=x.far=ee.far,(A!==v.near||P!==v.far)&&(s.updateRenderState({depthNear:v.near,depthFar:v.far}),A=v.near,P=v.far);const _e=ee.parent,me=v.cameras;$(v,_e);for(let Ce=0;Ce0&&(E.alphaTest.value=g.alphaTest);const S=e.get(g).envMap;if(S&&(E.envMap.value=S,E.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,E.reflectivity.value=g.reflectivity,E.ior.value=g.ior,E.refractionRatio.value=g.refractionRatio),g.lightMap){E.lightMap.value=g.lightMap;const y=n._useLegacyLights===!0?Math.PI:1;E.lightMapIntensity.value=g.lightMapIntensity*y,t(g.lightMap,E.lightMapTransform)}g.aoMap&&(E.aoMap.value=g.aoMap,E.aoMapIntensity.value=g.aoMapIntensity,t(g.aoMap,E.aoMapTransform))}function o(E,g){E.diffuse.value.copy(g.color),E.opacity.value=g.opacity,g.map&&(E.map.value=g.map,t(g.map,E.mapTransform))}function a(E,g){E.dashSize.value=g.dashSize,E.totalSize.value=g.dashSize+g.gapSize,E.scale.value=g.scale}function l(E,g,S,y){E.diffuse.value.copy(g.color),E.opacity.value=g.opacity,E.size.value=g.size*S,E.scale.value=y*.5,g.map&&(E.map.value=g.map,t(g.map,E.uvTransform)),g.alphaMap&&(E.alphaMap.value=g.alphaMap,t(g.alphaMap,E.alphaMapTransform)),g.alphaTest>0&&(E.alphaTest.value=g.alphaTest)}function c(E,g){E.diffuse.value.copy(g.color),E.opacity.value=g.opacity,E.rotation.value=g.rotation,g.map&&(E.map.value=g.map,t(g.map,E.mapTransform)),g.alphaMap&&(E.alphaMap.value=g.alphaMap,t(g.alphaMap,E.alphaMapTransform)),g.alphaTest>0&&(E.alphaTest.value=g.alphaTest)}function d(E,g){E.specular.value.copy(g.specular),E.shininess.value=Math.max(g.shininess,1e-4)}function u(E,g){g.gradientMap&&(E.gradientMap.value=g.gradientMap)}function h(E,g){E.metalness.value=g.metalness,g.metalnessMap&&(E.metalnessMap.value=g.metalnessMap,t(g.metalnessMap,E.metalnessMapTransform)),E.roughness.value=g.roughness,g.roughnessMap&&(E.roughnessMap.value=g.roughnessMap,t(g.roughnessMap,E.roughnessMapTransform)),e.get(g).envMap&&(E.envMapIntensity.value=g.envMapIntensity)}function m(E,g,S){E.ior.value=g.ior,g.sheen>0&&(E.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),E.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(E.sheenColorMap.value=g.sheenColorMap,t(g.sheenColorMap,E.sheenColorMapTransform)),g.sheenRoughnessMap&&(E.sheenRoughnessMap.value=g.sheenRoughnessMap,t(g.sheenRoughnessMap,E.sheenRoughnessMapTransform))),g.clearcoat>0&&(E.clearcoat.value=g.clearcoat,E.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(E.clearcoatMap.value=g.clearcoatMap,t(g.clearcoatMap,E.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(E.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,t(g.clearcoatRoughnessMap,E.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(E.clearcoatNormalMap.value=g.clearcoatNormalMap,t(g.clearcoatNormalMap,E.clearcoatNormalMapTransform),E.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===Wn&&E.clearcoatNormalScale.value.negate())),g.iridescence>0&&(E.iridescence.value=g.iridescence,E.iridescenceIOR.value=g.iridescenceIOR,E.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],E.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(E.iridescenceMap.value=g.iridescenceMap,t(g.iridescenceMap,E.iridescenceMapTransform)),g.iridescenceThicknessMap&&(E.iridescenceThicknessMap.value=g.iridescenceThicknessMap,t(g.iridescenceThicknessMap,E.iridescenceThicknessMapTransform))),g.transmission>0&&(E.transmission.value=g.transmission,E.transmissionSamplerMap.value=S.texture,E.transmissionSamplerSize.value.set(S.width,S.height),g.transmissionMap&&(E.transmissionMap.value=g.transmissionMap,t(g.transmissionMap,E.transmissionMapTransform)),E.thickness.value=g.thickness,g.thicknessMap&&(E.thicknessMap.value=g.thicknessMap,t(g.thicknessMap,E.thicknessMapTransform)),E.attenuationDistance.value=g.attenuationDistance,E.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(E.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(E.anisotropyMap.value=g.anisotropyMap,t(g.anisotropyMap,E.anisotropyMapTransform))),E.specularIntensity.value=g.specularIntensity,E.specularColor.value.copy(g.specularColor),g.specularColorMap&&(E.specularColorMap.value=g.specularColorMap,t(g.specularColorMap,E.specularColorMapTransform)),g.specularIntensityMap&&(E.specularIntensityMap.value=g.specularIntensityMap,t(g.specularIntensityMap,E.specularIntensityMapTransform))}function f(E,g){g.matcap&&(E.matcap.value=g.matcap)}function b(E,g){const S=e.get(g).light;E.referencePosition.value.setFromMatrixPosition(S.matrixWorld),E.nearDistance.value=S.shadow.camera.near,E.farDistance.value=S.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:s}}function Hxt(n,e,t,i){let s={},r={},o=[];const a=t.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(S,y){const T=y.program;i.uniformBlockBinding(S,T)}function c(S,y){let T=s[S.id];T===void 0&&(f(S),T=d(S),s[S.id]=T,S.addEventListener("dispose",E));const C=y.program;i.updateUBOMapping(S,C);const x=e.render.frame;r[S.id]!==x&&(h(S),r[S.id]=x)}function d(S){const y=u();S.__bindingPointIndex=y;const T=n.createBuffer(),C=S.__size,x=S.usage;return n.bindBuffer(n.UNIFORM_BUFFER,T),n.bufferData(n.UNIFORM_BUFFER,C,x),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,y,T),T}function u(){for(let S=0;S0){x=T%C;const U=C-x;x!==0&&U-A.boundary<0&&(T+=C-x,v.__offset=T)}T+=A.storage}return x=T%C,x>0&&(T+=C-x),S.__size=T,S.__cache={},this}function b(S){const y={boundary:0,storage:0};return typeof S=="number"?(y.boundary=4,y.storage=4):S.isVector2?(y.boundary=8,y.storage=8):S.isVector3||S.isColor?(y.boundary=16,y.storage=12):S.isVector4?(y.boundary=16,y.storage=16):S.isMatrix3?(y.boundary=48,y.storage=48):S.isMatrix4?(y.boundary=64,y.storage=64):S.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",S),y}function E(S){const y=S.target;y.removeEventListener("dispose",E);const T=o.indexOf(y.__bindingPointIndex);o.splice(T,1),n.deleteBuffer(s[y.id]),delete s[y.id],delete r[y.id]}function g(){for(const S in s)n.deleteBuffer(s[S]);o=[],s={},r={}}return{bind:l,update:c,dispose:g}}class DO{constructor(e={}){const{canvas:t=GSt(),context:i=null,depth:s=!0,stencil:r=!0,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:d="default",failIfMajorPerformanceCaveat:u=!1}=e;this.isWebGLRenderer=!0;let h;i!==null?h=i.getContextAttributes().alpha:h=o;const m=new Uint32Array(4),f=new Int32Array(4);let b=null,E=null;const g=[],S=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=tn,this._useLegacyLights=!1,this.toneMapping=ur,this.toneMappingExposure=1;const y=this;let T=!1,C=0,x=0,w=null,R=-1,v=null;const A=new Ht,P=new Ht;let U=null;const Y=new ut(0);let L=0,H=t.width,B=t.height,k=1,$=null,K=null;const W=new Ht(0,0,H,B),le=new Ht(0,0,H,B);let J=!1;const ee=new Mb;let _e=!1,me=!1,Ce=null;const X=new Tt,ue=new Rt,Z=new pe,ge={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Oe(){return w===null?k:1}let M=i;function G(F,fe){for(let ye=0;ye{function Ke(){if(Ae.forEach(function(Je){we.get(Je).currentProgram.isReady()&&Ae.delete(Je)}),Ae.size===0){Ee(F);return}setTimeout(Ke,10)}q.get("KHR_parallel_shader_compile")!==null?Ke():setTimeout(Ke,10)})};let Et=null;function en(F){Et&&Et(F)}function dn(){jt.stop()}function Lt(){jt.start()}const jt=new RO;jt.setAnimationLoop(en),typeof self<"u"&&jt.setContext(self),this.setAnimationLoop=function(F){Et=F,We.setAnimationLoop(F),F===null?jt.stop():jt.start()},We.addEventListener("sessionstart",dn),We.addEventListener("sessionend",Lt),this.render=function(F,fe){if(fe!==void 0&&fe.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(T===!0)return;F.matrixWorldAutoUpdate===!0&&F.updateMatrixWorld(),fe.parent===null&&fe.matrixWorldAutoUpdate===!0&&fe.updateMatrixWorld(),We.enabled===!0&&We.isPresenting===!0&&(We.cameraAutoUpdate===!0&&We.updateCamera(fe),fe=We.getCamera()),F.isScene===!0&&F.onBeforeRender(y,F,fe,w),E=te.get(F,S.length),E.init(),S.push(E),X.multiplyMatrices(fe.projectionMatrix,fe.matrixWorldInverse),ee.setFromProjectionMatrix(X),me=this.localClippingEnabled,_e=Re.init(this.clippingPlanes,me),b=Q.get(F,g.length),b.init(),g.push(b),Vn(F,fe,0,y.sortObjects),b.finish(),y.sortObjects===!0&&b.sort($,K),this.info.render.frame++,_e===!0&&Re.beginShadows();const ye=E.state.shadowsArray;if(Se.render(ye,F,fe),_e===!0&&Re.endShadows(),this.info.autoReset===!0&&this.info.reset(),Le.render(b,F),E.setupLights(y._useLegacyLights),fe.isArrayCamera){const Ae=fe.cameras;for(let Ee=0,Ke=Ae.length;Ee0?E=S[S.length-1]:E=null,g.pop(),g.length>0?b=g[g.length-1]:b=null};function Vn(F,fe,ye,Ae){if(F.visible===!1)return;if(F.layers.test(fe.layers)){if(F.isGroup)ye=F.renderOrder;else if(F.isLOD)F.autoUpdate===!0&&F.update(fe);else if(F.isLight)E.pushLight(F),F.castShadow&&E.pushShadow(F);else if(F.isSprite){if(!F.frustumCulled||ee.intersectsSprite(F)){Ae&&Z.setFromMatrixPosition(F.matrixWorld).applyMatrix4(X);const Je=N.update(F),st=F.material;st.visible&&b.push(F,Je,st,ye,Z.z,null)}}else if((F.isMesh||F.isLine||F.isPoints)&&(!F.frustumCulled||ee.intersectsObject(F))){const Je=N.update(F),st=F.material;if(Ae&&(F.boundingSphere!==void 0?(F.boundingSphere===null&&F.computeBoundingSphere(),Z.copy(F.boundingSphere.center)):(Je.boundingSphere===null&&Je.computeBoundingSphere(),Z.copy(Je.boundingSphere.center)),Z.applyMatrix4(F.matrixWorld).applyMatrix4(X)),Array.isArray(st)){const at=Je.groups;for(let ft=0,ct=at.length;ft0&&$a(Ee,Ke,fe,ye),Ae&&ne.viewport(A.copy(Ae)),Ee.length>0&&rs(Ee,fe,ye),Ke.length>0&&rs(Ke,fe,ye),Je.length>0&&rs(Je,fe,ye),ne.buffers.depth.setTest(!0),ne.buffers.depth.setMask(!0),ne.buffers.color.setMask(!0),ne.setPolygonOffset(!1)}function $a(F,fe,ye,Ae){if((ye.isScene===!0?ye.overrideMaterial:null)!==null)return;const Ke=oe.isWebGL2;Ce===null&&(Ce=new so(1,1,{generateMipmaps:!0,type:q.has("EXT_color_buffer_half_float")?Ql:pr,minFilter:io,samples:Ke?4:0})),y.getDrawingBufferSize(ue),Ke?Ce.setSize(ue.x,ue.y):Ce.setSize(lu(ue.x),lu(ue.y));const Je=y.getRenderTarget();y.setRenderTarget(Ce),y.getClearColor(Y),L=y.getClearAlpha(),L<1&&y.setClearColor(16777215,.5),y.clear();const st=y.toneMapping;y.toneMapping=ur,rs(F,ye,Ae),V.updateMultisampleRenderTarget(Ce),V.updateRenderTargetMipmap(Ce);let at=!1;for(let ft=0,ct=fe.length;ft0),pt=!!ye.morphAttributes.position,qt=!!ye.morphAttributes.normal,bn=!!ye.morphAttributes.color;let Qt=ur;Ae.toneMapped&&(w===null||w.isXRRenderTarget===!0)&&(Qt=y.toneMapping);const Rn=ye.morphAttributes.position||ye.morphAttributes.normal||ye.morphAttributes.color,Yt=Rn!==void 0?Rn.length:0,bt=we.get(Ae),Ka=E.state.lights;if(_e===!0&&(me===!0||F!==v)){const zn=F===v&&Ae.id===R;Re.setState(Ae,F,zn)}let Kt=!1;Ae.version===bt.__version?(bt.needsLights&&bt.lightsStateVersion!==Ka.state.version||bt.outputColorSpace!==st||Ee.isBatchedMesh&&bt.batching===!1||!Ee.isBatchedMesh&&bt.batching===!0||Ee.isInstancedMesh&&bt.instancing===!1||!Ee.isInstancedMesh&&bt.instancing===!0||Ee.isSkinnedMesh&&bt.skinning===!1||!Ee.isSkinnedMesh&&bt.skinning===!0||Ee.isInstancedMesh&&bt.instancingColor===!0&&Ee.instanceColor===null||Ee.isInstancedMesh&&bt.instancingColor===!1&&Ee.instanceColor!==null||bt.envMap!==at||Ae.fog===!0&&bt.fog!==Ke||bt.numClippingPlanes!==void 0&&(bt.numClippingPlanes!==Re.numPlanes||bt.numIntersection!==Re.numIntersection)||bt.vertexAlphas!==ft||bt.vertexTangents!==ct||bt.morphTargets!==pt||bt.morphNormals!==qt||bt.morphColors!==bn||bt.toneMapping!==Qt||oe.isWebGL2===!0&&bt.morphTargetsCount!==Yt)&&(Kt=!0):(Kt=!0,bt.__version=Ae.version);let as=bt.currentProgram;Kt===!0&&(as=os(Ae,fe,Ee));let gc=!1,Tr=!1,ja=!1;const fn=as.getUniforms(),ls=bt.uniforms;if(ne.useProgram(as.program)&&(gc=!0,Tr=!0,ja=!0),Ae.id!==R&&(R=Ae.id,Tr=!0),gc||v!==F){fn.setValue(M,"projectionMatrix",F.projectionMatrix),fn.setValue(M,"viewMatrix",F.matrixWorldInverse);const zn=fn.map.cameraPosition;zn!==void 0&&zn.setValue(M,Z.setFromMatrixPosition(F.matrixWorld)),oe.logarithmicDepthBuffer&&fn.setValue(M,"logDepthBufFC",2/(Math.log(F.far+1)/Math.LN2)),(Ae.isMeshPhongMaterial||Ae.isMeshToonMaterial||Ae.isMeshLambertMaterial||Ae.isMeshBasicMaterial||Ae.isMeshStandardMaterial||Ae.isShaderMaterial)&&fn.setValue(M,"isOrthographic",F.isOrthographicCamera===!0),v!==F&&(v=F,Tr=!0,ja=!0)}if(Ee.isSkinnedMesh){fn.setOptional(M,Ee,"bindMatrix"),fn.setOptional(M,Ee,"bindMatrixInverse");const zn=Ee.skeleton;zn&&(oe.floatVertexTextures?(zn.boneTexture===null&&zn.computeBoneTexture(),fn.setValue(M,"boneTexture",zn.boneTexture,V)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}Ee.isBatchedMesh&&(fn.setOptional(M,Ee,"batchingTexture"),fn.setValue(M,"batchingTexture",Ee._matricesTexture,V));const Qa=ye.morphAttributes;if((Qa.position!==void 0||Qa.normal!==void 0||Qa.color!==void 0&&oe.isWebGL2===!0)&&Ve.update(Ee,ye,as),(Tr||bt.receiveShadow!==Ee.receiveShadow)&&(bt.receiveShadow=Ee.receiveShadow,fn.setValue(M,"receiveShadow",Ee.receiveShadow)),Ae.isMeshGouraudMaterial&&Ae.envMap!==null&&(ls.envMap.value=at,ls.flipEnvMap.value=at.isCubeTexture&&at.isRenderTargetTexture===!1?-1:1),Tr&&(fn.setValue(M,"toneMappingExposure",y.toneMappingExposure),bt.needsLights&&yr(ls,ja),Ke&&Ae.fog===!0&&de.refreshFogUniforms(ls,Ke),de.refreshMaterialUniforms(ls,Ae,k,B,Ce),Nd.upload(M,vr(bt),ls,V)),Ae.isShaderMaterial&&Ae.uniformsNeedUpdate===!0&&(Nd.upload(M,vr(bt),ls,V),Ae.uniformsNeedUpdate=!1),Ae.isSpriteMaterial&&fn.setValue(M,"center",Ee.center),fn.setValue(M,"modelViewMatrix",Ee.modelViewMatrix),fn.setValue(M,"normalMatrix",Ee.normalMatrix),fn.setValue(M,"modelMatrix",Ee.matrixWorld),Ae.isShaderMaterial||Ae.isRawShaderMaterial){const zn=Ae.uniformsGroups;for(let Xa=0,ip=zn.length;Xa0&&V.useMultisampledRTT(F)===!1?Ee=we.get(F).__webglMultisampledFramebuffer:Array.isArray(ct)?Ee=ct[ye]:Ee=ct,A.copy(F.viewport),P.copy(F.scissor),U=F.scissorTest}else A.copy(W).multiplyScalar(k).floor(),P.copy(le).multiplyScalar(k).floor(),U=J;if(ne.bindFramebuffer(M.FRAMEBUFFER,Ee)&&oe.drawBuffers&&Ae&&ne.drawBuffers(F,Ee),ne.viewport(A),ne.scissor(P),ne.setScissorTest(U),Ke){const at=we.get(F.texture);M.framebufferTexture2D(M.FRAMEBUFFER,M.COLOR_ATTACHMENT0,M.TEXTURE_CUBE_MAP_POSITIVE_X+fe,at.__webglTexture,ye)}else if(Je){const at=we.get(F.texture),ft=fe||0;M.framebufferTextureLayer(M.FRAMEBUFFER,M.COLOR_ATTACHMENT0,at.__webglTexture,ye||0,ft)}R=-1},this.readRenderTargetPixels=function(F,fe,ye,Ae,Ee,Ke,Je){if(!(F&&F.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let st=we.get(F).__webglFramebuffer;if(F.isWebGLCubeRenderTarget&&Je!==void 0&&(st=st[Je]),st){ne.bindFramebuffer(M.FRAMEBUFFER,st);try{const at=F.texture,ft=at.format,ct=at.type;if(ft!==ui&&it.convert(ft)!==M.getParameter(M.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const pt=ct===Ql&&(q.has("EXT_color_buffer_half_float")||oe.isWebGL2&&q.has("EXT_color_buffer_float"));if(ct!==pr&&it.convert(ct)!==M.getParameter(M.IMPLEMENTATION_COLOR_READ_TYPE)&&!(ct===Ss&&(oe.isWebGL2||q.has("OES_texture_float")||q.has("WEBGL_color_buffer_float")))&&!pt){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}fe>=0&&fe<=F.width-Ae&&ye>=0&&ye<=F.height-Ee&&M.readPixels(fe,ye,Ae,Ee,it.convert(ft),it.convert(ct),Ke)}finally{const at=w!==null?we.get(w).__webglFramebuffer:null;ne.bindFramebuffer(M.FRAMEBUFFER,at)}}},this.copyFramebufferToTexture=function(F,fe,ye=0){const Ae=Math.pow(2,-ye),Ee=Math.floor(fe.image.width*Ae),Ke=Math.floor(fe.image.height*Ae);V.setTexture2D(fe,0),M.copyTexSubImage2D(M.TEXTURE_2D,ye,0,0,F.x,F.y,Ee,Ke),ne.unbindTexture()},this.copyTextureToTexture=function(F,fe,ye,Ae=0){const Ee=fe.image.width,Ke=fe.image.height,Je=it.convert(ye.format),st=it.convert(ye.type);V.setTexture2D(ye,0),M.pixelStorei(M.UNPACK_FLIP_Y_WEBGL,ye.flipY),M.pixelStorei(M.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ye.premultiplyAlpha),M.pixelStorei(M.UNPACK_ALIGNMENT,ye.unpackAlignment),fe.isDataTexture?M.texSubImage2D(M.TEXTURE_2D,Ae,F.x,F.y,Ee,Ke,Je,st,fe.image.data):fe.isCompressedTexture?M.compressedTexSubImage2D(M.TEXTURE_2D,Ae,F.x,F.y,fe.mipmaps[0].width,fe.mipmaps[0].height,Je,fe.mipmaps[0].data):M.texSubImage2D(M.TEXTURE_2D,Ae,F.x,F.y,Je,st,fe.image),Ae===0&&ye.generateMipmaps&&M.generateMipmap(M.TEXTURE_2D),ne.unbindTexture()},this.copyTextureToTexture3D=function(F,fe,ye,Ae,Ee=0){if(y.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Ke=F.max.x-F.min.x+1,Je=F.max.y-F.min.y+1,st=F.max.z-F.min.z+1,at=it.convert(Ae.format),ft=it.convert(Ae.type);let ct;if(Ae.isData3DTexture)V.setTexture3D(Ae,0),ct=M.TEXTURE_3D;else if(Ae.isDataArrayTexture)V.setTexture2DArray(Ae,0),ct=M.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}M.pixelStorei(M.UNPACK_FLIP_Y_WEBGL,Ae.flipY),M.pixelStorei(M.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Ae.premultiplyAlpha),M.pixelStorei(M.UNPACK_ALIGNMENT,Ae.unpackAlignment);const pt=M.getParameter(M.UNPACK_ROW_LENGTH),qt=M.getParameter(M.UNPACK_IMAGE_HEIGHT),bn=M.getParameter(M.UNPACK_SKIP_PIXELS),Qt=M.getParameter(M.UNPACK_SKIP_ROWS),Rn=M.getParameter(M.UNPACK_SKIP_IMAGES),Yt=ye.isCompressedTexture?ye.mipmaps[0]:ye.image;M.pixelStorei(M.UNPACK_ROW_LENGTH,Yt.width),M.pixelStorei(M.UNPACK_IMAGE_HEIGHT,Yt.height),M.pixelStorei(M.UNPACK_SKIP_PIXELS,F.min.x),M.pixelStorei(M.UNPACK_SKIP_ROWS,F.min.y),M.pixelStorei(M.UNPACK_SKIP_IMAGES,F.min.z),ye.isDataTexture||ye.isData3DTexture?M.texSubImage3D(ct,Ee,fe.x,fe.y,fe.z,Ke,Je,st,at,ft,Yt.data):ye.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),M.compressedTexSubImage3D(ct,Ee,fe.x,fe.y,fe.z,Ke,Je,st,at,Yt.data)):M.texSubImage3D(ct,Ee,fe.x,fe.y,fe.z,Ke,Je,st,at,ft,Yt),M.pixelStorei(M.UNPACK_ROW_LENGTH,pt),M.pixelStorei(M.UNPACK_IMAGE_HEIGHT,qt),M.pixelStorei(M.UNPACK_SKIP_PIXELS,bn),M.pixelStorei(M.UNPACK_SKIP_ROWS,Qt),M.pixelStorei(M.UNPACK_SKIP_IMAGES,Rn),Ee===0&&Ae.generateMipmaps&&M.generateMipmap(ct),ne.unbindTexture()},this.initTexture=function(F){F.isCubeTexture?V.setTextureCube(F,0):F.isData3DTexture?V.setTexture3D(F,0):F.isDataArrayTexture||F.isCompressedArrayTexture?V.setTexture2DArray(F,0):V.setTexture2D(F,0),ne.unbindTexture()},this.resetState=function(){C=0,x=0,w=null,ne.reset(),Qe.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return vs}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===Ob?"display-p3":"srgb",t.unpackColorSpace=kt.workingColorSpace===ju?"display-p3":"srgb"}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(e){console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!e}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===tn?Xr:_O}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===Xr?tn:Cn}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class qxt extends DO{}qxt.prototype.isWebGL1Renderer=!0;class Yxt extends Zt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t}}class $xt{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=qg,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Mi()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return console.warn('THREE.InterleavedBuffer: "updateRange" is deprecated and removed in r169. Use "addUpdateRange()" instead.'),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let s=0,r=this.stride;sl)continue;h.applyMatrix4(this.matrixWorld);const R=e.ray.origin.distanceTo(h);Re.far||t.push({distance:R,point:u.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}else{const g=Math.max(0,o.start),S=Math.min(E.count,o.start+o.count);for(let y=g,T=S-1;yl)continue;h.applyMatrix4(this.matrixWorld);const x=e.ray.origin.distanceTo(h);xe.far||t.push({distance:x,point:u.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;r0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;rs.far)return;r.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}class Bb extends Di{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new ut(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ut(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Nb,this.normalScale=new Rt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Us extends Bb{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Rt(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return On(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new ut(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new ut(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new ut(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class Z1 extends Di{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new ut(16777215),this.specular=new ut(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ut(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Nb,this.normalScale=new Rt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Ab,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}function _d(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function nCt(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function iCt(n){function e(s,r){return n[s]-n[r]}const t=n.length,i=new Array(t);for(let s=0;s!==t;++s)i[s]=s;return i.sort(e),i}function J1(n,e,t){const i=n.length,s=new n.constructor(i);for(let r=0,o=0;o!==i;++r){const a=t[r]*e;for(let l=0;l!==e;++l)s[o++]=n[a+l]}return s}function UO(n,e,t,i){let s=1,r=n[0];for(;r!==void 0&&r[i]===void 0;)r=n[s++];if(r===void 0)return;let o=r[i];if(o!==void 0)if(Array.isArray(o))do o=r[i],o!==void 0&&(e.push(r.time),t.push.apply(t,o)),r=n[s++];while(r!==void 0);else if(o.toArray!==void 0)do o=r[i],o!==void 0&&(e.push(r.time),o.toArray(t,t.length)),r=n[s++];while(r!==void 0);else do o=r[i],o!==void 0&&(e.push(r.time),t.push(o)),r=n[s++];while(r!==void 0)}class fc{constructor(e,t,i,s){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=s!==void 0?s:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let i=this._cachedIndex,s=t[i],r=t[i-1];e:{t:{let o;n:{i:if(!(e=r)){const a=t[1];e=r)break t}o=i,i=0;break n}break e}for(;i>>1;et;)--o;if(++o,r!==0||o!==s){r>=o&&(o=Math.max(o,1),r=o-1);const a=this.getValueSize();this.times=i.slice(r,o),this.values=this.values.slice(r*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,s=this.values,r=i.length;r===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==r;a++){const l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(s!==void 0&&nCt(s))for(let a=0,l=s.length;a!==l;++a){const c=s[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),s=this.getInterpolation()===Tm,r=e.length-1;let o=1;for(let a=1;a0){e[o]=e[r];for(let a=r*i,l=o*i,c=0;c!==i;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,s=new i(this.name,e,t);return s.createInterpolant=this.createInterpolant,s}}ss.prototype.TimeBufferType=Float32Array;ss.prototype.ValueBufferType=Float32Array;ss.prototype.DefaultInterpolation=Sa;class Ha extends ss{}Ha.prototype.ValueTypeName="bool";Ha.prototype.ValueBufferType=Array;Ha.prototype.DefaultInterpolation=Xl;Ha.prototype.InterpolantFactoryMethodLinear=void 0;Ha.prototype.InterpolantFactoryMethodSmooth=void 0;class FO extends ss{}FO.prototype.ValueTypeName="color";class Ta extends ss{}Ta.prototype.ValueTypeName="number";class aCt extends fc{constructor(e,t,i,s){super(e,t,i,s)}interpolate_(e,t,i,s){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-t)/(s-t);let c=e*a;for(let d=c+a;c!==d;c+=4)br.slerpFlat(r,0,o,c-a,o,c,l);return r}}class oo extends ss{InterpolantFactoryMethodLinear(e){return new aCt(this.times,this.values,this.getValueSize(),e)}}oo.prototype.ValueTypeName="quaternion";oo.prototype.DefaultInterpolation=Sa;oo.prototype.InterpolantFactoryMethodSmooth=void 0;class qa extends ss{}qa.prototype.ValueTypeName="string";qa.prototype.ValueBufferType=Array;qa.prototype.DefaultInterpolation=Xl;qa.prototype.InterpolantFactoryMethodLinear=void 0;qa.prototype.InterpolantFactoryMethodSmooth=void 0;class xa extends ss{}xa.prototype.ValueTypeName="vector";class lCt{constructor(e,t=-1,i,s=_St){this.name=e,this.tracks=i,this.duration=t,this.blendMode=s,this.uuid=Mi(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,s=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)t.push(dCt(i[o]).scale(s));const r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){const t=[],i=e.tracks,s={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let r=0,o=i.length;r!==o;++r)t.push(ss.toJSON(i[r]));return s}static CreateFromMorphTargetSequence(e,t,i,s){const r=t.length,o=[];for(let a=0;a1){const u=d[1];let h=s[u];h||(s[u]=h=[]),h.push(c)}}const o=[];for(const a in s)o.push(this.CreateFromMorphTargetSequence(a,s[a],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(u,h,m,f,b){if(m.length!==0){const E=[],g=[];UO(m,E,g,f),E.length!==0&&b.push(new u(h,E,g))}},s=[],r=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let u=0;u{t&&t(r),this.manager.itemEnd(e)},0),r;if(fs[e]!==void 0){fs[e].push({onLoad:t,onProgress:i,onError:s});return}fs[e]=[],fs[e].push({onLoad:t,onProgress:i,onError:s});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const d=fs[e],u=c.body.getReader(),h=c.headers.get("Content-Length")||c.headers.get("X-File-Size"),m=h?parseInt(h):0,f=m!==0;let b=0;const E=new ReadableStream({start(g){S();function S(){u.read().then(({done:y,value:T})=>{if(y)g.close();else{b+=T.byteLength;const C=new ProgressEvent("progress",{lengthComputable:f,loaded:b,total:m});for(let x=0,w=d.length;x{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(d=>new DOMParser().parseFromString(d,a));case"json":return c.json();default:if(a===void 0)return c.text();{const u=/charset="?([^;"\s]*)"?/i.exec(a),h=u&&u[1]?u[1].toLowerCase():void 0,m=new TextDecoder(h);return c.arrayBuffer().then(f=>m.decode(f))}}}).then(c=>{Ca.add(e,c);const d=fs[e];delete fs[e];for(let u=0,h=d.length;u{const d=fs[e];if(d===void 0)throw this.manager.itemError(e),c;delete fs[e];for(let u=0,h=d.length;u{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class hCt extends Ya{constructor(e){super(e)}load(e,t,i,s){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=Ca.get(e);if(o!==void 0)return r.manager.itemStart(e),setTimeout(function(){t&&t(o),r.manager.itemEnd(e)},0),o;const a=Zl("img");function l(){d(),Ca.add(e,this),t&&t(this),r.manager.itemEnd(e)}function c(u){d(),s&&s(u),r.manager.itemError(e),r.manager.itemEnd(e)}function d(){a.removeEventListener("load",l,!1),a.removeEventListener("error",c,!1)}return a.addEventListener("load",l,!1),a.addEventListener("error",c,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),r.manager.itemStart(e),a.src=e,a}}class GO extends Ya{constructor(e){super(e)}load(e,t,i,s){const r=new xn,o=new hCt(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(a){r.image=a,r.needsUpdate=!0,t!==void 0&&t(r)},i,s),r}}class Ju extends Zt{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new ut(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}const Qm=new Tt,eR=new pe,tR=new pe;class Gb{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Rt(512,512),this.map=null,this.mapPass=null,this.matrix=new Tt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Mb,this._frameExtents=new Rt(1,1),this._viewportCount=1,this._viewports=[new Ht(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,i=this.matrix;eR.setFromMatrixPosition(e.matrixWorld),t.position.copy(eR),tR.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(tR),t.updateMatrixWorld(),Qm.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Qm),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(Qm)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class fCt extends Gb{constructor(){super(new Un(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,i=va*2*e.angle*this.focus,s=this.mapSize.width/this.mapSize.height,r=e.distance||t.far;(i!==t.fov||s!==t.aspect||r!==t.far)&&(t.fov=i,t.aspect=s,t.far=r,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class mCt extends Ju{constructor(e,t,i=0,s=Math.PI/3,r=0,o=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Zt.DEFAULT_UP),this.updateMatrix(),this.target=new Zt,this.distance=i,this.angle=s,this.penumbra=r,this.decay=o,this.map=null,this.shadow=new fCt}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const nR=new Tt,pl=new pe,Xm=new pe;class gCt extends Gb{constructor(){super(new Un(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Rt(4,2),this._viewportCount=6,this._viewports=[new Ht(2,1,1,1),new Ht(0,1,1,1),new Ht(3,1,1,1),new Ht(1,1,1,1),new Ht(3,0,1,1),new Ht(1,0,1,1)],this._cubeDirections=[new pe(1,0,0),new pe(-1,0,0),new pe(0,0,1),new pe(0,0,-1),new pe(0,1,0),new pe(0,-1,0)],this._cubeUps=[new pe(0,1,0),new pe(0,1,0),new pe(0,1,0),new pe(0,1,0),new pe(0,0,1),new pe(0,0,-1)]}updateMatrices(e,t=0){const i=this.camera,s=this.matrix,r=e.distance||i.far;r!==i.far&&(i.far=r,i.updateProjectionMatrix()),pl.setFromMatrixPosition(e.matrixWorld),i.position.copy(pl),Xm.copy(i.position),Xm.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(Xm),i.updateMatrixWorld(),s.makeTranslation(-pl.x,-pl.y,-pl.z),nR.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(nR)}}class ECt extends Ju{constructor(e,t,i=0,s=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=s,this.shadow=new gCt}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class bCt extends Gb{constructor(){super(new Lb(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class VO extends Ju{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Zt.DEFAULT_UP),this.updateMatrix(),this.target=new Zt,this.shadow=new bCt}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class SCt extends Ju{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class Il{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,s=e.length;i"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,s){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=Ca.get(e);if(o!==void 0)return r.manager.itemStart(e),setTimeout(function(){t&&t(o),r.manager.itemEnd(e)},0),o;const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(l){Ca.add(e,l),t&&t(l),r.manager.itemEnd(e)}).catch(function(l){s&&s(l),r.manager.itemError(e),r.manager.itemEnd(e)}),r.manager.itemStart(e)}}const Vb="\\[\\]\\.:\\/",yCt=new RegExp("["+Vb+"]","g"),zb="[^"+Vb+"]",TCt="[^"+Vb.replace("\\.","")+"]",xCt=/((?:WC+[\/:])*)/.source.replace("WC",zb),CCt=/(WCOD+)?/.source.replace("WCOD",TCt),RCt=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",zb),ACt=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",zb),wCt=new RegExp("^"+xCt+CCt+RCt+ACt+"$"),NCt=["material","materials","bones","map"];class OCt{constructor(e,t,i){const s=i||Ft.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,s)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,s=this._bindings[i];s!==void 0&&s.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let s=this._targetGroup.nCachedObjects_,r=i.length;s!==r;++s)i[s].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class Ft{constructor(e,t,i){this.path=t,this.parsedPath=i||Ft.parseTrackName(t),this.node=Ft.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new Ft.Composite(e,t,i):new Ft(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(yCt,"")}static parseTrackName(e){const t=wCt.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},s=i.nodeName&&i.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){const r=i.nodeName.substring(s+1);NCt.indexOf(r)!==-1&&(i.nodeName=i.nodeName.substring(0,s),i.objectName=r)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(r){for(let o=0;o=2.0 are supported."));return}const c=new c1t(r,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let d=0;d=0&&a[u]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}c.setExtensions(o),c.setPlugins(a),c.parse(i,s)}parseAsync(e,t){const i=this;return new Promise(function(s,r){i.parse(e,t,s,r)})}}function MCt(){let n={};return{get:function(e){return n[e]},add:function(e,t){n[e]=t},remove:function(e){delete n[e]},removeAll:function(){n={}}}}const Ct={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class DCt{constructor(e){this.parser=e,this.name=Ct.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let i=0,s=t.length;i=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,r.source,o)}}class $Ct{constructor(e){this.parser=e,this.name=Ct.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,s=i.json,r=s.textures[e];if(!r.extensions||!r.extensions[t])return null;const o=r.extensions[t],a=s.images[o.source];let l=i.textureLoader;if(a.uri){const c=i.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return i.loadTextureImage(e,o.source,l);if(s.extensionsRequired&&s.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class WCt{constructor(e){this.parser=e,this.name=Ct.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,s=i.json,r=s.textures[e];if(!r.extensions||!r.extensions[t])return null;const o=r.extensions[t],a=s.images[o.source];let l=i.textureLoader;if(a.uri){const c=i.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return i.loadTextureImage(e,o.source,l);if(s.extensionsRequired&&s.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class KCt{constructor(e){this.name=Ct.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,i=t.bufferViews[e];if(i.extensions&&i.extensions[this.name]){const s=i.extensions[this.name],r=this.parser.getDependency("buffer",s.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return r.then(function(a){const l=s.byteOffset||0,c=s.byteLength||0,d=s.count,u=s.byteStride,h=new Uint8Array(a,l,c);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(d,u,h,s.mode,s.filter).then(function(m){return m.buffer}):o.ready.then(function(){const m=new ArrayBuffer(d*u);return o.decodeGltfBuffer(new Uint8Array(m),d,u,h,s.mode,s.filter),m})})}else return null}}class jCt{constructor(e){this.name=Ct.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,i=t.nodes[e];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const s=t.meshes[i.mesh];for(const c of s.primitives)if(c.mode!==li.TRIANGLES&&c.mode!==li.TRIANGLE_STRIP&&c.mode!==li.TRIANGLE_FAN&&c.mode!==void 0)return null;const o=i.extensions[this.name].attributes,a=[],l={};for(const c in o)a.push(this.parser.getDependency("accessor",o[c]).then(d=>(l[c]=d,l[c])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(c=>{const d=c.pop(),u=d.isGroup?d.children:[d],h=c[0].count,m=[];for(const f of u){const b=new Tt,E=new pe,g=new br,S=new pe(1,1,1),y=new Zxt(f.geometry,f.material,h);for(let T=0;T0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const l1t=new Tt;class c1t{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new MCt,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let i=!1,s=!1,r=-1;typeof navigator<"u"&&(i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,s=navigator.userAgent.indexOf("Firefox")>-1,r=s?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||i||s&&r<98?this.textureLoader=new GO(this.options.manager):this.textureLoader=new vCt(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new BO(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const i=this,s=this.json,r=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(o){const a={scene:o[0][s.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:s.asset,parser:i,userData:{}};return Mr(r,a,s),ir(a,s),Promise.all(i._invokeAll(function(l){return l.afterRoot&&l.afterRoot(a)})).then(function(){e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let s=0,r=t.length;s{const l=this.associations.get(o);l!=null&&this.associations.set(a,l);for(const[c,d]of o.children.entries())r(d,a.children[c])};return r(i,s),s.name+="_instance_"+e.uses[t]++,s}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let i=0;i=2&&E.setY(v,x[w*l+1]),l>=3&&E.setZ(v,x[w*l+2]),l>=4&&E.setW(v,x[w*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return E})}loadTexture(e){const t=this.json,i=this.options,r=t.textures[e].source,o=t.images[r];let a=this.textureLoader;if(o.uri){const l=i.manager.getHandler(o.uri);l!==null&&(a=l)}return this.loadTextureImage(e,r,a)}loadTextureImage(e,t,i){const s=this,r=this.json,o=r.textures[e],a=r.images[t],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const c=this.loadImageSource(t,i).then(function(d){d.flipY=!1,d.name=o.name||a.name||"",d.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(d.name=a.uri);const h=(r.samplers||{})[o.sampler]||{};return d.magFilter=rR[h.magFilter]||qn,d.minFilter=rR[h.minFilter]||io,d.wrapS=oR[h.wrapS]||Ea,d.wrapT=oR[h.wrapT]||Ea,s.associations.set(d,{textures:e}),d}).catch(function(){return null});return this.textureCache[l]=c,c}loadImageSource(e,t){const i=this,s=this.json,r=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(u=>u.clone());const o=s.images[e],a=self.URL||self.webkitURL;let l=o.uri||"",c=!1;if(o.bufferView!==void 0)l=i.getDependency("bufferView",o.bufferView).then(function(u){c=!0;const h=new Blob([u],{type:o.mimeType});return l=a.createObjectURL(h),l});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const d=Promise.resolve(l).then(function(u){return new Promise(function(h,m){let f=h;t.isImageBitmapLoader===!0&&(f=function(b){const E=new xn(b);E.needsUpdate=!0,h(E)}),t.load(Il.resolveURL(u,r.path),f,void 0,m)})}).then(function(u){return c===!0&&a.revokeObjectURL(l),u.userData.mimeType=o.mimeType||a1t(o.uri),u}).catch(function(u){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),u});return this.sourceCache[e]=d,d}assignTexture(e,t,i,s){const r=this;return this.getDependency("texture",i.index).then(function(o){if(!o)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(o=o.clone(),o.channel=i.texCoord),r.extensions[Ct.KHR_TEXTURE_TRANSFORM]){const a=i.extensions!==void 0?i.extensions[Ct.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const l=r.associations.get(o);o=r.extensions[Ct.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),r.associations.set(o,l)}}return s!==void 0&&(o.colorSpace=s),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let i=e.material;const s=t.attributes.tangent===void 0,r=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+i.uuid;let l=this.cache.get(a);l||(l=new PO,Di.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,l.sizeAttenuation=!1,this.cache.add(a,l)),i=l}else if(e.isLine){const a="LineBasicMaterial:"+i.uuid;let l=this.cache.get(a);l||(l=new kO,Di.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,this.cache.add(a,l)),i=l}if(s||r||o){let a="ClonedMaterial:"+i.uuid+":";s&&(a+="derivative-tangents:"),r&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=i.clone(),r&&(l.vertexColors=!0),o&&(l.flatShading=!0),s&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(i))),i=l}e.material=i}getMaterialType(){return Bb}loadMaterial(e){const t=this,i=this.json,s=this.extensions,r=i.materials[e];let o;const a={},l=r.extensions||{},c=[];if(l[Ct.KHR_MATERIALS_UNLIT]){const u=s[Ct.KHR_MATERIALS_UNLIT];o=u.getMaterialType(),c.push(u.extendParams(a,r,t))}else{const u=r.pbrMetallicRoughness||{};if(a.color=new ut(1,1,1),a.opacity=1,Array.isArray(u.baseColorFactor)){const h=u.baseColorFactor;a.color.setRGB(h[0],h[1],h[2],Cn),a.opacity=h[3]}u.baseColorTexture!==void 0&&c.push(t.assignTexture(a,"map",u.baseColorTexture,tn)),a.metalness=u.metallicFactor!==void 0?u.metallicFactor:1,a.roughness=u.roughnessFactor!==void 0?u.roughnessFactor:1,u.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(a,"metalnessMap",u.metallicRoughnessTexture)),c.push(t.assignTexture(a,"roughnessMap",u.metallicRoughnessTexture))),o=this._invokeOne(function(h){return h.getMaterialType&&h.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(h){return h.extendMaterialParams&&h.extendMaterialParams(e,a)})))}r.doubleSided===!0&&(a.side=Hi);const d=r.alphaMode||Jm.OPAQUE;if(d===Jm.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,d===Jm.MASK&&(a.alphaTest=r.alphaCutoff!==void 0?r.alphaCutoff:.5)),r.normalTexture!==void 0&&o!==ar&&(c.push(t.assignTexture(a,"normalMap",r.normalTexture)),a.normalScale=new Rt(1,1),r.normalTexture.scale!==void 0)){const u=r.normalTexture.scale;a.normalScale.set(u,u)}if(r.occlusionTexture!==void 0&&o!==ar&&(c.push(t.assignTexture(a,"aoMap",r.occlusionTexture)),r.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=r.occlusionTexture.strength)),r.emissiveFactor!==void 0&&o!==ar){const u=r.emissiveFactor;a.emissive=new ut().setRGB(u[0],u[1],u[2],Cn)}return r.emissiveTexture!==void 0&&o!==ar&&c.push(t.assignTexture(a,"emissiveMap",r.emissiveTexture,tn)),Promise.all(c).then(function(){const u=new o(a);return r.name&&(u.name=r.name),ir(u,r),t.associations.set(u,{materials:e}),r.extensions&&Mr(s,u,r),u})}createUniqueName(e){const t=Ft.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,i=this.extensions,s=this.primitiveCache;function r(a){return i[Ct.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return aR(l,a,t)})}const o=[];for(let a=0,l=e.length;a0&&r1t(g,r),g.name=t.createUniqueName(r.name||"mesh_"+e),ir(g,r),E.extensions&&Mr(s,g,E),t.assignFinalMaterial(g),u.push(g)}for(let m=0,f=u.length;m1?d=new qr:c.length===1?d=c[0]:d=new Zt,d!==c[0])for(let u=0,h=c.length;u{const u=new Map;for(const[h,m]of s.associations)(h instanceof Di||h instanceof xn)&&u.set(h,m);return d.traverse(h=>{const m=s.associations.get(h);m!=null&&u.set(h,m)}),u};return s.associations=c(r),r})}_createAnimationTracks(e,t,i,s,r){const o=[],a=e.name?e.name:e.uuid,l=[];Ws[r.path]===Ws.weights?e.traverse(function(h){h.morphTargetInfluences&&l.push(h.name?h.name:h.uuid)}):l.push(a);let c;switch(Ws[r.path]){case Ws.weights:c=Ta;break;case Ws.rotation:c=oo;break;case Ws.position:case Ws.scale:c=xa;break;default:switch(i.itemSize){case 1:c=Ta;break;case 2:case 3:default:c=xa;break}break}const d=s.interpolation!==void 0?n1t[s.interpolation]:Sa,u=this._getArrayFromAccessor(i);for(let h=0,m=l.length;h{Be.replace()})},stopVideoStream(){this.isVideoActive=!1,this.imageData=null,Ye.emit("stop_webcam_video_stream"),Fe(()=>{Be.replace()})},startDrag(n){this.isDragging=!0,this.zIndex=5001,this.dragStart.x=n.clientX,this.dragStart.y=n.clientY,document.addEventListener("mousemove",this.drag),document.addEventListener("mouseup",this.stopDrag)},drag(n){if(this.isDragging){const e=n.clientX-this.dragStart.x,t=n.clientY-this.dragStart.y;this.position.bottom-=t,this.position.right-=e,this.dragStart.x=n.clientX,this.dragStart.y=n.clientY}},stopDrag(){this.isDragging=!1,this.zIndex=0,document.removeEventListener("mousemove",this.drag),document.removeEventListener("mouseup",this.stopDrag)}},mounted(){Be.replace(),Ye.on("video_stream_image",n=>{if(this.isVideoActive){this.imageDataUrl="data:image/jpeg;base64,"+n,this.frameCount++;const e=Date.now();e-this.lastFrameTime>=1e3&&(this.frameRate=this.frameCount,this.frameCount=0,this.lastFrameTime=e)}})}},p1t=["src"],_1t=["src"],h1t={class:"controls"},f1t=_("i",{"data-feather":"video"},null,-1),m1t=[f1t],g1t=_("i",{"data-feather":"video"},null,-1),E1t=[g1t],b1t={key:2};function S1t(n,e,t,i,s,r){return O(),D("div",{class:"floating-frame bg-white",style:Xt({bottom:s.position.bottom+"px",right:s.position.right+"px","z-index":s.zIndex}),onMousedown:e[4]||(e[4]=Te((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[5]||(e[5]=Te((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},[_("div",{class:"handle",onMousedown:e[0]||(e[0]=Te((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[1]||(e[1]=Te((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},"Drag Me",32),s.isVideoActive&&s.imageDataUrl!=null?(O(),D("img",{key:0,src:s.imageDataUrl,alt:"Webcam Frame",width:"300",height:"300"},null,8,p1t)):j("",!0),s.isVideoActive&&s.imageDataUrl==null?(O(),D("p",{key:1,src:s.imageDataUrl,alt:"Webcam Frame",width:"300",height:"300"},"Loading. Please wait...",8,_1t)):j("",!0),_("div",h1t,[s.isVideoActive?j("",!0):(O(),D("button",{key:0,class:"bg-green-500 hover:bg-green-700 text-white font-bold py-2 px-4 rounded",onClick:e[2]||(e[2]=(...o)=>r.startVideoStream&&r.startVideoStream(...o))},m1t)),s.isVideoActive?(O(),D("button",{key:1,class:"bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded",onClick:e[3]||(e[3]=(...o)=>r.stopVideoStream&&r.stopVideoStream(...o))},E1t)):j("",!0),s.isVideoActive?(O(),D("span",b1t,"FPS: "+he(s.frameRate),1)):j("",!0)])],36)}const v1t=gt(u1t,[["render",S1t]]);const y1t={data(){return{isAudioActive:!1,imageDataUrl:null,isDragging:!1,position:{bottom:0,right:0},dragStart:{x:0,y:0},zIndex:0,frameRate:0,frameCount:0,lastFrameTime:Date.now()}},methods:{startAudioStream(){this.isAudioActive=!0,Ye.emit("start_audio_stream"),Fe(()=>{Be.replace()})},stopAudioStream(){this.isAudioActive=!1,this.imageDataUrl=null,Ye.emit("stop_audio_stream"),Fe(()=>{Be.replace()})},startDrag(n){this.isDragging=!0,this.zIndex=5001,this.dragStart.x=n.clientX,this.dragStart.y=n.clientY,document.addEventListener("mousemove",this.drag),document.addEventListener("mouseup",this.stopDrag)},drag(n){if(this.isDragging){const e=n.clientX-this.dragStart.x,t=n.clientY-this.dragStart.y;this.position.bottom-=t,this.position.right-=e,this.dragStart.x=n.clientX,this.dragStart.y=n.clientY}},stopDrag(){this.isDragging=!1,this.zIndex=0,document.removeEventListener("mousemove",this.drag),document.removeEventListener("mouseup",this.stopDrag)}},mounted(){Be.replace(),Ye.on("update_spectrogram",n=>{if(this.isAudioActive){this.imageDataUrl="data:image/jpeg;base64,"+n,this.frameCount++;const e=Date.now();e-this.lastFrameTime>=1e3&&(this.frameRate=this.frameCount,this.frameCount=0,this.lastFrameTime=e)}})}},T1t=["src"],x1t={class:"controls"},C1t=_("i",{"data-feather":"mic"},null,-1),R1t=[C1t],A1t=_("i",{"data-feather":"mic"},null,-1),w1t=[A1t],N1t={key:2};function O1t(n,e,t,i,s,r){return O(),D("div",{class:"floating-frame bg-white",style:Xt({bottom:s.position.bottom+"px",right:s.position.right+"px","z-index":s.zIndex}),onMousedown:e[4]||(e[4]=Te((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[5]||(e[5]=Te((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},[_("div",{class:"handle",onMousedown:e[0]||(e[0]=Te((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[1]||(e[1]=Te((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},"Drag Me",32),s.isAudioActive&&s.imageDataUrl!=null?(O(),D("img",{key:0,src:s.imageDataUrl,alt:"Spectrogram",width:"300",height:"300"},null,8,T1t)):j("",!0),_("div",x1t,[s.isAudioActive?j("",!0):(O(),D("button",{key:0,class:"bg-green-500 hover:bg-green-700 text-white font-bold py-2 px-4 rounded",onClick:e[2]||(e[2]=(...o)=>r.startAudioStream&&r.startAudioStream(...o))},R1t)),s.isAudioActive?(O(),D("button",{key:1,class:"bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded",onClick:e[3]||(e[3]=(...o)=>r.stopAudioStream&&r.stopAudioStream(...o))},w1t)):j("",!0),s.isAudioActive?(O(),D("span",N1t,"FPS: "+he(s.frameRate),1)):j("",!0)])],36)}const I1t=gt(y1t,[["render",O1t]]);const M1t={data(){return{activePersonality:null}},props:{personality:{type:Object,default:()=>({})}},components:{VideoFrame:v1t,AudioFrame:I1t},computed:{isReady:{get(){return this.$store.state.ready}}},watch:{"$store.state.mountedPersArr":"updatePersonality","$store.state.config.active_personality_id":"updatePersonality"},async mounted(){for(;this.isReady===!1;)await new Promise(n=>setTimeout(n,100));console.log("Personality:",this.personality),this.initWebGLScene(),this.updatePersonality(),Fe(()=>{Be.replace()}),this.$refs.video_frame.position={bottom:0,right:0},this.$refs.audio_frame.position={bottom:0,right:100}},beforeDestroy(){},methods:{initWebGLScene(){this.scene=new Yxt,this.camera=new Un(75,window.innerWidth/window.innerHeight,.1,1e3),this.renderer=new DO,this.renderer.setSize(window.innerWidth,window.innerHeight),this.$refs.webglContainer.appendChild(this.renderer.domElement);const n=new _r,e=new Z1({color:65280});this.cube=new Fn(n,e),this.scene.add(this.cube);const t=new SCt(4210752),i=new VO(16777215,.5);i.position.set(0,1,0),this.scene.add(t),this.scene.add(i),this.camera.position.z=5,this.animate()},updatePersonality(){const{mountedPersArr:n,config:e}=this.$store.state;this.activePersonality=n[e.active_personality_id],this.activePersonality.avatar?this.showBoxWithAvatar(this.activePersonality.avatar):this.showDefaultCube(),this.$emit("update:personality",this.activePersonality)},loadScene(n){new ICt().load(n,t=>{this.scene.remove(this.cube),this.cube=t.scene,this.scene.add(this.cube)})},showBoxWithAvatar(n){this.cube&&this.scene.remove(this.cube);const e=new _r,t=new GO().load(n),i=new ar({map:t});this.cube=new Fn(e,i),this.scene.add(this.cube)},showDefaultCube(){this.scene.remove(this.cube);const n=new _r,e=new Z1({color:65280});this.cube=new Fn(n,e),this.scene.add(this.cube)},animate(){requestAnimationFrame(this.animate),this.cube&&(this.cube.rotation.x+=.01,this.cube.rotation.y+=.01),this.renderer.render(this.scene,this.camera)}}},D1t={ref:"webglContainer"},L1t={class:"flex-col y-overflow scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},k1t={key:0,class:"text-center"},P1t={key:1,class:"text-center"},U1t={class:"floating-frame2"},F1t=["innerHTML"];function B1t(n,e,t,i,s,r){const o=_t("VideoFrame"),a=_t("AudioFrame");return O(),D($e,null,[_("div",D1t,null,512),_("div",L1t,[!s.activePersonality||!s.activePersonality.scene_path?(O(),D("div",k1t," Personality does not have a 3d avatar. ")):j("",!0),!s.activePersonality||!s.activePersonality.avatar||s.activePersonality.avatar===""?(O(),D("div",P1t," Personality does not have an avatar. ")):j("",!0),_("div",U1t,[_("div",{innerHTML:n.htmlContent},null,8,F1t)])]),Ie(o,{ref:"video_frame"},null,512),Ie(a,{ref:"audio_frame"},null,512)],64)}const G1t=gt(M1t,[["render",B1t]]);let hd;const V1t=new Uint8Array(16);function z1t(){if(!hd&&(hd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!hd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return hd(V1t)}const Sn=[];for(let n=0;n<256;++n)Sn.push((n+256).toString(16).slice(1));function H1t(n,e=0){return Sn[n[e+0]]+Sn[n[e+1]]+Sn[n[e+2]]+Sn[n[e+3]]+"-"+Sn[n[e+4]]+Sn[n[e+5]]+"-"+Sn[n[e+6]]+Sn[n[e+7]]+"-"+Sn[n[e+8]]+Sn[n[e+9]]+"-"+Sn[n[e+10]]+Sn[n[e+11]]+Sn[n[e+12]]+Sn[n[e+13]]+Sn[n[e+14]]+Sn[n[e+15]]}const q1t=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),lR={randomUUID:q1t};function Cs(n,e,t){if(lR.randomUUID&&!e&&!n)return lR.randomUUID();n=n||{};const i=n.random||(n.rng||z1t)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){t=t||0;for(let s=0;s<16;++s)e[t+s]=i[s];return e}return H1t(i)}class Zr{constructor(){this.listenerMap=new Map,this._listeners=[],this.proxyMap=new Map,this.proxies=[]}get listeners(){return this._listeners.concat(this.proxies.flatMap(e=>e()))}subscribe(e,t){this.listenerMap.has(e)&&(console.warn(`Already subscribed. Unsubscribing for you. +}`;function Lxt(n,e,t){let i=new Mb;const s=new Rt,r=new Rt,o=new Ht,a=new Oxt({depthPacking:fSt}),l=new Ixt,c={},d=t.maxTextureSize,u={[Os]:Wn,[Wn]:Os,[Hi]:Hi},h=new ro({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Rt},radius:{value:4}},vertexShader:Mxt,fragmentShader:Dxt}),m=h.clone();m.defines.HORIZONTAL_PASS=1;const f=new is;f.setAttribute("position",new Gn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const b=new Fn(f,h),E=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=nO;let g=this.type;this.render=function(C,x,w){if(E.enabled===!1||E.autoUpdate===!1&&E.needsUpdate===!1||C.length===0)return;const R=n.getRenderTarget(),v=n.getActiveCubeFace(),A=n.getActiveMipmapLevel(),P=n.state;P.setBlending(dr),P.buffers.color.setClear(1,1,1,1),P.buffers.depth.setTest(!0),P.setScissorTest(!1);const U=g!==gs&&this.type===gs,Y=g===gs&&this.type!==gs;for(let L=0,H=C.length;Ld||s.y>d)&&(s.x>d&&(r.x=Math.floor(d/$.x),s.x=r.x*$.x,k.mapSize.x=r.x),s.y>d&&(r.y=Math.floor(d/$.y),s.y=r.y*$.y,k.mapSize.y=r.y)),k.map===null||U===!0||Y===!0){const W=this.type!==gs?{minFilter:gn,magFilter:gn}:{};k.map!==null&&k.map.dispose(),k.map=new so(s.x,s.y,W),k.map.texture.name=B.name+".shadowMap",k.camera.updateProjectionMatrix()}n.setRenderTarget(k.map),n.clear();const K=k.getViewportCount();for(let W=0;W0||x.map&&x.alphaTest>0){const P=v.uuid,U=x.uuid;let Y=c[P];Y===void 0&&(Y={},c[P]=Y);let L=Y[U];L===void 0&&(L=v.clone(),Y[U]=L),v=L}if(v.visible=x.visible,v.wireframe=x.wireframe,R===gs?v.side=x.shadowSide!==null?x.shadowSide:x.side:v.side=x.shadowSide!==null?x.shadowSide:u[x.side],v.alphaMap=x.alphaMap,v.alphaTest=x.alphaTest,v.map=x.map,v.clipShadows=x.clipShadows,v.clippingPlanes=x.clippingPlanes,v.clipIntersection=x.clipIntersection,v.displacementMap=x.displacementMap,v.displacementScale=x.displacementScale,v.displacementBias=x.displacementBias,v.wireframeLinewidth=x.wireframeLinewidth,v.linewidth=x.linewidth,w.isPointLight===!0&&v.isMeshDistanceMaterial===!0){const P=n.properties.get(v);P.light=w}return v}function T(C,x,w,R,v){if(C.visible===!1)return;if(C.layers.test(x.layers)&&(C.isMesh||C.isLine||C.isPoints)&&(C.castShadow||C.receiveShadow&&v===gs)&&(!C.frustumCulled||i.intersectsObject(C))){C.modelViewMatrix.multiplyMatrices(w.matrixWorldInverse,C.matrixWorld);const U=e.update(C),Y=C.material;if(Array.isArray(Y)){const L=U.groups;for(let H=0,B=L.length;H=1):W.indexOf("OpenGL ES")!==-1&&(K=parseFloat(/^OpenGL ES (\d)/.exec(W)[1]),$=K>=2);let le=null,J={};const ee=n.getParameter(n.SCISSOR_BOX),_e=n.getParameter(n.VIEWPORT),me=new Ht().fromArray(ee),Ce=new Ht().fromArray(_e);function X(ae,qe,ke,Ne){const Pe=new Uint8Array(4),rt=n.createTexture();n.bindTexture(ae,rt),n.texParameteri(ae,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(ae,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Et=0;Et"u"?!1:/OculusBrowser/g.test(navigator.userAgent),f=new WeakMap;let b;const E=new WeakMap;let g=!1;try{g=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function S(I,N){return g?new OffscreenCanvas(I,N):Zl("canvas")}function y(I,N,z,de){let Q=1;if((I.width>de||I.height>de)&&(Q=de/Math.max(I.width,I.height)),Q<1||N===!0)if(typeof HTMLImageElement<"u"&&I instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&I instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&I instanceof ImageBitmap){const te=N?lu:Math.floor,Re=te(Q*I.width),Se=te(Q*I.height);b===void 0&&(b=S(Re,Se));const Le=z?S(Re,Se):b;return Le.width=Re,Le.height=Se,Le.getContext("2d").drawImage(I,0,0,Re,Se),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+I.width+"x"+I.height+") to ("+Re+"x"+Se+")."),Le}else return"data"in I&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+I.width+"x"+I.height+")."),I;return I}function T(I){return $g(I.width)&&$g(I.height)}function C(I){return a?!1:I.wrapS!==di||I.wrapT!==di||I.minFilter!==gn&&I.minFilter!==qn}function x(I,N){return I.generateMipmaps&&N&&I.minFilter!==gn&&I.minFilter!==qn}function w(I){n.generateMipmap(I)}function R(I,N,z,de,Q=!1){if(a===!1)return N;if(I!==null){if(n[I]!==void 0)return n[I];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+I+"'")}let te=N;if(N===n.RED&&(z===n.FLOAT&&(te=n.R32F),z===n.HALF_FLOAT&&(te=n.R16F),z===n.UNSIGNED_BYTE&&(te=n.R8)),N===n.RED_INTEGER&&(z===n.UNSIGNED_BYTE&&(te=n.R8UI),z===n.UNSIGNED_SHORT&&(te=n.R16UI),z===n.UNSIGNED_INT&&(te=n.R32UI),z===n.BYTE&&(te=n.R8I),z===n.SHORT&&(te=n.R16I),z===n.INT&&(te=n.R32I)),N===n.RG&&(z===n.FLOAT&&(te=n.RG32F),z===n.HALF_FLOAT&&(te=n.RG16F),z===n.UNSIGNED_BYTE&&(te=n.RG8)),N===n.RGBA){const Re=Q?su:kt.getTransfer(de);z===n.FLOAT&&(te=n.RGBA32F),z===n.HALF_FLOAT&&(te=n.RGBA16F),z===n.UNSIGNED_BYTE&&(te=Re===$t?n.SRGB8_ALPHA8:n.RGBA8),z===n.UNSIGNED_SHORT_4_4_4_4&&(te=n.RGBA4),z===n.UNSIGNED_SHORT_5_5_5_1&&(te=n.RGB5_A1)}return(te===n.R16F||te===n.R32F||te===n.RG16F||te===n.RG32F||te===n.RGBA16F||te===n.RGBA32F)&&e.get("EXT_color_buffer_float"),te}function v(I,N,z){return x(I,z)===!0||I.isFramebufferTexture&&I.minFilter!==gn&&I.minFilter!==qn?Math.log2(Math.max(N.width,N.height))+1:I.mipmaps!==void 0&&I.mipmaps.length>0?I.mipmaps.length:I.isCompressedTexture&&Array.isArray(I.image)?N.mipmaps.length:1}function A(I){return I===gn||I===zg||I===wd?n.NEAREST:n.LINEAR}function P(I){const N=I.target;N.removeEventListener("dispose",P),Y(N),N.isVideoTexture&&f.delete(N)}function U(I){const N=I.target;N.removeEventListener("dispose",U),H(N)}function Y(I){const N=i.get(I);if(N.__webglInit===void 0)return;const z=I.source,de=E.get(z);if(de){const Q=de[N.__cacheKey];Q.usedTimes--,Q.usedTimes===0&&L(I),Object.keys(de).length===0&&E.delete(z)}i.remove(I)}function L(I){const N=i.get(I);n.deleteTexture(N.__webglTexture);const z=I.source,de=E.get(z);delete de[N.__cacheKey],o.memory.textures--}function H(I){const N=I.texture,z=i.get(I),de=i.get(N);if(de.__webglTexture!==void 0&&(n.deleteTexture(de.__webglTexture),o.memory.textures--),I.depthTexture&&I.depthTexture.dispose(),I.isWebGLCubeRenderTarget)for(let Q=0;Q<6;Q++){if(Array.isArray(z.__webglFramebuffer[Q]))for(let te=0;te=l&&console.warn("THREE.WebGLTextures: Trying to use "+I+" texture units while this GPU supports only "+l),B+=1,I}function K(I){const N=[];return N.push(I.wrapS),N.push(I.wrapT),N.push(I.wrapR||0),N.push(I.magFilter),N.push(I.minFilter),N.push(I.anisotropy),N.push(I.internalFormat),N.push(I.format),N.push(I.type),N.push(I.generateMipmaps),N.push(I.premultiplyAlpha),N.push(I.flipY),N.push(I.unpackAlignment),N.push(I.colorSpace),N.join()}function W(I,N){const z=i.get(I);if(I.isVideoTexture&&ie(I),I.isRenderTargetTexture===!1&&I.version>0&&z.__version!==I.version){const de=I.image;if(de===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(de.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Z(z,I,N);return}}t.bindTexture(n.TEXTURE_2D,z.__webglTexture,n.TEXTURE0+N)}function le(I,N){const z=i.get(I);if(I.version>0&&z.__version!==I.version){Z(z,I,N);return}t.bindTexture(n.TEXTURE_2D_ARRAY,z.__webglTexture,n.TEXTURE0+N)}function J(I,N){const z=i.get(I);if(I.version>0&&z.__version!==I.version){Z(z,I,N);return}t.bindTexture(n.TEXTURE_3D,z.__webglTexture,n.TEXTURE0+N)}function ee(I,N){const z=i.get(I);if(I.version>0&&z.__version!==I.version){ge(z,I,N);return}t.bindTexture(n.TEXTURE_CUBE_MAP,z.__webglTexture,n.TEXTURE0+N)}const _e={[Ea]:n.REPEAT,[di]:n.CLAMP_TO_EDGE,[iu]:n.MIRRORED_REPEAT},me={[gn]:n.NEAREST,[zg]:n.NEAREST_MIPMAP_NEAREST,[wd]:n.NEAREST_MIPMAP_LINEAR,[qn]:n.LINEAR,[sO]:n.LINEAR_MIPMAP_NEAREST,[io]:n.LINEAR_MIPMAP_LINEAR},Ce={[gSt]:n.NEVER,[TSt]:n.ALWAYS,[ESt]:n.LESS,[hO]:n.LEQUAL,[bSt]:n.EQUAL,[ySt]:n.GEQUAL,[SSt]:n.GREATER,[vSt]:n.NOTEQUAL};function X(I,N,z){if(z?(n.texParameteri(I,n.TEXTURE_WRAP_S,_e[N.wrapS]),n.texParameteri(I,n.TEXTURE_WRAP_T,_e[N.wrapT]),(I===n.TEXTURE_3D||I===n.TEXTURE_2D_ARRAY)&&n.texParameteri(I,n.TEXTURE_WRAP_R,_e[N.wrapR]),n.texParameteri(I,n.TEXTURE_MAG_FILTER,me[N.magFilter]),n.texParameteri(I,n.TEXTURE_MIN_FILTER,me[N.minFilter])):(n.texParameteri(I,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(I,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),(I===n.TEXTURE_3D||I===n.TEXTURE_2D_ARRAY)&&n.texParameteri(I,n.TEXTURE_WRAP_R,n.CLAMP_TO_EDGE),(N.wrapS!==di||N.wrapT!==di)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(I,n.TEXTURE_MAG_FILTER,A(N.magFilter)),n.texParameteri(I,n.TEXTURE_MIN_FILTER,A(N.minFilter)),N.minFilter!==gn&&N.minFilter!==qn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),N.compareFunction&&(n.texParameteri(I,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(I,n.TEXTURE_COMPARE_FUNC,Ce[N.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const de=e.get("EXT_texture_filter_anisotropic");if(N.magFilter===gn||N.minFilter!==wd&&N.minFilter!==io||N.type===Ss&&e.has("OES_texture_float_linear")===!1||a===!1&&N.type===Ql&&e.has("OES_texture_half_float_linear")===!1)return;(N.anisotropy>1||i.get(N).__currentAnisotropy)&&(n.texParameterf(I,de.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(N.anisotropy,s.getMaxAnisotropy())),i.get(N).__currentAnisotropy=N.anisotropy)}}function ue(I,N){let z=!1;I.__webglInit===void 0&&(I.__webglInit=!0,N.addEventListener("dispose",P));const de=N.source;let Q=E.get(de);Q===void 0&&(Q={},E.set(de,Q));const te=K(N);if(te!==I.__cacheKey){Q[te]===void 0&&(Q[te]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,z=!0),Q[te].usedTimes++;const Re=Q[I.__cacheKey];Re!==void 0&&(Q[I.__cacheKey].usedTimes--,Re.usedTimes===0&&L(N)),I.__cacheKey=te,I.__webglTexture=Q[te].texture}return z}function Z(I,N,z){let de=n.TEXTURE_2D;(N.isDataArrayTexture||N.isCompressedArrayTexture)&&(de=n.TEXTURE_2D_ARRAY),N.isData3DTexture&&(de=n.TEXTURE_3D);const Q=ue(I,N),te=N.source;t.bindTexture(de,I.__webglTexture,n.TEXTURE0+z);const Re=i.get(te);if(te.version!==Re.__version||Q===!0){t.activeTexture(n.TEXTURE0+z);const Se=kt.getPrimaries(kt.workingColorSpace),Le=N.colorSpace===pi?null:kt.getPrimaries(N.colorSpace),Ve=N.colorSpace===pi||Se===Le?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,N.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,N.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,N.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ve);const nt=C(N)&&T(N.image)===!1;let De=y(N.image,nt,!1,d);De=re(N,De);const it=T(De)||a,Qe=r.convert(N.format,N.colorSpace);let Ge=r.convert(N.type),Ze=R(N.internalFormat,Qe,Ge,N.colorSpace,N.isVideoTexture);X(de,N,it);let We;const ht=N.mipmaps,ae=a&&N.isVideoTexture!==!0&&Ze!==uO,qe=Re.__version===void 0||Q===!0,ke=v(N,De,it);if(N.isDepthTexture)Ze=n.DEPTH_COMPONENT,a?N.type===Ss?Ze=n.DEPTH_COMPONENT32F:N.type===or?Ze=n.DEPTH_COMPONENT24:N.type===jr?Ze=n.DEPTH24_STENCIL8:Ze=n.DEPTH_COMPONENT16:N.type===Ss&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),N.format===Qr&&Ze===n.DEPTH_COMPONENT&&N.type!==wb&&N.type!==or&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),N.type=or,Ge=r.convert(N.type)),N.format===ba&&Ze===n.DEPTH_COMPONENT&&(Ze=n.DEPTH_STENCIL,N.type!==jr&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),N.type=jr,Ge=r.convert(N.type))),qe&&(ae?t.texStorage2D(n.TEXTURE_2D,1,Ze,De.width,De.height):t.texImage2D(n.TEXTURE_2D,0,Ze,De.width,De.height,0,Qe,Ge,null));else if(N.isDataTexture)if(ht.length>0&&it){ae&&qe&&t.texStorage2D(n.TEXTURE_2D,ke,Ze,ht[0].width,ht[0].height);for(let Ne=0,Pe=ht.length;Ne>=1,Pe>>=1}}else if(ht.length>0&&it){ae&&qe&&t.texStorage2D(n.TEXTURE_2D,ke,Ze,ht[0].width,ht[0].height);for(let Ne=0,Pe=ht.length;Ne0&&qe++,t.texStorage2D(n.TEXTURE_CUBE_MAP,qe,We,De[0].width,De[0].height));for(let Ne=0;Ne<6;Ne++)if(nt){ht?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ne,0,0,0,De[Ne].width,De[Ne].height,Ge,Ze,De[Ne].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ne,0,We,De[Ne].width,De[Ne].height,0,Ge,Ze,De[Ne].data);for(let Pe=0;Pe>te),De=Math.max(1,N.height>>te);Q===n.TEXTURE_3D||Q===n.TEXTURE_2D_ARRAY?t.texImage3D(Q,te,Le,nt,De,N.depth,0,Re,Se,null):t.texImage2D(Q,te,Le,nt,De,0,Re,Se,null)}t.bindFramebuffer(n.FRAMEBUFFER,I),ce(N)?h.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,de,Q,i.get(z).__webglTexture,0,V(N)):(Q===n.TEXTURE_2D||Q>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&Q<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,de,Q,i.get(z).__webglTexture,te),t.bindFramebuffer(n.FRAMEBUFFER,null)}function M(I,N,z){if(n.bindRenderbuffer(n.RENDERBUFFER,I),N.depthBuffer&&!N.stencilBuffer){let de=a===!0?n.DEPTH_COMPONENT24:n.DEPTH_COMPONENT16;if(z||ce(N)){const Q=N.depthTexture;Q&&Q.isDepthTexture&&(Q.type===Ss?de=n.DEPTH_COMPONENT32F:Q.type===or&&(de=n.DEPTH_COMPONENT24));const te=V(N);ce(N)?h.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,te,de,N.width,N.height):n.renderbufferStorageMultisample(n.RENDERBUFFER,te,de,N.width,N.height)}else n.renderbufferStorage(n.RENDERBUFFER,de,N.width,N.height);n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,I)}else if(N.depthBuffer&&N.stencilBuffer){const de=V(N);z&&ce(N)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,de,n.DEPTH24_STENCIL8,N.width,N.height):ce(N)?h.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,de,n.DEPTH24_STENCIL8,N.width,N.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,N.width,N.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,I)}else{const de=N.isWebGLMultipleRenderTargets===!0?N.texture:[N.texture];for(let Q=0;Q0){z.__webglFramebuffer[Se]=[];for(let Le=0;Le0){z.__webglFramebuffer=[];for(let Se=0;Se0&&ce(I)===!1){const Se=te?N:[N];z.__webglMultisampledFramebuffer=n.createFramebuffer(),z.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,z.__webglMultisampledFramebuffer);for(let Le=0;Le0)for(let Le=0;Le0)for(let Le=0;Le0&&ce(I)===!1){const N=I.isWebGLMultipleRenderTargets?I.texture:[I.texture],z=I.width,de=I.height;let Q=n.COLOR_BUFFER_BIT;const te=[],Re=I.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Se=i.get(I),Le=I.isWebGLMultipleRenderTargets===!0;if(Le)for(let Ve=0;Ve0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&N.__useRenderToTexture!==!1}function ie(I){const N=o.render.frame;f.get(I)!==N&&(f.set(I,N),I.update())}function re(I,N){const z=I.colorSpace,de=I.format,Q=I.type;return I.isCompressedTexture===!0||I.isVideoTexture===!0||I.format===Yg||z!==Cn&&z!==pi&&(kt.getTransfer(z)===$t?a===!1?e.has("EXT_sRGB")===!0&&de===ui?(I.format=Yg,I.minFilter=qn,I.generateMipmaps=!1):N=mO.sRGBToLinear(N):(de!==ui||Q!==pr)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",z)),N}this.allocateTextureUnit=$,this.resetTextureUnits=k,this.setTexture2D=W,this.setTexture2DArray=le,this.setTexture3D=J,this.setTextureCube=ee,this.rebindTextures=oe,this.setupRenderTarget=ne,this.updateRenderTargetMipmap=ve,this.updateMultisampleRenderTarget=we,this.setupDepthRenderbuffer=q,this.setupFrameBufferTexture=Oe,this.useMultisampledRTT=ce}function Uxt(n,e,t){const i=t.isWebGL2;function s(r,o=pi){let a;const l=kt.getTransfer(o);if(r===pr)return n.UNSIGNED_BYTE;if(r===oO)return n.UNSIGNED_SHORT_4_4_4_4;if(r===aO)return n.UNSIGNED_SHORT_5_5_5_1;if(r===sSt)return n.BYTE;if(r===rSt)return n.SHORT;if(r===wb)return n.UNSIGNED_SHORT;if(r===rO)return n.INT;if(r===or)return n.UNSIGNED_INT;if(r===Ss)return n.FLOAT;if(r===Ql)return i?n.HALF_FLOAT:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(r===oSt)return n.ALPHA;if(r===ui)return n.RGBA;if(r===aSt)return n.LUMINANCE;if(r===lSt)return n.LUMINANCE_ALPHA;if(r===Qr)return n.DEPTH_COMPONENT;if(r===ba)return n.DEPTH_STENCIL;if(r===Yg)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(r===cSt)return n.RED;if(r===lO)return n.RED_INTEGER;if(r===dSt)return n.RG;if(r===cO)return n.RG_INTEGER;if(r===dO)return n.RGBA_INTEGER;if(r===Em||r===bm||r===Sm||r===vm)if(l===$t)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(r===Em)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===bm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===Sm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===vm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(r===Em)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===bm)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===Sm)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===vm)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(r===yC||r===TC||r===xC||r===CC)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(r===yC)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===TC)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===xC)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===CC)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(r===uO)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(r===RC||r===AC)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(r===RC)return l===$t?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(r===AC)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(r===wC||r===NC||r===OC||r===IC||r===MC||r===DC||r===LC||r===kC||r===PC||r===UC||r===FC||r===BC||r===GC||r===VC)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(r===wC)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===NC)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===OC)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===IC)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===MC)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===DC)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===LC)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===kC)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===PC)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===UC)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===FC)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===BC)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===GC)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===VC)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(r===ym||r===zC||r===HC)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(r===ym)return l===$t?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(r===zC)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(r===HC)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(r===uSt||r===qC||r===YC||r===$C)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(r===ym)return a.COMPRESSED_RED_RGTC1_EXT;if(r===qC)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(r===YC)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(r===$C)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return r===jr?i?n.UNSIGNED_INT_24_8:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):n[r]!==void 0?n[r]:null}return{convert:s}}class Fxt extends Un{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class qr extends Zt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Bxt={type:"move"};class $m{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new qr,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new qr,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new pe,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new pe),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new qr,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new pe,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new pe),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let s=null,r=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){o=!0;for(const b of e.hand.values()){const E=t.getJointPose(b,i),g=this._getHandJoint(c,b);E!==null&&(g.matrix.fromArray(E.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,g.jointRadius=E.radius),g.visible=E!==null}const d=c.joints["index-finger-tip"],u=c.joints["thumb-tip"],h=d.position.distanceTo(u.position),m=.02,f=.005;c.inputState.pinching&&h>m+f?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&h<=m-f&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(r=t.getPose(e.gripSpace,i),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(s=t.getPose(e.targetRaySpace,i),s===null&&r!==null&&(s=r),s!==null&&(a.matrix.fromArray(s.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,s.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(s.linearVelocity)):a.hasLinearVelocity=!1,s.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(s.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(Bxt)))}return a!==null&&(a.visible=s!==null),l!==null&&(l.visible=r!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new qr;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}class Gxt extends Va{constructor(e,t){super();const i=this;let s=null,r=1,o=null,a="local-floor",l=1,c=null,d=null,u=null,h=null,m=null,f=null;const b=t.getContextAttributes();let E=null,g=null;const S=[],y=[],T=new Rt;let C=null;const x=new Un;x.layers.enable(1),x.viewport=new Ht;const w=new Un;w.layers.enable(2),w.viewport=new Ht;const R=[x,w],v=new Fxt;v.layers.enable(1),v.layers.enable(2);let A=null,P=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ee){let _e=S[ee];return _e===void 0&&(_e=new $m,S[ee]=_e),_e.getTargetRaySpace()},this.getControllerGrip=function(ee){let _e=S[ee];return _e===void 0&&(_e=new $m,S[ee]=_e),_e.getGripSpace()},this.getHand=function(ee){let _e=S[ee];return _e===void 0&&(_e=new $m,S[ee]=_e),_e.getHandSpace()};function U(ee){const _e=y.indexOf(ee.inputSource);if(_e===-1)return;const me=S[_e];me!==void 0&&(me.update(ee.inputSource,ee.frame,c||o),me.dispatchEvent({type:ee.type,data:ee.inputSource}))}function Y(){s.removeEventListener("select",U),s.removeEventListener("selectstart",U),s.removeEventListener("selectend",U),s.removeEventListener("squeeze",U),s.removeEventListener("squeezestart",U),s.removeEventListener("squeezeend",U),s.removeEventListener("end",Y),s.removeEventListener("inputsourceschange",L);for(let ee=0;ee=0&&(y[Ce]=null,S[Ce].disconnect(me))}for(let _e=0;_e=y.length){y.push(me),Ce=ue;break}else if(y[ue]===null){y[ue]=me,Ce=ue;break}if(Ce===-1)break}const X=S[Ce];X&&X.connect(me)}}const H=new pe,B=new pe;function k(ee,_e,me){H.setFromMatrixPosition(_e.matrixWorld),B.setFromMatrixPosition(me.matrixWorld);const Ce=H.distanceTo(B),X=_e.projectionMatrix.elements,ue=me.projectionMatrix.elements,Z=X[14]/(X[10]-1),ge=X[14]/(X[10]+1),Oe=(X[9]+1)/X[5],M=(X[9]-1)/X[5],G=(X[8]-1)/X[0],q=(ue[8]+1)/ue[0],oe=Z*G,ne=Z*q,ve=Ce/(-G+q),we=ve*-G;_e.matrixWorld.decompose(ee.position,ee.quaternion,ee.scale),ee.translateX(we),ee.translateZ(ve),ee.matrixWorld.compose(ee.position,ee.quaternion,ee.scale),ee.matrixWorldInverse.copy(ee.matrixWorld).invert();const V=Z+ve,ce=ge+ve,ie=oe-we,re=ne+(Ce-we),I=Oe*ge/ce*V,N=M*ge/ce*V;ee.projectionMatrix.makePerspective(ie,re,I,N,V,ce),ee.projectionMatrixInverse.copy(ee.projectionMatrix).invert()}function $(ee,_e){_e===null?ee.matrixWorld.copy(ee.matrix):ee.matrixWorld.multiplyMatrices(_e.matrixWorld,ee.matrix),ee.matrixWorldInverse.copy(ee.matrixWorld).invert()}this.updateCamera=function(ee){if(s===null)return;v.near=w.near=x.near=ee.near,v.far=w.far=x.far=ee.far,(A!==v.near||P!==v.far)&&(s.updateRenderState({depthNear:v.near,depthFar:v.far}),A=v.near,P=v.far);const _e=ee.parent,me=v.cameras;$(v,_e);for(let Ce=0;Ce0&&(E.alphaTest.value=g.alphaTest);const S=e.get(g).envMap;if(S&&(E.envMap.value=S,E.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,E.reflectivity.value=g.reflectivity,E.ior.value=g.ior,E.refractionRatio.value=g.refractionRatio),g.lightMap){E.lightMap.value=g.lightMap;const y=n._useLegacyLights===!0?Math.PI:1;E.lightMapIntensity.value=g.lightMapIntensity*y,t(g.lightMap,E.lightMapTransform)}g.aoMap&&(E.aoMap.value=g.aoMap,E.aoMapIntensity.value=g.aoMapIntensity,t(g.aoMap,E.aoMapTransform))}function o(E,g){E.diffuse.value.copy(g.color),E.opacity.value=g.opacity,g.map&&(E.map.value=g.map,t(g.map,E.mapTransform))}function a(E,g){E.dashSize.value=g.dashSize,E.totalSize.value=g.dashSize+g.gapSize,E.scale.value=g.scale}function l(E,g,S,y){E.diffuse.value.copy(g.color),E.opacity.value=g.opacity,E.size.value=g.size*S,E.scale.value=y*.5,g.map&&(E.map.value=g.map,t(g.map,E.uvTransform)),g.alphaMap&&(E.alphaMap.value=g.alphaMap,t(g.alphaMap,E.alphaMapTransform)),g.alphaTest>0&&(E.alphaTest.value=g.alphaTest)}function c(E,g){E.diffuse.value.copy(g.color),E.opacity.value=g.opacity,E.rotation.value=g.rotation,g.map&&(E.map.value=g.map,t(g.map,E.mapTransform)),g.alphaMap&&(E.alphaMap.value=g.alphaMap,t(g.alphaMap,E.alphaMapTransform)),g.alphaTest>0&&(E.alphaTest.value=g.alphaTest)}function d(E,g){E.specular.value.copy(g.specular),E.shininess.value=Math.max(g.shininess,1e-4)}function u(E,g){g.gradientMap&&(E.gradientMap.value=g.gradientMap)}function h(E,g){E.metalness.value=g.metalness,g.metalnessMap&&(E.metalnessMap.value=g.metalnessMap,t(g.metalnessMap,E.metalnessMapTransform)),E.roughness.value=g.roughness,g.roughnessMap&&(E.roughnessMap.value=g.roughnessMap,t(g.roughnessMap,E.roughnessMapTransform)),e.get(g).envMap&&(E.envMapIntensity.value=g.envMapIntensity)}function m(E,g,S){E.ior.value=g.ior,g.sheen>0&&(E.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),E.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(E.sheenColorMap.value=g.sheenColorMap,t(g.sheenColorMap,E.sheenColorMapTransform)),g.sheenRoughnessMap&&(E.sheenRoughnessMap.value=g.sheenRoughnessMap,t(g.sheenRoughnessMap,E.sheenRoughnessMapTransform))),g.clearcoat>0&&(E.clearcoat.value=g.clearcoat,E.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(E.clearcoatMap.value=g.clearcoatMap,t(g.clearcoatMap,E.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(E.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,t(g.clearcoatRoughnessMap,E.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(E.clearcoatNormalMap.value=g.clearcoatNormalMap,t(g.clearcoatNormalMap,E.clearcoatNormalMapTransform),E.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===Wn&&E.clearcoatNormalScale.value.negate())),g.iridescence>0&&(E.iridescence.value=g.iridescence,E.iridescenceIOR.value=g.iridescenceIOR,E.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],E.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(E.iridescenceMap.value=g.iridescenceMap,t(g.iridescenceMap,E.iridescenceMapTransform)),g.iridescenceThicknessMap&&(E.iridescenceThicknessMap.value=g.iridescenceThicknessMap,t(g.iridescenceThicknessMap,E.iridescenceThicknessMapTransform))),g.transmission>0&&(E.transmission.value=g.transmission,E.transmissionSamplerMap.value=S.texture,E.transmissionSamplerSize.value.set(S.width,S.height),g.transmissionMap&&(E.transmissionMap.value=g.transmissionMap,t(g.transmissionMap,E.transmissionMapTransform)),E.thickness.value=g.thickness,g.thicknessMap&&(E.thicknessMap.value=g.thicknessMap,t(g.thicknessMap,E.thicknessMapTransform)),E.attenuationDistance.value=g.attenuationDistance,E.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(E.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(E.anisotropyMap.value=g.anisotropyMap,t(g.anisotropyMap,E.anisotropyMapTransform))),E.specularIntensity.value=g.specularIntensity,E.specularColor.value.copy(g.specularColor),g.specularColorMap&&(E.specularColorMap.value=g.specularColorMap,t(g.specularColorMap,E.specularColorMapTransform)),g.specularIntensityMap&&(E.specularIntensityMap.value=g.specularIntensityMap,t(g.specularIntensityMap,E.specularIntensityMapTransform))}function f(E,g){g.matcap&&(E.matcap.value=g.matcap)}function b(E,g){const S=e.get(g).light;E.referencePosition.value.setFromMatrixPosition(S.matrixWorld),E.nearDistance.value=S.shadow.camera.near,E.farDistance.value=S.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:s}}function zxt(n,e,t,i){let s={},r={},o=[];const a=t.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(S,y){const T=y.program;i.uniformBlockBinding(S,T)}function c(S,y){let T=s[S.id];T===void 0&&(f(S),T=d(S),s[S.id]=T,S.addEventListener("dispose",E));const C=y.program;i.updateUBOMapping(S,C);const x=e.render.frame;r[S.id]!==x&&(h(S),r[S.id]=x)}function d(S){const y=u();S.__bindingPointIndex=y;const T=n.createBuffer(),C=S.__size,x=S.usage;return n.bindBuffer(n.UNIFORM_BUFFER,T),n.bufferData(n.UNIFORM_BUFFER,C,x),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,y,T),T}function u(){for(let S=0;S0){x=T%C;const U=C-x;x!==0&&U-A.boundary<0&&(T+=C-x,v.__offset=T)}T+=A.storage}return x=T%C,x>0&&(T+=C-x),S.__size=T,S.__cache={},this}function b(S){const y={boundary:0,storage:0};return typeof S=="number"?(y.boundary=4,y.storage=4):S.isVector2?(y.boundary=8,y.storage=8):S.isVector3||S.isColor?(y.boundary=16,y.storage=12):S.isVector4?(y.boundary=16,y.storage=16):S.isMatrix3?(y.boundary=48,y.storage=48):S.isMatrix4?(y.boundary=64,y.storage=64):S.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",S),y}function E(S){const y=S.target;y.removeEventListener("dispose",E);const T=o.indexOf(y.__bindingPointIndex);o.splice(T,1),n.deleteBuffer(s[y.id]),delete s[y.id],delete r[y.id]}function g(){for(const S in s)n.deleteBuffer(s[S]);o=[],s={},r={}}return{bind:l,update:c,dispose:g}}class DO{constructor(e={}){const{canvas:t=BSt(),context:i=null,depth:s=!0,stencil:r=!0,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:d="default",failIfMajorPerformanceCaveat:u=!1}=e;this.isWebGLRenderer=!0;let h;i!==null?h=i.getContextAttributes().alpha:h=o;const m=new Uint32Array(4),f=new Int32Array(4);let b=null,E=null;const g=[],S=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=tn,this._useLegacyLights=!1,this.toneMapping=ur,this.toneMappingExposure=1;const y=this;let T=!1,C=0,x=0,w=null,R=-1,v=null;const A=new Ht,P=new Ht;let U=null;const Y=new ut(0);let L=0,H=t.width,B=t.height,k=1,$=null,K=null;const W=new Ht(0,0,H,B),le=new Ht(0,0,H,B);let J=!1;const ee=new Mb;let _e=!1,me=!1,Ce=null;const X=new Tt,ue=new Rt,Z=new pe,ge={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Oe(){return w===null?k:1}let M=i;function G(F,fe){for(let ye=0;ye{function Ke(){if(Ae.forEach(function(Je){we.get(Je).currentProgram.isReady()&&Ae.delete(Je)}),Ae.size===0){Ee(F);return}setTimeout(Ke,10)}q.get("KHR_parallel_shader_compile")!==null?Ke():setTimeout(Ke,10)})};let Et=null;function en(F){Et&&Et(F)}function dn(){jt.stop()}function Lt(){jt.start()}const jt=new RO;jt.setAnimationLoop(en),typeof self<"u"&&jt.setContext(self),this.setAnimationLoop=function(F){Et=F,We.setAnimationLoop(F),F===null?jt.stop():jt.start()},We.addEventListener("sessionstart",dn),We.addEventListener("sessionend",Lt),this.render=function(F,fe){if(fe!==void 0&&fe.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(T===!0)return;F.matrixWorldAutoUpdate===!0&&F.updateMatrixWorld(),fe.parent===null&&fe.matrixWorldAutoUpdate===!0&&fe.updateMatrixWorld(),We.enabled===!0&&We.isPresenting===!0&&(We.cameraAutoUpdate===!0&&We.updateCamera(fe),fe=We.getCamera()),F.isScene===!0&&F.onBeforeRender(y,F,fe,w),E=te.get(F,S.length),E.init(),S.push(E),X.multiplyMatrices(fe.projectionMatrix,fe.matrixWorldInverse),ee.setFromProjectionMatrix(X),me=this.localClippingEnabled,_e=Re.init(this.clippingPlanes,me),b=Q.get(F,g.length),b.init(),g.push(b),Vn(F,fe,0,y.sortObjects),b.finish(),y.sortObjects===!0&&b.sort($,K),this.info.render.frame++,_e===!0&&Re.beginShadows();const ye=E.state.shadowsArray;if(Se.render(ye,F,fe),_e===!0&&Re.endShadows(),this.info.autoReset===!0&&this.info.reset(),Le.render(b,F),E.setupLights(y._useLegacyLights),fe.isArrayCamera){const Ae=fe.cameras;for(let Ee=0,Ke=Ae.length;Ee0?E=S[S.length-1]:E=null,g.pop(),g.length>0?b=g[g.length-1]:b=null};function Vn(F,fe,ye,Ae){if(F.visible===!1)return;if(F.layers.test(fe.layers)){if(F.isGroup)ye=F.renderOrder;else if(F.isLOD)F.autoUpdate===!0&&F.update(fe);else if(F.isLight)E.pushLight(F),F.castShadow&&E.pushShadow(F);else if(F.isSprite){if(!F.frustumCulled||ee.intersectsSprite(F)){Ae&&Z.setFromMatrixPosition(F.matrixWorld).applyMatrix4(X);const Je=N.update(F),st=F.material;st.visible&&b.push(F,Je,st,ye,Z.z,null)}}else if((F.isMesh||F.isLine||F.isPoints)&&(!F.frustumCulled||ee.intersectsObject(F))){const Je=N.update(F),st=F.material;if(Ae&&(F.boundingSphere!==void 0?(F.boundingSphere===null&&F.computeBoundingSphere(),Z.copy(F.boundingSphere.center)):(Je.boundingSphere===null&&Je.computeBoundingSphere(),Z.copy(Je.boundingSphere.center)),Z.applyMatrix4(F.matrixWorld).applyMatrix4(X)),Array.isArray(st)){const at=Je.groups;for(let ft=0,ct=at.length;ft0&&$a(Ee,Ke,fe,ye),Ae&&ne.viewport(A.copy(Ae)),Ee.length>0&&rs(Ee,fe,ye),Ke.length>0&&rs(Ke,fe,ye),Je.length>0&&rs(Je,fe,ye),ne.buffers.depth.setTest(!0),ne.buffers.depth.setMask(!0),ne.buffers.color.setMask(!0),ne.setPolygonOffset(!1)}function $a(F,fe,ye,Ae){if((ye.isScene===!0?ye.overrideMaterial:null)!==null)return;const Ke=oe.isWebGL2;Ce===null&&(Ce=new so(1,1,{generateMipmaps:!0,type:q.has("EXT_color_buffer_half_float")?Ql:pr,minFilter:io,samples:Ke?4:0})),y.getDrawingBufferSize(ue),Ke?Ce.setSize(ue.x,ue.y):Ce.setSize(lu(ue.x),lu(ue.y));const Je=y.getRenderTarget();y.setRenderTarget(Ce),y.getClearColor(Y),L=y.getClearAlpha(),L<1&&y.setClearColor(16777215,.5),y.clear();const st=y.toneMapping;y.toneMapping=ur,rs(F,ye,Ae),V.updateMultisampleRenderTarget(Ce),V.updateRenderTargetMipmap(Ce);let at=!1;for(let ft=0,ct=fe.length;ft0),pt=!!ye.morphAttributes.position,qt=!!ye.morphAttributes.normal,bn=!!ye.morphAttributes.color;let Qt=ur;Ae.toneMapped&&(w===null||w.isXRRenderTarget===!0)&&(Qt=y.toneMapping);const Rn=ye.morphAttributes.position||ye.morphAttributes.normal||ye.morphAttributes.color,Yt=Rn!==void 0?Rn.length:0,bt=we.get(Ae),Ka=E.state.lights;if(_e===!0&&(me===!0||F!==v)){const zn=F===v&&Ae.id===R;Re.setState(Ae,F,zn)}let Kt=!1;Ae.version===bt.__version?(bt.needsLights&&bt.lightsStateVersion!==Ka.state.version||bt.outputColorSpace!==st||Ee.isBatchedMesh&&bt.batching===!1||!Ee.isBatchedMesh&&bt.batching===!0||Ee.isInstancedMesh&&bt.instancing===!1||!Ee.isInstancedMesh&&bt.instancing===!0||Ee.isSkinnedMesh&&bt.skinning===!1||!Ee.isSkinnedMesh&&bt.skinning===!0||Ee.isInstancedMesh&&bt.instancingColor===!0&&Ee.instanceColor===null||Ee.isInstancedMesh&&bt.instancingColor===!1&&Ee.instanceColor!==null||bt.envMap!==at||Ae.fog===!0&&bt.fog!==Ke||bt.numClippingPlanes!==void 0&&(bt.numClippingPlanes!==Re.numPlanes||bt.numIntersection!==Re.numIntersection)||bt.vertexAlphas!==ft||bt.vertexTangents!==ct||bt.morphTargets!==pt||bt.morphNormals!==qt||bt.morphColors!==bn||bt.toneMapping!==Qt||oe.isWebGL2===!0&&bt.morphTargetsCount!==Yt)&&(Kt=!0):(Kt=!0,bt.__version=Ae.version);let as=bt.currentProgram;Kt===!0&&(as=os(Ae,fe,Ee));let gc=!1,Tr=!1,ja=!1;const fn=as.getUniforms(),ls=bt.uniforms;if(ne.useProgram(as.program)&&(gc=!0,Tr=!0,ja=!0),Ae.id!==R&&(R=Ae.id,Tr=!0),gc||v!==F){fn.setValue(M,"projectionMatrix",F.projectionMatrix),fn.setValue(M,"viewMatrix",F.matrixWorldInverse);const zn=fn.map.cameraPosition;zn!==void 0&&zn.setValue(M,Z.setFromMatrixPosition(F.matrixWorld)),oe.logarithmicDepthBuffer&&fn.setValue(M,"logDepthBufFC",2/(Math.log(F.far+1)/Math.LN2)),(Ae.isMeshPhongMaterial||Ae.isMeshToonMaterial||Ae.isMeshLambertMaterial||Ae.isMeshBasicMaterial||Ae.isMeshStandardMaterial||Ae.isShaderMaterial)&&fn.setValue(M,"isOrthographic",F.isOrthographicCamera===!0),v!==F&&(v=F,Tr=!0,ja=!0)}if(Ee.isSkinnedMesh){fn.setOptional(M,Ee,"bindMatrix"),fn.setOptional(M,Ee,"bindMatrixInverse");const zn=Ee.skeleton;zn&&(oe.floatVertexTextures?(zn.boneTexture===null&&zn.computeBoneTexture(),fn.setValue(M,"boneTexture",zn.boneTexture,V)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}Ee.isBatchedMesh&&(fn.setOptional(M,Ee,"batchingTexture"),fn.setValue(M,"batchingTexture",Ee._matricesTexture,V));const Qa=ye.morphAttributes;if((Qa.position!==void 0||Qa.normal!==void 0||Qa.color!==void 0&&oe.isWebGL2===!0)&&Ve.update(Ee,ye,as),(Tr||bt.receiveShadow!==Ee.receiveShadow)&&(bt.receiveShadow=Ee.receiveShadow,fn.setValue(M,"receiveShadow",Ee.receiveShadow)),Ae.isMeshGouraudMaterial&&Ae.envMap!==null&&(ls.envMap.value=at,ls.flipEnvMap.value=at.isCubeTexture&&at.isRenderTargetTexture===!1?-1:1),Tr&&(fn.setValue(M,"toneMappingExposure",y.toneMappingExposure),bt.needsLights&&yr(ls,ja),Ke&&Ae.fog===!0&&de.refreshFogUniforms(ls,Ke),de.refreshMaterialUniforms(ls,Ae,k,B,Ce),Nd.upload(M,vr(bt),ls,V)),Ae.isShaderMaterial&&Ae.uniformsNeedUpdate===!0&&(Nd.upload(M,vr(bt),ls,V),Ae.uniformsNeedUpdate=!1),Ae.isSpriteMaterial&&fn.setValue(M,"center",Ee.center),fn.setValue(M,"modelViewMatrix",Ee.modelViewMatrix),fn.setValue(M,"normalMatrix",Ee.normalMatrix),fn.setValue(M,"modelMatrix",Ee.matrixWorld),Ae.isShaderMaterial||Ae.isRawShaderMaterial){const zn=Ae.uniformsGroups;for(let Xa=0,ip=zn.length;Xa0&&V.useMultisampledRTT(F)===!1?Ee=we.get(F).__webglMultisampledFramebuffer:Array.isArray(ct)?Ee=ct[ye]:Ee=ct,A.copy(F.viewport),P.copy(F.scissor),U=F.scissorTest}else A.copy(W).multiplyScalar(k).floor(),P.copy(le).multiplyScalar(k).floor(),U=J;if(ne.bindFramebuffer(M.FRAMEBUFFER,Ee)&&oe.drawBuffers&&Ae&&ne.drawBuffers(F,Ee),ne.viewport(A),ne.scissor(P),ne.setScissorTest(U),Ke){const at=we.get(F.texture);M.framebufferTexture2D(M.FRAMEBUFFER,M.COLOR_ATTACHMENT0,M.TEXTURE_CUBE_MAP_POSITIVE_X+fe,at.__webglTexture,ye)}else if(Je){const at=we.get(F.texture),ft=fe||0;M.framebufferTextureLayer(M.FRAMEBUFFER,M.COLOR_ATTACHMENT0,at.__webglTexture,ye||0,ft)}R=-1},this.readRenderTargetPixels=function(F,fe,ye,Ae,Ee,Ke,Je){if(!(F&&F.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let st=we.get(F).__webglFramebuffer;if(F.isWebGLCubeRenderTarget&&Je!==void 0&&(st=st[Je]),st){ne.bindFramebuffer(M.FRAMEBUFFER,st);try{const at=F.texture,ft=at.format,ct=at.type;if(ft!==ui&&it.convert(ft)!==M.getParameter(M.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const pt=ct===Ql&&(q.has("EXT_color_buffer_half_float")||oe.isWebGL2&&q.has("EXT_color_buffer_float"));if(ct!==pr&&it.convert(ct)!==M.getParameter(M.IMPLEMENTATION_COLOR_READ_TYPE)&&!(ct===Ss&&(oe.isWebGL2||q.has("OES_texture_float")||q.has("WEBGL_color_buffer_float")))&&!pt){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}fe>=0&&fe<=F.width-Ae&&ye>=0&&ye<=F.height-Ee&&M.readPixels(fe,ye,Ae,Ee,it.convert(ft),it.convert(ct),Ke)}finally{const at=w!==null?we.get(w).__webglFramebuffer:null;ne.bindFramebuffer(M.FRAMEBUFFER,at)}}},this.copyFramebufferToTexture=function(F,fe,ye=0){const Ae=Math.pow(2,-ye),Ee=Math.floor(fe.image.width*Ae),Ke=Math.floor(fe.image.height*Ae);V.setTexture2D(fe,0),M.copyTexSubImage2D(M.TEXTURE_2D,ye,0,0,F.x,F.y,Ee,Ke),ne.unbindTexture()},this.copyTextureToTexture=function(F,fe,ye,Ae=0){const Ee=fe.image.width,Ke=fe.image.height,Je=it.convert(ye.format),st=it.convert(ye.type);V.setTexture2D(ye,0),M.pixelStorei(M.UNPACK_FLIP_Y_WEBGL,ye.flipY),M.pixelStorei(M.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ye.premultiplyAlpha),M.pixelStorei(M.UNPACK_ALIGNMENT,ye.unpackAlignment),fe.isDataTexture?M.texSubImage2D(M.TEXTURE_2D,Ae,F.x,F.y,Ee,Ke,Je,st,fe.image.data):fe.isCompressedTexture?M.compressedTexSubImage2D(M.TEXTURE_2D,Ae,F.x,F.y,fe.mipmaps[0].width,fe.mipmaps[0].height,Je,fe.mipmaps[0].data):M.texSubImage2D(M.TEXTURE_2D,Ae,F.x,F.y,Je,st,fe.image),Ae===0&&ye.generateMipmaps&&M.generateMipmap(M.TEXTURE_2D),ne.unbindTexture()},this.copyTextureToTexture3D=function(F,fe,ye,Ae,Ee=0){if(y.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Ke=F.max.x-F.min.x+1,Je=F.max.y-F.min.y+1,st=F.max.z-F.min.z+1,at=it.convert(Ae.format),ft=it.convert(Ae.type);let ct;if(Ae.isData3DTexture)V.setTexture3D(Ae,0),ct=M.TEXTURE_3D;else if(Ae.isDataArrayTexture)V.setTexture2DArray(Ae,0),ct=M.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}M.pixelStorei(M.UNPACK_FLIP_Y_WEBGL,Ae.flipY),M.pixelStorei(M.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Ae.premultiplyAlpha),M.pixelStorei(M.UNPACK_ALIGNMENT,Ae.unpackAlignment);const pt=M.getParameter(M.UNPACK_ROW_LENGTH),qt=M.getParameter(M.UNPACK_IMAGE_HEIGHT),bn=M.getParameter(M.UNPACK_SKIP_PIXELS),Qt=M.getParameter(M.UNPACK_SKIP_ROWS),Rn=M.getParameter(M.UNPACK_SKIP_IMAGES),Yt=ye.isCompressedTexture?ye.mipmaps[0]:ye.image;M.pixelStorei(M.UNPACK_ROW_LENGTH,Yt.width),M.pixelStorei(M.UNPACK_IMAGE_HEIGHT,Yt.height),M.pixelStorei(M.UNPACK_SKIP_PIXELS,F.min.x),M.pixelStorei(M.UNPACK_SKIP_ROWS,F.min.y),M.pixelStorei(M.UNPACK_SKIP_IMAGES,F.min.z),ye.isDataTexture||ye.isData3DTexture?M.texSubImage3D(ct,Ee,fe.x,fe.y,fe.z,Ke,Je,st,at,ft,Yt.data):ye.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),M.compressedTexSubImage3D(ct,Ee,fe.x,fe.y,fe.z,Ke,Je,st,at,Yt.data)):M.texSubImage3D(ct,Ee,fe.x,fe.y,fe.z,Ke,Je,st,at,ft,Yt),M.pixelStorei(M.UNPACK_ROW_LENGTH,pt),M.pixelStorei(M.UNPACK_IMAGE_HEIGHT,qt),M.pixelStorei(M.UNPACK_SKIP_PIXELS,bn),M.pixelStorei(M.UNPACK_SKIP_ROWS,Qt),M.pixelStorei(M.UNPACK_SKIP_IMAGES,Rn),Ee===0&&Ae.generateMipmaps&&M.generateMipmap(ct),ne.unbindTexture()},this.initTexture=function(F){F.isCubeTexture?V.setTextureCube(F,0):F.isData3DTexture?V.setTexture3D(F,0):F.isDataArrayTexture||F.isCompressedArrayTexture?V.setTexture2DArray(F,0):V.setTexture2D(F,0),ne.unbindTexture()},this.resetState=function(){C=0,x=0,w=null,ne.reset(),Qe.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return vs}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===Ob?"display-p3":"srgb",t.unpackColorSpace=kt.workingColorSpace===ju?"display-p3":"srgb"}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(e){console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!e}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===tn?Xr:_O}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===Xr?tn:Cn}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class Hxt extends DO{}Hxt.prototype.isWebGL1Renderer=!0;class qxt extends Zt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t}}class Yxt{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=qg,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Mi()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return console.warn('THREE.InterleavedBuffer: "updateRange" is deprecated and removed in r169. Use "addUpdateRange()" instead.'),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let s=0,r=this.stride;sl)continue;h.applyMatrix4(this.matrixWorld);const R=e.ray.origin.distanceTo(h);Re.far||t.push({distance:R,point:u.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}else{const g=Math.max(0,o.start),S=Math.min(E.count,o.start+o.count);for(let y=g,T=S-1;yl)continue;h.applyMatrix4(this.matrixWorld);const x=e.ray.origin.distanceTo(h);xe.far||t.push({distance:x,point:u.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;r0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;rs.far)return;r.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}class Bb extends Di{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new ut(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ut(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Nb,this.normalScale=new Rt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Us extends Bb{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Rt(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return On(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new ut(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new ut(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new ut(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class Z1 extends Di{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new ut(16777215),this.specular=new ut(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ut(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Nb,this.normalScale=new Rt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Ab,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}function _d(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function tCt(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function nCt(n){function e(s,r){return n[s]-n[r]}const t=n.length,i=new Array(t);for(let s=0;s!==t;++s)i[s]=s;return i.sort(e),i}function J1(n,e,t){const i=n.length,s=new n.constructor(i);for(let r=0,o=0;o!==i;++r){const a=t[r]*e;for(let l=0;l!==e;++l)s[o++]=n[a+l]}return s}function UO(n,e,t,i){let s=1,r=n[0];for(;r!==void 0&&r[i]===void 0;)r=n[s++];if(r===void 0)return;let o=r[i];if(o!==void 0)if(Array.isArray(o))do o=r[i],o!==void 0&&(e.push(r.time),t.push.apply(t,o)),r=n[s++];while(r!==void 0);else if(o.toArray!==void 0)do o=r[i],o!==void 0&&(e.push(r.time),o.toArray(t,t.length)),r=n[s++];while(r!==void 0);else do o=r[i],o!==void 0&&(e.push(r.time),t.push(o)),r=n[s++];while(r!==void 0)}class fc{constructor(e,t,i,s){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=s!==void 0?s:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let i=this._cachedIndex,s=t[i],r=t[i-1];e:{t:{let o;n:{i:if(!(e=r)){const a=t[1];e=r)break t}o=i,i=0;break n}break e}for(;i>>1;et;)--o;if(++o,r!==0||o!==s){r>=o&&(o=Math.max(o,1),r=o-1);const a=this.getValueSize();this.times=i.slice(r,o),this.values=this.values.slice(r*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,s=this.values,r=i.length;r===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==r;a++){const l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(s!==void 0&&tCt(s))for(let a=0,l=s.length;a!==l;++a){const c=s[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),s=this.getInterpolation()===Tm,r=e.length-1;let o=1;for(let a=1;a0){e[o]=e[r];for(let a=r*i,l=o*i,c=0;c!==i;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,s=new i(this.name,e,t);return s.createInterpolant=this.createInterpolant,s}}ss.prototype.TimeBufferType=Float32Array;ss.prototype.ValueBufferType=Float32Array;ss.prototype.DefaultInterpolation=Sa;class Ha extends ss{}Ha.prototype.ValueTypeName="bool";Ha.prototype.ValueBufferType=Array;Ha.prototype.DefaultInterpolation=Xl;Ha.prototype.InterpolantFactoryMethodLinear=void 0;Ha.prototype.InterpolantFactoryMethodSmooth=void 0;class FO extends ss{}FO.prototype.ValueTypeName="color";class Ta extends ss{}Ta.prototype.ValueTypeName="number";class oCt extends fc{constructor(e,t,i,s){super(e,t,i,s)}interpolate_(e,t,i,s){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-t)/(s-t);let c=e*a;for(let d=c+a;c!==d;c+=4)br.slerpFlat(r,0,o,c-a,o,c,l);return r}}class oo extends ss{InterpolantFactoryMethodLinear(e){return new oCt(this.times,this.values,this.getValueSize(),e)}}oo.prototype.ValueTypeName="quaternion";oo.prototype.DefaultInterpolation=Sa;oo.prototype.InterpolantFactoryMethodSmooth=void 0;class qa extends ss{}qa.prototype.ValueTypeName="string";qa.prototype.ValueBufferType=Array;qa.prototype.DefaultInterpolation=Xl;qa.prototype.InterpolantFactoryMethodLinear=void 0;qa.prototype.InterpolantFactoryMethodSmooth=void 0;class xa extends ss{}xa.prototype.ValueTypeName="vector";class aCt{constructor(e,t=-1,i,s=pSt){this.name=e,this.tracks=i,this.duration=t,this.blendMode=s,this.uuid=Mi(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,s=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)t.push(cCt(i[o]).scale(s));const r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){const t=[],i=e.tracks,s={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let r=0,o=i.length;r!==o;++r)t.push(ss.toJSON(i[r]));return s}static CreateFromMorphTargetSequence(e,t,i,s){const r=t.length,o=[];for(let a=0;a1){const u=d[1];let h=s[u];h||(s[u]=h=[]),h.push(c)}}const o=[];for(const a in s)o.push(this.CreateFromMorphTargetSequence(a,s[a],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(u,h,m,f,b){if(m.length!==0){const E=[],g=[];UO(m,E,g,f),E.length!==0&&b.push(new u(h,E,g))}},s=[],r=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let u=0;u{t&&t(r),this.manager.itemEnd(e)},0),r;if(fs[e]!==void 0){fs[e].push({onLoad:t,onProgress:i,onError:s});return}fs[e]=[],fs[e].push({onLoad:t,onProgress:i,onError:s});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const d=fs[e],u=c.body.getReader(),h=c.headers.get("Content-Length")||c.headers.get("X-File-Size"),m=h?parseInt(h):0,f=m!==0;let b=0;const E=new ReadableStream({start(g){S();function S(){u.read().then(({done:y,value:T})=>{if(y)g.close();else{b+=T.byteLength;const C=new ProgressEvent("progress",{lengthComputable:f,loaded:b,total:m});for(let x=0,w=d.length;x{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(d=>new DOMParser().parseFromString(d,a));case"json":return c.json();default:if(a===void 0)return c.text();{const u=/charset="?([^;"\s]*)"?/i.exec(a),h=u&&u[1]?u[1].toLowerCase():void 0,m=new TextDecoder(h);return c.arrayBuffer().then(f=>m.decode(f))}}}).then(c=>{Ca.add(e,c);const d=fs[e];delete fs[e];for(let u=0,h=d.length;u{const d=fs[e];if(d===void 0)throw this.manager.itemError(e),c;delete fs[e];for(let u=0,h=d.length;u{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class _Ct extends Ya{constructor(e){super(e)}load(e,t,i,s){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=Ca.get(e);if(o!==void 0)return r.manager.itemStart(e),setTimeout(function(){t&&t(o),r.manager.itemEnd(e)},0),o;const a=Zl("img");function l(){d(),Ca.add(e,this),t&&t(this),r.manager.itemEnd(e)}function c(u){d(),s&&s(u),r.manager.itemError(e),r.manager.itemEnd(e)}function d(){a.removeEventListener("load",l,!1),a.removeEventListener("error",c,!1)}return a.addEventListener("load",l,!1),a.addEventListener("error",c,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),r.manager.itemStart(e),a.src=e,a}}class GO extends Ya{constructor(e){super(e)}load(e,t,i,s){const r=new xn,o=new _Ct(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(a){r.image=a,r.needsUpdate=!0,t!==void 0&&t(r)},i,s),r}}class Ju extends Zt{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new ut(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}const Qm=new Tt,eR=new pe,tR=new pe;class Gb{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Rt(512,512),this.map=null,this.mapPass=null,this.matrix=new Tt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Mb,this._frameExtents=new Rt(1,1),this._viewportCount=1,this._viewports=[new Ht(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,i=this.matrix;eR.setFromMatrixPosition(e.matrixWorld),t.position.copy(eR),tR.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(tR),t.updateMatrixWorld(),Qm.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Qm),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(Qm)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class hCt extends Gb{constructor(){super(new Un(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,i=va*2*e.angle*this.focus,s=this.mapSize.width/this.mapSize.height,r=e.distance||t.far;(i!==t.fov||s!==t.aspect||r!==t.far)&&(t.fov=i,t.aspect=s,t.far=r,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class fCt extends Ju{constructor(e,t,i=0,s=Math.PI/3,r=0,o=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Zt.DEFAULT_UP),this.updateMatrix(),this.target=new Zt,this.distance=i,this.angle=s,this.penumbra=r,this.decay=o,this.map=null,this.shadow=new hCt}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const nR=new Tt,pl=new pe,Xm=new pe;class mCt extends Gb{constructor(){super(new Un(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Rt(4,2),this._viewportCount=6,this._viewports=[new Ht(2,1,1,1),new Ht(0,1,1,1),new Ht(3,1,1,1),new Ht(1,1,1,1),new Ht(3,0,1,1),new Ht(1,0,1,1)],this._cubeDirections=[new pe(1,0,0),new pe(-1,0,0),new pe(0,0,1),new pe(0,0,-1),new pe(0,1,0),new pe(0,-1,0)],this._cubeUps=[new pe(0,1,0),new pe(0,1,0),new pe(0,1,0),new pe(0,1,0),new pe(0,0,1),new pe(0,0,-1)]}updateMatrices(e,t=0){const i=this.camera,s=this.matrix,r=e.distance||i.far;r!==i.far&&(i.far=r,i.updateProjectionMatrix()),pl.setFromMatrixPosition(e.matrixWorld),i.position.copy(pl),Xm.copy(i.position),Xm.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(Xm),i.updateMatrixWorld(),s.makeTranslation(-pl.x,-pl.y,-pl.z),nR.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(nR)}}class gCt extends Ju{constructor(e,t,i=0,s=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=s,this.shadow=new mCt}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class ECt extends Gb{constructor(){super(new Lb(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class VO extends Ju{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Zt.DEFAULT_UP),this.updateMatrix(),this.target=new Zt,this.shadow=new ECt}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class bCt extends Ju{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class Il{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,s=e.length;i"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,s){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=Ca.get(e);if(o!==void 0)return r.manager.itemStart(e),setTimeout(function(){t&&t(o),r.manager.itemEnd(e)},0),o;const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(l){Ca.add(e,l),t&&t(l),r.manager.itemEnd(e)}).catch(function(l){s&&s(l),r.manager.itemError(e),r.manager.itemEnd(e)}),r.manager.itemStart(e)}}const Vb="\\[\\]\\.:\\/",vCt=new RegExp("["+Vb+"]","g"),zb="[^"+Vb+"]",yCt="[^"+Vb.replace("\\.","")+"]",TCt=/((?:WC+[\/:])*)/.source.replace("WC",zb),xCt=/(WCOD+)?/.source.replace("WCOD",yCt),CCt=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",zb),RCt=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",zb),ACt=new RegExp("^"+TCt+xCt+CCt+RCt+"$"),wCt=["material","materials","bones","map"];class NCt{constructor(e,t,i){const s=i||Ft.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,s)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,s=this._bindings[i];s!==void 0&&s.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let s=this._targetGroup.nCachedObjects_,r=i.length;s!==r;++s)i[s].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class Ft{constructor(e,t,i){this.path=t,this.parsedPath=i||Ft.parseTrackName(t),this.node=Ft.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new Ft.Composite(e,t,i):new Ft(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(vCt,"")}static parseTrackName(e){const t=ACt.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},s=i.nodeName&&i.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){const r=i.nodeName.substring(s+1);wCt.indexOf(r)!==-1&&(i.nodeName=i.nodeName.substring(0,s),i.objectName=r)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(r){for(let o=0;o=2.0 are supported."));return}const c=new l1t(r,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let d=0;d=0&&a[u]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}c.setExtensions(o),c.setPlugins(a),c.parse(i,s)}parseAsync(e,t){const i=this;return new Promise(function(s,r){i.parse(e,t,s,r)})}}function ICt(){let n={};return{get:function(e){return n[e]},add:function(e,t){n[e]=t},remove:function(e){delete n[e]},removeAll:function(){n={}}}}const Ct={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class MCt{constructor(e){this.parser=e,this.name=Ct.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let i=0,s=t.length;i=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,r.source,o)}}class YCt{constructor(e){this.parser=e,this.name=Ct.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,s=i.json,r=s.textures[e];if(!r.extensions||!r.extensions[t])return null;const o=r.extensions[t],a=s.images[o.source];let l=i.textureLoader;if(a.uri){const c=i.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return i.loadTextureImage(e,o.source,l);if(s.extensionsRequired&&s.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class $Ct{constructor(e){this.parser=e,this.name=Ct.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,s=i.json,r=s.textures[e];if(!r.extensions||!r.extensions[t])return null;const o=r.extensions[t],a=s.images[o.source];let l=i.textureLoader;if(a.uri){const c=i.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return i.loadTextureImage(e,o.source,l);if(s.extensionsRequired&&s.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class WCt{constructor(e){this.name=Ct.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,i=t.bufferViews[e];if(i.extensions&&i.extensions[this.name]){const s=i.extensions[this.name],r=this.parser.getDependency("buffer",s.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return r.then(function(a){const l=s.byteOffset||0,c=s.byteLength||0,d=s.count,u=s.byteStride,h=new Uint8Array(a,l,c);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(d,u,h,s.mode,s.filter).then(function(m){return m.buffer}):o.ready.then(function(){const m=new ArrayBuffer(d*u);return o.decodeGltfBuffer(new Uint8Array(m),d,u,h,s.mode,s.filter),m})})}else return null}}class KCt{constructor(e){this.name=Ct.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,i=t.nodes[e];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const s=t.meshes[i.mesh];for(const c of s.primitives)if(c.mode!==li.TRIANGLES&&c.mode!==li.TRIANGLE_STRIP&&c.mode!==li.TRIANGLE_FAN&&c.mode!==void 0)return null;const o=i.extensions[this.name].attributes,a=[],l={};for(const c in o)a.push(this.parser.getDependency("accessor",o[c]).then(d=>(l[c]=d,l[c])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(c=>{const d=c.pop(),u=d.isGroup?d.children:[d],h=c[0].count,m=[];for(const f of u){const b=new Tt,E=new pe,g=new br,S=new pe(1,1,1),y=new Xxt(f.geometry,f.material,h);for(let T=0;T0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const a1t=new Tt;class l1t{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new ICt,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let i=!1,s=!1,r=-1;typeof navigator<"u"&&(i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,s=navigator.userAgent.indexOf("Firefox")>-1,r=s?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||i||s&&r<98?this.textureLoader=new GO(this.options.manager):this.textureLoader=new SCt(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new BO(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const i=this,s=this.json,r=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(o){const a={scene:o[0][s.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:s.asset,parser:i,userData:{}};return Mr(r,a,s),ir(a,s),Promise.all(i._invokeAll(function(l){return l.afterRoot&&l.afterRoot(a)})).then(function(){e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let s=0,r=t.length;s{const l=this.associations.get(o);l!=null&&this.associations.set(a,l);for(const[c,d]of o.children.entries())r(d,a.children[c])};return r(i,s),s.name+="_instance_"+e.uses[t]++,s}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let i=0;i=2&&E.setY(v,x[w*l+1]),l>=3&&E.setZ(v,x[w*l+2]),l>=4&&E.setW(v,x[w*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return E})}loadTexture(e){const t=this.json,i=this.options,r=t.textures[e].source,o=t.images[r];let a=this.textureLoader;if(o.uri){const l=i.manager.getHandler(o.uri);l!==null&&(a=l)}return this.loadTextureImage(e,r,a)}loadTextureImage(e,t,i){const s=this,r=this.json,o=r.textures[e],a=r.images[t],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const c=this.loadImageSource(t,i).then(function(d){d.flipY=!1,d.name=o.name||a.name||"",d.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(d.name=a.uri);const h=(r.samplers||{})[o.sampler]||{};return d.magFilter=rR[h.magFilter]||qn,d.minFilter=rR[h.minFilter]||io,d.wrapS=oR[h.wrapS]||Ea,d.wrapT=oR[h.wrapT]||Ea,s.associations.set(d,{textures:e}),d}).catch(function(){return null});return this.textureCache[l]=c,c}loadImageSource(e,t){const i=this,s=this.json,r=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(u=>u.clone());const o=s.images[e],a=self.URL||self.webkitURL;let l=o.uri||"",c=!1;if(o.bufferView!==void 0)l=i.getDependency("bufferView",o.bufferView).then(function(u){c=!0;const h=new Blob([u],{type:o.mimeType});return l=a.createObjectURL(h),l});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const d=Promise.resolve(l).then(function(u){return new Promise(function(h,m){let f=h;t.isImageBitmapLoader===!0&&(f=function(b){const E=new xn(b);E.needsUpdate=!0,h(E)}),t.load(Il.resolveURL(u,r.path),f,void 0,m)})}).then(function(u){return c===!0&&a.revokeObjectURL(l),u.userData.mimeType=o.mimeType||o1t(o.uri),u}).catch(function(u){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),u});return this.sourceCache[e]=d,d}assignTexture(e,t,i,s){const r=this;return this.getDependency("texture",i.index).then(function(o){if(!o)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(o=o.clone(),o.channel=i.texCoord),r.extensions[Ct.KHR_TEXTURE_TRANSFORM]){const a=i.extensions!==void 0?i.extensions[Ct.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const l=r.associations.get(o);o=r.extensions[Ct.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),r.associations.set(o,l)}}return s!==void 0&&(o.colorSpace=s),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let i=e.material;const s=t.attributes.tangent===void 0,r=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+i.uuid;let l=this.cache.get(a);l||(l=new PO,Di.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,l.sizeAttenuation=!1,this.cache.add(a,l)),i=l}else if(e.isLine){const a="LineBasicMaterial:"+i.uuid;let l=this.cache.get(a);l||(l=new kO,Di.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,this.cache.add(a,l)),i=l}if(s||r||o){let a="ClonedMaterial:"+i.uuid+":";s&&(a+="derivative-tangents:"),r&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=i.clone(),r&&(l.vertexColors=!0),o&&(l.flatShading=!0),s&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(i))),i=l}e.material=i}getMaterialType(){return Bb}loadMaterial(e){const t=this,i=this.json,s=this.extensions,r=i.materials[e];let o;const a={},l=r.extensions||{},c=[];if(l[Ct.KHR_MATERIALS_UNLIT]){const u=s[Ct.KHR_MATERIALS_UNLIT];o=u.getMaterialType(),c.push(u.extendParams(a,r,t))}else{const u=r.pbrMetallicRoughness||{};if(a.color=new ut(1,1,1),a.opacity=1,Array.isArray(u.baseColorFactor)){const h=u.baseColorFactor;a.color.setRGB(h[0],h[1],h[2],Cn),a.opacity=h[3]}u.baseColorTexture!==void 0&&c.push(t.assignTexture(a,"map",u.baseColorTexture,tn)),a.metalness=u.metallicFactor!==void 0?u.metallicFactor:1,a.roughness=u.roughnessFactor!==void 0?u.roughnessFactor:1,u.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(a,"metalnessMap",u.metallicRoughnessTexture)),c.push(t.assignTexture(a,"roughnessMap",u.metallicRoughnessTexture))),o=this._invokeOne(function(h){return h.getMaterialType&&h.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(h){return h.extendMaterialParams&&h.extendMaterialParams(e,a)})))}r.doubleSided===!0&&(a.side=Hi);const d=r.alphaMode||Jm.OPAQUE;if(d===Jm.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,d===Jm.MASK&&(a.alphaTest=r.alphaCutoff!==void 0?r.alphaCutoff:.5)),r.normalTexture!==void 0&&o!==ar&&(c.push(t.assignTexture(a,"normalMap",r.normalTexture)),a.normalScale=new Rt(1,1),r.normalTexture.scale!==void 0)){const u=r.normalTexture.scale;a.normalScale.set(u,u)}if(r.occlusionTexture!==void 0&&o!==ar&&(c.push(t.assignTexture(a,"aoMap",r.occlusionTexture)),r.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=r.occlusionTexture.strength)),r.emissiveFactor!==void 0&&o!==ar){const u=r.emissiveFactor;a.emissive=new ut().setRGB(u[0],u[1],u[2],Cn)}return r.emissiveTexture!==void 0&&o!==ar&&c.push(t.assignTexture(a,"emissiveMap",r.emissiveTexture,tn)),Promise.all(c).then(function(){const u=new o(a);return r.name&&(u.name=r.name),ir(u,r),t.associations.set(u,{materials:e}),r.extensions&&Mr(s,u,r),u})}createUniqueName(e){const t=Ft.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,i=this.extensions,s=this.primitiveCache;function r(a){return i[Ct.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return aR(l,a,t)})}const o=[];for(let a=0,l=e.length;a0&&s1t(g,r),g.name=t.createUniqueName(r.name||"mesh_"+e),ir(g,r),E.extensions&&Mr(s,g,E),t.assignFinalMaterial(g),u.push(g)}for(let m=0,f=u.length;m1?d=new qr:c.length===1?d=c[0]:d=new Zt,d!==c[0])for(let u=0,h=c.length;u{const u=new Map;for(const[h,m]of s.associations)(h instanceof Di||h instanceof xn)&&u.set(h,m);return d.traverse(h=>{const m=s.associations.get(h);m!=null&&u.set(h,m)}),u};return s.associations=c(r),r})}_createAnimationTracks(e,t,i,s,r){const o=[],a=e.name?e.name:e.uuid,l=[];Ws[r.path]===Ws.weights?e.traverse(function(h){h.morphTargetInfluences&&l.push(h.name?h.name:h.uuid)}):l.push(a);let c;switch(Ws[r.path]){case Ws.weights:c=Ta;break;case Ws.rotation:c=oo;break;case Ws.position:case Ws.scale:c=xa;break;default:switch(i.itemSize){case 1:c=Ta;break;case 2:case 3:default:c=xa;break}break}const d=s.interpolation!==void 0?t1t[s.interpolation]:Sa,u=this._getArrayFromAccessor(i);for(let h=0,m=l.length;h{Be.replace()})},stopVideoStream(){this.isVideoActive=!1,this.imageData=null,Ye.emit("stop_webcam_video_stream"),Fe(()=>{Be.replace()})},startDrag(n){this.isDragging=!0,this.zIndex=5001,this.dragStart.x=n.clientX,this.dragStart.y=n.clientY,document.addEventListener("mousemove",this.drag),document.addEventListener("mouseup",this.stopDrag)},drag(n){if(this.isDragging){const e=n.clientX-this.dragStart.x,t=n.clientY-this.dragStart.y;this.position.bottom-=t,this.position.right-=e,this.dragStart.x=n.clientX,this.dragStart.y=n.clientY}},stopDrag(){this.isDragging=!1,this.zIndex=0,document.removeEventListener("mousemove",this.drag),document.removeEventListener("mouseup",this.stopDrag)}},mounted(){Be.replace(),Ye.on("video_stream_image",n=>{if(this.isVideoActive){this.imageDataUrl="data:image/jpeg;base64,"+n,this.frameCount++;const e=Date.now();e-this.lastFrameTime>=1e3&&(this.frameRate=this.frameCount,this.frameCount=0,this.lastFrameTime=e)}})}},u1t=["src"],p1t=["src"],_1t={class:"controls"},h1t=_("i",{"data-feather":"video"},null,-1),f1t=[h1t],m1t=_("i",{"data-feather":"video"},null,-1),g1t=[m1t],E1t={key:2};function b1t(n,e,t,i,s,r){return O(),D("div",{class:"floating-frame bg-white",style:Xt({bottom:s.position.bottom+"px",right:s.position.right+"px","z-index":s.zIndex}),onMousedown:e[4]||(e[4]=Te((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[5]||(e[5]=Te((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},[_("div",{class:"handle",onMousedown:e[0]||(e[0]=Te((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[1]||(e[1]=Te((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},"Drag Me",32),s.isVideoActive&&s.imageDataUrl!=null?(O(),D("img",{key:0,src:s.imageDataUrl,alt:"Webcam Frame",width:"300",height:"300"},null,8,u1t)):j("",!0),s.isVideoActive&&s.imageDataUrl==null?(O(),D("p",{key:1,src:s.imageDataUrl,alt:"Webcam Frame",width:"300",height:"300"},"Loading. Please wait...",8,p1t)):j("",!0),_("div",_1t,[s.isVideoActive?j("",!0):(O(),D("button",{key:0,class:"bg-green-500 hover:bg-green-700 text-white font-bold py-2 px-4 rounded",onClick:e[2]||(e[2]=(...o)=>r.startVideoStream&&r.startVideoStream(...o))},f1t)),s.isVideoActive?(O(),D("button",{key:1,class:"bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded",onClick:e[3]||(e[3]=(...o)=>r.stopVideoStream&&r.stopVideoStream(...o))},g1t)):j("",!0),s.isVideoActive?(O(),D("span",E1t,"FPS: "+he(s.frameRate),1)):j("",!0)])],36)}const S1t=gt(d1t,[["render",b1t]]);const v1t={data(){return{isAudioActive:!1,imageDataUrl:null,isDragging:!1,position:{bottom:0,right:0},dragStart:{x:0,y:0},zIndex:0,frameRate:0,frameCount:0,lastFrameTime:Date.now()}},methods:{startAudioStream(){this.isAudioActive=!0,Ye.emit("start_audio_stream"),Fe(()=>{Be.replace()})},stopAudioStream(){this.isAudioActive=!1,this.imageDataUrl=null,Ye.emit("stop_audio_stream"),Fe(()=>{Be.replace()})},startDrag(n){this.isDragging=!0,this.zIndex=5001,this.dragStart.x=n.clientX,this.dragStart.y=n.clientY,document.addEventListener("mousemove",this.drag),document.addEventListener("mouseup",this.stopDrag)},drag(n){if(this.isDragging){const e=n.clientX-this.dragStart.x,t=n.clientY-this.dragStart.y;this.position.bottom-=t,this.position.right-=e,this.dragStart.x=n.clientX,this.dragStart.y=n.clientY}},stopDrag(){this.isDragging=!1,this.zIndex=0,document.removeEventListener("mousemove",this.drag),document.removeEventListener("mouseup",this.stopDrag)}},mounted(){Be.replace(),Ye.on("update_spectrogram",n=>{if(this.isAudioActive){this.imageDataUrl="data:image/jpeg;base64,"+n,this.frameCount++;const e=Date.now();e-this.lastFrameTime>=1e3&&(this.frameRate=this.frameCount,this.frameCount=0,this.lastFrameTime=e)}})}},y1t=["src"],T1t={class:"controls"},x1t=_("i",{"data-feather":"mic"},null,-1),C1t=[x1t],R1t=_("i",{"data-feather":"mic"},null,-1),A1t=[R1t],w1t={key:2};function N1t(n,e,t,i,s,r){return O(),D("div",{class:"floating-frame bg-white",style:Xt({bottom:s.position.bottom+"px",right:s.position.right+"px","z-index":s.zIndex}),onMousedown:e[4]||(e[4]=Te((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[5]||(e[5]=Te((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},[_("div",{class:"handle",onMousedown:e[0]||(e[0]=Te((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[1]||(e[1]=Te((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},"Drag Me",32),s.isAudioActive&&s.imageDataUrl!=null?(O(),D("img",{key:0,src:s.imageDataUrl,alt:"Spectrogram",width:"300",height:"300"},null,8,y1t)):j("",!0),_("div",T1t,[s.isAudioActive?j("",!0):(O(),D("button",{key:0,class:"bg-green-500 hover:bg-green-700 text-white font-bold py-2 px-4 rounded",onClick:e[2]||(e[2]=(...o)=>r.startAudioStream&&r.startAudioStream(...o))},C1t)),s.isAudioActive?(O(),D("button",{key:1,class:"bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded",onClick:e[3]||(e[3]=(...o)=>r.stopAudioStream&&r.stopAudioStream(...o))},A1t)):j("",!0),s.isAudioActive?(O(),D("span",w1t,"FPS: "+he(s.frameRate),1)):j("",!0)])],36)}const O1t=gt(v1t,[["render",N1t]]);const I1t={data(){return{activePersonality:null}},props:{personality:{type:Object,default:()=>({})}},components:{VideoFrame:S1t,AudioFrame:O1t},computed:{isReady:{get(){return this.$store.state.ready}}},watch:{"$store.state.mountedPersArr":"updatePersonality","$store.state.config.active_personality_id":"updatePersonality"},async mounted(){for(;this.isReady===!1;)await new Promise(n=>setTimeout(n,100));console.log("Personality:",this.personality),this.initWebGLScene(),this.updatePersonality(),Fe(()=>{Be.replace()}),this.$refs.video_frame.position={bottom:0,right:0},this.$refs.audio_frame.position={bottom:0,right:100}},beforeDestroy(){},methods:{initWebGLScene(){this.scene=new qxt,this.camera=new Un(75,window.innerWidth/window.innerHeight,.1,1e3),this.renderer=new DO,this.renderer.setSize(window.innerWidth,window.innerHeight),this.$refs.webglContainer.appendChild(this.renderer.domElement);const n=new _r,e=new Z1({color:65280});this.cube=new Fn(n,e),this.scene.add(this.cube);const t=new bCt(4210752),i=new VO(16777215,.5);i.position.set(0,1,0),this.scene.add(t),this.scene.add(i),this.camera.position.z=5,this.animate()},updatePersonality(){const{mountedPersArr:n,config:e}=this.$store.state;this.activePersonality=n[e.active_personality_id],this.activePersonality.avatar?this.showBoxWithAvatar(this.activePersonality.avatar):this.showDefaultCube(),this.$emit("update:personality",this.activePersonality)},loadScene(n){new OCt().load(n,t=>{this.scene.remove(this.cube),this.cube=t.scene,this.scene.add(this.cube)})},showBoxWithAvatar(n){this.cube&&this.scene.remove(this.cube);const e=new _r,t=new GO().load(n),i=new ar({map:t});this.cube=new Fn(e,i),this.scene.add(this.cube)},showDefaultCube(){this.scene.remove(this.cube);const n=new _r,e=new Z1({color:65280});this.cube=new Fn(n,e),this.scene.add(this.cube)},animate(){requestAnimationFrame(this.animate),this.cube&&(this.cube.rotation.x+=.01,this.cube.rotation.y+=.01),this.renderer.render(this.scene,this.camera)}}},M1t={ref:"webglContainer"},D1t={class:"flex-col y-overflow scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},L1t={key:0,class:"text-center"},k1t={key:1,class:"text-center"},P1t={class:"floating-frame2"},U1t=["innerHTML"];function F1t(n,e,t,i,s,r){const o=_t("VideoFrame"),a=_t("AudioFrame");return O(),D($e,null,[_("div",M1t,null,512),_("div",D1t,[!s.activePersonality||!s.activePersonality.scene_path?(O(),D("div",L1t," Personality does not have a 3d avatar. ")):j("",!0),!s.activePersonality||!s.activePersonality.avatar||s.activePersonality.avatar===""?(O(),D("div",k1t," Personality does not have an avatar. ")):j("",!0),_("div",P1t,[_("div",{innerHTML:n.htmlContent},null,8,U1t)])]),Ie(o,{ref:"video_frame"},null,512),Ie(a,{ref:"audio_frame"},null,512)],64)}const B1t=gt(I1t,[["render",F1t]]);let hd;const G1t=new Uint8Array(16);function V1t(){if(!hd&&(hd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!hd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return hd(G1t)}const Sn=[];for(let n=0;n<256;++n)Sn.push((n+256).toString(16).slice(1));function z1t(n,e=0){return Sn[n[e+0]]+Sn[n[e+1]]+Sn[n[e+2]]+Sn[n[e+3]]+"-"+Sn[n[e+4]]+Sn[n[e+5]]+"-"+Sn[n[e+6]]+Sn[n[e+7]]+"-"+Sn[n[e+8]]+Sn[n[e+9]]+"-"+Sn[n[e+10]]+Sn[n[e+11]]+Sn[n[e+12]]+Sn[n[e+13]]+Sn[n[e+14]]+Sn[n[e+15]]}const H1t=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),lR={randomUUID:H1t};function Cs(n,e,t){if(lR.randomUUID&&!e&&!n)return lR.randomUUID();n=n||{};const i=n.random||(n.rng||V1t)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){t=t||0;for(let s=0;s<16;++s)e[t+s]=i[s];return e}return z1t(i)}class Zr{constructor(){this.listenerMap=new Map,this._listeners=[],this.proxyMap=new Map,this.proxies=[]}get listeners(){return this._listeners.concat(this.proxies.flatMap(e=>e()))}subscribe(e,t){this.listenerMap.has(e)&&(console.warn(`Already subscribed. Unsubscribing for you. Please check that you don't accidentally use the same token twice to register two different handlers for the same event/hook.`),this.unsubscribe(e)),this.listenerMap.set(e,t),this._listeners.push(t)}unsubscribe(e){if(this.listenerMap.has(e)){const t=this.listenerMap.get(e);this.listenerMap.delete(e);const i=this._listeners.indexOf(t);i>=0&&this._listeners.splice(i,1)}}registerProxy(e,t){this.proxyMap.has(e)&&(console.warn(`Already subscribed. Unsubscribing for you. -Please check that you don't accidentally use the same token twice to register two different proxies for the same event/hook.`),this.unregisterProxy(e)),this.proxyMap.set(e,t),this.proxies.push(t)}unregisterProxy(e){if(!this.proxyMap.has(e))return;const t=this.proxyMap.get(e);this.proxyMap.delete(e);const i=this.proxies.indexOf(t);i>=0&&this.proxies.splice(i,1)}}class Vt extends Zr{constructor(e){super(),this.entity=e}emit(e){this.listeners.forEach(t=>t(e,this.entity))}}class Mn extends Zr{constructor(e){super(),this.entity=e}emit(e){let t=!1;const i=()=>[t=!0];for(const s of Array.from(this.listeners.values()))if(s(e,i,this.entity),t)return{prevented:!0};return{prevented:!1}}}class qO extends Zr{execute(e,t){let i=e;for(const s of this.listeners)i=s(i,t);return i}}class ii extends qO{constructor(e){super(),this.entity=e}execute(e){return super.execute(e,this.entity)}}class Y1t extends Zr{constructor(e){super(),this.entity=e}execute(e){const t=[];for(const i of this.listeners)t.push(i(e,this.entity));return t}}function Fi(){const n=Symbol(),e=new Map,t=new Set,i=(l,c)=>{c instanceof Zr&&c.registerProxy(n,()=>{var d,u;return(u=(d=e.get(l))===null||d===void 0?void 0:d.listeners)!==null&&u!==void 0?u:[]})},s=l=>{const c=new Zr;e.set(l,c),t.forEach(d=>i(l,d[l]))},r=l=>{t.add(l);for(const c of e.keys())i(c,l[c])},o=l=>{for(const c of e.keys())l[c]instanceof Zr&&l[c].unregisterProxy(n);t.delete(l)},a=()=>{t.forEach(l=>o(l)),e.clear()};return new Proxy({},{get(l,c){return c==="addTarget"?r:c==="removeTarget"?o:c==="destroy"?a:typeof c!="string"||c.startsWith("_")?l[c]:(e.has(c)||s(c),e.get(c))}})}class cR{constructor(e,t){if(this.destructed=!1,this.events={destruct:new Vt(this)},!e||!t)throw new Error("Cannot initialize connection with null/undefined for 'from' or 'to' values");this.id=Cs(),this.from=e,this.to=t,this.from.connectionCount++,this.to.connectionCount++}destruct(){this.events.destruct.emit(),this.from.connectionCount--,this.to.connectionCount--,this.destructed=!0}}class YO{constructor(e,t){if(!e||!t)throw new Error("Cannot initialize connection with null/undefined for 'from' or 'to' values");this.id=Cs(),this.from=e,this.to=t}}function Zg(n,e){return Object.fromEntries(Object.entries(n).map(([t,i])=>[t,e(i)]))}class $O{constructor(){this._title="",this.id=Cs(),this.events={loaded:new Vt(this),beforeAddInput:new Mn(this),addInput:new Vt(this),beforeRemoveInput:new Mn(this),removeInput:new Vt(this),beforeAddOutput:new Mn(this),addOutput:new Vt(this),beforeRemoveOutput:new Mn(this),removeOutput:new Vt(this),beforeTitleChanged:new Mn(this),titleChanged:new Vt(this),update:new Vt(this)},this.hooks={beforeLoad:new ii(this),afterSave:new ii(this)}}get graph(){return this.graphInstance}get title(){return this._title}set title(e){this.events.beforeTitleChanged.emit(e).prevented||(this._title=e,this.events.titleChanged.emit(e))}addInput(e,t){return this.addInterface("input",e,t)}addOutput(e,t){return this.addInterface("output",e,t)}removeInput(e){return this.removeInterface("input",e)}removeOutput(e){return this.removeInterface("output",e)}registerGraph(e){this.graphInstance=e}load(e){this.hooks.beforeLoad.execute(e),this.id=e.id,this._title=e.title,Object.entries(e.inputs).forEach(([t,i])=>{this.inputs[t]&&(this.inputs[t].load(i),this.inputs[t].nodeId=this.id)}),Object.entries(e.outputs).forEach(([t,i])=>{this.outputs[t]&&(this.outputs[t].load(i),this.outputs[t].nodeId=this.id)}),this.events.loaded.emit(this)}save(){const e=Zg(this.inputs,s=>s.save()),t=Zg(this.outputs,s=>s.save()),i={type:this.type,id:this.id,title:this.title,inputs:e,outputs:t};return this.hooks.afterSave.execute(i)}onPlaced(){}onDestroy(){}initializeIo(){Object.entries(this.inputs).forEach(([e,t])=>this.initializeIntf("input",e,t)),Object.entries(this.outputs).forEach(([e,t])=>this.initializeIntf("output",e,t))}initializeIntf(e,t,i){i.isInput=e==="input",i.nodeId=this.id,i.events.setValue.subscribe(this,()=>this.events.update.emit({type:e,name:t,intf:i}))}addInterface(e,t,i){const s=e==="input"?this.events.beforeAddInput:this.events.beforeAddOutput,r=e==="input"?this.events.addInput:this.events.addOutput,o=e==="input"?this.inputs:this.outputs;return s.emit(i).prevented?!1:(o[t]=i,this.initializeIntf(e,t,i),r.emit(i),!0)}removeInterface(e,t){const i=e==="input"?this.events.beforeRemoveInput:this.events.beforeRemoveOutput,s=e==="input"?this.events.removeInput:this.events.removeOutput,r=e==="input"?this.inputs[t]:this.outputs[t];if(!r||i.emit(r).prevented)return!1;if(r.connectionCount>0)if(this.graphInstance)this.graphInstance.connections.filter(a=>a.from===r||a.to===r).forEach(a=>{this.graphInstance.removeConnection(a)});else throw new Error("Interface is connected, but no graph instance is specified. Unable to delete interface");return r.events.setValue.unsubscribe(this),e==="input"?delete this.inputs[t]:delete this.outputs[t],s.emit(r),!0}}let WO=class extends $O{load(e){super.load(e)}save(){return super.save()}};function Hb(n){return class extends WO{constructor(){var e,t;super(),this.type=n.type,this.inputs={},this.outputs={},this.calculate=n.calculate?(i,s)=>n.calculate.call(this,i,s):void 0,this._title=(e=n.title)!==null&&e!==void 0?e:n.type,this.executeFactory("input",n.inputs),this.executeFactory("output",n.outputs),(t=n.onCreate)===null||t===void 0||t.call(this)}onPlaced(){var e;(e=n.onPlaced)===null||e===void 0||e.call(this)}onDestroy(){var e;(e=n.onDestroy)===null||e===void 0||e.call(this)}executeFactory(e,t){Object.keys(t||{}).forEach(i=>{const s=t[i]();e==="input"?this.addInput(i,s):this.addOutput(i,s)})}}}class pn{set connectionCount(e){this._connectionCount=e,this.events.setConnectionCount.emit(e)}get connectionCount(){return this._connectionCount}set value(e){this.events.beforeSetValue.emit(e).prevented||(this._value=e,this.events.setValue.emit(e))}get value(){return this._value}constructor(e,t){this.id=Cs(),this.nodeId="",this.port=!0,this.hidden=!1,this.events={setConnectionCount:new Vt(this),beforeSetValue:new Mn(this),setValue:new Vt(this),updated:new Vt(this)},this.hooks={load:new ii(this),save:new ii(this)},this._connectionCount=0,this.name=e,this._value=t}load(e){this.id=e.id,this.templateId=e.templateId,this.value=e.value,this.hooks.load.execute(e)}save(){const e={id:this.id,templateId:this.templateId,value:this.value};return this.hooks.save.execute(e)}setComponent(e){return this.component=e,this}setPort(e){return this.port=e,this}setHidden(e){return this.hidden=e,this}use(e,...t){return e(this,...t),this}}const Ra="__baklava_SubgraphInputNode",Aa="__baklava_SubgraphOutputNode";class KO extends WO{constructor(){super(),this.graphInterfaceId=Cs()}onPlaced(){super.onPlaced(),this.initializeIo()}save(){return{...super.save(),graphInterfaceId:this.graphInterfaceId}}load(e){super.load(e),this.graphInterfaceId=e.graphInterfaceId}}class jO extends KO{constructor(){super(...arguments),this.type=Ra,this.inputs={name:new pn("Name","Input")},this.outputs={placeholder:new pn("Value",void 0)}}static isGraphInputNode(e){return e.type===Ra}}class QO extends KO{constructor(){super(...arguments),this.type=Aa,this.inputs={name:new pn("Name","Output"),placeholder:new pn("Value",void 0)},this.outputs={output:new pn("Output",void 0).setHidden(!0)},this.calculate=({placeholder:e})=>({output:e})}static isGraphOutputNode(e){return e.type===Aa}}class mc{get nodes(){return this._nodes}get connections(){return this._connections}get loading(){return this._loading}get destroying(){return this._destroying}get inputs(){return this.nodes.filter(t=>t.type===Ra).map(t=>({id:t.graphInterfaceId,name:t.inputs.name.value,nodeId:t.id,nodeInterfaceId:t.outputs.placeholder.id}))}get outputs(){return this.nodes.filter(t=>t.type===Aa).map(t=>({id:t.graphInterfaceId,name:t.inputs.name.value,nodeId:t.id,nodeInterfaceId:t.outputs.output.id}))}constructor(e,t){this.id=Cs(),this.activeTransactions=0,this._nodes=[],this._connections=[],this._loading=!1,this._destroying=!1,this.events={beforeAddNode:new Mn(this),addNode:new Vt(this),beforeRemoveNode:new Mn(this),removeNode:new Vt(this),beforeAddConnection:new Mn(this),addConnection:new Vt(this),checkConnection:new Mn(this),beforeRemoveConnection:new Mn(this),removeConnection:new Vt(this)},this.hooks={save:new ii(this),load:new ii(this),checkConnection:new Y1t(this)},this.nodeEvents=Fi(),this.nodeHooks=Fi(),this.connectionEvents=Fi(),this.editor=e,this.template=t,e.registerGraph(this)}addNode(e){if(!this.events.beforeAddNode.emit(e).prevented)return this.nodeEvents.addTarget(e.events),this.nodeHooks.addTarget(e.hooks),e.registerGraph(this),this._nodes.push(e),e=this.nodes.find(t=>t.id===e.id),e.onPlaced(),this.events.addNode.emit(e),e}removeNode(e){if(this.nodes.includes(e)){if(this.events.beforeRemoveNode.emit(e).prevented)return;const t=[...Object.values(e.inputs),...Object.values(e.outputs)];this.connections.filter(i=>t.includes(i.from)||t.includes(i.to)).forEach(i=>this.removeConnection(i)),this._nodes.splice(this.nodes.indexOf(e),1),this.events.removeNode.emit(e),e.onDestroy(),this.nodeEvents.removeTarget(e.events),this.nodeHooks.removeTarget(e.hooks)}}addConnection(e,t){const i=this.checkConnection(e,t);if(!i.connectionAllowed||this.events.beforeAddConnection.emit({from:e,to:t}).prevented)return;for(const r of i.connectionsInDanger){const o=this.connections.find(a=>a.id===r.id);o&&this.removeConnection(o)}const s=new cR(i.dummyConnection.from,i.dummyConnection.to);return this.internalAddConnection(s),s}removeConnection(e){if(this.connections.includes(e)){if(this.events.beforeRemoveConnection.emit(e).prevented)return;e.destruct(),this._connections.splice(this.connections.indexOf(e),1),this.events.removeConnection.emit(e),this.connectionEvents.removeTarget(e.events)}}checkConnection(e,t){if(!e||!t)return{connectionAllowed:!1};const i=this.findNodeById(e.nodeId),s=this.findNodeById(t.nodeId);if(i&&s&&i===s)return{connectionAllowed:!1};if(e.isInput&&!t.isInput){const a=e;e=t,t=a}if(e.isInput||!t.isInput)return{connectionAllowed:!1};if(this.connections.some(a=>a.from===e&&a.to===t))return{connectionAllowed:!1};if(this.events.checkConnection.emit({from:e,to:t}).prevented)return{connectionAllowed:!1};const r=this.hooks.checkConnection.execute({from:e,to:t});if(r.some(a=>!a.connectionAllowed))return{connectionAllowed:!1};const o=Array.from(new Set(r.flatMap(a=>a.connectionsInDanger)));return{connectionAllowed:!0,dummyConnection:new YO(e,t),connectionsInDanger:o}}findNodeInterface(e){for(const t of this.nodes){for(const i in t.inputs){const s=t.inputs[i];if(s.id===e)return s}for(const i in t.outputs){const s=t.outputs[i];if(s.id===e)return s}}}findNodeById(e){return this.nodes.find(t=>t.id===e)}load(e){try{this._loading=!0;const t=[];for(let i=this.connections.length-1;i>=0;i--)this.removeConnection(this.connections[i]);for(let i=this.nodes.length-1;i>=0;i--)this.removeNode(this.nodes[i]);this.id=e.id;for(const i of e.nodes){const s=this.editor.nodeTypes.get(i.type);if(!s){t.push(`Node type ${i.type} is not registered`);continue}const r=new s.type;this.addNode(r),r.load(i)}for(const i of e.connections){const s=this.findNodeInterface(i.from),r=this.findNodeInterface(i.to);if(s)if(r){const o=new cR(s,r);o.id=i.id,this.internalAddConnection(o)}else{t.push(`Could not find interface with id ${i.to}`);continue}else{t.push(`Could not find interface with id ${i.from}`);continue}}return this.hooks.load.execute(e),t}finally{this._loading=!1}}save(){const e={id:this.id,nodes:this.nodes.map(t=>t.save()),connections:this.connections.map(t=>({id:t.id,from:t.from.id,to:t.to.id})),inputs:this.inputs,outputs:this.outputs};return this.hooks.save.execute(e)}destroy(){this._destroying=!0;for(const e of this.nodes)this.removeNode(e);this.editor.unregisterGraph(this)}internalAddConnection(e){this.connectionEvents.addTarget(e.events),this._connections.push(e),this.events.addConnection.emit(e)}}const Jl="__baklava_GraphNode-";function wa(n){return Jl+n.id}function $1t(n){return class extends $O{constructor(){super(...arguments),this.type=wa(n),this.inputs={},this.outputs={},this.template=n,this.calculate=async(t,i)=>{var s;if(!this.subgraph)throw new Error(`GraphNode ${this.id}: calculate called without subgraph being initialized`);if(!i.engine||typeof i.engine!="object")throw new Error(`GraphNode ${this.id}: calculate called but no engine provided in context`);const r=i.engine.getInputValues(this.subgraph);for(const l of this.subgraph.inputs)r.set(l.nodeInterfaceId,t[l.id]);const o=await i.engine.runGraph(this.subgraph,r,i.globalValues),a={};for(const l of this.subgraph.outputs)a[l.id]=(s=o.get(l.nodeId))===null||s===void 0?void 0:s.get("output");return a._calculationResults=o,a}}get title(){return this._title}set title(t){this.template.name=t}load(t){if(!this.subgraph)throw new Error("Cannot load a graph node without a graph");if(!this.template)throw new Error("Unable to load graph node without graph template");this.subgraph.load(t.graphState),super.load(t)}save(){if(!this.subgraph)throw new Error("Cannot save a graph node without a graph");return{...super.save(),graphState:this.subgraph.save()}}onPlaced(){this.template.events.updated.subscribe(this,()=>this.initialize()),this.template.events.nameChanged.subscribe(this,t=>{this._title=t}),this.initialize()}onDestroy(){var t;this.template.events.updated.unsubscribe(this),this.template.events.nameChanged.unsubscribe(this),(t=this.subgraph)===null||t===void 0||t.destroy()}initialize(){this.subgraph&&this.subgraph.destroy(),this.subgraph=this.template.createGraph(),this._title=this.template.name,this.updateInterfaces(),this.events.update.emit(null)}updateInterfaces(){if(!this.subgraph)throw new Error("Trying to update interfaces without graph instance");for(const t of this.subgraph.inputs)t.id in this.inputs?this.inputs[t.id].name=t.name:this.addInput(t.id,new pn(t.name,void 0));for(const t of Object.keys(this.inputs))this.subgraph.inputs.some(i=>i.id===t)||this.removeInput(t);for(const t of this.subgraph.outputs)t.id in this.outputs?this.outputs[t.id].name=t.name:this.addOutput(t.id,new pn(t.name,void 0));for(const t of Object.keys(this.outputs))this.subgraph.outputs.some(i=>i.id===t)||this.removeOutput(t);this.addOutput("_calculationResults",new pn("_calculationResults",void 0).setHidden(!0))}}}class ep{static fromGraph(e,t){return new ep(e.save(),t)}get name(){return this._name}set name(e){this._name=e,this.events.nameChanged.emit(e);const t=this.editor.nodeTypes.get(wa(this));t&&(t.title=e)}get inputs(){return this.nodes.filter(t=>t.type===Ra).map(t=>({id:t.graphInterfaceId,name:t.inputs.name.value,nodeId:t.id,nodeInterfaceId:t.outputs.placeholder.id}))}get outputs(){return this.nodes.filter(t=>t.type===Aa).map(t=>({id:t.graphInterfaceId,name:t.inputs.name.value,nodeId:t.id,nodeInterfaceId:t.outputs.output.id}))}constructor(e,t){this.id=Cs(),this._name="Subgraph",this.events={nameChanged:new Vt(this),updated:new Vt(this)},this.hooks={beforeLoad:new ii(this),afterSave:new ii(this)},this.editor=t,e.id&&(this.id=e.id),e.name&&(this._name=e.name),this.update(e)}update(e){this.nodes=e.nodes,this.connections=e.connections,this.events.updated.emit()}save(){return{id:this.id,name:this.name,nodes:this.nodes,connections:this.connections,inputs:this.inputs,outputs:this.outputs}}createGraph(e){const t=new Map,i=h=>{const m=Cs();return t.set(h,m),m},s=h=>{const m=t.get(h);if(!m)throw new Error(`Unable to create graph from template: Could not map old id ${h} to new id`);return m},r=h=>Zg(h,m=>({id:i(m.id),templateId:m.id,value:m.value})),o=this.nodes.map(h=>({...h,id:i(h.id),inputs:r(h.inputs),outputs:r(h.outputs)})),a=this.connections.map(h=>({id:i(h.id),from:s(h.from),to:s(h.to)})),l=this.inputs.map(h=>({id:h.id,name:h.name,nodeId:s(h.nodeId),nodeInterfaceId:s(h.nodeInterfaceId)})),c=this.outputs.map(h=>({id:h.id,name:h.name,nodeId:s(h.nodeId),nodeInterfaceId:s(h.nodeInterfaceId)})),d={id:Cs(),nodes:o,connections:a,inputs:l,outputs:c};return e||(e=new mc(this.editor)),e.load(d).forEach(h=>console.warn(h)),e.template=this,e}}class W1t{get nodeTypes(){return this._nodeTypes}get graph(){return this._graph}get graphTemplates(){return this._graphTemplates}get graphs(){return this._graphs}get loading(){return this._loading}constructor(){this.events={loaded:new Vt(this),beforeRegisterNodeType:new Mn(this),registerNodeType:new Vt(this),beforeUnregisterNodeType:new Mn(this),unregisterNodeType:new Vt(this),beforeAddGraphTemplate:new Mn(this),addGraphTemplate:new Vt(this),beforeRemoveGraphTemplate:new Mn(this),removeGraphTemplate:new Vt(this),registerGraph:new Vt(this),unregisterGraph:new Vt(this)},this.hooks={save:new ii(this),load:new ii(this)},this.graphTemplateEvents=Fi(),this.graphTemplateHooks=Fi(),this.graphEvents=Fi(),this.graphHooks=Fi(),this.nodeEvents=Fi(),this.nodeHooks=Fi(),this.connectionEvents=Fi(),this._graphs=new Set,this._nodeTypes=new Map,this._graph=new mc(this),this._graphTemplates=[],this._loading=!1,this.registerNodeType(jO),this.registerNodeType(QO)}registerNodeType(e,t){var i,s;if(this.events.beforeRegisterNodeType.emit({type:e,options:t}).prevented)return;const r=new e;this._nodeTypes.set(r.type,{type:e,category:(i=t==null?void 0:t.category)!==null&&i!==void 0?i:"default",title:(s=t==null?void 0:t.title)!==null&&s!==void 0?s:r.title}),this.events.registerNodeType.emit({type:e,options:t})}unregisterNodeType(e){const t=typeof e=="string"?e:new e().type;if(this.nodeTypes.has(t)){if(this.events.beforeUnregisterNodeType.emit(t).prevented)return;this._nodeTypes.delete(t),this.events.unregisterNodeType.emit(t)}}addGraphTemplate(e){if(this.events.beforeAddGraphTemplate.emit(e).prevented)return;this._graphTemplates.push(e),this.graphTemplateEvents.addTarget(e.events),this.graphTemplateHooks.addTarget(e.hooks);const t=$1t(e);this.registerNodeType(t,{category:"Subgraphs",title:e.name}),this.events.addGraphTemplate.emit(e)}removeGraphTemplate(e){if(this.graphTemplates.includes(e)){if(this.events.beforeRemoveGraphTemplate.emit(e).prevented)return;const t=wa(e);for(const i of[this.graph,...this.graphs.values()]){const s=i.nodes.filter(r=>r.type===t);for(const r of s)i.removeNode(r)}this.unregisterNodeType(t),this._graphTemplates.splice(this._graphTemplates.indexOf(e),1),this.graphTemplateEvents.removeTarget(e.events),this.graphTemplateHooks.removeTarget(e.hooks),this.events.removeGraphTemplate.emit(e)}}registerGraph(e){this.graphEvents.addTarget(e.events),this.graphHooks.addTarget(e.hooks),this.nodeEvents.addTarget(e.nodeEvents),this.nodeHooks.addTarget(e.nodeHooks),this.connectionEvents.addTarget(e.connectionEvents),this.events.registerGraph.emit(e),this._graphs.add(e)}unregisterGraph(e){this.graphEvents.removeTarget(e.events),this.graphHooks.removeTarget(e.hooks),this.nodeEvents.removeTarget(e.nodeEvents),this.nodeHooks.removeTarget(e.nodeHooks),this.connectionEvents.removeTarget(e.connectionEvents),this.events.unregisterGraph.emit(e),this._graphs.delete(e)}load(e){try{this._loading=!0,e=this.hooks.load.execute(e),e.graphTemplates.forEach(i=>{const s=new ep(i,this);this.addGraphTemplate(s)});const t=this._graph.load(e.graph);return this.events.loaded.emit(),t.forEach(i=>console.warn(i)),t}finally{this._loading=!1}}save(){const e={graph:this.graph.save(),graphTemplates:this.graphTemplates.map(t=>t.save())};return this.hooks.save.execute(e)}}function K1t(n,e){const t=new Map;e.graphs.forEach(i=>{i.nodes.forEach(s=>t.set(s.id,s))}),n.forEach((i,s)=>{const r=t.get(s);r&&i.forEach((o,a)=>{const l=r.outputs[a];l&&(l.value=o)})})}class XO extends Error{constructor(){super("Cycle detected")}}function j1t(n){return typeof n=="string"}function ZO(n,e){const t=new Map,i=new Map,s=new Map;let r,o;if(n instanceof mc)r=n.nodes,o=n.connections;else{if(!e)throw new Error("Invalid argument value: expected array of connections");r=n,o=e}r.forEach(c=>{Object.values(c.inputs).forEach(d=>t.set(d.id,c.id)),Object.values(c.outputs).forEach(d=>t.set(d.id,c.id))}),r.forEach(c=>{const d=o.filter(h=>h.from&&t.get(h.from.id)===c.id),u=new Set(d.map(h=>t.get(h.to.id)).filter(j1t));i.set(c.id,u),s.set(c,d)});const a=r.slice();o.forEach(c=>{const d=a.findIndex(u=>t.get(c.to.id)===u.id);d>=0&&a.splice(d,1)});const l=[];for(;a.length>0;){const c=a.pop();l.push(c);const d=i.get(c.id);for(;d.size>0;){const u=d.values().next().value;if(d.delete(u),Array.from(i.values()).every(h=>!h.has(u))){const h=r.find(m=>m.id===u);a.push(h)}}}if(Array.from(i.values()).some(c=>c.size>0))throw new XO;return{calculationOrder:l,connectionsFromNode:s,interfaceIdToNodeId:t}}function Q1t(n,e){try{return ZO(n,e),!1}catch(t){if(t instanceof XO)return!0;throw t}}var Hn;(function(n){n.Running="Running",n.Idle="Idle",n.Paused="Paused",n.Stopped="Stopped"})(Hn||(Hn={}));class X1t{get status(){return this.isRunning?Hn.Running:this.internalStatus}constructor(e){this.editor=e,this.events={beforeRun:new Mn(this),afterRun:new Vt(this),statusChange:new Vt(this),beforeNodeCalculation:new Vt(this),afterNodeCalculation:new Vt(this)},this.hooks={gatherCalculationData:new ii(this),transferData:new qO},this.recalculateOrder=!0,this.internalStatus=Hn.Stopped,this.isRunning=!1,this.editor.nodeEvents.update.subscribe(this,(t,i)=>{i.graph&&!i.graph.loading&&i.graph.activeTransactions===0&&this.internalOnChange(i,t??void 0)}),this.editor.graphEvents.addNode.subscribe(this,(t,i)=>{this.recalculateOrder=!0,!i.loading&&i.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.removeNode.subscribe(this,(t,i)=>{this.recalculateOrder=!0,!i.loading&&i.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.addConnection.subscribe(this,(t,i)=>{this.recalculateOrder=!0,!i.loading&&i.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.removeConnection.subscribe(this,(t,i)=>{this.recalculateOrder=!0,!i.loading&&i.activeTransactions===0&&this.internalOnChange()}),this.editor.graphHooks.checkConnection.subscribe(this,t=>this.checkConnection(t.from,t.to))}start(){this.internalStatus===Hn.Stopped&&(this.internalStatus=Hn.Idle,this.events.statusChange.emit(this.status))}pause(){this.internalStatus===Hn.Idle&&(this.internalStatus=Hn.Paused,this.events.statusChange.emit(this.status))}resume(){this.internalStatus===Hn.Paused&&(this.internalStatus=Hn.Idle,this.events.statusChange.emit(this.status))}stop(){(this.internalStatus===Hn.Idle||this.internalStatus===Hn.Paused)&&(this.internalStatus=Hn.Stopped,this.events.statusChange.emit(this.status))}async runOnce(e,...t){if(this.events.beforeRun.emit(e).prevented)return null;try{this.isRunning=!0,this.events.statusChange.emit(this.status),this.recalculateOrder&&this.calculateOrder();const i=await this.execute(e,...t);return this.events.afterRun.emit(i),i}finally{this.isRunning=!1,this.events.statusChange.emit(this.status)}}checkConnection(e,t){if(e.templateId){const r=this.findInterfaceByTemplateId(this.editor.graph.nodes,e.templateId);if(!r)return{connectionAllowed:!0,connectionsInDanger:[]};e=r}if(t.templateId){const r=this.findInterfaceByTemplateId(this.editor.graph.nodes,t.templateId);if(!r)return{connectionAllowed:!0,connectionsInDanger:[]};t=r}const i=new YO(e,t);let s=this.editor.graph.connections.slice();return t.allowMultipleConnections||(s=s.filter(r=>r.to!==t)),s.push(i),Q1t(this.editor.graph.nodes,s)?{connectionAllowed:!1,connectionsInDanger:[]}:{connectionAllowed:!0,connectionsInDanger:t.allowMultipleConnections?[]:this.editor.graph.connections.filter(r=>r.to===t)}}calculateOrder(){this.recalculateOrder=!0}async calculateWithoutData(...e){const t=this.hooks.gatherCalculationData.execute(void 0);return await this.runOnce(t,...e)}validateNodeCalculationOutput(e,t){if(typeof t!="object")throw new Error(`Invalid calculation return value from node ${e.id} (type ${e.type})`);Object.keys(e.outputs).forEach(i=>{if(!(i in t))throw new Error(`Calculation return value from node ${e.id} (type ${e.type}) is missing key "${i}"`)})}internalOnChange(e,t){this.internalStatus===Hn.Idle&&this.onChange(this.recalculateOrder,e,t)}findInterfaceByTemplateId(e,t){for(const i of e)for(const s of[...Object.values(i.inputs),...Object.values(i.outputs)])if(s.templateId===t)return s;return null}}class Z1t extends X1t{constructor(e){super(e),this.order=new Map}start(){super.start(),this.recalculateOrder=!0,this.calculateWithoutData()}async runGraph(e,t,i){this.order.has(e.id)||this.order.set(e.id,ZO(e));const{calculationOrder:s,connectionsFromNode:r}=this.order.get(e.id),o=new Map;for(const a of s){const l={};Object.entries(a.inputs).forEach(([d,u])=>{l[d]=this.getInterfaceValue(t,u.id)}),this.events.beforeNodeCalculation.emit({inputValues:l,node:a});let c;if(a.calculate)c=await a.calculate(l,{globalValues:i,engine:this});else{c={};for(const[d,u]of Object.entries(a.outputs))c[d]=this.getInterfaceValue(t,u.id)}this.validateNodeCalculationOutput(a,c),this.events.afterNodeCalculation.emit({outputValues:c,node:a}),o.set(a.id,new Map(Object.entries(c))),r.has(a)&&r.get(a).forEach(d=>{var u;const h=(u=Object.entries(a.outputs).find(([,f])=>f.id===d.from.id))===null||u===void 0?void 0:u[0];if(!h)throw new Error(`Could not find key for interface ${d.from.id} +Please check that you don't accidentally use the same token twice to register two different proxies for the same event/hook.`),this.unregisterProxy(e)),this.proxyMap.set(e,t),this.proxies.push(t)}unregisterProxy(e){if(!this.proxyMap.has(e))return;const t=this.proxyMap.get(e);this.proxyMap.delete(e);const i=this.proxies.indexOf(t);i>=0&&this.proxies.splice(i,1)}}class Vt extends Zr{constructor(e){super(),this.entity=e}emit(e){this.listeners.forEach(t=>t(e,this.entity))}}class Mn extends Zr{constructor(e){super(),this.entity=e}emit(e){let t=!1;const i=()=>[t=!0];for(const s of Array.from(this.listeners.values()))if(s(e,i,this.entity),t)return{prevented:!0};return{prevented:!1}}}class qO extends Zr{execute(e,t){let i=e;for(const s of this.listeners)i=s(i,t);return i}}class ii extends qO{constructor(e){super(),this.entity=e}execute(e){return super.execute(e,this.entity)}}class q1t extends Zr{constructor(e){super(),this.entity=e}execute(e){const t=[];for(const i of this.listeners)t.push(i(e,this.entity));return t}}function Fi(){const n=Symbol(),e=new Map,t=new Set,i=(l,c)=>{c instanceof Zr&&c.registerProxy(n,()=>{var d,u;return(u=(d=e.get(l))===null||d===void 0?void 0:d.listeners)!==null&&u!==void 0?u:[]})},s=l=>{const c=new Zr;e.set(l,c),t.forEach(d=>i(l,d[l]))},r=l=>{t.add(l);for(const c of e.keys())i(c,l[c])},o=l=>{for(const c of e.keys())l[c]instanceof Zr&&l[c].unregisterProxy(n);t.delete(l)},a=()=>{t.forEach(l=>o(l)),e.clear()};return new Proxy({},{get(l,c){return c==="addTarget"?r:c==="removeTarget"?o:c==="destroy"?a:typeof c!="string"||c.startsWith("_")?l[c]:(e.has(c)||s(c),e.get(c))}})}class cR{constructor(e,t){if(this.destructed=!1,this.events={destruct:new Vt(this)},!e||!t)throw new Error("Cannot initialize connection with null/undefined for 'from' or 'to' values");this.id=Cs(),this.from=e,this.to=t,this.from.connectionCount++,this.to.connectionCount++}destruct(){this.events.destruct.emit(),this.from.connectionCount--,this.to.connectionCount--,this.destructed=!0}}class YO{constructor(e,t){if(!e||!t)throw new Error("Cannot initialize connection with null/undefined for 'from' or 'to' values");this.id=Cs(),this.from=e,this.to=t}}function Zg(n,e){return Object.fromEntries(Object.entries(n).map(([t,i])=>[t,e(i)]))}class $O{constructor(){this._title="",this.id=Cs(),this.events={loaded:new Vt(this),beforeAddInput:new Mn(this),addInput:new Vt(this),beforeRemoveInput:new Mn(this),removeInput:new Vt(this),beforeAddOutput:new Mn(this),addOutput:new Vt(this),beforeRemoveOutput:new Mn(this),removeOutput:new Vt(this),beforeTitleChanged:new Mn(this),titleChanged:new Vt(this),update:new Vt(this)},this.hooks={beforeLoad:new ii(this),afterSave:new ii(this)}}get graph(){return this.graphInstance}get title(){return this._title}set title(e){this.events.beforeTitleChanged.emit(e).prevented||(this._title=e,this.events.titleChanged.emit(e))}addInput(e,t){return this.addInterface("input",e,t)}addOutput(e,t){return this.addInterface("output",e,t)}removeInput(e){return this.removeInterface("input",e)}removeOutput(e){return this.removeInterface("output",e)}registerGraph(e){this.graphInstance=e}load(e){this.hooks.beforeLoad.execute(e),this.id=e.id,this._title=e.title,Object.entries(e.inputs).forEach(([t,i])=>{this.inputs[t]&&(this.inputs[t].load(i),this.inputs[t].nodeId=this.id)}),Object.entries(e.outputs).forEach(([t,i])=>{this.outputs[t]&&(this.outputs[t].load(i),this.outputs[t].nodeId=this.id)}),this.events.loaded.emit(this)}save(){const e=Zg(this.inputs,s=>s.save()),t=Zg(this.outputs,s=>s.save()),i={type:this.type,id:this.id,title:this.title,inputs:e,outputs:t};return this.hooks.afterSave.execute(i)}onPlaced(){}onDestroy(){}initializeIo(){Object.entries(this.inputs).forEach(([e,t])=>this.initializeIntf("input",e,t)),Object.entries(this.outputs).forEach(([e,t])=>this.initializeIntf("output",e,t))}initializeIntf(e,t,i){i.isInput=e==="input",i.nodeId=this.id,i.events.setValue.subscribe(this,()=>this.events.update.emit({type:e,name:t,intf:i}))}addInterface(e,t,i){const s=e==="input"?this.events.beforeAddInput:this.events.beforeAddOutput,r=e==="input"?this.events.addInput:this.events.addOutput,o=e==="input"?this.inputs:this.outputs;return s.emit(i).prevented?!1:(o[t]=i,this.initializeIntf(e,t,i),r.emit(i),!0)}removeInterface(e,t){const i=e==="input"?this.events.beforeRemoveInput:this.events.beforeRemoveOutput,s=e==="input"?this.events.removeInput:this.events.removeOutput,r=e==="input"?this.inputs[t]:this.outputs[t];if(!r||i.emit(r).prevented)return!1;if(r.connectionCount>0)if(this.graphInstance)this.graphInstance.connections.filter(a=>a.from===r||a.to===r).forEach(a=>{this.graphInstance.removeConnection(a)});else throw new Error("Interface is connected, but no graph instance is specified. Unable to delete interface");return r.events.setValue.unsubscribe(this),e==="input"?delete this.inputs[t]:delete this.outputs[t],s.emit(r),!0}}let WO=class extends $O{load(e){super.load(e)}save(){return super.save()}};function Hb(n){return class extends WO{constructor(){var e,t;super(),this.type=n.type,this.inputs={},this.outputs={},this.calculate=n.calculate?(i,s)=>n.calculate.call(this,i,s):void 0,this._title=(e=n.title)!==null&&e!==void 0?e:n.type,this.executeFactory("input",n.inputs),this.executeFactory("output",n.outputs),(t=n.onCreate)===null||t===void 0||t.call(this)}onPlaced(){var e;(e=n.onPlaced)===null||e===void 0||e.call(this)}onDestroy(){var e;(e=n.onDestroy)===null||e===void 0||e.call(this)}executeFactory(e,t){Object.keys(t||{}).forEach(i=>{const s=t[i]();e==="input"?this.addInput(i,s):this.addOutput(i,s)})}}}class pn{set connectionCount(e){this._connectionCount=e,this.events.setConnectionCount.emit(e)}get connectionCount(){return this._connectionCount}set value(e){this.events.beforeSetValue.emit(e).prevented||(this._value=e,this.events.setValue.emit(e))}get value(){return this._value}constructor(e,t){this.id=Cs(),this.nodeId="",this.port=!0,this.hidden=!1,this.events={setConnectionCount:new Vt(this),beforeSetValue:new Mn(this),setValue:new Vt(this),updated:new Vt(this)},this.hooks={load:new ii(this),save:new ii(this)},this._connectionCount=0,this.name=e,this._value=t}load(e){this.id=e.id,this.templateId=e.templateId,this.value=e.value,this.hooks.load.execute(e)}save(){const e={id:this.id,templateId:this.templateId,value:this.value};return this.hooks.save.execute(e)}setComponent(e){return this.component=e,this}setPort(e){return this.port=e,this}setHidden(e){return this.hidden=e,this}use(e,...t){return e(this,...t),this}}const Ra="__baklava_SubgraphInputNode",Aa="__baklava_SubgraphOutputNode";class KO extends WO{constructor(){super(),this.graphInterfaceId=Cs()}onPlaced(){super.onPlaced(),this.initializeIo()}save(){return{...super.save(),graphInterfaceId:this.graphInterfaceId}}load(e){super.load(e),this.graphInterfaceId=e.graphInterfaceId}}class jO extends KO{constructor(){super(...arguments),this.type=Ra,this.inputs={name:new pn("Name","Input")},this.outputs={placeholder:new pn("Value",void 0)}}static isGraphInputNode(e){return e.type===Ra}}class QO extends KO{constructor(){super(...arguments),this.type=Aa,this.inputs={name:new pn("Name","Output"),placeholder:new pn("Value",void 0)},this.outputs={output:new pn("Output",void 0).setHidden(!0)},this.calculate=({placeholder:e})=>({output:e})}static isGraphOutputNode(e){return e.type===Aa}}class mc{get nodes(){return this._nodes}get connections(){return this._connections}get loading(){return this._loading}get destroying(){return this._destroying}get inputs(){return this.nodes.filter(t=>t.type===Ra).map(t=>({id:t.graphInterfaceId,name:t.inputs.name.value,nodeId:t.id,nodeInterfaceId:t.outputs.placeholder.id}))}get outputs(){return this.nodes.filter(t=>t.type===Aa).map(t=>({id:t.graphInterfaceId,name:t.inputs.name.value,nodeId:t.id,nodeInterfaceId:t.outputs.output.id}))}constructor(e,t){this.id=Cs(),this.activeTransactions=0,this._nodes=[],this._connections=[],this._loading=!1,this._destroying=!1,this.events={beforeAddNode:new Mn(this),addNode:new Vt(this),beforeRemoveNode:new Mn(this),removeNode:new Vt(this),beforeAddConnection:new Mn(this),addConnection:new Vt(this),checkConnection:new Mn(this),beforeRemoveConnection:new Mn(this),removeConnection:new Vt(this)},this.hooks={save:new ii(this),load:new ii(this),checkConnection:new q1t(this)},this.nodeEvents=Fi(),this.nodeHooks=Fi(),this.connectionEvents=Fi(),this.editor=e,this.template=t,e.registerGraph(this)}addNode(e){if(!this.events.beforeAddNode.emit(e).prevented)return this.nodeEvents.addTarget(e.events),this.nodeHooks.addTarget(e.hooks),e.registerGraph(this),this._nodes.push(e),e=this.nodes.find(t=>t.id===e.id),e.onPlaced(),this.events.addNode.emit(e),e}removeNode(e){if(this.nodes.includes(e)){if(this.events.beforeRemoveNode.emit(e).prevented)return;const t=[...Object.values(e.inputs),...Object.values(e.outputs)];this.connections.filter(i=>t.includes(i.from)||t.includes(i.to)).forEach(i=>this.removeConnection(i)),this._nodes.splice(this.nodes.indexOf(e),1),this.events.removeNode.emit(e),e.onDestroy(),this.nodeEvents.removeTarget(e.events),this.nodeHooks.removeTarget(e.hooks)}}addConnection(e,t){const i=this.checkConnection(e,t);if(!i.connectionAllowed||this.events.beforeAddConnection.emit({from:e,to:t}).prevented)return;for(const r of i.connectionsInDanger){const o=this.connections.find(a=>a.id===r.id);o&&this.removeConnection(o)}const s=new cR(i.dummyConnection.from,i.dummyConnection.to);return this.internalAddConnection(s),s}removeConnection(e){if(this.connections.includes(e)){if(this.events.beforeRemoveConnection.emit(e).prevented)return;e.destruct(),this._connections.splice(this.connections.indexOf(e),1),this.events.removeConnection.emit(e),this.connectionEvents.removeTarget(e.events)}}checkConnection(e,t){if(!e||!t)return{connectionAllowed:!1};const i=this.findNodeById(e.nodeId),s=this.findNodeById(t.nodeId);if(i&&s&&i===s)return{connectionAllowed:!1};if(e.isInput&&!t.isInput){const a=e;e=t,t=a}if(e.isInput||!t.isInput)return{connectionAllowed:!1};if(this.connections.some(a=>a.from===e&&a.to===t))return{connectionAllowed:!1};if(this.events.checkConnection.emit({from:e,to:t}).prevented)return{connectionAllowed:!1};const r=this.hooks.checkConnection.execute({from:e,to:t});if(r.some(a=>!a.connectionAllowed))return{connectionAllowed:!1};const o=Array.from(new Set(r.flatMap(a=>a.connectionsInDanger)));return{connectionAllowed:!0,dummyConnection:new YO(e,t),connectionsInDanger:o}}findNodeInterface(e){for(const t of this.nodes){for(const i in t.inputs){const s=t.inputs[i];if(s.id===e)return s}for(const i in t.outputs){const s=t.outputs[i];if(s.id===e)return s}}}findNodeById(e){return this.nodes.find(t=>t.id===e)}load(e){try{this._loading=!0;const t=[];for(let i=this.connections.length-1;i>=0;i--)this.removeConnection(this.connections[i]);for(let i=this.nodes.length-1;i>=0;i--)this.removeNode(this.nodes[i]);this.id=e.id;for(const i of e.nodes){const s=this.editor.nodeTypes.get(i.type);if(!s){t.push(`Node type ${i.type} is not registered`);continue}const r=new s.type;this.addNode(r),r.load(i)}for(const i of e.connections){const s=this.findNodeInterface(i.from),r=this.findNodeInterface(i.to);if(s)if(r){const o=new cR(s,r);o.id=i.id,this.internalAddConnection(o)}else{t.push(`Could not find interface with id ${i.to}`);continue}else{t.push(`Could not find interface with id ${i.from}`);continue}}return this.hooks.load.execute(e),t}finally{this._loading=!1}}save(){const e={id:this.id,nodes:this.nodes.map(t=>t.save()),connections:this.connections.map(t=>({id:t.id,from:t.from.id,to:t.to.id})),inputs:this.inputs,outputs:this.outputs};return this.hooks.save.execute(e)}destroy(){this._destroying=!0;for(const e of this.nodes)this.removeNode(e);this.editor.unregisterGraph(this)}internalAddConnection(e){this.connectionEvents.addTarget(e.events),this._connections.push(e),this.events.addConnection.emit(e)}}const Jl="__baklava_GraphNode-";function wa(n){return Jl+n.id}function Y1t(n){return class extends $O{constructor(){super(...arguments),this.type=wa(n),this.inputs={},this.outputs={},this.template=n,this.calculate=async(t,i)=>{var s;if(!this.subgraph)throw new Error(`GraphNode ${this.id}: calculate called without subgraph being initialized`);if(!i.engine||typeof i.engine!="object")throw new Error(`GraphNode ${this.id}: calculate called but no engine provided in context`);const r=i.engine.getInputValues(this.subgraph);for(const l of this.subgraph.inputs)r.set(l.nodeInterfaceId,t[l.id]);const o=await i.engine.runGraph(this.subgraph,r,i.globalValues),a={};for(const l of this.subgraph.outputs)a[l.id]=(s=o.get(l.nodeId))===null||s===void 0?void 0:s.get("output");return a._calculationResults=o,a}}get title(){return this._title}set title(t){this.template.name=t}load(t){if(!this.subgraph)throw new Error("Cannot load a graph node without a graph");if(!this.template)throw new Error("Unable to load graph node without graph template");this.subgraph.load(t.graphState),super.load(t)}save(){if(!this.subgraph)throw new Error("Cannot save a graph node without a graph");return{...super.save(),graphState:this.subgraph.save()}}onPlaced(){this.template.events.updated.subscribe(this,()=>this.initialize()),this.template.events.nameChanged.subscribe(this,t=>{this._title=t}),this.initialize()}onDestroy(){var t;this.template.events.updated.unsubscribe(this),this.template.events.nameChanged.unsubscribe(this),(t=this.subgraph)===null||t===void 0||t.destroy()}initialize(){this.subgraph&&this.subgraph.destroy(),this.subgraph=this.template.createGraph(),this._title=this.template.name,this.updateInterfaces(),this.events.update.emit(null)}updateInterfaces(){if(!this.subgraph)throw new Error("Trying to update interfaces without graph instance");for(const t of this.subgraph.inputs)t.id in this.inputs?this.inputs[t.id].name=t.name:this.addInput(t.id,new pn(t.name,void 0));for(const t of Object.keys(this.inputs))this.subgraph.inputs.some(i=>i.id===t)||this.removeInput(t);for(const t of this.subgraph.outputs)t.id in this.outputs?this.outputs[t.id].name=t.name:this.addOutput(t.id,new pn(t.name,void 0));for(const t of Object.keys(this.outputs))this.subgraph.outputs.some(i=>i.id===t)||this.removeOutput(t);this.addOutput("_calculationResults",new pn("_calculationResults",void 0).setHidden(!0))}}}class ep{static fromGraph(e,t){return new ep(e.save(),t)}get name(){return this._name}set name(e){this._name=e,this.events.nameChanged.emit(e);const t=this.editor.nodeTypes.get(wa(this));t&&(t.title=e)}get inputs(){return this.nodes.filter(t=>t.type===Ra).map(t=>({id:t.graphInterfaceId,name:t.inputs.name.value,nodeId:t.id,nodeInterfaceId:t.outputs.placeholder.id}))}get outputs(){return this.nodes.filter(t=>t.type===Aa).map(t=>({id:t.graphInterfaceId,name:t.inputs.name.value,nodeId:t.id,nodeInterfaceId:t.outputs.output.id}))}constructor(e,t){this.id=Cs(),this._name="Subgraph",this.events={nameChanged:new Vt(this),updated:new Vt(this)},this.hooks={beforeLoad:new ii(this),afterSave:new ii(this)},this.editor=t,e.id&&(this.id=e.id),e.name&&(this._name=e.name),this.update(e)}update(e){this.nodes=e.nodes,this.connections=e.connections,this.events.updated.emit()}save(){return{id:this.id,name:this.name,nodes:this.nodes,connections:this.connections,inputs:this.inputs,outputs:this.outputs}}createGraph(e){const t=new Map,i=h=>{const m=Cs();return t.set(h,m),m},s=h=>{const m=t.get(h);if(!m)throw new Error(`Unable to create graph from template: Could not map old id ${h} to new id`);return m},r=h=>Zg(h,m=>({id:i(m.id),templateId:m.id,value:m.value})),o=this.nodes.map(h=>({...h,id:i(h.id),inputs:r(h.inputs),outputs:r(h.outputs)})),a=this.connections.map(h=>({id:i(h.id),from:s(h.from),to:s(h.to)})),l=this.inputs.map(h=>({id:h.id,name:h.name,nodeId:s(h.nodeId),nodeInterfaceId:s(h.nodeInterfaceId)})),c=this.outputs.map(h=>({id:h.id,name:h.name,nodeId:s(h.nodeId),nodeInterfaceId:s(h.nodeInterfaceId)})),d={id:Cs(),nodes:o,connections:a,inputs:l,outputs:c};return e||(e=new mc(this.editor)),e.load(d).forEach(h=>console.warn(h)),e.template=this,e}}class $1t{get nodeTypes(){return this._nodeTypes}get graph(){return this._graph}get graphTemplates(){return this._graphTemplates}get graphs(){return this._graphs}get loading(){return this._loading}constructor(){this.events={loaded:new Vt(this),beforeRegisterNodeType:new Mn(this),registerNodeType:new Vt(this),beforeUnregisterNodeType:new Mn(this),unregisterNodeType:new Vt(this),beforeAddGraphTemplate:new Mn(this),addGraphTemplate:new Vt(this),beforeRemoveGraphTemplate:new Mn(this),removeGraphTemplate:new Vt(this),registerGraph:new Vt(this),unregisterGraph:new Vt(this)},this.hooks={save:new ii(this),load:new ii(this)},this.graphTemplateEvents=Fi(),this.graphTemplateHooks=Fi(),this.graphEvents=Fi(),this.graphHooks=Fi(),this.nodeEvents=Fi(),this.nodeHooks=Fi(),this.connectionEvents=Fi(),this._graphs=new Set,this._nodeTypes=new Map,this._graph=new mc(this),this._graphTemplates=[],this._loading=!1,this.registerNodeType(jO),this.registerNodeType(QO)}registerNodeType(e,t){var i,s;if(this.events.beforeRegisterNodeType.emit({type:e,options:t}).prevented)return;const r=new e;this._nodeTypes.set(r.type,{type:e,category:(i=t==null?void 0:t.category)!==null&&i!==void 0?i:"default",title:(s=t==null?void 0:t.title)!==null&&s!==void 0?s:r.title}),this.events.registerNodeType.emit({type:e,options:t})}unregisterNodeType(e){const t=typeof e=="string"?e:new e().type;if(this.nodeTypes.has(t)){if(this.events.beforeUnregisterNodeType.emit(t).prevented)return;this._nodeTypes.delete(t),this.events.unregisterNodeType.emit(t)}}addGraphTemplate(e){if(this.events.beforeAddGraphTemplate.emit(e).prevented)return;this._graphTemplates.push(e),this.graphTemplateEvents.addTarget(e.events),this.graphTemplateHooks.addTarget(e.hooks);const t=Y1t(e);this.registerNodeType(t,{category:"Subgraphs",title:e.name}),this.events.addGraphTemplate.emit(e)}removeGraphTemplate(e){if(this.graphTemplates.includes(e)){if(this.events.beforeRemoveGraphTemplate.emit(e).prevented)return;const t=wa(e);for(const i of[this.graph,...this.graphs.values()]){const s=i.nodes.filter(r=>r.type===t);for(const r of s)i.removeNode(r)}this.unregisterNodeType(t),this._graphTemplates.splice(this._graphTemplates.indexOf(e),1),this.graphTemplateEvents.removeTarget(e.events),this.graphTemplateHooks.removeTarget(e.hooks),this.events.removeGraphTemplate.emit(e)}}registerGraph(e){this.graphEvents.addTarget(e.events),this.graphHooks.addTarget(e.hooks),this.nodeEvents.addTarget(e.nodeEvents),this.nodeHooks.addTarget(e.nodeHooks),this.connectionEvents.addTarget(e.connectionEvents),this.events.registerGraph.emit(e),this._graphs.add(e)}unregisterGraph(e){this.graphEvents.removeTarget(e.events),this.graphHooks.removeTarget(e.hooks),this.nodeEvents.removeTarget(e.nodeEvents),this.nodeHooks.removeTarget(e.nodeHooks),this.connectionEvents.removeTarget(e.connectionEvents),this.events.unregisterGraph.emit(e),this._graphs.delete(e)}load(e){try{this._loading=!0,e=this.hooks.load.execute(e),e.graphTemplates.forEach(i=>{const s=new ep(i,this);this.addGraphTemplate(s)});const t=this._graph.load(e.graph);return this.events.loaded.emit(),t.forEach(i=>console.warn(i)),t}finally{this._loading=!1}}save(){const e={graph:this.graph.save(),graphTemplates:this.graphTemplates.map(t=>t.save())};return this.hooks.save.execute(e)}}function W1t(n,e){const t=new Map;e.graphs.forEach(i=>{i.nodes.forEach(s=>t.set(s.id,s))}),n.forEach((i,s)=>{const r=t.get(s);r&&i.forEach((o,a)=>{const l=r.outputs[a];l&&(l.value=o)})})}class XO extends Error{constructor(){super("Cycle detected")}}function K1t(n){return typeof n=="string"}function ZO(n,e){const t=new Map,i=new Map,s=new Map;let r,o;if(n instanceof mc)r=n.nodes,o=n.connections;else{if(!e)throw new Error("Invalid argument value: expected array of connections");r=n,o=e}r.forEach(c=>{Object.values(c.inputs).forEach(d=>t.set(d.id,c.id)),Object.values(c.outputs).forEach(d=>t.set(d.id,c.id))}),r.forEach(c=>{const d=o.filter(h=>h.from&&t.get(h.from.id)===c.id),u=new Set(d.map(h=>t.get(h.to.id)).filter(K1t));i.set(c.id,u),s.set(c,d)});const a=r.slice();o.forEach(c=>{const d=a.findIndex(u=>t.get(c.to.id)===u.id);d>=0&&a.splice(d,1)});const l=[];for(;a.length>0;){const c=a.pop();l.push(c);const d=i.get(c.id);for(;d.size>0;){const u=d.values().next().value;if(d.delete(u),Array.from(i.values()).every(h=>!h.has(u))){const h=r.find(m=>m.id===u);a.push(h)}}}if(Array.from(i.values()).some(c=>c.size>0))throw new XO;return{calculationOrder:l,connectionsFromNode:s,interfaceIdToNodeId:t}}function j1t(n,e){try{return ZO(n,e),!1}catch(t){if(t instanceof XO)return!0;throw t}}var Hn;(function(n){n.Running="Running",n.Idle="Idle",n.Paused="Paused",n.Stopped="Stopped"})(Hn||(Hn={}));class Q1t{get status(){return this.isRunning?Hn.Running:this.internalStatus}constructor(e){this.editor=e,this.events={beforeRun:new Mn(this),afterRun:new Vt(this),statusChange:new Vt(this),beforeNodeCalculation:new Vt(this),afterNodeCalculation:new Vt(this)},this.hooks={gatherCalculationData:new ii(this),transferData:new qO},this.recalculateOrder=!0,this.internalStatus=Hn.Stopped,this.isRunning=!1,this.editor.nodeEvents.update.subscribe(this,(t,i)=>{i.graph&&!i.graph.loading&&i.graph.activeTransactions===0&&this.internalOnChange(i,t??void 0)}),this.editor.graphEvents.addNode.subscribe(this,(t,i)=>{this.recalculateOrder=!0,!i.loading&&i.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.removeNode.subscribe(this,(t,i)=>{this.recalculateOrder=!0,!i.loading&&i.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.addConnection.subscribe(this,(t,i)=>{this.recalculateOrder=!0,!i.loading&&i.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.removeConnection.subscribe(this,(t,i)=>{this.recalculateOrder=!0,!i.loading&&i.activeTransactions===0&&this.internalOnChange()}),this.editor.graphHooks.checkConnection.subscribe(this,t=>this.checkConnection(t.from,t.to))}start(){this.internalStatus===Hn.Stopped&&(this.internalStatus=Hn.Idle,this.events.statusChange.emit(this.status))}pause(){this.internalStatus===Hn.Idle&&(this.internalStatus=Hn.Paused,this.events.statusChange.emit(this.status))}resume(){this.internalStatus===Hn.Paused&&(this.internalStatus=Hn.Idle,this.events.statusChange.emit(this.status))}stop(){(this.internalStatus===Hn.Idle||this.internalStatus===Hn.Paused)&&(this.internalStatus=Hn.Stopped,this.events.statusChange.emit(this.status))}async runOnce(e,...t){if(this.events.beforeRun.emit(e).prevented)return null;try{this.isRunning=!0,this.events.statusChange.emit(this.status),this.recalculateOrder&&this.calculateOrder();const i=await this.execute(e,...t);return this.events.afterRun.emit(i),i}finally{this.isRunning=!1,this.events.statusChange.emit(this.status)}}checkConnection(e,t){if(e.templateId){const r=this.findInterfaceByTemplateId(this.editor.graph.nodes,e.templateId);if(!r)return{connectionAllowed:!0,connectionsInDanger:[]};e=r}if(t.templateId){const r=this.findInterfaceByTemplateId(this.editor.graph.nodes,t.templateId);if(!r)return{connectionAllowed:!0,connectionsInDanger:[]};t=r}const i=new YO(e,t);let s=this.editor.graph.connections.slice();return t.allowMultipleConnections||(s=s.filter(r=>r.to!==t)),s.push(i),j1t(this.editor.graph.nodes,s)?{connectionAllowed:!1,connectionsInDanger:[]}:{connectionAllowed:!0,connectionsInDanger:t.allowMultipleConnections?[]:this.editor.graph.connections.filter(r=>r.to===t)}}calculateOrder(){this.recalculateOrder=!0}async calculateWithoutData(...e){const t=this.hooks.gatherCalculationData.execute(void 0);return await this.runOnce(t,...e)}validateNodeCalculationOutput(e,t){if(typeof t!="object")throw new Error(`Invalid calculation return value from node ${e.id} (type ${e.type})`);Object.keys(e.outputs).forEach(i=>{if(!(i in t))throw new Error(`Calculation return value from node ${e.id} (type ${e.type}) is missing key "${i}"`)})}internalOnChange(e,t){this.internalStatus===Hn.Idle&&this.onChange(this.recalculateOrder,e,t)}findInterfaceByTemplateId(e,t){for(const i of e)for(const s of[...Object.values(i.inputs),...Object.values(i.outputs)])if(s.templateId===t)return s;return null}}class X1t extends Q1t{constructor(e){super(e),this.order=new Map}start(){super.start(),this.recalculateOrder=!0,this.calculateWithoutData()}async runGraph(e,t,i){this.order.has(e.id)||this.order.set(e.id,ZO(e));const{calculationOrder:s,connectionsFromNode:r}=this.order.get(e.id),o=new Map;for(const a of s){const l={};Object.entries(a.inputs).forEach(([d,u])=>{l[d]=this.getInterfaceValue(t,u.id)}),this.events.beforeNodeCalculation.emit({inputValues:l,node:a});let c;if(a.calculate)c=await a.calculate(l,{globalValues:i,engine:this});else{c={};for(const[d,u]of Object.entries(a.outputs))c[d]=this.getInterfaceValue(t,u.id)}this.validateNodeCalculationOutput(a,c),this.events.afterNodeCalculation.emit({outputValues:c,node:a}),o.set(a.id,new Map(Object.entries(c))),r.has(a)&&r.get(a).forEach(d=>{var u;const h=(u=Object.entries(a.outputs).find(([,f])=>f.id===d.from.id))===null||u===void 0?void 0:u[0];if(!h)throw new Error(`Could not find key for interface ${d.from.id} This is likely a Baklava internal issue. Please report it on GitHub.`);const m=this.hooks.transferData.execute(c[h],d);d.to.allowMultipleConnections?t.has(d.to.id)?t.get(d.to.id).push(m):t.set(d.to.id,[m]):t.set(d.to.id,m)})}return o}async execute(e){this.recalculateOrder&&(this.order.clear(),this.recalculateOrder=!1);const t=this.getInputValues(this.editor.graph);return await this.runGraph(this.editor.graph,t,e)}getInputValues(e){const t=new Map;for(const i of e.nodes)Object.values(i.inputs).forEach(s=>{s.connectionCount===0&&t.set(s.id,s.value)}),i.calculate||Object.values(i.outputs).forEach(s=>{t.set(s.id,s.value)});return t}onChange(e){this.recalculateOrder=e||this.recalculateOrder,this.calculateWithoutData()}getInterfaceValue(e,t){if(!e.has(t))throw new Error(`Could not find value for interface ${t} -This is likely a Baklava internal issue. Please report it on GitHub.`);return e.get(t)}}let Jg=null;function J1t(n){Jg=n}function yi(){if(!Jg)throw new Error("providePlugin() must be called before usePlugin()");return{viewModel:Jg}}function Ui(){const{viewModel:n}=yi();return{graph:kd(n.value,"displayedGraph"),switchGraph:n.value.switchGraph}}function JO(n){const{graph:e}=Ui(),t=dt(null),i=dt(null);return{dragging:et(()=>!!t.value),onPointerDown:l=>{t.value={x:l.pageX,y:l.pageY},i.value={x:n.value.x,y:n.value.y}},onPointerMove:l=>{if(t.value){const c=l.pageX-t.value.x,d=l.pageY-t.value.y;n.value.x=i.value.x+c/e.value.scaling,n.value.y=i.value.y+d/e.value.scaling}},onPointerUp:()=>{t.value=null,i.value=null}}}function eI(n,e,t){if(!e.template)return!1;if(wa(e.template)===t)return!0;const i=n.graphTemplates.find(r=>wa(r)===t);return i?i.nodes.filter(r=>r.type.startsWith(Jl)).some(r=>eI(n,e,r.type)):!1}function tI(n){return et(()=>{const e=Array.from(n.value.editor.nodeTypes.entries()),t=new Set(e.map(([,s])=>s.category)),i=[];for(const s of t.values()){let r=e.filter(([,o])=>o.category===s);n.value.displayedGraph.template?r=r.filter(([o])=>!eI(n.value.editor,n.value.displayedGraph,o)):r=r.filter(([o])=>![Ra,Aa].includes(o)),r.length>0&&i.push({name:s,nodeTypes:Object.fromEntries(r)})}return i.sort((s,r)=>s.name==="default"?-1:r.name==="default"||s.name>r.name?1:-1),i})}function nI(){const{graph:n}=Ui();return{transform:(t,i)=>{const s=t/n.value.scaling-n.value.panning.x,r=i/n.value.scaling-n.value.panning.y;return[s,r]}}}function eRt(){const{graph:n}=Ui();let e=[],t=-1,i={x:0,y:0};const s=et(()=>n.value.panning),r=JO(s),o=et(()=>({"transform-origin":"0 0",transform:`scale(${n.value.scaling}) translate(${n.value.panning.x}px, ${n.value.panning.y}px)`})),a=(m,f,b)=>{const E=[m/n.value.scaling-n.value.panning.x,f/n.value.scaling-n.value.panning.y],g=[m/b-n.value.panning.x,f/b-n.value.panning.y],S=[g[0]-E[0],g[1]-E[1]];n.value.panning.x+=S[0],n.value.panning.y+=S[1],n.value.scaling=b},l=m=>{m.preventDefault();let f=m.deltaY;m.deltaMode===1&&(f*=32);const b=n.value.scaling*(1-f/3e3);a(m.offsetX,m.offsetY,b)},c=()=>({ax:e[0].clientX,ay:e[0].clientY,bx:e[1].clientX,by:e[1].clientY});return{styles:o,...r,onPointerDown:m=>{if(e.push(m),r.onPointerDown(m),e.length===2){const{ax:f,ay:b,bx:E,by:g}=c();i={x:f+(E-f)/2,y:b+(g-b)/2}}},onPointerMove:m=>{for(let f=0;f0){const C=n.value.scaling*(1+(T-t)/500);a(i.x,i.y,C)}t=T}else r.onPointerMove(m)},onPointerUp:m=>{e=e.filter(f=>f.pointerId!==m.pointerId),t=-1,r.onPointerUp()},onMouseWheel:l}}var _i=(n=>(n[n.NONE=0]="NONE",n[n.ALLOWED=1]="ALLOWED",n[n.FORBIDDEN=2]="FORBIDDEN",n))(_i||{});const iI=Symbol();function tRt(){const{graph:n}=Ui(),e=dt(null),t=dt(null),i=a=>{e.value&&(e.value.mx=a.offsetX/n.value.scaling-n.value.panning.x,e.value.my=a.offsetY/n.value.scaling-n.value.panning.y)},s=()=>{if(t.value){if(e.value)return;const a=n.value.connections.find(l=>l.to===t.value);t.value.isInput&&a?(e.value={status:_i.NONE,from:a.from},n.value.removeConnection(a)):e.value={status:_i.NONE,from:t.value},e.value.mx=void 0,e.value.my=void 0}},r=()=>{if(e.value&&t.value){if(e.value.from===t.value)return;n.value.addConnection(e.value.from,e.value.to)}e.value=null},o=a=>{if(t.value=a??null,a&&e.value){e.value.to=a;const l=n.value.checkConnection(e.value.from,e.value.to);if(e.value.status=l.connectionAllowed?_i.ALLOWED:_i.FORBIDDEN,l.connectionAllowed){const c=l.connectionsInDanger.map(d=>d.id);n.value.connections.forEach(d=>{c.includes(d.id)&&(d.isInDanger=!0)})}}else!a&&e.value&&(e.value.to=void 0,e.value.status=_i.NONE,n.value.connections.forEach(l=>{l.isInDanger=!1}))};return Qo(iI,{temporaryConnection:e,hoveredOver:o}),{temporaryConnection:e,onMouseMove:i,onMouseDown:s,onMouseUp:r,hoveredOver:o}}function nRt(n){const e=dt(!1),t=dt(0),i=dt(0),s=tI(n),{transform:r}=nI(),o=et(()=>{let d=[];const u={};for(const m of s.value){const f=Object.entries(m.nodeTypes).map(([b,E])=>({label:E.title,value:"addNode:"+b}));m.name==="default"?d=f:u[m.name]=f}const h=[...Object.entries(u).map(([m,f])=>({label:m,submenu:f}))];return h.length>0&&d.length>0&&h.push({isDivider:!0}),h.push(...d),h}),a=et(()=>n.value.settings.contextMenu.additionalItems.length===0?o.value:[{label:"Add node",submenu:o.value},...n.value.settings.contextMenu.additionalItems.map(d=>"isDivider"in d||"submenu"in d?d:{label:d.label,value:"command:"+d.command,disabled:!n.value.commandHandler.canExecuteCommand(d.command)})]);function l(d){e.value=!0,t.value=d.offsetX,i.value=d.offsetY}function c(d){if(d.startsWith("addNode:")){const u=d.substring(8),h=n.value.editor.nodeTypes.get(u);if(!h)return;const m=jn(new h.type);n.value.displayedGraph.addNode(m);const[f,b]=r(t.value,i.value);m.position.x=f,m.position.y=b}else if(d.startsWith("command:")){const u=d.substring(8);n.value.commandHandler.canExecuteCommand(u)&&n.value.commandHandler.executeCommand(u)}}return{show:e,x:t,y:i,items:a,open:l,onClick:c}}const iRt=ln({setup(){const{viewModel:n}=yi(),{graph:e}=Ui();return{styles:et(()=>{const i=n.value.settings.background,s=e.value.panning.x*e.value.scaling,r=e.value.panning.y*e.value.scaling,o=e.value.scaling*i.gridSize,a=o/i.gridDivision,l=`${o}px ${o}px, ${o}px ${o}px`,c=e.value.scaling>i.subGridVisibleThreshold?`, ${a}px ${a}px, ${a}px ${a}px`:"";return{backgroundPosition:`left ${s}px top ${r}px`,backgroundSize:`${l} ${c}`}})}}}),cn=(n,e)=>{const t=n.__vccOpts||n;for(const[i,s]of e)t[i]=s;return t};function sRt(n,e,t,i,s,r){return O(),D("div",{class:"background",style:Xt(n.styles)},null,4)}const rRt=cn(iRt,[["render",sRt]]);function oRt(n){return wR()?(zI(n),!0):!1}function qb(n){return typeof n=="function"?n():vt(n)}const sI=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const aRt=Object.prototype.toString,lRt=n=>aRt.call(n)==="[object Object]",Od=()=>{},cRt=dRt();function dRt(){var n,e;return sI&&((n=window==null?void 0:window.navigator)==null?void 0:n.userAgent)&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||((e=window==null?void 0:window.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function uRt(n,e,t=!1){return e.reduce((i,s)=>(s in n&&(!t||n[s]!==void 0)&&(i[s]=n[s]),i),{})}function pRt(n,e={}){if(!un(n))return TM(n);const t=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)t[i]=yM(()=>({get(){return n.value[i]},set(s){var r;if((r=qb(e.replaceRef))!=null?r:!0)if(Array.isArray(n.value)){const a=[...n.value];a[i]=s,n.value=a}else{const a={...n.value,[i]:s};Object.setPrototypeOf(a,Object.getPrototypeOf(n.value)),n.value=a}else n.value[i]=s}}));return t}function bl(n){var e;const t=qb(n);return(e=t==null?void 0:t.$el)!=null?e:t}const Yb=sI?window:void 0;function Ml(...n){let e,t,i,s;if(typeof n[0]=="string"||Array.isArray(n[0])?([t,i,s]=n,e=Yb):[e,t,i,s]=n,!e)return Od;Array.isArray(t)||(t=[t]),Array.isArray(i)||(i=[i]);const r=[],o=()=>{r.forEach(d=>d()),r.length=0},a=(d,u,h,m)=>(d.addEventListener(u,h,m),()=>d.removeEventListener(u,h,m)),l=Bn(()=>[bl(e),qb(s)],([d,u])=>{if(o(),!d)return;const h=lRt(u)?{...u}:u;r.push(...t.flatMap(m=>i.map(f=>a(d,m,f,h))))},{immediate:!0,flush:"post"}),c=()=>{l(),o()};return oRt(c),c}let dR=!1;function rI(n,e,t={}){const{window:i=Yb,ignore:s=[],capture:r=!0,detectIframe:o=!1}=t;if(!i)return Od;cRt&&!dR&&(dR=!0,Array.from(i.document.body.children).forEach(h=>h.addEventListener("click",Od)),i.document.documentElement.addEventListener("click",Od));let a=!0;const l=h=>s.some(m=>{if(typeof m=="string")return Array.from(i.document.querySelectorAll(m)).some(f=>f===h.target||h.composedPath().includes(f));{const f=bl(m);return f&&(h.target===f||h.composedPath().includes(f))}}),d=[Ml(i,"click",h=>{const m=bl(n);if(!(!m||m===h.target||h.composedPath().includes(m))){if(h.detail===0&&(a=!l(h)),!a){a=!0;return}e(h)}},{passive:!0,capture:r}),Ml(i,"pointerdown",h=>{const m=bl(n);a=!l(h)&&!!(m&&!h.composedPath().includes(m))},{passive:!0}),o&&Ml(i,"blur",h=>{setTimeout(()=>{var m;const f=bl(n);((m=i.document.activeElement)==null?void 0:m.tagName)==="IFRAME"&&!(f!=null&&f.contains(i.document.activeElement))&&e(h)},0)})].filter(Boolean);return()=>d.forEach(h=>h())}const oI={x:0,y:0,pointerId:0,pressure:0,tiltX:0,tiltY:0,width:0,height:0,twist:0,pointerType:null},_Rt=Object.keys(oI);function hRt(n={}){const{target:e=Yb}=n,t=dt(!1),i=dt(n.initialValue||{});Object.assign(i.value,oI,i.value);const s=r=>{t.value=!0,!(n.pointerTypes&&!n.pointerTypes.includes(r.pointerType))&&(i.value=uRt(r,_Rt,!1))};if(e){const r={passive:!0};Ml(e,["pointerdown","pointermove","pointerup"],s,r),Ml(e,"pointerleave",()=>t.value=!1,r)}return{...pRt(i),isInside:t}}const fRt=["onMouseenter","onMouseleave","onClick"],mRt={class:"flex-fill"},gRt={key:0,class:"__submenu-icon",style:{"line-height":"1em"}},ERt=_("svg",{width:"13",height:"13",viewBox:"-60 120 250 250"},[_("path",{d:"M160.875 279.5625 L70.875 369.5625 L70.875 189.5625 L160.875 279.5625 Z",stroke:"none",fill:"white"})],-1),bRt=[ERt],$b=ln({__name:"ContextMenu",props:{modelValue:{type:Boolean},items:{},x:{default:0},y:{default:0},isNested:{type:Boolean,default:!1},isFlipped:{default:()=>({x:!1,y:!1})},flippable:{type:Boolean,default:!1}},emits:["update:modelValue","click"],setup(n,{emit:e}){const t=n,i=e;let s=null;const r=dt(null),o=dt(-1),a=dt(0),l=dt({x:!1,y:!1}),c=et(()=>t.flippable&&(l.value.x||t.isFlipped.x)),d=et(()=>t.flippable&&(l.value.y||t.isFlipped.y)),u=et(()=>{const S={};return t.isNested||(S.top=(d.value?t.y-a.value:t.y)+"px",S.left=t.x+"px"),S}),h=et(()=>({"--flipped-x":c.value,"--flipped-y":d.value,"--nested":t.isNested})),m=et(()=>t.items.map(S=>({...S,hover:!1})));Bn([()=>t.y,()=>t.items],()=>{var S,y,T,C;a.value=t.items.length*30;const x=((y=(S=r.value)==null?void 0:S.parentElement)==null?void 0:y.offsetWidth)??0,w=((C=(T=r.value)==null?void 0:T.parentElement)==null?void 0:C.offsetHeight)??0;l.value.x=!t.isNested&&t.x>x*.75,l.value.y=!t.isNested&&t.y+a.value>w-20}),rI(r,()=>{t.modelValue&&i("update:modelValue",!1)});const f=S=>{!S.submenu&&S.value&&(i("click",S.value),i("update:modelValue",!1))},b=S=>{i("click",S),o.value=-1,t.isNested||i("update:modelValue",!1)},E=(S,y)=>{t.items[y].submenu&&(o.value=y,s!==null&&(clearTimeout(s),s=null))},g=(S,y)=>{t.items[y].submenu&&(s=window.setTimeout(()=>{o.value=-1,s=null},200))};return(S,y)=>{const T=_t("ContextMenu",!0);return O(),Ot(ws,{name:"slide-fade"},{default:ot(()=>[xe(_("div",{ref_key:"el",ref:r,class:He(["baklava-context-menu",h.value]),style:Xt(u.value)},[(O(!0),D($e,null,lt(m.value,(C,x)=>(O(),D($e,null,[C.isDivider?(O(),D("div",{key:`d-${x}`,class:"divider"})):(O(),D("div",{key:`i-${x}`,class:He(["item",{submenu:!!C.submenu,"--disabled":!!C.disabled}]),onMouseenter:w=>E(w,x),onMouseleave:w=>g(w,x),onClick:Te(w=>f(C),["stop","prevent"])},[_("div",mRt,he(C.label),1),C.submenu?(O(),D("div",gRt,bRt)):j("",!0),C.submenu?(O(),Ot(T,{key:1,"model-value":o.value===x,items:C.submenu,"is-nested":!0,"is-flipped":{x:c.value,y:d.value},flippable:S.flippable,onClick:b},null,8,["model-value","items","is-flipped","flippable"])):j("",!0)],42,fRt))],64))),256))],6),[[At,S.modelValue]])]),_:1})}}}),SRt={},vRt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"16",height:"16",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},yRt=_("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),TRt=_("circle",{cx:"12",cy:"12",r:"1"},null,-1),xRt=_("circle",{cx:"12",cy:"19",r:"1"},null,-1),CRt=_("circle",{cx:"12",cy:"5",r:"1"},null,-1),RRt=[yRt,TRt,xRt,CRt];function ARt(n,e){return O(),D("svg",vRt,RRt)}const aI=cn(SRt,[["render",ARt]]),wRt=["id"],NRt={key:0,class:"__tooltip"},ORt={key:2,class:"align-middle"},uR=ln({__name:"NodeInterface",props:{node:{},intf:{}},setup(n){const e=(E,g=100)=>{const S=E!=null&&E.toString?E.toString():"";return S.length>g?S.slice(0,g)+"...":S},t=n,{viewModel:i}=yi(),{hoveredOver:s,temporaryConnection:r}=Ii(iI),o=dt(null),a=et(()=>t.intf.connectionCount>0),l=dt(!1),c=et(()=>i.value.settings.displayValueOnHover&&l.value),d=et(()=>({"--input":t.intf.isInput,"--output":!t.intf.isInput,"--connected":a.value})),u=et(()=>t.intf.component&&(!t.intf.isInput||!t.intf.port||t.intf.connectionCount===0)),h=()=>{l.value=!0,s(t.intf)},m=()=>{l.value=!1,s(void 0)},f=()=>{o.value&&i.value.hooks.renderInterface.execute({intf:t.intf,el:o.value})},b=()=>{const E=i.value.displayedGraph.sidebar;E.nodeId=t.node.id,E.optionName=t.intf.name,E.visible=!0};return Ms(f),nc(f),(E,g)=>{var S;return O(),D("div",{id:E.intf.id,ref_key:"el",ref:o,class:He(["baklava-node-interface",d.value])},[E.intf.port?(O(),D("div",{key:0,class:He(["__port",{"--selected":((S=vt(r))==null?void 0:S.from)===E.intf}]),onPointerover:h,onPointerout:m},[Nn(E.$slots,"portTooltip",{showTooltip:c.value},()=>[c.value===!0?(O(),D("span",NRt,he(e(E.intf.value)),1)):j("",!0)])],34)):j("",!0),u.value?(O(),Ot(Tu(E.intf.component),{key:1,modelValue:E.intf.value,"onUpdate:modelValue":g[0]||(g[0]=y=>E.intf.value=y),node:E.node,intf:E.intf,onOpenSidebar:b},null,40,["modelValue","node","intf"])):(O(),D("span",ORt,he(E.intf.name),1))],10,wRt)}}}),IRt=["id","data-node-type"],MRt={class:"__title-label"},DRt={class:"__menu"},LRt={class:"__outputs"},kRt={class:"__inputs"},PRt=ln({__name:"Node",props:{node:{},selected:{type:Boolean,default:!1},dragging:{type:Boolean}},emits:["select","start-drag"],setup(n,{emit:e}){const t=n,i=e,{viewModel:s}=yi(),{graph:r,switchGraph:o}=Ui(),a=dt(null),l=dt(!1),c=dt(""),d=dt(null),u=dt(!1),h=dt(!1),m=et(()=>{const P=[{value:"rename",label:"Rename"},{value:"delete",label:"Delete"}];return t.node.type.startsWith(Jl)&&P.push({value:"editSubgraph",label:"Edit Subgraph"}),P}),f=et(()=>({"--selected":t.selected,"--dragging":t.dragging,"--two-column":!!t.node.twoColumn})),b=et(()=>{var P,U;return{top:`${((P=t.node.position)==null?void 0:P.y)??0}px`,left:`${((U=t.node.position)==null?void 0:U.x)??0}px`,"--width":`${t.node.width??s.value.settings.nodes.defaultWidth}px`}}),E=et(()=>Object.values(t.node.inputs).filter(P=>!P.hidden)),g=et(()=>Object.values(t.node.outputs).filter(P=>!P.hidden)),S=()=>{i("select")},y=P=>{t.selected||S(),i("start-drag",P)},T=()=>{h.value=!0},C=async P=>{var U;switch(P){case"delete":r.value.removeNode(t.node);break;case"rename":c.value=t.node.title,l.value=!0,await Fe(),(U=d.value)==null||U.focus();break;case"editSubgraph":o(t.node.template);break}},x=()=>{t.node.title=c.value,l.value=!1},w=()=>{a.value&&s.value.hooks.renderNode.execute({node:t.node,el:a.value})},R=P=>{u.value=!0,P.preventDefault()},v=P=>{if(!u.value)return;const U=t.node.width+P.movementX/r.value.scaling,Y=s.value.settings.nodes.minWidth,L=s.value.settings.nodes.maxWidth;t.node.width=Math.max(Y,Math.min(L,U))},A=()=>{u.value=!1};return Ms(()=>{w(),window.addEventListener("mousemove",v),window.addEventListener("mouseup",A)}),nc(w),La(()=>{window.removeEventListener("mousemove",v),window.removeEventListener("mouseup",A)}),(P,U)=>(O(),D("div",{id:P.node.id,ref_key:"el",ref:a,class:He(["baklava-node",f.value]),style:Xt(b.value),"data-node-type":P.node.type,onPointerdown:S},[vt(s).settings.nodes.resizable?(O(),D("div",{key:0,class:"__resize-handle",onMousedown:R},null,32)):j("",!0),Nn(P.$slots,"title",{},()=>[_("div",{class:"__title",onPointerdown:Te(y,["self","stop"])},[l.value?xe((O(),D("input",{key:1,ref_key:"renameInputEl",ref:d,"onUpdate:modelValue":U[1]||(U[1]=Y=>c.value=Y),type:"text",class:"baklava-input",placeholder:"Node Name",onBlur:x,onKeydown:mr(x,["enter"])},null,544)),[[Xe,c.value]]):(O(),D($e,{key:0},[_("div",MRt,he(P.node.title),1),_("div",DRt,[Ie(aI,{class:"--clickable",onClick:T}),Ie($b,{modelValue:h.value,"onUpdate:modelValue":U[0]||(U[0]=Y=>h.value=Y),x:0,y:0,items:m.value,onClick:C},null,8,["modelValue","items"])])],64))],32)]),Nn(P.$slots,"content",{},()=>[_("div",{class:"__content",onKeydown:U[2]||(U[2]=mr(Te(()=>{},["stop"]),["delete"]))},[_("div",LRt,[(O(!0),D($e,null,lt(g.value,Y=>Nn(P.$slots,"nodeInterface",{key:Y.id,type:"output",node:P.node,intf:Y},()=>[Ie(uR,{node:P.node,intf:Y},null,8,["node","intf"])])),128))]),_("div",kRt,[(O(!0),D($e,null,lt(E.value,Y=>Nn(P.$slots,"nodeInterface",{key:Y.id,type:"input",node:P.node,intf:Y},()=>[Ie(uR,{node:P.node,intf:Y},null,8,["node","intf"])])),128))])],32)])],46,IRt))}}),URt=ln({props:{x1:{type:Number,required:!0},y1:{type:Number,required:!0},x2:{type:Number,required:!0},y2:{type:Number,required:!0},state:{type:Number,default:_i.NONE},isTemporary:{type:Boolean,default:!1}},setup(n){const{viewModel:e}=yi(),{graph:t}=Ui(),i=(o,a)=>{const l=(o+t.value.panning.x)*t.value.scaling,c=(a+t.value.panning.y)*t.value.scaling;return[l,c]},s=et(()=>{const[o,a]=i(n.x1,n.y1),[l,c]=i(n.x2,n.y2);if(e.value.settings.useStraightConnections)return`M ${o} ${a} L ${l} ${c}`;{const d=.3*Math.abs(o-l);return`M ${o} ${a} C ${o+d} ${a}, ${l-d} ${c}, ${l} ${c}`}}),r=et(()=>({"--temporary":n.isTemporary,"--allowed":n.state===_i.ALLOWED,"--forbidden":n.state===_i.FORBIDDEN}));return{d:s,classes:r}}}),FRt=["d"];function BRt(n,e,t,i,s,r){return O(),D("path",{class:He(["baklava-connection",n.classes]),d:n.d},null,10,FRt)}const lI=cn(URt,[["render",BRt]]);function GRt(n){return document.getElementById(n.id)}function Na(n){const e=document.getElementById(n.id),t=e==null?void 0:e.getElementsByClassName("__port");return{node:(e==null?void 0:e.closest(".baklava-node"))??null,interface:e,port:t&&t.length>0?t[0]:null}}const VRt=ln({components:{"connection-view":lI},props:{connection:{type:Object,required:!0}},setup(n){const{graph:e}=Ui();let t;const i=dt({x1:0,y1:0,x2:0,y2:0}),s=et(()=>n.connection.isInDanger?_i.FORBIDDEN:_i.NONE),r=et(()=>{var c;return(c=e.value.findNodeById(n.connection.from.nodeId))==null?void 0:c.position}),o=et(()=>{var c;return(c=e.value.findNodeById(n.connection.to.nodeId))==null?void 0:c.position}),a=c=>c.node&&c.interface&&c.port?[c.node.offsetLeft+c.interface.offsetLeft+c.port.offsetLeft+c.port.clientWidth/2,c.node.offsetTop+c.interface.offsetTop+c.port.offsetTop+c.port.clientHeight/2]:[0,0],l=()=>{const c=Na(n.connection.from),d=Na(n.connection.to);c.node&&d.node&&(t||(t=new ResizeObserver(()=>{l()}),t.observe(c.node),t.observe(d.node)));const[u,h]=a(c),[m,f]=a(d);i.value={x1:u,y1:h,x2:m,y2:f}};return Ms(async()=>{await Fe(),l()}),La(()=>{t&&t.disconnect()}),Bn([r,o],()=>l(),{deep:!0}),{d:i,state:s}}});function zRt(n,e,t,i,s,r){const o=_t("connection-view");return O(),Ot(o,{x1:n.d.x1,y1:n.d.y1,x2:n.d.x2,y2:n.d.y2,state:n.state},null,8,["x1","y1","x2","y2","state"])}const HRt=cn(VRt,[["render",zRt]]);function cu(n){return n.node&&n.interface&&n.port?[n.node.offsetLeft+n.interface.offsetLeft+n.port.offsetLeft+n.port.clientWidth/2,n.node.offsetTop+n.interface.offsetTop+n.port.offsetTop+n.port.clientHeight/2]:[0,0]}const qRt=ln({components:{"connection-view":lI},props:{connection:{type:Object,required:!0}},setup(n){const e=et(()=>n.connection?n.connection.status:_i.NONE);return{d:et(()=>{if(!n.connection)return{input:[0,0],output:[0,0]};const i=cu(Na(n.connection.from)),s=n.connection.to?cu(Na(n.connection.to)):[n.connection.mx||i[0],n.connection.my||i[1]];return n.connection.from.isInput?{input:s,output:i}:{input:i,output:s}}),status:e}}});function YRt(n,e,t,i,s,r){const o=_t("connection-view");return O(),Ot(o,{x1:n.d.input[0],y1:n.d.input[1],x2:n.d.output[0],y2:n.d.output[1],state:n.status,"is-temporary":""},null,8,["x1","y1","x2","y2","state"])}const $Rt=cn(qRt,[["render",YRt]]),WRt=ln({setup(){const{viewModel:n}=yi(),{graph:e}=Ui(),t=dt(null),i=kd(n.value.settings.sidebar,"width"),s=et(()=>n.value.settings.sidebar.resizable),r=et(()=>{const u=e.value.sidebar.nodeId;return e.value.nodes.find(h=>h.id===u)}),o=et(()=>({width:`${i.value}px`})),a=et(()=>r.value?[...Object.values(r.value.inputs),...Object.values(r.value.outputs)].filter(h=>h.displayInSidebar&&h.component):[]),l=()=>{e.value.sidebar.visible=!1},c=()=>{window.addEventListener("mousemove",d),window.addEventListener("mouseup",()=>{window.removeEventListener("mousemove",d)},{once:!0})},d=u=>{var h,m;const f=((m=(h=t.value)==null?void 0:h.parentElement)==null?void 0:m.getBoundingClientRect().width)??500;let b=i.value-u.movementX;b<300?b=300:b>.9*f&&(b=.9*f),i.value=b};return{el:t,graph:e,resizable:s,node:r,styles:o,displayedInterfaces:a,startResize:c,close:l}}}),KRt={class:"__header"},jRt={class:"__node-name"};function QRt(n,e,t,i,s,r){return O(),D("div",{ref:"el",class:He(["baklava-sidebar",{"--open":n.graph.sidebar.visible}]),style:Xt(n.styles)},[n.resizable?(O(),D("div",{key:0,class:"__resizer",onMousedown:e[0]||(e[0]=(...o)=>n.startResize&&n.startResize(...o))},null,32)):j("",!0),_("div",KRt,[_("button",{tabindex:"-1",class:"__close",onClick:e[1]||(e[1]=(...o)=>n.close&&n.close(...o))},"×"),_("div",jRt,[_("b",null,he(n.node?n.node.title:""),1)])]),(O(!0),D($e,null,lt(n.displayedInterfaces,o=>(O(),D("div",{key:o.id,class:"__interface"},[(O(),Ot(Tu(o.component),{modelValue:o.value,"onUpdate:modelValue":a=>o.value=a,node:n.node,intf:o},null,8,["modelValue","onUpdate:modelValue","node","intf"]))]))),128))],6)}const XRt=cn(WRt,[["render",QRt]]),ZRt=ln({__name:"Minimap",setup(n){const{viewModel:e}=yi(),{graph:t}=Ui(),i=dt(null),s=dt(!1);let r,o=!1,a={x1:0,y1:0,x2:0,y2:0},l;const c=()=>{var x,w;if(!r)return;r.canvas.width=i.value.offsetWidth,r.canvas.height=i.value.offsetHeight;const R=new Map,v=new Map;for(const L of t.value.nodes){const H=GRt(L),B=(H==null?void 0:H.offsetWidth)??0,k=(H==null?void 0:H.offsetHeight)??0,$=((x=L.position)==null?void 0:x.x)??0,K=((w=L.position)==null?void 0:w.y)??0;R.set(L,{x1:$,y1:K,x2:$+B,y2:K+k}),v.set(L,H)}const A={x1:Number.MAX_SAFE_INTEGER,y1:Number.MAX_SAFE_INTEGER,x2:Number.MIN_SAFE_INTEGER,y2:Number.MIN_SAFE_INTEGER};for(const L of R.values())L.x1A.x2&&(A.x2=L.x2),L.y2>A.y2&&(A.y2=L.y2);const P=50;A.x1-=P,A.y1-=P,A.x2+=P,A.y2+=P,a=A;const U=r.canvas.width/r.canvas.height,Y=(a.x2-a.x1)/(a.y2-a.y1);if(U>Y){const L=(U-Y)*(a.y2-a.y1)*.5;a.x1-=L,a.x2+=L}else{const L=a.x2-a.x1,H=a.y2-a.y1,B=(L-U*H)/U*.5;a.y1-=B,a.y2+=B}r.clearRect(0,0,r.canvas.width,r.canvas.height),r.strokeStyle="white";for(const L of t.value.connections){const[H,B]=cu(Na(L.from)),[k,$]=cu(Na(L.to)),[K,W]=d(H,B),[le,J]=d(k,$);if(r.beginPath(),r.moveTo(K,W),e.value.settings.useStraightConnections)r.lineTo(le,J);else{const ee=.3*Math.abs(K-le);r.bezierCurveTo(K+ee,W,le-ee,J,le,J)}r.stroke()}r.strokeStyle="lightgray";for(const[L,H]of R.entries()){const[B,k]=d(H.x1,H.y1),[$,K]=d(H.x2,H.y2);r.fillStyle=h(v.get(L)),r.beginPath(),r.rect(B,k,$-B,K-k),r.fill(),r.stroke()}if(s.value){const L=f(),[H,B]=d(L.x1,L.y1),[k,$]=d(L.x2,L.y2);r.fillStyle="rgba(255, 255, 255, 0.2)",r.fillRect(H,B,k-H,$-B)}},d=(x,w)=>[(x-a.x1)/(a.x2-a.x1)*r.canvas.width,(w-a.y1)/(a.y2-a.y1)*r.canvas.height],u=(x,w)=>[x*(a.x2-a.x1)/r.canvas.width+a.x1,w*(a.y2-a.y1)/r.canvas.height+a.y1],h=x=>{if(x){const w=x.querySelector(".__content");if(w){const v=m(w);if(v)return v}const R=m(x);if(R)return R}return"gray"},m=x=>{const w=getComputedStyle(x).backgroundColor;if(w&&w!=="rgba(0, 0, 0, 0)")return w},f=()=>{const x=i.value.parentElement.offsetWidth,w=i.value.parentElement.offsetHeight,R=x/t.value.scaling-t.value.panning.x,v=w/t.value.scaling-t.value.panning.y;return{x1:-t.value.panning.x,y1:-t.value.panning.y,x2:R,y2:v}},b=x=>{x.button===0&&(o=!0,E(x))},E=x=>{if(o){const[w,R]=u(x.offsetX,x.offsetY),v=f(),A=(v.x2-v.x1)/2,P=(v.y2-v.y1)/2;t.value.panning.x=-(w-A),t.value.panning.y=-(R-P)}},g=()=>{o=!1},S=()=>{s.value=!0},y=()=>{s.value=!1,g()};Bn([s,t.value.panning,()=>t.value.scaling,()=>t.value.connections.length],()=>{c()});const T=et(()=>t.value.nodes.map(x=>x.position)),C=et(()=>t.value.nodes.map(x=>x.width));return Bn([T,C],()=>{c()},{deep:!0}),Ms(()=>{r=i.value.getContext("2d"),r.imageSmoothingQuality="high",c(),l=setInterval(c,500)}),La(()=>{clearInterval(l)}),(x,w)=>(O(),D("canvas",{ref_key:"canvas",ref:i,class:"baklava-minimap",onMouseenter:S,onMouseleave:y,onMousedown:Te(b,["self"]),onMousemove:Te(E,["self"]),onMouseup:g},null,544))}}),JRt=ln({components:{ContextMenu:$b,VerticalDots:aI},props:{type:{type:String,required:!0},title:{type:String,required:!0}},setup(n){const{viewModel:e}=yi(),{switchGraph:t}=Ui(),i=dt(!1),s=et(()=>n.type.startsWith(Jl));return{showContextMenu:i,hasContextMenu:s,contextMenuItems:[{label:"Edit Subgraph",value:"editSubgraph"},{label:"Delete Subgraph",value:"deleteSubgraph"}],openContextMenu:()=>{i.value=!0},onContextMenuClick:l=>{const c=n.type.substring(Jl.length),d=e.value.editor.graphTemplates.find(u=>u.id===c);if(d)switch(l){case"editSubgraph":t(d);break;case"deleteSubgraph":e.value.editor.removeGraphTemplate(d);break}}}}}),eAt=["data-node-type"],tAt={class:"__title"},nAt={class:"__title-label"},iAt={key:0,class:"__menu"};function sAt(n,e,t,i,s,r){const o=_t("vertical-dots"),a=_t("context-menu");return O(),D("div",{class:"baklava-node --palette","data-node-type":n.type},[_("div",tAt,[_("div",nAt,he(n.title),1),n.hasContextMenu?(O(),D("div",iAt,[Ie(o,{class:"--clickable",onPointerdown:e[0]||(e[0]=Te(()=>{},["stop","prevent"])),onClick:Te(n.openContextMenu,["stop","prevent"])},null,8,["onClick"]),Ie(a,{modelValue:n.showContextMenu,"onUpdate:modelValue":e[1]||(e[1]=l=>n.showContextMenu=l),x:-100,y:0,items:n.contextMenuItems,onClick:n.onContextMenuClick,onPointerdown:e[2]||(e[2]=Te(()=>{},["stop","prevent"]))},null,8,["modelValue","items","onClick"])])):j("",!0)])],8,eAt)}const pR=cn(JRt,[["render",sAt]]),rAt={class:"baklava-node-palette"},oAt={key:0},aAt=ln({__name:"NodePalette",setup(n){const{viewModel:e}=yi(),{x:t,y:i}=hRt(),{transform:s}=nI(),r=tI(e),o=Ii("editorEl"),a=dt(null),l=et(()=>{if(!a.value||!(o!=null&&o.value))return{};const{left:d,top:u}=o.value.getBoundingClientRect();return{top:`${i.value-u}px`,left:`${t.value-d}px`}}),c=(d,u)=>{a.value={type:d,nodeInformation:u};const h=()=>{const m=jn(new u.type);e.value.displayedGraph.addNode(m);const f=o.value.getBoundingClientRect(),[b,E]=s(t.value-f.left,i.value-f.top);m.position.x=b,m.position.y=E,a.value=null,document.removeEventListener("pointerup",h)};document.addEventListener("pointerup",h)};return(d,u)=>(O(),D($e,null,[_("div",rAt,[(O(!0),D($e,null,lt(vt(r),h=>(O(),D("section",{key:h.name},[h.name!=="default"?(O(),D("h1",oAt,he(h.name),1)):j("",!0),(O(!0),D($e,null,lt(h.nodeTypes,(m,f)=>(O(),Ot(pR,{key:f,type:f,title:m.title,onPointerdown:b=>c(f,m)},null,8,["type","title","onPointerdown"]))),128))]))),128))]),Ie(ws,{name:"fade"},{default:ot(()=>[a.value?(O(),D("div",{key:0,class:"baklava-dragged-node",style:Xt(l.value)},[Ie(pR,{type:a.value.type,title:a.value.nodeInformation.title},null,8,["type","title"])],4)):j("",!0)]),_:1})],64))}});let fd;const lAt=new Uint8Array(16);function cAt(){if(!fd&&(fd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!fd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return fd(lAt)}const vn=[];for(let n=0;n<256;++n)vn.push((n+256).toString(16).slice(1));function dAt(n,e=0){return vn[n[e+0]]+vn[n[e+1]]+vn[n[e+2]]+vn[n[e+3]]+"-"+vn[n[e+4]]+vn[n[e+5]]+"-"+vn[n[e+6]]+vn[n[e+7]]+"-"+vn[n[e+8]]+vn[n[e+9]]+"-"+vn[n[e+10]]+vn[n[e+11]]+vn[n[e+12]]+vn[n[e+13]]+vn[n[e+14]]+vn[n[e+15]]}const uAt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),_R={randomUUID:uAt};function du(n,e,t){if(_R.randomUUID&&!e&&!n)return _R.randomUUID();n=n||{};const i=n.random||(n.rng||cAt)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){t=t||0;for(let s=0;s<16;++s)e[t+s]=i[s];return e}return dAt(i)}const ec="SAVE_SUBGRAPH";function pAt(n,e){const t=()=>{const i=n.value;if(!i.template)throw new Error("Graph template property not set");i.template.update(i.save()),i.template.panning=i.panning,i.template.scaling=i.scaling};e.registerCommand(ec,{canExecute:()=>{var i;return n.value!==((i=n.value.editor)==null?void 0:i.graph)},execute:t})}const _At={},hAt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},fAt=_("polyline",{points:"6 9 12 15 18 9"},null,-1),mAt=[fAt];function gAt(n,e){return O(),D("svg",hAt,mAt)}const EAt=cn(_At,[["render",gAt]]),bAt=ln({components:{"i-arrow":EAt},props:{intf:{type:Object,required:!0}},setup(n){const e=dt(null),t=dt(!1),i=et(()=>n.intf.items.find(o=>typeof o=="string"?o===n.intf.value:o.value===n.intf.value)),s=et(()=>i.value?typeof i.value=="string"?i.value:i.value.text:""),r=o=>{n.intf.value=typeof o=="string"?o:o.value};return rI(e,()=>{t.value=!1}),{el:e,open:t,selectedItem:i,selectedText:s,setSelected:r}}}),SAt=["title"],vAt={class:"__selected"},yAt={class:"__text"},TAt={class:"__icon"},xAt={class:"__dropdown"},CAt={class:"item --header"},RAt=["onClick"];function AAt(n,e,t,i,s,r){const o=_t("i-arrow");return O(),D("div",{ref:"el",class:He(["baklava-select",{"--open":n.open}]),title:n.intf.name,onClick:e[0]||(e[0]=a=>n.open=!n.open)},[_("div",vAt,[_("div",yAt,he(n.selectedText),1),_("div",TAt,[Ie(o)])]),Ie(ws,{name:"slide-fade"},{default:ot(()=>[xe(_("div",xAt,[_("div",CAt,he(n.intf.name),1),(O(!0),D($e,null,lt(n.intf.items,(a,l)=>(O(),D("div",{key:l,class:He(["item",{"--active":a===n.selectedItem}]),onClick:c=>n.setSelected(a)},he(typeof a=="string"?a:a.text),11,RAt))),128))],512),[[At,n.open]])]),_:1})],10,SAt)}const wAt=cn(bAt,[["render",AAt]]);class NAt extends pn{constructor(e,t,i){super(e,t),this.component=tc(wAt),this.items=i}}const OAt=ln({props:{intf:{type:Object,required:!0}}});function IAt(n,e,t,i,s,r){return O(),D("div",null,he(n.intf.value),1)}const MAt=cn(OAt,[["render",IAt]]);class DAt extends pn{constructor(e,t){super(e,t),this.component=tc(MAt),this.setPort(!1)}}const LAt=ln({props:{intf:{type:Object,required:!0},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(n,{emit:e}){return{v:et({get:()=>n.modelValue,set:i=>{e("update:modelValue",i)}})}}}),kAt=["placeholder","title"];function PAt(n,e,t,i,s,r){return O(),D("div",null,[xe(_("input",{"onUpdate:modelValue":e[0]||(e[0]=o=>n.v=o),type:"text",class:"baklava-input",placeholder:n.intf.name,title:n.intf.name},null,8,kAt),[[Xe,n.v]])])}const UAt=cn(LAt,[["render",PAt]]);class tp extends pn{constructor(){super(...arguments),this.component=tc(UAt)}}class cI extends jO{constructor(){super(...arguments),this._title="Subgraph Input",this.inputs={name:new tp("Name","Input").setPort(!1)},this.outputs={placeholder:new pn("Connection",void 0)}}}class dI extends QO{constructor(){super(...arguments),this._title="Subgraph Output",this.inputs={name:new tp("Name","Output").setPort(!1),placeholder:new pn("Connection",void 0)},this.outputs={output:new pn("Output",void 0).setHidden(!0)}}}const uI="CREATE_SUBGRAPH",hR=[Ra,Aa];function FAt(n,e,t){const i=()=>n.value.selectedNodes.filter(r=>!hR.includes(r.type)).length>0,s=()=>{const{viewModel:r}=yi(),o=n.value,a=n.value.editor;if(o.selectedNodes.length===0)return;const l=o.selectedNodes.filter(v=>!hR.includes(v.type)),c=l.flatMap(v=>Object.values(v.inputs)),d=l.flatMap(v=>Object.values(v.outputs)),u=o.connections.filter(v=>!d.includes(v.from)&&c.includes(v.to)),h=o.connections.filter(v=>d.includes(v.from)&&!c.includes(v.to)),m=o.connections.filter(v=>d.includes(v.from)&&c.includes(v.to)),f=l.map(v=>v.save()),b=m.map(v=>({id:v.id,from:v.from.id,to:v.to.id})),E=new Map,{xLeft:g,xRight:S,yTop:y}=BAt(l);console.log(g,S,y);for(const[v,A]of u.entries()){const P=new cI;P.inputs.name.value=A.to.name,f.push({...P.save(),position:{x:S-r.value.settings.nodes.defaultWidth-100,y:y+v*200}}),b.push({id:du(),from:P.outputs.placeholder.id,to:A.to.id}),E.set(A.to.id,P.graphInterfaceId)}for(const[v,A]of h.entries()){const P=new dI;P.inputs.name.value=A.from.name,f.push({...P.save(),position:{x:g+100,y:y+v*200}}),b.push({id:du(),from:A.from.id,to:P.inputs.placeholder.id}),E.set(A.from.id,P.graphInterfaceId)}const T=jn(new ep({connections:b,nodes:f,inputs:[],outputs:[]},a));a.addGraphTemplate(T);const C=a.nodeTypes.get(wa(T));if(!C)throw new Error("Unable to create subgraph: Could not find corresponding graph node type");const x=jn(new C.type);o.addNode(x);const w=Math.round(l.map(v=>v.position.x).reduce((v,A)=>v+A,0)/l.length),R=Math.round(l.map(v=>v.position.y).reduce((v,A)=>v+A,0)/l.length);x.position.x=w,x.position.y=R,u.forEach(v=>{o.removeConnection(v),o.addConnection(v.from,x.inputs[E.get(v.to.id)])}),h.forEach(v=>{o.removeConnection(v),o.addConnection(x.outputs[E.get(v.from.id)],v.to)}),l.forEach(v=>o.removeNode(v)),e.canExecuteCommand(ec)&&e.executeCommand(ec),t(T),n.value.panning={...o.panning},n.value.scaling=o.scaling};e.registerCommand(uI,{canExecute:i,execute:s})}function BAt(n){const e=n.reduce((s,r)=>{const o=r.position.x;return o{const o=r.position.y;return o{const o=r.position.x+r.width;return o>s?o:s},-1/0),xRight:e,yTop:t}}const fR="DELETE_NODES";function GAt(n,e){e.registerCommand(fR,{canExecute:()=>n.value.selectedNodes.length>0,execute(){n.value.selectedNodes.forEach(t=>n.value.removeNode(t))}}),e.registerHotkey(["Delete"],fR)}const pI="SWITCH_TO_MAIN_GRAPH";function VAt(n,e,t){e.registerCommand(pI,{canExecute:()=>n.value!==n.value.editor.graph,execute:()=>{e.executeCommand(ec),t(n.value.editor.graph)}})}function zAt(n,e,t){GAt(n,e),FAt(n,e,t),pAt(n,e),VAt(n,e,t)}class mR{constructor(e,t){this.type=e,e==="addNode"?this.nodeId=t:this.nodeState=t}undo(e){this.type==="addNode"?this.removeNode(e):this.addNode(e)}redo(e){this.type==="addNode"&&this.nodeState?this.addNode(e):this.type==="removeNode"&&this.nodeId&&this.removeNode(e)}addNode(e){const t=e.editor.nodeTypes.get(this.nodeState.type);if(!t)return;const i=new t.type;e.addNode(i),i.load(this.nodeState),this.nodeId=i.id}removeNode(e){const t=e.nodes.find(i=>i.id===this.nodeId);t&&(this.nodeState=t.save(),e.removeNode(t))}}class gR{constructor(e,t){if(this.type=e,e==="addConnection")this.connectionId=t;else{const i=t;this.connectionState={id:i.id,from:i.from.id,to:i.to.id}}}undo(e){this.type==="addConnection"?this.removeConnection(e):this.addConnection(e)}redo(e){this.type==="addConnection"&&this.connectionState?this.addConnection(e):this.type==="removeConnection"&&this.connectionId&&this.removeConnection(e)}addConnection(e){const t=e.findNodeInterface(this.connectionState.from),i=e.findNodeInterface(this.connectionState.to);!t||!i||e.addConnection(t,i)}removeConnection(e){const t=e.connections.find(i=>i.id===this.connectionId);t&&(this.connectionState={id:t.id,from:t.from.id,to:t.to.id},e.removeConnection(t))}}class HAt{constructor(e){if(this.type="transaction",e.length===0)throw new Error("Can't create a transaction with no steps");this.steps=e}undo(e){for(let t=this.steps.length-1;t>=0;t--)this.steps[t].undo(e)}redo(e){for(let t=0;t{if(!r.value)if(a.value)l.value.push(E);else for(o.value!==s.value.length-1&&(s.value=s.value.slice(0,o.value+1)),s.value.push(E),o.value++;s.value.length>i.value;)s.value.shift()},d=()=>{a.value=!0},u=()=>{a.value=!1,l.value.length>0&&(c(new HAt(l.value)),l.value=[])},h=()=>s.value.length!==0&&o.value!==-1,m=()=>{h()&&(r.value=!0,s.value[o.value--].undo(n.value),r.value=!1)},f=()=>s.value.length!==0&&o.value{f()&&(r.value=!0,s.value[++o.value].redo(n.value),r.value=!1)};return Bn(n,(E,g)=>{g&&(g.events.addNode.unsubscribe(t),g.events.removeNode.unsubscribe(t),g.events.addConnection.unsubscribe(t),g.events.removeConnection.unsubscribe(t)),E&&(E.events.addNode.subscribe(t,S=>{c(new mR("addNode",S.id))}),E.events.removeNode.subscribe(t,S=>{c(new mR("removeNode",S.save()))}),E.events.addConnection.subscribe(t,S=>{c(new gR("addConnection",S.id))}),E.events.removeConnection.subscribe(t,S=>{c(new gR("removeConnection",S))}))},{immediate:!0}),e.registerCommand(eE,{canExecute:h,execute:m}),e.registerCommand(tE,{canExecute:f,execute:b}),e.registerCommand(_I,{canExecute:()=>!a.value,execute:d}),e.registerCommand(hI,{canExecute:()=>a.value,execute:u}),e.registerHotkey(["Control","z"],eE),e.registerHotkey(["Control","y"],tE),jn({maxSteps:i})}const nE="COPY",iE="PASTE",YAt="CLEAR_CLIPBOARD";function $At(n,e,t){const i=Symbol("ClipboardToken"),s=dt(""),r=dt(""),o=et(()=>!s.value),a=()=>{s.value="",r.value=""},l=()=>{const u=n.value.selectedNodes.flatMap(m=>[...Object.values(m.inputs),...Object.values(m.outputs)]),h=n.value.connections.filter(m=>u.includes(m.from)||u.includes(m.to)).map(m=>({from:m.from.id,to:m.to.id}));r.value=JSON.stringify(h),s.value=JSON.stringify(n.value.selectedNodes.map(m=>m.save()))},c=(u,h,m)=>{for(const f of u){let b;if((!m||m==="input")&&(b=Object.values(f.inputs).find(E=>E.id===h)),!b&&(!m||m==="output")&&(b=Object.values(f.outputs).find(E=>E.id===h)),b)return b}},d=()=>{if(o.value)return;const u=new Map,h=JSON.parse(s.value),m=JSON.parse(r.value),f=[],b=[],E=n.value;t.executeCommand(_I);for(const g of h){const S=e.value.nodeTypes.get(g.type);if(!S){console.warn(`Node type ${g.type} not registered`);return}const y=new S.type,T=y.id;f.push(y),y.hooks.beforeLoad.subscribe(i,C=>{const x=C;return x.position&&(x.position.x+=100,x.position.y+=100),y.hooks.beforeLoad.unsubscribe(i),x}),E.addNode(y),y.load({...g,id:T}),y.id=T,u.set(g.id,T);for(const C of Object.values(y.inputs)){const x=du();u.set(C.id,x),C.id=x}for(const C of Object.values(y.outputs)){const x=du();u.set(C.id,x),C.id=x}}for(const g of m){const S=c(f,u.get(g.from),"output"),y=c(f,u.get(g.to),"input");if(!S||!y)continue;const T=E.addConnection(S,y);T&&b.push(T)}return n.value.selectedNodes=f,t.executeCommand(hI),{newNodes:f,newConnections:b}};return t.registerCommand(nE,{canExecute:()=>n.value.selectedNodes.length>0,execute:l}),t.registerHotkey(["Control","c"],nE),t.registerCommand(iE,{canExecute:()=>!o.value,execute:d}),t.registerHotkey(["Control","v"],iE),t.registerCommand(YAt,{canExecute:()=>!0,execute:a}),jn({isEmpty:o})}const WAt="OPEN_SIDEBAR";function KAt(n,e){e.registerCommand(WAt,{execute:t=>{n.value.sidebar.nodeId=t,n.value.sidebar.visible=!0},canExecute:()=>!0})}function jAt(n,e){KAt(n,e)}const QAt={},XAt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},ZAt=_("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),JAt=_("path",{d:"M9 13l-4 -4l4 -4m-4 4h11a4 4 0 0 1 0 8h-1"},null,-1),ewt=[ZAt,JAt];function twt(n,e){return O(),D("svg",XAt,ewt)}const nwt=cn(QAt,[["render",twt]]),iwt={},swt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},rwt=_("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),owt=_("path",{d:"M15 13l4 -4l-4 -4m4 4h-11a4 4 0 0 0 0 8h1"},null,-1),awt=[rwt,owt];function lwt(n,e){return O(),D("svg",swt,awt)}const cwt=cn(iwt,[["render",lwt]]),dwt={},uwt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},pwt=_("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),_wt=_("line",{x1:"5",y1:"12",x2:"19",y2:"12"},null,-1),hwt=_("line",{x1:"5",y1:"12",x2:"11",y2:"18"},null,-1),fwt=_("line",{x1:"5",y1:"12",x2:"11",y2:"6"},null,-1),mwt=[pwt,_wt,hwt,fwt];function gwt(n,e){return O(),D("svg",uwt,mwt)}const Ewt=cn(dwt,[["render",gwt]]),bwt={},Swt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},vwt=_("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),ywt=_("path",{d:"M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2"},null,-1),Twt=_("rect",{x:"9",y:"3",width:"6",height:"4",rx:"2"},null,-1),xwt=[vwt,ywt,Twt];function Cwt(n,e){return O(),D("svg",Swt,xwt)}const Rwt=cn(bwt,[["render",Cwt]]),Awt={},wwt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},Nwt=_("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),Owt=_("rect",{x:"8",y:"8",width:"12",height:"12",rx:"2"},null,-1),Iwt=_("path",{d:"M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2"},null,-1),Mwt=[Nwt,Owt,Iwt];function Dwt(n,e){return O(),D("svg",wwt,Mwt)}const Lwt=cn(Awt,[["render",Dwt]]),kwt={},Pwt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},Uwt=_("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),Fwt=_("path",{d:"M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2"},null,-1),Bwt=_("circle",{cx:"12",cy:"14",r:"2"},null,-1),Gwt=_("polyline",{points:"14 4 14 8 8 8 8 4"},null,-1),Vwt=[Uwt,Fwt,Bwt,Gwt];function zwt(n,e){return O(),D("svg",Pwt,Vwt)}const Hwt=cn(kwt,[["render",zwt]]),qwt={},Ywt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},$wt=Ru('',6),Wwt=[$wt];function Kwt(n,e){return O(),D("svg",Ywt,Wwt)}const jwt=cn(qwt,[["render",Kwt]]),Qwt=ln({props:{command:{type:String,required:!0},title:{type:String,required:!0},icon:{type:Object,required:!1,default:void 0}},setup(){const{viewModel:n}=yi();return{viewModel:n}}}),Xwt=["disabled","title"];function Zwt(n,e,t,i,s,r){return O(),D("button",{class:"baklava-toolbar-entry baklava-toolbar-button",disabled:!n.viewModel.commandHandler.canExecuteCommand(n.command),title:n.title,onClick:e[0]||(e[0]=o=>n.viewModel.commandHandler.executeCommand(n.command))},[n.icon?(O(),Ot(Tu(n.icon),{key:0})):(O(),D($e,{key:1},[je(he(n.title),1)],64))],8,Xwt)}const Jwt=cn(Qwt,[["render",Zwt]]),eNt=ln({components:{ToolbarButton:Jwt},setup(){const{viewModel:n}=yi();return{isSubgraph:et(()=>n.value.displayedGraph!==n.value.editor.graph),commands:[{command:nE,title:"Copy",icon:Lwt},{command:iE,title:"Paste",icon:Rwt},{command:eE,title:"Undo",icon:nwt},{command:tE,title:"Redo",icon:cwt},{command:uI,title:"Create Subgraph",icon:jwt}],subgraphCommands:[{command:ec,title:"Save Subgraph",icon:Hwt},{command:pI,title:"Back to Main Graph",icon:Ewt}]}}}),tNt={class:"baklava-toolbar"};function nNt(n,e,t,i,s,r){const o=_t("toolbar-button");return O(),D("div",tNt,[(O(!0),D($e,null,lt(n.commands,a=>(O(),Ot(o,{key:a.command,command:a.command,title:a.title,icon:a.icon},null,8,["command","title","icon"]))),128)),n.isSubgraph?(O(!0),D($e,{key:0},lt(n.subgraphCommands,a=>(O(),Ot(o,{key:a.command,command:a.command,title:a.title,icon:a.icon},null,8,["command","title","icon"]))),128)):j("",!0)])}const iNt=cn(eNt,[["render",nNt]]),sNt={class:"connections-container"},rNt=ln({__name:"Editor",props:{viewModel:{}},setup(n){const e=n,t=Symbol("EditorToken"),i=kd(e,"viewModel");J1t(i);const s=dt(null);Qo("editorEl",s);const r=et(()=>e.viewModel.displayedGraph.nodes),o=et(()=>e.viewModel.displayedGraph.nodes.map(w=>JO(kd(w,"position")))),a=et(()=>e.viewModel.displayedGraph.connections),l=et(()=>e.viewModel.displayedGraph.selectedNodes),c=eRt(),d=tRt(),u=nRt(i),h=et(()=>({...c.styles.value})),m=dt(0);e.viewModel.editor.hooks.load.subscribe(t,w=>(m.value++,w));const f=w=>{c.onPointerMove(w),d.onMouseMove(w)},b=w=>{w.button===0&&(w.target===s.value&&(T(),c.onPointerDown(w)),d.onMouseDown())},E=w=>{c.onPointerUp(w),d.onMouseUp()},g=w=>{w.key==="Tab"&&w.preventDefault(),e.viewModel.commandHandler.handleKeyDown(w)},S=w=>{e.viewModel.commandHandler.handleKeyUp(w)},y=w=>{["Control","Shift"].some(R=>e.viewModel.commandHandler.pressedKeys.includes(R))||T(),e.viewModel.displayedGraph.selectedNodes.push(w)},T=()=>{e.viewModel.displayedGraph.selectedNodes=[]},C=w=>{for(const R of e.viewModel.displayedGraph.selectedNodes){const v=r.value.indexOf(R),A=o.value[v];A.onPointerDown(w),document.addEventListener("pointermove",A.onPointerMove)}document.addEventListener("pointerup",x)},x=()=>{for(const w of e.viewModel.displayedGraph.selectedNodes){const R=r.value.indexOf(w),v=o.value[R];v.onPointerUp(),document.removeEventListener("pointermove",v.onPointerMove)}document.removeEventListener("pointerup",x)};return(w,R)=>(O(),D("div",{ref_key:"el",ref:s,tabindex:"-1",class:He(["baklava-editor",{"baklava-ignore-mouse":!!vt(d).temporaryConnection.value||vt(c).dragging.value,"--temporary-connection":!!vt(d).temporaryConnection.value}]),onPointermove:Te(f,["self"]),onPointerdown:b,onPointerup:E,onWheel:R[1]||(R[1]=Te((...v)=>vt(c).onMouseWheel&&vt(c).onMouseWheel(...v),["self"])),onKeydown:g,onKeyup:S,onContextmenu:R[2]||(R[2]=Te((...v)=>vt(u).open&&vt(u).open(...v),["self","prevent"]))},[Nn(w.$slots,"background",{},()=>[Ie(rRt)]),Nn(w.$slots,"toolbar",{},()=>[Ie(iNt)]),Nn(w.$slots,"palette",{},()=>[Ie(aAt)]),(O(),D("svg",sNt,[(O(!0),D($e,null,lt(a.value,v=>(O(),D("g",{key:v.id+m.value.toString()},[Nn(w.$slots,"connection",{connection:v},()=>[Ie(HRt,{connection:v},null,8,["connection"])])]))),128)),Nn(w.$slots,"temporaryConnection",{temporaryConnection:vt(d).temporaryConnection.value},()=>[vt(d).temporaryConnection.value?(O(),Ot($Rt,{key:0,connection:vt(d).temporaryConnection.value},null,8,["connection"])):j("",!0)])])),_("div",{class:"node-container",style:Xt(h.value)},[Ie(ys,{name:"fade"},{default:ot(()=>[(O(!0),D($e,null,lt(r.value,(v,A)=>Nn(w.$slots,"node",{key:v.id+m.value.toString(),node:v,selected:l.value.includes(v),dragging:o.value[A].dragging.value,onSelect:P=>y(v),onStartDrag:C},()=>[Ie(PRt,{node:v,selected:l.value.includes(v),dragging:o.value[A].dragging.value,onSelect:P=>y(v),onStartDrag:C},null,8,["node","selected","dragging","onSelect"])])),128))]),_:3})],4),Nn(w.$slots,"sidebar",{},()=>[Ie(XRt)]),Nn(w.$slots,"minimap",{},()=>[w.viewModel.settings.enableMinimap?(O(),Ot(ZRt,{key:0})):j("",!0)]),Nn(w.$slots,"contextMenu",{contextMenu:vt(u)},()=>[w.viewModel.settings.contextMenu.enabled?(O(),Ot($b,{key:0,modelValue:vt(u).show.value,"onUpdate:modelValue":R[0]||(R[0]=v=>vt(u).show.value=v),items:vt(u).items.value,x:vt(u).x.value,y:vt(u).y.value,onClick:vt(u).onClick},null,8,["modelValue","items","x","y","onClick"])):j("",!0)])],34))}}),oNt=["INPUT","TEXTAREA","SELECT"];function aNt(n){const e=dt([]),t=dt([]);return{pressedKeys:e,handleKeyDown:o=>{var a;e.value.includes(o.key)||e.value.push(o.key),!oNt.includes(((a=document.activeElement)==null?void 0:a.tagName)??"")&&t.value.forEach(l=>{l.keys.every(c=>e.value.includes(c))&&n(l.commandName)})},handleKeyUp:o=>{const a=e.value.indexOf(o.key);a>=0&&e.value.splice(a,1)},registerHotkey:(o,a)=>{t.value.push({keys:o,commandName:a})}}}const lNt=()=>{const n=dt(new Map),e=(r,o)=>{if(n.value.has(r))throw new Error(`Command "${r}" already exists`);n.value.set(r,o)},t=(r,o=!1,...a)=>{if(!n.value.has(r)){if(o)throw new Error(`[CommandHandler] Command ${r} not registered`);return}return n.value.get(r).execute(...a)},i=(r,o=!1,...a)=>{if(!n.value.has(r)){if(o)throw new Error(`[CommandHandler] Command ${r} not registered`);return!1}return n.value.get(r).canExecute(a)},s=aNt(t);return jn({registerCommand:e,executeCommand:t,canExecuteCommand:i,...s})},cNt=n=>!(n instanceof mc);function dNt(n,e){return{switchGraph:i=>{let s;if(cNt(i))s=new mc(n.value),i.createGraph(s);else{if(i!==n.value.graph)throw new Error("Can only switch using 'Graph' instance when it is the root graph. Otherwise a 'GraphTemplate' must be used.");s=i}e.value&&e.value!==n.value.graph&&e.value.destroy(),s.panning=s.panning??i.panning??{x:0,y:0},s.scaling=s.scaling??i.scaling??1,s.selectedNodes=s.selectedNodes??[],s.sidebar=s.sidebar??{visible:!1,nodeId:"",optionName:""},e.value=s}}}function uNt(n,e){n.position=n.position??{x:0,y:0},n.disablePointerEvents=!1,n.twoColumn=n.twoColumn??!1,n.width=n.width??e.defaultWidth}const pNt=()=>({useStraightConnections:!1,enableMinimap:!1,background:{gridSize:100,gridDivision:5,subGridVisibleThreshold:.6},sidebar:{width:300,resizable:!0},displayValueOnHover:!1,nodes:{defaultWidth:200,maxWidth:320,minWidth:150,resizable:!1},contextMenu:{enabled:!0,additionalItems:[]}});function _Nt(n){const e=dt(n??new W1t),t=Symbol("ViewModelToken"),i=dt(null),s=gM(i),{switchGraph:r}=dNt(e,i),o=et(()=>s.value&&s.value!==e.value.graph),a=jn(pNt()),l=lNt(),c=qAt(s,l),d=$At(s,e,l),u={renderNode:new ii(null),renderInterface:new ii(null)};return zAt(s,l,r),jAt(s,l),Bn(e,(h,m)=>{m&&(m.events.registerGraph.unsubscribe(t),m.graphEvents.beforeAddNode.unsubscribe(t),h.nodeHooks.beforeLoad.unsubscribe(t),h.nodeHooks.afterSave.unsubscribe(t),h.graphTemplateHooks.beforeLoad.unsubscribe(t),h.graphTemplateHooks.afterSave.unsubscribe(t),h.graph.hooks.load.unsubscribe(t),h.graph.hooks.save.unsubscribe(t)),h&&(h.nodeHooks.beforeLoad.subscribe(t,(f,b)=>(b.position=f.position??{x:0,y:0},b.width=f.width??a.nodes.defaultWidth,b.twoColumn=f.twoColumn??!1,f)),h.nodeHooks.afterSave.subscribe(t,(f,b)=>(f.position=b.position,f.width=b.width,f.twoColumn=b.twoColumn,f)),h.graphTemplateHooks.beforeLoad.subscribe(t,(f,b)=>(b.panning=f.panning,b.scaling=f.scaling,f)),h.graphTemplateHooks.afterSave.subscribe(t,(f,b)=>(f.panning=b.panning,f.scaling=b.scaling,f)),h.graph.hooks.load.subscribe(t,(f,b)=>(b.panning=f.panning,b.scaling=f.scaling,f)),h.graph.hooks.save.subscribe(t,(f,b)=>(f.panning=b.panning,f.scaling=b.scaling,f)),h.graphEvents.beforeAddNode.subscribe(t,f=>uNt(f,{defaultWidth:a.nodes.defaultWidth})),e.value.registerNodeType(cI,{category:"Subgraphs"}),e.value.registerNodeType(dI,{category:"Subgraphs"}),r(h.graph))},{immediate:!0}),jn({editor:e,displayedGraph:s,isSubgraph:o,settings:a,commandHandler:l,history:c,clipboard:d,hooks:u,switchGraph:r})}const ER=Hb({type:"AgentNode",title:"Agent",inputs:{request:()=>new pn("Request",""),agent_name:()=>new NAt("Agent name","",sE.state.config.personalities).setPort(!1)},outputs:{display:()=>new DAt("Output",""),response:()=>new pn("Response","")},async calculate({request:n}){console.log(sE.state.config.personalities);let e="";try{e=(await Ue.get("/generate",{params:{text:n}})).data}catch(t){console.error(t)}return{display:e,response:e}}}),hNt=Hb({type:"RAGNode",title:"RAG",inputs:{request:()=>new pn("Prompt",""),document_path:()=>new tp("Document path","").setPort(!1)},outputs:{prompt:()=>new pn("Prompt with Data","")},async calculate({request:n,document_path:e}){let t="";try{t=(await Ue.get("/rag",{params:{text:n,doc_path:e}})).data}catch(i){console.error(i)}return{response:t}}}),bR=Hb({type:"Task",title:"Task",inputs:{description:()=>new tp("Task description","").setPort(!1)},outputs:{prompt:()=>new pn("Prompt")},calculate({description:n}){return{prompt:n}}}),fNt=ln({components:{"baklava-editor":rNt},setup(){const n=_Nt(),e=new Z1t(n.editor);n.editor.registerNodeType(ER),n.editor.registerNodeType(bR),n.editor.registerNodeType(hNt);const t=Symbol();e.events.afterRun.subscribe(t,o=>{e.pause(),K1t(o,n.editor),e.resume()}),e.start();function i(o,a,l){const c=new o;return n.displayedGraph.addNode(c),c.position.x=a,c.position.y=l,c}const s=i(bR,300,140),r=i(ER,550,140);return n.displayedGraph.addConnection(s.outputs.result,r.inputs.value),{baklava:n,saveGraph:()=>{const o=e.export();localStorage.setItem("myGraph",JSON.stringify(o))},loadGraph:()=>{const o=JSON.parse(localStorage.getItem("myGraph"));e.import(o)}}}}),mNt={style:{width:"100vw",height:"100vh"}};function gNt(n,e,t,i,s,r){const o=_t("baklava-editor");return O(),D("div",mNt,[Ie(o,{"view-model":n.baklava},null,8,["view-model"]),_("button",{onClick:e[0]||(e[0]=(...a)=>n.saveGraph&&n.saveGraph(...a))},"Save Graph"),_("button",{onClick:e[1]||(e[1]=(...a)=>n.loadGraph&&n.loadGraph(...a))},"Load Graph")])}const ENt=gt(fNt,[["render",gNt]]),bNt=Zk({history:mk("/"),routes:[{path:"/playground/",name:"playground",component:KZe},{path:"/extensions/",name:"extensions",component:rJe},{path:"/help/",name:"help",component:CJe},{path:"/settings/",name:"settings",component:jut},{path:"/training/",name:"training",component:mpt},{path:"/quantizing/",name:"quantizing",component:Cpt},{path:"/",name:"discussions",component:xbt},{path:"/",name:"interactive",component:G1t},{path:"/",name:"nodes",component:ENt}]});const np=l2(NB);console.log("Loaded main.js");function SR(n){const e={};for(const t in n)n.hasOwnProperty(t)&&(e[t]=n[t]);return e}const sE=k2({state(){return{yesNoDialog:null,universalForm:null,toast:null,messageBox:null,api_get_req:null,startSpeechRecognition:null,ready:!1,loading_infos:"",loading_progress:0,version:"unknown",settingsChanged:!1,isConnected:!1,isModelOk:!1,isGenerating:!1,config:null,mountedPers:null,mountedPersArr:[],mountedExtensions:[],bindingsZoo:[],modelsArr:[],selectedModel:null,personalities:[],diskUsage:null,ramUsage:null,vramUsage:null,modelsZoo:[],installedModels:[],currentModel:null,extensionsZoo:[],databases:[]}},mutations:{setIsReady(n,e){n.ready=e},setIsConnected(n,e){n.isConnected=e},setIsModelOk(n,e){n.isModelOk=e},setIsGenerating(n,e){n.isGenerating=e},setConfig(n,e){n.config=e},setPersonalities(n,e){n.personalities=e},setMountedPers(n,e){n.mountedPers=e},setMountedPersArr(n,e){n.mountedPersArr=e},setMountedExtensions(n,e){n.mountedExtensions=e},setbindingsZoo(n,e){n.bindingsZoo=e},setModelsArr(n,e){n.modelsArr=e},setselectedModel(n,e){n.selectedModel=e},setDiskUsage(n,e){n.diskUsage=e},setRamUsage(n,e){n.ramUsage=e},setVramUsage(n,e){n.vramUsage=e},setModelsZoo(n,e){n.modelsZoo=e},setCurrentModel(n,e){n.currentModel=e},setExtensionsZoo(n,e){n.extensionsZoo=e},setDatabases(n,e){n.databases=e}},getters:{getIsConnected(n){return n.isConnected},getIsModelOk(n){return n.isModelOk},getIsGenerating(n){return n.isGenerating},getConfig(n){return n.config},getPersonalities(n){return n.personalities},getMountedPersArr(n){return n.mountedPersArr},getmmountedExtensions(n){return n.mountedExtensions},getMountedPers(n){return n.mountedPers},getbindingsZoo(n){return n.bindingsZoo},getModelsArr(n){return n.modelsArr},getDiskUsage(n){return n.diskUsage},getRamUsage(n){return n.ramUsage},getVramUsage(n){return n.vramUsage},getDatabasesList(n){return n.databases},getModelsZoo(n){return n.modelsZoo},getCurrentModel(n){return n.currentModel},getExtensionsZoo(n){return n.extensionsZoo}},actions:{async getVersion(){try{let n=await Ue.get("/get_lollms_webui_version",{});n&&(this.state.version=n.data.version)}catch{console.log("Coudln't get version")}},async refreshConfig({commit:n}){console.log("Fetching configuration");try{const e=await oi("get_config");e.active_personality_id<0&&(e.active_personality_id=0);let t=e.personalities[e.active_personality_id].split("/");e.personality_category=t[0],e.personality_folder=t[1],e.extensions.length>0?e.extension_category=e.extensions[-1]:e.extension_category="ai_sensors",console.log("Recovered config"),console.log(e),console.log("Committing config"),console.log(e),console.log(this.state.config),n("setConfig",e)}catch(e){console.log(e.message,"refreshConfig")}},async refreshDatabase({commit:n}){let e=await oi("list_databases");console.log("databases:",e),n("setDatabases",e)},async refreshPersonalitiesZoo({commit:n}){let e=[];const t=await oi("get_all_personalities"),i=Object.keys(t);console.log("Personalities recovered:"+this.state.config.personalities);for(let s=0;s{let c=!1;for(const u of this.state.config.personalities)if(u.includes(r+"/"+l.folder))if(c=!0,u.includes(":")){const h=u.split(":");l.language=h[1]}else l.language=null;let d={};return d=l,d.category=r,d.full_path=r+"/"+l.folder,d.isMounted=c,d});e.length==0?e=a:e=e.concat(a)}e.sort((s,r)=>s.name.localeCompare(r.name)),n("setPersonalities",e),console.log("Done loading personalities")},refreshMountedPersonalities({commit:n}){this.state.config.active_personality_id<0&&(this.state.config.active_personality_id=0);let e=[];const t=[];for(let i=0;ia.full_path==s||a.full_path==r[0]);if(o>=0){let a=SR(this.state.personalities[o]);r.length>1&&(a.language=r[1]),a?e.push(a):e.push(this.state.personalities[this.state.personalities.findIndex(l=>l.full_path=="generic/lollms")])}else t.push(i),console.log("Couldn't load personality : ",s)}for(let i=t.length-1;i>=0;i--)console.log("Removing personality : ",this.state.config.personalities[t[i]]),this.state.config.personalities.splice(t[i],1),this.state.config.active_personality_id>t[i]&&(this.state.config.active_personality_id-=1);n("setMountedPersArr",e),this.state.mountedPers=this.state.personalities[this.state.personalities.findIndex(i=>i.full_path==this.state.config.personalities[this.state.config.active_personality_id]||i.full_path+":"+i.language==this.state.config.personalities[this.state.config.active_personality_id])]},async refreshBindings({commit:n}){let e=await oi("list_bindings");n("setbindingsZoo",e)},async refreshModelsZoo({commit:n}){console.log("Fetching models");const e=await Ue.get("/get_available_models");n("setModelsZoo",e.data.filter(t=>t.variants&&t.variants.length>0))},async refreshModelStatus({commit:n}){let e=await oi("get_model_status");n("setIsModelOk",e.status)},async refreshModels({commit:n}){console.log("Fetching models");let e=await oi("list_models");console.log(`Found ${e}`);let t=await oi("get_active_model");console.log("Selected model ",t),t!=null&&n("setselectedModel",t.model),n("setModelsArr",e),console.log("setModelsArr",e),this.state.modelsZoo.map(s=>{s.isInstalled=e.includes(s.name)}),this.state.installedModels=this.state.modelsZoo.filter(s=>s.isInstalled);const i=this.state.modelsZoo.findIndex(s=>s.name==this.state.config.model_name);i!=-1&&n("setCurrentModel",this.state.modelsZoo[i])},async refreshExtensionsZoo({commit:n}){let e=[],t=await oi("list_extensions");const i=Object.keys(t);console.log("Extensions recovered:"+t);for(let s=0;s{let c=!1;for(const u of this.state.config.extensions)u.includes(r+"/"+l.folder)&&(c=!0);let d={};return d=l,d.category=r,d.full_path=r+"/"+l.folder,d.isMounted=c,d});e.length==0?e=a:e=e.concat(a)}e.sort((s,r)=>s.name.localeCompare(r.name)),console.log("Done loading extensions"),n("setExtensionsZoo",e)},refreshmountedExtensions({commit:n}){console.log("Mounting extensions");let e=[];const t=[];for(let i=0;io.full_path==s);if(r>=0){let o=SR(this.state.config.extensions[r]);o&&e.push(o)}else t.push(i),console.log("Couldn't load extension : ",s)}for(let i=t.length-1;i>=0;i--)console.log("Removing extensions : ",this.state.config.extensions[t[i]]),this.state.config.extensions.splice(t[i],1);n("setMountedExtensions",e)},async refreshDiskUsage({commit:n}){this.state.diskUsage=await oi("disk_usage")},async refreshRamUsage({commit:n}){this.state.ramUsage=await oi("ram_usage")},async refreshVramUsage({commit:n}){const e=await oi("vram_usage"),t=[];if(e.nb_gpus>0){for(let s=0;s!!t.value),onPointerDown:l=>{t.value={x:l.pageX,y:l.pageY},i.value={x:n.value.x,y:n.value.y}},onPointerMove:l=>{if(t.value){const c=l.pageX-t.value.x,d=l.pageY-t.value.y;n.value.x=i.value.x+c/e.value.scaling,n.value.y=i.value.y+d/e.value.scaling}},onPointerUp:()=>{t.value=null,i.value=null}}}function eI(n,e,t){if(!e.template)return!1;if(wa(e.template)===t)return!0;const i=n.graphTemplates.find(r=>wa(r)===t);return i?i.nodes.filter(r=>r.type.startsWith(Jl)).some(r=>eI(n,e,r.type)):!1}function tI(n){return et(()=>{const e=Array.from(n.value.editor.nodeTypes.entries()),t=new Set(e.map(([,s])=>s.category)),i=[];for(const s of t.values()){let r=e.filter(([,o])=>o.category===s);n.value.displayedGraph.template?r=r.filter(([o])=>!eI(n.value.editor,n.value.displayedGraph,o)):r=r.filter(([o])=>![Ra,Aa].includes(o)),r.length>0&&i.push({name:s,nodeTypes:Object.fromEntries(r)})}return i.sort((s,r)=>s.name==="default"?-1:r.name==="default"||s.name>r.name?1:-1),i})}function nI(){const{graph:n}=Ui();return{transform:(t,i)=>{const s=t/n.value.scaling-n.value.panning.x,r=i/n.value.scaling-n.value.panning.y;return[s,r]}}}function J1t(){const{graph:n}=Ui();let e=[],t=-1,i={x:0,y:0};const s=et(()=>n.value.panning),r=JO(s),o=et(()=>({"transform-origin":"0 0",transform:`scale(${n.value.scaling}) translate(${n.value.panning.x}px, ${n.value.panning.y}px)`})),a=(m,f,b)=>{const E=[m/n.value.scaling-n.value.panning.x,f/n.value.scaling-n.value.panning.y],g=[m/b-n.value.panning.x,f/b-n.value.panning.y],S=[g[0]-E[0],g[1]-E[1]];n.value.panning.x+=S[0],n.value.panning.y+=S[1],n.value.scaling=b},l=m=>{m.preventDefault();let f=m.deltaY;m.deltaMode===1&&(f*=32);const b=n.value.scaling*(1-f/3e3);a(m.offsetX,m.offsetY,b)},c=()=>({ax:e[0].clientX,ay:e[0].clientY,bx:e[1].clientX,by:e[1].clientY});return{styles:o,...r,onPointerDown:m=>{if(e.push(m),r.onPointerDown(m),e.length===2){const{ax:f,ay:b,bx:E,by:g}=c();i={x:f+(E-f)/2,y:b+(g-b)/2}}},onPointerMove:m=>{for(let f=0;f0){const C=n.value.scaling*(1+(T-t)/500);a(i.x,i.y,C)}t=T}else r.onPointerMove(m)},onPointerUp:m=>{e=e.filter(f=>f.pointerId!==m.pointerId),t=-1,r.onPointerUp()},onMouseWheel:l}}var _i=(n=>(n[n.NONE=0]="NONE",n[n.ALLOWED=1]="ALLOWED",n[n.FORBIDDEN=2]="FORBIDDEN",n))(_i||{});const iI=Symbol();function eRt(){const{graph:n}=Ui(),e=dt(null),t=dt(null),i=a=>{e.value&&(e.value.mx=a.offsetX/n.value.scaling-n.value.panning.x,e.value.my=a.offsetY/n.value.scaling-n.value.panning.y)},s=()=>{if(t.value){if(e.value)return;const a=n.value.connections.find(l=>l.to===t.value);t.value.isInput&&a?(e.value={status:_i.NONE,from:a.from},n.value.removeConnection(a)):e.value={status:_i.NONE,from:t.value},e.value.mx=void 0,e.value.my=void 0}},r=()=>{if(e.value&&t.value){if(e.value.from===t.value)return;n.value.addConnection(e.value.from,e.value.to)}e.value=null},o=a=>{if(t.value=a??null,a&&e.value){e.value.to=a;const l=n.value.checkConnection(e.value.from,e.value.to);if(e.value.status=l.connectionAllowed?_i.ALLOWED:_i.FORBIDDEN,l.connectionAllowed){const c=l.connectionsInDanger.map(d=>d.id);n.value.connections.forEach(d=>{c.includes(d.id)&&(d.isInDanger=!0)})}}else!a&&e.value&&(e.value.to=void 0,e.value.status=_i.NONE,n.value.connections.forEach(l=>{l.isInDanger=!1}))};return Qo(iI,{temporaryConnection:e,hoveredOver:o}),{temporaryConnection:e,onMouseMove:i,onMouseDown:s,onMouseUp:r,hoveredOver:o}}function tRt(n){const e=dt(!1),t=dt(0),i=dt(0),s=tI(n),{transform:r}=nI(),o=et(()=>{let d=[];const u={};for(const m of s.value){const f=Object.entries(m.nodeTypes).map(([b,E])=>({label:E.title,value:"addNode:"+b}));m.name==="default"?d=f:u[m.name]=f}const h=[...Object.entries(u).map(([m,f])=>({label:m,submenu:f}))];return h.length>0&&d.length>0&&h.push({isDivider:!0}),h.push(...d),h}),a=et(()=>n.value.settings.contextMenu.additionalItems.length===0?o.value:[{label:"Add node",submenu:o.value},...n.value.settings.contextMenu.additionalItems.map(d=>"isDivider"in d||"submenu"in d?d:{label:d.label,value:"command:"+d.command,disabled:!n.value.commandHandler.canExecuteCommand(d.command)})]);function l(d){e.value=!0,t.value=d.offsetX,i.value=d.offsetY}function c(d){if(d.startsWith("addNode:")){const u=d.substring(8),h=n.value.editor.nodeTypes.get(u);if(!h)return;const m=jn(new h.type);n.value.displayedGraph.addNode(m);const[f,b]=r(t.value,i.value);m.position.x=f,m.position.y=b}else if(d.startsWith("command:")){const u=d.substring(8);n.value.commandHandler.canExecuteCommand(u)&&n.value.commandHandler.executeCommand(u)}}return{show:e,x:t,y:i,items:a,open:l,onClick:c}}const nRt=ln({setup(){const{viewModel:n}=yi(),{graph:e}=Ui();return{styles:et(()=>{const i=n.value.settings.background,s=e.value.panning.x*e.value.scaling,r=e.value.panning.y*e.value.scaling,o=e.value.scaling*i.gridSize,a=o/i.gridDivision,l=`${o}px ${o}px, ${o}px ${o}px`,c=e.value.scaling>i.subGridVisibleThreshold?`, ${a}px ${a}px, ${a}px ${a}px`:"";return{backgroundPosition:`left ${s}px top ${r}px`,backgroundSize:`${l} ${c}`}})}}}),cn=(n,e)=>{const t=n.__vccOpts||n;for(const[i,s]of e)t[i]=s;return t};function iRt(n,e,t,i,s,r){return O(),D("div",{class:"background",style:Xt(n.styles)},null,4)}const sRt=cn(nRt,[["render",iRt]]);function rRt(n){return wR()?(zI(n),!0):!1}function qb(n){return typeof n=="function"?n():vt(n)}const sI=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const oRt=Object.prototype.toString,aRt=n=>oRt.call(n)==="[object Object]",Od=()=>{},lRt=cRt();function cRt(){var n,e;return sI&&((n=window==null?void 0:window.navigator)==null?void 0:n.userAgent)&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||((e=window==null?void 0:window.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function dRt(n,e,t=!1){return e.reduce((i,s)=>(s in n&&(!t||n[s]!==void 0)&&(i[s]=n[s]),i),{})}function uRt(n,e={}){if(!un(n))return TM(n);const t=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)t[i]=yM(()=>({get(){return n.value[i]},set(s){var r;if((r=qb(e.replaceRef))!=null?r:!0)if(Array.isArray(n.value)){const a=[...n.value];a[i]=s,n.value=a}else{const a={...n.value,[i]:s};Object.setPrototypeOf(a,Object.getPrototypeOf(n.value)),n.value=a}else n.value[i]=s}}));return t}function bl(n){var e;const t=qb(n);return(e=t==null?void 0:t.$el)!=null?e:t}const Yb=sI?window:void 0;function Ml(...n){let e,t,i,s;if(typeof n[0]=="string"||Array.isArray(n[0])?([t,i,s]=n,e=Yb):[e,t,i,s]=n,!e)return Od;Array.isArray(t)||(t=[t]),Array.isArray(i)||(i=[i]);const r=[],o=()=>{r.forEach(d=>d()),r.length=0},a=(d,u,h,m)=>(d.addEventListener(u,h,m),()=>d.removeEventListener(u,h,m)),l=Bn(()=>[bl(e),qb(s)],([d,u])=>{if(o(),!d)return;const h=aRt(u)?{...u}:u;r.push(...t.flatMap(m=>i.map(f=>a(d,m,f,h))))},{immediate:!0,flush:"post"}),c=()=>{l(),o()};return rRt(c),c}let dR=!1;function rI(n,e,t={}){const{window:i=Yb,ignore:s=[],capture:r=!0,detectIframe:o=!1}=t;if(!i)return Od;lRt&&!dR&&(dR=!0,Array.from(i.document.body.children).forEach(h=>h.addEventListener("click",Od)),i.document.documentElement.addEventListener("click",Od));let a=!0;const l=h=>s.some(m=>{if(typeof m=="string")return Array.from(i.document.querySelectorAll(m)).some(f=>f===h.target||h.composedPath().includes(f));{const f=bl(m);return f&&(h.target===f||h.composedPath().includes(f))}}),d=[Ml(i,"click",h=>{const m=bl(n);if(!(!m||m===h.target||h.composedPath().includes(m))){if(h.detail===0&&(a=!l(h)),!a){a=!0;return}e(h)}},{passive:!0,capture:r}),Ml(i,"pointerdown",h=>{const m=bl(n);a=!l(h)&&!!(m&&!h.composedPath().includes(m))},{passive:!0}),o&&Ml(i,"blur",h=>{setTimeout(()=>{var m;const f=bl(n);((m=i.document.activeElement)==null?void 0:m.tagName)==="IFRAME"&&!(f!=null&&f.contains(i.document.activeElement))&&e(h)},0)})].filter(Boolean);return()=>d.forEach(h=>h())}const oI={x:0,y:0,pointerId:0,pressure:0,tiltX:0,tiltY:0,width:0,height:0,twist:0,pointerType:null},pRt=Object.keys(oI);function _Rt(n={}){const{target:e=Yb}=n,t=dt(!1),i=dt(n.initialValue||{});Object.assign(i.value,oI,i.value);const s=r=>{t.value=!0,!(n.pointerTypes&&!n.pointerTypes.includes(r.pointerType))&&(i.value=dRt(r,pRt,!1))};if(e){const r={passive:!0};Ml(e,["pointerdown","pointermove","pointerup"],s,r),Ml(e,"pointerleave",()=>t.value=!1,r)}return{...uRt(i),isInside:t}}const hRt=["onMouseenter","onMouseleave","onClick"],fRt={class:"flex-fill"},mRt={key:0,class:"__submenu-icon",style:{"line-height":"1em"}},gRt=_("svg",{width:"13",height:"13",viewBox:"-60 120 250 250"},[_("path",{d:"M160.875 279.5625 L70.875 369.5625 L70.875 189.5625 L160.875 279.5625 Z",stroke:"none",fill:"white"})],-1),ERt=[gRt],$b=ln({__name:"ContextMenu",props:{modelValue:{type:Boolean},items:{},x:{default:0},y:{default:0},isNested:{type:Boolean,default:!1},isFlipped:{default:()=>({x:!1,y:!1})},flippable:{type:Boolean,default:!1}},emits:["update:modelValue","click"],setup(n,{emit:e}){const t=n,i=e;let s=null;const r=dt(null),o=dt(-1),a=dt(0),l=dt({x:!1,y:!1}),c=et(()=>t.flippable&&(l.value.x||t.isFlipped.x)),d=et(()=>t.flippable&&(l.value.y||t.isFlipped.y)),u=et(()=>{const S={};return t.isNested||(S.top=(d.value?t.y-a.value:t.y)+"px",S.left=t.x+"px"),S}),h=et(()=>({"--flipped-x":c.value,"--flipped-y":d.value,"--nested":t.isNested})),m=et(()=>t.items.map(S=>({...S,hover:!1})));Bn([()=>t.y,()=>t.items],()=>{var S,y,T,C;a.value=t.items.length*30;const x=((y=(S=r.value)==null?void 0:S.parentElement)==null?void 0:y.offsetWidth)??0,w=((C=(T=r.value)==null?void 0:T.parentElement)==null?void 0:C.offsetHeight)??0;l.value.x=!t.isNested&&t.x>x*.75,l.value.y=!t.isNested&&t.y+a.value>w-20}),rI(r,()=>{t.modelValue&&i("update:modelValue",!1)});const f=S=>{!S.submenu&&S.value&&(i("click",S.value),i("update:modelValue",!1))},b=S=>{i("click",S),o.value=-1,t.isNested||i("update:modelValue",!1)},E=(S,y)=>{t.items[y].submenu&&(o.value=y,s!==null&&(clearTimeout(s),s=null))},g=(S,y)=>{t.items[y].submenu&&(s=window.setTimeout(()=>{o.value=-1,s=null},200))};return(S,y)=>{const T=_t("ContextMenu",!0);return O(),Ot(ws,{name:"slide-fade"},{default:ot(()=>[xe(_("div",{ref_key:"el",ref:r,class:He(["baklava-context-menu",h.value]),style:Xt(u.value)},[(O(!0),D($e,null,lt(m.value,(C,x)=>(O(),D($e,null,[C.isDivider?(O(),D("div",{key:`d-${x}`,class:"divider"})):(O(),D("div",{key:`i-${x}`,class:He(["item",{submenu:!!C.submenu,"--disabled":!!C.disabled}]),onMouseenter:w=>E(w,x),onMouseleave:w=>g(w,x),onClick:Te(w=>f(C),["stop","prevent"])},[_("div",fRt,he(C.label),1),C.submenu?(O(),D("div",mRt,ERt)):j("",!0),C.submenu?(O(),Ot(T,{key:1,"model-value":o.value===x,items:C.submenu,"is-nested":!0,"is-flipped":{x:c.value,y:d.value},flippable:S.flippable,onClick:b},null,8,["model-value","items","is-flipped","flippable"])):j("",!0)],42,hRt))],64))),256))],6),[[At,S.modelValue]])]),_:1})}}}),bRt={},SRt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"16",height:"16",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},vRt=_("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),yRt=_("circle",{cx:"12",cy:"12",r:"1"},null,-1),TRt=_("circle",{cx:"12",cy:"19",r:"1"},null,-1),xRt=_("circle",{cx:"12",cy:"5",r:"1"},null,-1),CRt=[vRt,yRt,TRt,xRt];function RRt(n,e){return O(),D("svg",SRt,CRt)}const aI=cn(bRt,[["render",RRt]]),ARt=["id"],wRt={key:0,class:"__tooltip"},NRt={key:2,class:"align-middle"},uR=ln({__name:"NodeInterface",props:{node:{},intf:{}},setup(n){const e=(E,g=100)=>{const S=E!=null&&E.toString?E.toString():"";return S.length>g?S.slice(0,g)+"...":S},t=n,{viewModel:i}=yi(),{hoveredOver:s,temporaryConnection:r}=Ii(iI),o=dt(null),a=et(()=>t.intf.connectionCount>0),l=dt(!1),c=et(()=>i.value.settings.displayValueOnHover&&l.value),d=et(()=>({"--input":t.intf.isInput,"--output":!t.intf.isInput,"--connected":a.value})),u=et(()=>t.intf.component&&(!t.intf.isInput||!t.intf.port||t.intf.connectionCount===0)),h=()=>{l.value=!0,s(t.intf)},m=()=>{l.value=!1,s(void 0)},f=()=>{o.value&&i.value.hooks.renderInterface.execute({intf:t.intf,el:o.value})},b=()=>{const E=i.value.displayedGraph.sidebar;E.nodeId=t.node.id,E.optionName=t.intf.name,E.visible=!0};return Ms(f),nc(f),(E,g)=>{var S;return O(),D("div",{id:E.intf.id,ref_key:"el",ref:o,class:He(["baklava-node-interface",d.value])},[E.intf.port?(O(),D("div",{key:0,class:He(["__port",{"--selected":((S=vt(r))==null?void 0:S.from)===E.intf}]),onPointerover:h,onPointerout:m},[Nn(E.$slots,"portTooltip",{showTooltip:c.value},()=>[c.value===!0?(O(),D("span",wRt,he(e(E.intf.value)),1)):j("",!0)])],34)):j("",!0),u.value?(O(),Ot(Tu(E.intf.component),{key:1,modelValue:E.intf.value,"onUpdate:modelValue":g[0]||(g[0]=y=>E.intf.value=y),node:E.node,intf:E.intf,onOpenSidebar:b},null,40,["modelValue","node","intf"])):(O(),D("span",NRt,he(E.intf.name),1))],10,ARt)}}}),ORt=["id","data-node-type"],IRt={class:"__title-label"},MRt={class:"__menu"},DRt={class:"__outputs"},LRt={class:"__inputs"},kRt=ln({__name:"Node",props:{node:{},selected:{type:Boolean,default:!1},dragging:{type:Boolean}},emits:["select","start-drag"],setup(n,{emit:e}){const t=n,i=e,{viewModel:s}=yi(),{graph:r,switchGraph:o}=Ui(),a=dt(null),l=dt(!1),c=dt(""),d=dt(null),u=dt(!1),h=dt(!1),m=et(()=>{const P=[{value:"rename",label:"Rename"},{value:"delete",label:"Delete"}];return t.node.type.startsWith(Jl)&&P.push({value:"editSubgraph",label:"Edit Subgraph"}),P}),f=et(()=>({"--selected":t.selected,"--dragging":t.dragging,"--two-column":!!t.node.twoColumn})),b=et(()=>{var P,U;return{top:`${((P=t.node.position)==null?void 0:P.y)??0}px`,left:`${((U=t.node.position)==null?void 0:U.x)??0}px`,"--width":`${t.node.width??s.value.settings.nodes.defaultWidth}px`}}),E=et(()=>Object.values(t.node.inputs).filter(P=>!P.hidden)),g=et(()=>Object.values(t.node.outputs).filter(P=>!P.hidden)),S=()=>{i("select")},y=P=>{t.selected||S(),i("start-drag",P)},T=()=>{h.value=!0},C=async P=>{var U;switch(P){case"delete":r.value.removeNode(t.node);break;case"rename":c.value=t.node.title,l.value=!0,await Fe(),(U=d.value)==null||U.focus();break;case"editSubgraph":o(t.node.template);break}},x=()=>{t.node.title=c.value,l.value=!1},w=()=>{a.value&&s.value.hooks.renderNode.execute({node:t.node,el:a.value})},R=P=>{u.value=!0,P.preventDefault()},v=P=>{if(!u.value)return;const U=t.node.width+P.movementX/r.value.scaling,Y=s.value.settings.nodes.minWidth,L=s.value.settings.nodes.maxWidth;t.node.width=Math.max(Y,Math.min(L,U))},A=()=>{u.value=!1};return Ms(()=>{w(),window.addEventListener("mousemove",v),window.addEventListener("mouseup",A)}),nc(w),La(()=>{window.removeEventListener("mousemove",v),window.removeEventListener("mouseup",A)}),(P,U)=>(O(),D("div",{id:P.node.id,ref_key:"el",ref:a,class:He(["baklava-node",f.value]),style:Xt(b.value),"data-node-type":P.node.type,onPointerdown:S},[vt(s).settings.nodes.resizable?(O(),D("div",{key:0,class:"__resize-handle",onMousedown:R},null,32)):j("",!0),Nn(P.$slots,"title",{},()=>[_("div",{class:"__title",onPointerdown:Te(y,["self","stop"])},[l.value?xe((O(),D("input",{key:1,ref_key:"renameInputEl",ref:d,"onUpdate:modelValue":U[1]||(U[1]=Y=>c.value=Y),type:"text",class:"baklava-input",placeholder:"Node Name",onBlur:x,onKeydown:mr(x,["enter"])},null,544)),[[Xe,c.value]]):(O(),D($e,{key:0},[_("div",IRt,he(P.node.title),1),_("div",MRt,[Ie(aI,{class:"--clickable",onClick:T}),Ie($b,{modelValue:h.value,"onUpdate:modelValue":U[0]||(U[0]=Y=>h.value=Y),x:0,y:0,items:m.value,onClick:C},null,8,["modelValue","items"])])],64))],32)]),Nn(P.$slots,"content",{},()=>[_("div",{class:"__content",onKeydown:U[2]||(U[2]=mr(Te(()=>{},["stop"]),["delete"]))},[_("div",DRt,[(O(!0),D($e,null,lt(g.value,Y=>Nn(P.$slots,"nodeInterface",{key:Y.id,type:"output",node:P.node,intf:Y},()=>[Ie(uR,{node:P.node,intf:Y},null,8,["node","intf"])])),128))]),_("div",LRt,[(O(!0),D($e,null,lt(E.value,Y=>Nn(P.$slots,"nodeInterface",{key:Y.id,type:"input",node:P.node,intf:Y},()=>[Ie(uR,{node:P.node,intf:Y},null,8,["node","intf"])])),128))])],32)])],46,ORt))}}),PRt=ln({props:{x1:{type:Number,required:!0},y1:{type:Number,required:!0},x2:{type:Number,required:!0},y2:{type:Number,required:!0},state:{type:Number,default:_i.NONE},isTemporary:{type:Boolean,default:!1}},setup(n){const{viewModel:e}=yi(),{graph:t}=Ui(),i=(o,a)=>{const l=(o+t.value.panning.x)*t.value.scaling,c=(a+t.value.panning.y)*t.value.scaling;return[l,c]},s=et(()=>{const[o,a]=i(n.x1,n.y1),[l,c]=i(n.x2,n.y2);if(e.value.settings.useStraightConnections)return`M ${o} ${a} L ${l} ${c}`;{const d=.3*Math.abs(o-l);return`M ${o} ${a} C ${o+d} ${a}, ${l-d} ${c}, ${l} ${c}`}}),r=et(()=>({"--temporary":n.isTemporary,"--allowed":n.state===_i.ALLOWED,"--forbidden":n.state===_i.FORBIDDEN}));return{d:s,classes:r}}}),URt=["d"];function FRt(n,e,t,i,s,r){return O(),D("path",{class:He(["baklava-connection",n.classes]),d:n.d},null,10,URt)}const lI=cn(PRt,[["render",FRt]]);function BRt(n){return document.getElementById(n.id)}function Na(n){const e=document.getElementById(n.id),t=e==null?void 0:e.getElementsByClassName("__port");return{node:(e==null?void 0:e.closest(".baklava-node"))??null,interface:e,port:t&&t.length>0?t[0]:null}}const GRt=ln({components:{"connection-view":lI},props:{connection:{type:Object,required:!0}},setup(n){const{graph:e}=Ui();let t;const i=dt({x1:0,y1:0,x2:0,y2:0}),s=et(()=>n.connection.isInDanger?_i.FORBIDDEN:_i.NONE),r=et(()=>{var c;return(c=e.value.findNodeById(n.connection.from.nodeId))==null?void 0:c.position}),o=et(()=>{var c;return(c=e.value.findNodeById(n.connection.to.nodeId))==null?void 0:c.position}),a=c=>c.node&&c.interface&&c.port?[c.node.offsetLeft+c.interface.offsetLeft+c.port.offsetLeft+c.port.clientWidth/2,c.node.offsetTop+c.interface.offsetTop+c.port.offsetTop+c.port.clientHeight/2]:[0,0],l=()=>{const c=Na(n.connection.from),d=Na(n.connection.to);c.node&&d.node&&(t||(t=new ResizeObserver(()=>{l()}),t.observe(c.node),t.observe(d.node)));const[u,h]=a(c),[m,f]=a(d);i.value={x1:u,y1:h,x2:m,y2:f}};return Ms(async()=>{await Fe(),l()}),La(()=>{t&&t.disconnect()}),Bn([r,o],()=>l(),{deep:!0}),{d:i,state:s}}});function VRt(n,e,t,i,s,r){const o=_t("connection-view");return O(),Ot(o,{x1:n.d.x1,y1:n.d.y1,x2:n.d.x2,y2:n.d.y2,state:n.state},null,8,["x1","y1","x2","y2","state"])}const zRt=cn(GRt,[["render",VRt]]);function cu(n){return n.node&&n.interface&&n.port?[n.node.offsetLeft+n.interface.offsetLeft+n.port.offsetLeft+n.port.clientWidth/2,n.node.offsetTop+n.interface.offsetTop+n.port.offsetTop+n.port.clientHeight/2]:[0,0]}const HRt=ln({components:{"connection-view":lI},props:{connection:{type:Object,required:!0}},setup(n){const e=et(()=>n.connection?n.connection.status:_i.NONE);return{d:et(()=>{if(!n.connection)return{input:[0,0],output:[0,0]};const i=cu(Na(n.connection.from)),s=n.connection.to?cu(Na(n.connection.to)):[n.connection.mx||i[0],n.connection.my||i[1]];return n.connection.from.isInput?{input:s,output:i}:{input:i,output:s}}),status:e}}});function qRt(n,e,t,i,s,r){const o=_t("connection-view");return O(),Ot(o,{x1:n.d.input[0],y1:n.d.input[1],x2:n.d.output[0],y2:n.d.output[1],state:n.status,"is-temporary":""},null,8,["x1","y1","x2","y2","state"])}const YRt=cn(HRt,[["render",qRt]]),$Rt=ln({setup(){const{viewModel:n}=yi(),{graph:e}=Ui(),t=dt(null),i=kd(n.value.settings.sidebar,"width"),s=et(()=>n.value.settings.sidebar.resizable),r=et(()=>{const u=e.value.sidebar.nodeId;return e.value.nodes.find(h=>h.id===u)}),o=et(()=>({width:`${i.value}px`})),a=et(()=>r.value?[...Object.values(r.value.inputs),...Object.values(r.value.outputs)].filter(h=>h.displayInSidebar&&h.component):[]),l=()=>{e.value.sidebar.visible=!1},c=()=>{window.addEventListener("mousemove",d),window.addEventListener("mouseup",()=>{window.removeEventListener("mousemove",d)},{once:!0})},d=u=>{var h,m;const f=((m=(h=t.value)==null?void 0:h.parentElement)==null?void 0:m.getBoundingClientRect().width)??500;let b=i.value-u.movementX;b<300?b=300:b>.9*f&&(b=.9*f),i.value=b};return{el:t,graph:e,resizable:s,node:r,styles:o,displayedInterfaces:a,startResize:c,close:l}}}),WRt={class:"__header"},KRt={class:"__node-name"};function jRt(n,e,t,i,s,r){return O(),D("div",{ref:"el",class:He(["baklava-sidebar",{"--open":n.graph.sidebar.visible}]),style:Xt(n.styles)},[n.resizable?(O(),D("div",{key:0,class:"__resizer",onMousedown:e[0]||(e[0]=(...o)=>n.startResize&&n.startResize(...o))},null,32)):j("",!0),_("div",WRt,[_("button",{tabindex:"-1",class:"__close",onClick:e[1]||(e[1]=(...o)=>n.close&&n.close(...o))},"×"),_("div",KRt,[_("b",null,he(n.node?n.node.title:""),1)])]),(O(!0),D($e,null,lt(n.displayedInterfaces,o=>(O(),D("div",{key:o.id,class:"__interface"},[(O(),Ot(Tu(o.component),{modelValue:o.value,"onUpdate:modelValue":a=>o.value=a,node:n.node,intf:o},null,8,["modelValue","onUpdate:modelValue","node","intf"]))]))),128))],6)}const QRt=cn($Rt,[["render",jRt]]),XRt=ln({__name:"Minimap",setup(n){const{viewModel:e}=yi(),{graph:t}=Ui(),i=dt(null),s=dt(!1);let r,o=!1,a={x1:0,y1:0,x2:0,y2:0},l;const c=()=>{var x,w;if(!r)return;r.canvas.width=i.value.offsetWidth,r.canvas.height=i.value.offsetHeight;const R=new Map,v=new Map;for(const L of t.value.nodes){const H=BRt(L),B=(H==null?void 0:H.offsetWidth)??0,k=(H==null?void 0:H.offsetHeight)??0,$=((x=L.position)==null?void 0:x.x)??0,K=((w=L.position)==null?void 0:w.y)??0;R.set(L,{x1:$,y1:K,x2:$+B,y2:K+k}),v.set(L,H)}const A={x1:Number.MAX_SAFE_INTEGER,y1:Number.MAX_SAFE_INTEGER,x2:Number.MIN_SAFE_INTEGER,y2:Number.MIN_SAFE_INTEGER};for(const L of R.values())L.x1A.x2&&(A.x2=L.x2),L.y2>A.y2&&(A.y2=L.y2);const P=50;A.x1-=P,A.y1-=P,A.x2+=P,A.y2+=P,a=A;const U=r.canvas.width/r.canvas.height,Y=(a.x2-a.x1)/(a.y2-a.y1);if(U>Y){const L=(U-Y)*(a.y2-a.y1)*.5;a.x1-=L,a.x2+=L}else{const L=a.x2-a.x1,H=a.y2-a.y1,B=(L-U*H)/U*.5;a.y1-=B,a.y2+=B}r.clearRect(0,0,r.canvas.width,r.canvas.height),r.strokeStyle="white";for(const L of t.value.connections){const[H,B]=cu(Na(L.from)),[k,$]=cu(Na(L.to)),[K,W]=d(H,B),[le,J]=d(k,$);if(r.beginPath(),r.moveTo(K,W),e.value.settings.useStraightConnections)r.lineTo(le,J);else{const ee=.3*Math.abs(K-le);r.bezierCurveTo(K+ee,W,le-ee,J,le,J)}r.stroke()}r.strokeStyle="lightgray";for(const[L,H]of R.entries()){const[B,k]=d(H.x1,H.y1),[$,K]=d(H.x2,H.y2);r.fillStyle=h(v.get(L)),r.beginPath(),r.rect(B,k,$-B,K-k),r.fill(),r.stroke()}if(s.value){const L=f(),[H,B]=d(L.x1,L.y1),[k,$]=d(L.x2,L.y2);r.fillStyle="rgba(255, 255, 255, 0.2)",r.fillRect(H,B,k-H,$-B)}},d=(x,w)=>[(x-a.x1)/(a.x2-a.x1)*r.canvas.width,(w-a.y1)/(a.y2-a.y1)*r.canvas.height],u=(x,w)=>[x*(a.x2-a.x1)/r.canvas.width+a.x1,w*(a.y2-a.y1)/r.canvas.height+a.y1],h=x=>{if(x){const w=x.querySelector(".__content");if(w){const v=m(w);if(v)return v}const R=m(x);if(R)return R}return"gray"},m=x=>{const w=getComputedStyle(x).backgroundColor;if(w&&w!=="rgba(0, 0, 0, 0)")return w},f=()=>{const x=i.value.parentElement.offsetWidth,w=i.value.parentElement.offsetHeight,R=x/t.value.scaling-t.value.panning.x,v=w/t.value.scaling-t.value.panning.y;return{x1:-t.value.panning.x,y1:-t.value.panning.y,x2:R,y2:v}},b=x=>{x.button===0&&(o=!0,E(x))},E=x=>{if(o){const[w,R]=u(x.offsetX,x.offsetY),v=f(),A=(v.x2-v.x1)/2,P=(v.y2-v.y1)/2;t.value.panning.x=-(w-A),t.value.panning.y=-(R-P)}},g=()=>{o=!1},S=()=>{s.value=!0},y=()=>{s.value=!1,g()};Bn([s,t.value.panning,()=>t.value.scaling,()=>t.value.connections.length],()=>{c()});const T=et(()=>t.value.nodes.map(x=>x.position)),C=et(()=>t.value.nodes.map(x=>x.width));return Bn([T,C],()=>{c()},{deep:!0}),Ms(()=>{r=i.value.getContext("2d"),r.imageSmoothingQuality="high",c(),l=setInterval(c,500)}),La(()=>{clearInterval(l)}),(x,w)=>(O(),D("canvas",{ref_key:"canvas",ref:i,class:"baklava-minimap",onMouseenter:S,onMouseleave:y,onMousedown:Te(b,["self"]),onMousemove:Te(E,["self"]),onMouseup:g},null,544))}}),ZRt=ln({components:{ContextMenu:$b,VerticalDots:aI},props:{type:{type:String,required:!0},title:{type:String,required:!0}},setup(n){const{viewModel:e}=yi(),{switchGraph:t}=Ui(),i=dt(!1),s=et(()=>n.type.startsWith(Jl));return{showContextMenu:i,hasContextMenu:s,contextMenuItems:[{label:"Edit Subgraph",value:"editSubgraph"},{label:"Delete Subgraph",value:"deleteSubgraph"}],openContextMenu:()=>{i.value=!0},onContextMenuClick:l=>{const c=n.type.substring(Jl.length),d=e.value.editor.graphTemplates.find(u=>u.id===c);if(d)switch(l){case"editSubgraph":t(d);break;case"deleteSubgraph":e.value.editor.removeGraphTemplate(d);break}}}}}),JRt=["data-node-type"],eAt={class:"__title"},tAt={class:"__title-label"},nAt={key:0,class:"__menu"};function iAt(n,e,t,i,s,r){const o=_t("vertical-dots"),a=_t("context-menu");return O(),D("div",{class:"baklava-node --palette","data-node-type":n.type},[_("div",eAt,[_("div",tAt,he(n.title),1),n.hasContextMenu?(O(),D("div",nAt,[Ie(o,{class:"--clickable",onPointerdown:e[0]||(e[0]=Te(()=>{},["stop","prevent"])),onClick:Te(n.openContextMenu,["stop","prevent"])},null,8,["onClick"]),Ie(a,{modelValue:n.showContextMenu,"onUpdate:modelValue":e[1]||(e[1]=l=>n.showContextMenu=l),x:-100,y:0,items:n.contextMenuItems,onClick:n.onContextMenuClick,onPointerdown:e[2]||(e[2]=Te(()=>{},["stop","prevent"]))},null,8,["modelValue","items","onClick"])])):j("",!0)])],8,JRt)}const pR=cn(ZRt,[["render",iAt]]),sAt={class:"baklava-node-palette"},rAt={key:0},oAt=ln({__name:"NodePalette",setup(n){const{viewModel:e}=yi(),{x:t,y:i}=_Rt(),{transform:s}=nI(),r=tI(e),o=Ii("editorEl"),a=dt(null),l=et(()=>{if(!a.value||!(o!=null&&o.value))return{};const{left:d,top:u}=o.value.getBoundingClientRect();return{top:`${i.value-u}px`,left:`${t.value-d}px`}}),c=(d,u)=>{a.value={type:d,nodeInformation:u};const h=()=>{const m=jn(new u.type);e.value.displayedGraph.addNode(m);const f=o.value.getBoundingClientRect(),[b,E]=s(t.value-f.left,i.value-f.top);m.position.x=b,m.position.y=E,a.value=null,document.removeEventListener("pointerup",h)};document.addEventListener("pointerup",h)};return(d,u)=>(O(),D($e,null,[_("div",sAt,[(O(!0),D($e,null,lt(vt(r),h=>(O(),D("section",{key:h.name},[h.name!=="default"?(O(),D("h1",rAt,he(h.name),1)):j("",!0),(O(!0),D($e,null,lt(h.nodeTypes,(m,f)=>(O(),Ot(pR,{key:f,type:f,title:m.title,onPointerdown:b=>c(f,m)},null,8,["type","title","onPointerdown"]))),128))]))),128))]),Ie(ws,{name:"fade"},{default:ot(()=>[a.value?(O(),D("div",{key:0,class:"baklava-dragged-node",style:Xt(l.value)},[Ie(pR,{type:a.value.type,title:a.value.nodeInformation.title},null,8,["type","title"])],4)):j("",!0)]),_:1})],64))}});let fd;const aAt=new Uint8Array(16);function lAt(){if(!fd&&(fd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!fd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return fd(aAt)}const vn=[];for(let n=0;n<256;++n)vn.push((n+256).toString(16).slice(1));function cAt(n,e=0){return vn[n[e+0]]+vn[n[e+1]]+vn[n[e+2]]+vn[n[e+3]]+"-"+vn[n[e+4]]+vn[n[e+5]]+"-"+vn[n[e+6]]+vn[n[e+7]]+"-"+vn[n[e+8]]+vn[n[e+9]]+"-"+vn[n[e+10]]+vn[n[e+11]]+vn[n[e+12]]+vn[n[e+13]]+vn[n[e+14]]+vn[n[e+15]]}const dAt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),_R={randomUUID:dAt};function du(n,e,t){if(_R.randomUUID&&!e&&!n)return _R.randomUUID();n=n||{};const i=n.random||(n.rng||lAt)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){t=t||0;for(let s=0;s<16;++s)e[t+s]=i[s];return e}return cAt(i)}const ec="SAVE_SUBGRAPH";function uAt(n,e){const t=()=>{const i=n.value;if(!i.template)throw new Error("Graph template property not set");i.template.update(i.save()),i.template.panning=i.panning,i.template.scaling=i.scaling};e.registerCommand(ec,{canExecute:()=>{var i;return n.value!==((i=n.value.editor)==null?void 0:i.graph)},execute:t})}const pAt={},_At={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},hAt=_("polyline",{points:"6 9 12 15 18 9"},null,-1),fAt=[hAt];function mAt(n,e){return O(),D("svg",_At,fAt)}const gAt=cn(pAt,[["render",mAt]]),EAt=ln({components:{"i-arrow":gAt},props:{intf:{type:Object,required:!0}},setup(n){const e=dt(null),t=dt(!1),i=et(()=>n.intf.items.find(o=>typeof o=="string"?o===n.intf.value:o.value===n.intf.value)),s=et(()=>i.value?typeof i.value=="string"?i.value:i.value.text:""),r=o=>{n.intf.value=typeof o=="string"?o:o.value};return rI(e,()=>{t.value=!1}),{el:e,open:t,selectedItem:i,selectedText:s,setSelected:r}}}),bAt=["title"],SAt={class:"__selected"},vAt={class:"__text"},yAt={class:"__icon"},TAt={class:"__dropdown"},xAt={class:"item --header"},CAt=["onClick"];function RAt(n,e,t,i,s,r){const o=_t("i-arrow");return O(),D("div",{ref:"el",class:He(["baklava-select",{"--open":n.open}]),title:n.intf.name,onClick:e[0]||(e[0]=a=>n.open=!n.open)},[_("div",SAt,[_("div",vAt,he(n.selectedText),1),_("div",yAt,[Ie(o)])]),Ie(ws,{name:"slide-fade"},{default:ot(()=>[xe(_("div",TAt,[_("div",xAt,he(n.intf.name),1),(O(!0),D($e,null,lt(n.intf.items,(a,l)=>(O(),D("div",{key:l,class:He(["item",{"--active":a===n.selectedItem}]),onClick:c=>n.setSelected(a)},he(typeof a=="string"?a:a.text),11,CAt))),128))],512),[[At,n.open]])]),_:1})],10,bAt)}const AAt=cn(EAt,[["render",RAt]]);class wAt extends pn{constructor(e,t,i){super(e,t),this.component=tc(AAt),this.items=i}}const NAt=ln({props:{intf:{type:Object,required:!0}}});function OAt(n,e,t,i,s,r){return O(),D("div",null,he(n.intf.value),1)}const IAt=cn(NAt,[["render",OAt]]);class MAt extends pn{constructor(e,t){super(e,t),this.component=tc(IAt),this.setPort(!1)}}const DAt=ln({props:{intf:{type:Object,required:!0},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(n,{emit:e}){return{v:et({get:()=>n.modelValue,set:i=>{e("update:modelValue",i)}})}}}),LAt=["placeholder","title"];function kAt(n,e,t,i,s,r){return O(),D("div",null,[xe(_("input",{"onUpdate:modelValue":e[0]||(e[0]=o=>n.v=o),type:"text",class:"baklava-input",placeholder:n.intf.name,title:n.intf.name},null,8,LAt),[[Xe,n.v]])])}const PAt=cn(DAt,[["render",kAt]]);class tp extends pn{constructor(){super(...arguments),this.component=tc(PAt)}}class cI extends jO{constructor(){super(...arguments),this._title="Subgraph Input",this.inputs={name:new tp("Name","Input").setPort(!1)},this.outputs={placeholder:new pn("Connection",void 0)}}}class dI extends QO{constructor(){super(...arguments),this._title="Subgraph Output",this.inputs={name:new tp("Name","Output").setPort(!1),placeholder:new pn("Connection",void 0)},this.outputs={output:new pn("Output",void 0).setHidden(!0)}}}const uI="CREATE_SUBGRAPH",hR=[Ra,Aa];function UAt(n,e,t){const i=()=>n.value.selectedNodes.filter(r=>!hR.includes(r.type)).length>0,s=()=>{const{viewModel:r}=yi(),o=n.value,a=n.value.editor;if(o.selectedNodes.length===0)return;const l=o.selectedNodes.filter(v=>!hR.includes(v.type)),c=l.flatMap(v=>Object.values(v.inputs)),d=l.flatMap(v=>Object.values(v.outputs)),u=o.connections.filter(v=>!d.includes(v.from)&&c.includes(v.to)),h=o.connections.filter(v=>d.includes(v.from)&&!c.includes(v.to)),m=o.connections.filter(v=>d.includes(v.from)&&c.includes(v.to)),f=l.map(v=>v.save()),b=m.map(v=>({id:v.id,from:v.from.id,to:v.to.id})),E=new Map,{xLeft:g,xRight:S,yTop:y}=FAt(l);console.log(g,S,y);for(const[v,A]of u.entries()){const P=new cI;P.inputs.name.value=A.to.name,f.push({...P.save(),position:{x:S-r.value.settings.nodes.defaultWidth-100,y:y+v*200}}),b.push({id:du(),from:P.outputs.placeholder.id,to:A.to.id}),E.set(A.to.id,P.graphInterfaceId)}for(const[v,A]of h.entries()){const P=new dI;P.inputs.name.value=A.from.name,f.push({...P.save(),position:{x:g+100,y:y+v*200}}),b.push({id:du(),from:A.from.id,to:P.inputs.placeholder.id}),E.set(A.from.id,P.graphInterfaceId)}const T=jn(new ep({connections:b,nodes:f,inputs:[],outputs:[]},a));a.addGraphTemplate(T);const C=a.nodeTypes.get(wa(T));if(!C)throw new Error("Unable to create subgraph: Could not find corresponding graph node type");const x=jn(new C.type);o.addNode(x);const w=Math.round(l.map(v=>v.position.x).reduce((v,A)=>v+A,0)/l.length),R=Math.round(l.map(v=>v.position.y).reduce((v,A)=>v+A,0)/l.length);x.position.x=w,x.position.y=R,u.forEach(v=>{o.removeConnection(v),o.addConnection(v.from,x.inputs[E.get(v.to.id)])}),h.forEach(v=>{o.removeConnection(v),o.addConnection(x.outputs[E.get(v.from.id)],v.to)}),l.forEach(v=>o.removeNode(v)),e.canExecuteCommand(ec)&&e.executeCommand(ec),t(T),n.value.panning={...o.panning},n.value.scaling=o.scaling};e.registerCommand(uI,{canExecute:i,execute:s})}function FAt(n){const e=n.reduce((s,r)=>{const o=r.position.x;return o{const o=r.position.y;return o{const o=r.position.x+r.width;return o>s?o:s},-1/0),xRight:e,yTop:t}}const fR="DELETE_NODES";function BAt(n,e){e.registerCommand(fR,{canExecute:()=>n.value.selectedNodes.length>0,execute(){n.value.selectedNodes.forEach(t=>n.value.removeNode(t))}}),e.registerHotkey(["Delete"],fR)}const pI="SWITCH_TO_MAIN_GRAPH";function GAt(n,e,t){e.registerCommand(pI,{canExecute:()=>n.value!==n.value.editor.graph,execute:()=>{e.executeCommand(ec),t(n.value.editor.graph)}})}function VAt(n,e,t){BAt(n,e),UAt(n,e,t),uAt(n,e),GAt(n,e,t)}class mR{constructor(e,t){this.type=e,e==="addNode"?this.nodeId=t:this.nodeState=t}undo(e){this.type==="addNode"?this.removeNode(e):this.addNode(e)}redo(e){this.type==="addNode"&&this.nodeState?this.addNode(e):this.type==="removeNode"&&this.nodeId&&this.removeNode(e)}addNode(e){const t=e.editor.nodeTypes.get(this.nodeState.type);if(!t)return;const i=new t.type;e.addNode(i),i.load(this.nodeState),this.nodeId=i.id}removeNode(e){const t=e.nodes.find(i=>i.id===this.nodeId);t&&(this.nodeState=t.save(),e.removeNode(t))}}class gR{constructor(e,t){if(this.type=e,e==="addConnection")this.connectionId=t;else{const i=t;this.connectionState={id:i.id,from:i.from.id,to:i.to.id}}}undo(e){this.type==="addConnection"?this.removeConnection(e):this.addConnection(e)}redo(e){this.type==="addConnection"&&this.connectionState?this.addConnection(e):this.type==="removeConnection"&&this.connectionId&&this.removeConnection(e)}addConnection(e){const t=e.findNodeInterface(this.connectionState.from),i=e.findNodeInterface(this.connectionState.to);!t||!i||e.addConnection(t,i)}removeConnection(e){const t=e.connections.find(i=>i.id===this.connectionId);t&&(this.connectionState={id:t.id,from:t.from.id,to:t.to.id},e.removeConnection(t))}}class zAt{constructor(e){if(this.type="transaction",e.length===0)throw new Error("Can't create a transaction with no steps");this.steps=e}undo(e){for(let t=this.steps.length-1;t>=0;t--)this.steps[t].undo(e)}redo(e){for(let t=0;t{if(!r.value)if(a.value)l.value.push(E);else for(o.value!==s.value.length-1&&(s.value=s.value.slice(0,o.value+1)),s.value.push(E),o.value++;s.value.length>i.value;)s.value.shift()},d=()=>{a.value=!0},u=()=>{a.value=!1,l.value.length>0&&(c(new zAt(l.value)),l.value=[])},h=()=>s.value.length!==0&&o.value!==-1,m=()=>{h()&&(r.value=!0,s.value[o.value--].undo(n.value),r.value=!1)},f=()=>s.value.length!==0&&o.value{f()&&(r.value=!0,s.value[++o.value].redo(n.value),r.value=!1)};return Bn(n,(E,g)=>{g&&(g.events.addNode.unsubscribe(t),g.events.removeNode.unsubscribe(t),g.events.addConnection.unsubscribe(t),g.events.removeConnection.unsubscribe(t)),E&&(E.events.addNode.subscribe(t,S=>{c(new mR("addNode",S.id))}),E.events.removeNode.subscribe(t,S=>{c(new mR("removeNode",S.save()))}),E.events.addConnection.subscribe(t,S=>{c(new gR("addConnection",S.id))}),E.events.removeConnection.subscribe(t,S=>{c(new gR("removeConnection",S))}))},{immediate:!0}),e.registerCommand(eE,{canExecute:h,execute:m}),e.registerCommand(tE,{canExecute:f,execute:b}),e.registerCommand(_I,{canExecute:()=>!a.value,execute:d}),e.registerCommand(hI,{canExecute:()=>a.value,execute:u}),e.registerHotkey(["Control","z"],eE),e.registerHotkey(["Control","y"],tE),jn({maxSteps:i})}const nE="COPY",iE="PASTE",qAt="CLEAR_CLIPBOARD";function YAt(n,e,t){const i=Symbol("ClipboardToken"),s=dt(""),r=dt(""),o=et(()=>!s.value),a=()=>{s.value="",r.value=""},l=()=>{const u=n.value.selectedNodes.flatMap(m=>[...Object.values(m.inputs),...Object.values(m.outputs)]),h=n.value.connections.filter(m=>u.includes(m.from)||u.includes(m.to)).map(m=>({from:m.from.id,to:m.to.id}));r.value=JSON.stringify(h),s.value=JSON.stringify(n.value.selectedNodes.map(m=>m.save()))},c=(u,h,m)=>{for(const f of u){let b;if((!m||m==="input")&&(b=Object.values(f.inputs).find(E=>E.id===h)),!b&&(!m||m==="output")&&(b=Object.values(f.outputs).find(E=>E.id===h)),b)return b}},d=()=>{if(o.value)return;const u=new Map,h=JSON.parse(s.value),m=JSON.parse(r.value),f=[],b=[],E=n.value;t.executeCommand(_I);for(const g of h){const S=e.value.nodeTypes.get(g.type);if(!S){console.warn(`Node type ${g.type} not registered`);return}const y=new S.type,T=y.id;f.push(y),y.hooks.beforeLoad.subscribe(i,C=>{const x=C;return x.position&&(x.position.x+=100,x.position.y+=100),y.hooks.beforeLoad.unsubscribe(i),x}),E.addNode(y),y.load({...g,id:T}),y.id=T,u.set(g.id,T);for(const C of Object.values(y.inputs)){const x=du();u.set(C.id,x),C.id=x}for(const C of Object.values(y.outputs)){const x=du();u.set(C.id,x),C.id=x}}for(const g of m){const S=c(f,u.get(g.from),"output"),y=c(f,u.get(g.to),"input");if(!S||!y)continue;const T=E.addConnection(S,y);T&&b.push(T)}return n.value.selectedNodes=f,t.executeCommand(hI),{newNodes:f,newConnections:b}};return t.registerCommand(nE,{canExecute:()=>n.value.selectedNodes.length>0,execute:l}),t.registerHotkey(["Control","c"],nE),t.registerCommand(iE,{canExecute:()=>!o.value,execute:d}),t.registerHotkey(["Control","v"],iE),t.registerCommand(qAt,{canExecute:()=>!0,execute:a}),jn({isEmpty:o})}const $At="OPEN_SIDEBAR";function WAt(n,e){e.registerCommand($At,{execute:t=>{n.value.sidebar.nodeId=t,n.value.sidebar.visible=!0},canExecute:()=>!0})}function KAt(n,e){WAt(n,e)}const jAt={},QAt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},XAt=_("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),ZAt=_("path",{d:"M9 13l-4 -4l4 -4m-4 4h11a4 4 0 0 1 0 8h-1"},null,-1),JAt=[XAt,ZAt];function ewt(n,e){return O(),D("svg",QAt,JAt)}const twt=cn(jAt,[["render",ewt]]),nwt={},iwt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},swt=_("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),rwt=_("path",{d:"M15 13l4 -4l-4 -4m4 4h-11a4 4 0 0 0 0 8h1"},null,-1),owt=[swt,rwt];function awt(n,e){return O(),D("svg",iwt,owt)}const lwt=cn(nwt,[["render",awt]]),cwt={},dwt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},uwt=_("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),pwt=_("line",{x1:"5",y1:"12",x2:"19",y2:"12"},null,-1),_wt=_("line",{x1:"5",y1:"12",x2:"11",y2:"18"},null,-1),hwt=_("line",{x1:"5",y1:"12",x2:"11",y2:"6"},null,-1),fwt=[uwt,pwt,_wt,hwt];function mwt(n,e){return O(),D("svg",dwt,fwt)}const gwt=cn(cwt,[["render",mwt]]),Ewt={},bwt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},Swt=_("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),vwt=_("path",{d:"M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2"},null,-1),ywt=_("rect",{x:"9",y:"3",width:"6",height:"4",rx:"2"},null,-1),Twt=[Swt,vwt,ywt];function xwt(n,e){return O(),D("svg",bwt,Twt)}const Cwt=cn(Ewt,[["render",xwt]]),Rwt={},Awt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},wwt=_("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),Nwt=_("rect",{x:"8",y:"8",width:"12",height:"12",rx:"2"},null,-1),Owt=_("path",{d:"M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2"},null,-1),Iwt=[wwt,Nwt,Owt];function Mwt(n,e){return O(),D("svg",Awt,Iwt)}const Dwt=cn(Rwt,[["render",Mwt]]),Lwt={},kwt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},Pwt=_("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),Uwt=_("path",{d:"M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2"},null,-1),Fwt=_("circle",{cx:"12",cy:"14",r:"2"},null,-1),Bwt=_("polyline",{points:"14 4 14 8 8 8 8 4"},null,-1),Gwt=[Pwt,Uwt,Fwt,Bwt];function Vwt(n,e){return O(),D("svg",kwt,Gwt)}const zwt=cn(Lwt,[["render",Vwt]]),Hwt={},qwt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},Ywt=Ru('',6),$wt=[Ywt];function Wwt(n,e){return O(),D("svg",qwt,$wt)}const Kwt=cn(Hwt,[["render",Wwt]]),jwt=ln({props:{command:{type:String,required:!0},title:{type:String,required:!0},icon:{type:Object,required:!1,default:void 0}},setup(){const{viewModel:n}=yi();return{viewModel:n}}}),Qwt=["disabled","title"];function Xwt(n,e,t,i,s,r){return O(),D("button",{class:"baklava-toolbar-entry baklava-toolbar-button",disabled:!n.viewModel.commandHandler.canExecuteCommand(n.command),title:n.title,onClick:e[0]||(e[0]=o=>n.viewModel.commandHandler.executeCommand(n.command))},[n.icon?(O(),Ot(Tu(n.icon),{key:0})):(O(),D($e,{key:1},[je(he(n.title),1)],64))],8,Qwt)}const Zwt=cn(jwt,[["render",Xwt]]),Jwt=ln({components:{ToolbarButton:Zwt},setup(){const{viewModel:n}=yi();return{isSubgraph:et(()=>n.value.displayedGraph!==n.value.editor.graph),commands:[{command:nE,title:"Copy",icon:Dwt},{command:iE,title:"Paste",icon:Cwt},{command:eE,title:"Undo",icon:twt},{command:tE,title:"Redo",icon:lwt},{command:uI,title:"Create Subgraph",icon:Kwt}],subgraphCommands:[{command:ec,title:"Save Subgraph",icon:zwt},{command:pI,title:"Back to Main Graph",icon:gwt}]}}}),eNt={class:"baklava-toolbar"};function tNt(n,e,t,i,s,r){const o=_t("toolbar-button");return O(),D("div",eNt,[(O(!0),D($e,null,lt(n.commands,a=>(O(),Ot(o,{key:a.command,command:a.command,title:a.title,icon:a.icon},null,8,["command","title","icon"]))),128)),n.isSubgraph?(O(!0),D($e,{key:0},lt(n.subgraphCommands,a=>(O(),Ot(o,{key:a.command,command:a.command,title:a.title,icon:a.icon},null,8,["command","title","icon"]))),128)):j("",!0)])}const nNt=cn(Jwt,[["render",tNt]]),iNt={class:"connections-container"},sNt=ln({__name:"Editor",props:{viewModel:{}},setup(n){const e=n,t=Symbol("EditorToken"),i=kd(e,"viewModel");Z1t(i);const s=dt(null);Qo("editorEl",s);const r=et(()=>e.viewModel.displayedGraph.nodes),o=et(()=>e.viewModel.displayedGraph.nodes.map(w=>JO(kd(w,"position")))),a=et(()=>e.viewModel.displayedGraph.connections),l=et(()=>e.viewModel.displayedGraph.selectedNodes),c=J1t(),d=eRt(),u=tRt(i),h=et(()=>({...c.styles.value})),m=dt(0);e.viewModel.editor.hooks.load.subscribe(t,w=>(m.value++,w));const f=w=>{c.onPointerMove(w),d.onMouseMove(w)},b=w=>{w.button===0&&(w.target===s.value&&(T(),c.onPointerDown(w)),d.onMouseDown())},E=w=>{c.onPointerUp(w),d.onMouseUp()},g=w=>{w.key==="Tab"&&w.preventDefault(),e.viewModel.commandHandler.handleKeyDown(w)},S=w=>{e.viewModel.commandHandler.handleKeyUp(w)},y=w=>{["Control","Shift"].some(R=>e.viewModel.commandHandler.pressedKeys.includes(R))||T(),e.viewModel.displayedGraph.selectedNodes.push(w)},T=()=>{e.viewModel.displayedGraph.selectedNodes=[]},C=w=>{for(const R of e.viewModel.displayedGraph.selectedNodes){const v=r.value.indexOf(R),A=o.value[v];A.onPointerDown(w),document.addEventListener("pointermove",A.onPointerMove)}document.addEventListener("pointerup",x)},x=()=>{for(const w of e.viewModel.displayedGraph.selectedNodes){const R=r.value.indexOf(w),v=o.value[R];v.onPointerUp(),document.removeEventListener("pointermove",v.onPointerMove)}document.removeEventListener("pointerup",x)};return(w,R)=>(O(),D("div",{ref_key:"el",ref:s,tabindex:"-1",class:He(["baklava-editor",{"baklava-ignore-mouse":!!vt(d).temporaryConnection.value||vt(c).dragging.value,"--temporary-connection":!!vt(d).temporaryConnection.value}]),onPointermove:Te(f,["self"]),onPointerdown:b,onPointerup:E,onWheel:R[1]||(R[1]=Te((...v)=>vt(c).onMouseWheel&&vt(c).onMouseWheel(...v),["self"])),onKeydown:g,onKeyup:S,onContextmenu:R[2]||(R[2]=Te((...v)=>vt(u).open&&vt(u).open(...v),["self","prevent"]))},[Nn(w.$slots,"background",{},()=>[Ie(sRt)]),Nn(w.$slots,"toolbar",{},()=>[Ie(nNt)]),Nn(w.$slots,"palette",{},()=>[Ie(oAt)]),(O(),D("svg",iNt,[(O(!0),D($e,null,lt(a.value,v=>(O(),D("g",{key:v.id+m.value.toString()},[Nn(w.$slots,"connection",{connection:v},()=>[Ie(zRt,{connection:v},null,8,["connection"])])]))),128)),Nn(w.$slots,"temporaryConnection",{temporaryConnection:vt(d).temporaryConnection.value},()=>[vt(d).temporaryConnection.value?(O(),Ot(YRt,{key:0,connection:vt(d).temporaryConnection.value},null,8,["connection"])):j("",!0)])])),_("div",{class:"node-container",style:Xt(h.value)},[Ie(ys,{name:"fade"},{default:ot(()=>[(O(!0),D($e,null,lt(r.value,(v,A)=>Nn(w.$slots,"node",{key:v.id+m.value.toString(),node:v,selected:l.value.includes(v),dragging:o.value[A].dragging.value,onSelect:P=>y(v),onStartDrag:C},()=>[Ie(kRt,{node:v,selected:l.value.includes(v),dragging:o.value[A].dragging.value,onSelect:P=>y(v),onStartDrag:C},null,8,["node","selected","dragging","onSelect"])])),128))]),_:3})],4),Nn(w.$slots,"sidebar",{},()=>[Ie(QRt)]),Nn(w.$slots,"minimap",{},()=>[w.viewModel.settings.enableMinimap?(O(),Ot(XRt,{key:0})):j("",!0)]),Nn(w.$slots,"contextMenu",{contextMenu:vt(u)},()=>[w.viewModel.settings.contextMenu.enabled?(O(),Ot($b,{key:0,modelValue:vt(u).show.value,"onUpdate:modelValue":R[0]||(R[0]=v=>vt(u).show.value=v),items:vt(u).items.value,x:vt(u).x.value,y:vt(u).y.value,onClick:vt(u).onClick},null,8,["modelValue","items","x","y","onClick"])):j("",!0)])],34))}}),rNt=["INPUT","TEXTAREA","SELECT"];function oNt(n){const e=dt([]),t=dt([]);return{pressedKeys:e,handleKeyDown:o=>{var a;e.value.includes(o.key)||e.value.push(o.key),!rNt.includes(((a=document.activeElement)==null?void 0:a.tagName)??"")&&t.value.forEach(l=>{l.keys.every(c=>e.value.includes(c))&&n(l.commandName)})},handleKeyUp:o=>{const a=e.value.indexOf(o.key);a>=0&&e.value.splice(a,1)},registerHotkey:(o,a)=>{t.value.push({keys:o,commandName:a})}}}const aNt=()=>{const n=dt(new Map),e=(r,o)=>{if(n.value.has(r))throw new Error(`Command "${r}" already exists`);n.value.set(r,o)},t=(r,o=!1,...a)=>{if(!n.value.has(r)){if(o)throw new Error(`[CommandHandler] Command ${r} not registered`);return}return n.value.get(r).execute(...a)},i=(r,o=!1,...a)=>{if(!n.value.has(r)){if(o)throw new Error(`[CommandHandler] Command ${r} not registered`);return!1}return n.value.get(r).canExecute(a)},s=oNt(t);return jn({registerCommand:e,executeCommand:t,canExecuteCommand:i,...s})},lNt=n=>!(n instanceof mc);function cNt(n,e){return{switchGraph:i=>{let s;if(lNt(i))s=new mc(n.value),i.createGraph(s);else{if(i!==n.value.graph)throw new Error("Can only switch using 'Graph' instance when it is the root graph. Otherwise a 'GraphTemplate' must be used.");s=i}e.value&&e.value!==n.value.graph&&e.value.destroy(),s.panning=s.panning??i.panning??{x:0,y:0},s.scaling=s.scaling??i.scaling??1,s.selectedNodes=s.selectedNodes??[],s.sidebar=s.sidebar??{visible:!1,nodeId:"",optionName:""},e.value=s}}}function dNt(n,e){n.position=n.position??{x:0,y:0},n.disablePointerEvents=!1,n.twoColumn=n.twoColumn??!1,n.width=n.width??e.defaultWidth}const uNt=()=>({useStraightConnections:!1,enableMinimap:!1,background:{gridSize:100,gridDivision:5,subGridVisibleThreshold:.6},sidebar:{width:300,resizable:!0},displayValueOnHover:!1,nodes:{defaultWidth:200,maxWidth:320,minWidth:150,resizable:!1},contextMenu:{enabled:!0,additionalItems:[]}});function pNt(n){const e=dt(n??new $1t),t=Symbol("ViewModelToken"),i=dt(null),s=gM(i),{switchGraph:r}=cNt(e,i),o=et(()=>s.value&&s.value!==e.value.graph),a=jn(uNt()),l=aNt(),c=HAt(s,l),d=YAt(s,e,l),u={renderNode:new ii(null),renderInterface:new ii(null)};return VAt(s,l,r),KAt(s,l),Bn(e,(h,m)=>{m&&(m.events.registerGraph.unsubscribe(t),m.graphEvents.beforeAddNode.unsubscribe(t),h.nodeHooks.beforeLoad.unsubscribe(t),h.nodeHooks.afterSave.unsubscribe(t),h.graphTemplateHooks.beforeLoad.unsubscribe(t),h.graphTemplateHooks.afterSave.unsubscribe(t),h.graph.hooks.load.unsubscribe(t),h.graph.hooks.save.unsubscribe(t)),h&&(h.nodeHooks.beforeLoad.subscribe(t,(f,b)=>(b.position=f.position??{x:0,y:0},b.width=f.width??a.nodes.defaultWidth,b.twoColumn=f.twoColumn??!1,f)),h.nodeHooks.afterSave.subscribe(t,(f,b)=>(f.position=b.position,f.width=b.width,f.twoColumn=b.twoColumn,f)),h.graphTemplateHooks.beforeLoad.subscribe(t,(f,b)=>(b.panning=f.panning,b.scaling=f.scaling,f)),h.graphTemplateHooks.afterSave.subscribe(t,(f,b)=>(f.panning=b.panning,f.scaling=b.scaling,f)),h.graph.hooks.load.subscribe(t,(f,b)=>(b.panning=f.panning,b.scaling=f.scaling,f)),h.graph.hooks.save.subscribe(t,(f,b)=>(f.panning=b.panning,f.scaling=b.scaling,f)),h.graphEvents.beforeAddNode.subscribe(t,f=>dNt(f,{defaultWidth:a.nodes.defaultWidth})),e.value.registerNodeType(cI,{category:"Subgraphs"}),e.value.registerNodeType(dI,{category:"Subgraphs"}),r(h.graph))},{immediate:!0}),jn({editor:e,displayedGraph:s,isSubgraph:o,settings:a,commandHandler:l,history:c,clipboard:d,hooks:u,switchGraph:r})}const ER=Hb({type:"AgentNode",title:"Agent",inputs:{request:()=>new pn("Request",""),agent_name:()=>new wAt("Agent name","",sE.state.config.personalities).setPort(!1)},outputs:{display:()=>new MAt("Output",""),response:()=>new pn("Response","")},async calculate({request:n}){console.log(sE.state.config.personalities);let e="";try{e=(await Ue.get("/generate",{params:{text:n}})).data}catch(t){console.error(t)}return{display:e,response:e}}}),_Nt=Hb({type:"RAGNode",title:"RAG",inputs:{request:()=>new pn("Prompt",""),document_path:()=>new tp("Document path","").setPort(!1)},outputs:{prompt:()=>new pn("Prompt with Data","")},async calculate({request:n,document_path:e}){let t="";try{t=(await Ue.get("/rag",{params:{text:n,doc_path:e}})).data}catch(i){console.error(i)}return{response:t}}}),bR=Hb({type:"Task",title:"Task",inputs:{description:()=>new tp("Task description","").setPort(!1)},outputs:{prompt:()=>new pn("Prompt")},calculate({description:n}){return{prompt:n}}}),hNt=ln({components:{"baklava-editor":sNt},setup(){const n=pNt(),e=new X1t(n.editor);n.editor.registerNodeType(ER),n.editor.registerNodeType(bR),n.editor.registerNodeType(_Nt);const t=Symbol();e.events.afterRun.subscribe(t,o=>{e.pause(),W1t(o,n.editor),e.resume()}),e.start();function i(o,a,l){const c=new o;return n.displayedGraph.addNode(c),c.position.x=a,c.position.y=l,c}const s=i(bR,300,140),r=i(ER,550,140);return n.displayedGraph.addConnection(s.outputs.result,r.inputs.value),{baklava:n,saveGraph:()=>{const o=e.export();localStorage.setItem("myGraph",JSON.stringify(o))},loadGraph:()=>{const o=JSON.parse(localStorage.getItem("myGraph"));e.import(o)}}}}),fNt={style:{width:"100vw",height:"100vh"}};function mNt(n,e,t,i,s,r){const o=_t("baklava-editor");return O(),D("div",fNt,[Ie(o,{"view-model":n.baklava},null,8,["view-model"]),_("button",{onClick:e[0]||(e[0]=(...a)=>n.saveGraph&&n.saveGraph(...a))},"Save Graph"),_("button",{onClick:e[1]||(e[1]=(...a)=>n.loadGraph&&n.loadGraph(...a))},"Load Graph")])}const gNt=gt(hNt,[["render",mNt]]),ENt=Zk({history:mk("/"),routes:[{path:"/playground/",name:"playground",component:KZe},{path:"/extensions/",name:"extensions",component:rJe},{path:"/help/",name:"help",component:CJe},{path:"/settings/",name:"settings",component:Kut},{path:"/training/",name:"training",component:fpt},{path:"/quantizing/",name:"quantizing",component:xpt},{path:"/",name:"discussions",component:Tbt},{path:"/",name:"interactive",component:B1t},{path:"/",name:"nodes",component:gNt}]});const np=l2(NB);console.log("Loaded main.js");function SR(n){const e={};for(const t in n)n.hasOwnProperty(t)&&(e[t]=n[t]);return e}const sE=k2({state(){return{yesNoDialog:null,universalForm:null,toast:null,messageBox:null,api_get_req:null,startSpeechRecognition:null,ready:!1,loading_infos:"",loading_progress:0,version:"unknown",settingsChanged:!1,isConnected:!1,isModelOk:!1,isGenerating:!1,config:null,mountedPers:null,mountedPersArr:[],mountedExtensions:[],bindingsZoo:[],modelsArr:[],selectedModel:null,personalities:[],diskUsage:null,ramUsage:null,vramUsage:null,modelsZoo:[],installedModels:[],currentModel:null,extensionsZoo:[],databases:[]}},mutations:{setIsReady(n,e){n.ready=e},setIsConnected(n,e){n.isConnected=e},setIsModelOk(n,e){n.isModelOk=e},setIsGenerating(n,e){n.isGenerating=e},setConfig(n,e){n.config=e},setPersonalities(n,e){n.personalities=e},setMountedPers(n,e){n.mountedPers=e},setMountedPersArr(n,e){n.mountedPersArr=e},setMountedExtensions(n,e){n.mountedExtensions=e},setbindingsZoo(n,e){n.bindingsZoo=e},setModelsArr(n,e){n.modelsArr=e},setselectedModel(n,e){n.selectedModel=e},setDiskUsage(n,e){n.diskUsage=e},setRamUsage(n,e){n.ramUsage=e},setVramUsage(n,e){n.vramUsage=e},setModelsZoo(n,e){n.modelsZoo=e},setCurrentModel(n,e){n.currentModel=e},setExtensionsZoo(n,e){n.extensionsZoo=e},setDatabases(n,e){n.databases=e}},getters:{getIsConnected(n){return n.isConnected},getIsModelOk(n){return n.isModelOk},getIsGenerating(n){return n.isGenerating},getConfig(n){return n.config},getPersonalities(n){return n.personalities},getMountedPersArr(n){return n.mountedPersArr},getmmountedExtensions(n){return n.mountedExtensions},getMountedPers(n){return n.mountedPers},getbindingsZoo(n){return n.bindingsZoo},getModelsArr(n){return n.modelsArr},getDiskUsage(n){return n.diskUsage},getRamUsage(n){return n.ramUsage},getVramUsage(n){return n.vramUsage},getDatabasesList(n){return n.databases},getModelsZoo(n){return n.modelsZoo},getCurrentModel(n){return n.currentModel},getExtensionsZoo(n){return n.extensionsZoo}},actions:{async getVersion(){try{let n=await Ue.get("/get_lollms_webui_version",{});n&&(this.state.version=n.data.version)}catch{console.log("Coudln't get version")}},async refreshConfig({commit:n}){console.log("Fetching configuration");try{const e=await oi("get_config");e.active_personality_id<0&&(e.active_personality_id=0);let t=e.personalities[e.active_personality_id].split("/");e.personality_category=t[0],e.personality_folder=t[1],e.extensions.length>0?e.extension_category=e.extensions[-1]:e.extension_category="ai_sensors",console.log("Recovered config"),console.log(e),console.log("Committing config"),console.log(e),console.log(this.state.config),n("setConfig",e)}catch(e){console.log(e.message,"refreshConfig")}},async refreshDatabase({commit:n}){let e=await oi("list_databases");console.log("databases:",e),n("setDatabases",e)},async refreshPersonalitiesZoo({commit:n}){let e=[];const t=await oi("get_all_personalities"),i=Object.keys(t);console.log("Personalities recovered:"+this.state.config.personalities);for(let s=0;s{let c=!1;for(const u of this.state.config.personalities)if(u.includes(r+"/"+l.folder))if(c=!0,u.includes(":")){const h=u.split(":");l.language=h[1]}else l.language=null;let d={};return d=l,d.category=r,d.full_path=r+"/"+l.folder,d.isMounted=c,d});e.length==0?e=a:e=e.concat(a)}e.sort((s,r)=>s.name.localeCompare(r.name)),n("setPersonalities",e),console.log("Done loading personalities")},refreshMountedPersonalities({commit:n}){this.state.config.active_personality_id<0&&(this.state.config.active_personality_id=0);let e=[];const t=[];for(let i=0;ia.full_path==s||a.full_path==r[0]);if(o>=0){let a=SR(this.state.personalities[o]);r.length>1&&(a.language=r[1]),a?e.push(a):e.push(this.state.personalities[this.state.personalities.findIndex(l=>l.full_path=="generic/lollms")])}else t.push(i),console.log("Couldn't load personality : ",s)}for(let i=t.length-1;i>=0;i--)console.log("Removing personality : ",this.state.config.personalities[t[i]]),this.state.config.personalities.splice(t[i],1),this.state.config.active_personality_id>t[i]&&(this.state.config.active_personality_id-=1);n("setMountedPersArr",e),this.state.mountedPers=this.state.personalities[this.state.personalities.findIndex(i=>i.full_path==this.state.config.personalities[this.state.config.active_personality_id]||i.full_path+":"+i.language==this.state.config.personalities[this.state.config.active_personality_id])]},async refreshBindings({commit:n}){let e=await oi("list_bindings");n("setbindingsZoo",e)},async refreshModelsZoo({commit:n}){console.log("Fetching models");const e=await Ue.get("/get_available_models");n("setModelsZoo",e.data.filter(t=>t.variants&&t.variants.length>0))},async refreshModelStatus({commit:n}){let e=await oi("get_model_status");n("setIsModelOk",e.status)},async refreshModels({commit:n}){console.log("Fetching models");let e=await oi("list_models");console.log(`Found ${e}`);let t=await oi("get_active_model");console.log("Selected model ",t),t!=null&&n("setselectedModel",t.model),n("setModelsArr",e),console.log("setModelsArr",e),this.state.modelsZoo.map(s=>{s.isInstalled=e.includes(s.name)}),this.state.installedModels=this.state.modelsZoo.filter(s=>s.isInstalled);const i=this.state.modelsZoo.findIndex(s=>s.name==this.state.config.model_name);i!=-1&&n("setCurrentModel",this.state.modelsZoo[i])},async refreshExtensionsZoo({commit:n}){let e=[],t=await oi("list_extensions");const i=Object.keys(t);console.log("Extensions recovered:"+t);for(let s=0;s{let c=!1;for(const u of this.state.config.extensions)u.includes(r+"/"+l.folder)&&(c=!0);let d={};return d=l,d.category=r,d.full_path=r+"/"+l.folder,d.isMounted=c,d});e.length==0?e=a:e=e.concat(a)}e.sort((s,r)=>s.name.localeCompare(r.name)),console.log("Done loading extensions"),n("setExtensionsZoo",e)},refreshmountedExtensions({commit:n}){console.log("Mounting extensions");let e=[];const t=[];for(let i=0;io.full_path==s);if(r>=0){let o=SR(this.state.config.extensions[r]);o&&e.push(o)}else t.push(i),console.log("Couldn't load extension : ",s)}for(let i=t.length-1;i>=0;i--)console.log("Removing extensions : ",this.state.config.extensions[t[i]]),this.state.config.extensions.splice(t[i],1);n("setMountedExtensions",e)},async refreshDiskUsage({commit:n}){this.state.diskUsage=await oi("disk_usage")},async refreshRamUsage({commit:n}){this.state.ramUsage=await oi("ram_usage")},async refreshVramUsage({commit:n}){const e=await oi("vram_usage"),t=[];if(e.nb_gpus>0){for(let s=0;s LoLLMS WebUI - Welcome - - + +
diff --git a/web/src/main.js b/web/src/main.js index c7f7b46a..2bd1c47e 100644 --- a/web/src/main.js +++ b/web/src/main.js @@ -513,16 +513,16 @@ app.mixin({ await this.$store.dispatch('refreshConfig'); console.log("Config ready") } - catch{ - + catch (ex){ + console.log("Error cought:", ex) } try{ this.$store.state.loading_infos = "Loading Database" this.$store.state.loading_progress = 20 await this.$store.dispatch('refreshDatabase'); } - catch{ - + catch (ex){ + console.log("Error cought:", ex) } try{ @@ -530,8 +530,8 @@ app.mixin({ this.$store.state.loading_progress = 30 await this.$store.dispatch('getVersion'); } - catch{ - + catch (ex){ + console.log("Error cought:", ex) } try{ @@ -539,31 +539,31 @@ app.mixin({ this.$store.state.loading_progress = 40 await this.$store.dispatch('refreshBindings'); } - catch{ - + catch (ex){ + console.log("Error cought:", ex) } try{ this.$store.state.loading_infos = "Getting Hardware usage" await refreshHardwareUsage(this.$store); } - catch{ - + catch (ex){ + console.log("Error cought:", ex) } try{ this.$store.state.loading_infos = "Getting extensions zoo" this.$store.state.loading_progress = 50 await this.$store.dispatch('refreshExtensionsZoo'); } - catch{ - + catch (ex){ + console.log("Error cought:", ex) } try{ this.$store.state.loading_infos = "Getting mounted extensions" this.$store.state.loading_progress = 60 await this.$store.dispatch('refreshmountedExtensions'); } - catch{ - + catch (ex){ + console.log("Error cought:", ex) } try{ @@ -571,16 +571,16 @@ app.mixin({ this.$store.state.loading_progress = 70 await this.$store.dispatch('refreshPersonalitiesZoo') } - catch{ - + catch (ex){ + console.log("Error cought:", ex) } try{ this.$store.state.loading_infos = "Getting mounted personalities" this.$store.state.loading_progress = 80 await this.$store.dispatch('refreshMountedPersonalities'); } - catch{ - + catch (ex){ + console.log("Error cought:", ex) } try{ @@ -588,8 +588,8 @@ app.mixin({ this.$store.state.loading_progress = 90 await this.$store.dispatch('refreshModelsZoo'); } - catch{ - + catch (ex){ + console.log("Error cought:", ex) } try{ this.$store.state.loading_infos = "Getting active models" @@ -597,8 +597,8 @@ app.mixin({ await this.$store.dispatch('refreshModels'); await this.$store.dispatch('refreshModelStatus'); } - catch{ - + catch (ex){ + console.log("Error cought:", ex) } diff --git a/web/src/views/SettingsView.vue b/web/src/views/SettingsView.vue index 4468f0ae..f10afbd2 100644 --- a/web/src/views/SettingsView.vue +++ b/web/src/views/SettingsView.vue @@ -3835,6 +3835,7 @@ export default { async unmountAll(){ await axios.get('/unmount_all_personalities'); this.$store.dispatch('refreshMountedPersonalities'); + this.$store.dispatch('refreshConfig'); this.$store.state.toast.showToast("All personas unmounted", 4, true) }, async unmountPersonality(pers) {