From f61713ec63c432b905324ab10141c18c5eed8a64 Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Mon, 1 Jul 2024 01:02:24 +0200 Subject: [PATCH] synced --- configs/config.yaml | 3 +- lollms_core | 2 +- ...{index-b98243ba.css => index-a84fbfd3.css} | 2 +- .../{index-01362090.js => index-e55d062d.js} | 342 +++++++++--------- web/dist/index.html | 4 +- web/src/views/SettingsView.vue | 12 + zoos/models_zoo | 2 +- zoos/personalities_zoo | 2 +- 8 files changed, 191 insertions(+), 178 deletions(-) rename web/dist/assets/{index-b98243ba.css => index-a84fbfd3.css} (99%) rename web/dist/assets/{index-01362090.js => index-e55d062d.js} (92%) diff --git a/configs/config.yaml b/configs/config.yaml index 93dad81e..68c09f5d 100644 --- a/configs/config.yaml +++ b/configs/config.yaml @@ -1,5 +1,5 @@ # =================== Lord Of Large Language Multimodal Systems Configuration file =========================== -version: 123 +version: 124 binding_name: null model_name: null model_variant: null @@ -258,6 +258,7 @@ rag_activate_multi_hops: false #if true, we use multi hops algorithm to do multi rag_min_nb_tokens_in_chunk: 10 #this removed any useless junk ith less than x tokens rag_max_n_hops: 3 #We set the maximum number of hop in multi hops rag +contextual_summary: false #If activated this will completely replace the rag and instead will use contextual summary activate_skills_lib: false # Activate vectorizing previous conversations skills_lib_database_name: "default" # Default skills database diff --git a/lollms_core b/lollms_core index 367111ba..059f36aa 160000 --- a/lollms_core +++ b/lollms_core @@ -1 +1 @@ -Subproject commit 367111bab7ce5d417f27b7d85e1ecfa8cfea2922 +Subproject commit 059f36aae23abd141f24490258ced6d690ab3681 diff --git a/web/dist/assets/index-b98243ba.css b/web/dist/assets/index-a84fbfd3.css similarity index 99% rename from web/dist/assets/index-b98243ba.css rename to web/dist/assets/index-a84fbfd3.css index c232937f..974cdd91 100644 --- a/web/dist/assets/index-b98243ba.css +++ b/web/dist/assets/index-a84fbfd3.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;outline:none}.progress-bar-container{background-color:#f0f0f0;border-radius:4px;height:8px;overflow:hidden}.progress-bar{background-color:#3498db;height:100%;transition:width .3s ease}.popup-container[data-v-d504dfc9]{background-color:#fff;color:#333;border-radius:8px;box-shadow:0 4px 6px #0000001a;padding:24px;width:100%;height:100%;position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center}.close-button[data-v-d504dfc9]{position:absolute;top:16px;right:16px;background-color:#3490dc;color:#fff;font-weight:700;padding:8px 16px;border-radius:8px;cursor:pointer;transition:background-color .3s ease}.close-button[data-v-d504dfc9]:hover{background-color:#2779bd}.iframe-content[data-v-d504dfc9]{width:100%;height:80%;border:none;margin-bottom:16px}.checkbox-container[data-v-d504dfc9]{display:flex;align-items:center;justify-content:center}.styled-checkbox[data-v-d504dfc9]{width:24px;height:24px;accent-color:#3490dc;cursor:pointer}.checkbox-label[data-v-d504dfc9]{margin-left:8px;font-size:16px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.fade-enter-active[data-v-d504dfc9],.fade-leave-active[data-v-d504dfc9]{transition:opacity .5s}.fade-enter[data-v-d504dfc9],.fade-leave-to[data-v-d504dfc9]{opacity:0}.container{margin:0;padding:0}.link-item{height:25px;margin-top:5px;padding:0 20px;margin-bottom:-5px;display:flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:5px 5px 0 0;font-weight:700;transition:duration-300 ease-in-out transform}.link-item-dark{padding:0 20px;color:#f0f8ff;margin-bottom:-5px;display:flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:5px 5px 0 0;font-weight:700;transition:duration-300 ease-in-out transform}.nav-ul{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;height:100%}.nav-li{cursor:pointer;display:flex;align-items:center;padding:5px}.fade-in{animation:fadeInAnimation .5s}@keyframes fadeInAnimation{0%{opacity:0}to{opacity:1}}.bounce-in{animation:bounceInAnimation .5s}.bounce-out{animation:bounceOutAnimation .5s}@keyframes bounceInAnimation{0%{transform:scale(1)}50%{transform:scale(1.2)}to{transform:scale(1)}}.shadow-no-bottom{box-shadow:0 -4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.dot{width:10px;height:10px;border-radius:50%}.dot-green{background-color:green}.dot-red{background-color:red}.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}.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-b7b0e3aa]{font-size:24px;animation:pulsate-b7b0e3aa 1.5s infinite}@keyframes pulsate-b7b0e3aa{0%{transform:scale(1);opacity:1}50%{transform:scale(1.1);opacity:.7}to{transform:scale(1);opacity:1}}.list-move[data-v-b7b0e3aa],.list-enter-active[data-v-b7b0e3aa],.list-leave-active[data-v-b7b0e3aa]{transition:all .5s ease}.list-enter-from[data-v-b7b0e3aa]{transform:translatey(-30px)}.list-leave-to[data-v-b7b0e3aa]{opacity:0;transform:translatey(30px)}.list-leave-active[data-v-b7b0e3aa]{position:absolute}.bounce-enter-active[data-v-b7b0e3aa]{animation:bounce-in-b7b0e3aa .5s}.bounce-leave-active[data-v-b7b0e3aa]{animation:bounce-in-b7b0e3aa .5s reverse}@keyframes bounce-in-b7b0e3aa{0%{transform:scale(0)}50%{transform:scale(1.25)}to{transform:scale(1)}}.bg-primary-light[data-v-b7b0e3aa]{background-color:#0ff}.hover[data-v-b7b0e3aa]:bg-primary-light:hover{background-color:#7fffd4}.font-bold[data-v-b7b0e3aa]{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-de7bc8fe]{animation:bounce-in-de7bc8fe .5s}.bounce-leave-active[data-v-de7bc8fe]{animation:bounce-in-de7bc8fe .5s reverse}@keyframes bounce-in-de7bc8fe{0%{transform:scale(0)}50%{transform:scale(1.25)}to{transform:scale(1)}}.custom-scrollbar[data-v-1a32c141]::-webkit-scrollbar{width:8px}.custom-scrollbar[data-v-1a32c141]::-webkit-scrollbar-track{background-color:#f1f1f1}.custom-scrollbar[data-v-1a32c141]::-webkit-scrollbar-thumb{background-color:#888;border-radius:4px}.custom-scrollbar[data-v-1a32c141]::-webkit-scrollbar-thumb:hover{background-color:#555}.menu[data-v-1a32c141]{display:flex;flex-direction:column;align-items:center}.commands-menu-items-wrapper[data-v-1a32c141]{position:relative;display:flex;flex-direction:column;align-items:center}.commands-menu-items-wrapper>#commands-menu-items[data-v-1a32c141]{top:calc(-100% - 2rem)}.list-move[data-v-2c705e91],.list-enter-active[data-v-2c705e91],.list-leave-active[data-v-2c705e91]{transition:all .5s ease}.list-enter-from[data-v-2c705e91]{transform:translatey(-30px)}.list-leave-to[data-v-2c705e91]{opacity:0;transform:translatey(30px)}.list-leave-active[data-v-2c705e91]{position:absolute}.slide-right-enter-active[data-v-b8e854ae],.slide-right-leave-active[data-v-b8e854ae]{transition:transform .3s ease}.slide-right-enter[data-v-b8e854ae],.slide-right-leave-to[data-v-b8e854ae]{transform:translate(-100%)}.fade-and-fly-enter-active[data-v-b8e854ae]{animation:fade-and-fly-enter-b8e854ae .5s ease}.fade-and-fly-leave-active[data-v-b8e854ae]{animation:fade-and-fly-leave-b8e854ae .5s ease}@keyframes fade-and-fly-enter-b8e854ae{0%{opacity:0;transform:translateY(20px) scale(.8)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes fade-and-fly-leave-b8e854ae{0%{opacity:1;transform:translateY(0) scale(1)}to{opacity:0;transform:translateY(-20px) scale(1.2)}}.list-move[data-v-b8e854ae],.list-enter-active[data-v-b8e854ae],.list-leave-active[data-v-b8e854ae]{transition:all .5s ease}.list-enter-from[data-v-b8e854ae]{transform:translatey(-30px)}.list-leave-to[data-v-b8e854ae]{opacity:0;transform:translatey(30px)}.list-leave-active[data-v-b8e854ae]{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}.-left-6{left:-1.5rem}.-right-0{right:-0px}.-right-0\.5{right:-.125rem}.-right-1{right:-.25rem}.-right-1\.5{right:-.375rem}.-right-6{right:-1.5rem}.-top-1{top:-.25rem}.-top-1\.5{top:-.375rem}.-top-2{top:-.5rem}.-top-20{top:-5rem}.-top-6{top:-1.5rem}.-top-9{top:-2.25rem}.bottom-0{bottom:0}.bottom-16{bottom:4rem}.bottom-2{bottom:.5rem}.bottom-2\.5{bottom:.625rem}.bottom-20{bottom:5rem}.bottom-5{bottom:1.25rem}.bottom-\[60px\]{bottom:60px}.left-0{left:0}.left-1{left:.25rem}.left-1\/2{left:50%}.left-2{left:.5rem}.left-20{left:5rem}.right-0{right:0}.right-2{right:.5rem}.right-2\.5{right:.625rem}.right-20{right:5rem}.right-3{right:.75rem}.top-0{top:0}.top-1{top:.25rem}.top-1\/2{top:50%}.top-2{top:.5rem}.top-20{top:5rem}.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-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-0{margin-left:0;margin-right:0}.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-3\.5{margin-bottom:.875rem}.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-6{margin-left:1.5rem}.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}.contents{display:contents}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.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-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-96{height:24rem}.h-\[200px\]{height:200px}.h-auto{height:auto}.h-fit{height:-moz-fit-content;height:fit-content}.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-\[500px\]{min-height:500px}.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-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-\[1000px\]{width:1000px}.w-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.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-\[900px\]{max-width:900px}.max-w-full{max-width:100%}.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-150{--tw-scale-x: 1.5;--tw-scale-y: 1.5;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-none{list-style-type:none}.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))}.grid-cols-\[40px\,1fr\]{grid-template-columns:40px 1fr}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-content-center{place-content:center}.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-2\.5{gap:.625rem}.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-r{border-right-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{border-color:var(--color-bg-dark)}.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{border-color:var(--color-primary)}.border-primary-light{border-color:var(--color-primary-light)}.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{border-color:var(--color-secondary)}.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{background-color:var(--color-accent)}.bg-bg-dark-tone-panel{background-color:var(--color-bg-dark-tone-panel)}.bg-bg-light{background-color:var(--color-bg-light)}.bg-bg-light-discussion{background-color:var(--color-bg-light-discussion)}.bg-bg-light-panel{background-color:var(--color-bg-light-panel)}.bg-bg-light-tone{background-color:var(--color-bg-light-tone)}.bg-bg-light-tone-panel{background-color:var(--color-bg-light-tone-panel)}.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{background-color:var(--color-primary)}.bg-primary-light{background-color:var(--color-primary-light)}.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{background-color:var(--color-secondary)}.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: var(--color-bg-light) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 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: var(--color-bg-light-tone) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 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(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--color-bg-light) 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:var(--color-secondary)}.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-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.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}.pb-5{padding-bottom:1.25rem}.pb-6{padding-bottom:1.5rem}.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-\[\.82rem\]{font-size:.82rem}.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-4{line-height:1rem}.leading-6{line-height:1.5rem}.leading-9{line-height:2.25rem}.leading-none{line-height:1}.leading-tight{line-height:1.25}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-blue-100{--tw-text-opacity: 1;color:rgb(225 239 254 / 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-dark-text-panel{color:var(--color-dark-text-panel)}.text-gray-100{--tw-text-opacity: 1;color:rgb(243 244 246 / 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-light-text-panel{color:var(--color-light-text-panel)}.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{color:var(--color-secondary)}.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)}.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-md{--tw-backdrop-blur: blur(12px);-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)}.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-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-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: var(--color-bg-light) !important}.scrollbar-track-bg-light-tone{--scrollbar-track: var(--color-bg-light-tone) !important}.scrollbar-thumb-bg-light-tone{--scrollbar-thumb: var(--color-bg-light-tone) !important}.scrollbar-thumb-bg-light-tone-panel{--scrollbar-thumb: var(--color-bg-light-tone-panel) !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}:root{--color-primary: #0e8ef0;--color-primary-light: #3dabff;--color-secondary: #0fd974;--color-accent: #f0700e;--color-light-text-panel: #ffffff;--color-dark-text-panel: #ffffff;--color-bg-light-panel: #7cb5ec;--color-bg-light: #e2edff;--color-bg-light-tone: #b9d2f7;--color-bg-light-code-block: #cad7ed;--color-bg-light-tone-panel: #8fb5ef;--color-bg-light-discussion: #c5d8f8;--color-bg-light-discussion-odd: #d6e7ff;--color-bg-dark: #132e59;--color-bg-dark-tone: #25477d;--color-bg-dark-tone-panel: #4367a3;--color-bg-dark-code-block: #2254a7;--color-bg-dark-discussion: #435E8A;--color-bg-dark-discussion-odd: #284471}.last\:mb-0:last-child{margin-bottom:0}.last\:\!border-transparent:last-child{border-color:transparent!important}.last\:pb-0:last-child{padding-bottom:0}.odd\:bg-bg-light-tone:nth-child(odd){background-color:var(--color-bg-light-tone)}.even\:bg-bg-light-discussion-odd:nth-child(2n){background-color:var(--color-bg-light-discussion-odd)}.even\:bg-bg-light-tone-panel:nth-child(2n){background-color:var(--color-bg-light-tone-panel)}.group:hover .group-hover\:visible{visibility:visible}.group:hover .group-hover\:bottom-0{bottom:0}.group:hover .group-hover\:block{display:block}.group:hover .group-hover\:-translate-x-12{--tw-translate-x: -3rem;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\:-translate-x-8{--tw-translate-x: -2rem;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\:-translate-y-8{--tw-translate-y: -2rem;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\:translate-x-5{--tw-translate-x: 1.25rem;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\:translate-x-\[0px\]{--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))}.group:hover .group-hover\:translate-y-\[-50px\]{--tw-translate-y: -50px;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{border-color:var(--color-secondary)}.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: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{color:var(--color-primary)}.hover\:z-10:hover{z-index:10}.hover\:z-20:hover{z-index:20}.hover\:z-50:hover{z-index:50}.hover\:h-8:hover{height:2rem}.hover\:-translate-y-1:hover{--tw-translate-y: -.25rem;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\:-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\:-translate-y-8:hover{--tw-translate-y: -2rem;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\:translate-y-\[-5px\]:hover{--tw-translate-y: -5px;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-110:hover{--tw-scale-x: 1.1;--tw-scale-y: 1.1;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-150:hover{--tw-scale-x: 1.5;--tw-scale-y: 1.5;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{border-color:var(--color-primary)}.hover\:border-primary-light:hover{border-color:var(--color-primary-light)}.hover\:border-secondary:hover{border-color:var(--color-secondary)}.hover\:bg-accent:hover{background-color:var(--color-accent)}.hover\:bg-bg-light-tone:hover{background-color:var(--color-bg-light-tone)}.hover\:bg-bg-light-tone-panel:hover{background-color:var(--color-bg-light-tone-panel)}.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-500:hover{--tw-bg-opacity: 1;background-color:rgb(63 131 248 / 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-700:hover{--tw-bg-opacity: 1;background-color:rgb(26 86 219 / 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-300:hover{--tw-bg-opacity: 1;background-color:rgb(132 225 188 / 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{background-color:var(--color-primary)}.hover\:bg-primary-light:hover{background-color:var(--color-primary-light)}.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-300:hover{--tw-bg-opacity: 1;background-color:rgb(248 180 180 / 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-secondary:hover{background-color:var(--color-secondary)}.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:var(--color-primary)}.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-300:hover{--tw-text-opacity: 1;color:rgb(132 225 188 / 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{color:var(--color-primary)}.hover\:text-red-300:hover{--tw-text-opacity: 1;color:rgb(248 180 180 / 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{color:var(--color-secondary)}.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\:shadow-none:hover{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;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: var(--color-primary) !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{border-color:var(--color-secondary)}.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-red-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(240 82 82 / var(--tw-ring-opacity))}.focus\:ring-secondary:focus{--tw-ring-color: var(--color-secondary)}.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))}.focus\:ring-opacity-50:focus{--tw-ring-opacity: .5}.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: var(--color-secondary) !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){border-color:var(--color-bg-light)}: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){background-color:var(--color-bg-dark)}:is(.dark .dark\:bg-bg-dark-discussion){background-color:var(--color-bg-dark-discussion)}:is(.dark .dark\:bg-bg-dark-tone){background-color:var(--color-bg-dark-tone)}:is(.dark .dark\:bg-bg-dark-tone-panel){background-color:var(--color-bg-dark-tone-panel)}: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-200){--tw-bg-opacity: 1;background-color:rgb(229 231 235 / 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: var(--color-bg-dark) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 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: var(--color-bg-dark-tone) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 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(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--color-bg-dark) 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-dark-text-panel){color:var(--color-dark-text-panel)}: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-100){--tw-text-opacity: 1;color:rgb(222 247 236 / 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-light-text-panel){color:var(--color-light-text-panel)}: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-primary){color:var(--color-primary)}: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: var(--color-bg-dark) !important}:is(.dark .dark\:scrollbar-track-bg-dark-tone){--scrollbar-track: var(--color-bg-dark-tone) !important}:is(.dark .dark\:scrollbar-thumb-bg-dark-tone){--scrollbar-thumb: var(--color-bg-dark-tone) !important}:is(.dark .dark\:scrollbar-thumb-bg-dark-tone-panel){--scrollbar-thumb: var(--color-bg-dark-tone-panel) !important}:is(.dark .odd\:dark\:bg-bg-dark-tone):nth-child(odd){background-color:var(--color-bg-dark-tone)}:is(.dark .dark\:even\:bg-bg-dark-discussion-odd:nth-child(2n)){background-color:var(--color-bg-dark-discussion-odd)}:is(.dark .dark\:even\:bg-bg-dark-tone-panel:nth-child(2n)){background-color:var(--color-bg-dark-tone-panel)}: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){border-color:var(--color-primary)}:is(.dark .dark\:hover\:bg-bg-dark-tone:hover){background-color:var(--color-bg-dark-tone)}: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){background-color:var(--color-primary)}: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-secondary:hover){background-color:var(--color-secondary)}: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{background-color:var(--color-bg-dark-tone)}:is(.dark .hover\:dark\:bg-bg-dark-tone-panel):hover{background-color:var(--color-bg-dark-tone-panel)}:is(.dark .dark\:hover\:fill-primary:hover){fill:var(--color-primary)}: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: var(--color-primary) !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){border-color:var(--color-secondary)}: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-color: var(--color-secondary)}: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-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;outline:none}.progress-bar-container{background-color:#f0f0f0;border-radius:4px;height:8px;overflow:hidden}.progress-bar{background-color:#3498db;height:100%;transition:width .3s ease}.popup-container[data-v-d504dfc9]{background-color:#fff;color:#333;border-radius:8px;box-shadow:0 4px 6px #0000001a;padding:24px;width:100%;height:100%;position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center}.close-button[data-v-d504dfc9]{position:absolute;top:16px;right:16px;background-color:#3490dc;color:#fff;font-weight:700;padding:8px 16px;border-radius:8px;cursor:pointer;transition:background-color .3s ease}.close-button[data-v-d504dfc9]:hover{background-color:#2779bd}.iframe-content[data-v-d504dfc9]{width:100%;height:80%;border:none;margin-bottom:16px}.checkbox-container[data-v-d504dfc9]{display:flex;align-items:center;justify-content:center}.styled-checkbox[data-v-d504dfc9]{width:24px;height:24px;accent-color:#3490dc;cursor:pointer}.checkbox-label[data-v-d504dfc9]{margin-left:8px;font-size:16px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.fade-enter-active[data-v-d504dfc9],.fade-leave-active[data-v-d504dfc9]{transition:opacity .5s}.fade-enter[data-v-d504dfc9],.fade-leave-to[data-v-d504dfc9]{opacity:0}.container{margin:0;padding:0}.link-item{height:25px;margin-top:5px;padding:0 20px;margin-bottom:-5px;display:flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:5px 5px 0 0;font-weight:700;transition:duration-300 ease-in-out transform}.link-item-dark{padding:0 20px;color:#f0f8ff;margin-bottom:-5px;display:flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:5px 5px 0 0;font-weight:700;transition:duration-300 ease-in-out transform}.nav-ul{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;height:100%}.nav-li{cursor:pointer;display:flex;align-items:center;padding:5px}.fade-in{animation:fadeInAnimation .5s}@keyframes fadeInAnimation{0%{opacity:0}to{opacity:1}}.bounce-in{animation:bounceInAnimation .5s}.bounce-out{animation:bounceOutAnimation .5s}@keyframes bounceInAnimation{0%{transform:scale(1)}50%{transform:scale(1.2)}to{transform:scale(1)}}.shadow-no-bottom{box-shadow:0 -4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.dot{width:10px;height:10px;border-radius:50%}.dot-green{background-color:green}.dot-red{background-color:red}.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}.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-39a73106]{font-size:24px;animation:pulsate-39a73106 1.5s infinite}@keyframes pulsate-39a73106{0%{transform:scale(1);opacity:1}50%{transform:scale(1.1);opacity:.7}to{transform:scale(1);opacity:1}}.list-move[data-v-39a73106],.list-enter-active[data-v-39a73106],.list-leave-active[data-v-39a73106]{transition:all .5s ease}.list-enter-from[data-v-39a73106]{transform:translatey(-30px)}.list-leave-to[data-v-39a73106]{opacity:0;transform:translatey(30px)}.list-leave-active[data-v-39a73106]{position:absolute}.bounce-enter-active[data-v-39a73106]{animation:bounce-in-39a73106 .5s}.bounce-leave-active[data-v-39a73106]{animation:bounce-in-39a73106 .5s reverse}@keyframes bounce-in-39a73106{0%{transform:scale(0)}50%{transform:scale(1.25)}to{transform:scale(1)}}.bg-primary-light[data-v-39a73106]{background-color:#0ff}.hover[data-v-39a73106]:bg-primary-light:hover{background-color:#7fffd4}.font-bold[data-v-39a73106]{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-de7bc8fe]{animation:bounce-in-de7bc8fe .5s}.bounce-leave-active[data-v-de7bc8fe]{animation:bounce-in-de7bc8fe .5s reverse}@keyframes bounce-in-de7bc8fe{0%{transform:scale(0)}50%{transform:scale(1.25)}to{transform:scale(1)}}.custom-scrollbar[data-v-1a32c141]::-webkit-scrollbar{width:8px}.custom-scrollbar[data-v-1a32c141]::-webkit-scrollbar-track{background-color:#f1f1f1}.custom-scrollbar[data-v-1a32c141]::-webkit-scrollbar-thumb{background-color:#888;border-radius:4px}.custom-scrollbar[data-v-1a32c141]::-webkit-scrollbar-thumb:hover{background-color:#555}.menu[data-v-1a32c141]{display:flex;flex-direction:column;align-items:center}.commands-menu-items-wrapper[data-v-1a32c141]{position:relative;display:flex;flex-direction:column;align-items:center}.commands-menu-items-wrapper>#commands-menu-items[data-v-1a32c141]{top:calc(-100% - 2rem)}.list-move[data-v-2c705e91],.list-enter-active[data-v-2c705e91],.list-leave-active[data-v-2c705e91]{transition:all .5s ease}.list-enter-from[data-v-2c705e91]{transform:translatey(-30px)}.list-leave-to[data-v-2c705e91]{opacity:0;transform:translatey(30px)}.list-leave-active[data-v-2c705e91]{position:absolute}.slide-right-enter-active[data-v-b8e854ae],.slide-right-leave-active[data-v-b8e854ae]{transition:transform .3s ease}.slide-right-enter[data-v-b8e854ae],.slide-right-leave-to[data-v-b8e854ae]{transform:translate(-100%)}.fade-and-fly-enter-active[data-v-b8e854ae]{animation:fade-and-fly-enter-b8e854ae .5s ease}.fade-and-fly-leave-active[data-v-b8e854ae]{animation:fade-and-fly-leave-b8e854ae .5s ease}@keyframes fade-and-fly-enter-b8e854ae{0%{opacity:0;transform:translateY(20px) scale(.8)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes fade-and-fly-leave-b8e854ae{0%{opacity:1;transform:translateY(0) scale(1)}to{opacity:0;transform:translateY(-20px) scale(1.2)}}.list-move[data-v-b8e854ae],.list-enter-active[data-v-b8e854ae],.list-leave-active[data-v-b8e854ae]{transition:all .5s ease}.list-enter-from[data-v-b8e854ae]{transform:translatey(-30px)}.list-leave-to[data-v-b8e854ae]{opacity:0;transform:translatey(30px)}.list-leave-active[data-v-b8e854ae]{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}.-left-6{left:-1.5rem}.-right-0{right:-0px}.-right-0\.5{right:-.125rem}.-right-1{right:-.25rem}.-right-1\.5{right:-.375rem}.-right-6{right:-1.5rem}.-top-1{top:-.25rem}.-top-1\.5{top:-.375rem}.-top-2{top:-.5rem}.-top-20{top:-5rem}.-top-6{top:-1.5rem}.-top-9{top:-2.25rem}.bottom-0{bottom:0}.bottom-16{bottom:4rem}.bottom-2{bottom:.5rem}.bottom-2\.5{bottom:.625rem}.bottom-20{bottom:5rem}.bottom-5{bottom:1.25rem}.bottom-\[60px\]{bottom:60px}.left-0{left:0}.left-1{left:.25rem}.left-1\/2{left:50%}.left-2{left:.5rem}.left-20{left:5rem}.right-0{right:0}.right-2{right:.5rem}.right-2\.5{right:.625rem}.right-20{right:5rem}.right-3{right:.75rem}.top-0{top:0}.top-1{top:.25rem}.top-1\/2{top:50%}.top-2{top:.5rem}.top-20{top:5rem}.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-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-0{margin-left:0;margin-right:0}.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-3\.5{margin-bottom:.875rem}.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-6{margin-left:1.5rem}.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}.contents{display:contents}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.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-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-96{height:24rem}.h-\[200px\]{height:200px}.h-auto{height:auto}.h-fit{height:-moz-fit-content;height:fit-content}.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-\[500px\]{min-height:500px}.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-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-\[1000px\]{width:1000px}.w-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.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-\[900px\]{max-width:900px}.max-w-full{max-width:100%}.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-150{--tw-scale-x: 1.5;--tw-scale-y: 1.5;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-none{list-style-type:none}.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))}.grid-cols-\[40px\,1fr\]{grid-template-columns:40px 1fr}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-content-center{place-content:center}.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-2\.5{gap:.625rem}.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-r{border-right-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{border-color:var(--color-bg-dark)}.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{border-color:var(--color-primary)}.border-primary-light{border-color:var(--color-primary-light)}.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{border-color:var(--color-secondary)}.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{background-color:var(--color-accent)}.bg-bg-dark-tone-panel{background-color:var(--color-bg-dark-tone-panel)}.bg-bg-light{background-color:var(--color-bg-light)}.bg-bg-light-discussion{background-color:var(--color-bg-light-discussion)}.bg-bg-light-panel{background-color:var(--color-bg-light-panel)}.bg-bg-light-tone{background-color:var(--color-bg-light-tone)}.bg-bg-light-tone-panel{background-color:var(--color-bg-light-tone-panel)}.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{background-color:var(--color-primary)}.bg-primary-light{background-color:var(--color-primary-light)}.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{background-color:var(--color-secondary)}.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: var(--color-bg-light) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 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: var(--color-bg-light-tone) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 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(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--color-bg-light) 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:var(--color-secondary)}.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-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.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}.pb-5{padding-bottom:1.25rem}.pb-6{padding-bottom:1.5rem}.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-\[\.82rem\]{font-size:.82rem}.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-4{line-height:1rem}.leading-6{line-height:1.5rem}.leading-9{line-height:2.25rem}.leading-none{line-height:1}.leading-tight{line-height:1.25}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-blue-100{--tw-text-opacity: 1;color:rgb(225 239 254 / 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-dark-text-panel{color:var(--color-dark-text-panel)}.text-gray-100{--tw-text-opacity: 1;color:rgb(243 244 246 / 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-light-text-panel{color:var(--color-light-text-panel)}.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{color:var(--color-secondary)}.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)}.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-md{--tw-backdrop-blur: blur(12px);-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)}.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-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-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: var(--color-bg-light) !important}.scrollbar-track-bg-light-tone{--scrollbar-track: var(--color-bg-light-tone) !important}.scrollbar-thumb-bg-light-tone{--scrollbar-thumb: var(--color-bg-light-tone) !important}.scrollbar-thumb-bg-light-tone-panel{--scrollbar-thumb: var(--color-bg-light-tone-panel) !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}:root{--color-primary: #0e8ef0;--color-primary-light: #3dabff;--color-secondary: #0fd974;--color-accent: #f0700e;--color-light-text-panel: #ffffff;--color-dark-text-panel: #ffffff;--color-bg-light-panel: #7cb5ec;--color-bg-light: #e2edff;--color-bg-light-tone: #b9d2f7;--color-bg-light-code-block: #cad7ed;--color-bg-light-tone-panel: #8fb5ef;--color-bg-light-discussion: #c5d8f8;--color-bg-light-discussion-odd: #d6e7ff;--color-bg-dark: #132e59;--color-bg-dark-tone: #25477d;--color-bg-dark-tone-panel: #4367a3;--color-bg-dark-code-block: #2254a7;--color-bg-dark-discussion: #435E8A;--color-bg-dark-discussion-odd: #284471}.last\:mb-0:last-child{margin-bottom:0}.last\:\!border-transparent:last-child{border-color:transparent!important}.last\:pb-0:last-child{padding-bottom:0}.odd\:bg-bg-light-tone:nth-child(odd){background-color:var(--color-bg-light-tone)}.even\:bg-bg-light-discussion-odd:nth-child(2n){background-color:var(--color-bg-light-discussion-odd)}.even\:bg-bg-light-tone-panel:nth-child(2n){background-color:var(--color-bg-light-tone-panel)}.group:hover .group-hover\:visible{visibility:visible}.group:hover .group-hover\:bottom-0{bottom:0}.group:hover .group-hover\:block{display:block}.group:hover .group-hover\:-translate-x-12{--tw-translate-x: -3rem;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\:-translate-x-8{--tw-translate-x: -2rem;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\:-translate-y-8{--tw-translate-y: -2rem;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\:translate-x-5{--tw-translate-x: 1.25rem;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\:translate-x-\[0px\]{--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))}.group:hover .group-hover\:translate-y-\[-50px\]{--tw-translate-y: -50px;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{border-color:var(--color-secondary)}.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: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{color:var(--color-primary)}.hover\:z-10:hover{z-index:10}.hover\:z-20:hover{z-index:20}.hover\:z-50:hover{z-index:50}.hover\:h-8:hover{height:2rem}.hover\:-translate-y-1:hover{--tw-translate-y: -.25rem;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\:-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\:-translate-y-8:hover{--tw-translate-y: -2rem;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\:translate-y-\[-5px\]:hover{--tw-translate-y: -5px;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-110:hover{--tw-scale-x: 1.1;--tw-scale-y: 1.1;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-150:hover{--tw-scale-x: 1.5;--tw-scale-y: 1.5;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{border-color:var(--color-primary)}.hover\:border-primary-light:hover{border-color:var(--color-primary-light)}.hover\:border-secondary:hover{border-color:var(--color-secondary)}.hover\:bg-accent:hover{background-color:var(--color-accent)}.hover\:bg-bg-light-tone:hover{background-color:var(--color-bg-light-tone)}.hover\:bg-bg-light-tone-panel:hover{background-color:var(--color-bg-light-tone-panel)}.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-500:hover{--tw-bg-opacity: 1;background-color:rgb(63 131 248 / 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-700:hover{--tw-bg-opacity: 1;background-color:rgb(26 86 219 / 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-300:hover{--tw-bg-opacity: 1;background-color:rgb(132 225 188 / 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{background-color:var(--color-primary)}.hover\:bg-primary-light:hover{background-color:var(--color-primary-light)}.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-300:hover{--tw-bg-opacity: 1;background-color:rgb(248 180 180 / 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-secondary:hover{background-color:var(--color-secondary)}.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:var(--color-primary)}.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-300:hover{--tw-text-opacity: 1;color:rgb(132 225 188 / 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{color:var(--color-primary)}.hover\:text-red-300:hover{--tw-text-opacity: 1;color:rgb(248 180 180 / 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{color:var(--color-secondary)}.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\:shadow-none:hover{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;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: var(--color-primary) !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{border-color:var(--color-secondary)}.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-red-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(240 82 82 / var(--tw-ring-opacity))}.focus\:ring-secondary:focus{--tw-ring-color: var(--color-secondary)}.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))}.focus\:ring-opacity-50:focus{--tw-ring-opacity: .5}.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: var(--color-secondary) !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){border-color:var(--color-bg-light)}: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){background-color:var(--color-bg-dark)}:is(.dark .dark\:bg-bg-dark-discussion){background-color:var(--color-bg-dark-discussion)}:is(.dark .dark\:bg-bg-dark-tone){background-color:var(--color-bg-dark-tone)}:is(.dark .dark\:bg-bg-dark-tone-panel){background-color:var(--color-bg-dark-tone-panel)}: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-200){--tw-bg-opacity: 1;background-color:rgb(229 231 235 / 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: var(--color-bg-dark) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 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: var(--color-bg-dark-tone) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 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(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--color-bg-dark) 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-dark-text-panel){color:var(--color-dark-text-panel)}: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-100){--tw-text-opacity: 1;color:rgb(222 247 236 / 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-light-text-panel){color:var(--color-light-text-panel)}: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-primary){color:var(--color-primary)}: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: var(--color-bg-dark) !important}:is(.dark .dark\:scrollbar-track-bg-dark-tone){--scrollbar-track: var(--color-bg-dark-tone) !important}:is(.dark .dark\:scrollbar-thumb-bg-dark-tone){--scrollbar-thumb: var(--color-bg-dark-tone) !important}:is(.dark .dark\:scrollbar-thumb-bg-dark-tone-panel){--scrollbar-thumb: var(--color-bg-dark-tone-panel) !important}:is(.dark .odd\:dark\:bg-bg-dark-tone):nth-child(odd){background-color:var(--color-bg-dark-tone)}:is(.dark .dark\:even\:bg-bg-dark-discussion-odd:nth-child(2n)){background-color:var(--color-bg-dark-discussion-odd)}:is(.dark .dark\:even\:bg-bg-dark-tone-panel:nth-child(2n)){background-color:var(--color-bg-dark-tone-panel)}: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){border-color:var(--color-primary)}:is(.dark .dark\:hover\:bg-bg-dark-tone:hover){background-color:var(--color-bg-dark-tone)}: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){background-color:var(--color-primary)}: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-secondary:hover){background-color:var(--color-secondary)}: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{background-color:var(--color-bg-dark-tone)}:is(.dark .hover\:dark\:bg-bg-dark-tone-panel):hover{background-color:var(--color-bg-dark-tone-panel)}:is(.dark .dark\:hover\:fill-primary:hover){fill:var(--color-primary)}: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: var(--color-primary) !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){border-color:var(--color-secondary)}: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-color: var(--color-secondary)}: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-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-01362090.js b/web/dist/assets/index-e55d062d.js similarity index 92% rename from web/dist/assets/index-01362090.js rename to web/dist/assets/index-e55d062d.js index 6299c698..fb0e5ba6 100644 --- a/web/dist/assets/index-01362090.js +++ b/web/dist/assets/index-e55d062d.js @@ -150,25 +150,25 @@ Verify that the personality is not already copied there.`,4,!1)}).catch(e=>{this `,4,!1),console.error(e)})},async remountPersonality(t){await this.unmountPersonality(t),await this.mountPersonality(t)},onPersonalityReinstall(t){console.log("on reinstall ",t),this.isLoading=!0,console.log("Personality path:",t.personality.path),Se.post("/reinstall_personality",{client_id:this.$store.state.client_id,name:t.personality.path},{headers:this.posts_headers}).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(t){t.target.src=Ti},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();try{console.log("Loading input devices list");const t=await Se.get("/get_snd_input_devices");this.snd_input_devices=t.data.device_names,this.snd_input_devices_indexes=t.data.device_indexes}catch{console.log("Couldin't list input devices")}try{console.log("Loading output devices list");const t=await Se.get("/get_snd_output_devices");this.snd_output_devices=t.data.device_names,this.snd_output_devices_indexes=t.data.device_indexes}catch{console.log("Couldin't list output devices")}},activated(){},computed:{full_template:{get(){return(this.configFile.start_header_id_template+this.configFile.system_message_template+this.configFile.end_header_id_template+" system message"+this.configFile.separator_template+this.configFile.start_user_header_id_template+"user name"+this.configFile.end_user_header_id_template+" User prompt"+this.configFile.separator_template+this.configFile.end_user_message_id_template+this.configFile.separator_template+this.configFile.start_ai_header_id_template+"ai personality"+this.configFile.end_ai_header_id_template+"ai response"+this.configFile.end_ai_message_id_template).replace(` `,"
")}},rendered_models_zoo:{get(){return this.searchModel?this.show_only_installed_models?this.modelsFiltered.filter(t=>t.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(t=>t.isInstalled===!0):this.models_zoo.slice(0,Math.min(this.models_zoo.length,this.models_zoo_initialLoadCount)))}},imgBinding:{get(){if(!this.isMounted)return Pi;try{return this.$refs.bindingZoo[this.$refs.bindingZoo.findIndex(t=>t.binding.folder==this.configFile.binding_name)].$refs.imgElement.src}catch{return Pi}}},imgModel:{get(){try{let t=this.$store.state.modelsZoo.findIndex(e=>e.name==this.$store.state.selectedModel);return t>=0?(console.log(`model avatar : ${this.$store.state.modelsZoo[t].icon}`),this.$store.state.modelsZoo[t].icon):Pi}catch{console.log("error")}if(!this.isMounted)return Pi;try{return this.$refs.bindingZoo[this.$refs.bindingZoo.findIndex(t=>t.binding.folder==this.configFile.binding_name)].$refs.imgElement.src}catch{return Pi}}},isReady:{get(){return this.$store.state.ready}},audio_out_voice:{get(){return this.$store.state.config.audio_out_voice},set(t){this.$store.state.config.audio_out_voice=t}},openaiWhisperModels(){return["whisper-1"]},whisperModels(){return["tiny.en","tiny","base.en","base","small.en","small","medium.en","medium","large-v1","large-v2","large-v3","large"]},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(t){this.$store.commit("setConfig",t)}},userName:{get(){return this.$store.state.config.user_name},set(t){this.$store.state.config.user_name=t}},user_avatar:{get(){return this.$store.state.config.user_avatar!=""?"/user_infos/"+this.$store.state.config.user_avatar:Ti},set(t){this.$store.state.config.user_avatar=t}},hardware_mode:{get(){return this.$store.state.config.hardware_mode},set(t){this.$store.state.config.hardware_mode=t}},auto_update:{get(){return this.$store.state.config.auto_update},set(t){this.$store.state.config.auto_update=t}},auto_speak:{get(){return this.$store.state.config.auto_speak},set(t){this.$store.state.config.auto_speak=t}},auto_read:{get(){return this.$store.state.config.auto_read},set(t){this.$store.state.config.auto_read=t}},xtts_enable:{get(){return this.$store.state.config.xtts_enable},set(t){this.$store.state.config.xtts_enable=t}},xtts_current_language:{get(){return this.$store.state.config.xtts_current_language},set(t){console.log("Current xtts voice set to ",t),this.$store.state.config.xtts_current_language=t}},xtts_current_voice:{get(){return this.$store.state.config.xtts_current_voice===null||this.$store.state.config.xtts_current_voice===void 0?(console.log("current voice",this.$store.state.config.xtts_current_voice),"main_voice"):this.$store.state.config.xtts_current_voice},set(t){t=="main_voice"||t===void 0?(console.log("Current voice set to None"),this.$store.state.config.xtts_current_voice=null):(console.log("Current voice set to ",t),this.$store.state.config.xtts_current_voice=t)}},audio_pitch:{get(){return this.$store.state.config.audio_pitch},set(t){this.$store.state.config.audio_pitch=t}},audio_in_language:{get(){return this.$store.state.config.audio_in_language},set(t){this.$store.state.config.audio_in_language=t}},use_user_name_in_discussions:{get(){return this.$store.state.config.use_user_name_in_discussions},set(t){this.$store.state.config.use_user_name_in_discussions=t}},discussion_db_name:{get(){return this.$store.state.config.discussion_db_name},set(t){this.$store.state.config.discussion_db_name=t}},personalities:{get(){return this.$store.state.personalities},set(t){this.$store.commit("setPersonalities",t)}},mountedPersArr:{get(){return this.$store.state.mountedPersArr},set(t){this.$store.commit("setMountedPers",t)}},bindingsZoo:{get(){return this.$store.state.bindingsZoo},set(t){this.$store.commit("setbindingsZoo",t)}},modelsArr:{get(){return this.$store.state.modelsArr},set(t){this.$store.commit("setModelsArr",t)}},models:{get(){return this.models_zoo},set(t){this.$store.commit("setModelsZoo",t)}},installed_models:{get(){return this.models_zoo},set(t){this.$store.commit("setModelsZoo",t)}},diskUsage:{get(){return this.$store.state.diskUsage},set(t){this.$store.commit("setDiskUsage",t)}},ramUsage:{get(){return this.$store.state.ramUsage},set(t){this.$store.commit("setRamUsage",t)}},vramUsage:{get(){return this.$store.state.vramUsage},set(t){this.$store.commit("setVramUsage",t)}},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 t=this.bindingsZoo.findIndex(e=>e.folder===this.configFile.binding_name);if(t>-1)return this.bindingsZoo[t].name},active_pesonality(){if(!this.isMounted)return;const t=this.personalities.findIndex(e=>e.full_path===this.configFile.personalities[this.configFile.active_personality_id]);if(t>-1)return this.personalities[t].name},speed_computed(){return rs(this.addModel.speed)},total_size_computed(){return rs(this.addModel.total_size)},downloaded_size_computed(){return rs(this.addModel.downloaded_size)}},watch:{xtts_enable(t){t||(this.configFile.auto_read=!1)},bec_collapsed(){Ge(()=>{He.replace()})},pc_collapsed(){Ge(()=>{He.replace()})},mc_collapsed(){Ge(()=>{He.replace()})},sc_collapsed(){Ge(()=>{He.replace()})},showConfirmation(){Ge(()=>{He.replace()})},mzl_collapsed(){Ge(()=>{He.replace()})},pzl_collapsed(){Ge(()=>{He.replace()})},ezl_collapsed(){Ge(()=>{He.replace()})},bzl_collapsed(){Ge(()=>{He.replace()})},all_collapsed(t){this.collapseAll(t),Ge(()=>{He.replace()})},settingsChanged(t){this.$store.state.settingsChanged=t,Ge(()=>{He.replace()})},isLoading(){Ge(()=>{He.replace()})},searchPersonality(t){t==""&&this.filterPersonalities()},mzdc_collapsed(){Ge(()=>{He.replace()})}},async beforeRouteLeave(t){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}},P=t=>(yo("data-v-b7b0e3aa"),t=t(),vo(),t),$rt={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"},Wrt={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"},Krt={key:0,class:"flex gap-3 flex-1 items-center duration-75"},jrt=P(()=>c("i",{"data-feather":"x"},null,-1)),Qrt=[jrt],Xrt=P(()=>c("i",{"data-feather":"check"},null,-1)),Zrt=[Xrt],Jrt={key:1,class:"flex gap-3 flex-1 items-center"},eot=P(()=>c("i",{"data-feather":"refresh-ccw"},null,-1)),tot=[eot],not=P(()=>c("i",{"data-feather":"list"},null,-1)),iot=[not],sot={class:"flex gap-3 flex-1 items-center justify-end"},rot=P(()=>c("i",{"data-feather":"trash-2"},null,-1)),oot=[rot],aot=P(()=>c("i",{"data-feather":"refresh-ccw"},null,-1)),lot=[aot],cot=P(()=>c("i",{"data-feather":"arrow-up-circle"},null,-1)),dot=P(()=>c("i",{"data-feather":"alert-circle"},null,-1)),uot={class:"flex gap-3 items-center"},pot={key:0,class:"flex gap-3 items-center"},_ot=P(()=>c("div",{class:"flex flex-row"},[c("p",{class:"text-green-600 font-bold hover:text-green-300 ml-4 pl-4 mr-4 pr-4"},"Apply changes:"),c("i",{"data-feather":"check"})],-1)),hot=[_ot],fot=P(()=>c("div",{class:"flex flex-row"},[c("p",{class:"text-red-600 font-bold hover:text-red-300 ml-4 pl-4 mr-4 pr-4"},"Cancel changes:"),c("i",{"data-feather":"x"})],-1)),mot=[fot],got={key:1,role:"status"},bot=P(()=>c("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"},[c("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),c("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)),Eot=P(()=>c("span",{class:"sr-only"},"Loading...",-1)),yot={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"},vot={class:"flex flex-row p-3"},Sot=P(()=>c("i",{"data-feather":"chevron-right"},null,-1)),Tot=[Sot],xot=P(()=>c("i",{"data-feather":"chevron-down"},null,-1)),Cot=[xot],wot=P(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," System status",-1)),Rot=P(()=>c("div",{class:"mr-2"},"|",-1)),Aot={class:"text-base font-semibold cursor-pointer select-none items-center"},Not={class:"flex gap-2 items-center"},Oot={key:0},Iot=["src"],Mot={class:"font-bold font-large text-lg"},Dot={key:1},kot={class:"flex gap-2 items-center"},Lot=["src"],Pot={class:"font-bold font-large text-lg"},Uot=P(()=>c("i",{"data-feather":"cpu",title:"CPU Ram",class:"w-5 h-5 mx-1 flex-shrink-0"},null,-1)),Fot={class:"font-bold font-large text-lg"},Bot=P(()=>c("i",{"data-feather":"hard-drive",title:"Hard drive",class:"w-5 h-5 mx-1 flex-shrink-0"},null,-1)),Got={class:"font-bold font-large text-lg"},Vot={class:"mb-2"},zot=P(()=>c("label",{class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},[c("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[c("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"})]),et(" CPU Ram usage: ")],-1)),Hot={class:"flex flex-col mx-2"},qot=P(()=>c("b",null,"Avaliable ram: ",-1)),Yot=P(()=>c("b",null,"Ram usage: ",-1)),$ot={class:"p-2"},Wot={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},Kot={class:"mb-2"},jot=P(()=>c("label",{class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},[c("i",{"data-feather":"hard-drive",class:"w-5 h-5"}),et(" Disk usage: ")],-1)),Qot={class:"flex flex-col mx-2"},Xot=P(()=>c("b",null,"Avaliable disk space: ",-1)),Zot=P(()=>c("b",null,"Disk usage: ",-1)),Jot={class:"p-2"},eat={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},tat={class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},nat=["src"],iat={class:"flex flex-col mx-2"},sat=P(()=>c("b",null,"Model: ",-1)),rat=P(()=>c("b",null,"Avaliable vram: ",-1)),oat=P(()=>c("b",null,"GPU usage: ",-1)),aat={class:"p-2"},lat={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},cat={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"},dat={class:"flex flex-row p-3"},uat=P(()=>c("i",{"data-feather":"chevron-right"},null,-1)),pat=[uat],_at=P(()=>c("i",{"data-feather":"chevron-down"},null,-1)),hat=[_at],fat=P(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Main configurations",-1)),mat={class:"flex flex-col mb-2 px-3 pb-2"},gat={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"},bat=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"app_custom_logo",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Application logo:")],-1)),Eat={for:"logo-upload"},yat=["src"],vat={style:{width:"10%"}},Sat=P(()=>c("i",{"data-feather":"x"},null,-1)),Tat=[Sat],xat=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"hardware_mode",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Hardware mode:")],-1)),Cat={class:"text-center items-center"},wat={class:"flex flex-row"},Rat=P(()=>c("option",{value:"cpu"},"CPU",-1)),Aat=P(()=>c("option",{value:"cpu-noavx"},"CPU (No AVX)",-1)),Nat=P(()=>c("option",{value:"nvidia-tensorcores"},"NVIDIA (Tensor Cores)",-1)),Oat=P(()=>c("option",{value:"nvidia"},"NVIDIA",-1)),Iat=P(()=>c("option",{value:"amd-noavx"},"AMD (No AVX)",-1)),Mat=P(()=>c("option",{value:"amd"},"AMD",-1)),Dat=P(()=>c("option",{value:"apple-intel"},"Apple Intel",-1)),kat=P(()=>c("option",{value:"apple-silicon"},"Apple Silicon",-1)),Lat=[Rat,Aat,Nat,Oat,Iat,Mat,Dat,kat],Pat=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"discussion_db_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Database path:")],-1)),Uat={style:{width:"100%"}},Fat=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"copy_to_clipboard_add_all_details",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Add details to messages copied to clipboard:")],-1)),Bat={class:"flex flex-row"},Gat=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"auto_show_browser",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto show browser:")],-1)),Vat={class:"flex flex-row"},zat=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"activate_debug",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate debug mode:")],-1)),Hat={class:"flex flex-row"},qat=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"debug_show_final_full_prompt",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Show final full prompt in console:")],-1)),Yat={class:"flex flex-row"},$at=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"debug_show_chunks",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Show chunks in console:")],-1)),Wat={class:"flex flex-row"},Kat=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"debug_log_file_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Debug file path:")],-1)),jat={class:"flex flex-row"},Qat=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"show_news_panel",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Show news panel:")],-1)),Xat={class:"flex flex-row"},Zat=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"auto_save",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto save:")],-1)),Jat={class:"flex flex-row"},elt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"auto_update",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto update:")],-1)),tlt={class:"flex flex-row"},nlt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"auto_update",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto title:")],-1)),ilt={class:"flex flex-row"},slt={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"},rlt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"start_header_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Start header id template:")],-1)),olt=P(()=>c("option",{value:"lollms"},"Lollms communication template",-1)),alt=P(()=>c("option",{value:"lollms_simplified"},"Lollms simplified communication template",-1)),llt=P(()=>c("option",{value:"llama3"},"LLama3 communication template",-1)),clt=P(()=>c("option",{value:"mistral"},"Mistral communication template",-1)),dlt=[olt,alt,llt,clt],ult=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"start_header_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Start header id template:")],-1)),plt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"end_header_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"End header id template:")],-1)),_lt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"start_user_header_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Start user header id template:")],-1)),hlt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"end_user_header_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"End user header id template:")],-1)),flt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"end_user_message_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"End user message id template:")],-1)),mlt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"start_ai_header_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Start ai header id template:")],-1)),glt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"end_ai_header_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"End ai header id template:")],-1)),blt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"end_ai_message_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"End ai message id template:")],-1)),Elt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"separator_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Separator template:")],-1)),ylt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"system_message_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"System template:")],-1)),vlt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"full_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Full template:")],-1)),Slt=["innerHTML"],Tlt={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"},xlt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"user_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User name:")],-1)),Clt={style:{width:"100%"}},wlt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"user_description",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User description:")],-1)),Rlt={style:{width:"100%"}},Alt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"use_user_informations_in_discussion",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use user description in discussion:")],-1)),Nlt={style:{width:"100%"}},Olt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"use_model_name_in_discussions",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use model name in discussion:")],-1)),Ilt={style:{width:"100%"}},Mlt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"user_avatar",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User avatar:")],-1)),Dlt={for:"avatar-upload"},klt=["src"],Llt={style:{width:"10%"}},Plt=P(()=>c("i",{"data-feather":"x"},null,-1)),Ult=[Plt],Flt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"use_user_name_in_discussions",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use User Name in discussions:")],-1)),Blt={class:"flex flex-row"},Glt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"max_n_predict",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Maximum number of output tokens space (forces the model to have more space to speak):")],-1)),Vlt={style:{width:"100%"}},zlt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"max_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)),Hlt={style:{width:"100%"}},qlt={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"},Ylt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"turn_on_code_execution",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"turn on code execution:")],-1)),$lt={style:{width:"100%"}},Wlt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"turn_on_code_validation",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"turn on code validation (very recommended for security reasons):")],-1)),Klt={style:{width:"100%"}},jlt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"turn_on_setting_update_validation",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"turn on apply settings validation (very recommended for security reasons):")],-1)),Qlt={style:{width:"100%"}},Xlt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"turn_on_open_file_validation",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"turn on open file/folder validation:")],-1)),Zlt={style:{width:"100%"}},Jlt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"turn_on_send_file_validation",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"turn on send file validation:")],-1)),ect={style:{width:"100%"}},tct={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"},nct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"activate_skills_lib",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate Skills library:")],-1)),ict={class:"flex flex-row"},sct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"discussion_db_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Skills library database name:")],-1)),rct={style:{width:"100%"}},oct={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"},act=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"pdf_latex_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"PDF LaTeX path:")],-1)),lct={class:"flex flex-row"},cct={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"},dct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"positive_boost",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Positive Boost:")],-1)),uct={class:"flex flex-row"},pct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"negative_boost",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Negative Boost:")],-1)),_ct={class:"flex flex-row"},hct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"fun_mode",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Fun mode:")],-1)),fct={class:"flex flex-row"},mct={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"},gct={class:"flex flex-row p-3"},bct=P(()=>c("i",{"data-feather":"chevron-right"},null,-1)),Ect=[bct],yct=P(()=>c("i",{"data-feather":"chevron-down"},null,-1)),vct=[yct],Sct=P(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Data management settings",-1)),Tct={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"},xct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"rag_databases",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data Sources:")],-1)),Cct={style:{width:"100%"}},wct=["onUpdate:modelValue"],Rct=["onClick"],Act=["onClick"],Nct=["onClick"],Oct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_save_db",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"RAG Vectorizer:")],-1)),Ict=P(()=>c("option",{value:"bert"},"Bert Vectorizer",-1)),Mct=P(()=>c("option",{value:"tfidf"},"TFIDF Vectorizer",-1)),Dct=P(()=>c("option",{value:"word2vec"},"Word2Vec Vectorizer",-1)),kct=[Ict,Mct,Dct],Lct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"rag_vectorizer_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"RAG Vectorizer model:")],-1)),Pct=P(()=>c("option",{value:"bert-base-nli-mean-tokens"},"bert-base-nli-mean-tokens",-1)),Uct=[Pct],Fct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"rag_chunk_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"RAG chunk size:")],-1)),Bct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"rag_overlap",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"RAG overlap size:")],-1)),Gct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"rag_n_chunks",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"RAG number of chunks:")],-1)),Vct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"rag_clean_chunks",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Clean chunks:")],-1)),zct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"rag_follow_subfolders",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Follow subfolders:")],-1)),Hct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"rag_check_new_files_at_startup",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Check for new files at startup:")],-1)),qct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"rag_preprocess_chunks",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Preprocess chunks:")],-1)),Yct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"rag_activate_multi_hops",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate multi hops RAG:")],-1)),$ct={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"},Wct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_save_db",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Save vectorized database:")],-1)),Kct={class:"flex flex-row"},jct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_visualize_on_vectorization",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"show vectorized data:")],-1)),Qct={class:"flex flex-row"},Xct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_build_keys_words",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Reformulate prompt before querying database (advised):")],-1)),Zct={class:"flex flex-row"},Jct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_force_first_chunk",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Force adding the first chunk of the file to the context:")],-1)),edt={class:"flex flex-row"},tdt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_put_chunk_informations_into_context",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Put Chunk Information Into Context:")],-1)),ndt={class:"flex flex-row"},idt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_method",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization method:")],-1)),sdt=P(()=>c("option",{value:"tfidf_vectorizer"},"tfidf Vectorizer",-1)),rdt=P(()=>c("option",{value:"bm25_vectorizer"},"bm25 Vectorizer",-1)),odt=P(()=>c("option",{value:"model_embedding"},"Model Embedding",-1)),adt=P(()=>c("option",{value:"sentense_transformer"},"Sentense Transformer",-1)),ldt=[sdt,rdt,odt,adt],cdt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_sentense_transformer_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization model (for Sentense Transformer):")],-1)),ddt={style:{width:"100%"}},udt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_visualization_method",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data visualization method:")],-1)),pdt=P(()=>c("option",{value:"PCA"},"PCA",-1)),_dt=P(()=>c("option",{value:"TSNE"},"TSNE",-1)),hdt=[pdt,_dt],fdt=P(()=>c("td",{style:{"min-width":"200px"}},[c("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)),mdt={class:"flex flex-row"},gdt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_chunk_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization chunk size(tokens):")],-1)),bdt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_overlap_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization overlap size(tokens):")],-1)),Edt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_overlap_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Number of chunks to use for each message:")],-1)),ydt={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"},vdt={class:"flex flex-row p-3"},Sdt=P(()=>c("i",{"data-feather":"chevron-right"},null,-1)),Tdt=[Sdt],xdt=P(()=>c("i",{"data-feather":"chevron-down"},null,-1)),Cdt=[xdt],wdt=P(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Internet",-1)),Rdt={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"},Adt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"activate_internet_search",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate internet search:")],-1)),Ndt={class:"flex flex-row"},Odt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"activate_internet_pages_judgement",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate internet pages judgement:")],-1)),Idt={class:"flex flex-row"},Mdt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"internet_quick_search",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate quick search:")],-1)),Ddt={class:"flex flex-row"},kdt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"internet_activate_search_decision",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate search decision:")],-1)),Ldt={class:"flex flex-row"},Pdt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"internet_vectorization_chunk_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Internet vectorization chunk size:")],-1)),Udt={class:"flex flex-col"},Fdt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"internet_vectorization_overlap_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Internet vectorization overlap size:")],-1)),Bdt={class:"flex flex-col"},Gdt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"internet_vectorization_nb_chunks",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Internet vectorization number of chunks:")],-1)),Vdt={class:"flex flex-col"},zdt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"internet_nb_search_pages",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Internet number of search pages:")],-1)),Hdt={class:"flex flex-col"},qdt={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"},Ydt={class:"flex flex-row p-3"},$dt=P(()=>c("i",{"data-feather":"chevron-right"},null,-1)),Wdt=[$dt],Kdt=P(()=>c("i",{"data-feather":"chevron-down"},null,-1)),jdt=[Kdt],Qdt=P(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Services Zoo",-1)),Xdt={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"},Zdt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"active_tts_service",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Default Text to speach engine"},"Active TTS Service:")],-1)),Jdt={style:{width:"100%"}},eut=P(()=>c("option",{value:"None"},"None",-1)),tut=P(()=>c("option",{value:"browser"},"Use Browser TTS (doesn't work in realtime mode)",-1)),nut=P(()=>c("option",{value:"xtts"},"XTTS",-1)),iut=P(()=>c("option",{value:"openai_tts"},"Open AI TTS",-1)),sut=[eut,tut,nut,iut],rut=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"active_stt_service",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Default Speach to Text engine"},"Active STT Service:")],-1)),out={style:{width:"100%"}},aut=P(()=>c("option",{value:"None"},"None",-1)),lut=P(()=>c("option",{value:"whisper"},"Whisper",-1)),cut=P(()=>c("option",{value:"openai_whisper"},"Open AI Whisper",-1)),dut=[aut,lut,cut],uut=P(()=>c("tr",null,null,-1)),put=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"active_tti_service",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Default Text to image engine"},"Active TTI Service:")],-1)),_ut={style:{width:"100%"}},hut=P(()=>c("option",{value:"None"},"None",-1)),fut=P(()=>c("option",{value:"diffusers"},"Diffusers",-1)),mut=P(()=>c("option",{value:"autosd"},"AUTO1111's SD",-1)),gut=P(()=>c("option",{value:"dall-e"},"Open AI DALL-E",-1)),but=P(()=>c("option",{value:"midjourney"},"Midjourney",-1)),Eut=P(()=>c("option",{value:"comfyui"},"Comfyui",-1)),yut=P(()=>c("option",{value:"fooocus"},"Fooocus",-1)),vut=[hut,fut,mut,gut,but,Eut,yut],Sut=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"active_ttm_service",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Default Text to Music engine"},"Active TTM Service:")],-1)),Tut={style:{width:"100%"}},xut=P(()=>c("option",{value:"None"},"None",-1)),Cut=P(()=>c("option",{value:"musicgen"},"Music Gen",-1)),wut=[xut,Cut],Rut={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"},Aut=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"use_negative_prompt",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use negative prompt:")],-1)),Nut={class:"flex flex-row"},Out=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"use_ai_generated_negative_prompt",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use AI generated negative prompt:")],-1)),Iut={class:"flex flex-row"},Mut=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"negative_prompt_generation_prompt",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Negative prompt generation prompt:")],-1)),Dut={class:"flex flex-row"},kut=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"default_negative_prompt",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Default negative prompt:")],-1)),Lut={class:"flex flex-row"},Put={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"},Uut=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"stt_listening_threshold",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Listening threshold"},"Listening threshold:")],-1)),Fut={style:{width:"100%"}},But=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"stt_silence_duration",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Scilence duration"},"Silence duration (s):")],-1)),Gut={style:{width:"100%"}},Vut=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"stt_sound_threshold_percentage",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"stt_sound_threshold_percentage"},"Minimum sound percentage in recorded segment:")],-1)),zut={style:{width:"100%"}},Hut=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"stt_gain",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"STT Gain"},"Volume amplification:")],-1)),qut={style:{width:"100%"}},Yut=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"stt_rate",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Audio Rate"},"audio rate:")],-1)),$ut={style:{width:"100%"}},Wut=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"stt_channels",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"number of channels"},"number of channels:")],-1)),Kut={style:{width:"100%"}},jut=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"stt_buffer_size",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Buffer size"},"Buffer size:")],-1)),Qut={style:{width:"100%"}},Xut=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"stt_activate_word_detection",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate word detection:")],-1)),Zut={class:"flex flex-row"},Jut=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"stt_word_detection_file",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Word detection wav file:")],-1)),ept={class:"flex flex-row"},tpt={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"},npt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"stt_input_device",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Input device"},"Audio Input device:")],-1)),ipt={style:{width:"100%"}},spt=["value"],rpt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"tts_output_device",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Input device"},"Audio Output device:")],-1)),opt={style:{width:"100%"}},apt=["value"],lpt={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"},cpt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"host",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Host:")],-1)),dpt={style:{width:"100%"}},upt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"lollms_access_keys",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Access keys (coma separated, if empty, anyone can use the server without authentication):")],-1)),ppt={style:{width:"100%"}},_pt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"discussion_db_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Port:")],-1)),hpt={style:{width:"100%"}},fpt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"discussion_db_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate headless server mode (deactivates all code exectuion to protect the PC from attacks):")],-1)),mpt={style:{width:"100%"}},gpt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"activate_lollms_server",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate lollms server:")],-1)),bpt={style:{width:"100%"}},Ept=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"activate_ollama_emulator",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate ollama server emulator:")],-1)),ypt={style:{width:"100%"}},vpt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"activate_openai_emulator",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate openai server emulator:")],-1)),Spt={style:{width:"100%"}},Tpt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"activate_mistralai_emulator",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate mistral ai server emulator:")],-1)),xpt={style:{width:"100%"}},Cpt={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"},wpt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"activate_audio_infos",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate audio infos:")],-1)),Rpt={class:"flex flex-row"},Apt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"audio_auto_send_input",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Send audio input automatically:")],-1)),Npt={class:"flex flex-row"},Opt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"audio_silenceTimer",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"audio in silence timer (ms):")],-1)),Ipt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"audio_in_language",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Input Audio Language:")],-1)),Mpt=["value"],Dpt={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"},kpt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"whisper_activate",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate Whisper at startup:")],-1)),Lpt={class:"flex flex-row"},Ppt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"whisper_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Whisper model:")],-1)),Upt={class:"flex flex-row"},Fpt=["value"],Bpt={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"},Gpt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"openai_whisper_key",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"openai whisper key:")],-1)),Vpt={class:"flex flex-row"},zpt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"openai_whisper_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Open Ai Whisper model:")],-1)),Hpt={class:"flex flex-row"},qpt=["value"],Ypt={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"},$pt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"auto_speak",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable auto speak:")],-1)),Wpt={class:"flex flex-row"},Kpt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"audio_pitch",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"audio pitch:")],-1)),jpt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"audio_out_voice",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Output Audio Voice:")],-1)),Qpt=["value"],Xpt={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"},Zpt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_enable",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable voice service:")],-1)),Jpt={class:"flex flex-row"},e_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"install_xtts_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"xTTS service:")],-1)),t_t={class:"flex flex-row"},n_t=["href"],i_t=P(()=>c("a",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",href:"https://github.com/ParisNeo/xtts-api-server/blob/main/LICENSE",target:"_blank"},"licence",-1)),s_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"xtts base url:")],-1)),r_t={class:"flex flex-row"},o_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_current_language",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Current language:")],-1)),a_t={class:"flex flex-row"},l_t=["disabled"],c_t=["value"],d_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_current_voice",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Current voice:")],-1)),u_t={class:"flex flex-row"},p_t=["disabled"],__t=["value"],h_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_use_deepspeed",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable deepspeed:")],-1)),f_t={class:"flex flex-row"},m_t=["disabled"],g_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_use_streaming_mode",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable streaming mode:")],-1)),b_t={class:"flex flex-row"},E_t=["disabled"],y_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"auto_read",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable auto read:")],-1)),v_t={class:"flex flex-row"},S_t=["disabled"],T_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_stream_chunk_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"xtts stream chunk size:")],-1)),x_t={class:"flex flex-row"},C_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_temperature",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Temperature:")],-1)),w_t={class:"flex flex-row"},R_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_length_penalty",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Length Penalty:")],-1)),A_t={class:"flex flex-row"},N_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_repetition_penalty",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Repetition Penalty:")],-1)),O_t={class:"flex flex-row"},I_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_top_k",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Top K:")],-1)),M_t={class:"flex flex-row"},D_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_top_p",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Top P:")],-1)),k_t={class:"flex flex-row"},L_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_speed",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Speed:")],-1)),P_t={class:"flex flex-row"},U_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"enable_text_splitting",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable Text Splitting:")],-1)),F_t={class:"flex flex-row"},B_t={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"},G_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"openai_tts_key",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Open AI key:")],-1)),V_t={class:"flex flex-row"},z_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"openai_tts_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"openai tts model:")],-1)),H_t={class:"flex flex-row"},q_t=P(()=>c("option",null," tts-1 ",-1)),Y_t=P(()=>c("option",null," tts-2 ",-1)),$_t=[q_t,Y_t],W_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"openai_tts_voice",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"openai tts voice:")],-1)),K_t={class:"flex flex-row"},j_t=P(()=>c("option",null," alloy ",-1)),Q_t=P(()=>c("option",null," echo ",-1)),X_t=P(()=>c("option",null," fable ",-1)),Z_t=P(()=>c("option",null," nova ",-1)),J_t=P(()=>c("option",null," shimmer ",-1)),eht=[j_t,Q_t,X_t,Z_t,J_t],tht={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"},nht=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"enable_sd_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable sd service:")],-1)),iht={class:"flex flex-row"},sht=P(()=>c("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),rht=[sht],oht=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"install_sd_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install SD service:")],-1)),aht={class:"flex flex-row"},lht=P(()=>c("a",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",href:"https://github.com/ParisNeo/stable-diffusion-webui/blob/master/LICENSE.txt",target:"_blank"},"automatic1111's sd licence",-1)),cht={class:"flex flex-row"},dht=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"sd_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"sd base url:")],-1)),uht={class:"flex flex-row"},pht={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"},_ht=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"install_diffusers_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install Diffusers service:")],-1)),hht={class:"flex flex-row"},fht=P(()=>c("a",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",href:"https://github.com/huggingface/diffusers?tab=Apache-2.0-1-ov-file#readme",target:"_blank"},"Diffusers licence",-1)),mht=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"diffusers_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Diffusers model:")],-1)),ght={class:"flex flex-row"},bht=P(()=>c("td",null,null,-1)),Eht={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"},yht=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"midjourney_key",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"midjourney key:")],-1)),vht={class:"flex flex-row"},Sht={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"},Tht=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"dall_e_key",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"dall e key:")],-1)),xht={class:"flex flex-row"},Cht=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"dall_e_generation_engine",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"dall e generation engine:")],-1)),wht={class:"flex flex-row"},Rht=P(()=>c("option",null," dall-e-2 ",-1)),Aht=P(()=>c("option",null," dall-e-3 ",-1)),Nht=[Rht,Aht],Oht={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"},Iht=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"enable_comfyui_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable comfyui service:")],-1)),Mht={class:"flex flex-row"},Dht=P(()=>c("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),kht=[Dht],Lht=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"comfyui_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable comfyui model:")],-1)),Pht={class:"flex flex-row"},Uht=P(()=>c("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),Fht=[Uht],Bht=P(()=>c("td",{style:{"min-width":"200px"}},null,-1)),Ght={class:"flex flex-row"},Vht=P(()=>c("a",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",href:"https://github.com/ParisNeo/ComfyUI/blob/master/LICENSE",target:"_blank"},"comfyui licence",-1)),zht=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"comfyui_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"comfyui base url:")],-1)),Hht={class:"flex flex-row"},qht={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"},Yht=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"enable_ollama_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable ollama service:")],-1)),$ht={class:"flex flex-row"},Wht=P(()=>c("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),Kht=[Wht],jht=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"ollama_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install Ollama service:")],-1)),Qht={class:"flex flex-row"},Xht=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"ollama_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"ollama base url:")],-1)),Zht={class:"flex flex-row"},Jht={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"},eft=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"enable_vllm_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable vLLM service:")],-1)),tft={class:"flex flex-row"},nft=P(()=>c("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),ift=[nft],sft=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"vllm_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install vLLM service:")],-1)),rft={class:"flex flex-row"},oft=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"vllm_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"vllm base url:")],-1)),aft={class:"flex flex-row"},lft=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"vllm_gpu_memory_utilization",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"gpu memory utilization:")],-1)),cft={class:"flex flex-col align-bottom"},dft={class:"relative"},uft=P(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"vllm_gpu_memory_utilization",class:"text-sm font-medium"}," vllm gpu memory utilization: ")],-1)),pft={class:"absolute right-0"},_ft=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"vllm_max_num_seqs",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"vllm max num seqs:")],-1)),hft={class:"flex flex-row"},fft=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"vllm_max_model_len",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"max model len:")],-1)),mft={class:"flex flex-row"},gft=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"vllm_model_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"vllm model path:")],-1)),bft={class:"flex flex-row"},Eft={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"},yft=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"enable_petals_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable petals service:")],-1)),vft={class:"flex flex-row"},Sft=P(()=>c("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),Tft=[Sft],xft=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"petals_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install Petals service:")],-1)),Cft={class:"flex flex-row"},wft=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"petals_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"petals base url:")],-1)),Rft={class:"flex flex-row"},Aft={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"},Nft=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"enable_sd_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable Motion Ctrl service:")],-1)),Oft={class:"flex flex-row"},Ift=P(()=>c("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),Mft=[Ift],Dft=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"install_sd_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install Motion Ctrl service:")],-1)),kft={class:"flex flex-row"},Lft=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"sd_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"sd base url:")],-1)),Pft={class:"flex flex-row"},Uft={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"},Fft=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_enable",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable elastic search service:")],-1)),Bft={class:"flex flex-row"},Gft=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"install_elastic_search_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Reinstall Elastic Search service:")],-1)),Vft={class:"flex flex-row"},zft=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"elastic_search_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"elastic search base url:")],-1)),Hft={class:"flex flex-row"},qft={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"},Yft={class:"flex flex-row p-3"},$ft=P(()=>c("i",{"data-feather":"chevron-right"},null,-1)),Wft=[$ft],Kft=P(()=>c("i",{"data-feather":"chevron-down"},null,-1)),jft=[Kft],Qft=P(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Binding zoo",-1)),Xft={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},Zft=P(()=>c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),Jft={key:1,class:"mr-2"},emt={key:2,class:"text-base font-semibold cursor-pointer select-none items-center"},tmt={class:"flex gap-1 items-center"},nmt=["src"],imt={class:"font-bold font-large text-lg line-clamp-1"},smt={key:0,class:"mb-2"},rmt={for:"binding",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},omt=P(()=>c("i",{"data-feather":"chevron-up"},null,-1)),amt=[omt],lmt=P(()=>c("i",{"data-feather":"chevron-down"},null,-1)),cmt=[lmt],dmt={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"},umt={class:"flex flex-row p-3"},pmt=P(()=>c("i",{"data-feather":"chevron-right"},null,-1)),_mt=[pmt],hmt=P(()=>c("i",{"data-feather":"chevron-down"},null,-1)),fmt=[hmt],mmt=P(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Models zoo",-1)),gmt={class:"flex flex-row items-center"},bmt={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},Emt=P(()=>c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),ymt={key:1,class:"text-base text-red-600 flex gap-3 items-center mr-2"},vmt=P(()=>c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),Smt={key:2,class:"mr-2"},Tmt={key:3,class:"text-base font-semibold cursor-pointer select-none items-center"},xmt={class:"flex gap-1 items-center"},Cmt=["src"],wmt={class:"font-bold font-large text-lg line-clamp-1"},Rmt={class:"mx-2 mb-4"},Amt={class:"relative"},Nmt={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},Omt={key:0},Imt=P(()=>c("div",{role:"status"},[c("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"},[c("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),c("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"})]),c("span",{class:"sr-only"},"Loading...")],-1)),Mmt=[Imt],Dmt={key:1},kmt=P(()=>c("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"},[c("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)),Lmt=[kmt],Pmt=P(()=>c("label",{for:"only_installed"},"Show only installed models",-1)),Umt=P(()=>c("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)),Fmt={key:0,role:"status",class:"text-center w-full display: flex;align-items: center;"},Bmt=P(()=>c("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"},[c("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),c("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)),Gmt=P(()=>c("p",{class:"heartbeat-text"},"Loading models Zoo",-1)),Vmt=[Bmt,Gmt],zmt={key:1,class:"mb-2"},Hmt={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},qmt=P(()=>c("i",{"data-feather":"chevron-up"},null,-1)),Ymt=[qmt],$mt=P(()=>c("i",{"data-feather":"chevron-down"},null,-1)),Wmt=[$mt],Kmt={class:"mb-2"},jmt={class:"p-2"},Qmt={class:"mb-3"},Xmt=P(()=>c("label",{class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},"Create a reference from local file path:",-1)),Zmt={key:0},Jmt={class:"mb-3"},egt=P(()=>c("label",{class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},"Download from web:",-1)),tgt={key:1,class:"relative flex flex-col items-center justify-center flex-grow h-full"},ngt=P(()=>c("div",{role:"status",class:"justify-center"},null,-1)),igt={class:"relative flex flex-row flex-grow items-center w-full h-full bottom-0"},sgt={class:"w-full p-2"},rgt={class:"flex justify-between mb-1"},ogt=Vb(' Downloading Loading...',1),agt={class:"text-sm font-medium text-blue-700 dark:text-white"},lgt=["title"],cgt={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},dgt={class:"flex justify-between mb-1"},ugt={class:"text-base font-medium text-blue-700 dark:text-white"},pgt={class:"text-sm font-medium text-blue-700 dark:text-white"},_gt={class:"flex flex-grow"},hgt={class:"flex flex-row flex-grow gap-3"},fgt={class:"p-2 text-center grow"},mgt={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"},ggt={class:"flex flex-row p-3 items-center"},bgt=P(()=>c("i",{"data-feather":"chevron-right"},null,-1)),Egt=[bgt],ygt=P(()=>c("i",{"data-feather":"chevron-down"},null,-1)),vgt=[ygt],Sgt=P(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Personalities zoo",-1)),Tgt={key:0,class:"mr-2"},xgt={class:"mr-2 font-bold font-large text-lg line-clamp-1"},Cgt={key:1,class:"mr-2"},wgt={key:2,class:"text-base font-semibold cursor-pointer select-none items-center flex flex-row"},Rgt={key:0,class:"flex -space-x-4 items-center"},Agt={class:"group items-center flex flex-row"},Ngt=["onClick"],Ogt=["src","title"],Igt=["onClick"],Mgt=P(()=>c("span",{class:"hidden group-hover:block -top-2 -right-1 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2 border-transparent",title:"Unmount personality"},[c("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"},[c("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)),Dgt=[Mgt],kgt=P(()=>c("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"},[c("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)),Lgt=[kgt],Pgt={class:"mx-2 mb-4"},Ugt=P(()=>c("label",{for:"personality-search",class:"mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white"},"Search",-1)),Fgt={class:"relative"},Bgt={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},Ggt={key:0},Vgt=P(()=>c("div",{role:"status"},[c("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"},[c("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),c("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"})]),c("span",{class:"sr-only"},"Loading...")],-1)),zgt=[Vgt],Hgt={key:1},qgt=P(()=>c("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"},[c("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)),Ygt=[qgt],$gt={key:0,class:"mx-2 mb-4"},Wgt={for:"persCat",class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},Kgt=["selected"],jgt={key:0,class:"mb-2"},Qgt={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},Xgt=P(()=>c("i",{"data-feather":"chevron-up"},null,-1)),Zgt=[Xgt],Jgt=P(()=>c("i",{"data-feather":"chevron-down"},null,-1)),ebt=[Jgt],tbt={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"},nbt={class:"flex flex-row"},ibt=P(()=>c("i",{"data-feather":"chevron-right"},null,-1)),sbt=[ibt],rbt=P(()=>c("i",{"data-feather":"chevron-down"},null,-1)),obt=[rbt],abt=P(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none"}," Model Configuration",-1)),lbt={class:"m-2"},cbt={class:"flex flex-row gap-2 items-center"},dbt=P(()=>c("label",{for:"override-model-parameters",class:"block text-sm font-medium"}," Override personality model parameters ",-1)),ubt={class:"m-2"},pbt=P(()=>c("label",{for:"seed",class:"block mb-2 text-sm font-medium"}," Seed: ",-1)),_bt={class:"m-2"},hbt={class:"flex flex-col align-bottom"},fbt={class:"relative"},mbt=P(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"temperature",class:"text-sm font-medium"}," Temperature: ")],-1)),gbt={class:"absolute right-0"},bbt={class:"m-2"},Ebt={class:"flex flex-col align-bottom"},ybt={class:"relative"},vbt=P(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"predict",class:"text-sm font-medium"}," N Predict: ")],-1)),Sbt={class:"absolute right-0"},Tbt={class:"m-2"},xbt={class:"flex flex-col align-bottom"},Cbt={class:"relative"},wbt=P(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"top_k",class:"text-sm font-medium"}," Top-K: ")],-1)),Rbt={class:"absolute right-0"},Abt={class:"m-2"},Nbt={class:"flex flex-col align-bottom"},Obt={class:"relative"},Ibt=P(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"top_p",class:"text-sm font-medium"}," Top-P: ")],-1)),Mbt={class:"absolute right-0"},Dbt={class:"m-2"},kbt={class:"flex flex-col align-bottom"},Lbt={class:"relative"},Pbt=P(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"repeat_penalty",class:"text-sm font-medium"}," Repeat penalty: ")],-1)),Ubt={class:"absolute right-0"},Fbt={class:"m-2"},Bbt={class:"flex flex-col align-bottom"},Gbt={class:"relative"},Vbt=P(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"repeat_last_n",class:"text-sm font-medium"}," Repeat last N: ")],-1)),zbt={class:"absolute right-0"};function Hbt(t,e,n,i,s,r){const o=mt("Card"),a=mt("BindingEntry"),l=mt("RadioOptions"),u=mt("model-entry"),d=mt("personality-entry"),h=mt("AddModelDialog"),f=mt("ChoiceDialog");return w(),A(Ye,null,[c("div",$rt,[c("div",Wrt,[s.showConfirmation?(w(),A("div",Krt,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel",type:"button",onClick:e[0]||(e[0]=be(_=>s.showConfirmation=!1,["stop"]))},Qrt),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm save changes",type:"button",onClick:e[1]||(e[1]=be(_=>r.save_configuration(),["stop"]))},Zrt)])):V("",!0),s.showConfirmation?V("",!0):(w(),A("div",Jrt,[c("button",{title:"Reset configuration",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[2]||(e[2]=_=>r.reset_configuration())},tot),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Collapse / Expand all panels",type:"button",onClick:e[3]||(e[3]=be(_=>s.all_collapsed=!s.all_collapsed,["stop"]))},iot)])),c("div",sot,[c("button",{title:"Clear uploads",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[4]||(e[4]=_=>r.api_get_req("clear_uploads").then(m=>{m.status?this.$store.state.toast.showToast("Success!",4,!0):this.$store.state.toast.showToast(["failed!"],4,!1)}))},oot),c("button",{title:"Restart program",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[5]||(e[5]=_=>r.api_post_req("restart_program").then(m=>{m.status?this.$store.state.toast.showToast("Success!",4,!0):this.$store.state.toast.showToast(["failed!"],4,!1)}))},lot),s.has_updates?(w(),A("button",{key:0,title:"Upgrade program ",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[6]||(e[6]=_=>r.api_post_req("update_software").then(m=>{m.status?this.$store.state.toast.showToast("Success!",4,!0):this.$store.state.toast.showToast("Success!",4,!0)}))},[cot,dot,et(" = ")])):V("",!0),c("div",uot,[s.settingsChanged?(w(),A("div",pot,[s.isLoading?V("",!0):(w(),A("button",{key:0,class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Apply changes",type:"button",onClick:e[7]||(e[7]=be(_=>r.applyConfiguration(),["stop"]))},hot)),s.isLoading?V("",!0):(w(),A("button",{key:1,class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Cancel changes",type:"button",onClick:e[8]||(e[8]=be(_=>r.cancelConfiguration(),["stop"]))},mot))])):V("",!0),s.isLoading?(w(),A("div",got,[c("p",null,he(s.loading_text),1),bot,Eot])):V("",!0)])])]),c("div",{class:ze(s.isLoading?"pointer-events-none opacity-30 w-full":"w-full")},[c("div",yot,[c("div",vot,[c("button",{onClick:e[9]||(e[9]=be(_=>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"},[G(c("div",null,Tot,512),[[Mt,s.sc_collapsed]]),G(c("div",null,Cot,512),[[Mt,!s.sc_collapsed]]),wot,Rot,c("div",Aot,[c("div",Not,[c("div",null,[r.vramUsage&&r.vramUsage.gpus&&r.vramUsage.gpus.length==1?(w(),A("div",Oot,[(w(!0),A(Ye,null,lt(r.vramUsage.gpus,_=>(w(),A("div",{class:"flex gap-2 items-center",key:_},[c("img",{src:s.SVGGPU,width:"25",height:"25"},null,8,Iot),c("h3",Mot,[c("div",null,he(r.computedFileSize(_.used_vram))+" / "+he(r.computedFileSize(_.total_vram))+" ("+he(_.percentage)+"%) ",1)])]))),128))])):V("",!0),r.vramUsage&&r.vramUsage.gpus&&r.vramUsage.gpus.length>1?(w(),A("div",Dot,[c("div",kot,[c("img",{src:s.SVGGPU,width:"25",height:"25"},null,8,Lot),c("h3",Pot,[c("div",null,he(r.vramUsage.gpus.length)+"x ",1)])])])):V("",!0)]),Uot,c("h3",Fot,[c("div",null,he(r.ram_usage)+" / "+he(r.ram_total_space)+" ("+he(r.ram_percent_usage)+"%)",1)]),Bot,c("h3",Got,[c("div",null,he(r.disk_binding_models_usage)+" / "+he(r.disk_total_space)+" ("+he(r.disk_percent_usage)+"%)",1)])])])])]),c("div",{class:ze([{hidden:s.sc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",Vot,[zot,c("div",Hot,[c("div",null,[qot,et(he(r.ram_available_space),1)]),c("div",null,[Yot,et(" "+he(r.ram_usage)+" / "+he(r.ram_total_space)+" ("+he(r.ram_percent_usage)+")% ",1)])]),c("div",$ot,[c("div",Wot,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:en("width: "+r.ram_percent_usage+"%;")},null,4)])])]),c("div",Kot,[jot,c("div",Qot,[c("div",null,[Xot,et(he(r.disk_available_space),1)]),c("div",null,[Zot,et(" "+he(r.disk_binding_models_usage)+" / "+he(r.disk_total_space)+" ("+he(r.disk_percent_usage)+"%)",1)])]),c("div",Jot,[c("div",eat,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:en("width: "+r.disk_percent_usage+"%;")},null,4)])])]),(w(!0),A(Ye,null,lt(r.vramUsage.gpus,_=>(w(),A("div",{class:"mb-2",key:_},[c("label",tat,[c("img",{src:s.SVGGPU,width:"25",height:"25"},null,8,nat),et(" GPU usage: ")]),c("div",iat,[c("div",null,[sat,et(he(_.gpu_model),1)]),c("div",null,[rat,et(he(this.computedFileSize(_.available_space)),1)]),c("div",null,[oat,et(" "+he(this.computedFileSize(_.used_vram))+" / "+he(this.computedFileSize(_.total_vram))+" ("+he(_.percentage)+"%)",1)])]),c("div",aat,[c("div",lat,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:en("width: "+_.percentage+"%;")},null,4)])])]))),128))],2)]),c("div",cat,[c("div",dat,[c("button",{onClick:e[10]||(e[10]=be(_=>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"},[G(c("div",null,pat,512),[[Mt,s.minconf_collapsed]]),G(c("div",null,hat,512),[[Mt,!s.minconf_collapsed]]),fat])]),c("div",{class:ze([{hidden:s.minconf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",mat,[Te(o,{title:"General",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",gat,[c("tr",null,[bat,c("td",null,[c("label",Eat,[c("img",{src:r.configFile.app_custom_logo!=null&&r.configFile.app_custom_logo!=""?"/user_infos/"+r.configFile.app_custom_logo:s.storeLogo,class:"w-50 h-50 rounded-full",style:{"max-width":"50px","max-height":"50px",cursor:"pointer"}},null,8,yat)]),c("input",{type:"file",id:"logo-upload",style:{display:"none"},onChange:e[11]||(e[11]=(..._)=>r.uploadLogo&&r.uploadLogo(..._))},null,32)]),c("td",vat,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Discard title changes",type:"button",onClick:e[12]||(e[12]=be(_=>r.resetLogo(),["stop"]))},Tat)])]),c("tr",null,[xat,c("td",Cat,[c("div",wat,[G(c("select",{id:"hardware_mode",required:"","onUpdate:modelValue":e[13]||(e[13]=_=>r.configFile.hardware_mode=_),onChange:e[14]||(e[14]=_=>s.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},Lat,544),[[jt,r.configFile.hardware_mode]])])])]),c("tr",null,[Pat,c("td",Uat,[G(c("input",{type:"text",id:"discussion_db_name",required:"","onUpdate:modelValue":e[15]||(e[15]=_=>r.configFile.discussion_db_name=_),onChange:e[16]||(e[16]=_=>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),[[we,r.configFile.discussion_db_name]])])]),c("tr",null,[Fat,c("td",null,[c("div",Bat,[G(c("input",{type:"checkbox",id:"copy_to_clipboard_add_all_details",required:"","onUpdate:modelValue":e[17]||(e[17]=_=>r.configFile.copy_to_clipboard_add_all_details=_),onChange:e[18]||(e[18]=_=>s.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.copy_to_clipboard_add_all_details]])])])]),c("tr",null,[Gat,c("td",null,[c("div",Vat,[G(c("input",{type:"checkbox",id:"auto_show_browser",required:"","onUpdate:modelValue":e[19]||(e[19]=_=>r.configFile.auto_show_browser=_),onChange:e[20]||(e[20]=_=>s.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.auto_show_browser]])])])]),c("tr",null,[zat,c("td",null,[c("div",Hat,[G(c("input",{type:"checkbox",id:"activate_debug",required:"","onUpdate:modelValue":e[21]||(e[21]=_=>r.configFile.debug=_),onChange:e[22]||(e[22]=_=>s.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.debug]])])])]),c("tr",null,[qat,c("td",null,[c("div",Yat,[G(c("input",{type:"checkbox",id:"debug_show_final_full_prompt",required:"","onUpdate:modelValue":e[23]||(e[23]=_=>r.configFile.debug_show_final_full_prompt=_),onChange:e[24]||(e[24]=_=>s.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.debug_show_final_full_prompt]])])])]),c("tr",null,[$at,c("td",null,[c("div",Wat,[G(c("input",{type:"checkbox",id:"debug_show_chunks",required:"","onUpdate:modelValue":e[25]||(e[25]=_=>r.configFile.debug_show_chunks=_),onChange:e[26]||(e[26]=_=>s.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.debug_show_chunks]])])])]),c("tr",null,[Kat,c("td",null,[c("div",jat,[G(c("input",{type:"text",id:"debug_log_file_path",required:"","onUpdate:modelValue":e[27]||(e[27]=_=>r.configFile.debug_log_file_path=_),onChange:e[28]||(e[28]=_=>s.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.debug_log_file_path]])])])]),c("tr",null,[Qat,c("td",null,[c("div",Xat,[G(c("input",{type:"checkbox",id:"show_news_panel",required:"","onUpdate:modelValue":e[29]||(e[29]=_=>r.configFile.show_news_panel=_),onChange:e[30]||(e[30]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.show_news_panel]])])])]),c("tr",null,[Zat,c("td",null,[c("div",Jat,[G(c("input",{type:"checkbox",id:"auto_save",required:"","onUpdate:modelValue":e[31]||(e[31]=_=>r.configFile.auto_save=_),onChange:e[32]||(e[32]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.auto_save]])])])]),c("tr",null,[elt,c("td",null,[c("div",tlt,[G(c("input",{type:"checkbox",id:"auto_update",required:"","onUpdate:modelValue":e[33]||(e[33]=_=>r.configFile.auto_update=_),onChange:e[34]||(e[34]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.auto_update]])])])]),c("tr",null,[nlt,c("td",null,[c("div",ilt,[G(c("input",{type:"checkbox",id:"auto_title",required:"","onUpdate:modelValue":e[35]||(e[35]=_=>r.configFile.auto_title=_),onChange:e[36]||(e[36]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.auto_title]])])])])])]),_:1}),Te(o,{title:"Model template",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",slt,[c("tr",null,[rlt,c("td",null,[c("select",{onChange:e[37]||(e[37]=(..._)=>r.handleTemplateSelection&&r.handleTemplateSelection(..._))},dlt,32)])]),c("tr",null,[ult,c("td",null,[G(c("input",{type:"text",id:"start_header_id_template",required:"","onUpdate:modelValue":e[38]||(e[38]=_=>r.configFile.start_header_id_template=_),onChange:e[39]||(e[39]=_=>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),[[we,r.configFile.start_header_id_template]])])]),c("tr",null,[plt,c("td",null,[G(c("input",{type:"text",id:"end_header_id_template",required:"","onUpdate:modelValue":e[40]||(e[40]=_=>r.configFile.end_header_id_template=_),onChange:e[41]||(e[41]=_=>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),[[we,r.configFile.end_header_id_template]])])]),c("tr",null,[_lt,c("td",null,[G(c("input",{type:"text",id:"start_user_header_id_template",required:"","onUpdate:modelValue":e[42]||(e[42]=_=>r.configFile.start_user_header_id_template=_),onChange:e[43]||(e[43]=_=>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),[[we,r.configFile.start_user_header_id_template]])])]),c("tr",null,[hlt,c("td",null,[G(c("input",{type:"text",id:"end_user_header_id_template",required:"","onUpdate:modelValue":e[44]||(e[44]=_=>r.configFile.end_user_header_id_template=_),onChange:e[45]||(e[45]=_=>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),[[we,r.configFile.end_user_header_id_template]])])]),c("tr",null,[flt,c("td",null,[G(c("input",{type:"text",id:"end_user_message_id_template",required:"","onUpdate:modelValue":e[46]||(e[46]=_=>r.configFile.end_user_message_id_template=_),onChange:e[47]||(e[47]=_=>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),[[we,r.configFile.end_user_message_id_template]])])]),c("tr",null,[mlt,c("td",null,[G(c("input",{type:"text",id:"start_ai_header_id_template",required:"","onUpdate:modelValue":e[48]||(e[48]=_=>r.configFile.start_ai_header_id_template=_),onChange:e[49]||(e[49]=_=>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),[[we,r.configFile.start_ai_header_id_template]])])]),c("tr",null,[glt,c("td",null,[G(c("input",{type:"text",id:"end_ai_header_id_template",required:"","onUpdate:modelValue":e[50]||(e[50]=_=>r.configFile.end_ai_header_id_template=_),onChange:e[51]||(e[51]=_=>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),[[we,r.configFile.end_ai_header_id_template]])])]),c("tr",null,[blt,c("td",null,[G(c("input",{type:"text",id:"end_ai_message_id_template",required:"","onUpdate:modelValue":e[52]||(e[52]=_=>r.configFile.end_ai_message_id_template=_),onChange:e[53]||(e[53]=_=>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),[[we,r.configFile.end_ai_message_id_template]])])]),c("tr",null,[Elt,c("td",null,[G(c("textarea",{id:"separator_template",required:"","onUpdate:modelValue":e[54]||(e[54]=_=>r.configFile.separator_template=_),onChange:e[55]||(e[55]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.separator_template]])])]),c("tr",null,[ylt,c("td",null,[G(c("input",{type:"text",id:"system_message_template",required:"","onUpdate:modelValue":e[56]||(e[56]=_=>r.configFile.system_message_template=_),onChange:e[57]||(e[57]=_=>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),[[we,r.configFile.system_message_template]])])]),c("tr",null,[vlt,c("td",null,[c("div",{innerHTML:r.full_template},null,8,Slt)])])])]),_:1}),Te(o,{title:"User",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",Tlt,[c("tr",null,[xlt,c("td",Clt,[G(c("input",{type:"text",id:"user_name",required:"","onUpdate:modelValue":e[58]||(e[58]=_=>r.configFile.user_name=_),onChange:e[59]||(e[59]=_=>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),[[we,r.configFile.user_name]])])]),c("tr",null,[wlt,c("td",Rlt,[G(c("textarea",{id:"user_description",required:"","onUpdate:modelValue":e[60]||(e[60]=_=>r.configFile.user_description=_),onChange:e[61]||(e[61]=_=>s.settingsChanged=!0),class:"min-h-[500px] w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.user_description]])])]),c("tr",null,[Alt,c("td",Nlt,[G(c("input",{type:"checkbox",id:"use_user_informations_in_discussion",required:"","onUpdate:modelValue":e[62]||(e[62]=_=>r.configFile.use_user_informations_in_discussion=_),onChange:e[63]||(e[63]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.use_user_informations_in_discussion]])])]),c("tr",null,[Olt,c("td",Ilt,[G(c("input",{type:"checkbox",id:"use_model_name_in_discussions",required:"","onUpdate:modelValue":e[64]||(e[64]=_=>r.configFile.use_model_name_in_discussions=_),onChange:e[65]||(e[65]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.use_model_name_in_discussions]])])]),c("tr",null,[Mlt,c("td",null,[c("label",Dlt,[c("img",{src:r.configFile.user_avatar!=null&&r.configFile.user_avatar!=""?"/user_infos/"+r.configFile.user_avatar:s.storeLogo,class:"w-50 h-50 rounded-full",style:{"max-width":"50px","max-height":"50px",cursor:"pointer"}},null,8,klt)]),c("input",{type:"file",id:"avatar-upload",style:{display:"none"},onChange:e[66]||(e[66]=(..._)=>r.uploadAvatar&&r.uploadAvatar(..._))},null,32)]),c("td",Llt,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Discard title changes",type:"button",onClick:e[67]||(e[67]=be(_=>r.resetAvatar(),["stop"]))},Ult)])]),c("tr",null,[Flt,c("td",null,[c("div",Blt,[G(c("input",{type:"checkbox",id:"use_user_name_in_discussions",required:"","onUpdate:modelValue":e[68]||(e[68]=_=>r.configFile.use_user_name_in_discussions=_),onChange:e[69]||(e[69]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.use_user_name_in_discussions]])])])]),c("tr",null,[Glt,c("td",Vlt,[G(c("input",{type:"number",id:"max_n_predict",required:"","onUpdate:modelValue":e[70]||(e[70]=_=>r.configFile.max_n_predict=_),onChange:e[71]||(e[71]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.max_n_predict]])])]),c("tr",null,[zlt,c("td",Hlt,[G(c("input",{type:"number",id:"max_n_predict",required:"","onUpdate:modelValue":e[72]||(e[72]=_=>r.configFile.max_n_predict=_),onChange:e[73]||(e[73]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.max_n_predict]])])])])]),_:1}),Te(o,{title:"Security settings",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",qlt,[c("tr",null,[Ylt,c("td",$lt,[G(c("input",{type:"checkbox",id:"turn_on_code_execution",required:"","onUpdate:modelValue":e[74]||(e[74]=_=>r.configFile.turn_on_code_execution=_),onChange:e[75]||(e[75]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.turn_on_code_execution]])])]),c("tr",null,[Wlt,c("td",Klt,[G(c("input",{type:"checkbox",id:"turn_on_code_validation",required:"","onUpdate:modelValue":e[76]||(e[76]=_=>r.configFile.turn_on_code_validation=_),onChange:e[77]||(e[77]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.turn_on_code_validation]])])]),c("tr",null,[jlt,c("td",Qlt,[G(c("input",{type:"checkbox",id:"turn_on_setting_update_validation",required:"","onUpdate:modelValue":e[78]||(e[78]=_=>r.configFile.turn_on_setting_update_validation=_),onChange:e[79]||(e[79]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.turn_on_setting_update_validation]])])]),c("tr",null,[Xlt,c("td",Zlt,[G(c("input",{type:"checkbox",id:"turn_on_open_file_validation",required:"","onUpdate:modelValue":e[80]||(e[80]=_=>r.configFile.turn_on_open_file_validation=_),onChange:e[81]||(e[81]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.turn_on_open_file_validation]])])]),c("tr",null,[Jlt,c("td",ect,[G(c("input",{type:"checkbox",id:"turn_on_send_file_validation",required:"","onUpdate:modelValue":e[82]||(e[82]=_=>r.configFile.turn_on_send_file_validation=_),onChange:e[83]||(e[83]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.turn_on_send_file_validation]])])])])]),_:1}),Te(o,{title:"Knowledge database",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",tct,[c("tr",null,[nct,c("td",null,[c("div",ict,[G(c("input",{type:"checkbox",id:"activate_skills_lib",required:"","onUpdate:modelValue":e[84]||(e[84]=_=>r.configFile.activate_skills_lib=_),onChange:e[85]||(e[85]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.activate_skills_lib]])])])]),c("tr",null,[sct,c("td",rct,[G(c("input",{type:"text",id:"skills_lib_database_name",required:"","onUpdate:modelValue":e[86]||(e[86]=_=>r.configFile.skills_lib_database_name=_),onChange:e[87]||(e[87]=_=>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),[[we,r.configFile.skills_lib_database_name]])])])])]),_:1}),Te(o,{title:"Latex",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",oct,[c("tr",null,[act,c("td",null,[c("div",lct,[G(c("input",{type:"text",id:"pdf_latex_path",required:"","onUpdate:modelValue":e[88]||(e[88]=_=>r.configFile.pdf_latex_path=_),onChange:e[89]||(e[89]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.pdf_latex_path]])])])])])]),_:1}),Te(o,{title:"Boost",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",cct,[c("tr",null,[dct,c("td",null,[c("div",uct,[G(c("input",{type:"text",id:"positive_boost",required:"","onUpdate:modelValue":e[90]||(e[90]=_=>r.configFile.positive_boost=_),onChange:e[91]||(e[91]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.positive_boost]])])])]),c("tr",null,[pct,c("td",null,[c("div",_ct,[G(c("input",{type:"text",id:"negative_boost",required:"","onUpdate:modelValue":e[92]||(e[92]=_=>r.configFile.negative_boost=_),onChange:e[93]||(e[93]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.negative_boost]])])])]),c("tr",null,[hct,c("td",null,[c("div",fct,[G(c("input",{type:"checkbox",id:"fun_mode",required:"","onUpdate:modelValue":e[94]||(e[94]=_=>r.configFile.fun_mode=_),onChange:e[95]||(e[95]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.fun_mode]])])])])])]),_:1})])],2)]),c("div",mct,[c("div",gct,[c("button",{onClick:e[96]||(e[96]=be(_=>s.data_conf_collapsed=!s.data_conf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[G(c("div",null,Ect,512),[[Mt,s.data_conf_collapsed]]),G(c("div",null,vct,512),[[Mt,!s.data_conf_collapsed]]),Sct])]),c("div",{class:ze([{hidden:s.data_conf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[Te(o,{title:"Data Sources",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",Tct,[c("tr",null,[xct,c("td",Cct,[(w(!0),A(Ye,null,lt(r.configFile.rag_databases,(_,m)=>(w(),A("div",{key:m,class:"flex items-center mb-2"},[G(c("input",{type:"text","onUpdate:modelValue":E=>r.configFile.rag_databases[m]=E,onChange:e[97]||(e[97]=E=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,40,wct),[[we,r.configFile.rag_databases[m]]]),c("button",{onClick:E=>r.vectorize_folder(m),class:"w-500 ml-2 px-2 py-1 bg-green-500 text-white hover:bg-green-300 rounded"},"(Re)Vectorize",8,Rct),c("button",{onClick:E=>r.select_folder(m),class:"w-500 ml-2 px-2 py-1 bg-blue-500 text-white hover:bg-green-300 rounded"},"Select Folder",8,Act),c("button",{onClick:E=>r.removeDataSource(m),class:"ml-2 px-2 py-1 bg-red-500 text-white hover:bg-green-300 rounded"},"Remove",8,Nct)]))),128)),c("button",{onClick:e[98]||(e[98]=(..._)=>r.addDataSource&&r.addDataSource(..._)),class:"mt-2 px-2 py-1 bg-blue-500 text-white rounded"},"Add Data Source")])]),c("tr",null,[Oct,c("td",null,[G(c("select",{id:"rag_vectorizer",required:"","onUpdate:modelValue":e[99]||(e[99]=_=>r.configFile.rag_vectorizer=_),onChange:e[100]||(e[100]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},kct,544),[[jt,r.configFile.rag_vectorizer]])])]),c("tr",null,[Lct,c("td",null,[G(c("select",{id:"rag_vectorizer_model",required:"","onUpdate:modelValue":e[101]||(e[101]=_=>r.configFile.rag_vectorizer_model=_),onChange:e[102]||(e[102]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},Uct,544),[[jt,r.configFile.rag_vectorizer_model]])])]),c("tr",null,[Fct,c("td",null,[G(c("input",{id:"rag_chunk_size","onUpdate:modelValue":e[103]||(e[103]=_=>r.configFile.rag_chunk_size=_),onChange:e[104]||(e[104]=_=>s.settingsChanged=!0),type:"range",min:"2",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),[[we,r.configFile.rag_chunk_size]]),G(c("input",{"onUpdate:modelValue":e[105]||(e[105]=_=>r.configFile.rag_chunk_size=_),type:"number",onChange:e[106]||(e[106]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.rag_chunk_size]])])]),c("tr",null,[Bct,c("td",null,[G(c("input",{id:"rag_overlap","onUpdate:modelValue":e[107]||(e[107]=_=>r.configFile.rag_overlap=_),onChange:e[108]||(e[108]=_=>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),[[we,r.configFile.rag_overlap]]),G(c("input",{"onUpdate:modelValue":e[109]||(e[109]=_=>r.configFile.rag_overlap=_),type:"number",onChange:e[110]||(e[110]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.rag_overlap]])])]),c("tr",null,[Gct,c("td",null,[G(c("input",{id:"rag_n_chunks","onUpdate:modelValue":e[111]||(e[111]=_=>r.configFile.rag_n_chunks=_),onChange:e[112]||(e[112]=_=>s.settingsChanged=!0),type:"range",min:"2",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),[[we,r.configFile.rag_n_chunks]]),G(c("input",{"onUpdate:modelValue":e[113]||(e[113]=_=>r.configFile.rag_n_chunks=_),type:"number",onChange:e[114]||(e[114]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.rag_n_chunks]])])]),c("tr",null,[Vct,c("td",null,[G(c("input",{"onUpdate:modelValue":e[115]||(e[115]=_=>r.configFile.rag_clean_chunks=_),type:"checkbox",onChange:e[116]||(e[116]=_=>s.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.rag_clean_chunks]])])]),c("tr",null,[zct,c("td",null,[G(c("input",{"onUpdate:modelValue":e[117]||(e[117]=_=>r.configFile.rag_follow_subfolders=_),type:"checkbox",onChange:e[118]||(e[118]=_=>s.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.rag_follow_subfolders]])])]),c("tr",null,[Hct,c("td",null,[G(c("input",{"onUpdate:modelValue":e[119]||(e[119]=_=>r.configFile.rag_check_new_files_at_startup=_),type:"checkbox",onChange:e[120]||(e[120]=_=>s.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.rag_check_new_files_at_startup]])])]),c("tr",null,[qct,c("td",null,[G(c("input",{"onUpdate:modelValue":e[121]||(e[121]=_=>r.configFile.rag_preprocess_chunks=_),type:"checkbox",onChange:e[122]||(e[122]=_=>s.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.rag_preprocess_chunks]])])]),c("tr",null,[Yct,c("td",null,[G(c("input",{"onUpdate:modelValue":e[123]||(e[123]=_=>r.configFile.rag_activate_multi_hops=_),type:"checkbox",onChange:e[124]||(e[124]=_=>s.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.rag_activate_multi_hops]])])])])]),_:1}),Te(o,{title:"Data Vectorization",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",$ct,[c("tr",null,[Wct,c("td",null,[c("div",Kct,[G(c("input",{type:"checkbox",id:"data_vectorization_save_db",required:"","onUpdate:modelValue":e[125]||(e[125]=_=>r.configFile.data_vectorization_save_db=_),onChange:e[126]||(e[126]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.data_vectorization_save_db]])])])]),c("tr",null,[jct,c("td",null,[c("div",Qct,[G(c("input",{type:"checkbox",id:"data_vectorization_visualize_on_vectorization",required:"","onUpdate:modelValue":e[127]||(e[127]=_=>r.configFile.data_vectorization_visualize_on_vectorization=_),onChange:e[128]||(e[128]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.data_vectorization_visualize_on_vectorization]])])])]),c("tr",null,[Xct,c("td",null,[c("div",Zct,[G(c("input",{type:"checkbox",id:"data_vectorization_build_keys_words",required:"","onUpdate:modelValue":e[129]||(e[129]=_=>r.configFile.data_vectorization_build_keys_words=_),onChange:e[130]||(e[130]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.data_vectorization_build_keys_words]])])])]),c("tr",null,[Jct,c("td",null,[c("div",edt,[G(c("input",{type:"checkbox",id:"data_vectorization_force_first_chunk",required:"","onUpdate:modelValue":e[131]||(e[131]=_=>r.configFile.data_vectorization_force_first_chunk=_),onChange:e[132]||(e[132]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.data_vectorization_force_first_chunk]])])])]),c("tr",null,[tdt,c("td",null,[c("div",ndt,[G(c("input",{type:"checkbox",id:"data_vectorization_put_chunk_informations_into_context",required:"","onUpdate:modelValue":e[133]||(e[133]=_=>r.configFile.data_vectorization_put_chunk_informations_into_context=_),onChange:e[134]||(e[134]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.data_vectorization_put_chunk_informations_into_context]])])])]),c("tr",null,[idt,c("td",null,[G(c("select",{id:"data_vectorization_method",required:"","onUpdate:modelValue":e[135]||(e[135]=_=>r.configFile.data_vectorization_method=_),onChange:e[136]||(e[136]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},ldt,544),[[jt,r.configFile.data_vectorization_method]])])]),c("tr",null,[cdt,c("td",ddt,[G(c("input",{type:"text",id:"data_vectorization_sentense_transformer_model",required:"","onUpdate:modelValue":e[137]||(e[137]=_=>r.configFile.data_vectorization_sentense_transformer_model=_),onChange:e[138]||(e[138]=_=>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),[[we,r.configFile.data_vectorization_sentense_transformer_model]])])]),c("tr",null,[udt,c("td",null,[G(c("select",{id:"data_visualization_method",required:"","onUpdate:modelValue":e[139]||(e[139]=_=>r.configFile.data_visualization_method=_),onChange:e[140]||(e[140]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},hdt,544),[[jt,r.configFile.data_visualization_method]])])]),c("tr",null,[fdt,c("td",null,[c("div",mdt,[G(c("input",{type:"checkbox",id:"data_vectorization_save_db",required:"","onUpdate:modelValue":e[141]||(e[141]=_=>r.configFile.data_vectorization_save_db=_),onChange:e[142]||(e[142]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.data_vectorization_save_db]])])])]),c("tr",null,[gdt,c("td",null,[G(c("input",{id:"data_vectorization_chunk_size","onUpdate:modelValue":e[143]||(e[143]=_=>r.configFile.data_vectorization_chunk_size=_),onChange:e[144]||(e[144]=_=>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),[[we,r.configFile.data_vectorization_chunk_size]]),G(c("input",{"onUpdate:modelValue":e[145]||(e[145]=_=>r.configFile.data_vectorization_chunk_size=_),type:"number",onChange:e[146]||(e[146]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.data_vectorization_chunk_size]])])]),c("tr",null,[bdt,c("td",null,[G(c("input",{id:"data_vectorization_overlap_size","onUpdate:modelValue":e[147]||(e[147]=_=>r.configFile.data_vectorization_overlap_size=_),onChange:e[148]||(e[148]=_=>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),[[we,r.configFile.data_vectorization_overlap_size]]),G(c("input",{"onUpdate:modelValue":e[149]||(e[149]=_=>r.configFile.data_vectorization_overlap_size=_),type:"number",onChange:e[150]||(e[150]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.data_vectorization_overlap_size]])])]),c("tr",null,[Edt,c("td",null,[G(c("input",{id:"data_vectorization_nb_chunks","onUpdate:modelValue":e[151]||(e[151]=_=>r.configFile.data_vectorization_nb_chunks=_),onChange:e[152]||(e[152]=_=>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),[[we,r.configFile.data_vectorization_nb_chunks]]),G(c("input",{"onUpdate:modelValue":e[153]||(e[153]=_=>r.configFile.data_vectorization_nb_chunks=_),type:"number",onChange:e[154]||(e[154]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.data_vectorization_nb_chunks]])])])])]),_:1})],2)]),c("div",ydt,[c("div",vdt,[c("button",{onClick:e[155]||(e[155]=be(_=>s.internet_conf_collapsed=!s.internet_conf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[G(c("div",null,Tdt,512),[[Mt,s.internet_conf_collapsed]]),G(c("div",null,Cdt,512),[[Mt,!s.internet_conf_collapsed]]),wdt])]),c("div",{class:ze([{hidden:s.internet_conf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[Te(o,{title:"Internet search",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",Rdt,[c("tr",null,[Adt,c("td",null,[c("div",Ndt,[G(c("input",{type:"checkbox",id:"fun_mode",required:"","onUpdate:modelValue":e[156]||(e[156]=_=>r.configFile.activate_internet_search=_),onChange:e[157]||(e[157]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.activate_internet_search]])])])]),c("tr",null,[Odt,c("td",null,[c("div",Idt,[G(c("input",{type:"checkbox",id:"activate_internet_pages_judgement",required:"","onUpdate:modelValue":e[158]||(e[158]=_=>r.configFile.activate_internet_pages_judgement=_),onChange:e[159]||(e[159]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.activate_internet_pages_judgement]])])])]),c("tr",null,[Mdt,c("td",null,[c("div",Ddt,[G(c("input",{type:"checkbox",id:"internet_quick_search",required:"","onUpdate:modelValue":e[160]||(e[160]=_=>r.configFile.internet_quick_search=_),onChange:e[161]||(e[161]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.internet_quick_search]])])])]),c("tr",null,[kdt,c("td",null,[c("div",Ldt,[G(c("input",{type:"checkbox",id:"internet_activate_search_decision",required:"","onUpdate:modelValue":e[162]||(e[162]=_=>r.configFile.internet_activate_search_decision=_),onChange:e[163]||(e[163]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.internet_activate_search_decision]])])])]),c("tr",null,[Pdt,c("td",null,[c("div",Udt,[G(c("input",{id:"internet_vectorization_chunk_size","onUpdate:modelValue":e[164]||(e[164]=_=>r.configFile.internet_vectorization_chunk_size=_),onChange:e[165]||(e[165]=_=>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),[[we,r.configFile.internet_vectorization_chunk_size]]),G(c("input",{"onUpdate:modelValue":e[166]||(e[166]=_=>r.configFile.internet_vectorization_chunk_size=_),type:"number",onChange:e[167]||(e[167]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.internet_vectorization_chunk_size]])])])]),c("tr",null,[Fdt,c("td",null,[c("div",Bdt,[G(c("input",{id:"internet_vectorization_overlap_size","onUpdate:modelValue":e[168]||(e[168]=_=>r.configFile.internet_vectorization_overlap_size=_),onChange:e[169]||(e[169]=_=>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),[[we,r.configFile.internet_vectorization_overlap_size]]),G(c("input",{"onUpdate:modelValue":e[170]||(e[170]=_=>r.configFile.internet_vectorization_overlap_size=_),type:"number",onChange:e[171]||(e[171]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.internet_vectorization_overlap_size]])])])]),c("tr",null,[Gdt,c("td",null,[c("div",Vdt,[G(c("input",{id:"internet_vectorization_nb_chunks","onUpdate:modelValue":e[172]||(e[172]=_=>r.configFile.internet_vectorization_nb_chunks=_),onChange:e[173]||(e[173]=_=>s.settingsChanged=!0),type:"range",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),[[we,r.configFile.internet_vectorization_nb_chunks]]),G(c("input",{"onUpdate:modelValue":e[174]||(e[174]=_=>r.configFile.internet_vectorization_nb_chunks=_),type:"number",onChange:e[175]||(e[175]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.internet_vectorization_nb_chunks]])])])]),c("tr",null,[zdt,c("td",null,[c("div",Hdt,[G(c("input",{id:"internet_nb_search_pages","onUpdate:modelValue":e[176]||(e[176]=_=>r.configFile.internet_nb_search_pages=_),onChange:e[177]||(e[177]=_=>s.settingsChanged=!0),type:"range",min:"1",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),[[we,r.configFile.internet_nb_search_pages]]),G(c("input",{"onUpdate:modelValue":e[178]||(e[178]=_=>r.configFile.internet_nb_search_pages=_),type:"number",onChange:e[179]||(e[179]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.internet_nb_search_pages]])])])])])]),_:1})],2)]),c("div",qdt,[c("div",Ydt,[c("button",{onClick:e[180]||(e[180]=be(_=>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"},[G(c("div",null,Wdt,512),[[Mt,s.servers_conf_collapsed]]),G(c("div",null,jdt,512),[[Mt,!s.servers_conf_collapsed]]),Qdt])]),c("div",{class:ze([{hidden:s.servers_conf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[Te(o,{title:"Default services selection",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",Xdt,[c("tr",null,[Zdt,c("td",Jdt,[G(c("select",{id:"active_tts_service",required:"","onUpdate:modelValue":e[181]||(e[181]=_=>r.configFile.active_tts_service=_),onChange:e[182]||(e[182]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},sut,544),[[jt,r.configFile.active_tts_service]])])]),c("tr",null,[rut,c("td",out,[G(c("select",{id:"active_stt_service",required:"","onUpdate:modelValue":e[183]||(e[183]=_=>r.configFile.active_stt_service=_),onChange:e[184]||(e[184]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},dut,544),[[jt,r.configFile.active_stt_service]])])]),uut,c("tr",null,[put,c("td",_ut,[G(c("select",{id:"active_tti_service",required:"","onUpdate:modelValue":e[185]||(e[185]=_=>r.configFile.active_tti_service=_),onChange:e[186]||(e[186]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},vut,544),[[jt,r.configFile.active_tti_service]])])]),c("tr",null,[Sut,c("td",Tut,[G(c("select",{id:"active_ttm_service",required:"","onUpdate:modelValue":e[187]||(e[187]=_=>r.configFile.active_ttm_service=_),onChange:e[188]||(e[188]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},wut,544),[[jt,r.configFile.active_ttm_service]])])])])]),_:1}),Te(o,{title:"TTI settings",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",Rut,[c("tr",null,[Aut,c("td",null,[c("div",Nut,[G(c("input",{type:"checkbox",id:"use_negative_prompt",required:"","onUpdate:modelValue":e[189]||(e[189]=_=>r.configFile.use_negative_prompt=_),onChange:e[190]||(e[190]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.use_negative_prompt]])])])]),c("tr",null,[Out,c("td",null,[c("div",Iut,[G(c("input",{type:"checkbox",id:"use_ai_generated_negative_prompt",required:"","onUpdate:modelValue":e[191]||(e[191]=_=>r.configFile.use_ai_generated_negative_prompt=_),onChange:e[192]||(e[192]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.use_ai_generated_negative_prompt]])])])]),c("tr",null,[Mut,c("td",null,[c("div",Dut,[G(c("input",{type:"text",id:"negative_prompt_generation_prompt",required:"","onUpdate:modelValue":e[193]||(e[193]=_=>r.configFile.negative_prompt_generation_prompt=_),onChange:e[194]||(e[194]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.negative_prompt_generation_prompt]])])])]),c("tr",null,[kut,c("td",null,[c("div",Lut,[G(c("input",{type:"text",id:"default_negative_prompt",required:"","onUpdate:modelValue":e[195]||(e[195]=_=>r.configFile.default_negative_prompt=_),onChange:e[196]||(e[196]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.default_negative_prompt]])])])])])]),_:1}),Te(o,{title:"Full Audio settings",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",Put,[c("tr",null,[Uut,c("td",Fut,[G(c("input",{type:"number",step:"1",id:"stt_listening_threshold",required:"","onUpdate:modelValue":e[197]||(e[197]=_=>r.configFile.stt_listening_threshold=_),onChange:e[198]||(e[198]=_=>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),[[we,r.configFile.stt_listening_threshold]])])]),c("tr",null,[But,c("td",Gut,[G(c("input",{type:"number",step:"1",id:"stt_silence_duration",required:"","onUpdate:modelValue":e[199]||(e[199]=_=>r.configFile.stt_silence_duration=_),onChange:e[200]||(e[200]=_=>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),[[we,r.configFile.stt_silence_duration]])])]),c("tr",null,[Vut,c("td",zut,[G(c("input",{type:"number",step:"1",id:"stt_sound_threshold_percentage",required:"","onUpdate:modelValue":e[201]||(e[201]=_=>r.configFile.stt_sound_threshold_percentage=_),onChange:e[202]||(e[202]=_=>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),[[we,r.configFile.stt_sound_threshold_percentage]])])]),c("tr",null,[Hut,c("td",qut,[G(c("input",{type:"number",step:"1",id:"stt_gain",required:"","onUpdate:modelValue":e[203]||(e[203]=_=>r.configFile.stt_gain=_),onChange:e[204]||(e[204]=_=>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),[[we,r.configFile.stt_gain]])])]),c("tr",null,[Yut,c("td",$ut,[G(c("input",{type:"number",step:"1",id:"stt_rate",required:"","onUpdate:modelValue":e[205]||(e[205]=_=>r.configFile.stt_rate=_),onChange:e[206]||(e[206]=_=>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),[[we,r.configFile.stt_rate]])])]),c("tr",null,[Wut,c("td",Kut,[G(c("input",{type:"number",step:"1",id:"stt_channels",required:"","onUpdate:modelValue":e[207]||(e[207]=_=>r.configFile.stt_channels=_),onChange:e[208]||(e[208]=_=>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),[[we,r.configFile.stt_channels]])])]),c("tr",null,[jut,c("td",Qut,[G(c("input",{type:"number",step:"1",id:"stt_buffer_size",required:"","onUpdate:modelValue":e[209]||(e[209]=_=>r.configFile.stt_buffer_size=_),onChange:e[210]||(e[210]=_=>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),[[we,r.configFile.stt_buffer_size]])])]),c("tr",null,[Xut,c("td",null,[c("div",Zut,[G(c("input",{type:"checkbox",id:"stt_activate_word_detection",required:"","onUpdate:modelValue":e[211]||(e[211]=_=>r.configFile.stt_activate_word_detection=_),onChange:e[212]||(e[212]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.stt_activate_word_detection]])])])]),c("tr",null,[Jut,c("td",null,[c("div",ept,[G(c("input",{type:"text",id:"stt_word_detection_file",required:"","onUpdate:modelValue":e[213]||(e[213]=_=>r.configFile.stt_word_detection_file=_),onChange:e[214]||(e[214]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.stt_word_detection_file]])])])])])]),_:1}),Te(o,{title:"Audio devices settings",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",tpt,[c("tr",null,[npt,c("td",ipt,[G(c("select",{id:"stt_input_device",required:"","onUpdate:modelValue":e[215]||(e[215]=_=>r.configFile.stt_input_device=_),onChange:e[216]||(e[216]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(w(!0),A(Ye,null,lt(s.snd_input_devices,(_,m)=>(w(),A("option",{key:_,value:s.snd_input_devices_indexes[m]},he(_),9,spt))),128))],544),[[jt,r.configFile.stt_input_device]])])]),c("tr",null,[rpt,c("td",opt,[G(c("select",{id:"tts_output_device",required:"","onUpdate:modelValue":e[217]||(e[217]=_=>r.configFile.tts_output_device=_),onChange:e[218]||(e[218]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(w(!0),A(Ye,null,lt(s.snd_output_devices,(_,m)=>(w(),A("option",{key:_,value:s.snd_output_devices_indexes[m]},he(_),9,apt))),128))],544),[[jt,r.configFile.tts_output_device]])])])])]),_:1}),Te(o,{title:"Lollms service",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",lpt,[c("tr",null,[cpt,c("td",dpt,[G(c("input",{type:"text",id:"host",required:"","onUpdate:modelValue":e[219]||(e[219]=_=>r.configFile.host=_),onChange:e[220]||(e[220]=_=>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),[[we,r.configFile.host]])])]),c("tr",null,[upt,c("td",ppt,[G(c("input",{type:"text",id:"lollms_access_keys",required:"","onUpdate:modelValue":e[221]||(e[221]=_=>r.configFile.lollms_access_keys=_),onChange:e[222]||(e[222]=_=>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),[[we,r.configFile.lollms_access_keys]])])]),c("tr",null,[_pt,c("td",hpt,[G(c("input",{type:"number",step:"1",id:"port",required:"","onUpdate:modelValue":e[223]||(e[223]=_=>r.configFile.port=_),onChange:e[224]||(e[224]=_=>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),[[we,r.configFile.port]])])]),c("tr",null,[fpt,c("td",mpt,[G(c("input",{type:"checkbox",id:"headless_server_mode",required:"","onUpdate:modelValue":e[225]||(e[225]=_=>r.configFile.headless_server_mode=_),onChange:e[226]||(e[226]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Ze,r.configFile.headless_server_mode]])])]),c("tr",null,[gpt,c("td",bpt,[G(c("input",{type:"checkbox",id:"activate_lollms_server",required:"","onUpdate:modelValue":e[227]||(e[227]=_=>r.configFile.activate_lollms_server=_),onChange:e[228]||(e[228]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Ze,r.configFile.activate_lollms_server]])])]),c("tr",null,[Ept,c("td",ypt,[G(c("input",{type:"checkbox",id:"activate_ollama_emulator",required:"","onUpdate:modelValue":e[229]||(e[229]=_=>r.configFile.activate_ollama_emulator=_),onChange:e[230]||(e[230]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Ze,r.configFile.activate_ollama_emulator]])])]),c("tr",null,[vpt,c("td",Spt,[G(c("input",{type:"checkbox",id:"activate_openai_emulator",required:"","onUpdate:modelValue":e[231]||(e[231]=_=>r.configFile.activate_openai_emulator=_),onChange:e[232]||(e[232]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Ze,r.configFile.activate_openai_emulator]])])]),c("tr",null,[Tpt,c("td",xpt,[G(c("input",{type:"checkbox",id:"activate_mistralai_emulator",required:"","onUpdate:modelValue":e[233]||(e[233]=_=>r.configFile.activate_mistralai_emulator=_),onChange:e[234]||(e[234]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Ze,r.configFile.activate_mistralai_emulator]])])])])]),_:1}),Te(o,{title:"STT services",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[Te(o,{title:"Browser Audio STT",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",Cpt,[c("tr",null,[wpt,c("td",null,[c("div",Rpt,[G(c("input",{type:"checkbox",id:"activate_audio_infos",required:"","onUpdate:modelValue":e[235]||(e[235]=_=>r.configFile.activate_audio_infos=_),onChange:e[236]||(e[236]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.activate_audio_infos]])])])]),c("tr",null,[Apt,c("td",null,[c("div",Npt,[G(c("input",{type:"checkbox",id:"audio_auto_send_input",required:"","onUpdate:modelValue":e[237]||(e[237]=_=>r.configFile.audio_auto_send_input=_),onChange:e[238]||(e[238]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.audio_auto_send_input]])])])]),c("tr",null,[Opt,c("td",null,[G(c("input",{id:"audio_silenceTimer","onUpdate:modelValue":e[239]||(e[239]=_=>r.configFile.audio_silenceTimer=_),onChange:e[240]||(e[240]=_=>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),[[we,r.configFile.audio_silenceTimer]]),G(c("input",{"onUpdate:modelValue":e[241]||(e[241]=_=>r.configFile.audio_silenceTimer=_),onChange:e[242]||(e[242]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.audio_silenceTimer]])])]),c("tr",null,[Ipt,c("td",null,[G(c("select",{id:"audio_in_language","onUpdate:modelValue":e[243]||(e[243]=_=>r.configFile.audio_in_language=_),onChange:e[244]||(e[244]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(w(!0),A(Ye,null,lt(r.audioLanguages,_=>(w(),A("option",{key:_.code,value:_.code},he(_.name),9,Mpt))),128))],544),[[jt,r.configFile.audio_in_language]])])])])]),_:1}),Te(o,{title:"Whisper audio transcription",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",Dpt,[c("tr",null,[kpt,c("td",null,[c("div",Lpt,[G(c("input",{type:"checkbox",id:"whisper_activate",required:"","onUpdate:modelValue":e[245]||(e[245]=_=>r.configFile.whisper_activate=_),onChange:e[246]||(e[246]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.whisper_activate]])])])]),c("tr",null,[Ppt,c("td",null,[c("div",Upt,[G(c("select",{id:"whisper_model","onUpdate:modelValue":e[247]||(e[247]=_=>r.configFile.whisper_model=_),onChange:e[248]||(e[248]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(w(!0),A(Ye,null,lt(r.whisperModels,_=>(w(),A("option",{key:_,value:_},he(_),9,Fpt))),128))],544),[[jt,r.configFile.whisper_model]])])])])])]),_:1}),Te(o,{title:"Open AI Whisper audio transcription",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",Bpt,[c("tr",null,[Gpt,c("td",null,[c("div",Vpt,[G(c("input",{type:"text",id:"openai_whisper_key",required:"","onUpdate:modelValue":e[249]||(e[249]=_=>r.configFile.openai_whisper_key=_),onChange:e[250]||(e[250]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.openai_whisper_key]])])])]),c("tr",null,[zpt,c("td",null,[c("div",Hpt,[G(c("select",{id:"openai_whisper_model","onUpdate:modelValue":e[251]||(e[251]=_=>r.configFile.openai_whisper_model=_),onChange:e[252]||(e[252]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(w(!0),A(Ye,null,lt(r.openaiWhisperModels,_=>(w(),A("option",{key:_,value:_},he(_),9,qpt))),128))],544),[[jt,r.configFile.openai_whisper_model]])])])])])]),_:1})]),_:1}),Te(o,{title:"TTS services",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[Te(o,{title:"Browser Audio TTS",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",Ypt,[c("tr",null,[$pt,c("td",null,[c("div",Wpt,[G(c("input",{type:"checkbox",id:"auto_speak",required:"","onUpdate:modelValue":e[253]||(e[253]=_=>r.configFile.auto_speak=_),onChange:e[254]||(e[254]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.auto_speak]])])])]),c("tr",null,[Kpt,c("td",null,[G(c("input",{id:"audio_pitch","onUpdate:modelValue":e[255]||(e[255]=_=>r.configFile.audio_pitch=_),onChange:e[256]||(e[256]=_=>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),[[we,r.configFile.audio_pitch]]),G(c("input",{"onUpdate:modelValue":e[257]||(e[257]=_=>r.configFile.audio_pitch=_),onChange:e[258]||(e[258]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.audio_pitch]])])]),c("tr",null,[jpt,c("td",null,[G(c("select",{id:"audio_out_voice","onUpdate:modelValue":e[259]||(e[259]=_=>r.configFile.audio_out_voice=_),onChange:e[260]||(e[260]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(w(!0),A(Ye,null,lt(s.audioVoices,_=>(w(),A("option",{key:_.name,value:_.name},he(_.name),9,Qpt))),128))],544),[[jt,r.configFile.audio_out_voice]])])])])]),_:1}),Te(o,{title:"XTTS service",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",Xpt,[c("tr",null,[Zpt,c("td",null,[c("div",Jpt,[G(c("input",{type:"checkbox",id:"xtts_enable",required:"","onUpdate:modelValue":e[261]||(e[261]=_=>r.configFile.xtts_enable=_),onChange:e[262]||(e[262]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.xtts_enable]])])])]),c("tr",null,[e_t,c("td",null,[c("div",t_t,[c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[263]||(e[263]=(..._)=>r.reinstallAudioService&&r.reinstallAudioService(..._))},"install xtts service"),c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[264]||(e[264]=(..._)=>r.startAudioService&&r.startAudioService(..._))},"start xtts service"),c("a",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",href:this.$store.state.config.xtts_base_url+"/docs",target:"_blank"},"show xtts service entries",8,n_t),i_t])])]),c("tr",null,[s_t,c("td",null,[c("div",r_t,[G(c("input",{type:"text",id:"xtts_base_url",required:"","onUpdate:modelValue":e[265]||(e[265]=_=>r.configFile.xtts_base_url=_),onChange:e[266]||(e[266]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.xtts_base_url]])])])]),c("tr",null,[o_t,c("td",null,[c("div",a_t,[G(c("select",{"onUpdate:modelValue":e[267]||(e[267]=_=>r.xtts_current_language=_),onChange:e[268]||(e[268]=_=>s.settingsChanged=!0),disabled:!r.xtts_enable},[(w(!0),A(Ye,null,lt(s.voice_languages,(_,m)=>(w(),A("option",{key:m,value:_},he(m),9,c_t))),128))],40,l_t),[[jt,r.xtts_current_language]])])])]),c("tr",null,[d_t,c("td",null,[c("div",u_t,[G(c("select",{"onUpdate:modelValue":e[269]||(e[269]=_=>r.xtts_current_voice=_),onChange:e[270]||(e[270]=_=>s.settingsChanged=!0),disabled:!r.xtts_enable},[(w(!0),A(Ye,null,lt(s.voices,_=>(w(),A("option",{key:_,value:_},he(_),9,__t))),128))],40,p_t),[[jt,r.xtts_current_voice]])])])]),c("tr",null,[h_t,c("td",null,[c("div",f_t,[G(c("input",{type:"checkbox",id:"xtts_use_deepspeed",required:"","onUpdate:modelValue":e[271]||(e[271]=_=>r.configFile.xtts_use_deepspeed=_),onChange:e[272]||(e[272]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",disabled:!r.xtts_enable},null,40,m_t),[[Ze,r.configFile.xtts_use_deepspeed]])])])]),c("tr",null,[g_t,c("td",null,[c("div",b_t,[G(c("input",{type:"checkbox",id:"xtts_use_streaming_mode",required:"","onUpdate:modelValue":e[273]||(e[273]=_=>r.configFile.xtts_use_streaming_mode=_),onChange:e[274]||(e[274]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",disabled:!r.xtts_enable},null,40,E_t),[[Ze,r.configFile.xtts_use_streaming_mode]])])])]),c("tr",null,[y_t,c("td",null,[c("div",v_t,[G(c("input",{type:"checkbox",id:"auto_read",required:"","onUpdate:modelValue":e[275]||(e[275]=_=>r.configFile.auto_read=_),onChange:e[276]||(e[276]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",disabled:!r.xtts_enable},null,40,S_t),[[Ze,r.configFile.auto_read]])])])]),c("tr",null,[T_t,c("td",null,[c("div",x_t,[G(c("input",{type:"text",id:"xtts_stream_chunk_size",required:"","onUpdate:modelValue":e[277]||(e[277]=_=>r.configFile.xtts_stream_chunk_size=_),onChange:e[278]||(e[278]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.xtts_stream_chunk_size]])])])]),c("tr",null,[C_t,c("td",null,[c("div",w_t,[G(c("input",{type:"number",id:"xtts_temperature",required:"","onUpdate:modelValue":e[279]||(e[279]=_=>r.configFile.xtts_temperature=_),onChange:e[280]||(e[280]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",step:"0.01"},null,544),[[we,r.configFile.xtts_temperature,void 0,{number:!0}]])])])]),c("tr",null,[R_t,c("td",null,[c("div",A_t,[G(c("input",{type:"number",id:"xtts_length_penalty",required:"","onUpdate:modelValue":e[281]||(e[281]=_=>r.configFile.xtts_length_penalty=_),onChange:e[282]||(e[282]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",step:"0.1"},null,544),[[we,r.configFile.xtts_length_penalty,void 0,{number:!0}]])])])]),c("tr",null,[N_t,c("td",null,[c("div",O_t,[G(c("input",{type:"number",id:"xtts_repetition_penalty",required:"","onUpdate:modelValue":e[283]||(e[283]=_=>r.configFile.xtts_repetition_penalty=_),onChange:e[284]||(e[284]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",step:"0.1"},null,544),[[we,r.configFile.xtts_repetition_penalty,void 0,{number:!0}]])])])]),c("tr",null,[I_t,c("td",null,[c("div",M_t,[G(c("input",{type:"number",id:"xtts_top_k",required:"","onUpdate:modelValue":e[285]||(e[285]=_=>r.configFile.xtts_top_k=_),onChange:e[286]||(e[286]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.xtts_top_k,void 0,{number:!0}]])])])]),c("tr",null,[D_t,c("td",null,[c("div",k_t,[G(c("input",{type:"number",id:"xtts_top_p",required:"","onUpdate:modelValue":e[287]||(e[287]=_=>r.configFile.xtts_top_p=_),onChange:e[288]||(e[288]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.xtts_top_p,void 0,{number:!0}]])])])]),c("tr",null,[L_t,c("td",null,[c("div",P_t,[G(c("input",{type:"number",id:"xtts_speed",required:"","onUpdate:modelValue":e[289]||(e[289]=_=>r.configFile.xtts_speed=_),onChange:e[290]||(e[290]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",step:"0.1"},null,544),[[we,r.configFile.xtts_speed,void 0,{number:!0}]])])])]),c("tr",null,[U_t,c("td",null,[c("div",F_t,[G(c("input",{type:"checkbox",id:"enable_text_splitting","onUpdate:modelValue":e[291]||(e[291]=_=>r.configFile.enable_text_splitting=_),onChange:e[292]||(e[292]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.enable_text_splitting]])])])])])]),_:1}),Te(o,{title:"Open AI TTS service",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",B_t,[c("tr",null,[G_t,c("td",null,[c("div",V_t,[G(c("input",{type:"text",id:"openai_tts_key",required:"","onUpdate:modelValue":e[293]||(e[293]=_=>r.configFile.openai_tts_key=_),onChange:e[294]||(e[294]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.openai_tts_key]])])])]),c("tr",null,[z_t,c("td",null,[c("div",H_t,[G(c("select",{"onUpdate:modelValue":e[295]||(e[295]=_=>r.configFile.openai_tts_model=_),onChange:e[296]||(e[296]=_=>s.settingsChanged=!0)},$_t,544),[[jt,r.configFile.openai_tts_model]])])])]),c("tr",null,[W_t,c("td",null,[c("div",K_t,[G(c("select",{"onUpdate:modelValue":e[297]||(e[297]=_=>r.configFile.openai_tts_voice=_),onChange:e[298]||(e[298]=_=>s.settingsChanged=!0)},eht,544),[[jt,r.configFile.openai_tts_voice]])])])])])]),_:1})]),_:1}),Te(o,{title:"TTI services",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[Te(o,{title:"Stable diffusion service",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",tht,[c("tr",null,[nht,c("td",null,[c("div",iht,[G(c("input",{type:"checkbox",id:"enable_sd_service",required:"","onUpdate:modelValue":e[299]||(e[299]=_=>r.configFile.enable_sd_service=_),onChange:e[300]||(e[300]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.enable_sd_service]])])]),c("td",null,[c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[301]||(e[301]=_=>this.$store.state.messageBox.showMessage("Activates Stable diffusion service. The service will be automatically loaded at startup alowing you to use the stable diffusion endpoint to generate images"))},rht)])]),c("tr",null,[oht,c("td",null,[c("div",aht,[c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[302]||(e[302]=(..._)=>r.reinstallSDService&&r.reinstallSDService(..._))},"install sd service"),c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[303]||(e[303]=(..._)=>r.upgradeSDService&&r.upgradeSDService(..._))},"upgrade sd service"),c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[304]||(e[304]=(..._)=>r.startSDService&&r.startSDService(..._))},"start sd service"),c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[305]||(e[305]=(..._)=>r.showSD&&r.showSD(..._))},"show sd ui"),lht])]),c("td",null,[c("div",cht,[c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[306]||(e[306]=(..._)=>r.reinstallSDService&&r.reinstallSDService(..._))},"install sd service")])])]),c("tr",null,[dht,c("td",null,[c("div",uht,[G(c("input",{type:"text",id:"sd_base_url",required:"","onUpdate:modelValue":e[307]||(e[307]=_=>r.configFile.sd_base_url=_),onChange:e[308]||(e[308]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.sd_base_url]])])])])])]),_:1}),Te(o,{title:"Diffusers service",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",pht,[c("tr",null,[_ht,c("td",null,[c("div",hht,[c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[309]||(e[309]=(..._)=>r.reinstallDiffusersService&&r.reinstallDiffusersService(..._))},"install diffusers service"),c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[310]||(e[310]=(..._)=>r.upgradeDiffusersService&&r.upgradeDiffusersService(..._))},"upgrade diffusers service"),fht])])]),c("tr",null,[mht,c("td",null,[c("div",ght,[G(c("input",{type:"text",id:"diffusers_model",required:"","onUpdate:modelValue":e[311]||(e[311]=_=>r.configFile.diffusers_model=_),onChange:e[312]||(e[312]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.diffusers_model]])])]),bht])])]),_:1}),Te(o,{title:"Midjourney",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",Eht,[c("tr",null,[yht,c("td",null,[c("div",vht,[G(c("input",{type:"text",id:"midjourney_key",required:"","onUpdate:modelValue":e[313]||(e[313]=_=>r.configFile.midjourney_key=_),onChange:e[314]||(e[314]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.midjourney_key]])])])])])]),_:1}),Te(o,{title:"Dall-E",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",Sht,[c("tr",null,[Tht,c("td",null,[c("div",xht,[G(c("input",{type:"text",id:"dall_e_key",required:"","onUpdate:modelValue":e[315]||(e[315]=_=>r.configFile.dall_e_key=_),onChange:e[316]||(e[316]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.dall_e_key]])])])]),c("tr",null,[Cht,c("td",null,[c("div",wht,[G(c("select",{"onUpdate:modelValue":e[317]||(e[317]=_=>r.configFile.dall_e_generation_engine=_),onChange:e[318]||(e[318]=_=>s.settingsChanged=!0)},Nht,544),[[jt,r.configFile.dall_e_generation_engine]])])])])])]),_:1}),Te(o,{title:"ComfyUI service",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",Oht,[c("tr",null,[Iht,c("td",null,[c("div",Mht,[G(c("input",{type:"checkbox",id:"enable_comfyui_service",required:"","onUpdate:modelValue":e[319]||(e[319]=_=>r.configFile.enable_comfyui_service=_),onChange:e[320]||(e[320]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.enable_comfyui_service]])])]),c("td",null,[c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[321]||(e[321]=_=>this.$store.state.messageBox.showMessage("Activates Stable diffusion service. The service will be automatically loaded at startup alowing you to use the stable diffusion endpoint to generate images"))},kht)])]),c("tr",null,[Lht,c("td",null,[c("div",Pht,[G(c("input",{type:"text",id:"comfyui_model",required:"","onUpdate:modelValue":e[322]||(e[322]=_=>r.configFile.comfyui_model=_),onChange:e[323]||(e[323]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.comfyui_model]])])]),c("td",null,[c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[324]||(e[324]=_=>this.$store.state.messageBox.showMessage("Activates Stable diffusion service. The service will be automatically loaded at startup alowing you to use the stable diffusion endpoint to generate images"))},Fht)])]),c("tr",null,[Bht,c("td",null,[c("div",Ght,[c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[325]||(e[325]=(..._)=>r.reinstallComfyUIService&&r.reinstallComfyUIService(..._))},"install comfyui service"),c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[326]||(e[326]=(..._)=>r.upgradeComfyUIService&&r.upgradeComfyUIService(..._))},"upgrade comfyui service"),c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[327]||(e[327]=(..._)=>r.startComfyUIService&&r.startComfyUIService(..._))},"start comfyui service"),c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[328]||(e[328]=(..._)=>r.showComfyui&&r.showComfyui(..._))},"show comfyui"),Vht])])]),c("tr",null,[zht,c("td",null,[c("div",Hht,[G(c("input",{type:"text",id:"comfyui_base_url",required:"","onUpdate:modelValue":e[329]||(e[329]=_=>r.configFile.comfyui_base_url=_),onChange:e[330]||(e[330]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.comfyui_base_url]])])])])])]),_:1})]),_:1}),Te(o,{title:"TTT services",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[Te(o,{title:"Ollama service",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",qht,[c("tr",null,[Yht,c("td",null,[c("div",$ht,[G(c("input",{type:"checkbox",id:"enable_ollama_service",required:"","onUpdate:modelValue":e[331]||(e[331]=_=>r.configFile.enable_ollama_service=_),onChange:e[332]||(e[332]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.enable_ollama_service]])])]),c("td",null,[c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[333]||(e[333]=_=>this.$store.state.messageBox.showMessage(`Activates ollama service. The service will be automatically loaded at startup alowing you to use the ollama binding. +You need to apply changes before you leave, or else.`,"Apply configuration","Cancel")&&this.applyConfiguration(),!1}},P=t=>(yo("data-v-39a73106"),t=t(),vo(),t),$rt={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"},Wrt={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"},Krt={key:0,class:"flex gap-3 flex-1 items-center duration-75"},jrt=P(()=>c("i",{"data-feather":"x"},null,-1)),Qrt=[jrt],Xrt=P(()=>c("i",{"data-feather":"check"},null,-1)),Zrt=[Xrt],Jrt={key:1,class:"flex gap-3 flex-1 items-center"},eot=P(()=>c("i",{"data-feather":"refresh-ccw"},null,-1)),tot=[eot],not=P(()=>c("i",{"data-feather":"list"},null,-1)),iot=[not],sot={class:"flex gap-3 flex-1 items-center justify-end"},rot=P(()=>c("i",{"data-feather":"trash-2"},null,-1)),oot=[rot],aot=P(()=>c("i",{"data-feather":"refresh-ccw"},null,-1)),lot=[aot],cot=P(()=>c("i",{"data-feather":"arrow-up-circle"},null,-1)),dot=P(()=>c("i",{"data-feather":"alert-circle"},null,-1)),uot={class:"flex gap-3 items-center"},pot={key:0,class:"flex gap-3 items-center"},_ot=P(()=>c("div",{class:"flex flex-row"},[c("p",{class:"text-green-600 font-bold hover:text-green-300 ml-4 pl-4 mr-4 pr-4"},"Apply changes:"),c("i",{"data-feather":"check"})],-1)),hot=[_ot],fot=P(()=>c("div",{class:"flex flex-row"},[c("p",{class:"text-red-600 font-bold hover:text-red-300 ml-4 pl-4 mr-4 pr-4"},"Cancel changes:"),c("i",{"data-feather":"x"})],-1)),mot=[fot],got={key:1,role:"status"},bot=P(()=>c("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"},[c("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),c("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)),Eot=P(()=>c("span",{class:"sr-only"},"Loading...",-1)),yot={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"},vot={class:"flex flex-row p-3"},Sot=P(()=>c("i",{"data-feather":"chevron-right"},null,-1)),Tot=[Sot],xot=P(()=>c("i",{"data-feather":"chevron-down"},null,-1)),Cot=[xot],wot=P(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," System status",-1)),Rot=P(()=>c("div",{class:"mr-2"},"|",-1)),Aot={class:"text-base font-semibold cursor-pointer select-none items-center"},Not={class:"flex gap-2 items-center"},Oot={key:0},Iot=["src"],Mot={class:"font-bold font-large text-lg"},Dot={key:1},kot={class:"flex gap-2 items-center"},Lot=["src"],Pot={class:"font-bold font-large text-lg"},Uot=P(()=>c("i",{"data-feather":"cpu",title:"CPU Ram",class:"w-5 h-5 mx-1 flex-shrink-0"},null,-1)),Fot={class:"font-bold font-large text-lg"},Bot=P(()=>c("i",{"data-feather":"hard-drive",title:"Hard drive",class:"w-5 h-5 mx-1 flex-shrink-0"},null,-1)),Got={class:"font-bold font-large text-lg"},Vot={class:"mb-2"},zot=P(()=>c("label",{class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},[c("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[c("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"})]),et(" CPU Ram usage: ")],-1)),Hot={class:"flex flex-col mx-2"},qot=P(()=>c("b",null,"Avaliable ram: ",-1)),Yot=P(()=>c("b",null,"Ram usage: ",-1)),$ot={class:"p-2"},Wot={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},Kot={class:"mb-2"},jot=P(()=>c("label",{class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},[c("i",{"data-feather":"hard-drive",class:"w-5 h-5"}),et(" Disk usage: ")],-1)),Qot={class:"flex flex-col mx-2"},Xot=P(()=>c("b",null,"Avaliable disk space: ",-1)),Zot=P(()=>c("b",null,"Disk usage: ",-1)),Jot={class:"p-2"},eat={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},tat={class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},nat=["src"],iat={class:"flex flex-col mx-2"},sat=P(()=>c("b",null,"Model: ",-1)),rat=P(()=>c("b",null,"Avaliable vram: ",-1)),oat=P(()=>c("b",null,"GPU usage: ",-1)),aat={class:"p-2"},lat={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},cat={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"},dat={class:"flex flex-row p-3"},uat=P(()=>c("i",{"data-feather":"chevron-right"},null,-1)),pat=[uat],_at=P(()=>c("i",{"data-feather":"chevron-down"},null,-1)),hat=[_at],fat=P(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Main configurations",-1)),mat={class:"flex flex-col mb-2 px-3 pb-2"},gat={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"},bat=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"app_custom_logo",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Application logo:")],-1)),Eat={for:"logo-upload"},yat=["src"],vat={style:{width:"10%"}},Sat=P(()=>c("i",{"data-feather":"x"},null,-1)),Tat=[Sat],xat=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"hardware_mode",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Hardware mode:")],-1)),Cat={class:"text-center items-center"},wat={class:"flex flex-row"},Rat=P(()=>c("option",{value:"cpu"},"CPU",-1)),Aat=P(()=>c("option",{value:"cpu-noavx"},"CPU (No AVX)",-1)),Nat=P(()=>c("option",{value:"nvidia-tensorcores"},"NVIDIA (Tensor Cores)",-1)),Oat=P(()=>c("option",{value:"nvidia"},"NVIDIA",-1)),Iat=P(()=>c("option",{value:"amd-noavx"},"AMD (No AVX)",-1)),Mat=P(()=>c("option",{value:"amd"},"AMD",-1)),Dat=P(()=>c("option",{value:"apple-intel"},"Apple Intel",-1)),kat=P(()=>c("option",{value:"apple-silicon"},"Apple Silicon",-1)),Lat=[Rat,Aat,Nat,Oat,Iat,Mat,Dat,kat],Pat=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"discussion_db_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Database path:")],-1)),Uat={style:{width:"100%"}},Fat=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"copy_to_clipboard_add_all_details",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Add details to messages copied to clipboard:")],-1)),Bat={class:"flex flex-row"},Gat=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"auto_show_browser",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto show browser:")],-1)),Vat={class:"flex flex-row"},zat=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"activate_debug",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate debug mode:")],-1)),Hat={class:"flex flex-row"},qat=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"debug_show_final_full_prompt",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Show final full prompt in console:")],-1)),Yat={class:"flex flex-row"},$at=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"debug_show_chunks",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Show chunks in console:")],-1)),Wat={class:"flex flex-row"},Kat=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"debug_log_file_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Debug file path:")],-1)),jat={class:"flex flex-row"},Qat=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"show_news_panel",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Show news panel:")],-1)),Xat={class:"flex flex-row"},Zat=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"auto_save",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto save:")],-1)),Jat={class:"flex flex-row"},elt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"auto_update",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto update:")],-1)),tlt={class:"flex flex-row"},nlt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"auto_update",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto title:")],-1)),ilt={class:"flex flex-row"},slt={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"},rlt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"start_header_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Start header id template:")],-1)),olt=P(()=>c("option",{value:"lollms"},"Lollms communication template",-1)),alt=P(()=>c("option",{value:"lollms_simplified"},"Lollms simplified communication template",-1)),llt=P(()=>c("option",{value:"llama3"},"LLama3 communication template",-1)),clt=P(()=>c("option",{value:"mistral"},"Mistral communication template",-1)),dlt=[olt,alt,llt,clt],ult=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"start_header_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Start header id template:")],-1)),plt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"end_header_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"End header id template:")],-1)),_lt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"start_user_header_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Start user header id template:")],-1)),hlt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"end_user_header_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"End user header id template:")],-1)),flt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"end_user_message_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"End user message id template:")],-1)),mlt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"start_ai_header_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Start ai header id template:")],-1)),glt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"end_ai_header_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"End ai header id template:")],-1)),blt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"end_ai_message_id_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"End ai message id template:")],-1)),Elt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"separator_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Separator template:")],-1)),ylt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"system_message_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"System template:")],-1)),vlt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"full_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Full template:")],-1)),Slt=["innerHTML"],Tlt={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"},xlt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"user_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User name:")],-1)),Clt={style:{width:"100%"}},wlt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"user_description",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User description:")],-1)),Rlt={style:{width:"100%"}},Alt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"use_user_informations_in_discussion",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use user description in discussion:")],-1)),Nlt={style:{width:"100%"}},Olt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"use_model_name_in_discussions",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use model name in discussion:")],-1)),Ilt={style:{width:"100%"}},Mlt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"user_avatar",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User avatar:")],-1)),Dlt={for:"avatar-upload"},klt=["src"],Llt={style:{width:"10%"}},Plt=P(()=>c("i",{"data-feather":"x"},null,-1)),Ult=[Plt],Flt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"use_user_name_in_discussions",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use User Name in discussions:")],-1)),Blt={class:"flex flex-row"},Glt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"max_n_predict",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Maximum number of output tokens space (forces the model to have more space to speak):")],-1)),Vlt={style:{width:"100%"}},zlt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"max_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)),Hlt={style:{width:"100%"}},qlt={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"},Ylt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"turn_on_code_execution",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"turn on code execution:")],-1)),$lt={style:{width:"100%"}},Wlt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"turn_on_code_validation",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"turn on code validation (very recommended for security reasons):")],-1)),Klt={style:{width:"100%"}},jlt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"turn_on_setting_update_validation",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"turn on apply settings validation (very recommended for security reasons):")],-1)),Qlt={style:{width:"100%"}},Xlt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"turn_on_open_file_validation",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"turn on open file/folder validation:")],-1)),Zlt={style:{width:"100%"}},Jlt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"turn_on_send_file_validation",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"turn on send file validation:")],-1)),ect={style:{width:"100%"}},tct={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"},nct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"activate_skills_lib",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate Skills library:")],-1)),ict={class:"flex flex-row"},sct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"discussion_db_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Skills library database name:")],-1)),rct={style:{width:"100%"}},oct={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"},act=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"pdf_latex_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"PDF LaTeX path:")],-1)),lct={class:"flex flex-row"},cct={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"},dct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"positive_boost",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Positive Boost:")],-1)),uct={class:"flex flex-row"},pct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"negative_boost",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Negative Boost:")],-1)),_ct={class:"flex flex-row"},hct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"fun_mode",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Fun mode:")],-1)),fct={class:"flex flex-row"},mct={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"},gct={class:"flex flex-row p-3"},bct=P(()=>c("i",{"data-feather":"chevron-right"},null,-1)),Ect=[bct],yct=P(()=>c("i",{"data-feather":"chevron-down"},null,-1)),vct=[yct],Sct=P(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Data management settings",-1)),Tct={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"},xct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"rag_databases",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data Sources:")],-1)),Cct={style:{width:"100%"}},wct=["onUpdate:modelValue"],Rct=["onClick"],Act=["onClick"],Nct=["onClick"],Oct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_save_db",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"RAG Vectorizer:")],-1)),Ict=P(()=>c("option",{value:"bert"},"Bert Vectorizer",-1)),Mct=P(()=>c("option",{value:"tfidf"},"TFIDF Vectorizer",-1)),Dct=P(()=>c("option",{value:"word2vec"},"Word2Vec Vectorizer",-1)),kct=[Ict,Mct,Dct],Lct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"rag_vectorizer_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"RAG Vectorizer model:")],-1)),Pct=P(()=>c("option",{value:"bert-base-nli-mean-tokens"},"bert-base-nli-mean-tokens",-1)),Uct=[Pct],Fct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"rag_chunk_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"RAG chunk size:")],-1)),Bct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"rag_overlap",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"RAG overlap size:")],-1)),Gct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"rag_n_chunks",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"RAG number of chunks:")],-1)),Vct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"rag_clean_chunks",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Clean chunks:")],-1)),zct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"rag_follow_subfolders",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Follow subfolders:")],-1)),Hct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"rag_check_new_files_at_startup",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Check for new files at startup:")],-1)),qct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"rag_preprocess_chunks",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Preprocess chunks:")],-1)),Yct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"rag_activate_multi_hops",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate multi hops RAG:")],-1)),$ct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"contextual_summary",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use contextual summary instead of rag (consumes alot of tokens and may be very slow but efficient, useful for summary and global questions that RAG can't do):")],-1)),Wct={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"},Kct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_save_db",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Save vectorized database:")],-1)),jct={class:"flex flex-row"},Qct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_visualize_on_vectorization",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"show vectorized data:")],-1)),Xct={class:"flex flex-row"},Zct=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_build_keys_words",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Reformulate prompt before querying database (advised):")],-1)),Jct={class:"flex flex-row"},edt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_force_first_chunk",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Force adding the first chunk of the file to the context:")],-1)),tdt={class:"flex flex-row"},ndt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_put_chunk_informations_into_context",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Put Chunk Information Into Context:")],-1)),idt={class:"flex flex-row"},sdt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_method",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization method:")],-1)),rdt=P(()=>c("option",{value:"tfidf_vectorizer"},"tfidf Vectorizer",-1)),odt=P(()=>c("option",{value:"bm25_vectorizer"},"bm25 Vectorizer",-1)),adt=P(()=>c("option",{value:"model_embedding"},"Model Embedding",-1)),ldt=P(()=>c("option",{value:"sentense_transformer"},"Sentense Transformer",-1)),cdt=[rdt,odt,adt,ldt],ddt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_sentense_transformer_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization model (for Sentense Transformer):")],-1)),udt={style:{width:"100%"}},pdt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_visualization_method",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data visualization method:")],-1)),_dt=P(()=>c("option",{value:"PCA"},"PCA",-1)),hdt=P(()=>c("option",{value:"TSNE"},"TSNE",-1)),fdt=[_dt,hdt],mdt=P(()=>c("td",{style:{"min-width":"200px"}},[c("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)),gdt={class:"flex flex-row"},bdt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_chunk_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization chunk size(tokens):")],-1)),Edt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_overlap_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization overlap size(tokens):")],-1)),ydt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_overlap_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Number of chunks to use for each message:")],-1)),vdt={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"},Tdt=P(()=>c("i",{"data-feather":"chevron-right"},null,-1)),xdt=[Tdt],Cdt=P(()=>c("i",{"data-feather":"chevron-down"},null,-1)),wdt=[Cdt],Rdt=P(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Internet",-1)),Adt={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"},Ndt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"activate_internet_search",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate internet search:")],-1)),Odt={class:"flex flex-row"},Idt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"activate_internet_pages_judgement",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate internet pages judgement:")],-1)),Mdt={class:"flex flex-row"},Ddt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"internet_quick_search",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate quick search:")],-1)),kdt={class:"flex flex-row"},Ldt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"internet_activate_search_decision",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate search decision:")],-1)),Pdt={class:"flex flex-row"},Udt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"internet_vectorization_chunk_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Internet vectorization chunk size:")],-1)),Fdt={class:"flex flex-col"},Bdt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"internet_vectorization_overlap_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Internet vectorization overlap size:")],-1)),Gdt={class:"flex flex-col"},Vdt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"internet_vectorization_nb_chunks",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Internet vectorization number of chunks:")],-1)),zdt={class:"flex flex-col"},Hdt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"internet_nb_search_pages",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Internet number of search pages:")],-1)),qdt={class:"flex flex-col"},Ydt={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"},$dt={class:"flex flex-row p-3"},Wdt=P(()=>c("i",{"data-feather":"chevron-right"},null,-1)),Kdt=[Wdt],jdt=P(()=>c("i",{"data-feather":"chevron-down"},null,-1)),Qdt=[jdt],Xdt=P(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Services Zoo",-1)),Zdt={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"},Jdt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"active_tts_service",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Default Text to speach engine"},"Active TTS Service:")],-1)),eut={style:{width:"100%"}},tut=P(()=>c("option",{value:"None"},"None",-1)),nut=P(()=>c("option",{value:"browser"},"Use Browser TTS (doesn't work in realtime mode)",-1)),iut=P(()=>c("option",{value:"xtts"},"XTTS",-1)),sut=P(()=>c("option",{value:"openai_tts"},"Open AI TTS",-1)),rut=[tut,nut,iut,sut],out=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"active_stt_service",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Default Speach to Text engine"},"Active STT Service:")],-1)),aut={style:{width:"100%"}},lut=P(()=>c("option",{value:"None"},"None",-1)),cut=P(()=>c("option",{value:"whisper"},"Whisper",-1)),dut=P(()=>c("option",{value:"openai_whisper"},"Open AI Whisper",-1)),uut=[lut,cut,dut],put=P(()=>c("tr",null,null,-1)),_ut=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"active_tti_service",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Default Text to image engine"},"Active TTI Service:")],-1)),hut={style:{width:"100%"}},fut=P(()=>c("option",{value:"None"},"None",-1)),mut=P(()=>c("option",{value:"diffusers"},"Diffusers",-1)),gut=P(()=>c("option",{value:"autosd"},"AUTO1111's SD",-1)),but=P(()=>c("option",{value:"dall-e"},"Open AI DALL-E",-1)),Eut=P(()=>c("option",{value:"midjourney"},"Midjourney",-1)),yut=P(()=>c("option",{value:"comfyui"},"Comfyui",-1)),vut=P(()=>c("option",{value:"fooocus"},"Fooocus",-1)),Sut=[fut,mut,gut,but,Eut,yut,vut],Tut=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"active_ttm_service",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Default Text to Music engine"},"Active TTM Service:")],-1)),xut={style:{width:"100%"}},Cut=P(()=>c("option",{value:"None"},"None",-1)),wut=P(()=>c("option",{value:"musicgen"},"Music Gen",-1)),Rut=[Cut,wut],Aut={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"},Nut=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"use_negative_prompt",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use negative prompt:")],-1)),Out={class:"flex flex-row"},Iut=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"use_ai_generated_negative_prompt",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use AI generated negative prompt:")],-1)),Mut={class:"flex flex-row"},Dut=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"negative_prompt_generation_prompt",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Negative prompt generation prompt:")],-1)),kut={class:"flex flex-row"},Lut=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"default_negative_prompt",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Default negative prompt:")],-1)),Put={class:"flex flex-row"},Uut={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"},Fut=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"stt_listening_threshold",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Listening threshold"},"Listening threshold:")],-1)),But={style:{width:"100%"}},Gut=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"stt_silence_duration",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Scilence duration"},"Silence duration (s):")],-1)),Vut={style:{width:"100%"}},zut=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"stt_sound_threshold_percentage",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"stt_sound_threshold_percentage"},"Minimum sound percentage in recorded segment:")],-1)),Hut={style:{width:"100%"}},qut=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"stt_gain",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"STT Gain"},"Volume amplification:")],-1)),Yut={style:{width:"100%"}},$ut=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"stt_rate",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Audio Rate"},"audio rate:")],-1)),Wut={style:{width:"100%"}},Kut=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"stt_channels",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"number of channels"},"number of channels:")],-1)),jut={style:{width:"100%"}},Qut=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"stt_buffer_size",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Buffer size"},"Buffer size:")],-1)),Xut={style:{width:"100%"}},Zut=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"stt_activate_word_detection",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate word detection:")],-1)),Jut={class:"flex flex-row"},ept=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"stt_word_detection_file",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Word detection wav file:")],-1)),tpt={class:"flex flex-row"},npt={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"},ipt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"stt_input_device",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Input device"},"Audio Input device:")],-1)),spt={style:{width:"100%"}},rpt=["value"],opt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"tts_output_device",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"Input device"},"Audio Output device:")],-1)),apt={style:{width:"100%"}},lpt=["value"],cpt={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"},dpt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"host",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Host:")],-1)),upt={style:{width:"100%"}},ppt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"lollms_access_keys",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Access keys (coma separated, if empty, anyone can use the server without authentication):")],-1)),_pt={style:{width:"100%"}},hpt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"discussion_db_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Port:")],-1)),fpt={style:{width:"100%"}},mpt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"discussion_db_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate headless server mode (deactivates all code exectuion to protect the PC from attacks):")],-1)),gpt={style:{width:"100%"}},bpt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"activate_lollms_server",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate lollms server:")],-1)),Ept={style:{width:"100%"}},ypt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"activate_ollama_emulator",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate ollama server emulator:")],-1)),vpt={style:{width:"100%"}},Spt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"activate_openai_emulator",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate openai server emulator:")],-1)),Tpt={style:{width:"100%"}},xpt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"activate_mistralai_emulator",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate mistral ai server emulator:")],-1)),Cpt={style:{width:"100%"}},wpt={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"},Rpt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"activate_audio_infos",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate audio infos:")],-1)),Apt={class:"flex flex-row"},Npt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"audio_auto_send_input",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Send audio input automatically:")],-1)),Opt={class:"flex flex-row"},Ipt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"audio_silenceTimer",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"audio in silence timer (ms):")],-1)),Mpt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"audio_in_language",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Input Audio Language:")],-1)),Dpt=["value"],kpt={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"},Lpt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"whisper_activate",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate Whisper at startup:")],-1)),Ppt={class:"flex flex-row"},Upt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"whisper_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Whisper model:")],-1)),Fpt={class:"flex flex-row"},Bpt=["value"],Gpt={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"},Vpt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"openai_whisper_key",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"openai whisper key:")],-1)),zpt={class:"flex flex-row"},Hpt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"openai_whisper_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Open Ai Whisper model:")],-1)),qpt={class:"flex flex-row"},Ypt=["value"],$pt={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"},Wpt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"auto_speak",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable auto speak:")],-1)),Kpt={class:"flex flex-row"},jpt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"audio_pitch",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"audio pitch:")],-1)),Qpt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"audio_out_voice",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Output Audio Voice:")],-1)),Xpt=["value"],Zpt={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"},Jpt=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_enable",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable voice service:")],-1)),e_t={class:"flex flex-row"},t_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"install_xtts_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"xTTS service:")],-1)),n_t={class:"flex flex-row"},i_t=["href"],s_t=P(()=>c("a",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",href:"https://github.com/ParisNeo/xtts-api-server/blob/main/LICENSE",target:"_blank"},"licence",-1)),r_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"xtts base url:")],-1)),o_t={class:"flex flex-row"},a_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_current_language",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Current language:")],-1)),l_t={class:"flex flex-row"},c_t=["disabled"],d_t=["value"],u_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_current_voice",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Current voice:")],-1)),p_t={class:"flex flex-row"},__t=["disabled"],h_t=["value"],f_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_use_deepspeed",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable deepspeed:")],-1)),m_t={class:"flex flex-row"},g_t=["disabled"],b_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_use_streaming_mode",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable streaming mode:")],-1)),E_t={class:"flex flex-row"},y_t=["disabled"],v_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"auto_read",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable auto read:")],-1)),S_t={class:"flex flex-row"},T_t=["disabled"],x_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_stream_chunk_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"xtts stream chunk size:")],-1)),C_t={class:"flex flex-row"},w_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_temperature",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Temperature:")],-1)),R_t={class:"flex flex-row"},A_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_length_penalty",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Length Penalty:")],-1)),N_t={class:"flex flex-row"},O_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_repetition_penalty",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Repetition Penalty:")],-1)),I_t={class:"flex flex-row"},M_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_top_k",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Top K:")],-1)),D_t={class:"flex flex-row"},k_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_top_p",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Top P:")],-1)),L_t={class:"flex flex-row"},P_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_speed",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Speed:")],-1)),U_t={class:"flex flex-row"},F_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"enable_text_splitting",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable Text Splitting:")],-1)),B_t={class:"flex flex-row"},G_t={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"},V_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"openai_tts_key",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Open AI key:")],-1)),z_t={class:"flex flex-row"},H_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"openai_tts_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"openai tts model:")],-1)),q_t={class:"flex flex-row"},Y_t=P(()=>c("option",null," tts-1 ",-1)),$_t=P(()=>c("option",null," tts-2 ",-1)),W_t=[Y_t,$_t],K_t=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"openai_tts_voice",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"openai tts voice:")],-1)),j_t={class:"flex flex-row"},Q_t=P(()=>c("option",null," alloy ",-1)),X_t=P(()=>c("option",null," echo ",-1)),Z_t=P(()=>c("option",null," fable ",-1)),J_t=P(()=>c("option",null," nova ",-1)),eht=P(()=>c("option",null," shimmer ",-1)),tht=[Q_t,X_t,Z_t,J_t,eht],nht={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"},iht=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"enable_sd_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable sd service:")],-1)),sht={class:"flex flex-row"},rht=P(()=>c("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),oht=[rht],aht=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"install_sd_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install SD service:")],-1)),lht={class:"flex flex-row"},cht=P(()=>c("a",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",href:"https://github.com/ParisNeo/stable-diffusion-webui/blob/master/LICENSE.txt",target:"_blank"},"automatic1111's sd licence",-1)),dht={class:"flex flex-row"},uht=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"sd_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"sd base url:")],-1)),pht={class:"flex flex-row"},_ht={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"},hht=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"install_diffusers_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install Diffusers service:")],-1)),fht={class:"flex flex-row"},mht=P(()=>c("a",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",href:"https://github.com/huggingface/diffusers?tab=Apache-2.0-1-ov-file#readme",target:"_blank"},"Diffusers licence",-1)),ght=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"diffusers_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Diffusers model:")],-1)),bht={class:"flex flex-row"},Eht=P(()=>c("td",null,null,-1)),yht={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"},vht=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"midjourney_key",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"midjourney key:")],-1)),Sht={class:"flex flex-row"},Tht={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"},xht=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"dall_e_key",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"dall e key:")],-1)),Cht={class:"flex flex-row"},wht=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"dall_e_generation_engine",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"dall e generation engine:")],-1)),Rht={class:"flex flex-row"},Aht=P(()=>c("option",null," dall-e-2 ",-1)),Nht=P(()=>c("option",null," dall-e-3 ",-1)),Oht=[Aht,Nht],Iht={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"},Mht=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"enable_comfyui_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable comfyui service:")],-1)),Dht={class:"flex flex-row"},kht=P(()=>c("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),Lht=[kht],Pht=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"comfyui_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable comfyui model:")],-1)),Uht={class:"flex flex-row"},Fht=P(()=>c("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),Bht=[Fht],Ght=P(()=>c("td",{style:{"min-width":"200px"}},null,-1)),Vht={class:"flex flex-row"},zht=P(()=>c("a",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",href:"https://github.com/ParisNeo/ComfyUI/blob/master/LICENSE",target:"_blank"},"comfyui licence",-1)),Hht=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"comfyui_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"comfyui base url:")],-1)),qht={class:"flex flex-row"},Yht={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"},$ht=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"enable_ollama_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable ollama service:")],-1)),Wht={class:"flex flex-row"},Kht=P(()=>c("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),jht=[Kht],Qht=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"ollama_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install Ollama service:")],-1)),Xht={class:"flex flex-row"},Zht=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"ollama_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"ollama base url:")],-1)),Jht={class:"flex flex-row"},eft={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"},tft=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"enable_vllm_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable vLLM service:")],-1)),nft={class:"flex flex-row"},ift=P(()=>c("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),sft=[ift],rft=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"vllm_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install vLLM service:")],-1)),oft={class:"flex flex-row"},aft=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"vllm_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"vllm base url:")],-1)),lft={class:"flex flex-row"},cft=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"vllm_gpu_memory_utilization",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"gpu memory utilization:")],-1)),dft={class:"flex flex-col align-bottom"},uft={class:"relative"},pft=P(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"vllm_gpu_memory_utilization",class:"text-sm font-medium"}," vllm gpu memory utilization: ")],-1)),_ft={class:"absolute right-0"},hft=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"vllm_max_num_seqs",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"vllm max num seqs:")],-1)),fft={class:"flex flex-row"},mft=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"vllm_max_model_len",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"max model len:")],-1)),gft={class:"flex flex-row"},bft=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"vllm_model_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"vllm model path:")],-1)),Eft={class:"flex flex-row"},yft={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"},vft=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"enable_petals_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable petals service:")],-1)),Sft={class:"flex flex-row"},Tft=P(()=>c("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),xft=[Tft],Cft=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"petals_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install Petals service:")],-1)),wft={class:"flex flex-row"},Rft=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"petals_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"petals base url:")],-1)),Aft={class:"flex flex-row"},Nft={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"},Oft=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"enable_sd_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable Motion Ctrl service:")],-1)),Ift={class:"flex flex-row"},Mft=P(()=>c("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),Dft=[Mft],kft=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"install_sd_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install Motion Ctrl service:")],-1)),Lft={class:"flex flex-row"},Pft=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"sd_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"sd base url:")],-1)),Uft={class:"flex flex-row"},Fft={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"},Bft=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_enable",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable elastic search service:")],-1)),Gft={class:"flex flex-row"},Vft=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"install_elastic_search_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Reinstall Elastic Search service:")],-1)),zft={class:"flex flex-row"},Hft=P(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"elastic_search_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"elastic search base url:")],-1)),qft={class:"flex flex-row"},Yft={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"},$ft={class:"flex flex-row p-3"},Wft=P(()=>c("i",{"data-feather":"chevron-right"},null,-1)),Kft=[Wft],jft=P(()=>c("i",{"data-feather":"chevron-down"},null,-1)),Qft=[jft],Xft=P(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Binding zoo",-1)),Zft={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},Jft=P(()=>c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),emt={key:1,class:"mr-2"},tmt={key:2,class:"text-base font-semibold cursor-pointer select-none items-center"},nmt={class:"flex gap-1 items-center"},imt=["src"],smt={class:"font-bold font-large text-lg line-clamp-1"},rmt={key:0,class:"mb-2"},omt={for:"binding",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},amt=P(()=>c("i",{"data-feather":"chevron-up"},null,-1)),lmt=[amt],cmt=P(()=>c("i",{"data-feather":"chevron-down"},null,-1)),dmt=[cmt],umt={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"},pmt={class:"flex flex-row p-3"},_mt=P(()=>c("i",{"data-feather":"chevron-right"},null,-1)),hmt=[_mt],fmt=P(()=>c("i",{"data-feather":"chevron-down"},null,-1)),mmt=[fmt],gmt=P(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Models zoo",-1)),bmt={class:"flex flex-row items-center"},Emt={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},ymt=P(()=>c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),vmt={key:1,class:"text-base text-red-600 flex gap-3 items-center mr-2"},Smt=P(()=>c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),Tmt={key:2,class:"mr-2"},xmt={key:3,class:"text-base font-semibold cursor-pointer select-none items-center"},Cmt={class:"flex gap-1 items-center"},wmt=["src"],Rmt={class:"font-bold font-large text-lg line-clamp-1"},Amt={class:"mx-2 mb-4"},Nmt={class:"relative"},Omt={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},Imt={key:0},Mmt=P(()=>c("div",{role:"status"},[c("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"},[c("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),c("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"})]),c("span",{class:"sr-only"},"Loading...")],-1)),Dmt=[Mmt],kmt={key:1},Lmt=P(()=>c("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"},[c("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)),Pmt=[Lmt],Umt=P(()=>c("label",{for:"only_installed"},"Show only installed models",-1)),Fmt=P(()=>c("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)),Bmt={key:0,role:"status",class:"text-center w-full display: flex;align-items: center;"},Gmt=P(()=>c("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"},[c("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),c("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)),Vmt=P(()=>c("p",{class:"heartbeat-text"},"Loading models Zoo",-1)),zmt=[Gmt,Vmt],Hmt={key:1,class:"mb-2"},qmt={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},Ymt=P(()=>c("i",{"data-feather":"chevron-up"},null,-1)),$mt=[Ymt],Wmt=P(()=>c("i",{"data-feather":"chevron-down"},null,-1)),Kmt=[Wmt],jmt={class:"mb-2"},Qmt={class:"p-2"},Xmt={class:"mb-3"},Zmt=P(()=>c("label",{class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},"Create a reference from local file path:",-1)),Jmt={key:0},egt={class:"mb-3"},tgt=P(()=>c("label",{class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},"Download from web:",-1)),ngt={key:1,class:"relative flex flex-col items-center justify-center flex-grow h-full"},igt=P(()=>c("div",{role:"status",class:"justify-center"},null,-1)),sgt={class:"relative flex flex-row flex-grow items-center w-full h-full bottom-0"},rgt={class:"w-full p-2"},ogt={class:"flex justify-between mb-1"},agt=Vb(' Downloading Loading...',1),lgt={class:"text-sm font-medium text-blue-700 dark:text-white"},cgt=["title"],dgt={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},ugt={class:"flex justify-between mb-1"},pgt={class:"text-base font-medium text-blue-700 dark:text-white"},_gt={class:"text-sm font-medium text-blue-700 dark:text-white"},hgt={class:"flex flex-grow"},fgt={class:"flex flex-row flex-grow gap-3"},mgt={class:"p-2 text-center grow"},ggt={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"},bgt={class:"flex flex-row p-3 items-center"},Egt=P(()=>c("i",{"data-feather":"chevron-right"},null,-1)),ygt=[Egt],vgt=P(()=>c("i",{"data-feather":"chevron-down"},null,-1)),Sgt=[vgt],Tgt=P(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Personalities zoo",-1)),xgt={key:0,class:"mr-2"},Cgt={class:"mr-2 font-bold font-large text-lg line-clamp-1"},wgt={key:1,class:"mr-2"},Rgt={key:2,class:"text-base font-semibold cursor-pointer select-none items-center flex flex-row"},Agt={key:0,class:"flex -space-x-4 items-center"},Ngt={class:"group items-center flex flex-row"},Ogt=["onClick"],Igt=["src","title"],Mgt=["onClick"],Dgt=P(()=>c("span",{class:"hidden group-hover:block -top-2 -right-1 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2 border-transparent",title:"Unmount personality"},[c("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"},[c("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)),kgt=[Dgt],Lgt=P(()=>c("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"},[c("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)),Pgt=[Lgt],Ugt={class:"mx-2 mb-4"},Fgt=P(()=>c("label",{for:"personality-search",class:"mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white"},"Search",-1)),Bgt={class:"relative"},Ggt={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},Vgt={key:0},zgt=P(()=>c("div",{role:"status"},[c("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"},[c("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),c("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"})]),c("span",{class:"sr-only"},"Loading...")],-1)),Hgt=[zgt],qgt={key:1},Ygt=P(()=>c("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"},[c("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)),$gt=[Ygt],Wgt={key:0,class:"mx-2 mb-4"},Kgt={for:"persCat",class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},jgt=["selected"],Qgt={key:0,class:"mb-2"},Xgt={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},Zgt=P(()=>c("i",{"data-feather":"chevron-up"},null,-1)),Jgt=[Zgt],ebt=P(()=>c("i",{"data-feather":"chevron-down"},null,-1)),tbt=[ebt],nbt={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"},ibt={class:"flex flex-row"},sbt=P(()=>c("i",{"data-feather":"chevron-right"},null,-1)),rbt=[sbt],obt=P(()=>c("i",{"data-feather":"chevron-down"},null,-1)),abt=[obt],lbt=P(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none"}," Model Configuration",-1)),cbt={class:"m-2"},dbt={class:"flex flex-row gap-2 items-center"},ubt=P(()=>c("label",{for:"override-model-parameters",class:"block text-sm font-medium"}," Override personality model parameters ",-1)),pbt={class:"m-2"},_bt=P(()=>c("label",{for:"seed",class:"block mb-2 text-sm font-medium"}," Seed: ",-1)),hbt={class:"m-2"},fbt={class:"flex flex-col align-bottom"},mbt={class:"relative"},gbt=P(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"temperature",class:"text-sm font-medium"}," Temperature: ")],-1)),bbt={class:"absolute right-0"},Ebt={class:"m-2"},ybt={class:"flex flex-col align-bottom"},vbt={class:"relative"},Sbt=P(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"predict",class:"text-sm font-medium"}," N Predict: ")],-1)),Tbt={class:"absolute right-0"},xbt={class:"m-2"},Cbt={class:"flex flex-col align-bottom"},wbt={class:"relative"},Rbt=P(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"top_k",class:"text-sm font-medium"}," Top-K: ")],-1)),Abt={class:"absolute right-0"},Nbt={class:"m-2"},Obt={class:"flex flex-col align-bottom"},Ibt={class:"relative"},Mbt=P(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"top_p",class:"text-sm font-medium"}," Top-P: ")],-1)),Dbt={class:"absolute right-0"},kbt={class:"m-2"},Lbt={class:"flex flex-col align-bottom"},Pbt={class:"relative"},Ubt=P(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"repeat_penalty",class:"text-sm font-medium"}," Repeat penalty: ")],-1)),Fbt={class:"absolute right-0"},Bbt={class:"m-2"},Gbt={class:"flex flex-col align-bottom"},Vbt={class:"relative"},zbt=P(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"repeat_last_n",class:"text-sm font-medium"}," Repeat last N: ")],-1)),Hbt={class:"absolute right-0"};function qbt(t,e,n,i,s,r){const o=mt("Card"),a=mt("BindingEntry"),l=mt("RadioOptions"),u=mt("model-entry"),d=mt("personality-entry"),h=mt("AddModelDialog"),f=mt("ChoiceDialog");return w(),A(Ye,null,[c("div",$rt,[c("div",Wrt,[s.showConfirmation?(w(),A("div",Krt,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel",type:"button",onClick:e[0]||(e[0]=be(_=>s.showConfirmation=!1,["stop"]))},Qrt),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm save changes",type:"button",onClick:e[1]||(e[1]=be(_=>r.save_configuration(),["stop"]))},Zrt)])):V("",!0),s.showConfirmation?V("",!0):(w(),A("div",Jrt,[c("button",{title:"Reset configuration",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[2]||(e[2]=_=>r.reset_configuration())},tot),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Collapse / Expand all panels",type:"button",onClick:e[3]||(e[3]=be(_=>s.all_collapsed=!s.all_collapsed,["stop"]))},iot)])),c("div",sot,[c("button",{title:"Clear uploads",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[4]||(e[4]=_=>r.api_get_req("clear_uploads").then(m=>{m.status?this.$store.state.toast.showToast("Success!",4,!0):this.$store.state.toast.showToast(["failed!"],4,!1)}))},oot),c("button",{title:"Restart program",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[5]||(e[5]=_=>r.api_post_req("restart_program").then(m=>{m.status?this.$store.state.toast.showToast("Success!",4,!0):this.$store.state.toast.showToast(["failed!"],4,!1)}))},lot),s.has_updates?(w(),A("button",{key:0,title:"Upgrade program ",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[6]||(e[6]=_=>r.api_post_req("update_software").then(m=>{m.status?this.$store.state.toast.showToast("Success!",4,!0):this.$store.state.toast.showToast("Success!",4,!0)}))},[cot,dot,et(" = ")])):V("",!0),c("div",uot,[s.settingsChanged?(w(),A("div",pot,[s.isLoading?V("",!0):(w(),A("button",{key:0,class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Apply changes",type:"button",onClick:e[7]||(e[7]=be(_=>r.applyConfiguration(),["stop"]))},hot)),s.isLoading?V("",!0):(w(),A("button",{key:1,class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Cancel changes",type:"button",onClick:e[8]||(e[8]=be(_=>r.cancelConfiguration(),["stop"]))},mot))])):V("",!0),s.isLoading?(w(),A("div",got,[c("p",null,he(s.loading_text),1),bot,Eot])):V("",!0)])])]),c("div",{class:ze(s.isLoading?"pointer-events-none opacity-30 w-full":"w-full")},[c("div",yot,[c("div",vot,[c("button",{onClick:e[9]||(e[9]=be(_=>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"},[G(c("div",null,Tot,512),[[Mt,s.sc_collapsed]]),G(c("div",null,Cot,512),[[Mt,!s.sc_collapsed]]),wot,Rot,c("div",Aot,[c("div",Not,[c("div",null,[r.vramUsage&&r.vramUsage.gpus&&r.vramUsage.gpus.length==1?(w(),A("div",Oot,[(w(!0),A(Ye,null,lt(r.vramUsage.gpus,_=>(w(),A("div",{class:"flex gap-2 items-center",key:_},[c("img",{src:s.SVGGPU,width:"25",height:"25"},null,8,Iot),c("h3",Mot,[c("div",null,he(r.computedFileSize(_.used_vram))+" / "+he(r.computedFileSize(_.total_vram))+" ("+he(_.percentage)+"%) ",1)])]))),128))])):V("",!0),r.vramUsage&&r.vramUsage.gpus&&r.vramUsage.gpus.length>1?(w(),A("div",Dot,[c("div",kot,[c("img",{src:s.SVGGPU,width:"25",height:"25"},null,8,Lot),c("h3",Pot,[c("div",null,he(r.vramUsage.gpus.length)+"x ",1)])])])):V("",!0)]),Uot,c("h3",Fot,[c("div",null,he(r.ram_usage)+" / "+he(r.ram_total_space)+" ("+he(r.ram_percent_usage)+"%)",1)]),Bot,c("h3",Got,[c("div",null,he(r.disk_binding_models_usage)+" / "+he(r.disk_total_space)+" ("+he(r.disk_percent_usage)+"%)",1)])])])])]),c("div",{class:ze([{hidden:s.sc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",Vot,[zot,c("div",Hot,[c("div",null,[qot,et(he(r.ram_available_space),1)]),c("div",null,[Yot,et(" "+he(r.ram_usage)+" / "+he(r.ram_total_space)+" ("+he(r.ram_percent_usage)+")% ",1)])]),c("div",$ot,[c("div",Wot,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:en("width: "+r.ram_percent_usage+"%;")},null,4)])])]),c("div",Kot,[jot,c("div",Qot,[c("div",null,[Xot,et(he(r.disk_available_space),1)]),c("div",null,[Zot,et(" "+he(r.disk_binding_models_usage)+" / "+he(r.disk_total_space)+" ("+he(r.disk_percent_usage)+"%)",1)])]),c("div",Jot,[c("div",eat,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:en("width: "+r.disk_percent_usage+"%;")},null,4)])])]),(w(!0),A(Ye,null,lt(r.vramUsage.gpus,_=>(w(),A("div",{class:"mb-2",key:_},[c("label",tat,[c("img",{src:s.SVGGPU,width:"25",height:"25"},null,8,nat),et(" GPU usage: ")]),c("div",iat,[c("div",null,[sat,et(he(_.gpu_model),1)]),c("div",null,[rat,et(he(this.computedFileSize(_.available_space)),1)]),c("div",null,[oat,et(" "+he(this.computedFileSize(_.used_vram))+" / "+he(this.computedFileSize(_.total_vram))+" ("+he(_.percentage)+"%)",1)])]),c("div",aat,[c("div",lat,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:en("width: "+_.percentage+"%;")},null,4)])])]))),128))],2)]),c("div",cat,[c("div",dat,[c("button",{onClick:e[10]||(e[10]=be(_=>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"},[G(c("div",null,pat,512),[[Mt,s.minconf_collapsed]]),G(c("div",null,hat,512),[[Mt,!s.minconf_collapsed]]),fat])]),c("div",{class:ze([{hidden:s.minconf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",mat,[Te(o,{title:"General",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",gat,[c("tr",null,[bat,c("td",null,[c("label",Eat,[c("img",{src:r.configFile.app_custom_logo!=null&&r.configFile.app_custom_logo!=""?"/user_infos/"+r.configFile.app_custom_logo:s.storeLogo,class:"w-50 h-50 rounded-full",style:{"max-width":"50px","max-height":"50px",cursor:"pointer"}},null,8,yat)]),c("input",{type:"file",id:"logo-upload",style:{display:"none"},onChange:e[11]||(e[11]=(..._)=>r.uploadLogo&&r.uploadLogo(..._))},null,32)]),c("td",vat,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Discard title changes",type:"button",onClick:e[12]||(e[12]=be(_=>r.resetLogo(),["stop"]))},Tat)])]),c("tr",null,[xat,c("td",Cat,[c("div",wat,[G(c("select",{id:"hardware_mode",required:"","onUpdate:modelValue":e[13]||(e[13]=_=>r.configFile.hardware_mode=_),onChange:e[14]||(e[14]=_=>s.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},Lat,544),[[jt,r.configFile.hardware_mode]])])])]),c("tr",null,[Pat,c("td",Uat,[G(c("input",{type:"text",id:"discussion_db_name",required:"","onUpdate:modelValue":e[15]||(e[15]=_=>r.configFile.discussion_db_name=_),onChange:e[16]||(e[16]=_=>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),[[we,r.configFile.discussion_db_name]])])]),c("tr",null,[Fat,c("td",null,[c("div",Bat,[G(c("input",{type:"checkbox",id:"copy_to_clipboard_add_all_details",required:"","onUpdate:modelValue":e[17]||(e[17]=_=>r.configFile.copy_to_clipboard_add_all_details=_),onChange:e[18]||(e[18]=_=>s.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.copy_to_clipboard_add_all_details]])])])]),c("tr",null,[Gat,c("td",null,[c("div",Vat,[G(c("input",{type:"checkbox",id:"auto_show_browser",required:"","onUpdate:modelValue":e[19]||(e[19]=_=>r.configFile.auto_show_browser=_),onChange:e[20]||(e[20]=_=>s.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.auto_show_browser]])])])]),c("tr",null,[zat,c("td",null,[c("div",Hat,[G(c("input",{type:"checkbox",id:"activate_debug",required:"","onUpdate:modelValue":e[21]||(e[21]=_=>r.configFile.debug=_),onChange:e[22]||(e[22]=_=>s.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.debug]])])])]),c("tr",null,[qat,c("td",null,[c("div",Yat,[G(c("input",{type:"checkbox",id:"debug_show_final_full_prompt",required:"","onUpdate:modelValue":e[23]||(e[23]=_=>r.configFile.debug_show_final_full_prompt=_),onChange:e[24]||(e[24]=_=>s.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.debug_show_final_full_prompt]])])])]),c("tr",null,[$at,c("td",null,[c("div",Wat,[G(c("input",{type:"checkbox",id:"debug_show_chunks",required:"","onUpdate:modelValue":e[25]||(e[25]=_=>r.configFile.debug_show_chunks=_),onChange:e[26]||(e[26]=_=>s.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.debug_show_chunks]])])])]),c("tr",null,[Kat,c("td",null,[c("div",jat,[G(c("input",{type:"text",id:"debug_log_file_path",required:"","onUpdate:modelValue":e[27]||(e[27]=_=>r.configFile.debug_log_file_path=_),onChange:e[28]||(e[28]=_=>s.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.debug_log_file_path]])])])]),c("tr",null,[Qat,c("td",null,[c("div",Xat,[G(c("input",{type:"checkbox",id:"show_news_panel",required:"","onUpdate:modelValue":e[29]||(e[29]=_=>r.configFile.show_news_panel=_),onChange:e[30]||(e[30]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.show_news_panel]])])])]),c("tr",null,[Zat,c("td",null,[c("div",Jat,[G(c("input",{type:"checkbox",id:"auto_save",required:"","onUpdate:modelValue":e[31]||(e[31]=_=>r.configFile.auto_save=_),onChange:e[32]||(e[32]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.auto_save]])])])]),c("tr",null,[elt,c("td",null,[c("div",tlt,[G(c("input",{type:"checkbox",id:"auto_update",required:"","onUpdate:modelValue":e[33]||(e[33]=_=>r.configFile.auto_update=_),onChange:e[34]||(e[34]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.auto_update]])])])]),c("tr",null,[nlt,c("td",null,[c("div",ilt,[G(c("input",{type:"checkbox",id:"auto_title",required:"","onUpdate:modelValue":e[35]||(e[35]=_=>r.configFile.auto_title=_),onChange:e[36]||(e[36]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.auto_title]])])])])])]),_:1}),Te(o,{title:"Model template",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",slt,[c("tr",null,[rlt,c("td",null,[c("select",{onChange:e[37]||(e[37]=(..._)=>r.handleTemplateSelection&&r.handleTemplateSelection(..._))},dlt,32)])]),c("tr",null,[ult,c("td",null,[G(c("input",{type:"text",id:"start_header_id_template",required:"","onUpdate:modelValue":e[38]||(e[38]=_=>r.configFile.start_header_id_template=_),onChange:e[39]||(e[39]=_=>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),[[we,r.configFile.start_header_id_template]])])]),c("tr",null,[plt,c("td",null,[G(c("input",{type:"text",id:"end_header_id_template",required:"","onUpdate:modelValue":e[40]||(e[40]=_=>r.configFile.end_header_id_template=_),onChange:e[41]||(e[41]=_=>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),[[we,r.configFile.end_header_id_template]])])]),c("tr",null,[_lt,c("td",null,[G(c("input",{type:"text",id:"start_user_header_id_template",required:"","onUpdate:modelValue":e[42]||(e[42]=_=>r.configFile.start_user_header_id_template=_),onChange:e[43]||(e[43]=_=>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),[[we,r.configFile.start_user_header_id_template]])])]),c("tr",null,[hlt,c("td",null,[G(c("input",{type:"text",id:"end_user_header_id_template",required:"","onUpdate:modelValue":e[44]||(e[44]=_=>r.configFile.end_user_header_id_template=_),onChange:e[45]||(e[45]=_=>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),[[we,r.configFile.end_user_header_id_template]])])]),c("tr",null,[flt,c("td",null,[G(c("input",{type:"text",id:"end_user_message_id_template",required:"","onUpdate:modelValue":e[46]||(e[46]=_=>r.configFile.end_user_message_id_template=_),onChange:e[47]||(e[47]=_=>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),[[we,r.configFile.end_user_message_id_template]])])]),c("tr",null,[mlt,c("td",null,[G(c("input",{type:"text",id:"start_ai_header_id_template",required:"","onUpdate:modelValue":e[48]||(e[48]=_=>r.configFile.start_ai_header_id_template=_),onChange:e[49]||(e[49]=_=>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),[[we,r.configFile.start_ai_header_id_template]])])]),c("tr",null,[glt,c("td",null,[G(c("input",{type:"text",id:"end_ai_header_id_template",required:"","onUpdate:modelValue":e[50]||(e[50]=_=>r.configFile.end_ai_header_id_template=_),onChange:e[51]||(e[51]=_=>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),[[we,r.configFile.end_ai_header_id_template]])])]),c("tr",null,[blt,c("td",null,[G(c("input",{type:"text",id:"end_ai_message_id_template",required:"","onUpdate:modelValue":e[52]||(e[52]=_=>r.configFile.end_ai_message_id_template=_),onChange:e[53]||(e[53]=_=>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),[[we,r.configFile.end_ai_message_id_template]])])]),c("tr",null,[Elt,c("td",null,[G(c("textarea",{id:"separator_template",required:"","onUpdate:modelValue":e[54]||(e[54]=_=>r.configFile.separator_template=_),onChange:e[55]||(e[55]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.separator_template]])])]),c("tr",null,[ylt,c("td",null,[G(c("input",{type:"text",id:"system_message_template",required:"","onUpdate:modelValue":e[56]||(e[56]=_=>r.configFile.system_message_template=_),onChange:e[57]||(e[57]=_=>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),[[we,r.configFile.system_message_template]])])]),c("tr",null,[vlt,c("td",null,[c("div",{innerHTML:r.full_template},null,8,Slt)])])])]),_:1}),Te(o,{title:"User",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",Tlt,[c("tr",null,[xlt,c("td",Clt,[G(c("input",{type:"text",id:"user_name",required:"","onUpdate:modelValue":e[58]||(e[58]=_=>r.configFile.user_name=_),onChange:e[59]||(e[59]=_=>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),[[we,r.configFile.user_name]])])]),c("tr",null,[wlt,c("td",Rlt,[G(c("textarea",{id:"user_description",required:"","onUpdate:modelValue":e[60]||(e[60]=_=>r.configFile.user_description=_),onChange:e[61]||(e[61]=_=>s.settingsChanged=!0),class:"min-h-[500px] w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.user_description]])])]),c("tr",null,[Alt,c("td",Nlt,[G(c("input",{type:"checkbox",id:"use_user_informations_in_discussion",required:"","onUpdate:modelValue":e[62]||(e[62]=_=>r.configFile.use_user_informations_in_discussion=_),onChange:e[63]||(e[63]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.use_user_informations_in_discussion]])])]),c("tr",null,[Olt,c("td",Ilt,[G(c("input",{type:"checkbox",id:"use_model_name_in_discussions",required:"","onUpdate:modelValue":e[64]||(e[64]=_=>r.configFile.use_model_name_in_discussions=_),onChange:e[65]||(e[65]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.use_model_name_in_discussions]])])]),c("tr",null,[Mlt,c("td",null,[c("label",Dlt,[c("img",{src:r.configFile.user_avatar!=null&&r.configFile.user_avatar!=""?"/user_infos/"+r.configFile.user_avatar:s.storeLogo,class:"w-50 h-50 rounded-full",style:{"max-width":"50px","max-height":"50px",cursor:"pointer"}},null,8,klt)]),c("input",{type:"file",id:"avatar-upload",style:{display:"none"},onChange:e[66]||(e[66]=(..._)=>r.uploadAvatar&&r.uploadAvatar(..._))},null,32)]),c("td",Llt,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Discard title changes",type:"button",onClick:e[67]||(e[67]=be(_=>r.resetAvatar(),["stop"]))},Ult)])]),c("tr",null,[Flt,c("td",null,[c("div",Blt,[G(c("input",{type:"checkbox",id:"use_user_name_in_discussions",required:"","onUpdate:modelValue":e[68]||(e[68]=_=>r.configFile.use_user_name_in_discussions=_),onChange:e[69]||(e[69]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.use_user_name_in_discussions]])])])]),c("tr",null,[Glt,c("td",Vlt,[G(c("input",{type:"number",id:"max_n_predict",required:"","onUpdate:modelValue":e[70]||(e[70]=_=>r.configFile.max_n_predict=_),onChange:e[71]||(e[71]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.max_n_predict]])])]),c("tr",null,[zlt,c("td",Hlt,[G(c("input",{type:"number",id:"max_n_predict",required:"","onUpdate:modelValue":e[72]||(e[72]=_=>r.configFile.max_n_predict=_),onChange:e[73]||(e[73]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.max_n_predict]])])])])]),_:1}),Te(o,{title:"Security settings",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",qlt,[c("tr",null,[Ylt,c("td",$lt,[G(c("input",{type:"checkbox",id:"turn_on_code_execution",required:"","onUpdate:modelValue":e[74]||(e[74]=_=>r.configFile.turn_on_code_execution=_),onChange:e[75]||(e[75]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.turn_on_code_execution]])])]),c("tr",null,[Wlt,c("td",Klt,[G(c("input",{type:"checkbox",id:"turn_on_code_validation",required:"","onUpdate:modelValue":e[76]||(e[76]=_=>r.configFile.turn_on_code_validation=_),onChange:e[77]||(e[77]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.turn_on_code_validation]])])]),c("tr",null,[jlt,c("td",Qlt,[G(c("input",{type:"checkbox",id:"turn_on_setting_update_validation",required:"","onUpdate:modelValue":e[78]||(e[78]=_=>r.configFile.turn_on_setting_update_validation=_),onChange:e[79]||(e[79]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.turn_on_setting_update_validation]])])]),c("tr",null,[Xlt,c("td",Zlt,[G(c("input",{type:"checkbox",id:"turn_on_open_file_validation",required:"","onUpdate:modelValue":e[80]||(e[80]=_=>r.configFile.turn_on_open_file_validation=_),onChange:e[81]||(e[81]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.turn_on_open_file_validation]])])]),c("tr",null,[Jlt,c("td",ect,[G(c("input",{type:"checkbox",id:"turn_on_send_file_validation",required:"","onUpdate:modelValue":e[82]||(e[82]=_=>r.configFile.turn_on_send_file_validation=_),onChange:e[83]||(e[83]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.turn_on_send_file_validation]])])])])]),_:1}),Te(o,{title:"Knowledge database",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",tct,[c("tr",null,[nct,c("td",null,[c("div",ict,[G(c("input",{type:"checkbox",id:"activate_skills_lib",required:"","onUpdate:modelValue":e[84]||(e[84]=_=>r.configFile.activate_skills_lib=_),onChange:e[85]||(e[85]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.activate_skills_lib]])])])]),c("tr",null,[sct,c("td",rct,[G(c("input",{type:"text",id:"skills_lib_database_name",required:"","onUpdate:modelValue":e[86]||(e[86]=_=>r.configFile.skills_lib_database_name=_),onChange:e[87]||(e[87]=_=>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),[[we,r.configFile.skills_lib_database_name]])])])])]),_:1}),Te(o,{title:"Latex",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",oct,[c("tr",null,[act,c("td",null,[c("div",lct,[G(c("input",{type:"text",id:"pdf_latex_path",required:"","onUpdate:modelValue":e[88]||(e[88]=_=>r.configFile.pdf_latex_path=_),onChange:e[89]||(e[89]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.pdf_latex_path]])])])])])]),_:1}),Te(o,{title:"Boost",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",cct,[c("tr",null,[dct,c("td",null,[c("div",uct,[G(c("input",{type:"text",id:"positive_boost",required:"","onUpdate:modelValue":e[90]||(e[90]=_=>r.configFile.positive_boost=_),onChange:e[91]||(e[91]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.positive_boost]])])])]),c("tr",null,[pct,c("td",null,[c("div",_ct,[G(c("input",{type:"text",id:"negative_boost",required:"","onUpdate:modelValue":e[92]||(e[92]=_=>r.configFile.negative_boost=_),onChange:e[93]||(e[93]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.negative_boost]])])])]),c("tr",null,[hct,c("td",null,[c("div",fct,[G(c("input",{type:"checkbox",id:"fun_mode",required:"","onUpdate:modelValue":e[94]||(e[94]=_=>r.configFile.fun_mode=_),onChange:e[95]||(e[95]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.fun_mode]])])])])])]),_:1})])],2)]),c("div",mct,[c("div",gct,[c("button",{onClick:e[96]||(e[96]=be(_=>s.data_conf_collapsed=!s.data_conf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[G(c("div",null,Ect,512),[[Mt,s.data_conf_collapsed]]),G(c("div",null,vct,512),[[Mt,!s.data_conf_collapsed]]),Sct])]),c("div",{class:ze([{hidden:s.data_conf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[Te(o,{title:"Data Sources",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",Tct,[c("tr",null,[xct,c("td",Cct,[(w(!0),A(Ye,null,lt(r.configFile.rag_databases,(_,m)=>(w(),A("div",{key:m,class:"flex items-center mb-2"},[G(c("input",{type:"text","onUpdate:modelValue":E=>r.configFile.rag_databases[m]=E,onChange:e[97]||(e[97]=E=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,40,wct),[[we,r.configFile.rag_databases[m]]]),c("button",{onClick:E=>r.vectorize_folder(m),class:"w-500 ml-2 px-2 py-1 bg-green-500 text-white hover:bg-green-300 rounded"},"(Re)Vectorize",8,Rct),c("button",{onClick:E=>r.select_folder(m),class:"w-500 ml-2 px-2 py-1 bg-blue-500 text-white hover:bg-green-300 rounded"},"Select Folder",8,Act),c("button",{onClick:E=>r.removeDataSource(m),class:"ml-2 px-2 py-1 bg-red-500 text-white hover:bg-green-300 rounded"},"Remove",8,Nct)]))),128)),c("button",{onClick:e[98]||(e[98]=(..._)=>r.addDataSource&&r.addDataSource(..._)),class:"mt-2 px-2 py-1 bg-blue-500 text-white rounded"},"Add Data Source")])]),c("tr",null,[Oct,c("td",null,[G(c("select",{id:"rag_vectorizer",required:"","onUpdate:modelValue":e[99]||(e[99]=_=>r.configFile.rag_vectorizer=_),onChange:e[100]||(e[100]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},kct,544),[[jt,r.configFile.rag_vectorizer]])])]),c("tr",null,[Lct,c("td",null,[G(c("select",{id:"rag_vectorizer_model",required:"","onUpdate:modelValue":e[101]||(e[101]=_=>r.configFile.rag_vectorizer_model=_),onChange:e[102]||(e[102]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},Uct,544),[[jt,r.configFile.rag_vectorizer_model]])])]),c("tr",null,[Fct,c("td",null,[G(c("input",{id:"rag_chunk_size","onUpdate:modelValue":e[103]||(e[103]=_=>r.configFile.rag_chunk_size=_),onChange:e[104]||(e[104]=_=>s.settingsChanged=!0),type:"range",min:"2",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),[[we,r.configFile.rag_chunk_size]]),G(c("input",{"onUpdate:modelValue":e[105]||(e[105]=_=>r.configFile.rag_chunk_size=_),type:"number",onChange:e[106]||(e[106]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.rag_chunk_size]])])]),c("tr",null,[Bct,c("td",null,[G(c("input",{id:"rag_overlap","onUpdate:modelValue":e[107]||(e[107]=_=>r.configFile.rag_overlap=_),onChange:e[108]||(e[108]=_=>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),[[we,r.configFile.rag_overlap]]),G(c("input",{"onUpdate:modelValue":e[109]||(e[109]=_=>r.configFile.rag_overlap=_),type:"number",onChange:e[110]||(e[110]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.rag_overlap]])])]),c("tr",null,[Gct,c("td",null,[G(c("input",{id:"rag_n_chunks","onUpdate:modelValue":e[111]||(e[111]=_=>r.configFile.rag_n_chunks=_),onChange:e[112]||(e[112]=_=>s.settingsChanged=!0),type:"range",min:"2",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),[[we,r.configFile.rag_n_chunks]]),G(c("input",{"onUpdate:modelValue":e[113]||(e[113]=_=>r.configFile.rag_n_chunks=_),type:"number",onChange:e[114]||(e[114]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.rag_n_chunks]])])]),c("tr",null,[Vct,c("td",null,[G(c("input",{"onUpdate:modelValue":e[115]||(e[115]=_=>r.configFile.rag_clean_chunks=_),type:"checkbox",onChange:e[116]||(e[116]=_=>s.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.rag_clean_chunks]])])]),c("tr",null,[zct,c("td",null,[G(c("input",{"onUpdate:modelValue":e[117]||(e[117]=_=>r.configFile.rag_follow_subfolders=_),type:"checkbox",onChange:e[118]||(e[118]=_=>s.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.rag_follow_subfolders]])])]),c("tr",null,[Hct,c("td",null,[G(c("input",{"onUpdate:modelValue":e[119]||(e[119]=_=>r.configFile.rag_check_new_files_at_startup=_),type:"checkbox",onChange:e[120]||(e[120]=_=>s.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.rag_check_new_files_at_startup]])])]),c("tr",null,[qct,c("td",null,[G(c("input",{"onUpdate:modelValue":e[121]||(e[121]=_=>r.configFile.rag_preprocess_chunks=_),type:"checkbox",onChange:e[122]||(e[122]=_=>s.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.rag_preprocess_chunks]])])]),c("tr",null,[Yct,c("td",null,[G(c("input",{"onUpdate:modelValue":e[123]||(e[123]=_=>r.configFile.rag_activate_multi_hops=_),type:"checkbox",onChange:e[124]||(e[124]=_=>s.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.rag_activate_multi_hops]])])]),c("tr",null,[$ct,c("td",null,[G(c("input",{"onUpdate:modelValue":e[125]||(e[125]=_=>r.configFile.contextual_summary=_),type:"checkbox",onChange:e[126]||(e[126]=_=>s.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.contextual_summary]])])])])]),_:1}),Te(o,{title:"Data Vectorization",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",Wct,[c("tr",null,[Kct,c("td",null,[c("div",jct,[G(c("input",{type:"checkbox",id:"data_vectorization_save_db",required:"","onUpdate:modelValue":e[127]||(e[127]=_=>r.configFile.data_vectorization_save_db=_),onChange:e[128]||(e[128]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.data_vectorization_save_db]])])])]),c("tr",null,[Qct,c("td",null,[c("div",Xct,[G(c("input",{type:"checkbox",id:"data_vectorization_visualize_on_vectorization",required:"","onUpdate:modelValue":e[129]||(e[129]=_=>r.configFile.data_vectorization_visualize_on_vectorization=_),onChange:e[130]||(e[130]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.data_vectorization_visualize_on_vectorization]])])])]),c("tr",null,[Zct,c("td",null,[c("div",Jct,[G(c("input",{type:"checkbox",id:"data_vectorization_build_keys_words",required:"","onUpdate:modelValue":e[131]||(e[131]=_=>r.configFile.data_vectorization_build_keys_words=_),onChange:e[132]||(e[132]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.data_vectorization_build_keys_words]])])])]),c("tr",null,[edt,c("td",null,[c("div",tdt,[G(c("input",{type:"checkbox",id:"data_vectorization_force_first_chunk",required:"","onUpdate:modelValue":e[133]||(e[133]=_=>r.configFile.data_vectorization_force_first_chunk=_),onChange:e[134]||(e[134]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.data_vectorization_force_first_chunk]])])])]),c("tr",null,[ndt,c("td",null,[c("div",idt,[G(c("input",{type:"checkbox",id:"data_vectorization_put_chunk_informations_into_context",required:"","onUpdate:modelValue":e[135]||(e[135]=_=>r.configFile.data_vectorization_put_chunk_informations_into_context=_),onChange:e[136]||(e[136]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.data_vectorization_put_chunk_informations_into_context]])])])]),c("tr",null,[sdt,c("td",null,[G(c("select",{id:"data_vectorization_method",required:"","onUpdate:modelValue":e[137]||(e[137]=_=>r.configFile.data_vectorization_method=_),onChange:e[138]||(e[138]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},cdt,544),[[jt,r.configFile.data_vectorization_method]])])]),c("tr",null,[ddt,c("td",udt,[G(c("input",{type:"text",id:"data_vectorization_sentense_transformer_model",required:"","onUpdate:modelValue":e[139]||(e[139]=_=>r.configFile.data_vectorization_sentense_transformer_model=_),onChange:e[140]||(e[140]=_=>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),[[we,r.configFile.data_vectorization_sentense_transformer_model]])])]),c("tr",null,[pdt,c("td",null,[G(c("select",{id:"data_visualization_method",required:"","onUpdate:modelValue":e[141]||(e[141]=_=>r.configFile.data_visualization_method=_),onChange:e[142]||(e[142]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},fdt,544),[[jt,r.configFile.data_visualization_method]])])]),c("tr",null,[mdt,c("td",null,[c("div",gdt,[G(c("input",{type:"checkbox",id:"data_vectorization_save_db",required:"","onUpdate:modelValue":e[143]||(e[143]=_=>r.configFile.data_vectorization_save_db=_),onChange:e[144]||(e[144]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.data_vectorization_save_db]])])])]),c("tr",null,[bdt,c("td",null,[G(c("input",{id:"data_vectorization_chunk_size","onUpdate:modelValue":e[145]||(e[145]=_=>r.configFile.data_vectorization_chunk_size=_),onChange:e[146]||(e[146]=_=>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),[[we,r.configFile.data_vectorization_chunk_size]]),G(c("input",{"onUpdate:modelValue":e[147]||(e[147]=_=>r.configFile.data_vectorization_chunk_size=_),type:"number",onChange:e[148]||(e[148]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.data_vectorization_chunk_size]])])]),c("tr",null,[Edt,c("td",null,[G(c("input",{id:"data_vectorization_overlap_size","onUpdate:modelValue":e[149]||(e[149]=_=>r.configFile.data_vectorization_overlap_size=_),onChange:e[150]||(e[150]=_=>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),[[we,r.configFile.data_vectorization_overlap_size]]),G(c("input",{"onUpdate:modelValue":e[151]||(e[151]=_=>r.configFile.data_vectorization_overlap_size=_),type:"number",onChange:e[152]||(e[152]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.data_vectorization_overlap_size]])])]),c("tr",null,[ydt,c("td",null,[G(c("input",{id:"data_vectorization_nb_chunks","onUpdate:modelValue":e[153]||(e[153]=_=>r.configFile.data_vectorization_nb_chunks=_),onChange:e[154]||(e[154]=_=>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),[[we,r.configFile.data_vectorization_nb_chunks]]),G(c("input",{"onUpdate:modelValue":e[155]||(e[155]=_=>r.configFile.data_vectorization_nb_chunks=_),type:"number",onChange:e[156]||(e[156]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.data_vectorization_nb_chunks]])])])])]),_:1})],2)]),c("div",vdt,[c("div",Sdt,[c("button",{onClick:e[157]||(e[157]=be(_=>s.internet_conf_collapsed=!s.internet_conf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[G(c("div",null,xdt,512),[[Mt,s.internet_conf_collapsed]]),G(c("div",null,wdt,512),[[Mt,!s.internet_conf_collapsed]]),Rdt])]),c("div",{class:ze([{hidden:s.internet_conf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[Te(o,{title:"Internet search",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",Adt,[c("tr",null,[Ndt,c("td",null,[c("div",Odt,[G(c("input",{type:"checkbox",id:"fun_mode",required:"","onUpdate:modelValue":e[158]||(e[158]=_=>r.configFile.activate_internet_search=_),onChange:e[159]||(e[159]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.activate_internet_search]])])])]),c("tr",null,[Idt,c("td",null,[c("div",Mdt,[G(c("input",{type:"checkbox",id:"activate_internet_pages_judgement",required:"","onUpdate:modelValue":e[160]||(e[160]=_=>r.configFile.activate_internet_pages_judgement=_),onChange:e[161]||(e[161]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.activate_internet_pages_judgement]])])])]),c("tr",null,[Ddt,c("td",null,[c("div",kdt,[G(c("input",{type:"checkbox",id:"internet_quick_search",required:"","onUpdate:modelValue":e[162]||(e[162]=_=>r.configFile.internet_quick_search=_),onChange:e[163]||(e[163]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.internet_quick_search]])])])]),c("tr",null,[Ldt,c("td",null,[c("div",Pdt,[G(c("input",{type:"checkbox",id:"internet_activate_search_decision",required:"","onUpdate:modelValue":e[164]||(e[164]=_=>r.configFile.internet_activate_search_decision=_),onChange:e[165]||(e[165]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.internet_activate_search_decision]])])])]),c("tr",null,[Udt,c("td",null,[c("div",Fdt,[G(c("input",{id:"internet_vectorization_chunk_size","onUpdate:modelValue":e[166]||(e[166]=_=>r.configFile.internet_vectorization_chunk_size=_),onChange:e[167]||(e[167]=_=>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),[[we,r.configFile.internet_vectorization_chunk_size]]),G(c("input",{"onUpdate:modelValue":e[168]||(e[168]=_=>r.configFile.internet_vectorization_chunk_size=_),type:"number",onChange:e[169]||(e[169]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.internet_vectorization_chunk_size]])])])]),c("tr",null,[Bdt,c("td",null,[c("div",Gdt,[G(c("input",{id:"internet_vectorization_overlap_size","onUpdate:modelValue":e[170]||(e[170]=_=>r.configFile.internet_vectorization_overlap_size=_),onChange:e[171]||(e[171]=_=>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),[[we,r.configFile.internet_vectorization_overlap_size]]),G(c("input",{"onUpdate:modelValue":e[172]||(e[172]=_=>r.configFile.internet_vectorization_overlap_size=_),type:"number",onChange:e[173]||(e[173]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.internet_vectorization_overlap_size]])])])]),c("tr",null,[Vdt,c("td",null,[c("div",zdt,[G(c("input",{id:"internet_vectorization_nb_chunks","onUpdate:modelValue":e[174]||(e[174]=_=>r.configFile.internet_vectorization_nb_chunks=_),onChange:e[175]||(e[175]=_=>s.settingsChanged=!0),type:"range",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),[[we,r.configFile.internet_vectorization_nb_chunks]]),G(c("input",{"onUpdate:modelValue":e[176]||(e[176]=_=>r.configFile.internet_vectorization_nb_chunks=_),type:"number",onChange:e[177]||(e[177]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.internet_vectorization_nb_chunks]])])])]),c("tr",null,[Hdt,c("td",null,[c("div",qdt,[G(c("input",{id:"internet_nb_search_pages","onUpdate:modelValue":e[178]||(e[178]=_=>r.configFile.internet_nb_search_pages=_),onChange:e[179]||(e[179]=_=>s.settingsChanged=!0),type:"range",min:"1",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),[[we,r.configFile.internet_nb_search_pages]]),G(c("input",{"onUpdate:modelValue":e[180]||(e[180]=_=>r.configFile.internet_nb_search_pages=_),type:"number",onChange:e[181]||(e[181]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.internet_nb_search_pages]])])])])])]),_:1})],2)]),c("div",Ydt,[c("div",$dt,[c("button",{onClick:e[182]||(e[182]=be(_=>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"},[G(c("div",null,Kdt,512),[[Mt,s.servers_conf_collapsed]]),G(c("div",null,Qdt,512),[[Mt,!s.servers_conf_collapsed]]),Xdt])]),c("div",{class:ze([{hidden:s.servers_conf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[Te(o,{title:"Default services selection",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",Zdt,[c("tr",null,[Jdt,c("td",eut,[G(c("select",{id:"active_tts_service",required:"","onUpdate:modelValue":e[183]||(e[183]=_=>r.configFile.active_tts_service=_),onChange:e[184]||(e[184]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},rut,544),[[jt,r.configFile.active_tts_service]])])]),c("tr",null,[out,c("td",aut,[G(c("select",{id:"active_stt_service",required:"","onUpdate:modelValue":e[185]||(e[185]=_=>r.configFile.active_stt_service=_),onChange:e[186]||(e[186]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},uut,544),[[jt,r.configFile.active_stt_service]])])]),put,c("tr",null,[_ut,c("td",hut,[G(c("select",{id:"active_tti_service",required:"","onUpdate:modelValue":e[187]||(e[187]=_=>r.configFile.active_tti_service=_),onChange:e[188]||(e[188]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},Sut,544),[[jt,r.configFile.active_tti_service]])])]),c("tr",null,[Tut,c("td",xut,[G(c("select",{id:"active_ttm_service",required:"","onUpdate:modelValue":e[189]||(e[189]=_=>r.configFile.active_ttm_service=_),onChange:e[190]||(e[190]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},Rut,544),[[jt,r.configFile.active_ttm_service]])])])])]),_:1}),Te(o,{title:"TTI settings",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",Aut,[c("tr",null,[Nut,c("td",null,[c("div",Out,[G(c("input",{type:"checkbox",id:"use_negative_prompt",required:"","onUpdate:modelValue":e[191]||(e[191]=_=>r.configFile.use_negative_prompt=_),onChange:e[192]||(e[192]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.use_negative_prompt]])])])]),c("tr",null,[Iut,c("td",null,[c("div",Mut,[G(c("input",{type:"checkbox",id:"use_ai_generated_negative_prompt",required:"","onUpdate:modelValue":e[193]||(e[193]=_=>r.configFile.use_ai_generated_negative_prompt=_),onChange:e[194]||(e[194]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.use_ai_generated_negative_prompt]])])])]),c("tr",null,[Dut,c("td",null,[c("div",kut,[G(c("input",{type:"text",id:"negative_prompt_generation_prompt",required:"","onUpdate:modelValue":e[195]||(e[195]=_=>r.configFile.negative_prompt_generation_prompt=_),onChange:e[196]||(e[196]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.negative_prompt_generation_prompt]])])])]),c("tr",null,[Lut,c("td",null,[c("div",Put,[G(c("input",{type:"text",id:"default_negative_prompt",required:"","onUpdate:modelValue":e[197]||(e[197]=_=>r.configFile.default_negative_prompt=_),onChange:e[198]||(e[198]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.default_negative_prompt]])])])])])]),_:1}),Te(o,{title:"Full Audio settings",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",Uut,[c("tr",null,[Fut,c("td",But,[G(c("input",{type:"number",step:"1",id:"stt_listening_threshold",required:"","onUpdate:modelValue":e[199]||(e[199]=_=>r.configFile.stt_listening_threshold=_),onChange:e[200]||(e[200]=_=>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),[[we,r.configFile.stt_listening_threshold]])])]),c("tr",null,[Gut,c("td",Vut,[G(c("input",{type:"number",step:"1",id:"stt_silence_duration",required:"","onUpdate:modelValue":e[201]||(e[201]=_=>r.configFile.stt_silence_duration=_),onChange:e[202]||(e[202]=_=>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),[[we,r.configFile.stt_silence_duration]])])]),c("tr",null,[zut,c("td",Hut,[G(c("input",{type:"number",step:"1",id:"stt_sound_threshold_percentage",required:"","onUpdate:modelValue":e[203]||(e[203]=_=>r.configFile.stt_sound_threshold_percentage=_),onChange:e[204]||(e[204]=_=>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),[[we,r.configFile.stt_sound_threshold_percentage]])])]),c("tr",null,[qut,c("td",Yut,[G(c("input",{type:"number",step:"1",id:"stt_gain",required:"","onUpdate:modelValue":e[205]||(e[205]=_=>r.configFile.stt_gain=_),onChange:e[206]||(e[206]=_=>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),[[we,r.configFile.stt_gain]])])]),c("tr",null,[$ut,c("td",Wut,[G(c("input",{type:"number",step:"1",id:"stt_rate",required:"","onUpdate:modelValue":e[207]||(e[207]=_=>r.configFile.stt_rate=_),onChange:e[208]||(e[208]=_=>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),[[we,r.configFile.stt_rate]])])]),c("tr",null,[Kut,c("td",jut,[G(c("input",{type:"number",step:"1",id:"stt_channels",required:"","onUpdate:modelValue":e[209]||(e[209]=_=>r.configFile.stt_channels=_),onChange:e[210]||(e[210]=_=>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),[[we,r.configFile.stt_channels]])])]),c("tr",null,[Qut,c("td",Xut,[G(c("input",{type:"number",step:"1",id:"stt_buffer_size",required:"","onUpdate:modelValue":e[211]||(e[211]=_=>r.configFile.stt_buffer_size=_),onChange:e[212]||(e[212]=_=>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),[[we,r.configFile.stt_buffer_size]])])]),c("tr",null,[Zut,c("td",null,[c("div",Jut,[G(c("input",{type:"checkbox",id:"stt_activate_word_detection",required:"","onUpdate:modelValue":e[213]||(e[213]=_=>r.configFile.stt_activate_word_detection=_),onChange:e[214]||(e[214]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.stt_activate_word_detection]])])])]),c("tr",null,[ept,c("td",null,[c("div",tpt,[G(c("input",{type:"text",id:"stt_word_detection_file",required:"","onUpdate:modelValue":e[215]||(e[215]=_=>r.configFile.stt_word_detection_file=_),onChange:e[216]||(e[216]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.stt_word_detection_file]])])])])])]),_:1}),Te(o,{title:"Audio devices settings",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",npt,[c("tr",null,[ipt,c("td",spt,[G(c("select",{id:"stt_input_device",required:"","onUpdate:modelValue":e[217]||(e[217]=_=>r.configFile.stt_input_device=_),onChange:e[218]||(e[218]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(w(!0),A(Ye,null,lt(s.snd_input_devices,(_,m)=>(w(),A("option",{key:_,value:s.snd_input_devices_indexes[m]},he(_),9,rpt))),128))],544),[[jt,r.configFile.stt_input_device]])])]),c("tr",null,[opt,c("td",apt,[G(c("select",{id:"tts_output_device",required:"","onUpdate:modelValue":e[219]||(e[219]=_=>r.configFile.tts_output_device=_),onChange:e[220]||(e[220]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(w(!0),A(Ye,null,lt(s.snd_output_devices,(_,m)=>(w(),A("option",{key:_,value:s.snd_output_devices_indexes[m]},he(_),9,lpt))),128))],544),[[jt,r.configFile.tts_output_device]])])])])]),_:1}),Te(o,{title:"Lollms service",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",cpt,[c("tr",null,[dpt,c("td",upt,[G(c("input",{type:"text",id:"host",required:"","onUpdate:modelValue":e[221]||(e[221]=_=>r.configFile.host=_),onChange:e[222]||(e[222]=_=>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),[[we,r.configFile.host]])])]),c("tr",null,[ppt,c("td",_pt,[G(c("input",{type:"text",id:"lollms_access_keys",required:"","onUpdate:modelValue":e[223]||(e[223]=_=>r.configFile.lollms_access_keys=_),onChange:e[224]||(e[224]=_=>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),[[we,r.configFile.lollms_access_keys]])])]),c("tr",null,[hpt,c("td",fpt,[G(c("input",{type:"number",step:"1",id:"port",required:"","onUpdate:modelValue":e[225]||(e[225]=_=>r.configFile.port=_),onChange:e[226]||(e[226]=_=>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),[[we,r.configFile.port]])])]),c("tr",null,[mpt,c("td",gpt,[G(c("input",{type:"checkbox",id:"headless_server_mode",required:"","onUpdate:modelValue":e[227]||(e[227]=_=>r.configFile.headless_server_mode=_),onChange:e[228]||(e[228]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Ze,r.configFile.headless_server_mode]])])]),c("tr",null,[bpt,c("td",Ept,[G(c("input",{type:"checkbox",id:"activate_lollms_server",required:"","onUpdate:modelValue":e[229]||(e[229]=_=>r.configFile.activate_lollms_server=_),onChange:e[230]||(e[230]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Ze,r.configFile.activate_lollms_server]])])]),c("tr",null,[ypt,c("td",vpt,[G(c("input",{type:"checkbox",id:"activate_ollama_emulator",required:"","onUpdate:modelValue":e[231]||(e[231]=_=>r.configFile.activate_ollama_emulator=_),onChange:e[232]||(e[232]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Ze,r.configFile.activate_ollama_emulator]])])]),c("tr",null,[Spt,c("td",Tpt,[G(c("input",{type:"checkbox",id:"activate_openai_emulator",required:"","onUpdate:modelValue":e[233]||(e[233]=_=>r.configFile.activate_openai_emulator=_),onChange:e[234]||(e[234]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Ze,r.configFile.activate_openai_emulator]])])]),c("tr",null,[xpt,c("td",Cpt,[G(c("input",{type:"checkbox",id:"activate_mistralai_emulator",required:"","onUpdate:modelValue":e[235]||(e[235]=_=>r.configFile.activate_mistralai_emulator=_),onChange:e[236]||(e[236]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Ze,r.configFile.activate_mistralai_emulator]])])])])]),_:1}),Te(o,{title:"STT services",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[Te(o,{title:"Browser Audio STT",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",wpt,[c("tr",null,[Rpt,c("td",null,[c("div",Apt,[G(c("input",{type:"checkbox",id:"activate_audio_infos",required:"","onUpdate:modelValue":e[237]||(e[237]=_=>r.configFile.activate_audio_infos=_),onChange:e[238]||(e[238]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.activate_audio_infos]])])])]),c("tr",null,[Npt,c("td",null,[c("div",Opt,[G(c("input",{type:"checkbox",id:"audio_auto_send_input",required:"","onUpdate:modelValue":e[239]||(e[239]=_=>r.configFile.audio_auto_send_input=_),onChange:e[240]||(e[240]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.audio_auto_send_input]])])])]),c("tr",null,[Ipt,c("td",null,[G(c("input",{id:"audio_silenceTimer","onUpdate:modelValue":e[241]||(e[241]=_=>r.configFile.audio_silenceTimer=_),onChange:e[242]||(e[242]=_=>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),[[we,r.configFile.audio_silenceTimer]]),G(c("input",{"onUpdate:modelValue":e[243]||(e[243]=_=>r.configFile.audio_silenceTimer=_),onChange:e[244]||(e[244]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.audio_silenceTimer]])])]),c("tr",null,[Mpt,c("td",null,[G(c("select",{id:"audio_in_language","onUpdate:modelValue":e[245]||(e[245]=_=>r.configFile.audio_in_language=_),onChange:e[246]||(e[246]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(w(!0),A(Ye,null,lt(r.audioLanguages,_=>(w(),A("option",{key:_.code,value:_.code},he(_.name),9,Dpt))),128))],544),[[jt,r.configFile.audio_in_language]])])])])]),_:1}),Te(o,{title:"Whisper audio transcription",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",kpt,[c("tr",null,[Lpt,c("td",null,[c("div",Ppt,[G(c("input",{type:"checkbox",id:"whisper_activate",required:"","onUpdate:modelValue":e[247]||(e[247]=_=>r.configFile.whisper_activate=_),onChange:e[248]||(e[248]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.whisper_activate]])])])]),c("tr",null,[Upt,c("td",null,[c("div",Fpt,[G(c("select",{id:"whisper_model","onUpdate:modelValue":e[249]||(e[249]=_=>r.configFile.whisper_model=_),onChange:e[250]||(e[250]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(w(!0),A(Ye,null,lt(r.whisperModels,_=>(w(),A("option",{key:_,value:_},he(_),9,Bpt))),128))],544),[[jt,r.configFile.whisper_model]])])])])])]),_:1}),Te(o,{title:"Open AI Whisper audio transcription",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",Gpt,[c("tr",null,[Vpt,c("td",null,[c("div",zpt,[G(c("input",{type:"text",id:"openai_whisper_key",required:"","onUpdate:modelValue":e[251]||(e[251]=_=>r.configFile.openai_whisper_key=_),onChange:e[252]||(e[252]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.openai_whisper_key]])])])]),c("tr",null,[Hpt,c("td",null,[c("div",qpt,[G(c("select",{id:"openai_whisper_model","onUpdate:modelValue":e[253]||(e[253]=_=>r.configFile.openai_whisper_model=_),onChange:e[254]||(e[254]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(w(!0),A(Ye,null,lt(r.openaiWhisperModels,_=>(w(),A("option",{key:_,value:_},he(_),9,Ypt))),128))],544),[[jt,r.configFile.openai_whisper_model]])])])])])]),_:1})]),_:1}),Te(o,{title:"TTS services",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[Te(o,{title:"Browser Audio TTS",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",$pt,[c("tr",null,[Wpt,c("td",null,[c("div",Kpt,[G(c("input",{type:"checkbox",id:"auto_speak",required:"","onUpdate:modelValue":e[255]||(e[255]=_=>r.configFile.auto_speak=_),onChange:e[256]||(e[256]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.auto_speak]])])])]),c("tr",null,[jpt,c("td",null,[G(c("input",{id:"audio_pitch","onUpdate:modelValue":e[257]||(e[257]=_=>r.configFile.audio_pitch=_),onChange:e[258]||(e[258]=_=>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),[[we,r.configFile.audio_pitch]]),G(c("input",{"onUpdate:modelValue":e[259]||(e[259]=_=>r.configFile.audio_pitch=_),onChange:e[260]||(e[260]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.audio_pitch]])])]),c("tr",null,[Qpt,c("td",null,[G(c("select",{id:"audio_out_voice","onUpdate:modelValue":e[261]||(e[261]=_=>r.configFile.audio_out_voice=_),onChange:e[262]||(e[262]=_=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(w(!0),A(Ye,null,lt(s.audioVoices,_=>(w(),A("option",{key:_.name,value:_.name},he(_.name),9,Xpt))),128))],544),[[jt,r.configFile.audio_out_voice]])])])])]),_:1}),Te(o,{title:"XTTS service",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",Zpt,[c("tr",null,[Jpt,c("td",null,[c("div",e_t,[G(c("input",{type:"checkbox",id:"xtts_enable",required:"","onUpdate:modelValue":e[263]||(e[263]=_=>r.configFile.xtts_enable=_),onChange:e[264]||(e[264]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.xtts_enable]])])])]),c("tr",null,[t_t,c("td",null,[c("div",n_t,[c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[265]||(e[265]=(..._)=>r.reinstallAudioService&&r.reinstallAudioService(..._))},"install xtts service"),c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[266]||(e[266]=(..._)=>r.startAudioService&&r.startAudioService(..._))},"start xtts service"),c("a",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",href:this.$store.state.config.xtts_base_url+"/docs",target:"_blank"},"show xtts service entries",8,i_t),s_t])])]),c("tr",null,[r_t,c("td",null,[c("div",o_t,[G(c("input",{type:"text",id:"xtts_base_url",required:"","onUpdate:modelValue":e[267]||(e[267]=_=>r.configFile.xtts_base_url=_),onChange:e[268]||(e[268]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.xtts_base_url]])])])]),c("tr",null,[a_t,c("td",null,[c("div",l_t,[G(c("select",{"onUpdate:modelValue":e[269]||(e[269]=_=>r.xtts_current_language=_),onChange:e[270]||(e[270]=_=>s.settingsChanged=!0),disabled:!r.xtts_enable},[(w(!0),A(Ye,null,lt(s.voice_languages,(_,m)=>(w(),A("option",{key:m,value:_},he(m),9,d_t))),128))],40,c_t),[[jt,r.xtts_current_language]])])])]),c("tr",null,[u_t,c("td",null,[c("div",p_t,[G(c("select",{"onUpdate:modelValue":e[271]||(e[271]=_=>r.xtts_current_voice=_),onChange:e[272]||(e[272]=_=>s.settingsChanged=!0),disabled:!r.xtts_enable},[(w(!0),A(Ye,null,lt(s.voices,_=>(w(),A("option",{key:_,value:_},he(_),9,h_t))),128))],40,__t),[[jt,r.xtts_current_voice]])])])]),c("tr",null,[f_t,c("td",null,[c("div",m_t,[G(c("input",{type:"checkbox",id:"xtts_use_deepspeed",required:"","onUpdate:modelValue":e[273]||(e[273]=_=>r.configFile.xtts_use_deepspeed=_),onChange:e[274]||(e[274]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",disabled:!r.xtts_enable},null,40,g_t),[[Ze,r.configFile.xtts_use_deepspeed]])])])]),c("tr",null,[b_t,c("td",null,[c("div",E_t,[G(c("input",{type:"checkbox",id:"xtts_use_streaming_mode",required:"","onUpdate:modelValue":e[275]||(e[275]=_=>r.configFile.xtts_use_streaming_mode=_),onChange:e[276]||(e[276]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",disabled:!r.xtts_enable},null,40,y_t),[[Ze,r.configFile.xtts_use_streaming_mode]])])])]),c("tr",null,[v_t,c("td",null,[c("div",S_t,[G(c("input",{type:"checkbox",id:"auto_read",required:"","onUpdate:modelValue":e[277]||(e[277]=_=>r.configFile.auto_read=_),onChange:e[278]||(e[278]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",disabled:!r.xtts_enable},null,40,T_t),[[Ze,r.configFile.auto_read]])])])]),c("tr",null,[x_t,c("td",null,[c("div",C_t,[G(c("input",{type:"text",id:"xtts_stream_chunk_size",required:"","onUpdate:modelValue":e[279]||(e[279]=_=>r.configFile.xtts_stream_chunk_size=_),onChange:e[280]||(e[280]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.xtts_stream_chunk_size]])])])]),c("tr",null,[w_t,c("td",null,[c("div",R_t,[G(c("input",{type:"number",id:"xtts_temperature",required:"","onUpdate:modelValue":e[281]||(e[281]=_=>r.configFile.xtts_temperature=_),onChange:e[282]||(e[282]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",step:"0.01"},null,544),[[we,r.configFile.xtts_temperature,void 0,{number:!0}]])])])]),c("tr",null,[A_t,c("td",null,[c("div",N_t,[G(c("input",{type:"number",id:"xtts_length_penalty",required:"","onUpdate:modelValue":e[283]||(e[283]=_=>r.configFile.xtts_length_penalty=_),onChange:e[284]||(e[284]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",step:"0.1"},null,544),[[we,r.configFile.xtts_length_penalty,void 0,{number:!0}]])])])]),c("tr",null,[O_t,c("td",null,[c("div",I_t,[G(c("input",{type:"number",id:"xtts_repetition_penalty",required:"","onUpdate:modelValue":e[285]||(e[285]=_=>r.configFile.xtts_repetition_penalty=_),onChange:e[286]||(e[286]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",step:"0.1"},null,544),[[we,r.configFile.xtts_repetition_penalty,void 0,{number:!0}]])])])]),c("tr",null,[M_t,c("td",null,[c("div",D_t,[G(c("input",{type:"number",id:"xtts_top_k",required:"","onUpdate:modelValue":e[287]||(e[287]=_=>r.configFile.xtts_top_k=_),onChange:e[288]||(e[288]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.xtts_top_k,void 0,{number:!0}]])])])]),c("tr",null,[k_t,c("td",null,[c("div",L_t,[G(c("input",{type:"number",id:"xtts_top_p",required:"","onUpdate:modelValue":e[289]||(e[289]=_=>r.configFile.xtts_top_p=_),onChange:e[290]||(e[290]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.xtts_top_p,void 0,{number:!0}]])])])]),c("tr",null,[P_t,c("td",null,[c("div",U_t,[G(c("input",{type:"number",id:"xtts_speed",required:"","onUpdate:modelValue":e[291]||(e[291]=_=>r.configFile.xtts_speed=_),onChange:e[292]||(e[292]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",step:"0.1"},null,544),[[we,r.configFile.xtts_speed,void 0,{number:!0}]])])])]),c("tr",null,[F_t,c("td",null,[c("div",B_t,[G(c("input",{type:"checkbox",id:"enable_text_splitting","onUpdate:modelValue":e[293]||(e[293]=_=>r.configFile.enable_text_splitting=_),onChange:e[294]||(e[294]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.enable_text_splitting]])])])])])]),_:1}),Te(o,{title:"Open AI TTS service",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",G_t,[c("tr",null,[V_t,c("td",null,[c("div",z_t,[G(c("input",{type:"text",id:"openai_tts_key",required:"","onUpdate:modelValue":e[295]||(e[295]=_=>r.configFile.openai_tts_key=_),onChange:e[296]||(e[296]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.openai_tts_key]])])])]),c("tr",null,[H_t,c("td",null,[c("div",q_t,[G(c("select",{"onUpdate:modelValue":e[297]||(e[297]=_=>r.configFile.openai_tts_model=_),onChange:e[298]||(e[298]=_=>s.settingsChanged=!0)},W_t,544),[[jt,r.configFile.openai_tts_model]])])])]),c("tr",null,[K_t,c("td",null,[c("div",j_t,[G(c("select",{"onUpdate:modelValue":e[299]||(e[299]=_=>r.configFile.openai_tts_voice=_),onChange:e[300]||(e[300]=_=>s.settingsChanged=!0)},tht,544),[[jt,r.configFile.openai_tts_voice]])])])])])]),_:1})]),_:1}),Te(o,{title:"TTI services",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[Te(o,{title:"Stable diffusion service",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",nht,[c("tr",null,[iht,c("td",null,[c("div",sht,[G(c("input",{type:"checkbox",id:"enable_sd_service",required:"","onUpdate:modelValue":e[301]||(e[301]=_=>r.configFile.enable_sd_service=_),onChange:e[302]||(e[302]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.enable_sd_service]])])]),c("td",null,[c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[303]||(e[303]=_=>this.$store.state.messageBox.showMessage("Activates Stable diffusion service. The service will be automatically loaded at startup alowing you to use the stable diffusion endpoint to generate images"))},oht)])]),c("tr",null,[aht,c("td",null,[c("div",lht,[c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[304]||(e[304]=(..._)=>r.reinstallSDService&&r.reinstallSDService(..._))},"install sd service"),c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[305]||(e[305]=(..._)=>r.upgradeSDService&&r.upgradeSDService(..._))},"upgrade sd service"),c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[306]||(e[306]=(..._)=>r.startSDService&&r.startSDService(..._))},"start sd service"),c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[307]||(e[307]=(..._)=>r.showSD&&r.showSD(..._))},"show sd ui"),cht])]),c("td",null,[c("div",dht,[c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[308]||(e[308]=(..._)=>r.reinstallSDService&&r.reinstallSDService(..._))},"install sd service")])])]),c("tr",null,[uht,c("td",null,[c("div",pht,[G(c("input",{type:"text",id:"sd_base_url",required:"","onUpdate:modelValue":e[309]||(e[309]=_=>r.configFile.sd_base_url=_),onChange:e[310]||(e[310]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.sd_base_url]])])])])])]),_:1}),Te(o,{title:"Diffusers service",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",_ht,[c("tr",null,[hht,c("td",null,[c("div",fht,[c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[311]||(e[311]=(..._)=>r.reinstallDiffusersService&&r.reinstallDiffusersService(..._))},"install diffusers service"),c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[312]||(e[312]=(..._)=>r.upgradeDiffusersService&&r.upgradeDiffusersService(..._))},"upgrade diffusers service"),mht])])]),c("tr",null,[ght,c("td",null,[c("div",bht,[G(c("input",{type:"text",id:"diffusers_model",required:"","onUpdate:modelValue":e[313]||(e[313]=_=>r.configFile.diffusers_model=_),onChange:e[314]||(e[314]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.diffusers_model]])])]),Eht])])]),_:1}),Te(o,{title:"Midjourney",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",yht,[c("tr",null,[vht,c("td",null,[c("div",Sht,[G(c("input",{type:"text",id:"midjourney_key",required:"","onUpdate:modelValue":e[315]||(e[315]=_=>r.configFile.midjourney_key=_),onChange:e[316]||(e[316]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.midjourney_key]])])])])])]),_:1}),Te(o,{title:"Dall-E",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",Tht,[c("tr",null,[xht,c("td",null,[c("div",Cht,[G(c("input",{type:"text",id:"dall_e_key",required:"","onUpdate:modelValue":e[317]||(e[317]=_=>r.configFile.dall_e_key=_),onChange:e[318]||(e[318]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.dall_e_key]])])])]),c("tr",null,[wht,c("td",null,[c("div",Rht,[G(c("select",{"onUpdate:modelValue":e[319]||(e[319]=_=>r.configFile.dall_e_generation_engine=_),onChange:e[320]||(e[320]=_=>s.settingsChanged=!0)},Oht,544),[[jt,r.configFile.dall_e_generation_engine]])])])])])]),_:1}),Te(o,{title:"ComfyUI service",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",Iht,[c("tr",null,[Mht,c("td",null,[c("div",Dht,[G(c("input",{type:"checkbox",id:"enable_comfyui_service",required:"","onUpdate:modelValue":e[321]||(e[321]=_=>r.configFile.enable_comfyui_service=_),onChange:e[322]||(e[322]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.enable_comfyui_service]])])]),c("td",null,[c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[323]||(e[323]=_=>this.$store.state.messageBox.showMessage("Activates Stable diffusion service. The service will be automatically loaded at startup alowing you to use the stable diffusion endpoint to generate images"))},Lht)])]),c("tr",null,[Pht,c("td",null,[c("div",Uht,[G(c("input",{type:"text",id:"comfyui_model",required:"","onUpdate:modelValue":e[324]||(e[324]=_=>r.configFile.comfyui_model=_),onChange:e[325]||(e[325]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.comfyui_model]])])]),c("td",null,[c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[326]||(e[326]=_=>this.$store.state.messageBox.showMessage("Activates Stable diffusion service. The service will be automatically loaded at startup alowing you to use the stable diffusion endpoint to generate images"))},Bht)])]),c("tr",null,[Ght,c("td",null,[c("div",Vht,[c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[327]||(e[327]=(..._)=>r.reinstallComfyUIService&&r.reinstallComfyUIService(..._))},"install comfyui service"),c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[328]||(e[328]=(..._)=>r.upgradeComfyUIService&&r.upgradeComfyUIService(..._))},"upgrade comfyui service"),c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[329]||(e[329]=(..._)=>r.startComfyUIService&&r.startComfyUIService(..._))},"start comfyui service"),c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[330]||(e[330]=(..._)=>r.showComfyui&&r.showComfyui(..._))},"show comfyui"),zht])])]),c("tr",null,[Hht,c("td",null,[c("div",qht,[G(c("input",{type:"text",id:"comfyui_base_url",required:"","onUpdate:modelValue":e[331]||(e[331]=_=>r.configFile.comfyui_base_url=_),onChange:e[332]||(e[332]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.comfyui_base_url]])])])])])]),_:1})]),_:1}),Te(o,{title:"TTT services",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[Te(o,{title:"Ollama service",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",Yht,[c("tr",null,[$ht,c("td",null,[c("div",Wht,[G(c("input",{type:"checkbox",id:"enable_ollama_service",required:"","onUpdate:modelValue":e[333]||(e[333]=_=>r.configFile.enable_ollama_service=_),onChange:e[334]||(e[334]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.enable_ollama_service]])])]),c("td",null,[c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[335]||(e[335]=_=>this.$store.state.messageBox.showMessage(`Activates ollama service. The service will be automatically loaded at startup alowing you to use the ollama binding. If you are using windows, this uses wsl which requires you to have it installed or at least activated. If You are using windows, this will install wsl so you need to activate it. -Here is how you can do that`))},Kht)])]),c("tr",null,[jht,c("td",null,[c("div",Qht,[c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[334]||(e[334]=(..._)=>r.reinstallOLLAMAService&&r.reinstallOLLAMAService(..._))},"install ollama service"),c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[335]||(e[335]=(..._)=>r.startollamaService&&r.startollamaService(..._))},"start ollama service")])])]),c("tr",null,[Xht,c("td",null,[c("div",Zht,[G(c("input",{type:"text",id:"ollama_base_url",required:"","onUpdate:modelValue":e[336]||(e[336]=_=>r.configFile.ollama_base_url=_),onChange:e[337]||(e[337]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.ollama_base_url]])])])])])]),_:1}),Te(o,{title:"vLLM service",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",Jht,[c("tr",null,[eft,c("td",null,[c("div",tft,[G(c("input",{type:"checkbox",id:"enable_vllm_service",required:"","onUpdate:modelValue":e[338]||(e[338]=_=>r.configFile.enable_vllm_service=_),onChange:e[339]||(e[339]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.enable_vllm_service]])])]),c("td",null,[c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[340]||(e[340]=_=>this.$store.state.messageBox.showMessage(`Activates vllm service. The service will be automatically loaded at startup alowing you to use the elf binding. +Here is how you can do that`))},jht)])]),c("tr",null,[Qht,c("td",null,[c("div",Xht,[c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[336]||(e[336]=(..._)=>r.reinstallOLLAMAService&&r.reinstallOLLAMAService(..._))},"install ollama service"),c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[337]||(e[337]=(..._)=>r.startollamaService&&r.startollamaService(..._))},"start ollama service")])])]),c("tr",null,[Zht,c("td",null,[c("div",Jht,[G(c("input",{type:"text",id:"ollama_base_url",required:"","onUpdate:modelValue":e[338]||(e[338]=_=>r.configFile.ollama_base_url=_),onChange:e[339]||(e[339]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.ollama_base_url]])])])])])]),_:1}),Te(o,{title:"vLLM service",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",eft,[c("tr",null,[tft,c("td",null,[c("div",nft,[G(c("input",{type:"checkbox",id:"enable_vllm_service",required:"","onUpdate:modelValue":e[340]||(e[340]=_=>r.configFile.enable_vllm_service=_),onChange:e[341]||(e[341]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.enable_vllm_service]])])]),c("td",null,[c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[342]||(e[342]=_=>this.$store.state.messageBox.showMessage(`Activates vllm service. The service will be automatically loaded at startup alowing you to use the elf binding. If you are using windows, this uses wsl which requires you to have it installed or at least activated. If You are using windows, this will install wsl so you need to activate it. -Here is how you can do that`))},ift)])]),c("tr",null,[sft,c("td",null,[c("div",rft,[c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[341]||(e[341]=(..._)=>r.reinstallvLLMService&&r.reinstallvLLMService(..._))},"install vLLM service"),c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[342]||(e[342]=(..._)=>r.startvLLMService&&r.startvLLMService(..._))},"start vllm service")])])]),c("tr",null,[oft,c("td",null,[c("div",aft,[G(c("input",{type:"text",id:"vllm_url",required:"","onUpdate:modelValue":e[343]||(e[343]=_=>r.configFile.vllm_url=_),onChange:e[344]||(e[344]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.vllm_url]])])])]),c("tr",null,[lft,c("td",null,[c("div",cft,[c("div",dft,[uft,c("p",pft,[G(c("input",{type:"text",id:"temp-val","onUpdate:modelValue":e[345]||(e[345]=_=>r.configFile.vllm_gpu_memory_utilization=_),onChange:e[346]||(e[346]=_=>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),[[we,r.configFile.vllm_gpu_memory_utilization]])])]),G(c("input",{id:"vllm_gpu_memory_utilization",onChange:e[347]||(e[347]=_=>s.settingsChanged=!0),type:"range","onUpdate:modelValue":e[348]||(e[348]=_=>r.configFile.vllm_gpu_memory_utilization=_),min:"0.10",max:"1",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),[[we,r.configFile.vllm_gpu_memory_utilization]])])])]),c("tr",null,[_ft,c("td",null,[c("div",hft,[G(c("input",{type:"number",id:"vllm_max_num_seqs",min:"64",max:"2048",required:"","onUpdate:modelValue":e[349]||(e[349]=_=>r.configFile.vllm_max_num_seqs=_),onChange:e[350]||(e[350]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.vllm_max_num_seqs]])])])]),c("tr",null,[fft,c("td",null,[c("div",mft,[G(c("input",{type:"number",id:"vllm_max_model_len",min:"2048",max:"1000000",required:"","onUpdate:modelValue":e[351]||(e[351]=_=>r.configFile.vllm_max_model_len=_),onChange:e[352]||(e[352]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.vllm_max_model_len]])])])]),c("tr",null,[gft,c("td",null,[c("div",bft,[G(c("input",{type:"text",id:"vllm_model_path",required:"","onUpdate:modelValue":e[353]||(e[353]=_=>r.configFile.vllm_model_path=_),onChange:e[354]||(e[354]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.vllm_model_path]])])])])])]),_:1}),Te(o,{title:"Petals service",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",Eft,[c("tr",null,[yft,c("td",null,[c("div",vft,[G(c("input",{type:"checkbox",id:"enable_petals_service",required:"","onUpdate:modelValue":e[355]||(e[355]=_=>r.configFile.enable_petals_service=_),onChange:e[356]||(e[356]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.enable_petals_service]])])]),c("td",null,[c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[357]||(e[357]=_=>this.$store.state.messageBox.showMessage(`Activates Petals service. The service will be automatically loaded at startup alowing you to use the petals endpoint to generate text in a distributed network. +Here is how you can do that`))},sft)])]),c("tr",null,[rft,c("td",null,[c("div",oft,[c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[343]||(e[343]=(..._)=>r.reinstallvLLMService&&r.reinstallvLLMService(..._))},"install vLLM service"),c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[344]||(e[344]=(..._)=>r.startvLLMService&&r.startvLLMService(..._))},"start vllm service")])])]),c("tr",null,[aft,c("td",null,[c("div",lft,[G(c("input",{type:"text",id:"vllm_url",required:"","onUpdate:modelValue":e[345]||(e[345]=_=>r.configFile.vllm_url=_),onChange:e[346]||(e[346]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.vllm_url]])])])]),c("tr",null,[cft,c("td",null,[c("div",dft,[c("div",uft,[pft,c("p",_ft,[G(c("input",{type:"text",id:"temp-val","onUpdate:modelValue":e[347]||(e[347]=_=>r.configFile.vllm_gpu_memory_utilization=_),onChange:e[348]||(e[348]=_=>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),[[we,r.configFile.vllm_gpu_memory_utilization]])])]),G(c("input",{id:"vllm_gpu_memory_utilization",onChange:e[349]||(e[349]=_=>s.settingsChanged=!0),type:"range","onUpdate:modelValue":e[350]||(e[350]=_=>r.configFile.vllm_gpu_memory_utilization=_),min:"0.10",max:"1",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),[[we,r.configFile.vllm_gpu_memory_utilization]])])])]),c("tr",null,[hft,c("td",null,[c("div",fft,[G(c("input",{type:"number",id:"vllm_max_num_seqs",min:"64",max:"2048",required:"","onUpdate:modelValue":e[351]||(e[351]=_=>r.configFile.vllm_max_num_seqs=_),onChange:e[352]||(e[352]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.vllm_max_num_seqs]])])])]),c("tr",null,[mft,c("td",null,[c("div",gft,[G(c("input",{type:"number",id:"vllm_max_model_len",min:"2048",max:"1000000",required:"","onUpdate:modelValue":e[353]||(e[353]=_=>r.configFile.vllm_max_model_len=_),onChange:e[354]||(e[354]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.vllm_max_model_len]])])])]),c("tr",null,[bft,c("td",null,[c("div",Eft,[G(c("input",{type:"text",id:"vllm_model_path",required:"","onUpdate:modelValue":e[355]||(e[355]=_=>r.configFile.vllm_model_path=_),onChange:e[356]||(e[356]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.vllm_model_path]])])])])])]),_:1}),Te(o,{title:"Petals service",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",yft,[c("tr",null,[vft,c("td",null,[c("div",Sft,[G(c("input",{type:"checkbox",id:"enable_petals_service",required:"","onUpdate:modelValue":e[357]||(e[357]=_=>r.configFile.enable_petals_service=_),onChange:e[358]||(e[358]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.enable_petals_service]])])]),c("td",null,[c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[359]||(e[359]=_=>this.$store.state.messageBox.showMessage(`Activates Petals service. The service will be automatically loaded at startup alowing you to use the petals endpoint to generate text in a distributed network. If You are using windows, this will install wsl so you need to activate it. -Here is how you can do that`))},Tft)])]),c("tr",null,[xft,c("td",null,[c("div",Cft,[c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[358]||(e[358]=(..._)=>r.reinstallPetalsService&&r.reinstallPetalsService(..._))},"install petals service")])])]),c("tr",null,[wft,c("td",null,[c("div",Rft,[G(c("input",{type:"text",id:"petals_base_url",required:"","onUpdate:modelValue":e[359]||(e[359]=_=>r.configFile.petals_base_url=_),onChange:e[360]||(e[360]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.petals_base_url]])])])])])]),_:1})]),_:1}),Te(o,{title:"Misc",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[Te(o,{title:"Motion Ctrl service",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",Aft,[c("tr",null,[Nft,c("td",null,[c("div",Oft,[G(c("input",{type:"checkbox",id:"enable_motion_ctrl_service",required:"","onUpdate:modelValue":e[361]||(e[361]=_=>r.configFile.enable_motion_ctrl_service=_),onChange:e[362]||(e[362]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.enable_motion_ctrl_service]])])]),c("td",null,[c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[363]||(e[363]=_=>this.$store.state.messageBox.showMessage("Activates Motion ctrl service. The service will be automatically loaded at startup alowing you to use the motoin control endpoint to generate videos"))},Mft)])]),c("tr",null,[Dft,c("td",null,[c("div",kft,[c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[364]||(e[364]=(..._)=>r.reinstallMotionCtrlService&&r.reinstallMotionCtrlService(..._))},"install Motion Ctrl service")])])]),c("tr",null,[Lft,c("td",null,[c("div",Pft,[G(c("input",{type:"text",id:"sd_base_url",required:"","onUpdate:modelValue":e[365]||(e[365]=_=>r.configFile.sd_base_url=_),onChange:e[366]||(e[366]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.sd_base_url]])])])])])]),_:1}),Te(o,{title:"Elastic search Service (under construction)",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",Uft,[c("tr",null,[Fft,c("td",null,[c("div",Bft,[G(c("input",{type:"checkbox",id:"elastic_search_service",required:"","onUpdate:modelValue":e[367]||(e[367]=_=>r.configFile.elastic_search_service=_),onChange:e[368]||(e[368]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.elastic_search_service]])])])]),c("tr",null,[Gft,c("td",null,[c("div",Vft,[c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[369]||(e[369]=(..._)=>r.reinstallElasticSearchService&&r.reinstallElasticSearchService(..._))},"install ElasticSearch service")])])]),c("tr",null,[zft,c("td",null,[c("div",Hft,[G(c("input",{type:"text",id:"elastic_search_url",required:"","onUpdate:modelValue":e[370]||(e[370]=_=>r.configFile.elastic_search_url=_),onChange:e[371]||(e[371]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.elastic_search_url]])])])])])]),_:1})]),_:1})],2)]),c("div",qft,[c("div",Yft,[c("button",{onClick:e[372]||(e[372]=be(_=>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"},[G(c("div",null,Wft,512),[[Mt,s.bzc_collapsed]]),G(c("div",null,jft,512),[[Mt,!s.bzc_collapsed]]),Qft,r.configFile.binding_name?V("",!0):(w(),A("div",Xft,[Zft,et(" No binding selected! ")])),r.configFile.binding_name?(w(),A("div",Jft,"|")):V("",!0),r.configFile.binding_name?(w(),A("div",emt,[c("div",tmt,[c("img",{src:r.imgBinding,class:"w-8 h-8 rounded-full object-fill text-blue-700"},null,8,nmt),c("h3",imt,he(r.binding_name),1)])])):V("",!0)])]),c("div",{class:ze([{hidden:s.bzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[r.bindingsZoo&&r.bindingsZoo.length>0?(w(),A("div",smt,[c("label",rmt," Bindings: ("+he(r.bindingsZoo.length)+") ",1),c("div",{class:ze(["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"])},[Te(os,{name:"list"},{default:We(()=>[(w(!0),A(Ye,null,lt(r.bindingsZoo,(_,m)=>(w(),xt(a,{ref_for:!0,ref:"bindingZoo",key:"index-"+m+"-"+_.folder,binding:_,"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:_.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)])):V("",!0),s.bzl_collapsed?(w(),A("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[373]||(e[373]=_=>s.bzl_collapsed=!s.bzl_collapsed)},amt)):(w(),A("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[374]||(e[374]=_=>s.bzl_collapsed=!s.bzl_collapsed)},cmt))],2)]),c("div",dmt,[c("div",umt,[c("button",{onClick:e[375]||(e[375]=be(_=>r.modelsZooToggleCollapse(),["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[G(c("div",null,_mt,512),[[Mt,s.mzc_collapsed]]),G(c("div",null,fmt,512),[[Mt,!s.mzc_collapsed]]),mmt,c("div",gmt,[r.configFile.binding_name?V("",!0):(w(),A("div",bmt,[Emt,et(" Select binding first! ")])),!r.configFile.model_name&&r.configFile.binding_name?(w(),A("div",ymt,[vmt,et(" No model selected! ")])):V("",!0),r.configFile.model_name?(w(),A("div",Smt,"|")):V("",!0),r.configFile.model_name?(w(),A("div",Tmt,[c("div",xmt,[c("img",{src:r.imgModel,class:"w-8 h-8 rounded-lg object-fill"},null,8,Cmt),c("h3",wmt,he(r.configFile.model_name),1)])])):V("",!0)])])]),c("div",{class:ze([{hidden:s.mzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",Rmt,[c("div",Amt,[c("div",Nmt,[s.searchModelInProgress?(w(),A("div",Omt,Mmt)):V("",!0),s.searchModelInProgress?V("",!0):(w(),A("div",Dmt,Lmt))]),G(c("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[376]||(e[376]=_=>s.searchModel=_),onKeyup:e[377]||(e[377]=Hs((..._)=>r.searchModel_func&&r.searchModel_func(..._),["enter"]))},null,544),[[we,s.searchModel]]),s.searchModel?(w(),A("button",{key:0,onClick:e[378]||(e[378]=be(_=>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")):V("",!0)])]),c("div",null,[G(c("input",{"onUpdate:modelValue":e[379]||(e[379]=_=>s.show_only_installed_models=_),class:"m-2 p-2",type:"checkbox",ref:"only_installed"},null,512),[[Ze,s.show_only_installed_models]]),Pmt]),c("div",null,[Te(l,{radioOptions:s.sortOptions,onRadioSelected:r.handleRadioSelected},null,8,["radioOptions","onRadioSelected"])]),Umt,s.is_loading_zoo?(w(),A("div",Fmt,Vmt)):V("",!0),s.models_zoo&&s.models_zoo.length>0?(w(),A("div",zmt,[c("label",Hmt," Models: ("+he(s.models_zoo.length)+") ",1),c("div",{class:ze(["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"])},[Te(os,{name:"list"},{default:We(()=>[(w(!0),A(Ye,null,lt(r.rendered_models_zoo,(_,m)=>(w(),xt(u,{ref_for:!0,ref:"modelZoo",key:"index-"+m+"-"+_.name,model:_,"is-installed":_.isInstalled,"on-install":r.onInstall,"on-uninstall":r.onUninstall,"on-selected":r.onModelSelected,selected:_.name===r.configFile.model_name,model_type:_.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)),c("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[380]||(e[380]=(..._)=>r.load_more_models&&r.load_more_models(..._))},"Load more models",512)]),_:1})],2)])):V("",!0),s.mzl_collapsed?(w(),A("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[381]||(e[381]=(..._)=>r.open_mzl&&r.open_mzl(..._))},Ymt)):(w(),A("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[382]||(e[382]=(..._)=>r.open_mzl&&r.open_mzl(..._))},Wmt)),c("div",Kmt,[c("div",jmt,[c("div",null,[c("div",Qmt,[Xmt,G(c("input",{type:"text","onUpdate:modelValue":e[383]||(e[383]=_=>s.reference_path=_),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),[[we,s.reference_path]])]),c("button",{type:"button",onClick:e[384]||(e[384]=be(_=>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?V("",!0):(w(),A("div",Zmt,[c("div",Jmt,[egt,G(c("input",{type:"text","onUpdate:modelValue":e[385]||(e[385]=_=>s.addModel.url=_),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),[[we,s.addModel.url]])]),c("button",{type:"button",onClick:e[386]||(e[386]=be(_=>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?(w(),A("div",tgt,[ngt,c("div",igt,[c("div",sgt,[c("div",rgt,[ogt,c("span",agt,he(Math.floor(s.addModel.progress))+"%",1)]),c("div",{class:"mx-1 opacity-80 line-clamp-1",title:s.addModel.url},he(s.addModel.url),9,lgt),c("div",cgt,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:en({width:s.addModel.progress+"%"})},null,4)]),c("div",dgt,[c("span",ugt,"Download speed: "+he(r.speed_computed)+"/s",1),c("span",pgt,he(r.downloaded_size_computed)+"/"+he(r.total_size_computed),1)])])]),c("div",_gt,[c("div",hgt,[c("div",fgt,[c("button",{onClick:e[387]||(e[387]=be((..._)=>r.onCancelInstall&&r.onCancelInstall(..._),["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 ")])])])])):V("",!0)])])],2)]),c("div",mgt,[c("div",ggt,[c("button",{onClick:e[390]||(e[390]=be(_=>s.pzc_collapsed=!s.pzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 text-left w-full flex items-center"},[G(c("div",null,Egt,512),[[Mt,s.pzc_collapsed]]),G(c("div",null,vgt,512),[[Mt,!s.pzc_collapsed]]),Sgt,r.configFile.personalities?(w(),A("div",Tgt,"|")):V("",!0),c("div",xgt,he(r.active_pesonality),1),r.configFile.personalities?(w(),A("div",Cgt,"|")):V("",!0),r.configFile.personalities?(w(),A("div",wgt,[r.mountedPersArr.length>0?(w(),A("div",Rgt,[(w(!0),A(Ye,null,lt(r.mountedPersArr,(_,m)=>(w(),A("div",{class:"relative hover:-translate-y-2 duration-300 hover:z-10 shrink-0",key:m+"-"+_.name,ref_for:!0,ref:"mountedPersonalities"},[c("div",Agt,[c("button",{onClick:be(E=>r.onPersonalitySelected(_),["stop"])},[c("img",{src:s.bUrl+_.avatar,onError:e[388]||(e[388]=(...E)=>r.personalityImgPlacehodler&&r.personalityImgPlacehodler(...E)),class:ze(["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(_.full_path)?"border-secondary":"border-transparent z-0"]),title:_.name},null,42,Ogt)],8,Ngt),c("button",{onClick:be(E=>r.unmountPersonality(_),["stop"])},Dgt,8,Igt)])]))),128))])):V("",!0)])):V("",!0),c("button",{onClick:e[389]||(e[389]=be(_=>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"},Lgt)])]),c("div",{class:ze([{hidden:s.pzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",Pgt,[Ugt,c("div",Fgt,[c("div",Bgt,[s.searchPersonalityInProgress?(w(),A("div",Ggt,zgt)):V("",!0),s.searchPersonalityInProgress?V("",!0):(w(),A("div",Hgt,Ygt))]),G(c("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[391]||(e[391]=_=>s.searchPersonality=_),onKeyup:e[392]||(e[392]=be((..._)=>r.searchPersonality_func&&r.searchPersonality_func(..._),["stop"]))},null,544),[[we,s.searchPersonality]]),s.searchPersonality?(w(),A("button",{key:0,onClick:e[393]||(e[393]=be(_=>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")):V("",!0)])]),s.searchPersonality?V("",!0):(w(),A("div",$gt,[c("label",Wgt," Personalities Category: ("+he(s.persCatgArr.length)+") ",1),c("select",{id:"persCat",onChange:e[394]||(e[394]=_=>r.update_personality_category(_.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"},[(w(!0),A(Ye,null,lt(s.persCatgArr,(_,m)=>(w(),A("option",{key:m,selected:_==this.configFile.personality_category},he(_),9,Kgt))),128))],32)])),c("div",null,[s.personalitiesFiltered.length>0?(w(),A("div",jgt,[c("label",Qgt,he(s.searchPersonality?"Search results":"Personalities")+": ("+he(s.personalitiesFiltered.length)+") ",1),c("div",{class:ze(["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"])},[Te(os,{name:"bounce"},{default:We(()=>[(w(!0),A(Ye,null,lt(s.personalitiesFiltered,(_,m)=>(w(),xt(d,{ref_for:!0,ref:"personalitiesZoo",key:"index-"+m+"-"+_.name,personality:_,select_language:!0,full_path:_.full_path,selected:r.configFile.active_personality_id==r.configFile.personalities.findIndex(E=>E===_.full_path||E===_.full_path+":"+_.language),"on-selected":r.onPersonalitySelected,"on-mount":r.mountPersonality,"on-un-mount":r.unmountPersonality,"on-remount":r.remountPersonality,"on-edit":r.editPersonality,"on-copy-to-custom":r.copyToCustom,"on-reinstall":r.onPersonalityReinstall,"on-settings":r.onSettingsPersonality,"on-copy-personality-name":r.onCopyPersonalityName,"on-copy-to_custom":r.onCopyToCustom,"on-open-folder":r.handleOpenFolder},null,8,["personality","full_path","selected","on-selected","on-mount","on-un-mount","on-remount","on-edit","on-copy-to-custom","on-reinstall","on-settings","on-copy-personality-name","on-copy-to_custom","on-open-folder"]))),128))]),_:1})],2)])):V("",!0)]),s.pzl_collapsed?(w(),A("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[395]||(e[395]=_=>s.pzl_collapsed=!s.pzl_collapsed)},Zgt)):(w(),A("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[396]||(e[396]=_=>s.pzl_collapsed=!s.pzl_collapsed)},ebt))],2)]),c("div",tbt,[c("div",nbt,[c("button",{onClick:e[397]||(e[397]=be(_=>s.mc_collapsed=!s.mc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[G(c("div",null,sbt,512),[[Mt,s.mc_collapsed]]),G(c("div",null,obt,512),[[Mt,!s.mc_collapsed]]),abt])]),c("div",{class:ze([{hidden:s.mc_collapsed},"flex flex-col mb-2 p-2"])},[c("div",lbt,[c("div",cbt,[G(c("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[398]||(e[398]=be(()=>{},["stop"])),"onUpdate:modelValue":e[399]||(e[399]=_=>r.configFile.override_personality_model_parameters=_),onChange:e[400]||(e[400]=_=>r.update_setting("override_personality_model_parameters",r.configFile.override_personality_model_parameters))},null,544),[[Ze,r.configFile.override_personality_model_parameters]]),dbt])]),c("div",{class:ze(r.configFile.override_personality_model_parameters?"":"pointer-events-none opacity-30")},[c("div",ubt,[pbt,G(c("input",{type:"text",id:"seed","onUpdate:modelValue":e[401]||(e[401]=_=>r.configFile.seed=_),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),[[we,r.configFile.seed]])]),c("div",_bt,[c("div",hbt,[c("div",fbt,[mbt,c("p",gbt,[G(c("input",{type:"text",id:"temp-val","onUpdate:modelValue":e[402]||(e[402]=_=>r.configFile.temperature=_),onChange:e[403]||(e[403]=_=>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),[[we,r.configFile.temperature]])])]),G(c("input",{id:"temperature",onChange:e[404]||(e[404]=_=>s.settingsChanged=!0),type:"range","onUpdate:modelValue":e[405]||(e[405]=_=>r.configFile.temperature=_),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),[[we,r.configFile.temperature]])])]),c("div",bbt,[c("div",Ebt,[c("div",ybt,[vbt,c("p",Sbt,[G(c("input",{type:"text",id:"predict-val","onUpdate:modelValue":e[406]||(e[406]=_=>r.configFile.n_predict=_),onChange:e[407]||(e[407]=_=>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),[[we,r.configFile.n_predict]])])]),G(c("input",{id:"predict",type:"range",onChange:e[408]||(e[408]=_=>s.settingsChanged=!0),"onUpdate:modelValue":e[409]||(e[409]=_=>r.configFile.n_predict=_),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),[[we,r.configFile.n_predict]])])]),c("div",Tbt,[c("div",xbt,[c("div",Cbt,[wbt,c("p",Rbt,[G(c("input",{type:"text",id:"top_k-val","onUpdate:modelValue":e[410]||(e[410]=_=>r.configFile.top_k=_),onChange:e[411]||(e[411]=_=>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),[[we,r.configFile.top_k]])])]),G(c("input",{id:"top_k",type:"range",onChange:e[412]||(e[412]=_=>s.settingsChanged=!0),"onUpdate:modelValue":e[413]||(e[413]=_=>r.configFile.top_k=_),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),[[we,r.configFile.top_k]])])]),c("div",Abt,[c("div",Nbt,[c("div",Obt,[Ibt,c("p",Mbt,[G(c("input",{type:"text",id:"top_p-val","onUpdate:modelValue":e[414]||(e[414]=_=>r.configFile.top_p=_),onChange:e[415]||(e[415]=_=>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),[[we,r.configFile.top_p]])])]),G(c("input",{id:"top_p",type:"range","onUpdate:modelValue":e[416]||(e[416]=_=>r.configFile.top_p=_),min:"0",max:"1",step:"0.01",onChange:e[417]||(e[417]=_=>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),[[we,r.configFile.top_p]])])]),c("div",Dbt,[c("div",kbt,[c("div",Lbt,[Pbt,c("p",Ubt,[G(c("input",{type:"text",id:"repeat_penalty-val","onUpdate:modelValue":e[418]||(e[418]=_=>r.configFile.repeat_penalty=_),onChange:e[419]||(e[419]=_=>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),[[we,r.configFile.repeat_penalty]])])]),G(c("input",{id:"repeat_penalty",onChange:e[420]||(e[420]=_=>s.settingsChanged=!0),type:"range","onUpdate:modelValue":e[421]||(e[421]=_=>r.configFile.repeat_penalty=_),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),[[we,r.configFile.repeat_penalty]])])]),c("div",Fbt,[c("div",Bbt,[c("div",Gbt,[Vbt,c("p",zbt,[G(c("input",{type:"text",id:"repeat_last_n-val","onUpdate:modelValue":e[422]||(e[422]=_=>r.configFile.repeat_last_n=_),onChange:e[423]||(e[423]=_=>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),[[we,r.configFile.repeat_last_n]])])]),G(c("input",{id:"repeat_last_n",type:"range","onUpdate:modelValue":e[424]||(e[424]=_=>r.configFile.repeat_last_n=_),min:"0",max:"100",step:"1",onChange:e[425]||(e[425]=_=>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),[[we,r.configFile.repeat_last_n]])])])],2)],2)])],2)]),Te(h,{ref:"addmodeldialog"},null,512),Te(f,{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 qbt=bt(Yrt,[["render",Hbt],["__scopeId","data-v-b7b0e3aa"]]),Ybt={components:{ClipBoardTextInput:xE,Card:rp},data(){return{dataset_path:"",max_length:1024,batch_size:4,lr:5e-5,num_epochs:2,selectedFolder:"",selectedDataset:""}},methods:{submitForm(){const t={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};Se.post("/start_training",t).then(e=>{})},openFolderSelector(){this.$refs.folder_selector.click()},selectOutputDirectory(t){var n;console.log("here");const e=(n=t.target.files[0])==null?void 0:n.path;console.log(e),e&&(this.selectedFolder=e)},selectDataset(t){const e=t.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(t){console.log("watching model_name",t),this.$refs.clipboardInput.inputValue=t}}},$bt={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"},Wbt={class:"mb-4"},Kbt=c("label",{for:"model_name",class:"text-sm"},"Model Name:",-1),jbt=["value"],Qbt={class:"mb-4"},Xbt=c("label",{for:"dataset_path",class:"text-sm"},"Dataset:",-1),Zbt={class:"mb-4"},Jbt=c("label",{for:"lr",class:"text-sm"},"Learning Rate:",-1),eEt={class:"mb-4"},tEt=c("label",{for:"num_epochs",class:"text-sm"},"Number of Epochs:",-1),nEt={class:"mb-4"},iEt=c("label",{for:"max_length",class:"text-sm"},"Max Length:",-1),sEt={class:"mb-4"},rEt=c("label",{for:"batch_size",class:"text-sm"},"Batch Size:",-1),oEt={class:"mb-4"},aEt=c("label",{for:"output_dir",class:"text-sm"},"Output Directory:",-1),lEt=c("button",{class:"bg-blue-500 text-white px-4 py-2 rounded"},"Start training",-1),cEt={key:1};function dEt(t,e,n,i,s,r){const o=mt("Card"),a=mt("ClipBoardTextInput");return r.selectedModel!==null&&r.selectedModel.toLowerCase().includes("gptq")?(w(),A("div",$bt,[c("form",{onSubmit:e[2]||(e[2]=be((...l)=>r.submitForm&&r.submitForm(...l),["prevent"])),class:""},[Te(o,{title:"Training configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:We(()=>[Te(o,{title:"Model",class:"",isHorizontal:!1},{default:We(()=>[c("div",Wbt,[Kbt,G(c("select",{"onUpdate:modelValue":e[0]||(e[0]=l=>r.selectedModel=l),onChange:e[1]||(e[1]=(...l)=>t.setModel&&t.setModel(...l)),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},[(w(!0),A(Ye,null,lt(r.models,l=>(w(),A("option",{key:l,value:l},he(l),9,jbt))),128))],544),[[jt,r.selectedModel]])])]),_:1}),Te(o,{title:"Data",isHorizontal:!1},{default:We(()=>[c("div",Qbt,[Xbt,Te(a,{id:"model_path",inputType:"file",value:s.dataset_path,onchange:"selectDataset()"},null,8,["value"])])]),_:1}),Te(o,{title:"Training",isHorizontal:!1},{default:We(()=>[c("div",Zbt,[Jbt,Te(a,{id:"model_path",inputType:"integer",value:s.lr},null,8,["value"])]),c("div",eEt,[tEt,Te(a,{id:"model_path",inputType:"integer",value:s.num_epochs},null,8,["value"])]),c("div",nEt,[iEt,Te(a,{id:"model_path",inputType:"integer",value:s.max_length},null,8,["value"])]),c("div",sEt,[rEt,Te(a,{id:"model_path",inputType:"integer",value:s.batch_size},null,8,["value"])])]),_:1}),Te(o,{title:"Output",isHorizontal:!1},{default:We(()=>[c("div",oEt,[aEt,Te(a,{id:"model_path",inputType:"text",value:t.output_dir},null,8,["value"])])]),_:1})]),_:1}),Te(o,{disableHoverAnimation:!0,disableFocus:!0},{default:We(()=>[lEt]),_:1})],32)])):(w(),A("div",cEt,[Te(o,{title:"Info",class:"",isHorizontal:!1},{default:We(()=>[et(" Only GPTQ models are supported for QLora fine tuning. Please select a GPTQ compatible binding. ")]),_:1})]))}const uEt=bt(Ybt,[["render",dEt]]),pEt={components:{ClipBoardTextInput:xE,Card:rp},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(t){var n;console.log("here");const e=(n=t.target.files[0])==null?void 0:n.path;console.log(e),e&&(this.selectedFolder=e)},selectDatasetPath(t){const e=t.target.files;e.length>0&&(this.selectedDatasetPath=e[0].webkitRelativePath)}}},_Et={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"},hEt={class:"mb-4"},fEt=c("label",{for:"model_name",class:"text-sm"},"Model Name:",-1),mEt={class:"mb-4"},gEt=c("label",{for:"tokenizer_name",class:"text-sm"},"Tokenizer Name:",-1),bEt=c("button",{type:"submit",class:"bg-blue-500 text-white px-4 py-2 rounded"},"Quantize LLM",-1);function EEt(t,e,n,i,s,r){const o=mt("ClipBoardTextInput"),a=mt("Card");return w(),A("div",_Et,[c("form",{onSubmit:e[0]||(e[0]=be((...l)=>r.submitForm&&r.submitForm(...l),["prevent"])),class:"max-w-md mx-auto"},[Te(a,{title:"Quantizing configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:We(()=>[Te(a,{title:"Model",class:"",isHorizontal:!1},{default:We(()=>[c("div",hEt,[fEt,Te(o,{id:"model_path",inputType:"text",value:s.model_name},null,8,["value"])]),c("div",mEt,[gEt,Te(o,{id:"model_path",inputType:"text",value:s.tokenizer_name},null,8,["value"])])]),_:1})]),_:1}),Te(a,{disableHoverAnimation:!0,disableFocus:!0},{default:We(()=>[bEt]),_:1})],32)])}const yEt=bt(pEt,[["render",EEt]]),vEt={name:"Discussion",emits:["delete","select","openFolder","editTitle","makeTitle","checked"],props:{id:Number,title:String,selected:Boolean,loading:Boolean,isCheckbox:Boolean,checkBoxValue:Boolean},setup(){},data(){return{showConfirmation:!1,editTitleMode:!1,makeTitleMode:!1,deleteMode:!1,openFolder:!1,editTitle:!1,newTitle:String,checkBoxValue_local:!1}},methods:{cancel(){this.editTitleMode=!1,this.makeTitleMode=!1,this.deleteMode=!1,this.showConfirmation=!1},deleteEvent(){this.showConfirmation=!1,this.$emit("delete")},selectEvent(){this.$emit("select")},openFolderEvent(){this.$emit("openFolder",{id:this.id})},editTitleEvent(){this.editTitle=!1,this.editTitleMode=!1,this.makeTitleMode=!1,this.deleteMode=!1,this.showConfirmation=!1,this.$emit("editTitle",{title:this.newTitle,id:this.id})},makeTitleEvent(){this.$emit("makeTitle",{id:this.id}),this.showConfirmation=!1},chnageTitle(t){this.newTitle=t},checkedChangeEvent(t,e){this.$emit("checked",t,e)}},mounted(){this.newTitle=this.title,Ge(()=>{He.replace()})},watch:{showConfirmation(){Ge(()=>{He.replace()})},editTitleMode(t){this.showConfirmation=t,this.editTitle=t,t&&Ge(()=>{try{this.$refs.titleBox.focus()}catch{}})},deleteMode(t){this.showConfirmation=t,t&&Ge(()=>{this.$refs.titleBox.focus()})},makeTitleMode(t){this.showConfirmation=t},checkBoxValue(t,e){this.checkBoxValue_local=t}}},SEt=["id"],TEt={class:"flex flex-row items-center gap-2"},xEt={key:0},CEt={class:"flex flex-row items-center w-full"},wEt=["title"],REt=["value"],AEt={class:"flex items-center flex-1 max-h-6"},NEt={key:0,class:"flex gap-3 flex-1 items-center justify-end duration-75"},OEt=c("i",{"data-feather":"x"},null,-1),IEt=[OEt],MEt=c("i",{"data-feather":"check"},null,-1),DEt=[MEt],kEt={key:1,class:"flex gap-3 flex-1 items-center justify-end invisible group-hover:visible duration-75"},LEt=c("i",{"data-feather":"folder"},null,-1),PEt=[LEt],UEt=c("i",{"data-feather":"type"},null,-1),FEt=[UEt],BEt=c("i",{"data-feather":"edit-2"},null,-1),GEt=[BEt],VEt=c("i",{"data-feather":"trash"},null,-1),zEt=[VEt];function HEt(t,e,n,i,s,r){return w(),A("div",{class:ze([n.selected?"bg-bg-light-discussion dark:bg-bg-dark-discussion shadow-md min-w-[23rem] max-w-[23rem]":" min-w-[23rem] max-w-[23rem]","flex flex-row sm:flex-row flex-wrap flex-shrink: 0 item-center shadow-sm 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"]),id:"dis-"+n.id,onClick:e[13]||(e[13]=be(o=>r.selectEvent(),["stop"]))},[c("div",TEt,[n.isCheckbox?(w(),A("div",xEt,[G(c("input",{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[0]||(e[0]=be(()=>{},["stop"])),"onUpdate:modelValue":e[1]||(e[1]=o=>s.checkBoxValue_local=o),onInput:e[2]||(e[2]=o=>r.checkedChangeEvent(o,n.id))},null,544),[[Ze,s.checkBoxValue_local]])])):V("",!0),n.selected?(w(),A("div",{key:1,class:ze(["min-h-full w-2 rounded-xl self-stretch",n.loading?"animate-bounce bg-accent ":" bg-secondary "])},null,2)):V("",!0),n.selected?V("",!0):(w(),A("div",{key:2,class:ze(["w-2",n.loading?"min-h-full w-2 rounded-xl self-stretch animate-bounce bg-accent ":" "])},null,2))]),c("div",CEt,[s.editTitle?V("",!0):(w(),A("p",{key:0,title:n.title,class:"line-clamp-1 w-4/6 ml-1 -mx-5"},he(n.title?n.title==="untitled"?"New discussion":n.title:"New discussion"),9,wEt)),s.editTitle?(w(),A("input",{key:1,type:"text",id:"title-box",ref:"titleBox",class:"bg-bg-light dark:bg-bg-dark rounded-md border-0 w-full -m-1 p-1",value:n.title,required:"",onKeydown:[e[3]||(e[3]=Hs(be(o=>r.editTitleEvent(),["exact"]),["enter"])),e[4]||(e[4]=Hs(be(o=>s.editTitleMode=!1,["exact"]),["esc"]))],onInput:e[5]||(e[5]=o=>r.chnageTitle(o.target.value)),onClick:e[6]||(e[6]=be(()=>{},["stop"]))},null,40,REt)):V("",!0),c("div",AEt,[s.showConfirmation?(w(),A("div",NEt,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Discard title changes",type:"button",onClick:e[7]||(e[7]=be(o=>r.cancel(),["stop"]))},IEt),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm title changes",type:"button",onClick:e[8]||(e[8]=be(o=>s.editTitleMode?r.editTitleEvent():s.deleteMode?r.deleteEvent():r.makeTitleEvent(),["stop"]))},DEt)])):V("",!0),s.showConfirmation?V("",!0):(w(),A("div",kEt,[c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Open folder",type:"button",onClick:e[9]||(e[9]=be(o=>r.openFolderEvent(),["stop"]))},PEt),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Make a title",type:"button",onClick:e[10]||(e[10]=be(o=>s.makeTitleMode=!0,["stop"]))},FEt),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Edit title",type:"button",onClick:e[11]||(e[11]=be(o=>s.editTitleMode=!0,["stop"]))},GEt),c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Remove discussion",type:"button",onClick:e[12]||(e[12]=be(o=>s.deleteMode=!0,["stop"]))},zEt)]))])])],10,SEt)}const RE=bt(vEt,[["render",HEt]]),qEt={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(t){this.prompt=t}}},YEt={key:0,class:"fixed top-0 left-0 w-full h-full flex justify-center items-center bg-black bg-opacity-50"},$Et={class:"bg-white p-8 rounded"},WEt={class:"text-xl font-bold mb-4"};function KEt(t,e,n,i,s,r){return w(),A("div",null,[s.show?(w(),A("div",YEt,[c("div",$Et,[c("h2",WEt,he(n.promptText),1),G(c("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),[[we,s.inputText]]),c("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"),c("button",{onClick:e[2]||(e[2]=(...o)=>r.cancel&&r.cancel(...o)),class:"bg-gray-500 text-white px-4 py-2 rounded"},"Cancel")])])):V("",!0)])}const gO=bt(qEt,[["render",KEt]]),jEt={data(){return{id:0,loading:!1,isCheckbox:!1,isVisible:!1,categories:[],titles:[],content:"",searchQuery:""}},components:{Discussion:RE,MarkdownRenderer:ip},props:{host:{type:String,required:!1,default:"http://localhost:9600"}},methods:{showSkillsLibrary(){this.isVisible=!0,this.fetchTitles()},closeComponent(){this.isVisible=!1},fetchCategories(){Se.post("/get_skills_library_categories",{client_id:this.$store.state.client_id}).then(t=>{this.categories=t.data.categories}).catch(t=>{console.error("Error fetching categories:",t)})},fetchTitles(){console.log("Fetching categories"),Se.post("/get_skills_library_titles",{client_id:this.$store.state.client_id}).then(t=>{this.titles=t.data.titles,console.log("titles recovered")}).catch(t=>{console.error("Error fetching titles:",t)})},fetchContent(t){Se.post("/get_skills_library_content",{client_id:this.$store.state.client_id,skill_id:t}).then(e=>{const n=e.data.contents[0];this.id=n.id,this.content=n.content}).catch(e=>{console.error("Error fetching content:",e)})},deleteCategory(t){console.log("Delete category")},editCategory(t){console.log("Edit category")},checkUncheckCategory(t){console.log("Unchecked category")},deleteSkill(t){console.log("Delete skill ",t),Se.post("/delete_skill",{client_id:this.$store.state.client_id,skill_id:t}).then(()=>{this.fetchTitles()})},editTitle(t){Se.post("/edit_skill_title",{client_id:this.$store.state.client_id,skill_id:t,title:t}).then(()=>{this.fetchTitles()}),console.log("Edit title")},makeTitle(t){console.log("Make title")},checkUncheckTitle(t){},searchSkills(){}}},QEt={id:"leftPanel",class:"flex flex-row h-full flex-grow shadow-lg rounded"},XEt={class:"min-w-[23rem] max-w-[23rem] z-10 top-0 bg-bg-light-tone dark:bg-bg-dark-tone shadow-md overflow-y-scroll no-scrollbar"},ZEt={class:"search p-4"},JEt={classclass:"absolute flex flex-col no-scrollbar shadow-lg min-w-[24rem] max-w-[24rem] bg-bg-light-tone dark:bg-bg-dark-tone top-20 left-20 bottom-20 right-20 bg-bg-light shadow-lg rounded"},eyt=c("h2",{class:"text-xl font-bold m-4"},"Titles",-1),tyt={class:"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"},nyt=c("h2",{class:"text-xl font-bold m-4"},"Content",-1);function iyt(t,e,n,i,s,r){const o=mt("Discussion"),a=mt("MarkdownRenderer");return w(),A("div",{class:ze([{hidden:!s.isVisible},"absolute flex flex-col no-scrollbar shadow-lg bg-bg-light dark:bg-bg-dark top-20 left-20 bottom-20 right-20 shadow-lg rounded"])},[c("div",QEt,[c("div",XEt,[c("div",ZEt,[G(c("input",{type:"text","onUpdate:modelValue":e[0]||(e[0]=l=>s.searchQuery=l),placeholder:"Search skills",class:"border border-gray-300 rounded px-2 py-1 mr-2"},null,512),[[we,s.searchQuery]]),c("button",{onClick:e[1]||(e[1]=(...l)=>r.searchSkills&&r.searchSkills(...l)),class:"bg-blue-500 text-white rounded px-4 py-1"},"Search")]),c("div",JEt,[eyt,s.titles.length>0?(w(),xt(os,{key:0,name:"list"},{default:We(()=>[(w(!0),A(Ye,null,lt(s.titles,l=>(w(),xt(o,{key:l.id,id:l.id,title:l.title,selected:r.fetchContent(l.id),loading:s.loading,isCheckbox:s.isCheckbox,checkBoxValue:!1,onSelect:u=>r.fetchContent(l.id),onDelete:u=>r.deleteSkill(l.id),onEditTitle:r.editTitle,onMakeTitle:r.makeTitle,onChecked:r.checkUncheckTitle},null,8,["id","title","selected","loading","isCheckbox","onSelect","onDelete","onEditTitle","onMakeTitle","onChecked"]))),128))]),_:1})):V("",!0)])]),c("div",tyt,[nyt,Te(a,{host:n.host,"markdown-text":s.content,message_id:s.id,discussion_id:s.id,client_id:this.$store.state.client_id},null,8,["host","markdown-text","message_id","discussion_id","client_id"])])]),c("button",{onClick:e[2]||(e[2]=(...l)=>r.closeComponent&&r.closeComponent(...l)),class:"absolute top-2 right-2 bg-red-500 text-white rounded px-2 py-1 hover:bg-red-300"},"Close")],2)}const bO=bt(jEt,[["render",iyt]]),syt={props:{htmlContent:{type:String,required:!0}}},ryt=["innerHTML"];function oyt(t,e,n,i,s,r){return w(),A("div",{class:"w-full h-full 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",innerHTML:n.htmlContent},null,8,ryt)}const ayt=bt(syt,[["render",oyt]]);const lyt={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}}},cyt={key:0},dyt={class:"toggle-icon mr-1"},uyt={key:0,class:"fas fa-plus-circle text-gray-600"},pyt={key:1,class:"fas fa-minus-circle text-gray-600"},_yt={class:"json-viewer max-h-64 overflow-auto p-4 bg-gray-100 border border-gray-300 rounded dark:bg-gray-600"},hyt={key:0,class:"fas fa-plus-circle text-gray-600"},fyt={key:1,class:"fas fa-minus-circle text-gray-600"},myt=["innerHTML"];function gyt(t,e,n,i,s,r){return r.isContentPresent?(w(),A("div",cyt,[c("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))},[c("span",dyt,[s.collapsed?(w(),A("i",uyt)):(w(),A("i",pyt))]),et(" "+he(n.jsonFormText),1)]),G(c("div",null,[c("div",_yt,[r.isObject?(w(),A("span",{key:0,onClick:e[1]||(e[1]=(...o)=>r.toggleCollapsed&&r.toggleCollapsed(...o)),class:"toggle-icon cursor-pointer mr-1"},[s.collapsed?(w(),A("i",hyt)):(w(),A("i",fyt))])):V("",!0),c("pre",{innerHTML:r.formattedJson},null,8,myt)])],512),[[Mt,!s.collapsed]])])):V("",!0)}const byt=bt(lyt,[["render",gyt]]),Eyt={props:{done:{type:Boolean,required:!0},message:{type:String,required:!0},status:{type:Boolean,required:!0},step_type:{type:String,required:!1,default:"start_end"}}},yyt={class:"flex items-start"},vyt={class:"step flex items-center mb-4"},Syt={key:0,class:"flex items-center justify-center w-6 h-6 mr-2"},Tyt={key:0},xyt=c("i",{"data-feather":"square",class:"text-gray-400 w-4 h-4"},null,-1),Cyt=[xyt],wyt={key:1},Ryt=c("i",{"data-feather":"check-square",class:"text-green-500 w-4 h-4"},null,-1),Ayt=[Ryt],Nyt={key:2},Oyt=c("i",{"data-feather":"x-square",class:"text-red-500 w-4 h-4"},null,-1),Iyt=[Oyt],Myt={key:1,role:"status",class:"m-15"},Dyt=c("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"},[c("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),c("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),kyt=[Dyt],Lyt={class:"text-sm ml-6"};function Pyt(t,e,n,i,s,r){return w(),A("div",yyt,[c("div",vyt,[n.step_type=="start_end"?(w(),A("div",Syt,[n.done?V("",!0):(w(),A("div",Tyt,Cyt)),n.done&&n.status?(w(),A("div",wyt,Ayt)):V("",!0),n.done&&!n.status?(w(),A("div",Nyt,Iyt)):V("",!0)])):V("",!0),n.done?V("",!0):(w(),A("div",Myt,kyt)),c("h3",Lyt,he(n.message),1)])])}const Uyt=bt(Eyt,[["render",Pyt]]),Fyt="/assets/process-61f7a21b.svg",Byt="/assets/ok-a0b56451.svg",Gyt="/assets/failed-183609e7.svg",EO="/assets/send_globe-305330b9.svg";const Vyt="/",zyt={name:"Message",emits:["copy","delete","rankUp","rankDown","updateMessage","resendMessage","continueMessage"],components:{MarkdownRenderer:ip,Step:Uyt,RenderHTMLJS:ayt,JsonViewer:byt,DynamicUIRenderer:mO},props:{host:{type:String,required:!1,default:"http://localhost:9600"},message:Object,avatar:{default:""}},data(){return{isSynthesizingVoice:!1,cpp_block:dO,html5_block:uO,LaTeX_block:pO,json_block:cO,javascript_block:lO,process_svg:Fyt,ok_svg:Byt,failed_svg:Gyt,loading_svg:hO,sendGlobe:EO,code_block:oO,python_block:aO,bash_block:_O,audio_url:null,audio:null,msg:null,isSpeaking:!1,speechSynthesis:null,voices:[],expanded:!1,showConfirmation:!1,editMsgMode_:!1,deleteMsgMode:!1,mdRenderHeight:Number}},mounted(){if("speechSynthesis"in window?(this.speechSynthesis=window.speechSynthesis,this.voices=this.speechSynthesis.getVoices(),this.voices.length===0?this.speechSynthesis.addEventListener("voiceschanged",this.onVoicesChanged):console.log("No voices found")):console.error("Speech synthesis is not supported in this browser."),Ge(()=>{He.replace(),this.mdRenderHeight=this.$refs.mdRender.$el.offsetHeight}),console.log("Checking metadata"),console.log(this.message),Object.prototype.hasOwnProperty.call(this.message,"metadata")&&this.message.metadata!=null){console.log("Metadata found!"),Array.isArray(this.message.metadata)||(this.message.metadata=[]),console.log(typeof this.message.metadata),console.log(this.message.metadata);for(let t of this.message.metadata)Object.prototype.hasOwnProperty.call(t,"audio_url")&&t.audio_url!=null&&(this.audio_url=t.audio_url,console.log("Audio URL:",this.audio_url))}},methods:{computeTimeDiff(t,e){let n=e.getTime()-t.getTime();const i=Math.floor(n/(1e3*60*60));n-=i*(1e3*60*60);const s=Math.floor(n/(1e3*60));n-=s*(1e3*60);const r=Math.floor(n/1e3);return n-=r*1e3,[i,s,r]},insertTab(t){const e=t.target,n=e.selectionStart,i=e.selectionEnd,s=t.shiftKey;if(n===i)if(s){if(e.value.substring(n-4,n)==" "){const r=e.value.substring(0,n-4),o=e.value.substring(i),a=r+o;this.message.content=a,this.$nextTick(()=>{e.selectionStart=e.selectionEnd=n-4})}}else{const r=e.value.substring(0,n),o=e.value.substring(i),a=r+" "+o;this.message.content=a,this.$nextTick(()=>{e.selectionStart=e.selectionEnd=n+4})}else{const o=e.value.substring(n,i).split(` +Here is how you can do that`))},xft)])]),c("tr",null,[Cft,c("td",null,[c("div",wft,[c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[360]||(e[360]=(..._)=>r.reinstallPetalsService&&r.reinstallPetalsService(..._))},"install petals service")])])]),c("tr",null,[Rft,c("td",null,[c("div",Aft,[G(c("input",{type:"text",id:"petals_base_url",required:"","onUpdate:modelValue":e[361]||(e[361]=_=>r.configFile.petals_base_url=_),onChange:e[362]||(e[362]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.petals_base_url]])])])])])]),_:1})]),_:1}),Te(o,{title:"Misc",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[Te(o,{title:"Motion Ctrl service",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",Nft,[c("tr",null,[Oft,c("td",null,[c("div",Ift,[G(c("input",{type:"checkbox",id:"enable_motion_ctrl_service",required:"","onUpdate:modelValue":e[363]||(e[363]=_=>r.configFile.enable_motion_ctrl_service=_),onChange:e[364]||(e[364]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.enable_motion_ctrl_service]])])]),c("td",null,[c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[365]||(e[365]=_=>this.$store.state.messageBox.showMessage("Activates Motion ctrl service. The service will be automatically loaded at startup alowing you to use the motoin control endpoint to generate videos"))},Dft)])]),c("tr",null,[kft,c("td",null,[c("div",Lft,[c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[366]||(e[366]=(..._)=>r.reinstallMotionCtrlService&&r.reinstallMotionCtrlService(..._))},"install Motion Ctrl service")])])]),c("tr",null,[Pft,c("td",null,[c("div",Uft,[G(c("input",{type:"text",id:"sd_base_url",required:"","onUpdate:modelValue":e[367]||(e[367]=_=>r.configFile.sd_base_url=_),onChange:e[368]||(e[368]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.sd_base_url]])])])])])]),_:1}),Te(o,{title:"Elastic search Service (under construction)",is_subcard:!0,class:"pb-2 m-2"},{default:We(()=>[c("table",Fft,[c("tr",null,[Bft,c("td",null,[c("div",Gft,[G(c("input",{type:"checkbox",id:"elastic_search_service",required:"","onUpdate:modelValue":e[369]||(e[369]=_=>r.configFile.elastic_search_service=_),onChange:e[370]||(e[370]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ze,r.configFile.elastic_search_service]])])])]),c("tr",null,[Vft,c("td",null,[c("div",zft,[c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[371]||(e[371]=(..._)=>r.reinstallElasticSearchService&&r.reinstallElasticSearchService(..._))},"install ElasticSearch service")])])]),c("tr",null,[Hft,c("td",null,[c("div",qft,[G(c("input",{type:"text",id:"elastic_search_url",required:"","onUpdate:modelValue":e[372]||(e[372]=_=>r.configFile.elastic_search_url=_),onChange:e[373]||(e[373]=_=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[we,r.configFile.elastic_search_url]])])])])])]),_:1})]),_:1})],2)]),c("div",Yft,[c("div",$ft,[c("button",{onClick:e[374]||(e[374]=be(_=>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"},[G(c("div",null,Kft,512),[[Mt,s.bzc_collapsed]]),G(c("div",null,Qft,512),[[Mt,!s.bzc_collapsed]]),Xft,r.configFile.binding_name?V("",!0):(w(),A("div",Zft,[Jft,et(" No binding selected! ")])),r.configFile.binding_name?(w(),A("div",emt,"|")):V("",!0),r.configFile.binding_name?(w(),A("div",tmt,[c("div",nmt,[c("img",{src:r.imgBinding,class:"w-8 h-8 rounded-full object-fill text-blue-700"},null,8,imt),c("h3",smt,he(r.binding_name),1)])])):V("",!0)])]),c("div",{class:ze([{hidden:s.bzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[r.bindingsZoo&&r.bindingsZoo.length>0?(w(),A("div",rmt,[c("label",omt," Bindings: ("+he(r.bindingsZoo.length)+") ",1),c("div",{class:ze(["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"])},[Te(os,{name:"list"},{default:We(()=>[(w(!0),A(Ye,null,lt(r.bindingsZoo,(_,m)=>(w(),xt(a,{ref_for:!0,ref:"bindingZoo",key:"index-"+m+"-"+_.folder,binding:_,"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:_.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)])):V("",!0),s.bzl_collapsed?(w(),A("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[375]||(e[375]=_=>s.bzl_collapsed=!s.bzl_collapsed)},lmt)):(w(),A("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[376]||(e[376]=_=>s.bzl_collapsed=!s.bzl_collapsed)},dmt))],2)]),c("div",umt,[c("div",pmt,[c("button",{onClick:e[377]||(e[377]=be(_=>r.modelsZooToggleCollapse(),["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[G(c("div",null,hmt,512),[[Mt,s.mzc_collapsed]]),G(c("div",null,mmt,512),[[Mt,!s.mzc_collapsed]]),gmt,c("div",bmt,[r.configFile.binding_name?V("",!0):(w(),A("div",Emt,[ymt,et(" Select binding first! ")])),!r.configFile.model_name&&r.configFile.binding_name?(w(),A("div",vmt,[Smt,et(" No model selected! ")])):V("",!0),r.configFile.model_name?(w(),A("div",Tmt,"|")):V("",!0),r.configFile.model_name?(w(),A("div",xmt,[c("div",Cmt,[c("img",{src:r.imgModel,class:"w-8 h-8 rounded-lg object-fill"},null,8,wmt),c("h3",Rmt,he(r.configFile.model_name),1)])])):V("",!0)])])]),c("div",{class:ze([{hidden:s.mzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",Amt,[c("div",Nmt,[c("div",Omt,[s.searchModelInProgress?(w(),A("div",Imt,Dmt)):V("",!0),s.searchModelInProgress?V("",!0):(w(),A("div",kmt,Pmt))]),G(c("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[378]||(e[378]=_=>s.searchModel=_),onKeyup:e[379]||(e[379]=Hs((..._)=>r.searchModel_func&&r.searchModel_func(..._),["enter"]))},null,544),[[we,s.searchModel]]),s.searchModel?(w(),A("button",{key:0,onClick:e[380]||(e[380]=be(_=>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")):V("",!0)])]),c("div",null,[G(c("input",{"onUpdate:modelValue":e[381]||(e[381]=_=>s.show_only_installed_models=_),class:"m-2 p-2",type:"checkbox",ref:"only_installed"},null,512),[[Ze,s.show_only_installed_models]]),Umt]),c("div",null,[Te(l,{radioOptions:s.sortOptions,onRadioSelected:r.handleRadioSelected},null,8,["radioOptions","onRadioSelected"])]),Fmt,s.is_loading_zoo?(w(),A("div",Bmt,zmt)):V("",!0),s.models_zoo&&s.models_zoo.length>0?(w(),A("div",Hmt,[c("label",qmt," Models: ("+he(s.models_zoo.length)+") ",1),c("div",{class:ze(["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"])},[Te(os,{name:"list"},{default:We(()=>[(w(!0),A(Ye,null,lt(r.rendered_models_zoo,(_,m)=>(w(),xt(u,{ref_for:!0,ref:"modelZoo",key:"index-"+m+"-"+_.name,model:_,"is-installed":_.isInstalled,"on-install":r.onInstall,"on-uninstall":r.onUninstall,"on-selected":r.onModelSelected,selected:_.name===r.configFile.model_name,model_type:_.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)),c("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[382]||(e[382]=(..._)=>r.load_more_models&&r.load_more_models(..._))},"Load more models",512)]),_:1})],2)])):V("",!0),s.mzl_collapsed?(w(),A("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[383]||(e[383]=(..._)=>r.open_mzl&&r.open_mzl(..._))},$mt)):(w(),A("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[384]||(e[384]=(..._)=>r.open_mzl&&r.open_mzl(..._))},Kmt)),c("div",jmt,[c("div",Qmt,[c("div",null,[c("div",Xmt,[Zmt,G(c("input",{type:"text","onUpdate:modelValue":e[385]||(e[385]=_=>s.reference_path=_),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),[[we,s.reference_path]])]),c("button",{type:"button",onClick:e[386]||(e[386]=be(_=>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?V("",!0):(w(),A("div",Jmt,[c("div",egt,[tgt,G(c("input",{type:"text","onUpdate:modelValue":e[387]||(e[387]=_=>s.addModel.url=_),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),[[we,s.addModel.url]])]),c("button",{type:"button",onClick:e[388]||(e[388]=be(_=>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?(w(),A("div",ngt,[igt,c("div",sgt,[c("div",rgt,[c("div",ogt,[agt,c("span",lgt,he(Math.floor(s.addModel.progress))+"%",1)]),c("div",{class:"mx-1 opacity-80 line-clamp-1",title:s.addModel.url},he(s.addModel.url),9,cgt),c("div",dgt,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:en({width:s.addModel.progress+"%"})},null,4)]),c("div",ugt,[c("span",pgt,"Download speed: "+he(r.speed_computed)+"/s",1),c("span",_gt,he(r.downloaded_size_computed)+"/"+he(r.total_size_computed),1)])])]),c("div",hgt,[c("div",fgt,[c("div",mgt,[c("button",{onClick:e[389]||(e[389]=be((..._)=>r.onCancelInstall&&r.onCancelInstall(..._),["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 ")])])])])):V("",!0)])])],2)]),c("div",ggt,[c("div",bgt,[c("button",{onClick:e[392]||(e[392]=be(_=>s.pzc_collapsed=!s.pzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 text-left w-full flex items-center"},[G(c("div",null,ygt,512),[[Mt,s.pzc_collapsed]]),G(c("div",null,Sgt,512),[[Mt,!s.pzc_collapsed]]),Tgt,r.configFile.personalities?(w(),A("div",xgt,"|")):V("",!0),c("div",Cgt,he(r.active_pesonality),1),r.configFile.personalities?(w(),A("div",wgt,"|")):V("",!0),r.configFile.personalities?(w(),A("div",Rgt,[r.mountedPersArr.length>0?(w(),A("div",Agt,[(w(!0),A(Ye,null,lt(r.mountedPersArr,(_,m)=>(w(),A("div",{class:"relative hover:-translate-y-2 duration-300 hover:z-10 shrink-0",key:m+"-"+_.name,ref_for:!0,ref:"mountedPersonalities"},[c("div",Ngt,[c("button",{onClick:be(E=>r.onPersonalitySelected(_),["stop"])},[c("img",{src:s.bUrl+_.avatar,onError:e[390]||(e[390]=(...E)=>r.personalityImgPlacehodler&&r.personalityImgPlacehodler(...E)),class:ze(["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(_.full_path)?"border-secondary":"border-transparent z-0"]),title:_.name},null,42,Igt)],8,Ogt),c("button",{onClick:be(E=>r.unmountPersonality(_),["stop"])},kgt,8,Mgt)])]))),128))])):V("",!0)])):V("",!0),c("button",{onClick:e[391]||(e[391]=be(_=>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"},Pgt)])]),c("div",{class:ze([{hidden:s.pzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",Ugt,[Fgt,c("div",Bgt,[c("div",Ggt,[s.searchPersonalityInProgress?(w(),A("div",Vgt,Hgt)):V("",!0),s.searchPersonalityInProgress?V("",!0):(w(),A("div",qgt,$gt))]),G(c("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[393]||(e[393]=_=>s.searchPersonality=_),onKeyup:e[394]||(e[394]=be((..._)=>r.searchPersonality_func&&r.searchPersonality_func(..._),["stop"]))},null,544),[[we,s.searchPersonality]]),s.searchPersonality?(w(),A("button",{key:0,onClick:e[395]||(e[395]=be(_=>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")):V("",!0)])]),s.searchPersonality?V("",!0):(w(),A("div",Wgt,[c("label",Kgt," Personalities Category: ("+he(s.persCatgArr.length)+") ",1),c("select",{id:"persCat",onChange:e[396]||(e[396]=_=>r.update_personality_category(_.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"},[(w(!0),A(Ye,null,lt(s.persCatgArr,(_,m)=>(w(),A("option",{key:m,selected:_==this.configFile.personality_category},he(_),9,jgt))),128))],32)])),c("div",null,[s.personalitiesFiltered.length>0?(w(),A("div",Qgt,[c("label",Xgt,he(s.searchPersonality?"Search results":"Personalities")+": ("+he(s.personalitiesFiltered.length)+") ",1),c("div",{class:ze(["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"])},[Te(os,{name:"bounce"},{default:We(()=>[(w(!0),A(Ye,null,lt(s.personalitiesFiltered,(_,m)=>(w(),xt(d,{ref_for:!0,ref:"personalitiesZoo",key:"index-"+m+"-"+_.name,personality:_,select_language:!0,full_path:_.full_path,selected:r.configFile.active_personality_id==r.configFile.personalities.findIndex(E=>E===_.full_path||E===_.full_path+":"+_.language),"on-selected":r.onPersonalitySelected,"on-mount":r.mountPersonality,"on-un-mount":r.unmountPersonality,"on-remount":r.remountPersonality,"on-edit":r.editPersonality,"on-copy-to-custom":r.copyToCustom,"on-reinstall":r.onPersonalityReinstall,"on-settings":r.onSettingsPersonality,"on-copy-personality-name":r.onCopyPersonalityName,"on-copy-to_custom":r.onCopyToCustom,"on-open-folder":r.handleOpenFolder},null,8,["personality","full_path","selected","on-selected","on-mount","on-un-mount","on-remount","on-edit","on-copy-to-custom","on-reinstall","on-settings","on-copy-personality-name","on-copy-to_custom","on-open-folder"]))),128))]),_:1})],2)])):V("",!0)]),s.pzl_collapsed?(w(),A("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[397]||(e[397]=_=>s.pzl_collapsed=!s.pzl_collapsed)},Jgt)):(w(),A("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[398]||(e[398]=_=>s.pzl_collapsed=!s.pzl_collapsed)},tbt))],2)]),c("div",nbt,[c("div",ibt,[c("button",{onClick:e[399]||(e[399]=be(_=>s.mc_collapsed=!s.mc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[G(c("div",null,rbt,512),[[Mt,s.mc_collapsed]]),G(c("div",null,abt,512),[[Mt,!s.mc_collapsed]]),lbt])]),c("div",{class:ze([{hidden:s.mc_collapsed},"flex flex-col mb-2 p-2"])},[c("div",cbt,[c("div",dbt,[G(c("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[400]||(e[400]=be(()=>{},["stop"])),"onUpdate:modelValue":e[401]||(e[401]=_=>r.configFile.override_personality_model_parameters=_),onChange:e[402]||(e[402]=_=>r.update_setting("override_personality_model_parameters",r.configFile.override_personality_model_parameters))},null,544),[[Ze,r.configFile.override_personality_model_parameters]]),ubt])]),c("div",{class:ze(r.configFile.override_personality_model_parameters?"":"pointer-events-none opacity-30")},[c("div",pbt,[_bt,G(c("input",{type:"text",id:"seed","onUpdate:modelValue":e[403]||(e[403]=_=>r.configFile.seed=_),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),[[we,r.configFile.seed]])]),c("div",hbt,[c("div",fbt,[c("div",mbt,[gbt,c("p",bbt,[G(c("input",{type:"text",id:"temp-val","onUpdate:modelValue":e[404]||(e[404]=_=>r.configFile.temperature=_),onChange:e[405]||(e[405]=_=>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),[[we,r.configFile.temperature]])])]),G(c("input",{id:"temperature",onChange:e[406]||(e[406]=_=>s.settingsChanged=!0),type:"range","onUpdate:modelValue":e[407]||(e[407]=_=>r.configFile.temperature=_),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),[[we,r.configFile.temperature]])])]),c("div",Ebt,[c("div",ybt,[c("div",vbt,[Sbt,c("p",Tbt,[G(c("input",{type:"text",id:"predict-val","onUpdate:modelValue":e[408]||(e[408]=_=>r.configFile.n_predict=_),onChange:e[409]||(e[409]=_=>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),[[we,r.configFile.n_predict]])])]),G(c("input",{id:"predict",type:"range",onChange:e[410]||(e[410]=_=>s.settingsChanged=!0),"onUpdate:modelValue":e[411]||(e[411]=_=>r.configFile.n_predict=_),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),[[we,r.configFile.n_predict]])])]),c("div",xbt,[c("div",Cbt,[c("div",wbt,[Rbt,c("p",Abt,[G(c("input",{type:"text",id:"top_k-val","onUpdate:modelValue":e[412]||(e[412]=_=>r.configFile.top_k=_),onChange:e[413]||(e[413]=_=>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),[[we,r.configFile.top_k]])])]),G(c("input",{id:"top_k",type:"range",onChange:e[414]||(e[414]=_=>s.settingsChanged=!0),"onUpdate:modelValue":e[415]||(e[415]=_=>r.configFile.top_k=_),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),[[we,r.configFile.top_k]])])]),c("div",Nbt,[c("div",Obt,[c("div",Ibt,[Mbt,c("p",Dbt,[G(c("input",{type:"text",id:"top_p-val","onUpdate:modelValue":e[416]||(e[416]=_=>r.configFile.top_p=_),onChange:e[417]||(e[417]=_=>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),[[we,r.configFile.top_p]])])]),G(c("input",{id:"top_p",type:"range","onUpdate:modelValue":e[418]||(e[418]=_=>r.configFile.top_p=_),min:"0",max:"1",step:"0.01",onChange:e[419]||(e[419]=_=>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),[[we,r.configFile.top_p]])])]),c("div",kbt,[c("div",Lbt,[c("div",Pbt,[Ubt,c("p",Fbt,[G(c("input",{type:"text",id:"repeat_penalty-val","onUpdate:modelValue":e[420]||(e[420]=_=>r.configFile.repeat_penalty=_),onChange:e[421]||(e[421]=_=>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),[[we,r.configFile.repeat_penalty]])])]),G(c("input",{id:"repeat_penalty",onChange:e[422]||(e[422]=_=>s.settingsChanged=!0),type:"range","onUpdate:modelValue":e[423]||(e[423]=_=>r.configFile.repeat_penalty=_),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),[[we,r.configFile.repeat_penalty]])])]),c("div",Bbt,[c("div",Gbt,[c("div",Vbt,[zbt,c("p",Hbt,[G(c("input",{type:"text",id:"repeat_last_n-val","onUpdate:modelValue":e[424]||(e[424]=_=>r.configFile.repeat_last_n=_),onChange:e[425]||(e[425]=_=>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),[[we,r.configFile.repeat_last_n]])])]),G(c("input",{id:"repeat_last_n",type:"range","onUpdate:modelValue":e[426]||(e[426]=_=>r.configFile.repeat_last_n=_),min:"0",max:"100",step:"1",onChange:e[427]||(e[427]=_=>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),[[we,r.configFile.repeat_last_n]])])])],2)],2)])],2)]),Te(h,{ref:"addmodeldialog"},null,512),Te(f,{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 Ybt=bt(Yrt,[["render",qbt],["__scopeId","data-v-39a73106"]]),$bt={components:{ClipBoardTextInput:xE,Card:rp},data(){return{dataset_path:"",max_length:1024,batch_size:4,lr:5e-5,num_epochs:2,selectedFolder:"",selectedDataset:""}},methods:{submitForm(){const t={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};Se.post("/start_training",t).then(e=>{})},openFolderSelector(){this.$refs.folder_selector.click()},selectOutputDirectory(t){var n;console.log("here");const e=(n=t.target.files[0])==null?void 0:n.path;console.log(e),e&&(this.selectedFolder=e)},selectDataset(t){const e=t.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(t){console.log("watching model_name",t),this.$refs.clipboardInput.inputValue=t}}},Wbt={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"},Kbt={class:"mb-4"},jbt=c("label",{for:"model_name",class:"text-sm"},"Model Name:",-1),Qbt=["value"],Xbt={class:"mb-4"},Zbt=c("label",{for:"dataset_path",class:"text-sm"},"Dataset:",-1),Jbt={class:"mb-4"},eEt=c("label",{for:"lr",class:"text-sm"},"Learning Rate:",-1),tEt={class:"mb-4"},nEt=c("label",{for:"num_epochs",class:"text-sm"},"Number of Epochs:",-1),iEt={class:"mb-4"},sEt=c("label",{for:"max_length",class:"text-sm"},"Max Length:",-1),rEt={class:"mb-4"},oEt=c("label",{for:"batch_size",class:"text-sm"},"Batch Size:",-1),aEt={class:"mb-4"},lEt=c("label",{for:"output_dir",class:"text-sm"},"Output Directory:",-1),cEt=c("button",{class:"bg-blue-500 text-white px-4 py-2 rounded"},"Start training",-1),dEt={key:1};function uEt(t,e,n,i,s,r){const o=mt("Card"),a=mt("ClipBoardTextInput");return r.selectedModel!==null&&r.selectedModel.toLowerCase().includes("gptq")?(w(),A("div",Wbt,[c("form",{onSubmit:e[2]||(e[2]=be((...l)=>r.submitForm&&r.submitForm(...l),["prevent"])),class:""},[Te(o,{title:"Training configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:We(()=>[Te(o,{title:"Model",class:"",isHorizontal:!1},{default:We(()=>[c("div",Kbt,[jbt,G(c("select",{"onUpdate:modelValue":e[0]||(e[0]=l=>r.selectedModel=l),onChange:e[1]||(e[1]=(...l)=>t.setModel&&t.setModel(...l)),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},[(w(!0),A(Ye,null,lt(r.models,l=>(w(),A("option",{key:l,value:l},he(l),9,Qbt))),128))],544),[[jt,r.selectedModel]])])]),_:1}),Te(o,{title:"Data",isHorizontal:!1},{default:We(()=>[c("div",Xbt,[Zbt,Te(a,{id:"model_path",inputType:"file",value:s.dataset_path,onchange:"selectDataset()"},null,8,["value"])])]),_:1}),Te(o,{title:"Training",isHorizontal:!1},{default:We(()=>[c("div",Jbt,[eEt,Te(a,{id:"model_path",inputType:"integer",value:s.lr},null,8,["value"])]),c("div",tEt,[nEt,Te(a,{id:"model_path",inputType:"integer",value:s.num_epochs},null,8,["value"])]),c("div",iEt,[sEt,Te(a,{id:"model_path",inputType:"integer",value:s.max_length},null,8,["value"])]),c("div",rEt,[oEt,Te(a,{id:"model_path",inputType:"integer",value:s.batch_size},null,8,["value"])])]),_:1}),Te(o,{title:"Output",isHorizontal:!1},{default:We(()=>[c("div",aEt,[lEt,Te(a,{id:"model_path",inputType:"text",value:t.output_dir},null,8,["value"])])]),_:1})]),_:1}),Te(o,{disableHoverAnimation:!0,disableFocus:!0},{default:We(()=>[cEt]),_:1})],32)])):(w(),A("div",dEt,[Te(o,{title:"Info",class:"",isHorizontal:!1},{default:We(()=>[et(" Only GPTQ models are supported for QLora fine tuning. Please select a GPTQ compatible binding. ")]),_:1})]))}const pEt=bt($bt,[["render",uEt]]),_Et={components:{ClipBoardTextInput:xE,Card:rp},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(t){var n;console.log("here");const e=(n=t.target.files[0])==null?void 0:n.path;console.log(e),e&&(this.selectedFolder=e)},selectDatasetPath(t){const e=t.target.files;e.length>0&&(this.selectedDatasetPath=e[0].webkitRelativePath)}}},hEt={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"},fEt={class:"mb-4"},mEt=c("label",{for:"model_name",class:"text-sm"},"Model Name:",-1),gEt={class:"mb-4"},bEt=c("label",{for:"tokenizer_name",class:"text-sm"},"Tokenizer Name:",-1),EEt=c("button",{type:"submit",class:"bg-blue-500 text-white px-4 py-2 rounded"},"Quantize LLM",-1);function yEt(t,e,n,i,s,r){const o=mt("ClipBoardTextInput"),a=mt("Card");return w(),A("div",hEt,[c("form",{onSubmit:e[0]||(e[0]=be((...l)=>r.submitForm&&r.submitForm(...l),["prevent"])),class:"max-w-md mx-auto"},[Te(a,{title:"Quantizing configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:We(()=>[Te(a,{title:"Model",class:"",isHorizontal:!1},{default:We(()=>[c("div",fEt,[mEt,Te(o,{id:"model_path",inputType:"text",value:s.model_name},null,8,["value"])]),c("div",gEt,[bEt,Te(o,{id:"model_path",inputType:"text",value:s.tokenizer_name},null,8,["value"])])]),_:1})]),_:1}),Te(a,{disableHoverAnimation:!0,disableFocus:!0},{default:We(()=>[EEt]),_:1})],32)])}const vEt=bt(_Et,[["render",yEt]]),SEt={name:"Discussion",emits:["delete","select","openFolder","editTitle","makeTitle","checked"],props:{id:Number,title:String,selected:Boolean,loading:Boolean,isCheckbox:Boolean,checkBoxValue:Boolean},setup(){},data(){return{showConfirmation:!1,editTitleMode:!1,makeTitleMode:!1,deleteMode:!1,openFolder:!1,editTitle:!1,newTitle:String,checkBoxValue_local:!1}},methods:{cancel(){this.editTitleMode=!1,this.makeTitleMode=!1,this.deleteMode=!1,this.showConfirmation=!1},deleteEvent(){this.showConfirmation=!1,this.$emit("delete")},selectEvent(){this.$emit("select")},openFolderEvent(){this.$emit("openFolder",{id:this.id})},editTitleEvent(){this.editTitle=!1,this.editTitleMode=!1,this.makeTitleMode=!1,this.deleteMode=!1,this.showConfirmation=!1,this.$emit("editTitle",{title:this.newTitle,id:this.id})},makeTitleEvent(){this.$emit("makeTitle",{id:this.id}),this.showConfirmation=!1},chnageTitle(t){this.newTitle=t},checkedChangeEvent(t,e){this.$emit("checked",t,e)}},mounted(){this.newTitle=this.title,Ge(()=>{He.replace()})},watch:{showConfirmation(){Ge(()=>{He.replace()})},editTitleMode(t){this.showConfirmation=t,this.editTitle=t,t&&Ge(()=>{try{this.$refs.titleBox.focus()}catch{}})},deleteMode(t){this.showConfirmation=t,t&&Ge(()=>{this.$refs.titleBox.focus()})},makeTitleMode(t){this.showConfirmation=t},checkBoxValue(t,e){this.checkBoxValue_local=t}}},TEt=["id"],xEt={class:"flex flex-row items-center gap-2"},CEt={key:0},wEt={class:"flex flex-row items-center w-full"},REt=["title"],AEt=["value"],NEt={class:"flex items-center flex-1 max-h-6"},OEt={key:0,class:"flex gap-3 flex-1 items-center justify-end duration-75"},IEt=c("i",{"data-feather":"x"},null,-1),MEt=[IEt],DEt=c("i",{"data-feather":"check"},null,-1),kEt=[DEt],LEt={key:1,class:"flex gap-3 flex-1 items-center justify-end invisible group-hover:visible duration-75"},PEt=c("i",{"data-feather":"folder"},null,-1),UEt=[PEt],FEt=c("i",{"data-feather":"type"},null,-1),BEt=[FEt],GEt=c("i",{"data-feather":"edit-2"},null,-1),VEt=[GEt],zEt=c("i",{"data-feather":"trash"},null,-1),HEt=[zEt];function qEt(t,e,n,i,s,r){return w(),A("div",{class:ze([n.selected?"bg-bg-light-discussion dark:bg-bg-dark-discussion shadow-md min-w-[23rem] max-w-[23rem]":" min-w-[23rem] max-w-[23rem]","flex flex-row sm:flex-row flex-wrap flex-shrink: 0 item-center shadow-sm 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"]),id:"dis-"+n.id,onClick:e[13]||(e[13]=be(o=>r.selectEvent(),["stop"]))},[c("div",xEt,[n.isCheckbox?(w(),A("div",CEt,[G(c("input",{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[0]||(e[0]=be(()=>{},["stop"])),"onUpdate:modelValue":e[1]||(e[1]=o=>s.checkBoxValue_local=o),onInput:e[2]||(e[2]=o=>r.checkedChangeEvent(o,n.id))},null,544),[[Ze,s.checkBoxValue_local]])])):V("",!0),n.selected?(w(),A("div",{key:1,class:ze(["min-h-full w-2 rounded-xl self-stretch",n.loading?"animate-bounce bg-accent ":" bg-secondary "])},null,2)):V("",!0),n.selected?V("",!0):(w(),A("div",{key:2,class:ze(["w-2",n.loading?"min-h-full w-2 rounded-xl self-stretch animate-bounce bg-accent ":" "])},null,2))]),c("div",wEt,[s.editTitle?V("",!0):(w(),A("p",{key:0,title:n.title,class:"line-clamp-1 w-4/6 ml-1 -mx-5"},he(n.title?n.title==="untitled"?"New discussion":n.title:"New discussion"),9,REt)),s.editTitle?(w(),A("input",{key:1,type:"text",id:"title-box",ref:"titleBox",class:"bg-bg-light dark:bg-bg-dark rounded-md border-0 w-full -m-1 p-1",value:n.title,required:"",onKeydown:[e[3]||(e[3]=Hs(be(o=>r.editTitleEvent(),["exact"]),["enter"])),e[4]||(e[4]=Hs(be(o=>s.editTitleMode=!1,["exact"]),["esc"]))],onInput:e[5]||(e[5]=o=>r.chnageTitle(o.target.value)),onClick:e[6]||(e[6]=be(()=>{},["stop"]))},null,40,AEt)):V("",!0),c("div",NEt,[s.showConfirmation?(w(),A("div",OEt,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Discard title changes",type:"button",onClick:e[7]||(e[7]=be(o=>r.cancel(),["stop"]))},MEt),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm title changes",type:"button",onClick:e[8]||(e[8]=be(o=>s.editTitleMode?r.editTitleEvent():s.deleteMode?r.deleteEvent():r.makeTitleEvent(),["stop"]))},kEt)])):V("",!0),s.showConfirmation?V("",!0):(w(),A("div",LEt,[c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Open folder",type:"button",onClick:e[9]||(e[9]=be(o=>r.openFolderEvent(),["stop"]))},UEt),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Make a title",type:"button",onClick:e[10]||(e[10]=be(o=>s.makeTitleMode=!0,["stop"]))},BEt),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Edit title",type:"button",onClick:e[11]||(e[11]=be(o=>s.editTitleMode=!0,["stop"]))},VEt),c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Remove discussion",type:"button",onClick:e[12]||(e[12]=be(o=>s.deleteMode=!0,["stop"]))},HEt)]))])])],10,TEt)}const RE=bt(SEt,[["render",qEt]]),YEt={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(t){this.prompt=t}}},$Et={key:0,class:"fixed top-0 left-0 w-full h-full flex justify-center items-center bg-black bg-opacity-50"},WEt={class:"bg-white p-8 rounded"},KEt={class:"text-xl font-bold mb-4"};function jEt(t,e,n,i,s,r){return w(),A("div",null,[s.show?(w(),A("div",$Et,[c("div",WEt,[c("h2",KEt,he(n.promptText),1),G(c("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),[[we,s.inputText]]),c("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"),c("button",{onClick:e[2]||(e[2]=(...o)=>r.cancel&&r.cancel(...o)),class:"bg-gray-500 text-white px-4 py-2 rounded"},"Cancel")])])):V("",!0)])}const gO=bt(YEt,[["render",jEt]]),QEt={data(){return{id:0,loading:!1,isCheckbox:!1,isVisible:!1,categories:[],titles:[],content:"",searchQuery:""}},components:{Discussion:RE,MarkdownRenderer:ip},props:{host:{type:String,required:!1,default:"http://localhost:9600"}},methods:{showSkillsLibrary(){this.isVisible=!0,this.fetchTitles()},closeComponent(){this.isVisible=!1},fetchCategories(){Se.post("/get_skills_library_categories",{client_id:this.$store.state.client_id}).then(t=>{this.categories=t.data.categories}).catch(t=>{console.error("Error fetching categories:",t)})},fetchTitles(){console.log("Fetching categories"),Se.post("/get_skills_library_titles",{client_id:this.$store.state.client_id}).then(t=>{this.titles=t.data.titles,console.log("titles recovered")}).catch(t=>{console.error("Error fetching titles:",t)})},fetchContent(t){Se.post("/get_skills_library_content",{client_id:this.$store.state.client_id,skill_id:t}).then(e=>{const n=e.data.contents[0];this.id=n.id,this.content=n.content}).catch(e=>{console.error("Error fetching content:",e)})},deleteCategory(t){console.log("Delete category")},editCategory(t){console.log("Edit category")},checkUncheckCategory(t){console.log("Unchecked category")},deleteSkill(t){console.log("Delete skill ",t),Se.post("/delete_skill",{client_id:this.$store.state.client_id,skill_id:t}).then(()=>{this.fetchTitles()})},editTitle(t){Se.post("/edit_skill_title",{client_id:this.$store.state.client_id,skill_id:t,title:t}).then(()=>{this.fetchTitles()}),console.log("Edit title")},makeTitle(t){console.log("Make title")},checkUncheckTitle(t){},searchSkills(){}}},XEt={id:"leftPanel",class:"flex flex-row h-full flex-grow shadow-lg rounded"},ZEt={class:"min-w-[23rem] max-w-[23rem] z-10 top-0 bg-bg-light-tone dark:bg-bg-dark-tone shadow-md overflow-y-scroll no-scrollbar"},JEt={class:"search p-4"},eyt={classclass:"absolute flex flex-col no-scrollbar shadow-lg min-w-[24rem] max-w-[24rem] bg-bg-light-tone dark:bg-bg-dark-tone top-20 left-20 bottom-20 right-20 bg-bg-light shadow-lg rounded"},tyt=c("h2",{class:"text-xl font-bold m-4"},"Titles",-1),nyt={class:"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"},iyt=c("h2",{class:"text-xl font-bold m-4"},"Content",-1);function syt(t,e,n,i,s,r){const o=mt("Discussion"),a=mt("MarkdownRenderer");return w(),A("div",{class:ze([{hidden:!s.isVisible},"absolute flex flex-col no-scrollbar shadow-lg bg-bg-light dark:bg-bg-dark top-20 left-20 bottom-20 right-20 shadow-lg rounded"])},[c("div",XEt,[c("div",ZEt,[c("div",JEt,[G(c("input",{type:"text","onUpdate:modelValue":e[0]||(e[0]=l=>s.searchQuery=l),placeholder:"Search skills",class:"border border-gray-300 rounded px-2 py-1 mr-2"},null,512),[[we,s.searchQuery]]),c("button",{onClick:e[1]||(e[1]=(...l)=>r.searchSkills&&r.searchSkills(...l)),class:"bg-blue-500 text-white rounded px-4 py-1"},"Search")]),c("div",eyt,[tyt,s.titles.length>0?(w(),xt(os,{key:0,name:"list"},{default:We(()=>[(w(!0),A(Ye,null,lt(s.titles,l=>(w(),xt(o,{key:l.id,id:l.id,title:l.title,selected:r.fetchContent(l.id),loading:s.loading,isCheckbox:s.isCheckbox,checkBoxValue:!1,onSelect:u=>r.fetchContent(l.id),onDelete:u=>r.deleteSkill(l.id),onEditTitle:r.editTitle,onMakeTitle:r.makeTitle,onChecked:r.checkUncheckTitle},null,8,["id","title","selected","loading","isCheckbox","onSelect","onDelete","onEditTitle","onMakeTitle","onChecked"]))),128))]),_:1})):V("",!0)])]),c("div",nyt,[iyt,Te(a,{host:n.host,"markdown-text":s.content,message_id:s.id,discussion_id:s.id,client_id:this.$store.state.client_id},null,8,["host","markdown-text","message_id","discussion_id","client_id"])])]),c("button",{onClick:e[2]||(e[2]=(...l)=>r.closeComponent&&r.closeComponent(...l)),class:"absolute top-2 right-2 bg-red-500 text-white rounded px-2 py-1 hover:bg-red-300"},"Close")],2)}const bO=bt(QEt,[["render",syt]]),ryt={props:{htmlContent:{type:String,required:!0}}},oyt=["innerHTML"];function ayt(t,e,n,i,s,r){return w(),A("div",{class:"w-full h-full 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",innerHTML:n.htmlContent},null,8,oyt)}const lyt=bt(ryt,[["render",ayt]]);const cyt={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}}},dyt={key:0},uyt={class:"toggle-icon mr-1"},pyt={key:0,class:"fas fa-plus-circle text-gray-600"},_yt={key:1,class:"fas fa-minus-circle text-gray-600"},hyt={class:"json-viewer max-h-64 overflow-auto p-4 bg-gray-100 border border-gray-300 rounded dark:bg-gray-600"},fyt={key:0,class:"fas fa-plus-circle text-gray-600"},myt={key:1,class:"fas fa-minus-circle text-gray-600"},gyt=["innerHTML"];function byt(t,e,n,i,s,r){return r.isContentPresent?(w(),A("div",dyt,[c("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))},[c("span",uyt,[s.collapsed?(w(),A("i",pyt)):(w(),A("i",_yt))]),et(" "+he(n.jsonFormText),1)]),G(c("div",null,[c("div",hyt,[r.isObject?(w(),A("span",{key:0,onClick:e[1]||(e[1]=(...o)=>r.toggleCollapsed&&r.toggleCollapsed(...o)),class:"toggle-icon cursor-pointer mr-1"},[s.collapsed?(w(),A("i",fyt)):(w(),A("i",myt))])):V("",!0),c("pre",{innerHTML:r.formattedJson},null,8,gyt)])],512),[[Mt,!s.collapsed]])])):V("",!0)}const Eyt=bt(cyt,[["render",byt]]),yyt={props:{done:{type:Boolean,required:!0},message:{type:String,required:!0},status:{type:Boolean,required:!0},step_type:{type:String,required:!1,default:"start_end"}}},vyt={class:"flex items-start"},Syt={class:"step flex items-center mb-4"},Tyt={key:0,class:"flex items-center justify-center w-6 h-6 mr-2"},xyt={key:0},Cyt=c("i",{"data-feather":"square",class:"text-gray-400 w-4 h-4"},null,-1),wyt=[Cyt],Ryt={key:1},Ayt=c("i",{"data-feather":"check-square",class:"text-green-500 w-4 h-4"},null,-1),Nyt=[Ayt],Oyt={key:2},Iyt=c("i",{"data-feather":"x-square",class:"text-red-500 w-4 h-4"},null,-1),Myt=[Iyt],Dyt={key:1,role:"status",class:"m-15"},kyt=c("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"},[c("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),c("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),Lyt=[kyt],Pyt={class:"text-sm ml-6"};function Uyt(t,e,n,i,s,r){return w(),A("div",vyt,[c("div",Syt,[n.step_type=="start_end"?(w(),A("div",Tyt,[n.done?V("",!0):(w(),A("div",xyt,wyt)),n.done&&n.status?(w(),A("div",Ryt,Nyt)):V("",!0),n.done&&!n.status?(w(),A("div",Oyt,Myt)):V("",!0)])):V("",!0),n.done?V("",!0):(w(),A("div",Dyt,Lyt)),c("h3",Pyt,he(n.message),1)])])}const Fyt=bt(yyt,[["render",Uyt]]),Byt="/assets/process-61f7a21b.svg",Gyt="/assets/ok-a0b56451.svg",Vyt="/assets/failed-183609e7.svg",EO="/assets/send_globe-305330b9.svg";const zyt="/",Hyt={name:"Message",emits:["copy","delete","rankUp","rankDown","updateMessage","resendMessage","continueMessage"],components:{MarkdownRenderer:ip,Step:Fyt,RenderHTMLJS:lyt,JsonViewer:Eyt,DynamicUIRenderer:mO},props:{host:{type:String,required:!1,default:"http://localhost:9600"},message:Object,avatar:{default:""}},data(){return{isSynthesizingVoice:!1,cpp_block:dO,html5_block:uO,LaTeX_block:pO,json_block:cO,javascript_block:lO,process_svg:Byt,ok_svg:Gyt,failed_svg:Vyt,loading_svg:hO,sendGlobe:EO,code_block:oO,python_block:aO,bash_block:_O,audio_url:null,audio:null,msg:null,isSpeaking:!1,speechSynthesis:null,voices:[],expanded:!1,showConfirmation:!1,editMsgMode_:!1,deleteMsgMode:!1,mdRenderHeight:Number}},mounted(){if("speechSynthesis"in window?(this.speechSynthesis=window.speechSynthesis,this.voices=this.speechSynthesis.getVoices(),this.voices.length===0?this.speechSynthesis.addEventListener("voiceschanged",this.onVoicesChanged):console.log("No voices found")):console.error("Speech synthesis is not supported in this browser."),Ge(()=>{He.replace(),this.mdRenderHeight=this.$refs.mdRender.$el.offsetHeight}),console.log("Checking metadata"),console.log(this.message),Object.prototype.hasOwnProperty.call(this.message,"metadata")&&this.message.metadata!=null){console.log("Metadata found!"),Array.isArray(this.message.metadata)||(this.message.metadata=[]),console.log(typeof this.message.metadata),console.log(this.message.metadata);for(let t of this.message.metadata)Object.prototype.hasOwnProperty.call(t,"audio_url")&&t.audio_url!=null&&(this.audio_url=t.audio_url,console.log("Audio URL:",this.audio_url))}},methods:{computeTimeDiff(t,e){let n=e.getTime()-t.getTime();const i=Math.floor(n/(1e3*60*60));n-=i*(1e3*60*60);const s=Math.floor(n/(1e3*60));n-=s*(1e3*60);const r=Math.floor(n/1e3);return n-=r*1e3,[i,s,r]},insertTab(t){const e=t.target,n=e.selectionStart,i=e.selectionEnd,s=t.shiftKey;if(n===i)if(s){if(e.value.substring(n-4,n)==" "){const r=e.value.substring(0,n-4),o=e.value.substring(i),a=r+o;this.message.content=a,this.$nextTick(()=>{e.selectionStart=e.selectionEnd=n-4})}}else{const r=e.value.substring(0,n),o=e.value.substring(i),a=r+" "+o;this.message.content=a,this.$nextTick(()=>{e.selectionStart=e.selectionEnd=n+4})}else{const o=e.value.substring(n,i).split(` `).map(d=>d.trim()===""?d:s?d.startsWith(" ")?d.substring(4):d:" "+d),a=e.value.substring(0,n),l=e.value.substring(i),u=a+o.join(` `)+l;this.message.content=u,this.$nextTick(()=>{e.selectionStart=n,e.selectionEnd=i+o.length*4})}t.preventDefault()},onVoicesChanged(){this.voices=this.speechSynthesis.getVoices()},read(){this.isSynthesizingVoice?(this.isSynthesizingVoice=!1,this.$refs.audio_player.pause()):(this.isSynthesizingVoice=!0,Se.post("./text2wav",{text:this.message.content}).then(t=>{this.isSynthesizingVoice=!1;let e=t.data.url;console.log(e),this.audio_url=e,this.message.metadata||(this.message.metadata=[]);let n=!1;for(let i of this.message.metadata)Object.prototype.hasOwnProperty.call(i,"audio_url")&&(i.audio_url=this.audio_url,n=!0);n||this.message.metadata.push({audio_url:this.audio_url}),this.$emit("updateMessage",this.message.id,this.message.content,this.audio_url)}).catch(t=>{this.$store.state.toast.showToast(`Error: ${t}`,4,!1),this.isSynthesizingVoice=!1}))},speak(){if(this.$store.state.config.active_tts_service!="browser"&&this.$store.state.config.active_tts_service!="None")this.isSpeaking=!0,Se.post("./text2Audio",{text:this.message.content}).then(t=>{this.isSpeaking=!1}).catch(t=>{this.$store.state.toast.showToast(`Error: ${t}`,4,!1),this.isSpeaking=!1});else{if(this.msg){this.speechSynthesis.cancel(),this.msg=null,this.isSpeaking=!1;return}let t=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 n=s=>{let r=this.message.content.substring(s,s+e);const o=[".","!","?",` `];let a=-1;return o.forEach(l=>{const u=r.lastIndexOf(l);u>a&&(a=u)}),a==-1&&(a=r.length),console.log(a),a+s+1},i=()=>{if(this.status_message=="Done"||this.message.content.includes(".")||this.message.content.includes("?")||this.message.content.includes("!")){const s=n(t),r=this.message.content.substring(t,s);this.msg.text=r,t=s+1,this.msg.onend=o=>{t{i()},1):(this.isSpeaking=!1,console.log("voice off :",this.message.content.length," ",s))},this.speechSynthesis.speak(this.msg)}else setTimeout(()=>{i()},1)};console.log("Speaking chunk"),i()}},toggleModel(){this.expanded=!this.expanded},addBlock(t){let e=this.$refs.mdTextarea.selectionStart,n=this.$refs.mdTextarea.selectionEnd;e==n?speechSynthesis==0||this.message.content[e-1]==` `?(this.message.content=this.message.content.slice(0,e)+"```"+t+"\n\n```\n"+this.message.content.slice(e),e=e+4+t.length):(this.message.content=this.message.content.slice(0,e)+"\n```"+t+"\n\n```\n"+this.message.content.slice(e),e=e+3+t.length):speechSynthesis==0||this.message.content[e-1]==` `?(this.message.content=this.message.content.slice(0,e)+"```"+t+` `+this.message.content.slice(e,n)+"\n```\n"+this.message.content.slice(n),e=e+4+t.length):(this.message.content=this.message.content.slice(0,e)+"\n```"+t+` -`+this.message.content.slice(e,n)+"\n```\n"+this.message.content.slice(n),p=p+3+t.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(t){this.$emit("resendMessage",this.message.id,this.message.content,t)},continueMessage(){this.$emit("continueMessage",this.message.id,this.message.content)},getImgUrl(){return this.avatar?Vyt+this.avatar:(console.log("No avatar found"),Ti)},defaultImg(t){t.target.src=Ti},parseDate(t){let e=new Date(Date.parse(t)),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":t},prettyDate(t){let e=new Date((t||"").replace(/-/g,"/").replace(/[TZ]/g," ")),n=(new Date().getTime()-e.getTime())/1e3,i=Math.floor(n/86400);if(!(isNaN(i)||i<0||i>=31))return i==0&&(n<60&&"just now"||n<120&&"1 minute ago"||n<3600&&Math.floor(n/60)+" minutes ago"||n<7200&&"1 hour ago"||n<86400&&Math.floor(n/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(t){t&&(this.$refs.audio_player.src=t)},"message.content":function(t){this.$store.state.config.auto_speak&&(this.$store.state.config.xtts_enable&&this.$store.state.config.xtts_use_streaming_mode||this.isSpeaking||this.checkForFullSentence())},"message.ui":function(t){console.log("ui changed")},showConfirmation(){Ge(()=>{He.replace()})},deleteMsgMode(){Ge(()=>{He.replace()})}},computed:{editMsgMode:{get(){return this.message.hasOwnProperty("open")?this.editMsgMode_||this.message.open:this.editMsgMode_},set(t){this.message.open=t,this.editMsgMode_=t,Ge(()=>{He.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 t=new Date(Date.parse(this.message.started_generating_at)),e=new Date(Date.parse(this.message.finished_generating_at));if(e.getTime()===t.getTime()||!t.getTime()||!e.getTime())return;let[i,s,r]=this.computeTimeDiff(t,e);function o(l){return l<10&&(l="0"+l),l}return o(i)+"h:"+o(s)+"m:"+o(r)+"s"},warmup_duration(){const t=new Date(Date.parse(this.message.created_at)),e=new Date(Date.parse(this.message.started_generating_at));if(console.log("Computing the warmup duration, ",t," -> ",e),e.getTime()===t.getTime())return 0;if(!t.getTime()||!e.getTime())return;let i,s,r;[i,s,r]=this.computeTimeDiff(t,e);function o(l){return l<10&&(l="0"+l),l}return o(i)+"h:"+o(s)+"m:"+o(r)+"s"},generation_rate(){const t=new Date(Date.parse(this.message.started_generating_at)),e=new Date(Date.parse(this.message.finished_generating_at)),n=this.message.nb_tokens;if(e.getTime()===t.getTime()||!n||!t.getTime()||!e.getTime())return;let s=e.getTime()-t.getTime();const r=Math.floor(s/1e3),o=n/r;return Math.round(o)+" t/s"}}},Hyt={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"},qyt={class:"flex flex-row gap-2"},Yyt={class:"flex-shrink-0"},$yt={class:"group/avatar"},Wyt=["src","data-popover-target"],Kyt={class:"flex flex-col w-full flex-grow-0"},jyt={class:"flex flex-row flex-grow items-start"},Qyt={class:"flex flex-col mb-2"},Xyt={class:"drop-shadow-sm text-lg text-opacity-95 font-bold grow"},Zyt=["title"],Jyt=c("div",{class:"flex-grow"},null,-1),evt={class:"flex-row justify-end mx-2"},tvt={class:"invisible group-hover:visible flex flex-row"},nvt={key:0,class:"flex items-center duration-75"},ivt=c("i",{"data-feather":"x"},null,-1),svt=[ivt],rvt=c("i",{"data-feather":"check"},null,-1),ovt=[rvt],avt=c("i",{"data-feather":"edit"},null,-1),lvt=[avt],cvt=["src"],dvt=["src"],uvt=["src"],pvt=["src"],_vt=["src"],hvt=["src"],fvt=["src"],mvt=["src"],gvt=c("i",{"data-feather":"copy"},null,-1),bvt=[gvt],Evt=c("i",{"data-feather":"send"},null,-1),yvt=[Evt],vvt=["src"],Svt=c("i",{"data-feather":"send"},null,-1),Tvt=[Svt],xvt=c("i",{"data-feather":"fast-forward"},null,-1),Cvt=[xvt],wvt={key:14,class:"flex items-center duration-75"},Rvt=c("i",{"data-feather":"x"},null,-1),Avt=[Rvt],Nvt=c("i",{"data-feather":"check"},null,-1),Ovt=[Nvt],Ivt=c("i",{"data-feather":"trash"},null,-1),Mvt=[Ivt],Dvt=c("i",{"data-feather":"thumbs-up"},null,-1),kvt=[Dvt],Lvt={class:"flex flex-row items-center"},Pvt=c("i",{"data-feather":"thumbs-down"},null,-1),Uvt=[Pvt],Fvt={class:"flex flex-row items-center"},Bvt=c("i",{"data-feather":"volume-2"},null,-1),Gvt=[Bvt],Vvt={key:16,class:"flex flex-row items-center"},zvt=c("i",{"data-feather":"voicemail"},null,-1),Hvt=[zvt],qvt=["src"],Yvt={class:"overflow-x-auto w-full 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"},$vt={class:"flex w-full cursor-pointer rounded-xl border border-gray-200 bg-white shadow-sm dark:border-gray-800 dark:bg-gray-900 mb-3.5 max-w-full"},Wvt={class:"grid min-w-72 select-none grid-cols-[40px,1fr] items-center gap-2.5 p-2"},Kvt={class:"relative grid aspect-square place-content-center overflow-hidden rounded-lg bg-gray-300 dark:bg-gray-200"},jvt=["src"],Qvt=["src"],Xvt=["src"],Zvt={class:"leading-4"},Jvt=c("dd",{class:"text-sm"},"Processing infos",-1),eSt={class:"flex items-center gap-1 truncate whitespace-nowrap text-[.82rem] text-gray-400"},tSt={class:"content px-5 pb-5 pt-4"},nSt={class:"list-none"},iSt=c("div",{class:"flex flex-col items-start w-full"},null,-1),sSt={class:"flex flex-col items-start w-full 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"},rSt={key:1},oSt=["src"],aSt={class:"text-sm text-gray-400 mt-2"},lSt={class:"flex flex-row items-center gap-2"},cSt={key:0},dSt={class:"font-thin"},uSt={key:1},pSt={class:"font-thin"},_St={key:2},hSt={class:"font-thin"},fSt={key:3},mSt=["title"],gSt={key:4},bSt=["title"],ESt={key:5},ySt=["title"],vSt={key:6},SSt=["title"];function TSt(t,e,n,i,s,r){var h;const o=mt("Step"),a=mt("RenderHTMLJS"),l=mt("MarkdownRenderer"),u=mt("JsonViewer"),d=mt("DynamicUIRenderer");return w(),A("div",Hyt,[c("div",qyt,[c("div",Yyt,[c("div",$yt,[c("img",{src:r.getImgUrl(),onError:e[0]||(e[0]=f=>r.defaultImg(f)),"data-popover-target":"avatar"+n.message.id,"data-popover-placement":"bottom",class:"w-10 h-10 rounded-full object-fill text-red-700"},null,40,Wyt)])]),c("div",Kyt,[c("div",jyt,[c("div",Qyt,[c("div",Xyt,he(n.message.sender)+" ",1),n.message.created_at?(w(),A("div",{key:0,class:"text-sm text-gray-400 font-thin",title:"Created at: "+r.created_at_parsed},he(r.created_at),9,Zyt)):V("",!0)]),Jyt,c("div",evt,[c("div",tvt,[r.editMsgMode?(w(),A("div",nvt,[c("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]=be(f=>r.editMsgMode=!1,["stop"]))},svt),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 p-2",title:"Update message",type:"button",onClick:e[2]||(e[2]=be((...f)=>r.updateMessage&&r.updateMessage(...f),["stop"]))},ovt)])):V("",!0),r.editMsgMode?V("",!0):(w(),A("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]=be(f=>r.editMsgMode=!0,["stop"]))},lvt)),r.editMsgMode?(w(),A("div",{key:2,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer hover:border-2",title:"Add generic block",onClick:e[4]||(e[4]=be(f=>r.addBlock(""),["stop"]))},[c("img",{src:s.code_block,width:"25",height:"25"},null,8,cvt)])):V("",!0),r.editMsgMode?(w(),A("div",{key:3,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer hover:border-2",title:"Add python block",onClick:e[5]||(e[5]=be(f=>r.addBlock("python"),["stop"]))},[c("img",{src:s.python_block,width:"25",height:"25"},null,8,dvt)])):V("",!0),r.editMsgMode?(w(),A("div",{key:4,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add javascript block",onClick:e[6]||(e[6]=be(f=>r.addBlock("javascript"),["stop"]))},[c("img",{src:s.javascript_block,width:"25",height:"25"},null,8,uvt)])):V("",!0),r.editMsgMode?(w(),A("div",{key:5,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add json block",onClick:e[7]||(e[7]=be(f=>r.addBlock("json"),["stop"]))},[c("img",{src:s.json_block,width:"25",height:"25"},null,8,pvt)])):V("",!0),r.editMsgMode?(w(),A("div",{key:6,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add c++ block",onClick:e[8]||(e[8]=be(f=>r.addBlock("c++"),["stop"]))},[c("img",{src:s.cpp_block,width:"25",height:"25"},null,8,_vt)])):V("",!0),r.editMsgMode?(w(),A("div",{key:7,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add html block",onClick:e[9]||(e[9]=be(f=>r.addBlock("html"),["stop"]))},[c("img",{src:s.html5_block,width:"25",height:"25"},null,8,hvt)])):V("",!0),r.editMsgMode?(w(),A("div",{key:8,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add LaTex block",onClick:e[10]||(e[10]=be(f=>r.addBlock("latex"),["stop"]))},[c("img",{src:s.LaTeX_block,width:"25",height:"25"},null,8,fvt)])):V("",!0),r.editMsgMode?(w(),A("div",{key:9,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add bash block",onClick:e[11]||(e[11]=be(f=>r.addBlock("bash"),["stop"]))},[c("img",{src:s.bash_block,width:"25",height:"25"},null,8,mvt)])):V("",!0),c("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Copy message to clipboard",onClick:e[12]||(e[12]=be(f=>r.copyContentToClipboard(),["stop"]))},bvt),!r.editMsgMode&&n.message.sender!=this.$store.state.mountedPers.name?(w(),A("div",{key:10,class:ze(["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[13]||(e[13]=be(f=>r.resendMessage("full_context"),["stop"]))},yvt,2)):V("",!0),!r.editMsgMode&&n.message.sender!=this.$store.state.mountedPers.name?(w(),A("div",{key:11,class:ze(["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[14]||(e[14]=be(f=>r.resendMessage("full_context_with_internet"),["stop"]))},[c("img",{src:s.sendGlobe,width:"25",height:"25"},null,8,vvt)],2)):V("",!0),!r.editMsgMode&&n.message.sender!=this.$store.state.mountedPers.name?(w(),A("div",{key:12,class:ze(["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[15]||(e[15]=be(f=>r.resendMessage("simple_question"),["stop"]))},Tvt,2)):V("",!0),!r.editMsgMode&&n.message.sender==this.$store.state.mountedPers.name?(w(),A("div",{key:13,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Resend message",onClick:e[16]||(e[16]=be(f=>r.continueMessage(),["stop"]))},Cvt)):V("",!0),s.deleteMsgMode?(w(),A("div",wvt,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"Cancel removal",type:"button",onClick:e[17]||(e[17]=be(f=>s.deleteMsgMode=!1,["stop"]))},Avt),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Confirm removal",type:"button",onClick:e[18]||(e[18]=be(f=>r.deleteMsg(),["stop"]))},Ovt)])):V("",!0),!r.editMsgMode&&!s.deleteMsgMode?(w(),A("div",{key:15,class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"Remove message",onClick:e[19]||(e[19]=f=>s.deleteMsgMode=!0)},Mvt)):V("",!0),c("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Upvote",onClick:e[20]||(e[20]=be(f=>r.rankUp(),["stop"]))},kvt),c("div",Lvt,[c("div",{class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"Downvote",onClick:e[21]||(e[21]=be(f=>r.rankDown(),["stop"]))},Uvt),n.message.rank!=0?(w(),A("div",{key:0,class:ze(["rounded-full px-2 text-sm flex items-center justify-center font-bold cursor-pointer",n.message.rank>0?"bg-secondary":"bg-red-600"]),title:"Rank"},he(n.message.rank),3)):V("",!0)]),c("div",Fvt,[this.$store.state.config.active_tts_service!="None"?(w(),A("div",{key:0,class:ze(["text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",{"text-red-500":r.isTalking}]),title:"speak",onClick:e[22]||(e[22]=be(f=>r.speak(),["stop"]))},Gvt,2)):V("",!0)]),this.$store.state.config.xtts_enable&&!this.$store.state.config.xtts_use_streaming_mode?(w(),A("div",Vvt,[s.isSynthesizingVoice?(w(),A("img",{key:1,src:s.loading_svg},null,8,qvt)):(w(),A("div",{key:0,class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"generate_audio",onClick:e[23]||(e[23]=be(f=>r.read(),["stop"]))},Hvt))])):V("",!0)])])]),c("div",Yvt,[G(c("details",$vt,[c("summary",Wvt,[c("div",Kvt,[n.message.status_message!="Done"&n.message.status_message!="Generation canceled"?(w(),A("img",{key:0,src:s.loading_svg,class:"w-50 h-50 absolute inset-0 text-gray-100 transition-opacity dark:text-gray-800 opacity-100"},null,8,jvt)):V("",!0),n.message.status_message=="Generation canceled"?(w(),A("img",{key:1,src:s.failed_svg,class:"w-50 h-50 absolute inset-0 text-gray-100 transition-opacity dark:text-gray-800 opacity-100"},null,8,Qvt)):V("",!0),n.message.status_message=="Done"?(w(),A("img",{key:2,src:s.ok_svg,class:"w-50 h-50 absolute m-2 w-6 inset-0 text-geen-100 transition-opacity dark:text-gray-800 opacity-100"},null,8,Xvt)):V("",!0)]),c("dl",Zvt,[Jvt,c("dt",eSt,he(n.message==null?"":n.message.status_message),1)])]),c("div",tSt,[c("ol",nSt,[(w(!0),A(Ye,null,lt(n.message.steps,(f,_)=>(w(),A("div",{key:"step-"+n.message.id+"-"+_,class:"group border-l pb-6 last:!border-transparent last:pb-0 dark:border-gray-800",style:en({backgroundColor:f.done?"transparent":"inherit"})},[Te(o,{done:f.done,message:f.message,status:f.status,step_type:f.type},null,8,["done","message","status","step_type"])],4))),128))])])],512),[[Mt,n.message!=null&&n.message.steps!=null&&n.message.steps.length>0]]),iSt,c("div",sSt,[(w(!0),A(Ye,null,lt(n.message.html_js_s,(f,_)=>(w(),A("div",{key:"htmljs-"+n.message.id+"-"+_,class:"htmljs font-bold",style:en({backgroundColor:t.step.done?"transparent":"inherit"})},[Te(a,{htmlContent:f},null,8,["htmlContent"])],4))),128))]),r.editMsgMode?V("",!0):(w(),xt(l,{key:0,ref:"mdRender",host:n.host,"markdown-text":n.message.content,message_id:n.message.id,discussion_id:n.message.discussion_id,client_id:this.$store.state.client_id},null,8,["host","markdown-text","message_id","discussion_id","client_id"])),c("div",null,[n.message.open?G((w(),A("textarea",{key:0,ref:"mdTextarea",onKeydown:e[24]||(e[24]=Hs(be((...f)=>r.insertTab&&r.insertTab(...f),["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,placeholder:"Enter message here...","onUpdate:modelValue":e[25]||(e[25]=f=>n.message.content=f)},`\r - `,544)),[[we,n.message.content]]):V("",!0)]),n.message.metadata!==null?(w(),A("div",rSt,[(w(!0),A(Ye,null,lt(((h=n.message.metadata)==null?void 0:h.filter(f=>f!=null&&f.hasOwnProperty("title")&&f.hasOwnProperty("content")))||[],(f,_)=>(w(),A("div",{key:"json-"+n.message.id+"-"+_,class:"json font-bold"},[Te(u,{jsonFormText:f.title,jsonData:f.content},null,8,["jsonFormText","jsonData"])]))),128))])):V("",!0),Te(d,{class:"w-full",code:n.message.ui},null,8,["code"]),s.audio_url!=null?(w(),A("audio",{controls:"",key:s.audio_url},[c("source",{src:s.audio_url,type:"audio/wav",ref:"audio_player"},null,8,oSt),et(" Your browser does not support the audio element. ")])):V("",!0)]),c("div",aSt,[c("div",lSt,[n.message.binding?(w(),A("p",cSt,[et("Binding: "),c("span",dSt,he(n.message.binding),1)])):V("",!0),n.message.model?(w(),A("p",uSt,[et("Model: "),c("span",pSt,he(n.message.model),1)])):V("",!0),n.message.seed?(w(),A("p",_St,[et("Seed: "),c("span",hSt,he(n.message.seed),1)])):V("",!0),n.message.nb_tokens?(w(),A("p",fSt,[et("Number of tokens: "),c("span",{class:"font-thin",title:"Number of Tokens: "+n.message.nb_tokens},he(n.message.nb_tokens),9,mSt)])):V("",!0),r.warmup_duration?(w(),A("p",gSt,[et("Warmup duration: "),c("span",{class:"font-thin",title:"Warmup duration: "+r.warmup_duration},he(r.warmup_duration),9,bSt)])):V("",!0),r.time_spent?(w(),A("p",ESt,[et("Generation duration: "),c("span",{class:"font-thin",title:"Finished generating: "+r.time_spent},he(r.time_spent),9,ySt)])):V("",!0),r.generation_rate?(w(),A("p",vSt,[et("Rate: "),c("span",{class:"font-thin",title:"Generation rate: "+r.generation_rate},he(r.generation_rate),9,SSt)])):V("",!0)])])])])])}const yO=bt(zyt,[["render",TSt]]),xSt="/";Se.defaults.baseURL="/";const CSt={name:"MountedPersonalities",props:{onShowPersList:Function,onReady:Function},components:{Toast:hc,UniversalForm:bc},data(){return{bUrl:xSt,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(t){this.$store.commit("setConfig",t)}},mountedPers:{get(){return this.$store.state.mountedPers},set(t){this.$store.commit("setMountedPers",t)}},personalities:{get(){return this.$store.state.personalities},set(t){this.$store.commit("setPersonalities",t)}},mountedPersArr:{get(){return this.$store.state.mountedPersArr},set(t){this.$store.commit("setMountedPers",t)}}},methods:{async handleOnTalk(){const t=this.mountedPers;console.log("pers:",t),this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating);let e=await Se.get("/get_generation_status",{});if(e)if(e.data.status)console.log("Already generating");else{const n=this.$store.state.config.personalities.findIndex(s=>s===t.full_path),i={client_id:this.$store.state.client_id,id:n};e=await Se.post("/select_personality",i),console.log("Generating message from ",e.data.status),$e.emit("generate_msg_from",{id:-1})}},async remount_personality(){const t=this.mountedPers;if(console.log("Remounting personality ",t),!t)return{status:!1,error:"no personality - mount_personality"};try{console.log("before");const e={client_id:this.$store.state.client_id,category:t.category,folder:t.folder,language:t.language};console.log("after");const n=await Se.post("/remount_personality",e);if(console.log("Remounting personality executed:",n),n)return console.log("Remounting personality res"),this.$store.state.toast.showToast("Personality remounted",4,!0),n.data;console.log("failed remount_personality")}catch(e){console.log(e.message,"remount_personality - settings");return}},onSettingsPersonality(t){try{Se.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 - "+t.name,"Save changes","Cancel").then(n=>{try{Se.post("/set_active_personality_settings",n).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,n)+"\n```\n"+this.message.content.slice(n),p=p+3+t.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(t){this.$emit("resendMessage",this.message.id,this.message.content,t)},continueMessage(){this.$emit("continueMessage",this.message.id,this.message.content)},getImgUrl(){return this.avatar?zyt+this.avatar:(console.log("No avatar found"),Ti)},defaultImg(t){t.target.src=Ti},parseDate(t){let e=new Date(Date.parse(t)),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":t},prettyDate(t){let e=new Date((t||"").replace(/-/g,"/").replace(/[TZ]/g," ")),n=(new Date().getTime()-e.getTime())/1e3,i=Math.floor(n/86400);if(!(isNaN(i)||i<0||i>=31))return i==0&&(n<60&&"just now"||n<120&&"1 minute ago"||n<3600&&Math.floor(n/60)+" minutes ago"||n<7200&&"1 hour ago"||n<86400&&Math.floor(n/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(t){t&&(this.$refs.audio_player.src=t)},"message.content":function(t){this.$store.state.config.auto_speak&&(this.$store.state.config.xtts_enable&&this.$store.state.config.xtts_use_streaming_mode||this.isSpeaking||this.checkForFullSentence())},"message.ui":function(t){console.log("ui changed")},showConfirmation(){Ge(()=>{He.replace()})},deleteMsgMode(){Ge(()=>{He.replace()})}},computed:{editMsgMode:{get(){return this.message.hasOwnProperty("open")?this.editMsgMode_||this.message.open:this.editMsgMode_},set(t){this.message.open=t,this.editMsgMode_=t,Ge(()=>{He.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 t=new Date(Date.parse(this.message.started_generating_at)),e=new Date(Date.parse(this.message.finished_generating_at));if(e.getTime()===t.getTime()||!t.getTime()||!e.getTime())return;let[i,s,r]=this.computeTimeDiff(t,e);function o(l){return l<10&&(l="0"+l),l}return o(i)+"h:"+o(s)+"m:"+o(r)+"s"},warmup_duration(){const t=new Date(Date.parse(this.message.created_at)),e=new Date(Date.parse(this.message.started_generating_at));if(console.log("Computing the warmup duration, ",t," -> ",e),e.getTime()===t.getTime())return 0;if(!t.getTime()||!e.getTime())return;let i,s,r;[i,s,r]=this.computeTimeDiff(t,e);function o(l){return l<10&&(l="0"+l),l}return o(i)+"h:"+o(s)+"m:"+o(r)+"s"},generation_rate(){const t=new Date(Date.parse(this.message.started_generating_at)),e=new Date(Date.parse(this.message.finished_generating_at)),n=this.message.nb_tokens;if(e.getTime()===t.getTime()||!n||!t.getTime()||!e.getTime())return;let s=e.getTime()-t.getTime();const r=Math.floor(s/1e3),o=n/r;return Math.round(o)+" t/s"}}},qyt={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"},Yyt={class:"flex flex-row gap-2"},$yt={class:"flex-shrink-0"},Wyt={class:"group/avatar"},Kyt=["src","data-popover-target"],jyt={class:"flex flex-col w-full flex-grow-0"},Qyt={class:"flex flex-row flex-grow items-start"},Xyt={class:"flex flex-col mb-2"},Zyt={class:"drop-shadow-sm text-lg text-opacity-95 font-bold grow"},Jyt=["title"],evt=c("div",{class:"flex-grow"},null,-1),tvt={class:"flex-row justify-end mx-2"},nvt={class:"invisible group-hover:visible flex flex-row"},ivt={key:0,class:"flex items-center duration-75"},svt=c("i",{"data-feather":"x"},null,-1),rvt=[svt],ovt=c("i",{"data-feather":"check"},null,-1),avt=[ovt],lvt=c("i",{"data-feather":"edit"},null,-1),cvt=[lvt],dvt=["src"],uvt=["src"],pvt=["src"],_vt=["src"],hvt=["src"],fvt=["src"],mvt=["src"],gvt=["src"],bvt=c("i",{"data-feather":"copy"},null,-1),Evt=[bvt],yvt=c("i",{"data-feather":"send"},null,-1),vvt=[yvt],Svt=["src"],Tvt=c("i",{"data-feather":"send"},null,-1),xvt=[Tvt],Cvt=c("i",{"data-feather":"fast-forward"},null,-1),wvt=[Cvt],Rvt={key:14,class:"flex items-center duration-75"},Avt=c("i",{"data-feather":"x"},null,-1),Nvt=[Avt],Ovt=c("i",{"data-feather":"check"},null,-1),Ivt=[Ovt],Mvt=c("i",{"data-feather":"trash"},null,-1),Dvt=[Mvt],kvt=c("i",{"data-feather":"thumbs-up"},null,-1),Lvt=[kvt],Pvt={class:"flex flex-row items-center"},Uvt=c("i",{"data-feather":"thumbs-down"},null,-1),Fvt=[Uvt],Bvt={class:"flex flex-row items-center"},Gvt=c("i",{"data-feather":"volume-2"},null,-1),Vvt=[Gvt],zvt={key:16,class:"flex flex-row items-center"},Hvt=c("i",{"data-feather":"voicemail"},null,-1),qvt=[Hvt],Yvt=["src"],$vt={class:"overflow-x-auto w-full 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"},Wvt={class:"flex w-full cursor-pointer rounded-xl border border-gray-200 bg-white shadow-sm dark:border-gray-800 dark:bg-gray-900 mb-3.5 max-w-full"},Kvt={class:"grid min-w-72 select-none grid-cols-[40px,1fr] items-center gap-2.5 p-2"},jvt={class:"relative grid aspect-square place-content-center overflow-hidden rounded-lg bg-gray-300 dark:bg-gray-200"},Qvt=["src"],Xvt=["src"],Zvt=["src"],Jvt={class:"leading-4"},eSt=c("dd",{class:"text-sm"},"Processing infos",-1),tSt={class:"flex items-center gap-1 truncate whitespace-nowrap text-[.82rem] text-gray-400"},nSt={class:"content px-5 pb-5 pt-4"},iSt={class:"list-none"},sSt=c("div",{class:"flex flex-col items-start w-full"},null,-1),rSt={class:"flex flex-col items-start w-full 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"},oSt={key:1},aSt=["src"],lSt={class:"text-sm text-gray-400 mt-2"},cSt={class:"flex flex-row items-center gap-2"},dSt={key:0},uSt={class:"font-thin"},pSt={key:1},_St={class:"font-thin"},hSt={key:2},fSt={class:"font-thin"},mSt={key:3},gSt=["title"],bSt={key:4},ESt=["title"],ySt={key:5},vSt=["title"],SSt={key:6},TSt=["title"];function xSt(t,e,n,i,s,r){var h;const o=mt("Step"),a=mt("RenderHTMLJS"),l=mt("MarkdownRenderer"),u=mt("JsonViewer"),d=mt("DynamicUIRenderer");return w(),A("div",qyt,[c("div",Yyt,[c("div",$yt,[c("div",Wyt,[c("img",{src:r.getImgUrl(),onError:e[0]||(e[0]=f=>r.defaultImg(f)),"data-popover-target":"avatar"+n.message.id,"data-popover-placement":"bottom",class:"w-10 h-10 rounded-full object-fill text-red-700"},null,40,Kyt)])]),c("div",jyt,[c("div",Qyt,[c("div",Xyt,[c("div",Zyt,he(n.message.sender)+" ",1),n.message.created_at?(w(),A("div",{key:0,class:"text-sm text-gray-400 font-thin",title:"Created at: "+r.created_at_parsed},he(r.created_at),9,Jyt)):V("",!0)]),evt,c("div",tvt,[c("div",nvt,[r.editMsgMode?(w(),A("div",ivt,[c("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]=be(f=>r.editMsgMode=!1,["stop"]))},rvt),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 p-2",title:"Update message",type:"button",onClick:e[2]||(e[2]=be((...f)=>r.updateMessage&&r.updateMessage(...f),["stop"]))},avt)])):V("",!0),r.editMsgMode?V("",!0):(w(),A("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]=be(f=>r.editMsgMode=!0,["stop"]))},cvt)),r.editMsgMode?(w(),A("div",{key:2,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer hover:border-2",title:"Add generic block",onClick:e[4]||(e[4]=be(f=>r.addBlock(""),["stop"]))},[c("img",{src:s.code_block,width:"25",height:"25"},null,8,dvt)])):V("",!0),r.editMsgMode?(w(),A("div",{key:3,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer hover:border-2",title:"Add python block",onClick:e[5]||(e[5]=be(f=>r.addBlock("python"),["stop"]))},[c("img",{src:s.python_block,width:"25",height:"25"},null,8,uvt)])):V("",!0),r.editMsgMode?(w(),A("div",{key:4,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add javascript block",onClick:e[6]||(e[6]=be(f=>r.addBlock("javascript"),["stop"]))},[c("img",{src:s.javascript_block,width:"25",height:"25"},null,8,pvt)])):V("",!0),r.editMsgMode?(w(),A("div",{key:5,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add json block",onClick:e[7]||(e[7]=be(f=>r.addBlock("json"),["stop"]))},[c("img",{src:s.json_block,width:"25",height:"25"},null,8,_vt)])):V("",!0),r.editMsgMode?(w(),A("div",{key:6,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add c++ block",onClick:e[8]||(e[8]=be(f=>r.addBlock("c++"),["stop"]))},[c("img",{src:s.cpp_block,width:"25",height:"25"},null,8,hvt)])):V("",!0),r.editMsgMode?(w(),A("div",{key:7,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add html block",onClick:e[9]||(e[9]=be(f=>r.addBlock("html"),["stop"]))},[c("img",{src:s.html5_block,width:"25",height:"25"},null,8,fvt)])):V("",!0),r.editMsgMode?(w(),A("div",{key:8,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add LaTex block",onClick:e[10]||(e[10]=be(f=>r.addBlock("latex"),["stop"]))},[c("img",{src:s.LaTeX_block,width:"25",height:"25"},null,8,mvt)])):V("",!0),r.editMsgMode?(w(),A("div",{key:9,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add bash block",onClick:e[11]||(e[11]=be(f=>r.addBlock("bash"),["stop"]))},[c("img",{src:s.bash_block,width:"25",height:"25"},null,8,gvt)])):V("",!0),c("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Copy message to clipboard",onClick:e[12]||(e[12]=be(f=>r.copyContentToClipboard(),["stop"]))},Evt),!r.editMsgMode&&n.message.sender!=this.$store.state.mountedPers.name?(w(),A("div",{key:10,class:ze(["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[13]||(e[13]=be(f=>r.resendMessage("full_context"),["stop"]))},vvt,2)):V("",!0),!r.editMsgMode&&n.message.sender!=this.$store.state.mountedPers.name?(w(),A("div",{key:11,class:ze(["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[14]||(e[14]=be(f=>r.resendMessage("full_context_with_internet"),["stop"]))},[c("img",{src:s.sendGlobe,width:"25",height:"25"},null,8,Svt)],2)):V("",!0),!r.editMsgMode&&n.message.sender!=this.$store.state.mountedPers.name?(w(),A("div",{key:12,class:ze(["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[15]||(e[15]=be(f=>r.resendMessage("simple_question"),["stop"]))},xvt,2)):V("",!0),!r.editMsgMode&&n.message.sender==this.$store.state.mountedPers.name?(w(),A("div",{key:13,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Resend message",onClick:e[16]||(e[16]=be(f=>r.continueMessage(),["stop"]))},wvt)):V("",!0),s.deleteMsgMode?(w(),A("div",Rvt,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"Cancel removal",type:"button",onClick:e[17]||(e[17]=be(f=>s.deleteMsgMode=!1,["stop"]))},Nvt),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Confirm removal",type:"button",onClick:e[18]||(e[18]=be(f=>r.deleteMsg(),["stop"]))},Ivt)])):V("",!0),!r.editMsgMode&&!s.deleteMsgMode?(w(),A("div",{key:15,class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"Remove message",onClick:e[19]||(e[19]=f=>s.deleteMsgMode=!0)},Dvt)):V("",!0),c("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Upvote",onClick:e[20]||(e[20]=be(f=>r.rankUp(),["stop"]))},Lvt),c("div",Pvt,[c("div",{class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"Downvote",onClick:e[21]||(e[21]=be(f=>r.rankDown(),["stop"]))},Fvt),n.message.rank!=0?(w(),A("div",{key:0,class:ze(["rounded-full px-2 text-sm flex items-center justify-center font-bold cursor-pointer",n.message.rank>0?"bg-secondary":"bg-red-600"]),title:"Rank"},he(n.message.rank),3)):V("",!0)]),c("div",Bvt,[this.$store.state.config.active_tts_service!="None"?(w(),A("div",{key:0,class:ze(["text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",{"text-red-500":r.isTalking}]),title:"speak",onClick:e[22]||(e[22]=be(f=>r.speak(),["stop"]))},Vvt,2)):V("",!0)]),this.$store.state.config.xtts_enable&&!this.$store.state.config.xtts_use_streaming_mode?(w(),A("div",zvt,[s.isSynthesizingVoice?(w(),A("img",{key:1,src:s.loading_svg},null,8,Yvt)):(w(),A("div",{key:0,class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"generate_audio",onClick:e[23]||(e[23]=be(f=>r.read(),["stop"]))},qvt))])):V("",!0)])])]),c("div",$vt,[G(c("details",Wvt,[c("summary",Kvt,[c("div",jvt,[n.message.status_message!="Done"&n.message.status_message!="Generation canceled"?(w(),A("img",{key:0,src:s.loading_svg,class:"w-50 h-50 absolute inset-0 text-gray-100 transition-opacity dark:text-gray-800 opacity-100"},null,8,Qvt)):V("",!0),n.message.status_message=="Generation canceled"?(w(),A("img",{key:1,src:s.failed_svg,class:"w-50 h-50 absolute inset-0 text-gray-100 transition-opacity dark:text-gray-800 opacity-100"},null,8,Xvt)):V("",!0),n.message.status_message=="Done"?(w(),A("img",{key:2,src:s.ok_svg,class:"w-50 h-50 absolute m-2 w-6 inset-0 text-geen-100 transition-opacity dark:text-gray-800 opacity-100"},null,8,Zvt)):V("",!0)]),c("dl",Jvt,[eSt,c("dt",tSt,he(n.message==null?"":n.message.status_message),1)])]),c("div",nSt,[c("ol",iSt,[(w(!0),A(Ye,null,lt(n.message.steps,(f,_)=>(w(),A("div",{key:"step-"+n.message.id+"-"+_,class:"group border-l pb-6 last:!border-transparent last:pb-0 dark:border-gray-800",style:en({backgroundColor:f.done?"transparent":"inherit"})},[Te(o,{done:f.done,message:f.message,status:f.status,step_type:f.type},null,8,["done","message","status","step_type"])],4))),128))])])],512),[[Mt,n.message!=null&&n.message.steps!=null&&n.message.steps.length>0]]),sSt,c("div",rSt,[(w(!0),A(Ye,null,lt(n.message.html_js_s,(f,_)=>(w(),A("div",{key:"htmljs-"+n.message.id+"-"+_,class:"htmljs font-bold",style:en({backgroundColor:t.step.done?"transparent":"inherit"})},[Te(a,{htmlContent:f},null,8,["htmlContent"])],4))),128))]),r.editMsgMode?V("",!0):(w(),xt(l,{key:0,ref:"mdRender",host:n.host,"markdown-text":n.message.content,message_id:n.message.id,discussion_id:n.message.discussion_id,client_id:this.$store.state.client_id},null,8,["host","markdown-text","message_id","discussion_id","client_id"])),c("div",null,[n.message.open?G((w(),A("textarea",{key:0,ref:"mdTextarea",onKeydown:e[24]||(e[24]=Hs(be((...f)=>r.insertTab&&r.insertTab(...f),["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,placeholder:"Enter message here...","onUpdate:modelValue":e[25]||(e[25]=f=>n.message.content=f)},`\r + `,544)),[[we,n.message.content]]):V("",!0)]),n.message.metadata!==null?(w(),A("div",oSt,[(w(!0),A(Ye,null,lt(((h=n.message.metadata)==null?void 0:h.filter(f=>f!=null&&f.hasOwnProperty("title")&&f.hasOwnProperty("content")))||[],(f,_)=>(w(),A("div",{key:"json-"+n.message.id+"-"+_,class:"json font-bold"},[Te(u,{jsonFormText:f.title,jsonData:f.content},null,8,["jsonFormText","jsonData"])]))),128))])):V("",!0),Te(d,{class:"w-full",code:n.message.ui},null,8,["code"]),s.audio_url!=null?(w(),A("audio",{controls:"",key:s.audio_url},[c("source",{src:s.audio_url,type:"audio/wav",ref:"audio_player"},null,8,aSt),et(" Your browser does not support the audio element. ")])):V("",!0)]),c("div",lSt,[c("div",cSt,[n.message.binding?(w(),A("p",dSt,[et("Binding: "),c("span",uSt,he(n.message.binding),1)])):V("",!0),n.message.model?(w(),A("p",pSt,[et("Model: "),c("span",_St,he(n.message.model),1)])):V("",!0),n.message.seed?(w(),A("p",hSt,[et("Seed: "),c("span",fSt,he(n.message.seed),1)])):V("",!0),n.message.nb_tokens?(w(),A("p",mSt,[et("Number of tokens: "),c("span",{class:"font-thin",title:"Number of Tokens: "+n.message.nb_tokens},he(n.message.nb_tokens),9,gSt)])):V("",!0),r.warmup_duration?(w(),A("p",bSt,[et("Warmup duration: "),c("span",{class:"font-thin",title:"Warmup duration: "+r.warmup_duration},he(r.warmup_duration),9,ESt)])):V("",!0),r.time_spent?(w(),A("p",ySt,[et("Generation duration: "),c("span",{class:"font-thin",title:"Finished generating: "+r.time_spent},he(r.time_spent),9,vSt)])):V("",!0),r.generation_rate?(w(),A("p",SSt,[et("Rate: "),c("span",{class:"font-thin",title:"Generation rate: "+r.generation_rate},he(r.generation_rate),9,TSt)])):V("",!0)])])])])])}const yO=bt(Hyt,[["render",xSt]]),CSt="/";Se.defaults.baseURL="/";const wSt={name:"MountedPersonalities",props:{onShowPersList:Function,onReady:Function},components:{Toast:hc,UniversalForm:bc},data(){return{bUrl:CSt,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(t){this.$store.commit("setConfig",t)}},mountedPers:{get(){return this.$store.state.mountedPers},set(t){this.$store.commit("setMountedPers",t)}},personalities:{get(){return this.$store.state.personalities},set(t){this.$store.commit("setPersonalities",t)}},mountedPersArr:{get(){return this.$store.state.mountedPersArr},set(t){this.$store.commit("setMountedPers",t)}}},methods:{async handleOnTalk(){const t=this.mountedPers;console.log("pers:",t),this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating);let e=await Se.get("/get_generation_status",{});if(e)if(e.data.status)console.log("Already generating");else{const n=this.$store.state.config.personalities.findIndex(s=>s===t.full_path),i={client_id:this.$store.state.client_id,id:n};e=await Se.post("/select_personality",i),console.log("Generating message from ",e.data.status),$e.emit("generate_msg_from",{id:-1})}},async remount_personality(){const t=this.mountedPers;if(console.log("Remounting personality ",t),!t)return{status:!1,error:"no personality - mount_personality"};try{console.log("before");const e={client_id:this.$store.state.client_id,category:t.category,folder:t.folder,language:t.language};console.log("after");const n=await Se.post("/remount_personality",e);if(console.log("Remounting personality executed:",n),n)return console.log("Remounting personality res"),this.$store.state.toast.showToast("Personality remounted",4,!0),n.data;console.log("failed remount_personality")}catch(e){console.log(e.message,"remount_personality - settings");return}},onSettingsPersonality(t){try{Se.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 - "+t.name,"Save changes","Cancel").then(n=>{try{Se.post("/set_active_personality_settings",n).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(Ge(()=>{He.replace()});this.$store.state.ready===!1;)await new Promise(t=>setTimeout(t,100));this.onReady()},async api_get_req(t){try{const e=await Se.get("/"+t);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - mountedPersonalities");return}},personalityImgPlacehodler(t){t.target.src=op}}},wSt={class:"w-fit flex select-none"},RSt={class:"w-fit flex select-none"},ASt={class:"w-8 h-8 group relative"},NSt=["src","title"],OSt={class:"opacity-0 group-hover:opacity-100"},ISt=c("span",{title:"Remount"},[c("svg",{xmlns:"http://www.w3.org/2000/svg",class:"top-0 left-1 relative w-4 h-4 text-red-600 hover:text-red-500",viewBox:"0 0 30 30",width:"2",height:"2",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},[c("g",{id:"surface1"},[c("path",{style:{},d:"M 16 4 C 10.886719 4 6.617188 7.160156 4.875 11.625 L 6.71875 12.375 C 8.175781 8.640625 11.710938 6 16 6 C 19.242188 6 22.132813 7.589844 23.9375 10 L 20 10 L 20 12 L 27 12 L 27 5 L 25 5 L 25 8.09375 C 22.808594 5.582031 19.570313 4 16 4 Z M 25.28125 19.625 C 23.824219 23.359375 20.289063 26 16 26 C 12.722656 26 9.84375 24.386719 8.03125 22 L 12 22 L 12 20 L 5 20 L 5 27 L 7 27 L 7 23.90625 C 9.1875 26.386719 12.394531 28 16 28 C 21.113281 28 25.382813 24.839844 27.125 20.375 Z "})])])],-1),MSt=[ISt],DSt=c("span",{title:"Talk"},[c("svg",{xmlns:"http://www.w3.org/2000/svg",class:"left-1 relative w-4 h-4 text-red-600 hover:text-red-500",viewBox:"0 0 24 24",width:"2",height:"2",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},[c("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),c("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})])],-1),kSt=[DSt];function LSt(t,e,n,i,s,r){const o=mt("UniversalForm");return w(),A(Ye,null,[c("div",wSt,[c("div",RSt,[c("div",ASt,[c("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 hover:scale-150 active:scale-90 hover:z-50 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,NSt),c("div",OSt,[t.personalityHoveredIndex===t.index?(w(),A("button",{key:0,class:"z-50 -top-1 group-hover:translate-x-5 border-gray-500 absolute active:scale-90 w-7 h-7 hover:scale-150 transition bg-bg-light dark:bg-bg-dark rounded-full border-2",onClick:e[2]||(e[2]=be(a=>r.remount_personality(),["prevent"]))},MSt)):V("",!0),t.personalityHoveredIndex===t.index?(w(),A("button",{key:1,class:"-top-1 group-hover:-translate-x-12 border-gray-500 active:scale-90 absolute items-center w-7 h-7 hover:scale-150 transition text-red-200 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2",onClick:e[3]||(e[3]=be(a=>r.handleOnTalk(),["prevent"]))},kSt)):V("",!0),c("div",{class:"top-0 group-hover:-translate-x-8 group-hover:-translate-y-8 left-0 border-gray-500 active:scale-90 absolute items-center w-7 h-7 hover:scale-150 transition text-red-500 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2",onClick:e[4]||(e[4]=be((...a)=>r.toggleShowPersList&&r.toggleShowPersList(...a),["stop"])),title:"Click to show more"},"+"+he(r.mountedPersArr.length-1),1)])])])]),Te(o,{ref:"universalForm",class:"z-50"},null,512)],64)}const PSt=bt(CSt,[["render",LSt]]);const USt="/";Se.defaults.baseURL="/";const FSt={props:{onTalk:Function,onMounted:Function,onUnmounted:Function,onRemounted:Function,discussionPersonalities:Array,onShowPersList:Function},components:{PersonalityEntry:fO,Toast:hc,UniversalForm:bc},name:"MountedPersonalitiesList",data(){return{posts_headers:{accept:"application/json","Content-Type":"application/json"},bUrl:USt,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(t){this.$store.commit("setConfig",t)}},personalities:{get(){return this.$store.state.personalities},set(t){this.$store.commit("setPersonalities",t)}},mountedPersArr:{get(){return this.$store.state.mountedPersArr},set(t){this.$store.commit("setMountedPers",t)}}},methods:{async onCopyToCustom(t){await Se.post("/copy_to_custom_personas",{client_id:this.$store.state.client_id,category:t.personality.category,name:t.personality.name})},onCopyPersonalityName(t){this.$store.state.toast.showToast("Copied name to clipboard!",4,!0),navigator.clipboard.writeText(t.name)},toggleShowPersList(){this.onShowPersList()},async constructor(){},async api_get_req(t){try{const e=await Se.get("/"+t);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - mountedPersonalities");return}},personalityImgPlacehodler(t){t.target.src=op},onPersonalityReinstall(t){console.log("on reinstall ",t),this.isLoading=!0,Se.post("/reinstall_personality",{name:t.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(Ge(()=>{He.replace()});this.$store.state.ready===!1;)await new Promise(t=>setTimeout(t,100));this.onReady()},async api_get_req(t){try{const e=await Se.get("/"+t);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - mountedPersonalities");return}},personalityImgPlacehodler(t){t.target.src=op}}},RSt={class:"w-fit flex select-none"},ASt={class:"w-fit flex select-none"},NSt={class:"w-8 h-8 group relative"},OSt=["src","title"],ISt={class:"opacity-0 group-hover:opacity-100"},MSt=c("span",{title:"Remount"},[c("svg",{xmlns:"http://www.w3.org/2000/svg",class:"top-0 left-1 relative w-4 h-4 text-red-600 hover:text-red-500",viewBox:"0 0 30 30",width:"2",height:"2",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},[c("g",{id:"surface1"},[c("path",{style:{},d:"M 16 4 C 10.886719 4 6.617188 7.160156 4.875 11.625 L 6.71875 12.375 C 8.175781 8.640625 11.710938 6 16 6 C 19.242188 6 22.132813 7.589844 23.9375 10 L 20 10 L 20 12 L 27 12 L 27 5 L 25 5 L 25 8.09375 C 22.808594 5.582031 19.570313 4 16 4 Z M 25.28125 19.625 C 23.824219 23.359375 20.289063 26 16 26 C 12.722656 26 9.84375 24.386719 8.03125 22 L 12 22 L 12 20 L 5 20 L 5 27 L 7 27 L 7 23.90625 C 9.1875 26.386719 12.394531 28 16 28 C 21.113281 28 25.382813 24.839844 27.125 20.375 Z "})])])],-1),DSt=[MSt],kSt=c("span",{title:"Talk"},[c("svg",{xmlns:"http://www.w3.org/2000/svg",class:"left-1 relative w-4 h-4 text-red-600 hover:text-red-500",viewBox:"0 0 24 24",width:"2",height:"2",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},[c("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),c("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})])],-1),LSt=[kSt];function PSt(t,e,n,i,s,r){const o=mt("UniversalForm");return w(),A(Ye,null,[c("div",RSt,[c("div",ASt,[c("div",NSt,[c("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 hover:scale-150 active:scale-90 hover:z-50 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,OSt),c("div",ISt,[t.personalityHoveredIndex===t.index?(w(),A("button",{key:0,class:"z-50 -top-1 group-hover:translate-x-5 border-gray-500 absolute active:scale-90 w-7 h-7 hover:scale-150 transition bg-bg-light dark:bg-bg-dark rounded-full border-2",onClick:e[2]||(e[2]=be(a=>r.remount_personality(),["prevent"]))},DSt)):V("",!0),t.personalityHoveredIndex===t.index?(w(),A("button",{key:1,class:"-top-1 group-hover:-translate-x-12 border-gray-500 active:scale-90 absolute items-center w-7 h-7 hover:scale-150 transition text-red-200 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2",onClick:e[3]||(e[3]=be(a=>r.handleOnTalk(),["prevent"]))},LSt)):V("",!0),c("div",{class:"top-0 group-hover:-translate-x-8 group-hover:-translate-y-8 left-0 border-gray-500 active:scale-90 absolute items-center w-7 h-7 hover:scale-150 transition text-red-500 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2",onClick:e[4]||(e[4]=be((...a)=>r.toggleShowPersList&&r.toggleShowPersList(...a),["stop"])),title:"Click to show more"},"+"+he(r.mountedPersArr.length-1),1)])])])]),Te(o,{ref:"universalForm",class:"z-50"},null,512)],64)}const USt=bt(wSt,[["render",PSt]]);const FSt="/";Se.defaults.baseURL="/";const BSt={props:{onTalk:Function,onMounted:Function,onUnmounted:Function,onRemounted:Function,discussionPersonalities:Array,onShowPersList:Function},components:{PersonalityEntry:fO,Toast:hc,UniversalForm:bc},name:"MountedPersonalitiesList",data(){return{posts_headers:{accept:"application/json","Content-Type":"application/json"},bUrl:FSt,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(t){this.$store.commit("setConfig",t)}},personalities:{get(){return this.$store.state.personalities},set(t){this.$store.commit("setPersonalities",t)}},mountedPersArr:{get(){return this.$store.state.mountedPersArr},set(t){this.$store.commit("setMountedPers",t)}}},methods:{async onCopyToCustom(t){await Se.post("/copy_to_custom_personas",{client_id:this.$store.state.client_id,category:t.personality.category,name:t.personality.name})},onCopyPersonalityName(t){this.$store.state.toast.showToast("Copied name to clipboard!",4,!0),navigator.clipboard.writeText(t.name)},toggleShowPersList(){this.onShowPersList()},async constructor(){},async api_get_req(t){try{const e=await Se.get("/"+t);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - mountedPersonalities");return}},personalityImgPlacehodler(t){t.target.src=op},onPersonalityReinstall(t){console.log("on reinstall ",t),this.isLoading=!0,Se.post("/reinstall_personality",{name:t.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}))},editPersonality(t){t=t.personality,Se.post("/get_personality_config",{client_id:this.$store.state.client_id,category:t.category,name:t.folder}).then(e=>{const n=e.data;console.log("Done"),n.status?(this.$store.state.currentPersonConfig=n.config,this.$store.state.showPersonalityEditor=!0,this.$store.state.personality_editor.showPanel(),this.$store.state.selectedPersonality=t):console.error(n.error)}).catch(e=>{console.error(e)})},onPersonalityMounted(t){this.mountPersonality(t)},onPersonalityUnMounted(t){this.unmountPersonality(t)},onPersonalityRemount(t){this.reMountPersonality(t)},async handleOpenFolder(t){const e={client_id:this.$store.state.client_id,personality_folder:t.personality.folder};console.log(e),await Se.post("/open_personality_folder",e)},async handleOnTalk(t){if(He.replace(),console.log("ppa",t),t){if(t.isMounted){const e=await this.select_personality(t);e&&e.status&&(await this.constructor(),this.$refs.toast.showToast(`Selected personality: `+t.name,4,!0))}else this.onPersonalityMounted(t);this.onTalk(t)}},async onPersonalitySelected(t){if(He.replace(),console.log("Selected personality : ",JSON.stringify(t.personality)),t){if(t.selected){this.$refs.toast.showToast("Personality already selected",4,!0);return}if(t.isMounted){const e=await this.select_personality(t);e&&e.status&&(await this.constructor(),this.$refs.toast.showToast(`Selected personality: `+t.name,4,!0))}else this.onPersonalityMounted(t)}},onSettingsPersonality(t){try{Se.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 - "+t.personality.name,"Save changes","Cancel").then(n=>{try{Se.post("/set_active_personality_settings",n).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. @@ -178,15 +178,15 @@ If You are using windows, this will install wsl so you need to activate it. Error: `+e.error,4,!1))},async reMountPersonality(t){if(console.log("remount pers",t),!t)return;if(!this.configFile.personalities.includes(t.personality.full_path)){this.$refs.toast.showToast("Personality not mounted",4,!1);return}const e=await this.remount_personality(t.personality);console.log("remount_personality res",e),e.status?(this.configFile.personalities=e.personalities,this.$refs.toast.showToast("Personality remounted",4,!0),t.isMounted=!0,this.onMounted(this),(await this.select_personality(t.personality)).status&&this.$refs.toast.showToast(`Selected personality: `+t.personality.name,4,!0),this.getMountedPersonalities()):(t.isMounted=!1,this.$refs.toast.showToast(`Could not mount personality Error: `+e.error,4,!1))},async unmountPersonality(t){if(!t)return;console.log(`Unmounting ${JSON.stringify(t.personality)}`);const e=await this.unmount_personality(t.personality);if(e.status){console.log("unmount response",e),this.configFile.active_personality_id=e.active_personality_id,this.configFile.personalities=e.personalities;const n=this.configFile.personalities[this.configFile.active_personality_id],i=this.personalities.findIndex(a=>a.full_path==n),s=this.$refs.personalitiesZoo.findIndex(a=>a.full_path==t.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&&He.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 t=[];console.log(this.configFile.personalities.length);for(let e=0;er.full_path==n),s=this.personalities[i];if(s)console.log("adding from config"),t.push(s);else{console.log("adding default");const r=this.personalities.findIndex(a=>a.full_path=="english/generic/lollms"),o=this.personalities[r];t.push(o)}}if(this.mountedPersArr=[],this.mountedPersArr=t,console.log("discussionPersonalities",this.discussionPersonalities),this.discussionPersonalities!=null&&this.discussionPersonalities.length>0)for(let e=0;es.full_path==n);if(console.log("discussionPersonalities -includes",i),console.log("discussionPersonalities -mounted list",this.mountedPersArr),i==-1){const s=this.personalities.findIndex(o=>o.full_path==n),r=this.personalities[s];console.log("adding discucc121",r,n),r&&(this.mountedPersArr.push(r),console.log("adding discucc",r))}}this.isLoading=!1,console.log("getMountedPersonalities",this.mountedPersArr),console.log("fig",this.configFile)}}},AE=t=>(yo("data-v-de7bc8fe"),t=t(),vo(),t),BSt={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"},GSt={key:0,role:"status",class:"flex justify-center overflow-y-hidden"},VSt=AE(()=>c("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"},[c("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),c("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)),zSt=AE(()=>c("span",{class:"sr-only"},"Loading...",-1)),HSt=[VSt,zSt],qSt=AE(()=>c("i",{"data-feather":"chevron-down"},null,-1)),YSt=[qSt],$St={class:"block my-2 text-sm font-medium text-gray-900 dark:text-white"},WSt={class:"overflow-y-auto no-scrollbar pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4 max-h-96"};function KSt(t,e,n,i,s,r){const o=mt("personality-entry"),a=mt("Toast"),l=mt("UniversalForm");return w(),A("div",BSt,[s.isLoading?(w(),A("div",GSt,HSt)):V("",!0),c("div",null,[r.mountedPersArr.length>0?(w(),A("div",{key:0,class:ze(s.isLoading?"pointer-events-none opacity-30 cursor-default":"")},[c("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]=be((...u)=>r.toggleShowPersList&&r.toggleShowPersList(...u),["stop"]))},YSt),c("label",$St," Mounted Personalities: ("+he(r.mountedPersArr.length)+") ",1),c("div",WSt,[Te(os,{name:"bounce"},{default:We(()=>[(w(!0),A(Ye,null,lt(this.$store.state.mountedPersArr,(u,d)=>(w(),xt(o,{ref_for:!0,ref:"personalitiesZoo",key:"index-"+d+"-"+u.name,personality:u,full_path:u.full_path,select_language:!1,selected:r.configFile.personalities[r.configFile.active_personality_id]===u.full_path||r.configFile.personalities[r.configFile.active_personality_id]===u.full_path+":"+u.language,"on-selected":r.onPersonalitySelected,"on-mount":r.onPersonalityMounted,"on-edit":r.editPersonality,"on-un-mount":r.onPersonalityUnMounted,"on-remount":r.onPersonalityRemount,"on-settings":r.onSettingsPersonality,"on-reinstall":r.onPersonalityReinstall,"on-talk":r.handleOnTalk,"on-copy-personality-name":r.onCopyPersonalityName,"on-copy-to_custom":r.onCopyToCustom,"on-open-folder":r.handleOpenFolder},null,8,["personality","full_path","selected","on-selected","on-mount","on-edit","on-un-mount","on-remount","on-settings","on-reinstall","on-talk","on-copy-personality-name","on-copy-to_custom","on-open-folder"]))),128))]),_:1})])],2)):V("",!0)]),Te(a,{ref:"toast"},null,512),Te(l,{ref:"universalForm",class:"z-20"},null,512)])}const jSt=bt(FSt,[["render",KSt],["__scopeId","data-v-de7bc8fe"]]);const QSt={components:{InteractiveMenu:CE},props:{commandsList:{type:Array,required:!0},sendCommand:Function,onShowToastMessage:Function},data(){return{loading:!1,selectedFile:null,showMenu:!1,showHelpText:!1,helpText:"",commands:[]}},async mounted(){this.commands=this.commandsList,console.log("Commands",this.commands),document.addEventListener("click",this.handleClickOutside),Ge(()=>{He.replace()})},methods:{isHTML(t){const n=new DOMParser().parseFromString(t,"text/html");return Array.from(n.body.childNodes).some(i=>i.nodeType===Node.ELEMENT_NODE)},selectFile(t,e){const n=document.createElement("input");n.type="file",n.accept=t,n.onchange=i=>{this.selectedFile=i.target.files[0],console.log("File selected"),e()},n.click()},uploadFile(){new FormData().append("file",this.selectedFile),console.log("Uploading file"),this.loading=!0;const e=new FileReader;e.onload=()=>{const n={filename:this.selectedFile.name,fileData:e.result};$e.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,$e.off("file_received")}),$e.emit("send_file",n)},e.readAsDataURL(this.selectedFile)},async constructor(){Ge(()=>{He.replace()})},toggleMenu(){this.showMenu=!this.showMenu},execute_cmd(t){this.showMenu=!this.showMenu,t.hasOwnProperty("is_file")?(console.log("Need to send a file."),this.selectFile(t.hasOwnProperty("file_types")?t.file_types:"*",()=>{this.selectedFile!=null&&this.uploadFile()})):this.sendCommand(t.value)},handleClickOutside(t){const e=this.$el.querySelector(".commands-menu-items-wrapper");e&&!e.contains(t.target)&&(this.showMenu=!1)}},beforeUnmount(){document.removeEventListener("click",this.handleClickOutside)}},XSt=t=>(yo("data-v-1a32c141"),t=t(),vo(),t),ZSt={key:0,title:"Loading..",class:"flex flex-row flex-grow justify-end"},JSt=XSt(()=>c("div",{role:"status"},[c("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"},[c("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),c("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"})]),c("span",{class:"sr-only"},"Loading...")],-1)),e0t=[JSt];function t0t(t,e,n,i,s,r){const o=mt("InteractiveMenu");return s.loading?(w(),A("div",ZSt,e0t)):(w(),xt(o,{key:1,commands:n.commandsList,execute_cmd:r.execute_cmd},null,8,["commands","execute_cmd"]))}const n0t=bt(QSt,[["render",t0t],["__scopeId","data-v-1a32c141"]]),i0t="/assets/loader_v0-16906488.svg";console.log("modelImgPlaceholder:",Pi);const s0t="/",r0t={name:"ChatBox",emits:["messageSentEvent","sendCMDEvent","stopGenerating","loaded","createEmptyUserMessage","createEmptyAIMessage","personalitySelected","addWebLink"],props:{onTalk:Function,discussionList:Array,loading:{default:!1},onShowToastMessage:Function},components:{UniversalForm:bc,MountedPersonalities:PSt,MountedPersonalitiesList:jSt,PersonalitiesCommands:n0t},setup(){},data(){return{is_rt:!1,bindingHoveredIndex:null,modelHoveredIndex:null,personalityHoveredIndex:null,loader_v0:i0t,sendGlobe:EO,modelImgPlaceholder:Pi,bUrl:s0t,message:"",selecting_binding:!1,selecting_model:!1,selectedModel:"",isListeningToVoice:!1,filesList:[],isFileSentList:[],totalSize:0,showfilesList:!0,showPersonalities:!1,personalities_ready:!1,models_menu_icon:"",posts_headers:{accept:"application/json","Content-Type":"application/json"}}},computed:{isDataSourceNamesValid(){return console.log("dataSourceNames:",this.dataSourceNames),console.log("Type of dataSourceNames:",typeof this.dataSourceNames),Array.isArray(this.dataSourceNames)&&this.dataSourceNames.length>0},dataSourceNames(){console.log("dataSourceNames",this.$store.state.config.rag_databases);const t=this.$store.state.config.rag_databases.map(e=>{console.log("entry",e);const n=e.split("::");console.log("extracted",n[0]);const s=e.endsWith("mounted")?"feather:check":"";return console.log("icon decision",s),{name:n[0],value:n[0]||"default_value",icon:s,help:"mounts the database"}});return console.log("formatted data sources",t),t},currentBindingIcon(){return this.currentBinding.icon||this.modelImgPlaceholder},currentBinding(){return this.$store.state.currentBinding||{}},currentModel(){return this.$store.state.currentModel||{}},currentModelIcon(){return this.currentModel.icon||this.modelImgPlaceholder},installedBindings(){return this.$store.state.installedBindings},installedModels(){return this.$store.state.installedModels},mountedPersonalities(){return this.$store.state.mountedPersArr},binding_name(){return this.$store.state.config.binding_name},model_name(){return this.$store.state.config.model_name},personality_name(){return this.$store.state.config.active_personality_id},config(){return this.$store.state.config},mountedPers(){return this.$store.state.mountedPers},allDiscussionPersonalities(){if(this.discussionList.length>0){let t=[];for(let e=0;e0&&this.addFiles(n)},toggleSwitch(){this.$store.state.config.activate_internet_search=!this.$store.state.config.activate_internet_search,this.isLoading=!0,Se.post("/apply_settings",{config:this.$store.state.config}).then(t=>{this.isLoading=!1,t.data.status?(this.$store.state.config.activate_internet_search?this.$store.state.toast.showToast("Websearch activated.",4,!0):this.$store.state.toast.showToast("Websearch deactivated.",4,!0),this.settingsChanged=!1):this.$store.state.toast.showToast("Configuration change failed.",4,!1),Ge(()=>{He.replace()})})},showModelConfig(){try{this.isLoading=!0,Se.get("/get_active_binding_settings").then(t=>{this.isLoading=!1,t&&(console.log("binding sett",t),t.data&&Object.keys(t.data).length>0?this.$refs.universalForm.showForm(t.data,"Binding settings ","Save changes","Cancel").then(e=>{try{Se.post("/set_active_binding_settings",e).then(n=>{n&&n.data?(console.log("binding set with new settings",n.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 t=[];console.log(this.configFile.personalities.length);for(let e=0;er.full_path==n),s=this.personalities[i];if(s)console.log("adding from config"),t.push(s);else{console.log("adding default");const r=this.personalities.findIndex(a=>a.full_path=="english/generic/lollms"),o=this.personalities[r];t.push(o)}}if(this.mountedPersArr=[],this.mountedPersArr=t,console.log("discussionPersonalities",this.discussionPersonalities),this.discussionPersonalities!=null&&this.discussionPersonalities.length>0)for(let e=0;es.full_path==n);if(console.log("discussionPersonalities -includes",i),console.log("discussionPersonalities -mounted list",this.mountedPersArr),i==-1){const s=this.personalities.findIndex(o=>o.full_path==n),r=this.personalities[s];console.log("adding discucc121",r,n),r&&(this.mountedPersArr.push(r),console.log("adding discucc",r))}}this.isLoading=!1,console.log("getMountedPersonalities",this.mountedPersArr),console.log("fig",this.configFile)}}},AE=t=>(yo("data-v-de7bc8fe"),t=t(),vo(),t),GSt={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"},VSt={key:0,role:"status",class:"flex justify-center overflow-y-hidden"},zSt=AE(()=>c("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"},[c("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),c("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)),HSt=AE(()=>c("span",{class:"sr-only"},"Loading...",-1)),qSt=[zSt,HSt],YSt=AE(()=>c("i",{"data-feather":"chevron-down"},null,-1)),$St=[YSt],WSt={class:"block my-2 text-sm font-medium text-gray-900 dark:text-white"},KSt={class:"overflow-y-auto no-scrollbar pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4 max-h-96"};function jSt(t,e,n,i,s,r){const o=mt("personality-entry"),a=mt("Toast"),l=mt("UniversalForm");return w(),A("div",GSt,[s.isLoading?(w(),A("div",VSt,qSt)):V("",!0),c("div",null,[r.mountedPersArr.length>0?(w(),A("div",{key:0,class:ze(s.isLoading?"pointer-events-none opacity-30 cursor-default":"")},[c("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]=be((...u)=>r.toggleShowPersList&&r.toggleShowPersList(...u),["stop"]))},$St),c("label",WSt," Mounted Personalities: ("+he(r.mountedPersArr.length)+") ",1),c("div",KSt,[Te(os,{name:"bounce"},{default:We(()=>[(w(!0),A(Ye,null,lt(this.$store.state.mountedPersArr,(u,d)=>(w(),xt(o,{ref_for:!0,ref:"personalitiesZoo",key:"index-"+d+"-"+u.name,personality:u,full_path:u.full_path,select_language:!1,selected:r.configFile.personalities[r.configFile.active_personality_id]===u.full_path||r.configFile.personalities[r.configFile.active_personality_id]===u.full_path+":"+u.language,"on-selected":r.onPersonalitySelected,"on-mount":r.onPersonalityMounted,"on-edit":r.editPersonality,"on-un-mount":r.onPersonalityUnMounted,"on-remount":r.onPersonalityRemount,"on-settings":r.onSettingsPersonality,"on-reinstall":r.onPersonalityReinstall,"on-talk":r.handleOnTalk,"on-copy-personality-name":r.onCopyPersonalityName,"on-copy-to_custom":r.onCopyToCustom,"on-open-folder":r.handleOpenFolder},null,8,["personality","full_path","selected","on-selected","on-mount","on-edit","on-un-mount","on-remount","on-settings","on-reinstall","on-talk","on-copy-personality-name","on-copy-to_custom","on-open-folder"]))),128))]),_:1})])],2)):V("",!0)]),Te(a,{ref:"toast"},null,512),Te(l,{ref:"universalForm",class:"z-20"},null,512)])}const QSt=bt(BSt,[["render",jSt],["__scopeId","data-v-de7bc8fe"]]);const XSt={components:{InteractiveMenu:CE},props:{commandsList:{type:Array,required:!0},sendCommand:Function,onShowToastMessage:Function},data(){return{loading:!1,selectedFile:null,showMenu:!1,showHelpText:!1,helpText:"",commands:[]}},async mounted(){this.commands=this.commandsList,console.log("Commands",this.commands),document.addEventListener("click",this.handleClickOutside),Ge(()=>{He.replace()})},methods:{isHTML(t){const n=new DOMParser().parseFromString(t,"text/html");return Array.from(n.body.childNodes).some(i=>i.nodeType===Node.ELEMENT_NODE)},selectFile(t,e){const n=document.createElement("input");n.type="file",n.accept=t,n.onchange=i=>{this.selectedFile=i.target.files[0],console.log("File selected"),e()},n.click()},uploadFile(){new FormData().append("file",this.selectedFile),console.log("Uploading file"),this.loading=!0;const e=new FileReader;e.onload=()=>{const n={filename:this.selectedFile.name,fileData:e.result};$e.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,$e.off("file_received")}),$e.emit("send_file",n)},e.readAsDataURL(this.selectedFile)},async constructor(){Ge(()=>{He.replace()})},toggleMenu(){this.showMenu=!this.showMenu},execute_cmd(t){this.showMenu=!this.showMenu,t.hasOwnProperty("is_file")?(console.log("Need to send a file."),this.selectFile(t.hasOwnProperty("file_types")?t.file_types:"*",()=>{this.selectedFile!=null&&this.uploadFile()})):this.sendCommand(t.value)},handleClickOutside(t){const e=this.$el.querySelector(".commands-menu-items-wrapper");e&&!e.contains(t.target)&&(this.showMenu=!1)}},beforeUnmount(){document.removeEventListener("click",this.handleClickOutside)}},ZSt=t=>(yo("data-v-1a32c141"),t=t(),vo(),t),JSt={key:0,title:"Loading..",class:"flex flex-row flex-grow justify-end"},e0t=ZSt(()=>c("div",{role:"status"},[c("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"},[c("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),c("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"})]),c("span",{class:"sr-only"},"Loading...")],-1)),t0t=[e0t];function n0t(t,e,n,i,s,r){const o=mt("InteractiveMenu");return s.loading?(w(),A("div",JSt,t0t)):(w(),xt(o,{key:1,commands:n.commandsList,execute_cmd:r.execute_cmd},null,8,["commands","execute_cmd"]))}const i0t=bt(XSt,[["render",n0t],["__scopeId","data-v-1a32c141"]]),s0t="/assets/loader_v0-16906488.svg";console.log("modelImgPlaceholder:",Pi);const r0t="/",o0t={name:"ChatBox",emits:["messageSentEvent","sendCMDEvent","stopGenerating","loaded","createEmptyUserMessage","createEmptyAIMessage","personalitySelected","addWebLink"],props:{onTalk:Function,discussionList:Array,loading:{default:!1},onShowToastMessage:Function},components:{UniversalForm:bc,MountedPersonalities:USt,MountedPersonalitiesList:QSt,PersonalitiesCommands:i0t},setup(){},data(){return{is_rt:!1,bindingHoveredIndex:null,modelHoveredIndex:null,personalityHoveredIndex:null,loader_v0:s0t,sendGlobe:EO,modelImgPlaceholder:Pi,bUrl:r0t,message:"",selecting_binding:!1,selecting_model:!1,selectedModel:"",isListeningToVoice:!1,filesList:[],isFileSentList:[],totalSize:0,showfilesList:!0,showPersonalities:!1,personalities_ready:!1,models_menu_icon:"",posts_headers:{accept:"application/json","Content-Type":"application/json"}}},computed:{isDataSourceNamesValid(){return console.log("dataSourceNames:",this.dataSourceNames),console.log("Type of dataSourceNames:",typeof this.dataSourceNames),Array.isArray(this.dataSourceNames)&&this.dataSourceNames.length>0},dataSourceNames(){console.log("dataSourceNames",this.$store.state.config.rag_databases);const t=this.$store.state.config.rag_databases.map(e=>{console.log("entry",e);const n=e.split("::");console.log("extracted",n[0]);const s=e.endsWith("mounted")?"feather:check":"";return console.log("icon decision",s),{name:n[0],value:n[0]||"default_value",icon:s,help:"mounts the database"}});return console.log("formatted data sources",t),t},currentBindingIcon(){return this.currentBinding.icon||this.modelImgPlaceholder},currentBinding(){return this.$store.state.currentBinding||{}},currentModel(){return this.$store.state.currentModel||{}},currentModelIcon(){return this.currentModel.icon||this.modelImgPlaceholder},installedBindings(){return this.$store.state.installedBindings},installedModels(){return this.$store.state.installedModels},mountedPersonalities(){return this.$store.state.mountedPersArr},binding_name(){return this.$store.state.config.binding_name},model_name(){return this.$store.state.config.model_name},personality_name(){return this.$store.state.config.active_personality_id},config(){return this.$store.state.config},mountedPers(){return this.$store.state.mountedPers},allDiscussionPersonalities(){if(this.discussionList.length>0){let t=[];for(let e=0;e0&&this.addFiles(n)},toggleSwitch(){this.$store.state.config.activate_internet_search=!this.$store.state.config.activate_internet_search,this.isLoading=!0,Se.post("/apply_settings",{config:this.$store.state.config}).then(t=>{this.isLoading=!1,t.data.status?(this.$store.state.config.activate_internet_search?this.$store.state.toast.showToast("Websearch activated.",4,!0):this.$store.state.toast.showToast("Websearch deactivated.",4,!0),this.settingsChanged=!1):this.$store.state.toast.showToast("Configuration change failed.",4,!1),Ge(()=>{He.replace()})})},showModelConfig(){try{this.isLoading=!0,Se.get("/get_active_binding_settings").then(t=>{this.isLoading=!1,t&&(console.log("binding sett",t),t.data&&Object.keys(t.data).length>0?this.$refs.universalForm.showForm(t.data,"Binding settings ","Save changes","Cancel").then(e=>{try{Se.post("/set_active_binding_settings",e).then(n=>{n&&n.data?(console.log("binding set with new settings",n.data),this.$store.state.toast.showToast("Binding settings updated successfully!",4,!0)):(this.$store.state.toast.showToast(`Did not get binding settings responses. `+n,4,!1),this.isLoading=!1)})}catch(n){this.$store.state.toast.showToast(`Did not get binding settings responses. Endpoint error: `+n.message,4,!1),this.isLoading=!1}}):(this.$store.state.toast.showToast("Binding has no settings",4,!1),this.isLoading=!1))})}catch(t){this.isLoading=!1,this.$store.state.toast.showToast("Could not open binding settings. Endpoint error: "+t.message,4,!1)}},async remount_personality(t){if(console.log("Remounting personality ",t),!t)return{status:!1,error:"no personality - mount_personality"};try{console.log("before");const e={client_id:this.$store.state.client_id,category:t.category,folder:t.folder,language:t.language};console.log("after");const n=await Se.post("/remount_personality",e);if(console.log("Remounting personality executed:",n),n)return console.log("Remounting personality res"),this.$store.state.toast.showToast("Personality remounted",4,!0),n.data;console.log("failed remount_personality")}catch(e){console.log(e.message,"remount_personality - settings");return}},async unmountPersonality(t){if(console.log("Unmounting personality:",t),!t)return;const e=await this.unmount_personality(t.personality||t);if(console.log(e),e.status){this.$store.state.config.personalities=e.personalities,this.$store.state.toast.showToast("Personality unmounted",4,!0),this.$store.dispatch("refreshMountedPersonalities");const n=this.$store.state.mountedPersArr[this.$store.state.mountedPersArr.length-1];console.log(n,this.$store.state.mountedPersArr.length),(await this.select_personality(t.personality)).status&&this.$store.state.toast.showToast(`Selected personality: `+n.name,4,!0)}else this.$store.state.toast.showToast(`Could not unmount personality Error: `+e.error,4,!1)},async unmount_personality(t){if(!t)return{status:!1,error:"no personality - unmount_personality"};const e={client_id:this.$store.state.client_id,language:t.language,category:t.category,folder:t.folder};try{const n=await Se.post("/unmount_personality",e);if(n)return n.data}catch(n){console.log(n.message,"unmount_personality - settings");return}},async showBindingHoveredIn(t){this.bindingHoveredIndex=t},async showBindingHoveredOut(){this.bindingHoveredIndex=null},async showModelHoveredIn(t){this.modelHoveredIndex=t},async showModelHoveredOut(){this.modelHoveredIndex=null},async showPersonalityHoveredIn(t){this.personalityHoveredIndex=t},async showPersonalityHoveredOut(){this.personalityHoveredIndex=null},async onPersonalitySelected(t){if(t){if(t.selected){this.$store.state.toast.showToast("Personality already selected",4,!0);return}const e=t.language===null?t.full_path:t.full_path+":"+t.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 n=await this.select_personality(t);await this.$store.dispatch("refreshConfig"),await this.$store.dispatch("refreshBindings"),await this.$store.dispatch("refreshModelsZoo"),await this.$store.dispatch("refreshModels"),await this.$store.dispatch("refreshMountedPersonalities"),await this.$store.dispatch("refreshConfig"),await this.$store.dispatch("fetchLanguages"),await this.$store.dispatch("fetchLanguage"),await this.$store.dispatch("fetchisRTOn"),console.log("pers is mounted",n),n&&n.status&&n.active_personality_id>-1?this.$store.state.toast.showToast(`Selected personality: `+t.name,4,!0):this.$store.state.toast.showToast(`Error on select personality: -`+t.name,4,!1)}else console.log("mounting pers");this.$emit("personalitySelected"),Ge(()=>{He.replace()})}},async select_personality(t){if(!t)return{status:!1,error:"no personality - select_personality"};const e=t.language===null?t.full_path:t.full_path+":"+t.language;console.log("Selecting personality ",e);const n=this.$store.state.config.personalities.findIndex(s=>s===e),i={client_id:this.$store.state.client_id,id:n};try{const s=await Se.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(t){t.preventDefault();const e=this.$refs.modelsSelectionList;console.log(e);const n=new MouseEvent("click");e.dispatchEvent(n)},setBinding(t){console.log("Setting binding to "+t.name),this.selecting_binding=!0,this.selectedBinding=t,this.$store.state.messageBox.showBlockingMessage("Loading binding"),Se.post("/update_setting",{client_id:this.$store.state.client_id,setting_name:"binding_name",setting_value:t.name}).then(async e=>{this.$store.state.messageBox.hideMessage(),console.log("UPDATED"),console.log(e),await this.$store.dispatch("refreshConfig"),await this.$store.dispatch("refreshBindings"),await this.$store.dispatch("refreshModelsZoo"),await this.$store.dispatch("refreshModels"),this.$store.state.toast.showToast(`Binding changed to ${this.currentBinding.name}`,4,!0),this.selecting_binding=!1}).catch(e=>{this.$store.state.messageBox.hideMessage(),this.$store.state.toast.showToast(`Error ${e}`,4,!0),this.selecting_binding=!1})},setModel(t){console.log("Setting model to "+t.name),this.selecting_model=!0,this.selectedModel=t,this.$store.state.messageBox.showBlockingMessage("Loading model"),Se.post("/update_setting",{client_id:this.$store.state.client_id,setting_name:"model_name",setting_value:t.name}).then(async e=>{this.$store.state.messageBox.hideMessage(),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.messageBox.hideMessage(),this.$store.state.toast.showToast(`Error ${e}`,4,!0),this.selecting_model=!1})},download_files(){Se.get("/download_files")},remove_file(t){Se.get("/remove_discussion_file",{client_id:this.$store.state.client_id,name:t}).then(e=>{console.log(e)})},clear_files(){Se.post("/clear_discussion_files_list",{client_id:this.$store.state.client_id}).then(t=>{console.log(t),t.data.state?(this.$store.state.toast.showToast("File removed successfully",4,!0),this.filesList.length=0,this.isFileSentList.length=0,this.totalSize=0):this.$store.state.toast.showToast("Files couldn't be removed",4,!1)})},send_file(t,e){console.log("Send file triggered");const n=new FileReader,i=24*1024;let s=0,r=0;n.onloadend=()=>{if(n.error){console.error("Error reading file:",n.error);return}const a=n.result,l=s+a.byteLength>=t.size;$e.emit("send_file_chunk",{filename:t.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),e()):o()};function o(){const a=t.slice(s,s+i);n.readAsArrayBuffer(a)}console.log("Uploading file"),o()},makeAnEmptyUserMessage(){this.$emit("createEmptyUserMessage",this.message),this.message=""},makeAnEmptyAIMessage(){this.$emit("createEmptyAIMessage")},startRTCom(){this.is_rt=!0,console.log("is_rt:",this.is_rt),$e.emit("start_bidirectional_audio_stream"),Ge(()=>{He.replace()})},stopRTCom(){this.is_rt=!1,console.log("is_rt:",this.is_rt),$e.emit("stop_bidirectional_audio_stream"),Ge(()=>{He.replace()})},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.isListeningToVoice=!0,this.silenceTimer=setTimeout(()=>{this.recognition.stop()},this.silenceTimeout)},this.recognition.onresult=t=>{let e="";for(let n=t.resultIndex;n{this.recognition.stop()},this.silenceTimeout)},this.recognition.onerror=t=>{console.error("Speech recognition error:",t.error),this.isListeningToVoice=!1,clearTimeout(this.silenceTimer)},this.recognition.onend=()=>{console.log("Speech recognition ended."),this.isListeningToVoice=!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(t){this.showPersonalities=!this.showPersonalities},handleOnTalk(t){console.log("talking"),this.showPersonalities=!1,this.$store.state.toast.showToast(`Personality ${t.name} is Talking`,4,!0),this.onTalk(t)},onMountFun(t){console.log("Mounting personality"),this.$refs.mountedPers.constructor()},onUnmountFun(t){console.log("Unmounting personality"),this.$refs.mountedPers.constructor()},onRemount(t){console.log("Remounting chat"),this.$refs.mountedPers.constructor()},computedFileSize(t){return Ge(()=>{He.replace()}),rs(t)},removeItem(t){console.log("Removing ",t.name),Se.post("/remove_discussion_file",{client_id:this.$store.state.client_id,name:t.name},{headers:this.posts_headers}).then(()=>{this.filesList=this.filesList.filter(e=>e!=t)}),console.log(this.filesList)},sendMessageEvent(t,e="no_internet"){this.$emit("messageSentEvent",t,e)},sendCMDEvent(t){this.$emit("sendCMDEvent",t)},async mountDB(t){await Se.post("/toggle_mount_rag_database",{client_id:this.$store.state.client_id,database_name:t}),await this.$store.dispatch("refreshConfig"),console.log("Refreshed")},addWebLink(){console.log("Emitting addWebLink"),this.$emit("addWebLink")},add_file(){const t=document.createElement("input");t.type="file",t.style.display="none",t.multiple=!0,document.body.appendChild(t),t.addEventListener("change",()=>{console.log("Calling Add file..."),this.addFiles(t.files),document.body.removeChild(t)}),t.click()},takePicture(){$e.emit("take_picture"),$e.on("picture_taken",()=>{Se.post("/get_discussion_files_list",{client_id:this.$store.state.client_id}).then(t=>{this.filesList=t.data.files,this.isFileSentList=t.data.files.map(e=>!0),console.log(`Files recovered: ${this.filesList}`)})})},submitOnEnter(t){this.loading||t.which===13&&(t.preventDefault(),t.repeat||(this.sendMessageEvent(this.message),this.message=""))},submit(){this.message&&(this.sendMessageEvent(this.message),this.message="")},submitWithInternetSearch(){this.message&&(this.sendMessageEvent(this.message,"internet"),this.message="")},stopGenerating(){this.$emit("stopGenerating")},addFiles(t){console.log("Adding files");const e=[...t];let n=0;const i=()=>{if(n>=e.length){console.log(`Files_list: ${this.filesList}`);return}const s=e[n];this.filesList.push(s),this.isFileSentList.push(!1),this.send_file(s,()=>{n++,i()})};i()}},watch:{installedModels:{immediate:!0,handler(t){this.$nextTick(()=>{this.installedModels=t})}},model_name:{immediate:!0,handler(t){this.$nextTick(()=>{this.model_name=t})}},showfilesList(){Ge(()=>{He.replace()})},loading(t,e){Ge(()=>{He.replace()})},filesList:{handler(t,e){let n=0;if(t.length>0)for(let i=0;i{He.replace()}),console.log("Chatbar mounted"),$e.on("rtcom_status_changed",t=>{this.$store.dispatch("fetchisRTOn"),console.log("rtcom_status_changed: ",t.status),console.log("active_tts_service: ",this.$store.state.config.active_tts_service),console.log("is_rt_on: ",this.$store.state.is_rt_on)}),this.$store.dispatch("fetchisRTOn")},activated(){Ge(()=>{He.replace()})}},Pt=t=>(yo("data-v-2c705e91"),t=t(),vo(),t),o0t={class:"absolute bottom-0 left-0 w-fit min-w-96 w-full justify-center text-center"},a0t={key:0,class:"items-center gap-2 bg-bg-light-panel dark:bg-bg-dark-tone shadow-sm hover:shadow-none dark:border-gray-800 w-fit"},l0t={class:"flex"},c0t=["title"],d0t=Pt(()=>c("i",{"data-feather":"list"},null,-1)),u0t=[d0t],p0t={key:0},_0t={class:"flex flex-col max-h-64"},h0t=["title"],f0t={class:"flex flex-row items-center gap-1 text-left p-2 text-sm font-medium items-center gap-2 rounded-lg border bg-gray-100 p-1.5 shadow-sm hover:shadow-none dark:border-gray-800 dark:bg-gray-700 hover:bg-primary dark:hover:bg-primary"},m0t={key:0,filesList:"",role:"status"},g0t=Pt(()=>c("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"},[c("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),c("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)),b0t=Pt(()=>c("span",{class:"sr-only"},"Loading...",-1)),E0t=[g0t,b0t],y0t=Pt(()=>c("div",null,[c("i",{"data-feather":"file",class:"w-5 h-5"})],-1)),v0t=Pt(()=>c("div",{class:"grow"},null,-1)),S0t={class:"flex flex-row items-center"},T0t={class:"whitespace-nowrap"},x0t=["onClick"],C0t=Pt(()=>c("i",{"data-feather":"x",class:"w-5 h-5"},null,-1)),w0t=[C0t],R0t={key:1,class:"flex mx-1 w-500"},A0t={class:"whitespace-nowrap flex flex-row gap-2"},N0t=Pt(()=>c("p",{class:"font-bold"}," Total size: ",-1)),O0t=Pt(()=>c("div",{class:"grow"},null,-1)),I0t=Pt(()=>c("i",{"data-feather":"trash",class:"w-5 h-5"},null,-1)),M0t=[I0t],D0t=Pt(()=>c("i",{"data-feather":"download-cloud",class:"w-5 h-5"},null,-1)),k0t=[D0t],L0t={key:2,class:"mx-1"},P0t={key:1,title:"Selecting model",class:"flex flex-row flex-grow justify-end bg-primary"},U0t={role:"status"},F0t=["src"],B0t=Pt(()=>c("span",{class:"sr-only"},"Selecting model...",-1)),G0t={class:"flex w-fit relative grow w-full"},V0t={class:"relative text-light-text-panel dark:text-dark-text-panel grow flex h-12.5 cursor-pointer select-none items-center gap-2 bg-bg-light-panel dark:bg-bg-dark-tone p-1 shadow-sm hover:shadow-none dark:border-gray-800",tabindex:"0"},z0t={key:0,title:"Waiting for reply"},H0t=["src"],q0t=Pt(()=>c("div",{role:"status"},[c("span",{class:"sr-only"},"Loading...")],-1)),Y0t={key:1,class:"w-fit group relative"},$0t={class:"hide top-50 hide opacity-0 group-hover:bottom-0 opacity-0 .group-hover:block fixed w-[1000px] group absolute group-hover:opacity-100 transform group-hover:translate-y-[-50px] group-hover:translate-x-[0px] transition-all duration-300"},W0t={class:"w-fit flex-wrap flex bg-white bg-opacity-50 backdrop-blur-md rounded p-4"},K0t=["onMouseover"],j0t={class:"relative"},Q0t=["onClick"],X0t=["src","title"],Z0t={class:"group items-center flex flex-row"},J0t=["src","title"],eTt={key:2,class:"w-fit group relative"},tTt={class:"hide top-50 hide opacity-0 group-hover:bottom-0 opacity-0 .group-hover:block fixed w-[1000px] group absolute group-hover:opacity-100 transform group-hover:translate-y-[-50px] group-hover:translate-x-[0px] transition-all duration-300"},nTt={class:"w-fit flex-wrap flex bg-white bg-opacity-50 backdrop-blur-md rounded p-4"},iTt=["onMouseover"],sTt={class:"relative"},rTt=["onClick"],oTt=["src","title"],aTt={class:"group items-center flex flex-row"},lTt=["src","title"],cTt={key:3,class:"w-fit group relative"},dTt={class:"top-50 hide opacity-0 group-hover:bottom-0 .group-hover:block fixed w-[1000px] group absolute group-hover:opacity-100 transform group-hover:translate-y-[-50px] group-hover:translate-x-[0px] transition-all duration-300"},uTt={class:"w-fit flex-wrap flex bg-white bg-opacity-50 backdrop-blur-md rounded p-4"},pTt=["onMouseover"],_Tt={class:"relative"},hTt=["onClick"],fTt=["src","title"],mTt=["onClick"],gTt=Pt(()=>c("span",{class:"-top-6 -right-6 border-gray-500 absolute active:scale-90 w-7 h-7 hover:scale-150 transition bg-bg-light dark:bg-bg-dark rounded-full border-2",title:"Unmount personality"},[c("svg",{"aria-hidden":"true",class:"top-1 left-1 relative w-5 h-5 text-red-600 hover:text-red-500",fill:"currentColor",viewBox:"0 0 20 20","stroke-width":"1",xmlns:"http://www.w3.org/2000/svg"},[c("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)),bTt=[gTt],ETt=["onClick"],yTt=Pt(()=>c("span",{class:"-top-9 left-2 border-gray-500 active:scale-90 absolute items-center w-7 h-7 hover:scale-150 transition text-red-200 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2",title:"Remount"},[c("svg",{xmlns:"http://www.w3.org/2000/svg",class:"top-1 left-1 relative w-4 h-4 text-red-600 hover:text-red-500",viewBox:"0 0 30 30",width:"2",height:"2",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},[c("g",{id:"surface1"},[c("path",{style:{},d:"M 16 4 C 10.886719 4 6.617188 7.160156 4.875 11.625 L 6.71875 12.375 C 8.175781 8.640625 11.710938 6 16 6 C 19.242188 6 22.132813 7.589844 23.9375 10 L 20 10 L 20 12 L 27 12 L 27 5 L 25 5 L 25 8.09375 C 22.808594 5.582031 19.570313 4 16 4 Z M 25.28125 19.625 C 23.824219 23.359375 20.289063 26 16 26 C 12.722656 26 9.84375 24.386719 8.03125 22 L 12 22 L 12 20 L 5 20 L 5 27 L 7 27 L 7 23.90625 C 9.1875 26.386719 12.394531 28 16 28 C 21.113281 28 25.382813 24.839844 27.125 20.375 Z "})])])],-1)),vTt=[yTt],STt=["onClick"],TTt=Pt(()=>c("span",{class:"-top-6 -left-6 border-gray-500 active:scale-90 absolute items-center w-7 h-7 hover:scale-150 transition text-red-200 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2",title:"Talk"},[c("svg",{xmlns:"http://www.w3.org/2000/svg",class:"top-1 left-1 relative w-4 h-4 text-red-600 hover:text-red-500",viewBox:"0 0 24 24",width:"2",height:"2",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},[c("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),c("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})])],-1)),xTt=[TTt],CTt={class:"w-fit"},wTt={class:"w-fit"},RTt={class:"relative grow"},ATt={class:"group relative w-max"},NTt=Pt(()=>c("i",{"data-feather":"send"},null,-1)),OTt=[NTt],ITt=Pt(()=>c("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[c("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"Sends your message to the AI.")],-1)),MTt={class:"group relative w-max"},DTt=["src"],kTt=Pt(()=>c("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[c("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"Sends your message to the AI with internet search.")],-1)),LTt={class:"group relative w-max"},PTt=Pt(()=>c("i",{"data-feather":"mic"},null,-1)),UTt=[PTt],FTt=Pt(()=>c("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[c("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"Press and talk.")],-1)),BTt={key:5,class:"group relative w-max"},GTt=Pt(()=>c("i",{"data-feather":"mic"},null,-1)),VTt=[GTt],zTt=Pt(()=>c("i",{"data-feather":"mic"},null,-1)),HTt=[zTt],qTt=Pt(()=>c("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[c("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"Real time bidirectional audio mode.")],-1)),YTt={key:6,class:"group relative w-max"},$Tt=Pt(()=>c("i",{"data-feather":"file-plus"},null,-1)),WTt=[$Tt],KTt=Pt(()=>c("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[c("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"Send File to the AI.")],-1)),jTt={class:"group relative w-max"},QTt=Pt(()=>c("i",{"data-feather":"camera"},null,-1)),XTt=[QTt],ZTt=Pt(()=>c("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[c("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"Take a shot from webcam.")],-1)),JTt={class:"group relative w-max"},ext=Pt(()=>c("i",{"data-feather":"globe"},null,-1)),txt=[ext],nxt=Pt(()=>c("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[c("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"Add a weblink to the discussion.")],-1)),ixt={class:"group relative w-max"},sxt=Pt(()=>c("i",{"data-feather":"message-square"},null,-1)),rxt=[sxt],oxt=Pt(()=>c("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[c("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"New empty User message.")],-1)),axt={class:"group relative w-max"},lxt=Pt(()=>c("i",{"data-feather":"message-square"},null,-1)),cxt=[lxt],dxt=Pt(()=>c("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[c("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"New empty ai message.")],-1)),uxt=Pt(()=>c("div",{class:"ml-auto gap-2"},null,-1));function pxt(t,e,n,i,s,r){const o=mt("MountedPersonalitiesList"),a=mt("MountedPersonalities"),l=mt("PersonalitiesCommands"),u=mt("UniversalForm");return w(),A(Ye,null,[c("form",null,[c("div",o0t,[s.filesList.length>0||s.showPersonalities?(w(),A("div",a0t,[c("div",l0t,[c("button",{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[0]||(e[0]=be(d=>s.showfilesList=!s.showfilesList,["stop"]))},u0t,8,c0t)]),s.filesList.length>0&&s.showfilesList==!0?(w(),A("div",p0t,[c("div",_0t,[Te(os,{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:We(()=>[(w(!0),A(Ye,null,lt(s.filesList,(d,h)=>(w(),A("div",{key:h+"-"+d.name},[c("div",{class:"m-1",title:d.name},[c("div",f0t,[s.isFileSentList[h]?V("",!0):(w(),A("div",m0t,E0t)),y0t,c("div",{class:ze(["line-clamp-1 w-3/5",s.isFileSentList[h]?"text-green-500":"text-red-200"])},he(d.name),3),v0t,c("div",S0t,[c("p",T0t,he(r.computedFileSize(d.size)),1),c("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:f=>r.removeItem(d)},w0t,8,x0t)])])],8,h0t)]))),128))]),_:1})])])):V("",!0),s.filesList.length>0?(w(),A("div",R0t,[c("div",A0t,[N0t,et(" "+he(s.totalSize)+" ("+he(s.filesList.length)+") ",1)]),O0t,c("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[1]||(e[1]=(...d)=>r.clear_files&&r.clear_files(...d))},M0t),c("button",{type:"button",title:"Download database",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.download_files&&r.download_files(...d))},k0t)])):V("",!0),s.showPersonalities?(w(),A("div",L0t,[Te(o,{ref:"mountedPersList",onShowPersList:r.onShowPersListFun,"on-mounted":r.onMountFun,"on-un-mounted":r.onUnmountFun,"on-remounted":t.onRemountFun,"on-talk":r.handleOnTalk,discussionPersonalities:r.allDiscussionPersonalities},null,8,["onShowPersList","on-mounted","on-un-mounted","on-remounted","on-talk","discussionPersonalities"])])):V("",!0)])):V("",!0),s.selecting_model||s.selecting_binding?(w(),A("div",P0t,[c("div",U0t,[c("img",{src:s.loader_v0,class:"w-50 h-50"},null,8,F0t),B0t])])):V("",!0),c("div",G0t,[c("div",V0t,[n.loading?(w(),A("div",z0t,[c("img",{src:s.loader_v0},null,8,H0t),q0t])):V("",!0),n.loading?V("",!0):(w(),A("div",Y0t,[c("div",$0t,[c("div",W0t,[(w(!0),A(Ye,null,lt(r.installedBindings,(d,h)=>(w(),A("div",{class:"w-fit h-fit inset-0 opacity-100",key:h+"-"+d.name,ref_for:!0,ref:"installedBindings",onMouseover:f=>r.showBindingHoveredIn(h),onMouseleave:e[4]||(e[4]=f=>r.showBindingHoveredOut())},[h!=r.binding_name?(w(),A("div",{key:0,class:ze(["items-center flex flex-row relative z-20 hover:-translate-y-8 duration-300",s.bindingHoveredIndex===h?"scale-150":""])},[c("div",j0t,[c("button",{onClick:be(f=>r.setBinding(d),["prevent"]),class:"w-10 h-10 relative"},[c("img",{src:d.icon?d.icon:s.modelImgPlaceholder,onError:e[3]||(e[3]=(...f)=>s.modelImgPlaceholder&&s.modelImgPlaceholder(...f)),class:ze(["z-50 w-10 h-10 rounded-full object-fill text-red-700 border-2 border-gray-500 active:scale-90",s.bindingHoveredIndex===h?"scale-150 ":""+d.name==r.binding_name?"border-secondary":"border-transparent z-0"]),title:d.name},null,42,X0t)],8,Q0t)])],2)):V("",!0)],40,K0t))),128))])]),c("div",Z0t,[c("button",{onClick:e[5]||(e[5]=be(d=>r.showModelConfig(),["prevent"])),class:"w-8 h-8"},[c("img",{src:r.currentBindingIcon,class:"w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:border-secondary hover:scale-110 hover:-translate-y-1 duration-200",title:r.currentBinding?r.currentBinding.name:"unknown"},null,8,J0t)])])])),n.loading?V("",!0):(w(),A("div",eTt,[c("div",tTt,[c("div",nTt,[(w(!0),A(Ye,null,lt(r.installedModels,(d,h)=>(w(),A("div",{class:"w-fit h-fit",key:h+"-"+d.name,ref_for:!0,ref:"installedModels",onMouseover:f=>r.showModelHoveredIn(h),onMouseleave:e[7]||(e[7]=f=>r.showModelHoveredOut())},[h!=r.model_name?(w(),A("div",{key:0,class:ze(["items-center flex flex-row relative z-20 hover:-translate-y-8 duration-300",s.modelHoveredIndex===h?"scale-150":""])},[c("div",sTt,[c("button",{onClick:be(f=>r.setModel(d),["prevent"]),class:"w-10 h-10 relative"},[c("img",{src:d.icon?d.icon:s.modelImgPlaceholder,onError:e[6]||(e[6]=(...f)=>t.personalityImgPlacehodler&&t.personalityImgPlacehodler(...f)),class:ze(["z-50 w-10 h-10 rounded-full object-fill text-red-700 border-2 border-gray-500 active:scale-90",s.modelHoveredIndex===h?"scale-150 ":""+d.name==r.model_name?"border-secondary":"border-transparent z-0"]),title:d.name},null,42,oTt)],8,rTt)])],2)):V("",!0)],40,iTt))),128))])]),c("div",aTt,[c("button",{onClick:e[8]||(e[8]=be(d=>r.showModelConfig(),["prevent"])),class:"w-8 h-8"},[c("img",{src:r.currentModelIcon,class:"w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:border-secondary hover:scale-110 hover:-translate-y-1 duration-400",title:r.currentModel?r.currentModel.name:"unknown"},null,8,lTt)])])])),n.loading?V("",!0):(w(),A("div",cTt,[c("div",dTt,[c("div",uTt,[(w(!0),A(Ye,null,lt(r.mountedPersonalities,(d,h)=>(w(),A("div",{class:"w-fit h-fit inset-0 opacity-100",key:h+"-"+d.name,ref_for:!0,ref:"mountedPersonalities",onMouseover:f=>r.showPersonalityHoveredIn(h),onMouseleave:e[10]||(e[10]=f=>r.showPersonalityHoveredOut())},[h!=r.personality_name?(w(),A("div",{key:0,class:ze(["items-center flex flex-row relative z-20 hover:-translate-y-8 duration-300",s.personalityHoveredIndex===h?"scale-150":""])},[c("div",_Tt,[c("button",{onClick:be(f=>r.onPersonalitySelected(d),["prevent"]),class:"w-10 h-10 relative"},[c("img",{src:s.bUrl+d.avatar,onError:e[9]||(e[9]=(...f)=>t.personalityImgPlacehodler&&t.personalityImgPlacehodler(...f)),class:ze(["z-50 w-10 h-10 rounded-full object-fill text-red-700 border-2 border-gray-500 active:scale-90",s.personalityHoveredIndex===h?"scale-150 ":""+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,fTt)],8,hTt),s.personalityHoveredIndex===h?(w(),A("button",{key:0,onClick:be(f=>r.unmountPersonality(d),["prevent"])},bTt,8,mTt)):V("",!0),s.personalityHoveredIndex===h?(w(),A("button",{key:1,onClick:be(f=>r.remount_personality(d),["prevent"])},vTt,8,ETt)):V("",!0),s.personalityHoveredIndex===h?(w(),A("button",{key:2,onClick:be(f=>r.handleOnTalk(d),["prevent"])},xTt,8,STt)):V("",!0)])],2)):V("",!0)],40,pTt))),128))])]),Te(a,{ref:"mountedPers",onShowPersList:r.onShowPersListFun,onReady:r.onPersonalitiesReadyFun},null,8,["onShowPersList","onReady"])])),c("div",CTt,[s.personalities_ready&&this.$store.state.mountedPersArr[this.$store.state.config.active_personality_id].commands!=""?(w(),xt(l,{key:0,commandsList:this.$store.state.mountedPersArr[this.$store.state.config.active_personality_id].commands,sendCommand:r.sendCMDEvent,"on-show-toast-message":n.onShowToastMessage,ref:"personalityCMD"},null,8,["commandsList","sendCommand","on-show-toast-message"])):V("",!0)]),c("div",wTt,[r.isDataSourceNamesValid?(w(),xt(l,{key:0,icon:"feather:book",commandsList:r.dataSourceNames,sendCommand:r.mountDB,"on-show-toast-message":n.onShowToastMessage,ref:"databasesList"},null,8,["commandsList","sendCommand","on-show-toast-message"])):V("",!0)]),c("div",RTt,[G(c("textarea",{id:"chat",rows:"1","onUpdate:modelValue":e[11]||(e[11]=d=>s.message=d),title:"Hold SHIFT + ENTER to add new line",onPaste:e[12]||(e[12]=(...d)=>r.handlePaste&&r.handlePaste(...d)),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[13]||(e[13]=Hs(be(d=>r.submitOnEnter(d),["exact"]),["enter"]))},`\r - `,544),[[we,s.message]])]),n.loading?(w(),A("button",{key:4,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[14]||(e[14]=be((...d)=>r.stopGenerating&&r.stopGenerating(...d),["stop"]))}," Stop generating ")):V("",!0),c("div",ATt,[n.loading?V("",!0):(w(),A("button",{key:0,type:"button",onClick:e[15]||(e[15]=(...d)=>r.submit&&r.submit(...d)),title:"Send",class:"w-6 text-panel hover:text-secondary duration-75 active:scale-90 cursor-pointer transform transition-transform hover:translate-y-[-5px] active:scale-90"},OTt)),ITt]),c("div",MTt,[n.loading?V("",!0):(w(),A("button",{key:0,type:"button",onClick:e[16]||(e[16]=(...d)=>r.submitWithInternetSearch&&r.submitWithInternetSearch(...d)),title:"Send With internet",class:"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer transform transition-transform hover:translate-y-[-5px] active:scale-90"},[c("img",{src:s.sendGlobe,width:"50",height:"50",style:{stroke:"currentColor",fill:"currentColor"}},null,8,DTt)])),kTt]),c("div",LTt,[n.loading?V("",!0):(w(),A("button",{key:0,type:"button",onClick:e[17]||(e[17]=(...d)=>r.startSpeechRecognition&&r.startSpeechRecognition(...d)),class:ze([{"text-red-500":s.isListeningToVoice},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer transform transition-transform hover:translate-y-[-5px] active:scale-90"])},UTt,2)),FTt]),t.$store.state.config.active_tts_service!="None"?(w(),A("div",BTt,[s.is_rt?(w(),A("button",{key:0,type:"button",onClick:e[18]||(e[18]=(...d)=>r.stopRTCom&&r.stopRTCom(...d)),class:"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer transform transition-transform hover:translate-y-[-5px] active:scale-90 bg-red-500 border borderred700 rounded-md"},VTt)):(w(),A("button",{key:1,type:"button",onClick:e[19]||(e[19]=(...d)=>r.startRTCom&&r.startRTCom(...d)),class:"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer transform transition-transform hover:translate-y-[-5px] active:scale-90 bg-green-500 border border-green-700 rounded-md"},HTt)),qTt])):V("",!0),n.loading?V("",!0):(w(),A("div",YTt,[c("input",{type:"file",ref:"fileDialog",style:{display:"none"},onChange:e[20]||(e[20]=(...d)=>r.addFiles&&r.addFiles(...d)),multiple:""},null,544),c("button",{type:"button",onClick:e[21]||(e[21]=be((...d)=>r.add_file&&r.add_file(...d),["prevent"])),class:"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer transform transition-transform hover:translate-y-[-5px] active:scale-90"},WTt),KTt])),c("div",jTt,[n.loading?V("",!0):(w(),A("button",{key:0,type:"button",onClick:e[22]||(e[22]=be((...d)=>r.takePicture&&r.takePicture(...d),["stop"])),class:"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer transform transition-transform hover:translate-y-[-5px] active:scale-90"},XTt)),ZTt]),c("div",JTt,[n.loading?V("",!0):(w(),A("button",{key:0,type:"button",onClick:e[23]||(e[23]=be((...d)=>r.addWebLink&&r.addWebLink(...d),["stop"])),class:"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer transform transition-transform hover:translate-y-[-5px] active:scale-90"},txt)),nxt]),c("div",ixt,[n.loading?V("",!0):(w(),A("button",{key:0,type:"button",onClick:e[24]||(e[24]=be((...d)=>r.makeAnEmptyUserMessage&&r.makeAnEmptyUserMessage(...d),["stop"])),class:"w-6 text-gray-800 hover:text-secondary duration-75 active:scale-90 hover:translate-y-[-5px]"},rxt)),oxt]),c("div",axt,[n.loading?V("",!0):(w(),A("button",{key:0,type:"button",onClick:e[25]||(e[25]=be((...d)=>r.makeAnEmptyAIMessage&&r.makeAnEmptyAIMessage(...d),["stop"])),class:"w-6 text-red-400 hover:text-secondary duration-75 active:scale-90 hover:translate-y-[-5px]"},cxt)),dxt])]),uxt])])]),Te(u,{ref:"universalForm",class:"z-20"},null,512)],64)}const vO=bt(r0t,[["render",pxt],["__scopeId","data-v-2c705e91"]]),_xt={name:"WelcomeComponent",computed:{storeLogo(){return this.$store.state.config?Ti:this.$store.state.config.app_custom_logo!=""?"/user_infos/"+this.$store.state.config.app_custom_logo:Ti}},data(){},setup(){return{}}},hxt={class:"flex flex-col text-center w-full h-full"},fxt={class:"flex flex-col text-center items-center"},mxt={class:"flex items-center gap-3 text-5xl drop-shadow-md align-middle pt-24"},gxt=["src"],bxt=c("div",{class:"flex flex-col items-start"},[c("p",{class:"text-2xl"},"LoLLMS"),c("p",{class:"text-gray-400 text-base"},"One tool to rule them all")],-1),Ext=c("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),yxt=c("p",{class:"text-2xl"},"Welcome",-1),vxt=c("p",{class:"text-lg"},"Please create a new discussion or select existing one to start",-1);function Sxt(t,e,n,i,s,r){return w(),A("div",hxt,[c("div",fxt,[c("div",mxt,[c("img",{class:"w-12 hover:scale-95 duration-150",title:"LoLLMS WebUI",src:t.$store.state.config==null?r.storeLogo:t.$store.state.config.app_custom_logo!=""?"/user_infos/"+t.$store.state.config.app_custom_logo:r.storeLogo,alt:"Logo"},null,8,gxt),bxt]),Ext,yxt,vxt])])}const SO=bt(_xt,[["render",Sxt]]);var Txt=function(){function t(e,n){n===void 0&&(n=[]),this._eventType=e,this._eventFunctions=n}return t.prototype.init=function(){var e=this;this._eventFunctions.forEach(function(n){typeof window<"u"&&window.addEventListener(e._eventType,n)})},t}(),iu=globalThis&&globalThis.__assign||function(){return iu=Object.assign||function(t){for(var e,n=1,i=arguments.length;n"u")return!1;var e=ai(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Pxt(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var i=e.styles[n]||{},s=e.attributes[n]||{},r=e.elements[n];!xi(r)||!us(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 Uxt(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.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]:n[i]),a=o.reduce(function(l,u){return l[u]="",l},{});!xi(s)||!us(s)||(Object.assign(s.style,a),Object.keys(r).forEach(function(l){s.removeAttribute(l)}))})}}const Fxt={name:"applyStyles",enabled:!0,phase:"write",fn:Pxt,effect:Uxt,requires:["computeStyles"]};function as(t){return t.split("-")[0]}var ro=Math.max,au=Math.min,ya=Math.round;function eb(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function NO(){return!/^((?!chrome|android).)*safari/i.test(eb())}function va(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var i=t.getBoundingClientRect(),s=1,r=1;e&&xi(t)&&(s=t.offsetWidth>0&&ya(i.width)/t.offsetWidth||1,r=t.offsetHeight>0&&ya(i.height)/t.offsetHeight||1);var o=ho(t)?ai(t):window,a=o.visualViewport,l=!NO()&&n,u=(i.left+(l&&a?a.offsetLeft:0))/s,d=(i.top+(l&&a?a.offsetTop:0))/r,h=i.width/s,f=i.height/r;return{width:h,height:f,top:d,right:u+h,bottom:d+f,left:u,x:u,y:d}}function LE(t){var e=va(t),n=t.offsetWidth,i=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:i}}function OO(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&kE(n)){var i=e;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function qs(t){return ai(t).getComputedStyle(t)}function Bxt(t){return["table","td","th"].indexOf(us(t))>=0}function Or(t){return((ho(t)?t.ownerDocument:t.document)||window.document).documentElement}function ap(t){return us(t)==="html"?t:t.assignedSlot||t.parentNode||(kE(t)?t.host:null)||Or(t)}function DC(t){return!xi(t)||qs(t).position==="fixed"?null:t.offsetParent}function Gxt(t){var e=/firefox/i.test(eb()),n=/Trident/i.test(eb());if(n&&xi(t)){var i=qs(t);if(i.position==="fixed")return null}var s=ap(t);for(kE(s)&&(s=s.host);xi(s)&&["html","body"].indexOf(us(s))<0;){var r=qs(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 yc(t){for(var e=ai(t),n=DC(t);n&&Bxt(n)&&qs(n).position==="static";)n=DC(n);return n&&(us(n)==="html"||us(n)==="body"&&qs(n).position==="static")?e:n||Gxt(t)||e}function PE(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function kl(t,e,n){return ro(t,au(e,n))}function Vxt(t,e,n){var i=kl(t,e,n);return i>n?n:i}function IO(){return{top:0,right:0,bottom:0,left:0}}function MO(t){return Object.assign({},IO(),t)}function DO(t,e){return e.reduce(function(n,i){return n[i]=t,n},{})}var zxt=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,MO(typeof e!="number"?e:DO(e,Ec))};function Hxt(t){var e,n=t.state,i=t.name,s=t.options,r=n.elements.arrow,o=n.modifiersData.popperOffsets,a=as(n.placement),l=PE(a),u=[Xn,Ai].indexOf(a)>=0,d=u?"height":"width";if(!(!r||!o)){var h=zxt(s.padding,n),f=LE(r),_=l==="y"?Qn:Xn,m=l==="y"?Ri:Ai,E=n.rects.reference[d]+n.rects.reference[l]-o[l]-n.rects.popper[d],b=o[l]-n.rects.reference[l],g=yc(r),y=g?l==="y"?g.clientHeight||0:g.clientWidth||0:0,v=E/2-b/2,S=h[_],C=y-f[d]-h[m],T=y/2-f[d]/2+v,O=kl(S,T,C),k=l;n.modifiersData[i]=(e={},e[k]=O,e.centerOffset=O-T,e)}}function qxt(t){var e=t.state,n=t.options,i=n.element,s=i===void 0?"[data-popper-arrow]":i;s!=null&&(typeof s=="string"&&(s=e.elements.popper.querySelector(s),!s)||OO(e.elements.popper,s)&&(e.elements.arrow=s))}const Yxt={name:"arrow",enabled:!0,phase:"main",fn:Hxt,effect:qxt,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Sa(t){return t.split("-")[1]}var $xt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Wxt(t,e){var n=t.x,i=t.y,s=e.devicePixelRatio||1;return{x:ya(n*s)/s||0,y:ya(i*s)/s||0}}function kC(t){var e,n=t.popper,i=t.popperRect,s=t.placement,r=t.variation,o=t.offsets,a=t.position,l=t.gpuAcceleration,u=t.adaptive,d=t.roundOffsets,h=t.isFixed,f=o.x,_=f===void 0?0:f,m=o.y,E=m===void 0?0:m,b=typeof d=="function"?d({x:_,y:E}):{x:_,y:E};_=b.x,E=b.y;var g=o.hasOwnProperty("x"),y=o.hasOwnProperty("y"),v=Xn,S=Qn,C=window;if(u){var T=yc(n),O="clientHeight",k="clientWidth";if(T===ai(n)&&(T=Or(n),qs(T).position!=="static"&&a==="absolute"&&(O="scrollHeight",k="scrollWidth")),T=T,s===Qn||(s===Xn||s===Ai)&&r===ic){S=Ri;var x=h&&T===C&&C.visualViewport?C.visualViewport.height:T[O];E-=x-i.height,E*=l?1:-1}if(s===Xn||(s===Qn||s===Ri)&&r===ic){v=Ai;var I=h&&T===C&&C.visualViewport?C.visualViewport.width:T[k];_-=I-i.width,_*=l?1:-1}}var F=Object.assign({position:a},u&&$xt),B=d===!0?Wxt({x:_,y:E},ai(n)):{x:_,y:E};if(_=B.x,E=B.y,l){var ne;return Object.assign({},F,(ne={},ne[S]=y?"0":"",ne[v]=g?"0":"",ne.transform=(C.devicePixelRatio||1)<=1?"translate("+_+"px, "+E+"px)":"translate3d("+_+"px, "+E+"px, 0)",ne))}return Object.assign({},F,(e={},e[S]=y?E+"px":"",e[v]=g?_+"px":"",e.transform="",e))}function Kxt(t){var e=t.state,n=t.options,i=n.gpuAcceleration,s=i===void 0?!0:i,r=n.adaptive,o=r===void 0?!0:r,a=n.roundOffsets,l=a===void 0?!0:a,u={placement:as(e.placement),variation:Sa(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,kC(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,kC(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const jxt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Kxt,data:{}};var qc={passive:!0};function Qxt(t){var e=t.state,n=t.instance,i=t.options,s=i.scroll,r=s===void 0?!0:s,o=i.resize,a=o===void 0?!0:o,l=ai(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&u.forEach(function(d){d.addEventListener("scroll",n.update,qc)}),a&&l.addEventListener("resize",n.update,qc),function(){r&&u.forEach(function(d){d.removeEventListener("scroll",n.update,qc)}),a&&l.removeEventListener("resize",n.update,qc)}}const Xxt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Qxt,data:{}};var Zxt={left:"right",right:"left",bottom:"top",top:"bottom"};function Fd(t){return t.replace(/left|right|bottom|top/g,function(e){return Zxt[e]})}var Jxt={start:"end",end:"start"};function LC(t){return t.replace(/start|end/g,function(e){return Jxt[e]})}function UE(t){var e=ai(t),n=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:n,scrollTop:i}}function FE(t){return va(Or(t)).left+UE(t).scrollLeft}function eCt(t,e){var n=ai(t),i=Or(t),s=n.visualViewport,r=i.clientWidth,o=i.clientHeight,a=0,l=0;if(s){r=s.width,o=s.height;var u=NO();(u||!u&&e==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:r,height:o,x:a+FE(t),y:l}}function tCt(t){var e,n=Or(t),i=UE(t),s=(e=t.ownerDocument)==null?void 0:e.body,r=ro(n.scrollWidth,n.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=ro(n.scrollHeight,n.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-i.scrollLeft+FE(t),l=-i.scrollTop;return qs(s||n).direction==="rtl"&&(a+=ro(n.clientWidth,s?s.clientWidth:0)-r),{width:r,height:o,x:a,y:l}}function BE(t){var e=qs(t),n=e.overflow,i=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+s+i)}function kO(t){return["html","body","#document"].indexOf(us(t))>=0?t.ownerDocument.body:xi(t)&&BE(t)?t:kO(ap(t))}function Ll(t,e){var n;e===void 0&&(e=[]);var i=kO(t),s=i===((n=t.ownerDocument)==null?void 0:n.body),r=ai(i),o=s?[r].concat(r.visualViewport||[],BE(i)?i:[]):i,a=e.concat(o);return s?a:a.concat(Ll(ap(o)))}function tb(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function nCt(t,e){var n=va(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function PC(t,e,n){return e===RO?tb(eCt(t,n)):ho(e)?nCt(e,n):tb(tCt(Or(t)))}function iCt(t){var e=Ll(ap(t)),n=["absolute","fixed"].indexOf(qs(t).position)>=0,i=n&&xi(t)?yc(t):t;return ho(i)?e.filter(function(s){return ho(s)&&OO(s,i)&&us(s)!=="body"}):[]}function sCt(t,e,n,i){var s=e==="clippingParents"?iCt(t):[].concat(e),r=[].concat(s,[n]),o=r[0],a=r.reduce(function(l,u){var d=PC(t,u,i);return l.top=ro(d.top,l.top),l.right=au(d.right,l.right),l.bottom=au(d.bottom,l.bottom),l.left=ro(d.left,l.left),l},PC(t,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 LO(t){var e=t.reference,n=t.element,i=t.placement,s=i?as(i):null,r=i?Sa(i):null,o=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(s){case Qn:l={x:o,y:e.y-n.height};break;case Ri:l={x:o,y:e.y+e.height};break;case Ai:l={x:e.x+e.width,y:a};break;case Xn:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var u=s?PE(s):null;if(u!=null){var d=u==="y"?"height":"width";switch(r){case Ea:l[u]=l[u]-(e[d]/2-n[d]/2);break;case ic:l[u]=l[u]+(e[d]/2-n[d]/2);break}}return l}function sc(t,e){e===void 0&&(e={});var n=e,i=n.placement,s=i===void 0?t.placement:i,r=n.strategy,o=r===void 0?t.strategy:r,a=n.boundary,l=a===void 0?xxt:a,u=n.rootBoundary,d=u===void 0?RO:u,h=n.elementContext,f=h===void 0?hl:h,_=n.altBoundary,m=_===void 0?!1:_,E=n.padding,b=E===void 0?0:E,g=MO(typeof b!="number"?b:DO(b,Ec)),y=f===hl?Cxt:hl,v=t.rects.popper,S=t.elements[m?y:f],C=sCt(ho(S)?S:S.contextElement||Or(t.elements.popper),l,d,o),T=va(t.elements.reference),O=LO({reference:T,element:v,strategy:"absolute",placement:s}),k=tb(Object.assign({},v,O)),x=f===hl?k:T,I={top:C.top-x.top+g.top,bottom:x.bottom-C.bottom+g.bottom,left:C.left-x.left+g.left,right:x.right-C.right+g.right},F=t.modifiersData.offset;if(f===hl&&F){var B=F[s];Object.keys(I).forEach(function(ne){var L=[Ai,Ri].indexOf(ne)>=0?1:-1,$=[Qn,Ri].indexOf(ne)>=0?"y":"x";I[ne]+=B[$]*L})}return I}function rCt(t,e){e===void 0&&(e={});var n=e,i=n.placement,s=n.boundary,r=n.rootBoundary,o=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?AO:l,d=Sa(i),h=d?a?MC:MC.filter(function(m){return Sa(m)===d}):Ec,f=h.filter(function(m){return u.indexOf(m)>=0});f.length===0&&(f=h);var _=f.reduce(function(m,E){return m[E]=sc(t,{placement:E,boundary:s,rootBoundary:r,padding:o})[as(E)],m},{});return Object.keys(_).sort(function(m,E){return _[m]-_[E]})}function oCt(t){if(as(t)===DE)return[];var e=Fd(t);return[LC(t),e,LC(e)]}function aCt(t){var e=t.state,n=t.options,i=t.name;if(!e.modifiersData[i]._skip){for(var s=n.mainAxis,r=s===void 0?!0:s,o=n.altAxis,a=o===void 0?!0:o,l=n.fallbackPlacements,u=n.padding,d=n.boundary,h=n.rootBoundary,f=n.altBoundary,_=n.flipVariations,m=_===void 0?!0:_,E=n.allowedAutoPlacements,b=e.options.placement,g=as(b),y=g===b,v=l||(y||!m?[Fd(b)]:oCt(b)),S=[b].concat(v).reduce(function(Ee,xe){return Ee.concat(as(xe)===DE?rCt(e,{placement:xe,boundary:d,rootBoundary:h,padding:u,flipVariations:m,allowedAutoPlacements:E}):xe)},[]),C=e.rects.reference,T=e.rects.popper,O=new Map,k=!0,x=S[0],I=0;I=0,$=L?"width":"height",H=sc(e,{placement:F,boundary:d,rootBoundary:h,altBoundary:f,padding:u}),U=L?ne?Ai:Xn:ne?Ri:Qn;C[$]>T[$]&&(U=Fd(U));var Q=Fd(U),J=[];if(r&&J.push(H[B]<=0),a&&J.push(H[U]<=0,H[Q]<=0),J.every(function(Ee){return Ee})){x=F,k=!1;break}O.set(F,J)}if(k)for(var j=m?3:1,ae=function(xe){var Me=S.find(function(Z){var ye=O.get(Z);if(ye)return ye.slice(0,xe).every(function(fe){return fe})});if(Me)return x=Me,"break"},ve=j;ve>0;ve--){var ee=ae(ve);if(ee==="break")break}e.placement!==x&&(e.modifiersData[i]._skip=!0,e.placement=x,e.reset=!0)}}const lCt={name:"flip",enabled:!0,phase:"main",fn:aCt,requiresIfExists:["offset"],data:{_skip:!1}};function UC(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function FC(t){return[Qn,Ai,Ri,Xn].some(function(e){return t[e]>=0})}function cCt(t){var e=t.state,n=t.name,i=e.rects.reference,s=e.rects.popper,r=e.modifiersData.preventOverflow,o=sc(e,{elementContext:"reference"}),a=sc(e,{altBoundary:!0}),l=UC(o,i),u=UC(a,s,r),d=FC(l),h=FC(u);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":h})}const dCt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:cCt};function uCt(t,e,n){var i=as(t),s=[Xn,Qn].indexOf(i)>=0?-1:1,r=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,o=r[0],a=r[1];return o=o||0,a=(a||0)*s,[Xn,Ai].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}function pCt(t){var e=t.state,n=t.options,i=t.name,s=n.offset,r=s===void 0?[0,0]:s,o=AO.reduce(function(d,h){return d[h]=uCt(h,e.rects,r),d},{}),a=o[e.placement],l=a.x,u=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=u),e.modifiersData[i]=o}const _Ct={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:pCt};function hCt(t){var e=t.state,n=t.name;e.modifiersData[n]=LO({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const fCt={name:"popperOffsets",enabled:!0,phase:"read",fn:hCt,data:{}};function mCt(t){return t==="x"?"y":"x"}function gCt(t){var e=t.state,n=t.options,i=t.name,s=n.mainAxis,r=s===void 0?!0:s,o=n.altAxis,a=o===void 0?!1:o,l=n.boundary,u=n.rootBoundary,d=n.altBoundary,h=n.padding,f=n.tether,_=f===void 0?!0:f,m=n.tetherOffset,E=m===void 0?0:m,b=sc(e,{boundary:l,rootBoundary:u,padding:h,altBoundary:d}),g=as(e.placement),y=Sa(e.placement),v=!y,S=PE(g),C=mCt(S),T=e.modifiersData.popperOffsets,O=e.rects.reference,k=e.rects.popper,x=typeof E=="function"?E(Object.assign({},e.rects,{placement:e.placement})):E,I=typeof x=="number"?{mainAxis:x,altAxis:x}:Object.assign({mainAxis:0,altAxis:0},x),F=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,B={x:0,y:0};if(T){if(r){var ne,L=S==="y"?Qn:Xn,$=S==="y"?Ri:Ai,H=S==="y"?"height":"width",U=T[S],Q=U+b[L],J=U-b[$],j=_?-k[H]/2:0,ae=y===Ea?O[H]:k[H],ve=y===Ea?-k[H]:-O[H],ee=e.elements.arrow,Ee=_&&ee?LE(ee):{width:0,height:0},xe=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:IO(),Me=xe[L],Z=xe[$],ye=kl(0,O[H],Ee[H]),fe=v?O[H]/2-j-ye-Me-I.mainAxis:ae-ye-Me-I.mainAxis,Ne=v?-O[H]/2+j+ye+Z+I.mainAxis:ve+ye+Z+I.mainAxis,Le=e.elements.arrow&&yc(e.elements.arrow),D=Le?S==="y"?Le.clientTop||0:Le.clientLeft||0:0,q=(ne=F==null?void 0:F[S])!=null?ne:0,K=U+fe-q-D,de=U+Ne-q,le=kl(_?au(Q,K):Q,U,_?ro(J,de):J);T[S]=le,B[S]=le-U}if(a){var Re,Ie=S==="x"?Qn:Xn,z=S==="x"?Ri:Ai,pe=T[C],re=C==="y"?"height":"width",ce=pe+b[Ie],M=pe-b[z],N=[Qn,Xn].indexOf(g)!==-1,W=(Re=F==null?void 0:F[C])!=null?Re:0,ue=N?ce:pe-O[re]-k[re]-W+I.altAxis,X=N?pe+O[re]+k[re]-W-I.altAxis:M,ie=_&&N?Vxt(ue,pe,X):kl(_?ue:ce,pe,_?X:M);T[C]=ie,B[C]=ie-pe}e.modifiersData[i]=B}}const bCt={name:"preventOverflow",enabled:!0,phase:"main",fn:gCt,requiresIfExists:["offset"]};function ECt(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function yCt(t){return t===ai(t)||!xi(t)?UE(t):ECt(t)}function vCt(t){var e=t.getBoundingClientRect(),n=ya(e.width)/t.offsetWidth||1,i=ya(e.height)/t.offsetHeight||1;return n!==1||i!==1}function SCt(t,e,n){n===void 0&&(n=!1);var i=xi(e),s=xi(e)&&vCt(e),r=Or(e),o=va(t,s,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!n)&&((us(e)!=="body"||BE(r))&&(a=yCt(e)),xi(e)?(l=va(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):r&&(l.x=FE(r))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function TCt(t){var e=new Map,n=new Set,i=[];t.forEach(function(r){e.set(r.name,r)});function s(r){n.add(r.name);var o=[].concat(r.requires||[],r.requiresIfExists||[]);o.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&s(l)}}),i.push(r)}return t.forEach(function(r){n.has(r.name)||s(r)}),i}function xCt(t){var e=TCt(t);return Lxt.reduce(function(n,i){return n.concat(e.filter(function(s){return s.phase===i}))},[])}function CCt(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function wCt(t){var e=t.reduce(function(n,i){var s=n[i.name];return n[i.name]=s?Object.assign({},s,i,{options:Object.assign({},s.options,i.options),data:Object.assign({},s.data,i.data)}):i,n},{});return Object.keys(e).map(function(n){return e[n]})}var BC={placement:"bottom",modifiers:[],strategy:"absolute"};function GC(){for(var t=arguments.length,e=new Array(t),n=0;n(yo("data-v-b8e854ae"),t=t(),vo(),t),kCt={key:0,class:"fixed top-0 left-0 w-screen h-screen flex items-center justify-center"},LCt={class:"flex flex-col text-center"},PCt={class:"flex flex-col text-center items-center"},UCt={class:"flex items-center gap-3 text-5xl drop-shadow-md align-middle pt-24"},FCt=Ft(()=>c("img",{class:"w-24 animate-bounce",title:"LoLLMS WebUI",src:Ti,alt:"Logo"},null,-1)),BCt={class:"flex flex-col items-start"},GCt={class:"text-2xl font-bold text-5xl drop-shadow-md align-middle"},VCt=Ft(()=>c("p",{class:"text-gray-400 text-base"},"One tool to rule them all",-1)),zCt=Ft(()=>c("p",{class:"text-gray-400 text-base"},"by ParisNeo",-1)),HCt=Ft(()=>c("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)),qCt=Ft(()=>c("p",{class:"text-2xl mb-10 font-bold drop-shadow-md"},"Welcome",-1)),YCt={role:"status",class:"text-center w-full display: flex; flex-row align-items: center;"},$Ct={class:"text-2xl animate-pulse mt-2"},WCt=Ft(()=>c("i",{"data-feather":"chevron-right"},null,-1)),KCt=[WCt],jCt=Ft(()=>c("i",{"data-feather":"chevron-left"},null,-1)),QCt=[jCt],XCt={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"},ZCt={class:"text-light-text-panel dark:text-dark-text-panel bg-bg-light-panel sticky z-10 top-0 dark:bg-bg-dark-tone shadow-md"},JCt={class:"flex-row p-4 flex items-center gap-3 flex-0"},e1t=Ft(()=>c("i",{"data-feather":"plus"},null,-1)),t1t=[e1t],n1t=Ft(()=>c("i",{"data-feather":"check-square"},null,-1)),i1t=[n1t],s1t={class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Reset database, remove all discussions"},r1t=Ft(()=>c("i",{"data-feather":"database"},null,-1)),o1t=[r1t],a1t=Ft(()=>c("i",{"data-feather":"log-in"},null,-1)),l1t=[a1t],c1t=Ft(()=>c("i",{"data-feather":"folder"},null,-1)),d1t=[c1t],u1t={key:1,class:"dropdown"},p1t=Ft(()=>c("i",{"data-feather":"search"},null,-1)),_1t=[p1t],h1t={key:2,class:"flex gap-3 flex-1 items-center duration-75"},f1t=Ft(()=>c("i",{"data-feather":"x"},null,-1)),m1t=[f1t],g1t=Ft(()=>c("i",{"data-feather":"check"},null,-1)),b1t=[g1t],E1t=Ft(()=>c("i",{"data-feather":"hard-drive"},null,-1)),y1t=[E1t],v1t=Ft(()=>c("i",{"data-feather":"check-circle"},null,-1)),S1t=[v1t],T1t=Ft(()=>c("i",{"data-feather":"x-octagon"},null,-1)),x1t=[T1t],C1t=Ft(()=>c("i",{"data-feather":"book"},null,-1)),w1t=[C1t],R1t={key:7,title:"Loading..",class:"flex flex-row flex-grow justify-end"},A1t=Ft(()=>c("div",{role:"status"},[c("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"},[c("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),c("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"})]),c("span",{class:"sr-only"},"Loading...")],-1)),N1t=[A1t],O1t={key:0,class:"flex-row items-center gap-3 flex-0 w-full"},I1t={class:"p-4 pt-2"},M1t={class:"relative"},D1t=Ft(()=>c("div",{class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},[c("div",{class:"scale-75"},[c("i",{"data-feather":"search"})])],-1)),k1t={class:"absolute inset-y-0 right-0 flex items-center pr-3"},L1t=Ft(()=>c("i",{"data-feather":"x"},null,-1)),P1t=[L1t],U1t={key:1,class:"h-px bg-bg-light p-0 mb-4 px-4 mx-4 border-0 dark:bg-bg-dark"},F1t={key:2,class:"flex flex-row flex-grow p-4 pt-0 items-center"},B1t={class:"flex flex-row flex-grow"},G1t={key:0},V1t={class:"flex flex-row"},z1t={key:0,class:"flex gap-3"},H1t=Ft(()=>c("i",{"data-feather":"trash"},null,-1)),q1t=[H1t],Y1t={key:1,class:"flex gap-3 mx-3 flex-1 items-center justify-end group-hover:visible duration-75"},$1t=Ft(()=>c("i",{"data-feather":"check"},null,-1)),W1t=[$1t],K1t=Ft(()=>c("i",{"data-feather":"x"},null,-1)),j1t=[K1t],Q1t={class:"flex gap-3"},X1t=Ft(()=>c("i",{"data-feather":"codepen"},null,-1)),Z1t=[X1t],J1t=Ft(()=>c("i",{"data-feather":"folder"},null,-1)),ewt=[J1t],twt=Ft(()=>c("i",{"data-feather":"bookmark"},null,-1)),nwt=[twt],iwt=Ft(()=>c("i",{"data-feather":"list"},null,-1)),swt=[iwt],rwt={class:"relative flex flex-row flex-grow mb-10 z-0 w-full"},owt={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"},awt=Ft(()=>c("p",{class:"px-3"},"No discussions are found",-1)),lwt=[awt],cwt=Ft(()=>c("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)),dwt={class:"text-center font-large font-bold text-l drop-shadow-md align-middle"},uwt={key:1,class:"relative flex flex-col flex-grow w-full"},pwt={class:"container pt-4 pb-50 mb-50 w-full"},_wt=Ft(()=>c("div",null,[c("br"),c("br"),c("br"),c("br"),c("br"),c("br"),c("br")],-1)),hwt=Ft(()=>c("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)),fwt={key:0,class:"flex flex-row items-center justify-center h-10"},mwt={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"},gwt={class:"text-2xl animate-pulse mt-2 text-light-text-panel dark:text-dark-text-panel"},bwt={setup(){},data(){return{memory_icon:OCt,active_skills:ICt,inactive_skills:MCt,skillsRegistry:DCt,posts_headers:{accept:"application/json","Content-Type":"application/json"},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()},addWebpage(){Se.post("/add_webpage",{client_id:this.client_id,url:this.$refs.web_url_input_box.inputText},{headers:this.posts_headers}).then(t=>{t&&t.status&&(console.log("Done"),this.recoverFiles())})},show_progress(t){this.progress_visibility_val=!0},hide_progress(t){this.progress_visibility_val=!1},update_progress(t){console.log("Progress update"),this.progress_value=t.value},onSettingsBinding(){try{this.isLoading=!0,Se.get("/get_active_binding_settings").then(t=>{this.isLoading=!1,t&&(t.data&&Object.keys(t.data).length>0?this.$store.state.universalForm.showForm(t.data,"Binding settings - "+bindingEntry.binding.name,"Save changes","Cancel").then(e=>{try{Se.post("/set_active_binding_settings",e).then(n=>{n&&n.data?(console.log("binding set with new settings",n.data),this.$store.state.toast.showToast("Binding settings updated successfully!",4,!0)):(this.$store.state.toast.showToast(`Did not get binding settings responses. +`+t.name,4,!1)}else console.log("mounting pers");this.$emit("personalitySelected"),Ge(()=>{He.replace()})}},async select_personality(t){if(!t)return{status:!1,error:"no personality - select_personality"};const e=t.language===null?t.full_path:t.full_path+":"+t.language;console.log("Selecting personality ",e);const n=this.$store.state.config.personalities.findIndex(s=>s===e),i={client_id:this.$store.state.client_id,id:n};try{const s=await Se.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(t){t.preventDefault();const e=this.$refs.modelsSelectionList;console.log(e);const n=new MouseEvent("click");e.dispatchEvent(n)},setBinding(t){console.log("Setting binding to "+t.name),this.selecting_binding=!0,this.selectedBinding=t,this.$store.state.messageBox.showBlockingMessage("Loading binding"),Se.post("/update_setting",{client_id:this.$store.state.client_id,setting_name:"binding_name",setting_value:t.name}).then(async e=>{this.$store.state.messageBox.hideMessage(),console.log("UPDATED"),console.log(e),await this.$store.dispatch("refreshConfig"),await this.$store.dispatch("refreshBindings"),await this.$store.dispatch("refreshModelsZoo"),await this.$store.dispatch("refreshModels"),this.$store.state.toast.showToast(`Binding changed to ${this.currentBinding.name}`,4,!0),this.selecting_binding=!1}).catch(e=>{this.$store.state.messageBox.hideMessage(),this.$store.state.toast.showToast(`Error ${e}`,4,!0),this.selecting_binding=!1})},setModel(t){console.log("Setting model to "+t.name),this.selecting_model=!0,this.selectedModel=t,this.$store.state.messageBox.showBlockingMessage("Loading model"),Se.post("/update_setting",{client_id:this.$store.state.client_id,setting_name:"model_name",setting_value:t.name}).then(async e=>{this.$store.state.messageBox.hideMessage(),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.messageBox.hideMessage(),this.$store.state.toast.showToast(`Error ${e}`,4,!0),this.selecting_model=!1})},download_files(){Se.get("/download_files")},remove_file(t){Se.get("/remove_discussion_file",{client_id:this.$store.state.client_id,name:t}).then(e=>{console.log(e)})},clear_files(){Se.post("/clear_discussion_files_list",{client_id:this.$store.state.client_id}).then(t=>{console.log(t),t.data.state?(this.$store.state.toast.showToast("File removed successfully",4,!0),this.filesList.length=0,this.isFileSentList.length=0,this.totalSize=0):this.$store.state.toast.showToast("Files couldn't be removed",4,!1)})},send_file(t,e){console.log("Send file triggered");const n=new FileReader,i=24*1024;let s=0,r=0;n.onloadend=()=>{if(n.error){console.error("Error reading file:",n.error);return}const a=n.result,l=s+a.byteLength>=t.size;$e.emit("send_file_chunk",{filename:t.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),e()):o()};function o(){const a=t.slice(s,s+i);n.readAsArrayBuffer(a)}console.log("Uploading file"),o()},makeAnEmptyUserMessage(){this.$emit("createEmptyUserMessage",this.message),this.message=""},makeAnEmptyAIMessage(){this.$emit("createEmptyAIMessage")},startRTCom(){this.is_rt=!0,console.log("is_rt:",this.is_rt),$e.emit("start_bidirectional_audio_stream"),Ge(()=>{He.replace()})},stopRTCom(){this.is_rt=!1,console.log("is_rt:",this.is_rt),$e.emit("stop_bidirectional_audio_stream"),Ge(()=>{He.replace()})},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.isListeningToVoice=!0,this.silenceTimer=setTimeout(()=>{this.recognition.stop()},this.silenceTimeout)},this.recognition.onresult=t=>{let e="";for(let n=t.resultIndex;n{this.recognition.stop()},this.silenceTimeout)},this.recognition.onerror=t=>{console.error("Speech recognition error:",t.error),this.isListeningToVoice=!1,clearTimeout(this.silenceTimer)},this.recognition.onend=()=>{console.log("Speech recognition ended."),this.isListeningToVoice=!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(t){this.showPersonalities=!this.showPersonalities},handleOnTalk(t){console.log("talking"),this.showPersonalities=!1,this.$store.state.toast.showToast(`Personality ${t.name} is Talking`,4,!0),this.onTalk(t)},onMountFun(t){console.log("Mounting personality"),this.$refs.mountedPers.constructor()},onUnmountFun(t){console.log("Unmounting personality"),this.$refs.mountedPers.constructor()},onRemount(t){console.log("Remounting chat"),this.$refs.mountedPers.constructor()},computedFileSize(t){return Ge(()=>{He.replace()}),rs(t)},removeItem(t){console.log("Removing ",t.name),Se.post("/remove_discussion_file",{client_id:this.$store.state.client_id,name:t.name},{headers:this.posts_headers}).then(()=>{this.filesList=this.filesList.filter(e=>e!=t)}),console.log(this.filesList)},sendMessageEvent(t,e="no_internet"){this.$emit("messageSentEvent",t,e)},sendCMDEvent(t){this.$emit("sendCMDEvent",t)},async mountDB(t){await Se.post("/toggle_mount_rag_database",{client_id:this.$store.state.client_id,database_name:t}),await this.$store.dispatch("refreshConfig"),console.log("Refreshed")},addWebLink(){console.log("Emitting addWebLink"),this.$emit("addWebLink")},add_file(){const t=document.createElement("input");t.type="file",t.style.display="none",t.multiple=!0,document.body.appendChild(t),t.addEventListener("change",()=>{console.log("Calling Add file..."),this.addFiles(t.files),document.body.removeChild(t)}),t.click()},takePicture(){$e.emit("take_picture"),$e.on("picture_taken",()=>{Se.post("/get_discussion_files_list",{client_id:this.$store.state.client_id}).then(t=>{this.filesList=t.data.files,this.isFileSentList=t.data.files.map(e=>!0),console.log(`Files recovered: ${this.filesList}`)})})},submitOnEnter(t){this.loading||t.which===13&&(t.preventDefault(),t.repeat||(this.sendMessageEvent(this.message),this.message=""))},submit(){this.message&&(this.sendMessageEvent(this.message),this.message="")},submitWithInternetSearch(){this.message&&(this.sendMessageEvent(this.message,"internet"),this.message="")},stopGenerating(){this.$emit("stopGenerating")},addFiles(t){console.log("Adding files");const e=[...t];let n=0;const i=()=>{if(n>=e.length){console.log(`Files_list: ${this.filesList}`);return}const s=e[n];this.filesList.push(s),this.isFileSentList.push(!1),this.send_file(s,()=>{n++,i()})};i()}},watch:{installedModels:{immediate:!0,handler(t){this.$nextTick(()=>{this.installedModels=t})}},model_name:{immediate:!0,handler(t){this.$nextTick(()=>{this.model_name=t})}},showfilesList(){Ge(()=>{He.replace()})},loading(t,e){Ge(()=>{He.replace()})},filesList:{handler(t,e){let n=0;if(t.length>0)for(let i=0;i{He.replace()}),console.log("Chatbar mounted"),$e.on("rtcom_status_changed",t=>{this.$store.dispatch("fetchisRTOn"),console.log("rtcom_status_changed: ",t.status),console.log("active_tts_service: ",this.$store.state.config.active_tts_service),console.log("is_rt_on: ",this.$store.state.is_rt_on)}),this.$store.dispatch("fetchisRTOn")},activated(){Ge(()=>{He.replace()})}},Pt=t=>(yo("data-v-2c705e91"),t=t(),vo(),t),a0t={class:"absolute bottom-0 left-0 w-fit min-w-96 w-full justify-center text-center"},l0t={key:0,class:"items-center gap-2 bg-bg-light-panel dark:bg-bg-dark-tone shadow-sm hover:shadow-none dark:border-gray-800 w-fit"},c0t={class:"flex"},d0t=["title"],u0t=Pt(()=>c("i",{"data-feather":"list"},null,-1)),p0t=[u0t],_0t={key:0},h0t={class:"flex flex-col max-h-64"},f0t=["title"],m0t={class:"flex flex-row items-center gap-1 text-left p-2 text-sm font-medium items-center gap-2 rounded-lg border bg-gray-100 p-1.5 shadow-sm hover:shadow-none dark:border-gray-800 dark:bg-gray-700 hover:bg-primary dark:hover:bg-primary"},g0t={key:0,filesList:"",role:"status"},b0t=Pt(()=>c("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"},[c("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),c("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)),E0t=Pt(()=>c("span",{class:"sr-only"},"Loading...",-1)),y0t=[b0t,E0t],v0t=Pt(()=>c("div",null,[c("i",{"data-feather":"file",class:"w-5 h-5"})],-1)),S0t=Pt(()=>c("div",{class:"grow"},null,-1)),T0t={class:"flex flex-row items-center"},x0t={class:"whitespace-nowrap"},C0t=["onClick"],w0t=Pt(()=>c("i",{"data-feather":"x",class:"w-5 h-5"},null,-1)),R0t=[w0t],A0t={key:1,class:"flex mx-1 w-500"},N0t={class:"whitespace-nowrap flex flex-row gap-2"},O0t=Pt(()=>c("p",{class:"font-bold"}," Total size: ",-1)),I0t=Pt(()=>c("div",{class:"grow"},null,-1)),M0t=Pt(()=>c("i",{"data-feather":"trash",class:"w-5 h-5"},null,-1)),D0t=[M0t],k0t=Pt(()=>c("i",{"data-feather":"download-cloud",class:"w-5 h-5"},null,-1)),L0t=[k0t],P0t={key:2,class:"mx-1"},U0t={key:1,title:"Selecting model",class:"flex flex-row flex-grow justify-end bg-primary"},F0t={role:"status"},B0t=["src"],G0t=Pt(()=>c("span",{class:"sr-only"},"Selecting model...",-1)),V0t={class:"flex w-fit relative grow w-full"},z0t={class:"relative text-light-text-panel dark:text-dark-text-panel grow flex h-12.5 cursor-pointer select-none items-center gap-2 bg-bg-light-panel dark:bg-bg-dark-tone p-1 shadow-sm hover:shadow-none dark:border-gray-800",tabindex:"0"},H0t={key:0,title:"Waiting for reply"},q0t=["src"],Y0t=Pt(()=>c("div",{role:"status"},[c("span",{class:"sr-only"},"Loading...")],-1)),$0t={key:1,class:"w-fit group relative"},W0t={class:"hide top-50 hide opacity-0 group-hover:bottom-0 opacity-0 .group-hover:block fixed w-[1000px] group absolute group-hover:opacity-100 transform group-hover:translate-y-[-50px] group-hover:translate-x-[0px] transition-all duration-300"},K0t={class:"w-fit flex-wrap flex bg-white bg-opacity-50 backdrop-blur-md rounded p-4"},j0t=["onMouseover"],Q0t={class:"relative"},X0t=["onClick"],Z0t=["src","title"],J0t={class:"group items-center flex flex-row"},eTt=["src","title"],tTt={key:2,class:"w-fit group relative"},nTt={class:"hide top-50 hide opacity-0 group-hover:bottom-0 opacity-0 .group-hover:block fixed w-[1000px] group absolute group-hover:opacity-100 transform group-hover:translate-y-[-50px] group-hover:translate-x-[0px] transition-all duration-300"},iTt={class:"w-fit flex-wrap flex bg-white bg-opacity-50 backdrop-blur-md rounded p-4"},sTt=["onMouseover"],rTt={class:"relative"},oTt=["onClick"],aTt=["src","title"],lTt={class:"group items-center flex flex-row"},cTt=["src","title"],dTt={key:3,class:"w-fit group relative"},uTt={class:"top-50 hide opacity-0 group-hover:bottom-0 .group-hover:block fixed w-[1000px] group absolute group-hover:opacity-100 transform group-hover:translate-y-[-50px] group-hover:translate-x-[0px] transition-all duration-300"},pTt={class:"w-fit flex-wrap flex bg-white bg-opacity-50 backdrop-blur-md rounded p-4"},_Tt=["onMouseover"],hTt={class:"relative"},fTt=["onClick"],mTt=["src","title"],gTt=["onClick"],bTt=Pt(()=>c("span",{class:"-top-6 -right-6 border-gray-500 absolute active:scale-90 w-7 h-7 hover:scale-150 transition bg-bg-light dark:bg-bg-dark rounded-full border-2",title:"Unmount personality"},[c("svg",{"aria-hidden":"true",class:"top-1 left-1 relative w-5 h-5 text-red-600 hover:text-red-500",fill:"currentColor",viewBox:"0 0 20 20","stroke-width":"1",xmlns:"http://www.w3.org/2000/svg"},[c("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)),ETt=[bTt],yTt=["onClick"],vTt=Pt(()=>c("span",{class:"-top-9 left-2 border-gray-500 active:scale-90 absolute items-center w-7 h-7 hover:scale-150 transition text-red-200 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2",title:"Remount"},[c("svg",{xmlns:"http://www.w3.org/2000/svg",class:"top-1 left-1 relative w-4 h-4 text-red-600 hover:text-red-500",viewBox:"0 0 30 30",width:"2",height:"2",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},[c("g",{id:"surface1"},[c("path",{style:{},d:"M 16 4 C 10.886719 4 6.617188 7.160156 4.875 11.625 L 6.71875 12.375 C 8.175781 8.640625 11.710938 6 16 6 C 19.242188 6 22.132813 7.589844 23.9375 10 L 20 10 L 20 12 L 27 12 L 27 5 L 25 5 L 25 8.09375 C 22.808594 5.582031 19.570313 4 16 4 Z M 25.28125 19.625 C 23.824219 23.359375 20.289063 26 16 26 C 12.722656 26 9.84375 24.386719 8.03125 22 L 12 22 L 12 20 L 5 20 L 5 27 L 7 27 L 7 23.90625 C 9.1875 26.386719 12.394531 28 16 28 C 21.113281 28 25.382813 24.839844 27.125 20.375 Z "})])])],-1)),STt=[vTt],TTt=["onClick"],xTt=Pt(()=>c("span",{class:"-top-6 -left-6 border-gray-500 active:scale-90 absolute items-center w-7 h-7 hover:scale-150 transition text-red-200 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2",title:"Talk"},[c("svg",{xmlns:"http://www.w3.org/2000/svg",class:"top-1 left-1 relative w-4 h-4 text-red-600 hover:text-red-500",viewBox:"0 0 24 24",width:"2",height:"2",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round"},[c("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),c("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})])],-1)),CTt=[xTt],wTt={class:"w-fit"},RTt={class:"w-fit"},ATt={class:"relative grow"},NTt={class:"group relative w-max"},OTt=Pt(()=>c("i",{"data-feather":"send"},null,-1)),ITt=[OTt],MTt=Pt(()=>c("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[c("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"Sends your message to the AI.")],-1)),DTt={class:"group relative w-max"},kTt=["src"],LTt=Pt(()=>c("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[c("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"Sends your message to the AI with internet search.")],-1)),PTt={class:"group relative w-max"},UTt=Pt(()=>c("i",{"data-feather":"mic"},null,-1)),FTt=[UTt],BTt=Pt(()=>c("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[c("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"Press and talk.")],-1)),GTt={key:5,class:"group relative w-max"},VTt=Pt(()=>c("i",{"data-feather":"mic"},null,-1)),zTt=[VTt],HTt=Pt(()=>c("i",{"data-feather":"mic"},null,-1)),qTt=[HTt],YTt=Pt(()=>c("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[c("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"Real time bidirectional audio mode.")],-1)),$Tt={key:6,class:"group relative w-max"},WTt=Pt(()=>c("i",{"data-feather":"file-plus"},null,-1)),KTt=[WTt],jTt=Pt(()=>c("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[c("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"Send File to the AI.")],-1)),QTt={class:"group relative w-max"},XTt=Pt(()=>c("i",{"data-feather":"camera"},null,-1)),ZTt=[XTt],JTt=Pt(()=>c("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[c("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"Take a shot from webcam.")],-1)),ext={class:"group relative w-max"},txt=Pt(()=>c("i",{"data-feather":"globe"},null,-1)),nxt=[txt],ixt=Pt(()=>c("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[c("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"Add a weblink to the discussion.")],-1)),sxt={class:"group relative w-max"},rxt=Pt(()=>c("i",{"data-feather":"message-square"},null,-1)),oxt=[rxt],axt=Pt(()=>c("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[c("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"New empty User message.")],-1)),lxt={class:"group relative w-max"},cxt=Pt(()=>c("i",{"data-feather":"message-square"},null,-1)),dxt=[cxt],uxt=Pt(()=>c("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[c("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"New empty ai message.")],-1)),pxt=Pt(()=>c("div",{class:"ml-auto gap-2"},null,-1));function _xt(t,e,n,i,s,r){const o=mt("MountedPersonalitiesList"),a=mt("MountedPersonalities"),l=mt("PersonalitiesCommands"),u=mt("UniversalForm");return w(),A(Ye,null,[c("form",null,[c("div",a0t,[s.filesList.length>0||s.showPersonalities?(w(),A("div",l0t,[c("div",c0t,[c("button",{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[0]||(e[0]=be(d=>s.showfilesList=!s.showfilesList,["stop"]))},p0t,8,d0t)]),s.filesList.length>0&&s.showfilesList==!0?(w(),A("div",_0t,[c("div",h0t,[Te(os,{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:We(()=>[(w(!0),A(Ye,null,lt(s.filesList,(d,h)=>(w(),A("div",{key:h+"-"+d.name},[c("div",{class:"m-1",title:d.name},[c("div",m0t,[s.isFileSentList[h]?V("",!0):(w(),A("div",g0t,y0t)),v0t,c("div",{class:ze(["line-clamp-1 w-3/5",s.isFileSentList[h]?"text-green-500":"text-red-200"])},he(d.name),3),S0t,c("div",T0t,[c("p",x0t,he(r.computedFileSize(d.size)),1),c("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:f=>r.removeItem(d)},R0t,8,C0t)])])],8,f0t)]))),128))]),_:1})])])):V("",!0),s.filesList.length>0?(w(),A("div",A0t,[c("div",N0t,[O0t,et(" "+he(s.totalSize)+" ("+he(s.filesList.length)+") ",1)]),I0t,c("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[1]||(e[1]=(...d)=>r.clear_files&&r.clear_files(...d))},D0t),c("button",{type:"button",title:"Download database",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.download_files&&r.download_files(...d))},L0t)])):V("",!0),s.showPersonalities?(w(),A("div",P0t,[Te(o,{ref:"mountedPersList",onShowPersList:r.onShowPersListFun,"on-mounted":r.onMountFun,"on-un-mounted":r.onUnmountFun,"on-remounted":t.onRemountFun,"on-talk":r.handleOnTalk,discussionPersonalities:r.allDiscussionPersonalities},null,8,["onShowPersList","on-mounted","on-un-mounted","on-remounted","on-talk","discussionPersonalities"])])):V("",!0)])):V("",!0),s.selecting_model||s.selecting_binding?(w(),A("div",U0t,[c("div",F0t,[c("img",{src:s.loader_v0,class:"w-50 h-50"},null,8,B0t),G0t])])):V("",!0),c("div",V0t,[c("div",z0t,[n.loading?(w(),A("div",H0t,[c("img",{src:s.loader_v0},null,8,q0t),Y0t])):V("",!0),n.loading?V("",!0):(w(),A("div",$0t,[c("div",W0t,[c("div",K0t,[(w(!0),A(Ye,null,lt(r.installedBindings,(d,h)=>(w(),A("div",{class:"w-fit h-fit inset-0 opacity-100",key:h+"-"+d.name,ref_for:!0,ref:"installedBindings",onMouseover:f=>r.showBindingHoveredIn(h),onMouseleave:e[4]||(e[4]=f=>r.showBindingHoveredOut())},[h!=r.binding_name?(w(),A("div",{key:0,class:ze(["items-center flex flex-row relative z-20 hover:-translate-y-8 duration-300",s.bindingHoveredIndex===h?"scale-150":""])},[c("div",Q0t,[c("button",{onClick:be(f=>r.setBinding(d),["prevent"]),class:"w-10 h-10 relative"},[c("img",{src:d.icon?d.icon:s.modelImgPlaceholder,onError:e[3]||(e[3]=(...f)=>s.modelImgPlaceholder&&s.modelImgPlaceholder(...f)),class:ze(["z-50 w-10 h-10 rounded-full object-fill text-red-700 border-2 border-gray-500 active:scale-90",s.bindingHoveredIndex===h?"scale-150 ":""+d.name==r.binding_name?"border-secondary":"border-transparent z-0"]),title:d.name},null,42,Z0t)],8,X0t)])],2)):V("",!0)],40,j0t))),128))])]),c("div",J0t,[c("button",{onClick:e[5]||(e[5]=be(d=>r.showModelConfig(),["prevent"])),class:"w-8 h-8"},[c("img",{src:r.currentBindingIcon,class:"w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:border-secondary hover:scale-110 hover:-translate-y-1 duration-200",title:r.currentBinding?r.currentBinding.name:"unknown"},null,8,eTt)])])])),n.loading?V("",!0):(w(),A("div",tTt,[c("div",nTt,[c("div",iTt,[(w(!0),A(Ye,null,lt(r.installedModels,(d,h)=>(w(),A("div",{class:"w-fit h-fit",key:h+"-"+d.name,ref_for:!0,ref:"installedModels",onMouseover:f=>r.showModelHoveredIn(h),onMouseleave:e[7]||(e[7]=f=>r.showModelHoveredOut())},[h!=r.model_name?(w(),A("div",{key:0,class:ze(["items-center flex flex-row relative z-20 hover:-translate-y-8 duration-300",s.modelHoveredIndex===h?"scale-150":""])},[c("div",rTt,[c("button",{onClick:be(f=>r.setModel(d),["prevent"]),class:"w-10 h-10 relative"},[c("img",{src:d.icon?d.icon:s.modelImgPlaceholder,onError:e[6]||(e[6]=(...f)=>t.personalityImgPlacehodler&&t.personalityImgPlacehodler(...f)),class:ze(["z-50 w-10 h-10 rounded-full object-fill text-red-700 border-2 border-gray-500 active:scale-90",s.modelHoveredIndex===h?"scale-150 ":""+d.name==r.model_name?"border-secondary":"border-transparent z-0"]),title:d.name},null,42,aTt)],8,oTt)])],2)):V("",!0)],40,sTt))),128))])]),c("div",lTt,[c("button",{onClick:e[8]||(e[8]=be(d=>r.showModelConfig(),["prevent"])),class:"w-8 h-8"},[c("img",{src:r.currentModelIcon,class:"w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:border-secondary hover:scale-110 hover:-translate-y-1 duration-400",title:r.currentModel?r.currentModel.name:"unknown"},null,8,cTt)])])])),n.loading?V("",!0):(w(),A("div",dTt,[c("div",uTt,[c("div",pTt,[(w(!0),A(Ye,null,lt(r.mountedPersonalities,(d,h)=>(w(),A("div",{class:"w-fit h-fit inset-0 opacity-100",key:h+"-"+d.name,ref_for:!0,ref:"mountedPersonalities",onMouseover:f=>r.showPersonalityHoveredIn(h),onMouseleave:e[10]||(e[10]=f=>r.showPersonalityHoveredOut())},[h!=r.personality_name?(w(),A("div",{key:0,class:ze(["items-center flex flex-row relative z-20 hover:-translate-y-8 duration-300",s.personalityHoveredIndex===h?"scale-150":""])},[c("div",hTt,[c("button",{onClick:be(f=>r.onPersonalitySelected(d),["prevent"]),class:"w-10 h-10 relative"},[c("img",{src:s.bUrl+d.avatar,onError:e[9]||(e[9]=(...f)=>t.personalityImgPlacehodler&&t.personalityImgPlacehodler(...f)),class:ze(["z-50 w-10 h-10 rounded-full object-fill text-red-700 border-2 border-gray-500 active:scale-90",s.personalityHoveredIndex===h?"scale-150 ":""+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,mTt)],8,fTt),s.personalityHoveredIndex===h?(w(),A("button",{key:0,onClick:be(f=>r.unmountPersonality(d),["prevent"])},ETt,8,gTt)):V("",!0),s.personalityHoveredIndex===h?(w(),A("button",{key:1,onClick:be(f=>r.remount_personality(d),["prevent"])},STt,8,yTt)):V("",!0),s.personalityHoveredIndex===h?(w(),A("button",{key:2,onClick:be(f=>r.handleOnTalk(d),["prevent"])},CTt,8,TTt)):V("",!0)])],2)):V("",!0)],40,_Tt))),128))])]),Te(a,{ref:"mountedPers",onShowPersList:r.onShowPersListFun,onReady:r.onPersonalitiesReadyFun},null,8,["onShowPersList","onReady"])])),c("div",wTt,[s.personalities_ready&&this.$store.state.mountedPersArr[this.$store.state.config.active_personality_id].commands!=""?(w(),xt(l,{key:0,commandsList:this.$store.state.mountedPersArr[this.$store.state.config.active_personality_id].commands,sendCommand:r.sendCMDEvent,"on-show-toast-message":n.onShowToastMessage,ref:"personalityCMD"},null,8,["commandsList","sendCommand","on-show-toast-message"])):V("",!0)]),c("div",RTt,[r.isDataSourceNamesValid?(w(),xt(l,{key:0,icon:"feather:book",commandsList:r.dataSourceNames,sendCommand:r.mountDB,"on-show-toast-message":n.onShowToastMessage,ref:"databasesList"},null,8,["commandsList","sendCommand","on-show-toast-message"])):V("",!0)]),c("div",ATt,[G(c("textarea",{id:"chat",rows:"1","onUpdate:modelValue":e[11]||(e[11]=d=>s.message=d),title:"Hold SHIFT + ENTER to add new line",onPaste:e[12]||(e[12]=(...d)=>r.handlePaste&&r.handlePaste(...d)),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[13]||(e[13]=Hs(be(d=>r.submitOnEnter(d),["exact"]),["enter"]))},`\r + `,544),[[we,s.message]])]),n.loading?(w(),A("button",{key:4,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[14]||(e[14]=be((...d)=>r.stopGenerating&&r.stopGenerating(...d),["stop"]))}," Stop generating ")):V("",!0),c("div",NTt,[n.loading?V("",!0):(w(),A("button",{key:0,type:"button",onClick:e[15]||(e[15]=(...d)=>r.submit&&r.submit(...d)),title:"Send",class:"w-6 text-panel hover:text-secondary duration-75 active:scale-90 cursor-pointer transform transition-transform hover:translate-y-[-5px] active:scale-90"},ITt)),MTt]),c("div",DTt,[n.loading?V("",!0):(w(),A("button",{key:0,type:"button",onClick:e[16]||(e[16]=(...d)=>r.submitWithInternetSearch&&r.submitWithInternetSearch(...d)),title:"Send With internet",class:"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer transform transition-transform hover:translate-y-[-5px] active:scale-90"},[c("img",{src:s.sendGlobe,width:"50",height:"50",style:{stroke:"currentColor",fill:"currentColor"}},null,8,kTt)])),LTt]),c("div",PTt,[n.loading?V("",!0):(w(),A("button",{key:0,type:"button",onClick:e[17]||(e[17]=(...d)=>r.startSpeechRecognition&&r.startSpeechRecognition(...d)),class:ze([{"text-red-500":s.isListeningToVoice},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer transform transition-transform hover:translate-y-[-5px] active:scale-90"])},FTt,2)),BTt]),t.$store.state.config.active_tts_service!="None"?(w(),A("div",GTt,[s.is_rt?(w(),A("button",{key:0,type:"button",onClick:e[18]||(e[18]=(...d)=>r.stopRTCom&&r.stopRTCom(...d)),class:"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer transform transition-transform hover:translate-y-[-5px] active:scale-90 bg-red-500 border borderred700 rounded-md"},zTt)):(w(),A("button",{key:1,type:"button",onClick:e[19]||(e[19]=(...d)=>r.startRTCom&&r.startRTCom(...d)),class:"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer transform transition-transform hover:translate-y-[-5px] active:scale-90 bg-green-500 border border-green-700 rounded-md"},qTt)),YTt])):V("",!0),n.loading?V("",!0):(w(),A("div",$Tt,[c("input",{type:"file",ref:"fileDialog",style:{display:"none"},onChange:e[20]||(e[20]=(...d)=>r.addFiles&&r.addFiles(...d)),multiple:""},null,544),c("button",{type:"button",onClick:e[21]||(e[21]=be((...d)=>r.add_file&&r.add_file(...d),["prevent"])),class:"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer transform transition-transform hover:translate-y-[-5px] active:scale-90"},KTt),jTt])),c("div",QTt,[n.loading?V("",!0):(w(),A("button",{key:0,type:"button",onClick:e[22]||(e[22]=be((...d)=>r.takePicture&&r.takePicture(...d),["stop"])),class:"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer transform transition-transform hover:translate-y-[-5px] active:scale-90"},ZTt)),JTt]),c("div",ext,[n.loading?V("",!0):(w(),A("button",{key:0,type:"button",onClick:e[23]||(e[23]=be((...d)=>r.addWebLink&&r.addWebLink(...d),["stop"])),class:"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer transform transition-transform hover:translate-y-[-5px] active:scale-90"},nxt)),ixt]),c("div",sxt,[n.loading?V("",!0):(w(),A("button",{key:0,type:"button",onClick:e[24]||(e[24]=be((...d)=>r.makeAnEmptyUserMessage&&r.makeAnEmptyUserMessage(...d),["stop"])),class:"w-6 text-gray-800 hover:text-secondary duration-75 active:scale-90 hover:translate-y-[-5px]"},oxt)),axt]),c("div",lxt,[n.loading?V("",!0):(w(),A("button",{key:0,type:"button",onClick:e[25]||(e[25]=be((...d)=>r.makeAnEmptyAIMessage&&r.makeAnEmptyAIMessage(...d),["stop"])),class:"w-6 text-red-400 hover:text-secondary duration-75 active:scale-90 hover:translate-y-[-5px]"},dxt)),uxt])]),pxt])])]),Te(u,{ref:"universalForm",class:"z-20"},null,512)],64)}const vO=bt(o0t,[["render",_xt],["__scopeId","data-v-2c705e91"]]),hxt={name:"WelcomeComponent",computed:{storeLogo(){return this.$store.state.config?Ti:this.$store.state.config.app_custom_logo!=""?"/user_infos/"+this.$store.state.config.app_custom_logo:Ti}},data(){},setup(){return{}}},fxt={class:"flex flex-col text-center w-full h-full"},mxt={class:"flex flex-col text-center items-center"},gxt={class:"flex items-center gap-3 text-5xl drop-shadow-md align-middle pt-24"},bxt=["src"],Ext=c("div",{class:"flex flex-col items-start"},[c("p",{class:"text-2xl"},"LoLLMS"),c("p",{class:"text-gray-400 text-base"},"One tool to rule them all")],-1),yxt=c("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),vxt=c("p",{class:"text-2xl"},"Welcome",-1),Sxt=c("p",{class:"text-lg"},"Please create a new discussion or select existing one to start",-1);function Txt(t,e,n,i,s,r){return w(),A("div",fxt,[c("div",mxt,[c("div",gxt,[c("img",{class:"w-12 hover:scale-95 duration-150",title:"LoLLMS WebUI",src:t.$store.state.config==null?r.storeLogo:t.$store.state.config.app_custom_logo!=""?"/user_infos/"+t.$store.state.config.app_custom_logo:r.storeLogo,alt:"Logo"},null,8,bxt),Ext]),yxt,vxt,Sxt])])}const SO=bt(hxt,[["render",Txt]]);var xxt=function(){function t(e,n){n===void 0&&(n=[]),this._eventType=e,this._eventFunctions=n}return t.prototype.init=function(){var e=this;this._eventFunctions.forEach(function(n){typeof window<"u"&&window.addEventListener(e._eventType,n)})},t}(),iu=globalThis&&globalThis.__assign||function(){return iu=Object.assign||function(t){for(var e,n=1,i=arguments.length;n"u")return!1;var e=ai(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Uxt(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var i=e.styles[n]||{},s=e.attributes[n]||{},r=e.elements[n];!xi(r)||!us(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 Fxt(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.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]:n[i]),a=o.reduce(function(l,u){return l[u]="",l},{});!xi(s)||!us(s)||(Object.assign(s.style,a),Object.keys(r).forEach(function(l){s.removeAttribute(l)}))})}}const Bxt={name:"applyStyles",enabled:!0,phase:"write",fn:Uxt,effect:Fxt,requires:["computeStyles"]};function as(t){return t.split("-")[0]}var ro=Math.max,au=Math.min,ya=Math.round;function eb(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function NO(){return!/^((?!chrome|android).)*safari/i.test(eb())}function va(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var i=t.getBoundingClientRect(),s=1,r=1;e&&xi(t)&&(s=t.offsetWidth>0&&ya(i.width)/t.offsetWidth||1,r=t.offsetHeight>0&&ya(i.height)/t.offsetHeight||1);var o=ho(t)?ai(t):window,a=o.visualViewport,l=!NO()&&n,u=(i.left+(l&&a?a.offsetLeft:0))/s,d=(i.top+(l&&a?a.offsetTop:0))/r,h=i.width/s,f=i.height/r;return{width:h,height:f,top:d,right:u+h,bottom:d+f,left:u,x:u,y:d}}function LE(t){var e=va(t),n=t.offsetWidth,i=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:i}}function OO(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&kE(n)){var i=e;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function qs(t){return ai(t).getComputedStyle(t)}function Gxt(t){return["table","td","th"].indexOf(us(t))>=0}function Or(t){return((ho(t)?t.ownerDocument:t.document)||window.document).documentElement}function ap(t){return us(t)==="html"?t:t.assignedSlot||t.parentNode||(kE(t)?t.host:null)||Or(t)}function DC(t){return!xi(t)||qs(t).position==="fixed"?null:t.offsetParent}function Vxt(t){var e=/firefox/i.test(eb()),n=/Trident/i.test(eb());if(n&&xi(t)){var i=qs(t);if(i.position==="fixed")return null}var s=ap(t);for(kE(s)&&(s=s.host);xi(s)&&["html","body"].indexOf(us(s))<0;){var r=qs(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 yc(t){for(var e=ai(t),n=DC(t);n&&Gxt(n)&&qs(n).position==="static";)n=DC(n);return n&&(us(n)==="html"||us(n)==="body"&&qs(n).position==="static")?e:n||Vxt(t)||e}function PE(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function kl(t,e,n){return ro(t,au(e,n))}function zxt(t,e,n){var i=kl(t,e,n);return i>n?n:i}function IO(){return{top:0,right:0,bottom:0,left:0}}function MO(t){return Object.assign({},IO(),t)}function DO(t,e){return e.reduce(function(n,i){return n[i]=t,n},{})}var Hxt=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,MO(typeof e!="number"?e:DO(e,Ec))};function qxt(t){var e,n=t.state,i=t.name,s=t.options,r=n.elements.arrow,o=n.modifiersData.popperOffsets,a=as(n.placement),l=PE(a),u=[Xn,Ai].indexOf(a)>=0,d=u?"height":"width";if(!(!r||!o)){var h=Hxt(s.padding,n),f=LE(r),_=l==="y"?Qn:Xn,m=l==="y"?Ri:Ai,E=n.rects.reference[d]+n.rects.reference[l]-o[l]-n.rects.popper[d],b=o[l]-n.rects.reference[l],g=yc(r),y=g?l==="y"?g.clientHeight||0:g.clientWidth||0:0,v=E/2-b/2,S=h[_],C=y-f[d]-h[m],T=y/2-f[d]/2+v,O=kl(S,T,C),k=l;n.modifiersData[i]=(e={},e[k]=O,e.centerOffset=O-T,e)}}function Yxt(t){var e=t.state,n=t.options,i=n.element,s=i===void 0?"[data-popper-arrow]":i;s!=null&&(typeof s=="string"&&(s=e.elements.popper.querySelector(s),!s)||OO(e.elements.popper,s)&&(e.elements.arrow=s))}const $xt={name:"arrow",enabled:!0,phase:"main",fn:qxt,effect:Yxt,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Sa(t){return t.split("-")[1]}var Wxt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Kxt(t,e){var n=t.x,i=t.y,s=e.devicePixelRatio||1;return{x:ya(n*s)/s||0,y:ya(i*s)/s||0}}function kC(t){var e,n=t.popper,i=t.popperRect,s=t.placement,r=t.variation,o=t.offsets,a=t.position,l=t.gpuAcceleration,u=t.adaptive,d=t.roundOffsets,h=t.isFixed,f=o.x,_=f===void 0?0:f,m=o.y,E=m===void 0?0:m,b=typeof d=="function"?d({x:_,y:E}):{x:_,y:E};_=b.x,E=b.y;var g=o.hasOwnProperty("x"),y=o.hasOwnProperty("y"),v=Xn,S=Qn,C=window;if(u){var T=yc(n),O="clientHeight",k="clientWidth";if(T===ai(n)&&(T=Or(n),qs(T).position!=="static"&&a==="absolute"&&(O="scrollHeight",k="scrollWidth")),T=T,s===Qn||(s===Xn||s===Ai)&&r===ic){S=Ri;var x=h&&T===C&&C.visualViewport?C.visualViewport.height:T[O];E-=x-i.height,E*=l?1:-1}if(s===Xn||(s===Qn||s===Ri)&&r===ic){v=Ai;var I=h&&T===C&&C.visualViewport?C.visualViewport.width:T[k];_-=I-i.width,_*=l?1:-1}}var F=Object.assign({position:a},u&&Wxt),B=d===!0?Kxt({x:_,y:E},ai(n)):{x:_,y:E};if(_=B.x,E=B.y,l){var ne;return Object.assign({},F,(ne={},ne[S]=y?"0":"",ne[v]=g?"0":"",ne.transform=(C.devicePixelRatio||1)<=1?"translate("+_+"px, "+E+"px)":"translate3d("+_+"px, "+E+"px, 0)",ne))}return Object.assign({},F,(e={},e[S]=y?E+"px":"",e[v]=g?_+"px":"",e.transform="",e))}function jxt(t){var e=t.state,n=t.options,i=n.gpuAcceleration,s=i===void 0?!0:i,r=n.adaptive,o=r===void 0?!0:r,a=n.roundOffsets,l=a===void 0?!0:a,u={placement:as(e.placement),variation:Sa(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,kC(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,kC(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Qxt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:jxt,data:{}};var qc={passive:!0};function Xxt(t){var e=t.state,n=t.instance,i=t.options,s=i.scroll,r=s===void 0?!0:s,o=i.resize,a=o===void 0?!0:o,l=ai(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&u.forEach(function(d){d.addEventListener("scroll",n.update,qc)}),a&&l.addEventListener("resize",n.update,qc),function(){r&&u.forEach(function(d){d.removeEventListener("scroll",n.update,qc)}),a&&l.removeEventListener("resize",n.update,qc)}}const Zxt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Xxt,data:{}};var Jxt={left:"right",right:"left",bottom:"top",top:"bottom"};function Fd(t){return t.replace(/left|right|bottom|top/g,function(e){return Jxt[e]})}var eCt={start:"end",end:"start"};function LC(t){return t.replace(/start|end/g,function(e){return eCt[e]})}function UE(t){var e=ai(t),n=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:n,scrollTop:i}}function FE(t){return va(Or(t)).left+UE(t).scrollLeft}function tCt(t,e){var n=ai(t),i=Or(t),s=n.visualViewport,r=i.clientWidth,o=i.clientHeight,a=0,l=0;if(s){r=s.width,o=s.height;var u=NO();(u||!u&&e==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:r,height:o,x:a+FE(t),y:l}}function nCt(t){var e,n=Or(t),i=UE(t),s=(e=t.ownerDocument)==null?void 0:e.body,r=ro(n.scrollWidth,n.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=ro(n.scrollHeight,n.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-i.scrollLeft+FE(t),l=-i.scrollTop;return qs(s||n).direction==="rtl"&&(a+=ro(n.clientWidth,s?s.clientWidth:0)-r),{width:r,height:o,x:a,y:l}}function BE(t){var e=qs(t),n=e.overflow,i=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+s+i)}function kO(t){return["html","body","#document"].indexOf(us(t))>=0?t.ownerDocument.body:xi(t)&&BE(t)?t:kO(ap(t))}function Ll(t,e){var n;e===void 0&&(e=[]);var i=kO(t),s=i===((n=t.ownerDocument)==null?void 0:n.body),r=ai(i),o=s?[r].concat(r.visualViewport||[],BE(i)?i:[]):i,a=e.concat(o);return s?a:a.concat(Ll(ap(o)))}function tb(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function iCt(t,e){var n=va(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function PC(t,e,n){return e===RO?tb(tCt(t,n)):ho(e)?iCt(e,n):tb(nCt(Or(t)))}function sCt(t){var e=Ll(ap(t)),n=["absolute","fixed"].indexOf(qs(t).position)>=0,i=n&&xi(t)?yc(t):t;return ho(i)?e.filter(function(s){return ho(s)&&OO(s,i)&&us(s)!=="body"}):[]}function rCt(t,e,n,i){var s=e==="clippingParents"?sCt(t):[].concat(e),r=[].concat(s,[n]),o=r[0],a=r.reduce(function(l,u){var d=PC(t,u,i);return l.top=ro(d.top,l.top),l.right=au(d.right,l.right),l.bottom=au(d.bottom,l.bottom),l.left=ro(d.left,l.left),l},PC(t,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 LO(t){var e=t.reference,n=t.element,i=t.placement,s=i?as(i):null,r=i?Sa(i):null,o=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(s){case Qn:l={x:o,y:e.y-n.height};break;case Ri:l={x:o,y:e.y+e.height};break;case Ai:l={x:e.x+e.width,y:a};break;case Xn:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var u=s?PE(s):null;if(u!=null){var d=u==="y"?"height":"width";switch(r){case Ea:l[u]=l[u]-(e[d]/2-n[d]/2);break;case ic:l[u]=l[u]+(e[d]/2-n[d]/2);break}}return l}function sc(t,e){e===void 0&&(e={});var n=e,i=n.placement,s=i===void 0?t.placement:i,r=n.strategy,o=r===void 0?t.strategy:r,a=n.boundary,l=a===void 0?Cxt:a,u=n.rootBoundary,d=u===void 0?RO:u,h=n.elementContext,f=h===void 0?hl:h,_=n.altBoundary,m=_===void 0?!1:_,E=n.padding,b=E===void 0?0:E,g=MO(typeof b!="number"?b:DO(b,Ec)),y=f===hl?wxt:hl,v=t.rects.popper,S=t.elements[m?y:f],C=rCt(ho(S)?S:S.contextElement||Or(t.elements.popper),l,d,o),T=va(t.elements.reference),O=LO({reference:T,element:v,strategy:"absolute",placement:s}),k=tb(Object.assign({},v,O)),x=f===hl?k:T,I={top:C.top-x.top+g.top,bottom:x.bottom-C.bottom+g.bottom,left:C.left-x.left+g.left,right:x.right-C.right+g.right},F=t.modifiersData.offset;if(f===hl&&F){var B=F[s];Object.keys(I).forEach(function(ne){var L=[Ai,Ri].indexOf(ne)>=0?1:-1,$=[Qn,Ri].indexOf(ne)>=0?"y":"x";I[ne]+=B[$]*L})}return I}function oCt(t,e){e===void 0&&(e={});var n=e,i=n.placement,s=n.boundary,r=n.rootBoundary,o=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?AO:l,d=Sa(i),h=d?a?MC:MC.filter(function(m){return Sa(m)===d}):Ec,f=h.filter(function(m){return u.indexOf(m)>=0});f.length===0&&(f=h);var _=f.reduce(function(m,E){return m[E]=sc(t,{placement:E,boundary:s,rootBoundary:r,padding:o})[as(E)],m},{});return Object.keys(_).sort(function(m,E){return _[m]-_[E]})}function aCt(t){if(as(t)===DE)return[];var e=Fd(t);return[LC(t),e,LC(e)]}function lCt(t){var e=t.state,n=t.options,i=t.name;if(!e.modifiersData[i]._skip){for(var s=n.mainAxis,r=s===void 0?!0:s,o=n.altAxis,a=o===void 0?!0:o,l=n.fallbackPlacements,u=n.padding,d=n.boundary,h=n.rootBoundary,f=n.altBoundary,_=n.flipVariations,m=_===void 0?!0:_,E=n.allowedAutoPlacements,b=e.options.placement,g=as(b),y=g===b,v=l||(y||!m?[Fd(b)]:aCt(b)),S=[b].concat(v).reduce(function(Ee,xe){return Ee.concat(as(xe)===DE?oCt(e,{placement:xe,boundary:d,rootBoundary:h,padding:u,flipVariations:m,allowedAutoPlacements:E}):xe)},[]),C=e.rects.reference,T=e.rects.popper,O=new Map,k=!0,x=S[0],I=0;I=0,$=L?"width":"height",H=sc(e,{placement:F,boundary:d,rootBoundary:h,altBoundary:f,padding:u}),U=L?ne?Ai:Xn:ne?Ri:Qn;C[$]>T[$]&&(U=Fd(U));var Q=Fd(U),J=[];if(r&&J.push(H[B]<=0),a&&J.push(H[U]<=0,H[Q]<=0),J.every(function(Ee){return Ee})){x=F,k=!1;break}O.set(F,J)}if(k)for(var j=m?3:1,ae=function(xe){var Me=S.find(function(Z){var ye=O.get(Z);if(ye)return ye.slice(0,xe).every(function(fe){return fe})});if(Me)return x=Me,"break"},ve=j;ve>0;ve--){var ee=ae(ve);if(ee==="break")break}e.placement!==x&&(e.modifiersData[i]._skip=!0,e.placement=x,e.reset=!0)}}const cCt={name:"flip",enabled:!0,phase:"main",fn:lCt,requiresIfExists:["offset"],data:{_skip:!1}};function UC(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function FC(t){return[Qn,Ai,Ri,Xn].some(function(e){return t[e]>=0})}function dCt(t){var e=t.state,n=t.name,i=e.rects.reference,s=e.rects.popper,r=e.modifiersData.preventOverflow,o=sc(e,{elementContext:"reference"}),a=sc(e,{altBoundary:!0}),l=UC(o,i),u=UC(a,s,r),d=FC(l),h=FC(u);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":h})}const uCt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:dCt};function pCt(t,e,n){var i=as(t),s=[Xn,Qn].indexOf(i)>=0?-1:1,r=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,o=r[0],a=r[1];return o=o||0,a=(a||0)*s,[Xn,Ai].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}function _Ct(t){var e=t.state,n=t.options,i=t.name,s=n.offset,r=s===void 0?[0,0]:s,o=AO.reduce(function(d,h){return d[h]=pCt(h,e.rects,r),d},{}),a=o[e.placement],l=a.x,u=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=u),e.modifiersData[i]=o}const hCt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:_Ct};function fCt(t){var e=t.state,n=t.name;e.modifiersData[n]=LO({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const mCt={name:"popperOffsets",enabled:!0,phase:"read",fn:fCt,data:{}};function gCt(t){return t==="x"?"y":"x"}function bCt(t){var e=t.state,n=t.options,i=t.name,s=n.mainAxis,r=s===void 0?!0:s,o=n.altAxis,a=o===void 0?!1:o,l=n.boundary,u=n.rootBoundary,d=n.altBoundary,h=n.padding,f=n.tether,_=f===void 0?!0:f,m=n.tetherOffset,E=m===void 0?0:m,b=sc(e,{boundary:l,rootBoundary:u,padding:h,altBoundary:d}),g=as(e.placement),y=Sa(e.placement),v=!y,S=PE(g),C=gCt(S),T=e.modifiersData.popperOffsets,O=e.rects.reference,k=e.rects.popper,x=typeof E=="function"?E(Object.assign({},e.rects,{placement:e.placement})):E,I=typeof x=="number"?{mainAxis:x,altAxis:x}:Object.assign({mainAxis:0,altAxis:0},x),F=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,B={x:0,y:0};if(T){if(r){var ne,L=S==="y"?Qn:Xn,$=S==="y"?Ri:Ai,H=S==="y"?"height":"width",U=T[S],Q=U+b[L],J=U-b[$],j=_?-k[H]/2:0,ae=y===Ea?O[H]:k[H],ve=y===Ea?-k[H]:-O[H],ee=e.elements.arrow,Ee=_&&ee?LE(ee):{width:0,height:0},xe=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:IO(),Me=xe[L],Z=xe[$],ye=kl(0,O[H],Ee[H]),fe=v?O[H]/2-j-ye-Me-I.mainAxis:ae-ye-Me-I.mainAxis,Ne=v?-O[H]/2+j+ye+Z+I.mainAxis:ve+ye+Z+I.mainAxis,Le=e.elements.arrow&&yc(e.elements.arrow),D=Le?S==="y"?Le.clientTop||0:Le.clientLeft||0:0,q=(ne=F==null?void 0:F[S])!=null?ne:0,K=U+fe-q-D,de=U+Ne-q,le=kl(_?au(Q,K):Q,U,_?ro(J,de):J);T[S]=le,B[S]=le-U}if(a){var Re,Ie=S==="x"?Qn:Xn,z=S==="x"?Ri:Ai,pe=T[C],re=C==="y"?"height":"width",ce=pe+b[Ie],M=pe-b[z],N=[Qn,Xn].indexOf(g)!==-1,W=(Re=F==null?void 0:F[C])!=null?Re:0,ue=N?ce:pe-O[re]-k[re]-W+I.altAxis,X=N?pe+O[re]+k[re]-W-I.altAxis:M,ie=_&&N?zxt(ue,pe,X):kl(_?ue:ce,pe,_?X:M);T[C]=ie,B[C]=ie-pe}e.modifiersData[i]=B}}const ECt={name:"preventOverflow",enabled:!0,phase:"main",fn:bCt,requiresIfExists:["offset"]};function yCt(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function vCt(t){return t===ai(t)||!xi(t)?UE(t):yCt(t)}function SCt(t){var e=t.getBoundingClientRect(),n=ya(e.width)/t.offsetWidth||1,i=ya(e.height)/t.offsetHeight||1;return n!==1||i!==1}function TCt(t,e,n){n===void 0&&(n=!1);var i=xi(e),s=xi(e)&&SCt(e),r=Or(e),o=va(t,s,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!n)&&((us(e)!=="body"||BE(r))&&(a=vCt(e)),xi(e)?(l=va(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):r&&(l.x=FE(r))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function xCt(t){var e=new Map,n=new Set,i=[];t.forEach(function(r){e.set(r.name,r)});function s(r){n.add(r.name);var o=[].concat(r.requires||[],r.requiresIfExists||[]);o.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&s(l)}}),i.push(r)}return t.forEach(function(r){n.has(r.name)||s(r)}),i}function CCt(t){var e=xCt(t);return Pxt.reduce(function(n,i){return n.concat(e.filter(function(s){return s.phase===i}))},[])}function wCt(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function RCt(t){var e=t.reduce(function(n,i){var s=n[i.name];return n[i.name]=s?Object.assign({},s,i,{options:Object.assign({},s.options,i.options),data:Object.assign({},s.data,i.data)}):i,n},{});return Object.keys(e).map(function(n){return e[n]})}var BC={placement:"bottom",modifiers:[],strategy:"absolute"};function GC(){for(var t=arguments.length,e=new Array(t),n=0;n(yo("data-v-b8e854ae"),t=t(),vo(),t),LCt={key:0,class:"fixed top-0 left-0 w-screen h-screen flex items-center justify-center"},PCt={class:"flex flex-col text-center"},UCt={class:"flex flex-col text-center items-center"},FCt={class:"flex items-center gap-3 text-5xl drop-shadow-md align-middle pt-24"},BCt=Ft(()=>c("img",{class:"w-24 animate-bounce",title:"LoLLMS WebUI",src:Ti,alt:"Logo"},null,-1)),GCt={class:"flex flex-col items-start"},VCt={class:"text-2xl font-bold text-5xl drop-shadow-md align-middle"},zCt=Ft(()=>c("p",{class:"text-gray-400 text-base"},"One tool to rule them all",-1)),HCt=Ft(()=>c("p",{class:"text-gray-400 text-base"},"by ParisNeo",-1)),qCt=Ft(()=>c("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)),YCt=Ft(()=>c("p",{class:"text-2xl mb-10 font-bold drop-shadow-md"},"Welcome",-1)),$Ct={role:"status",class:"text-center w-full display: flex; flex-row align-items: center;"},WCt={class:"text-2xl animate-pulse mt-2"},KCt=Ft(()=>c("i",{"data-feather":"chevron-right"},null,-1)),jCt=[KCt],QCt=Ft(()=>c("i",{"data-feather":"chevron-left"},null,-1)),XCt=[QCt],ZCt={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"},JCt={class:"text-light-text-panel dark:text-dark-text-panel bg-bg-light-panel sticky z-10 top-0 dark:bg-bg-dark-tone shadow-md"},e1t={class:"flex-row p-4 flex items-center gap-3 flex-0"},t1t=Ft(()=>c("i",{"data-feather":"plus"},null,-1)),n1t=[t1t],i1t=Ft(()=>c("i",{"data-feather":"check-square"},null,-1)),s1t=[i1t],r1t={class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Reset database, remove all discussions"},o1t=Ft(()=>c("i",{"data-feather":"database"},null,-1)),a1t=[o1t],l1t=Ft(()=>c("i",{"data-feather":"log-in"},null,-1)),c1t=[l1t],d1t=Ft(()=>c("i",{"data-feather":"folder"},null,-1)),u1t=[d1t],p1t={key:1,class:"dropdown"},_1t=Ft(()=>c("i",{"data-feather":"search"},null,-1)),h1t=[_1t],f1t={key:2,class:"flex gap-3 flex-1 items-center duration-75"},m1t=Ft(()=>c("i",{"data-feather":"x"},null,-1)),g1t=[m1t],b1t=Ft(()=>c("i",{"data-feather":"check"},null,-1)),E1t=[b1t],y1t=Ft(()=>c("i",{"data-feather":"hard-drive"},null,-1)),v1t=[y1t],S1t=Ft(()=>c("i",{"data-feather":"check-circle"},null,-1)),T1t=[S1t],x1t=Ft(()=>c("i",{"data-feather":"x-octagon"},null,-1)),C1t=[x1t],w1t=Ft(()=>c("i",{"data-feather":"book"},null,-1)),R1t=[w1t],A1t={key:7,title:"Loading..",class:"flex flex-row flex-grow justify-end"},N1t=Ft(()=>c("div",{role:"status"},[c("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"},[c("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),c("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"})]),c("span",{class:"sr-only"},"Loading...")],-1)),O1t=[N1t],I1t={key:0,class:"flex-row items-center gap-3 flex-0 w-full"},M1t={class:"p-4 pt-2"},D1t={class:"relative"},k1t=Ft(()=>c("div",{class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},[c("div",{class:"scale-75"},[c("i",{"data-feather":"search"})])],-1)),L1t={class:"absolute inset-y-0 right-0 flex items-center pr-3"},P1t=Ft(()=>c("i",{"data-feather":"x"},null,-1)),U1t=[P1t],F1t={key:1,class:"h-px bg-bg-light p-0 mb-4 px-4 mx-4 border-0 dark:bg-bg-dark"},B1t={key:2,class:"flex flex-row flex-grow p-4 pt-0 items-center"},G1t={class:"flex flex-row flex-grow"},V1t={key:0},z1t={class:"flex flex-row"},H1t={key:0,class:"flex gap-3"},q1t=Ft(()=>c("i",{"data-feather":"trash"},null,-1)),Y1t=[q1t],$1t={key:1,class:"flex gap-3 mx-3 flex-1 items-center justify-end group-hover:visible duration-75"},W1t=Ft(()=>c("i",{"data-feather":"check"},null,-1)),K1t=[W1t],j1t=Ft(()=>c("i",{"data-feather":"x"},null,-1)),Q1t=[j1t],X1t={class:"flex gap-3"},Z1t=Ft(()=>c("i",{"data-feather":"codepen"},null,-1)),J1t=[Z1t],ewt=Ft(()=>c("i",{"data-feather":"folder"},null,-1)),twt=[ewt],nwt=Ft(()=>c("i",{"data-feather":"bookmark"},null,-1)),iwt=[nwt],swt=Ft(()=>c("i",{"data-feather":"list"},null,-1)),rwt=[swt],owt={class:"relative flex flex-row flex-grow mb-10 z-0 w-full"},awt={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"},lwt=Ft(()=>c("p",{class:"px-3"},"No discussions are found",-1)),cwt=[lwt],dwt=Ft(()=>c("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)),uwt={class:"text-center font-large font-bold text-l drop-shadow-md align-middle"},pwt={key:1,class:"relative flex flex-col flex-grow w-full"},_wt={class:"container pt-4 pb-50 mb-50 w-full"},hwt=Ft(()=>c("div",null,[c("br"),c("br"),c("br"),c("br"),c("br"),c("br"),c("br")],-1)),fwt=Ft(()=>c("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)),mwt={key:0,class:"flex flex-row items-center justify-center h-10"},gwt={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"},bwt={class:"text-2xl animate-pulse mt-2 text-light-text-panel dark:text-dark-text-panel"},Ewt={setup(){},data(){return{memory_icon:ICt,active_skills:MCt,inactive_skills:DCt,skillsRegistry:kCt,posts_headers:{accept:"application/json","Content-Type":"application/json"},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()},addWebpage(){Se.post("/add_webpage",{client_id:this.client_id,url:this.$refs.web_url_input_box.inputText},{headers:this.posts_headers}).then(t=>{t&&t.status&&(console.log("Done"),this.recoverFiles())})},show_progress(t){this.progress_visibility_val=!0},hide_progress(t){this.progress_visibility_val=!1},update_progress(t){console.log("Progress update"),this.progress_value=t.value},onSettingsBinding(){try{this.isLoading=!0,Se.get("/get_active_binding_settings").then(t=>{this.isLoading=!1,t&&(t.data&&Object.keys(t.data).length>0?this.$store.state.universalForm.showForm(t.data,"Binding settings - "+bindingEntry.binding.name,"Save changes","Cancel").then(e=>{try{Se.post("/set_active_binding_settings",e).then(n=>{n&&n.data?(console.log("binding set with new settings",n.data),this.$store.state.toast.showToast("Binding settings updated successfully!",4,!0)):(this.$store.state.toast.showToast(`Did not get binding settings responses. `+n,4,!1),this.isLoading=!1)})}catch(n){this.$store.state.toast.showToast(`Did not get binding settings responses. Endpoint error: `+n.message,4,!1),this.isLoading=!1}}):(this.$store.state.toast.showToast("Binding has no settings",4,!1),this.isLoading=!1))})}catch(t){this.isLoading=!1,this.$store.state.toast.showToast("Could not open binding settings. Endpoint error: "+t.message,4,!1)}},showDatabaseSelector(){this.database_selectorDialogVisible=!0},async ondatabase_selectorDialogSelected(t){console.log("Selected:",t)},onclosedatabase_selectorDialog(){this.database_selectorDialogVisible=!1},async onvalidatedatabase_selectorChoice(t){if(this.database_selectorDialogVisible=!1,(await Se.post("/select_database",{client_id:this.client_id,name:t},{headers:this.posts_headers})).status){console.log("Selected database"),this.$store.state.config=await Se.get("/get_config"),console.log("new config loaded :",this.$store.state.config);let n=await Se.get("/list_databases").data;console.log("New list of database: ",n),this.$store.state.databases=n,console.log("New list of database: ",this.$store.state.databases),location.reload()}},async addDiscussion2SkillsLibrary(){(await Se.post("/add_discussion_to_skills_library",{client_id:this.client_id},{headers:this.posts_headers})).status&&console.log("done")},async toggleSkillsLib(){this.$store.state.config.activate_skills_lib=!this.$store.state.config.activate_skills_lib,await this.applyConfiguration()},async showSkillsLib(){this.$refs.skills_lib.showSkillsLibrary()},async applyConfiguration(){this.loading=!0;const t=await Se.post("/apply_settings",{client_id:this.$store.state.client_id,config:this.$store.state.config});this.loading=!1,t.data.status?this.$store.state.toast.showToast("Configuration changed successfully.",4,!0):this.$store.state.toast.showToast("Configuration change failed.",4,!1),Ge(()=>{He.replace()})},save_configuration(){this.showConfirmation=!1,Se.post("/save_settings",{}).then(t=>{if(t)return t.status?this.$store.state.toast.showToast("Settings saved!",4,!0):this.$store.state.messageBox.showMessage("Error: Couldn't save settings!"),t.data}).catch(t=>(console.log(t.message,"save_configuration"),this.$store.state.messageBox.showMessage("Couldn't save settings!"),{status:!1}))},showToastMessage(t,e,n){console.log("sending",t),this.$store.state.toast.showToast(t,e,n)},togglePanel(){this.panelCollapsed=!this.panelCollapsed},toggleDropdown(){this.isOpen=!this.isOpen},importChatGPT(){},async api_get_req(t){try{const e=await Se.get("/"+t);if(e)return e.data}catch(e){console.log(e.message,"api_get_req");return}},async list_discussions(){try{const t=await Se.get("/list_discussions");if(t)return this.createDiscussionList(t.data),t.data}catch(t){return console.log("Error: Could not list discussions",t.message),[]}},load_discussion(t,e){t&&(console.log("Loading discussion",t),this.loading=!0,this.discussionArr=[],this.setDiscussionLoading(t,this.loading),$e.on("discussion",n=>{console.log("Discussion recovered"),this.loading=!1,this.setDiscussionLoading(t,this.loading),n&&(this.discussionArr=n.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()),$e.off("discussion")}),$e.emit("load_discussion",{id:t}),console.log("here"))},recoverFiles(){console.log("Recovering files"),Se.post("/get_discussion_files_list",{client_id:this.$store.state.client_id}).then(t=>{this.$refs.chatBox.filesList=t.data.files,this.$refs.chatBox.isFileSentList=t.data.files.map(e=>!0),console.log(`Files recovered: ${this.$refs.chatBox.filesList}`)})},new_discussion(t){try{this.loading=!0,$e.on("discussion_created",e=>{$e.off("discussion_created"),this.list_discussions().then(()=>{const n=this.list.findIndex(s=>s.id==e.id),i=this.list[n];this.selectDiscussion(i),this.load_discussion(e.id,()=>{this.loading=!1,this.recoverFiles(),Ge(()=>{const s=document.getElementById("dis-"+e.id);this.scrollToElement(s),console.log("Scrolling tp "+s)})})})}),console.log("new_discussion ",t),$e.emit("new_discussion",{title:t})}catch(e){return console.log("Error: Could not create new discussion",e.message),{}}},async delete_discussion(t){try{t&&(this.loading=!0,this.setDiscussionLoading(t,this.loading),await Se.post("/delete_discussion",{client_id:this.client_id,id:t},{headers:this.posts_headers}),this.loading=!1,this.setDiscussionLoading(t,this.loading))}catch(e){console.log("Error: Could not delete discussion",e.message),this.loading=!1,this.setDiscussionLoading(t,this.loading)}},async edit_title(t,e){try{if(t){this.loading=!0,this.setDiscussionLoading(t,this.loading);const n=await Se.post("/edit_title",{client_id:this.client_id,id:t,title:e},{headers:this.posts_headers});if(this.loading=!1,this.setDiscussionLoading(t,this.loading),n.status==200){const i=this.list.findIndex(r=>r.id==t),s=this.list[i];s.title=e,this.tempList=this.list}}}catch(n){console.log("Error: Could not edit title",n.message),this.loading=!1,this.setDiscussionLoading(t,this.loading)}},async make_title(t){try{if(t){this.loading=!0,this.setDiscussionLoading(t,this.loading);const e=await Se.post("/make_title",{client_id:this.client_id,id:t},{headers:this.posts_headers});if(console.log("Making title:",e),this.loading=!1,this.setDiscussionLoading(t,this.loading),e.status==200){const n=this.list.findIndex(s=>s.id==t),i=this.list[n];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(t,this.loading)}},async delete_message(t){try{console.log(typeof t),console.log(typeof this.client_id),console.log(t),console.log(this.client_id);const e=await Se.post("/delete_message",{client_id:this.client_id,id:t},{headers:this.posts_headers});if(e)return e.data}catch(e){return console.log("Error: Could delete message",e.message),{}}},async stop_gen(){try{if(this.discussionArr.length>0){const t=this.discussionArr[this.discussionArr.length-1];t.status_message="Generation canceled"}if($e.emit("cancel_generation"),res)return res.data}catch(t){return console.log("Error: Could not stop generating",t.message),{}}},async message_rank_up(t){try{const e=await Se.post("/message_rank_up",{client_id:this.client_id,id:t},{headers:this.posts_headers});if(e)return e.data}catch(e){return console.log("Error: Could not rank up message",e.message),{}}},async message_rank_down(t){try{const e=await Se.post("/message_rank_down",{client_id:this.client_id,id:t},{headers:this.posts_headers});if(e)return e.data}catch(e){return console.log("Error: Could not rank down message",e.message),{}}},async edit_message(t,e,n){try{console.log(typeof this.client_id),console.log(typeof t),console.log(typeof e),console.log(typeof{audio_url:n});const i=await Se.post("/edit_message",{client_id:this.client_id,id:t,message:e,metadata:[{audio_url:n}]},{headers:this.posts_headers});if(i)return i.data}catch(i){return console.log("Error: Could not update message",i.message),{}}},async export_multiple_discussions(t,e){try{if(t.length>0){const n=await Se.post("/export_multiple_discussions",{client_id:this.$store.state.client_id,discussion_ids:t,export_format:e},{headers:this.posts_headers});if(n)return n.data}}catch(n){return console.log("Error: Could not export multiple discussions",n.message),{}}},async import_multiple_discussions(t){try{if(t.length>0){console.log("sending import",t);const e=await Se.post("/import_multiple_discussions",{client_id:this.$store.state.client_id,jArray:t},{headers:this.posts_headers});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(t=>t.title&&t.title.includes(this.filterTitle)):this.list=this.tempList,this.filterInProgress=!1},100))},async selectDiscussion(t){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}t&&(this.currentDiscussion===void 0?(this.currentDiscussion=t,this.setPageTitle(t),localStorage.setItem("selected_discussion",this.currentDiscussion.id),this.load_discussion(t.id,()=>{this.discussionArr.length>1&&((this.currentDiscussion.title===""||this.currentDiscussion.title===null)&&this.changeTitleUsingUserMSG(this.currentDiscussion.id,this.discussionArr[1].content),this.recoverFiles())})):this.currentDiscussion.id!=t.id&&(console.log("item",t),console.log("this.currentDiscussion",this.currentDiscussion),this.currentDiscussion=t,console.log("this.currentDiscussion",this.currentDiscussion),this.setPageTitle(t),localStorage.setItem("selected_discussion",this.currentDiscussion.id),this.load_discussion(t.id,()=>{this.discussionArr.length>1&&(this.currentDiscussion.title===""||this.currentDiscussion.title===null)&&this.changeTitleUsingUserMSG(this.currentDiscussion.id,this.discussionArr[1].content),this.recoverFiles()})),Ge(()=>{const e=document.getElementById("dis-"+this.currentDiscussion.id);this.scrollToElementInContainer(e,"leftPanel");const n=document.getElementById("messages-list");this.scrollBottom(n)}))},scrollToElement(t){t?t.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"}):console.log("Error: scrollToElement")},scrollToElementInContainer(t,e){try{const n=t.offsetTop;document.getElementById(e).scrollTo({top:n,behavior:"smooth"})}catch{console.log("error")}},scrollBottom(t){t?t.scrollTo({top:t.scrollHeight,behavior:"smooth"}):console.log("Error: scrollBottom")},scrollTop(t){t?t.scrollTo({top:0,behavior:"smooth"}):console.log("Error: scrollTop")},createUserMsg(t){let e={content:t.message,id:t.id,rank:0,sender:t.user,created_at:t.created_at,steps:[],html_js_s:[],status_message:"Warming up"};this.discussionArr.push(e),Ge(()=>{const n=document.getElementById("messages-list");this.scrollBottom(n)})},updateLastUserMsg(t){const e=this.discussionArr.indexOf(i=>i.id=t.user_id),n={binding:t.binding,content:t.message,created_at:t.created_at,type:t.type,finished_generating_at:t.finished_generating_at,id:t.user_id,model:t.model,personality:t.personality,sender:t.user,steps:[]};e!==-1&&(this.discussionArr[e]=n)},socketIOConnected(){return console.log("socketIOConnected"),this.$store.state.isConnected=!0,this.$store.state.client_id=$e.id,!0},socketIODisconnected(){return console.log("socketIOConnected"),this.currentDiscussion=null,this.$store.dispatch("refreshModels"),this.$store.state.isConnected=!1,!0},new_message(t){t.sender_type==this.SENDER_TYPES_AI&&(this.isGenerating=!0),console.log("Making a new message"),console.log("New message",t);let e={sender:t.sender,message_type:t.message_type,sender_type:t.sender_type,content:t.content,id:t.id,discussion_id:t.discussion_id,parent_id:t.parent_id,binding:t.binding,model:t.model,personality:t.personality,created_at:t.created_at,finished_generating_at:t.finished_generating_at,rank:0,ui:t.ui,steps:[],parameters:t.parameters,metadata:t.metadata,open:t.open};e.status_message="Warming up",console.log(e),this.discussionArr.push(e),(this.currentDiscussion.title===""||this.currentDiscussion.title===null)&&this.changeTitleUsingUserMSG(this.currentDiscussion.id,t.message),console.log("infos",t)},async talk(t){this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating);let e=await Se.get("/get_generation_status",{});if(e)if(e.data.status)console.log("Already generating");else{const n=this.$store.state.config.personalities.findIndex(s=>s===t.full_path),i={client_id:this.$store.state.client_id,id:n};e=await Se.post("/select_personality",i),console.log("Generating message from ",e.data.status),$e.emit("generate_msg_from",{id:-1})}},createEmptyUserMessage(t){$e.emit("create_empty_message",{type:0,message:t})},createEmptyAIMessage(){$e.emit("create_empty_message",{type:1})},sendMsg(t,e){if(!t){this.$store.state.toast.showToast("Message contains no content!",4,!1);return}this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),Se.get("/get_generation_status",{}).then(n=>{if(n)if(n.data.status)console.log("Already generating");else{e=="internet"?$e.emit("generate_msg_with_internet",{prompt:t}):$e.emit("generate_msg",{prompt:t});let i=0;this.discussionArr.length>0&&(i=Number(this.discussionArr[this.discussionArr.length-1].id)+1);let s={message:t,id:i,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:t,id:i,discussion_id:this.discussion_id,parent_id:i,binding:"",model:"",personality:"",created_at:new Date().toLocaleString(),finished_generating_at:new Date().toLocaleString(),rank:0,steps:[],parameters:null,metadata:[],ui:null};this.createUserMsg(s)}}).catch(n=>{console.log("Error: Could not get generation status",n)})},sendCmd(t){this.isGenerating=!0,$e.emit("execute_command",{command:t,parameters:[]})},notify(t){self.isGenerating=!1,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),Ge(()=>{const e=document.getElementById("messages-list");this.scrollBottom(e)}),t.display_type==0?this.$store.state.toast.showToast(t.content,t.duration,t.notification_type):t.display_type==1?this.$store.state.messageBox.showMessage(t.content):t.display_type==2?(this.$store.state.messageBox.hideMessage(),this.$store.state.yesNoDialog.askQuestion(t.content,"Yes","No").then(e=>{$e.emit("yesNoRes",{yesRes:e})})):t.display_type==3?this.$store.state.messageBox.showBlockingMessage(t.content):t.display_type==4&&this.$store.state.messageBox.hideMessage(),this.chime.play()},streamMessageContent(t){if(this.discussion_id=t.discussion_id,this.setDiscussionLoading(this.discussion_id,!0),this.currentDiscussion.id==this.discussion_id){const e=this.discussionArr.findIndex(i=>i.id==t.id),n=this.discussionArr[e];if(n&&(t.message_type==this.msgTypes.MSG_TYPE_FULL||t.message_type==this.msgTypes.MSG_TYPE_FULL_INVISIBLE_TO_AI))this.isGenerating=!0,n.content=t.content,n.created_at=t.created_at,n.started_generating_at=t.started_generating_at,n.nb_tokens=t.nb_tokens,n.finished_generating_at=t.finished_generating_at;else if(n&&t.message_type==this.msgTypes.MSG_TYPE_CHUNK)this.isGenerating=!0,n.content+=t.content,n.created_at=t.created_at,n.started_generating_at=t.started_generating_at,n.nb_tokens=t.nb_tokens,n.finished_generating_at=t.finished_generating_at;else if(t.message_type==this.msgTypes.MSG_TYPE_STEP)n.status_message=t.content,n.steps.push({message:t.content,done:!0,status:!0,type:"instantanious"});else if(t.message_type==this.msgTypes.MSG_TYPE_STEP_START)n.status_message=t.content,n.steps.push({message:t.content,done:!1,status:!0,type:"start_end"});else if(t.message_type==this.msgTypes.MSG_TYPE_STEP_END){console.log("received step end",t);try{n.steps.forEach(i=>{if(i.message===t.content){i.done=!0;try{console.log(t.parameters);const s=t.parameters;s!==void 0&&(i.status=s.status,console.log(s))}catch(s){console.error("Error parsing JSON:",s.message)}}})}catch{console.log("error")}}else t.message_type==this.msgTypes.MSG_TYPE_JSON_INFOS?(console.log("JSON message"),console.log(t.metadata),n.metadata=t.metadata):t.message_type==this.msgTypes.MSG_TYPE_UI?(console.log("UI message"),n.ui=t.ui,console.log(n.ui)):t.message_type==this.msgTypes.MSG_TYPE_EXCEPTION&&this.$store.state.toast.showToast(t.content,5,!1)}this.$nextTick(()=>{He.replace()})},async changeTitleUsingUserMSG(t,e){const n=this.list.findIndex(s=>s.id==t),i=this.list[n];e&&(i.title=e,this.tempList=this.list,await this.edit_title(t,e))},async createNewDiscussion(){this.new_discussion(null)},loadLastUsedDiscussion(){console.log("Loading last discussion");const t=localStorage.getItem("selected_discussion");if(console.log("Last discussion id: ",t),t){const e=this.list.findIndex(i=>i.id==t),n=this.list[e];n&&this.selectDiscussion(n)}},onCopyPersonalityName(t){this.$store.state.toast.showToast("Copied name to clipboard!",4,!0),navigator.clipboard.writeText(t.name)},async deleteDiscussion(t){await this.delete_discussion(t),this.currentDiscussion.id==t&&(this.currentDiscussion={},this.discussionArr=[],this.setPageTitle()),this.list.splice(this.list.findIndex(e=>e.id==t),1),this.createDiscussionList(this.list)},async deleteDiscussionMulti(){const t=this.selectedDiscussions;for(let e=0;ei.id==n.id),1)}this.tempList=this.list,this.isCheckbox=!1,this.$store.state.toast.showToast("Removed ("+t.length+") items",4,!0),this.showConfirmation=!1,console.log("Multi delete done")},async deleteMessage(t){await this.delete_message(t).then(()=>{this.discussionArr.splice(this.discussionArr.findIndex(e=>e.id==t),1)}).catch(()=>{this.$store.state.toast.showToast("Could not remove message",4,!1),console.log("Error: Could not delete message")})},async openFolder(t){const e=JSON.stringify({client_id:this.$store.state.client_id,discussion_id:t.id});console.log(e),await Se.post("/open_discussion_folder",e,{method:"POST",headers:{"Content-Type":"application/json"}})},async editTitle(t){const e=this.list.findIndex(i=>i.id==t.id),n=this.list[e];n.title=t.title,n.loading=!0,await this.edit_title(t.id,t.title),n.loading=!1},async makeTitle(t){this.list.findIndex(e=>e.id==t.id),await this.make_title(t.id)},checkUncheckDiscussion(t,e){const n=this.list.findIndex(s=>s.id==e),i=this.list[n];i.checkBoxValue=t.target.checked,this.tempList=this.list},selectAllDiscussions(){this.isSelectAll=!this.tempList.filter(t=>t.checkBoxValue==!1).length>0;for(let t=0;t({id:n.id,title:n.title,selected:!1,loading:!1,checkBoxValue:!1})).sort(function(n,i){return i.id-n.id});this.list=e,this.tempList=e}},setDiscussionLoading(t,e){try{const n=this.list.findIndex(s=>s.id==t),i=this.list[n];i.loading=e}catch{console.log("Error setting discussion loading")}},setPageTitle(t){if(t)if(t.id){const e=t.title?t.title==="untitled"?"New discussion":t.title:"New discussion";document.title="LoLLMS WebUI - "+e}else{const e=t||"Welcome";document.title="LoLLMS WebUI - "+e}else{const e=t||"Welcome";document.title="LoLLMS WebUI - "+e}},async rankUpMessage(t){await this.message_rank_up(t).then(e=>{const n=this.discussionArr[this.discussionArr.findIndex(i=>i.id==t)];n.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(t){await this.message_rank_down(t).then(e=>{const n=this.discussionArr[this.discussionArr.findIndex(i=>i.id==t)];n.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(t,e,n){await this.edit_message(t,e,n).then(()=>{const i=this.discussionArr[this.discussionArr.findIndex(s=>s.id==t)];i.content=e}).catch(()=>{this.$store.state.toast.showToast("Could not update message",4,!1),console.log("Error: Could not update message")})},resendMessage(t,e,n){Ge(()=>{He.replace()}),this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),Se.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")):$e.emit("generate_msg_from",{prompt:e,id:t,msg_type:n}))}).catch(i=>{console.log("Error: Could not get generation status",i)})},continueMessage(t,e){Ge(()=>{He.replace()}),this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),Se.get("/get_generation_status",{}).then(n=>{n&&(n.data.status?console.log("Already generating"):$e.emit("continue_generate_msg_from",{prompt:e,id:t}))}).catch(n=>{console.log("Error: Could not get generation status",n)})},stopGenerating(){this.stop_gen(),this.isGenerating=!1,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),console.log("Stopped generating"),Ge(()=>{const t=document.getElementById("messages-list");this.scrollBottom(t)})},finalMsgEvent(t){let e=0;this.discussion_id=t.discussion_id,this.currentDiscussion.id==this.discussion_id&&(e=this.discussionArr.findIndex(i=>i.id==t.id),this.discussionArr[e].content=t.content,this.discussionArr[e].finished_generating_at=t.finished_generating_at),Ge(()=>{const i=document.getElementById("messages-list");this.scrollBottom(i),this.recoverFiles()}),this.isGenerating=!1,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),this.chime.play(),e=this.discussionArr.findIndex(i=>i.id==t.id);const n=this.discussionArr[e];if(n.status_message="Done",console.log("final",t),this.$store.state.config.auto_speak&&this.$store.state.config.xtts_enable&&this.$store.state.config.xtts_use_streaming_mode){e=this.discussionArr.findIndex(s=>s.id==t.id);let i=this.$refs["msg-"+t.id][0];console.log(i),i.speak()}},copyToClipBoard(t){let e="";if(t.message.content&&(e=t.message.content),this.$store.state.config.copy_to_clipboard_add_all_details){let n="";t.message.binding&&(n=`Binding: ${t.message.binding}`);let i="";t.message.personality&&(i=` Personality: ${t.message.personality}`);let s="";t.created_at_parsed&&(s=` @@ -197,15 +197,15 @@ ${e} ${l}`;navigator.clipboard.writeText(u)}else navigator.clipboard.writeText(e);this.$store.state.toast.showToast("Copied to clipboard successfully",4,!0),Ge(()=>{He.replace()})},closeToast(){this.showToast=!1},saveJSONtoFile(t,e){e=e||"data.json";const n=document.createElement("a");n.href=URL.createObjectURL(new Blob([JSON.stringify(t,null,2)],{type:"text/plain"})),n.setAttribute("download",e),document.body.appendChild(n),n.click(),document.body.removeChild(n)},saveMarkdowntoFile(t,e){e=e||"data.md";const n=document.createElement("a");n.href=URL.createObjectURL(new Blob([t],{type:"text/plain"})),n.setAttribute("download",e),document.body.appendChild(n),n.click(),document.body.removeChild(n)},parseJsonObj(t){try{return JSON.parse(t)}catch(e){return this.$store.state.toast.showToast(`Could not parse JSON. `+e.message,4,!1),null}},async parseJsonFile(t){return new Promise((e,n)=>{const i=new FileReader;i.onload=s=>e(this.parseJsonObj(s.target.result)),i.onerror=s=>n(s),i.readAsText(t)})},async exportDiscussionsAsMarkdown(){const t=this.list.filter(e=>e.checkBoxValue==!0).map(e=>e.id);if(t.length>0){console.log("export",t);let e=new Date;const n=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"),u="discussions_export_"+(n+"."+i+"."+s+"."+r+o+a)+".md";this.loading=!0;const d=await this.export_multiple_discussions(t,"markdown");d?(this.saveMarkdowntoFile(d,u),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 exportDiscussions(){},async exportDiscussionsAsJson(){const t=this.list.filter(e=>e.checkBoxValue==!0).map(e=>e.id);if(t.length>0){console.log("export",t);let e=new Date;const n=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"),u="discussions_export_"+(n+"."+i+"."+s+"."+r+o+a)+".json";this.loading=!0;const d=await this.export_multiple_discussions(t,"json");d?(this.saveJSONtoFile(d,u),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 importDiscussionsBundle(t){},async importDiscussions(t){const e=await this.parseJsonFile(t.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 t=this.$store.state.personalities;this.personalityAvatars=t.map(e=>({name:e.name,avatar:e.avatar}))},getAvatar(t){if(t.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===t),n=this.personalityAvatars[e];if(n)return console.log("Avatar",n.avatar),n.avatar},setFileListChat(t){try{this.$refs.chatBox.fileList=this.$refs.chatBox.fileList.concat(t)}catch(e){this.$store.state.toast.showToast(`Failed to set filelist in chatbox -`+e.message,4,!1)}this.isDragOverChat=!1},async setFileListDiscussion(t){if(t.length>1){this.$store.state.toast.showToast("Failed to import discussions. Too many files",4,!1);return}const e=await this.parseJsonFile(t[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(){const e=(await Se.get("/get_versionID")).data.versionId;for(this.versionId!==e&&(this.$store.commit("updateVersionId",e),window.location.reload(!0)),this.$nextTick(()=>{He.replace()}),$e.on("disucssion_renamed",n=>{console.log("Received new title",n.discussion_id,n.title);const i=this.list.findIndex(r=>r.id==n.discussion_id),s=this.list[i];s.title=n.title}),$e.onclose=n=>{console.log("WebSocket connection closed:",n.code,n.reason),this.socketIODisconnected()},$e.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}),$e.onerror=n=>{console.log("WebSocket connection error:",n.code,n.reason),this.socketIODisconnected(),$e.disconnect()},$e.on("connected",this.socketIOConnected),$e.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("Ready"),this.setPageTitle(),await this.list_discussions(),this.loadLastUsedDiscussion(),$e.on("show_progress",this.show_progress),$e.on("hide_progress",this.hide_progress),$e.on("update_progress",this.update_progress),$e.on("notification",this.notify),$e.on("new_message",this.new_message),$e.on("update_message",this.streamMessageContent),$e.on("close_message",this.finalMsgEvent),$e.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(){$e.on("refresh_files",()=>{this.recoverFiles()}),this.$nextTick(()=>{He.replace()})},async activated(){for(;this.isReady===!1;)await new Promise(t=>setTimeout(t,100));await this.getPersonalityAvatars(),console.log("Avatars found:",this.personalityAvatars),this.isCreated&&Ge(()=>{const t=document.getElementById("messages-list");this.scrollBottom(t)}),this.$store.state.config.show_news_panel&&this.$store.state.news.show()},components:{Discussion:RE,Message:yO,ChatBox:vO,WelcomeComponent:SO,ChoiceDialog:wE,ProgressBar:nc,InputBox:gO,SkillsLibraryViewer:bO},watch:{progress_visibility_val(t){console.log("progress_visibility changed")},filterTitle(t){t==""&&(this.filterInProgress=!0,this.list=this.tempList,this.filterInProgress=!1)},isCheckbox(t){Ge(()=>{He.replace()}),t||(this.isSelectAll=!1)},socketConnected(t){console.log("Websocket connected (watch)",t)},showConfirmation(){Ge(()=>{He.replace()})},isSearch(){Ge(()=>{He.replace()})}},computed:{...Sk({versionId:t=>t.versionId}),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(t){this.$store.state.isModelOk=t}},isGenerating:{get(){return this.$store.state.isGenerating},set(t){this.$store.state.isGenerating=t}},formatted_database_name(){return this.$store.state.config.discussion_db_name},UseDiscussionHistory(){return this.$store.state.config.activate_skills_lib},isReady:{get(){return this.$store.state.ready}},databases(){return this.$store.state.databases},client_id(){return $e.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 Ge(()=>{He.replace()}),this.list.filter(t=>t.checkBoxValue==!0)}}},Ewt=Object.assign(bwt,{__name:"DiscussionsView",setup(t){return Ws(()=>{zO()}),Se.defaults.baseURL="/",(e,n)=>(w(),A(Ye,null,[Te(cs,{name:"fade-and-fly"},{default:We(()=>[e.isReady?V("",!0):(w(),A("div",kCt,[c("div",LCt,[c("div",PCt,[c("div",UCt,[FCt,c("div",BCt,[c("p",GCt,"LoLLMS "+he(e.version_info),1),VCt,zCt])]),HCt,qCt,c("div",YCt,[Te(nc,{ref:"loading_progress",progress:e.loading_progress},null,8,["progress"]),c("p",$Ct,he(e.loading_infos)+" ...",1)])])])]))]),_:1}),e.isReady?(w(),A("button",{key:0,onClick:n[0]||(n[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"},[G(c("div",null,KCt,512),[[Mt,e.panelCollapsed]]),G(c("div",null,QCt,512),[[Mt,!e.panelCollapsed]])])):V("",!0),Te(cs,{name:"slide-right"},{default:We(()=>[e.showPanel?(w(),A("div",XCt,[c("div",{id:"leftPanel",class:"flex flex-col flex-grow overflow-y-scroll no-scrollbar",onDragover:n[28]||(n[28]=be(i=>e.setDropZoneDiscussion(),["stop","prevent"]))},[c("div",ZCt,[c("div",JCt,[c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Create new discussion",type:"button",onClick:n[1]||(n[1]=i=>e.createNewDiscussion())},t1t),c("button",{class:ze(["text-2xl hover:text-secondary duration-75 active:scale-90",e.isCheckbox?"text-secondary":""]),title:"Edit discussion list",type:"button",onClick:n[2]||(n[2]=i=>e.isCheckbox=!e.isCheckbox)},i1t,2),c("button",s1t,[c("i",{"data-feather":"trash-2",onClick:n[3]||(n[3]=be(()=>{},["stop"]))})]),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Export database",type:"button",onClick:n[4]||(n[4]=be(i=>e.database_selectorDialogVisible=!0,["stop"]))},o1t),c("input",{type:"file",ref:"fileDialog",style:{display:"none"},onChange:n[5]||(n[5]=(...i)=>e.importDiscussions&&e.importDiscussions(...i))},null,544),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Import discussions",type:"button",onClick:n[6]||(n[6]=be(i=>e.$refs.fileDialog.click(),["stop"]))},l1t),c("input",{type:"file",ref:"bundleLoadingDialog",style:{display:"none"},onChange:n[7]||(n[7]=(...i)=>e.importDiscussionsBundle&&e.importDiscussionsBundle(...i))},null,544),e.showSaveConfirmation?V("",!0):(w(),A("button",{key:0,title:"Import discussion bundle",onClick:n[8]||(n[8]=be(i=>e.$refs.bundleLoadingDialog.click(),["stop"])),class:"text-2xl hover:text-secondary duration-75 active:scale-90"},d1t)),e.isOpen?(w(),A("div",u1t,[c("button",{onClick:n[9]||(n[9]=(...i)=>e.importDiscussions&&e.importDiscussions(...i))},"LOLLMS"),c("button",{onClick:n[10]||(n[10]=(...i)=>e.importChatGPT&&e.importChatGPT(...i))},"ChatGPT")])):V("",!0),c("button",{class:ze(["text-2xl hover:text-secondary duration-75 active:scale-90",e.isSearch?"text-secondary":""]),title:"Filter discussions",type:"button",onClick:n[11]||(n[11]=i=>e.isSearch=!e.isSearch)},_1t,2),e.showSaveConfirmation?(w(),A("div",h1t,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel",type:"button",onClick:n[12]||(n[12]=be(i=>e.showSaveConfirmation=!1,["stop"]))},m1t),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm save changes",type:"button",onClick:n[13]||(n[13]=be(i=>e.save_configuration(),["stop"]))},b1t)])):V("",!0),e.loading?V("",!0):(w(),A("button",{key:3,type:"button",onClick:n[14]||(n[14]=be((...i)=>e.addDiscussion2SkillsLibrary&&e.addDiscussion2SkillsLibrary(...i),["stop"])),title:"Add this discussion content to skills database",class:"w-6 hover:text-secondary duration-75 active:scale-90"},y1t)),!e.loading&&e.$store.state.config.activate_skills_lib?(w(),A("button",{key:4,type:"button",onClick:n[15]||(n[15]=be((...i)=>e.toggleSkillsLib&&e.toggleSkillsLib(...i),["stop"])),title:"Skills database is activated",class:"w-6 hover:text-secondary duration-75 active:scale-90"},S1t)):V("",!0),!e.loading&&!e.$store.state.config.activate_skills_lib?(w(),A("button",{key:5,type:"button",onClick:n[16]||(n[16]=be((...i)=>e.toggleSkillsLib&&e.toggleSkillsLib(...i),["stop"])),title:"Skills database is deactivated",class:"w-6 hover:text-secondary duration-75 active:scale-90"},x1t)):V("",!0),e.loading?V("",!0):(w(),A("button",{key:6,type:"button",onClick:n[17]||(n[17]=be((...i)=>e.showSkillsLib&&e.showSkillsLib(...i),["stop"])),title:"Show Skills database",class:"w-6 hover:text-secondary duration-75 active:scale-90"},w1t)),e.loading?(w(),A("div",R1t,N1t)):V("",!0)]),e.isSearch?(w(),A("div",O1t,[c("div",I1t,[c("div",M1t,[D1t,c("div",k1t,[c("div",{class:ze(["hover:text-secondary duration-75 active:scale-90",e.filterTitle?"visible":"invisible"]),title:"Clear",onClick:n[18]||(n[18]=i=>e.filterTitle="")},P1t,2)]),G(c("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":n[19]||(n[19]=i=>e.filterTitle=i),onInput:n[20]||(n[20]=i=>e.filterDiscussions())},null,544),[[we,e.filterTitle]])])])])):V("",!0),e.isCheckbox?(w(),A("hr",U1t)):V("",!0),e.isCheckbox?(w(),A("div",F1t,[c("div",B1t,[e.selectedDiscussions.length>0?(w(),A("p",G1t,"Selected: "+he(e.selectedDiscussions.length),1)):V("",!0)]),c("div",V1t,[e.selectedDiscussions.length>0?(w(),A("div",z1t,[e.showConfirmation?V("",!0):(w(),A("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:n[21]||(n[21]=be(i=>e.showConfirmation=!0,["stop"]))},q1t)),e.showConfirmation?(w(),A("div",Y1t,[c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm removal",type:"button",onClick:n[22]||(n[22]=be((...i)=>e.deleteDiscussionMulti&&e.deleteDiscussionMulti(...i),["stop"]))},W1t),c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel removal",type:"button",onClick:n[23]||(n[23]=be(i=>e.showConfirmation=!1,["stop"]))},j1t)])):V("",!0)])):V("",!0),c("div",Q1t,[c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Export selected to a json file",type:"button",onClick:n[24]||(n[24]=be((...i)=>e.exportDiscussionsAsJson&&e.exportDiscussionsAsJson(...i),["stop"]))},Z1t),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Export selected to a martkdown file",type:"button",onClick:n[25]||(n[25]=be((...i)=>e.exportDiscussions&&e.exportDiscussions(...i),["stop"]))},ewt),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Export selected to a martkdown file",type:"button",onClick:n[26]||(n[26]=be((...i)=>e.exportDiscussionsAsMarkdown&&e.exportDiscussionsAsMarkdown(...i),["stop"]))},nwt),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Select All",type:"button",onClick:n[27]||(n[27]=be((...i)=>e.selectAllDiscussions&&e.selectAllDiscussions(...i),["stop"]))},swt)])])])):V("",!0)]),c("div",rwt,[c("div",{class:ze(["mx-4 flex flex-col flex-grow w-full",e.isDragOverDiscussion?"pointer-events-none":""])},[c("div",{id:"dis-list",class:ze([e.filterInProgress?"opacity-20 pointer-events-none":"","flex flex-col flex-grow w-full"])},[e.list.length>0?(w(),xt(os,{key:0,name:"list"},{default:We(()=>[(w(!0),A(Ye,null,lt(e.list,(i,s)=>(w(),xt(RE,{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),onOpenFolder:e.openFolder,onEditTitle:e.editTitle,onMakeTitle:e.makeTitle,onChecked:e.checkUncheckDiscussion},null,8,["id","title","selected","loading","isCheckbox","checkBoxValue","onSelect","onDelete","onOpenFolder","onEditTitle","onMakeTitle","onChecked"]))),128))]),_:1})):V("",!0),e.list.length<1?(w(),A("div",owt,lwt)):V("",!0),cwt],2)],2)])],32),c("div",{class:"absolute h-15 bottom-0 left-0 w-full bg-bg-light-panel dark:bg-bg-dark-tone light-text-panel py-4 cursor-pointer text-light-text-panel dark:text-dark-text-panel hover:text-secondary",onClick:n[29]||(n[29]=(...i)=>e.showDatabaseSelector&&e.showDatabaseSelector(...i))},[c("p",dwt,he(e.formatted_database_name.replace("_"," ")),1)])])):V("",!0)]),_:1}),e.isReady?(w(),A("div",uwt,[c("div",{id:"messages-list",class:ze(["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":""])},[c("div",pwt,[e.discussionArr.length>0?(w(),xt(os,{key:0,name:"list"},{default:We(()=>[(w(!0),A(Ye,null,lt(e.discussionArr,(i,s)=>(w(),xt(yO,{key:i.id,message:i,id:"msg-"+i.id,ref_for:!0,ref:"msg-"+i.id,host:e.host,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})):V("",!0),e.currentDiscussion.id?V("",!0):(w(),xt(SO,{key:1})),_wt]),hwt],2),e.currentDiscussion.id?(w(),A("div",fwt,[Te(vO,{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"])])):V("",!0)])):V("",!0),Te(wE,{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"]),G(c("div",mwt,[Te(nc,{ref:"progress",progress:e.progress_value,class:"w-full h-4"},null,8,["progress"]),c("p",gwt,he(e.loading_infos)+" ...",1)],512),[[Mt,e.progress_visibility]]),Te(gO,{"prompt-text":"Enter the url to the page to use as discussion support",onOk:e.addWebpage,ref:"web_url_input_box"},null,8,["onOk"]),Te(bO,{ref:"skills_lib"},null,512)],64))}}),ywt=bt(Ewt,[["__scopeId","data-v-b8e854ae"]]);/** +`+e.message,4,!1)}this.isDragOverChat=!1},async setFileListDiscussion(t){if(t.length>1){this.$store.state.toast.showToast("Failed to import discussions. Too many files",4,!1);return}const e=await this.parseJsonFile(t[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(){const e=(await Se.get("/get_versionID")).data.versionId;for(this.versionId!==e&&(this.$store.commit("updateVersionId",e),window.location.reload(!0)),this.$nextTick(()=>{He.replace()}),$e.on("disucssion_renamed",n=>{console.log("Received new title",n.discussion_id,n.title);const i=this.list.findIndex(r=>r.id==n.discussion_id),s=this.list[i];s.title=n.title}),$e.onclose=n=>{console.log("WebSocket connection closed:",n.code,n.reason),this.socketIODisconnected()},$e.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}),$e.onerror=n=>{console.log("WebSocket connection error:",n.code,n.reason),this.socketIODisconnected(),$e.disconnect()},$e.on("connected",this.socketIOConnected),$e.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("Ready"),this.setPageTitle(),await this.list_discussions(),this.loadLastUsedDiscussion(),$e.on("show_progress",this.show_progress),$e.on("hide_progress",this.hide_progress),$e.on("update_progress",this.update_progress),$e.on("notification",this.notify),$e.on("new_message",this.new_message),$e.on("update_message",this.streamMessageContent),$e.on("close_message",this.finalMsgEvent),$e.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(){$e.on("refresh_files",()=>{this.recoverFiles()}),this.$nextTick(()=>{He.replace()})},async activated(){for(;this.isReady===!1;)await new Promise(t=>setTimeout(t,100));await this.getPersonalityAvatars(),console.log("Avatars found:",this.personalityAvatars),this.isCreated&&Ge(()=>{const t=document.getElementById("messages-list");this.scrollBottom(t)}),this.$store.state.config.show_news_panel&&this.$store.state.news.show()},components:{Discussion:RE,Message:yO,ChatBox:vO,WelcomeComponent:SO,ChoiceDialog:wE,ProgressBar:nc,InputBox:gO,SkillsLibraryViewer:bO},watch:{progress_visibility_val(t){console.log("progress_visibility changed")},filterTitle(t){t==""&&(this.filterInProgress=!0,this.list=this.tempList,this.filterInProgress=!1)},isCheckbox(t){Ge(()=>{He.replace()}),t||(this.isSelectAll=!1)},socketConnected(t){console.log("Websocket connected (watch)",t)},showConfirmation(){Ge(()=>{He.replace()})},isSearch(){Ge(()=>{He.replace()})}},computed:{...Sk({versionId:t=>t.versionId}),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(t){this.$store.state.isModelOk=t}},isGenerating:{get(){return this.$store.state.isGenerating},set(t){this.$store.state.isGenerating=t}},formatted_database_name(){return this.$store.state.config.discussion_db_name},UseDiscussionHistory(){return this.$store.state.config.activate_skills_lib},isReady:{get(){return this.$store.state.ready}},databases(){return this.$store.state.databases},client_id(){return $e.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 Ge(()=>{He.replace()}),this.list.filter(t=>t.checkBoxValue==!0)}}},ywt=Object.assign(Ewt,{__name:"DiscussionsView",setup(t){return Ws(()=>{zO()}),Se.defaults.baseURL="/",(e,n)=>(w(),A(Ye,null,[Te(cs,{name:"fade-and-fly"},{default:We(()=>[e.isReady?V("",!0):(w(),A("div",LCt,[c("div",PCt,[c("div",UCt,[c("div",FCt,[BCt,c("div",GCt,[c("p",VCt,"LoLLMS "+he(e.version_info),1),zCt,HCt])]),qCt,YCt,c("div",$Ct,[Te(nc,{ref:"loading_progress",progress:e.loading_progress},null,8,["progress"]),c("p",WCt,he(e.loading_infos)+" ...",1)])])])]))]),_:1}),e.isReady?(w(),A("button",{key:0,onClick:n[0]||(n[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"},[G(c("div",null,jCt,512),[[Mt,e.panelCollapsed]]),G(c("div",null,XCt,512),[[Mt,!e.panelCollapsed]])])):V("",!0),Te(cs,{name:"slide-right"},{default:We(()=>[e.showPanel?(w(),A("div",ZCt,[c("div",{id:"leftPanel",class:"flex flex-col flex-grow overflow-y-scroll no-scrollbar",onDragover:n[28]||(n[28]=be(i=>e.setDropZoneDiscussion(),["stop","prevent"]))},[c("div",JCt,[c("div",e1t,[c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Create new discussion",type:"button",onClick:n[1]||(n[1]=i=>e.createNewDiscussion())},n1t),c("button",{class:ze(["text-2xl hover:text-secondary duration-75 active:scale-90",e.isCheckbox?"text-secondary":""]),title:"Edit discussion list",type:"button",onClick:n[2]||(n[2]=i=>e.isCheckbox=!e.isCheckbox)},s1t,2),c("button",r1t,[c("i",{"data-feather":"trash-2",onClick:n[3]||(n[3]=be(()=>{},["stop"]))})]),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Export database",type:"button",onClick:n[4]||(n[4]=be(i=>e.database_selectorDialogVisible=!0,["stop"]))},a1t),c("input",{type:"file",ref:"fileDialog",style:{display:"none"},onChange:n[5]||(n[5]=(...i)=>e.importDiscussions&&e.importDiscussions(...i))},null,544),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Import discussions",type:"button",onClick:n[6]||(n[6]=be(i=>e.$refs.fileDialog.click(),["stop"]))},c1t),c("input",{type:"file",ref:"bundleLoadingDialog",style:{display:"none"},onChange:n[7]||(n[7]=(...i)=>e.importDiscussionsBundle&&e.importDiscussionsBundle(...i))},null,544),e.showSaveConfirmation?V("",!0):(w(),A("button",{key:0,title:"Import discussion bundle",onClick:n[8]||(n[8]=be(i=>e.$refs.bundleLoadingDialog.click(),["stop"])),class:"text-2xl hover:text-secondary duration-75 active:scale-90"},u1t)),e.isOpen?(w(),A("div",p1t,[c("button",{onClick:n[9]||(n[9]=(...i)=>e.importDiscussions&&e.importDiscussions(...i))},"LOLLMS"),c("button",{onClick:n[10]||(n[10]=(...i)=>e.importChatGPT&&e.importChatGPT(...i))},"ChatGPT")])):V("",!0),c("button",{class:ze(["text-2xl hover:text-secondary duration-75 active:scale-90",e.isSearch?"text-secondary":""]),title:"Filter discussions",type:"button",onClick:n[11]||(n[11]=i=>e.isSearch=!e.isSearch)},h1t,2),e.showSaveConfirmation?(w(),A("div",f1t,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel",type:"button",onClick:n[12]||(n[12]=be(i=>e.showSaveConfirmation=!1,["stop"]))},g1t),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm save changes",type:"button",onClick:n[13]||(n[13]=be(i=>e.save_configuration(),["stop"]))},E1t)])):V("",!0),e.loading?V("",!0):(w(),A("button",{key:3,type:"button",onClick:n[14]||(n[14]=be((...i)=>e.addDiscussion2SkillsLibrary&&e.addDiscussion2SkillsLibrary(...i),["stop"])),title:"Add this discussion content to skills database",class:"w-6 hover:text-secondary duration-75 active:scale-90"},v1t)),!e.loading&&e.$store.state.config.activate_skills_lib?(w(),A("button",{key:4,type:"button",onClick:n[15]||(n[15]=be((...i)=>e.toggleSkillsLib&&e.toggleSkillsLib(...i),["stop"])),title:"Skills database is activated",class:"w-6 hover:text-secondary duration-75 active:scale-90"},T1t)):V("",!0),!e.loading&&!e.$store.state.config.activate_skills_lib?(w(),A("button",{key:5,type:"button",onClick:n[16]||(n[16]=be((...i)=>e.toggleSkillsLib&&e.toggleSkillsLib(...i),["stop"])),title:"Skills database is deactivated",class:"w-6 hover:text-secondary duration-75 active:scale-90"},C1t)):V("",!0),e.loading?V("",!0):(w(),A("button",{key:6,type:"button",onClick:n[17]||(n[17]=be((...i)=>e.showSkillsLib&&e.showSkillsLib(...i),["stop"])),title:"Show Skills database",class:"w-6 hover:text-secondary duration-75 active:scale-90"},R1t)),e.loading?(w(),A("div",A1t,O1t)):V("",!0)]),e.isSearch?(w(),A("div",I1t,[c("div",M1t,[c("div",D1t,[k1t,c("div",L1t,[c("div",{class:ze(["hover:text-secondary duration-75 active:scale-90",e.filterTitle?"visible":"invisible"]),title:"Clear",onClick:n[18]||(n[18]=i=>e.filterTitle="")},U1t,2)]),G(c("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":n[19]||(n[19]=i=>e.filterTitle=i),onInput:n[20]||(n[20]=i=>e.filterDiscussions())},null,544),[[we,e.filterTitle]])])])])):V("",!0),e.isCheckbox?(w(),A("hr",F1t)):V("",!0),e.isCheckbox?(w(),A("div",B1t,[c("div",G1t,[e.selectedDiscussions.length>0?(w(),A("p",V1t,"Selected: "+he(e.selectedDiscussions.length),1)):V("",!0)]),c("div",z1t,[e.selectedDiscussions.length>0?(w(),A("div",H1t,[e.showConfirmation?V("",!0):(w(),A("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:n[21]||(n[21]=be(i=>e.showConfirmation=!0,["stop"]))},Y1t)),e.showConfirmation?(w(),A("div",$1t,[c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm removal",type:"button",onClick:n[22]||(n[22]=be((...i)=>e.deleteDiscussionMulti&&e.deleteDiscussionMulti(...i),["stop"]))},K1t),c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel removal",type:"button",onClick:n[23]||(n[23]=be(i=>e.showConfirmation=!1,["stop"]))},Q1t)])):V("",!0)])):V("",!0),c("div",X1t,[c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Export selected to a json file",type:"button",onClick:n[24]||(n[24]=be((...i)=>e.exportDiscussionsAsJson&&e.exportDiscussionsAsJson(...i),["stop"]))},J1t),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Export selected to a martkdown file",type:"button",onClick:n[25]||(n[25]=be((...i)=>e.exportDiscussions&&e.exportDiscussions(...i),["stop"]))},twt),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Export selected to a martkdown file",type:"button",onClick:n[26]||(n[26]=be((...i)=>e.exportDiscussionsAsMarkdown&&e.exportDiscussionsAsMarkdown(...i),["stop"]))},iwt),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Select All",type:"button",onClick:n[27]||(n[27]=be((...i)=>e.selectAllDiscussions&&e.selectAllDiscussions(...i),["stop"]))},rwt)])])])):V("",!0)]),c("div",owt,[c("div",{class:ze(["mx-4 flex flex-col flex-grow w-full",e.isDragOverDiscussion?"pointer-events-none":""])},[c("div",{id:"dis-list",class:ze([e.filterInProgress?"opacity-20 pointer-events-none":"","flex flex-col flex-grow w-full"])},[e.list.length>0?(w(),xt(os,{key:0,name:"list"},{default:We(()=>[(w(!0),A(Ye,null,lt(e.list,(i,s)=>(w(),xt(RE,{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),onOpenFolder:e.openFolder,onEditTitle:e.editTitle,onMakeTitle:e.makeTitle,onChecked:e.checkUncheckDiscussion},null,8,["id","title","selected","loading","isCheckbox","checkBoxValue","onSelect","onDelete","onOpenFolder","onEditTitle","onMakeTitle","onChecked"]))),128))]),_:1})):V("",!0),e.list.length<1?(w(),A("div",awt,cwt)):V("",!0),dwt],2)],2)])],32),c("div",{class:"absolute h-15 bottom-0 left-0 w-full bg-bg-light-panel dark:bg-bg-dark-tone light-text-panel py-4 cursor-pointer text-light-text-panel dark:text-dark-text-panel hover:text-secondary",onClick:n[29]||(n[29]=(...i)=>e.showDatabaseSelector&&e.showDatabaseSelector(...i))},[c("p",uwt,he(e.formatted_database_name.replace("_"," ")),1)])])):V("",!0)]),_:1}),e.isReady?(w(),A("div",pwt,[c("div",{id:"messages-list",class:ze(["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":""])},[c("div",_wt,[e.discussionArr.length>0?(w(),xt(os,{key:0,name:"list"},{default:We(()=>[(w(!0),A(Ye,null,lt(e.discussionArr,(i,s)=>(w(),xt(yO,{key:i.id,message:i,id:"msg-"+i.id,ref_for:!0,ref:"msg-"+i.id,host:e.host,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})):V("",!0),e.currentDiscussion.id?V("",!0):(w(),xt(SO,{key:1})),hwt]),fwt],2),e.currentDiscussion.id?(w(),A("div",mwt,[Te(vO,{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"])])):V("",!0)])):V("",!0),Te(wE,{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"]),G(c("div",gwt,[Te(nc,{ref:"progress",progress:e.progress_value,class:"w-full h-4"},null,8,["progress"]),c("p",bwt,he(e.loading_infos)+" ...",1)],512),[[Mt,e.progress_visibility]]),Te(gO,{"prompt-text":"Enter the url to the page to use as discussion support",onOk:e.addWebpage,ref:"web_url_input_box"},null,8,["onOk"]),Te(bO,{ref:"skills_lib"},null,512)],64))}}),vwt=bt(ywt,[["__scopeId","data-v-b8e854ae"]]);/** * @license * Copyright 2010-2023 Three.js Authors * SPDX-License-Identifier: MIT - */const KE="159",vwt=0,zC=1,Swt=2,HO=1,Twt=2,Ms=3,Ys=0,Zn=1,es=2,Sr=0,aa=1,HC=2,qC=3,YC=4,xwt=5,Xr=100,Cwt=101,wwt=102,$C=103,WC=104,Rwt=200,Awt=201,Nwt=202,Owt=203,sb=204,rb=205,Iwt=206,Mwt=207,Dwt=208,kwt=209,Lwt=210,Pwt=211,Uwt=212,Fwt=213,Bwt=214,Gwt=0,Vwt=1,zwt=2,_u=3,Hwt=4,qwt=5,Ywt=6,$wt=7,jE=0,Wwt=1,Kwt=2,Tr=0,jwt=1,Qwt=2,Xwt=3,Zwt=4,Jwt=5,KC="attached",eRt="detached",qO=300,Ta=301,xa=302,ob=303,ab=304,lp=306,Ca=1e3,mi=1001,hu=1002,yn=1003,lb=1004,Bd=1005,jn=1006,YO=1007,fo=1008,xr=1009,tRt=1010,nRt=1011,QE=1012,$O=1013,br=1014,Ps=1015,rc=1016,WO=1017,KO=1018,oo=1020,iRt=1021,gi=1023,sRt=1024,rRt=1025,ao=1026,wa=1027,oRt=1028,jO=1029,aRt=1030,QO=1031,XO=1033,Pm=33776,Um=33777,Fm=33778,Bm=33779,jC=35840,QC=35841,XC=35842,ZC=35843,ZO=36196,JC=37492,e1=37496,t1=37808,n1=37809,i1=37810,s1=37811,r1=37812,o1=37813,a1=37814,l1=37815,c1=37816,d1=37817,u1=37818,p1=37819,_1=37820,h1=37821,Gm=36492,f1=36494,m1=36495,lRt=36283,g1=36284,b1=36285,E1=36286,oc=2300,Ra=2301,Vm=2302,y1=2400,v1=2401,S1=2402,cRt=2500,dRt=0,JO=1,cb=2,eI=3e3,lo=3001,uRt=3200,pRt=3201,XE=0,_Rt=1,bi="",on="srgb",On="srgb-linear",ZE="display-p3",cp="display-p3-linear",fu="linear",Zt="srgb",mu="rec709",gu="p3",Oo=7680,T1=519,hRt=512,fRt=513,mRt=514,tI=515,gRt=516,bRt=517,ERt=518,yRt=519,db=35044,x1="300 es",ub=1035,Us=2e3,bu=2001;class Ka{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(n)===-1&&i[e].push(n)}hasEventListener(e,n){if(this._listeners===void 0)return!1;const i=this._listeners;return i[e]!==void 0&&i[e].indexOf(n)!==-1}removeEventListener(e,n){if(this._listeners===void 0)return;const s=this._listeners[e];if(s!==void 0){const r=s.indexOf(n);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]+Mn[t>>16&255]+Mn[t>>24&255]+"-"+Mn[e&255]+Mn[e>>8&255]+"-"+Mn[e>>16&15|64]+Mn[e>>24&255]+"-"+Mn[n&63|128]+Mn[n>>8&255]+"-"+Mn[n>>16&255]+Mn[n>>24&255]+Mn[i&255]+Mn[i>>8&255]+Mn[i>>16&255]+Mn[i>>24&255]).toLowerCase()}function Ln(t,e,n){return Math.max(e,Math.min(n,t))}function JE(t,e){return(t%e+e)%e}function vRt(t,e,n,i,s){return i+(t-e)*(s-i)/(n-e)}function SRt(t,e,n){return t!==e?(n-t)/(e-t):0}function Fl(t,e,n){return(1-n)*t+n*e}function TRt(t,e,n,i){return Fl(t,e,1-Math.exp(-n*i))}function xRt(t,e=1){return e-Math.abs(JE(t,e*2)-e)}function CRt(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function wRt(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(t*6-15)+10))}function RRt(t,e){return t+Math.floor(Math.random()*(e-t+1))}function ARt(t,e){return t+Math.random()*(e-t)}function NRt(t){return t*(.5-Math.random())}function ORt(t){t!==void 0&&(C1=t);let e=C1+=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 IRt(t){return t*Ul}function MRt(t){return t*Aa}function pb(t){return(t&t-1)===0&&t!==0}function DRt(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function Eu(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function kRt(t,e,n,i,s){const r=Math.cos,o=Math.sin,a=r(n/2),l=o(n/2),u=r((e+i)/2),d=o((e+i)/2),h=r((e-i)/2),f=o((e-i)/2),_=r((i-e)/2),m=o((i-e)/2);switch(s){case"XYX":t.set(a*d,l*h,l*f,a*u);break;case"YZY":t.set(l*f,a*d,l*h,a*u);break;case"ZXZ":t.set(l*h,l*f,a*d,a*u);break;case"XZX":t.set(a*d,l*m,l*_,a*u);break;case"YXY":t.set(l*_,a*d,l*m,a*u);break;case"ZYZ":t.set(l*m,l*_,a*d,a*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}}function ts(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Ht(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}const LRt={DEG2RAD:Ul,RAD2DEG:Aa,generateUUID:zi,clamp:Ln,euclideanModulo:JE,mapLinear:vRt,inverseLerp:SRt,lerp:Fl,damp:TRt,pingpong:xRt,smoothstep:CRt,smootherstep:wRt,randInt:RRt,randFloat:ARt,randFloatSpread:NRt,seededRandom:ORt,degToRad:IRt,radToDeg:MRt,isPowerOfTwo:pb,ceilPowerOfTwo:DRt,floorPowerOfTwo:Eu,setQuaternionFromProperEuler:kRt,normalize:Ht,denormalize:ts};class It{constructor(e=0,n=0){It.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,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,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;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,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,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,n){return this.x=e.x-n.x,this.y=e.y-n.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 n=this.x,i=this.y,s=e.elements;return this.x=s[0]*n+s[3]*i+s[6],this.y=s[1]*n+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,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(n,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 n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(e)/n;return Math.acos(Ln(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,i=this.y-e.y;return n*n+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,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const i=Math.cos(n),s=Math.sin(n),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 wt{constructor(e,n,i,s,r,o,a,l,u){wt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,i,s,r,o,a,l,u)}set(e,n,i,s,r,o,a,l,u){const d=this.elements;return d[0]=e,d[1]=s,d[2]=a,d[3]=n,d[4]=r,d[5]=l,d[6]=i,d[7]=o,d[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,i=e.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],this}extractBasis(e,n,i){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const i=e.elements,s=n.elements,r=this.elements,o=i[0],a=i[3],l=i[6],u=i[1],d=i[4],h=i[7],f=i[2],_=i[5],m=i[8],E=s[0],b=s[3],g=s[6],y=s[1],v=s[4],S=s[7],C=s[2],T=s[5],O=s[8];return r[0]=o*E+a*y+l*C,r[3]=o*b+a*v+l*T,r[6]=o*g+a*S+l*O,r[1]=u*E+d*y+h*C,r[4]=u*b+d*v+h*T,r[7]=u*g+d*S+h*O,r[2]=f*E+_*y+m*C,r[5]=f*b+_*v+m*T,r[8]=f*g+_*S+m*O,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],u=e[7],d=e[8];return n*o*d-n*a*u-i*r*d+i*a*l+s*r*u-s*o*l}invert(){const e=this.elements,n=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],u=e[7],d=e[8],h=d*o-a*u,f=a*l-d*r,_=u*r-o*l,m=n*h+i*f+s*_;if(m===0)return this.set(0,0,0,0,0,0,0,0,0);const E=1/m;return e[0]=h*E,e[1]=(s*u-d*i)*E,e[2]=(a*i-s*o)*E,e[3]=f*E,e[4]=(d*n-s*l)*E,e[5]=(s*r-a*n)*E,e[6]=_*E,e[7]=(i*l-u*n)*E,e[8]=(o*n-i*r)*E,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,i,s,r,o,a){const l=Math.cos(r),u=Math.sin(r);return this.set(i*l,i*u,-i*(l*o+u*a)+o+e,-s*u,s*l,-s*(-u*o+l*a)+a+n,0,0,1),this}scale(e,n){return this.premultiply(zm.makeScale(e,n)),this}rotate(e){return this.premultiply(zm.makeRotation(-e)),this}translate(e,n){return this.premultiply(zm.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,i,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){const n=this.elements,i=e.elements;for(let s=0;s<9;s++)if(n[s]!==i[s])return!1;return!0}fromArray(e,n=0){for(let i=0;i<9;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){const i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const zm=new wt;function nI(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function ac(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function PRt(){const t=ac("canvas");return t.style.display="block",t}const w1={};function Bl(t){t in w1||(w1[t]=!0,console.warn(t))}const R1=new wt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),A1=new wt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Qc={[On]:{transfer:fu,primaries:mu,toReference:t=>t,fromReference:t=>t},[on]:{transfer:Zt,primaries:mu,toReference:t=>t.convertSRGBToLinear(),fromReference:t=>t.convertLinearToSRGB()},[cp]:{transfer:fu,primaries:gu,toReference:t=>t.applyMatrix3(A1),fromReference:t=>t.applyMatrix3(R1)},[ZE]:{transfer:Zt,primaries:gu,toReference:t=>t.convertSRGBToLinear().applyMatrix3(A1),fromReference:t=>t.applyMatrix3(R1).convertLinearToSRGB()}},URt=new Set([On,cp]),Gt={enabled:!0,_workingColorSpace:On,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(t){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!t},get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(t){if(!URt.has(t))throw new Error(`Unsupported working color space, "${t}".`);this._workingColorSpace=t},convert:function(t,e,n){if(this.enabled===!1||e===n||!e||!n)return t;const i=Qc[e].toReference,s=Qc[n].fromReference;return s(i(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this._workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this._workingColorSpace)},getPrimaries:function(t){return Qc[t].primaries},getTransfer:function(t){return t===bi?fu:Qc[t].transfer}};function la(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function Hm(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let Io;class iI{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{Io===void 0&&(Io=ac("canvas")),Io.width=e.width,Io.height=e.height;const i=Io.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),n=Io}return n.width>2048||n.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),n.toDataURL("image/jpeg",.6)):n.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 n=ac("canvas");n.width=e.width,n.height=e.height;const i=n.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),n||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==qO)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Ca:e.x=e.x-Math.floor(e.x);break;case mi:e.x=e.x<0?0:1;break;case hu: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 Ca:e.y=e.y-Math.floor(e.y);break;case mi:e.y=e.y<0?0:1;break;case hu: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 Bl("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===on?lo:eI}set encoding(e){Bl("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===lo?on:bi}}Nn.DEFAULT_IMAGE=null;Nn.DEFAULT_MAPPING=qO;Nn.DEFAULT_ANISOTROPY=1;class Wt{constructor(e=0,n=0,i=0,s=1){Wt.prototype.isVector4=!0,this.x=e,this.y=n,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,n,i,s){return this.x=e,this.y=n,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,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;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,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,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,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.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 n=this.x,i=this.y,s=this.z,r=this.w,o=e.elements;return this.x=o[0]*n+o[4]*i+o[8]*s+o[12]*r,this.y=o[1]*n+o[5]*i+o[9]*s+o[13]*r,this.z=o[2]*n+o[6]*i+o[10]*s+o[14]*r,this.w=o[3]*n+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 n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,i,s,r;const l=e.elements,u=l[0],d=l[4],h=l[8],f=l[1],_=l[5],m=l[9],E=l[2],b=l[6],g=l[10];if(Math.abs(d-f)<.01&&Math.abs(h-E)<.01&&Math.abs(m-b)<.01){if(Math.abs(d+f)<.1&&Math.abs(h+E)<.1&&Math.abs(m+b)<.1&&Math.abs(u+_+g-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const v=(u+1)/2,S=(_+1)/2,C=(g+1)/2,T=(d+f)/4,O=(h+E)/4,k=(m+b)/4;return v>S&&v>C?v<.01?(i=0,s=.707106781,r=.707106781):(i=Math.sqrt(v),s=T/i,r=O/i):S>C?S<.01?(i=.707106781,s=0,r=.707106781):(s=Math.sqrt(S),i=T/s,r=k/s):C<.01?(i=.707106781,s=.707106781,r=0):(r=Math.sqrt(C),i=O/r,s=k/r),this.set(i,s,r,n),this}let y=Math.sqrt((b-m)*(b-m)+(h-E)*(h-E)+(f-d)*(f-d));return Math.abs(y)<.001&&(y=1),this.x=(b-m)/y,this.y=(h-E)/y,this.z=(f-d)/y,this.w=Math.acos((u+_+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,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this.w=Math.max(e.w,Math.min(n.w,this.w)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this.w=Math.max(e,Math.min(n,this.w)),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(n,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,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this.w=e.w+(n.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,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),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 GRt extends Ka{constructor(e=1,n=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=1,this.scissor=new Wt(0,0,e,n),this.scissorTest=!1,this.viewport=new Wt(0,0,e,n);const s={width:e,height:n,depth:1};i.encoding!==void 0&&(Bl("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),i.colorSpace=i.encoding===lo?on:bi),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:jn,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},i),this.texture=new Nn(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,n,i=1){(this.width!==e||this.height!==n||this.depth!==i)&&(this.width=e,this.height=n,this.depth=i,this.texture.image.width=e,this.texture.image.height=n,this.texture.image.depth=i,this.dispose()),this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}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 n=Object.assign({},e.texture.image);return this.texture.source=new sI(n),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 mo extends GRt{constructor(e=1,n=1,i={}){super(e,n,i),this.isWebGLRenderTarget=!0}}class rI extends Nn{constructor(e=null,n=1,i=1,s=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:n,height:i,depth:s},this.magFilter=yn,this.minFilter=yn,this.wrapR=mi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class VRt extends Nn{constructor(e=null,n=1,i=1,s=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:n,height:i,depth:s},this.magFilter=yn,this.minFilter=yn,this.wrapR=mi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Ir{constructor(e=0,n=0,i=0,s=1){this.isQuaternion=!0,this._x=e,this._y=n,this._z=i,this._w=s}static slerpFlat(e,n,i,s,r,o,a){let l=i[s+0],u=i[s+1],d=i[s+2],h=i[s+3];const f=r[o+0],_=r[o+1],m=r[o+2],E=r[o+3];if(a===0){e[n+0]=l,e[n+1]=u,e[n+2]=d,e[n+3]=h;return}if(a===1){e[n+0]=f,e[n+1]=_,e[n+2]=m,e[n+3]=E;return}if(h!==E||l!==f||u!==_||d!==m){let b=1-a;const g=l*f+u*_+d*m+h*E,y=g>=0?1:-1,v=1-g*g;if(v>Number.EPSILON){const C=Math.sqrt(v),T=Math.atan2(C,g*y);b=Math.sin(b*T)/C,a=Math.sin(a*T)/C}const S=a*y;if(l=l*b+f*S,u=u*b+_*S,d=d*b+m*S,h=h*b+E*S,b===1-a){const C=1/Math.sqrt(l*l+u*u+d*d+h*h);l*=C,u*=C,d*=C,h*=C}}e[n]=l,e[n+1]=u,e[n+2]=d,e[n+3]=h}static multiplyQuaternionsFlat(e,n,i,s,r,o){const a=i[s],l=i[s+1],u=i[s+2],d=i[s+3],h=r[o],f=r[o+1],_=r[o+2],m=r[o+3];return e[n]=a*m+d*h+l*_-u*f,e[n+1]=l*m+d*f+u*h-a*_,e[n+2]=u*m+d*_+a*f-l*h,e[n+3]=d*m-a*h-l*f-u*_,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,n,i,s){return this._x=e,this._y=n,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,n){const i=e._x,s=e._y,r=e._z,o=e._order,a=Math.cos,l=Math.sin,u=a(i/2),d=a(s/2),h=a(r/2),f=l(i/2),_=l(s/2),m=l(r/2);switch(o){case"XYZ":this._x=f*d*h+u*_*m,this._y=u*_*h-f*d*m,this._z=u*d*m+f*_*h,this._w=u*d*h-f*_*m;break;case"YXZ":this._x=f*d*h+u*_*m,this._y=u*_*h-f*d*m,this._z=u*d*m-f*_*h,this._w=u*d*h+f*_*m;break;case"ZXY":this._x=f*d*h-u*_*m,this._y=u*_*h+f*d*m,this._z=u*d*m+f*_*h,this._w=u*d*h-f*_*m;break;case"ZYX":this._x=f*d*h-u*_*m,this._y=u*_*h+f*d*m,this._z=u*d*m-f*_*h,this._w=u*d*h+f*_*m;break;case"YZX":this._x=f*d*h+u*_*m,this._y=u*_*h+f*d*m,this._z=u*d*m-f*_*h,this._w=u*d*h-f*_*m;break;case"XZY":this._x=f*d*h-u*_*m,this._y=u*_*h-f*d*m,this._z=u*d*m+f*_*h,this._w=u*d*h+f*_*m;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return n!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const i=n/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 n=e.elements,i=n[0],s=n[4],r=n[8],o=n[1],a=n[5],l=n[9],u=n[2],d=n[6],h=n[10],f=i+a+h;if(f>0){const _=.5/Math.sqrt(f+1);this._w=.25/_,this._x=(d-l)*_,this._y=(r-u)*_,this._z=(o-s)*_}else if(i>a&&i>h){const _=2*Math.sqrt(1+i-a-h);this._w=(d-l)/_,this._x=.25*_,this._y=(s+o)/_,this._z=(r+u)/_}else if(a>h){const _=2*Math.sqrt(1+a-i-h);this._w=(r-u)/_,this._x=(s+o)/_,this._y=.25*_,this._z=(l+d)/_}else{const _=2*Math.sqrt(1+h-i-a);this._w=(o-s)/_,this._x=(r+u)/_,this._y=(l+d)/_,this._z=.25*_}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let i=e.dot(n)+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*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Ln(this.dot(e),-1,1)))}rotateTowards(e,n){const i=this.angleTo(e);if(i===0)return this;const s=Math.min(1,n/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,n){const i=e._x,s=e._y,r=e._z,o=e._w,a=n._x,l=n._y,u=n._z,d=n._w;return this._x=i*d+o*a+s*u-r*l,this._y=s*d+o*l+r*a-i*u,this._z=r*d+o*u+i*l-s*a,this._w=o*d-i*a-s*l-r*u,this._onChangeCallback(),this}slerp(e,n){if(n===0)return this;if(n===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 _=1-n;return this._w=_*o+n*this._w,this._x=_*i+n*this._x,this._y=_*s+n*this._y,this._z=_*r+n*this._z,this.normalize(),this._onChangeCallback(),this}const u=Math.sqrt(l),d=Math.atan2(u,a),h=Math.sin((1-n)*d)/u,f=Math.sin(n*d)/u;return this._w=o*h+this._w*f,this._x=i*h+this._x*f,this._y=s*h+this._y*f,this._z=r*h+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,n,i){return this.copy(e).slerp(n,i)}random(){const e=Math.random(),n=Math.sqrt(1-e),i=Math.sqrt(e),s=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(n*Math.cos(s),i*Math.sin(r),i*Math.cos(r),n*Math.sin(s))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),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 _e{constructor(e=0,n=0,i=0){_e.prototype.isVector3=!0,this.x=e,this.y=n,this.z=i}set(e,n,i){return i===void 0&&(i=this.z),this.x=e,this.y=n,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,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;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,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,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,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.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,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(N1.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(N1.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,i=this.y,s=this.z,r=e.elements;return this.x=r[0]*n+r[3]*i+r[6]*s,this.y=r[1]*n+r[4]*i+r[7]*s,this.z=r[2]*n+r[5]*i+r[8]*s,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,i=this.y,s=this.z,r=e.elements,o=1/(r[3]*n+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*n+r[4]*i+r[8]*s+r[12])*o,this.y=(r[1]*n+r[5]*i+r[9]*s+r[13])*o,this.z=(r[2]*n+r[6]*i+r[10]*s+r[14])*o,this}applyQuaternion(e){const n=this.x,i=this.y,s=this.z,r=e.x,o=e.y,a=e.z,l=e.w,u=2*(o*s-a*i),d=2*(a*n-r*s),h=2*(r*i-o*n);return this.x=n+l*u+o*h-a*d,this.y=i+l*d+a*u-r*h,this.z=s+l*h+r*d-o*u,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,i=this.y,s=this.z,r=e.elements;return this.x=r[0]*n+r[4]*i+r[8]*s,this.y=r[1]*n+r[5]*i+r[9]*s,this.z=r[2]*n+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,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(n,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,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const i=e.x,s=e.y,r=e.z,o=n.x,a=n.y,l=n.z;return this.x=s*l-r*a,this.y=r*o-i*l,this.z=i*a-s*o,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const i=e.dot(this)/n;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return Ym.copy(this).projectOnVector(e),this.sub(Ym)}reflect(e){return this.sub(Ym.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(e)/n;return Math.acos(Ln(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,i=this.y-e.y,s=this.z-e.z;return n*n+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,n,i){const s=Math.sin(n)*e;return this.x=s*Math.sin(i),this.y=Math.cos(n)*e,this.z=s*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,i){return this.x=e*Math.sin(n),this.y=i,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),s=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=i,this.z=s,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*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,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,n=Math.random()*Math.PI*2,i=Math.sqrt(1-e**2);return this.x=i*Math.cos(n),this.y=i*Math.sin(n),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Ym=new _e,N1=new Ir;class js{constructor(e=new _e(1/0,1/0,1/0),n=new _e(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromArray(e){this.makeEmpty();for(let n=0,i=e.length;nthis.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,n){return n.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,Ii),Ii.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,i;return e.normal.x>0?(n=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),n<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(fl),Zc.subVectors(this.max,fl),Mo.subVectors(e.a,fl),Do.subVectors(e.b,fl),ko.subVectors(e.c,fl),tr.subVectors(Do,Mo),nr.subVectors(ko,Do),Fr.subVectors(Mo,ko);let n=[0,-tr.z,tr.y,0,-nr.z,nr.y,0,-Fr.z,Fr.y,tr.z,0,-tr.x,nr.z,0,-nr.x,Fr.z,0,-Fr.x,-tr.y,tr.x,0,-nr.y,nr.x,0,-Fr.y,Fr.x,0];return!$m(n,Mo,Do,ko,Zc)||(n=[1,0,0,0,1,0,0,0,1],!$m(n,Mo,Do,ko,Zc))?!1:(Jc.crossVectors(tr,nr),n=[Jc.x,Jc.y,Jc.z],$m(n,Mo,Do,ko,Zc))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Ii).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Ii).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:(Cs[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Cs[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Cs[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Cs[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Cs[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Cs[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Cs[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Cs[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Cs),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 Cs=[new _e,new _e,new _e,new _e,new _e,new _e,new _e,new _e],Ii=new _e,Xc=new js,Mo=new _e,Do=new _e,ko=new _e,tr=new _e,nr=new _e,Fr=new _e,fl=new _e,Zc=new _e,Jc=new _e,Br=new _e;function $m(t,e,n,i,s){for(let r=0,o=t.length-3;r<=o;r+=3){Br.fromArray(t,r);const a=s.x*Math.abs(Br.x)+s.y*Math.abs(Br.y)+s.z*Math.abs(Br.z),l=e.dot(Br),u=n.dot(Br),d=i.dot(Br);if(Math.max(-Math.max(l,u,d),Math.min(l,u,d))>a)return!1}return!0}const zRt=new js,ml=new _e,Wm=new _e;class fs{constructor(e=new _e,n=-1){this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const i=this.center;n!==void 0?i.copy(n):zRt.setFromPoints(e).getCenter(i);let s=0;for(let r=0,o=e.length;rthis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}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;ml.subVectors(e,this.center);const n=ml.lengthSq();if(n>this.radius*this.radius){const i=Math.sqrt(n),s=(i-this.radius)*.5;this.center.addScaledVector(ml,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):(Wm.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(ml.copy(e.center).add(Wm)),this.expandByPoint(ml.copy(e.center).sub(Wm))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const ws=new _e,Km=new _e,ed=new _e,ir=new _e,jm=new _e,td=new _e,Qm=new _e;class dp{constructor(e=new _e,n=new _e(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.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,ws)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const i=n.dot(this.direction);return i<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=ws.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(ws.copy(this.origin).addScaledVector(this.direction,n),ws.distanceToSquared(e))}distanceSqToSegment(e,n,i,s){Km.copy(e).add(n).multiplyScalar(.5),ed.copy(n).sub(e).normalize(),ir.copy(this.origin).sub(Km);const r=e.distanceTo(n)*.5,o=-this.direction.dot(ed),a=ir.dot(this.direction),l=-ir.dot(ed),u=ir.lengthSq(),d=Math.abs(1-o*o);let h,f,_,m;if(d>0)if(h=o*l-a,f=o*a-l,m=r*d,h>=0)if(f>=-m)if(f<=m){const E=1/d;h*=E,f*=E,_=h*(h+o*f+2*a)+f*(o*h+f+2*l)+u}else f=r,h=Math.max(0,-(o*f+a)),_=-h*h+f*(f+2*l)+u;else f=-r,h=Math.max(0,-(o*f+a)),_=-h*h+f*(f+2*l)+u;else f<=-m?(h=Math.max(0,-(-o*r+a)),f=h>0?-r:Math.min(Math.max(-r,-l),r),_=-h*h+f*(f+2*l)+u):f<=m?(h=0,f=Math.min(Math.max(-r,-l),r),_=f*(f+2*l)+u):(h=Math.max(0,-(o*r+a)),f=h>0?r:Math.min(Math.max(-r,-l),r),_=-h*h+f*(f+2*l)+u);else f=o>0?-r:r,h=Math.max(0,-(o*f+a)),_=-h*h+f*(f+2*l)+u;return i&&i.copy(this.origin).addScaledVector(this.direction,h),s&&s.copy(Km).addScaledVector(ed,f),_}intersectSphere(e,n){ws.subVectors(e.center,this.origin);const i=ws.dot(this.direction),s=ws.dot(ws)-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,n):this.at(a,n)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/n;return i>=0?i:null}intersectPlane(e,n){const i=this.distanceToPlane(e);return i===null?null:this.at(i,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let i,s,r,o,a,l;const u=1/this.direction.x,d=1/this.direction.y,h=1/this.direction.z,f=this.origin;return u>=0?(i=(e.min.x-f.x)*u,s=(e.max.x-f.x)*u):(i=(e.max.x-f.x)*u,s=(e.min.x-f.x)*u),d>=0?(r=(e.min.y-f.y)*d,o=(e.max.y-f.y)*d):(r=(e.max.y-f.y)*d,o=(e.min.y-f.y)*d),i>o||r>s||((r>i||isNaN(i))&&(i=r),(o=0?(a=(e.min.z-f.z)*h,l=(e.max.z-f.z)*h):(a=(e.max.z-f.z)*h,l=(e.min.z-f.z)*h),i>l||a>s)||((a>i||i!==i)&&(i=a),(l=0?i:s,n)}intersectsBox(e){return this.intersectBox(e,ws)!==null}intersectTriangle(e,n,i,s,r){jm.subVectors(n,e),td.subVectors(i,e),Qm.crossVectors(jm,td);let o=this.direction.dot(Qm),a;if(o>0){if(s)return null;a=1}else if(o<0)a=-1,o=-o;else return null;ir.subVectors(this.origin,e);const l=a*this.direction.dot(td.crossVectors(ir,td));if(l<0)return null;const u=a*this.direction.dot(jm.cross(ir));if(u<0||l+u>o)return null;const d=-a*ir.dot(Qm);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 Rt{constructor(e,n,i,s,r,o,a,l,u,d,h,f,_,m,E,b){Rt.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,n,i,s,r,o,a,l,u,d,h,f,_,m,E,b)}set(e,n,i,s,r,o,a,l,u,d,h,f,_,m,E,b){const g=this.elements;return g[0]=e,g[4]=n,g[8]=i,g[12]=s,g[1]=r,g[5]=o,g[9]=a,g[13]=l,g[2]=u,g[6]=d,g[10]=h,g[14]=f,g[3]=_,g[7]=m,g[11]=E,g[15]=b,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 Rt().fromArray(this.elements)}copy(e){const n=this.elements,i=e.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],n[9]=i[9],n[10]=i[10],n[11]=i[11],n[12]=i[12],n[13]=i[13],n[14]=i[14],n[15]=i[15],this}copyPosition(e){const n=this.elements,i=e.elements;return n[12]=i[12],n[13]=i[13],n[14]=i[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,i){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,n,i){return this.set(e.x,n.x,i.x,0,e.y,n.y,i.y,0,e.z,n.z,i.z,0,0,0,0,1),this}extractRotation(e){const n=this.elements,i=e.elements,s=1/Lo.setFromMatrixColumn(e,0).length(),r=1/Lo.setFromMatrixColumn(e,1).length(),o=1/Lo.setFromMatrixColumn(e,2).length();return n[0]=i[0]*s,n[1]=i[1]*s,n[2]=i[2]*s,n[3]=0,n[4]=i[4]*r,n[5]=i[5]*r,n[6]=i[6]*r,n[7]=0,n[8]=i[8]*o,n[9]=i[9]*o,n[10]=i[10]*o,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,i=e.x,s=e.y,r=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(s),u=Math.sin(s),d=Math.cos(r),h=Math.sin(r);if(e.order==="XYZ"){const f=o*d,_=o*h,m=a*d,E=a*h;n[0]=l*d,n[4]=-l*h,n[8]=u,n[1]=_+m*u,n[5]=f-E*u,n[9]=-a*l,n[2]=E-f*u,n[6]=m+_*u,n[10]=o*l}else if(e.order==="YXZ"){const f=l*d,_=l*h,m=u*d,E=u*h;n[0]=f+E*a,n[4]=m*a-_,n[8]=o*u,n[1]=o*h,n[5]=o*d,n[9]=-a,n[2]=_*a-m,n[6]=E+f*a,n[10]=o*l}else if(e.order==="ZXY"){const f=l*d,_=l*h,m=u*d,E=u*h;n[0]=f-E*a,n[4]=-o*h,n[8]=m+_*a,n[1]=_+m*a,n[5]=o*d,n[9]=E-f*a,n[2]=-o*u,n[6]=a,n[10]=o*l}else if(e.order==="ZYX"){const f=o*d,_=o*h,m=a*d,E=a*h;n[0]=l*d,n[4]=m*u-_,n[8]=f*u+E,n[1]=l*h,n[5]=E*u+f,n[9]=_*u-m,n[2]=-u,n[6]=a*l,n[10]=o*l}else if(e.order==="YZX"){const f=o*l,_=o*u,m=a*l,E=a*u;n[0]=l*d,n[4]=E-f*h,n[8]=m*h+_,n[1]=h,n[5]=o*d,n[9]=-a*d,n[2]=-u*d,n[6]=_*h+m,n[10]=f-E*h}else if(e.order==="XZY"){const f=o*l,_=o*u,m=a*l,E=a*u;n[0]=l*d,n[4]=-h,n[8]=u*d,n[1]=f*h+E,n[5]=o*d,n[9]=_*h-m,n[2]=m*h-_,n[6]=a*d,n[10]=E*h+f}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(HRt,e,qRt)}lookAt(e,n,i){const s=this.elements;return ii.subVectors(e,n),ii.lengthSq()===0&&(ii.z=1),ii.normalize(),sr.crossVectors(i,ii),sr.lengthSq()===0&&(Math.abs(i.z)===1?ii.x+=1e-4:ii.z+=1e-4,ii.normalize(),sr.crossVectors(i,ii)),sr.normalize(),nd.crossVectors(ii,sr),s[0]=sr.x,s[4]=nd.x,s[8]=ii.x,s[1]=sr.y,s[5]=nd.y,s[9]=ii.y,s[2]=sr.z,s[6]=nd.z,s[10]=ii.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const i=e.elements,s=n.elements,r=this.elements,o=i[0],a=i[4],l=i[8],u=i[12],d=i[1],h=i[5],f=i[9],_=i[13],m=i[2],E=i[6],b=i[10],g=i[14],y=i[3],v=i[7],S=i[11],C=i[15],T=s[0],O=s[4],k=s[8],x=s[12],I=s[1],F=s[5],B=s[9],ne=s[13],L=s[2],$=s[6],H=s[10],U=s[14],Q=s[3],J=s[7],j=s[11],ae=s[15];return r[0]=o*T+a*I+l*L+u*Q,r[4]=o*O+a*F+l*$+u*J,r[8]=o*k+a*B+l*H+u*j,r[12]=o*x+a*ne+l*U+u*ae,r[1]=d*T+h*I+f*L+_*Q,r[5]=d*O+h*F+f*$+_*J,r[9]=d*k+h*B+f*H+_*j,r[13]=d*x+h*ne+f*U+_*ae,r[2]=m*T+E*I+b*L+g*Q,r[6]=m*O+E*F+b*$+g*J,r[10]=m*k+E*B+b*H+g*j,r[14]=m*x+E*ne+b*U+g*ae,r[3]=y*T+v*I+S*L+C*Q,r[7]=y*O+v*F+S*$+C*J,r[11]=y*k+v*B+S*H+C*j,r[15]=y*x+v*ne+S*U+C*ae,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],i=e[4],s=e[8],r=e[12],o=e[1],a=e[5],l=e[9],u=e[13],d=e[2],h=e[6],f=e[10],_=e[14],m=e[3],E=e[7],b=e[11],g=e[15];return m*(+r*l*h-s*u*h-r*a*f+i*u*f+s*a*_-i*l*_)+E*(+n*l*_-n*u*f+r*o*f-s*o*_+s*u*d-r*l*d)+b*(+n*u*h-n*a*_-r*o*h+i*o*_+r*a*d-i*u*d)+g*(-s*a*d-n*l*h+n*a*f+s*o*h-i*o*f+i*l*d)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,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]=n,s[14]=i),this}invert(){const e=this.elements,n=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],u=e[7],d=e[8],h=e[9],f=e[10],_=e[11],m=e[12],E=e[13],b=e[14],g=e[15],y=h*b*u-E*f*u+E*l*_-a*b*_-h*l*g+a*f*g,v=m*f*u-d*b*u-m*l*_+o*b*_+d*l*g-o*f*g,S=d*E*u-m*h*u+m*a*_-o*E*_-d*a*g+o*h*g,C=m*h*l-d*E*l-m*a*f+o*E*f+d*a*b-o*h*b,T=n*y+i*v+s*S+r*C;if(T===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const O=1/T;return e[0]=y*O,e[1]=(E*f*r-h*b*r-E*s*_+i*b*_+h*s*g-i*f*g)*O,e[2]=(a*b*r-E*l*r+E*s*u-i*b*u-a*s*g+i*l*g)*O,e[3]=(h*l*r-a*f*r-h*s*u+i*f*u+a*s*_-i*l*_)*O,e[4]=v*O,e[5]=(d*b*r-m*f*r+m*s*_-n*b*_-d*s*g+n*f*g)*O,e[6]=(m*l*r-o*b*r-m*s*u+n*b*u+o*s*g-n*l*g)*O,e[7]=(o*f*r-d*l*r+d*s*u-n*f*u-o*s*_+n*l*_)*O,e[8]=S*O,e[9]=(m*h*r-d*E*r-m*i*_+n*E*_+d*i*g-n*h*g)*O,e[10]=(o*E*r-m*a*r+m*i*u-n*E*u-o*i*g+n*a*g)*O,e[11]=(d*a*r-o*h*r-d*i*u+n*h*u+o*i*_-n*a*_)*O,e[12]=C*O,e[13]=(d*E*s-m*h*s+m*i*f-n*E*f-d*i*b+n*h*b)*O,e[14]=(m*a*s-o*E*s-m*i*l+n*E*l+o*i*b-n*a*b)*O,e[15]=(o*h*s-d*a*s+d*i*l-n*h*l-o*i*f+n*a*f)*O,this}scale(e){const n=this.elements,i=e.x,s=e.y,r=e.z;return n[0]*=i,n[4]*=s,n[8]*=r,n[1]*=i,n[5]*=s,n[9]*=r,n[2]*=i,n[6]*=s,n[10]*=r,n[3]*=i,n[7]*=s,n[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements,n=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(n,i,s))}makeTranslation(e,n,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,n,0,0,1,i,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,n,-i,0,0,i,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,0,i,0,0,1,0,0,-i,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,0,i,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const i=Math.cos(n),s=Math.sin(n),r=1-i,o=e.x,a=e.y,l=e.z,u=r*o,d=r*a;return this.set(u*o+i,u*a-s*l,u*l+s*a,0,u*a+s*l,d*a+i,d*l-s*o,0,u*l-s*a,d*l+s*o,r*l*l+i,0,0,0,0,1),this}makeScale(e,n,i){return this.set(e,0,0,0,0,n,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,n,i,s,r,o){return this.set(1,i,r,0,e,1,o,0,n,s,1,0,0,0,0,1),this}compose(e,n,i){const s=this.elements,r=n._x,o=n._y,a=n._z,l=n._w,u=r+r,d=o+o,h=a+a,f=r*u,_=r*d,m=r*h,E=o*d,b=o*h,g=a*h,y=l*u,v=l*d,S=l*h,C=i.x,T=i.y,O=i.z;return s[0]=(1-(E+g))*C,s[1]=(_+S)*C,s[2]=(m-v)*C,s[3]=0,s[4]=(_-S)*T,s[5]=(1-(f+g))*T,s[6]=(b+y)*T,s[7]=0,s[8]=(m+v)*O,s[9]=(b-y)*O,s[10]=(1-(f+E))*O,s[11]=0,s[12]=e.x,s[13]=e.y,s[14]=e.z,s[15]=1,this}decompose(e,n,i){const s=this.elements;let r=Lo.set(s[0],s[1],s[2]).length();const o=Lo.set(s[4],s[5],s[6]).length(),a=Lo.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],Mi.copy(this);const u=1/r,d=1/o,h=1/a;return Mi.elements[0]*=u,Mi.elements[1]*=u,Mi.elements[2]*=u,Mi.elements[4]*=d,Mi.elements[5]*=d,Mi.elements[6]*=d,Mi.elements[8]*=h,Mi.elements[9]*=h,Mi.elements[10]*=h,n.setFromRotationMatrix(Mi),i.x=r,i.y=o,i.z=a,this}makePerspective(e,n,i,s,r,o,a=Us){const l=this.elements,u=2*r/(n-e),d=2*r/(i-s),h=(n+e)/(n-e),f=(i+s)/(i-s);let _,m;if(a===Us)_=-(o+r)/(o-r),m=-2*o*r/(o-r);else if(a===bu)_=-o/(o-r),m=-o*r/(o-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=u,l[4]=0,l[8]=h,l[12]=0,l[1]=0,l[5]=d,l[9]=f,l[13]=0,l[2]=0,l[6]=0,l[10]=_,l[14]=m,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,n,i,s,r,o,a=Us){const l=this.elements,u=1/(n-e),d=1/(i-s),h=1/(o-r),f=(n+e)*u,_=(i+s)*d;let m,E;if(a===Us)m=(o+r)*h,E=-2*h;else if(a===bu)m=r*h,E=-1*h;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*u,l[4]=0,l[8]=0,l[12]=-f,l[1]=0,l[5]=2*d,l[9]=0,l[13]=-_,l[2]=0,l[6]=0,l[10]=E,l[14]=-m,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const n=this.elements,i=e.elements;for(let s=0;s<16;s++)if(n[s]!==i[s])return!1;return!0}fromArray(e,n=0){for(let i=0;i<16;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){const i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e[n+9]=i[9],e[n+10]=i[10],e[n+11]=i[11],e[n+12]=i[12],e[n+13]=i[13],e[n+14]=i[14],e[n+15]=i[15],e}}const Lo=new _e,Mi=new Rt,HRt=new _e(0,0,0),qRt=new _e(1,1,1),sr=new _e,nd=new _e,ii=new _e,O1=new Rt,I1=new Ir;class up{constructor(e=0,n=0,i=0,s=up.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,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,n,i,s=this._order){return this._x=e,this._y=n,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,n=this._order,i=!0){const s=e.elements,r=s[0],o=s[4],a=s[8],l=s[1],u=s[5],d=s[9],h=s[2],f=s[6],_=s[10];switch(n){case"XYZ":this._y=Math.asin(Ln(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-d,_),this._z=Math.atan2(-o,r)):(this._x=Math.atan2(f,u),this._z=0);break;case"YXZ":this._x=Math.asin(-Ln(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(a,_),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-h,r),this._z=0);break;case"ZXY":this._x=Math.asin(Ln(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-h,_),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(l,r));break;case"ZYX":this._y=Math.asin(-Ln(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(f,_),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-o,u));break;case"YZX":this._z=Math.asin(Ln(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-d,u),this._y=Math.atan2(-h,r)):(this._x=0,this._y=Math.atan2(a,_));break;case"XZY":this._z=Math.asin(-Ln(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(f,u),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-d,_),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,i){return O1.makeRotationFromQuaternion(e),this.setFromRotationMatrix(O1,n,i)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return I1.setFromEuler(this),this.setFromQuaternion(I1,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=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+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}}up.DEFAULT_ORDER="XYZ";class oI{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let n=0;n1){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 u=0,d=l.length;u0){s.children=[];for(let a=0;a0){s.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),u.length>0&&(i.textures=u),d.length>0&&(i.images=d),h.length>0&&(i.shapes=h),f.length>0&&(i.skeletons=f),_.length>0&&(i.animations=_),m.length>0&&(i.nodes=m)}return i.object=s,i;function o(a){const l=[];for(const u in a){const d=a[u];delete d.metadata,l.push(d)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!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)),n===!0)for(let i=0;i0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(e,n,i,s,r){Di.subVectors(s,n),As.subVectors(i,n),Xm.subVectors(e,n);const o=Di.dot(Di),a=Di.dot(As),l=Di.dot(Xm),u=As.dot(As),d=As.dot(Xm),h=o*u-a*a;if(h===0)return r.set(-2,-1,-1);const f=1/h,_=(u*l-a*d)*f,m=(o*d-a*l)*f;return r.set(1-_-m,m,_)}static containsPoint(e,n,i,s){return this.getBarycoord(e,n,i,s,Ns),Ns.x>=0&&Ns.y>=0&&Ns.x+Ns.y<=1}static getUV(e,n,i,s,r,o,a,l){return sd===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),sd=!0),this.getInterpolation(e,n,i,s,r,o,a,l)}static getInterpolation(e,n,i,s,r,o,a,l){return this.getBarycoord(e,n,i,s,Ns),l.setScalar(0),l.addScaledVector(r,Ns.x),l.addScaledVector(o,Ns.y),l.addScaledVector(a,Ns.z),l}static isFrontFacing(e,n,i,s){return Di.subVectors(i,n),As.subVectors(e,n),Di.cross(As).dot(s)<0}set(e,n,i){return this.a.copy(e),this.b.copy(n),this.c.copy(i),this}setFromPointsAndIndices(e,n,i,s){return this.a.copy(e[n]),this.b.copy(e[i]),this.c.copy(e[s]),this}setFromAttributeAndIndices(e,n,i,s){return this.a.fromBufferAttribute(e,n),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 Di.subVectors(this.c,this.b),As.subVectors(this.a,this.b),Di.cross(As).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Ui.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return Ui.getBarycoord(e,this.a,this.b,this.c,n)}getUV(e,n,i,s,r){return sd===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),sd=!0),Ui.getInterpolation(e,this.a,this.b,this.c,n,i,s,r)}getInterpolation(e,n,i,s,r){return Ui.getInterpolation(e,this.a,this.b,this.c,n,i,s,r)}containsPoint(e){return Ui.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Ui.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const i=this.a,s=this.b,r=this.c;let o,a;Uo.subVectors(s,i),Fo.subVectors(r,i),Zm.subVectors(e,i);const l=Uo.dot(Zm),u=Fo.dot(Zm);if(l<=0&&u<=0)return n.copy(i);Jm.subVectors(e,s);const d=Uo.dot(Jm),h=Fo.dot(Jm);if(d>=0&&h<=d)return n.copy(s);const f=l*h-d*u;if(f<=0&&l>=0&&d<=0)return o=l/(l-d),n.copy(i).addScaledVector(Uo,o);eg.subVectors(e,r);const _=Uo.dot(eg),m=Fo.dot(eg);if(m>=0&&_<=m)return n.copy(r);const E=_*u-l*m;if(E<=0&&u>=0&&m<=0)return a=u/(u-m),n.copy(i).addScaledVector(Fo,a);const b=d*m-_*h;if(b<=0&&h-d>=0&&_-m>=0)return P1.subVectors(r,s),a=(h-d)/(h-d+(_-m)),n.copy(s).addScaledVector(P1,a);const g=1/(b+E+f);return o=E*g,a=f*g,n.copy(i).addScaledVector(Uo,o).addScaledVector(Fo,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const aI={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},rr={h:0,s:0,l:0},rd={h:0,s:0,l:0};function tg(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}class gt{constructor(e,n,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,i)}set(e,n,i){if(n===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,n,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=on){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Gt.toWorkingColorSpace(this,n),this}setRGB(e,n,i,s=Gt.workingColorSpace){return this.r=e,this.g=n,this.b=i,Gt.toWorkingColorSpace(this,s),this}setHSL(e,n,i,s=Gt.workingColorSpace){if(e=JE(e,1),n=Ln(n,0,1),i=Ln(i,0,1),n===0)this.r=this.g=this.b=i;else{const r=i<=.5?i*(1+n):i+n-i*n,o=2*i-r;this.r=tg(o,r,e+1/3),this.g=tg(o,r,e),this.b=tg(o,r,e-1/3)}return Gt.toWorkingColorSpace(this,s),this}setStyle(e,n=on){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,n);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,n);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,n);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,n);if(o===6)return this.setHex(parseInt(r,16),n);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=on){const i=aI[e.toLowerCase()];return i!==void 0?this.setHex(i,n):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=la(e.r),this.g=la(e.g),this.b=la(e.b),this}copyLinearToSRGB(e){return this.r=Hm(e.r),this.g=Hm(e.g),this.b=Hm(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=on){return Gt.fromWorkingColorSpace(Dn.copy(this),e),Math.round(Ln(Dn.r*255,0,255))*65536+Math.round(Ln(Dn.g*255,0,255))*256+Math.round(Ln(Dn.b*255,0,255))}getHexString(e=on){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=Gt.workingColorSpace){Gt.fromWorkingColorSpace(Dn.copy(this),n);const i=Dn.r,s=Dn.g,r=Dn.b,o=Math.max(i,s,r),a=Math.min(i,s,r);let l,u;const d=(a+o)/2;if(a===o)l=0,u=0;else{const h=o-a;switch(u=d<=.5?h/(o+a):h/(2-o-a),o){case i:l=(s-r)/h+(s0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const i=e[n];if(i===void 0){console.warn(`THREE.Material: parameter '${n}' has value of undefined.`);continue}const s=this[n];if(s===void 0){console.warn(`THREE.Material: '${n}' 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[n]=i}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(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!==aa&&(i.blending=this.blending),this.side!==Ys&&(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!==sb&&(i.blendSrc=this.blendSrc),this.blendDst!==rb&&(i.blendDst=this.blendDst),this.blendEquation!==Xr&&(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!==_u&&(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!==T1&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Oo&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Oo&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Oo&&(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(n){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 n=e.clippingPlanes;let i=null;if(n!==null){const s=n.length;i=new Array(s);for(let r=0;r!==s;++r)i[r]=n[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 Er extends Hi{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new gt(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=jE,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 dn=new _e,od=new It;class Yn{constructor(e,n,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=n,this.count=e!==void 0?e.length/n:0,this.normalized=i,this.usage=db,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Ps,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,n){this.updateRanges.push({start:e,count:n})}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,n,i){e*=this.itemSize,i*=n.itemSize;for(let s=0,r=this.itemSize;s0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const u in l)l[u]!==void 0&&(e[u]=l[u]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const i=this.attributes;for(const l in i){const u=i[l];e.data.attributes[l]=u.toJSON(e.data)}const s={};let r=!1;for(const l in this.morphAttributes){const u=this.morphAttributes[l],d=[];for(let h=0,f=u.length;h0&&(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 n={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone(n));const s=e.attributes;for(const u in s){const d=s[u];this.setAttribute(u,d.clone(n))}const r=e.morphAttributes;for(const u in r){const d=[],h=r[u];for(let f=0,_=h.length;f<_;f++)d.push(h[f].clone(n));this.morphAttributes[u]=d}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let u=0,d=o.length;u0){const s=n[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;r(e.far-e.near)**2))&&(U1.copy(r).invert(),Gr.copy(e.ray).applyMatrix4(U1),!(i.boundingBox!==null&&Gr.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,n,Gr)))}_computeIntersections(e,n,i){let s;const r=this.geometry,o=this.material,a=r.index,l=r.attributes.position,u=r.attributes.uv,d=r.attributes.uv1,h=r.attributes.normal,f=r.groups,_=r.drawRange;if(a!==null)if(Array.isArray(o))for(let m=0,E=f.length;mn.far?null:{distance:u,point:_d.clone(),object:t}}function hd(t,e,n,i,s,r,o,a,l,u){t.getVertexPosition(a,Go),t.getVertexPosition(l,Vo),t.getVertexPosition(u,zo);const d=ZRt(t,e,n,i,Go,Vo,zo,pd);if(d){s&&(cd.fromBufferAttribute(s,a),dd.fromBufferAttribute(s,l),ud.fromBufferAttribute(s,u),d.uv=Ui.getInterpolation(pd,Go,Vo,zo,cd,dd,ud,new It)),r&&(cd.fromBufferAttribute(r,a),dd.fromBufferAttribute(r,l),ud.fromBufferAttribute(r,u),d.uv1=Ui.getInterpolation(pd,Go,Vo,zo,cd,dd,ud,new It),d.uv2=d.uv1),o&&(B1.fromBufferAttribute(o,a),G1.fromBufferAttribute(o,l),V1.fromBufferAttribute(o,u),d.normal=Ui.getInterpolation(pd,Go,Vo,zo,B1,G1,V1,new _e),d.normal.dot(i.direction)>0&&d.normal.multiplyScalar(-1));const h={a,b:l,c:u,normal:new _e,materialIndex:0};Ui.getNormal(Go,Vo,zo,h.normal),d.face=h}return d}class Cr extends ms{constructor(e=1,n=1,i=1,s=1,r=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,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=[],u=[],d=[],h=[];let f=0,_=0;m("z","y","x",-1,-1,i,n,e,o,r,0),m("z","y","x",1,-1,i,n,-e,o,r,1),m("x","z","y",1,1,e,i,n,s,o,2),m("x","z","y",1,-1,e,i,-n,s,o,3),m("x","y","z",1,-1,e,n,i,s,r,4),m("x","y","z",-1,-1,e,n,-i,s,r,5),this.setIndex(l),this.setAttribute("position",new Bs(u,3)),this.setAttribute("normal",new Bs(d,3)),this.setAttribute("uv",new Bs(h,2));function m(E,b,g,y,v,S,C,T,O,k,x){const I=S/O,F=C/k,B=S/2,ne=C/2,L=T/2,$=O+1,H=k+1;let U=0,Q=0;const J=new _e;for(let j=0;j0?1:-1,d.push(J.x,J.y,J.z),h.push(ve/O),h.push(1-j/k),U+=1}}for(let j=0;j>8&255]+Mn[t>>16&255]+Mn[t>>24&255]+"-"+Mn[e&255]+Mn[e>>8&255]+"-"+Mn[e>>16&15|64]+Mn[e>>24&255]+"-"+Mn[n&63|128]+Mn[n>>8&255]+"-"+Mn[n>>16&255]+Mn[n>>24&255]+Mn[i&255]+Mn[i>>8&255]+Mn[i>>16&255]+Mn[i>>24&255]).toLowerCase()}function Ln(t,e,n){return Math.max(e,Math.min(n,t))}function JE(t,e){return(t%e+e)%e}function SRt(t,e,n,i,s){return i+(t-e)*(s-i)/(n-e)}function TRt(t,e,n){return t!==e?(n-t)/(e-t):0}function Fl(t,e,n){return(1-n)*t+n*e}function xRt(t,e,n,i){return Fl(t,e,1-Math.exp(-n*i))}function CRt(t,e=1){return e-Math.abs(JE(t,e*2)-e)}function wRt(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function RRt(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(t*6-15)+10))}function ARt(t,e){return t+Math.floor(Math.random()*(e-t+1))}function NRt(t,e){return t+Math.random()*(e-t)}function ORt(t){return t*(.5-Math.random())}function IRt(t){t!==void 0&&(C1=t);let e=C1+=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 MRt(t){return t*Ul}function DRt(t){return t*Aa}function pb(t){return(t&t-1)===0&&t!==0}function kRt(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function Eu(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function LRt(t,e,n,i,s){const r=Math.cos,o=Math.sin,a=r(n/2),l=o(n/2),u=r((e+i)/2),d=o((e+i)/2),h=r((e-i)/2),f=o((e-i)/2),_=r((i-e)/2),m=o((i-e)/2);switch(s){case"XYX":t.set(a*d,l*h,l*f,a*u);break;case"YZY":t.set(l*f,a*d,l*h,a*u);break;case"ZXZ":t.set(l*h,l*f,a*d,a*u);break;case"XZX":t.set(a*d,l*m,l*_,a*u);break;case"YXY":t.set(l*_,a*d,l*m,a*u);break;case"ZYZ":t.set(l*m,l*_,a*d,a*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}}function ts(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Ht(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}const PRt={DEG2RAD:Ul,RAD2DEG:Aa,generateUUID:zi,clamp:Ln,euclideanModulo:JE,mapLinear:SRt,inverseLerp:TRt,lerp:Fl,damp:xRt,pingpong:CRt,smoothstep:wRt,smootherstep:RRt,randInt:ARt,randFloat:NRt,randFloatSpread:ORt,seededRandom:IRt,degToRad:MRt,radToDeg:DRt,isPowerOfTwo:pb,ceilPowerOfTwo:kRt,floorPowerOfTwo:Eu,setQuaternionFromProperEuler:LRt,normalize:Ht,denormalize:ts};class It{constructor(e=0,n=0){It.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,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,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;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,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,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,n){return this.x=e.x-n.x,this.y=e.y-n.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 n=this.x,i=this.y,s=e.elements;return this.x=s[0]*n+s[3]*i+s[6],this.y=s[1]*n+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,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(n,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 n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(e)/n;return Math.acos(Ln(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,i=this.y-e.y;return n*n+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,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const i=Math.cos(n),s=Math.sin(n),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 wt{constructor(e,n,i,s,r,o,a,l,u){wt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,i,s,r,o,a,l,u)}set(e,n,i,s,r,o,a,l,u){const d=this.elements;return d[0]=e,d[1]=s,d[2]=a,d[3]=n,d[4]=r,d[5]=l,d[6]=i,d[7]=o,d[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,i=e.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],this}extractBasis(e,n,i){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const i=e.elements,s=n.elements,r=this.elements,o=i[0],a=i[3],l=i[6],u=i[1],d=i[4],h=i[7],f=i[2],_=i[5],m=i[8],E=s[0],b=s[3],g=s[6],y=s[1],v=s[4],S=s[7],C=s[2],T=s[5],O=s[8];return r[0]=o*E+a*y+l*C,r[3]=o*b+a*v+l*T,r[6]=o*g+a*S+l*O,r[1]=u*E+d*y+h*C,r[4]=u*b+d*v+h*T,r[7]=u*g+d*S+h*O,r[2]=f*E+_*y+m*C,r[5]=f*b+_*v+m*T,r[8]=f*g+_*S+m*O,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],u=e[7],d=e[8];return n*o*d-n*a*u-i*r*d+i*a*l+s*r*u-s*o*l}invert(){const e=this.elements,n=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],u=e[7],d=e[8],h=d*o-a*u,f=a*l-d*r,_=u*r-o*l,m=n*h+i*f+s*_;if(m===0)return this.set(0,0,0,0,0,0,0,0,0);const E=1/m;return e[0]=h*E,e[1]=(s*u-d*i)*E,e[2]=(a*i-s*o)*E,e[3]=f*E,e[4]=(d*n-s*l)*E,e[5]=(s*r-a*n)*E,e[6]=_*E,e[7]=(i*l-u*n)*E,e[8]=(o*n-i*r)*E,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,i,s,r,o,a){const l=Math.cos(r),u=Math.sin(r);return this.set(i*l,i*u,-i*(l*o+u*a)+o+e,-s*u,s*l,-s*(-u*o+l*a)+a+n,0,0,1),this}scale(e,n){return this.premultiply(zm.makeScale(e,n)),this}rotate(e){return this.premultiply(zm.makeRotation(-e)),this}translate(e,n){return this.premultiply(zm.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,i,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){const n=this.elements,i=e.elements;for(let s=0;s<9;s++)if(n[s]!==i[s])return!1;return!0}fromArray(e,n=0){for(let i=0;i<9;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){const i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const zm=new wt;function nI(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function ac(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function URt(){const t=ac("canvas");return t.style.display="block",t}const w1={};function Bl(t){t in w1||(w1[t]=!0,console.warn(t))}const R1=new wt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),A1=new wt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Qc={[On]:{transfer:fu,primaries:mu,toReference:t=>t,fromReference:t=>t},[on]:{transfer:Zt,primaries:mu,toReference:t=>t.convertSRGBToLinear(),fromReference:t=>t.convertLinearToSRGB()},[cp]:{transfer:fu,primaries:gu,toReference:t=>t.applyMatrix3(A1),fromReference:t=>t.applyMatrix3(R1)},[ZE]:{transfer:Zt,primaries:gu,toReference:t=>t.convertSRGBToLinear().applyMatrix3(A1),fromReference:t=>t.applyMatrix3(R1).convertLinearToSRGB()}},FRt=new Set([On,cp]),Gt={enabled:!0,_workingColorSpace:On,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(t){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!t},get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(t){if(!FRt.has(t))throw new Error(`Unsupported working color space, "${t}".`);this._workingColorSpace=t},convert:function(t,e,n){if(this.enabled===!1||e===n||!e||!n)return t;const i=Qc[e].toReference,s=Qc[n].fromReference;return s(i(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this._workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this._workingColorSpace)},getPrimaries:function(t){return Qc[t].primaries},getTransfer:function(t){return t===bi?fu:Qc[t].transfer}};function la(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function Hm(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let Io;class iI{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{Io===void 0&&(Io=ac("canvas")),Io.width=e.width,Io.height=e.height;const i=Io.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),n=Io}return n.width>2048||n.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),n.toDataURL("image/jpeg",.6)):n.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 n=ac("canvas");n.width=e.width,n.height=e.height;const i=n.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),n||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==qO)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Ca:e.x=e.x-Math.floor(e.x);break;case mi:e.x=e.x<0?0:1;break;case hu: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 Ca:e.y=e.y-Math.floor(e.y);break;case mi:e.y=e.y<0?0:1;break;case hu: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 Bl("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===on?lo:eI}set encoding(e){Bl("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===lo?on:bi}}Nn.DEFAULT_IMAGE=null;Nn.DEFAULT_MAPPING=qO;Nn.DEFAULT_ANISOTROPY=1;class Wt{constructor(e=0,n=0,i=0,s=1){Wt.prototype.isVector4=!0,this.x=e,this.y=n,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,n,i,s){return this.x=e,this.y=n,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,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;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,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,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,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.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 n=this.x,i=this.y,s=this.z,r=this.w,o=e.elements;return this.x=o[0]*n+o[4]*i+o[8]*s+o[12]*r,this.y=o[1]*n+o[5]*i+o[9]*s+o[13]*r,this.z=o[2]*n+o[6]*i+o[10]*s+o[14]*r,this.w=o[3]*n+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 n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,i,s,r;const l=e.elements,u=l[0],d=l[4],h=l[8],f=l[1],_=l[5],m=l[9],E=l[2],b=l[6],g=l[10];if(Math.abs(d-f)<.01&&Math.abs(h-E)<.01&&Math.abs(m-b)<.01){if(Math.abs(d+f)<.1&&Math.abs(h+E)<.1&&Math.abs(m+b)<.1&&Math.abs(u+_+g-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const v=(u+1)/2,S=(_+1)/2,C=(g+1)/2,T=(d+f)/4,O=(h+E)/4,k=(m+b)/4;return v>S&&v>C?v<.01?(i=0,s=.707106781,r=.707106781):(i=Math.sqrt(v),s=T/i,r=O/i):S>C?S<.01?(i=.707106781,s=0,r=.707106781):(s=Math.sqrt(S),i=T/s,r=k/s):C<.01?(i=.707106781,s=.707106781,r=0):(r=Math.sqrt(C),i=O/r,s=k/r),this.set(i,s,r,n),this}let y=Math.sqrt((b-m)*(b-m)+(h-E)*(h-E)+(f-d)*(f-d));return Math.abs(y)<.001&&(y=1),this.x=(b-m)/y,this.y=(h-E)/y,this.z=(f-d)/y,this.w=Math.acos((u+_+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,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this.w=Math.max(e.w,Math.min(n.w,this.w)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this.w=Math.max(e,Math.min(n,this.w)),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(n,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,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this.w=e.w+(n.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,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),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 VRt extends Ka{constructor(e=1,n=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=1,this.scissor=new Wt(0,0,e,n),this.scissorTest=!1,this.viewport=new Wt(0,0,e,n);const s={width:e,height:n,depth:1};i.encoding!==void 0&&(Bl("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),i.colorSpace=i.encoding===lo?on:bi),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:jn,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},i),this.texture=new Nn(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,n,i=1){(this.width!==e||this.height!==n||this.depth!==i)&&(this.width=e,this.height=n,this.depth=i,this.texture.image.width=e,this.texture.image.height=n,this.texture.image.depth=i,this.dispose()),this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}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 n=Object.assign({},e.texture.image);return this.texture.source=new sI(n),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 mo extends VRt{constructor(e=1,n=1,i={}){super(e,n,i),this.isWebGLRenderTarget=!0}}class rI extends Nn{constructor(e=null,n=1,i=1,s=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:n,height:i,depth:s},this.magFilter=yn,this.minFilter=yn,this.wrapR=mi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class zRt extends Nn{constructor(e=null,n=1,i=1,s=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:n,height:i,depth:s},this.magFilter=yn,this.minFilter=yn,this.wrapR=mi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Ir{constructor(e=0,n=0,i=0,s=1){this.isQuaternion=!0,this._x=e,this._y=n,this._z=i,this._w=s}static slerpFlat(e,n,i,s,r,o,a){let l=i[s+0],u=i[s+1],d=i[s+2],h=i[s+3];const f=r[o+0],_=r[o+1],m=r[o+2],E=r[o+3];if(a===0){e[n+0]=l,e[n+1]=u,e[n+2]=d,e[n+3]=h;return}if(a===1){e[n+0]=f,e[n+1]=_,e[n+2]=m,e[n+3]=E;return}if(h!==E||l!==f||u!==_||d!==m){let b=1-a;const g=l*f+u*_+d*m+h*E,y=g>=0?1:-1,v=1-g*g;if(v>Number.EPSILON){const C=Math.sqrt(v),T=Math.atan2(C,g*y);b=Math.sin(b*T)/C,a=Math.sin(a*T)/C}const S=a*y;if(l=l*b+f*S,u=u*b+_*S,d=d*b+m*S,h=h*b+E*S,b===1-a){const C=1/Math.sqrt(l*l+u*u+d*d+h*h);l*=C,u*=C,d*=C,h*=C}}e[n]=l,e[n+1]=u,e[n+2]=d,e[n+3]=h}static multiplyQuaternionsFlat(e,n,i,s,r,o){const a=i[s],l=i[s+1],u=i[s+2],d=i[s+3],h=r[o],f=r[o+1],_=r[o+2],m=r[o+3];return e[n]=a*m+d*h+l*_-u*f,e[n+1]=l*m+d*f+u*h-a*_,e[n+2]=u*m+d*_+a*f-l*h,e[n+3]=d*m-a*h-l*f-u*_,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,n,i,s){return this._x=e,this._y=n,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,n){const i=e._x,s=e._y,r=e._z,o=e._order,a=Math.cos,l=Math.sin,u=a(i/2),d=a(s/2),h=a(r/2),f=l(i/2),_=l(s/2),m=l(r/2);switch(o){case"XYZ":this._x=f*d*h+u*_*m,this._y=u*_*h-f*d*m,this._z=u*d*m+f*_*h,this._w=u*d*h-f*_*m;break;case"YXZ":this._x=f*d*h+u*_*m,this._y=u*_*h-f*d*m,this._z=u*d*m-f*_*h,this._w=u*d*h+f*_*m;break;case"ZXY":this._x=f*d*h-u*_*m,this._y=u*_*h+f*d*m,this._z=u*d*m+f*_*h,this._w=u*d*h-f*_*m;break;case"ZYX":this._x=f*d*h-u*_*m,this._y=u*_*h+f*d*m,this._z=u*d*m-f*_*h,this._w=u*d*h+f*_*m;break;case"YZX":this._x=f*d*h+u*_*m,this._y=u*_*h+f*d*m,this._z=u*d*m-f*_*h,this._w=u*d*h-f*_*m;break;case"XZY":this._x=f*d*h-u*_*m,this._y=u*_*h-f*d*m,this._z=u*d*m+f*_*h,this._w=u*d*h+f*_*m;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return n!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const i=n/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 n=e.elements,i=n[0],s=n[4],r=n[8],o=n[1],a=n[5],l=n[9],u=n[2],d=n[6],h=n[10],f=i+a+h;if(f>0){const _=.5/Math.sqrt(f+1);this._w=.25/_,this._x=(d-l)*_,this._y=(r-u)*_,this._z=(o-s)*_}else if(i>a&&i>h){const _=2*Math.sqrt(1+i-a-h);this._w=(d-l)/_,this._x=.25*_,this._y=(s+o)/_,this._z=(r+u)/_}else if(a>h){const _=2*Math.sqrt(1+a-i-h);this._w=(r-u)/_,this._x=(s+o)/_,this._y=.25*_,this._z=(l+d)/_}else{const _=2*Math.sqrt(1+h-i-a);this._w=(o-s)/_,this._x=(r+u)/_,this._y=(l+d)/_,this._z=.25*_}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let i=e.dot(n)+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*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Ln(this.dot(e),-1,1)))}rotateTowards(e,n){const i=this.angleTo(e);if(i===0)return this;const s=Math.min(1,n/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,n){const i=e._x,s=e._y,r=e._z,o=e._w,a=n._x,l=n._y,u=n._z,d=n._w;return this._x=i*d+o*a+s*u-r*l,this._y=s*d+o*l+r*a-i*u,this._z=r*d+o*u+i*l-s*a,this._w=o*d-i*a-s*l-r*u,this._onChangeCallback(),this}slerp(e,n){if(n===0)return this;if(n===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 _=1-n;return this._w=_*o+n*this._w,this._x=_*i+n*this._x,this._y=_*s+n*this._y,this._z=_*r+n*this._z,this.normalize(),this._onChangeCallback(),this}const u=Math.sqrt(l),d=Math.atan2(u,a),h=Math.sin((1-n)*d)/u,f=Math.sin(n*d)/u;return this._w=o*h+this._w*f,this._x=i*h+this._x*f,this._y=s*h+this._y*f,this._z=r*h+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,n,i){return this.copy(e).slerp(n,i)}random(){const e=Math.random(),n=Math.sqrt(1-e),i=Math.sqrt(e),s=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(n*Math.cos(s),i*Math.sin(r),i*Math.cos(r),n*Math.sin(s))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),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 _e{constructor(e=0,n=0,i=0){_e.prototype.isVector3=!0,this.x=e,this.y=n,this.z=i}set(e,n,i){return i===void 0&&(i=this.z),this.x=e,this.y=n,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,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;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,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,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,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.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,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(N1.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(N1.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,i=this.y,s=this.z,r=e.elements;return this.x=r[0]*n+r[3]*i+r[6]*s,this.y=r[1]*n+r[4]*i+r[7]*s,this.z=r[2]*n+r[5]*i+r[8]*s,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,i=this.y,s=this.z,r=e.elements,o=1/(r[3]*n+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*n+r[4]*i+r[8]*s+r[12])*o,this.y=(r[1]*n+r[5]*i+r[9]*s+r[13])*o,this.z=(r[2]*n+r[6]*i+r[10]*s+r[14])*o,this}applyQuaternion(e){const n=this.x,i=this.y,s=this.z,r=e.x,o=e.y,a=e.z,l=e.w,u=2*(o*s-a*i),d=2*(a*n-r*s),h=2*(r*i-o*n);return this.x=n+l*u+o*h-a*d,this.y=i+l*d+a*u-r*h,this.z=s+l*h+r*d-o*u,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,i=this.y,s=this.z,r=e.elements;return this.x=r[0]*n+r[4]*i+r[8]*s,this.y=r[1]*n+r[5]*i+r[9]*s,this.z=r[2]*n+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,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(n,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,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const i=e.x,s=e.y,r=e.z,o=n.x,a=n.y,l=n.z;return this.x=s*l-r*a,this.y=r*o-i*l,this.z=i*a-s*o,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const i=e.dot(this)/n;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return Ym.copy(this).projectOnVector(e),this.sub(Ym)}reflect(e){return this.sub(Ym.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(e)/n;return Math.acos(Ln(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,i=this.y-e.y,s=this.z-e.z;return n*n+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,n,i){const s=Math.sin(n)*e;return this.x=s*Math.sin(i),this.y=Math.cos(n)*e,this.z=s*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,i){return this.x=e*Math.sin(n),this.y=i,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),s=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=i,this.z=s,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*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,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,n=Math.random()*Math.PI*2,i=Math.sqrt(1-e**2);return this.x=i*Math.cos(n),this.y=i*Math.sin(n),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Ym=new _e,N1=new Ir;class js{constructor(e=new _e(1/0,1/0,1/0),n=new _e(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromArray(e){this.makeEmpty();for(let n=0,i=e.length;nthis.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,n){return n.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,Ii),Ii.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,i;return e.normal.x>0?(n=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),n<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(fl),Zc.subVectors(this.max,fl),Mo.subVectors(e.a,fl),Do.subVectors(e.b,fl),ko.subVectors(e.c,fl),tr.subVectors(Do,Mo),nr.subVectors(ko,Do),Fr.subVectors(Mo,ko);let n=[0,-tr.z,tr.y,0,-nr.z,nr.y,0,-Fr.z,Fr.y,tr.z,0,-tr.x,nr.z,0,-nr.x,Fr.z,0,-Fr.x,-tr.y,tr.x,0,-nr.y,nr.x,0,-Fr.y,Fr.x,0];return!$m(n,Mo,Do,ko,Zc)||(n=[1,0,0,0,1,0,0,0,1],!$m(n,Mo,Do,ko,Zc))?!1:(Jc.crossVectors(tr,nr),n=[Jc.x,Jc.y,Jc.z],$m(n,Mo,Do,ko,Zc))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Ii).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Ii).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:(Cs[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Cs[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Cs[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Cs[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Cs[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Cs[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Cs[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Cs[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Cs),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 Cs=[new _e,new _e,new _e,new _e,new _e,new _e,new _e,new _e],Ii=new _e,Xc=new js,Mo=new _e,Do=new _e,ko=new _e,tr=new _e,nr=new _e,Fr=new _e,fl=new _e,Zc=new _e,Jc=new _e,Br=new _e;function $m(t,e,n,i,s){for(let r=0,o=t.length-3;r<=o;r+=3){Br.fromArray(t,r);const a=s.x*Math.abs(Br.x)+s.y*Math.abs(Br.y)+s.z*Math.abs(Br.z),l=e.dot(Br),u=n.dot(Br),d=i.dot(Br);if(Math.max(-Math.max(l,u,d),Math.min(l,u,d))>a)return!1}return!0}const HRt=new js,ml=new _e,Wm=new _e;class fs{constructor(e=new _e,n=-1){this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const i=this.center;n!==void 0?i.copy(n):HRt.setFromPoints(e).getCenter(i);let s=0;for(let r=0,o=e.length;rthis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}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;ml.subVectors(e,this.center);const n=ml.lengthSq();if(n>this.radius*this.radius){const i=Math.sqrt(n),s=(i-this.radius)*.5;this.center.addScaledVector(ml,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):(Wm.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(ml.copy(e.center).add(Wm)),this.expandByPoint(ml.copy(e.center).sub(Wm))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const ws=new _e,Km=new _e,ed=new _e,ir=new _e,jm=new _e,td=new _e,Qm=new _e;class dp{constructor(e=new _e,n=new _e(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.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,ws)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const i=n.dot(this.direction);return i<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=ws.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(ws.copy(this.origin).addScaledVector(this.direction,n),ws.distanceToSquared(e))}distanceSqToSegment(e,n,i,s){Km.copy(e).add(n).multiplyScalar(.5),ed.copy(n).sub(e).normalize(),ir.copy(this.origin).sub(Km);const r=e.distanceTo(n)*.5,o=-this.direction.dot(ed),a=ir.dot(this.direction),l=-ir.dot(ed),u=ir.lengthSq(),d=Math.abs(1-o*o);let h,f,_,m;if(d>0)if(h=o*l-a,f=o*a-l,m=r*d,h>=0)if(f>=-m)if(f<=m){const E=1/d;h*=E,f*=E,_=h*(h+o*f+2*a)+f*(o*h+f+2*l)+u}else f=r,h=Math.max(0,-(o*f+a)),_=-h*h+f*(f+2*l)+u;else f=-r,h=Math.max(0,-(o*f+a)),_=-h*h+f*(f+2*l)+u;else f<=-m?(h=Math.max(0,-(-o*r+a)),f=h>0?-r:Math.min(Math.max(-r,-l),r),_=-h*h+f*(f+2*l)+u):f<=m?(h=0,f=Math.min(Math.max(-r,-l),r),_=f*(f+2*l)+u):(h=Math.max(0,-(o*r+a)),f=h>0?r:Math.min(Math.max(-r,-l),r),_=-h*h+f*(f+2*l)+u);else f=o>0?-r:r,h=Math.max(0,-(o*f+a)),_=-h*h+f*(f+2*l)+u;return i&&i.copy(this.origin).addScaledVector(this.direction,h),s&&s.copy(Km).addScaledVector(ed,f),_}intersectSphere(e,n){ws.subVectors(e.center,this.origin);const i=ws.dot(this.direction),s=ws.dot(ws)-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,n):this.at(a,n)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/n;return i>=0?i:null}intersectPlane(e,n){const i=this.distanceToPlane(e);return i===null?null:this.at(i,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let i,s,r,o,a,l;const u=1/this.direction.x,d=1/this.direction.y,h=1/this.direction.z,f=this.origin;return u>=0?(i=(e.min.x-f.x)*u,s=(e.max.x-f.x)*u):(i=(e.max.x-f.x)*u,s=(e.min.x-f.x)*u),d>=0?(r=(e.min.y-f.y)*d,o=(e.max.y-f.y)*d):(r=(e.max.y-f.y)*d,o=(e.min.y-f.y)*d),i>o||r>s||((r>i||isNaN(i))&&(i=r),(o=0?(a=(e.min.z-f.z)*h,l=(e.max.z-f.z)*h):(a=(e.max.z-f.z)*h,l=(e.min.z-f.z)*h),i>l||a>s)||((a>i||i!==i)&&(i=a),(l=0?i:s,n)}intersectsBox(e){return this.intersectBox(e,ws)!==null}intersectTriangle(e,n,i,s,r){jm.subVectors(n,e),td.subVectors(i,e),Qm.crossVectors(jm,td);let o=this.direction.dot(Qm),a;if(o>0){if(s)return null;a=1}else if(o<0)a=-1,o=-o;else return null;ir.subVectors(this.origin,e);const l=a*this.direction.dot(td.crossVectors(ir,td));if(l<0)return null;const u=a*this.direction.dot(jm.cross(ir));if(u<0||l+u>o)return null;const d=-a*ir.dot(Qm);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 Rt{constructor(e,n,i,s,r,o,a,l,u,d,h,f,_,m,E,b){Rt.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,n,i,s,r,o,a,l,u,d,h,f,_,m,E,b)}set(e,n,i,s,r,o,a,l,u,d,h,f,_,m,E,b){const g=this.elements;return g[0]=e,g[4]=n,g[8]=i,g[12]=s,g[1]=r,g[5]=o,g[9]=a,g[13]=l,g[2]=u,g[6]=d,g[10]=h,g[14]=f,g[3]=_,g[7]=m,g[11]=E,g[15]=b,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 Rt().fromArray(this.elements)}copy(e){const n=this.elements,i=e.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],n[9]=i[9],n[10]=i[10],n[11]=i[11],n[12]=i[12],n[13]=i[13],n[14]=i[14],n[15]=i[15],this}copyPosition(e){const n=this.elements,i=e.elements;return n[12]=i[12],n[13]=i[13],n[14]=i[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,i){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,n,i){return this.set(e.x,n.x,i.x,0,e.y,n.y,i.y,0,e.z,n.z,i.z,0,0,0,0,1),this}extractRotation(e){const n=this.elements,i=e.elements,s=1/Lo.setFromMatrixColumn(e,0).length(),r=1/Lo.setFromMatrixColumn(e,1).length(),o=1/Lo.setFromMatrixColumn(e,2).length();return n[0]=i[0]*s,n[1]=i[1]*s,n[2]=i[2]*s,n[3]=0,n[4]=i[4]*r,n[5]=i[5]*r,n[6]=i[6]*r,n[7]=0,n[8]=i[8]*o,n[9]=i[9]*o,n[10]=i[10]*o,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,i=e.x,s=e.y,r=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(s),u=Math.sin(s),d=Math.cos(r),h=Math.sin(r);if(e.order==="XYZ"){const f=o*d,_=o*h,m=a*d,E=a*h;n[0]=l*d,n[4]=-l*h,n[8]=u,n[1]=_+m*u,n[5]=f-E*u,n[9]=-a*l,n[2]=E-f*u,n[6]=m+_*u,n[10]=o*l}else if(e.order==="YXZ"){const f=l*d,_=l*h,m=u*d,E=u*h;n[0]=f+E*a,n[4]=m*a-_,n[8]=o*u,n[1]=o*h,n[5]=o*d,n[9]=-a,n[2]=_*a-m,n[6]=E+f*a,n[10]=o*l}else if(e.order==="ZXY"){const f=l*d,_=l*h,m=u*d,E=u*h;n[0]=f-E*a,n[4]=-o*h,n[8]=m+_*a,n[1]=_+m*a,n[5]=o*d,n[9]=E-f*a,n[2]=-o*u,n[6]=a,n[10]=o*l}else if(e.order==="ZYX"){const f=o*d,_=o*h,m=a*d,E=a*h;n[0]=l*d,n[4]=m*u-_,n[8]=f*u+E,n[1]=l*h,n[5]=E*u+f,n[9]=_*u-m,n[2]=-u,n[6]=a*l,n[10]=o*l}else if(e.order==="YZX"){const f=o*l,_=o*u,m=a*l,E=a*u;n[0]=l*d,n[4]=E-f*h,n[8]=m*h+_,n[1]=h,n[5]=o*d,n[9]=-a*d,n[2]=-u*d,n[6]=_*h+m,n[10]=f-E*h}else if(e.order==="XZY"){const f=o*l,_=o*u,m=a*l,E=a*u;n[0]=l*d,n[4]=-h,n[8]=u*d,n[1]=f*h+E,n[5]=o*d,n[9]=_*h-m,n[2]=m*h-_,n[6]=a*d,n[10]=E*h+f}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(qRt,e,YRt)}lookAt(e,n,i){const s=this.elements;return ii.subVectors(e,n),ii.lengthSq()===0&&(ii.z=1),ii.normalize(),sr.crossVectors(i,ii),sr.lengthSq()===0&&(Math.abs(i.z)===1?ii.x+=1e-4:ii.z+=1e-4,ii.normalize(),sr.crossVectors(i,ii)),sr.normalize(),nd.crossVectors(ii,sr),s[0]=sr.x,s[4]=nd.x,s[8]=ii.x,s[1]=sr.y,s[5]=nd.y,s[9]=ii.y,s[2]=sr.z,s[6]=nd.z,s[10]=ii.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const i=e.elements,s=n.elements,r=this.elements,o=i[0],a=i[4],l=i[8],u=i[12],d=i[1],h=i[5],f=i[9],_=i[13],m=i[2],E=i[6],b=i[10],g=i[14],y=i[3],v=i[7],S=i[11],C=i[15],T=s[0],O=s[4],k=s[8],x=s[12],I=s[1],F=s[5],B=s[9],ne=s[13],L=s[2],$=s[6],H=s[10],U=s[14],Q=s[3],J=s[7],j=s[11],ae=s[15];return r[0]=o*T+a*I+l*L+u*Q,r[4]=o*O+a*F+l*$+u*J,r[8]=o*k+a*B+l*H+u*j,r[12]=o*x+a*ne+l*U+u*ae,r[1]=d*T+h*I+f*L+_*Q,r[5]=d*O+h*F+f*$+_*J,r[9]=d*k+h*B+f*H+_*j,r[13]=d*x+h*ne+f*U+_*ae,r[2]=m*T+E*I+b*L+g*Q,r[6]=m*O+E*F+b*$+g*J,r[10]=m*k+E*B+b*H+g*j,r[14]=m*x+E*ne+b*U+g*ae,r[3]=y*T+v*I+S*L+C*Q,r[7]=y*O+v*F+S*$+C*J,r[11]=y*k+v*B+S*H+C*j,r[15]=y*x+v*ne+S*U+C*ae,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],i=e[4],s=e[8],r=e[12],o=e[1],a=e[5],l=e[9],u=e[13],d=e[2],h=e[6],f=e[10],_=e[14],m=e[3],E=e[7],b=e[11],g=e[15];return m*(+r*l*h-s*u*h-r*a*f+i*u*f+s*a*_-i*l*_)+E*(+n*l*_-n*u*f+r*o*f-s*o*_+s*u*d-r*l*d)+b*(+n*u*h-n*a*_-r*o*h+i*o*_+r*a*d-i*u*d)+g*(-s*a*d-n*l*h+n*a*f+s*o*h-i*o*f+i*l*d)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,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]=n,s[14]=i),this}invert(){const e=this.elements,n=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],u=e[7],d=e[8],h=e[9],f=e[10],_=e[11],m=e[12],E=e[13],b=e[14],g=e[15],y=h*b*u-E*f*u+E*l*_-a*b*_-h*l*g+a*f*g,v=m*f*u-d*b*u-m*l*_+o*b*_+d*l*g-o*f*g,S=d*E*u-m*h*u+m*a*_-o*E*_-d*a*g+o*h*g,C=m*h*l-d*E*l-m*a*f+o*E*f+d*a*b-o*h*b,T=n*y+i*v+s*S+r*C;if(T===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const O=1/T;return e[0]=y*O,e[1]=(E*f*r-h*b*r-E*s*_+i*b*_+h*s*g-i*f*g)*O,e[2]=(a*b*r-E*l*r+E*s*u-i*b*u-a*s*g+i*l*g)*O,e[3]=(h*l*r-a*f*r-h*s*u+i*f*u+a*s*_-i*l*_)*O,e[4]=v*O,e[5]=(d*b*r-m*f*r+m*s*_-n*b*_-d*s*g+n*f*g)*O,e[6]=(m*l*r-o*b*r-m*s*u+n*b*u+o*s*g-n*l*g)*O,e[7]=(o*f*r-d*l*r+d*s*u-n*f*u-o*s*_+n*l*_)*O,e[8]=S*O,e[9]=(m*h*r-d*E*r-m*i*_+n*E*_+d*i*g-n*h*g)*O,e[10]=(o*E*r-m*a*r+m*i*u-n*E*u-o*i*g+n*a*g)*O,e[11]=(d*a*r-o*h*r-d*i*u+n*h*u+o*i*_-n*a*_)*O,e[12]=C*O,e[13]=(d*E*s-m*h*s+m*i*f-n*E*f-d*i*b+n*h*b)*O,e[14]=(m*a*s-o*E*s-m*i*l+n*E*l+o*i*b-n*a*b)*O,e[15]=(o*h*s-d*a*s+d*i*l-n*h*l-o*i*f+n*a*f)*O,this}scale(e){const n=this.elements,i=e.x,s=e.y,r=e.z;return n[0]*=i,n[4]*=s,n[8]*=r,n[1]*=i,n[5]*=s,n[9]*=r,n[2]*=i,n[6]*=s,n[10]*=r,n[3]*=i,n[7]*=s,n[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements,n=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(n,i,s))}makeTranslation(e,n,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,n,0,0,1,i,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,n,-i,0,0,i,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,0,i,0,0,1,0,0,-i,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,0,i,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const i=Math.cos(n),s=Math.sin(n),r=1-i,o=e.x,a=e.y,l=e.z,u=r*o,d=r*a;return this.set(u*o+i,u*a-s*l,u*l+s*a,0,u*a+s*l,d*a+i,d*l-s*o,0,u*l-s*a,d*l+s*o,r*l*l+i,0,0,0,0,1),this}makeScale(e,n,i){return this.set(e,0,0,0,0,n,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,n,i,s,r,o){return this.set(1,i,r,0,e,1,o,0,n,s,1,0,0,0,0,1),this}compose(e,n,i){const s=this.elements,r=n._x,o=n._y,a=n._z,l=n._w,u=r+r,d=o+o,h=a+a,f=r*u,_=r*d,m=r*h,E=o*d,b=o*h,g=a*h,y=l*u,v=l*d,S=l*h,C=i.x,T=i.y,O=i.z;return s[0]=(1-(E+g))*C,s[1]=(_+S)*C,s[2]=(m-v)*C,s[3]=0,s[4]=(_-S)*T,s[5]=(1-(f+g))*T,s[6]=(b+y)*T,s[7]=0,s[8]=(m+v)*O,s[9]=(b-y)*O,s[10]=(1-(f+E))*O,s[11]=0,s[12]=e.x,s[13]=e.y,s[14]=e.z,s[15]=1,this}decompose(e,n,i){const s=this.elements;let r=Lo.set(s[0],s[1],s[2]).length();const o=Lo.set(s[4],s[5],s[6]).length(),a=Lo.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],Mi.copy(this);const u=1/r,d=1/o,h=1/a;return Mi.elements[0]*=u,Mi.elements[1]*=u,Mi.elements[2]*=u,Mi.elements[4]*=d,Mi.elements[5]*=d,Mi.elements[6]*=d,Mi.elements[8]*=h,Mi.elements[9]*=h,Mi.elements[10]*=h,n.setFromRotationMatrix(Mi),i.x=r,i.y=o,i.z=a,this}makePerspective(e,n,i,s,r,o,a=Us){const l=this.elements,u=2*r/(n-e),d=2*r/(i-s),h=(n+e)/(n-e),f=(i+s)/(i-s);let _,m;if(a===Us)_=-(o+r)/(o-r),m=-2*o*r/(o-r);else if(a===bu)_=-o/(o-r),m=-o*r/(o-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=u,l[4]=0,l[8]=h,l[12]=0,l[1]=0,l[5]=d,l[9]=f,l[13]=0,l[2]=0,l[6]=0,l[10]=_,l[14]=m,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,n,i,s,r,o,a=Us){const l=this.elements,u=1/(n-e),d=1/(i-s),h=1/(o-r),f=(n+e)*u,_=(i+s)*d;let m,E;if(a===Us)m=(o+r)*h,E=-2*h;else if(a===bu)m=r*h,E=-1*h;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*u,l[4]=0,l[8]=0,l[12]=-f,l[1]=0,l[5]=2*d,l[9]=0,l[13]=-_,l[2]=0,l[6]=0,l[10]=E,l[14]=-m,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const n=this.elements,i=e.elements;for(let s=0;s<16;s++)if(n[s]!==i[s])return!1;return!0}fromArray(e,n=0){for(let i=0;i<16;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){const i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e[n+9]=i[9],e[n+10]=i[10],e[n+11]=i[11],e[n+12]=i[12],e[n+13]=i[13],e[n+14]=i[14],e[n+15]=i[15],e}}const Lo=new _e,Mi=new Rt,qRt=new _e(0,0,0),YRt=new _e(1,1,1),sr=new _e,nd=new _e,ii=new _e,O1=new Rt,I1=new Ir;class up{constructor(e=0,n=0,i=0,s=up.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,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,n,i,s=this._order){return this._x=e,this._y=n,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,n=this._order,i=!0){const s=e.elements,r=s[0],o=s[4],a=s[8],l=s[1],u=s[5],d=s[9],h=s[2],f=s[6],_=s[10];switch(n){case"XYZ":this._y=Math.asin(Ln(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-d,_),this._z=Math.atan2(-o,r)):(this._x=Math.atan2(f,u),this._z=0);break;case"YXZ":this._x=Math.asin(-Ln(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(a,_),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-h,r),this._z=0);break;case"ZXY":this._x=Math.asin(Ln(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-h,_),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(l,r));break;case"ZYX":this._y=Math.asin(-Ln(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(f,_),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-o,u));break;case"YZX":this._z=Math.asin(Ln(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-d,u),this._y=Math.atan2(-h,r)):(this._x=0,this._y=Math.atan2(a,_));break;case"XZY":this._z=Math.asin(-Ln(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(f,u),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-d,_),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,i){return O1.makeRotationFromQuaternion(e),this.setFromRotationMatrix(O1,n,i)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return I1.setFromEuler(this),this.setFromQuaternion(I1,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=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+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}}up.DEFAULT_ORDER="XYZ";class oI{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let n=0;n1){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 u=0,d=l.length;u0){s.children=[];for(let a=0;a0){s.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),u.length>0&&(i.textures=u),d.length>0&&(i.images=d),h.length>0&&(i.shapes=h),f.length>0&&(i.skeletons=f),_.length>0&&(i.animations=_),m.length>0&&(i.nodes=m)}return i.object=s,i;function o(a){const l=[];for(const u in a){const d=a[u];delete d.metadata,l.push(d)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!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)),n===!0)for(let i=0;i0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(e,n,i,s,r){Di.subVectors(s,n),As.subVectors(i,n),Xm.subVectors(e,n);const o=Di.dot(Di),a=Di.dot(As),l=Di.dot(Xm),u=As.dot(As),d=As.dot(Xm),h=o*u-a*a;if(h===0)return r.set(-2,-1,-1);const f=1/h,_=(u*l-a*d)*f,m=(o*d-a*l)*f;return r.set(1-_-m,m,_)}static containsPoint(e,n,i,s){return this.getBarycoord(e,n,i,s,Ns),Ns.x>=0&&Ns.y>=0&&Ns.x+Ns.y<=1}static getUV(e,n,i,s,r,o,a,l){return sd===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),sd=!0),this.getInterpolation(e,n,i,s,r,o,a,l)}static getInterpolation(e,n,i,s,r,o,a,l){return this.getBarycoord(e,n,i,s,Ns),l.setScalar(0),l.addScaledVector(r,Ns.x),l.addScaledVector(o,Ns.y),l.addScaledVector(a,Ns.z),l}static isFrontFacing(e,n,i,s){return Di.subVectors(i,n),As.subVectors(e,n),Di.cross(As).dot(s)<0}set(e,n,i){return this.a.copy(e),this.b.copy(n),this.c.copy(i),this}setFromPointsAndIndices(e,n,i,s){return this.a.copy(e[n]),this.b.copy(e[i]),this.c.copy(e[s]),this}setFromAttributeAndIndices(e,n,i,s){return this.a.fromBufferAttribute(e,n),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 Di.subVectors(this.c,this.b),As.subVectors(this.a,this.b),Di.cross(As).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Ui.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return Ui.getBarycoord(e,this.a,this.b,this.c,n)}getUV(e,n,i,s,r){return sd===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),sd=!0),Ui.getInterpolation(e,this.a,this.b,this.c,n,i,s,r)}getInterpolation(e,n,i,s,r){return Ui.getInterpolation(e,this.a,this.b,this.c,n,i,s,r)}containsPoint(e){return Ui.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Ui.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const i=this.a,s=this.b,r=this.c;let o,a;Uo.subVectors(s,i),Fo.subVectors(r,i),Zm.subVectors(e,i);const l=Uo.dot(Zm),u=Fo.dot(Zm);if(l<=0&&u<=0)return n.copy(i);Jm.subVectors(e,s);const d=Uo.dot(Jm),h=Fo.dot(Jm);if(d>=0&&h<=d)return n.copy(s);const f=l*h-d*u;if(f<=0&&l>=0&&d<=0)return o=l/(l-d),n.copy(i).addScaledVector(Uo,o);eg.subVectors(e,r);const _=Uo.dot(eg),m=Fo.dot(eg);if(m>=0&&_<=m)return n.copy(r);const E=_*u-l*m;if(E<=0&&u>=0&&m<=0)return a=u/(u-m),n.copy(i).addScaledVector(Fo,a);const b=d*m-_*h;if(b<=0&&h-d>=0&&_-m>=0)return P1.subVectors(r,s),a=(h-d)/(h-d+(_-m)),n.copy(s).addScaledVector(P1,a);const g=1/(b+E+f);return o=E*g,a=f*g,n.copy(i).addScaledVector(Uo,o).addScaledVector(Fo,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const aI={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},rr={h:0,s:0,l:0},rd={h:0,s:0,l:0};function tg(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}class gt{constructor(e,n,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,i)}set(e,n,i){if(n===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,n,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=on){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Gt.toWorkingColorSpace(this,n),this}setRGB(e,n,i,s=Gt.workingColorSpace){return this.r=e,this.g=n,this.b=i,Gt.toWorkingColorSpace(this,s),this}setHSL(e,n,i,s=Gt.workingColorSpace){if(e=JE(e,1),n=Ln(n,0,1),i=Ln(i,0,1),n===0)this.r=this.g=this.b=i;else{const r=i<=.5?i*(1+n):i+n-i*n,o=2*i-r;this.r=tg(o,r,e+1/3),this.g=tg(o,r,e),this.b=tg(o,r,e-1/3)}return Gt.toWorkingColorSpace(this,s),this}setStyle(e,n=on){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,n);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,n);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,n);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,n);if(o===6)return this.setHex(parseInt(r,16),n);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=on){const i=aI[e.toLowerCase()];return i!==void 0?this.setHex(i,n):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=la(e.r),this.g=la(e.g),this.b=la(e.b),this}copyLinearToSRGB(e){return this.r=Hm(e.r),this.g=Hm(e.g),this.b=Hm(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=on){return Gt.fromWorkingColorSpace(Dn.copy(this),e),Math.round(Ln(Dn.r*255,0,255))*65536+Math.round(Ln(Dn.g*255,0,255))*256+Math.round(Ln(Dn.b*255,0,255))}getHexString(e=on){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=Gt.workingColorSpace){Gt.fromWorkingColorSpace(Dn.copy(this),n);const i=Dn.r,s=Dn.g,r=Dn.b,o=Math.max(i,s,r),a=Math.min(i,s,r);let l,u;const d=(a+o)/2;if(a===o)l=0,u=0;else{const h=o-a;switch(u=d<=.5?h/(o+a):h/(2-o-a),o){case i:l=(s-r)/h+(s0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const i=e[n];if(i===void 0){console.warn(`THREE.Material: parameter '${n}' has value of undefined.`);continue}const s=this[n];if(s===void 0){console.warn(`THREE.Material: '${n}' 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[n]=i}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(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!==aa&&(i.blending=this.blending),this.side!==Ys&&(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!==sb&&(i.blendSrc=this.blendSrc),this.blendDst!==rb&&(i.blendDst=this.blendDst),this.blendEquation!==Xr&&(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!==_u&&(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!==T1&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Oo&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Oo&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Oo&&(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(n){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 n=e.clippingPlanes;let i=null;if(n!==null){const s=n.length;i=new Array(s);for(let r=0;r!==s;++r)i[r]=n[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 Er extends Hi{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new gt(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=jE,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 dn=new _e,od=new It;class Yn{constructor(e,n,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=n,this.count=e!==void 0?e.length/n:0,this.normalized=i,this.usage=db,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Ps,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,n){this.updateRanges.push({start:e,count:n})}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,n,i){e*=this.itemSize,i*=n.itemSize;for(let s=0,r=this.itemSize;s0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const u in l)l[u]!==void 0&&(e[u]=l[u]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const i=this.attributes;for(const l in i){const u=i[l];e.data.attributes[l]=u.toJSON(e.data)}const s={};let r=!1;for(const l in this.morphAttributes){const u=this.morphAttributes[l],d=[];for(let h=0,f=u.length;h0&&(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 n={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone(n));const s=e.attributes;for(const u in s){const d=s[u];this.setAttribute(u,d.clone(n))}const r=e.morphAttributes;for(const u in r){const d=[],h=r[u];for(let f=0,_=h.length;f<_;f++)d.push(h[f].clone(n));this.morphAttributes[u]=d}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let u=0,d=o.length;u0){const s=n[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;r(e.far-e.near)**2))&&(U1.copy(r).invert(),Gr.copy(e.ray).applyMatrix4(U1),!(i.boundingBox!==null&&Gr.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,n,Gr)))}_computeIntersections(e,n,i){let s;const r=this.geometry,o=this.material,a=r.index,l=r.attributes.position,u=r.attributes.uv,d=r.attributes.uv1,h=r.attributes.normal,f=r.groups,_=r.drawRange;if(a!==null)if(Array.isArray(o))for(let m=0,E=f.length;mn.far?null:{distance:u,point:_d.clone(),object:t}}function hd(t,e,n,i,s,r,o,a,l,u){t.getVertexPosition(a,Go),t.getVertexPosition(l,Vo),t.getVertexPosition(u,zo);const d=JRt(t,e,n,i,Go,Vo,zo,pd);if(d){s&&(cd.fromBufferAttribute(s,a),dd.fromBufferAttribute(s,l),ud.fromBufferAttribute(s,u),d.uv=Ui.getInterpolation(pd,Go,Vo,zo,cd,dd,ud,new It)),r&&(cd.fromBufferAttribute(r,a),dd.fromBufferAttribute(r,l),ud.fromBufferAttribute(r,u),d.uv1=Ui.getInterpolation(pd,Go,Vo,zo,cd,dd,ud,new It),d.uv2=d.uv1),o&&(B1.fromBufferAttribute(o,a),G1.fromBufferAttribute(o,l),V1.fromBufferAttribute(o,u),d.normal=Ui.getInterpolation(pd,Go,Vo,zo,B1,G1,V1,new _e),d.normal.dot(i.direction)>0&&d.normal.multiplyScalar(-1));const h={a,b:l,c:u,normal:new _e,materialIndex:0};Ui.getNormal(Go,Vo,zo,h.normal),d.face=h}return d}class Cr extends ms{constructor(e=1,n=1,i=1,s=1,r=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,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=[],u=[],d=[],h=[];let f=0,_=0;m("z","y","x",-1,-1,i,n,e,o,r,0),m("z","y","x",1,-1,i,n,-e,o,r,1),m("x","z","y",1,1,e,i,n,s,o,2),m("x","z","y",1,-1,e,i,-n,s,o,3),m("x","y","z",1,-1,e,n,i,s,r,4),m("x","y","z",-1,-1,e,n,-i,s,r,5),this.setIndex(l),this.setAttribute("position",new Bs(u,3)),this.setAttribute("normal",new Bs(d,3)),this.setAttribute("uv",new Bs(h,2));function m(E,b,g,y,v,S,C,T,O,k,x){const I=S/O,F=C/k,B=S/2,ne=C/2,L=T/2,$=O+1,H=k+1;let U=0,Q=0;const J=new _e;for(let j=0;j0?1:-1,d.push(J.x,J.y,J.z),h.push(ve/O),h.push(1-j/k),U+=1}}for(let j=0;j0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;const i={};for(const s in this.extensions)this.extensions[s]===!0&&(i[s]=!0);return Object.keys(i).length>0&&(n.extensions=i),n}}class uI extends rn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Rt,this.projectionMatrix=new Rt,this.projectionMatrixInverse=new Rt,this.coordinateSystem=Us}copy(e,n){return super.copy(e,n),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,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class zn extends uI{constructor(e=50,n=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=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),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 n=.5*this.getFilmHeight()/e;this.fov=Aa*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Ul*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Aa*2*Math.atan(Math.tan(Ul*.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,n,i,s,r,o){this.aspect=e/n,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=n,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 n=e*Math.tan(Ul*.5*this.fov)/this.zoom,i=2*n,s=this.aspect*i,r=-.5*s;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,u=o.fullHeight;r+=o.offsetX*s/l,n-=o.offsetY*i/u,s*=o.width/l,i*=o.height/u}const a=this.filmOffset;a!==0&&(r+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,n,n-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}const Ho=-90,qo=1;class iAt extends rn{constructor(e,n,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const s=new zn(Ho,qo,e,n);s.layers=this.layers,this.add(s);const r=new zn(Ho,qo,e,n);r.layers=this.layers,this.add(r);const o=new zn(Ho,qo,e,n);o.layers=this.layers,this.add(o);const a=new zn(Ho,qo,e,n);a.layers=this.layers,this.add(a);const l=new zn(Ho,qo,e,n);l.layers=this.layers,this.add(l);const u=new zn(Ho,qo,e,n);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){const e=this.coordinateSystem,n=this.children.concat(),[i,s,r,o,a,l]=n;for(const u of n)this.remove(u);if(e===Us)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===bu)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 u of n)this.add(u),u.updateMatrixWorld()}update(e,n){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,u,d]=this.children,h=e.getRenderTarget(),f=e.getActiveCubeFace(),_=e.getActiveMipmapLevel(),m=e.xr.enabled;e.xr.enabled=!1;const E=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,s),e.render(n,r),e.setRenderTarget(i,1,s),e.render(n,o),e.setRenderTarget(i,2,s),e.render(n,a),e.setRenderTarget(i,3,s),e.render(n,l),e.setRenderTarget(i,4,s),e.render(n,u),i.texture.generateMipmaps=E,e.setRenderTarget(i,5,s),e.render(n,d),e.setRenderTarget(h,f,_),e.xr.enabled=m,i.texture.needsPMREMUpdate=!0}}class pI extends Nn{constructor(e,n,i,s,r,o,a,l,u,d){e=e!==void 0?e:[],n=n!==void 0?n:Ta,super(e,n,i,s,r,o,a,l,u,d),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class sAt extends mo{constructor(e=1,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},s=[i,i,i,i,i,i];n.encoding!==void 0&&(Bl("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),n.colorSpace=n.encoding===lo?on:bi),this.texture=new pI(s,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=n.generateMipmaps!==void 0?n.generateMipmaps:!1,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:jn}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.colorSpace=n.colorSpace,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` +}`;class go extends Hi{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=nAt,this.fragmentShader=iAt,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=Na(e.uniforms),this.uniformsGroups=eAt(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 n=super.toJSON(e);n.glslVersion=this.glslVersion,n.uniforms={};for(const s in this.uniforms){const o=this.uniforms[s].value;o&&o.isTexture?n.uniforms[s]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?n.uniforms[s]={type:"c",value:o.getHex()}:o&&o.isVector2?n.uniforms[s]={type:"v2",value:o.toArray()}:o&&o.isVector3?n.uniforms[s]={type:"v3",value:o.toArray()}:o&&o.isVector4?n.uniforms[s]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?n.uniforms[s]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?n.uniforms[s]={type:"m4",value:o.toArray()}:n.uniforms[s]={value:o}}Object.keys(this.defines).length>0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;const i={};for(const s in this.extensions)this.extensions[s]===!0&&(i[s]=!0);return Object.keys(i).length>0&&(n.extensions=i),n}}class uI extends rn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Rt,this.projectionMatrix=new Rt,this.projectionMatrixInverse=new Rt,this.coordinateSystem=Us}copy(e,n){return super.copy(e,n),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,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class zn extends uI{constructor(e=50,n=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=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),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 n=.5*this.getFilmHeight()/e;this.fov=Aa*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Ul*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Aa*2*Math.atan(Math.tan(Ul*.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,n,i,s,r,o){this.aspect=e/n,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=n,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 n=e*Math.tan(Ul*.5*this.fov)/this.zoom,i=2*n,s=this.aspect*i,r=-.5*s;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,u=o.fullHeight;r+=o.offsetX*s/l,n-=o.offsetY*i/u,s*=o.width/l,i*=o.height/u}const a=this.filmOffset;a!==0&&(r+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,n,n-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}const Ho=-90,qo=1;class sAt extends rn{constructor(e,n,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const s=new zn(Ho,qo,e,n);s.layers=this.layers,this.add(s);const r=new zn(Ho,qo,e,n);r.layers=this.layers,this.add(r);const o=new zn(Ho,qo,e,n);o.layers=this.layers,this.add(o);const a=new zn(Ho,qo,e,n);a.layers=this.layers,this.add(a);const l=new zn(Ho,qo,e,n);l.layers=this.layers,this.add(l);const u=new zn(Ho,qo,e,n);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){const e=this.coordinateSystem,n=this.children.concat(),[i,s,r,o,a,l]=n;for(const u of n)this.remove(u);if(e===Us)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===bu)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 u of n)this.add(u),u.updateMatrixWorld()}update(e,n){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,u,d]=this.children,h=e.getRenderTarget(),f=e.getActiveCubeFace(),_=e.getActiveMipmapLevel(),m=e.xr.enabled;e.xr.enabled=!1;const E=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,s),e.render(n,r),e.setRenderTarget(i,1,s),e.render(n,o),e.setRenderTarget(i,2,s),e.render(n,a),e.setRenderTarget(i,3,s),e.render(n,l),e.setRenderTarget(i,4,s),e.render(n,u),i.texture.generateMipmaps=E,e.setRenderTarget(i,5,s),e.render(n,d),e.setRenderTarget(h,f,_),e.xr.enabled=m,i.texture.needsPMREMUpdate=!0}}class pI extends Nn{constructor(e,n,i,s,r,o,a,l,u,d){e=e!==void 0?e:[],n=n!==void 0?n:Ta,super(e,n,i,s,r,o,a,l,u,d),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class rAt extends mo{constructor(e=1,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},s=[i,i,i,i,i,i];n.encoding!==void 0&&(Bl("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),n.colorSpace=n.encoding===lo?on:bi),this.texture=new pI(s,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=n.generateMipmaps!==void 0?n.generateMipmaps:!1,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:jn}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.colorSpace=n.colorSpace,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; @@ -240,9 +240,9 @@ ${l}`;navigator.clipboard.writeText(u)}else navigator.clipboard.writeText(e);thi gl_FragColor = texture2D( tEquirect, sampleUV ); } - `},s=new Cr(5,5,5),r=new go({name:"CubemapFromEquirect",uniforms:Na(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Zn,blending:Sr});r.uniforms.tEquirect.value=n;const o=new Hn(s,r),a=n.minFilter;return n.minFilter===fo&&(n.minFilter=jn),new iAt(1,10,this).update(e,o),n.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,n,i,s){const r=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(n,i,s);e.setRenderTarget(r)}}const sg=new _e,rAt=new _e,oAt=new wt;class Yr{constructor(e=new _e(1,0,0),n=0){this.isPlane=!0,this.normal=e,this.constant=n}set(e,n){return this.normal.copy(e),this.constant=n,this}setComponents(e,n,i,s){return this.normal.set(e,n,i),this.constant=s,this}setFromNormalAndCoplanarPoint(e,n){return this.normal.copy(e),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(e,n,i){const s=sg.subVectors(i,n).cross(rAt.subVectors(e,n)).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,n){return n.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,n){const i=e.delta(sg),s=this.normal.dot(i);if(s===0)return this.distanceToPoint(e.start)===0?n.copy(e.start):null;const r=-(e.start.dot(this.normal)+this.constant)/s;return r<0||r>1?null:n.copy(e.start).addScaledVector(i,r)}intersectsLine(e){const n=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return n<0&&i>0||i<0&&n>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,n){const i=n||oAt.getNormalMatrix(e),s=this.coplanarPoint(sg).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 Vr=new fs,fd=new _e;class ey{constructor(e=new Yr,n=new Yr,i=new Yr,s=new Yr,r=new Yr,o=new Yr){this.planes=[e,n,i,s,r,o]}set(e,n,i,s,r,o){const a=this.planes;return a[0].copy(e),a[1].copy(n),a[2].copy(i),a[3].copy(s),a[4].copy(r),a[5].copy(o),this}copy(e){const n=this.planes;for(let i=0;i<6;i++)n[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,n=Us){const i=this.planes,s=e.elements,r=s[0],o=s[1],a=s[2],l=s[3],u=s[4],d=s[5],h=s[6],f=s[7],_=s[8],m=s[9],E=s[10],b=s[11],g=s[12],y=s[13],v=s[14],S=s[15];if(i[0].setComponents(l-r,f-u,b-_,S-g).normalize(),i[1].setComponents(l+r,f+u,b+_,S+g).normalize(),i[2].setComponents(l+o,f+d,b+m,S+y).normalize(),i[3].setComponents(l-o,f-d,b-m,S-y).normalize(),i[4].setComponents(l-a,f-h,b-E,S-v).normalize(),n===Us)i[5].setComponents(l+a,f+h,b+E,S+v).normalize();else if(n===bu)i[5].setComponents(a,h,E,v).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Vr.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),Vr.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Vr)}intersectsSprite(e){return Vr.center.set(0,0,0),Vr.radius=.7071067811865476,Vr.applyMatrix4(e.matrixWorld),this.intersectsSphere(Vr)}intersectsSphere(e){const n=this.planes,i=e.center,s=-e.radius;for(let r=0;r<6;r++)if(n[r].distanceToPoint(i)0?e.max.x:e.min.x,fd.y=s.normal.y>0?e.max.y:e.min.y,fd.z=s.normal.z>0?e.max.z:e.min.z,s.distanceToPoint(fd)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let i=0;i<6;i++)if(n[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function _I(){let t=null,e=!1,n=null,i=null;function s(r,o){n(r,o),i=t.requestAnimationFrame(s)}return{start:function(){e!==!0&&n!==null&&(i=t.requestAnimationFrame(s),e=!0)},stop:function(){t.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(r){n=r},setContext:function(r){t=r}}}function aAt(t,e){const n=e.isWebGL2,i=new WeakMap;function s(u,d){const h=u.array,f=u.usage,_=h.byteLength,m=t.createBuffer();t.bindBuffer(d,m),t.bufferData(d,h,f),u.onUploadCallback();let E;if(h instanceof Float32Array)E=t.FLOAT;else if(h instanceof Uint16Array)if(u.isFloat16BufferAttribute)if(n)E=t.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else E=t.UNSIGNED_SHORT;else if(h instanceof Int16Array)E=t.SHORT;else if(h instanceof Uint32Array)E=t.UNSIGNED_INT;else if(h instanceof Int32Array)E=t.INT;else if(h instanceof Int8Array)E=t.BYTE;else if(h instanceof Uint8Array)E=t.UNSIGNED_BYTE;else if(h instanceof Uint8ClampedArray)E=t.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+h);return{buffer:m,type:E,bytesPerElement:h.BYTES_PER_ELEMENT,version:u.version,size:_}}function r(u,d,h){const f=d.array,_=d._updateRange,m=d.updateRanges;if(t.bindBuffer(h,u),_.count===-1&&m.length===0&&t.bufferSubData(h,0,f),m.length!==0){for(let E=0,b=m.length;E1?null:n.copy(e.start).addScaledVector(i,r)}intersectsLine(e){const n=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return n<0&&i>0||i<0&&n>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,n){const i=n||aAt.getNormalMatrix(e),s=this.coplanarPoint(sg).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 Vr=new fs,fd=new _e;class ey{constructor(e=new Yr,n=new Yr,i=new Yr,s=new Yr,r=new Yr,o=new Yr){this.planes=[e,n,i,s,r,o]}set(e,n,i,s,r,o){const a=this.planes;return a[0].copy(e),a[1].copy(n),a[2].copy(i),a[3].copy(s),a[4].copy(r),a[5].copy(o),this}copy(e){const n=this.planes;for(let i=0;i<6;i++)n[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,n=Us){const i=this.planes,s=e.elements,r=s[0],o=s[1],a=s[2],l=s[3],u=s[4],d=s[5],h=s[6],f=s[7],_=s[8],m=s[9],E=s[10],b=s[11],g=s[12],y=s[13],v=s[14],S=s[15];if(i[0].setComponents(l-r,f-u,b-_,S-g).normalize(),i[1].setComponents(l+r,f+u,b+_,S+g).normalize(),i[2].setComponents(l+o,f+d,b+m,S+y).normalize(),i[3].setComponents(l-o,f-d,b-m,S-y).normalize(),i[4].setComponents(l-a,f-h,b-E,S-v).normalize(),n===Us)i[5].setComponents(l+a,f+h,b+E,S+v).normalize();else if(n===bu)i[5].setComponents(a,h,E,v).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Vr.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),Vr.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Vr)}intersectsSprite(e){return Vr.center.set(0,0,0),Vr.radius=.7071067811865476,Vr.applyMatrix4(e.matrixWorld),this.intersectsSphere(Vr)}intersectsSphere(e){const n=this.planes,i=e.center,s=-e.radius;for(let r=0;r<6;r++)if(n[r].distanceToPoint(i)0?e.max.x:e.min.x,fd.y=s.normal.y>0?e.max.y:e.min.y,fd.z=s.normal.z>0?e.max.z:e.min.z,s.distanceToPoint(fd)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let i=0;i<6;i++)if(n[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function _I(){let t=null,e=!1,n=null,i=null;function s(r,o){n(r,o),i=t.requestAnimationFrame(s)}return{start:function(){e!==!0&&n!==null&&(i=t.requestAnimationFrame(s),e=!0)},stop:function(){t.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(r){n=r},setContext:function(r){t=r}}}function lAt(t,e){const n=e.isWebGL2,i=new WeakMap;function s(u,d){const h=u.array,f=u.usage,_=h.byteLength,m=t.createBuffer();t.bindBuffer(d,m),t.bufferData(d,h,f),u.onUploadCallback();let E;if(h instanceof Float32Array)E=t.FLOAT;else if(h instanceof Uint16Array)if(u.isFloat16BufferAttribute)if(n)E=t.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else E=t.UNSIGNED_SHORT;else if(h instanceof Int16Array)E=t.SHORT;else if(h instanceof Uint32Array)E=t.UNSIGNED_INT;else if(h instanceof Int32Array)E=t.INT;else if(h instanceof Int8Array)E=t.BYTE;else if(h instanceof Uint8Array)E=t.UNSIGNED_BYTE;else if(h instanceof Uint8ClampedArray)E=t.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+h);return{buffer:m,type:E,bytesPerElement:h.BYTES_PER_ELEMENT,version:u.version,size:_}}function r(u,d,h){const f=d.array,_=d._updateRange,m=d.updateRanges;if(t.bindBuffer(h,u),_.count===-1&&m.length===0&&t.bufferSubData(h,0,f),m.length!==0){for(let E=0,b=m.length;E 0 +#endif`,xAt=`#if NUM_CLIPPING_PLANES > 0 vec4 plane; #pragma unroll_loop_start for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { @@ -439,26 +439,26 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve #pragma unroll_loop_end if ( clipped ) discard; #endif -#endif`,xAt=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; #endif`,CAt=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; #endif`,wAt=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,RAt=`#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; -#endif`,RAt=`#if defined( USE_COLOR_ALPHA ) +#endif`,AAt=`#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; -#endif`,AAt=`#if defined( USE_COLOR_ALPHA ) +#endif`,NAt=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; -#endif`,NAt=`#if defined( USE_COLOR_ALPHA ) +#endif`,OAt=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) varying vec3 vColor; -#endif`,OAt=`#if defined( USE_COLOR_ALPHA ) +#endif`,IAt=`#if defined( USE_COLOR_ALPHA ) vColor = vec4( 1.0 ); #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) vColor = vec3( 1.0 ); @@ -468,7 +468,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`,IAt=`#define PI 3.141592653589793 +#endif`,MAt=`#define PI 3.141592653589793 #define PI2 6.283185307179586 #define PI_HALF 1.5707963267948966 #define RECIPROCAL_PI 0.3183098861837907 @@ -546,7 +546,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`,MAt=`#ifdef ENVMAP_TYPE_CUBE_UV +} // validated`,DAt=`#ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_minMipLevel 4.0 #define cubeUV_minTileSize 16.0 float getFace( vec3 direction ) { @@ -644,7 +644,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`,DAt=`vec3 transformedNormal = objectNormal; +#endif`,kAt=`vec3 transformedNormal = objectNormal; #ifdef USE_TANGENT vec3 transformedTangent = objectTangent; #endif @@ -673,18 +673,18 @@ transformedNormal = normalMatrix * transformedNormal; #ifdef FLIP_SIDED transformedTangent = - transformedTangent; #endif -#endif`,kAt=`#ifdef USE_DISPLACEMENTMAP +#endif`,LAt=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; -#endif`,LAt=`#ifdef USE_DISPLACEMENTMAP +#endif`,PAt=`#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); -#endif`,PAt=`#ifdef USE_EMISSIVEMAP +#endif`,UAt=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,UAt=`#ifdef USE_EMISSIVEMAP +#endif`,FAt=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; -#endif`,FAt="gl_FragColor = linearToOutputTexel( gl_FragColor );",BAt=` +#endif`,BAt="gl_FragColor = linearToOutputTexel( gl_FragColor );",GAt=` const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3( vec3( 0.8224621, 0.177538, 0.0 ), vec3( 0.0331941, 0.9668058, 0.0 ), @@ -712,7 +712,7 @@ vec4 LinearToLinear( in vec4 value ) { } vec4 LinearTosRGB( in vec4 value ) { return sRGBTransferOETF( value ); -}`,GAt=`#ifdef USE_ENVMAP +}`,VAt=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vec3 cameraToFrag; if ( isOrthographic ) { @@ -741,7 +741,7 @@ vec4 LinearTosRGB( in vec4 value ) { #elif defined( ENVMAP_BLENDING_ADD ) outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif -#endif`,VAt=`#ifdef USE_ENVMAP +#endif`,zAt=`#ifdef USE_ENVMAP uniform float envMapIntensity; uniform float flipEnvMap; #ifdef ENVMAP_TYPE_CUBE @@ -750,7 +750,7 @@ vec4 LinearTosRGB( in vec4 value ) { uniform sampler2D envMap; #endif -#endif`,zAt=`#ifdef USE_ENVMAP +#endif`,HAt=`#ifdef USE_ENVMAP uniform float reflectivity; #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS @@ -761,7 +761,7 @@ vec4 LinearTosRGB( in vec4 value ) { #else varying vec3 vReflect; #endif -#endif`,HAt=`#ifdef USE_ENVMAP +#endif`,qAt=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS #endif @@ -772,7 +772,7 @@ vec4 LinearTosRGB( in vec4 value ) { varying vec3 vReflect; uniform float refractionRatio; #endif -#endif`,qAt=`#ifdef USE_ENVMAP +#endif`,YAt=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vWorldPosition = worldPosition.xyz; #else @@ -789,18 +789,18 @@ vec4 LinearTosRGB( in vec4 value ) { vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); #endif #endif -#endif`,YAt=`#ifdef USE_FOG - vFogDepth = - mvPosition.z; #endif`,$At=`#ifdef USE_FOG - varying float vFogDepth; + vFogDepth = - mvPosition.z; #endif`,WAt=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,KAt=`#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`,KAt=`#ifdef USE_FOG +#endif`,jAt=`#ifdef USE_FOG uniform vec3 fogColor; varying float vFogDepth; #ifdef FOG_EXP2 @@ -809,7 +809,7 @@ vec4 LinearTosRGB( in vec4 value ) { uniform float fogNear; uniform float fogFar; #endif -#endif`,jAt=`#ifdef USE_GRADIENTMAP +#endif`,QAt=`#ifdef USE_GRADIENTMAP uniform sampler2D gradientMap; #endif vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { @@ -821,16 +821,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 -}`,QAt=`#ifdef USE_LIGHTMAP +}`,XAt=`#ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; reflectedLight.indirectDiffuse += lightMapIrradiance; -#endif`,XAt=`#ifdef USE_LIGHTMAP +#endif`,ZAt=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; -#endif`,ZAt=`LambertMaterial material; +#endif`,JAt=`LambertMaterial material; material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,JAt=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,eNt=`varying vec3 vViewPosition; struct LambertMaterial { vec3 diffuseColor; float specularStrength; @@ -844,7 +844,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`,eNt=`uniform bool receiveShadow; +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,tNt=`uniform bool receiveShadow; uniform vec3 ambientLightColor; #if defined( USE_LIGHT_PROBES ) uniform vec3 lightProbe[ 9 ]; @@ -967,7 +967,7 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); return irradiance; } -#endif`,tNt=`#ifdef USE_ENVMAP +#endif`,nNt=`#ifdef USE_ENVMAP vec3 getIBLIrradiance( const in vec3 normal ) { #ifdef ENVMAP_TYPE_CUBE_UV vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); @@ -1000,8 +1000,8 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi #endif } #endif -#endif`,nNt=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,iNt=`varying vec3 vViewPosition; +#endif`,iNt=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,sNt=`varying vec3 vViewPosition; struct ToonMaterial { vec3 diffuseColor; }; @@ -1013,11 +1013,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`,sNt=`BlinnPhongMaterial material; +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,rNt=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; -material.specularStrength = specularStrength;`,rNt=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,oNt=`varying vec3 vViewPosition; struct BlinnPhongMaterial { vec3 diffuseColor; vec3 specularColor; @@ -1034,7 +1034,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`,oNt=`PhysicalMaterial material; +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,aNt=`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 ); @@ -1117,7 +1117,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`,aNt=`struct PhysicalMaterial { +#endif`,lNt=`struct PhysicalMaterial { vec3 diffuseColor; float roughness; vec3 specularColor; @@ -1417,7 +1417,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 ); -}`,lNt=` +}`,cNt=` vec3 geometryPosition = - vViewPosition; vec3 geometryNormal = normal; vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); @@ -1532,7 +1532,7 @@ IncidentLight directLight; #if defined( RE_IndirectSpecular ) vec3 radiance = vec3( 0.0 ); vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,cNt=`#if defined( RE_IndirectDiffuse ) +#endif`,dNt=`#if defined( RE_IndirectDiffuse ) #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; @@ -1551,25 +1551,25 @@ IncidentLight directLight; #ifdef USE_CLEARCOAT clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); #endif -#endif`,dNt=`#if defined( RE_IndirectDiffuse ) +#endif`,uNt=`#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`,uNt=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; #endif`,pNt=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) + gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,_Nt=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; -#endif`,_Nt=`#ifdef USE_LOGDEPTHBUF +#endif`,hNt=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT varying float vFragDepth; varying float vIsPerspective; #else uniform float logDepthBufFC; #endif -#endif`,hNt=`#ifdef USE_LOGDEPTHBUF +#endif`,fNt=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); @@ -1579,16 +1579,16 @@ IncidentLight directLight; gl_Position.z *= gl_Position.w; } #endif -#endif`,fNt=`#ifdef USE_MAP +#endif`,mNt=`#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`,mNt=`#ifdef USE_MAP +#endif`,gNt=`#ifdef USE_MAP uniform sampler2D map; -#endif`,gNt=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) +#endif`,bNt=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) #if defined( USE_POINTS_UV ) vec2 uv = vUv; #else @@ -1600,7 +1600,7 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,bNt=`#if defined( USE_POINTS_UV ) +#endif`,ENt=`#if defined( USE_POINTS_UV ) varying vec2 vUv; #else #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) @@ -1612,13 +1612,13 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP uniform sampler2D alphaMap; -#endif`,ENt=`float metalnessFactor = metalness; +#endif`,yNt=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); metalnessFactor *= texelMetalness.b; -#endif`,yNt=`#ifdef USE_METALNESSMAP +#endif`,vNt=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; -#endif`,vNt=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) +#endif`,SNt=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) vColor *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { #if defined( USE_COLOR_ALPHA ) @@ -1627,7 +1627,7 @@ IncidentLight directLight; if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; #endif } -#endif`,SNt=`#ifdef USE_MORPHNORMALS +#endif`,TNt=`#ifdef USE_MORPHNORMALS objectNormal *= morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { @@ -1639,7 +1639,7 @@ IncidentLight directLight; objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; #endif -#endif`,TNt=`#ifdef USE_MORPHTARGETS +#endif`,xNt=`#ifdef USE_MORPHTARGETS uniform float morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; @@ -1659,7 +1659,7 @@ IncidentLight directLight; uniform float morphTargetInfluences[ 4 ]; #endif #endif -#endif`,xNt=`#ifdef USE_MORPHTARGETS +#endif`,CNt=`#ifdef USE_MORPHTARGETS transformed *= morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { @@ -1677,7 +1677,7 @@ IncidentLight directLight; transformed += morphTarget7 * morphTargetInfluences[ 7 ]; #endif #endif -#endif`,CNt=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#endif`,wNt=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; #ifdef FLAT_SHADED vec3 fdx = dFdx( vViewPosition ); vec3 fdy = dFdy( vViewPosition ); @@ -1718,7 +1718,7 @@ IncidentLight directLight; tbn2[1] *= faceDirection; #endif #endif -vec3 nonPerturbedNormal = normal;`,wNt=`#ifdef USE_NORMALMAP_OBJECTSPACE +vec3 nonPerturbedNormal = normal;`,RNt=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; #ifdef FLIP_SIDED normal = - normal; @@ -1733,12 +1733,6 @@ vec3 nonPerturbedNormal = normal;`,wNt=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = normalize( tbn * mapN ); #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,RNt=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif #endif`,ANt=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT @@ -1746,12 +1740,18 @@ vec3 nonPerturbedNormal = normal;`,wNt=`#ifdef USE_NORMALMAP_OBJECTSPACE varying vec3 vBitangent; #endif #endif`,NNt=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,ONt=`#ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif -#endif`,ONt=`#ifdef USE_NORMALMAP +#endif`,INt=`#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; #endif @@ -1773,13 +1773,13 @@ vec3 nonPerturbedNormal = normal;`,wNt=`#ifdef USE_NORMALMAP_OBJECTSPACE float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); return mat3( T * scale, B * scale, N ); } -#endif`,INt=`#ifdef USE_CLEARCOAT +#endif`,MNt=`#ifdef USE_CLEARCOAT vec3 clearcoatNormal = nonPerturbedNormal; -#endif`,MNt=`#ifdef USE_CLEARCOAT_NORMALMAP +#endif`,DNt=`#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; clearcoatNormal = normalize( tbn2 * clearcoatMapN ); -#endif`,DNt=`#ifdef USE_CLEARCOATMAP +#endif`,kNt=`#ifdef USE_CLEARCOATMAP uniform sampler2D clearcoatMap; #endif #ifdef USE_CLEARCOAT_NORMALMAP @@ -1788,18 +1788,18 @@ vec3 nonPerturbedNormal = normal;`,wNt=`#ifdef USE_NORMALMAP_OBJECTSPACE #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP uniform sampler2D clearcoatRoughnessMap; -#endif`,kNt=`#ifdef USE_IRIDESCENCEMAP +#endif`,LNt=`#ifdef USE_IRIDESCENCEMAP uniform sampler2D iridescenceMap; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform sampler2D iridescenceThicknessMap; -#endif`,LNt=`#ifdef OPAQUE +#endif`,PNt=`#ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= material.transmissionAlpha; #endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,PNt=`vec3 packNormalToRGB( const in vec3 normal ) { +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,UNt=`vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { @@ -1840,9 +1840,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 ); -}`,UNt=`#ifdef PREMULTIPLIED_ALPHA +}`,FNt=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; -#endif`,FNt=`vec4 mvPosition = vec4( transformed, 1.0 ); +#endif`,BNt=`vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING mvPosition = batchingMatrix * mvPosition; #endif @@ -1850,22 +1850,22 @@ float perspectiveDepthToViewZ( const in float depth, const in float near, const mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,BNt=`#ifdef DITHERING +gl_Position = projectionMatrix * mvPosition;`,GNt=`#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,GNt=`#ifdef DITHERING +#endif`,VNt=`#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`,VNt=`float roughnessFactor = roughness; +#endif`,zNt=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); roughnessFactor *= texelRoughness.g; -#endif`,zNt=`#ifdef USE_ROUGHNESSMAP +#endif`,HNt=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; -#endif`,HNt=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,qNt=`#if NUM_SPOT_LIGHT_COORDS > 0 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #if NUM_SPOT_LIGHT_MAPS > 0 @@ -2042,7 +2042,7 @@ gl_Position = projectionMatrix * mvPosition;`,BNt=`#ifdef DITHERING return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); #endif } -#endif`,qNt=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,YNt=`#if NUM_SPOT_LIGHT_COORDS > 0 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif @@ -2080,7 +2080,7 @@ gl_Position = projectionMatrix * mvPosition;`,BNt=`#ifdef DITHERING }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif -#endif`,YNt=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) +#endif`,$Nt=`#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 @@ -2112,7 +2112,7 @@ gl_Position = projectionMatrix * mvPosition;`,BNt=`#ifdef DITHERING vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end -#endif`,$Nt=`float getShadowMask() { +#endif`,WNt=`float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 @@ -2144,12 +2144,12 @@ gl_Position = projectionMatrix * mvPosition;`,BNt=`#ifdef DITHERING #endif #endif return shadow; -}`,WNt=`#ifdef USE_SKINNING +}`,KNt=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,KNt=`#ifdef USE_SKINNING +#endif`,jNt=`#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; uniform highp sampler2D boneTexture; @@ -2164,7 +2164,7 @@ gl_Position = projectionMatrix * mvPosition;`,BNt=`#ifdef DITHERING vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); return mat4( v1, v2, v3, v4 ); } -#endif`,jNt=`#ifdef USE_SKINNING +#endif`,QNt=`#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; @@ -2172,7 +2172,7 @@ gl_Position = projectionMatrix * mvPosition;`,BNt=`#ifdef DITHERING skinned += boneMatZ * skinVertex * skinWeight.z; skinned += boneMatW * skinVertex * skinWeight.w; transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,QNt=`#ifdef USE_SKINNING +#endif`,XNt=`#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; @@ -2183,17 +2183,17 @@ gl_Position = projectionMatrix * mvPosition;`,BNt=`#ifdef DITHERING #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif -#endif`,XNt=`float specularStrength; +#endif`,ZNt=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; -#endif`,ZNt=`#ifdef USE_SPECULARMAP +#endif`,JNt=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; -#endif`,JNt=`#if defined( TONE_MAPPING ) +#endif`,eOt=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,eOt=`#ifndef saturate +#endif`,tOt=`#ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif uniform float toneMappingExposure; @@ -2229,7 +2229,7 @@ vec3 ACESFilmicToneMapping( vec3 color ) { color = ACESOutputMat * color; return saturate( color ); } -vec3 CustomToneMapping( vec3 color ) { return color; }`,tOt=`#ifdef USE_TRANSMISSION +vec3 CustomToneMapping( vec3 color ) { return color; }`,nOt=`#ifdef USE_TRANSMISSION material.transmission = transmission; material.transmissionAlpha = 1.0; material.thickness = thickness; @@ -2250,7 +2250,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,tOt=`#ifdef USE_TRANSMIS material.attenuationColor, material.attenuationDistance ); material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); -#endif`,nOt=`#ifdef USE_TRANSMISSION +#endif`,iOt=`#ifdef USE_TRANSMISSION uniform float transmission; uniform float thickness; uniform float attenuationDistance; @@ -2356,7 +2356,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,tOt=`#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`,iOt=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,sOt=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -2426,7 +2426,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,tOt=`#ifdef USE_TRANSMIS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,sOt=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,rOt=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -2520,7 +2520,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,tOt=`#ifdef USE_TRANSMIS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,rOt=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,oOt=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) vUv = vec3( uv, 1 ).xy; #endif #ifdef USE_MAP @@ -2591,7 +2591,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,tOt=`#ifdef USE_TRANSMIS #endif #ifdef USE_THICKNESSMAP vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; -#endif`,oOt=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 +#endif`,aOt=`#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; @@ -2600,12 +2600,12 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,tOt=`#ifdef USE_TRANSMIS worldPosition = instanceMatrix * worldPosition; #endif worldPosition = modelMatrix * worldPosition; -#endif`;const aOt=`varying vec2 vUv; +#endif`;const lOt=`varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,lOt=`uniform sampler2D t2D; +}`,cOt=`uniform sampler2D t2D; uniform float backgroundIntensity; varying vec2 vUv; void main() { @@ -2617,14 +2617,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,cOt=`varying vec3 vWorldDirection; +}`,dOt=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,dOt=`#ifdef ENVMAP_TYPE_CUBE +}`,uOt=`#ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #elif defined( ENVMAP_TYPE_CUBE_UV ) uniform sampler2D envMap; @@ -2646,14 +2646,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,uOt=`varying vec3 vWorldDirection; +}`,pOt=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,pOt=`uniform samplerCube tCube; +}`,_Ot=`uniform samplerCube tCube; uniform float tFlip; uniform float opacity; varying vec3 vWorldDirection; @@ -2663,7 +2663,7 @@ void main() { gl_FragColor.a *= opacity; #include #include -}`,_Ot=`#include +}`,hOt=`#include #include #include #include @@ -2689,7 +2689,7 @@ void main() { #include #include vHighPrecisionZW = gl_Position.zw; -}`,hOt=`#if DEPTH_PACKING == 3200 +}`,fOt=`#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include @@ -2719,7 +2719,7 @@ void main() { #elif DEPTH_PACKING == 3201 gl_FragColor = packDepthToRGBA( fragCoordZ ); #endif -}`,fOt=`#define DISTANCE +}`,mOt=`#define DISTANCE varying vec3 vWorldPosition; #include #include @@ -2745,7 +2745,7 @@ void main() { #include #include vWorldPosition = worldPosition.xyz; -}`,mOt=`#define DISTANCE +}`,gOt=`#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; @@ -2769,13 +2769,13 @@ void main () { dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = packDepthToRGBA( dist ); -}`,gOt=`varying vec3 vWorldDirection; +}`,bOt=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include -}`,bOt=`uniform sampler2D tEquirect; +}`,EOt=`uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { @@ -2784,7 +2784,7 @@ void main() { gl_FragColor = texture2D( tEquirect, sampleUV ); #include #include -}`,EOt=`uniform float scale; +}`,yOt=`uniform float scale; attribute float lineDistance; varying float vLineDistance; #include @@ -2805,7 +2805,7 @@ void main() { #include #include #include -}`,yOt=`uniform vec3 diffuse; +}`,vOt=`uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; @@ -2833,7 +2833,7 @@ void main() { #include #include #include -}`,vOt=`#include +}`,SOt=`#include #include #include #include @@ -2864,7 +2864,7 @@ void main() { #include #include #include -}`,SOt=`uniform vec3 diffuse; +}`,TOt=`uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; @@ -2912,7 +2912,7 @@ void main() { #include #include #include -}`,TOt=`#define LAMBERT +}`,xOt=`#define LAMBERT varying vec3 vViewPosition; #include #include @@ -2950,7 +2950,7 @@ void main() { #include #include #include -}`,xOt=`#define LAMBERT +}`,COt=`#define LAMBERT uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -3007,7 +3007,7 @@ void main() { #include #include #include -}`,COt=`#define MATCAP +}`,wOt=`#define MATCAP varying vec3 vViewPosition; #include #include @@ -3040,7 +3040,7 @@ void main() { #include #include vViewPosition = - mvPosition.xyz; -}`,wOt=`#define MATCAP +}`,ROt=`#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; @@ -3086,7 +3086,7 @@ void main() { #include #include #include -}`,ROt=`#define NORMAL +}`,AOt=`#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; #endif @@ -3118,7 +3118,7 @@ void main() { #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) vViewPosition = - mvPosition.xyz; #endif -}`,AOt=`#define NORMAL +}`,NOt=`#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; @@ -3139,7 +3139,7 @@ void main() { #ifdef OPAQUE gl_FragColor.a = 1.0; #endif -}`,NOt=`#define PHONG +}`,OOt=`#define PHONG varying vec3 vViewPosition; #include #include @@ -3177,7 +3177,7 @@ void main() { #include #include #include -}`,OOt=`#define PHONG +}`,IOt=`#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; @@ -3236,7 +3236,7 @@ void main() { #include #include #include -}`,IOt=`#define STANDARD +}`,MOt=`#define STANDARD varying vec3 vViewPosition; #ifdef USE_TRANSMISSION varying vec3 vWorldPosition; @@ -3278,7 +3278,7 @@ void main() { #ifdef USE_TRANSMISSION vWorldPosition = worldPosition.xyz; #endif -}`,MOt=`#define STANDARD +}`,DOt=`#define STANDARD #ifdef PHYSICAL #define IOR #define USE_SPECULAR @@ -3400,7 +3400,7 @@ void main() { #include #include #include -}`,DOt=`#define TOON +}`,kOt=`#define TOON varying vec3 vViewPosition; #include #include @@ -3436,7 +3436,7 @@ void main() { #include #include #include -}`,kOt=`#define TOON +}`,LOt=`#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -3489,7 +3489,7 @@ void main() { #include #include #include -}`,LOt=`uniform float size; +}`,POt=`uniform float size; uniform float scale; #include #include @@ -3519,7 +3519,7 @@ void main() { #include #include #include -}`,POt=`uniform vec3 diffuse; +}`,UOt=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3544,7 +3544,7 @@ void main() { #include #include #include -}`,UOt=`#include +}`,FOt=`#include #include #include #include @@ -3566,7 +3566,7 @@ void main() { #include #include #include -}`,FOt=`uniform vec3 color; +}`,BOt=`uniform vec3 color; uniform float opacity; #include #include @@ -3582,7 +3582,7 @@ void main() { #include #include #include -}`,BOt=`uniform float rotation; +}`,GOt=`uniform float rotation; uniform vec2 center; #include #include @@ -3608,7 +3608,7 @@ void main() { #include #include #include -}`,GOt=`uniform vec3 diffuse; +}`,VOt=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3633,7 +3633,7 @@ void main() { #include #include #include -}`,Tt={alphahash_fragment:lAt,alphahash_pars_fragment:cAt,alphamap_fragment:dAt,alphamap_pars_fragment:uAt,alphatest_fragment:pAt,alphatest_pars_fragment:_At,aomap_fragment:hAt,aomap_pars_fragment:fAt,batching_pars_vertex:mAt,batching_vertex:gAt,begin_vertex:bAt,beginnormal_vertex:EAt,bsdfs:yAt,iridescence_fragment:vAt,bumpmap_pars_fragment:SAt,clipping_planes_fragment:TAt,clipping_planes_pars_fragment:xAt,clipping_planes_pars_vertex:CAt,clipping_planes_vertex:wAt,color_fragment:RAt,color_pars_fragment:AAt,color_pars_vertex:NAt,color_vertex:OAt,common:IAt,cube_uv_reflection_fragment:MAt,defaultnormal_vertex:DAt,displacementmap_pars_vertex:kAt,displacementmap_vertex:LAt,emissivemap_fragment:PAt,emissivemap_pars_fragment:UAt,colorspace_fragment:FAt,colorspace_pars_fragment:BAt,envmap_fragment:GAt,envmap_common_pars_fragment:VAt,envmap_pars_fragment:zAt,envmap_pars_vertex:HAt,envmap_physical_pars_fragment:tNt,envmap_vertex:qAt,fog_vertex:YAt,fog_pars_vertex:$At,fog_fragment:WAt,fog_pars_fragment:KAt,gradientmap_pars_fragment:jAt,lightmap_fragment:QAt,lightmap_pars_fragment:XAt,lights_lambert_fragment:ZAt,lights_lambert_pars_fragment:JAt,lights_pars_begin:eNt,lights_toon_fragment:nNt,lights_toon_pars_fragment:iNt,lights_phong_fragment:sNt,lights_phong_pars_fragment:rNt,lights_physical_fragment:oNt,lights_physical_pars_fragment:aNt,lights_fragment_begin:lNt,lights_fragment_maps:cNt,lights_fragment_end:dNt,logdepthbuf_fragment:uNt,logdepthbuf_pars_fragment:pNt,logdepthbuf_pars_vertex:_Nt,logdepthbuf_vertex:hNt,map_fragment:fNt,map_pars_fragment:mNt,map_particle_fragment:gNt,map_particle_pars_fragment:bNt,metalnessmap_fragment:ENt,metalnessmap_pars_fragment:yNt,morphcolor_vertex:vNt,morphnormal_vertex:SNt,morphtarget_pars_vertex:TNt,morphtarget_vertex:xNt,normal_fragment_begin:CNt,normal_fragment_maps:wNt,normal_pars_fragment:RNt,normal_pars_vertex:ANt,normal_vertex:NNt,normalmap_pars_fragment:ONt,clearcoat_normal_fragment_begin:INt,clearcoat_normal_fragment_maps:MNt,clearcoat_pars_fragment:DNt,iridescence_pars_fragment:kNt,opaque_fragment:LNt,packing:PNt,premultiplied_alpha_fragment:UNt,project_vertex:FNt,dithering_fragment:BNt,dithering_pars_fragment:GNt,roughnessmap_fragment:VNt,roughnessmap_pars_fragment:zNt,shadowmap_pars_fragment:HNt,shadowmap_pars_vertex:qNt,shadowmap_vertex:YNt,shadowmask_pars_fragment:$Nt,skinbase_vertex:WNt,skinning_pars_vertex:KNt,skinning_vertex:jNt,skinnormal_vertex:QNt,specularmap_fragment:XNt,specularmap_pars_fragment:ZNt,tonemapping_fragment:JNt,tonemapping_pars_fragment:eOt,transmission_fragment:tOt,transmission_pars_fragment:nOt,uv_pars_fragment:iOt,uv_pars_vertex:sOt,uv_vertex:rOt,worldpos_vertex:oOt,background_vert:aOt,background_frag:lOt,backgroundCube_vert:cOt,backgroundCube_frag:dOt,cube_vert:uOt,cube_frag:pOt,depth_vert:_Ot,depth_frag:hOt,distanceRGBA_vert:fOt,distanceRGBA_frag:mOt,equirect_vert:gOt,equirect_frag:bOt,linedashed_vert:EOt,linedashed_frag:yOt,meshbasic_vert:vOt,meshbasic_frag:SOt,meshlambert_vert:TOt,meshlambert_frag:xOt,meshmatcap_vert:COt,meshmatcap_frag:wOt,meshnormal_vert:ROt,meshnormal_frag:AOt,meshphong_vert:NOt,meshphong_frag:OOt,meshphysical_vert:IOt,meshphysical_frag:MOt,meshtoon_vert:DOt,meshtoon_frag:kOt,points_vert:LOt,points_frag:POt,shadow_vert:UOt,shadow_frag:FOt,sprite_vert:BOt,sprite_frag:GOt},je={common:{diffuse:{value:new gt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new wt},alphaMap:{value:null},alphaMapTransform:{value:new wt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new wt}},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 wt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new wt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new wt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new wt},normalScale:{value:new It(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new wt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new wt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new wt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new wt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new gt(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 gt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new wt},alphaTest:{value:0},uvTransform:{value:new wt}},sprite:{diffuse:{value:new gt(16777215)},opacity:{value:1},center:{value:new It(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new wt},alphaMap:{value:null},alphaMapTransform:{value:new wt},alphaTest:{value:0}}},Zi={basic:{uniforms:Vn([je.common,je.specularmap,je.envmap,je.aomap,je.lightmap,je.fog]),vertexShader:Tt.meshbasic_vert,fragmentShader:Tt.meshbasic_frag},lambert:{uniforms:Vn([je.common,je.specularmap,je.envmap,je.aomap,je.lightmap,je.emissivemap,je.bumpmap,je.normalmap,je.displacementmap,je.fog,je.lights,{emissive:{value:new gt(0)}}]),vertexShader:Tt.meshlambert_vert,fragmentShader:Tt.meshlambert_frag},phong:{uniforms:Vn([je.common,je.specularmap,je.envmap,je.aomap,je.lightmap,je.emissivemap,je.bumpmap,je.normalmap,je.displacementmap,je.fog,je.lights,{emissive:{value:new gt(0)},specular:{value:new gt(1118481)},shininess:{value:30}}]),vertexShader:Tt.meshphong_vert,fragmentShader:Tt.meshphong_frag},standard:{uniforms:Vn([je.common,je.envmap,je.aomap,je.lightmap,je.emissivemap,je.bumpmap,je.normalmap,je.displacementmap,je.roughnessmap,je.metalnessmap,je.fog,je.lights,{emissive:{value:new gt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Tt.meshphysical_vert,fragmentShader:Tt.meshphysical_frag},toon:{uniforms:Vn([je.common,je.aomap,je.lightmap,je.emissivemap,je.bumpmap,je.normalmap,je.displacementmap,je.gradientmap,je.fog,je.lights,{emissive:{value:new gt(0)}}]),vertexShader:Tt.meshtoon_vert,fragmentShader:Tt.meshtoon_frag},matcap:{uniforms:Vn([je.common,je.bumpmap,je.normalmap,je.displacementmap,je.fog,{matcap:{value:null}}]),vertexShader:Tt.meshmatcap_vert,fragmentShader:Tt.meshmatcap_frag},points:{uniforms:Vn([je.points,je.fog]),vertexShader:Tt.points_vert,fragmentShader:Tt.points_frag},dashed:{uniforms:Vn([je.common,je.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Tt.linedashed_vert,fragmentShader:Tt.linedashed_frag},depth:{uniforms:Vn([je.common,je.displacementmap]),vertexShader:Tt.depth_vert,fragmentShader:Tt.depth_frag},normal:{uniforms:Vn([je.common,je.bumpmap,je.normalmap,je.displacementmap,{opacity:{value:1}}]),vertexShader:Tt.meshnormal_vert,fragmentShader:Tt.meshnormal_frag},sprite:{uniforms:Vn([je.sprite,je.fog]),vertexShader:Tt.sprite_vert,fragmentShader:Tt.sprite_frag},background:{uniforms:{uvTransform:{value:new wt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Tt.background_vert,fragmentShader:Tt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:Tt.backgroundCube_vert,fragmentShader:Tt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Tt.cube_vert,fragmentShader:Tt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Tt.equirect_vert,fragmentShader:Tt.equirect_frag},distanceRGBA:{uniforms:Vn([je.common,je.displacementmap,{referencePosition:{value:new _e},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Tt.distanceRGBA_vert,fragmentShader:Tt.distanceRGBA_frag},shadow:{uniforms:Vn([je.lights,je.fog,{color:{value:new gt(0)},opacity:{value:1}}]),vertexShader:Tt.shadow_vert,fragmentShader:Tt.shadow_frag}};Zi.physical={uniforms:Vn([Zi.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new wt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new wt},clearcoatNormalScale:{value:new It(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new wt},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new wt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new wt},sheen:{value:0},sheenColor:{value:new gt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new wt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new wt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new wt},transmissionSamplerSize:{value:new It},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new wt},attenuationDistance:{value:0},attenuationColor:{value:new gt(0)},specularColor:{value:new gt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new wt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new wt},anisotropyVector:{value:new It},anisotropyMap:{value:null},anisotropyMapTransform:{value:new wt}}]),vertexShader:Tt.meshphysical_vert,fragmentShader:Tt.meshphysical_frag};const md={r:0,b:0,g:0};function VOt(t,e,n,i,s,r,o){const a=new gt(0);let l=r===!0?0:1,u,d,h=null,f=0,_=null;function m(b,g){let y=!1,v=g.isScene===!0?g.background:null;v&&v.isTexture&&(v=(g.backgroundBlurriness>0?n:e).get(v)),v===null?E(a,l):v&&v.isColor&&(E(v,1),y=!0);const S=t.xr.getEnvironmentBlendMode();S==="additive"?i.buffers.color.setClear(0,0,0,1,o):S==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(t.autoClear||y)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),v&&(v.isCubeTexture||v.mapping===lp)?(d===void 0&&(d=new Hn(new Cr(1,1,1),new go({name:"BackgroundCubeMaterial",uniforms:Na(Zi.backgroundCube.uniforms),vertexShader:Zi.backgroundCube.vertexShader,fragmentShader:Zi.backgroundCube.fragmentShader,side:Zn,depthTest:!1,depthWrite:!1,fog:!1})),d.geometry.deleteAttribute("normal"),d.geometry.deleteAttribute("uv"),d.onBeforeRender=function(C,T,O){this.matrixWorld.copyPosition(O.matrixWorld)},Object.defineProperty(d.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(d)),d.material.uniforms.envMap.value=v,d.material.uniforms.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,d.material.uniforms.backgroundBlurriness.value=g.backgroundBlurriness,d.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,d.material.toneMapped=Gt.getTransfer(v.colorSpace)!==Zt,(h!==v||f!==v.version||_!==t.toneMapping)&&(d.material.needsUpdate=!0,h=v,f=v.version,_=t.toneMapping),d.layers.enableAll(),b.unshift(d,d.geometry,d.material,0,0,null)):v&&v.isTexture&&(u===void 0&&(u=new Hn(new ty(2,2),new go({name:"BackgroundMaterial",uniforms:Na(Zi.background.uniforms),vertexShader:Zi.background.vertexShader,fragmentShader:Zi.background.fragmentShader,side:Ys,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(u)),u.material.uniforms.t2D.value=v,u.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,u.material.toneMapped=Gt.getTransfer(v.colorSpace)!==Zt,v.matrixAutoUpdate===!0&&v.updateMatrix(),u.material.uniforms.uvTransform.value.copy(v.matrix),(h!==v||f!==v.version||_!==t.toneMapping)&&(u.material.needsUpdate=!0,h=v,f=v.version,_=t.toneMapping),u.layers.enableAll(),b.unshift(u,u.geometry,u.material,0,0,null))}function E(b,g){b.getRGB(md,dI(t)),i.buffers.color.setClear(md.r,md.g,md.b,g,o)}return{getClearColor:function(){return a},setClearColor:function(b,g=1){a.set(b),l=g,E(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(b){l=b,E(a,l)},render:m}}function zOt(t,e,n,i){const s=t.getParameter(t.MAX_VERTEX_ATTRIBS),r=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||r!==null,a={},l=b(null);let u=l,d=!1;function h(L,$,H,U,Q){let J=!1;if(o){const j=E(U,H,$);u!==j&&(u=j,_(u.object)),J=g(L,U,H,Q),J&&y(L,U,H,Q)}else{const j=$.wireframe===!0;(u.geometry!==U.id||u.program!==H.id||u.wireframe!==j)&&(u.geometry=U.id,u.program=H.id,u.wireframe=j,J=!0)}Q!==null&&n.update(Q,t.ELEMENT_ARRAY_BUFFER),(J||d)&&(d=!1,k(L,$,H,U),Q!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n.get(Q).buffer))}function f(){return i.isWebGL2?t.createVertexArray():r.createVertexArrayOES()}function _(L){return i.isWebGL2?t.bindVertexArray(L):r.bindVertexArrayOES(L)}function m(L){return i.isWebGL2?t.deleteVertexArray(L):r.deleteVertexArrayOES(L)}function E(L,$,H){const U=H.wireframe===!0;let Q=a[L.id];Q===void 0&&(Q={},a[L.id]=Q);let J=Q[$.id];J===void 0&&(J={},Q[$.id]=J);let j=J[U];return j===void 0&&(j=b(f()),J[U]=j),j}function b(L){const $=[],H=[],U=[];for(let Q=0;Q=0){const Ee=Q[ve];let xe=J[ve];if(xe===void 0&&(ve==="instanceMatrix"&&L.instanceMatrix&&(xe=L.instanceMatrix),ve==="instanceColor"&&L.instanceColor&&(xe=L.instanceColor)),Ee===void 0||Ee.attribute!==xe||xe&&Ee.data!==xe.data)return!0;j++}return u.attributesNum!==j||u.index!==U}function y(L,$,H,U){const Q={},J=$.attributes;let j=0;const ae=H.getAttributes();for(const ve in ae)if(ae[ve].location>=0){let Ee=J[ve];Ee===void 0&&(ve==="instanceMatrix"&&L.instanceMatrix&&(Ee=L.instanceMatrix),ve==="instanceColor"&&L.instanceColor&&(Ee=L.instanceColor));const xe={};xe.attribute=Ee,Ee&&Ee.data&&(xe.data=Ee.data),Q[ve]=xe,j++}u.attributes=Q,u.attributesNum=j,u.index=U}function v(){const L=u.newAttributes;for(let $=0,H=L.length;$=0){let ee=Q[ae];if(ee===void 0&&(ae==="instanceMatrix"&&L.instanceMatrix&&(ee=L.instanceMatrix),ae==="instanceColor"&&L.instanceColor&&(ee=L.instanceColor)),ee!==void 0){const Ee=ee.normalized,xe=ee.itemSize,Me=n.get(ee);if(Me===void 0)continue;const Z=Me.buffer,ye=Me.type,fe=Me.bytesPerElement,Ne=i.isWebGL2===!0&&(ye===t.INT||ye===t.UNSIGNED_INT||ee.gpuType===$O);if(ee.isInterleavedBufferAttribute){const Le=ee.data,D=Le.stride,q=ee.offset;if(Le.isInstancedInterleavedBuffer){for(let K=0;K0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";O="mediump"}return O==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&t.constructor.name==="WebGL2RenderingContext";let a=n.precision!==void 0?n.precision:"highp";const l=r(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const u=o||e.has("WEBGL_draw_buffers"),d=n.logarithmicDepthBuffer===!0,h=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),f=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=t.getParameter(t.MAX_TEXTURE_SIZE),m=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),E=t.getParameter(t.MAX_VERTEX_ATTRIBS),b=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),g=t.getParameter(t.MAX_VARYING_VECTORS),y=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),v=f>0,S=o||e.has("OES_texture_float"),C=v&&S,T=o?t.getParameter(t.MAX_SAMPLES):0;return{isWebGL2:o,drawBuffers:u,getMaxAnisotropy:s,getMaxPrecision:r,precision:a,logarithmicDepthBuffer:d,maxTextures:h,maxVertexTextures:f,maxTextureSize:_,maxCubemapSize:m,maxAttributes:E,maxVertexUniforms:b,maxVaryings:g,maxFragmentUniforms:y,vertexTextures:v,floatFragmentTextures:S,floatVertexTextures:C,maxSamples:T}}function YOt(t){const e=this;let n=null,i=0,s=!1,r=!1;const o=new Yr,a=new wt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,f){const _=h.length!==0||f||i!==0||s;return s=f,i=h.length,_},this.beginShadows=function(){r=!0,d(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(h,f){n=d(h,f,0)},this.setState=function(h,f,_){const m=h.clippingPlanes,E=h.clipIntersection,b=h.clipShadows,g=t.get(h);if(!s||m===null||m.length===0||r&&!b)r?d(null):u();else{const y=r?0:i,v=y*4;let S=g.clippingState||null;l.value=S,S=d(m,f,v,_);for(let C=0;C!==v;++C)S[C]=n[C];g.clippingState=S,this.numIntersection=E?this.numPlanes:0,this.numPlanes+=y}};function u(){l.value!==n&&(l.value=n,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function d(h,f,_,m){const E=h!==null?h.length:0;let b=null;if(E!==0){if(b=l.value,m!==!0||b===null){const g=_+E*4,y=f.matrixWorldInverse;a.getNormalMatrix(y),(b===null||b.length0){const u=new sAt(l.height/2);return u.fromEquirectangularTexture(t,o),e.set(o,u),o.addEventListener("dispose",s),n(u.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 ny extends uI{constructor(e=-1,n=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=n,this.top=i,this.bottom=s,this.near=r,this.far=o,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),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,n,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=n,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),n=(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+n,l=s-n;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,d=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=u*this.view.offsetX,o=r+u*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 n=super.toJSON(e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}const Xo=4,z1=[.125,.215,.35,.446,.526,.582],Zr=20,rg=new ny,H1=new gt;let og=null,ag=0,lg=0;const $r=(1+Math.sqrt(5))/2,Yo=1/$r,q1=[new _e(1,1,1),new _e(-1,1,1),new _e(1,1,-1),new _e(-1,1,-1),new _e(0,$r,Yo),new _e(0,$r,-Yo),new _e(Yo,0,$r),new _e(-Yo,0,$r),new _e($r,Yo,0),new _e(-$r,Yo,0)];class Y1{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,n=0,i=.1,s=100){og=this._renderer.getRenderTarget(),ag=this._renderer.getActiveCubeFace(),lg=this._renderer.getActiveMipmapLevel(),this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(e,i,s,r),n>0&&this._blur(r,0,0,n),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=K1(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=W1(),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?v:0,v,v),d.setRenderTarget(s),E&&d.render(m,a),d.render(e,a)}m.geometry.dispose(),m.material.dispose(),d.toneMapping=f,d.autoClear=h,e.background=b}_textureToCubeUV(e,n){const i=this._renderer,s=e.mapping===Ta||e.mapping===xa;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=K1()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=W1());const r=s?this._cubemapMaterial:this._equirectMaterial,o=new Hn(this._lodPlanes[0],r),a=r.uniforms;a.envMap.value=e;const l=this._cubeSize;gd(n,0,0,3*l,2*l),i.setRenderTarget(n),i.render(o,rg)}_applyPMREM(e){const n=this._renderer,i=n.autoClear;n.autoClear=!1;for(let s=1;sZr&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${b} samples when the maximum is set to ${Zr}`);const g=[];let y=0;for(let O=0;Ov-Xo?s-v+Xo:0),T=4*(this._cubeSize-S);gd(n,C,T,3*S,2*S),l.setRenderTarget(n),l.render(h,rg)}}function WOt(t){const e=[],n=[],i=[];let s=t;const r=t-Xo+1+z1.length;for(let o=0;ot-Xo?l=z1[o-t+Xo-1]:o===0&&(l=0),i.push(l);const u=1/(a-2),d=-u,h=1+u,f=[d,d,h,d,h,h,d,d,h,h,d,h],_=6,m=6,E=3,b=2,g=1,y=new Float32Array(E*m*_),v=new Float32Array(b*m*_),S=new Float32Array(g*m*_);for(let T=0;T<_;T++){const O=T%3*2/3-1,k=T>2?0:-1,x=[O,k,0,O+2/3,k,0,O+2/3,k+1,0,O,k,0,O+2/3,k+1,0,O,k+1,0];y.set(x,E*m*T),v.set(f,b*m*T);const I=[T,T,T,T,T,T];S.set(I,g*m*T)}const C=new ms;C.setAttribute("position",new Yn(y,E)),C.setAttribute("uv",new Yn(v,b)),C.setAttribute("faceIndex",new Yn(S,g)),e.push(C),s>Xo&&s--}return{lodPlanes:e,sizeLods:n,sigmas:i}}function $1(t,e,n){const i=new mo(t,e,n);return i.texture.mapping=lp,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function gd(t,e,n,i,s){t.viewport.set(e,n,i,s),t.scissor.set(e,n,i,s)}function KOt(t,e,n){const i=new Float32Array(Zr),s=new _e(0,1,0);return new go({name:"SphericalGaussianBlur",defines:{n:Zr,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:iy(),fragmentShader:` +}`,Tt={alphahash_fragment:cAt,alphahash_pars_fragment:dAt,alphamap_fragment:uAt,alphamap_pars_fragment:pAt,alphatest_fragment:_At,alphatest_pars_fragment:hAt,aomap_fragment:fAt,aomap_pars_fragment:mAt,batching_pars_vertex:gAt,batching_vertex:bAt,begin_vertex:EAt,beginnormal_vertex:yAt,bsdfs:vAt,iridescence_fragment:SAt,bumpmap_pars_fragment:TAt,clipping_planes_fragment:xAt,clipping_planes_pars_fragment:CAt,clipping_planes_pars_vertex:wAt,clipping_planes_vertex:RAt,color_fragment:AAt,color_pars_fragment:NAt,color_pars_vertex:OAt,color_vertex:IAt,common:MAt,cube_uv_reflection_fragment:DAt,defaultnormal_vertex:kAt,displacementmap_pars_vertex:LAt,displacementmap_vertex:PAt,emissivemap_fragment:UAt,emissivemap_pars_fragment:FAt,colorspace_fragment:BAt,colorspace_pars_fragment:GAt,envmap_fragment:VAt,envmap_common_pars_fragment:zAt,envmap_pars_fragment:HAt,envmap_pars_vertex:qAt,envmap_physical_pars_fragment:nNt,envmap_vertex:YAt,fog_vertex:$At,fog_pars_vertex:WAt,fog_fragment:KAt,fog_pars_fragment:jAt,gradientmap_pars_fragment:QAt,lightmap_fragment:XAt,lightmap_pars_fragment:ZAt,lights_lambert_fragment:JAt,lights_lambert_pars_fragment:eNt,lights_pars_begin:tNt,lights_toon_fragment:iNt,lights_toon_pars_fragment:sNt,lights_phong_fragment:rNt,lights_phong_pars_fragment:oNt,lights_physical_fragment:aNt,lights_physical_pars_fragment:lNt,lights_fragment_begin:cNt,lights_fragment_maps:dNt,lights_fragment_end:uNt,logdepthbuf_fragment:pNt,logdepthbuf_pars_fragment:_Nt,logdepthbuf_pars_vertex:hNt,logdepthbuf_vertex:fNt,map_fragment:mNt,map_pars_fragment:gNt,map_particle_fragment:bNt,map_particle_pars_fragment:ENt,metalnessmap_fragment:yNt,metalnessmap_pars_fragment:vNt,morphcolor_vertex:SNt,morphnormal_vertex:TNt,morphtarget_pars_vertex:xNt,morphtarget_vertex:CNt,normal_fragment_begin:wNt,normal_fragment_maps:RNt,normal_pars_fragment:ANt,normal_pars_vertex:NNt,normal_vertex:ONt,normalmap_pars_fragment:INt,clearcoat_normal_fragment_begin:MNt,clearcoat_normal_fragment_maps:DNt,clearcoat_pars_fragment:kNt,iridescence_pars_fragment:LNt,opaque_fragment:PNt,packing:UNt,premultiplied_alpha_fragment:FNt,project_vertex:BNt,dithering_fragment:GNt,dithering_pars_fragment:VNt,roughnessmap_fragment:zNt,roughnessmap_pars_fragment:HNt,shadowmap_pars_fragment:qNt,shadowmap_pars_vertex:YNt,shadowmap_vertex:$Nt,shadowmask_pars_fragment:WNt,skinbase_vertex:KNt,skinning_pars_vertex:jNt,skinning_vertex:QNt,skinnormal_vertex:XNt,specularmap_fragment:ZNt,specularmap_pars_fragment:JNt,tonemapping_fragment:eOt,tonemapping_pars_fragment:tOt,transmission_fragment:nOt,transmission_pars_fragment:iOt,uv_pars_fragment:sOt,uv_pars_vertex:rOt,uv_vertex:oOt,worldpos_vertex:aOt,background_vert:lOt,background_frag:cOt,backgroundCube_vert:dOt,backgroundCube_frag:uOt,cube_vert:pOt,cube_frag:_Ot,depth_vert:hOt,depth_frag:fOt,distanceRGBA_vert:mOt,distanceRGBA_frag:gOt,equirect_vert:bOt,equirect_frag:EOt,linedashed_vert:yOt,linedashed_frag:vOt,meshbasic_vert:SOt,meshbasic_frag:TOt,meshlambert_vert:xOt,meshlambert_frag:COt,meshmatcap_vert:wOt,meshmatcap_frag:ROt,meshnormal_vert:AOt,meshnormal_frag:NOt,meshphong_vert:OOt,meshphong_frag:IOt,meshphysical_vert:MOt,meshphysical_frag:DOt,meshtoon_vert:kOt,meshtoon_frag:LOt,points_vert:POt,points_frag:UOt,shadow_vert:FOt,shadow_frag:BOt,sprite_vert:GOt,sprite_frag:VOt},je={common:{diffuse:{value:new gt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new wt},alphaMap:{value:null},alphaMapTransform:{value:new wt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new wt}},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 wt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new wt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new wt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new wt},normalScale:{value:new It(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new wt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new wt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new wt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new wt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new gt(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 gt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new wt},alphaTest:{value:0},uvTransform:{value:new wt}},sprite:{diffuse:{value:new gt(16777215)},opacity:{value:1},center:{value:new It(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new wt},alphaMap:{value:null},alphaMapTransform:{value:new wt},alphaTest:{value:0}}},Zi={basic:{uniforms:Vn([je.common,je.specularmap,je.envmap,je.aomap,je.lightmap,je.fog]),vertexShader:Tt.meshbasic_vert,fragmentShader:Tt.meshbasic_frag},lambert:{uniforms:Vn([je.common,je.specularmap,je.envmap,je.aomap,je.lightmap,je.emissivemap,je.bumpmap,je.normalmap,je.displacementmap,je.fog,je.lights,{emissive:{value:new gt(0)}}]),vertexShader:Tt.meshlambert_vert,fragmentShader:Tt.meshlambert_frag},phong:{uniforms:Vn([je.common,je.specularmap,je.envmap,je.aomap,je.lightmap,je.emissivemap,je.bumpmap,je.normalmap,je.displacementmap,je.fog,je.lights,{emissive:{value:new gt(0)},specular:{value:new gt(1118481)},shininess:{value:30}}]),vertexShader:Tt.meshphong_vert,fragmentShader:Tt.meshphong_frag},standard:{uniforms:Vn([je.common,je.envmap,je.aomap,je.lightmap,je.emissivemap,je.bumpmap,je.normalmap,je.displacementmap,je.roughnessmap,je.metalnessmap,je.fog,je.lights,{emissive:{value:new gt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Tt.meshphysical_vert,fragmentShader:Tt.meshphysical_frag},toon:{uniforms:Vn([je.common,je.aomap,je.lightmap,je.emissivemap,je.bumpmap,je.normalmap,je.displacementmap,je.gradientmap,je.fog,je.lights,{emissive:{value:new gt(0)}}]),vertexShader:Tt.meshtoon_vert,fragmentShader:Tt.meshtoon_frag},matcap:{uniforms:Vn([je.common,je.bumpmap,je.normalmap,je.displacementmap,je.fog,{matcap:{value:null}}]),vertexShader:Tt.meshmatcap_vert,fragmentShader:Tt.meshmatcap_frag},points:{uniforms:Vn([je.points,je.fog]),vertexShader:Tt.points_vert,fragmentShader:Tt.points_frag},dashed:{uniforms:Vn([je.common,je.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Tt.linedashed_vert,fragmentShader:Tt.linedashed_frag},depth:{uniforms:Vn([je.common,je.displacementmap]),vertexShader:Tt.depth_vert,fragmentShader:Tt.depth_frag},normal:{uniforms:Vn([je.common,je.bumpmap,je.normalmap,je.displacementmap,{opacity:{value:1}}]),vertexShader:Tt.meshnormal_vert,fragmentShader:Tt.meshnormal_frag},sprite:{uniforms:Vn([je.sprite,je.fog]),vertexShader:Tt.sprite_vert,fragmentShader:Tt.sprite_frag},background:{uniforms:{uvTransform:{value:new wt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Tt.background_vert,fragmentShader:Tt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:Tt.backgroundCube_vert,fragmentShader:Tt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Tt.cube_vert,fragmentShader:Tt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Tt.equirect_vert,fragmentShader:Tt.equirect_frag},distanceRGBA:{uniforms:Vn([je.common,je.displacementmap,{referencePosition:{value:new _e},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Tt.distanceRGBA_vert,fragmentShader:Tt.distanceRGBA_frag},shadow:{uniforms:Vn([je.lights,je.fog,{color:{value:new gt(0)},opacity:{value:1}}]),vertexShader:Tt.shadow_vert,fragmentShader:Tt.shadow_frag}};Zi.physical={uniforms:Vn([Zi.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new wt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new wt},clearcoatNormalScale:{value:new It(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new wt},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new wt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new wt},sheen:{value:0},sheenColor:{value:new gt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new wt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new wt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new wt},transmissionSamplerSize:{value:new It},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new wt},attenuationDistance:{value:0},attenuationColor:{value:new gt(0)},specularColor:{value:new gt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new wt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new wt},anisotropyVector:{value:new It},anisotropyMap:{value:null},anisotropyMapTransform:{value:new wt}}]),vertexShader:Tt.meshphysical_vert,fragmentShader:Tt.meshphysical_frag};const md={r:0,b:0,g:0};function zOt(t,e,n,i,s,r,o){const a=new gt(0);let l=r===!0?0:1,u,d,h=null,f=0,_=null;function m(b,g){let y=!1,v=g.isScene===!0?g.background:null;v&&v.isTexture&&(v=(g.backgroundBlurriness>0?n:e).get(v)),v===null?E(a,l):v&&v.isColor&&(E(v,1),y=!0);const S=t.xr.getEnvironmentBlendMode();S==="additive"?i.buffers.color.setClear(0,0,0,1,o):S==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(t.autoClear||y)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),v&&(v.isCubeTexture||v.mapping===lp)?(d===void 0&&(d=new Hn(new Cr(1,1,1),new go({name:"BackgroundCubeMaterial",uniforms:Na(Zi.backgroundCube.uniforms),vertexShader:Zi.backgroundCube.vertexShader,fragmentShader:Zi.backgroundCube.fragmentShader,side:Zn,depthTest:!1,depthWrite:!1,fog:!1})),d.geometry.deleteAttribute("normal"),d.geometry.deleteAttribute("uv"),d.onBeforeRender=function(C,T,O){this.matrixWorld.copyPosition(O.matrixWorld)},Object.defineProperty(d.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(d)),d.material.uniforms.envMap.value=v,d.material.uniforms.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,d.material.uniforms.backgroundBlurriness.value=g.backgroundBlurriness,d.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,d.material.toneMapped=Gt.getTransfer(v.colorSpace)!==Zt,(h!==v||f!==v.version||_!==t.toneMapping)&&(d.material.needsUpdate=!0,h=v,f=v.version,_=t.toneMapping),d.layers.enableAll(),b.unshift(d,d.geometry,d.material,0,0,null)):v&&v.isTexture&&(u===void 0&&(u=new Hn(new ty(2,2),new go({name:"BackgroundMaterial",uniforms:Na(Zi.background.uniforms),vertexShader:Zi.background.vertexShader,fragmentShader:Zi.background.fragmentShader,side:Ys,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(u)),u.material.uniforms.t2D.value=v,u.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,u.material.toneMapped=Gt.getTransfer(v.colorSpace)!==Zt,v.matrixAutoUpdate===!0&&v.updateMatrix(),u.material.uniforms.uvTransform.value.copy(v.matrix),(h!==v||f!==v.version||_!==t.toneMapping)&&(u.material.needsUpdate=!0,h=v,f=v.version,_=t.toneMapping),u.layers.enableAll(),b.unshift(u,u.geometry,u.material,0,0,null))}function E(b,g){b.getRGB(md,dI(t)),i.buffers.color.setClear(md.r,md.g,md.b,g,o)}return{getClearColor:function(){return a},setClearColor:function(b,g=1){a.set(b),l=g,E(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(b){l=b,E(a,l)},render:m}}function HOt(t,e,n,i){const s=t.getParameter(t.MAX_VERTEX_ATTRIBS),r=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||r!==null,a={},l=b(null);let u=l,d=!1;function h(L,$,H,U,Q){let J=!1;if(o){const j=E(U,H,$);u!==j&&(u=j,_(u.object)),J=g(L,U,H,Q),J&&y(L,U,H,Q)}else{const j=$.wireframe===!0;(u.geometry!==U.id||u.program!==H.id||u.wireframe!==j)&&(u.geometry=U.id,u.program=H.id,u.wireframe=j,J=!0)}Q!==null&&n.update(Q,t.ELEMENT_ARRAY_BUFFER),(J||d)&&(d=!1,k(L,$,H,U),Q!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n.get(Q).buffer))}function f(){return i.isWebGL2?t.createVertexArray():r.createVertexArrayOES()}function _(L){return i.isWebGL2?t.bindVertexArray(L):r.bindVertexArrayOES(L)}function m(L){return i.isWebGL2?t.deleteVertexArray(L):r.deleteVertexArrayOES(L)}function E(L,$,H){const U=H.wireframe===!0;let Q=a[L.id];Q===void 0&&(Q={},a[L.id]=Q);let J=Q[$.id];J===void 0&&(J={},Q[$.id]=J);let j=J[U];return j===void 0&&(j=b(f()),J[U]=j),j}function b(L){const $=[],H=[],U=[];for(let Q=0;Q=0){const Ee=Q[ve];let xe=J[ve];if(xe===void 0&&(ve==="instanceMatrix"&&L.instanceMatrix&&(xe=L.instanceMatrix),ve==="instanceColor"&&L.instanceColor&&(xe=L.instanceColor)),Ee===void 0||Ee.attribute!==xe||xe&&Ee.data!==xe.data)return!0;j++}return u.attributesNum!==j||u.index!==U}function y(L,$,H,U){const Q={},J=$.attributes;let j=0;const ae=H.getAttributes();for(const ve in ae)if(ae[ve].location>=0){let Ee=J[ve];Ee===void 0&&(ve==="instanceMatrix"&&L.instanceMatrix&&(Ee=L.instanceMatrix),ve==="instanceColor"&&L.instanceColor&&(Ee=L.instanceColor));const xe={};xe.attribute=Ee,Ee&&Ee.data&&(xe.data=Ee.data),Q[ve]=xe,j++}u.attributes=Q,u.attributesNum=j,u.index=U}function v(){const L=u.newAttributes;for(let $=0,H=L.length;$=0){let ee=Q[ae];if(ee===void 0&&(ae==="instanceMatrix"&&L.instanceMatrix&&(ee=L.instanceMatrix),ae==="instanceColor"&&L.instanceColor&&(ee=L.instanceColor)),ee!==void 0){const Ee=ee.normalized,xe=ee.itemSize,Me=n.get(ee);if(Me===void 0)continue;const Z=Me.buffer,ye=Me.type,fe=Me.bytesPerElement,Ne=i.isWebGL2===!0&&(ye===t.INT||ye===t.UNSIGNED_INT||ee.gpuType===$O);if(ee.isInterleavedBufferAttribute){const Le=ee.data,D=Le.stride,q=ee.offset;if(Le.isInstancedInterleavedBuffer){for(let K=0;K0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";O="mediump"}return O==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&t.constructor.name==="WebGL2RenderingContext";let a=n.precision!==void 0?n.precision:"highp";const l=r(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const u=o||e.has("WEBGL_draw_buffers"),d=n.logarithmicDepthBuffer===!0,h=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),f=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=t.getParameter(t.MAX_TEXTURE_SIZE),m=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),E=t.getParameter(t.MAX_VERTEX_ATTRIBS),b=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),g=t.getParameter(t.MAX_VARYING_VECTORS),y=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),v=f>0,S=o||e.has("OES_texture_float"),C=v&&S,T=o?t.getParameter(t.MAX_SAMPLES):0;return{isWebGL2:o,drawBuffers:u,getMaxAnisotropy:s,getMaxPrecision:r,precision:a,logarithmicDepthBuffer:d,maxTextures:h,maxVertexTextures:f,maxTextureSize:_,maxCubemapSize:m,maxAttributes:E,maxVertexUniforms:b,maxVaryings:g,maxFragmentUniforms:y,vertexTextures:v,floatFragmentTextures:S,floatVertexTextures:C,maxSamples:T}}function $Ot(t){const e=this;let n=null,i=0,s=!1,r=!1;const o=new Yr,a=new wt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,f){const _=h.length!==0||f||i!==0||s;return s=f,i=h.length,_},this.beginShadows=function(){r=!0,d(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(h,f){n=d(h,f,0)},this.setState=function(h,f,_){const m=h.clippingPlanes,E=h.clipIntersection,b=h.clipShadows,g=t.get(h);if(!s||m===null||m.length===0||r&&!b)r?d(null):u();else{const y=r?0:i,v=y*4;let S=g.clippingState||null;l.value=S,S=d(m,f,v,_);for(let C=0;C!==v;++C)S[C]=n[C];g.clippingState=S,this.numIntersection=E?this.numPlanes:0,this.numPlanes+=y}};function u(){l.value!==n&&(l.value=n,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function d(h,f,_,m){const E=h!==null?h.length:0;let b=null;if(E!==0){if(b=l.value,m!==!0||b===null){const g=_+E*4,y=f.matrixWorldInverse;a.getNormalMatrix(y),(b===null||b.length0){const u=new rAt(l.height/2);return u.fromEquirectangularTexture(t,o),e.set(o,u),o.addEventListener("dispose",s),n(u.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 ny extends uI{constructor(e=-1,n=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=n,this.top=i,this.bottom=s,this.near=r,this.far=o,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),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,n,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=n,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),n=(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+n,l=s-n;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,d=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=u*this.view.offsetX,o=r+u*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 n=super.toJSON(e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}const Xo=4,z1=[.125,.215,.35,.446,.526,.582],Zr=20,rg=new ny,H1=new gt;let og=null,ag=0,lg=0;const $r=(1+Math.sqrt(5))/2,Yo=1/$r,q1=[new _e(1,1,1),new _e(-1,1,1),new _e(1,1,-1),new _e(-1,1,-1),new _e(0,$r,Yo),new _e(0,$r,-Yo),new _e(Yo,0,$r),new _e(-Yo,0,$r),new _e($r,Yo,0),new _e(-$r,Yo,0)];class Y1{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,n=0,i=.1,s=100){og=this._renderer.getRenderTarget(),ag=this._renderer.getActiveCubeFace(),lg=this._renderer.getActiveMipmapLevel(),this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(e,i,s,r),n>0&&this._blur(r,0,0,n),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=K1(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=W1(),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?v:0,v,v),d.setRenderTarget(s),E&&d.render(m,a),d.render(e,a)}m.geometry.dispose(),m.material.dispose(),d.toneMapping=f,d.autoClear=h,e.background=b}_textureToCubeUV(e,n){const i=this._renderer,s=e.mapping===Ta||e.mapping===xa;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=K1()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=W1());const r=s?this._cubemapMaterial:this._equirectMaterial,o=new Hn(this._lodPlanes[0],r),a=r.uniforms;a.envMap.value=e;const l=this._cubeSize;gd(n,0,0,3*l,2*l),i.setRenderTarget(n),i.render(o,rg)}_applyPMREM(e){const n=this._renderer,i=n.autoClear;n.autoClear=!1;for(let s=1;sZr&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${b} samples when the maximum is set to ${Zr}`);const g=[];let y=0;for(let O=0;Ov-Xo?s-v+Xo:0),T=4*(this._cubeSize-S);gd(n,C,T,3*S,2*S),l.setRenderTarget(n),l.render(h,rg)}}function KOt(t){const e=[],n=[],i=[];let s=t;const r=t-Xo+1+z1.length;for(let o=0;ot-Xo?l=z1[o-t+Xo-1]:o===0&&(l=0),i.push(l);const u=1/(a-2),d=-u,h=1+u,f=[d,d,h,d,h,h,d,d,h,h,d,h],_=6,m=6,E=3,b=2,g=1,y=new Float32Array(E*m*_),v=new Float32Array(b*m*_),S=new Float32Array(g*m*_);for(let T=0;T<_;T++){const O=T%3*2/3-1,k=T>2?0:-1,x=[O,k,0,O+2/3,k,0,O+2/3,k+1,0,O,k,0,O+2/3,k+1,0,O,k+1,0];y.set(x,E*m*T),v.set(f,b*m*T);const I=[T,T,T,T,T,T];S.set(I,g*m*T)}const C=new ms;C.setAttribute("position",new Yn(y,E)),C.setAttribute("uv",new Yn(v,b)),C.setAttribute("faceIndex",new Yn(S,g)),e.push(C),s>Xo&&s--}return{lodPlanes:e,sizeLods:n,sigmas:i}}function $1(t,e,n){const i=new mo(t,e,n);return i.texture.mapping=lp,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function gd(t,e,n,i,s){t.viewport.set(e,n,i,s),t.scissor.set(e,n,i,s)}function jOt(t,e,n){const i=new Float32Array(Zr),s=new _e(0,1,0);return new go({name:"SphericalGaussianBlur",defines:{n:Zr,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:iy(),fragmentShader:` precision mediump float; precision mediump int; @@ -3783,26 +3783,26 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function jOt(t){let e=new WeakMap,n=null;function i(a){if(a&&a.isTexture){const l=a.mapping,u=l===ob||l===ab,d=l===Ta||l===xa;if(u||d)if(a.isRenderTargetTexture&&a.needsPMREMUpdate===!0){a.needsPMREMUpdate=!1;let h=e.get(a);return n===null&&(n=new Y1(t)),h=u?n.fromEquirectangular(a,h):n.fromCubemap(a,h),e.set(a,h),h.texture}else{if(e.has(a))return e.get(a).texture;{const h=a.image;if(u&&h&&h.height>0||d&&h&&s(h)){n===null&&(n=new Y1(t));const f=u?n.fromEquirectangular(a):n.fromCubemap(a);return e.set(a,f),a.addEventListener("dispose",r),f.texture}else return null}}}return a}function s(a){let l=0;const u=6;for(let d=0;de.maxTextureSize&&(F=Math.ceil(I/e.maxTextureSize),I=e.maxTextureSize);const B=new Float32Array(I*F*4*E),ne=new rI(B,I,F,E);ne.type=Ps,ne.needsUpdate=!0;const L=x*4;for(let H=0;H0)return t;const s=e*n;let r=j1[s];if(r===void 0&&(r=new Float32Array(s),j1[s]=r),e!==0){i.toArray(r,0);for(let o=1,a=0;o!==e;++o)a+=n,t[o].toArray(r,a)}return r}function mn(t,e){if(t.length!==e.length)return!1;for(let n=0,i=t.length;n0||d&&h&&s(h)){n===null&&(n=new Y1(t));const f=u?n.fromEquirectangular(a):n.fromCubemap(a);return e.set(a,f),a.addEventListener("dispose",r),f.texture}else return null}}}return a}function s(a){let l=0;const u=6;for(let d=0;de.maxTextureSize&&(F=Math.ceil(I/e.maxTextureSize),I=e.maxTextureSize);const B=new Float32Array(I*F*4*E),ne=new rI(B,I,F,E);ne.type=Ps,ne.needsUpdate=!0;const L=x*4;for(let H=0;H0)return t;const s=e*n;let r=j1[s];if(r===void 0&&(r=new Float32Array(s),j1[s]=r),e!==0){i.toArray(r,0);for(let o=1,a=0;o!==e;++o)a+=n,t[o].toArray(r,a)}return r}function mn(t,e){if(t.length!==e.length)return!1;for(let n=0,i=t.length;n":" "} ${a}: ${n[o]}`)}return i.join(` -`)}function XIt(t){const e=Gt.getPrimaries(Gt.workingColorSpace),n=Gt.getPrimaries(t);let i;switch(e===n?i="":e===gu&&n===mu?i="LinearDisplayP3ToLinearSRGB":e===mu&&n===gu&&(i="LinearSRGBToLinearDisplayP3"),t){case On:case cp:return[i,"LinearTransferOETF"];case on:case ZE:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",t),[i,"LinearTransferOETF"]}}function nw(t,e,n){const i=t.getShaderParameter(e,t.COMPILE_STATUS),s=t.getShaderInfoLog(e).trim();if(i&&s==="")return"";const r=/ERROR: 0:(\d+)/.exec(s);if(r){const o=parseInt(r[1]);return n.toUpperCase()+` +`)}function ZIt(t){const e=Gt.getPrimaries(Gt.workingColorSpace),n=Gt.getPrimaries(t);let i;switch(e===n?i="":e===gu&&n===mu?i="LinearDisplayP3ToLinearSRGB":e===mu&&n===gu&&(i="LinearSRGBToLinearDisplayP3"),t){case On:case cp:return[i,"LinearTransferOETF"];case on:case ZE:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",t),[i,"LinearTransferOETF"]}}function nw(t,e,n){const i=t.getShaderParameter(e,t.COMPILE_STATUS),s=t.getShaderInfoLog(e).trim();if(i&&s==="")return"";const r=/ERROR: 0:(\d+)/.exec(s);if(r){const o=parseInt(r[1]);return n.toUpperCase()+` `+s+` -`+QIt(t.getShaderSource(e),o)}else return s}function ZIt(t,e){const n=XIt(e);return`vec4 ${t}( vec4 value ) { return ${n[0]}( ${n[1]}( value ) ); }`}function JIt(t,e){let n;switch(e){case jwt:n="Linear";break;case Qwt:n="Reinhard";break;case Xwt:n="OptimizedCineon";break;case Zwt:n="ACESFilmic";break;case Jwt:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function eMt(t){return[t.extensionDerivatives||t.envMapCubeUVHeight||t.bumpMap||t.normalMapTangentSpace||t.clearcoatNormalMap||t.flatShading||t.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap||t.transmission)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Rl).join(` -`)}function tMt(t){const e=[];for(const n in t){const i=t[n];i!==!1&&e.push("#define "+n+" "+i)}return e.join(` -`)}function nMt(t,e){const n={},i=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let s=0;s/gm;function _b(t){return t.replace(iMt,rMt)}const sMt=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function rMt(t,e){let n=Tt[e];if(n===void 0){const i=sMt.get(e);if(i!==void 0)n=Tt[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 _b(n)}const oMt=/#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 rw(t){return t.replace(oMt,aMt)}function aMt(t,e,n,i){let s="";for(let r=parseInt(e);r/gm;function _b(t){return t.replace(sMt,oMt)}const rMt=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function oMt(t,e){let n=Tt[e];if(n===void 0){const i=rMt.get(e);if(i!==void 0)n=Tt[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 _b(n)}const aMt=/#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 rw(t){return t.replace(aMt,lMt)}function lMt(t,e,n,i){let s="";for(let r=parseInt(e);r0&&(b+=` `),g=[_,"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,m].filter(Rl).join(` `),g.length>0&&(g+=` `)):(b=[ow(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,m,n.batching?"#define USE_BATCHING":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+d:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.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(Rl).join(` -`),g=[_,ow(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,m,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.envMap?"#define "+d:"",n.envMap?"#define "+h:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==Tr?"#define TONE_MAPPING":"",n.toneMapping!==Tr?Tt.tonemapping_pars_fragment:"",n.toneMapping!==Tr?JIt("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Tt.colorspace_pars_fragment,ZIt("linearToOutputTexel",n.outputColorSpace),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",` +`),g=[_,ow(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,m,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.envMap?"#define "+d:"",n.envMap?"#define "+h:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==Tr?"#define TONE_MAPPING":"",n.toneMapping!==Tr?Tt.tonemapping_pars_fragment:"",n.toneMapping!==Tr?eMt("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Tt.colorspace_pars_fragment,JIt("linearToOutputTexel",n.outputColorSpace),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",` `].filter(Rl).join(` `)),o=_b(o),o=iw(o,n),o=sw(o,n),a=_b(a),a=iw(a,n),a=sw(a,n),o=rw(o),a=rw(a),n.isWebGL2&&n.isRawShaderMaterial!==!0&&(y=`#version 300 es `,b=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` @@ -3813,9 +3813,9 @@ precision `+t.precision+" int;";return t.precision==="highp"?e+=` Program Info Log: `+B+` `+U+` -`+Q)}else B!==""?console.warn("THREE.WebGLProgram: Program Info Log:",B):(ne===""||L==="")&&(H=!1);H&&(F.diagnostics={runnable:$,programLog:B,vertexShader:{log:ne,prefix:b},fragmentShader:{log:L,prefix:g}})}s.deleteShader(C),s.deleteShader(T),k=new Gd(s,E),x=nMt(s,E)}let k;this.getUniforms=function(){return k===void 0&&O(this),k};let x;this.getAttributes=function(){return x===void 0&&O(this),x};let I=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return I===!1&&(I=s.getProgramParameter(E,KIt)),I},this.destroy=function(){i.releaseStatesOfProgram(this),s.deleteProgram(E),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=jIt++,this.cacheKey=e,this.usedTimes=1,this.program=E,this.vertexShader=C,this.fragmentShader=T,this}let hMt=0;class fMt{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,i=e.fragmentShader,s=this._getShaderStage(n),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 n=this.materialCache.get(e);for(const i of n)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 n=this.materialCache;let i=n.get(e);return i===void 0&&(i=new Set,n.set(e,i)),i}_getShaderStage(e){const n=this.shaderCache;let i=n.get(e);return i===void 0&&(i=new mMt(e),n.set(e,i)),i}}class mMt{constructor(e){this.id=hMt++,this.code=e,this.usedTimes=0}}function gMt(t,e,n,i,s,r,o){const a=new oI,l=new fMt,u=[],d=s.isWebGL2,h=s.logarithmicDepthBuffer,f=s.vertexTextures;let _=s.precision;const m={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 E(x){return x===0?"uv":`uv${x}`}function b(x,I,F,B,ne){const L=B.fog,$=ne.geometry,H=x.isMeshStandardMaterial?B.environment:null,U=(x.isMeshStandardMaterial?n:e).get(x.envMap||H),Q=U&&U.mapping===lp?U.image.height:null,J=m[x.type];x.precision!==null&&(_=s.getMaxPrecision(x.precision),_!==x.precision&&console.warn("THREE.WebGLProgram.getParameters:",x.precision,"not supported, using",_,"instead."));const j=$.morphAttributes.position||$.morphAttributes.normal||$.morphAttributes.color,ae=j!==void 0?j.length:0;let ve=0;$.morphAttributes.position!==void 0&&(ve=1),$.morphAttributes.normal!==void 0&&(ve=2),$.morphAttributes.color!==void 0&&(ve=3);let ee,Ee,xe,Me;if(J){const cn=Zi[J];ee=cn.vertexShader,Ee=cn.fragmentShader}else ee=x.vertexShader,Ee=x.fragmentShader,l.update(x),xe=l.getVertexShaderID(x),Me=l.getFragmentShaderID(x);const Z=t.getRenderTarget(),ye=ne.isInstancedMesh===!0,fe=ne.isBatchedMesh===!0,Ne=!!x.map,Le=!!x.matcap,D=!!U,q=!!x.aoMap,K=!!x.lightMap,de=!!x.bumpMap,le=!!x.normalMap,Re=!!x.displacementMap,Ie=!!x.emissiveMap,z=!!x.metalnessMap,pe=!!x.roughnessMap,re=x.anisotropy>0,ce=x.clearcoat>0,M=x.iridescence>0,N=x.sheen>0,W=x.transmission>0,ue=re&&!!x.anisotropyMap,X=ce&&!!x.clearcoatMap,ie=ce&&!!x.clearcoatNormalMap,Ae=ce&&!!x.clearcoatRoughnessMap,Ce=M&&!!x.iridescenceMap,ke=M&&!!x.iridescenceThicknessMap,Qe=N&&!!x.sheenColorMap,ct=N&&!!x.sheenRoughnessMap,Pe=!!x.specularMap,ut=!!x.specularColorMap,Je=!!x.specularIntensityMap,qe=W&&!!x.transmissionMap,tt=W&&!!x.thicknessMap,Fe=!!x.gradientMap,pt=!!x.alphaMap,oe=x.alphaTest>0,Ke=!!x.alphaHash,Ue=!!x.extensions,Oe=!!$.attributes.uv1,Be=!!$.attributes.uv2,dt=!!$.attributes.uv3;let Et=Tr;return x.toneMapped&&(Z===null||Z.isXRRenderTarget===!0)&&(Et=t.toneMapping),{isWebGL2:d,shaderID:J,shaderType:x.type,shaderName:x.name,vertexShader:ee,fragmentShader:Ee,defines:x.defines,customVertexShaderID:xe,customFragmentShaderID:Me,isRawShaderMaterial:x.isRawShaderMaterial===!0,glslVersion:x.glslVersion,precision:_,batching:fe,instancing:ye,instancingColor:ye&&ne.instanceColor!==null,supportsVertexTextures:f,outputColorSpace:Z===null?t.outputColorSpace:Z.isXRRenderTarget===!0?Z.texture.colorSpace:On,map:Ne,matcap:Le,envMap:D,envMapMode:D&&U.mapping,envMapCubeUVHeight:Q,aoMap:q,lightMap:K,bumpMap:de,normalMap:le,displacementMap:f&&Re,emissiveMap:Ie,normalMapObjectSpace:le&&x.normalMapType===_Rt,normalMapTangentSpace:le&&x.normalMapType===XE,metalnessMap:z,roughnessMap:pe,anisotropy:re,anisotropyMap:ue,clearcoat:ce,clearcoatMap:X,clearcoatNormalMap:ie,clearcoatRoughnessMap:Ae,iridescence:M,iridescenceMap:Ce,iridescenceThicknessMap:ke,sheen:N,sheenColorMap:Qe,sheenRoughnessMap:ct,specularMap:Pe,specularColorMap:ut,specularIntensityMap:Je,transmission:W,transmissionMap:qe,thicknessMap:tt,gradientMap:Fe,opaque:x.transparent===!1&&x.blending===aa,alphaMap:pt,alphaTest:oe,alphaHash:Ke,combine:x.combine,mapUv:Ne&&E(x.map.channel),aoMapUv:q&&E(x.aoMap.channel),lightMapUv:K&&E(x.lightMap.channel),bumpMapUv:de&&E(x.bumpMap.channel),normalMapUv:le&&E(x.normalMap.channel),displacementMapUv:Re&&E(x.displacementMap.channel),emissiveMapUv:Ie&&E(x.emissiveMap.channel),metalnessMapUv:z&&E(x.metalnessMap.channel),roughnessMapUv:pe&&E(x.roughnessMap.channel),anisotropyMapUv:ue&&E(x.anisotropyMap.channel),clearcoatMapUv:X&&E(x.clearcoatMap.channel),clearcoatNormalMapUv:ie&&E(x.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ae&&E(x.clearcoatRoughnessMap.channel),iridescenceMapUv:Ce&&E(x.iridescenceMap.channel),iridescenceThicknessMapUv:ke&&E(x.iridescenceThicknessMap.channel),sheenColorMapUv:Qe&&E(x.sheenColorMap.channel),sheenRoughnessMapUv:ct&&E(x.sheenRoughnessMap.channel),specularMapUv:Pe&&E(x.specularMap.channel),specularColorMapUv:ut&&E(x.specularColorMap.channel),specularIntensityMapUv:Je&&E(x.specularIntensityMap.channel),transmissionMapUv:qe&&E(x.transmissionMap.channel),thicknessMapUv:tt&&E(x.thicknessMap.channel),alphaMapUv:pt&&E(x.alphaMap.channel),vertexTangents:!!$.attributes.tangent&&(le||re),vertexColors:x.vertexColors,vertexAlphas:x.vertexColors===!0&&!!$.attributes.color&&$.attributes.color.itemSize===4,vertexUv1s:Oe,vertexUv2s:Be,vertexUv3s:dt,pointsUvs:ne.isPoints===!0&&!!$.attributes.uv&&(Ne||pt),fog:!!L,useFog:x.fog===!0,fogExp2:L&&L.isFogExp2,flatShading:x.flatShading===!0,sizeAttenuation:x.sizeAttenuation===!0,logarithmicDepthBuffer:h,skinning:ne.isSkinnedMesh===!0,morphTargets:$.morphAttributes.position!==void 0,morphNormals:$.morphAttributes.normal!==void 0,morphColors:$.morphAttributes.color!==void 0,morphTargetsCount:ae,morphTextureStride:ve,numDirLights:I.directional.length,numPointLights:I.point.length,numSpotLights:I.spot.length,numSpotLightMaps:I.spotLightMap.length,numRectAreaLights:I.rectArea.length,numHemiLights:I.hemi.length,numDirLightShadows:I.directionalShadowMap.length,numPointLightShadows:I.pointShadowMap.length,numSpotLightShadows:I.spotShadowMap.length,numSpotLightShadowsWithMaps:I.numSpotLightShadowsWithMaps,numLightProbes:I.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:x.dithering,shadowMapEnabled:t.shadowMap.enabled&&F.length>0,shadowMapType:t.shadowMap.type,toneMapping:Et,useLegacyLights:t._useLegacyLights,decodeVideoTexture:Ne&&x.map.isVideoTexture===!0&&Gt.getTransfer(x.map.colorSpace)===Zt,premultipliedAlpha:x.premultipliedAlpha,doubleSided:x.side===es,flipSided:x.side===Zn,useDepthPacking:x.depthPacking>=0,depthPacking:x.depthPacking||0,index0AttributeName:x.index0AttributeName,extensionDerivatives:Ue&&x.extensions.derivatives===!0,extensionFragDepth:Ue&&x.extensions.fragDepth===!0,extensionDrawBuffers:Ue&&x.extensions.drawBuffers===!0,extensionShaderTextureLOD:Ue&&x.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:x.customProgramCacheKey()}}function g(x){const I=[];if(x.shaderID?I.push(x.shaderID):(I.push(x.customVertexShaderID),I.push(x.customFragmentShaderID)),x.defines!==void 0)for(const F in x.defines)I.push(F),I.push(x.defines[F]);return x.isRawShaderMaterial===!1&&(y(I,x),v(I,x),I.push(t.outputColorSpace)),I.push(x.customProgramCacheKey),I.join()}function y(x,I){x.push(I.precision),x.push(I.outputColorSpace),x.push(I.envMapMode),x.push(I.envMapCubeUVHeight),x.push(I.mapUv),x.push(I.alphaMapUv),x.push(I.lightMapUv),x.push(I.aoMapUv),x.push(I.bumpMapUv),x.push(I.normalMapUv),x.push(I.displacementMapUv),x.push(I.emissiveMapUv),x.push(I.metalnessMapUv),x.push(I.roughnessMapUv),x.push(I.anisotropyMapUv),x.push(I.clearcoatMapUv),x.push(I.clearcoatNormalMapUv),x.push(I.clearcoatRoughnessMapUv),x.push(I.iridescenceMapUv),x.push(I.iridescenceThicknessMapUv),x.push(I.sheenColorMapUv),x.push(I.sheenRoughnessMapUv),x.push(I.specularMapUv),x.push(I.specularColorMapUv),x.push(I.specularIntensityMapUv),x.push(I.transmissionMapUv),x.push(I.thicknessMapUv),x.push(I.combine),x.push(I.fogExp2),x.push(I.sizeAttenuation),x.push(I.morphTargetsCount),x.push(I.morphAttributeCount),x.push(I.numDirLights),x.push(I.numPointLights),x.push(I.numSpotLights),x.push(I.numSpotLightMaps),x.push(I.numHemiLights),x.push(I.numRectAreaLights),x.push(I.numDirLightShadows),x.push(I.numPointLightShadows),x.push(I.numSpotLightShadows),x.push(I.numSpotLightShadowsWithMaps),x.push(I.numLightProbes),x.push(I.shadowMapType),x.push(I.toneMapping),x.push(I.numClippingPlanes),x.push(I.numClipIntersection),x.push(I.depthPacking)}function v(x,I){a.disableAll(),I.isWebGL2&&a.enable(0),I.supportsVertexTextures&&a.enable(1),I.instancing&&a.enable(2),I.instancingColor&&a.enable(3),I.matcap&&a.enable(4),I.envMap&&a.enable(5),I.normalMapObjectSpace&&a.enable(6),I.normalMapTangentSpace&&a.enable(7),I.clearcoat&&a.enable(8),I.iridescence&&a.enable(9),I.alphaTest&&a.enable(10),I.vertexColors&&a.enable(11),I.vertexAlphas&&a.enable(12),I.vertexUv1s&&a.enable(13),I.vertexUv2s&&a.enable(14),I.vertexUv3s&&a.enable(15),I.vertexTangents&&a.enable(16),I.anisotropy&&a.enable(17),I.alphaHash&&a.enable(18),I.batching&&a.enable(19),x.push(a.mask),a.disableAll(),I.fog&&a.enable(0),I.useFog&&a.enable(1),I.flatShading&&a.enable(2),I.logarithmicDepthBuffer&&a.enable(3),I.skinning&&a.enable(4),I.morphTargets&&a.enable(5),I.morphNormals&&a.enable(6),I.morphColors&&a.enable(7),I.premultipliedAlpha&&a.enable(8),I.shadowMapEnabled&&a.enable(9),I.useLegacyLights&&a.enable(10),I.doubleSided&&a.enable(11),I.flipSided&&a.enable(12),I.useDepthPacking&&a.enable(13),I.dithering&&a.enable(14),I.transmission&&a.enable(15),I.sheen&&a.enable(16),I.opaque&&a.enable(17),I.pointsUvs&&a.enable(18),I.decodeVideoTexture&&a.enable(19),x.push(a.mask)}function S(x){const I=m[x.type];let F;if(I){const B=Zi[I];F=eAt.clone(B.uniforms)}else F=x.uniforms;return F}function C(x,I){let F;for(let B=0,ne=u.length;B0?i.push(g):_.transparent===!0?s.push(g):n.push(g)}function l(h,f,_,m,E,b){const g=o(h,f,_,m,E,b);_.transmission>0?i.unshift(g):_.transparent===!0?s.unshift(g):n.unshift(g)}function u(h,f){n.length>1&&n.sort(h||EMt),i.length>1&&i.sort(f||aw),s.length>1&&s.sort(f||aw)}function d(){for(let h=e,f=t.length;h=r.length?(o=new lw,r.push(o)):o=r[s],o}function n(){t=new WeakMap}return{get:e,dispose:n}}function vMt(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new _e,color:new gt};break;case"SpotLight":n={position:new _e,direction:new _e,color:new gt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new _e,color:new gt,distance:0,decay:0};break;case"HemisphereLight":n={direction:new _e,skyColor:new gt,groundColor:new gt};break;case"RectAreaLight":n={color:new gt,position:new _e,halfWidth:new _e,halfHeight:new _e};break}return t[e.id]=n,n}}}function SMt(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new It};break;case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new It};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new It,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let TMt=0;function xMt(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function CMt(t,e){const n=new vMt,i=SMt(),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 _e);const r=new _e,o=new Rt,a=new Rt;function l(d,h){let f=0,_=0,m=0;for(let B=0;B<9;B++)s.probe[B].set(0,0,0);let E=0,b=0,g=0,y=0,v=0,S=0,C=0,T=0,O=0,k=0,x=0;d.sort(xMt);const I=h===!0?Math.PI:1;for(let B=0,ne=d.length;B0&&(e.isWebGL2||t.has("OES_texture_float_linear")===!0?(s.rectAreaLTC1=je.LTC_FLOAT_1,s.rectAreaLTC2=je.LTC_FLOAT_2):t.has("OES_texture_half_float_linear")===!0?(s.rectAreaLTC1=je.LTC_HALF_1,s.rectAreaLTC2=je.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),s.ambient[0]=f,s.ambient[1]=_,s.ambient[2]=m;const F=s.hash;(F.directionalLength!==E||F.pointLength!==b||F.spotLength!==g||F.rectAreaLength!==y||F.hemiLength!==v||F.numDirectionalShadows!==S||F.numPointShadows!==C||F.numSpotShadows!==T||F.numSpotMaps!==O||F.numLightProbes!==x)&&(s.directional.length=E,s.spot.length=g,s.rectArea.length=y,s.point.length=b,s.hemi.length=v,s.directionalShadow.length=S,s.directionalShadowMap.length=S,s.pointShadow.length=C,s.pointShadowMap.length=C,s.spotShadow.length=T,s.spotShadowMap.length=T,s.directionalShadowMatrix.length=S,s.pointShadowMatrix.length=C,s.spotLightMatrix.length=T+O-k,s.spotLightMap.length=O,s.numSpotLightShadowsWithMaps=k,s.numLightProbes=x,F.directionalLength=E,F.pointLength=b,F.spotLength=g,F.rectAreaLength=y,F.hemiLength=v,F.numDirectionalShadows=S,F.numPointShadows=C,F.numSpotShadows=T,F.numSpotMaps=O,F.numLightProbes=x,s.version=TMt++)}function u(d,h){let f=0,_=0,m=0,E=0,b=0;const g=h.matrixWorldInverse;for(let y=0,v=d.length;y=a.length?(l=new cw(t,e),a.push(l)):l=a[o],l}function s(){n=new WeakMap}return{get:i,dispose:s}}class RMt extends Hi{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=uRt,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 AMt extends Hi{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 NMt=`void main() { +`+Q)}else B!==""?console.warn("THREE.WebGLProgram: Program Info Log:",B):(ne===""||L==="")&&(H=!1);H&&(F.diagnostics={runnable:$,programLog:B,vertexShader:{log:ne,prefix:b},fragmentShader:{log:L,prefix:g}})}s.deleteShader(C),s.deleteShader(T),k=new Gd(s,E),x=iMt(s,E)}let k;this.getUniforms=function(){return k===void 0&&O(this),k};let x;this.getAttributes=function(){return x===void 0&&O(this),x};let I=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return I===!1&&(I=s.getProgramParameter(E,jIt)),I},this.destroy=function(){i.releaseStatesOfProgram(this),s.deleteProgram(E),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=QIt++,this.cacheKey=e,this.usedTimes=1,this.program=E,this.vertexShader=C,this.fragmentShader=T,this}let fMt=0;class mMt{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,i=e.fragmentShader,s=this._getShaderStage(n),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 n=this.materialCache.get(e);for(const i of n)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 n=this.materialCache;let i=n.get(e);return i===void 0&&(i=new Set,n.set(e,i)),i}_getShaderStage(e){const n=this.shaderCache;let i=n.get(e);return i===void 0&&(i=new gMt(e),n.set(e,i)),i}}class gMt{constructor(e){this.id=fMt++,this.code=e,this.usedTimes=0}}function bMt(t,e,n,i,s,r,o){const a=new oI,l=new mMt,u=[],d=s.isWebGL2,h=s.logarithmicDepthBuffer,f=s.vertexTextures;let _=s.precision;const m={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 E(x){return x===0?"uv":`uv${x}`}function b(x,I,F,B,ne){const L=B.fog,$=ne.geometry,H=x.isMeshStandardMaterial?B.environment:null,U=(x.isMeshStandardMaterial?n:e).get(x.envMap||H),Q=U&&U.mapping===lp?U.image.height:null,J=m[x.type];x.precision!==null&&(_=s.getMaxPrecision(x.precision),_!==x.precision&&console.warn("THREE.WebGLProgram.getParameters:",x.precision,"not supported, using",_,"instead."));const j=$.morphAttributes.position||$.morphAttributes.normal||$.morphAttributes.color,ae=j!==void 0?j.length:0;let ve=0;$.morphAttributes.position!==void 0&&(ve=1),$.morphAttributes.normal!==void 0&&(ve=2),$.morphAttributes.color!==void 0&&(ve=3);let ee,Ee,xe,Me;if(J){const cn=Zi[J];ee=cn.vertexShader,Ee=cn.fragmentShader}else ee=x.vertexShader,Ee=x.fragmentShader,l.update(x),xe=l.getVertexShaderID(x),Me=l.getFragmentShaderID(x);const Z=t.getRenderTarget(),ye=ne.isInstancedMesh===!0,fe=ne.isBatchedMesh===!0,Ne=!!x.map,Le=!!x.matcap,D=!!U,q=!!x.aoMap,K=!!x.lightMap,de=!!x.bumpMap,le=!!x.normalMap,Re=!!x.displacementMap,Ie=!!x.emissiveMap,z=!!x.metalnessMap,pe=!!x.roughnessMap,re=x.anisotropy>0,ce=x.clearcoat>0,M=x.iridescence>0,N=x.sheen>0,W=x.transmission>0,ue=re&&!!x.anisotropyMap,X=ce&&!!x.clearcoatMap,ie=ce&&!!x.clearcoatNormalMap,Ae=ce&&!!x.clearcoatRoughnessMap,Ce=M&&!!x.iridescenceMap,ke=M&&!!x.iridescenceThicknessMap,Qe=N&&!!x.sheenColorMap,ct=N&&!!x.sheenRoughnessMap,Pe=!!x.specularMap,ut=!!x.specularColorMap,Je=!!x.specularIntensityMap,qe=W&&!!x.transmissionMap,tt=W&&!!x.thicknessMap,Fe=!!x.gradientMap,pt=!!x.alphaMap,oe=x.alphaTest>0,Ke=!!x.alphaHash,Ue=!!x.extensions,Oe=!!$.attributes.uv1,Be=!!$.attributes.uv2,dt=!!$.attributes.uv3;let Et=Tr;return x.toneMapped&&(Z===null||Z.isXRRenderTarget===!0)&&(Et=t.toneMapping),{isWebGL2:d,shaderID:J,shaderType:x.type,shaderName:x.name,vertexShader:ee,fragmentShader:Ee,defines:x.defines,customVertexShaderID:xe,customFragmentShaderID:Me,isRawShaderMaterial:x.isRawShaderMaterial===!0,glslVersion:x.glslVersion,precision:_,batching:fe,instancing:ye,instancingColor:ye&&ne.instanceColor!==null,supportsVertexTextures:f,outputColorSpace:Z===null?t.outputColorSpace:Z.isXRRenderTarget===!0?Z.texture.colorSpace:On,map:Ne,matcap:Le,envMap:D,envMapMode:D&&U.mapping,envMapCubeUVHeight:Q,aoMap:q,lightMap:K,bumpMap:de,normalMap:le,displacementMap:f&&Re,emissiveMap:Ie,normalMapObjectSpace:le&&x.normalMapType===hRt,normalMapTangentSpace:le&&x.normalMapType===XE,metalnessMap:z,roughnessMap:pe,anisotropy:re,anisotropyMap:ue,clearcoat:ce,clearcoatMap:X,clearcoatNormalMap:ie,clearcoatRoughnessMap:Ae,iridescence:M,iridescenceMap:Ce,iridescenceThicknessMap:ke,sheen:N,sheenColorMap:Qe,sheenRoughnessMap:ct,specularMap:Pe,specularColorMap:ut,specularIntensityMap:Je,transmission:W,transmissionMap:qe,thicknessMap:tt,gradientMap:Fe,opaque:x.transparent===!1&&x.blending===aa,alphaMap:pt,alphaTest:oe,alphaHash:Ke,combine:x.combine,mapUv:Ne&&E(x.map.channel),aoMapUv:q&&E(x.aoMap.channel),lightMapUv:K&&E(x.lightMap.channel),bumpMapUv:de&&E(x.bumpMap.channel),normalMapUv:le&&E(x.normalMap.channel),displacementMapUv:Re&&E(x.displacementMap.channel),emissiveMapUv:Ie&&E(x.emissiveMap.channel),metalnessMapUv:z&&E(x.metalnessMap.channel),roughnessMapUv:pe&&E(x.roughnessMap.channel),anisotropyMapUv:ue&&E(x.anisotropyMap.channel),clearcoatMapUv:X&&E(x.clearcoatMap.channel),clearcoatNormalMapUv:ie&&E(x.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ae&&E(x.clearcoatRoughnessMap.channel),iridescenceMapUv:Ce&&E(x.iridescenceMap.channel),iridescenceThicknessMapUv:ke&&E(x.iridescenceThicknessMap.channel),sheenColorMapUv:Qe&&E(x.sheenColorMap.channel),sheenRoughnessMapUv:ct&&E(x.sheenRoughnessMap.channel),specularMapUv:Pe&&E(x.specularMap.channel),specularColorMapUv:ut&&E(x.specularColorMap.channel),specularIntensityMapUv:Je&&E(x.specularIntensityMap.channel),transmissionMapUv:qe&&E(x.transmissionMap.channel),thicknessMapUv:tt&&E(x.thicknessMap.channel),alphaMapUv:pt&&E(x.alphaMap.channel),vertexTangents:!!$.attributes.tangent&&(le||re),vertexColors:x.vertexColors,vertexAlphas:x.vertexColors===!0&&!!$.attributes.color&&$.attributes.color.itemSize===4,vertexUv1s:Oe,vertexUv2s:Be,vertexUv3s:dt,pointsUvs:ne.isPoints===!0&&!!$.attributes.uv&&(Ne||pt),fog:!!L,useFog:x.fog===!0,fogExp2:L&&L.isFogExp2,flatShading:x.flatShading===!0,sizeAttenuation:x.sizeAttenuation===!0,logarithmicDepthBuffer:h,skinning:ne.isSkinnedMesh===!0,morphTargets:$.morphAttributes.position!==void 0,morphNormals:$.morphAttributes.normal!==void 0,morphColors:$.morphAttributes.color!==void 0,morphTargetsCount:ae,morphTextureStride:ve,numDirLights:I.directional.length,numPointLights:I.point.length,numSpotLights:I.spot.length,numSpotLightMaps:I.spotLightMap.length,numRectAreaLights:I.rectArea.length,numHemiLights:I.hemi.length,numDirLightShadows:I.directionalShadowMap.length,numPointLightShadows:I.pointShadowMap.length,numSpotLightShadows:I.spotShadowMap.length,numSpotLightShadowsWithMaps:I.numSpotLightShadowsWithMaps,numLightProbes:I.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:x.dithering,shadowMapEnabled:t.shadowMap.enabled&&F.length>0,shadowMapType:t.shadowMap.type,toneMapping:Et,useLegacyLights:t._useLegacyLights,decodeVideoTexture:Ne&&x.map.isVideoTexture===!0&&Gt.getTransfer(x.map.colorSpace)===Zt,premultipliedAlpha:x.premultipliedAlpha,doubleSided:x.side===es,flipSided:x.side===Zn,useDepthPacking:x.depthPacking>=0,depthPacking:x.depthPacking||0,index0AttributeName:x.index0AttributeName,extensionDerivatives:Ue&&x.extensions.derivatives===!0,extensionFragDepth:Ue&&x.extensions.fragDepth===!0,extensionDrawBuffers:Ue&&x.extensions.drawBuffers===!0,extensionShaderTextureLOD:Ue&&x.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:x.customProgramCacheKey()}}function g(x){const I=[];if(x.shaderID?I.push(x.shaderID):(I.push(x.customVertexShaderID),I.push(x.customFragmentShaderID)),x.defines!==void 0)for(const F in x.defines)I.push(F),I.push(x.defines[F]);return x.isRawShaderMaterial===!1&&(y(I,x),v(I,x),I.push(t.outputColorSpace)),I.push(x.customProgramCacheKey),I.join()}function y(x,I){x.push(I.precision),x.push(I.outputColorSpace),x.push(I.envMapMode),x.push(I.envMapCubeUVHeight),x.push(I.mapUv),x.push(I.alphaMapUv),x.push(I.lightMapUv),x.push(I.aoMapUv),x.push(I.bumpMapUv),x.push(I.normalMapUv),x.push(I.displacementMapUv),x.push(I.emissiveMapUv),x.push(I.metalnessMapUv),x.push(I.roughnessMapUv),x.push(I.anisotropyMapUv),x.push(I.clearcoatMapUv),x.push(I.clearcoatNormalMapUv),x.push(I.clearcoatRoughnessMapUv),x.push(I.iridescenceMapUv),x.push(I.iridescenceThicknessMapUv),x.push(I.sheenColorMapUv),x.push(I.sheenRoughnessMapUv),x.push(I.specularMapUv),x.push(I.specularColorMapUv),x.push(I.specularIntensityMapUv),x.push(I.transmissionMapUv),x.push(I.thicknessMapUv),x.push(I.combine),x.push(I.fogExp2),x.push(I.sizeAttenuation),x.push(I.morphTargetsCount),x.push(I.morphAttributeCount),x.push(I.numDirLights),x.push(I.numPointLights),x.push(I.numSpotLights),x.push(I.numSpotLightMaps),x.push(I.numHemiLights),x.push(I.numRectAreaLights),x.push(I.numDirLightShadows),x.push(I.numPointLightShadows),x.push(I.numSpotLightShadows),x.push(I.numSpotLightShadowsWithMaps),x.push(I.numLightProbes),x.push(I.shadowMapType),x.push(I.toneMapping),x.push(I.numClippingPlanes),x.push(I.numClipIntersection),x.push(I.depthPacking)}function v(x,I){a.disableAll(),I.isWebGL2&&a.enable(0),I.supportsVertexTextures&&a.enable(1),I.instancing&&a.enable(2),I.instancingColor&&a.enable(3),I.matcap&&a.enable(4),I.envMap&&a.enable(5),I.normalMapObjectSpace&&a.enable(6),I.normalMapTangentSpace&&a.enable(7),I.clearcoat&&a.enable(8),I.iridescence&&a.enable(9),I.alphaTest&&a.enable(10),I.vertexColors&&a.enable(11),I.vertexAlphas&&a.enable(12),I.vertexUv1s&&a.enable(13),I.vertexUv2s&&a.enable(14),I.vertexUv3s&&a.enable(15),I.vertexTangents&&a.enable(16),I.anisotropy&&a.enable(17),I.alphaHash&&a.enable(18),I.batching&&a.enable(19),x.push(a.mask),a.disableAll(),I.fog&&a.enable(0),I.useFog&&a.enable(1),I.flatShading&&a.enable(2),I.logarithmicDepthBuffer&&a.enable(3),I.skinning&&a.enable(4),I.morphTargets&&a.enable(5),I.morphNormals&&a.enable(6),I.morphColors&&a.enable(7),I.premultipliedAlpha&&a.enable(8),I.shadowMapEnabled&&a.enable(9),I.useLegacyLights&&a.enable(10),I.doubleSided&&a.enable(11),I.flipSided&&a.enable(12),I.useDepthPacking&&a.enable(13),I.dithering&&a.enable(14),I.transmission&&a.enable(15),I.sheen&&a.enable(16),I.opaque&&a.enable(17),I.pointsUvs&&a.enable(18),I.decodeVideoTexture&&a.enable(19),x.push(a.mask)}function S(x){const I=m[x.type];let F;if(I){const B=Zi[I];F=tAt.clone(B.uniforms)}else F=x.uniforms;return F}function C(x,I){let F;for(let B=0,ne=u.length;B0?i.push(g):_.transparent===!0?s.push(g):n.push(g)}function l(h,f,_,m,E,b){const g=o(h,f,_,m,E,b);_.transmission>0?i.unshift(g):_.transparent===!0?s.unshift(g):n.unshift(g)}function u(h,f){n.length>1&&n.sort(h||yMt),i.length>1&&i.sort(f||aw),s.length>1&&s.sort(f||aw)}function d(){for(let h=e,f=t.length;h=r.length?(o=new lw,r.push(o)):o=r[s],o}function n(){t=new WeakMap}return{get:e,dispose:n}}function SMt(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new _e,color:new gt};break;case"SpotLight":n={position:new _e,direction:new _e,color:new gt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new _e,color:new gt,distance:0,decay:0};break;case"HemisphereLight":n={direction:new _e,skyColor:new gt,groundColor:new gt};break;case"RectAreaLight":n={color:new gt,position:new _e,halfWidth:new _e,halfHeight:new _e};break}return t[e.id]=n,n}}}function TMt(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new It};break;case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new It};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new It,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let xMt=0;function CMt(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function wMt(t,e){const n=new SMt,i=TMt(),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 _e);const r=new _e,o=new Rt,a=new Rt;function l(d,h){let f=0,_=0,m=0;for(let B=0;B<9;B++)s.probe[B].set(0,0,0);let E=0,b=0,g=0,y=0,v=0,S=0,C=0,T=0,O=0,k=0,x=0;d.sort(CMt);const I=h===!0?Math.PI:1;for(let B=0,ne=d.length;B0&&(e.isWebGL2||t.has("OES_texture_float_linear")===!0?(s.rectAreaLTC1=je.LTC_FLOAT_1,s.rectAreaLTC2=je.LTC_FLOAT_2):t.has("OES_texture_half_float_linear")===!0?(s.rectAreaLTC1=je.LTC_HALF_1,s.rectAreaLTC2=je.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),s.ambient[0]=f,s.ambient[1]=_,s.ambient[2]=m;const F=s.hash;(F.directionalLength!==E||F.pointLength!==b||F.spotLength!==g||F.rectAreaLength!==y||F.hemiLength!==v||F.numDirectionalShadows!==S||F.numPointShadows!==C||F.numSpotShadows!==T||F.numSpotMaps!==O||F.numLightProbes!==x)&&(s.directional.length=E,s.spot.length=g,s.rectArea.length=y,s.point.length=b,s.hemi.length=v,s.directionalShadow.length=S,s.directionalShadowMap.length=S,s.pointShadow.length=C,s.pointShadowMap.length=C,s.spotShadow.length=T,s.spotShadowMap.length=T,s.directionalShadowMatrix.length=S,s.pointShadowMatrix.length=C,s.spotLightMatrix.length=T+O-k,s.spotLightMap.length=O,s.numSpotLightShadowsWithMaps=k,s.numLightProbes=x,F.directionalLength=E,F.pointLength=b,F.spotLength=g,F.rectAreaLength=y,F.hemiLength=v,F.numDirectionalShadows=S,F.numPointShadows=C,F.numSpotShadows=T,F.numSpotMaps=O,F.numLightProbes=x,s.version=xMt++)}function u(d,h){let f=0,_=0,m=0,E=0,b=0;const g=h.matrixWorldInverse;for(let y=0,v=d.length;y=a.length?(l=new cw(t,e),a.push(l)):l=a[o],l}function s(){n=new WeakMap}return{get:i,dispose:s}}class AMt extends Hi{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=pRt,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 NMt extends Hi{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 OMt=`void main() { gl_Position = vec4( position, 1.0 ); -}`,OMt=`uniform sampler2D shadow_pass; +}`,IMt=`uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; #include @@ -3841,8 +3841,8 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function IMt(t,e,n){let i=new ey;const s=new It,r=new It,o=new Wt,a=new RMt({depthPacking:pRt}),l=new AMt,u={},d=n.maxTextureSize,h={[Ys]:Zn,[Zn]:Ys,[es]:es},f=new go({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new It},radius:{value:4}},vertexShader:NMt,fragmentShader:OMt}),_=f.clone();_.defines.HORIZONTAL_PASS=1;const m=new ms;m.setAttribute("position",new Yn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const E=new Hn(m,f),b=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=HO;let g=this.type;this.render=function(C,T,O){if(b.enabled===!1||b.autoUpdate===!1&&b.needsUpdate===!1||C.length===0)return;const k=t.getRenderTarget(),x=t.getActiveCubeFace(),I=t.getActiveMipmapLevel(),F=t.state;F.setBlending(Sr),F.buffers.color.setClear(1,1,1,1),F.buffers.depth.setTest(!0),F.setScissorTest(!1);const B=g!==Ms&&this.type===Ms,ne=g===Ms&&this.type!==Ms;for(let L=0,$=C.length;L<$;L++){const H=C[L],U=H.shadow;if(U===void 0){console.warn("THREE.WebGLShadowMap:",H,"has no shadow.");continue}if(U.autoUpdate===!1&&U.needsUpdate===!1)continue;s.copy(U.mapSize);const Q=U.getFrameExtents();if(s.multiply(Q),r.copy(U.mapSize),(s.x>d||s.y>d)&&(s.x>d&&(r.x=Math.floor(d/Q.x),s.x=r.x*Q.x,U.mapSize.x=r.x),s.y>d&&(r.y=Math.floor(d/Q.y),s.y=r.y*Q.y,U.mapSize.y=r.y)),U.map===null||B===!0||ne===!0){const j=this.type!==Ms?{minFilter:yn,magFilter:yn}:{};U.map!==null&&U.map.dispose(),U.map=new mo(s.x,s.y,j),U.map.texture.name=H.name+".shadowMap",U.camera.updateProjectionMatrix()}t.setRenderTarget(U.map),t.clear();const J=U.getViewportCount();for(let j=0;j0||T.map&&T.alphaTest>0){const F=x.uuid,B=T.uuid;let ne=u[F];ne===void 0&&(ne={},u[F]=ne);let L=ne[B];L===void 0&&(L=x.clone(),ne[B]=L),x=L}if(x.visible=T.visible,x.wireframe=T.wireframe,k===Ms?x.side=T.shadowSide!==null?T.shadowSide:T.side:x.side=T.shadowSide!==null?T.shadowSide:h[T.side],x.alphaMap=T.alphaMap,x.alphaTest=T.alphaTest,x.map=T.map,x.clipShadows=T.clipShadows,x.clippingPlanes=T.clippingPlanes,x.clipIntersection=T.clipIntersection,x.displacementMap=T.displacementMap,x.displacementScale=T.displacementScale,x.displacementBias=T.displacementBias,x.wireframeLinewidth=T.wireframeLinewidth,x.linewidth=T.linewidth,O.isPointLight===!0&&x.isMeshDistanceMaterial===!0){const F=t.properties.get(x);F.light=O}return x}function S(C,T,O,k,x){if(C.visible===!1)return;if(C.layers.test(T.layers)&&(C.isMesh||C.isLine||C.isPoints)&&(C.castShadow||C.receiveShadow&&x===Ms)&&(!C.frustumCulled||i.intersectsObject(C))){C.modelViewMatrix.multiplyMatrices(O.matrixWorldInverse,C.matrixWorld);const B=e.update(C),ne=C.material;if(Array.isArray(ne)){const L=B.groups;for(let $=0,H=L.length;$=1):j.indexOf("OpenGL ES")!==-1&&(J=parseFloat(/^OpenGL ES (\d)/.exec(j)[1]),Q=J>=2);let ae=null,ve={};const ee=t.getParameter(t.SCISSOR_BOX),Ee=t.getParameter(t.VIEWPORT),xe=new Wt().fromArray(ee),Me=new Wt().fromArray(Ee);function Z(oe,Ke,Ue,Oe){const Be=new Uint8Array(4),dt=t.createTexture();t.bindTexture(oe,dt),t.texParameteri(oe,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(oe,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let Et=0;Et"u"?!1:/OculusBrowser/g.test(navigator.userAgent),m=new WeakMap;let E;const b=new WeakMap;let g=!1;try{g=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function y(M,N){return g?new OffscreenCanvas(M,N):ac("canvas")}function v(M,N,W,ue){let X=1;if((M.width>ue||M.height>ue)&&(X=ue/Math.max(M.width,M.height)),X<1||N===!0)if(typeof HTMLImageElement<"u"&&M instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&M instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&M instanceof ImageBitmap){const ie=N?Eu:Math.floor,Ae=ie(X*M.width),Ce=ie(X*M.height);E===void 0&&(E=y(Ae,Ce));const ke=W?y(Ae,Ce):E;return ke.width=Ae,ke.height=Ce,ke.getContext("2d").drawImage(M,0,0,Ae,Ce),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+M.width+"x"+M.height+") to ("+Ae+"x"+Ce+")."),ke}else return"data"in M&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+M.width+"x"+M.height+")."),M;return M}function S(M){return pb(M.width)&&pb(M.height)}function C(M){return a?!1:M.wrapS!==mi||M.wrapT!==mi||M.minFilter!==yn&&M.minFilter!==jn}function T(M,N){return M.generateMipmaps&&N&&M.minFilter!==yn&&M.minFilter!==jn}function O(M){t.generateMipmap(M)}function k(M,N,W,ue,X=!1){if(a===!1)return N;if(M!==null){if(t[M]!==void 0)return t[M];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+M+"'")}let ie=N;if(N===t.RED&&(W===t.FLOAT&&(ie=t.R32F),W===t.HALF_FLOAT&&(ie=t.R16F),W===t.UNSIGNED_BYTE&&(ie=t.R8)),N===t.RED_INTEGER&&(W===t.UNSIGNED_BYTE&&(ie=t.R8UI),W===t.UNSIGNED_SHORT&&(ie=t.R16UI),W===t.UNSIGNED_INT&&(ie=t.R32UI),W===t.BYTE&&(ie=t.R8I),W===t.SHORT&&(ie=t.R16I),W===t.INT&&(ie=t.R32I)),N===t.RG&&(W===t.FLOAT&&(ie=t.RG32F),W===t.HALF_FLOAT&&(ie=t.RG16F),W===t.UNSIGNED_BYTE&&(ie=t.RG8)),N===t.RGBA){const Ae=X?fu:Gt.getTransfer(ue);W===t.FLOAT&&(ie=t.RGBA32F),W===t.HALF_FLOAT&&(ie=t.RGBA16F),W===t.UNSIGNED_BYTE&&(ie=Ae===Zt?t.SRGB8_ALPHA8:t.RGBA8),W===t.UNSIGNED_SHORT_4_4_4_4&&(ie=t.RGBA4),W===t.UNSIGNED_SHORT_5_5_5_1&&(ie=t.RGB5_A1)}return(ie===t.R16F||ie===t.R32F||ie===t.RG16F||ie===t.RG32F||ie===t.RGBA16F||ie===t.RGBA32F)&&e.get("EXT_color_buffer_float"),ie}function x(M,N,W){return T(M,W)===!0||M.isFramebufferTexture&&M.minFilter!==yn&&M.minFilter!==jn?Math.log2(Math.max(N.width,N.height))+1:M.mipmaps!==void 0&&M.mipmaps.length>0?M.mipmaps.length:M.isCompressedTexture&&Array.isArray(M.image)?N.mipmaps.length:1}function I(M){return M===yn||M===lb||M===Bd?t.NEAREST:t.LINEAR}function F(M){const N=M.target;N.removeEventListener("dispose",F),ne(N),N.isVideoTexture&&m.delete(N)}function B(M){const N=M.target;N.removeEventListener("dispose",B),$(N)}function ne(M){const N=i.get(M);if(N.__webglInit===void 0)return;const W=M.source,ue=b.get(W);if(ue){const X=ue[N.__cacheKey];X.usedTimes--,X.usedTimes===0&&L(M),Object.keys(ue).length===0&&b.delete(W)}i.remove(M)}function L(M){const N=i.get(M);t.deleteTexture(N.__webglTexture);const W=M.source,ue=b.get(W);delete ue[N.__cacheKey],o.memory.textures--}function $(M){const N=M.texture,W=i.get(M),ue=i.get(N);if(ue.__webglTexture!==void 0&&(t.deleteTexture(ue.__webglTexture),o.memory.textures--),M.depthTexture&&M.depthTexture.dispose(),M.isWebGLCubeRenderTarget)for(let X=0;X<6;X++){if(Array.isArray(W.__webglFramebuffer[X]))for(let ie=0;ie=l&&console.warn("THREE.WebGLTextures: Trying to use "+M+" texture units while this GPU supports only "+l),H+=1,M}function J(M){const N=[];return N.push(M.wrapS),N.push(M.wrapT),N.push(M.wrapR||0),N.push(M.magFilter),N.push(M.minFilter),N.push(M.anisotropy),N.push(M.internalFormat),N.push(M.format),N.push(M.type),N.push(M.generateMipmaps),N.push(M.premultiplyAlpha),N.push(M.flipY),N.push(M.unpackAlignment),N.push(M.colorSpace),N.join()}function j(M,N){const W=i.get(M);if(M.isVideoTexture&&re(M),M.isRenderTargetTexture===!1&&M.version>0&&W.__version!==M.version){const ue=M.image;if(ue===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ue.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{fe(W,M,N);return}}n.bindTexture(t.TEXTURE_2D,W.__webglTexture,t.TEXTURE0+N)}function ae(M,N){const W=i.get(M);if(M.version>0&&W.__version!==M.version){fe(W,M,N);return}n.bindTexture(t.TEXTURE_2D_ARRAY,W.__webglTexture,t.TEXTURE0+N)}function ve(M,N){const W=i.get(M);if(M.version>0&&W.__version!==M.version){fe(W,M,N);return}n.bindTexture(t.TEXTURE_3D,W.__webglTexture,t.TEXTURE0+N)}function ee(M,N){const W=i.get(M);if(M.version>0&&W.__version!==M.version){Ne(W,M,N);return}n.bindTexture(t.TEXTURE_CUBE_MAP,W.__webglTexture,t.TEXTURE0+N)}const Ee={[Ca]:t.REPEAT,[mi]:t.CLAMP_TO_EDGE,[hu]:t.MIRRORED_REPEAT},xe={[yn]:t.NEAREST,[lb]:t.NEAREST_MIPMAP_NEAREST,[Bd]:t.NEAREST_MIPMAP_LINEAR,[jn]:t.LINEAR,[YO]:t.LINEAR_MIPMAP_NEAREST,[fo]:t.LINEAR_MIPMAP_LINEAR},Me={[hRt]:t.NEVER,[yRt]:t.ALWAYS,[fRt]:t.LESS,[tI]:t.LEQUAL,[mRt]:t.EQUAL,[ERt]:t.GEQUAL,[gRt]:t.GREATER,[bRt]:t.NOTEQUAL};function Z(M,N,W){if(W?(t.texParameteri(M,t.TEXTURE_WRAP_S,Ee[N.wrapS]),t.texParameteri(M,t.TEXTURE_WRAP_T,Ee[N.wrapT]),(M===t.TEXTURE_3D||M===t.TEXTURE_2D_ARRAY)&&t.texParameteri(M,t.TEXTURE_WRAP_R,Ee[N.wrapR]),t.texParameteri(M,t.TEXTURE_MAG_FILTER,xe[N.magFilter]),t.texParameteri(M,t.TEXTURE_MIN_FILTER,xe[N.minFilter])):(t.texParameteri(M,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(M,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),(M===t.TEXTURE_3D||M===t.TEXTURE_2D_ARRAY)&&t.texParameteri(M,t.TEXTURE_WRAP_R,t.CLAMP_TO_EDGE),(N.wrapS!==mi||N.wrapT!==mi)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(M,t.TEXTURE_MAG_FILTER,I(N.magFilter)),t.texParameteri(M,t.TEXTURE_MIN_FILTER,I(N.minFilter)),N.minFilter!==yn&&N.minFilter!==jn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),N.compareFunction&&(t.texParameteri(M,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(M,t.TEXTURE_COMPARE_FUNC,Me[N.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const ue=e.get("EXT_texture_filter_anisotropic");if(N.magFilter===yn||N.minFilter!==Bd&&N.minFilter!==fo||N.type===Ps&&e.has("OES_texture_float_linear")===!1||a===!1&&N.type===rc&&e.has("OES_texture_half_float_linear")===!1)return;(N.anisotropy>1||i.get(N).__currentAnisotropy)&&(t.texParameterf(M,ue.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(N.anisotropy,s.getMaxAnisotropy())),i.get(N).__currentAnisotropy=N.anisotropy)}}function ye(M,N){let W=!1;M.__webglInit===void 0&&(M.__webglInit=!0,N.addEventListener("dispose",F));const ue=N.source;let X=b.get(ue);X===void 0&&(X={},b.set(ue,X));const ie=J(N);if(ie!==M.__cacheKey){X[ie]===void 0&&(X[ie]={texture:t.createTexture(),usedTimes:0},o.memory.textures++,W=!0),X[ie].usedTimes++;const Ae=X[M.__cacheKey];Ae!==void 0&&(X[M.__cacheKey].usedTimes--,Ae.usedTimes===0&&L(N)),M.__cacheKey=ie,M.__webglTexture=X[ie].texture}return W}function fe(M,N,W){let ue=t.TEXTURE_2D;(N.isDataArrayTexture||N.isCompressedArrayTexture)&&(ue=t.TEXTURE_2D_ARRAY),N.isData3DTexture&&(ue=t.TEXTURE_3D);const X=ye(M,N),ie=N.source;n.bindTexture(ue,M.__webglTexture,t.TEXTURE0+W);const Ae=i.get(ie);if(ie.version!==Ae.__version||X===!0){n.activeTexture(t.TEXTURE0+W);const Ce=Gt.getPrimaries(Gt.workingColorSpace),ke=N.colorSpace===bi?null:Gt.getPrimaries(N.colorSpace),Qe=N.colorSpace===bi||Ce===ke?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,N.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,N.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,N.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,Qe);const ct=C(N)&&S(N.image)===!1;let Pe=v(N.image,ct,!1,d);Pe=ce(N,Pe);const ut=S(Pe)||a,Je=r.convert(N.format,N.colorSpace);let qe=r.convert(N.type),tt=k(N.internalFormat,Je,qe,N.colorSpace,N.isVideoTexture);Z(ue,N,ut);let Fe;const pt=N.mipmaps,oe=a&&N.isVideoTexture!==!0&&tt!==ZO,Ke=Ae.__version===void 0||X===!0,Ue=x(N,Pe,ut);if(N.isDepthTexture)tt=t.DEPTH_COMPONENT,a?N.type===Ps?tt=t.DEPTH_COMPONENT32F:N.type===br?tt=t.DEPTH_COMPONENT24:N.type===oo?tt=t.DEPTH24_STENCIL8:tt=t.DEPTH_COMPONENT16:N.type===Ps&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),N.format===ao&&tt===t.DEPTH_COMPONENT&&N.type!==QE&&N.type!==br&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),N.type=br,qe=r.convert(N.type)),N.format===wa&&tt===t.DEPTH_COMPONENT&&(tt=t.DEPTH_STENCIL,N.type!==oo&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),N.type=oo,qe=r.convert(N.type))),Ke&&(oe?n.texStorage2D(t.TEXTURE_2D,1,tt,Pe.width,Pe.height):n.texImage2D(t.TEXTURE_2D,0,tt,Pe.width,Pe.height,0,Je,qe,null));else if(N.isDataTexture)if(pt.length>0&&ut){oe&&Ke&&n.texStorage2D(t.TEXTURE_2D,Ue,tt,pt[0].width,pt[0].height);for(let Oe=0,Be=pt.length;Oe>=1,Be>>=1}}else if(pt.length>0&&ut){oe&&Ke&&n.texStorage2D(t.TEXTURE_2D,Ue,tt,pt[0].width,pt[0].height);for(let Oe=0,Be=pt.length;Oe0&&Ke++,n.texStorage2D(t.TEXTURE_CUBE_MAP,Ke,Fe,Pe[0].width,Pe[0].height));for(let Oe=0;Oe<6;Oe++)if(ct){pt?n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Oe,0,0,0,Pe[Oe].width,Pe[Oe].height,qe,tt,Pe[Oe].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Oe,0,Fe,Pe[Oe].width,Pe[Oe].height,0,qe,tt,Pe[Oe].data);for(let Be=0;Be>ie),Pe=Math.max(1,N.height>>ie);X===t.TEXTURE_3D||X===t.TEXTURE_2D_ARRAY?n.texImage3D(X,ie,ke,ct,Pe,N.depth,0,Ae,Ce,null):n.texImage2D(X,ie,ke,ct,Pe,0,Ae,Ce,null)}n.bindFramebuffer(t.FRAMEBUFFER,M),pe(N)?f.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,ue,X,i.get(W).__webglTexture,0,z(N)):(X===t.TEXTURE_2D||X>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&X<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,ue,X,i.get(W).__webglTexture,ie),n.bindFramebuffer(t.FRAMEBUFFER,null)}function D(M,N,W){if(t.bindRenderbuffer(t.RENDERBUFFER,M),N.depthBuffer&&!N.stencilBuffer){let ue=a===!0?t.DEPTH_COMPONENT24:t.DEPTH_COMPONENT16;if(W||pe(N)){const X=N.depthTexture;X&&X.isDepthTexture&&(X.type===Ps?ue=t.DEPTH_COMPONENT32F:X.type===br&&(ue=t.DEPTH_COMPONENT24));const ie=z(N);pe(N)?f.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,ie,ue,N.width,N.height):t.renderbufferStorageMultisample(t.RENDERBUFFER,ie,ue,N.width,N.height)}else t.renderbufferStorage(t.RENDERBUFFER,ue,N.width,N.height);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,M)}else if(N.depthBuffer&&N.stencilBuffer){const ue=z(N);W&&pe(N)===!1?t.renderbufferStorageMultisample(t.RENDERBUFFER,ue,t.DEPTH24_STENCIL8,N.width,N.height):pe(N)?f.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,ue,t.DEPTH24_STENCIL8,N.width,N.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,N.width,N.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,M)}else{const ue=N.isWebGLMultipleRenderTargets===!0?N.texture:[N.texture];for(let X=0;X0){W.__webglFramebuffer[Ce]=[];for(let ke=0;ke0){W.__webglFramebuffer=[];for(let Ce=0;Ce0&&pe(M)===!1){const Ce=ie?N:[N];W.__webglMultisampledFramebuffer=t.createFramebuffer(),W.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,W.__webglMultisampledFramebuffer);for(let ke=0;ke0)for(let ke=0;ke0)for(let ke=0;ke0&&pe(M)===!1){const N=M.isWebGLMultipleRenderTargets?M.texture:[M.texture],W=M.width,ue=M.height;let X=t.COLOR_BUFFER_BIT;const ie=[],Ae=M.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Ce=i.get(M),ke=M.isWebGLMultipleRenderTargets===!0;if(ke)for(let Qe=0;Qe0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&N.__useRenderToTexture!==!1}function re(M){const N=o.render.frame;m.get(M)!==N&&(m.set(M,N),M.update())}function ce(M,N){const W=M.colorSpace,ue=M.format,X=M.type;return M.isCompressedTexture===!0||M.isVideoTexture===!0||M.format===ub||W!==On&&W!==bi&&(Gt.getTransfer(W)===Zt?a===!1?e.has("EXT_sRGB")===!0&&ue===gi?(M.format=ub,M.minFilter=jn,M.generateMipmaps=!1):N=iI.sRGBToLinear(N):(ue!==gi||X!==xr)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",W)),N}this.allocateTextureUnit=Q,this.resetTextureUnits=U,this.setTexture2D=j,this.setTexture2DArray=ae,this.setTexture3D=ve,this.setTextureCube=ee,this.rebindTextures=de,this.setupRenderTarget=le,this.updateRenderTargetMipmap=Re,this.updateMultisampleRenderTarget=Ie,this.setupDepthRenderbuffer=K,this.setupFrameBufferTexture=Le,this.useMultisampledRTT=pe}function kMt(t,e,n){const i=n.isWebGL2;function s(r,o=bi){let a;const l=Gt.getTransfer(o);if(r===xr)return t.UNSIGNED_BYTE;if(r===WO)return t.UNSIGNED_SHORT_4_4_4_4;if(r===KO)return t.UNSIGNED_SHORT_5_5_5_1;if(r===tRt)return t.BYTE;if(r===nRt)return t.SHORT;if(r===QE)return t.UNSIGNED_SHORT;if(r===$O)return t.INT;if(r===br)return t.UNSIGNED_INT;if(r===Ps)return t.FLOAT;if(r===rc)return i?t.HALF_FLOAT:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(r===iRt)return t.ALPHA;if(r===gi)return t.RGBA;if(r===sRt)return t.LUMINANCE;if(r===rRt)return t.LUMINANCE_ALPHA;if(r===ao)return t.DEPTH_COMPONENT;if(r===wa)return t.DEPTH_STENCIL;if(r===ub)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(r===oRt)return t.RED;if(r===jO)return t.RED_INTEGER;if(r===aRt)return t.RG;if(r===QO)return t.RG_INTEGER;if(r===XO)return t.RGBA_INTEGER;if(r===Pm||r===Um||r===Fm||r===Bm)if(l===Zt)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(r===Pm)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===Um)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===Fm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===Bm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(r===Pm)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===Um)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===Fm)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===Bm)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(r===jC||r===QC||r===XC||r===ZC)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(r===jC)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===QC)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===XC)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===ZC)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(r===ZO)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(r===JC||r===e1)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(r===JC)return l===Zt?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(r===e1)return l===Zt?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(r===t1||r===n1||r===i1||r===s1||r===r1||r===o1||r===a1||r===l1||r===c1||r===d1||r===u1||r===p1||r===_1||r===h1)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(r===t1)return l===Zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===n1)return l===Zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===i1)return l===Zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===s1)return l===Zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===r1)return l===Zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===o1)return l===Zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===a1)return l===Zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===l1)return l===Zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===c1)return l===Zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===d1)return l===Zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===u1)return l===Zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===p1)return l===Zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===_1)return l===Zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===h1)return l===Zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(r===Gm||r===f1||r===m1)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(r===Gm)return l===Zt?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(r===f1)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(r===m1)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(r===lRt||r===g1||r===b1||r===E1)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(r===Gm)return a.COMPRESSED_RED_RGTC1_EXT;if(r===g1)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(r===b1)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(r===E1)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return r===oo?i?t.UNSIGNED_INT_24_8:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):t[r]!==void 0?t[r]:null}return{convert:s}}class LMt extends zn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class to extends rn{constructor(){super(),this.isGroup=!0,this.type="Group"}}const PMt={type:"move"};class dg{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new to,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 to,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new _e,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new _e),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new to,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new _e,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new _e),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 n=this._hand;if(n)for(const i of e.hand.values())this._getHandJoint(n,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,n,i){let s=null,r=null,o=null;const a=this._targetRay,l=this._grip,u=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(u&&e.hand){o=!0;for(const E of e.hand.values()){const b=n.getJointPose(E,i),g=this._getHandJoint(u,E);b!==null&&(g.matrix.fromArray(b.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,g.jointRadius=b.radius),g.visible=b!==null}const d=u.joints["index-finger-tip"],h=u.joints["thumb-tip"],f=d.position.distanceTo(h.position),_=.02,m=.005;u.inputState.pinching&&f>_+m?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&f<=_-m&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(r=n.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=n.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(PMt)))}return a!==null&&(a.visible=s!==null),l!==null&&(l.visible=r!==null),u!==null&&(u.visible=o!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const i=new to;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[n.jointName]=i,e.add(i)}return e.joints[n.jointName]}}class UMt extends Ka{constructor(e,n){super();const i=this;let s=null,r=1,o=null,a="local-floor",l=1,u=null,d=null,h=null,f=null,_=null,m=null;const E=n.getContextAttributes();let b=null,g=null;const y=[],v=[],S=new It;let C=null;const T=new zn;T.layers.enable(1),T.viewport=new Wt;const O=new zn;O.layers.enable(2),O.viewport=new Wt;const k=[T,O],x=new LMt;x.layers.enable(1),x.layers.enable(2);let I=null,F=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ee){let Ee=y[ee];return Ee===void 0&&(Ee=new dg,y[ee]=Ee),Ee.getTargetRaySpace()},this.getControllerGrip=function(ee){let Ee=y[ee];return Ee===void 0&&(Ee=new dg,y[ee]=Ee),Ee.getGripSpace()},this.getHand=function(ee){let Ee=y[ee];return Ee===void 0&&(Ee=new dg,y[ee]=Ee),Ee.getHandSpace()};function B(ee){const Ee=v.indexOf(ee.inputSource);if(Ee===-1)return;const xe=y[Ee];xe!==void 0&&(xe.update(ee.inputSource,ee.frame,u||o),xe.dispatchEvent({type:ee.type,data:ee.inputSource}))}function ne(){s.removeEventListener("select",B),s.removeEventListener("selectstart",B),s.removeEventListener("selectend",B),s.removeEventListener("squeeze",B),s.removeEventListener("squeezestart",B),s.removeEventListener("squeezeend",B),s.removeEventListener("end",ne),s.removeEventListener("inputsourceschange",L);for(let ee=0;ee=0&&(v[Me]=null,y[Me].disconnect(xe))}for(let Ee=0;Ee=v.length){v.push(xe),Me=ye;break}else if(v[ye]===null){v[ye]=xe,Me=ye;break}if(Me===-1)break}const Z=y[Me];Z&&Z.connect(xe)}}const $=new _e,H=new _e;function U(ee,Ee,xe){$.setFromMatrixPosition(Ee.matrixWorld),H.setFromMatrixPosition(xe.matrixWorld);const Me=$.distanceTo(H),Z=Ee.projectionMatrix.elements,ye=xe.projectionMatrix.elements,fe=Z[14]/(Z[10]-1),Ne=Z[14]/(Z[10]+1),Le=(Z[9]+1)/Z[5],D=(Z[9]-1)/Z[5],q=(Z[8]-1)/Z[0],K=(ye[8]+1)/ye[0],de=fe*q,le=fe*K,Re=Me/(-q+K),Ie=Re*-q;Ee.matrixWorld.decompose(ee.position,ee.quaternion,ee.scale),ee.translateX(Ie),ee.translateZ(Re),ee.matrixWorld.compose(ee.position,ee.quaternion,ee.scale),ee.matrixWorldInverse.copy(ee.matrixWorld).invert();const z=fe+Re,pe=Ne+Re,re=de-Ie,ce=le+(Me-Ie),M=Le*Ne/pe*z,N=D*Ne/pe*z;ee.projectionMatrix.makePerspective(re,ce,M,N,z,pe),ee.projectionMatrixInverse.copy(ee.projectionMatrix).invert()}function Q(ee,Ee){Ee===null?ee.matrixWorld.copy(ee.matrix):ee.matrixWorld.multiplyMatrices(Ee.matrixWorld,ee.matrix),ee.matrixWorldInverse.copy(ee.matrixWorld).invert()}this.updateCamera=function(ee){if(s===null)return;x.near=O.near=T.near=ee.near,x.far=O.far=T.far=ee.far,(I!==x.near||F!==x.far)&&(s.updateRenderState({depthNear:x.near,depthFar:x.far}),I=x.near,F=x.far);const Ee=ee.parent,xe=x.cameras;Q(x,Ee);for(let Me=0;Me0&&(b.alphaTest.value=g.alphaTest);const y=e.get(g).envMap;if(y&&(b.envMap.value=y,b.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,b.reflectivity.value=g.reflectivity,b.ior.value=g.ior,b.refractionRatio.value=g.refractionRatio),g.lightMap){b.lightMap.value=g.lightMap;const v=t._useLegacyLights===!0?Math.PI:1;b.lightMapIntensity.value=g.lightMapIntensity*v,n(g.lightMap,b.lightMapTransform)}g.aoMap&&(b.aoMap.value=g.aoMap,b.aoMapIntensity.value=g.aoMapIntensity,n(g.aoMap,b.aoMapTransform))}function o(b,g){b.diffuse.value.copy(g.color),b.opacity.value=g.opacity,g.map&&(b.map.value=g.map,n(g.map,b.mapTransform))}function a(b,g){b.dashSize.value=g.dashSize,b.totalSize.value=g.dashSize+g.gapSize,b.scale.value=g.scale}function l(b,g,y,v){b.diffuse.value.copy(g.color),b.opacity.value=g.opacity,b.size.value=g.size*y,b.scale.value=v*.5,g.map&&(b.map.value=g.map,n(g.map,b.uvTransform)),g.alphaMap&&(b.alphaMap.value=g.alphaMap,n(g.alphaMap,b.alphaMapTransform)),g.alphaTest>0&&(b.alphaTest.value=g.alphaTest)}function u(b,g){b.diffuse.value.copy(g.color),b.opacity.value=g.opacity,b.rotation.value=g.rotation,g.map&&(b.map.value=g.map,n(g.map,b.mapTransform)),g.alphaMap&&(b.alphaMap.value=g.alphaMap,n(g.alphaMap,b.alphaMapTransform)),g.alphaTest>0&&(b.alphaTest.value=g.alphaTest)}function d(b,g){b.specular.value.copy(g.specular),b.shininess.value=Math.max(g.shininess,1e-4)}function h(b,g){g.gradientMap&&(b.gradientMap.value=g.gradientMap)}function f(b,g){b.metalness.value=g.metalness,g.metalnessMap&&(b.metalnessMap.value=g.metalnessMap,n(g.metalnessMap,b.metalnessMapTransform)),b.roughness.value=g.roughness,g.roughnessMap&&(b.roughnessMap.value=g.roughnessMap,n(g.roughnessMap,b.roughnessMapTransform)),e.get(g).envMap&&(b.envMapIntensity.value=g.envMapIntensity)}function _(b,g,y){b.ior.value=g.ior,g.sheen>0&&(b.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),b.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(b.sheenColorMap.value=g.sheenColorMap,n(g.sheenColorMap,b.sheenColorMapTransform)),g.sheenRoughnessMap&&(b.sheenRoughnessMap.value=g.sheenRoughnessMap,n(g.sheenRoughnessMap,b.sheenRoughnessMapTransform))),g.clearcoat>0&&(b.clearcoat.value=g.clearcoat,b.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(b.clearcoatMap.value=g.clearcoatMap,n(g.clearcoatMap,b.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(b.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,n(g.clearcoatRoughnessMap,b.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(b.clearcoatNormalMap.value=g.clearcoatNormalMap,n(g.clearcoatNormalMap,b.clearcoatNormalMapTransform),b.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===Zn&&b.clearcoatNormalScale.value.negate())),g.iridescence>0&&(b.iridescence.value=g.iridescence,b.iridescenceIOR.value=g.iridescenceIOR,b.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],b.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(b.iridescenceMap.value=g.iridescenceMap,n(g.iridescenceMap,b.iridescenceMapTransform)),g.iridescenceThicknessMap&&(b.iridescenceThicknessMap.value=g.iridescenceThicknessMap,n(g.iridescenceThicknessMap,b.iridescenceThicknessMapTransform))),g.transmission>0&&(b.transmission.value=g.transmission,b.transmissionSamplerMap.value=y.texture,b.transmissionSamplerSize.value.set(y.width,y.height),g.transmissionMap&&(b.transmissionMap.value=g.transmissionMap,n(g.transmissionMap,b.transmissionMapTransform)),b.thickness.value=g.thickness,g.thicknessMap&&(b.thicknessMap.value=g.thicknessMap,n(g.thicknessMap,b.thicknessMapTransform)),b.attenuationDistance.value=g.attenuationDistance,b.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(b.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(b.anisotropyMap.value=g.anisotropyMap,n(g.anisotropyMap,b.anisotropyMapTransform))),b.specularIntensity.value=g.specularIntensity,b.specularColor.value.copy(g.specularColor),g.specularColorMap&&(b.specularColorMap.value=g.specularColorMap,n(g.specularColorMap,b.specularColorMapTransform)),g.specularIntensityMap&&(b.specularIntensityMap.value=g.specularIntensityMap,n(g.specularIntensityMap,b.specularIntensityMapTransform))}function m(b,g){g.matcap&&(b.matcap.value=g.matcap)}function E(b,g){const y=e.get(g).light;b.referencePosition.value.setFromMatrixPosition(y.matrixWorld),b.nearDistance.value=y.shadow.camera.near,b.farDistance.value=y.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:s}}function BMt(t,e,n,i){let s={},r={},o=[];const a=n.isWebGL2?t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(y,v){const S=v.program;i.uniformBlockBinding(y,S)}function u(y,v){let S=s[y.id];S===void 0&&(m(y),S=d(y),s[y.id]=S,y.addEventListener("dispose",b));const C=v.program;i.updateUBOMapping(y,C);const T=e.render.frame;r[y.id]!==T&&(f(y),r[y.id]=T)}function d(y){const v=h();y.__bindingPointIndex=v;const S=t.createBuffer(),C=y.__size,T=y.usage;return t.bindBuffer(t.UNIFORM_BUFFER,S),t.bufferData(t.UNIFORM_BUFFER,C,T),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,v,S),S}function h(){for(let y=0;y0){T=S%C;const B=C-T;T!==0&&B-I.boundary<0&&(S+=C-T,x.__offset=S)}S+=I.storage}return T=S%C,T>0&&(S+=C-T),y.__size=S,y.__cache={},this}function E(y){const v={boundary:0,storage:0};return typeof y=="number"?(v.boundary=4,v.storage=4):y.isVector2?(v.boundary=8,v.storage=8):y.isVector3||y.isColor?(v.boundary=16,v.storage=12):y.isVector4?(v.boundary=16,v.storage=16):y.isMatrix3?(v.boundary=48,v.storage=48):y.isMatrix4?(v.boundary=64,v.storage=64):y.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",y),v}function b(y){const v=y.target;v.removeEventListener("dispose",b);const S=o.indexOf(v.__bindingPointIndex);o.splice(S,1),t.deleteBuffer(s[v.id]),delete s[v.id],delete r[v.id]}function g(){for(const y in s)t.deleteBuffer(s[y]);o=[],s={},r={}}return{bind:l,update:u,dispose:g}}class yI{constructor(e={}){const{canvas:n=PRt(),context:i=null,depth:s=!0,stencil:r=!0,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:u=!1,powerPreference:d="default",failIfMajorPerformanceCaveat:h=!1}=e;this.isWebGLRenderer=!0;let f;i!==null?f=i.getContextAttributes().alpha:f=o;const _=new Uint32Array(4),m=new Int32Array(4);let E=null,b=null;const g=[],y=[];this.domElement=n,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=on,this._useLegacyLights=!1,this.toneMapping=Tr,this.toneMappingExposure=1;const v=this;let S=!1,C=0,T=0,O=null,k=-1,x=null;const I=new Wt,F=new Wt;let B=null;const ne=new gt(0);let L=0,$=n.width,H=n.height,U=1,Q=null,J=null;const j=new Wt(0,0,$,H),ae=new Wt(0,0,$,H);let ve=!1;const ee=new ey;let Ee=!1,xe=!1,Me=null;const Z=new Rt,ye=new It,fe=new _e,Ne={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Le(){return O===null?U:1}let D=i;function q(R,Y){for(let te=0;te{function Ve(){if(ge.forEach(function(Xe){Ie.get(Xe).currentProgram.isReady()&&ge.delete(Xe)}),ge.size===0){me(R);return}setTimeout(Ve,10)}K.get("KHR_parallel_shader_compile")!==null?Ve():setTimeout(Ve,10)})};let Et=null;function Qt(R){Et&&Et(R)}function cn(){$t.stop()}function Ct(){$t.start()}const $t=new _I;$t.setAnimationLoop(Qt),typeof self<"u"&&$t.setContext(self),this.setAnimationLoop=function(R){Et=R,Fe.setAnimationLoop(R),R===null?$t.stop():$t.start()},Fe.addEventListener("sessionstart",cn),Fe.addEventListener("sessionend",Ct),this.render=function(R,Y){if(Y!==void 0&&Y.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(S===!0)return;R.matrixWorldAutoUpdate===!0&&R.updateMatrixWorld(),Y.parent===null&&Y.matrixWorldAutoUpdate===!0&&Y.updateMatrixWorld(),Fe.enabled===!0&&Fe.isPresenting===!0&&(Fe.cameraAutoUpdate===!0&&Fe.updateCamera(Y),Y=Fe.getCamera()),R.isScene===!0&&R.onBeforeRender(v,R,Y,O),b=ie.get(R,y.length),b.init(),y.push(b),Z.multiplyMatrices(Y.projectionMatrix,Y.matrixWorldInverse),ee.setFromProjectionMatrix(Z),xe=this.localClippingEnabled,Ee=Ae.init(this.clippingPlanes,xe),E=X.get(R,g.length),E.init(),g.push(E),Sn(R,Y,0,v.sortObjects),E.finish(),v.sortObjects===!0&&E.sort(Q,J),this.info.render.frame++,Ee===!0&&Ae.beginShadows();const te=b.state.shadowsArray;if(Ce.render(te,R,Y),Ee===!0&&Ae.endShadows(),this.info.autoReset===!0&&this.info.reset(),ke.render(E,R),b.setupLights(v._useLegacyLights),Y.isArrayCamera){const ge=Y.cameras;for(let me=0,Ve=ge.length;me0?b=y[y.length-1]:b=null,g.pop(),g.length>0?E=g[g.length-1]:E=null};function Sn(R,Y,te,ge){if(R.visible===!1)return;if(R.layers.test(Y.layers)){if(R.isGroup)te=R.renderOrder;else if(R.isLOD)R.autoUpdate===!0&&R.update(Y);else if(R.isLight)b.pushLight(R),R.castShadow&&b.pushShadow(R);else if(R.isSprite){if(!R.frustumCulled||ee.intersectsSprite(R)){ge&&fe.setFromMatrixPosition(R.matrixWorld).applyMatrix4(Z);const Xe=N.update(R),it=R.material;it.visible&&E.push(R,Xe,it,te,fe.z,null)}}else if((R.isMesh||R.isLine||R.isPoints)&&(!R.frustumCulled||ee.intersectsObject(R))){const Xe=N.update(R),it=R.material;if(ge&&(R.boundingSphere!==void 0?(R.boundingSphere===null&&R.computeBoundingSphere(),fe.copy(R.boundingSphere.center)):(Xe.boundingSphere===null&&Xe.computeBoundingSphere(),fe.copy(Xe.boundingSphere.center)),fe.applyMatrix4(R.matrixWorld).applyMatrix4(Z)),Array.isArray(it)){const at=Xe.groups;for(let rt=0,_t=at.length;rt<_t;rt++){const ht=at[rt],Kt=it[ht.materialIndex];Kt&&Kt.visible&&E.push(R,Xe,Kt,te,fe.z,ht)}}else it.visible&&E.push(R,Xe,it,te,fe.z,null)}}const Ve=R.children;for(let Xe=0,it=Ve.length;Xe0&&Mr(me,Ve,Y,te),ge&&le.viewport(I.copy(ge)),me.length>0&&ci(me,Y,te),Ve.length>0&&ci(Ve,Y,te),Xe.length>0&&ci(Xe,Y,te),le.buffers.depth.setTest(!0),le.buffers.depth.setMask(!0),le.buffers.color.setMask(!0),le.setPolygonOffset(!1)}function Mr(R,Y,te,ge){if((te.isScene===!0?te.overrideMaterial:null)!==null)return;const Ve=de.isWebGL2;Me===null&&(Me=new mo(1,1,{generateMipmaps:!0,type:K.has("EXT_color_buffer_half_float")?rc:xr,minFilter:fo,samples:Ve?4:0})),v.getDrawingBufferSize(ye),Ve?Me.setSize(ye.x,ye.y):Me.setSize(Eu(ye.x),Eu(ye.y));const Xe=v.getRenderTarget();v.setRenderTarget(Me),v.getClearColor(ne),L=v.getClearAlpha(),L<1&&v.setClearColor(16777215,.5),v.clear();const it=v.toneMapping;v.toneMapping=Tr,ci(R,te,ge),z.updateMultisampleRenderTarget(Me),z.updateRenderTargetMipmap(Me);let at=!1;for(let rt=0,_t=Y.length;rt<_t;rt++){const ht=Y[rt],Kt=ht.object,xn=ht.geometry,sn=ht.material,In=ht.group;if(sn.side===es&&Kt.layers.test(ge.layers)){const Xt=sn.side;sn.side=Zn,sn.needsUpdate=!0,Tn(Kt,te,ge,xn,sn,In),sn.side=Xt,sn.needsUpdate=!0,at=!0}}at===!0&&(z.updateMultisampleRenderTarget(Me),z.updateRenderTargetMipmap(Me)),v.setRenderTarget(Xe),v.setClearColor(ne,L),v.toneMapping=it}function ci(R,Y,te){const ge=Y.isScene===!0?Y.overrideMaterial:null;for(let me=0,Ve=R.length;me0),ht=!!te.morphAttributes.position,Kt=!!te.morphAttributes.normal,xn=!!te.morphAttributes.color;let sn=Tr;ge.toneMapped&&(O===null||O.isXRRenderTarget===!0)&&(sn=v.toneMapping);const In=te.morphAttributes.position||te.morphAttributes.normal||te.morphAttributes.color,Xt=In!==void 0?In.length:0,St=Ie.get(ge),el=b.state.lights;if(Ee===!0&&(xe===!0||R!==x)){const Wn=R===x&&ge.id===k;Ae.setState(ge,R,Wn)}let tn=!1;ge.version===St.__version?(St.needsLights&&St.lightsStateVersion!==el.state.version||St.outputColorSpace!==it||me.isBatchedMesh&&St.batching===!1||!me.isBatchedMesh&&St.batching===!0||me.isInstancedMesh&&St.instancing===!1||!me.isInstancedMesh&&St.instancing===!0||me.isSkinnedMesh&&St.skinning===!1||!me.isSkinnedMesh&&St.skinning===!0||me.isInstancedMesh&&St.instancingColor===!0&&me.instanceColor===null||me.isInstancedMesh&&St.instancingColor===!1&&me.instanceColor!==null||St.envMap!==at||ge.fog===!0&&St.fog!==Ve||St.numClippingPlanes!==void 0&&(St.numClippingPlanes!==Ae.numPlanes||St.numIntersection!==Ae.numIntersection)||St.vertexAlphas!==rt||St.vertexTangents!==_t||St.morphTargets!==ht||St.morphNormals!==Kt||St.morphColors!==xn||St.toneMapping!==sn||de.isWebGL2===!0&&St.morphTargetsCount!==Xt)&&(tn=!0):(tn=!0,St.__version=ge.version);let Ss=St.currentProgram;tn===!0&&(Ss=di(ge,Y,me));let xc=!1,Dr=!1,tl=!1;const bn=Ss.getUniforms(),Ts=St.uniforms;if(le.useProgram(Ss.program)&&(xc=!0,Dr=!0,tl=!0),ge.id!==k&&(k=ge.id,Dr=!0),xc||x!==R){bn.setValue(D,"projectionMatrix",R.projectionMatrix),bn.setValue(D,"viewMatrix",R.matrixWorldInverse);const Wn=bn.map.cameraPosition;Wn!==void 0&&Wn.setValue(D,fe.setFromMatrixPosition(R.matrixWorld)),de.logarithmicDepthBuffer&&bn.setValue(D,"logDepthBufFC",2/(Math.log(R.far+1)/Math.LN2)),(ge.isMeshPhongMaterial||ge.isMeshToonMaterial||ge.isMeshLambertMaterial||ge.isMeshBasicMaterial||ge.isMeshStandardMaterial||ge.isShaderMaterial)&&bn.setValue(D,"isOrthographic",R.isOrthographicCamera===!0),x!==R&&(x=R,Dr=!0,tl=!0)}if(me.isSkinnedMesh){bn.setOptional(D,me,"bindMatrix"),bn.setOptional(D,me,"bindMatrixInverse");const Wn=me.skeleton;Wn&&(de.floatVertexTextures?(Wn.boneTexture===null&&Wn.computeBoneTexture(),bn.setValue(D,"boneTexture",Wn.boneTexture,z)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}me.isBatchedMesh&&(bn.setOptional(D,me,"batchingTexture"),bn.setValue(D,"batchingTexture",me._matricesTexture,z));const nl=te.morphAttributes;if((nl.position!==void 0||nl.normal!==void 0||nl.color!==void 0&&de.isWebGL2===!0)&&Qe.update(me,te,Ss),(Dr||St.receiveShadow!==me.receiveShadow)&&(St.receiveShadow=me.receiveShadow,bn.setValue(D,"receiveShadow",me.receiveShadow)),ge.isMeshGouraudMaterial&&ge.envMap!==null&&(Ts.envMap.value=at,Ts.flipEnvMap.value=at.isCubeTexture&&at.isRenderTargetTexture===!1?-1:1),Dr&&(bn.setValue(D,"toneMappingExposure",v.toneMappingExposure),St.needsLights&&vs(Ts,tl),Ve&&ge.fog===!0&&ue.refreshFogUniforms(Ts,Ve),ue.refreshMaterialUniforms(Ts,ge,U,H,Me),Gd.upload(D,ji(St),Ts,z)),ge.isShaderMaterial&&ge.uniformsNeedUpdate===!0&&(Gd.upload(D,ji(St),Ts,z),ge.uniformsNeedUpdate=!1),ge.isSpriteMaterial&&bn.setValue(D,"center",me.center),bn.setValue(D,"modelViewMatrix",me.modelViewMatrix),bn.setValue(D,"normalMatrix",me.normalMatrix),bn.setValue(D,"modelMatrix",me.matrixWorld),ge.isShaderMaterial||ge.isRawShaderMaterial){const Wn=ge.uniformsGroups;for(let il=0,mp=Wn.length;il0&&z.useMultisampledRTT(R)===!1?me=Ie.get(R).__webglMultisampledFramebuffer:Array.isArray(_t)?me=_t[te]:me=_t,I.copy(R.viewport),F.copy(R.scissor),B=R.scissorTest}else I.copy(j).multiplyScalar(U).floor(),F.copy(ae).multiplyScalar(U).floor(),B=ve;if(le.bindFramebuffer(D.FRAMEBUFFER,me)&&de.drawBuffers&&ge&&le.drawBuffers(R,me),le.viewport(I),le.scissor(F),le.setScissorTest(B),Ve){const at=Ie.get(R.texture);D.framebufferTexture2D(D.FRAMEBUFFER,D.COLOR_ATTACHMENT0,D.TEXTURE_CUBE_MAP_POSITIVE_X+Y,at.__webglTexture,te)}else if(Xe){const at=Ie.get(R.texture),rt=Y||0;D.framebufferTextureLayer(D.FRAMEBUFFER,D.COLOR_ATTACHMENT0,at.__webglTexture,te||0,rt)}k=-1},this.readRenderTargetPixels=function(R,Y,te,ge,me,Ve,Xe){if(!(R&&R.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let it=Ie.get(R).__webglFramebuffer;if(R.isWebGLCubeRenderTarget&&Xe!==void 0&&(it=it[Xe]),it){le.bindFramebuffer(D.FRAMEBUFFER,it);try{const at=R.texture,rt=at.format,_t=at.type;if(rt!==gi&&ut.convert(rt)!==D.getParameter(D.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const ht=_t===rc&&(K.has("EXT_color_buffer_half_float")||de.isWebGL2&&K.has("EXT_color_buffer_float"));if(_t!==xr&&ut.convert(_t)!==D.getParameter(D.IMPLEMENTATION_COLOR_READ_TYPE)&&!(_t===Ps&&(de.isWebGL2||K.has("OES_texture_float")||K.has("WEBGL_color_buffer_float")))&&!ht){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Y>=0&&Y<=R.width-ge&&te>=0&&te<=R.height-me&&D.readPixels(Y,te,ge,me,ut.convert(rt),ut.convert(_t),Ve)}finally{const at=O!==null?Ie.get(O).__webglFramebuffer:null;le.bindFramebuffer(D.FRAMEBUFFER,at)}}},this.copyFramebufferToTexture=function(R,Y,te=0){const ge=Math.pow(2,-te),me=Math.floor(Y.image.width*ge),Ve=Math.floor(Y.image.height*ge);z.setTexture2D(Y,0),D.copyTexSubImage2D(D.TEXTURE_2D,te,0,0,R.x,R.y,me,Ve),le.unbindTexture()},this.copyTextureToTexture=function(R,Y,te,ge=0){const me=Y.image.width,Ve=Y.image.height,Xe=ut.convert(te.format),it=ut.convert(te.type);z.setTexture2D(te,0),D.pixelStorei(D.UNPACK_FLIP_Y_WEBGL,te.flipY),D.pixelStorei(D.UNPACK_PREMULTIPLY_ALPHA_WEBGL,te.premultiplyAlpha),D.pixelStorei(D.UNPACK_ALIGNMENT,te.unpackAlignment),Y.isDataTexture?D.texSubImage2D(D.TEXTURE_2D,ge,R.x,R.y,me,Ve,Xe,it,Y.image.data):Y.isCompressedTexture?D.compressedTexSubImage2D(D.TEXTURE_2D,ge,R.x,R.y,Y.mipmaps[0].width,Y.mipmaps[0].height,Xe,Y.mipmaps[0].data):D.texSubImage2D(D.TEXTURE_2D,ge,R.x,R.y,Xe,it,Y.image),ge===0&&te.generateMipmaps&&D.generateMipmap(D.TEXTURE_2D),le.unbindTexture()},this.copyTextureToTexture3D=function(R,Y,te,ge,me=0){if(v.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Ve=R.max.x-R.min.x+1,Xe=R.max.y-R.min.y+1,it=R.max.z-R.min.z+1,at=ut.convert(ge.format),rt=ut.convert(ge.type);let _t;if(ge.isData3DTexture)z.setTexture3D(ge,0),_t=D.TEXTURE_3D;else if(ge.isDataArrayTexture)z.setTexture2DArray(ge,0),_t=D.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}D.pixelStorei(D.UNPACK_FLIP_Y_WEBGL,ge.flipY),D.pixelStorei(D.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ge.premultiplyAlpha),D.pixelStorei(D.UNPACK_ALIGNMENT,ge.unpackAlignment);const ht=D.getParameter(D.UNPACK_ROW_LENGTH),Kt=D.getParameter(D.UNPACK_IMAGE_HEIGHT),xn=D.getParameter(D.UNPACK_SKIP_PIXELS),sn=D.getParameter(D.UNPACK_SKIP_ROWS),In=D.getParameter(D.UNPACK_SKIP_IMAGES),Xt=te.isCompressedTexture?te.mipmaps[0]:te.image;D.pixelStorei(D.UNPACK_ROW_LENGTH,Xt.width),D.pixelStorei(D.UNPACK_IMAGE_HEIGHT,Xt.height),D.pixelStorei(D.UNPACK_SKIP_PIXELS,R.min.x),D.pixelStorei(D.UNPACK_SKIP_ROWS,R.min.y),D.pixelStorei(D.UNPACK_SKIP_IMAGES,R.min.z),te.isDataTexture||te.isData3DTexture?D.texSubImage3D(_t,me,Y.x,Y.y,Y.z,Ve,Xe,it,at,rt,Xt.data):te.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),D.compressedTexSubImage3D(_t,me,Y.x,Y.y,Y.z,Ve,Xe,it,at,Xt.data)):D.texSubImage3D(_t,me,Y.x,Y.y,Y.z,Ve,Xe,it,at,rt,Xt),D.pixelStorei(D.UNPACK_ROW_LENGTH,ht),D.pixelStorei(D.UNPACK_IMAGE_HEIGHT,Kt),D.pixelStorei(D.UNPACK_SKIP_PIXELS,xn),D.pixelStorei(D.UNPACK_SKIP_ROWS,sn),D.pixelStorei(D.UNPACK_SKIP_IMAGES,In),me===0&&ge.generateMipmaps&&D.generateMipmap(_t),le.unbindTexture()},this.initTexture=function(R){R.isCubeTexture?z.setTextureCube(R,0):R.isData3DTexture?z.setTexture3D(R,0):R.isDataArrayTexture||R.isCompressedArrayTexture?z.setTexture2DArray(R,0):z.setTexture2D(R,0),le.unbindTexture()},this.resetState=function(){C=0,T=0,O=null,le.reset(),Je.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Us}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const n=this.getContext();n.drawingBufferColorSpace=e===ZE?"display-p3":"srgb",n.unpackColorSpace=Gt.workingColorSpace===cp?"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===on?lo:eI}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===lo?on:On}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 GMt extends yI{}GMt.prototype.isWebGL1Renderer=!0;class VMt extends rn{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,n){return super.copy(e,n),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 n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n}}class zMt{constructor(e,n){this.isInterleavedBuffer=!0,this.array=e,this.stride=n,this.count=e!==void 0?e.length/n:0,this.usage=db,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=zi()}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,n){this.updateRanges.push({start:e,count:n})}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,n,i){e*=this.stride,i*=n.stride;for(let s=0,r=this.stride;sl)continue;f.applyMatrix4(this.matrixWorld);const k=e.ray.origin.distanceTo(f);ke.far||n.push({distance:k,point:h.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}else{const g=Math.max(0,o.start),y=Math.min(b.count,o.start+o.count);for(let v=g,S=y-1;vl)continue;f.applyMatrix4(this.matrixWorld);const T=e.ray.origin.distanceTo(f);Te.far||n.push({distance:T,point:h.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const n=this.geometry.morphAttributes,i=Object.keys(n);if(i.length>0){const s=n[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;r0){const s=n[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;rs.far)return;r.push({distance:u,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}class ay extends Hi{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new gt(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 gt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=XE,this.normalScale=new It(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 Qs extends ay{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 It(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Ln(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(n){this.ior=(1+.4*n)/(1-.4*n)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new gt(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 gt(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new gt(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 Cw extends Hi{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new gt(16777215),this.specular=new gt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new gt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=XE,this.normalScale=new It(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=jE,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 Td(t,e,n){return!t||!n&&t.constructor===e?t:typeof e.BYTES_PER_ELEMENT=="number"?new e(t):Array.prototype.slice.call(t)}function ZMt(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function JMt(t){function e(s,r){return t[s]-t[r]}const n=t.length,i=new Array(n);for(let s=0;s!==n;++s)i[s]=s;return i.sort(e),i}function ww(t,e,n){const i=t.length,s=new t.constructor(i);for(let r=0,o=0;o!==i;++r){const a=n[r]*e;for(let l=0;l!==e;++l)s[o++]=t[a+l]}return s}function xI(t,e,n,i){let s=1,r=t[0];for(;r!==void 0&&r[i]===void 0;)r=t[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),n.push.apply(n,o)),r=t[s++];while(r!==void 0);else if(o.toArray!==void 0)do o=r[i],o!==void 0&&(e.push(r.time),o.toArray(n,n.length)),r=t[s++];while(r!==void 0);else do o=r[i],o!==void 0&&(e.push(r.time),n.push(o)),r=t[s++];while(r!==void 0)}class vc{constructor(e,n,i,s){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=s!==void 0?s:new n.constructor(i),this.sampleValues=n,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){const n=this.parameterPositions;let i=this._cachedIndex,s=n[i],r=n[i-1];e:{t:{let o;n:{i:if(!(e=r)){const a=n[1];e=r)break t}o=i,i=0;break n}break e}for(;i>>1;en;)--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 n=this.getValueSize();n-Math.floor(n)!==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&&ZMt(s))for(let a=0,l=s.length;a!==l;++a){const u=s[a];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,u),e=!1;break}}return e}optimize(){const e=this.times.slice(),n=this.values.slice(),i=this.getValueSize(),s=this.getInterpolation()===Vm,r=e.length-1;let o=1;for(let a=1;a0){e[o]=e[r];for(let a=r*i,l=o*i,u=0;u!==i;++u)n[l+u]=n[a+u];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=n.slice(0,o*i)):(this.times=e,this.values=n),this}clone(){const e=this.times.slice(),n=this.values.slice(),i=this.constructor,s=new i(this.name,e,n);return s.createInterpolant=this.createInterpolant,s}}gs.prototype.TimeBufferType=Float32Array;gs.prototype.ValueBufferType=Float32Array;gs.prototype.DefaultInterpolation=Ra;class Qa extends gs{}Qa.prototype.ValueTypeName="bool";Qa.prototype.ValueBufferType=Array;Qa.prototype.DefaultInterpolation=oc;Qa.prototype.InterpolantFactoryMethodLinear=void 0;Qa.prototype.InterpolantFactoryMethodSmooth=void 0;class CI extends gs{}CI.prototype.ValueTypeName="color";class Oa extends gs{}Oa.prototype.ValueTypeName="number";class i2t extends vc{constructor(e,n,i,s){super(e,n,i,s)}interpolate_(e,n,i,s){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-n)/(s-n);let u=e*a;for(let d=u+a;u!==d;u+=4)Ir.slerpFlat(r,0,o,u-a,o,u,l);return r}}class bo extends gs{InterpolantFactoryMethodLinear(e){return new i2t(this.times,this.values,this.getValueSize(),e)}}bo.prototype.ValueTypeName="quaternion";bo.prototype.DefaultInterpolation=Ra;bo.prototype.InterpolantFactoryMethodSmooth=void 0;class Xa extends gs{}Xa.prototype.ValueTypeName="string";Xa.prototype.ValueBufferType=Array;Xa.prototype.DefaultInterpolation=oc;Xa.prototype.InterpolantFactoryMethodLinear=void 0;Xa.prototype.InterpolantFactoryMethodSmooth=void 0;class Ia extends gs{}Ia.prototype.ValueTypeName="vector";class s2t{constructor(e,n=-1,i,s=cRt){this.name=e,this.tracks=i,this.duration=n,this.blendMode=s,this.uuid=zi(),this.duration<0&&this.resetDuration()}static parse(e){const n=[],i=e.tracks,s=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)n.push(o2t(i[o]).scale(s));const r=new this(e.name,e.duration,n,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){const n=[],i=e.tracks,s={name:e.name,duration:e.duration,tracks:n,uuid:e.uuid,blendMode:e.blendMode};for(let r=0,o=i.length;r!==o;++r)n.push(gs.toJSON(i[r]));return s}static CreateFromMorphTargetSequence(e,n,i,s){const r=n.length,o=[];for(let a=0;a1){const h=d[1];let f=s[h];f||(s[h]=f=[]),f.push(u)}}const o=[];for(const a in s)o.push(this.CreateFromMorphTargetSequence(a,s[a],n,i));return o}static parseAnimation(e,n){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(h,f,_,m,E){if(_.length!==0){const b=[],g=[];xI(_,b,g,m),b.length!==0&&E.push(new h(f,b,g))}},s=[],r=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const u=e.hierarchy||[];for(let h=0;h{n&&n(r),this.manager.itemEnd(e)},0),r;if(Os[e]!==void 0){Os[e].push({onLoad:n,onProgress:i,onError:s});return}Os[e]=[],Os[e].push({onLoad:n,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(u=>{if(u.status===200||u.status===0){if(u.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||u.body===void 0||u.body.getReader===void 0)return u;const d=Os[e],h=u.body.getReader(),f=u.headers.get("Content-Length")||u.headers.get("X-File-Size"),_=f?parseInt(f):0,m=_!==0;let E=0;const b=new ReadableStream({start(g){y();function y(){h.read().then(({done:v,value:S})=>{if(v)g.close();else{E+=S.byteLength;const C=new ProgressEvent("progress",{lengthComputable:m,loaded:E,total:_});for(let T=0,O=d.length;T{switch(l){case"arraybuffer":return u.arrayBuffer();case"blob":return u.blob();case"document":return u.text().then(d=>new DOMParser().parseFromString(d,a));case"json":return u.json();default:if(a===void 0)return u.text();{const h=/charset="?([^;"\s]*)"?/i.exec(a),f=h&&h[1]?h[1].toLowerCase():void 0,_=new TextDecoder(f);return u.arrayBuffer().then(m=>_.decode(m))}}}).then(u=>{Ma.add(e,u);const d=Os[e];delete Os[e];for(let h=0,f=d.length;h{const d=Os[e];if(d===void 0)throw this.manager.itemError(e),u;delete Os[e];for(let h=0,f=d.length;h{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class d2t extends Za{constructor(e){super(e)}load(e,n,i,s){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=Ma.get(e);if(o!==void 0)return r.manager.itemStart(e),setTimeout(function(){n&&n(o),r.manager.itemEnd(e)},0),o;const a=ac("img");function l(){d(),Ma.add(e,this),n&&n(this),r.manager.itemEnd(e)}function u(h){d(),s&&s(h),r.manager.itemError(e),r.manager.itemEnd(e)}function d(){a.removeEventListener("load",l,!1),a.removeEventListener("error",u,!1)}return a.addEventListener("load",l,!1),a.addEventListener("error",u,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),r.manager.itemStart(e),a.src=e,a}}class RI extends Za{constructor(e){super(e)}load(e,n,i,s){const r=new Nn,o=new d2t(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(a){r.image=a,r.needsUpdate=!0,n!==void 0&&n(r)},i,s),r}}class _p extends rn{constructor(e,n=1){super(),this.isLight=!0,this.type="Light",this.color=new gt(e),this.intensity=n}dispose(){}copy(e,n){return super.copy(e,n),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const n=super.toJSON(e);return n.object.color=this.color.getHex(),n.object.intensity=this.intensity,this.groundColor!==void 0&&(n.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(n.object.distance=this.distance),this.angle!==void 0&&(n.object.angle=this.angle),this.decay!==void 0&&(n.object.decay=this.decay),this.penumbra!==void 0&&(n.object.penumbra=this.penumbra),this.shadow!==void 0&&(n.object.shadow=this.shadow.toJSON()),n}}const hg=new Rt,Rw=new _e,Aw=new _e;class ly{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new It(512,512),this.map=null,this.mapPass=null,this.matrix=new Rt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new ey,this._frameExtents=new It(1,1),this._viewportCount=1,this._viewports=[new Wt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const n=this.camera,i=this.matrix;Rw.setFromMatrixPosition(e.matrixWorld),n.position.copy(Rw),Aw.setFromMatrixPosition(e.target.matrixWorld),n.lookAt(Aw),n.updateMatrixWorld(),hg.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(hg),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(hg)}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 u2t extends ly{constructor(){super(new zn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const n=this.camera,i=Aa*2*e.angle*this.focus,s=this.mapSize.width/this.mapSize.height,r=e.distance||n.far;(i!==n.fov||s!==n.aspect||r!==n.far)&&(n.fov=i,n.aspect=s,n.far=r,n.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class p2t extends _p{constructor(e,n,i=0,s=Math.PI/3,r=0,o=2){super(e,n),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(rn.DEFAULT_UP),this.updateMatrix(),this.target=new rn,this.distance=i,this.angle=s,this.penumbra=r,this.decay=o,this.map=null,this.shadow=new u2t}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,n){return super.copy(e,n),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 Nw=new Rt,vl=new _e,fg=new _e;class _2t extends ly{constructor(){super(new zn(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new It(4,2),this._viewportCount=6,this._viewports=[new Wt(2,1,1,1),new Wt(0,1,1,1),new Wt(3,1,1,1),new Wt(1,1,1,1),new Wt(3,0,1,1),new Wt(1,0,1,1)],this._cubeDirections=[new _e(1,0,0),new _e(-1,0,0),new _e(0,0,1),new _e(0,0,-1),new _e(0,1,0),new _e(0,-1,0)],this._cubeUps=[new _e(0,1,0),new _e(0,1,0),new _e(0,1,0),new _e(0,1,0),new _e(0,0,1),new _e(0,0,-1)]}updateMatrices(e,n=0){const i=this.camera,s=this.matrix,r=e.distance||i.far;r!==i.far&&(i.far=r,i.updateProjectionMatrix()),vl.setFromMatrixPosition(e.matrixWorld),i.position.copy(vl),fg.copy(i.position),fg.add(this._cubeDirections[n]),i.up.copy(this._cubeUps[n]),i.lookAt(fg),i.updateMatrixWorld(),s.makeTranslation(-vl.x,-vl.y,-vl.z),Nw.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Nw)}}class h2t extends _p{constructor(e,n,i=0,s=2){super(e,n),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=s,this.shadow=new _2t}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class f2t extends ly{constructor(){super(new ny(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class AI extends _p{constructor(e,n){super(e,n),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(rn.DEFAULT_UP),this.updateMatrix(),this.target=new rn,this.shadow=new f2t}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class m2t extends _p{constructor(e,n){super(e,n),this.isAmbientLight=!0,this.type="AmbientLight"}}class Gl{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let n="";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,n,i,s){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=Ma.get(e);if(o!==void 0)return r.manager.itemStart(e),setTimeout(function(){n&&n(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){Ma.add(e,l),n&&n(l),r.manager.itemEnd(e)}).catch(function(l){s&&s(l),r.manager.itemError(e),r.manager.itemEnd(e)}),r.manager.itemStart(e)}}const cy="\\[\\]\\.:\\/",b2t=new RegExp("["+cy+"]","g"),dy="[^"+cy+"]",E2t="[^"+cy.replace("\\.","")+"]",y2t=/((?:WC+[\/:])*)/.source.replace("WC",dy),v2t=/(WCOD+)?/.source.replace("WCOD",E2t),S2t=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",dy),T2t=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",dy),x2t=new RegExp("^"+y2t+v2t+S2t+T2t+"$"),C2t=["material","materials","bones","map"];class w2t{constructor(e,n,i){const s=i||zt.parseTrackName(n);this._targetGroup=e,this._bindings=e.subscribe_(n,s)}getValue(e,n){this.bind();const i=this._targetGroup.nCachedObjects_,s=this._bindings[i];s!==void 0&&s.getValue(e,n)}setValue(e,n){const i=this._bindings;for(let s=this._targetGroup.nCachedObjects_,r=i.length;s!==r;++s)i[s].setValue(e,n)}bind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,i=e.length;n!==i;++n)e[n].bind()}unbind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,i=e.length;n!==i;++n)e[n].unbind()}}class zt{constructor(e,n,i){this.path=n,this.parsedPath=i||zt.parseTrackName(n),this.node=zt.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,n,i){return e&&e.isAnimationObjectGroup?new zt.Composite(e,n,i):new zt(e,n,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(b2t,"")}static parseTrackName(e){const n=x2t.exec(e);if(n===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},s=i.nodeName&&i.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){const r=i.nodeName.substring(s+1);C2t.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,n){if(n===void 0||n===""||n==="."||n===-1||n===e.name||n===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(n);if(i!==void 0)return i}if(e.children){const i=function(r){for(let o=0;o=2.0 are supported."));return}const u=new rDt(r,{path:n||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});u.fileLoader.setRequestHeader(this.requestHeader);for(let d=0;d=0&&a[h]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+h+'".')}}u.setExtensions(o),u.setPlugins(a),u.parse(i,s)}parseAsync(e,n){const i=this;return new Promise(function(s,r){i.parse(e,n,s,r)})}}function A2t(){let t={};return{get:function(e){return t[e]},add:function(e,n){t[e]=n},remove:function(e){delete t[e]},removeAll:function(){t={}}}}const Ot={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 N2t{constructor(e){this.parser=e,this.name=Ot.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,n=this.parser.json.nodes||[];for(let i=0,s=n.length;i=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return n.loadTextureImage(e,r.source,o)}}class z2t{constructor(e){this.parser=e,this.name=Ot.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const n=this.name,i=this.parser,s=i.json,r=s.textures[e];if(!r.extensions||!r.extensions[n])return null;const o=r.extensions[n],a=s.images[o.source];let l=i.textureLoader;if(a.uri){const u=i.options.manager.getHandler(a.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return i.loadTextureImage(e,o.source,l);if(s.extensionsRequired&&s.extensionsRequired.indexOf(n)>=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 n=new Image;n.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",n.onload=n.onerror=function(){e(n.height===1)}})),this.isSupported}}class H2t{constructor(e){this.parser=e,this.name=Ot.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const n=this.name,i=this.parser,s=i.json,r=s.textures[e];if(!r.extensions||!r.extensions[n])return null;const o=r.extensions[n],a=s.images[o.source];let l=i.textureLoader;if(a.uri){const u=i.options.manager.getHandler(a.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return i.loadTextureImage(e,o.source,l);if(s.extensionsRequired&&s.extensionsRequired.indexOf(n)>=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 n=new Image;n.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",n.onload=n.onerror=function(){e(n.height===1)}})),this.isSupported}}class q2t{constructor(e){this.name=Ot.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const n=this.parser.json,i=n.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(n.extensionsRequired&&n.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,u=s.byteLength||0,d=s.count,h=s.byteStride,f=new Uint8Array(a,l,u);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(d,h,f,s.mode,s.filter).then(function(_){return _.buffer}):o.ready.then(function(){const _=new ArrayBuffer(d*h);return o.decodeGltfBuffer(new Uint8Array(_),d,h,f,s.mode,s.filter),_})})}else return null}}class Y2t{constructor(e){this.name=Ot.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const n=this.parser.json,i=n.nodes[e];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const s=n.meshes[i.mesh];for(const u of s.primitives)if(u.mode!==hi.TRIANGLES&&u.mode!==hi.TRIANGLE_STRIP&&u.mode!==hi.TRIANGLE_FAN&&u.mode!==void 0)return null;const o=i.extensions[this.name].attributes,a=[],l={};for(const u in o)a.push(this.parser.getDependency("accessor",o[u]).then(d=>(l[u]=d,l[u])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(u=>{const d=u.pop(),h=d.isGroup?d.children:[d],f=u[0].count,_=[];for(const m of h){const E=new Rt,b=new _e,g=new Ir,y=new _e(1,1,1),v=new KMt(m.geometry,m.material,f);for(let S=0;S0||t.search(/^data\:image\/jpeg/)===0?"image/jpeg":t.search(/\.webp($|\?)/i)>0||t.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const sDt=new Rt;class rDt{constructor(e={},n={}){this.json=e,this.extensions={},this.plugins={},this.options=n,this.cache=new A2t,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 RI(this.options.manager):this.textureLoader=new g2t(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new wI(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,n){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 zr(r,a,s),fr(a,s),Promise.all(i._invokeAll(function(l){return l.afterRoot&&l.afterRoot(a)})).then(function(){e(a)})}).catch(n)}_markDefs(){const e=this.json.nodes||[],n=this.json.skins||[],i=this.json.meshes||[];for(let s=0,r=n.length;s{const l=this.associations.get(o);l!=null&&this.associations.set(a,l);for(const[u,d]of o.children.entries())r(d,a.children[u])};return r(i,s),s.name+="_instance_"+e.uses[n]++,s}_invokeOne(e){const n=Object.values(this.plugins);n.push(this);for(let i=0;i=2&&b.setY(x,T[O*l+1]),l>=3&&b.setZ(x,T[O*l+2]),l>=4&&b.setW(x,T[O*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return b})}loadTexture(e){const n=this.json,i=this.options,r=n.textures[e].source,o=n.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,n,i){const s=this,r=this.json,o=r.textures[e],a=r.images[n],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const u=this.loadImageSource(n,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 f=(r.samplers||{})[o.sampler]||{};return d.magFilter=Mw[f.magFilter]||jn,d.minFilter=Mw[f.minFilter]||fo,d.wrapS=Dw[f.wrapS]||Ca,d.wrapT=Dw[f.wrapT]||Ca,s.associations.set(d,{textures:e}),d}).catch(function(){return null});return this.textureCache[l]=u,u}loadImageSource(e,n){const i=this,s=this.json,r=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(h=>h.clone());const o=s.images[e],a=self.URL||self.webkitURL;let l=o.uri||"",u=!1;if(o.bufferView!==void 0)l=i.getDependency("bufferView",o.bufferView).then(function(h){u=!0;const f=new Blob([h],{type:o.mimeType});return l=a.createObjectURL(f),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(h){return new Promise(function(f,_){let m=f;n.isImageBitmapLoader===!0&&(m=function(E){const b=new Nn(E);b.needsUpdate=!0,f(b)}),n.load(Gl.resolveURL(h,r.path),m,void 0,_)})}).then(function(h){return u===!0&&a.revokeObjectURL(l),h.userData.mimeType=o.mimeType||iDt(o.uri),h}).catch(function(h){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),h});return this.sourceCache[e]=d,d}assignTexture(e,n,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[Ot.KHR_TEXTURE_TRANSFORM]){const a=i.extensions!==void 0?i.extensions[Ot.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const l=r.associations.get(o);o=r.extensions[Ot.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),r.associations.set(o,l)}}return s!==void 0&&(o.colorSpace=s),e[n]=o,o})}assignFinalMaterial(e){const n=e.geometry;let i=e.material;const s=n.attributes.tangent===void 0,r=n.attributes.color!==void 0,o=n.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+i.uuid;let l=this.cache.get(a);l||(l=new TI,Hi.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 SI,Hi.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 ay}loadMaterial(e){const n=this,i=this.json,s=this.extensions,r=i.materials[e];let o;const a={},l=r.extensions||{},u=[];if(l[Ot.KHR_MATERIALS_UNLIT]){const h=s[Ot.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),u.push(h.extendParams(a,r,n))}else{const h=r.pbrMetallicRoughness||{};if(a.color=new gt(1,1,1),a.opacity=1,Array.isArray(h.baseColorFactor)){const f=h.baseColorFactor;a.color.setRGB(f[0],f[1],f[2],On),a.opacity=f[3]}h.baseColorTexture!==void 0&&u.push(n.assignTexture(a,"map",h.baseColorTexture,on)),a.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,a.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(u.push(n.assignTexture(a,"metalnessMap",h.metallicRoughnessTexture)),u.push(n.assignTexture(a,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(f){return f.getMaterialType&&f.getMaterialType(e)}),u.push(Promise.all(this._invokeAll(function(f){return f.extendMaterialParams&&f.extendMaterialParams(e,a)})))}r.doubleSided===!0&&(a.side=es);const d=r.alphaMode||gg.OPAQUE;if(d===gg.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,d===gg.MASK&&(a.alphaTest=r.alphaCutoff!==void 0?r.alphaCutoff:.5)),r.normalTexture!==void 0&&o!==Er&&(u.push(n.assignTexture(a,"normalMap",r.normalTexture)),a.normalScale=new It(1,1),r.normalTexture.scale!==void 0)){const h=r.normalTexture.scale;a.normalScale.set(h,h)}if(r.occlusionTexture!==void 0&&o!==Er&&(u.push(n.assignTexture(a,"aoMap",r.occlusionTexture)),r.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=r.occlusionTexture.strength)),r.emissiveFactor!==void 0&&o!==Er){const h=r.emissiveFactor;a.emissive=new gt().setRGB(h[0],h[1],h[2],On)}return r.emissiveTexture!==void 0&&o!==Er&&u.push(n.assignTexture(a,"emissiveMap",r.emissiveTexture,on)),Promise.all(u).then(function(){const h=new o(a);return r.name&&(h.name=r.name),fr(h,r),n.associations.set(h,{materials:e}),r.extensions&&zr(s,h,r),h})}createUniqueName(e){const n=zt.sanitizeNodeName(e||"");return n in this.nodeNamesUsed?n+"_"+ ++this.nodeNamesUsed[n]:(this.nodeNamesUsed[n]=0,n)}loadGeometries(e){const n=this,i=this.extensions,s=this.primitiveCache;function r(a){return i[Ot.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,n).then(function(l){return kw(l,a,n)})}const o=[];for(let a=0,l=e.length;a0&&tDt(g,r),g.name=n.createUniqueName(r.name||"mesh_"+e),fr(g,r),b.extensions&&zr(s,g,b),n.assignFinalMaterial(g),h.push(g)}for(let _=0,m=h.length;_1?d=new to:u.length===1?d=u[0]:d=new rn,d!==u[0])for(let h=0,f=u.length;h{const h=new Map;for(const[f,_]of s.associations)(f instanceof Hi||f instanceof Nn)&&h.set(f,_);return d.traverse(f=>{const _=s.associations.get(f);_!=null&&h.set(f,_)}),h};return s.associations=u(r),r})}_createAnimationTracks(e,n,i,s,r){const o=[],a=e.name?e.name:e.uuid,l=[];or[r.path]===or.weights?e.traverse(function(f){f.morphTargetInfluences&&l.push(f.name?f.name:f.uuid)}):l.push(a);let u;switch(or[r.path]){case or.weights:u=Oa;break;case or.rotation:u=bo;break;case or.position:case or.scale:u=Ia;break;default:switch(i.itemSize){case 1:u=Oa;break;case 2:case 3:default:u=Ia;break}break}const d=s.interpolation!==void 0?Z2t[s.interpolation]:Ra,h=this._getArrayFromAccessor(i);for(let f=0,_=l.length;f<_;f++){const m=new u(l[f]+"."+or[r.path],n.array,h,d);s.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(m),o.push(m)}return o}_getArrayFromAccessor(e){let n=e.array;if(e.normalized){const i=gb(n.constructor),s=new Float32Array(n.length);for(let r=0,o=n.length;r{He.replace()})},stopVideoStream(){this.isVideoActive=!1,this.imageData=null,$e.emit("stop_webcam_video_stream"),Ge(()=>{He.replace()})},startDrag(t){this.isDragging=!0,this.zIndex=5001,this.dragStart.x=t.clientX,this.dragStart.y=t.clientY,document.addEventListener("mousemove",this.drag),document.addEventListener("mouseup",this.stopDrag)},drag(t){if(this.isDragging){const e=t.clientX-this.dragStart.x,n=t.clientY-this.dragStart.y;this.position.bottom-=n,this.position.right-=e,this.dragStart.x=t.clientX,this.dragStart.y=t.clientY}},stopDrag(){this.isDragging=!1,this.zIndex=0,document.removeEventListener("mousemove",this.drag),document.removeEventListener("mouseup",this.stopDrag)}},mounted(){He.replace(),$e.on("video_stream_image",t=>{if(this.isVideoActive){this.imageDataUrl="data:image/jpeg;base64,"+t,this.frameCount++;const e=Date.now();e-this.lastFrameTime>=1e3&&(this.frameRate=this.frameCount,this.frameCount=0,this.lastFrameTime=e)}})}},lDt=["src"],cDt=["src"],dDt={class:"controls"},uDt=c("i",{"data-feather":"video"},null,-1),pDt=[uDt],_Dt=c("i",{"data-feather":"video"},null,-1),hDt=[_Dt],fDt={key:2};function mDt(t,e,n,i,s,r){return w(),A("div",{class:"floating-frame bg-white",style:en({bottom:s.position.bottom+"px",right:s.position.right+"px","z-index":s.zIndex}),onMousedown:e[4]||(e[4]=be((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[5]||(e[5]=be((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},[c("div",{class:"handle",onMousedown:e[0]||(e[0]=be((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[1]||(e[1]=be((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},"Drag Me",32),s.isVideoActive&&s.imageDataUrl!=null?(w(),A("img",{key:0,src:s.imageDataUrl,alt:"Webcam Frame",width:"300",height:"300"},null,8,lDt)):V("",!0),s.isVideoActive&&s.imageDataUrl==null?(w(),A("p",{key:1,src:s.imageDataUrl,alt:"Webcam Frame",width:"300",height:"300"},"Loading. Please wait...",8,cDt)):V("",!0),c("div",dDt,[s.isVideoActive?V("",!0):(w(),A("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))},pDt)),s.isVideoActive?(w(),A("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))},hDt)):V("",!0),s.isVideoActive?(w(),A("span",fDt,"FPS: "+he(s.frameRate),1)):V("",!0)])],36)}const gDt=bt(aDt,[["render",mDt]]);const bDt={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(){$e.emit("start_audio_stream",()=>{this.isAudioActive=!0}),Ge(()=>{He.replace()})},stopAudioStream(){$e.emit("stop_audio_stream",()=>{this.isAudioActive=!1,this.imageDataUrl=null}),Ge(()=>{He.replace()})},startDrag(t){this.isDragging=!0,this.zIndex=5001,this.dragStart.x=t.clientX,this.dragStart.y=t.clientY,document.addEventListener("mousemove",this.drag),document.addEventListener("mouseup",this.stopDrag)},drag(t){if(this.isDragging){const e=t.clientX-this.dragStart.x,n=t.clientY-this.dragStart.y;this.position.bottom-=n,this.position.right-=e,this.dragStart.x=t.clientX,this.dragStart.y=t.clientY}},stopDrag(){this.isDragging=!1,this.zIndex=0,document.removeEventListener("mousemove",this.drag),document.removeEventListener("mouseup",this.stopDrag)}},mounted(){He.replace(),$e.on("update_spectrogram",t=>{if(this.isAudioActive){this.imageDataUrl="data:image/jpeg;base64,"+t,this.frameCount++;const e=Date.now();e-this.lastFrameTime>=1e3&&(this.frameRate=this.frameCount,this.frameCount=0,this.lastFrameTime=e)}})}},EDt=["src"],yDt={class:"controls"},vDt=c("i",{"data-feather":"mic"},null,-1),SDt=[vDt],TDt=c("i",{"data-feather":"mic"},null,-1),xDt=[TDt];function CDt(t,e,n,i,s,r){return w(),A("div",{class:"floating-frame bg-white",style:en({bottom:s.position.bottom+"px",right:s.position.right+"px","z-index":s.zIndex}),onMousedown:e[4]||(e[4]=be((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[5]||(e[5]=be((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},[c("div",{class:"handle",onMousedown:e[0]||(e[0]=be((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[1]||(e[1]=be((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},"Drag Me",32),s.isAudioActive&&s.imageDataUrl!=null?(w(),A("img",{key:0,src:s.imageDataUrl,alt:"Spectrogram",width:"300",height:"300"},null,8,EDt)):V("",!0),c("div",yDt,[s.isAudioActive?V("",!0):(w(),A("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))},SDt)),s.isAudioActive?(w(),A("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))},xDt)):V("",!0)])],36)}const wDt=bt(bDt,[["render",CDt]]);const RDt={data(){return{activePersonality:null}},props:{personality:{type:Object,default:()=>({})}},components:{VideoFrame:gDt,AudioFrame:wDt},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(t=>setTimeout(t,100));console.log("Personality:",this.personality),this.initWebGLScene(),this.updatePersonality(),Ge(()=>{He.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 VMt,this.camera=new zn(75,window.innerWidth/window.innerHeight,.1,1e3),this.renderer=new yI,this.renderer.setSize(window.innerWidth,window.innerHeight),this.$refs.webglContainer.appendChild(this.renderer.domElement);const t=new Cr,e=new Cw({color:65280});this.cube=new Hn(t,e),this.scene.add(this.cube);const n=new m2t(4210752),i=new AI(16777215,.5);i.position.set(0,1,0),this.scene.add(n),this.scene.add(i),this.camera.position.z=5,this.animate()},updatePersonality(){const{mountedPersArr:t,config:e}=this.$store.state;this.activePersonality=t[e.active_personality_id],this.activePersonality.avatar?this.showBoxWithAvatar(this.activePersonality.avatar):this.showDefaultCube(),this.$emit("update:personality",this.activePersonality)},loadScene(t){new R2t().load(t,n=>{this.scene.remove(this.cube),this.cube=n.scene,this.scene.add(this.cube)})},showBoxWithAvatar(t){this.cube&&this.scene.remove(this.cube);const e=new Cr,n=new RI().load(t),i=new Er({map:n});this.cube=new Hn(e,i),this.scene.add(this.cube)},showDefaultCube(){this.scene.remove(this.cube);const t=new Cr,e=new Cw({color:65280});this.cube=new Hn(t,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)}}},ADt={ref:"webglContainer"},NDt={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"},ODt={key:0,class:"text-center"},IDt={key:1,class:"text-center"},MDt={class:"floating-frame2"},DDt=["innerHTML"];function kDt(t,e,n,i,s,r){const o=mt("VideoFrame"),a=mt("AudioFrame");return w(),A(Ye,null,[c("div",ADt,null,512),c("div",NDt,[!s.activePersonality||!s.activePersonality.scene_path?(w(),A("div",ODt," Personality does not have a 3d avatar. ")):V("",!0),!s.activePersonality||!s.activePersonality.avatar||s.activePersonality.avatar===""?(w(),A("div",IDt," Personality does not have an avatar. ")):V("",!0),c("div",MDt,[c("div",{innerHTML:t.htmlContent},null,8,DDt)])]),Te(o,{ref:"video_frame"},null,512),Te(a,{ref:"audio_frame"},null,512)],64)}const LDt=bt(RDt,[["render",kDt]]);let xd;const PDt=new Uint8Array(16);function UDt(){if(!xd&&(xd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!xd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return xd(PDt)}const Cn=[];for(let t=0;t<256;++t)Cn.push((t+256).toString(16).slice(1));function FDt(t,e=0){return Cn[t[e+0]]+Cn[t[e+1]]+Cn[t[e+2]]+Cn[t[e+3]]+"-"+Cn[t[e+4]]+Cn[t[e+5]]+"-"+Cn[t[e+6]]+Cn[t[e+7]]+"-"+Cn[t[e+8]]+Cn[t[e+9]]+"-"+Cn[t[e+10]]+Cn[t[e+11]]+Cn[t[e+12]]+Cn[t[e+13]]+Cn[t[e+14]]+Cn[t[e+15]]}const BDt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Lw={randomUUID:BDt};function Gs(t,e,n){if(Lw.randomUUID&&!e&&!t)return Lw.randomUUID();t=t||{};const i=t.random||(t.rng||UDt)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){n=n||0;for(let s=0;s<16;++s)e[n+s]=i[s];return e}return FDt(i)}class co{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,n){this.listenerMap.has(e)&&(console.warn(`Already subscribed. Unsubscribing for you. +}`;function MMt(t,e,n){let i=new ey;const s=new It,r=new It,o=new Wt,a=new AMt({depthPacking:_Rt}),l=new NMt,u={},d=n.maxTextureSize,h={[Ys]:Zn,[Zn]:Ys,[es]:es},f=new go({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new It},radius:{value:4}},vertexShader:OMt,fragmentShader:IMt}),_=f.clone();_.defines.HORIZONTAL_PASS=1;const m=new ms;m.setAttribute("position",new Yn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const E=new Hn(m,f),b=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=HO;let g=this.type;this.render=function(C,T,O){if(b.enabled===!1||b.autoUpdate===!1&&b.needsUpdate===!1||C.length===0)return;const k=t.getRenderTarget(),x=t.getActiveCubeFace(),I=t.getActiveMipmapLevel(),F=t.state;F.setBlending(Sr),F.buffers.color.setClear(1,1,1,1),F.buffers.depth.setTest(!0),F.setScissorTest(!1);const B=g!==Ms&&this.type===Ms,ne=g===Ms&&this.type!==Ms;for(let L=0,$=C.length;L<$;L++){const H=C[L],U=H.shadow;if(U===void 0){console.warn("THREE.WebGLShadowMap:",H,"has no shadow.");continue}if(U.autoUpdate===!1&&U.needsUpdate===!1)continue;s.copy(U.mapSize);const Q=U.getFrameExtents();if(s.multiply(Q),r.copy(U.mapSize),(s.x>d||s.y>d)&&(s.x>d&&(r.x=Math.floor(d/Q.x),s.x=r.x*Q.x,U.mapSize.x=r.x),s.y>d&&(r.y=Math.floor(d/Q.y),s.y=r.y*Q.y,U.mapSize.y=r.y)),U.map===null||B===!0||ne===!0){const j=this.type!==Ms?{minFilter:yn,magFilter:yn}:{};U.map!==null&&U.map.dispose(),U.map=new mo(s.x,s.y,j),U.map.texture.name=H.name+".shadowMap",U.camera.updateProjectionMatrix()}t.setRenderTarget(U.map),t.clear();const J=U.getViewportCount();for(let j=0;j0||T.map&&T.alphaTest>0){const F=x.uuid,B=T.uuid;let ne=u[F];ne===void 0&&(ne={},u[F]=ne);let L=ne[B];L===void 0&&(L=x.clone(),ne[B]=L),x=L}if(x.visible=T.visible,x.wireframe=T.wireframe,k===Ms?x.side=T.shadowSide!==null?T.shadowSide:T.side:x.side=T.shadowSide!==null?T.shadowSide:h[T.side],x.alphaMap=T.alphaMap,x.alphaTest=T.alphaTest,x.map=T.map,x.clipShadows=T.clipShadows,x.clippingPlanes=T.clippingPlanes,x.clipIntersection=T.clipIntersection,x.displacementMap=T.displacementMap,x.displacementScale=T.displacementScale,x.displacementBias=T.displacementBias,x.wireframeLinewidth=T.wireframeLinewidth,x.linewidth=T.linewidth,O.isPointLight===!0&&x.isMeshDistanceMaterial===!0){const F=t.properties.get(x);F.light=O}return x}function S(C,T,O,k,x){if(C.visible===!1)return;if(C.layers.test(T.layers)&&(C.isMesh||C.isLine||C.isPoints)&&(C.castShadow||C.receiveShadow&&x===Ms)&&(!C.frustumCulled||i.intersectsObject(C))){C.modelViewMatrix.multiplyMatrices(O.matrixWorldInverse,C.matrixWorld);const B=e.update(C),ne=C.material;if(Array.isArray(ne)){const L=B.groups;for(let $=0,H=L.length;$=1):j.indexOf("OpenGL ES")!==-1&&(J=parseFloat(/^OpenGL ES (\d)/.exec(j)[1]),Q=J>=2);let ae=null,ve={};const ee=t.getParameter(t.SCISSOR_BOX),Ee=t.getParameter(t.VIEWPORT),xe=new Wt().fromArray(ee),Me=new Wt().fromArray(Ee);function Z(oe,Ke,Ue,Oe){const Be=new Uint8Array(4),dt=t.createTexture();t.bindTexture(oe,dt),t.texParameteri(oe,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(oe,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let Et=0;Et"u"?!1:/OculusBrowser/g.test(navigator.userAgent),m=new WeakMap;let E;const b=new WeakMap;let g=!1;try{g=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function y(M,N){return g?new OffscreenCanvas(M,N):ac("canvas")}function v(M,N,W,ue){let X=1;if((M.width>ue||M.height>ue)&&(X=ue/Math.max(M.width,M.height)),X<1||N===!0)if(typeof HTMLImageElement<"u"&&M instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&M instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&M instanceof ImageBitmap){const ie=N?Eu:Math.floor,Ae=ie(X*M.width),Ce=ie(X*M.height);E===void 0&&(E=y(Ae,Ce));const ke=W?y(Ae,Ce):E;return ke.width=Ae,ke.height=Ce,ke.getContext("2d").drawImage(M,0,0,Ae,Ce),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+M.width+"x"+M.height+") to ("+Ae+"x"+Ce+")."),ke}else return"data"in M&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+M.width+"x"+M.height+")."),M;return M}function S(M){return pb(M.width)&&pb(M.height)}function C(M){return a?!1:M.wrapS!==mi||M.wrapT!==mi||M.minFilter!==yn&&M.minFilter!==jn}function T(M,N){return M.generateMipmaps&&N&&M.minFilter!==yn&&M.minFilter!==jn}function O(M){t.generateMipmap(M)}function k(M,N,W,ue,X=!1){if(a===!1)return N;if(M!==null){if(t[M]!==void 0)return t[M];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+M+"'")}let ie=N;if(N===t.RED&&(W===t.FLOAT&&(ie=t.R32F),W===t.HALF_FLOAT&&(ie=t.R16F),W===t.UNSIGNED_BYTE&&(ie=t.R8)),N===t.RED_INTEGER&&(W===t.UNSIGNED_BYTE&&(ie=t.R8UI),W===t.UNSIGNED_SHORT&&(ie=t.R16UI),W===t.UNSIGNED_INT&&(ie=t.R32UI),W===t.BYTE&&(ie=t.R8I),W===t.SHORT&&(ie=t.R16I),W===t.INT&&(ie=t.R32I)),N===t.RG&&(W===t.FLOAT&&(ie=t.RG32F),W===t.HALF_FLOAT&&(ie=t.RG16F),W===t.UNSIGNED_BYTE&&(ie=t.RG8)),N===t.RGBA){const Ae=X?fu:Gt.getTransfer(ue);W===t.FLOAT&&(ie=t.RGBA32F),W===t.HALF_FLOAT&&(ie=t.RGBA16F),W===t.UNSIGNED_BYTE&&(ie=Ae===Zt?t.SRGB8_ALPHA8:t.RGBA8),W===t.UNSIGNED_SHORT_4_4_4_4&&(ie=t.RGBA4),W===t.UNSIGNED_SHORT_5_5_5_1&&(ie=t.RGB5_A1)}return(ie===t.R16F||ie===t.R32F||ie===t.RG16F||ie===t.RG32F||ie===t.RGBA16F||ie===t.RGBA32F)&&e.get("EXT_color_buffer_float"),ie}function x(M,N,W){return T(M,W)===!0||M.isFramebufferTexture&&M.minFilter!==yn&&M.minFilter!==jn?Math.log2(Math.max(N.width,N.height))+1:M.mipmaps!==void 0&&M.mipmaps.length>0?M.mipmaps.length:M.isCompressedTexture&&Array.isArray(M.image)?N.mipmaps.length:1}function I(M){return M===yn||M===lb||M===Bd?t.NEAREST:t.LINEAR}function F(M){const N=M.target;N.removeEventListener("dispose",F),ne(N),N.isVideoTexture&&m.delete(N)}function B(M){const N=M.target;N.removeEventListener("dispose",B),$(N)}function ne(M){const N=i.get(M);if(N.__webglInit===void 0)return;const W=M.source,ue=b.get(W);if(ue){const X=ue[N.__cacheKey];X.usedTimes--,X.usedTimes===0&&L(M),Object.keys(ue).length===0&&b.delete(W)}i.remove(M)}function L(M){const N=i.get(M);t.deleteTexture(N.__webglTexture);const W=M.source,ue=b.get(W);delete ue[N.__cacheKey],o.memory.textures--}function $(M){const N=M.texture,W=i.get(M),ue=i.get(N);if(ue.__webglTexture!==void 0&&(t.deleteTexture(ue.__webglTexture),o.memory.textures--),M.depthTexture&&M.depthTexture.dispose(),M.isWebGLCubeRenderTarget)for(let X=0;X<6;X++){if(Array.isArray(W.__webglFramebuffer[X]))for(let ie=0;ie=l&&console.warn("THREE.WebGLTextures: Trying to use "+M+" texture units while this GPU supports only "+l),H+=1,M}function J(M){const N=[];return N.push(M.wrapS),N.push(M.wrapT),N.push(M.wrapR||0),N.push(M.magFilter),N.push(M.minFilter),N.push(M.anisotropy),N.push(M.internalFormat),N.push(M.format),N.push(M.type),N.push(M.generateMipmaps),N.push(M.premultiplyAlpha),N.push(M.flipY),N.push(M.unpackAlignment),N.push(M.colorSpace),N.join()}function j(M,N){const W=i.get(M);if(M.isVideoTexture&&re(M),M.isRenderTargetTexture===!1&&M.version>0&&W.__version!==M.version){const ue=M.image;if(ue===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ue.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{fe(W,M,N);return}}n.bindTexture(t.TEXTURE_2D,W.__webglTexture,t.TEXTURE0+N)}function ae(M,N){const W=i.get(M);if(M.version>0&&W.__version!==M.version){fe(W,M,N);return}n.bindTexture(t.TEXTURE_2D_ARRAY,W.__webglTexture,t.TEXTURE0+N)}function ve(M,N){const W=i.get(M);if(M.version>0&&W.__version!==M.version){fe(W,M,N);return}n.bindTexture(t.TEXTURE_3D,W.__webglTexture,t.TEXTURE0+N)}function ee(M,N){const W=i.get(M);if(M.version>0&&W.__version!==M.version){Ne(W,M,N);return}n.bindTexture(t.TEXTURE_CUBE_MAP,W.__webglTexture,t.TEXTURE0+N)}const Ee={[Ca]:t.REPEAT,[mi]:t.CLAMP_TO_EDGE,[hu]:t.MIRRORED_REPEAT},xe={[yn]:t.NEAREST,[lb]:t.NEAREST_MIPMAP_NEAREST,[Bd]:t.NEAREST_MIPMAP_LINEAR,[jn]:t.LINEAR,[YO]:t.LINEAR_MIPMAP_NEAREST,[fo]:t.LINEAR_MIPMAP_LINEAR},Me={[fRt]:t.NEVER,[vRt]:t.ALWAYS,[mRt]:t.LESS,[tI]:t.LEQUAL,[gRt]:t.EQUAL,[yRt]:t.GEQUAL,[bRt]:t.GREATER,[ERt]:t.NOTEQUAL};function Z(M,N,W){if(W?(t.texParameteri(M,t.TEXTURE_WRAP_S,Ee[N.wrapS]),t.texParameteri(M,t.TEXTURE_WRAP_T,Ee[N.wrapT]),(M===t.TEXTURE_3D||M===t.TEXTURE_2D_ARRAY)&&t.texParameteri(M,t.TEXTURE_WRAP_R,Ee[N.wrapR]),t.texParameteri(M,t.TEXTURE_MAG_FILTER,xe[N.magFilter]),t.texParameteri(M,t.TEXTURE_MIN_FILTER,xe[N.minFilter])):(t.texParameteri(M,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(M,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),(M===t.TEXTURE_3D||M===t.TEXTURE_2D_ARRAY)&&t.texParameteri(M,t.TEXTURE_WRAP_R,t.CLAMP_TO_EDGE),(N.wrapS!==mi||N.wrapT!==mi)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(M,t.TEXTURE_MAG_FILTER,I(N.magFilter)),t.texParameteri(M,t.TEXTURE_MIN_FILTER,I(N.minFilter)),N.minFilter!==yn&&N.minFilter!==jn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),N.compareFunction&&(t.texParameteri(M,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(M,t.TEXTURE_COMPARE_FUNC,Me[N.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const ue=e.get("EXT_texture_filter_anisotropic");if(N.magFilter===yn||N.minFilter!==Bd&&N.minFilter!==fo||N.type===Ps&&e.has("OES_texture_float_linear")===!1||a===!1&&N.type===rc&&e.has("OES_texture_half_float_linear")===!1)return;(N.anisotropy>1||i.get(N).__currentAnisotropy)&&(t.texParameterf(M,ue.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(N.anisotropy,s.getMaxAnisotropy())),i.get(N).__currentAnisotropy=N.anisotropy)}}function ye(M,N){let W=!1;M.__webglInit===void 0&&(M.__webglInit=!0,N.addEventListener("dispose",F));const ue=N.source;let X=b.get(ue);X===void 0&&(X={},b.set(ue,X));const ie=J(N);if(ie!==M.__cacheKey){X[ie]===void 0&&(X[ie]={texture:t.createTexture(),usedTimes:0},o.memory.textures++,W=!0),X[ie].usedTimes++;const Ae=X[M.__cacheKey];Ae!==void 0&&(X[M.__cacheKey].usedTimes--,Ae.usedTimes===0&&L(N)),M.__cacheKey=ie,M.__webglTexture=X[ie].texture}return W}function fe(M,N,W){let ue=t.TEXTURE_2D;(N.isDataArrayTexture||N.isCompressedArrayTexture)&&(ue=t.TEXTURE_2D_ARRAY),N.isData3DTexture&&(ue=t.TEXTURE_3D);const X=ye(M,N),ie=N.source;n.bindTexture(ue,M.__webglTexture,t.TEXTURE0+W);const Ae=i.get(ie);if(ie.version!==Ae.__version||X===!0){n.activeTexture(t.TEXTURE0+W);const Ce=Gt.getPrimaries(Gt.workingColorSpace),ke=N.colorSpace===bi?null:Gt.getPrimaries(N.colorSpace),Qe=N.colorSpace===bi||Ce===ke?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,N.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,N.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,N.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,Qe);const ct=C(N)&&S(N.image)===!1;let Pe=v(N.image,ct,!1,d);Pe=ce(N,Pe);const ut=S(Pe)||a,Je=r.convert(N.format,N.colorSpace);let qe=r.convert(N.type),tt=k(N.internalFormat,Je,qe,N.colorSpace,N.isVideoTexture);Z(ue,N,ut);let Fe;const pt=N.mipmaps,oe=a&&N.isVideoTexture!==!0&&tt!==ZO,Ke=Ae.__version===void 0||X===!0,Ue=x(N,Pe,ut);if(N.isDepthTexture)tt=t.DEPTH_COMPONENT,a?N.type===Ps?tt=t.DEPTH_COMPONENT32F:N.type===br?tt=t.DEPTH_COMPONENT24:N.type===oo?tt=t.DEPTH24_STENCIL8:tt=t.DEPTH_COMPONENT16:N.type===Ps&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),N.format===ao&&tt===t.DEPTH_COMPONENT&&N.type!==QE&&N.type!==br&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),N.type=br,qe=r.convert(N.type)),N.format===wa&&tt===t.DEPTH_COMPONENT&&(tt=t.DEPTH_STENCIL,N.type!==oo&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),N.type=oo,qe=r.convert(N.type))),Ke&&(oe?n.texStorage2D(t.TEXTURE_2D,1,tt,Pe.width,Pe.height):n.texImage2D(t.TEXTURE_2D,0,tt,Pe.width,Pe.height,0,Je,qe,null));else if(N.isDataTexture)if(pt.length>0&&ut){oe&&Ke&&n.texStorage2D(t.TEXTURE_2D,Ue,tt,pt[0].width,pt[0].height);for(let Oe=0,Be=pt.length;Oe>=1,Be>>=1}}else if(pt.length>0&&ut){oe&&Ke&&n.texStorage2D(t.TEXTURE_2D,Ue,tt,pt[0].width,pt[0].height);for(let Oe=0,Be=pt.length;Oe0&&Ke++,n.texStorage2D(t.TEXTURE_CUBE_MAP,Ke,Fe,Pe[0].width,Pe[0].height));for(let Oe=0;Oe<6;Oe++)if(ct){pt?n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Oe,0,0,0,Pe[Oe].width,Pe[Oe].height,qe,tt,Pe[Oe].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Oe,0,Fe,Pe[Oe].width,Pe[Oe].height,0,qe,tt,Pe[Oe].data);for(let Be=0;Be>ie),Pe=Math.max(1,N.height>>ie);X===t.TEXTURE_3D||X===t.TEXTURE_2D_ARRAY?n.texImage3D(X,ie,ke,ct,Pe,N.depth,0,Ae,Ce,null):n.texImage2D(X,ie,ke,ct,Pe,0,Ae,Ce,null)}n.bindFramebuffer(t.FRAMEBUFFER,M),pe(N)?f.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,ue,X,i.get(W).__webglTexture,0,z(N)):(X===t.TEXTURE_2D||X>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&X<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,ue,X,i.get(W).__webglTexture,ie),n.bindFramebuffer(t.FRAMEBUFFER,null)}function D(M,N,W){if(t.bindRenderbuffer(t.RENDERBUFFER,M),N.depthBuffer&&!N.stencilBuffer){let ue=a===!0?t.DEPTH_COMPONENT24:t.DEPTH_COMPONENT16;if(W||pe(N)){const X=N.depthTexture;X&&X.isDepthTexture&&(X.type===Ps?ue=t.DEPTH_COMPONENT32F:X.type===br&&(ue=t.DEPTH_COMPONENT24));const ie=z(N);pe(N)?f.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,ie,ue,N.width,N.height):t.renderbufferStorageMultisample(t.RENDERBUFFER,ie,ue,N.width,N.height)}else t.renderbufferStorage(t.RENDERBUFFER,ue,N.width,N.height);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,M)}else if(N.depthBuffer&&N.stencilBuffer){const ue=z(N);W&&pe(N)===!1?t.renderbufferStorageMultisample(t.RENDERBUFFER,ue,t.DEPTH24_STENCIL8,N.width,N.height):pe(N)?f.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,ue,t.DEPTH24_STENCIL8,N.width,N.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,N.width,N.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,M)}else{const ue=N.isWebGLMultipleRenderTargets===!0?N.texture:[N.texture];for(let X=0;X0){W.__webglFramebuffer[Ce]=[];for(let ke=0;ke0){W.__webglFramebuffer=[];for(let Ce=0;Ce0&&pe(M)===!1){const Ce=ie?N:[N];W.__webglMultisampledFramebuffer=t.createFramebuffer(),W.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,W.__webglMultisampledFramebuffer);for(let ke=0;ke0)for(let ke=0;ke0)for(let ke=0;ke0&&pe(M)===!1){const N=M.isWebGLMultipleRenderTargets?M.texture:[M.texture],W=M.width,ue=M.height;let X=t.COLOR_BUFFER_BIT;const ie=[],Ae=M.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Ce=i.get(M),ke=M.isWebGLMultipleRenderTargets===!0;if(ke)for(let Qe=0;Qe0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&N.__useRenderToTexture!==!1}function re(M){const N=o.render.frame;m.get(M)!==N&&(m.set(M,N),M.update())}function ce(M,N){const W=M.colorSpace,ue=M.format,X=M.type;return M.isCompressedTexture===!0||M.isVideoTexture===!0||M.format===ub||W!==On&&W!==bi&&(Gt.getTransfer(W)===Zt?a===!1?e.has("EXT_sRGB")===!0&&ue===gi?(M.format=ub,M.minFilter=jn,M.generateMipmaps=!1):N=iI.sRGBToLinear(N):(ue!==gi||X!==xr)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",W)),N}this.allocateTextureUnit=Q,this.resetTextureUnits=U,this.setTexture2D=j,this.setTexture2DArray=ae,this.setTexture3D=ve,this.setTextureCube=ee,this.rebindTextures=de,this.setupRenderTarget=le,this.updateRenderTargetMipmap=Re,this.updateMultisampleRenderTarget=Ie,this.setupDepthRenderbuffer=K,this.setupFrameBufferTexture=Le,this.useMultisampledRTT=pe}function LMt(t,e,n){const i=n.isWebGL2;function s(r,o=bi){let a;const l=Gt.getTransfer(o);if(r===xr)return t.UNSIGNED_BYTE;if(r===WO)return t.UNSIGNED_SHORT_4_4_4_4;if(r===KO)return t.UNSIGNED_SHORT_5_5_5_1;if(r===nRt)return t.BYTE;if(r===iRt)return t.SHORT;if(r===QE)return t.UNSIGNED_SHORT;if(r===$O)return t.INT;if(r===br)return t.UNSIGNED_INT;if(r===Ps)return t.FLOAT;if(r===rc)return i?t.HALF_FLOAT:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(r===sRt)return t.ALPHA;if(r===gi)return t.RGBA;if(r===rRt)return t.LUMINANCE;if(r===oRt)return t.LUMINANCE_ALPHA;if(r===ao)return t.DEPTH_COMPONENT;if(r===wa)return t.DEPTH_STENCIL;if(r===ub)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(r===aRt)return t.RED;if(r===jO)return t.RED_INTEGER;if(r===lRt)return t.RG;if(r===QO)return t.RG_INTEGER;if(r===XO)return t.RGBA_INTEGER;if(r===Pm||r===Um||r===Fm||r===Bm)if(l===Zt)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(r===Pm)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===Um)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===Fm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===Bm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(r===Pm)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===Um)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===Fm)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===Bm)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(r===jC||r===QC||r===XC||r===ZC)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(r===jC)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===QC)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===XC)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===ZC)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(r===ZO)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(r===JC||r===e1)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(r===JC)return l===Zt?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(r===e1)return l===Zt?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(r===t1||r===n1||r===i1||r===s1||r===r1||r===o1||r===a1||r===l1||r===c1||r===d1||r===u1||r===p1||r===_1||r===h1)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(r===t1)return l===Zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===n1)return l===Zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===i1)return l===Zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===s1)return l===Zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===r1)return l===Zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===o1)return l===Zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===a1)return l===Zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===l1)return l===Zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===c1)return l===Zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===d1)return l===Zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===u1)return l===Zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===p1)return l===Zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===_1)return l===Zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===h1)return l===Zt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(r===Gm||r===f1||r===m1)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(r===Gm)return l===Zt?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(r===f1)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(r===m1)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(r===cRt||r===g1||r===b1||r===E1)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(r===Gm)return a.COMPRESSED_RED_RGTC1_EXT;if(r===g1)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(r===b1)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(r===E1)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return r===oo?i?t.UNSIGNED_INT_24_8:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):t[r]!==void 0?t[r]:null}return{convert:s}}class PMt extends zn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class to extends rn{constructor(){super(),this.isGroup=!0,this.type="Group"}}const UMt={type:"move"};class dg{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new to,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 to,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new _e,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new _e),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new to,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new _e,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new _e),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 n=this._hand;if(n)for(const i of e.hand.values())this._getHandJoint(n,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,n,i){let s=null,r=null,o=null;const a=this._targetRay,l=this._grip,u=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(u&&e.hand){o=!0;for(const E of e.hand.values()){const b=n.getJointPose(E,i),g=this._getHandJoint(u,E);b!==null&&(g.matrix.fromArray(b.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,g.jointRadius=b.radius),g.visible=b!==null}const d=u.joints["index-finger-tip"],h=u.joints["thumb-tip"],f=d.position.distanceTo(h.position),_=.02,m=.005;u.inputState.pinching&&f>_+m?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&f<=_-m&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(r=n.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=n.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(UMt)))}return a!==null&&(a.visible=s!==null),l!==null&&(l.visible=r!==null),u!==null&&(u.visible=o!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const i=new to;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[n.jointName]=i,e.add(i)}return e.joints[n.jointName]}}class FMt extends Ka{constructor(e,n){super();const i=this;let s=null,r=1,o=null,a="local-floor",l=1,u=null,d=null,h=null,f=null,_=null,m=null;const E=n.getContextAttributes();let b=null,g=null;const y=[],v=[],S=new It;let C=null;const T=new zn;T.layers.enable(1),T.viewport=new Wt;const O=new zn;O.layers.enable(2),O.viewport=new Wt;const k=[T,O],x=new PMt;x.layers.enable(1),x.layers.enable(2);let I=null,F=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ee){let Ee=y[ee];return Ee===void 0&&(Ee=new dg,y[ee]=Ee),Ee.getTargetRaySpace()},this.getControllerGrip=function(ee){let Ee=y[ee];return Ee===void 0&&(Ee=new dg,y[ee]=Ee),Ee.getGripSpace()},this.getHand=function(ee){let Ee=y[ee];return Ee===void 0&&(Ee=new dg,y[ee]=Ee),Ee.getHandSpace()};function B(ee){const Ee=v.indexOf(ee.inputSource);if(Ee===-1)return;const xe=y[Ee];xe!==void 0&&(xe.update(ee.inputSource,ee.frame,u||o),xe.dispatchEvent({type:ee.type,data:ee.inputSource}))}function ne(){s.removeEventListener("select",B),s.removeEventListener("selectstart",B),s.removeEventListener("selectend",B),s.removeEventListener("squeeze",B),s.removeEventListener("squeezestart",B),s.removeEventListener("squeezeend",B),s.removeEventListener("end",ne),s.removeEventListener("inputsourceschange",L);for(let ee=0;ee=0&&(v[Me]=null,y[Me].disconnect(xe))}for(let Ee=0;Ee=v.length){v.push(xe),Me=ye;break}else if(v[ye]===null){v[ye]=xe,Me=ye;break}if(Me===-1)break}const Z=y[Me];Z&&Z.connect(xe)}}const $=new _e,H=new _e;function U(ee,Ee,xe){$.setFromMatrixPosition(Ee.matrixWorld),H.setFromMatrixPosition(xe.matrixWorld);const Me=$.distanceTo(H),Z=Ee.projectionMatrix.elements,ye=xe.projectionMatrix.elements,fe=Z[14]/(Z[10]-1),Ne=Z[14]/(Z[10]+1),Le=(Z[9]+1)/Z[5],D=(Z[9]-1)/Z[5],q=(Z[8]-1)/Z[0],K=(ye[8]+1)/ye[0],de=fe*q,le=fe*K,Re=Me/(-q+K),Ie=Re*-q;Ee.matrixWorld.decompose(ee.position,ee.quaternion,ee.scale),ee.translateX(Ie),ee.translateZ(Re),ee.matrixWorld.compose(ee.position,ee.quaternion,ee.scale),ee.matrixWorldInverse.copy(ee.matrixWorld).invert();const z=fe+Re,pe=Ne+Re,re=de-Ie,ce=le+(Me-Ie),M=Le*Ne/pe*z,N=D*Ne/pe*z;ee.projectionMatrix.makePerspective(re,ce,M,N,z,pe),ee.projectionMatrixInverse.copy(ee.projectionMatrix).invert()}function Q(ee,Ee){Ee===null?ee.matrixWorld.copy(ee.matrix):ee.matrixWorld.multiplyMatrices(Ee.matrixWorld,ee.matrix),ee.matrixWorldInverse.copy(ee.matrixWorld).invert()}this.updateCamera=function(ee){if(s===null)return;x.near=O.near=T.near=ee.near,x.far=O.far=T.far=ee.far,(I!==x.near||F!==x.far)&&(s.updateRenderState({depthNear:x.near,depthFar:x.far}),I=x.near,F=x.far);const Ee=ee.parent,xe=x.cameras;Q(x,Ee);for(let Me=0;Me0&&(b.alphaTest.value=g.alphaTest);const y=e.get(g).envMap;if(y&&(b.envMap.value=y,b.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,b.reflectivity.value=g.reflectivity,b.ior.value=g.ior,b.refractionRatio.value=g.refractionRatio),g.lightMap){b.lightMap.value=g.lightMap;const v=t._useLegacyLights===!0?Math.PI:1;b.lightMapIntensity.value=g.lightMapIntensity*v,n(g.lightMap,b.lightMapTransform)}g.aoMap&&(b.aoMap.value=g.aoMap,b.aoMapIntensity.value=g.aoMapIntensity,n(g.aoMap,b.aoMapTransform))}function o(b,g){b.diffuse.value.copy(g.color),b.opacity.value=g.opacity,g.map&&(b.map.value=g.map,n(g.map,b.mapTransform))}function a(b,g){b.dashSize.value=g.dashSize,b.totalSize.value=g.dashSize+g.gapSize,b.scale.value=g.scale}function l(b,g,y,v){b.diffuse.value.copy(g.color),b.opacity.value=g.opacity,b.size.value=g.size*y,b.scale.value=v*.5,g.map&&(b.map.value=g.map,n(g.map,b.uvTransform)),g.alphaMap&&(b.alphaMap.value=g.alphaMap,n(g.alphaMap,b.alphaMapTransform)),g.alphaTest>0&&(b.alphaTest.value=g.alphaTest)}function u(b,g){b.diffuse.value.copy(g.color),b.opacity.value=g.opacity,b.rotation.value=g.rotation,g.map&&(b.map.value=g.map,n(g.map,b.mapTransform)),g.alphaMap&&(b.alphaMap.value=g.alphaMap,n(g.alphaMap,b.alphaMapTransform)),g.alphaTest>0&&(b.alphaTest.value=g.alphaTest)}function d(b,g){b.specular.value.copy(g.specular),b.shininess.value=Math.max(g.shininess,1e-4)}function h(b,g){g.gradientMap&&(b.gradientMap.value=g.gradientMap)}function f(b,g){b.metalness.value=g.metalness,g.metalnessMap&&(b.metalnessMap.value=g.metalnessMap,n(g.metalnessMap,b.metalnessMapTransform)),b.roughness.value=g.roughness,g.roughnessMap&&(b.roughnessMap.value=g.roughnessMap,n(g.roughnessMap,b.roughnessMapTransform)),e.get(g).envMap&&(b.envMapIntensity.value=g.envMapIntensity)}function _(b,g,y){b.ior.value=g.ior,g.sheen>0&&(b.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),b.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(b.sheenColorMap.value=g.sheenColorMap,n(g.sheenColorMap,b.sheenColorMapTransform)),g.sheenRoughnessMap&&(b.sheenRoughnessMap.value=g.sheenRoughnessMap,n(g.sheenRoughnessMap,b.sheenRoughnessMapTransform))),g.clearcoat>0&&(b.clearcoat.value=g.clearcoat,b.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(b.clearcoatMap.value=g.clearcoatMap,n(g.clearcoatMap,b.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(b.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,n(g.clearcoatRoughnessMap,b.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(b.clearcoatNormalMap.value=g.clearcoatNormalMap,n(g.clearcoatNormalMap,b.clearcoatNormalMapTransform),b.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===Zn&&b.clearcoatNormalScale.value.negate())),g.iridescence>0&&(b.iridescence.value=g.iridescence,b.iridescenceIOR.value=g.iridescenceIOR,b.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],b.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(b.iridescenceMap.value=g.iridescenceMap,n(g.iridescenceMap,b.iridescenceMapTransform)),g.iridescenceThicknessMap&&(b.iridescenceThicknessMap.value=g.iridescenceThicknessMap,n(g.iridescenceThicknessMap,b.iridescenceThicknessMapTransform))),g.transmission>0&&(b.transmission.value=g.transmission,b.transmissionSamplerMap.value=y.texture,b.transmissionSamplerSize.value.set(y.width,y.height),g.transmissionMap&&(b.transmissionMap.value=g.transmissionMap,n(g.transmissionMap,b.transmissionMapTransform)),b.thickness.value=g.thickness,g.thicknessMap&&(b.thicknessMap.value=g.thicknessMap,n(g.thicknessMap,b.thicknessMapTransform)),b.attenuationDistance.value=g.attenuationDistance,b.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(b.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(b.anisotropyMap.value=g.anisotropyMap,n(g.anisotropyMap,b.anisotropyMapTransform))),b.specularIntensity.value=g.specularIntensity,b.specularColor.value.copy(g.specularColor),g.specularColorMap&&(b.specularColorMap.value=g.specularColorMap,n(g.specularColorMap,b.specularColorMapTransform)),g.specularIntensityMap&&(b.specularIntensityMap.value=g.specularIntensityMap,n(g.specularIntensityMap,b.specularIntensityMapTransform))}function m(b,g){g.matcap&&(b.matcap.value=g.matcap)}function E(b,g){const y=e.get(g).light;b.referencePosition.value.setFromMatrixPosition(y.matrixWorld),b.nearDistance.value=y.shadow.camera.near,b.farDistance.value=y.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:s}}function GMt(t,e,n,i){let s={},r={},o=[];const a=n.isWebGL2?t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(y,v){const S=v.program;i.uniformBlockBinding(y,S)}function u(y,v){let S=s[y.id];S===void 0&&(m(y),S=d(y),s[y.id]=S,y.addEventListener("dispose",b));const C=v.program;i.updateUBOMapping(y,C);const T=e.render.frame;r[y.id]!==T&&(f(y),r[y.id]=T)}function d(y){const v=h();y.__bindingPointIndex=v;const S=t.createBuffer(),C=y.__size,T=y.usage;return t.bindBuffer(t.UNIFORM_BUFFER,S),t.bufferData(t.UNIFORM_BUFFER,C,T),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,v,S),S}function h(){for(let y=0;y0){T=S%C;const B=C-T;T!==0&&B-I.boundary<0&&(S+=C-T,x.__offset=S)}S+=I.storage}return T=S%C,T>0&&(S+=C-T),y.__size=S,y.__cache={},this}function E(y){const v={boundary:0,storage:0};return typeof y=="number"?(v.boundary=4,v.storage=4):y.isVector2?(v.boundary=8,v.storage=8):y.isVector3||y.isColor?(v.boundary=16,v.storage=12):y.isVector4?(v.boundary=16,v.storage=16):y.isMatrix3?(v.boundary=48,v.storage=48):y.isMatrix4?(v.boundary=64,v.storage=64):y.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",y),v}function b(y){const v=y.target;v.removeEventListener("dispose",b);const S=o.indexOf(v.__bindingPointIndex);o.splice(S,1),t.deleteBuffer(s[v.id]),delete s[v.id],delete r[v.id]}function g(){for(const y in s)t.deleteBuffer(s[y]);o=[],s={},r={}}return{bind:l,update:u,dispose:g}}class yI{constructor(e={}){const{canvas:n=URt(),context:i=null,depth:s=!0,stencil:r=!0,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:u=!1,powerPreference:d="default",failIfMajorPerformanceCaveat:h=!1}=e;this.isWebGLRenderer=!0;let f;i!==null?f=i.getContextAttributes().alpha:f=o;const _=new Uint32Array(4),m=new Int32Array(4);let E=null,b=null;const g=[],y=[];this.domElement=n,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=on,this._useLegacyLights=!1,this.toneMapping=Tr,this.toneMappingExposure=1;const v=this;let S=!1,C=0,T=0,O=null,k=-1,x=null;const I=new Wt,F=new Wt;let B=null;const ne=new gt(0);let L=0,$=n.width,H=n.height,U=1,Q=null,J=null;const j=new Wt(0,0,$,H),ae=new Wt(0,0,$,H);let ve=!1;const ee=new ey;let Ee=!1,xe=!1,Me=null;const Z=new Rt,ye=new It,fe=new _e,Ne={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Le(){return O===null?U:1}let D=i;function q(R,Y){for(let te=0;te{function Ve(){if(ge.forEach(function(Xe){Ie.get(Xe).currentProgram.isReady()&&ge.delete(Xe)}),ge.size===0){me(R);return}setTimeout(Ve,10)}K.get("KHR_parallel_shader_compile")!==null?Ve():setTimeout(Ve,10)})};let Et=null;function Qt(R){Et&&Et(R)}function cn(){$t.stop()}function Ct(){$t.start()}const $t=new _I;$t.setAnimationLoop(Qt),typeof self<"u"&&$t.setContext(self),this.setAnimationLoop=function(R){Et=R,Fe.setAnimationLoop(R),R===null?$t.stop():$t.start()},Fe.addEventListener("sessionstart",cn),Fe.addEventListener("sessionend",Ct),this.render=function(R,Y){if(Y!==void 0&&Y.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(S===!0)return;R.matrixWorldAutoUpdate===!0&&R.updateMatrixWorld(),Y.parent===null&&Y.matrixWorldAutoUpdate===!0&&Y.updateMatrixWorld(),Fe.enabled===!0&&Fe.isPresenting===!0&&(Fe.cameraAutoUpdate===!0&&Fe.updateCamera(Y),Y=Fe.getCamera()),R.isScene===!0&&R.onBeforeRender(v,R,Y,O),b=ie.get(R,y.length),b.init(),y.push(b),Z.multiplyMatrices(Y.projectionMatrix,Y.matrixWorldInverse),ee.setFromProjectionMatrix(Z),xe=this.localClippingEnabled,Ee=Ae.init(this.clippingPlanes,xe),E=X.get(R,g.length),E.init(),g.push(E),Sn(R,Y,0,v.sortObjects),E.finish(),v.sortObjects===!0&&E.sort(Q,J),this.info.render.frame++,Ee===!0&&Ae.beginShadows();const te=b.state.shadowsArray;if(Ce.render(te,R,Y),Ee===!0&&Ae.endShadows(),this.info.autoReset===!0&&this.info.reset(),ke.render(E,R),b.setupLights(v._useLegacyLights),Y.isArrayCamera){const ge=Y.cameras;for(let me=0,Ve=ge.length;me0?b=y[y.length-1]:b=null,g.pop(),g.length>0?E=g[g.length-1]:E=null};function Sn(R,Y,te,ge){if(R.visible===!1)return;if(R.layers.test(Y.layers)){if(R.isGroup)te=R.renderOrder;else if(R.isLOD)R.autoUpdate===!0&&R.update(Y);else if(R.isLight)b.pushLight(R),R.castShadow&&b.pushShadow(R);else if(R.isSprite){if(!R.frustumCulled||ee.intersectsSprite(R)){ge&&fe.setFromMatrixPosition(R.matrixWorld).applyMatrix4(Z);const Xe=N.update(R),it=R.material;it.visible&&E.push(R,Xe,it,te,fe.z,null)}}else if((R.isMesh||R.isLine||R.isPoints)&&(!R.frustumCulled||ee.intersectsObject(R))){const Xe=N.update(R),it=R.material;if(ge&&(R.boundingSphere!==void 0?(R.boundingSphere===null&&R.computeBoundingSphere(),fe.copy(R.boundingSphere.center)):(Xe.boundingSphere===null&&Xe.computeBoundingSphere(),fe.copy(Xe.boundingSphere.center)),fe.applyMatrix4(R.matrixWorld).applyMatrix4(Z)),Array.isArray(it)){const at=Xe.groups;for(let rt=0,_t=at.length;rt<_t;rt++){const ht=at[rt],Kt=it[ht.materialIndex];Kt&&Kt.visible&&E.push(R,Xe,Kt,te,fe.z,ht)}}else it.visible&&E.push(R,Xe,it,te,fe.z,null)}}const Ve=R.children;for(let Xe=0,it=Ve.length;Xe0&&Mr(me,Ve,Y,te),ge&&le.viewport(I.copy(ge)),me.length>0&&ci(me,Y,te),Ve.length>0&&ci(Ve,Y,te),Xe.length>0&&ci(Xe,Y,te),le.buffers.depth.setTest(!0),le.buffers.depth.setMask(!0),le.buffers.color.setMask(!0),le.setPolygonOffset(!1)}function Mr(R,Y,te,ge){if((te.isScene===!0?te.overrideMaterial:null)!==null)return;const Ve=de.isWebGL2;Me===null&&(Me=new mo(1,1,{generateMipmaps:!0,type:K.has("EXT_color_buffer_half_float")?rc:xr,minFilter:fo,samples:Ve?4:0})),v.getDrawingBufferSize(ye),Ve?Me.setSize(ye.x,ye.y):Me.setSize(Eu(ye.x),Eu(ye.y));const Xe=v.getRenderTarget();v.setRenderTarget(Me),v.getClearColor(ne),L=v.getClearAlpha(),L<1&&v.setClearColor(16777215,.5),v.clear();const it=v.toneMapping;v.toneMapping=Tr,ci(R,te,ge),z.updateMultisampleRenderTarget(Me),z.updateRenderTargetMipmap(Me);let at=!1;for(let rt=0,_t=Y.length;rt<_t;rt++){const ht=Y[rt],Kt=ht.object,xn=ht.geometry,sn=ht.material,In=ht.group;if(sn.side===es&&Kt.layers.test(ge.layers)){const Xt=sn.side;sn.side=Zn,sn.needsUpdate=!0,Tn(Kt,te,ge,xn,sn,In),sn.side=Xt,sn.needsUpdate=!0,at=!0}}at===!0&&(z.updateMultisampleRenderTarget(Me),z.updateRenderTargetMipmap(Me)),v.setRenderTarget(Xe),v.setClearColor(ne,L),v.toneMapping=it}function ci(R,Y,te){const ge=Y.isScene===!0?Y.overrideMaterial:null;for(let me=0,Ve=R.length;me0),ht=!!te.morphAttributes.position,Kt=!!te.morphAttributes.normal,xn=!!te.morphAttributes.color;let sn=Tr;ge.toneMapped&&(O===null||O.isXRRenderTarget===!0)&&(sn=v.toneMapping);const In=te.morphAttributes.position||te.morphAttributes.normal||te.morphAttributes.color,Xt=In!==void 0?In.length:0,St=Ie.get(ge),el=b.state.lights;if(Ee===!0&&(xe===!0||R!==x)){const Wn=R===x&&ge.id===k;Ae.setState(ge,R,Wn)}let tn=!1;ge.version===St.__version?(St.needsLights&&St.lightsStateVersion!==el.state.version||St.outputColorSpace!==it||me.isBatchedMesh&&St.batching===!1||!me.isBatchedMesh&&St.batching===!0||me.isInstancedMesh&&St.instancing===!1||!me.isInstancedMesh&&St.instancing===!0||me.isSkinnedMesh&&St.skinning===!1||!me.isSkinnedMesh&&St.skinning===!0||me.isInstancedMesh&&St.instancingColor===!0&&me.instanceColor===null||me.isInstancedMesh&&St.instancingColor===!1&&me.instanceColor!==null||St.envMap!==at||ge.fog===!0&&St.fog!==Ve||St.numClippingPlanes!==void 0&&(St.numClippingPlanes!==Ae.numPlanes||St.numIntersection!==Ae.numIntersection)||St.vertexAlphas!==rt||St.vertexTangents!==_t||St.morphTargets!==ht||St.morphNormals!==Kt||St.morphColors!==xn||St.toneMapping!==sn||de.isWebGL2===!0&&St.morphTargetsCount!==Xt)&&(tn=!0):(tn=!0,St.__version=ge.version);let Ss=St.currentProgram;tn===!0&&(Ss=di(ge,Y,me));let xc=!1,Dr=!1,tl=!1;const bn=Ss.getUniforms(),Ts=St.uniforms;if(le.useProgram(Ss.program)&&(xc=!0,Dr=!0,tl=!0),ge.id!==k&&(k=ge.id,Dr=!0),xc||x!==R){bn.setValue(D,"projectionMatrix",R.projectionMatrix),bn.setValue(D,"viewMatrix",R.matrixWorldInverse);const Wn=bn.map.cameraPosition;Wn!==void 0&&Wn.setValue(D,fe.setFromMatrixPosition(R.matrixWorld)),de.logarithmicDepthBuffer&&bn.setValue(D,"logDepthBufFC",2/(Math.log(R.far+1)/Math.LN2)),(ge.isMeshPhongMaterial||ge.isMeshToonMaterial||ge.isMeshLambertMaterial||ge.isMeshBasicMaterial||ge.isMeshStandardMaterial||ge.isShaderMaterial)&&bn.setValue(D,"isOrthographic",R.isOrthographicCamera===!0),x!==R&&(x=R,Dr=!0,tl=!0)}if(me.isSkinnedMesh){bn.setOptional(D,me,"bindMatrix"),bn.setOptional(D,me,"bindMatrixInverse");const Wn=me.skeleton;Wn&&(de.floatVertexTextures?(Wn.boneTexture===null&&Wn.computeBoneTexture(),bn.setValue(D,"boneTexture",Wn.boneTexture,z)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}me.isBatchedMesh&&(bn.setOptional(D,me,"batchingTexture"),bn.setValue(D,"batchingTexture",me._matricesTexture,z));const nl=te.morphAttributes;if((nl.position!==void 0||nl.normal!==void 0||nl.color!==void 0&&de.isWebGL2===!0)&&Qe.update(me,te,Ss),(Dr||St.receiveShadow!==me.receiveShadow)&&(St.receiveShadow=me.receiveShadow,bn.setValue(D,"receiveShadow",me.receiveShadow)),ge.isMeshGouraudMaterial&&ge.envMap!==null&&(Ts.envMap.value=at,Ts.flipEnvMap.value=at.isCubeTexture&&at.isRenderTargetTexture===!1?-1:1),Dr&&(bn.setValue(D,"toneMappingExposure",v.toneMappingExposure),St.needsLights&&vs(Ts,tl),Ve&&ge.fog===!0&&ue.refreshFogUniforms(Ts,Ve),ue.refreshMaterialUniforms(Ts,ge,U,H,Me),Gd.upload(D,ji(St),Ts,z)),ge.isShaderMaterial&&ge.uniformsNeedUpdate===!0&&(Gd.upload(D,ji(St),Ts,z),ge.uniformsNeedUpdate=!1),ge.isSpriteMaterial&&bn.setValue(D,"center",me.center),bn.setValue(D,"modelViewMatrix",me.modelViewMatrix),bn.setValue(D,"normalMatrix",me.normalMatrix),bn.setValue(D,"modelMatrix",me.matrixWorld),ge.isShaderMaterial||ge.isRawShaderMaterial){const Wn=ge.uniformsGroups;for(let il=0,mp=Wn.length;il0&&z.useMultisampledRTT(R)===!1?me=Ie.get(R).__webglMultisampledFramebuffer:Array.isArray(_t)?me=_t[te]:me=_t,I.copy(R.viewport),F.copy(R.scissor),B=R.scissorTest}else I.copy(j).multiplyScalar(U).floor(),F.copy(ae).multiplyScalar(U).floor(),B=ve;if(le.bindFramebuffer(D.FRAMEBUFFER,me)&&de.drawBuffers&&ge&&le.drawBuffers(R,me),le.viewport(I),le.scissor(F),le.setScissorTest(B),Ve){const at=Ie.get(R.texture);D.framebufferTexture2D(D.FRAMEBUFFER,D.COLOR_ATTACHMENT0,D.TEXTURE_CUBE_MAP_POSITIVE_X+Y,at.__webglTexture,te)}else if(Xe){const at=Ie.get(R.texture),rt=Y||0;D.framebufferTextureLayer(D.FRAMEBUFFER,D.COLOR_ATTACHMENT0,at.__webglTexture,te||0,rt)}k=-1},this.readRenderTargetPixels=function(R,Y,te,ge,me,Ve,Xe){if(!(R&&R.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let it=Ie.get(R).__webglFramebuffer;if(R.isWebGLCubeRenderTarget&&Xe!==void 0&&(it=it[Xe]),it){le.bindFramebuffer(D.FRAMEBUFFER,it);try{const at=R.texture,rt=at.format,_t=at.type;if(rt!==gi&&ut.convert(rt)!==D.getParameter(D.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const ht=_t===rc&&(K.has("EXT_color_buffer_half_float")||de.isWebGL2&&K.has("EXT_color_buffer_float"));if(_t!==xr&&ut.convert(_t)!==D.getParameter(D.IMPLEMENTATION_COLOR_READ_TYPE)&&!(_t===Ps&&(de.isWebGL2||K.has("OES_texture_float")||K.has("WEBGL_color_buffer_float")))&&!ht){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Y>=0&&Y<=R.width-ge&&te>=0&&te<=R.height-me&&D.readPixels(Y,te,ge,me,ut.convert(rt),ut.convert(_t),Ve)}finally{const at=O!==null?Ie.get(O).__webglFramebuffer:null;le.bindFramebuffer(D.FRAMEBUFFER,at)}}},this.copyFramebufferToTexture=function(R,Y,te=0){const ge=Math.pow(2,-te),me=Math.floor(Y.image.width*ge),Ve=Math.floor(Y.image.height*ge);z.setTexture2D(Y,0),D.copyTexSubImage2D(D.TEXTURE_2D,te,0,0,R.x,R.y,me,Ve),le.unbindTexture()},this.copyTextureToTexture=function(R,Y,te,ge=0){const me=Y.image.width,Ve=Y.image.height,Xe=ut.convert(te.format),it=ut.convert(te.type);z.setTexture2D(te,0),D.pixelStorei(D.UNPACK_FLIP_Y_WEBGL,te.flipY),D.pixelStorei(D.UNPACK_PREMULTIPLY_ALPHA_WEBGL,te.premultiplyAlpha),D.pixelStorei(D.UNPACK_ALIGNMENT,te.unpackAlignment),Y.isDataTexture?D.texSubImage2D(D.TEXTURE_2D,ge,R.x,R.y,me,Ve,Xe,it,Y.image.data):Y.isCompressedTexture?D.compressedTexSubImage2D(D.TEXTURE_2D,ge,R.x,R.y,Y.mipmaps[0].width,Y.mipmaps[0].height,Xe,Y.mipmaps[0].data):D.texSubImage2D(D.TEXTURE_2D,ge,R.x,R.y,Xe,it,Y.image),ge===0&&te.generateMipmaps&&D.generateMipmap(D.TEXTURE_2D),le.unbindTexture()},this.copyTextureToTexture3D=function(R,Y,te,ge,me=0){if(v.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Ve=R.max.x-R.min.x+1,Xe=R.max.y-R.min.y+1,it=R.max.z-R.min.z+1,at=ut.convert(ge.format),rt=ut.convert(ge.type);let _t;if(ge.isData3DTexture)z.setTexture3D(ge,0),_t=D.TEXTURE_3D;else if(ge.isDataArrayTexture)z.setTexture2DArray(ge,0),_t=D.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}D.pixelStorei(D.UNPACK_FLIP_Y_WEBGL,ge.flipY),D.pixelStorei(D.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ge.premultiplyAlpha),D.pixelStorei(D.UNPACK_ALIGNMENT,ge.unpackAlignment);const ht=D.getParameter(D.UNPACK_ROW_LENGTH),Kt=D.getParameter(D.UNPACK_IMAGE_HEIGHT),xn=D.getParameter(D.UNPACK_SKIP_PIXELS),sn=D.getParameter(D.UNPACK_SKIP_ROWS),In=D.getParameter(D.UNPACK_SKIP_IMAGES),Xt=te.isCompressedTexture?te.mipmaps[0]:te.image;D.pixelStorei(D.UNPACK_ROW_LENGTH,Xt.width),D.pixelStorei(D.UNPACK_IMAGE_HEIGHT,Xt.height),D.pixelStorei(D.UNPACK_SKIP_PIXELS,R.min.x),D.pixelStorei(D.UNPACK_SKIP_ROWS,R.min.y),D.pixelStorei(D.UNPACK_SKIP_IMAGES,R.min.z),te.isDataTexture||te.isData3DTexture?D.texSubImage3D(_t,me,Y.x,Y.y,Y.z,Ve,Xe,it,at,rt,Xt.data):te.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),D.compressedTexSubImage3D(_t,me,Y.x,Y.y,Y.z,Ve,Xe,it,at,Xt.data)):D.texSubImage3D(_t,me,Y.x,Y.y,Y.z,Ve,Xe,it,at,rt,Xt),D.pixelStorei(D.UNPACK_ROW_LENGTH,ht),D.pixelStorei(D.UNPACK_IMAGE_HEIGHT,Kt),D.pixelStorei(D.UNPACK_SKIP_PIXELS,xn),D.pixelStorei(D.UNPACK_SKIP_ROWS,sn),D.pixelStorei(D.UNPACK_SKIP_IMAGES,In),me===0&&ge.generateMipmaps&&D.generateMipmap(_t),le.unbindTexture()},this.initTexture=function(R){R.isCubeTexture?z.setTextureCube(R,0):R.isData3DTexture?z.setTexture3D(R,0):R.isDataArrayTexture||R.isCompressedArrayTexture?z.setTexture2DArray(R,0):z.setTexture2D(R,0),le.unbindTexture()},this.resetState=function(){C=0,T=0,O=null,le.reset(),Je.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Us}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const n=this.getContext();n.drawingBufferColorSpace=e===ZE?"display-p3":"srgb",n.unpackColorSpace=Gt.workingColorSpace===cp?"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===on?lo:eI}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===lo?on:On}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 VMt extends yI{}VMt.prototype.isWebGL1Renderer=!0;class zMt extends rn{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,n){return super.copy(e,n),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 n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n}}class HMt{constructor(e,n){this.isInterleavedBuffer=!0,this.array=e,this.stride=n,this.count=e!==void 0?e.length/n:0,this.usage=db,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=zi()}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,n){this.updateRanges.push({start:e,count:n})}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,n,i){e*=this.stride,i*=n.stride;for(let s=0,r=this.stride;sl)continue;f.applyMatrix4(this.matrixWorld);const k=e.ray.origin.distanceTo(f);ke.far||n.push({distance:k,point:h.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}else{const g=Math.max(0,o.start),y=Math.min(b.count,o.start+o.count);for(let v=g,S=y-1;vl)continue;f.applyMatrix4(this.matrixWorld);const T=e.ray.origin.distanceTo(f);Te.far||n.push({distance:T,point:h.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const n=this.geometry.morphAttributes,i=Object.keys(n);if(i.length>0){const s=n[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;r0){const s=n[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;rs.far)return;r.push({distance:u,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}class ay extends Hi{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new gt(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 gt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=XE,this.normalScale=new It(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 Qs extends ay{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 It(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Ln(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(n){this.ior=(1+.4*n)/(1-.4*n)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new gt(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 gt(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new gt(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 Cw extends Hi{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new gt(16777215),this.specular=new gt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new gt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=XE,this.normalScale=new It(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=jE,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 Td(t,e,n){return!t||!n&&t.constructor===e?t:typeof e.BYTES_PER_ELEMENT=="number"?new e(t):Array.prototype.slice.call(t)}function JMt(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function e2t(t){function e(s,r){return t[s]-t[r]}const n=t.length,i=new Array(n);for(let s=0;s!==n;++s)i[s]=s;return i.sort(e),i}function ww(t,e,n){const i=t.length,s=new t.constructor(i);for(let r=0,o=0;o!==i;++r){const a=n[r]*e;for(let l=0;l!==e;++l)s[o++]=t[a+l]}return s}function xI(t,e,n,i){let s=1,r=t[0];for(;r!==void 0&&r[i]===void 0;)r=t[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),n.push.apply(n,o)),r=t[s++];while(r!==void 0);else if(o.toArray!==void 0)do o=r[i],o!==void 0&&(e.push(r.time),o.toArray(n,n.length)),r=t[s++];while(r!==void 0);else do o=r[i],o!==void 0&&(e.push(r.time),n.push(o)),r=t[s++];while(r!==void 0)}class vc{constructor(e,n,i,s){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=s!==void 0?s:new n.constructor(i),this.sampleValues=n,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){const n=this.parameterPositions;let i=this._cachedIndex,s=n[i],r=n[i-1];e:{t:{let o;n:{i:if(!(e=r)){const a=n[1];e=r)break t}o=i,i=0;break n}break e}for(;i>>1;en;)--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 n=this.getValueSize();n-Math.floor(n)!==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&&JMt(s))for(let a=0,l=s.length;a!==l;++a){const u=s[a];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,u),e=!1;break}}return e}optimize(){const e=this.times.slice(),n=this.values.slice(),i=this.getValueSize(),s=this.getInterpolation()===Vm,r=e.length-1;let o=1;for(let a=1;a0){e[o]=e[r];for(let a=r*i,l=o*i,u=0;u!==i;++u)n[l+u]=n[a+u];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=n.slice(0,o*i)):(this.times=e,this.values=n),this}clone(){const e=this.times.slice(),n=this.values.slice(),i=this.constructor,s=new i(this.name,e,n);return s.createInterpolant=this.createInterpolant,s}}gs.prototype.TimeBufferType=Float32Array;gs.prototype.ValueBufferType=Float32Array;gs.prototype.DefaultInterpolation=Ra;class Qa extends gs{}Qa.prototype.ValueTypeName="bool";Qa.prototype.ValueBufferType=Array;Qa.prototype.DefaultInterpolation=oc;Qa.prototype.InterpolantFactoryMethodLinear=void 0;Qa.prototype.InterpolantFactoryMethodSmooth=void 0;class CI extends gs{}CI.prototype.ValueTypeName="color";class Oa extends gs{}Oa.prototype.ValueTypeName="number";class s2t extends vc{constructor(e,n,i,s){super(e,n,i,s)}interpolate_(e,n,i,s){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-n)/(s-n);let u=e*a;for(let d=u+a;u!==d;u+=4)Ir.slerpFlat(r,0,o,u-a,o,u,l);return r}}class bo extends gs{InterpolantFactoryMethodLinear(e){return new s2t(this.times,this.values,this.getValueSize(),e)}}bo.prototype.ValueTypeName="quaternion";bo.prototype.DefaultInterpolation=Ra;bo.prototype.InterpolantFactoryMethodSmooth=void 0;class Xa extends gs{}Xa.prototype.ValueTypeName="string";Xa.prototype.ValueBufferType=Array;Xa.prototype.DefaultInterpolation=oc;Xa.prototype.InterpolantFactoryMethodLinear=void 0;Xa.prototype.InterpolantFactoryMethodSmooth=void 0;class Ia extends gs{}Ia.prototype.ValueTypeName="vector";class r2t{constructor(e,n=-1,i,s=dRt){this.name=e,this.tracks=i,this.duration=n,this.blendMode=s,this.uuid=zi(),this.duration<0&&this.resetDuration()}static parse(e){const n=[],i=e.tracks,s=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)n.push(a2t(i[o]).scale(s));const r=new this(e.name,e.duration,n,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){const n=[],i=e.tracks,s={name:e.name,duration:e.duration,tracks:n,uuid:e.uuid,blendMode:e.blendMode};for(let r=0,o=i.length;r!==o;++r)n.push(gs.toJSON(i[r]));return s}static CreateFromMorphTargetSequence(e,n,i,s){const r=n.length,o=[];for(let a=0;a1){const h=d[1];let f=s[h];f||(s[h]=f=[]),f.push(u)}}const o=[];for(const a in s)o.push(this.CreateFromMorphTargetSequence(a,s[a],n,i));return o}static parseAnimation(e,n){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(h,f,_,m,E){if(_.length!==0){const b=[],g=[];xI(_,b,g,m),b.length!==0&&E.push(new h(f,b,g))}},s=[],r=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const u=e.hierarchy||[];for(let h=0;h{n&&n(r),this.manager.itemEnd(e)},0),r;if(Os[e]!==void 0){Os[e].push({onLoad:n,onProgress:i,onError:s});return}Os[e]=[],Os[e].push({onLoad:n,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(u=>{if(u.status===200||u.status===0){if(u.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||u.body===void 0||u.body.getReader===void 0)return u;const d=Os[e],h=u.body.getReader(),f=u.headers.get("Content-Length")||u.headers.get("X-File-Size"),_=f?parseInt(f):0,m=_!==0;let E=0;const b=new ReadableStream({start(g){y();function y(){h.read().then(({done:v,value:S})=>{if(v)g.close();else{E+=S.byteLength;const C=new ProgressEvent("progress",{lengthComputable:m,loaded:E,total:_});for(let T=0,O=d.length;T{switch(l){case"arraybuffer":return u.arrayBuffer();case"blob":return u.blob();case"document":return u.text().then(d=>new DOMParser().parseFromString(d,a));case"json":return u.json();default:if(a===void 0)return u.text();{const h=/charset="?([^;"\s]*)"?/i.exec(a),f=h&&h[1]?h[1].toLowerCase():void 0,_=new TextDecoder(f);return u.arrayBuffer().then(m=>_.decode(m))}}}).then(u=>{Ma.add(e,u);const d=Os[e];delete Os[e];for(let h=0,f=d.length;h{const d=Os[e];if(d===void 0)throw this.manager.itemError(e),u;delete Os[e];for(let h=0,f=d.length;h{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class u2t extends Za{constructor(e){super(e)}load(e,n,i,s){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=Ma.get(e);if(o!==void 0)return r.manager.itemStart(e),setTimeout(function(){n&&n(o),r.manager.itemEnd(e)},0),o;const a=ac("img");function l(){d(),Ma.add(e,this),n&&n(this),r.manager.itemEnd(e)}function u(h){d(),s&&s(h),r.manager.itemError(e),r.manager.itemEnd(e)}function d(){a.removeEventListener("load",l,!1),a.removeEventListener("error",u,!1)}return a.addEventListener("load",l,!1),a.addEventListener("error",u,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),r.manager.itemStart(e),a.src=e,a}}class RI extends Za{constructor(e){super(e)}load(e,n,i,s){const r=new Nn,o=new u2t(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(a){r.image=a,r.needsUpdate=!0,n!==void 0&&n(r)},i,s),r}}class _p extends rn{constructor(e,n=1){super(),this.isLight=!0,this.type="Light",this.color=new gt(e),this.intensity=n}dispose(){}copy(e,n){return super.copy(e,n),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const n=super.toJSON(e);return n.object.color=this.color.getHex(),n.object.intensity=this.intensity,this.groundColor!==void 0&&(n.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(n.object.distance=this.distance),this.angle!==void 0&&(n.object.angle=this.angle),this.decay!==void 0&&(n.object.decay=this.decay),this.penumbra!==void 0&&(n.object.penumbra=this.penumbra),this.shadow!==void 0&&(n.object.shadow=this.shadow.toJSON()),n}}const hg=new Rt,Rw=new _e,Aw=new _e;class ly{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new It(512,512),this.map=null,this.mapPass=null,this.matrix=new Rt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new ey,this._frameExtents=new It(1,1),this._viewportCount=1,this._viewports=[new Wt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const n=this.camera,i=this.matrix;Rw.setFromMatrixPosition(e.matrixWorld),n.position.copy(Rw),Aw.setFromMatrixPosition(e.target.matrixWorld),n.lookAt(Aw),n.updateMatrixWorld(),hg.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(hg),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(hg)}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 p2t extends ly{constructor(){super(new zn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const n=this.camera,i=Aa*2*e.angle*this.focus,s=this.mapSize.width/this.mapSize.height,r=e.distance||n.far;(i!==n.fov||s!==n.aspect||r!==n.far)&&(n.fov=i,n.aspect=s,n.far=r,n.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class _2t extends _p{constructor(e,n,i=0,s=Math.PI/3,r=0,o=2){super(e,n),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(rn.DEFAULT_UP),this.updateMatrix(),this.target=new rn,this.distance=i,this.angle=s,this.penumbra=r,this.decay=o,this.map=null,this.shadow=new p2t}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,n){return super.copy(e,n),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 Nw=new Rt,vl=new _e,fg=new _e;class h2t extends ly{constructor(){super(new zn(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new It(4,2),this._viewportCount=6,this._viewports=[new Wt(2,1,1,1),new Wt(0,1,1,1),new Wt(3,1,1,1),new Wt(1,1,1,1),new Wt(3,0,1,1),new Wt(1,0,1,1)],this._cubeDirections=[new _e(1,0,0),new _e(-1,0,0),new _e(0,0,1),new _e(0,0,-1),new _e(0,1,0),new _e(0,-1,0)],this._cubeUps=[new _e(0,1,0),new _e(0,1,0),new _e(0,1,0),new _e(0,1,0),new _e(0,0,1),new _e(0,0,-1)]}updateMatrices(e,n=0){const i=this.camera,s=this.matrix,r=e.distance||i.far;r!==i.far&&(i.far=r,i.updateProjectionMatrix()),vl.setFromMatrixPosition(e.matrixWorld),i.position.copy(vl),fg.copy(i.position),fg.add(this._cubeDirections[n]),i.up.copy(this._cubeUps[n]),i.lookAt(fg),i.updateMatrixWorld(),s.makeTranslation(-vl.x,-vl.y,-vl.z),Nw.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Nw)}}class f2t extends _p{constructor(e,n,i=0,s=2){super(e,n),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=s,this.shadow=new h2t}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class m2t extends ly{constructor(){super(new ny(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class AI extends _p{constructor(e,n){super(e,n),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(rn.DEFAULT_UP),this.updateMatrix(),this.target=new rn,this.shadow=new m2t}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class g2t extends _p{constructor(e,n){super(e,n),this.isAmbientLight=!0,this.type="AmbientLight"}}class Gl{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let n="";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,n,i,s){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=Ma.get(e);if(o!==void 0)return r.manager.itemStart(e),setTimeout(function(){n&&n(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){Ma.add(e,l),n&&n(l),r.manager.itemEnd(e)}).catch(function(l){s&&s(l),r.manager.itemError(e),r.manager.itemEnd(e)}),r.manager.itemStart(e)}}const cy="\\[\\]\\.:\\/",E2t=new RegExp("["+cy+"]","g"),dy="[^"+cy+"]",y2t="[^"+cy.replace("\\.","")+"]",v2t=/((?:WC+[\/:])*)/.source.replace("WC",dy),S2t=/(WCOD+)?/.source.replace("WCOD",y2t),T2t=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",dy),x2t=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",dy),C2t=new RegExp("^"+v2t+S2t+T2t+x2t+"$"),w2t=["material","materials","bones","map"];class R2t{constructor(e,n,i){const s=i||zt.parseTrackName(n);this._targetGroup=e,this._bindings=e.subscribe_(n,s)}getValue(e,n){this.bind();const i=this._targetGroup.nCachedObjects_,s=this._bindings[i];s!==void 0&&s.getValue(e,n)}setValue(e,n){const i=this._bindings;for(let s=this._targetGroup.nCachedObjects_,r=i.length;s!==r;++s)i[s].setValue(e,n)}bind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,i=e.length;n!==i;++n)e[n].bind()}unbind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,i=e.length;n!==i;++n)e[n].unbind()}}class zt{constructor(e,n,i){this.path=n,this.parsedPath=i||zt.parseTrackName(n),this.node=zt.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,n,i){return e&&e.isAnimationObjectGroup?new zt.Composite(e,n,i):new zt(e,n,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(E2t,"")}static parseTrackName(e){const n=C2t.exec(e);if(n===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},s=i.nodeName&&i.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){const r=i.nodeName.substring(s+1);w2t.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,n){if(n===void 0||n===""||n==="."||n===-1||n===e.name||n===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(n);if(i!==void 0)return i}if(e.children){const i=function(r){for(let o=0;o=2.0 are supported."));return}const u=new oDt(r,{path:n||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});u.fileLoader.setRequestHeader(this.requestHeader);for(let d=0;d=0&&a[h]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+h+'".')}}u.setExtensions(o),u.setPlugins(a),u.parse(i,s)}parseAsync(e,n){const i=this;return new Promise(function(s,r){i.parse(e,n,s,r)})}}function N2t(){let t={};return{get:function(e){return t[e]},add:function(e,n){t[e]=n},remove:function(e){delete t[e]},removeAll:function(){t={}}}}const Ot={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 O2t{constructor(e){this.parser=e,this.name=Ot.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,n=this.parser.json.nodes||[];for(let i=0,s=n.length;i=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return n.loadTextureImage(e,r.source,o)}}class H2t{constructor(e){this.parser=e,this.name=Ot.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const n=this.name,i=this.parser,s=i.json,r=s.textures[e];if(!r.extensions||!r.extensions[n])return null;const o=r.extensions[n],a=s.images[o.source];let l=i.textureLoader;if(a.uri){const u=i.options.manager.getHandler(a.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return i.loadTextureImage(e,o.source,l);if(s.extensionsRequired&&s.extensionsRequired.indexOf(n)>=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 n=new Image;n.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",n.onload=n.onerror=function(){e(n.height===1)}})),this.isSupported}}class q2t{constructor(e){this.parser=e,this.name=Ot.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const n=this.name,i=this.parser,s=i.json,r=s.textures[e];if(!r.extensions||!r.extensions[n])return null;const o=r.extensions[n],a=s.images[o.source];let l=i.textureLoader;if(a.uri){const u=i.options.manager.getHandler(a.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return i.loadTextureImage(e,o.source,l);if(s.extensionsRequired&&s.extensionsRequired.indexOf(n)>=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 n=new Image;n.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",n.onload=n.onerror=function(){e(n.height===1)}})),this.isSupported}}class Y2t{constructor(e){this.name=Ot.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const n=this.parser.json,i=n.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(n.extensionsRequired&&n.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,u=s.byteLength||0,d=s.count,h=s.byteStride,f=new Uint8Array(a,l,u);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(d,h,f,s.mode,s.filter).then(function(_){return _.buffer}):o.ready.then(function(){const _=new ArrayBuffer(d*h);return o.decodeGltfBuffer(new Uint8Array(_),d,h,f,s.mode,s.filter),_})})}else return null}}class $2t{constructor(e){this.name=Ot.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const n=this.parser.json,i=n.nodes[e];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const s=n.meshes[i.mesh];for(const u of s.primitives)if(u.mode!==hi.TRIANGLES&&u.mode!==hi.TRIANGLE_STRIP&&u.mode!==hi.TRIANGLE_FAN&&u.mode!==void 0)return null;const o=i.extensions[this.name].attributes,a=[],l={};for(const u in o)a.push(this.parser.getDependency("accessor",o[u]).then(d=>(l[u]=d,l[u])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(u=>{const d=u.pop(),h=d.isGroup?d.children:[d],f=u[0].count,_=[];for(const m of h){const E=new Rt,b=new _e,g=new Ir,y=new _e(1,1,1),v=new jMt(m.geometry,m.material,f);for(let S=0;S0||t.search(/^data\:image\/jpeg/)===0?"image/jpeg":t.search(/\.webp($|\?)/i)>0||t.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const rDt=new Rt;class oDt{constructor(e={},n={}){this.json=e,this.extensions={},this.plugins={},this.options=n,this.cache=new N2t,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 RI(this.options.manager):this.textureLoader=new b2t(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new wI(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,n){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 zr(r,a,s),fr(a,s),Promise.all(i._invokeAll(function(l){return l.afterRoot&&l.afterRoot(a)})).then(function(){e(a)})}).catch(n)}_markDefs(){const e=this.json.nodes||[],n=this.json.skins||[],i=this.json.meshes||[];for(let s=0,r=n.length;s{const l=this.associations.get(o);l!=null&&this.associations.set(a,l);for(const[u,d]of o.children.entries())r(d,a.children[u])};return r(i,s),s.name+="_instance_"+e.uses[n]++,s}_invokeOne(e){const n=Object.values(this.plugins);n.push(this);for(let i=0;i=2&&b.setY(x,T[O*l+1]),l>=3&&b.setZ(x,T[O*l+2]),l>=4&&b.setW(x,T[O*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return b})}loadTexture(e){const n=this.json,i=this.options,r=n.textures[e].source,o=n.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,n,i){const s=this,r=this.json,o=r.textures[e],a=r.images[n],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const u=this.loadImageSource(n,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 f=(r.samplers||{})[o.sampler]||{};return d.magFilter=Mw[f.magFilter]||jn,d.minFilter=Mw[f.minFilter]||fo,d.wrapS=Dw[f.wrapS]||Ca,d.wrapT=Dw[f.wrapT]||Ca,s.associations.set(d,{textures:e}),d}).catch(function(){return null});return this.textureCache[l]=u,u}loadImageSource(e,n){const i=this,s=this.json,r=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(h=>h.clone());const o=s.images[e],a=self.URL||self.webkitURL;let l=o.uri||"",u=!1;if(o.bufferView!==void 0)l=i.getDependency("bufferView",o.bufferView).then(function(h){u=!0;const f=new Blob([h],{type:o.mimeType});return l=a.createObjectURL(f),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(h){return new Promise(function(f,_){let m=f;n.isImageBitmapLoader===!0&&(m=function(E){const b=new Nn(E);b.needsUpdate=!0,f(b)}),n.load(Gl.resolveURL(h,r.path),m,void 0,_)})}).then(function(h){return u===!0&&a.revokeObjectURL(l),h.userData.mimeType=o.mimeType||sDt(o.uri),h}).catch(function(h){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),h});return this.sourceCache[e]=d,d}assignTexture(e,n,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[Ot.KHR_TEXTURE_TRANSFORM]){const a=i.extensions!==void 0?i.extensions[Ot.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const l=r.associations.get(o);o=r.extensions[Ot.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),r.associations.set(o,l)}}return s!==void 0&&(o.colorSpace=s),e[n]=o,o})}assignFinalMaterial(e){const n=e.geometry;let i=e.material;const s=n.attributes.tangent===void 0,r=n.attributes.color!==void 0,o=n.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+i.uuid;let l=this.cache.get(a);l||(l=new TI,Hi.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 SI,Hi.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 ay}loadMaterial(e){const n=this,i=this.json,s=this.extensions,r=i.materials[e];let o;const a={},l=r.extensions||{},u=[];if(l[Ot.KHR_MATERIALS_UNLIT]){const h=s[Ot.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),u.push(h.extendParams(a,r,n))}else{const h=r.pbrMetallicRoughness||{};if(a.color=new gt(1,1,1),a.opacity=1,Array.isArray(h.baseColorFactor)){const f=h.baseColorFactor;a.color.setRGB(f[0],f[1],f[2],On),a.opacity=f[3]}h.baseColorTexture!==void 0&&u.push(n.assignTexture(a,"map",h.baseColorTexture,on)),a.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,a.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(u.push(n.assignTexture(a,"metalnessMap",h.metallicRoughnessTexture)),u.push(n.assignTexture(a,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(f){return f.getMaterialType&&f.getMaterialType(e)}),u.push(Promise.all(this._invokeAll(function(f){return f.extendMaterialParams&&f.extendMaterialParams(e,a)})))}r.doubleSided===!0&&(a.side=es);const d=r.alphaMode||gg.OPAQUE;if(d===gg.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,d===gg.MASK&&(a.alphaTest=r.alphaCutoff!==void 0?r.alphaCutoff:.5)),r.normalTexture!==void 0&&o!==Er&&(u.push(n.assignTexture(a,"normalMap",r.normalTexture)),a.normalScale=new It(1,1),r.normalTexture.scale!==void 0)){const h=r.normalTexture.scale;a.normalScale.set(h,h)}if(r.occlusionTexture!==void 0&&o!==Er&&(u.push(n.assignTexture(a,"aoMap",r.occlusionTexture)),r.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=r.occlusionTexture.strength)),r.emissiveFactor!==void 0&&o!==Er){const h=r.emissiveFactor;a.emissive=new gt().setRGB(h[0],h[1],h[2],On)}return r.emissiveTexture!==void 0&&o!==Er&&u.push(n.assignTexture(a,"emissiveMap",r.emissiveTexture,on)),Promise.all(u).then(function(){const h=new o(a);return r.name&&(h.name=r.name),fr(h,r),n.associations.set(h,{materials:e}),r.extensions&&zr(s,h,r),h})}createUniqueName(e){const n=zt.sanitizeNodeName(e||"");return n in this.nodeNamesUsed?n+"_"+ ++this.nodeNamesUsed[n]:(this.nodeNamesUsed[n]=0,n)}loadGeometries(e){const n=this,i=this.extensions,s=this.primitiveCache;function r(a){return i[Ot.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,n).then(function(l){return kw(l,a,n)})}const o=[];for(let a=0,l=e.length;a0&&nDt(g,r),g.name=n.createUniqueName(r.name||"mesh_"+e),fr(g,r),b.extensions&&zr(s,g,b),n.assignFinalMaterial(g),h.push(g)}for(let _=0,m=h.length;_1?d=new to:u.length===1?d=u[0]:d=new rn,d!==u[0])for(let h=0,f=u.length;h{const h=new Map;for(const[f,_]of s.associations)(f instanceof Hi||f instanceof Nn)&&h.set(f,_);return d.traverse(f=>{const _=s.associations.get(f);_!=null&&h.set(f,_)}),h};return s.associations=u(r),r})}_createAnimationTracks(e,n,i,s,r){const o=[],a=e.name?e.name:e.uuid,l=[];or[r.path]===or.weights?e.traverse(function(f){f.morphTargetInfluences&&l.push(f.name?f.name:f.uuid)}):l.push(a);let u;switch(or[r.path]){case or.weights:u=Oa;break;case or.rotation:u=bo;break;case or.position:case or.scale:u=Ia;break;default:switch(i.itemSize){case 1:u=Oa;break;case 2:case 3:default:u=Ia;break}break}const d=s.interpolation!==void 0?J2t[s.interpolation]:Ra,h=this._getArrayFromAccessor(i);for(let f=0,_=l.length;f<_;f++){const m=new u(l[f]+"."+or[r.path],n.array,h,d);s.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(m),o.push(m)}return o}_getArrayFromAccessor(e){let n=e.array;if(e.normalized){const i=gb(n.constructor),s=new Float32Array(n.length);for(let r=0,o=n.length;r{He.replace()})},stopVideoStream(){this.isVideoActive=!1,this.imageData=null,$e.emit("stop_webcam_video_stream"),Ge(()=>{He.replace()})},startDrag(t){this.isDragging=!0,this.zIndex=5001,this.dragStart.x=t.clientX,this.dragStart.y=t.clientY,document.addEventListener("mousemove",this.drag),document.addEventListener("mouseup",this.stopDrag)},drag(t){if(this.isDragging){const e=t.clientX-this.dragStart.x,n=t.clientY-this.dragStart.y;this.position.bottom-=n,this.position.right-=e,this.dragStart.x=t.clientX,this.dragStart.y=t.clientY}},stopDrag(){this.isDragging=!1,this.zIndex=0,document.removeEventListener("mousemove",this.drag),document.removeEventListener("mouseup",this.stopDrag)}},mounted(){He.replace(),$e.on("video_stream_image",t=>{if(this.isVideoActive){this.imageDataUrl="data:image/jpeg;base64,"+t,this.frameCount++;const e=Date.now();e-this.lastFrameTime>=1e3&&(this.frameRate=this.frameCount,this.frameCount=0,this.lastFrameTime=e)}})}},cDt=["src"],dDt=["src"],uDt={class:"controls"},pDt=c("i",{"data-feather":"video"},null,-1),_Dt=[pDt],hDt=c("i",{"data-feather":"video"},null,-1),fDt=[hDt],mDt={key:2};function gDt(t,e,n,i,s,r){return w(),A("div",{class:"floating-frame bg-white",style:en({bottom:s.position.bottom+"px",right:s.position.right+"px","z-index":s.zIndex}),onMousedown:e[4]||(e[4]=be((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[5]||(e[5]=be((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},[c("div",{class:"handle",onMousedown:e[0]||(e[0]=be((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[1]||(e[1]=be((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},"Drag Me",32),s.isVideoActive&&s.imageDataUrl!=null?(w(),A("img",{key:0,src:s.imageDataUrl,alt:"Webcam Frame",width:"300",height:"300"},null,8,cDt)):V("",!0),s.isVideoActive&&s.imageDataUrl==null?(w(),A("p",{key:1,src:s.imageDataUrl,alt:"Webcam Frame",width:"300",height:"300"},"Loading. Please wait...",8,dDt)):V("",!0),c("div",uDt,[s.isVideoActive?V("",!0):(w(),A("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))},_Dt)),s.isVideoActive?(w(),A("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))},fDt)):V("",!0),s.isVideoActive?(w(),A("span",mDt,"FPS: "+he(s.frameRate),1)):V("",!0)])],36)}const bDt=bt(lDt,[["render",gDt]]);const EDt={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(){$e.emit("start_audio_stream",()=>{this.isAudioActive=!0}),Ge(()=>{He.replace()})},stopAudioStream(){$e.emit("stop_audio_stream",()=>{this.isAudioActive=!1,this.imageDataUrl=null}),Ge(()=>{He.replace()})},startDrag(t){this.isDragging=!0,this.zIndex=5001,this.dragStart.x=t.clientX,this.dragStart.y=t.clientY,document.addEventListener("mousemove",this.drag),document.addEventListener("mouseup",this.stopDrag)},drag(t){if(this.isDragging){const e=t.clientX-this.dragStart.x,n=t.clientY-this.dragStart.y;this.position.bottom-=n,this.position.right-=e,this.dragStart.x=t.clientX,this.dragStart.y=t.clientY}},stopDrag(){this.isDragging=!1,this.zIndex=0,document.removeEventListener("mousemove",this.drag),document.removeEventListener("mouseup",this.stopDrag)}},mounted(){He.replace(),$e.on("update_spectrogram",t=>{if(this.isAudioActive){this.imageDataUrl="data:image/jpeg;base64,"+t,this.frameCount++;const e=Date.now();e-this.lastFrameTime>=1e3&&(this.frameRate=this.frameCount,this.frameCount=0,this.lastFrameTime=e)}})}},yDt=["src"],vDt={class:"controls"},SDt=c("i",{"data-feather":"mic"},null,-1),TDt=[SDt],xDt=c("i",{"data-feather":"mic"},null,-1),CDt=[xDt];function wDt(t,e,n,i,s,r){return w(),A("div",{class:"floating-frame bg-white",style:en({bottom:s.position.bottom+"px",right:s.position.right+"px","z-index":s.zIndex}),onMousedown:e[4]||(e[4]=be((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[5]||(e[5]=be((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},[c("div",{class:"handle",onMousedown:e[0]||(e[0]=be((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[1]||(e[1]=be((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},"Drag Me",32),s.isAudioActive&&s.imageDataUrl!=null?(w(),A("img",{key:0,src:s.imageDataUrl,alt:"Spectrogram",width:"300",height:"300"},null,8,yDt)):V("",!0),c("div",vDt,[s.isAudioActive?V("",!0):(w(),A("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))},TDt)),s.isAudioActive?(w(),A("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))},CDt)):V("",!0)])],36)}const RDt=bt(EDt,[["render",wDt]]);const ADt={data(){return{activePersonality:null}},props:{personality:{type:Object,default:()=>({})}},components:{VideoFrame:bDt,AudioFrame:RDt},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(t=>setTimeout(t,100));console.log("Personality:",this.personality),this.initWebGLScene(),this.updatePersonality(),Ge(()=>{He.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 zMt,this.camera=new zn(75,window.innerWidth/window.innerHeight,.1,1e3),this.renderer=new yI,this.renderer.setSize(window.innerWidth,window.innerHeight),this.$refs.webglContainer.appendChild(this.renderer.domElement);const t=new Cr,e=new Cw({color:65280});this.cube=new Hn(t,e),this.scene.add(this.cube);const n=new g2t(4210752),i=new AI(16777215,.5);i.position.set(0,1,0),this.scene.add(n),this.scene.add(i),this.camera.position.z=5,this.animate()},updatePersonality(){const{mountedPersArr:t,config:e}=this.$store.state;this.activePersonality=t[e.active_personality_id],this.activePersonality.avatar?this.showBoxWithAvatar(this.activePersonality.avatar):this.showDefaultCube(),this.$emit("update:personality",this.activePersonality)},loadScene(t){new A2t().load(t,n=>{this.scene.remove(this.cube),this.cube=n.scene,this.scene.add(this.cube)})},showBoxWithAvatar(t){this.cube&&this.scene.remove(this.cube);const e=new Cr,n=new RI().load(t),i=new Er({map:n});this.cube=new Hn(e,i),this.scene.add(this.cube)},showDefaultCube(){this.scene.remove(this.cube);const t=new Cr,e=new Cw({color:65280});this.cube=new Hn(t,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)}}},NDt={ref:"webglContainer"},ODt={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"},IDt={key:0,class:"text-center"},MDt={key:1,class:"text-center"},DDt={class:"floating-frame2"},kDt=["innerHTML"];function LDt(t,e,n,i,s,r){const o=mt("VideoFrame"),a=mt("AudioFrame");return w(),A(Ye,null,[c("div",NDt,null,512),c("div",ODt,[!s.activePersonality||!s.activePersonality.scene_path?(w(),A("div",IDt," Personality does not have a 3d avatar. ")):V("",!0),!s.activePersonality||!s.activePersonality.avatar||s.activePersonality.avatar===""?(w(),A("div",MDt," Personality does not have an avatar. ")):V("",!0),c("div",DDt,[c("div",{innerHTML:t.htmlContent},null,8,kDt)])]),Te(o,{ref:"video_frame"},null,512),Te(a,{ref:"audio_frame"},null,512)],64)}const PDt=bt(ADt,[["render",LDt]]);let xd;const UDt=new Uint8Array(16);function FDt(){if(!xd&&(xd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!xd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return xd(UDt)}const Cn=[];for(let t=0;t<256;++t)Cn.push((t+256).toString(16).slice(1));function BDt(t,e=0){return Cn[t[e+0]]+Cn[t[e+1]]+Cn[t[e+2]]+Cn[t[e+3]]+"-"+Cn[t[e+4]]+Cn[t[e+5]]+"-"+Cn[t[e+6]]+Cn[t[e+7]]+"-"+Cn[t[e+8]]+Cn[t[e+9]]+"-"+Cn[t[e+10]]+Cn[t[e+11]]+Cn[t[e+12]]+Cn[t[e+13]]+Cn[t[e+14]]+Cn[t[e+15]]}const GDt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Lw={randomUUID:GDt};function Gs(t,e,n){if(Lw.randomUUID&&!e&&!t)return Lw.randomUUID();t=t||{};const i=t.random||(t.rng||FDt)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){n=n||0;for(let s=0;s<16;++s)e[n+s]=i[s];return e}return BDt(i)}class co{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,n){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,n),this._listeners.push(n)}unsubscribe(e){if(this.listenerMap.has(e)){const n=this.listenerMap.get(e);this.listenerMap.delete(e);const i=this._listeners.indexOf(n);i>=0&&this._listeners.splice(i,1)}}registerProxy(e,n){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,n),this.proxies.push(n)}unregisterProxy(e){if(!this.proxyMap.has(e))return;const n=this.proxyMap.get(e);this.proxyMap.delete(e);const i=this.proxies.indexOf(n);i>=0&&this.proxies.splice(i,1)}}class qt extends co{constructor(e){super(),this.entity=e}emit(e){this.listeners.forEach(n=>n(e,this.entity))}}class Un extends co{constructor(e){super(),this.entity=e}emit(e){let n=!1;const i=()=>[n=!0];for(const s of Array.from(this.listeners.values()))if(s(e,i,this.entity),n)return{prevented:!0};return{prevented:!1}}}class II extends co{execute(e,n){let i=e;for(const s of this.listeners)i=s(i,n);return i}}class li extends II{constructor(e){super(),this.entity=e}execute(e){return super.execute(e,this.entity)}}class GDt extends co{constructor(e){super(),this.entity=e}execute(e){const n=[];for(const i of this.listeners)n.push(i(e,this.entity));return n}}function Qi(){const t=Symbol(),e=new Map,n=new Set,i=(l,u)=>{u instanceof co&&u.registerProxy(t,()=>{var d,h;return(h=(d=e.get(l))===null||d===void 0?void 0:d.listeners)!==null&&h!==void 0?h:[]})},s=l=>{const u=new co;e.set(l,u),n.forEach(d=>i(l,d[l]))},r=l=>{n.add(l);for(const u of e.keys())i(u,l[u])},o=l=>{for(const u of e.keys())l[u]instanceof co&&l[u].unregisterProxy(t);n.delete(l)},a=()=>{n.forEach(l=>o(l)),e.clear()};return new Proxy({},{get(l,u){return u==="addTarget"?r:u==="removeTarget"?o:u==="destroy"?a:typeof u!="string"||u.startsWith("_")?l[u]:(e.has(u)||s(u),e.get(u))}})}class Pw{constructor(e,n){if(this.destructed=!1,this.events={destruct:new qt(this)},!e||!n)throw new Error("Cannot initialize connection with null/undefined for 'from' or 'to' values");this.id=Gs(),this.from=e,this.to=n,this.from.connectionCount++,this.to.connectionCount++}destruct(){this.events.destruct.emit(),this.from.connectionCount--,this.to.connectionCount--,this.destructed=!0}}class MI{constructor(e,n){if(!e||!n)throw new Error("Cannot initialize connection with null/undefined for 'from' or 'to' values");this.id=Gs(),this.from=e,this.to=n}}function bb(t,e){return Object.fromEntries(Object.entries(t).map(([n,i])=>[n,e(i)]))}class DI{constructor(){this._title="",this.id=Gs(),this.events={loaded:new qt(this),beforeAddInput:new Un(this),addInput:new qt(this),beforeRemoveInput:new Un(this),removeInput:new qt(this),beforeAddOutput:new Un(this),addOutput:new qt(this),beforeRemoveOutput:new Un(this),removeOutput:new qt(this),beforeTitleChanged:new Un(this),titleChanged:new qt(this),update:new qt(this)},this.hooks={beforeLoad:new li(this),afterSave:new li(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,n){return this.addInterface("input",e,n)}addOutput(e,n){return this.addInterface("output",e,n)}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(([n,i])=>{this.inputs[n]&&(this.inputs[n].load(i),this.inputs[n].nodeId=this.id)}),Object.entries(e.outputs).forEach(([n,i])=>{this.outputs[n]&&(this.outputs[n].load(i),this.outputs[n].nodeId=this.id)}),this.events.loaded.emit(this)}save(){const e=bb(this.inputs,s=>s.save()),n=bb(this.outputs,s=>s.save()),i={type:this.type,id:this.id,title:this.title,inputs:e,outputs:n};return this.hooks.afterSave.execute(i)}onPlaced(){}onDestroy(){}initializeIo(){Object.entries(this.inputs).forEach(([e,n])=>this.initializeIntf("input",e,n)),Object.entries(this.outputs).forEach(([e,n])=>this.initializeIntf("output",e,n))}initializeIntf(e,n,i){i.isInput=e==="input",i.nodeId=this.id,i.events.setValue.subscribe(this,()=>this.events.update.emit({type:e,name:n,intf:i}))}addInterface(e,n,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[n]=i,this.initializeIntf(e,n,i),r.emit(i),!0)}removeInterface(e,n){const i=e==="input"?this.events.beforeRemoveInput:this.events.beforeRemoveOutput,s=e==="input"?this.events.removeInput:this.events.removeOutput,r=e==="input"?this.inputs[n]:this.outputs[n];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[n]:delete this.outputs[n],s.emit(r),!0}}let kI=class extends DI{load(e){super.load(e)}save(){return super.save()}};function Ja(t){return class extends kI{constructor(){var e,n;super(),this.type=t.type,this.inputs={},this.outputs={},this.calculate=t.calculate?(i,s)=>t.calculate.call(this,i,s):void 0,this._title=(e=t.title)!==null&&e!==void 0?e:t.type,this.executeFactory("input",t.inputs),this.executeFactory("output",t.outputs),(n=t.onCreate)===null||n===void 0||n.call(this)}onPlaced(){var e;(e=t.onPlaced)===null||e===void 0||e.call(this)}onDestroy(){var e;(e=t.onDestroy)===null||e===void 0||e.call(this)}executeFactory(e,n){Object.keys(n||{}).forEach(i=>{const s=n[i]();e==="input"?this.addInput(i,s):this.addOutput(i,s)})}}}class nn{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,n){this.id=Gs(),this.nodeId="",this.port=!0,this.hidden=!1,this.events={setConnectionCount:new qt(this),beforeSetValue:new Un(this),setValue:new qt(this),updated:new qt(this)},this.hooks={load:new li(this),save:new li(this)},this._connectionCount=0,this.name=e,this._value=n}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,...n){return e(this,...n),this}}const Da="__baklava_SubgraphInputNode",ka="__baklava_SubgraphOutputNode";class LI extends kI{constructor(){super(),this.graphInterfaceId=Gs()}onPlaced(){super.onPlaced(),this.initializeIo()}save(){return{...super.save(),graphInterfaceId:this.graphInterfaceId}}load(e){super.load(e),this.graphInterfaceId=e.graphInterfaceId}}class PI extends LI{constructor(){super(...arguments),this.type=Da,this.inputs={name:new nn("Name","Input")},this.outputs={placeholder:new nn("Value",void 0)}}static isGraphInputNode(e){return e.type===Da}}class UI extends LI{constructor(){super(...arguments),this.type=ka,this.inputs={name:new nn("Name","Output"),placeholder:new nn("Value",void 0)},this.outputs={output:new nn("Output",void 0).setHidden(!0)},this.calculate=({placeholder:e})=>({output:e})}static isGraphOutputNode(e){return e.type===ka}}class Sc{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(n=>n.type===Da).map(n=>({id:n.graphInterfaceId,name:n.inputs.name.value,nodeId:n.id,nodeInterfaceId:n.outputs.placeholder.id}))}get outputs(){return this.nodes.filter(n=>n.type===ka).map(n=>({id:n.graphInterfaceId,name:n.inputs.name.value,nodeId:n.id,nodeInterfaceId:n.outputs.output.id}))}constructor(e,n){this.id=Gs(),this.activeTransactions=0,this._nodes=[],this._connections=[],this._loading=!1,this._destroying=!1,this.events={beforeAddNode:new Un(this),addNode:new qt(this),beforeRemoveNode:new Un(this),removeNode:new qt(this),beforeAddConnection:new Un(this),addConnection:new qt(this),checkConnection:new Un(this),beforeRemoveConnection:new Un(this),removeConnection:new qt(this)},this.hooks={save:new li(this),load:new li(this),checkConnection:new GDt(this)},this.nodeEvents=Qi(),this.nodeHooks=Qi(),this.connectionEvents=Qi(),this.editor=e,this.template=n,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(n=>n.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 n=[...Object.values(e.inputs),...Object.values(e.outputs)];this.connections.filter(i=>n.includes(i.from)||n.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,n){const i=this.checkConnection(e,n);if(!i.connectionAllowed||this.events.beforeAddConnection.emit({from:e,to:n}).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 Pw(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,n){if(!e||!n)return{connectionAllowed:!1};const i=this.findNodeById(e.nodeId),s=this.findNodeById(n.nodeId);if(i&&s&&i===s)return{connectionAllowed:!1};if(e.isInput&&!n.isInput){const a=e;e=n,n=a}if(e.isInput||!n.isInput)return{connectionAllowed:!1};if(this.connections.some(a=>a.from===e&&a.to===n))return{connectionAllowed:!1};if(this.events.checkConnection.emit({from:e,to:n}).prevented)return{connectionAllowed:!1};const r=this.hooks.checkConnection.execute({from:e,to:n});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 MI(e,n),connectionsInDanger:o}}findNodeInterface(e){for(const n of this.nodes){for(const i in n.inputs){const s=n.inputs[i];if(s.id===e)return s}for(const i in n.outputs){const s=n.outputs[i];if(s.id===e)return s}}}findNodeById(e){return this.nodes.find(n=>n.id===e)}load(e){try{this._loading=!0;const n=[];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){n.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 Pw(s,r);o.id=i.id,this.internalAddConnection(o)}else{n.push(`Could not find interface with id ${i.to}`);continue}else{n.push(`Could not find interface with id ${i.from}`);continue}}return this.hooks.load.execute(e),n}finally{this._loading=!1}}save(){const e={id:this.id,nodes:this.nodes.map(n=>n.save()),connections:this.connections.map(n=>({id:n.id,from:n.from.id,to:n.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 lc="__baklava_GraphNode-";function La(t){return lc+t.id}function VDt(t){return class extends DI{constructor(){super(...arguments),this.type=La(t),this.inputs={},this.outputs={},this.template=t,this.calculate=async(n,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,n[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(n){this.template.name=n}load(n){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(n.graphState),super.load(n)}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,n=>{this._title=n}),this.initialize()}onDestroy(){var n;this.template.events.updated.unsubscribe(this),this.template.events.nameChanged.unsubscribe(this),(n=this.subgraph)===null||n===void 0||n.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 n of this.subgraph.inputs)n.id in this.inputs?this.inputs[n.id].name=n.name:this.addInput(n.id,new nn(n.name,void 0));for(const n of Object.keys(this.inputs))this.subgraph.inputs.some(i=>i.id===n)||this.removeInput(n);for(const n of this.subgraph.outputs)n.id in this.outputs?this.outputs[n.id].name=n.name:this.addOutput(n.id,new nn(n.name,void 0));for(const n of Object.keys(this.outputs))this.subgraph.outputs.some(i=>i.id===n)||this.removeOutput(n);this.addOutput("_calculationResults",new nn("_calculationResults",void 0).setHidden(!0))}}}class hp{static fromGraph(e,n){return new hp(e.save(),n)}get name(){return this._name}set name(e){this._name=e,this.events.nameChanged.emit(e);const n=this.editor.nodeTypes.get(La(this));n&&(n.title=e)}get inputs(){return this.nodes.filter(n=>n.type===Da).map(n=>({id:n.graphInterfaceId,name:n.inputs.name.value,nodeId:n.id,nodeInterfaceId:n.outputs.placeholder.id}))}get outputs(){return this.nodes.filter(n=>n.type===ka).map(n=>({id:n.graphInterfaceId,name:n.inputs.name.value,nodeId:n.id,nodeInterfaceId:n.outputs.output.id}))}constructor(e,n){this.id=Gs(),this._name="Subgraph",this.events={nameChanged:new qt(this),updated:new qt(this)},this.hooks={beforeLoad:new li(this),afterSave:new li(this)},this.editor=n,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 n=new Map,i=f=>{const _=Gs();return n.set(f,_),_},s=f=>{const _=n.get(f);if(!_)throw new Error(`Unable to create graph from template: Could not map old id ${f} to new id`);return _},r=f=>bb(f,_=>({id:i(_.id),templateId:_.id,value:_.value})),o=this.nodes.map(f=>({...f,id:i(f.id),inputs:r(f.inputs),outputs:r(f.outputs)})),a=this.connections.map(f=>({id:i(f.id),from:s(f.from),to:s(f.to)})),l=this.inputs.map(f=>({id:f.id,name:f.name,nodeId:s(f.nodeId),nodeInterfaceId:s(f.nodeInterfaceId)})),u=this.outputs.map(f=>({id:f.id,name:f.name,nodeId:s(f.nodeId),nodeInterfaceId:s(f.nodeInterfaceId)})),d={id:Gs(),nodes:o,connections:a,inputs:l,outputs:u};return e||(e=new Sc(this.editor)),e.load(d).forEach(f=>console.warn(f)),e.template=this,e}}class zDt{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 qt(this),beforeRegisterNodeType:new Un(this),registerNodeType:new qt(this),beforeUnregisterNodeType:new Un(this),unregisterNodeType:new qt(this),beforeAddGraphTemplate:new Un(this),addGraphTemplate:new qt(this),beforeRemoveGraphTemplate:new Un(this),removeGraphTemplate:new qt(this),registerGraph:new qt(this),unregisterGraph:new qt(this)},this.hooks={save:new li(this),load:new li(this)},this.graphTemplateEvents=Qi(),this.graphTemplateHooks=Qi(),this.graphEvents=Qi(),this.graphHooks=Qi(),this.nodeEvents=Qi(),this.nodeHooks=Qi(),this.connectionEvents=Qi(),this._graphs=new Set,this._nodeTypes=new Map,this._graph=new Sc(this),this._graphTemplates=[],this._loading=!1,this.registerNodeType(PI),this.registerNodeType(UI)}registerNodeType(e,n){var i,s;if(this.events.beforeRegisterNodeType.emit({type:e,options:n}).prevented)return;const r=new e;this._nodeTypes.set(r.type,{type:e,category:(i=n==null?void 0:n.category)!==null&&i!==void 0?i:"default",title:(s=n==null?void 0:n.title)!==null&&s!==void 0?s:r.title}),this.events.registerNodeType.emit({type:e,options:n})}unregisterNodeType(e){const n=typeof e=="string"?e:new e().type;if(this.nodeTypes.has(n)){if(this.events.beforeUnregisterNodeType.emit(n).prevented)return;this._nodeTypes.delete(n),this.events.unregisterNodeType.emit(n)}}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 n=VDt(e);this.registerNodeType(n,{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 n=La(e);for(const i of[this.graph,...this.graphs.values()]){const s=i.nodes.filter(r=>r.type===n);for(const r of s)i.removeNode(r)}this.unregisterNodeType(n),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 hp(i,this);this.addGraphTemplate(s)});const n=this._graph.load(e.graph);return this.events.loaded.emit(),n.forEach(i=>console.warn(i)),n}finally{this._loading=!1}}save(){const e={graph:this.graph.save(),graphTemplates:this.graphTemplates.map(n=>n.save())};return this.hooks.save.execute(e)}}function HDt(t,e){const n=new Map;e.graphs.forEach(i=>{i.nodes.forEach(s=>n.set(s.id,s))}),t.forEach((i,s)=>{const r=n.get(s);r&&i.forEach((o,a)=>{const l=r.outputs[a];l&&(l.value=o)})})}class FI extends Error{constructor(){super("Cycle detected")}}function qDt(t){return typeof t=="string"}function BI(t,e){const n=new Map,i=new Map,s=new Map;let r,o;if(t instanceof Sc)r=t.nodes,o=t.connections;else{if(!e)throw new Error("Invalid argument value: expected array of connections");r=t,o=e}r.forEach(u=>{Object.values(u.inputs).forEach(d=>n.set(d.id,u.id)),Object.values(u.outputs).forEach(d=>n.set(d.id,u.id))}),r.forEach(u=>{const d=o.filter(f=>f.from&&n.get(f.from.id)===u.id),h=new Set(d.map(f=>n.get(f.to.id)).filter(qDt));i.set(u.id,h),s.set(u,d)});const a=r.slice();o.forEach(u=>{const d=a.findIndex(h=>n.get(u.to.id)===h.id);d>=0&&a.splice(d,1)});const l=[];for(;a.length>0;){const u=a.pop();l.push(u);const d=i.get(u.id);for(;d.size>0;){const h=d.values().next().value;if(d.delete(h),Array.from(i.values()).every(f=>!f.has(h))){const f=r.find(_=>_.id===h);a.push(f)}}}if(Array.from(i.values()).some(u=>u.size>0))throw new FI;return{calculationOrder:l,connectionsFromNode:s,interfaceIdToNodeId:n}}function YDt(t,e){try{return BI(t,e),!1}catch(n){if(n instanceof FI)return!0;throw n}}var Kn;(function(t){t.Running="Running",t.Idle="Idle",t.Paused="Paused",t.Stopped="Stopped"})(Kn||(Kn={}));class $Dt{get status(){return this.isRunning?Kn.Running:this.internalStatus}constructor(e){this.editor=e,this.events={beforeRun:new Un(this),afterRun:new qt(this),statusChange:new qt(this),beforeNodeCalculation:new qt(this),afterNodeCalculation:new qt(this)},this.hooks={gatherCalculationData:new li(this),transferData:new II},this.recalculateOrder=!0,this.internalStatus=Kn.Stopped,this.isRunning=!1,this.editor.nodeEvents.update.subscribe(this,(n,i)=>{i.graph&&!i.graph.loading&&i.graph.activeTransactions===0&&this.internalOnChange(i,n??void 0)}),this.editor.graphEvents.addNode.subscribe(this,(n,i)=>{this.recalculateOrder=!0,!i.loading&&i.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.removeNode.subscribe(this,(n,i)=>{this.recalculateOrder=!0,!i.loading&&i.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.addConnection.subscribe(this,(n,i)=>{this.recalculateOrder=!0,!i.loading&&i.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.removeConnection.subscribe(this,(n,i)=>{this.recalculateOrder=!0,!i.loading&&i.activeTransactions===0&&this.internalOnChange()}),this.editor.graphHooks.checkConnection.subscribe(this,n=>this.checkConnection(n.from,n.to))}start(){this.internalStatus===Kn.Stopped&&(this.internalStatus=Kn.Idle,this.events.statusChange.emit(this.status))}pause(){this.internalStatus===Kn.Idle&&(this.internalStatus=Kn.Paused,this.events.statusChange.emit(this.status))}resume(){this.internalStatus===Kn.Paused&&(this.internalStatus=Kn.Idle,this.events.statusChange.emit(this.status))}stop(){(this.internalStatus===Kn.Idle||this.internalStatus===Kn.Paused)&&(this.internalStatus=Kn.Stopped,this.events.statusChange.emit(this.status))}async runOnce(e,...n){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,...n);return this.events.afterRun.emit(i),i}finally{this.isRunning=!1,this.events.statusChange.emit(this.status)}}checkConnection(e,n){if(e.templateId){const r=this.findInterfaceByTemplateId(this.editor.graph.nodes,e.templateId);if(!r)return{connectionAllowed:!0,connectionsInDanger:[]};e=r}if(n.templateId){const r=this.findInterfaceByTemplateId(this.editor.graph.nodes,n.templateId);if(!r)return{connectionAllowed:!0,connectionsInDanger:[]};n=r}const i=new MI(e,n);let s=this.editor.graph.connections.slice();return n.allowMultipleConnections||(s=s.filter(r=>r.to!==n)),s.push(i),YDt(this.editor.graph.nodes,s)?{connectionAllowed:!1,connectionsInDanger:[]}:{connectionAllowed:!0,connectionsInDanger:n.allowMultipleConnections?[]:this.editor.graph.connections.filter(r=>r.to===n)}}calculateOrder(){this.recalculateOrder=!0}async calculateWithoutData(...e){const n=this.hooks.gatherCalculationData.execute(void 0);return await this.runOnce(n,...e)}validateNodeCalculationOutput(e,n){if(typeof n!="object")throw new Error(`Invalid calculation return value from node ${e.id} (type ${e.type})`);Object.keys(e.outputs).forEach(i=>{if(!(i in n))throw new Error(`Calculation return value from node ${e.id} (type ${e.type}) is missing key "${i}"`)})}internalOnChange(e,n){this.internalStatus===Kn.Idle&&this.onChange(this.recalculateOrder,e,n)}findInterfaceByTemplateId(e,n){for(const i of e)for(const s of[...Object.values(i.inputs),...Object.values(i.outputs)])if(s.templateId===n)return s;return null}}class WDt extends $Dt{constructor(e){super(e),this.order=new Map}start(){super.start(),this.recalculateOrder=!0,this.calculateWithoutData()}async runGraph(e,n,i){this.order.has(e.id)||this.order.set(e.id,BI(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,h])=>{l[d]=this.getInterfaceValue(n,h.id)}),this.events.beforeNodeCalculation.emit({inputValues:l,node:a});let u;if(a.calculate)u=await a.calculate(l,{globalValues:i,engine:this});else{u={};for(const[d,h]of Object.entries(a.outputs))u[d]=this.getInterfaceValue(n,h.id)}this.validateNodeCalculationOutput(a,u),this.events.afterNodeCalculation.emit({outputValues:u,node:a}),o.set(a.id,new Map(Object.entries(u))),r.has(a)&&r.get(a).forEach(d=>{var h;const f=(h=Object.entries(a.outputs).find(([,m])=>m.id===d.from.id))===null||h===void 0?void 0:h[0];if(!f)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,n),this.proxies.push(n)}unregisterProxy(e){if(!this.proxyMap.has(e))return;const n=this.proxyMap.get(e);this.proxyMap.delete(e);const i=this.proxies.indexOf(n);i>=0&&this.proxies.splice(i,1)}}class qt extends co{constructor(e){super(),this.entity=e}emit(e){this.listeners.forEach(n=>n(e,this.entity))}}class Un extends co{constructor(e){super(),this.entity=e}emit(e){let n=!1;const i=()=>[n=!0];for(const s of Array.from(this.listeners.values()))if(s(e,i,this.entity),n)return{prevented:!0};return{prevented:!1}}}class II extends co{execute(e,n){let i=e;for(const s of this.listeners)i=s(i,n);return i}}class li extends II{constructor(e){super(),this.entity=e}execute(e){return super.execute(e,this.entity)}}class VDt extends co{constructor(e){super(),this.entity=e}execute(e){const n=[];for(const i of this.listeners)n.push(i(e,this.entity));return n}}function Qi(){const t=Symbol(),e=new Map,n=new Set,i=(l,u)=>{u instanceof co&&u.registerProxy(t,()=>{var d,h;return(h=(d=e.get(l))===null||d===void 0?void 0:d.listeners)!==null&&h!==void 0?h:[]})},s=l=>{const u=new co;e.set(l,u),n.forEach(d=>i(l,d[l]))},r=l=>{n.add(l);for(const u of e.keys())i(u,l[u])},o=l=>{for(const u of e.keys())l[u]instanceof co&&l[u].unregisterProxy(t);n.delete(l)},a=()=>{n.forEach(l=>o(l)),e.clear()};return new Proxy({},{get(l,u){return u==="addTarget"?r:u==="removeTarget"?o:u==="destroy"?a:typeof u!="string"||u.startsWith("_")?l[u]:(e.has(u)||s(u),e.get(u))}})}class Pw{constructor(e,n){if(this.destructed=!1,this.events={destruct:new qt(this)},!e||!n)throw new Error("Cannot initialize connection with null/undefined for 'from' or 'to' values");this.id=Gs(),this.from=e,this.to=n,this.from.connectionCount++,this.to.connectionCount++}destruct(){this.events.destruct.emit(),this.from.connectionCount--,this.to.connectionCount--,this.destructed=!0}}class MI{constructor(e,n){if(!e||!n)throw new Error("Cannot initialize connection with null/undefined for 'from' or 'to' values");this.id=Gs(),this.from=e,this.to=n}}function bb(t,e){return Object.fromEntries(Object.entries(t).map(([n,i])=>[n,e(i)]))}class DI{constructor(){this._title="",this.id=Gs(),this.events={loaded:new qt(this),beforeAddInput:new Un(this),addInput:new qt(this),beforeRemoveInput:new Un(this),removeInput:new qt(this),beforeAddOutput:new Un(this),addOutput:new qt(this),beforeRemoveOutput:new Un(this),removeOutput:new qt(this),beforeTitleChanged:new Un(this),titleChanged:new qt(this),update:new qt(this)},this.hooks={beforeLoad:new li(this),afterSave:new li(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,n){return this.addInterface("input",e,n)}addOutput(e,n){return this.addInterface("output",e,n)}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(([n,i])=>{this.inputs[n]&&(this.inputs[n].load(i),this.inputs[n].nodeId=this.id)}),Object.entries(e.outputs).forEach(([n,i])=>{this.outputs[n]&&(this.outputs[n].load(i),this.outputs[n].nodeId=this.id)}),this.events.loaded.emit(this)}save(){const e=bb(this.inputs,s=>s.save()),n=bb(this.outputs,s=>s.save()),i={type:this.type,id:this.id,title:this.title,inputs:e,outputs:n};return this.hooks.afterSave.execute(i)}onPlaced(){}onDestroy(){}initializeIo(){Object.entries(this.inputs).forEach(([e,n])=>this.initializeIntf("input",e,n)),Object.entries(this.outputs).forEach(([e,n])=>this.initializeIntf("output",e,n))}initializeIntf(e,n,i){i.isInput=e==="input",i.nodeId=this.id,i.events.setValue.subscribe(this,()=>this.events.update.emit({type:e,name:n,intf:i}))}addInterface(e,n,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[n]=i,this.initializeIntf(e,n,i),r.emit(i),!0)}removeInterface(e,n){const i=e==="input"?this.events.beforeRemoveInput:this.events.beforeRemoveOutput,s=e==="input"?this.events.removeInput:this.events.removeOutput,r=e==="input"?this.inputs[n]:this.outputs[n];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[n]:delete this.outputs[n],s.emit(r),!0}}let kI=class extends DI{load(e){super.load(e)}save(){return super.save()}};function Ja(t){return class extends kI{constructor(){var e,n;super(),this.type=t.type,this.inputs={},this.outputs={},this.calculate=t.calculate?(i,s)=>t.calculate.call(this,i,s):void 0,this._title=(e=t.title)!==null&&e!==void 0?e:t.type,this.executeFactory("input",t.inputs),this.executeFactory("output",t.outputs),(n=t.onCreate)===null||n===void 0||n.call(this)}onPlaced(){var e;(e=t.onPlaced)===null||e===void 0||e.call(this)}onDestroy(){var e;(e=t.onDestroy)===null||e===void 0||e.call(this)}executeFactory(e,n){Object.keys(n||{}).forEach(i=>{const s=n[i]();e==="input"?this.addInput(i,s):this.addOutput(i,s)})}}}class nn{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,n){this.id=Gs(),this.nodeId="",this.port=!0,this.hidden=!1,this.events={setConnectionCount:new qt(this),beforeSetValue:new Un(this),setValue:new qt(this),updated:new qt(this)},this.hooks={load:new li(this),save:new li(this)},this._connectionCount=0,this.name=e,this._value=n}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,...n){return e(this,...n),this}}const Da="__baklava_SubgraphInputNode",ka="__baklava_SubgraphOutputNode";class LI extends kI{constructor(){super(),this.graphInterfaceId=Gs()}onPlaced(){super.onPlaced(),this.initializeIo()}save(){return{...super.save(),graphInterfaceId:this.graphInterfaceId}}load(e){super.load(e),this.graphInterfaceId=e.graphInterfaceId}}class PI extends LI{constructor(){super(...arguments),this.type=Da,this.inputs={name:new nn("Name","Input")},this.outputs={placeholder:new nn("Value",void 0)}}static isGraphInputNode(e){return e.type===Da}}class UI extends LI{constructor(){super(...arguments),this.type=ka,this.inputs={name:new nn("Name","Output"),placeholder:new nn("Value",void 0)},this.outputs={output:new nn("Output",void 0).setHidden(!0)},this.calculate=({placeholder:e})=>({output:e})}static isGraphOutputNode(e){return e.type===ka}}class Sc{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(n=>n.type===Da).map(n=>({id:n.graphInterfaceId,name:n.inputs.name.value,nodeId:n.id,nodeInterfaceId:n.outputs.placeholder.id}))}get outputs(){return this.nodes.filter(n=>n.type===ka).map(n=>({id:n.graphInterfaceId,name:n.inputs.name.value,nodeId:n.id,nodeInterfaceId:n.outputs.output.id}))}constructor(e,n){this.id=Gs(),this.activeTransactions=0,this._nodes=[],this._connections=[],this._loading=!1,this._destroying=!1,this.events={beforeAddNode:new Un(this),addNode:new qt(this),beforeRemoveNode:new Un(this),removeNode:new qt(this),beforeAddConnection:new Un(this),addConnection:new qt(this),checkConnection:new Un(this),beforeRemoveConnection:new Un(this),removeConnection:new qt(this)},this.hooks={save:new li(this),load:new li(this),checkConnection:new VDt(this)},this.nodeEvents=Qi(),this.nodeHooks=Qi(),this.connectionEvents=Qi(),this.editor=e,this.template=n,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(n=>n.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 n=[...Object.values(e.inputs),...Object.values(e.outputs)];this.connections.filter(i=>n.includes(i.from)||n.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,n){const i=this.checkConnection(e,n);if(!i.connectionAllowed||this.events.beforeAddConnection.emit({from:e,to:n}).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 Pw(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,n){if(!e||!n)return{connectionAllowed:!1};const i=this.findNodeById(e.nodeId),s=this.findNodeById(n.nodeId);if(i&&s&&i===s)return{connectionAllowed:!1};if(e.isInput&&!n.isInput){const a=e;e=n,n=a}if(e.isInput||!n.isInput)return{connectionAllowed:!1};if(this.connections.some(a=>a.from===e&&a.to===n))return{connectionAllowed:!1};if(this.events.checkConnection.emit({from:e,to:n}).prevented)return{connectionAllowed:!1};const r=this.hooks.checkConnection.execute({from:e,to:n});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 MI(e,n),connectionsInDanger:o}}findNodeInterface(e){for(const n of this.nodes){for(const i in n.inputs){const s=n.inputs[i];if(s.id===e)return s}for(const i in n.outputs){const s=n.outputs[i];if(s.id===e)return s}}}findNodeById(e){return this.nodes.find(n=>n.id===e)}load(e){try{this._loading=!0;const n=[];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){n.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 Pw(s,r);o.id=i.id,this.internalAddConnection(o)}else{n.push(`Could not find interface with id ${i.to}`);continue}else{n.push(`Could not find interface with id ${i.from}`);continue}}return this.hooks.load.execute(e),n}finally{this._loading=!1}}save(){const e={id:this.id,nodes:this.nodes.map(n=>n.save()),connections:this.connections.map(n=>({id:n.id,from:n.from.id,to:n.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 lc="__baklava_GraphNode-";function La(t){return lc+t.id}function zDt(t){return class extends DI{constructor(){super(...arguments),this.type=La(t),this.inputs={},this.outputs={},this.template=t,this.calculate=async(n,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,n[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(n){this.template.name=n}load(n){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(n.graphState),super.load(n)}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,n=>{this._title=n}),this.initialize()}onDestroy(){var n;this.template.events.updated.unsubscribe(this),this.template.events.nameChanged.unsubscribe(this),(n=this.subgraph)===null||n===void 0||n.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 n of this.subgraph.inputs)n.id in this.inputs?this.inputs[n.id].name=n.name:this.addInput(n.id,new nn(n.name,void 0));for(const n of Object.keys(this.inputs))this.subgraph.inputs.some(i=>i.id===n)||this.removeInput(n);for(const n of this.subgraph.outputs)n.id in this.outputs?this.outputs[n.id].name=n.name:this.addOutput(n.id,new nn(n.name,void 0));for(const n of Object.keys(this.outputs))this.subgraph.outputs.some(i=>i.id===n)||this.removeOutput(n);this.addOutput("_calculationResults",new nn("_calculationResults",void 0).setHidden(!0))}}}class hp{static fromGraph(e,n){return new hp(e.save(),n)}get name(){return this._name}set name(e){this._name=e,this.events.nameChanged.emit(e);const n=this.editor.nodeTypes.get(La(this));n&&(n.title=e)}get inputs(){return this.nodes.filter(n=>n.type===Da).map(n=>({id:n.graphInterfaceId,name:n.inputs.name.value,nodeId:n.id,nodeInterfaceId:n.outputs.placeholder.id}))}get outputs(){return this.nodes.filter(n=>n.type===ka).map(n=>({id:n.graphInterfaceId,name:n.inputs.name.value,nodeId:n.id,nodeInterfaceId:n.outputs.output.id}))}constructor(e,n){this.id=Gs(),this._name="Subgraph",this.events={nameChanged:new qt(this),updated:new qt(this)},this.hooks={beforeLoad:new li(this),afterSave:new li(this)},this.editor=n,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 n=new Map,i=f=>{const _=Gs();return n.set(f,_),_},s=f=>{const _=n.get(f);if(!_)throw new Error(`Unable to create graph from template: Could not map old id ${f} to new id`);return _},r=f=>bb(f,_=>({id:i(_.id),templateId:_.id,value:_.value})),o=this.nodes.map(f=>({...f,id:i(f.id),inputs:r(f.inputs),outputs:r(f.outputs)})),a=this.connections.map(f=>({id:i(f.id),from:s(f.from),to:s(f.to)})),l=this.inputs.map(f=>({id:f.id,name:f.name,nodeId:s(f.nodeId),nodeInterfaceId:s(f.nodeInterfaceId)})),u=this.outputs.map(f=>({id:f.id,name:f.name,nodeId:s(f.nodeId),nodeInterfaceId:s(f.nodeInterfaceId)})),d={id:Gs(),nodes:o,connections:a,inputs:l,outputs:u};return e||(e=new Sc(this.editor)),e.load(d).forEach(f=>console.warn(f)),e.template=this,e}}class HDt{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 qt(this),beforeRegisterNodeType:new Un(this),registerNodeType:new qt(this),beforeUnregisterNodeType:new Un(this),unregisterNodeType:new qt(this),beforeAddGraphTemplate:new Un(this),addGraphTemplate:new qt(this),beforeRemoveGraphTemplate:new Un(this),removeGraphTemplate:new qt(this),registerGraph:new qt(this),unregisterGraph:new qt(this)},this.hooks={save:new li(this),load:new li(this)},this.graphTemplateEvents=Qi(),this.graphTemplateHooks=Qi(),this.graphEvents=Qi(),this.graphHooks=Qi(),this.nodeEvents=Qi(),this.nodeHooks=Qi(),this.connectionEvents=Qi(),this._graphs=new Set,this._nodeTypes=new Map,this._graph=new Sc(this),this._graphTemplates=[],this._loading=!1,this.registerNodeType(PI),this.registerNodeType(UI)}registerNodeType(e,n){var i,s;if(this.events.beforeRegisterNodeType.emit({type:e,options:n}).prevented)return;const r=new e;this._nodeTypes.set(r.type,{type:e,category:(i=n==null?void 0:n.category)!==null&&i!==void 0?i:"default",title:(s=n==null?void 0:n.title)!==null&&s!==void 0?s:r.title}),this.events.registerNodeType.emit({type:e,options:n})}unregisterNodeType(e){const n=typeof e=="string"?e:new e().type;if(this.nodeTypes.has(n)){if(this.events.beforeUnregisterNodeType.emit(n).prevented)return;this._nodeTypes.delete(n),this.events.unregisterNodeType.emit(n)}}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 n=zDt(e);this.registerNodeType(n,{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 n=La(e);for(const i of[this.graph,...this.graphs.values()]){const s=i.nodes.filter(r=>r.type===n);for(const r of s)i.removeNode(r)}this.unregisterNodeType(n),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 hp(i,this);this.addGraphTemplate(s)});const n=this._graph.load(e.graph);return this.events.loaded.emit(),n.forEach(i=>console.warn(i)),n}finally{this._loading=!1}}save(){const e={graph:this.graph.save(),graphTemplates:this.graphTemplates.map(n=>n.save())};return this.hooks.save.execute(e)}}function qDt(t,e){const n=new Map;e.graphs.forEach(i=>{i.nodes.forEach(s=>n.set(s.id,s))}),t.forEach((i,s)=>{const r=n.get(s);r&&i.forEach((o,a)=>{const l=r.outputs[a];l&&(l.value=o)})})}class FI extends Error{constructor(){super("Cycle detected")}}function YDt(t){return typeof t=="string"}function BI(t,e){const n=new Map,i=new Map,s=new Map;let r,o;if(t instanceof Sc)r=t.nodes,o=t.connections;else{if(!e)throw new Error("Invalid argument value: expected array of connections");r=t,o=e}r.forEach(u=>{Object.values(u.inputs).forEach(d=>n.set(d.id,u.id)),Object.values(u.outputs).forEach(d=>n.set(d.id,u.id))}),r.forEach(u=>{const d=o.filter(f=>f.from&&n.get(f.from.id)===u.id),h=new Set(d.map(f=>n.get(f.to.id)).filter(YDt));i.set(u.id,h),s.set(u,d)});const a=r.slice();o.forEach(u=>{const d=a.findIndex(h=>n.get(u.to.id)===h.id);d>=0&&a.splice(d,1)});const l=[];for(;a.length>0;){const u=a.pop();l.push(u);const d=i.get(u.id);for(;d.size>0;){const h=d.values().next().value;if(d.delete(h),Array.from(i.values()).every(f=>!f.has(h))){const f=r.find(_=>_.id===h);a.push(f)}}}if(Array.from(i.values()).some(u=>u.size>0))throw new FI;return{calculationOrder:l,connectionsFromNode:s,interfaceIdToNodeId:n}}function $Dt(t,e){try{return BI(t,e),!1}catch(n){if(n instanceof FI)return!0;throw n}}var Kn;(function(t){t.Running="Running",t.Idle="Idle",t.Paused="Paused",t.Stopped="Stopped"})(Kn||(Kn={}));class WDt{get status(){return this.isRunning?Kn.Running:this.internalStatus}constructor(e){this.editor=e,this.events={beforeRun:new Un(this),afterRun:new qt(this),statusChange:new qt(this),beforeNodeCalculation:new qt(this),afterNodeCalculation:new qt(this)},this.hooks={gatherCalculationData:new li(this),transferData:new II},this.recalculateOrder=!0,this.internalStatus=Kn.Stopped,this.isRunning=!1,this.editor.nodeEvents.update.subscribe(this,(n,i)=>{i.graph&&!i.graph.loading&&i.graph.activeTransactions===0&&this.internalOnChange(i,n??void 0)}),this.editor.graphEvents.addNode.subscribe(this,(n,i)=>{this.recalculateOrder=!0,!i.loading&&i.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.removeNode.subscribe(this,(n,i)=>{this.recalculateOrder=!0,!i.loading&&i.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.addConnection.subscribe(this,(n,i)=>{this.recalculateOrder=!0,!i.loading&&i.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.removeConnection.subscribe(this,(n,i)=>{this.recalculateOrder=!0,!i.loading&&i.activeTransactions===0&&this.internalOnChange()}),this.editor.graphHooks.checkConnection.subscribe(this,n=>this.checkConnection(n.from,n.to))}start(){this.internalStatus===Kn.Stopped&&(this.internalStatus=Kn.Idle,this.events.statusChange.emit(this.status))}pause(){this.internalStatus===Kn.Idle&&(this.internalStatus=Kn.Paused,this.events.statusChange.emit(this.status))}resume(){this.internalStatus===Kn.Paused&&(this.internalStatus=Kn.Idle,this.events.statusChange.emit(this.status))}stop(){(this.internalStatus===Kn.Idle||this.internalStatus===Kn.Paused)&&(this.internalStatus=Kn.Stopped,this.events.statusChange.emit(this.status))}async runOnce(e,...n){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,...n);return this.events.afterRun.emit(i),i}finally{this.isRunning=!1,this.events.statusChange.emit(this.status)}}checkConnection(e,n){if(e.templateId){const r=this.findInterfaceByTemplateId(this.editor.graph.nodes,e.templateId);if(!r)return{connectionAllowed:!0,connectionsInDanger:[]};e=r}if(n.templateId){const r=this.findInterfaceByTemplateId(this.editor.graph.nodes,n.templateId);if(!r)return{connectionAllowed:!0,connectionsInDanger:[]};n=r}const i=new MI(e,n);let s=this.editor.graph.connections.slice();return n.allowMultipleConnections||(s=s.filter(r=>r.to!==n)),s.push(i),$Dt(this.editor.graph.nodes,s)?{connectionAllowed:!1,connectionsInDanger:[]}:{connectionAllowed:!0,connectionsInDanger:n.allowMultipleConnections?[]:this.editor.graph.connections.filter(r=>r.to===n)}}calculateOrder(){this.recalculateOrder=!0}async calculateWithoutData(...e){const n=this.hooks.gatherCalculationData.execute(void 0);return await this.runOnce(n,...e)}validateNodeCalculationOutput(e,n){if(typeof n!="object")throw new Error(`Invalid calculation return value from node ${e.id} (type ${e.type})`);Object.keys(e.outputs).forEach(i=>{if(!(i in n))throw new Error(`Calculation return value from node ${e.id} (type ${e.type}) is missing key "${i}"`)})}internalOnChange(e,n){this.internalStatus===Kn.Idle&&this.onChange(this.recalculateOrder,e,n)}findInterfaceByTemplateId(e,n){for(const i of e)for(const s of[...Object.values(i.inputs),...Object.values(i.outputs)])if(s.templateId===n)return s;return null}}class KDt extends WDt{constructor(e){super(e),this.order=new Map}start(){super.start(),this.recalculateOrder=!0,this.calculateWithoutData()}async runGraph(e,n,i){this.order.has(e.id)||this.order.set(e.id,BI(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,h])=>{l[d]=this.getInterfaceValue(n,h.id)}),this.events.beforeNodeCalculation.emit({inputValues:l,node:a});let u;if(a.calculate)u=await a.calculate(l,{globalValues:i,engine:this});else{u={};for(const[d,h]of Object.entries(a.outputs))u[d]=this.getInterfaceValue(n,h.id)}this.validateNodeCalculationOutput(a,u),this.events.afterNodeCalculation.emit({outputValues:u,node:a}),o.set(a.id,new Map(Object.entries(u))),r.has(a)&&r.get(a).forEach(d=>{var h;const f=(h=Object.entries(a.outputs).find(([,m])=>m.id===d.from.id))===null||h===void 0?void 0:h[0];if(!f)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 _=this.hooks.transferData.execute(u[f],d);d.to.allowMultipleConnections?n.has(d.to.id)?n.get(d.to.id).push(_):n.set(d.to.id,[_]):n.set(d.to.id,_)})}return o}async execute(e){this.recalculateOrder&&(this.order.clear(),this.recalculateOrder=!1);const n=this.getInputValues(this.editor.graph);return await this.runGraph(this.editor.graph,n,e)}getInputValues(e){const n=new Map;for(const i of e.nodes)Object.values(i.inputs).forEach(s=>{s.connectionCount===0&&n.set(s.id,s.value)}),i.calculate||Object.values(i.outputs).forEach(s=>{n.set(s.id,s.value)});return n}onChange(e){this.recalculateOrder=e||this.recalculateOrder,this.calculateWithoutData()}getInterfaceValue(e,n){if(!e.has(n))throw new Error(`Could not find value for interface ${n} -This is likely a Baklava internal issue. Please report it on GitHub.`);return e.get(n)}}let Eb=null;function KDt(t){Eb=t}function Oi(){if(!Eb)throw new Error("providePlugin() must be called before usePlugin()");return{viewModel:Eb}}function Ki(){const{viewModel:t}=Oi();return{graph:$d(t.value,"displayedGraph"),switchGraph:t.value.switchGraph}}function GI(t){const{graph:e}=Ki(),n=ft(null),i=ft(null);return{dragging:st(()=>!!n.value),onPointerDown:l=>{n.value={x:l.pageX,y:l.pageY},i.value={x:t.value.x,y:t.value.y}},onPointerMove:l=>{if(n.value){const u=l.pageX-n.value.x,d=l.pageY-n.value.y;t.value.x=i.value.x+u/e.value.scaling,t.value.y=i.value.y+d/e.value.scaling}},onPointerUp:()=>{n.value=null,i.value=null}}}function VI(t,e,n){if(!e.template)return!1;if(La(e.template)===n)return!0;const i=t.graphTemplates.find(r=>La(r)===n);return i?i.nodes.filter(r=>r.type.startsWith(lc)).some(r=>VI(t,e,r.type)):!1}function zI(t){return st(()=>{const e=Array.from(t.value.editor.nodeTypes.entries()),n=new Set(e.map(([,s])=>s.category)),i=[];for(const s of n.values()){let r=e.filter(([,o])=>o.category===s);t.value.displayedGraph.template?r=r.filter(([o])=>!VI(t.value.editor,t.value.displayedGraph,o)):r=r.filter(([o])=>![Da,ka].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 HI(){const{graph:t}=Ki();return{transform:(n,i)=>{const s=n/t.value.scaling-t.value.panning.x,r=i/t.value.scaling-t.value.panning.y;return[s,r]}}}function jDt(){const{graph:t}=Ki();let e=[],n=-1,i={x:0,y:0};const s=st(()=>t.value.panning),r=GI(s),o=st(()=>({"transform-origin":"0 0",transform:`scale(${t.value.scaling}) translate(${t.value.panning.x}px, ${t.value.panning.y}px)`})),a=(_,m,E)=>{const b=[_/t.value.scaling-t.value.panning.x,m/t.value.scaling-t.value.panning.y],g=[_/E-t.value.panning.x,m/E-t.value.panning.y],y=[g[0]-b[0],g[1]-b[1]];t.value.panning.x+=y[0],t.value.panning.y+=y[1],t.value.scaling=E},l=_=>{_.preventDefault();let m=_.deltaY;_.deltaMode===1&&(m*=32);const E=t.value.scaling*(1-m/3e3);a(_.offsetX,_.offsetY,E)},u=()=>({ax:e[0].clientX,ay:e[0].clientY,bx:e[1].clientX,by:e[1].clientY});return{styles:o,...r,onPointerDown:_=>{if(e.push(_),r.onPointerDown(_),e.length===2){const{ax:m,ay:E,bx:b,by:g}=u();i={x:m+(b-m)/2,y:E+(g-E)/2}}},onPointerMove:_=>{for(let m=0;m0){const C=t.value.scaling*(1+(S-n)/500);a(i.x,i.y,C)}n=S}else r.onPointerMove(_)},onPointerUp:_=>{e=e.filter(m=>m.pointerId!==_.pointerId),n=-1,r.onPointerUp()},onMouseWheel:l}}var Ei=(t=>(t[t.NONE=0]="NONE",t[t.ALLOWED=1]="ALLOWED",t[t.FORBIDDEN=2]="FORBIDDEN",t))(Ei||{});const qI=Symbol();function QDt(){const{graph:t}=Ki(),e=ft(null),n=ft(null),i=a=>{e.value&&(e.value.mx=a.offsetX/t.value.scaling-t.value.panning.x,e.value.my=a.offsetY/t.value.scaling-t.value.panning.y)},s=()=>{if(n.value){if(e.value)return;const a=t.value.connections.find(l=>l.to===n.value);n.value.isInput&&a?(e.value={status:Ei.NONE,from:a.from},t.value.removeConnection(a)):e.value={status:Ei.NONE,from:n.value},e.value.mx=void 0,e.value.my=void 0}},r=()=>{if(e.value&&n.value){if(e.value.from===n.value)return;t.value.addConnection(e.value.from,e.value.to)}e.value=null},o=a=>{if(n.value=a??null,a&&e.value){e.value.to=a;const l=t.value.checkConnection(e.value.from,e.value.to);if(e.value.status=l.connectionAllowed?Ei.ALLOWED:Ei.FORBIDDEN,l.connectionAllowed){const u=l.connectionsInDanger.map(d=>d.id);t.value.connections.forEach(d=>{u.includes(d.id)&&(d.isInDanger=!0)})}}else!a&&e.value&&(e.value.to=void 0,e.value.status=Ei.NONE,t.value.connections.forEach(l=>{l.isInDanger=!1}))};return sa(qI,{temporaryConnection:e,hoveredOver:o}),{temporaryConnection:e,onMouseMove:i,onMouseDown:s,onMouseUp:r,hoveredOver:o}}function XDt(t){const e=ft(!1),n=ft(0),i=ft(0),s=zI(t),{transform:r}=HI(),o=st(()=>{let d=[];const h={};for(const _ of s.value){const m=Object.entries(_.nodeTypes).map(([E,b])=>({label:b.title,value:"addNode:"+E}));_.name==="default"?d=m:h[_.name]=m}const f=[...Object.entries(h).map(([_,m])=>({label:_,submenu:m}))];return f.length>0&&d.length>0&&f.push({isDivider:!0}),f.push(...d),f}),a=st(()=>t.value.settings.contextMenu.additionalItems.length===0?o.value:[{label:"Add node",submenu:o.value},...t.value.settings.contextMenu.additionalItems.map(d=>"isDivider"in d||"submenu"in d?d:{label:d.label,value:"command:"+d.command,disabled:!t.value.commandHandler.canExecuteCommand(d.command)})]);function l(d){e.value=!0,n.value=d.offsetX,i.value=d.offsetY}function u(d){if(d.startsWith("addNode:")){const h=d.substring(8),f=t.value.editor.nodeTypes.get(h);if(!f)return;const _=ei(new f.type);t.value.displayedGraph.addNode(_);const[m,E]=r(n.value,i.value);_.position.x=m,_.position.y=E}else if(d.startsWith("command:")){const h=d.substring(8);t.value.commandHandler.canExecuteCommand(h)&&t.value.commandHandler.executeCommand(h)}}return{show:e,x:n,y:i,items:a,open:l,onClick:u}}const ZDt=_n({setup(){const{viewModel:t}=Oi(),{graph:e}=Ki();return{styles:st(()=>{const i=t.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`,u=e.value.scaling>i.subGridVisibleThreshold?`, ${a}px ${a}px, ${a}px ${a}px`:"";return{backgroundPosition:`left ${s}px top ${r}px`,backgroundSize:`${l} ${u}`}})}}}),hn=(t,e)=>{const n=t.__vccOpts||t;for(const[i,s]of e)n[i]=s;return n};function JDt(t,e,n,i,s,r){return w(),A("div",{class:"background",style:en(t.styles)},null,4)}const ekt=hn(ZDt,[["render",JDt]]);function tkt(t){return tR()?(NM(t),!0):!1}function uy(t){return typeof t=="function"?t():yt(t)}const YI=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const nkt=Object.prototype.toString,ikt=t=>nkt.call(t)==="[object Object]",Vd=()=>{},skt=rkt();function rkt(){var t,e;return YI&&((t=window==null?void 0:window.navigator)==null?void 0:t.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 okt(t,e,n=!1){return e.reduce((i,s)=>(s in t&&(!n||t[s]!==void 0)&&(i[s]=t[s]),i),{})}function akt(t,e={}){if(!fn(t))return d2(t);const n=Array.isArray(t.value)?Array.from({length:t.value.length}):{};for(const i in t.value)n[i]=c2(()=>({get(){return t.value[i]},set(s){var r;if((r=uy(e.replaceRef))!=null?r:!0)if(Array.isArray(t.value)){const a=[...t.value];a[i]=s,t.value=a}else{const a={...t.value,[i]:s};Object.setPrototypeOf(a,Object.getPrototypeOf(t.value)),t.value=a}else t.value[i]=s}}));return n}function Al(t){var e;const n=uy(t);return(e=n==null?void 0:n.$el)!=null?e:n}const py=YI?window:void 0;function Vl(...t){let e,n,i,s;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,i,s]=t,e=py):[e,n,i,s]=t,!e)return Vd;Array.isArray(n)||(n=[n]),Array.isArray(i)||(i=[i]);const r=[],o=()=>{r.forEach(d=>d()),r.length=0},a=(d,h,f,_)=>(d.addEventListener(h,f,_),()=>d.removeEventListener(h,f,_)),l=qn(()=>[Al(e),uy(s)],([d,h])=>{if(o(),!d)return;const f=ikt(h)?{...h}:h;r.push(...n.flatMap(_=>i.map(m=>a(d,_,m,f))))},{immediate:!0,flush:"post"}),u=()=>{l(),o()};return tkt(u),u}let Uw=!1;function $I(t,e,n={}){const{window:i=py,ignore:s=[],capture:r=!0,detectIframe:o=!1}=n;if(!i)return Vd;skt&&!Uw&&(Uw=!0,Array.from(i.document.body.children).forEach(f=>f.addEventListener("click",Vd)),i.document.documentElement.addEventListener("click",Vd));let a=!0;const l=f=>s.some(_=>{if(typeof _=="string")return Array.from(i.document.querySelectorAll(_)).some(m=>m===f.target||f.composedPath().includes(m));{const m=Al(_);return m&&(f.target===m||f.composedPath().includes(m))}}),d=[Vl(i,"click",f=>{const _=Al(t);if(!(!_||_===f.target||f.composedPath().includes(_))){if(f.detail===0&&(a=!l(f)),!a){a=!0;return}e(f)}},{passive:!0,capture:r}),Vl(i,"pointerdown",f=>{const _=Al(t);a=!l(f)&&!!(_&&!f.composedPath().includes(_))},{passive:!0}),o&&Vl(i,"blur",f=>{setTimeout(()=>{var _;const m=Al(t);((_=i.document.activeElement)==null?void 0:_.tagName)==="IFRAME"&&!(m!=null&&m.contains(i.document.activeElement))&&e(f)},0)})].filter(Boolean);return()=>d.forEach(f=>f())}const WI={x:0,y:0,pointerId:0,pressure:0,tiltX:0,tiltY:0,width:0,height:0,twist:0,pointerType:null},lkt=Object.keys(WI);function ckt(t={}){const{target:e=py}=t,n=ft(!1),i=ft(t.initialValue||{});Object.assign(i.value,WI,i.value);const s=r=>{n.value=!0,!(t.pointerTypes&&!t.pointerTypes.includes(r.pointerType))&&(i.value=okt(r,lkt,!1))};if(e){const r={passive:!0};Vl(e,["pointerdown","pointermove","pointerup"],s,r),Vl(e,"pointerleave",()=>n.value=!1,r)}return{...akt(i),isInside:n}}const dkt=["onMouseenter","onMouseleave","onClick"],ukt={class:"flex-fill"},pkt={key:0,class:"__submenu-icon",style:{"line-height":"1em"}},_kt=c("svg",{width:"13",height:"13",viewBox:"-60 120 250 250"},[c("path",{d:"M160.875 279.5625 L70.875 369.5625 L70.875 189.5625 L160.875 279.5625 Z",stroke:"none",fill:"white"})],-1),hkt=[_kt],_y=_n({__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(t,{emit:e}){const n=t,i=e;let s=null;const r=ft(null),o=ft(-1),a=ft(0),l=ft({x:!1,y:!1}),u=st(()=>n.flippable&&(l.value.x||n.isFlipped.x)),d=st(()=>n.flippable&&(l.value.y||n.isFlipped.y)),h=st(()=>{const y={};return n.isNested||(y.top=(d.value?n.y-a.value:n.y)+"px",y.left=n.x+"px"),y}),f=st(()=>({"--flipped-x":u.value,"--flipped-y":d.value,"--nested":n.isNested})),_=st(()=>n.items.map(y=>({...y,hover:!1})));qn([()=>n.y,()=>n.items],()=>{var y,v,S,C;a.value=n.items.length*30;const T=((v=(y=r.value)==null?void 0:y.parentElement)==null?void 0:v.offsetWidth)??0,O=((C=(S=r.value)==null?void 0:S.parentElement)==null?void 0:C.offsetHeight)??0;l.value.x=!n.isNested&&n.x>T*.75,l.value.y=!n.isNested&&n.y+a.value>O-20}),$I(r,()=>{n.modelValue&&i("update:modelValue",!1)});const m=y=>{!y.submenu&&y.value&&(i("click",y.value),i("update:modelValue",!1))},E=y=>{i("click",y),o.value=-1,n.isNested||i("update:modelValue",!1)},b=(y,v)=>{n.items[v].submenu&&(o.value=v,s!==null&&(clearTimeout(s),s=null))},g=(y,v)=>{n.items[v].submenu&&(s=window.setTimeout(()=>{o.value=-1,s=null},200))};return(y,v)=>{const S=mt("ContextMenu",!0);return w(),xt(cs,{name:"slide-fade"},{default:We(()=>[G(c("div",{ref_key:"el",ref:r,class:ze(["baklava-context-menu",f.value]),style:en(h.value)},[(w(!0),A(Ye,null,lt(_.value,(C,T)=>(w(),A(Ye,null,[C.isDivider?(w(),A("div",{key:`d-${T}`,class:"divider"})):(w(),A("div",{key:`i-${T}`,class:ze(["item",{submenu:!!C.submenu,"--disabled":!!C.disabled}]),onMouseenter:O=>b(O,T),onMouseleave:O=>g(O,T),onClick:be(O=>m(C),["stop","prevent"])},[c("div",ukt,he(C.label),1),C.submenu?(w(),A("div",pkt,hkt)):V("",!0),C.submenu?(w(),xt(S,{key:1,"model-value":o.value===T,items:C.submenu,"is-nested":!0,"is-flipped":{x:u.value,y:d.value},flippable:y.flippable,onClick:E},null,8,["model-value","items","is-flipped","flippable"])):V("",!0)],42,dkt))],64))),256))],6),[[Mt,y.modelValue]])]),_:1})}}}),fkt={},mkt={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"},gkt=c("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),bkt=c("circle",{cx:"12",cy:"12",r:"1"},null,-1),Ekt=c("circle",{cx:"12",cy:"19",r:"1"},null,-1),ykt=c("circle",{cx:"12",cy:"5",r:"1"},null,-1),vkt=[gkt,bkt,Ekt,ykt];function Skt(t,e){return w(),A("svg",mkt,vkt)}const KI=hn(fkt,[["render",Skt]]),Tkt=["id"],xkt={key:0,class:"__tooltip"},Ckt={key:2,class:"align-middle"},Fw=_n({__name:"NodeInterface",props:{node:{},intf:{}},setup(t){const e=(b,g=100)=>{const y=b!=null&&b.toString?b.toString():"";return y.length>g?y.slice(0,g)+"...":y},n=t,{viewModel:i}=Oi(),{hoveredOver:s,temporaryConnection:r}=Vi(qI),o=ft(null),a=st(()=>n.intf.connectionCount>0),l=ft(!1),u=st(()=>i.value.settings.displayValueOnHover&&l.value),d=st(()=>({"--input":n.intf.isInput,"--output":!n.intf.isInput,"--connected":a.value})),h=st(()=>n.intf.component&&(!n.intf.isInput||!n.intf.port||n.intf.connectionCount===0)),f=()=>{l.value=!0,s(n.intf)},_=()=>{l.value=!1,s(void 0)},m=()=>{o.value&&i.value.hooks.renderInterface.execute({intf:n.intf,el:o.value})},E=()=>{const b=i.value.displayedGraph.sidebar;b.nodeId=n.node.id,b.optionName=n.intf.name,b.visible=!0};return Ws(m),uc(m),(b,g)=>{var y;return w(),A("div",{id:b.intf.id,ref_key:"el",ref:o,class:ze(["baklava-node-interface",d.value])},[b.intf.port?(w(),A("div",{key:0,class:ze(["__port",{"--selected":((y=yt(r))==null?void 0:y.from)===b.intf}]),onPointerover:f,onPointerout:_},[kn(b.$slots,"portTooltip",{showTooltip:u.value},()=>[u.value===!0?(w(),A("span",xkt,he(e(b.intf.value)),1)):V("",!0)])],34)):V("",!0),h.value?(w(),xt(Lu(b.intf.component),{key:1,modelValue:b.intf.value,"onUpdate:modelValue":g[0]||(g[0]=v=>b.intf.value=v),node:b.node,intf:b.intf,onOpenSidebar:E},null,40,["modelValue","node","intf"])):(w(),A("span",Ckt,he(b.intf.name),1))],10,Tkt)}}}),wkt=["id","data-node-type"],Rkt={class:"__title-label"},Akt={class:"__menu"},Nkt={class:"__outputs"},Okt={class:"__inputs"},Ikt=_n({__name:"Node",props:{node:{},selected:{type:Boolean,default:!1},dragging:{type:Boolean}},emits:["select","start-drag"],setup(t,{emit:e}){const n=t,i=e,{viewModel:s}=Oi(),{graph:r,switchGraph:o}=Ki(),a=ft(null),l=ft(!1),u=ft(""),d=ft(null),h=ft(!1),f=ft(!1),_=st(()=>{const F=[{value:"rename",label:"Rename"},{value:"delete",label:"Delete"}];return n.node.type.startsWith(lc)&&F.push({value:"editSubgraph",label:"Edit Subgraph"}),F}),m=st(()=>({"--selected":n.selected,"--dragging":n.dragging,"--two-column":!!n.node.twoColumn})),E=st(()=>{var F,B;return{top:`${((F=n.node.position)==null?void 0:F.y)??0}px`,left:`${((B=n.node.position)==null?void 0:B.x)??0}px`,"--width":`${n.node.width??s.value.settings.nodes.defaultWidth}px`}}),b=st(()=>Object.values(n.node.inputs).filter(F=>!F.hidden)),g=st(()=>Object.values(n.node.outputs).filter(F=>!F.hidden)),y=()=>{i("select")},v=F=>{n.selected||y(),i("start-drag",F)},S=()=>{f.value=!0},C=async F=>{var B;switch(F){case"delete":r.value.removeNode(n.node);break;case"rename":u.value=n.node.title,l.value=!0,await Ge(),(B=d.value)==null||B.focus();break;case"editSubgraph":o(n.node.template);break}},T=()=>{n.node.title=u.value,l.value=!1},O=()=>{a.value&&s.value.hooks.renderNode.execute({node:n.node,el:a.value})},k=F=>{h.value=!0,F.preventDefault()},x=F=>{if(!h.value)return;const B=n.node.width+F.movementX/r.value.scaling,ne=s.value.settings.nodes.minWidth,L=s.value.settings.nodes.maxWidth;n.node.width=Math.max(ne,Math.min(L,B))},I=()=>{h.value=!1};return Ws(()=>{O(),window.addEventListener("mousemove",x),window.addEventListener("mouseup",I)}),uc(O),Va(()=>{window.removeEventListener("mousemove",x),window.removeEventListener("mouseup",I)}),(F,B)=>(w(),A("div",{id:F.node.id,ref_key:"el",ref:a,class:ze(["baklava-node",m.value]),style:en(E.value),"data-node-type":F.node.type,onPointerdown:y},[yt(s).settings.nodes.resizable?(w(),A("div",{key:0,class:"__resize-handle",onMousedown:k},null,32)):V("",!0),kn(F.$slots,"title",{},()=>[c("div",{class:"__title",onPointerdown:be(v,["self","stop"])},[l.value?G((w(),A("input",{key:1,ref_key:"renameInputEl",ref:d,"onUpdate:modelValue":B[1]||(B[1]=ne=>u.value=ne),type:"text",class:"baklava-input",placeholder:"Node Name",onBlur:T,onKeydown:Hs(T,["enter"])},null,544)),[[we,u.value]]):(w(),A(Ye,{key:0},[c("div",Rkt,he(F.node.title),1),c("div",Akt,[Te(KI,{class:"--clickable",onClick:S}),Te(_y,{modelValue:f.value,"onUpdate:modelValue":B[0]||(B[0]=ne=>f.value=ne),x:0,y:0,items:_.value,onClick:C},null,8,["modelValue","items"])])],64))],32)]),kn(F.$slots,"content",{},()=>[c("div",{class:"__content",onKeydown:B[2]||(B[2]=Hs(be(()=>{},["stop"]),["delete"]))},[c("div",Nkt,[(w(!0),A(Ye,null,lt(g.value,ne=>kn(F.$slots,"nodeInterface",{key:ne.id,type:"output",node:F.node,intf:ne},()=>[Te(Fw,{node:F.node,intf:ne},null,8,["node","intf"])])),128))]),c("div",Okt,[(w(!0),A(Ye,null,lt(b.value,ne=>kn(F.$slots,"nodeInterface",{key:ne.id,type:"input",node:F.node,intf:ne},()=>[Te(Fw,{node:F.node,intf:ne},null,8,["node","intf"])])),128))])],32)])],46,wkt))}}),Mkt=_n({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:Ei.NONE},isTemporary:{type:Boolean,default:!1}},setup(t){const{viewModel:e}=Oi(),{graph:n}=Ki(),i=(o,a)=>{const l=(o+n.value.panning.x)*n.value.scaling,u=(a+n.value.panning.y)*n.value.scaling;return[l,u]},s=st(()=>{const[o,a]=i(t.x1,t.y1),[l,u]=i(t.x2,t.y2);if(e.value.settings.useStraightConnections)return`M ${o} ${a} L ${l} ${u}`;{const d=.3*Math.abs(o-l);return`M ${o} ${a} C ${o+d} ${a}, ${l-d} ${u}, ${l} ${u}`}}),r=st(()=>({"--temporary":t.isTemporary,"--allowed":t.state===Ei.ALLOWED,"--forbidden":t.state===Ei.FORBIDDEN}));return{d:s,classes:r}}}),Dkt=["d"];function kkt(t,e,n,i,s,r){return w(),A("path",{class:ze(["baklava-connection",t.classes]),d:t.d},null,10,Dkt)}const jI=hn(Mkt,[["render",kkt]]);function Lkt(t){return document.getElementById(t.id)}function Pa(t){const e=document.getElementById(t.id),n=e==null?void 0:e.getElementsByClassName("__port");return{node:(e==null?void 0:e.closest(".baklava-node"))??null,interface:e,port:n&&n.length>0?n[0]:null}}const Pkt=_n({components:{"connection-view":jI},props:{connection:{type:Object,required:!0}},setup(t){const{graph:e}=Ki();let n;const i=ft({x1:0,y1:0,x2:0,y2:0}),s=st(()=>t.connection.isInDanger?Ei.FORBIDDEN:Ei.NONE),r=st(()=>{var u;return(u=e.value.findNodeById(t.connection.from.nodeId))==null?void 0:u.position}),o=st(()=>{var u;return(u=e.value.findNodeById(t.connection.to.nodeId))==null?void 0:u.position}),a=u=>u.node&&u.interface&&u.port?[u.node.offsetLeft+u.interface.offsetLeft+u.port.offsetLeft+u.port.clientWidth/2,u.node.offsetTop+u.interface.offsetTop+u.port.offsetTop+u.port.clientHeight/2]:[0,0],l=()=>{const u=Pa(t.connection.from),d=Pa(t.connection.to);u.node&&d.node&&(n||(n=new ResizeObserver(()=>{l()}),n.observe(u.node),n.observe(d.node)));const[h,f]=a(u),[_,m]=a(d);i.value={x1:h,y1:f,x2:_,y2:m}};return Ws(async()=>{await Ge(),l()}),Va(()=>{n&&n.disconnect()}),qn([r,o],()=>l(),{deep:!0}),{d:i,state:s}}});function Ukt(t,e,n,i,s,r){const o=mt("connection-view");return w(),xt(o,{x1:t.d.x1,y1:t.d.y1,x2:t.d.x2,y2:t.d.y2,state:t.state},null,8,["x1","y1","x2","y2","state"])}const Fkt=hn(Pkt,[["render",Ukt]]);function yu(t){return t.node&&t.interface&&t.port?[t.node.offsetLeft+t.interface.offsetLeft+t.port.offsetLeft+t.port.clientWidth/2,t.node.offsetTop+t.interface.offsetTop+t.port.offsetTop+t.port.clientHeight/2]:[0,0]}const Bkt=_n({components:{"connection-view":jI},props:{connection:{type:Object,required:!0}},setup(t){const e=st(()=>t.connection?t.connection.status:Ei.NONE);return{d:st(()=>{if(!t.connection)return{input:[0,0],output:[0,0]};const i=yu(Pa(t.connection.from)),s=t.connection.to?yu(Pa(t.connection.to)):[t.connection.mx||i[0],t.connection.my||i[1]];return t.connection.from.isInput?{input:s,output:i}:{input:i,output:s}}),status:e}}});function Gkt(t,e,n,i,s,r){const o=mt("connection-view");return w(),xt(o,{x1:t.d.input[0],y1:t.d.input[1],x2:t.d.output[0],y2:t.d.output[1],state:t.status,"is-temporary":""},null,8,["x1","y1","x2","y2","state"])}const Vkt=hn(Bkt,[["render",Gkt]]),zkt=_n({setup(){const{viewModel:t}=Oi(),{graph:e}=Ki(),n=ft(null),i=$d(t.value.settings.sidebar,"width"),s=st(()=>t.value.settings.sidebar.resizable),r=st(()=>{const h=e.value.sidebar.nodeId;return e.value.nodes.find(f=>f.id===h)}),o=st(()=>({width:`${i.value}px`})),a=st(()=>r.value?[...Object.values(r.value.inputs),...Object.values(r.value.outputs)].filter(f=>f.displayInSidebar&&f.component):[]),l=()=>{e.value.sidebar.visible=!1},u=()=>{window.addEventListener("mousemove",d),window.addEventListener("mouseup",()=>{window.removeEventListener("mousemove",d)},{once:!0})},d=h=>{var f,_;const m=((_=(f=n.value)==null?void 0:f.parentElement)==null?void 0:_.getBoundingClientRect().width)??500;let E=i.value-h.movementX;E<300?E=300:E>.9*m&&(E=.9*m),i.value=E};return{el:n,graph:e,resizable:s,node:r,styles:o,displayedInterfaces:a,startResize:u,close:l}}}),Hkt={class:"__header"},qkt={class:"__node-name"};function Ykt(t,e,n,i,s,r){return w(),A("div",{ref:"el",class:ze(["baklava-sidebar",{"--open":t.graph.sidebar.visible}]),style:en(t.styles)},[t.resizable?(w(),A("div",{key:0,class:"__resizer",onMousedown:e[0]||(e[0]=(...o)=>t.startResize&&t.startResize(...o))},null,32)):V("",!0),c("div",Hkt,[c("button",{tabindex:"-1",class:"__close",onClick:e[1]||(e[1]=(...o)=>t.close&&t.close(...o))},"×"),c("div",qkt,[c("b",null,he(t.node?t.node.title:""),1)])]),(w(!0),A(Ye,null,lt(t.displayedInterfaces,o=>(w(),A("div",{key:o.id,class:"__interface"},[(w(),xt(Lu(o.component),{modelValue:o.value,"onUpdate:modelValue":a=>o.value=a,node:t.node,intf:o},null,8,["modelValue","onUpdate:modelValue","node","intf"]))]))),128))],6)}const $kt=hn(zkt,[["render",Ykt]]),Wkt=_n({__name:"Minimap",setup(t){const{viewModel:e}=Oi(),{graph:n}=Ki(),i=ft(null),s=ft(!1);let r,o=!1,a={x1:0,y1:0,x2:0,y2:0},l;const u=()=>{var T,O;if(!r)return;r.canvas.width=i.value.offsetWidth,r.canvas.height=i.value.offsetHeight;const k=new Map,x=new Map;for(const L of n.value.nodes){const $=Lkt(L),H=($==null?void 0:$.offsetWidth)??0,U=($==null?void 0:$.offsetHeight)??0,Q=((T=L.position)==null?void 0:T.x)??0,J=((O=L.position)==null?void 0:O.y)??0;k.set(L,{x1:Q,y1:J,x2:Q+H,y2:J+U}),x.set(L,$)}const I={x1:Number.MAX_SAFE_INTEGER,y1:Number.MAX_SAFE_INTEGER,x2:Number.MIN_SAFE_INTEGER,y2:Number.MIN_SAFE_INTEGER};for(const L of k.values())L.x1I.x2&&(I.x2=L.x2),L.y2>I.y2&&(I.y2=L.y2);const F=50;I.x1-=F,I.y1-=F,I.x2+=F,I.y2+=F,a=I;const B=r.canvas.width/r.canvas.height,ne=(a.x2-a.x1)/(a.y2-a.y1);if(B>ne){const L=(B-ne)*(a.y2-a.y1)*.5;a.x1-=L,a.x2+=L}else{const L=a.x2-a.x1,$=a.y2-a.y1,H=(L-B*$)/B*.5;a.y1-=H,a.y2+=H}r.clearRect(0,0,r.canvas.width,r.canvas.height),r.strokeStyle="white";for(const L of n.value.connections){const[$,H]=yu(Pa(L.from)),[U,Q]=yu(Pa(L.to)),[J,j]=d($,H),[ae,ve]=d(U,Q);if(r.beginPath(),r.moveTo(J,j),e.value.settings.useStraightConnections)r.lineTo(ae,ve);else{const ee=.3*Math.abs(J-ae);r.bezierCurveTo(J+ee,j,ae-ee,ve,ae,ve)}r.stroke()}r.strokeStyle="lightgray";for(const[L,$]of k.entries()){const[H,U]=d($.x1,$.y1),[Q,J]=d($.x2,$.y2);r.fillStyle=f(x.get(L)),r.beginPath(),r.rect(H,U,Q-H,J-U),r.fill(),r.stroke()}if(s.value){const L=m(),[$,H]=d(L.x1,L.y1),[U,Q]=d(L.x2,L.y2);r.fillStyle="rgba(255, 255, 255, 0.2)",r.fillRect($,H,U-$,Q-H)}},d=(T,O)=>[(T-a.x1)/(a.x2-a.x1)*r.canvas.width,(O-a.y1)/(a.y2-a.y1)*r.canvas.height],h=(T,O)=>[T*(a.x2-a.x1)/r.canvas.width+a.x1,O*(a.y2-a.y1)/r.canvas.height+a.y1],f=T=>{if(T){const O=T.querySelector(".__content");if(O){const x=_(O);if(x)return x}const k=_(T);if(k)return k}return"gray"},_=T=>{const O=getComputedStyle(T).backgroundColor;if(O&&O!=="rgba(0, 0, 0, 0)")return O},m=()=>{const T=i.value.parentElement.offsetWidth,O=i.value.parentElement.offsetHeight,k=T/n.value.scaling-n.value.panning.x,x=O/n.value.scaling-n.value.panning.y;return{x1:-n.value.panning.x,y1:-n.value.panning.y,x2:k,y2:x}},E=T=>{T.button===0&&(o=!0,b(T))},b=T=>{if(o){const[O,k]=h(T.offsetX,T.offsetY),x=m(),I=(x.x2-x.x1)/2,F=(x.y2-x.y1)/2;n.value.panning.x=-(O-I),n.value.panning.y=-(k-F)}},g=()=>{o=!1},y=()=>{s.value=!0},v=()=>{s.value=!1,g()};qn([s,n.value.panning,()=>n.value.scaling,()=>n.value.connections.length],()=>{u()});const S=st(()=>n.value.nodes.map(T=>T.position)),C=st(()=>n.value.nodes.map(T=>T.width));return qn([S,C],()=>{u()},{deep:!0}),Ws(()=>{r=i.value.getContext("2d"),r.imageSmoothingQuality="high",u(),l=setInterval(u,500)}),Va(()=>{clearInterval(l)}),(T,O)=>(w(),A("canvas",{ref_key:"canvas",ref:i,class:"baklava-minimap",onMouseenter:y,onMouseleave:v,onMousedown:be(E,["self"]),onMousemove:be(b,["self"]),onMouseup:g},null,544))}}),Kkt=_n({components:{ContextMenu:_y,VerticalDots:KI},props:{type:{type:String,required:!0},title:{type:String,required:!0}},setup(t){const{viewModel:e}=Oi(),{switchGraph:n}=Ki(),i=ft(!1),s=st(()=>t.type.startsWith(lc));return{showContextMenu:i,hasContextMenu:s,contextMenuItems:[{label:"Edit Subgraph",value:"editSubgraph"},{label:"Delete Subgraph",value:"deleteSubgraph"}],openContextMenu:()=>{i.value=!0},onContextMenuClick:l=>{const u=t.type.substring(lc.length),d=e.value.editor.graphTemplates.find(h=>h.id===u);if(d)switch(l){case"editSubgraph":n(d);break;case"deleteSubgraph":e.value.editor.removeGraphTemplate(d);break}}}}}),jkt=["data-node-type"],Qkt={class:"__title"},Xkt={class:"__title-label"},Zkt={key:0,class:"__menu"};function Jkt(t,e,n,i,s,r){const o=mt("vertical-dots"),a=mt("context-menu");return w(),A("div",{class:"baklava-node --palette","data-node-type":t.type},[c("div",Qkt,[c("div",Xkt,he(t.title),1),t.hasContextMenu?(w(),A("div",Zkt,[Te(o,{class:"--clickable",onPointerdown:e[0]||(e[0]=be(()=>{},["stop","prevent"])),onClick:be(t.openContextMenu,["stop","prevent"])},null,8,["onClick"]),Te(a,{modelValue:t.showContextMenu,"onUpdate:modelValue":e[1]||(e[1]=l=>t.showContextMenu=l),x:-100,y:0,items:t.contextMenuItems,onClick:t.onContextMenuClick,onPointerdown:e[2]||(e[2]=be(()=>{},["stop","prevent"]))},null,8,["modelValue","items","onClick"])])):V("",!0)])],8,jkt)}const Bw=hn(Kkt,[["render",Jkt]]),eLt={class:"baklava-node-palette"},tLt={key:0},nLt=_n({__name:"NodePalette",setup(t){const{viewModel:e}=Oi(),{x:n,y:i}=ckt(),{transform:s}=HI(),r=zI(e),o=Vi("editorEl"),a=ft(null),l=st(()=>{if(!a.value||!(o!=null&&o.value))return{};const{left:d,top:h}=o.value.getBoundingClientRect();return{top:`${i.value-h}px`,left:`${n.value-d}px`}}),u=(d,h)=>{a.value={type:d,nodeInformation:h};const f=()=>{const _=ei(new h.type);e.value.displayedGraph.addNode(_);const m=o.value.getBoundingClientRect(),[E,b]=s(n.value-m.left,i.value-m.top);_.position.x=E,_.position.y=b,a.value=null,document.removeEventListener("pointerup",f)};document.addEventListener("pointerup",f)};return(d,h)=>(w(),A(Ye,null,[c("div",eLt,[(w(!0),A(Ye,null,lt(yt(r),f=>(w(),A("section",{key:f.name},[f.name!=="default"?(w(),A("h1",tLt,he(f.name),1)):V("",!0),(w(!0),A(Ye,null,lt(f.nodeTypes,(_,m)=>(w(),xt(Bw,{key:m,type:m,title:_.title,onPointerdown:E=>u(m,_)},null,8,["type","title","onPointerdown"]))),128))]))),128))]),Te(cs,{name:"fade"},{default:We(()=>[a.value?(w(),A("div",{key:0,class:"baklava-dragged-node",style:en(l.value)},[Te(Bw,{type:a.value.type,title:a.value.nodeInformation.title},null,8,["type","title"])],4)):V("",!0)]),_:1})],64))}});let Cd;const iLt=new Uint8Array(16);function sLt(){if(!Cd&&(Cd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Cd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Cd(iLt)}const wn=[];for(let t=0;t<256;++t)wn.push((t+256).toString(16).slice(1));function rLt(t,e=0){return wn[t[e+0]]+wn[t[e+1]]+wn[t[e+2]]+wn[t[e+3]]+"-"+wn[t[e+4]]+wn[t[e+5]]+"-"+wn[t[e+6]]+wn[t[e+7]]+"-"+wn[t[e+8]]+wn[t[e+9]]+"-"+wn[t[e+10]]+wn[t[e+11]]+wn[t[e+12]]+wn[t[e+13]]+wn[t[e+14]]+wn[t[e+15]]}const oLt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Gw={randomUUID:oLt};function vu(t,e,n){if(Gw.randomUUID&&!e&&!t)return Gw.randomUUID();t=t||{};const i=t.random||(t.rng||sLt)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){n=n||0;for(let s=0;s<16;++s)e[n+s]=i[s];return e}return rLt(i)}const cc="SAVE_SUBGRAPH";function aLt(t,e){const n=()=>{const i=t.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(cc,{canExecute:()=>{var i;return t.value!==((i=t.value.editor)==null?void 0:i.graph)},execute:n})}const lLt={},cLt={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"},dLt=c("polyline",{points:"6 9 12 15 18 9"},null,-1),uLt=[dLt];function pLt(t,e){return w(),A("svg",cLt,uLt)}const _Lt=hn(lLt,[["render",pLt]]),hLt=_n({components:{"i-arrow":_Lt},props:{intf:{type:Object,required:!0}},setup(t){const e=ft(null),n=ft(!1),i=st(()=>t.intf.items.find(o=>typeof o=="string"?o===t.intf.value:o.value===t.intf.value)),s=st(()=>i.value?typeof i.value=="string"?i.value:i.value.text:""),r=o=>{t.intf.value=typeof o=="string"?o:o.value};return $I(e,()=>{n.value=!1}),{el:e,open:n,selectedItem:i,selectedText:s,setSelected:r}}}),fLt=["title"],mLt={class:"__selected"},gLt={class:"__text"},bLt={class:"__icon"},ELt={class:"__dropdown"},yLt={class:"item --header"},vLt=["onClick"];function SLt(t,e,n,i,s,r){const o=mt("i-arrow");return w(),A("div",{ref:"el",class:ze(["baklava-select",{"--open":t.open}]),title:t.intf.name,onClick:e[0]||(e[0]=a=>t.open=!t.open)},[c("div",mLt,[c("div",gLt,he(t.selectedText),1),c("div",bLt,[Te(o)])]),Te(cs,{name:"slide-fade"},{default:We(()=>[G(c("div",ELt,[c("div",yLt,he(t.intf.name),1),(w(!0),A(Ye,null,lt(t.intf.items,(a,l)=>(w(),A("div",{key:l,class:ze(["item",{"--active":a===t.selectedItem}]),onClick:u=>t.setSelected(a)},he(typeof a=="string"?a:a.text),11,vLt))),128))],512),[[Mt,t.open]])]),_:1})],10,fLt)}const TLt=hn(hLt,[["render",SLt]]);class xLt extends nn{constructor(e,n,i){super(e,n),this.component=dc(TLt),this.items=i}}const CLt=_n({props:{intf:{type:Object,required:!0}}});function wLt(t,e,n,i,s,r){return w(),A("div",null,he(t.intf.value),1)}const RLt=hn(CLt,[["render",wLt]]);class ALt extends nn{constructor(e,n){super(e,n),this.component=dc(RLt),this.setPort(!1)}}const NLt=_n({props:{intf:{type:Object,required:!0},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(t,{emit:e}){return{v:st({get:()=>t.modelValue,set:i=>{e("update:modelValue",i)}})}}}),OLt=["placeholder","title"];function ILt(t,e,n,i,s,r){return w(),A("div",null,[G(c("input",{"onUpdate:modelValue":e[0]||(e[0]=o=>t.v=o),type:"text",class:"baklava-input",placeholder:t.intf.name,title:t.intf.name},null,8,OLt),[[we,t.v]])])}const MLt=hn(NLt,[["render",ILt]]);class Tc extends nn{constructor(){super(...arguments),this.component=dc(MLt)}}class QI extends PI{constructor(){super(...arguments),this._title="Subgraph Input",this.inputs={name:new Tc("Name","Input").setPort(!1)},this.outputs={placeholder:new nn("Connection",void 0)}}}class XI extends UI{constructor(){super(...arguments),this._title="Subgraph Output",this.inputs={name:new Tc("Name","Output").setPort(!1),placeholder:new nn("Connection",void 0)},this.outputs={output:new nn("Output",void 0).setHidden(!0)}}}const ZI="CREATE_SUBGRAPH",Vw=[Da,ka];function DLt(t,e,n){const i=()=>t.value.selectedNodes.filter(r=>!Vw.includes(r.type)).length>0,s=()=>{const{viewModel:r}=Oi(),o=t.value,a=t.value.editor;if(o.selectedNodes.length===0)return;const l=o.selectedNodes.filter(x=>!Vw.includes(x.type)),u=l.flatMap(x=>Object.values(x.inputs)),d=l.flatMap(x=>Object.values(x.outputs)),h=o.connections.filter(x=>!d.includes(x.from)&&u.includes(x.to)),f=o.connections.filter(x=>d.includes(x.from)&&!u.includes(x.to)),_=o.connections.filter(x=>d.includes(x.from)&&u.includes(x.to)),m=l.map(x=>x.save()),E=_.map(x=>({id:x.id,from:x.from.id,to:x.to.id})),b=new Map,{xLeft:g,xRight:y,yTop:v}=kLt(l);console.log(g,y,v);for(const[x,I]of h.entries()){const F=new QI;F.inputs.name.value=I.to.name,m.push({...F.save(),position:{x:y-r.value.settings.nodes.defaultWidth-100,y:v+x*200}}),E.push({id:vu(),from:F.outputs.placeholder.id,to:I.to.id}),b.set(I.to.id,F.graphInterfaceId)}for(const[x,I]of f.entries()){const F=new XI;F.inputs.name.value=I.from.name,m.push({...F.save(),position:{x:g+100,y:v+x*200}}),E.push({id:vu(),from:I.from.id,to:F.inputs.placeholder.id}),b.set(I.from.id,F.graphInterfaceId)}const S=ei(new hp({connections:E,nodes:m,inputs:[],outputs:[]},a));a.addGraphTemplate(S);const C=a.nodeTypes.get(La(S));if(!C)throw new Error("Unable to create subgraph: Could not find corresponding graph node type");const T=ei(new C.type);o.addNode(T);const O=Math.round(l.map(x=>x.position.x).reduce((x,I)=>x+I,0)/l.length),k=Math.round(l.map(x=>x.position.y).reduce((x,I)=>x+I,0)/l.length);T.position.x=O,T.position.y=k,h.forEach(x=>{o.removeConnection(x),o.addConnection(x.from,T.inputs[b.get(x.to.id)])}),f.forEach(x=>{o.removeConnection(x),o.addConnection(T.outputs[b.get(x.from.id)],x.to)}),l.forEach(x=>o.removeNode(x)),e.canExecuteCommand(cc)&&e.executeCommand(cc),n(S),t.value.panning={...o.panning},t.value.scaling=o.scaling};e.registerCommand(ZI,{canExecute:i,execute:s})}function kLt(t){const e=t.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:n}}const zw="DELETE_NODES";function LLt(t,e){e.registerCommand(zw,{canExecute:()=>t.value.selectedNodes.length>0,execute(){t.value.selectedNodes.forEach(n=>t.value.removeNode(n))}}),e.registerHotkey(["Delete"],zw)}const JI="SWITCH_TO_MAIN_GRAPH";function PLt(t,e,n){e.registerCommand(JI,{canExecute:()=>t.value!==t.value.editor.graph,execute:()=>{e.executeCommand(cc),n(t.value.editor.graph)}})}function ULt(t,e,n){LLt(t,e),DLt(t,e,n),aLt(t,e),PLt(t,e,n)}class Hw{constructor(e,n){this.type=e,e==="addNode"?this.nodeId=n:this.nodeState=n}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 n=e.editor.nodeTypes.get(this.nodeState.type);if(!n)return;const i=new n.type;e.addNode(i),i.load(this.nodeState),this.nodeId=i.id}removeNode(e){const n=e.nodes.find(i=>i.id===this.nodeId);n&&(this.nodeState=n.save(),e.removeNode(n))}}class qw{constructor(e,n){if(this.type=e,e==="addConnection")this.connectionId=n;else{const i=n;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 n=e.findNodeInterface(this.connectionState.from),i=e.findNodeInterface(this.connectionState.to);!n||!i||e.addConnection(n,i)}removeConnection(e){const n=e.connections.find(i=>i.id===this.connectionId);n&&(this.connectionState={id:n.id,from:n.from.id,to:n.to.id},e.removeConnection(n))}}class FLt{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 n=this.steps.length-1;n>=0;n--)this.steps[n].undo(e)}redo(e){for(let n=0;n{if(!r.value)if(a.value)l.value.push(b);else for(o.value!==s.value.length-1&&(s.value=s.value.slice(0,o.value+1)),s.value.push(b),o.value++;s.value.length>i.value;)s.value.shift()},d=()=>{a.value=!0},h=()=>{a.value=!1,l.value.length>0&&(u(new FLt(l.value)),l.value=[])},f=()=>s.value.length!==0&&o.value!==-1,_=()=>{f()&&(r.value=!0,s.value[o.value--].undo(t.value),r.value=!1)},m=()=>s.value.length!==0&&o.value{m()&&(r.value=!0,s.value[++o.value].redo(t.value),r.value=!1)};return qn(t,(b,g)=>{g&&(g.events.addNode.unsubscribe(n),g.events.removeNode.unsubscribe(n),g.events.addConnection.unsubscribe(n),g.events.removeConnection.unsubscribe(n)),b&&(b.events.addNode.subscribe(n,y=>{u(new Hw("addNode",y.id))}),b.events.removeNode.subscribe(n,y=>{u(new Hw("removeNode",y.save()))}),b.events.addConnection.subscribe(n,y=>{u(new qw("addConnection",y.id))}),b.events.removeConnection.subscribe(n,y=>{u(new qw("removeConnection",y))}))},{immediate:!0}),e.registerCommand(yb,{canExecute:f,execute:_}),e.registerCommand(vb,{canExecute:m,execute:E}),e.registerCommand(eM,{canExecute:()=>!a.value,execute:d}),e.registerCommand(tM,{canExecute:()=>a.value,execute:h}),e.registerHotkey(["Control","z"],yb),e.registerHotkey(["Control","y"],vb),ei({maxSteps:i})}const Sb="COPY",Tb="PASTE",GLt="CLEAR_CLIPBOARD";function VLt(t,e,n){const i=Symbol("ClipboardToken"),s=ft(""),r=ft(""),o=st(()=>!s.value),a=()=>{s.value="",r.value=""},l=()=>{const h=t.value.selectedNodes.flatMap(_=>[...Object.values(_.inputs),...Object.values(_.outputs)]),f=t.value.connections.filter(_=>h.includes(_.from)||h.includes(_.to)).map(_=>({from:_.from.id,to:_.to.id}));r.value=JSON.stringify(f),s.value=JSON.stringify(t.value.selectedNodes.map(_=>_.save()))},u=(h,f,_)=>{for(const m of h){let E;if((!_||_==="input")&&(E=Object.values(m.inputs).find(b=>b.id===f)),!E&&(!_||_==="output")&&(E=Object.values(m.outputs).find(b=>b.id===f)),E)return E}},d=()=>{if(o.value)return;const h=new Map,f=JSON.parse(s.value),_=JSON.parse(r.value),m=[],E=[],b=t.value;n.executeCommand(eM);for(const g of f){const y=e.value.nodeTypes.get(g.type);if(!y){console.warn(`Node type ${g.type} not registered`);return}const v=new y.type,S=v.id;m.push(v),v.hooks.beforeLoad.subscribe(i,C=>{const T=C;return T.position&&(T.position.x+=100,T.position.y+=100),v.hooks.beforeLoad.unsubscribe(i),T}),b.addNode(v),v.load({...g,id:S}),v.id=S,h.set(g.id,S);for(const C of Object.values(v.inputs)){const T=vu();h.set(C.id,T),C.id=T}for(const C of Object.values(v.outputs)){const T=vu();h.set(C.id,T),C.id=T}}for(const g of _){const y=u(m,h.get(g.from),"output"),v=u(m,h.get(g.to),"input");if(!y||!v)continue;const S=b.addConnection(y,v);S&&E.push(S)}return t.value.selectedNodes=m,n.executeCommand(tM),{newNodes:m,newConnections:E}};return n.registerCommand(Sb,{canExecute:()=>t.value.selectedNodes.length>0,execute:l}),n.registerHotkey(["Control","c"],Sb),n.registerCommand(Tb,{canExecute:()=>!o.value,execute:d}),n.registerHotkey(["Control","v"],Tb),n.registerCommand(GLt,{canExecute:()=>!0,execute:a}),ei({isEmpty:o})}const zLt="OPEN_SIDEBAR";function HLt(t,e){e.registerCommand(zLt,{execute:n=>{t.value.sidebar.nodeId=n,t.value.sidebar.visible=!0},canExecute:()=>!0})}function qLt(t,e){HLt(t,e)}const YLt={},$Lt={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"},WLt=c("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),KLt=c("path",{d:"M9 13l-4 -4l4 -4m-4 4h11a4 4 0 0 1 0 8h-1"},null,-1),jLt=[WLt,KLt];function QLt(t,e){return w(),A("svg",$Lt,jLt)}const XLt=hn(YLt,[["render",QLt]]),ZLt={},JLt={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"},ePt=c("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),tPt=c("path",{d:"M15 13l4 -4l-4 -4m4 4h-11a4 4 0 0 0 0 8h1"},null,-1),nPt=[ePt,tPt];function iPt(t,e){return w(),A("svg",JLt,nPt)}const sPt=hn(ZLt,[["render",iPt]]),rPt={},oPt={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"},aPt=c("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),lPt=c("line",{x1:"5",y1:"12",x2:"19",y2:"12"},null,-1),cPt=c("line",{x1:"5",y1:"12",x2:"11",y2:"18"},null,-1),dPt=c("line",{x1:"5",y1:"12",x2:"11",y2:"6"},null,-1),uPt=[aPt,lPt,cPt,dPt];function pPt(t,e){return w(),A("svg",oPt,uPt)}const _Pt=hn(rPt,[["render",pPt]]),hPt={},fPt={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"},mPt=c("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),gPt=c("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),bPt=c("rect",{x:"9",y:"3",width:"6",height:"4",rx:"2"},null,-1),EPt=[mPt,gPt,bPt];function yPt(t,e){return w(),A("svg",fPt,EPt)}const vPt=hn(hPt,[["render",yPt]]),SPt={},TPt={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"},xPt=c("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),CPt=c("rect",{x:"8",y:"8",width:"12",height:"12",rx:"2"},null,-1),wPt=c("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),RPt=[xPt,CPt,wPt];function APt(t,e){return w(),A("svg",TPt,RPt)}const NPt=hn(SPt,[["render",APt]]),OPt={},IPt={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"},MPt=c("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),DPt=c("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),kPt=c("circle",{cx:"12",cy:"14",r:"2"},null,-1),LPt=c("polyline",{points:"14 4 14 8 8 8 8 4"},null,-1),PPt=[MPt,DPt,kPt,LPt];function UPt(t,e){return w(),A("svg",IPt,PPt)}const FPt=hn(OPt,[["render",UPt]]),BPt={},GPt={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"},VPt=Vb('',6),zPt=[VPt];function HPt(t,e){return w(),A("svg",GPt,zPt)}const qPt=hn(BPt,[["render",HPt]]),YPt=_n({props:{command:{type:String,required:!0},title:{type:String,required:!0},icon:{type:Object,required:!1,default:void 0}},setup(){const{viewModel:t}=Oi();return{viewModel:t}}}),$Pt=["disabled","title"];function WPt(t,e,n,i,s,r){return w(),A("button",{class:"baklava-toolbar-entry baklava-toolbar-button",disabled:!t.viewModel.commandHandler.canExecuteCommand(t.command),title:t.title,onClick:e[0]||(e[0]=o=>t.viewModel.commandHandler.executeCommand(t.command))},[t.icon?(w(),xt(Lu(t.icon),{key:0})):(w(),A(Ye,{key:1},[et(he(t.title),1)],64))],8,$Pt)}const KPt=hn(YPt,[["render",WPt]]),jPt=_n({components:{ToolbarButton:KPt},setup(){const{viewModel:t}=Oi();return{isSubgraph:st(()=>t.value.displayedGraph!==t.value.editor.graph),commands:[{command:Sb,title:"Copy",icon:NPt},{command:Tb,title:"Paste",icon:vPt},{command:yb,title:"Undo",icon:XLt},{command:vb,title:"Redo",icon:sPt},{command:ZI,title:"Create Subgraph",icon:qPt}],subgraphCommands:[{command:cc,title:"Save Subgraph",icon:FPt},{command:JI,title:"Back to Main Graph",icon:_Pt}]}}}),QPt={class:"baklava-toolbar"};function XPt(t,e,n,i,s,r){const o=mt("toolbar-button");return w(),A("div",QPt,[(w(!0),A(Ye,null,lt(t.commands,a=>(w(),xt(o,{key:a.command,command:a.command,title:a.title,icon:a.icon},null,8,["command","title","icon"]))),128)),t.isSubgraph?(w(!0),A(Ye,{key:0},lt(t.subgraphCommands,a=>(w(),xt(o,{key:a.command,command:a.command,title:a.title,icon:a.icon},null,8,["command","title","icon"]))),128)):V("",!0)])}const ZPt=hn(jPt,[["render",XPt]]),JPt={class:"connections-container"},eUt=_n({__name:"Editor",props:{viewModel:{}},setup(t){const e=t,n=Symbol("EditorToken"),i=$d(e,"viewModel");KDt(i);const s=ft(null);sa("editorEl",s);const r=st(()=>e.viewModel.displayedGraph.nodes),o=st(()=>e.viewModel.displayedGraph.nodes.map(O=>GI($d(O,"position")))),a=st(()=>e.viewModel.displayedGraph.connections),l=st(()=>e.viewModel.displayedGraph.selectedNodes),u=jDt(),d=QDt(),h=XDt(i),f=st(()=>({...u.styles.value})),_=ft(0);e.viewModel.editor.hooks.load.subscribe(n,O=>(_.value++,O));const m=O=>{u.onPointerMove(O),d.onMouseMove(O)},E=O=>{O.button===0&&(O.target===s.value&&(S(),u.onPointerDown(O)),d.onMouseDown())},b=O=>{u.onPointerUp(O),d.onMouseUp()},g=O=>{O.key==="Tab"&&O.preventDefault(),e.viewModel.commandHandler.handleKeyDown(O)},y=O=>{e.viewModel.commandHandler.handleKeyUp(O)},v=O=>{["Control","Shift"].some(k=>e.viewModel.commandHandler.pressedKeys.includes(k))||S(),e.viewModel.displayedGraph.selectedNodes.push(O)},S=()=>{e.viewModel.displayedGraph.selectedNodes=[]},C=O=>{for(const k of e.viewModel.displayedGraph.selectedNodes){const x=r.value.indexOf(k),I=o.value[x];I.onPointerDown(O),document.addEventListener("pointermove",I.onPointerMove)}document.addEventListener("pointerup",T)},T=()=>{for(const O of e.viewModel.displayedGraph.selectedNodes){const k=r.value.indexOf(O),x=o.value[k];x.onPointerUp(),document.removeEventListener("pointermove",x.onPointerMove)}document.removeEventListener("pointerup",T)};return(O,k)=>(w(),A("div",{ref_key:"el",ref:s,tabindex:"-1",class:ze(["baklava-editor",{"baklava-ignore-mouse":!!yt(d).temporaryConnection.value||yt(u).dragging.value,"--temporary-connection":!!yt(d).temporaryConnection.value}]),onPointermove:be(m,["self"]),onPointerdown:E,onPointerup:b,onWheel:k[1]||(k[1]=be((...x)=>yt(u).onMouseWheel&&yt(u).onMouseWheel(...x),["self"])),onKeydown:g,onKeyup:y,onContextmenu:k[2]||(k[2]=be((...x)=>yt(h).open&&yt(h).open(...x),["self","prevent"]))},[kn(O.$slots,"background",{},()=>[Te(ekt)]),kn(O.$slots,"toolbar",{},()=>[Te(ZPt)]),kn(O.$slots,"palette",{},()=>[Te(nLt)]),(w(),A("svg",JPt,[(w(!0),A(Ye,null,lt(a.value,x=>(w(),A("g",{key:x.id+_.value.toString()},[kn(O.$slots,"connection",{connection:x},()=>[Te(Fkt,{connection:x},null,8,["connection"])])]))),128)),kn(O.$slots,"temporaryConnection",{temporaryConnection:yt(d).temporaryConnection.value},()=>[yt(d).temporaryConnection.value?(w(),xt(Vkt,{key:0,connection:yt(d).temporaryConnection.value},null,8,["connection"])):V("",!0)])])),c("div",{class:"node-container",style:en(f.value)},[Te(os,{name:"fade"},{default:We(()=>[(w(!0),A(Ye,null,lt(r.value,(x,I)=>kn(O.$slots,"node",{key:x.id+_.value.toString(),node:x,selected:l.value.includes(x),dragging:o.value[I].dragging.value,onSelect:F=>v(x),onStartDrag:C},()=>[Te(Ikt,{node:x,selected:l.value.includes(x),dragging:o.value[I].dragging.value,onSelect:F=>v(x),onStartDrag:C},null,8,["node","selected","dragging","onSelect"])])),128))]),_:3})],4),kn(O.$slots,"sidebar",{},()=>[Te($kt)]),kn(O.$slots,"minimap",{},()=>[O.viewModel.settings.enableMinimap?(w(),xt(Wkt,{key:0})):V("",!0)]),kn(O.$slots,"contextMenu",{contextMenu:yt(h)},()=>[O.viewModel.settings.contextMenu.enabled?(w(),xt(_y,{key:0,modelValue:yt(h).show.value,"onUpdate:modelValue":k[0]||(k[0]=x=>yt(h).show.value=x),items:yt(h).items.value,x:yt(h).x.value,y:yt(h).y.value,onClick:yt(h).onClick},null,8,["modelValue","items","x","y","onClick"])):V("",!0)])],34))}}),tUt=["INPUT","TEXTAREA","SELECT"];function nUt(t){const e=ft([]),n=ft([]);return{pressedKeys:e,handleKeyDown:o=>{var a;e.value.includes(o.key)||e.value.push(o.key),!tUt.includes(((a=document.activeElement)==null?void 0:a.tagName)??"")&&n.value.forEach(l=>{l.keys.every(u=>e.value.includes(u))&&t(l.commandName)})},handleKeyUp:o=>{const a=e.value.indexOf(o.key);a>=0&&e.value.splice(a,1)},registerHotkey:(o,a)=>{n.value.push({keys:o,commandName:a})}}}const iUt=()=>{const t=ft(new Map),e=(r,o)=>{if(t.value.has(r))throw new Error(`Command "${r}" already exists`);t.value.set(r,o)},n=(r,o=!1,...a)=>{if(!t.value.has(r)){if(o)throw new Error(`[CommandHandler] Command ${r} not registered`);return}return t.value.get(r).execute(...a)},i=(r,o=!1,...a)=>{if(!t.value.has(r)){if(o)throw new Error(`[CommandHandler] Command ${r} not registered`);return!1}return t.value.get(r).canExecute(a)},s=nUt(n);return ei({registerCommand:e,executeCommand:n,canExecuteCommand:i,...s})},sUt=t=>!(t instanceof Sc);function rUt(t,e){return{switchGraph:i=>{let s;if(sUt(i))s=new Sc(t.value),i.createGraph(s);else{if(i!==t.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!==t.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 oUt(t,e){t.position=t.position??{x:0,y:0},t.disablePointerEvents=!1,t.twoColumn=t.twoColumn??!1,t.width=t.width??e.defaultWidth}const aUt=()=>({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 lUt(t){const e=ft(t??new zDt),n=Symbol("ViewModelToken"),i=ft(null),s=s2(i),{switchGraph:r}=rUt(e,i),o=st(()=>s.value&&s.value!==e.value.graph),a=ei(aUt()),l=iUt(),u=BLt(s,l),d=VLt(s,e,l),h={renderNode:new li(null),renderInterface:new li(null)};return ULt(s,l,r),qLt(s,l),qn(e,(f,_)=>{_&&(_.events.registerGraph.unsubscribe(n),_.graphEvents.beforeAddNode.unsubscribe(n),f.nodeHooks.beforeLoad.unsubscribe(n),f.nodeHooks.afterSave.unsubscribe(n),f.graphTemplateHooks.beforeLoad.unsubscribe(n),f.graphTemplateHooks.afterSave.unsubscribe(n),f.graph.hooks.load.unsubscribe(n),f.graph.hooks.save.unsubscribe(n)),f&&(f.nodeHooks.beforeLoad.subscribe(n,(m,E)=>(E.position=m.position??{x:0,y:0},E.width=m.width??a.nodes.defaultWidth,E.twoColumn=m.twoColumn??!1,m)),f.nodeHooks.afterSave.subscribe(n,(m,E)=>(m.position=E.position,m.width=E.width,m.twoColumn=E.twoColumn,m)),f.graphTemplateHooks.beforeLoad.subscribe(n,(m,E)=>(E.panning=m.panning,E.scaling=m.scaling,m)),f.graphTemplateHooks.afterSave.subscribe(n,(m,E)=>(m.panning=E.panning,m.scaling=E.scaling,m)),f.graph.hooks.load.subscribe(n,(m,E)=>(E.panning=m.panning,E.scaling=m.scaling,m)),f.graph.hooks.save.subscribe(n,(m,E)=>(m.panning=E.panning,m.scaling=E.scaling,m)),f.graphEvents.beforeAddNode.subscribe(n,m=>oUt(m,{defaultWidth:a.nodes.defaultWidth})),e.value.registerNodeType(QI,{category:"Subgraphs"}),e.value.registerNodeType(XI,{category:"Subgraphs"}),r(f.graph))},{immediate:!0}),ei({editor:e,displayedGraph:s,isSubgraph:o,settings:a,commandHandler:l,history:u,clipboard:d,hooks:h,switchGraph:r})}const cUt=Ja({type:"PersonalityNode",title:"Personality",inputs:{request:()=>new nn("Request",""),agent_name:()=>new xLt("Personality","",Su.state.config.personalities).setPort(!1)},outputs:{response:()=>new nn("Response","")},async calculate({request:t}){console.log(Su.state.config.personalities);let e="";try{e=(await Se.post("/generate",{params:{text:t}})).data}catch(n){console.error(n)}return{display:e,response:e}}}),dUt=Ja({type:"RAGNode",title:"RAG",inputs:{request:()=>new nn("Prompt",""),document_path:()=>new Tc("Document path","").setPort(!1)},outputs:{prompt:()=>new nn("Prompt with Data","")},async calculate({request:t,document_path:e}){let n="";try{n=(await Se.get("/rag",{params:{text:t,doc_path:e}})).data}catch(i){console.error(i)}return{response:n}}}),Yw=Ja({type:"Task",title:"Task",inputs:{description:()=>new Tc("Task description","").setPort(!1)},outputs:{prompt:()=>new nn("Prompt")},calculate({description:t}){return{prompt:t}}}),$w=Ja({type:"TextDisplayNode",title:"TextDisplay",inputs:{text2display:()=>new nn("Input","")},outputs:{response:()=>new ALt("Text","")},async calculate({request:t}){}}),Ww=Ja({type:"LLMNode",title:"LLM",inputs:{request:()=>new nn("Request","")},outputs:{response:()=>new nn("Response","")},async calculate({request:t}){console.log(Su.state.config.personalities);let e="";try{e=(await Se.post("/generate",{params:{text:t}})).data}catch(n){console.error(n)}return{display:e,response:e}}}),uUt=Ja({type:"MultichoiceNode",title:"Multichoice",inputs:{question:()=>new nn("Question",""),outputs:()=>new Tc("choices, one per line","","").setPort(!1)},outputs:{response:()=>new nn("Response","")}}),pUt=_n({components:{"baklava-editor":eUt},setup(){const t=lUt(),e=new WDt(t.editor);t.editor.registerNodeType(cUt),t.editor.registerNodeType(Yw),t.editor.registerNodeType(dUt),t.editor.registerNodeType($w),t.editor.registerNodeType(Ww),t.editor.registerNodeType(uUt);const n=Symbol();e.events.afterRun.subscribe(n,a=>{e.pause(),HDt(a,t.editor),e.resume()}),e.start();function i(a,l,u){const d=new a;return t.displayedGraph.addNode(d),d.position.x=l,d.position.y=u,d}const s=i(Yw,300,140),r=i(Ww,550,140),o=i($w,850,140);return t.displayedGraph.addConnection(s.outputs.prompt,r.inputs.request),t.displayedGraph.addConnection(r.outputs.response,o.inputs.text2display),{baklava:t,saveGraph:()=>{const a=e.export();localStorage.setItem("myGraph",JSON.stringify(a))},loadGraph:()=>{const a=JSON.parse(localStorage.getItem("myGraph"));e.import(a)}}}}),_Ut={style:{width:"100vw",height:"100vh"}};function hUt(t,e,n,i,s,r){const o=mt("baklava-editor");return w(),A("div",_Ut,[Te(o,{"view-model":t.baklava},null,8,["view-model"]),c("button",{onClick:e[0]||(e[0]=(...a)=>t.saveGraph&&t.saveGraph(...a))},"Save Graph"),c("button",{onClick:e[1]||(e[1]=(...a)=>t.loadGraph&&t.loadGraph(...a))},"Load Graph")])}const fUt=bt(pUt,[["render",hUt]]),mUt={},gUt={style:{width:"100vw",height:"100vh"}},bUt=["src"];function EUt(t,e,n,i,s,r){return w(),A("div",gUt,[c("iframe",{src:t.$store.state.config.comfyui_base_url,class:"m-0 p-0 w-full h-full"},null,8,bUt)])}const yUt=bt(mUt,[["render",EUt]]),vUt={},SUt={style:{width:"100vw",height:"100vh"}},TUt=["src"];function xUt(t,e,n,i,s,r){return w(),A("div",SUt,[c("iframe",{src:t.$store.state.config.sd_base_url,class:"m-0 p-0 w-full h-full"},null,8,TUt)])}const CUt=bt(vUt,[["render",xUt]]),wUt=HP({history:aP("/"),routes:[{path:"/auto_sd_view/",name:"AutoSD",component:CUt},{path:"/autosd_view/",name:"ComfyUI",component:yUt},{path:"/playground/",name:"playground",component:Rtt},{path:"/extensions/",name:"extensions",component:Ftt},{path:"/help_view/",name:"help_view",component:qtt},{path:"/settings/",name:"settings",component:qbt},{path:"/training/",name:"training",component:uEt},{path:"/quantizing/",name:"quantizing",component:yEt},{path:"/",name:"discussions",component:ywt},{path:"/",name:"interactive",component:LDt},{path:"/",name:"nodes",component:fUt}]});const fp=jD(RZe);console.log("Loaded main.js");function RUt(t){const e={};for(const n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}const Su=vk({state(){return{is_rt_on:!1,language:"english",languages:[],currentTheme:"",personality_editor:null,showPersonalityEditor:!1,selectedPersonality:null,currentPersonConfig:{ai_name:"",ai_author:"",ai_category:"",ai_language:"",ai_description:"",ai_conditionning:"",ai_disclaimer:"",ai_icon:null},posts_headers:{accept:"application/json","Content-Type":"application/json"},client_id:"",yesNoDialog:null,universalForm:null,toast:null,news:null,messageBox:null,api_get_req:null,api_post_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:[],bindingsZoo:[],modelsArr:[],selectedModel:null,personalities:[],diskUsage:null,ramUsage:null,vramUsage:null,modelsZoo:[],installedModels:[],installedBindings:[],currentModel:null,currentBinding:null,databases:[]}},mutations:{setisRTOn(t,e){t.is_rt_on=e},setLanguages(t,e){t.languages=e},setLanguage(t,e){t.language=e},setIsReady(t,e){t.ready=e},setIsConnected(t,e){t.isConnected=e},setIsModelOk(t,e){t.isModelOk=e},setIsGenerating(t,e){t.isGenerating=e},setConfig(t,e){t.config=e},setPersonalities(t,e){t.personalities=e},setMountedPers(t,e){t.mountedPers=e},setMountedPersArr(t,e){t.mountedPersArr=e},setbindingsZoo(t,e){t.bindingsZoo=e},setModelsArr(t,e){t.modelsArr=e},setselectedModel(t,e){t.selectedModel=e},setDiskUsage(t,e){t.diskUsage=e},setRamUsage(t,e){t.ramUsage=e},setVramUsage(t,e){t.vramUsage=e},setModelsZoo(t,e){t.modelsZoo=e},setCurrentBinding(t,e){t.currentBinding=e},setCurrentModel(t,e){t.currentModel=e},setDatabases(t,e){t.databases=e},setTheme(t){this.currentTheme=t}},getters:{getisRTOn(t){return t.is_rt_on},getLanguages(t){return t.languages},getLanguage(t){return t.language},getIsConnected(t){return t.isConnected},getIsModelOk(t){return t.isModelOk},getIsGenerating(t){return t.isGenerating},getConfig(t){return t.config},getPersonalities(t){return t.personalities},getMountedPersArr(t){return t.mountedPersArr},getMountedPers(t){return t.mountedPers},getbindingsZoo(t){return t.bindingsZoo},getModelsArr(t){return t.modelsArr},getDiskUsage(t){return t.diskUsage},getRamUsage(t){return t.ramUsage},getVramUsage(t){return t.vramUsage},getDatabasesList(t){return t.databases},getModelsZoo(t){return t.modelsZoo},getCyrrentBinding(t){return t.currentBinding},getCurrentModel(t){return t.currentModel}},actions:{async getVersion(){try{let t=await Se.get("/get_lollms_webui_version",{});t&&(this.state.version=t.data,console.log("version res:",t),console.log("version :",this.state.version))}catch{console.log("Coudln't get version")}},async refreshConfig({commit:t}){console.log("Fetching configuration");try{const e=await ki("get_config");e.active_personality_id<0&&(e.active_personality_id=0);let n=e.personalities[e.active_personality_id].split("/");e.personality_category=n[0],e.personality_folder=n[1],console.log("Recovered config"),console.log(e),console.log("Committing config"),console.log(e),console.log(this.state.config),t("setConfig",e)}catch(e){console.log(e.message,"refreshConfig")}},async refreshDatabase({commit:t}){let e=await ki("list_databases");console.log("databases:",e),t("setDatabases",e)},async fetchisRTOn({commit:t}){console.log("is_rt_on",this.state.client_id);const e=await Se.get("/is_rt_on");console.log("response",e);const n=e.data.status;console.log("is_rt_on",n),t("setRTOn",n)},async fetchLanguages({commit:t}){console.log("get_personality_languages_list",this.state.client_id);const e=await Se.post("/get_personality_languages_list",{client_id:this.state.client_id});console.log("response",e);const n=e.data;console.log("languages",n),t("setLanguages",n)},async fetchLanguage({commit:t}){console.log("get_personality_language",this.state.client_id);const e=await Se.post("/get_personality_language",{client_id:this.state.client_id});console.log("response",e);const n=e.data;console.log("language",n),t("setLanguage",n)},async changeLanguage({commit:t},e){console.log("Changing language to ",e);let n=await Se.post("/set_personality_language",{client_id:this.state.client_id,language:e});console.log("get_personality_languages_list",this.state.client_id),n=await Se.post("/get_personality_languages_list",{client_id:this.state.client_id}),console.log("response",n);const i=n.data;console.log("languages",i),t("setLanguages",i),n=await Se.post("/get_personality_language",{client_id:this.state.client_id}),console.log("response",n);const s=n.data;console.log("language",s),t("setLanguage",s),console.log("Language changed successfully:",n.data.message)},async deleteLanguage({commit:t},e){console.log("Deleting ",e);let n=await Se.post("/del_personality_language",{client_id:this.state.client_id,language:e});console.log("get_personality_languages_list",this.state.client_id),n=await Se.post("/get_personality_languages_list",{client_id:this.state.client_id}),console.log("response",n);const i=n.data;console.log("languages",i),t("setLanguages",i),n=await Se.post("/get_personality_language",{client_id:this.state.client_id}),console.log("response",n);const s=n.data;console.log("language",s),t("setLanguage",s),console.log("Language changed successfully:",n.data.message)},async refreshPersonalitiesZoo({commit:t}){let e=[];const n=await ki("get_all_personalities"),i=Object.keys(n);console.log("Personalities recovered:"+this.state.config.personalities);for(let s=0;s{let u=!1;for(const h of this.state.config.personalities)if(h.includes(r+"/"+l.folder))if(u=!0,h.includes(":")){const f=h.split(":");l.language=f[1]}else l.language=null;let d={};return d=l,d.category=r,d.full_path=r+"/"+l.folder,d.isMounted=u,d});e.length==0?e=a:e=e.concat(a)}e.sort((s,r)=>s.name.localeCompare(r.name)),t("setPersonalities",e),console.log("Done loading personalities")},refreshMountedPersonalities({commit:t}){this.state.config.active_personality_id<0&&(this.state.config.active_personality_id=0);let e=[];const n=[];for(let i=0;ia.full_path==s||a.full_path==r[0]);if(o>=0){let a=RUt(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 n.push(i),console.log("Couldn't load personality : ",s)}for(let i=n.length-1;i>=0;i--)console.log("Removing personality : ",this.state.config.personalities[n[i]]),this.state.config.personalities.splice(n[i],1),this.state.config.active_personality_id>n[i]&&(this.state.config.active_personality_id-=1);t("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:t}){let e=await ki("list_bindings");console.log("Loaded bindings zoo :",e),this.state.installedBindings=e.filter(i=>i.installed),console.log("Loaded bindings zoo ",this.state.installedBindings),t("setbindingsZoo",e);const n=e.findIndex(i=>i.name==this.state.config.binding_name);n!=-1&&t("setCurrentBinding",e[n])},async refreshModelsZoo({commit:t}){console.log("Fetching models");const n=(await Se.get("/get_available_models")).data.filter(i=>i.variants&&i.variants.length>0);console.log(`get_available_models: ${n}`),t("setModelsZoo",n)},async refreshModelStatus({commit:t}){let e=await ki("get_model_status");t("setIsModelOk",e.status)},async refreshModels({commit:t}){console.log("Fetching models");let e=await ki("list_models");console.log(`Found ${e}`);let n=await ki("get_active_model");console.log("Selected model ",n),n!=null&&t("setselectedModel",n.model),t("setModelsArr",e),console.log("setModelsArr",e),console.log("this.state.modelsZoo",this.state.modelsZoo),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&&t("setCurrentModel",this.state.modelsZoo[i])},async refreshDiskUsage({commit:t}){this.state.diskUsage=await ki("disk_usage")},async refreshRamUsage({commit:t}){this.state.ramUsage=await ki("ram_usage")},async refreshVramUsage({commit:t}){const e=await ki("vram_usage"),n=[];if(e.nb_gpus>0){for(let s=0;s!!n.value),onPointerDown:l=>{n.value={x:l.pageX,y:l.pageY},i.value={x:t.value.x,y:t.value.y}},onPointerMove:l=>{if(n.value){const u=l.pageX-n.value.x,d=l.pageY-n.value.y;t.value.x=i.value.x+u/e.value.scaling,t.value.y=i.value.y+d/e.value.scaling}},onPointerUp:()=>{n.value=null,i.value=null}}}function VI(t,e,n){if(!e.template)return!1;if(La(e.template)===n)return!0;const i=t.graphTemplates.find(r=>La(r)===n);return i?i.nodes.filter(r=>r.type.startsWith(lc)).some(r=>VI(t,e,r.type)):!1}function zI(t){return st(()=>{const e=Array.from(t.value.editor.nodeTypes.entries()),n=new Set(e.map(([,s])=>s.category)),i=[];for(const s of n.values()){let r=e.filter(([,o])=>o.category===s);t.value.displayedGraph.template?r=r.filter(([o])=>!VI(t.value.editor,t.value.displayedGraph,o)):r=r.filter(([o])=>![Da,ka].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 HI(){const{graph:t}=Ki();return{transform:(n,i)=>{const s=n/t.value.scaling-t.value.panning.x,r=i/t.value.scaling-t.value.panning.y;return[s,r]}}}function QDt(){const{graph:t}=Ki();let e=[],n=-1,i={x:0,y:0};const s=st(()=>t.value.panning),r=GI(s),o=st(()=>({"transform-origin":"0 0",transform:`scale(${t.value.scaling}) translate(${t.value.panning.x}px, ${t.value.panning.y}px)`})),a=(_,m,E)=>{const b=[_/t.value.scaling-t.value.panning.x,m/t.value.scaling-t.value.panning.y],g=[_/E-t.value.panning.x,m/E-t.value.panning.y],y=[g[0]-b[0],g[1]-b[1]];t.value.panning.x+=y[0],t.value.panning.y+=y[1],t.value.scaling=E},l=_=>{_.preventDefault();let m=_.deltaY;_.deltaMode===1&&(m*=32);const E=t.value.scaling*(1-m/3e3);a(_.offsetX,_.offsetY,E)},u=()=>({ax:e[0].clientX,ay:e[0].clientY,bx:e[1].clientX,by:e[1].clientY});return{styles:o,...r,onPointerDown:_=>{if(e.push(_),r.onPointerDown(_),e.length===2){const{ax:m,ay:E,bx:b,by:g}=u();i={x:m+(b-m)/2,y:E+(g-E)/2}}},onPointerMove:_=>{for(let m=0;m0){const C=t.value.scaling*(1+(S-n)/500);a(i.x,i.y,C)}n=S}else r.onPointerMove(_)},onPointerUp:_=>{e=e.filter(m=>m.pointerId!==_.pointerId),n=-1,r.onPointerUp()},onMouseWheel:l}}var Ei=(t=>(t[t.NONE=0]="NONE",t[t.ALLOWED=1]="ALLOWED",t[t.FORBIDDEN=2]="FORBIDDEN",t))(Ei||{});const qI=Symbol();function XDt(){const{graph:t}=Ki(),e=ft(null),n=ft(null),i=a=>{e.value&&(e.value.mx=a.offsetX/t.value.scaling-t.value.panning.x,e.value.my=a.offsetY/t.value.scaling-t.value.panning.y)},s=()=>{if(n.value){if(e.value)return;const a=t.value.connections.find(l=>l.to===n.value);n.value.isInput&&a?(e.value={status:Ei.NONE,from:a.from},t.value.removeConnection(a)):e.value={status:Ei.NONE,from:n.value},e.value.mx=void 0,e.value.my=void 0}},r=()=>{if(e.value&&n.value){if(e.value.from===n.value)return;t.value.addConnection(e.value.from,e.value.to)}e.value=null},o=a=>{if(n.value=a??null,a&&e.value){e.value.to=a;const l=t.value.checkConnection(e.value.from,e.value.to);if(e.value.status=l.connectionAllowed?Ei.ALLOWED:Ei.FORBIDDEN,l.connectionAllowed){const u=l.connectionsInDanger.map(d=>d.id);t.value.connections.forEach(d=>{u.includes(d.id)&&(d.isInDanger=!0)})}}else!a&&e.value&&(e.value.to=void 0,e.value.status=Ei.NONE,t.value.connections.forEach(l=>{l.isInDanger=!1}))};return sa(qI,{temporaryConnection:e,hoveredOver:o}),{temporaryConnection:e,onMouseMove:i,onMouseDown:s,onMouseUp:r,hoveredOver:o}}function ZDt(t){const e=ft(!1),n=ft(0),i=ft(0),s=zI(t),{transform:r}=HI(),o=st(()=>{let d=[];const h={};for(const _ of s.value){const m=Object.entries(_.nodeTypes).map(([E,b])=>({label:b.title,value:"addNode:"+E}));_.name==="default"?d=m:h[_.name]=m}const f=[...Object.entries(h).map(([_,m])=>({label:_,submenu:m}))];return f.length>0&&d.length>0&&f.push({isDivider:!0}),f.push(...d),f}),a=st(()=>t.value.settings.contextMenu.additionalItems.length===0?o.value:[{label:"Add node",submenu:o.value},...t.value.settings.contextMenu.additionalItems.map(d=>"isDivider"in d||"submenu"in d?d:{label:d.label,value:"command:"+d.command,disabled:!t.value.commandHandler.canExecuteCommand(d.command)})]);function l(d){e.value=!0,n.value=d.offsetX,i.value=d.offsetY}function u(d){if(d.startsWith("addNode:")){const h=d.substring(8),f=t.value.editor.nodeTypes.get(h);if(!f)return;const _=ei(new f.type);t.value.displayedGraph.addNode(_);const[m,E]=r(n.value,i.value);_.position.x=m,_.position.y=E}else if(d.startsWith("command:")){const h=d.substring(8);t.value.commandHandler.canExecuteCommand(h)&&t.value.commandHandler.executeCommand(h)}}return{show:e,x:n,y:i,items:a,open:l,onClick:u}}const JDt=_n({setup(){const{viewModel:t}=Oi(),{graph:e}=Ki();return{styles:st(()=>{const i=t.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`,u=e.value.scaling>i.subGridVisibleThreshold?`, ${a}px ${a}px, ${a}px ${a}px`:"";return{backgroundPosition:`left ${s}px top ${r}px`,backgroundSize:`${l} ${u}`}})}}}),hn=(t,e)=>{const n=t.__vccOpts||t;for(const[i,s]of e)n[i]=s;return n};function ekt(t,e,n,i,s,r){return w(),A("div",{class:"background",style:en(t.styles)},null,4)}const tkt=hn(JDt,[["render",ekt]]);function nkt(t){return tR()?(NM(t),!0):!1}function uy(t){return typeof t=="function"?t():yt(t)}const YI=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const ikt=Object.prototype.toString,skt=t=>ikt.call(t)==="[object Object]",Vd=()=>{},rkt=okt();function okt(){var t,e;return YI&&((t=window==null?void 0:window.navigator)==null?void 0:t.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 akt(t,e,n=!1){return e.reduce((i,s)=>(s in t&&(!n||t[s]!==void 0)&&(i[s]=t[s]),i),{})}function lkt(t,e={}){if(!fn(t))return d2(t);const n=Array.isArray(t.value)?Array.from({length:t.value.length}):{};for(const i in t.value)n[i]=c2(()=>({get(){return t.value[i]},set(s){var r;if((r=uy(e.replaceRef))!=null?r:!0)if(Array.isArray(t.value)){const a=[...t.value];a[i]=s,t.value=a}else{const a={...t.value,[i]:s};Object.setPrototypeOf(a,Object.getPrototypeOf(t.value)),t.value=a}else t.value[i]=s}}));return n}function Al(t){var e;const n=uy(t);return(e=n==null?void 0:n.$el)!=null?e:n}const py=YI?window:void 0;function Vl(...t){let e,n,i,s;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,i,s]=t,e=py):[e,n,i,s]=t,!e)return Vd;Array.isArray(n)||(n=[n]),Array.isArray(i)||(i=[i]);const r=[],o=()=>{r.forEach(d=>d()),r.length=0},a=(d,h,f,_)=>(d.addEventListener(h,f,_),()=>d.removeEventListener(h,f,_)),l=qn(()=>[Al(e),uy(s)],([d,h])=>{if(o(),!d)return;const f=skt(h)?{...h}:h;r.push(...n.flatMap(_=>i.map(m=>a(d,_,m,f))))},{immediate:!0,flush:"post"}),u=()=>{l(),o()};return nkt(u),u}let Uw=!1;function $I(t,e,n={}){const{window:i=py,ignore:s=[],capture:r=!0,detectIframe:o=!1}=n;if(!i)return Vd;rkt&&!Uw&&(Uw=!0,Array.from(i.document.body.children).forEach(f=>f.addEventListener("click",Vd)),i.document.documentElement.addEventListener("click",Vd));let a=!0;const l=f=>s.some(_=>{if(typeof _=="string")return Array.from(i.document.querySelectorAll(_)).some(m=>m===f.target||f.composedPath().includes(m));{const m=Al(_);return m&&(f.target===m||f.composedPath().includes(m))}}),d=[Vl(i,"click",f=>{const _=Al(t);if(!(!_||_===f.target||f.composedPath().includes(_))){if(f.detail===0&&(a=!l(f)),!a){a=!0;return}e(f)}},{passive:!0,capture:r}),Vl(i,"pointerdown",f=>{const _=Al(t);a=!l(f)&&!!(_&&!f.composedPath().includes(_))},{passive:!0}),o&&Vl(i,"blur",f=>{setTimeout(()=>{var _;const m=Al(t);((_=i.document.activeElement)==null?void 0:_.tagName)==="IFRAME"&&!(m!=null&&m.contains(i.document.activeElement))&&e(f)},0)})].filter(Boolean);return()=>d.forEach(f=>f())}const WI={x:0,y:0,pointerId:0,pressure:0,tiltX:0,tiltY:0,width:0,height:0,twist:0,pointerType:null},ckt=Object.keys(WI);function dkt(t={}){const{target:e=py}=t,n=ft(!1),i=ft(t.initialValue||{});Object.assign(i.value,WI,i.value);const s=r=>{n.value=!0,!(t.pointerTypes&&!t.pointerTypes.includes(r.pointerType))&&(i.value=akt(r,ckt,!1))};if(e){const r={passive:!0};Vl(e,["pointerdown","pointermove","pointerup"],s,r),Vl(e,"pointerleave",()=>n.value=!1,r)}return{...lkt(i),isInside:n}}const ukt=["onMouseenter","onMouseleave","onClick"],pkt={class:"flex-fill"},_kt={key:0,class:"__submenu-icon",style:{"line-height":"1em"}},hkt=c("svg",{width:"13",height:"13",viewBox:"-60 120 250 250"},[c("path",{d:"M160.875 279.5625 L70.875 369.5625 L70.875 189.5625 L160.875 279.5625 Z",stroke:"none",fill:"white"})],-1),fkt=[hkt],_y=_n({__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(t,{emit:e}){const n=t,i=e;let s=null;const r=ft(null),o=ft(-1),a=ft(0),l=ft({x:!1,y:!1}),u=st(()=>n.flippable&&(l.value.x||n.isFlipped.x)),d=st(()=>n.flippable&&(l.value.y||n.isFlipped.y)),h=st(()=>{const y={};return n.isNested||(y.top=(d.value?n.y-a.value:n.y)+"px",y.left=n.x+"px"),y}),f=st(()=>({"--flipped-x":u.value,"--flipped-y":d.value,"--nested":n.isNested})),_=st(()=>n.items.map(y=>({...y,hover:!1})));qn([()=>n.y,()=>n.items],()=>{var y,v,S,C;a.value=n.items.length*30;const T=((v=(y=r.value)==null?void 0:y.parentElement)==null?void 0:v.offsetWidth)??0,O=((C=(S=r.value)==null?void 0:S.parentElement)==null?void 0:C.offsetHeight)??0;l.value.x=!n.isNested&&n.x>T*.75,l.value.y=!n.isNested&&n.y+a.value>O-20}),$I(r,()=>{n.modelValue&&i("update:modelValue",!1)});const m=y=>{!y.submenu&&y.value&&(i("click",y.value),i("update:modelValue",!1))},E=y=>{i("click",y),o.value=-1,n.isNested||i("update:modelValue",!1)},b=(y,v)=>{n.items[v].submenu&&(o.value=v,s!==null&&(clearTimeout(s),s=null))},g=(y,v)=>{n.items[v].submenu&&(s=window.setTimeout(()=>{o.value=-1,s=null},200))};return(y,v)=>{const S=mt("ContextMenu",!0);return w(),xt(cs,{name:"slide-fade"},{default:We(()=>[G(c("div",{ref_key:"el",ref:r,class:ze(["baklava-context-menu",f.value]),style:en(h.value)},[(w(!0),A(Ye,null,lt(_.value,(C,T)=>(w(),A(Ye,null,[C.isDivider?(w(),A("div",{key:`d-${T}`,class:"divider"})):(w(),A("div",{key:`i-${T}`,class:ze(["item",{submenu:!!C.submenu,"--disabled":!!C.disabled}]),onMouseenter:O=>b(O,T),onMouseleave:O=>g(O,T),onClick:be(O=>m(C),["stop","prevent"])},[c("div",pkt,he(C.label),1),C.submenu?(w(),A("div",_kt,fkt)):V("",!0),C.submenu?(w(),xt(S,{key:1,"model-value":o.value===T,items:C.submenu,"is-nested":!0,"is-flipped":{x:u.value,y:d.value},flippable:y.flippable,onClick:E},null,8,["model-value","items","is-flipped","flippable"])):V("",!0)],42,ukt))],64))),256))],6),[[Mt,y.modelValue]])]),_:1})}}}),mkt={},gkt={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"},bkt=c("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),Ekt=c("circle",{cx:"12",cy:"12",r:"1"},null,-1),ykt=c("circle",{cx:"12",cy:"19",r:"1"},null,-1),vkt=c("circle",{cx:"12",cy:"5",r:"1"},null,-1),Skt=[bkt,Ekt,ykt,vkt];function Tkt(t,e){return w(),A("svg",gkt,Skt)}const KI=hn(mkt,[["render",Tkt]]),xkt=["id"],Ckt={key:0,class:"__tooltip"},wkt={key:2,class:"align-middle"},Fw=_n({__name:"NodeInterface",props:{node:{},intf:{}},setup(t){const e=(b,g=100)=>{const y=b!=null&&b.toString?b.toString():"";return y.length>g?y.slice(0,g)+"...":y},n=t,{viewModel:i}=Oi(),{hoveredOver:s,temporaryConnection:r}=Vi(qI),o=ft(null),a=st(()=>n.intf.connectionCount>0),l=ft(!1),u=st(()=>i.value.settings.displayValueOnHover&&l.value),d=st(()=>({"--input":n.intf.isInput,"--output":!n.intf.isInput,"--connected":a.value})),h=st(()=>n.intf.component&&(!n.intf.isInput||!n.intf.port||n.intf.connectionCount===0)),f=()=>{l.value=!0,s(n.intf)},_=()=>{l.value=!1,s(void 0)},m=()=>{o.value&&i.value.hooks.renderInterface.execute({intf:n.intf,el:o.value})},E=()=>{const b=i.value.displayedGraph.sidebar;b.nodeId=n.node.id,b.optionName=n.intf.name,b.visible=!0};return Ws(m),uc(m),(b,g)=>{var y;return w(),A("div",{id:b.intf.id,ref_key:"el",ref:o,class:ze(["baklava-node-interface",d.value])},[b.intf.port?(w(),A("div",{key:0,class:ze(["__port",{"--selected":((y=yt(r))==null?void 0:y.from)===b.intf}]),onPointerover:f,onPointerout:_},[kn(b.$slots,"portTooltip",{showTooltip:u.value},()=>[u.value===!0?(w(),A("span",Ckt,he(e(b.intf.value)),1)):V("",!0)])],34)):V("",!0),h.value?(w(),xt(Lu(b.intf.component),{key:1,modelValue:b.intf.value,"onUpdate:modelValue":g[0]||(g[0]=v=>b.intf.value=v),node:b.node,intf:b.intf,onOpenSidebar:E},null,40,["modelValue","node","intf"])):(w(),A("span",wkt,he(b.intf.name),1))],10,xkt)}}}),Rkt=["id","data-node-type"],Akt={class:"__title-label"},Nkt={class:"__menu"},Okt={class:"__outputs"},Ikt={class:"__inputs"},Mkt=_n({__name:"Node",props:{node:{},selected:{type:Boolean,default:!1},dragging:{type:Boolean}},emits:["select","start-drag"],setup(t,{emit:e}){const n=t,i=e,{viewModel:s}=Oi(),{graph:r,switchGraph:o}=Ki(),a=ft(null),l=ft(!1),u=ft(""),d=ft(null),h=ft(!1),f=ft(!1),_=st(()=>{const F=[{value:"rename",label:"Rename"},{value:"delete",label:"Delete"}];return n.node.type.startsWith(lc)&&F.push({value:"editSubgraph",label:"Edit Subgraph"}),F}),m=st(()=>({"--selected":n.selected,"--dragging":n.dragging,"--two-column":!!n.node.twoColumn})),E=st(()=>{var F,B;return{top:`${((F=n.node.position)==null?void 0:F.y)??0}px`,left:`${((B=n.node.position)==null?void 0:B.x)??0}px`,"--width":`${n.node.width??s.value.settings.nodes.defaultWidth}px`}}),b=st(()=>Object.values(n.node.inputs).filter(F=>!F.hidden)),g=st(()=>Object.values(n.node.outputs).filter(F=>!F.hidden)),y=()=>{i("select")},v=F=>{n.selected||y(),i("start-drag",F)},S=()=>{f.value=!0},C=async F=>{var B;switch(F){case"delete":r.value.removeNode(n.node);break;case"rename":u.value=n.node.title,l.value=!0,await Ge(),(B=d.value)==null||B.focus();break;case"editSubgraph":o(n.node.template);break}},T=()=>{n.node.title=u.value,l.value=!1},O=()=>{a.value&&s.value.hooks.renderNode.execute({node:n.node,el:a.value})},k=F=>{h.value=!0,F.preventDefault()},x=F=>{if(!h.value)return;const B=n.node.width+F.movementX/r.value.scaling,ne=s.value.settings.nodes.minWidth,L=s.value.settings.nodes.maxWidth;n.node.width=Math.max(ne,Math.min(L,B))},I=()=>{h.value=!1};return Ws(()=>{O(),window.addEventListener("mousemove",x),window.addEventListener("mouseup",I)}),uc(O),Va(()=>{window.removeEventListener("mousemove",x),window.removeEventListener("mouseup",I)}),(F,B)=>(w(),A("div",{id:F.node.id,ref_key:"el",ref:a,class:ze(["baklava-node",m.value]),style:en(E.value),"data-node-type":F.node.type,onPointerdown:y},[yt(s).settings.nodes.resizable?(w(),A("div",{key:0,class:"__resize-handle",onMousedown:k},null,32)):V("",!0),kn(F.$slots,"title",{},()=>[c("div",{class:"__title",onPointerdown:be(v,["self","stop"])},[l.value?G((w(),A("input",{key:1,ref_key:"renameInputEl",ref:d,"onUpdate:modelValue":B[1]||(B[1]=ne=>u.value=ne),type:"text",class:"baklava-input",placeholder:"Node Name",onBlur:T,onKeydown:Hs(T,["enter"])},null,544)),[[we,u.value]]):(w(),A(Ye,{key:0},[c("div",Akt,he(F.node.title),1),c("div",Nkt,[Te(KI,{class:"--clickable",onClick:S}),Te(_y,{modelValue:f.value,"onUpdate:modelValue":B[0]||(B[0]=ne=>f.value=ne),x:0,y:0,items:_.value,onClick:C},null,8,["modelValue","items"])])],64))],32)]),kn(F.$slots,"content",{},()=>[c("div",{class:"__content",onKeydown:B[2]||(B[2]=Hs(be(()=>{},["stop"]),["delete"]))},[c("div",Okt,[(w(!0),A(Ye,null,lt(g.value,ne=>kn(F.$slots,"nodeInterface",{key:ne.id,type:"output",node:F.node,intf:ne},()=>[Te(Fw,{node:F.node,intf:ne},null,8,["node","intf"])])),128))]),c("div",Ikt,[(w(!0),A(Ye,null,lt(b.value,ne=>kn(F.$slots,"nodeInterface",{key:ne.id,type:"input",node:F.node,intf:ne},()=>[Te(Fw,{node:F.node,intf:ne},null,8,["node","intf"])])),128))])],32)])],46,Rkt))}}),Dkt=_n({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:Ei.NONE},isTemporary:{type:Boolean,default:!1}},setup(t){const{viewModel:e}=Oi(),{graph:n}=Ki(),i=(o,a)=>{const l=(o+n.value.panning.x)*n.value.scaling,u=(a+n.value.panning.y)*n.value.scaling;return[l,u]},s=st(()=>{const[o,a]=i(t.x1,t.y1),[l,u]=i(t.x2,t.y2);if(e.value.settings.useStraightConnections)return`M ${o} ${a} L ${l} ${u}`;{const d=.3*Math.abs(o-l);return`M ${o} ${a} C ${o+d} ${a}, ${l-d} ${u}, ${l} ${u}`}}),r=st(()=>({"--temporary":t.isTemporary,"--allowed":t.state===Ei.ALLOWED,"--forbidden":t.state===Ei.FORBIDDEN}));return{d:s,classes:r}}}),kkt=["d"];function Lkt(t,e,n,i,s,r){return w(),A("path",{class:ze(["baklava-connection",t.classes]),d:t.d},null,10,kkt)}const jI=hn(Dkt,[["render",Lkt]]);function Pkt(t){return document.getElementById(t.id)}function Pa(t){const e=document.getElementById(t.id),n=e==null?void 0:e.getElementsByClassName("__port");return{node:(e==null?void 0:e.closest(".baklava-node"))??null,interface:e,port:n&&n.length>0?n[0]:null}}const Ukt=_n({components:{"connection-view":jI},props:{connection:{type:Object,required:!0}},setup(t){const{graph:e}=Ki();let n;const i=ft({x1:0,y1:0,x2:0,y2:0}),s=st(()=>t.connection.isInDanger?Ei.FORBIDDEN:Ei.NONE),r=st(()=>{var u;return(u=e.value.findNodeById(t.connection.from.nodeId))==null?void 0:u.position}),o=st(()=>{var u;return(u=e.value.findNodeById(t.connection.to.nodeId))==null?void 0:u.position}),a=u=>u.node&&u.interface&&u.port?[u.node.offsetLeft+u.interface.offsetLeft+u.port.offsetLeft+u.port.clientWidth/2,u.node.offsetTop+u.interface.offsetTop+u.port.offsetTop+u.port.clientHeight/2]:[0,0],l=()=>{const u=Pa(t.connection.from),d=Pa(t.connection.to);u.node&&d.node&&(n||(n=new ResizeObserver(()=>{l()}),n.observe(u.node),n.observe(d.node)));const[h,f]=a(u),[_,m]=a(d);i.value={x1:h,y1:f,x2:_,y2:m}};return Ws(async()=>{await Ge(),l()}),Va(()=>{n&&n.disconnect()}),qn([r,o],()=>l(),{deep:!0}),{d:i,state:s}}});function Fkt(t,e,n,i,s,r){const o=mt("connection-view");return w(),xt(o,{x1:t.d.x1,y1:t.d.y1,x2:t.d.x2,y2:t.d.y2,state:t.state},null,8,["x1","y1","x2","y2","state"])}const Bkt=hn(Ukt,[["render",Fkt]]);function yu(t){return t.node&&t.interface&&t.port?[t.node.offsetLeft+t.interface.offsetLeft+t.port.offsetLeft+t.port.clientWidth/2,t.node.offsetTop+t.interface.offsetTop+t.port.offsetTop+t.port.clientHeight/2]:[0,0]}const Gkt=_n({components:{"connection-view":jI},props:{connection:{type:Object,required:!0}},setup(t){const e=st(()=>t.connection?t.connection.status:Ei.NONE);return{d:st(()=>{if(!t.connection)return{input:[0,0],output:[0,0]};const i=yu(Pa(t.connection.from)),s=t.connection.to?yu(Pa(t.connection.to)):[t.connection.mx||i[0],t.connection.my||i[1]];return t.connection.from.isInput?{input:s,output:i}:{input:i,output:s}}),status:e}}});function Vkt(t,e,n,i,s,r){const o=mt("connection-view");return w(),xt(o,{x1:t.d.input[0],y1:t.d.input[1],x2:t.d.output[0],y2:t.d.output[1],state:t.status,"is-temporary":""},null,8,["x1","y1","x2","y2","state"])}const zkt=hn(Gkt,[["render",Vkt]]),Hkt=_n({setup(){const{viewModel:t}=Oi(),{graph:e}=Ki(),n=ft(null),i=$d(t.value.settings.sidebar,"width"),s=st(()=>t.value.settings.sidebar.resizable),r=st(()=>{const h=e.value.sidebar.nodeId;return e.value.nodes.find(f=>f.id===h)}),o=st(()=>({width:`${i.value}px`})),a=st(()=>r.value?[...Object.values(r.value.inputs),...Object.values(r.value.outputs)].filter(f=>f.displayInSidebar&&f.component):[]),l=()=>{e.value.sidebar.visible=!1},u=()=>{window.addEventListener("mousemove",d),window.addEventListener("mouseup",()=>{window.removeEventListener("mousemove",d)},{once:!0})},d=h=>{var f,_;const m=((_=(f=n.value)==null?void 0:f.parentElement)==null?void 0:_.getBoundingClientRect().width)??500;let E=i.value-h.movementX;E<300?E=300:E>.9*m&&(E=.9*m),i.value=E};return{el:n,graph:e,resizable:s,node:r,styles:o,displayedInterfaces:a,startResize:u,close:l}}}),qkt={class:"__header"},Ykt={class:"__node-name"};function $kt(t,e,n,i,s,r){return w(),A("div",{ref:"el",class:ze(["baklava-sidebar",{"--open":t.graph.sidebar.visible}]),style:en(t.styles)},[t.resizable?(w(),A("div",{key:0,class:"__resizer",onMousedown:e[0]||(e[0]=(...o)=>t.startResize&&t.startResize(...o))},null,32)):V("",!0),c("div",qkt,[c("button",{tabindex:"-1",class:"__close",onClick:e[1]||(e[1]=(...o)=>t.close&&t.close(...o))},"×"),c("div",Ykt,[c("b",null,he(t.node?t.node.title:""),1)])]),(w(!0),A(Ye,null,lt(t.displayedInterfaces,o=>(w(),A("div",{key:o.id,class:"__interface"},[(w(),xt(Lu(o.component),{modelValue:o.value,"onUpdate:modelValue":a=>o.value=a,node:t.node,intf:o},null,8,["modelValue","onUpdate:modelValue","node","intf"]))]))),128))],6)}const Wkt=hn(Hkt,[["render",$kt]]),Kkt=_n({__name:"Minimap",setup(t){const{viewModel:e}=Oi(),{graph:n}=Ki(),i=ft(null),s=ft(!1);let r,o=!1,a={x1:0,y1:0,x2:0,y2:0},l;const u=()=>{var T,O;if(!r)return;r.canvas.width=i.value.offsetWidth,r.canvas.height=i.value.offsetHeight;const k=new Map,x=new Map;for(const L of n.value.nodes){const $=Pkt(L),H=($==null?void 0:$.offsetWidth)??0,U=($==null?void 0:$.offsetHeight)??0,Q=((T=L.position)==null?void 0:T.x)??0,J=((O=L.position)==null?void 0:O.y)??0;k.set(L,{x1:Q,y1:J,x2:Q+H,y2:J+U}),x.set(L,$)}const I={x1:Number.MAX_SAFE_INTEGER,y1:Number.MAX_SAFE_INTEGER,x2:Number.MIN_SAFE_INTEGER,y2:Number.MIN_SAFE_INTEGER};for(const L of k.values())L.x1I.x2&&(I.x2=L.x2),L.y2>I.y2&&(I.y2=L.y2);const F=50;I.x1-=F,I.y1-=F,I.x2+=F,I.y2+=F,a=I;const B=r.canvas.width/r.canvas.height,ne=(a.x2-a.x1)/(a.y2-a.y1);if(B>ne){const L=(B-ne)*(a.y2-a.y1)*.5;a.x1-=L,a.x2+=L}else{const L=a.x2-a.x1,$=a.y2-a.y1,H=(L-B*$)/B*.5;a.y1-=H,a.y2+=H}r.clearRect(0,0,r.canvas.width,r.canvas.height),r.strokeStyle="white";for(const L of n.value.connections){const[$,H]=yu(Pa(L.from)),[U,Q]=yu(Pa(L.to)),[J,j]=d($,H),[ae,ve]=d(U,Q);if(r.beginPath(),r.moveTo(J,j),e.value.settings.useStraightConnections)r.lineTo(ae,ve);else{const ee=.3*Math.abs(J-ae);r.bezierCurveTo(J+ee,j,ae-ee,ve,ae,ve)}r.stroke()}r.strokeStyle="lightgray";for(const[L,$]of k.entries()){const[H,U]=d($.x1,$.y1),[Q,J]=d($.x2,$.y2);r.fillStyle=f(x.get(L)),r.beginPath(),r.rect(H,U,Q-H,J-U),r.fill(),r.stroke()}if(s.value){const L=m(),[$,H]=d(L.x1,L.y1),[U,Q]=d(L.x2,L.y2);r.fillStyle="rgba(255, 255, 255, 0.2)",r.fillRect($,H,U-$,Q-H)}},d=(T,O)=>[(T-a.x1)/(a.x2-a.x1)*r.canvas.width,(O-a.y1)/(a.y2-a.y1)*r.canvas.height],h=(T,O)=>[T*(a.x2-a.x1)/r.canvas.width+a.x1,O*(a.y2-a.y1)/r.canvas.height+a.y1],f=T=>{if(T){const O=T.querySelector(".__content");if(O){const x=_(O);if(x)return x}const k=_(T);if(k)return k}return"gray"},_=T=>{const O=getComputedStyle(T).backgroundColor;if(O&&O!=="rgba(0, 0, 0, 0)")return O},m=()=>{const T=i.value.parentElement.offsetWidth,O=i.value.parentElement.offsetHeight,k=T/n.value.scaling-n.value.panning.x,x=O/n.value.scaling-n.value.panning.y;return{x1:-n.value.panning.x,y1:-n.value.panning.y,x2:k,y2:x}},E=T=>{T.button===0&&(o=!0,b(T))},b=T=>{if(o){const[O,k]=h(T.offsetX,T.offsetY),x=m(),I=(x.x2-x.x1)/2,F=(x.y2-x.y1)/2;n.value.panning.x=-(O-I),n.value.panning.y=-(k-F)}},g=()=>{o=!1},y=()=>{s.value=!0},v=()=>{s.value=!1,g()};qn([s,n.value.panning,()=>n.value.scaling,()=>n.value.connections.length],()=>{u()});const S=st(()=>n.value.nodes.map(T=>T.position)),C=st(()=>n.value.nodes.map(T=>T.width));return qn([S,C],()=>{u()},{deep:!0}),Ws(()=>{r=i.value.getContext("2d"),r.imageSmoothingQuality="high",u(),l=setInterval(u,500)}),Va(()=>{clearInterval(l)}),(T,O)=>(w(),A("canvas",{ref_key:"canvas",ref:i,class:"baklava-minimap",onMouseenter:y,onMouseleave:v,onMousedown:be(E,["self"]),onMousemove:be(b,["self"]),onMouseup:g},null,544))}}),jkt=_n({components:{ContextMenu:_y,VerticalDots:KI},props:{type:{type:String,required:!0},title:{type:String,required:!0}},setup(t){const{viewModel:e}=Oi(),{switchGraph:n}=Ki(),i=ft(!1),s=st(()=>t.type.startsWith(lc));return{showContextMenu:i,hasContextMenu:s,contextMenuItems:[{label:"Edit Subgraph",value:"editSubgraph"},{label:"Delete Subgraph",value:"deleteSubgraph"}],openContextMenu:()=>{i.value=!0},onContextMenuClick:l=>{const u=t.type.substring(lc.length),d=e.value.editor.graphTemplates.find(h=>h.id===u);if(d)switch(l){case"editSubgraph":n(d);break;case"deleteSubgraph":e.value.editor.removeGraphTemplate(d);break}}}}}),Qkt=["data-node-type"],Xkt={class:"__title"},Zkt={class:"__title-label"},Jkt={key:0,class:"__menu"};function eLt(t,e,n,i,s,r){const o=mt("vertical-dots"),a=mt("context-menu");return w(),A("div",{class:"baklava-node --palette","data-node-type":t.type},[c("div",Xkt,[c("div",Zkt,he(t.title),1),t.hasContextMenu?(w(),A("div",Jkt,[Te(o,{class:"--clickable",onPointerdown:e[0]||(e[0]=be(()=>{},["stop","prevent"])),onClick:be(t.openContextMenu,["stop","prevent"])},null,8,["onClick"]),Te(a,{modelValue:t.showContextMenu,"onUpdate:modelValue":e[1]||(e[1]=l=>t.showContextMenu=l),x:-100,y:0,items:t.contextMenuItems,onClick:t.onContextMenuClick,onPointerdown:e[2]||(e[2]=be(()=>{},["stop","prevent"]))},null,8,["modelValue","items","onClick"])])):V("",!0)])],8,Qkt)}const Bw=hn(jkt,[["render",eLt]]),tLt={class:"baklava-node-palette"},nLt={key:0},iLt=_n({__name:"NodePalette",setup(t){const{viewModel:e}=Oi(),{x:n,y:i}=dkt(),{transform:s}=HI(),r=zI(e),o=Vi("editorEl"),a=ft(null),l=st(()=>{if(!a.value||!(o!=null&&o.value))return{};const{left:d,top:h}=o.value.getBoundingClientRect();return{top:`${i.value-h}px`,left:`${n.value-d}px`}}),u=(d,h)=>{a.value={type:d,nodeInformation:h};const f=()=>{const _=ei(new h.type);e.value.displayedGraph.addNode(_);const m=o.value.getBoundingClientRect(),[E,b]=s(n.value-m.left,i.value-m.top);_.position.x=E,_.position.y=b,a.value=null,document.removeEventListener("pointerup",f)};document.addEventListener("pointerup",f)};return(d,h)=>(w(),A(Ye,null,[c("div",tLt,[(w(!0),A(Ye,null,lt(yt(r),f=>(w(),A("section",{key:f.name},[f.name!=="default"?(w(),A("h1",nLt,he(f.name),1)):V("",!0),(w(!0),A(Ye,null,lt(f.nodeTypes,(_,m)=>(w(),xt(Bw,{key:m,type:m,title:_.title,onPointerdown:E=>u(m,_)},null,8,["type","title","onPointerdown"]))),128))]))),128))]),Te(cs,{name:"fade"},{default:We(()=>[a.value?(w(),A("div",{key:0,class:"baklava-dragged-node",style:en(l.value)},[Te(Bw,{type:a.value.type,title:a.value.nodeInformation.title},null,8,["type","title"])],4)):V("",!0)]),_:1})],64))}});let Cd;const sLt=new Uint8Array(16);function rLt(){if(!Cd&&(Cd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Cd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Cd(sLt)}const wn=[];for(let t=0;t<256;++t)wn.push((t+256).toString(16).slice(1));function oLt(t,e=0){return wn[t[e+0]]+wn[t[e+1]]+wn[t[e+2]]+wn[t[e+3]]+"-"+wn[t[e+4]]+wn[t[e+5]]+"-"+wn[t[e+6]]+wn[t[e+7]]+"-"+wn[t[e+8]]+wn[t[e+9]]+"-"+wn[t[e+10]]+wn[t[e+11]]+wn[t[e+12]]+wn[t[e+13]]+wn[t[e+14]]+wn[t[e+15]]}const aLt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Gw={randomUUID:aLt};function vu(t,e,n){if(Gw.randomUUID&&!e&&!t)return Gw.randomUUID();t=t||{};const i=t.random||(t.rng||rLt)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){n=n||0;for(let s=0;s<16;++s)e[n+s]=i[s];return e}return oLt(i)}const cc="SAVE_SUBGRAPH";function lLt(t,e){const n=()=>{const i=t.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(cc,{canExecute:()=>{var i;return t.value!==((i=t.value.editor)==null?void 0:i.graph)},execute:n})}const cLt={},dLt={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"},uLt=c("polyline",{points:"6 9 12 15 18 9"},null,-1),pLt=[uLt];function _Lt(t,e){return w(),A("svg",dLt,pLt)}const hLt=hn(cLt,[["render",_Lt]]),fLt=_n({components:{"i-arrow":hLt},props:{intf:{type:Object,required:!0}},setup(t){const e=ft(null),n=ft(!1),i=st(()=>t.intf.items.find(o=>typeof o=="string"?o===t.intf.value:o.value===t.intf.value)),s=st(()=>i.value?typeof i.value=="string"?i.value:i.value.text:""),r=o=>{t.intf.value=typeof o=="string"?o:o.value};return $I(e,()=>{n.value=!1}),{el:e,open:n,selectedItem:i,selectedText:s,setSelected:r}}}),mLt=["title"],gLt={class:"__selected"},bLt={class:"__text"},ELt={class:"__icon"},yLt={class:"__dropdown"},vLt={class:"item --header"},SLt=["onClick"];function TLt(t,e,n,i,s,r){const o=mt("i-arrow");return w(),A("div",{ref:"el",class:ze(["baklava-select",{"--open":t.open}]),title:t.intf.name,onClick:e[0]||(e[0]=a=>t.open=!t.open)},[c("div",gLt,[c("div",bLt,he(t.selectedText),1),c("div",ELt,[Te(o)])]),Te(cs,{name:"slide-fade"},{default:We(()=>[G(c("div",yLt,[c("div",vLt,he(t.intf.name),1),(w(!0),A(Ye,null,lt(t.intf.items,(a,l)=>(w(),A("div",{key:l,class:ze(["item",{"--active":a===t.selectedItem}]),onClick:u=>t.setSelected(a)},he(typeof a=="string"?a:a.text),11,SLt))),128))],512),[[Mt,t.open]])]),_:1})],10,mLt)}const xLt=hn(fLt,[["render",TLt]]);class CLt extends nn{constructor(e,n,i){super(e,n),this.component=dc(xLt),this.items=i}}const wLt=_n({props:{intf:{type:Object,required:!0}}});function RLt(t,e,n,i,s,r){return w(),A("div",null,he(t.intf.value),1)}const ALt=hn(wLt,[["render",RLt]]);class NLt extends nn{constructor(e,n){super(e,n),this.component=dc(ALt),this.setPort(!1)}}const OLt=_n({props:{intf:{type:Object,required:!0},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(t,{emit:e}){return{v:st({get:()=>t.modelValue,set:i=>{e("update:modelValue",i)}})}}}),ILt=["placeholder","title"];function MLt(t,e,n,i,s,r){return w(),A("div",null,[G(c("input",{"onUpdate:modelValue":e[0]||(e[0]=o=>t.v=o),type:"text",class:"baklava-input",placeholder:t.intf.name,title:t.intf.name},null,8,ILt),[[we,t.v]])])}const DLt=hn(OLt,[["render",MLt]]);class Tc extends nn{constructor(){super(...arguments),this.component=dc(DLt)}}class QI extends PI{constructor(){super(...arguments),this._title="Subgraph Input",this.inputs={name:new Tc("Name","Input").setPort(!1)},this.outputs={placeholder:new nn("Connection",void 0)}}}class XI extends UI{constructor(){super(...arguments),this._title="Subgraph Output",this.inputs={name:new Tc("Name","Output").setPort(!1),placeholder:new nn("Connection",void 0)},this.outputs={output:new nn("Output",void 0).setHidden(!0)}}}const ZI="CREATE_SUBGRAPH",Vw=[Da,ka];function kLt(t,e,n){const i=()=>t.value.selectedNodes.filter(r=>!Vw.includes(r.type)).length>0,s=()=>{const{viewModel:r}=Oi(),o=t.value,a=t.value.editor;if(o.selectedNodes.length===0)return;const l=o.selectedNodes.filter(x=>!Vw.includes(x.type)),u=l.flatMap(x=>Object.values(x.inputs)),d=l.flatMap(x=>Object.values(x.outputs)),h=o.connections.filter(x=>!d.includes(x.from)&&u.includes(x.to)),f=o.connections.filter(x=>d.includes(x.from)&&!u.includes(x.to)),_=o.connections.filter(x=>d.includes(x.from)&&u.includes(x.to)),m=l.map(x=>x.save()),E=_.map(x=>({id:x.id,from:x.from.id,to:x.to.id})),b=new Map,{xLeft:g,xRight:y,yTop:v}=LLt(l);console.log(g,y,v);for(const[x,I]of h.entries()){const F=new QI;F.inputs.name.value=I.to.name,m.push({...F.save(),position:{x:y-r.value.settings.nodes.defaultWidth-100,y:v+x*200}}),E.push({id:vu(),from:F.outputs.placeholder.id,to:I.to.id}),b.set(I.to.id,F.graphInterfaceId)}for(const[x,I]of f.entries()){const F=new XI;F.inputs.name.value=I.from.name,m.push({...F.save(),position:{x:g+100,y:v+x*200}}),E.push({id:vu(),from:I.from.id,to:F.inputs.placeholder.id}),b.set(I.from.id,F.graphInterfaceId)}const S=ei(new hp({connections:E,nodes:m,inputs:[],outputs:[]},a));a.addGraphTemplate(S);const C=a.nodeTypes.get(La(S));if(!C)throw new Error("Unable to create subgraph: Could not find corresponding graph node type");const T=ei(new C.type);o.addNode(T);const O=Math.round(l.map(x=>x.position.x).reduce((x,I)=>x+I,0)/l.length),k=Math.round(l.map(x=>x.position.y).reduce((x,I)=>x+I,0)/l.length);T.position.x=O,T.position.y=k,h.forEach(x=>{o.removeConnection(x),o.addConnection(x.from,T.inputs[b.get(x.to.id)])}),f.forEach(x=>{o.removeConnection(x),o.addConnection(T.outputs[b.get(x.from.id)],x.to)}),l.forEach(x=>o.removeNode(x)),e.canExecuteCommand(cc)&&e.executeCommand(cc),n(S),t.value.panning={...o.panning},t.value.scaling=o.scaling};e.registerCommand(ZI,{canExecute:i,execute:s})}function LLt(t){const e=t.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:n}}const zw="DELETE_NODES";function PLt(t,e){e.registerCommand(zw,{canExecute:()=>t.value.selectedNodes.length>0,execute(){t.value.selectedNodes.forEach(n=>t.value.removeNode(n))}}),e.registerHotkey(["Delete"],zw)}const JI="SWITCH_TO_MAIN_GRAPH";function ULt(t,e,n){e.registerCommand(JI,{canExecute:()=>t.value!==t.value.editor.graph,execute:()=>{e.executeCommand(cc),n(t.value.editor.graph)}})}function FLt(t,e,n){PLt(t,e),kLt(t,e,n),lLt(t,e),ULt(t,e,n)}class Hw{constructor(e,n){this.type=e,e==="addNode"?this.nodeId=n:this.nodeState=n}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 n=e.editor.nodeTypes.get(this.nodeState.type);if(!n)return;const i=new n.type;e.addNode(i),i.load(this.nodeState),this.nodeId=i.id}removeNode(e){const n=e.nodes.find(i=>i.id===this.nodeId);n&&(this.nodeState=n.save(),e.removeNode(n))}}class qw{constructor(e,n){if(this.type=e,e==="addConnection")this.connectionId=n;else{const i=n;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 n=e.findNodeInterface(this.connectionState.from),i=e.findNodeInterface(this.connectionState.to);!n||!i||e.addConnection(n,i)}removeConnection(e){const n=e.connections.find(i=>i.id===this.connectionId);n&&(this.connectionState={id:n.id,from:n.from.id,to:n.to.id},e.removeConnection(n))}}class BLt{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 n=this.steps.length-1;n>=0;n--)this.steps[n].undo(e)}redo(e){for(let n=0;n{if(!r.value)if(a.value)l.value.push(b);else for(o.value!==s.value.length-1&&(s.value=s.value.slice(0,o.value+1)),s.value.push(b),o.value++;s.value.length>i.value;)s.value.shift()},d=()=>{a.value=!0},h=()=>{a.value=!1,l.value.length>0&&(u(new BLt(l.value)),l.value=[])},f=()=>s.value.length!==0&&o.value!==-1,_=()=>{f()&&(r.value=!0,s.value[o.value--].undo(t.value),r.value=!1)},m=()=>s.value.length!==0&&o.value{m()&&(r.value=!0,s.value[++o.value].redo(t.value),r.value=!1)};return qn(t,(b,g)=>{g&&(g.events.addNode.unsubscribe(n),g.events.removeNode.unsubscribe(n),g.events.addConnection.unsubscribe(n),g.events.removeConnection.unsubscribe(n)),b&&(b.events.addNode.subscribe(n,y=>{u(new Hw("addNode",y.id))}),b.events.removeNode.subscribe(n,y=>{u(new Hw("removeNode",y.save()))}),b.events.addConnection.subscribe(n,y=>{u(new qw("addConnection",y.id))}),b.events.removeConnection.subscribe(n,y=>{u(new qw("removeConnection",y))}))},{immediate:!0}),e.registerCommand(yb,{canExecute:f,execute:_}),e.registerCommand(vb,{canExecute:m,execute:E}),e.registerCommand(eM,{canExecute:()=>!a.value,execute:d}),e.registerCommand(tM,{canExecute:()=>a.value,execute:h}),e.registerHotkey(["Control","z"],yb),e.registerHotkey(["Control","y"],vb),ei({maxSteps:i})}const Sb="COPY",Tb="PASTE",VLt="CLEAR_CLIPBOARD";function zLt(t,e,n){const i=Symbol("ClipboardToken"),s=ft(""),r=ft(""),o=st(()=>!s.value),a=()=>{s.value="",r.value=""},l=()=>{const h=t.value.selectedNodes.flatMap(_=>[...Object.values(_.inputs),...Object.values(_.outputs)]),f=t.value.connections.filter(_=>h.includes(_.from)||h.includes(_.to)).map(_=>({from:_.from.id,to:_.to.id}));r.value=JSON.stringify(f),s.value=JSON.stringify(t.value.selectedNodes.map(_=>_.save()))},u=(h,f,_)=>{for(const m of h){let E;if((!_||_==="input")&&(E=Object.values(m.inputs).find(b=>b.id===f)),!E&&(!_||_==="output")&&(E=Object.values(m.outputs).find(b=>b.id===f)),E)return E}},d=()=>{if(o.value)return;const h=new Map,f=JSON.parse(s.value),_=JSON.parse(r.value),m=[],E=[],b=t.value;n.executeCommand(eM);for(const g of f){const y=e.value.nodeTypes.get(g.type);if(!y){console.warn(`Node type ${g.type} not registered`);return}const v=new y.type,S=v.id;m.push(v),v.hooks.beforeLoad.subscribe(i,C=>{const T=C;return T.position&&(T.position.x+=100,T.position.y+=100),v.hooks.beforeLoad.unsubscribe(i),T}),b.addNode(v),v.load({...g,id:S}),v.id=S,h.set(g.id,S);for(const C of Object.values(v.inputs)){const T=vu();h.set(C.id,T),C.id=T}for(const C of Object.values(v.outputs)){const T=vu();h.set(C.id,T),C.id=T}}for(const g of _){const y=u(m,h.get(g.from),"output"),v=u(m,h.get(g.to),"input");if(!y||!v)continue;const S=b.addConnection(y,v);S&&E.push(S)}return t.value.selectedNodes=m,n.executeCommand(tM),{newNodes:m,newConnections:E}};return n.registerCommand(Sb,{canExecute:()=>t.value.selectedNodes.length>0,execute:l}),n.registerHotkey(["Control","c"],Sb),n.registerCommand(Tb,{canExecute:()=>!o.value,execute:d}),n.registerHotkey(["Control","v"],Tb),n.registerCommand(VLt,{canExecute:()=>!0,execute:a}),ei({isEmpty:o})}const HLt="OPEN_SIDEBAR";function qLt(t,e){e.registerCommand(HLt,{execute:n=>{t.value.sidebar.nodeId=n,t.value.sidebar.visible=!0},canExecute:()=>!0})}function YLt(t,e){qLt(t,e)}const $Lt={},WLt={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"},KLt=c("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),jLt=c("path",{d:"M9 13l-4 -4l4 -4m-4 4h11a4 4 0 0 1 0 8h-1"},null,-1),QLt=[KLt,jLt];function XLt(t,e){return w(),A("svg",WLt,QLt)}const ZLt=hn($Lt,[["render",XLt]]),JLt={},ePt={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"},tPt=c("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),nPt=c("path",{d:"M15 13l4 -4l-4 -4m4 4h-11a4 4 0 0 0 0 8h1"},null,-1),iPt=[tPt,nPt];function sPt(t,e){return w(),A("svg",ePt,iPt)}const rPt=hn(JLt,[["render",sPt]]),oPt={},aPt={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"},lPt=c("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),cPt=c("line",{x1:"5",y1:"12",x2:"19",y2:"12"},null,-1),dPt=c("line",{x1:"5",y1:"12",x2:"11",y2:"18"},null,-1),uPt=c("line",{x1:"5",y1:"12",x2:"11",y2:"6"},null,-1),pPt=[lPt,cPt,dPt,uPt];function _Pt(t,e){return w(),A("svg",aPt,pPt)}const hPt=hn(oPt,[["render",_Pt]]),fPt={},mPt={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"},gPt=c("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),bPt=c("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),EPt=c("rect",{x:"9",y:"3",width:"6",height:"4",rx:"2"},null,-1),yPt=[gPt,bPt,EPt];function vPt(t,e){return w(),A("svg",mPt,yPt)}const SPt=hn(fPt,[["render",vPt]]),TPt={},xPt={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"},CPt=c("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),wPt=c("rect",{x:"8",y:"8",width:"12",height:"12",rx:"2"},null,-1),RPt=c("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),APt=[CPt,wPt,RPt];function NPt(t,e){return w(),A("svg",xPt,APt)}const OPt=hn(TPt,[["render",NPt]]),IPt={},MPt={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"},DPt=c("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),kPt=c("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),LPt=c("circle",{cx:"12",cy:"14",r:"2"},null,-1),PPt=c("polyline",{points:"14 4 14 8 8 8 8 4"},null,-1),UPt=[DPt,kPt,LPt,PPt];function FPt(t,e){return w(),A("svg",MPt,UPt)}const BPt=hn(IPt,[["render",FPt]]),GPt={},VPt={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"},zPt=Vb('',6),HPt=[zPt];function qPt(t,e){return w(),A("svg",VPt,HPt)}const YPt=hn(GPt,[["render",qPt]]),$Pt=_n({props:{command:{type:String,required:!0},title:{type:String,required:!0},icon:{type:Object,required:!1,default:void 0}},setup(){const{viewModel:t}=Oi();return{viewModel:t}}}),WPt=["disabled","title"];function KPt(t,e,n,i,s,r){return w(),A("button",{class:"baklava-toolbar-entry baklava-toolbar-button",disabled:!t.viewModel.commandHandler.canExecuteCommand(t.command),title:t.title,onClick:e[0]||(e[0]=o=>t.viewModel.commandHandler.executeCommand(t.command))},[t.icon?(w(),xt(Lu(t.icon),{key:0})):(w(),A(Ye,{key:1},[et(he(t.title),1)],64))],8,WPt)}const jPt=hn($Pt,[["render",KPt]]),QPt=_n({components:{ToolbarButton:jPt},setup(){const{viewModel:t}=Oi();return{isSubgraph:st(()=>t.value.displayedGraph!==t.value.editor.graph),commands:[{command:Sb,title:"Copy",icon:OPt},{command:Tb,title:"Paste",icon:SPt},{command:yb,title:"Undo",icon:ZLt},{command:vb,title:"Redo",icon:rPt},{command:ZI,title:"Create Subgraph",icon:YPt}],subgraphCommands:[{command:cc,title:"Save Subgraph",icon:BPt},{command:JI,title:"Back to Main Graph",icon:hPt}]}}}),XPt={class:"baklava-toolbar"};function ZPt(t,e,n,i,s,r){const o=mt("toolbar-button");return w(),A("div",XPt,[(w(!0),A(Ye,null,lt(t.commands,a=>(w(),xt(o,{key:a.command,command:a.command,title:a.title,icon:a.icon},null,8,["command","title","icon"]))),128)),t.isSubgraph?(w(!0),A(Ye,{key:0},lt(t.subgraphCommands,a=>(w(),xt(o,{key:a.command,command:a.command,title:a.title,icon:a.icon},null,8,["command","title","icon"]))),128)):V("",!0)])}const JPt=hn(QPt,[["render",ZPt]]),eUt={class:"connections-container"},tUt=_n({__name:"Editor",props:{viewModel:{}},setup(t){const e=t,n=Symbol("EditorToken"),i=$d(e,"viewModel");jDt(i);const s=ft(null);sa("editorEl",s);const r=st(()=>e.viewModel.displayedGraph.nodes),o=st(()=>e.viewModel.displayedGraph.nodes.map(O=>GI($d(O,"position")))),a=st(()=>e.viewModel.displayedGraph.connections),l=st(()=>e.viewModel.displayedGraph.selectedNodes),u=QDt(),d=XDt(),h=ZDt(i),f=st(()=>({...u.styles.value})),_=ft(0);e.viewModel.editor.hooks.load.subscribe(n,O=>(_.value++,O));const m=O=>{u.onPointerMove(O),d.onMouseMove(O)},E=O=>{O.button===0&&(O.target===s.value&&(S(),u.onPointerDown(O)),d.onMouseDown())},b=O=>{u.onPointerUp(O),d.onMouseUp()},g=O=>{O.key==="Tab"&&O.preventDefault(),e.viewModel.commandHandler.handleKeyDown(O)},y=O=>{e.viewModel.commandHandler.handleKeyUp(O)},v=O=>{["Control","Shift"].some(k=>e.viewModel.commandHandler.pressedKeys.includes(k))||S(),e.viewModel.displayedGraph.selectedNodes.push(O)},S=()=>{e.viewModel.displayedGraph.selectedNodes=[]},C=O=>{for(const k of e.viewModel.displayedGraph.selectedNodes){const x=r.value.indexOf(k),I=o.value[x];I.onPointerDown(O),document.addEventListener("pointermove",I.onPointerMove)}document.addEventListener("pointerup",T)},T=()=>{for(const O of e.viewModel.displayedGraph.selectedNodes){const k=r.value.indexOf(O),x=o.value[k];x.onPointerUp(),document.removeEventListener("pointermove",x.onPointerMove)}document.removeEventListener("pointerup",T)};return(O,k)=>(w(),A("div",{ref_key:"el",ref:s,tabindex:"-1",class:ze(["baklava-editor",{"baklava-ignore-mouse":!!yt(d).temporaryConnection.value||yt(u).dragging.value,"--temporary-connection":!!yt(d).temporaryConnection.value}]),onPointermove:be(m,["self"]),onPointerdown:E,onPointerup:b,onWheel:k[1]||(k[1]=be((...x)=>yt(u).onMouseWheel&&yt(u).onMouseWheel(...x),["self"])),onKeydown:g,onKeyup:y,onContextmenu:k[2]||(k[2]=be((...x)=>yt(h).open&&yt(h).open(...x),["self","prevent"]))},[kn(O.$slots,"background",{},()=>[Te(tkt)]),kn(O.$slots,"toolbar",{},()=>[Te(JPt)]),kn(O.$slots,"palette",{},()=>[Te(iLt)]),(w(),A("svg",eUt,[(w(!0),A(Ye,null,lt(a.value,x=>(w(),A("g",{key:x.id+_.value.toString()},[kn(O.$slots,"connection",{connection:x},()=>[Te(Bkt,{connection:x},null,8,["connection"])])]))),128)),kn(O.$slots,"temporaryConnection",{temporaryConnection:yt(d).temporaryConnection.value},()=>[yt(d).temporaryConnection.value?(w(),xt(zkt,{key:0,connection:yt(d).temporaryConnection.value},null,8,["connection"])):V("",!0)])])),c("div",{class:"node-container",style:en(f.value)},[Te(os,{name:"fade"},{default:We(()=>[(w(!0),A(Ye,null,lt(r.value,(x,I)=>kn(O.$slots,"node",{key:x.id+_.value.toString(),node:x,selected:l.value.includes(x),dragging:o.value[I].dragging.value,onSelect:F=>v(x),onStartDrag:C},()=>[Te(Mkt,{node:x,selected:l.value.includes(x),dragging:o.value[I].dragging.value,onSelect:F=>v(x),onStartDrag:C},null,8,["node","selected","dragging","onSelect"])])),128))]),_:3})],4),kn(O.$slots,"sidebar",{},()=>[Te(Wkt)]),kn(O.$slots,"minimap",{},()=>[O.viewModel.settings.enableMinimap?(w(),xt(Kkt,{key:0})):V("",!0)]),kn(O.$slots,"contextMenu",{contextMenu:yt(h)},()=>[O.viewModel.settings.contextMenu.enabled?(w(),xt(_y,{key:0,modelValue:yt(h).show.value,"onUpdate:modelValue":k[0]||(k[0]=x=>yt(h).show.value=x),items:yt(h).items.value,x:yt(h).x.value,y:yt(h).y.value,onClick:yt(h).onClick},null,8,["modelValue","items","x","y","onClick"])):V("",!0)])],34))}}),nUt=["INPUT","TEXTAREA","SELECT"];function iUt(t){const e=ft([]),n=ft([]);return{pressedKeys:e,handleKeyDown:o=>{var a;e.value.includes(o.key)||e.value.push(o.key),!nUt.includes(((a=document.activeElement)==null?void 0:a.tagName)??"")&&n.value.forEach(l=>{l.keys.every(u=>e.value.includes(u))&&t(l.commandName)})},handleKeyUp:o=>{const a=e.value.indexOf(o.key);a>=0&&e.value.splice(a,1)},registerHotkey:(o,a)=>{n.value.push({keys:o,commandName:a})}}}const sUt=()=>{const t=ft(new Map),e=(r,o)=>{if(t.value.has(r))throw new Error(`Command "${r}" already exists`);t.value.set(r,o)},n=(r,o=!1,...a)=>{if(!t.value.has(r)){if(o)throw new Error(`[CommandHandler] Command ${r} not registered`);return}return t.value.get(r).execute(...a)},i=(r,o=!1,...a)=>{if(!t.value.has(r)){if(o)throw new Error(`[CommandHandler] Command ${r} not registered`);return!1}return t.value.get(r).canExecute(a)},s=iUt(n);return ei({registerCommand:e,executeCommand:n,canExecuteCommand:i,...s})},rUt=t=>!(t instanceof Sc);function oUt(t,e){return{switchGraph:i=>{let s;if(rUt(i))s=new Sc(t.value),i.createGraph(s);else{if(i!==t.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!==t.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 aUt(t,e){t.position=t.position??{x:0,y:0},t.disablePointerEvents=!1,t.twoColumn=t.twoColumn??!1,t.width=t.width??e.defaultWidth}const lUt=()=>({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 cUt(t){const e=ft(t??new HDt),n=Symbol("ViewModelToken"),i=ft(null),s=s2(i),{switchGraph:r}=oUt(e,i),o=st(()=>s.value&&s.value!==e.value.graph),a=ei(lUt()),l=sUt(),u=GLt(s,l),d=zLt(s,e,l),h={renderNode:new li(null),renderInterface:new li(null)};return FLt(s,l,r),YLt(s,l),qn(e,(f,_)=>{_&&(_.events.registerGraph.unsubscribe(n),_.graphEvents.beforeAddNode.unsubscribe(n),f.nodeHooks.beforeLoad.unsubscribe(n),f.nodeHooks.afterSave.unsubscribe(n),f.graphTemplateHooks.beforeLoad.unsubscribe(n),f.graphTemplateHooks.afterSave.unsubscribe(n),f.graph.hooks.load.unsubscribe(n),f.graph.hooks.save.unsubscribe(n)),f&&(f.nodeHooks.beforeLoad.subscribe(n,(m,E)=>(E.position=m.position??{x:0,y:0},E.width=m.width??a.nodes.defaultWidth,E.twoColumn=m.twoColumn??!1,m)),f.nodeHooks.afterSave.subscribe(n,(m,E)=>(m.position=E.position,m.width=E.width,m.twoColumn=E.twoColumn,m)),f.graphTemplateHooks.beforeLoad.subscribe(n,(m,E)=>(E.panning=m.panning,E.scaling=m.scaling,m)),f.graphTemplateHooks.afterSave.subscribe(n,(m,E)=>(m.panning=E.panning,m.scaling=E.scaling,m)),f.graph.hooks.load.subscribe(n,(m,E)=>(E.panning=m.panning,E.scaling=m.scaling,m)),f.graph.hooks.save.subscribe(n,(m,E)=>(m.panning=E.panning,m.scaling=E.scaling,m)),f.graphEvents.beforeAddNode.subscribe(n,m=>aUt(m,{defaultWidth:a.nodes.defaultWidth})),e.value.registerNodeType(QI,{category:"Subgraphs"}),e.value.registerNodeType(XI,{category:"Subgraphs"}),r(f.graph))},{immediate:!0}),ei({editor:e,displayedGraph:s,isSubgraph:o,settings:a,commandHandler:l,history:u,clipboard:d,hooks:h,switchGraph:r})}const dUt=Ja({type:"PersonalityNode",title:"Personality",inputs:{request:()=>new nn("Request",""),agent_name:()=>new CLt("Personality","",Su.state.config.personalities).setPort(!1)},outputs:{response:()=>new nn("Response","")},async calculate({request:t}){console.log(Su.state.config.personalities);let e="";try{e=(await Se.post("/generate",{params:{text:t}})).data}catch(n){console.error(n)}return{display:e,response:e}}}),uUt=Ja({type:"RAGNode",title:"RAG",inputs:{request:()=>new nn("Prompt",""),document_path:()=>new Tc("Document path","").setPort(!1)},outputs:{prompt:()=>new nn("Prompt with Data","")},async calculate({request:t,document_path:e}){let n="";try{n=(await Se.get("/rag",{params:{text:t,doc_path:e}})).data}catch(i){console.error(i)}return{response:n}}}),Yw=Ja({type:"Task",title:"Task",inputs:{description:()=>new Tc("Task description","").setPort(!1)},outputs:{prompt:()=>new nn("Prompt")},calculate({description:t}){return{prompt:t}}}),$w=Ja({type:"TextDisplayNode",title:"TextDisplay",inputs:{text2display:()=>new nn("Input","")},outputs:{response:()=>new NLt("Text","")},async calculate({request:t}){}}),Ww=Ja({type:"LLMNode",title:"LLM",inputs:{request:()=>new nn("Request","")},outputs:{response:()=>new nn("Response","")},async calculate({request:t}){console.log(Su.state.config.personalities);let e="";try{e=(await Se.post("/generate",{params:{text:t}})).data}catch(n){console.error(n)}return{display:e,response:e}}}),pUt=Ja({type:"MultichoiceNode",title:"Multichoice",inputs:{question:()=>new nn("Question",""),outputs:()=>new Tc("choices, one per line","","").setPort(!1)},outputs:{response:()=>new nn("Response","")}}),_Ut=_n({components:{"baklava-editor":tUt},setup(){const t=cUt(),e=new KDt(t.editor);t.editor.registerNodeType(dUt),t.editor.registerNodeType(Yw),t.editor.registerNodeType(uUt),t.editor.registerNodeType($w),t.editor.registerNodeType(Ww),t.editor.registerNodeType(pUt);const n=Symbol();e.events.afterRun.subscribe(n,a=>{e.pause(),qDt(a,t.editor),e.resume()}),e.start();function i(a,l,u){const d=new a;return t.displayedGraph.addNode(d),d.position.x=l,d.position.y=u,d}const s=i(Yw,300,140),r=i(Ww,550,140),o=i($w,850,140);return t.displayedGraph.addConnection(s.outputs.prompt,r.inputs.request),t.displayedGraph.addConnection(r.outputs.response,o.inputs.text2display),{baklava:t,saveGraph:()=>{const a=e.export();localStorage.setItem("myGraph",JSON.stringify(a))},loadGraph:()=>{const a=JSON.parse(localStorage.getItem("myGraph"));e.import(a)}}}}),hUt={style:{width:"100vw",height:"100vh"}};function fUt(t,e,n,i,s,r){const o=mt("baklava-editor");return w(),A("div",hUt,[Te(o,{"view-model":t.baklava},null,8,["view-model"]),c("button",{onClick:e[0]||(e[0]=(...a)=>t.saveGraph&&t.saveGraph(...a))},"Save Graph"),c("button",{onClick:e[1]||(e[1]=(...a)=>t.loadGraph&&t.loadGraph(...a))},"Load Graph")])}const mUt=bt(_Ut,[["render",fUt]]),gUt={},bUt={style:{width:"100vw",height:"100vh"}},EUt=["src"];function yUt(t,e,n,i,s,r){return w(),A("div",bUt,[c("iframe",{src:t.$store.state.config.comfyui_base_url,class:"m-0 p-0 w-full h-full"},null,8,EUt)])}const vUt=bt(gUt,[["render",yUt]]),SUt={},TUt={style:{width:"100vw",height:"100vh"}},xUt=["src"];function CUt(t,e,n,i,s,r){return w(),A("div",TUt,[c("iframe",{src:t.$store.state.config.sd_base_url,class:"m-0 p-0 w-full h-full"},null,8,xUt)])}const wUt=bt(SUt,[["render",CUt]]),RUt=HP({history:aP("/"),routes:[{path:"/auto_sd_view/",name:"AutoSD",component:wUt},{path:"/autosd_view/",name:"ComfyUI",component:vUt},{path:"/playground/",name:"playground",component:Rtt},{path:"/extensions/",name:"extensions",component:Ftt},{path:"/help_view/",name:"help_view",component:qtt},{path:"/settings/",name:"settings",component:Ybt},{path:"/training/",name:"training",component:pEt},{path:"/quantizing/",name:"quantizing",component:vEt},{path:"/",name:"discussions",component:vwt},{path:"/",name:"interactive",component:PDt},{path:"/",name:"nodes",component:mUt}]});const fp=jD(RZe);console.log("Loaded main.js");function AUt(t){const e={};for(const n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}const Su=vk({state(){return{is_rt_on:!1,language:"english",languages:[],currentTheme:"",personality_editor:null,showPersonalityEditor:!1,selectedPersonality:null,currentPersonConfig:{ai_name:"",ai_author:"",ai_category:"",ai_language:"",ai_description:"",ai_conditionning:"",ai_disclaimer:"",ai_icon:null},posts_headers:{accept:"application/json","Content-Type":"application/json"},client_id:"",yesNoDialog:null,universalForm:null,toast:null,news:null,messageBox:null,api_get_req:null,api_post_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:[],bindingsZoo:[],modelsArr:[],selectedModel:null,personalities:[],diskUsage:null,ramUsage:null,vramUsage:null,modelsZoo:[],installedModels:[],installedBindings:[],currentModel:null,currentBinding:null,databases:[]}},mutations:{setisRTOn(t,e){t.is_rt_on=e},setLanguages(t,e){t.languages=e},setLanguage(t,e){t.language=e},setIsReady(t,e){t.ready=e},setIsConnected(t,e){t.isConnected=e},setIsModelOk(t,e){t.isModelOk=e},setIsGenerating(t,e){t.isGenerating=e},setConfig(t,e){t.config=e},setPersonalities(t,e){t.personalities=e},setMountedPers(t,e){t.mountedPers=e},setMountedPersArr(t,e){t.mountedPersArr=e},setbindingsZoo(t,e){t.bindingsZoo=e},setModelsArr(t,e){t.modelsArr=e},setselectedModel(t,e){t.selectedModel=e},setDiskUsage(t,e){t.diskUsage=e},setRamUsage(t,e){t.ramUsage=e},setVramUsage(t,e){t.vramUsage=e},setModelsZoo(t,e){t.modelsZoo=e},setCurrentBinding(t,e){t.currentBinding=e},setCurrentModel(t,e){t.currentModel=e},setDatabases(t,e){t.databases=e},setTheme(t){this.currentTheme=t}},getters:{getisRTOn(t){return t.is_rt_on},getLanguages(t){return t.languages},getLanguage(t){return t.language},getIsConnected(t){return t.isConnected},getIsModelOk(t){return t.isModelOk},getIsGenerating(t){return t.isGenerating},getConfig(t){return t.config},getPersonalities(t){return t.personalities},getMountedPersArr(t){return t.mountedPersArr},getMountedPers(t){return t.mountedPers},getbindingsZoo(t){return t.bindingsZoo},getModelsArr(t){return t.modelsArr},getDiskUsage(t){return t.diskUsage},getRamUsage(t){return t.ramUsage},getVramUsage(t){return t.vramUsage},getDatabasesList(t){return t.databases},getModelsZoo(t){return t.modelsZoo},getCyrrentBinding(t){return t.currentBinding},getCurrentModel(t){return t.currentModel}},actions:{async getVersion(){try{let t=await Se.get("/get_lollms_webui_version",{});t&&(this.state.version=t.data,console.log("version res:",t),console.log("version :",this.state.version))}catch{console.log("Coudln't get version")}},async refreshConfig({commit:t}){console.log("Fetching configuration");try{const e=await ki("get_config");e.active_personality_id<0&&(e.active_personality_id=0);let n=e.personalities[e.active_personality_id].split("/");e.personality_category=n[0],e.personality_folder=n[1],console.log("Recovered config"),console.log(e),console.log("Committing config"),console.log(e),console.log(this.state.config),t("setConfig",e)}catch(e){console.log(e.message,"refreshConfig")}},async refreshDatabase({commit:t}){let e=await ki("list_databases");console.log("databases:",e),t("setDatabases",e)},async fetchisRTOn({commit:t}){console.log("is_rt_on",this.state.client_id);const e=await Se.get("/is_rt_on");console.log("response",e);const n=e.data.status;console.log("is_rt_on",n),t("setRTOn",n)},async fetchLanguages({commit:t}){console.log("get_personality_languages_list",this.state.client_id);const e=await Se.post("/get_personality_languages_list",{client_id:this.state.client_id});console.log("response",e);const n=e.data;console.log("languages",n),t("setLanguages",n)},async fetchLanguage({commit:t}){console.log("get_personality_language",this.state.client_id);const e=await Se.post("/get_personality_language",{client_id:this.state.client_id});console.log("response",e);const n=e.data;console.log("language",n),t("setLanguage",n)},async changeLanguage({commit:t},e){console.log("Changing language to ",e);let n=await Se.post("/set_personality_language",{client_id:this.state.client_id,language:e});console.log("get_personality_languages_list",this.state.client_id),n=await Se.post("/get_personality_languages_list",{client_id:this.state.client_id}),console.log("response",n);const i=n.data;console.log("languages",i),t("setLanguages",i),n=await Se.post("/get_personality_language",{client_id:this.state.client_id}),console.log("response",n);const s=n.data;console.log("language",s),t("setLanguage",s),console.log("Language changed successfully:",n.data.message)},async deleteLanguage({commit:t},e){console.log("Deleting ",e);let n=await Se.post("/del_personality_language",{client_id:this.state.client_id,language:e});console.log("get_personality_languages_list",this.state.client_id),n=await Se.post("/get_personality_languages_list",{client_id:this.state.client_id}),console.log("response",n);const i=n.data;console.log("languages",i),t("setLanguages",i),n=await Se.post("/get_personality_language",{client_id:this.state.client_id}),console.log("response",n);const s=n.data;console.log("language",s),t("setLanguage",s),console.log("Language changed successfully:",n.data.message)},async refreshPersonalitiesZoo({commit:t}){let e=[];const n=await ki("get_all_personalities"),i=Object.keys(n);console.log("Personalities recovered:"+this.state.config.personalities);for(let s=0;s{let u=!1;for(const h of this.state.config.personalities)if(h.includes(r+"/"+l.folder))if(u=!0,h.includes(":")){const f=h.split(":");l.language=f[1]}else l.language=null;let d={};return d=l,d.category=r,d.full_path=r+"/"+l.folder,d.isMounted=u,d});e.length==0?e=a:e=e.concat(a)}e.sort((s,r)=>s.name.localeCompare(r.name)),t("setPersonalities",e),console.log("Done loading personalities")},refreshMountedPersonalities({commit:t}){this.state.config.active_personality_id<0&&(this.state.config.active_personality_id=0);let e=[];const n=[];for(let i=0;ia.full_path==s||a.full_path==r[0]);if(o>=0){let a=AUt(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 n.push(i),console.log("Couldn't load personality : ",s)}for(let i=n.length-1;i>=0;i--)console.log("Removing personality : ",this.state.config.personalities[n[i]]),this.state.config.personalities.splice(n[i],1),this.state.config.active_personality_id>n[i]&&(this.state.config.active_personality_id-=1);t("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:t}){let e=await ki("list_bindings");console.log("Loaded bindings zoo :",e),this.state.installedBindings=e.filter(i=>i.installed),console.log("Loaded bindings zoo ",this.state.installedBindings),t("setbindingsZoo",e);const n=e.findIndex(i=>i.name==this.state.config.binding_name);n!=-1&&t("setCurrentBinding",e[n])},async refreshModelsZoo({commit:t}){console.log("Fetching models");const n=(await Se.get("/get_available_models")).data.filter(i=>i.variants&&i.variants.length>0);console.log(`get_available_models: ${n}`),t("setModelsZoo",n)},async refreshModelStatus({commit:t}){let e=await ki("get_model_status");t("setIsModelOk",e.status)},async refreshModels({commit:t}){console.log("Fetching models");let e=await ki("list_models");console.log(`Found ${e}`);let n=await ki("get_active_model");console.log("Selected model ",n),n!=null&&t("setselectedModel",n.model),t("setModelsArr",e),console.log("setModelsArr",e),console.log("this.state.modelsZoo",this.state.modelsZoo),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&&t("setCurrentModel",this.state.modelsZoo[i])},async refreshDiskUsage({commit:t}){this.state.diskUsage=await ki("disk_usage")},async refreshRamUsage({commit:t}){this.state.ramUsage=await ki("ram_usage")},async refreshVramUsage({commit:t}){const e=await ki("vram_usage"),n=[];if(e.nb_gpus>0){for(let s=0;s LoLLMS WebUI - Welcome - - + +
diff --git a/web/src/views/SettingsView.vue b/web/src/views/SettingsView.vue index 090cd690..1920150a 100644 --- a/web/src/views/SettingsView.vue +++ b/web/src/views/SettingsView.vue @@ -1154,6 +1154,18 @@ class="w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600" > + + + + + + + + diff --git a/zoos/models_zoo b/zoos/models_zoo index 381c2a90..f991f3f5 160000 --- a/zoos/models_zoo +++ b/zoos/models_zoo @@ -1 +1 @@ -Subproject commit 381c2a90bcf6d02100448a7d91c66222b8cc68a8 +Subproject commit f991f3f585be4904bba822301bc01eeb94d771f1 diff --git a/zoos/personalities_zoo b/zoos/personalities_zoo index 81d21886..4ca7182f 160000 --- a/zoos/personalities_zoo +++ b/zoos/personalities_zoo @@ -1 +1 @@ -Subproject commit 81d218860024938d2fcfc7ddd89394853b261dc4 +Subproject commit 4ca7182fbe310a5efdc429eaf4a0ddbb4af03d6d