diff --git a/web/dist/assets/index-f7f15056.css b/web/dist/assets/index-2bf4e8d6.css similarity index 99% rename from web/dist/assets/index-f7f15056.css rename to web/dist/assets/index-2bf4e8d6.css index ab6c24c9..a8a909bc 100644 --- a/web/dist/assets/index-f7f15056.css +++ b/web/dist/assets/index-2bf4e8d6.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-2d3d13af]{font-size:24px;animation:pulsate-2d3d13af 1.5s infinite}@keyframes pulsate-2d3d13af{0%{transform:scale(1);opacity:1}50%{transform:scale(1.1);opacity:.7}to{transform:scale(1);opacity:1}}.list-move[data-v-2d3d13af],.list-enter-active[data-v-2d3d13af],.list-leave-active[data-v-2d3d13af]{transition:all .5s ease}.list-enter-from[data-v-2d3d13af]{transform:translatey(-30px)}.list-leave-to[data-v-2d3d13af]{opacity:0;transform:translatey(30px)}.list-leave-active[data-v-2d3d13af]{position:absolute}.bounce-enter-active[data-v-2d3d13af]{animation:bounce-in-2d3d13af .5s}.bounce-leave-active[data-v-2d3d13af]{animation:bounce-in-2d3d13af .5s reverse}@keyframes bounce-in-2d3d13af{0%{transform:scale(0)}50%{transform:scale(1.25)}to{transform:scale(1)}}.bg-primary-light[data-v-2d3d13af]{background-color:#0ff}.hover[data-v-2d3d13af]:bg-primary-light:hover{background-color:#7fffd4}.font-bold[data-v-2d3d13af]{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-64fb461b],.list-enter-active[data-v-64fb461b],.list-leave-active[data-v-64fb461b]{transition:all .5s ease}.list-enter-from[data-v-64fb461b]{transform:translatey(-30px)}.list-leave-to[data-v-64fb461b]{opacity:0;transform:translatey(30px)}.list-leave-active[data-v-64fb461b]{position:absolute}.custom-scrollbar[data-v-c538ea16]{scrollbar-width:thin;scrollbar-color:rgba(155,155,155,.5) transparent}.custom-scrollbar[data-v-c538ea16]::-webkit-scrollbar{width:8px}.custom-scrollbar[data-v-c538ea16]::-webkit-scrollbar-track{background:transparent}.custom-scrollbar[data-v-c538ea16]::-webkit-scrollbar-thumb{background-color:#9b9b9b80;border-radius:20px;border:transparent}@keyframes custom-pulse-c538ea16{0%,to{box-shadow:0 0 #3b82f680}50%{box-shadow:0 0 0 15px #3b82f600}}.animate-pulse[data-v-c538ea16]{animation:custom-pulse-c538ea16 2s infinite}.slide-right-enter-active[data-v-c538ea16],.slide-right-leave-active[data-v-c538ea16]{transition:transform .3s ease}.slide-right-enter[data-v-c538ea16],.slide-right-leave-to[data-v-c538ea16]{transform:translate(-100%)}.slide-left-enter-active[data-v-c538ea16],.slide-left-leave-active[data-v-c538ea16]{transition:transform .3s ease}.slide-left-enter[data-v-c538ea16],.slide-left-leave-to[data-v-c538ea16]{transform:translate(100%)}.fade-and-fly-enter-active[data-v-c538ea16]{animation:fade-and-fly-enter-c538ea16 .5s ease}.fade-and-fly-leave-active[data-v-c538ea16]{animation:fade-and-fly-leave-c538ea16 .5s ease}@keyframes fade-and-fly-enter-c538ea16{0%{opacity:0;transform:translateY(20px) scale(.8)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes fade-and-fly-leave-c538ea16{0%{opacity:1;transform:translateY(0) scale(1)}to{opacity:0;transform:translateY(-20px) scale(1.2)}}.list-move[data-v-c538ea16],.list-enter-active[data-v-c538ea16],.list-leave-active[data-v-c538ea16]{transition:all .5s ease}.list-enter-from[data-v-c538ea16]{transform:translatey(-30px)}.list-leave-to[data-v-c538ea16]{opacity:0;transform:translatey(30px)}.list-leave-active[data-v-c538ea16]{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-\[220px\]{height:220px}.h-\[600px\]{height:600px}.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-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-0{--tw-bg-opacity: 0}.bg-opacity-10{--tw-bg-opacity: .1}.bg-opacity-50{--tw-bg-opacity: .5}.bg-opacity-70{--tw-bg-opacity: .7}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.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-transparent{--tw-gradient-from: transparent var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 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-transparent{--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), transparent 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-white{--tw-gradient-to: #ffffff 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\:text-yellow-400{--tw-text-opacity: 1;color:rgb(227 160 8 / var(--tw-text-opacity))}.group:hover .group-hover\:opacity-0{opacity:0}.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-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;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-opacity-20:hover{--tw-bg-opacity: .2}.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-lg:hover{--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)}.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\:shadow-xl:hover{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:scrollbar-thumb-primary{--scrollbar-thumb-hover: 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\:to-gray-800){--tw-gradient-to: #1F2937 var(--tw-gradient-to-position)}: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\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.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\:grid-cols-3{grid-template-columns:repeat(3,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\:grid-cols-4{grid-template-columns:repeat(4,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-e519cdb3]{font-size:24px;animation:pulsate-e519cdb3 1.5s infinite}@keyframes pulsate-e519cdb3{0%{transform:scale(1);opacity:1}50%{transform:scale(1.1);opacity:.7}to{transform:scale(1);opacity:1}}.list-move[data-v-e519cdb3],.list-enter-active[data-v-e519cdb3],.list-leave-active[data-v-e519cdb3]{transition:all .5s ease}.list-enter-from[data-v-e519cdb3]{transform:translatey(-30px)}.list-leave-to[data-v-e519cdb3]{opacity:0;transform:translatey(30px)}.list-leave-active[data-v-e519cdb3]{position:absolute}.bounce-enter-active[data-v-e519cdb3]{animation:bounce-in-e519cdb3 .5s}.bounce-leave-active[data-v-e519cdb3]{animation:bounce-in-e519cdb3 .5s reverse}@keyframes bounce-in-e519cdb3{0%{transform:scale(0)}50%{transform:scale(1.25)}to{transform:scale(1)}}.bg-primary-light[data-v-e519cdb3]{background-color:#0ff}.hover[data-v-e519cdb3]:bg-primary-light:hover{background-color:#7fffd4}.font-bold[data-v-e519cdb3]{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-64fb461b],.list-enter-active[data-v-64fb461b],.list-leave-active[data-v-64fb461b]{transition:all .5s ease}.list-enter-from[data-v-64fb461b]{transform:translatey(-30px)}.list-leave-to[data-v-64fb461b]{opacity:0;transform:translatey(30px)}.list-leave-active[data-v-64fb461b]{position:absolute}.custom-scrollbar[data-v-c538ea16]{scrollbar-width:thin;scrollbar-color:rgba(155,155,155,.5) transparent}.custom-scrollbar[data-v-c538ea16]::-webkit-scrollbar{width:8px}.custom-scrollbar[data-v-c538ea16]::-webkit-scrollbar-track{background:transparent}.custom-scrollbar[data-v-c538ea16]::-webkit-scrollbar-thumb{background-color:#9b9b9b80;border-radius:20px;border:transparent}@keyframes custom-pulse-c538ea16{0%,to{box-shadow:0 0 #3b82f680}50%{box-shadow:0 0 0 15px #3b82f600}}.animate-pulse[data-v-c538ea16]{animation:custom-pulse-c538ea16 2s infinite}.slide-right-enter-active[data-v-c538ea16],.slide-right-leave-active[data-v-c538ea16]{transition:transform .3s ease}.slide-right-enter[data-v-c538ea16],.slide-right-leave-to[data-v-c538ea16]{transform:translate(-100%)}.slide-left-enter-active[data-v-c538ea16],.slide-left-leave-active[data-v-c538ea16]{transition:transform .3s ease}.slide-left-enter[data-v-c538ea16],.slide-left-leave-to[data-v-c538ea16]{transform:translate(100%)}.fade-and-fly-enter-active[data-v-c538ea16]{animation:fade-and-fly-enter-c538ea16 .5s ease}.fade-and-fly-leave-active[data-v-c538ea16]{animation:fade-and-fly-leave-c538ea16 .5s ease}@keyframes fade-and-fly-enter-c538ea16{0%{opacity:0;transform:translateY(20px) scale(.8)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes fade-and-fly-leave-c538ea16{0%{opacity:1;transform:translateY(0) scale(1)}to{opacity:0;transform:translateY(-20px) scale(1.2)}}.list-move[data-v-c538ea16],.list-enter-active[data-v-c538ea16],.list-leave-active[data-v-c538ea16]{transition:all .5s ease}.list-enter-from[data-v-c538ea16]{transform:translatey(-30px)}.list-leave-to[data-v-c538ea16]{opacity:0;transform:translatey(30px)}.list-leave-active[data-v-c538ea16]{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-\[220px\]{height:220px}.h-\[600px\]{height:600px}.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-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-0{--tw-bg-opacity: 0}.bg-opacity-10{--tw-bg-opacity: .1}.bg-opacity-50{--tw-bg-opacity: .5}.bg-opacity-70{--tw-bg-opacity: .7}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.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-transparent{--tw-gradient-from: transparent var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 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-transparent{--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), transparent 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-white{--tw-gradient-to: #ffffff 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\:text-yellow-400{--tw-text-opacity: 1;color:rgb(227 160 8 / var(--tw-text-opacity))}.group:hover .group-hover\:opacity-0{opacity:0}.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-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;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-opacity-20:hover{--tw-bg-opacity: .2}.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-lg:hover{--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)}.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\:shadow-xl:hover{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:scrollbar-thumb-primary{--scrollbar-thumb-hover: 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\:to-gray-800){--tw-gradient-to: #1F2937 var(--tw-gradient-to-position)}: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\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.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\:grid-cols-3{grid-template-columns:repeat(3,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\:grid-cols-4{grid-template-columns:repeat(4,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-9fb50d9a.js b/web/dist/assets/index-2de3b115.js similarity index 91% rename from web/dist/assets/index-9fb50d9a.js rename to web/dist/assets/index-2de3b115.js index 479e8252..3b172b83 100644 --- a/web/dist/assets/index-9fb50d9a.js +++ b/web/dist/assets/index-2de3b115.js @@ -80,7 +80,8 @@ https://github.com/highlightjs/highlight.js/issues/2277`),me=P,re=$),J===void 0& `];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+i+1},s=()=>{const i=t(n),r=this.text.substring(n,i);this.msg.text=r,n=i+1,this.msg.onend=o=>{n{s()},1):(this.isSpeaking=!1,console.log("voice off :",this.text.length," ",i))},this.speechSynthesis.speak(this.msg)};s()},getCursorPosition(){return this.$refs.mdTextarea.selectionStart},appendToOutput(n){this.pre_text+=n,this.text=this.pre_text+this.post_text},generate_in_placeholder(){console.log("Finding cursor position");let n=this.text.indexOf("@@");if(n<0){this.$refs.toast.showToast("No generation placeholder found",4,!1);return}this.text=this.text.substring(0,n)+this.text.substring(n+26,this.text.length),this.pre_text=this.text.substring(0,n),this.post_text=this.text.substring(n,this.text.length);var e=this.text.substring(0,n);console.log(e),He.emit("generate_text",{prompt:e,personality:-1,n_predicts:this.n_predicts,n_crop:this.n_crop,parameters:{temperature:this.temperature,top_k:this.top_k,top_p:this.top_p,repeat_penalty:this.repeat_penalty,repeat_last_n:this.repeat_last_n,seed:parseInt(this.seed)}}),this.generating=!0},async tokenize_text(){const n=await de.post("/lollms_tokenize",{prompt:this.text},{headers:this.posts_headers});console.log(n.data.named_tokens),this.namedTokens=n.data.named_tokens},generate(){console.log("Finding cursor position"),this.pre_text=this.text.substring(0,this.getCursorPosition()),this.post_text=this.text.substring(this.getCursorPosition(),this.text.length);var n=this.text.substring(0,this.getCursorPosition());console.log(this.text),console.log(`cursor position :${this.getCursorPosition()}`),console.log(`pretext:${this.pre_text}`),console.log(`post_text:${this.post_text}`),console.log(`prompt:${n}`),He.emit("generate_text",{prompt:n,personality:-1,n_predicts:this.n_predicts,n_crop:this.n_crop,parameters:{temperature:this.temperature,top_k:this.top_k,top_p:this.top_p,repeat_penalty:this.repeat_penalty,repeat_last_n:this.repeat_last_n,seed:parseInt(this.seed)}}),this.generating=!0},stopGeneration(){He.emit("cancel_text_generation",{})},exportText(){const n=this.text,e=document.createElement("a"),t=new Blob([n],{type:"text/plain"});e.href=URL.createObjectURL(t),e.download="exported_text.txt",document.body.appendChild(e),e.click(),document.body.removeChild(e)},importText(){const n=document.getElementById("import-input");n&&(n.addEventListener("change",e=>{if(e.target.files&&e.target.files[0]){const t=new FileReader;t.onload=()=>{this.text=t.result},t.readAsText(e.target.files[0])}else alert("Please select a file.")}),n.click())},setPreset(){console.log("Setting preset"),console.log(this.selectedPreset),this.tab_id="render",this.text=IZe(this.selectedPreset.content,n=>{console.log("Done"),console.log(n),this.text=n})},addPreset(){let n=prompt("Enter the title of the preset:");this.presets[n]={client_id:this.$store.state.client_id,name:n,content:this.text},de.post("./add_preset",this.presets[n]).then(e=>{console.log(e.data)}).catch(e=>{this.$refs.toast.showToast(`Error: ${e}`,4,!1)})},removePreset(){this.selectedPreset&&delete this.presets[this.selectedPreset.name]},reloadPresets(){de.get("./get_presets").then(n=>{console.log(n.data),this.presets=n.data,this.selectedPreset=this.presets[0]}).catch(n=>{this.$refs.toast.showToast(`Error: ${n}`,4,!1)})},startRecording(){this.pending=!0,this.is_recording?de.post("/stop_recording",{client_id:this.$store.state.client_id}).then(n=>{this.is_recording=!1,this.pending=!1,console.log(n),this.text+=n.data.text,console.log(n.data),this.presets=n.data,this.selectedPreset=this.presets[0]}).catch(n=>{this.$refs.toast.showToast(`Error: ${n}`,4,!1)}):de.post("/start_recording",{client_id:this.$store.state.client_id}).then(n=>{this.is_recording=!0,this.pending=!1,console.log(n.data)}).catch(n=>{this.$refs.toast.showToast(`Error: ${n}`,4,!1)})},startRecordingAndTranscribing(){this.pending=!0,this.is_deaf_transcribing?de.get("/stop_recording").then(n=>{this.is_deaf_transcribing=!1,this.pending=!1,this.text=n.data.text,this.read()}).catch(n=>{this.$refs.toast.showToast(`Error: ${n}`,4,!1)}):de.get("/start_recording").then(n=>{this.is_deaf_transcribing=!0,this.pending=!1}).catch(n=>{this.$refs.toast.showToast(`Error: ${n}`,4,!1)})},startSpeechRecognition(){"SpeechRecognition"in window||"webkitSpeechRecognition"in window?(this.recognition=new(window.SpeechRecognition||window.webkitSpeechRecognition),this.recognition.lang=this.$store.state.config.audio_in_language,this.recognition.interimResults=!0,this.recognition.onstart=()=>{this.isLesteningToVoice=!0,this.silenceTimer=setTimeout(()=>{this.recognition.stop()},this.silenceTimeout)},this.pre_text=this.text.substring(0,this.getCursorPosition()),this.post_text=this.text.substring(this.getCursorPosition(),this.text.length),this.recognition.onresult=n=>{this.generated="";for(let e=n.resultIndex;e{this.recognition.stop()},this.silenceTimeout)},this.recognition.onerror=n=>{console.error("Speech recognition error:",n.error),this.isLesteningToVoice=!1,clearTimeout(this.silenceTimer)},this.recognition.onend=()=>{console.log("Speech recognition ended."),this.isLesteningToVoice=!1,this.pre_text=this.pre_text+this.generated,this.cursorPosition=this.pre_text.length,clearTimeout(this.silenceTimer)},this.recognition.start()):console.error("Speech recognition is not supported in this browser.")}}},DZe={class:"container w-full bg-bg-light dark:bg-bg-dark shadow-lg 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"},kZe={class:"container flex flex-row m-2 w-full"},LZe={class:"flex-grow max-w-[900px] m-2"},PZe={class:"flex gap-3 flex-1 items-center flex-grow flex-row m-2 p-2 border border-blue-300 rounded-md border-2 border-blue-300 m-2 p-4"},UZe=c("i",{"data-feather":"pen-tool"},null,-1),FZe=[UZe],BZe=c("i",{"data-feather":"archive"},null,-1),GZe=[BZe],VZe=["src"],zZe=c("span",{class:"w-80"},null,-1),HZe=c("i",{"data-feather":"x"},null,-1),qZe=[HZe],YZe=c("i",{"data-feather":"mic"},null,-1),$Ze=[YZe],WZe=c("i",{"data-feather":"volume-2"},null,-1),KZe=[WZe],jZe=c("i",{"data-feather":"speaker"},null,-1),QZe=[jZe],XZe=["src"],ZZe=["src"],JZe=["src"],eJe=["src"],tJe=c("i",{"data-feather":"voicemail"},null,-1),nJe=[tJe],sJe={key:1,"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"},iJe=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"},null,-1),rJe=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"},null,-1),oJe=[iJe,rJe],aJe=c("i",{"data-feather":"upload"},null,-1),lJe=[aJe],cJe=c("i",{"data-feather":"download"},null,-1),dJe=[cJe],uJe={class:"flex gap-3 flex-1 items-center flex-grow justify-end"},pJe=c("input",{type:"file",id:"import-input",class:"hidden"},null,-1),_Je={key:0},hJe={class:"flex flex-row justify-end mx-2"},fJe=["src"],mJe=["src"],gJe=["src"],bJe=["src"],EJe=["src"],yJe=["src"],vJe=["src"],SJe=["src"],TJe=c("i",{"data-feather":"copy"},null,-1),xJe=[TJe],CJe=["src"],wJe={key:2},RJe=["value"],AJe={key:0,title:"Selecting model",class:"flex flex-row flex-grow justify-end"},NJe=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"},"Selecting model...")],-1),OJe=[NJe],IJe=["value"],MJe=c("br",null,null,-1),DJe=c("i",{"data-feather":"check"},null,-1),kJe=[DJe],LJe=c("i",{"data-feather":"plus"},null,-1),PJe=[LJe],UJe=c("i",{"data-feather":"x"},null,-1),FJe=[UJe],BJe=c("i",{"data-feather":"refresh-ccw"},null,-1),GJe=[BJe],VJe={class:"slider-container ml-2 mr-2"},zJe=c("h3",{class:"text-gray-600"},"Temperature",-1),HJe={class:"slider-value text-gray-500"},qJe={class:"slider-container ml-2 mr-2"},YJe=c("h3",{class:"text-gray-600"},"Top K",-1),$Je={class:"slider-value text-gray-500"},WJe={class:"slider-container ml-2 mr-2"},KJe=c("h3",{class:"text-gray-600"},"Top P",-1),jJe={class:"slider-value text-gray-500"},QJe={class:"slider-container ml-2 mr-2"},XJe=c("h3",{class:"text-gray-600"},"Repeat Penalty",-1),ZJe={class:"slider-value text-gray-500"},JJe={class:"slider-container ml-2 mr-2"},eet=c("h3",{class:"text-gray-600"},"Repeat Last N",-1),tet={class:"slider-value text-gray-500"},net={class:"slider-container ml-2 mr-2"},set=c("h3",{class:"text-gray-600"},"Number of tokens to crop the text to",-1),iet={class:"slider-value text-gray-500"},ret={class:"slider-container ml-2 mr-2"},oet=c("h3",{class:"text-gray-600"},"Number of tokens to generate",-1),aet={class:"slider-value text-gray-500"},cet={class:"slider-container ml-2 mr-2"},det=c("h3",{class:"text-gray-600"},"Seed",-1),uet={class:"slider-value text-gray-500"};function pet(n,e,t,s,i,r){const o=dt("tokens-hilighter"),a=dt("MarkdownRenderer"),l=dt("Card"),u=dt("Toast");return C(),R(ze,null,[c("div",DZe,[c("div",kZe,[c("div",LZe,[c("div",PZe,[B(c("button",{id:"generate-button",title:"Generate from current cursor position",onClick:e[0]||(e[0]=(...d)=>r.generate&&r.generate(...d)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},FZe,512),[[Ot,!i.generating]]),B(c("button",{id:"generate-next-button",title:"Generate from next place holder",onClick:e[1]||(e[1]=(...d)=>r.generate_in_placeholder&&r.generate_in_placeholder(...d)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},GZe,512),[[Ot,!i.generating]]),B(c("button",{id:"tokenize",title:"Tokenize text",onClick:e[2]||(e[2]=(...d)=>r.tokenize_text&&r.tokenize_text(...d)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},[c("img",{width:"25",height:"25",src:i.tokenize_icon},null,8,VZe)],512),[[Ot,!i.generating]]),zZe,B(c("button",{id:"stop-button",onClick:e[3]||(e[3]=(...d)=>r.stopGeneration&&r.stopGeneration(...d)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},qZe,512),[[Ot,i.generating]]),c("button",{type:"button",title:"Dictate (using your browser for transcription)",onClick:e[4]||(e[4]=(...d)=>r.startSpeechRecognition&&r.startSpeechRecognition(...d)),class:Fe([{"text-red-500":i.isLesteningToVoice},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer"])},$Ze,2),c("button",{title:"convert text to audio (not saved and uses your browser tts service)",onClick:e[5]||(e[5]=ae(d=>r.speak(),["stop"])),class:Fe([{"text-red-500":r.isTalking},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer"])},KZe,2),c("input",{type:"file",ref:"fileInput",onChange:e[6]||(e[6]=(...d)=>r.handleFileUpload&&r.handleFileUpload(...d)),style:{display:"none"},accept:".wav"},null,544),c("button",{title:"Upload a voice",onClick:e[7]||(e[7]=(...d)=>r.triggerFileUpload&&r.triggerFileUpload(...d))},QZe),c("button",{type:"button",title:"Start audio to audio",onClick:e[8]||(e[8]=(...d)=>r.startRecordingAndTranscribing&&r.startRecordingAndTranscribing(...d)),class:Fe([{"text-green-500":i.isLesteningToVoice},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer text-red-500"])},[i.pending?G("",!0):(C(),R("img",{key:0,src:i.is_deaf_transcribing?i.deaf_on:i.deaf_off,height:"25"},null,8,XZe)),i.pending?(C(),R("img",{key:1,src:i.loading_icon,height:"25"},null,8,ZZe)):G("",!0)],2),c("button",{type:"button",title:"Start recording audio",onClick:e[9]||(e[9]=(...d)=>r.startRecording&&r.startRecording(...d)),class:Fe([{"text-green-500":i.isLesteningToVoice},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer text-red-500"])},[i.pending?G("",!0):(C(),R("img",{key:0,src:i.is_recording?i.rec_on:i.rec_off,height:"25"},null,8,JZe)),i.pending?(C(),R("img",{key:1,src:i.loading_icon,height:"25"},null,8,eJe)):G("",!0)],2),i.isSynthesizingVoice?(C(),R("svg",sJe,oJe)):(C(),R("button",{key:0,title:"generate audio from the text",onClick:e[10]||(e[10]=ae(d=>r.read(),["stop"])),class:"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},nJe)),B(c("button",{id:"export-button",onClick:e[11]||(e[11]=(...d)=>r.exportText&&r.exportText(...d)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},lJe,512),[[Ot,!i.generating]]),B(c("button",{id:"import-button",onClick:e[12]||(e[12]=(...d)=>r.importText&&r.importText(...d)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},dJe,512),[[Ot,!i.generating]]),c("div",uJe,[c("button",{class:Fe(["border-2 text-blue-600 dark:text-white border-blue-300 p-2 rounded shadow-lg hover:border-gray-600 dark:link-item-dark cursor-pointer",{"bg-blue-200 dark:bg-blue-500":i.tab_id=="source"}]),onClick:e[13]||(e[13]=d=>i.tab_id="source")}," Source ",2),c("button",{class:Fe(["border-2 text-blue-600 dark:text-white border-blue-300 p-2 rounded shadow-lg hover:border-gray-600 dark:link-item-dark cursor-pointer",{"bg-blue-200 dark:bg-blue-500":i.tab_id=="render"}]),onClick:e[14]||(e[14]=d=>i.tab_id="render")}," Render ",2)]),pJe]),c("div",{class:Fe(["flex-grow m-2 p-2 border border-blue-300 rounded-md border-2 border-blue-300 m-2 p-4",{"border-red-500":i.generating}])},[i.tab_id==="source"?(C(),R("div",_Je,[c("div",hJe,[c("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer hover:border-2",title:"Add generic block",onClick:e[15]||(e[15]=ae(d=>r.addBlock(""),["stop"]))},[c("img",{src:i.code_block,width:"25",height:"25"},null,8,fJe)]),c("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer hover:border-2",title:"Add python block",onClick:e[16]||(e[16]=ae(d=>r.addBlock("python"),["stop"]))},[c("img",{src:i.python_block,width:"25",height:"25"},null,8,mJe)]),c("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer hover:border-2",title:"Add javascript block",onClick:e[17]||(e[17]=ae(d=>r.addBlock("javascript"),["stop"]))},[c("img",{src:i.javascript_block,width:"25",height:"25"},null,8,gJe)]),c("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer hover:border-2",title:"Add json block",onClick:e[18]||(e[18]=ae(d=>r.addBlock("json"),["stop"]))},[c("img",{src:i.json_block,width:"25",height:"25"},null,8,bJe)]),c("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer hover:border-2",title:"Add c++ block",onClick:e[19]||(e[19]=ae(d=>r.addBlock("c++"),["stop"]))},[c("img",{src:i.cpp_block,width:"25",height:"25"},null,8,EJe)]),c("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer hover:border-2",title:"Add html block",onClick:e[20]||(e[20]=ae(d=>r.addBlock("html"),["stop"]))},[c("img",{src:i.html5_block,width:"25",height:"25"},null,8,yJe)]),c("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer hover:border-2",title:"Add LaTex block",onClick:e[21]||(e[21]=ae(d=>r.addBlock("latex"),["stop"]))},[c("img",{src:i.LaTeX_block,width:"25",height:"25"},null,8,vJe)]),c("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer hover:border-2",title:"Add bash block",onClick:e[22]||(e[22]=ae(d=>r.addBlock("bash"),["stop"]))},[c("img",{src:i.bash_block,width:"25",height:"25"},null,8,SJe)]),c("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer hover:border-2",title:"Copy message to clipboard",onClick:e[23]||(e[23]=ae(d=>n.copyContentToClipboard(),["stop"]))},xJe)]),B(c("textarea",{ref:"mdTextarea",onKeydown:e[24]||(e[24]=Ai(ae((...d)=>r.insertTab&&r.insertTab(...d),["prevent"]),["tab"])),class:"block min-h-500 p-2.5 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 overflow-y-scroll flex flex-col shadow-lg p-10 pt-0 overflow-y-scroll dark:bg-bg-dark scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",rows:4,style:jt({minHeight:i.mdRenderHeight+"px"}),placeholder:"Enter message here...","onUpdate:modelValue":e[25]||(e[25]=d=>i.text=d),onClick:e[26]||(e[26]=ae((...d)=>r.mdTextarea_clicked&&r.mdTextarea_clicked(...d),["prevent"])),onChange:e[27]||(e[27]=ae((...d)=>r.mdTextarea_changed&&r.mdTextarea_changed(...d),["prevent"]))},`\r `,36),[[he,i.text]]),c("span",null,"Cursor position "+se(i.cursorPosition),1)])):G("",!0),i.audio_url!=null?(C(),R("audio",{controls:"",key:i.audio_url},[c("source",{src:i.audio_url,type:"audio/wav",ref:"audio_player"},null,8,CJe),Xe(" Your browser does not support the audio element. ")])):G("",!0),_e(o,{namedTokens:i.namedTokens},null,8,["namedTokens"]),i.tab_id==="render"?(C(),R("div",wJe,[_e(a,{ref:"mdRender",client_id:this.$store.state.client_id,message_id:0,discussion_id:0,"markdown-text":i.text,class:"mt-4 p-2 rounded shadow-lg dark:bg-bg-dark"},null,8,["client_id","markdown-text"])])):G("",!0)],2)]),_e(l,{title:"settings",class:"slider-container ml-0 mr-0",isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:qe(()=>[_e(l,{title:"Model",class:"slider-container ml-0 mr-0",is_subcard:!0,isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:qe(()=>[B(c("select",{"onUpdate:modelValue":e[28]||(e[28]=d=>this.$store.state.selectedModel=d),onChange:e[29]||(e[29]=(...d)=>r.setModel&&r.setModel(...d)),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},[(C(!0),R(ze,null,st(r.models,d=>(C(),R("option",{key:d,value:d},se(d),9,RJe))),128))],544),[[qt,this.$store.state.selectedModel]]),i.selecting_model?(C(),R("div",AJe,OJe)):G("",!0)]),_:1}),_e(l,{title:"Presets",class:"slider-container ml-0 mr-0",is_subcard:!0,isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:qe(()=>[B(c("select",{"onUpdate:modelValue":e[30]||(e[30]=d=>i.selectedPreset=d),class:"bg-white dark:bg-black mb-2 border-2 rounded-md shadow-sm w-full"},[(C(!0),R(ze,null,st(i.presets,d=>(C(),R("option",{key:d,value:d},se(d.name),9,IJe))),128))],512),[[qt,i.selectedPreset]]),MJe,c("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[31]||(e[31]=(...d)=>r.setPreset&&r.setPreset(...d)),title:"Use preset"},kJe),c("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[32]||(e[32]=(...d)=>r.addPreset&&r.addPreset(...d)),title:"Add this text as a preset"},PJe),c("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[33]||(e[33]=(...d)=>r.removePreset&&r.removePreset(...d)),title:"Remove preset"},FJe),c("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[34]||(e[34]=(...d)=>r.reloadPresets&&r.reloadPresets(...d)),title:"Reload presets list"},GJe)]),_:1}),_e(l,{title:"Generation params",class:"slider-container ml-0 mr-0",is_subcard:!0,isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:qe(()=>[c("div",VJe,[zJe,B(c("input",{type:"range","onUpdate:modelValue":e[35]||(e[35]=d=>i.temperature=d),min:"0",max:"5",step:"0.1",class:"w-full"},null,512),[[he,i.temperature]]),c("span",HJe,"Current value: "+se(i.temperature),1)]),c("div",qJe,[YJe,B(c("input",{type:"range","onUpdate:modelValue":e[36]||(e[36]=d=>i.top_k=d),min:"1",max:"100",step:"1",class:"w-full"},null,512),[[he,i.top_k]]),c("span",$Je,"Current value: "+se(i.top_k),1)]),c("div",WJe,[KJe,B(c("input",{type:"range","onUpdate:modelValue":e[37]||(e[37]=d=>i.top_p=d),min:"0",max:"1",step:"0.1",class:"w-full"},null,512),[[he,i.top_p]]),c("span",jJe,"Current value: "+se(i.top_p),1)]),c("div",QJe,[XJe,B(c("input",{type:"range","onUpdate:modelValue":e[38]||(e[38]=d=>i.repeat_penalty=d),min:"0",max:"5",step:"0.1",class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[he,i.repeat_penalty]]),c("span",ZJe,"Current value: "+se(i.repeat_penalty),1)]),c("div",JJe,[eet,B(c("input",{type:"range","onUpdate:modelValue":e[39]||(e[39]=d=>i.repeat_last_n=d),min:"0",max:"100",step:"1",class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[he,i.repeat_last_n]]),c("span",tet,"Current value: "+se(i.repeat_last_n),1)]),c("div",net,[set,B(c("input",{type:"number","onUpdate:modelValue":e[40]||(e[40]=d=>i.n_crop=d),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[he,i.n_crop]]),c("span",iet,"Current value: "+se(i.n_crop),1)]),c("div",ret,[oet,B(c("input",{type:"number","onUpdate:modelValue":e[41]||(e[41]=d=>i.n_predicts=d),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[he,i.n_predicts]]),c("span",aet,"Current value: "+se(i.n_predicts),1)]),c("div",cet,[det,B(c("input",{type:"number","onUpdate:modelValue":e[42]||(e[42]=d=>i.seed=d),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[he,i.seed]]),c("span",uet,"Current value: "+se(i.seed),1)])]),_:1})]),_:1})])]),_e(u,{ref:"toast"},null,512)],64)}const _et=pt(MZe,[["render",pet]]);const het={data(){return{activeExtension:null}},computed:{activeExtensions(){return console.log(this.$store.state.extensionsZoo),console.log(_I(this.$store.state.extensionsZoo)),this.$store.state.extensionsZoo}},methods:{showExtensionPage(n){this.activeExtension=n}}},fet={class:"container overflow-y-scroll flex flex-col 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"},met={key:0},get=["onClick"],bet={key:0},Eet=["src"],yet={key:1},vet=c("p",null,"No extension is active. Please install and activate an extension.",-1),Tet=[vet];function xet(n,e,t,s,i,r){return C(),R("div",fet,[r.activeExtensions.length>0?(C(),R("div",met,[(C(!0),R(ze,null,st(r.activeExtensions,o=>(C(),R("div",{key:o.name,onClick:a=>r.showExtensionPage(o)},[c("div",{class:Fe({"active-tab":o===i.activeExtension})},se(o.name),3)],8,get))),128)),i.activeExtension?(C(),R("div",bet,[c("iframe",{src:i.activeExtension.page,width:"100%",height:"500px",frameborder:"0"},null,8,Eet)])):G("",!0)])):(C(),R("div",yet,Tet))])}const Cet=pt(het,[["render",xet]]),wet={},Ret={style:{width:"100vw",height:"100vh"}},Aet=c("iframe",{src:"/help/index.html",class:"m-0 p-0 w-full h-full"},null,-1),Net=[Aet];function Oet(n,e,t,s,i,r){return C(),R("div",Ret,Net)}const Iet=pt(wet,[["render",Oet]]);function js(n,e=!0,t=1){const s=e?1e3:1024;if(Math.abs(n)=s&&r{Ge.replace()})},executeCommand(n){this.isMenuOpen=!1,console.log("Selected"),console.log(n.value),typeof n.value=="function"&&(console.log("Command detected",n),n.value()),this.execute_cmd&&(console.log("executing generic command"),this.execute_cmd(n))},positionMenu(){var n;if(this.$refs.menuButton!=null){if(this.force_position==0||this.force_position==null){const e=this.$refs.menuButton.getBoundingClientRect(),t=window.innerHeight;n=e.bottom>t/2}else this.force_position==1?n=!0:n=!1;this.menuPosition.top=n?"auto":"calc(100% + 10px)",this.menuPosition.bottom=n?"100%":"auto"}}},mounted(){window.addEventListener("resize",this.positionMenu),this.positionMenu(),Ue(()=>{Ge.replace()})},beforeDestroy(){window.removeEventListener("resize",this.positionMenu)},watch:{isMenuOpen:"positionMenu"}},Det={class:"menu-container"},ket=["title"],Let=["src"],Pet=["data-feather"],Uet={key:2,class:"w-5 h-5"},Fet={key:3,"data-feather":"menu"},Bet={class:"flex-grow menu-ul"},Get=["onClick"],Vet={key:0,"data-feather":"check"},zet=["src","alt"],Het=["data-feather"],qet={key:3,class:"menu-icon"};function Yet(n,e,t,s,i,r){return C(),R("div",Det,[c("button",{onClick:e[0]||(e[0]=ae((...o)=>r.toggleMenu&&r.toggleMenu(...o),["prevent"])),title:t.title,class:Fe([t.menuIconClass,"menu-button m-0 p-0 bg-blue-500 text-white dark:bg-blue-200 dark:text-gray-800 rounded flex items-center justify-center w-6 h-6 border-none cursor-pointer hover:bg-blue-400 w-8 h-8 object-fill text-red-700 border-2 active:scale-90 hover:z-20 hover:-translate-y-2 duration-150 border-gray-300 border-secondary cursor-pointer"]),ref:"menuButton"},[t.icon&&!t.icon.includes("#")&&!t.icon.includes("feather")?(C(),R("img",{key:0,src:t.icon,class:"w-5 h-5 p-0 m-0 shadow-lg bold"},null,8,Let)):t.icon&&t.icon.includes("feather")?(C(),R("i",{key:1,"data-feather":t.icon.split(":")[1],class:"w-5 h-5"},null,8,Pet)):t.icon&&t.icon.includes("#")?(C(),R("p",Uet,se(t.icon.split("#")[1]),1)):(C(),R("i",Fet))],10,ket),_e(Ms,{name:"slide"},{default:qe(()=>[i.isMenuOpen?(C(),R("div",{key:0,class:"menu-list flex-grow",style:jt(i.menuPosition),ref:"menu"},[c("ul",Bet,[(C(!0),R(ze,null,st(t.commands,(o,a)=>(C(),R("li",{key:a,onClick:ae(l=>r.executeCommand(o),["prevent"]),class:"menu-command menu-li flex-grow hover:bg-blue-400"},[t.selected_entry==o.name?(C(),R("i",Vet)):o.icon&&!o.icon.includes("feather")&&!o.is_file?(C(),R("img",{key:1,src:o.icon,alt:o.name,class:"menu-icon"},null,8,zet)):G("",!0),o.icon&&o.icon.includes("feather")&&!o.is_file?(C(),R("i",{key:2,"data-feather":o.icon.split(":")[1],class:"mr-2"},null,8,Het)):(C(),R("span",qet)),c("span",null,se(o.name),1)],8,Get))),128))])],4)):G("",!0)]),_:1})])}const Jb=pt(Met,[["render",Yet]]),$et={components:{InteractiveMenu:Jb},props:{isInstalled:Boolean,onInstall:Function,onCancelInstall:Function,onUninstall:Function,onSelected:Function,onCopy:Function,onCopyLink:Function,selected:Boolean,model:Object,model_type:String},data(){return{progress:0,speed:0,total_size:0,downloaded_size:0,start_time:"",installing:!1,uninstalling:!1,failedToLoad:!1,linkNotValid:!1,selected_variant:""}},async mounted(){Ue(()=>{Ge.replace()})},methods:{formatFileSize(n){return n<1024?n+" bytes":n<1024*1024?(n/1024).toFixed(2)+" KB":n<1024*1024*1024?(n/(1024*1024)).toFixed(2)+" MB":(n/(1024*1024*1024)).toFixed(2)+" GB"},computedFileSize(n){return js(n)},getImgUrl(){return this.model.icon==null||this.model.icon==="/images/default_model.png"?ws:this.model.icon},defaultImg(n){n.target.src=ws},install(){this.onInstall(this)},uninstall(){this.isInstalled&&this.onUninstall(this)},toggleInstall(){this.isInstalled?(this.uninstalling=!0,this.onUninstall(this)):this.onInstall(this)},toggleSelected(n){if(console.log("event.target.tagName.toLowerCase()"),console.log(n.target.tagName.toLowerCase()),n.target.tagName.toLowerCase()==="button"||n.target.tagName.toLowerCase()==="svg"){n.stopPropagation();return}this.onSelected(this),this.model.selected=!0,Ue(()=>{Ge.replace()})},toggleCopy(){this.onCopy(this)},toggleCopyLink(){this.onCopyLink(this)},toggleCancelInstall(){this.onCancelInstall(this),this.installing=!1},handleSelection(){this.isInstalled&&!this.selected&&this.onSelected(this)},copyContentToClipboard(){this.$emit("copy","this.message.content")}},computed:{computed_classes(){return this.model.isInstalled?this.selected?"border-4 border-gray-200 bg-primary cursor-pointer":"border-0 border-primary bg-primary cursor-pointer":"border-transparent"},commandsList(){let n=[{name:this.model.isInstalled?"Install Extra":"Install",icon:"feather:settings",is_file:!1,value:this.install},{name:"Copy model info to clipboard",icon:"feather:settings",is_file:!1,value:this.toggleCopy}];return this.model.isInstalled&&n.push({name:"UnInstall",icon:"feather:settings",is_file:!1,value:this.uninstall}),this.selected&&n.push({name:"Reload",icon:"feather:refresh-ccw",is_file:!1,value:this.toggleSelected}),n},selected_computed(){return this.selected},fileSize:{get(){if(this.model&&this.model.variants&&this.model.variants.length>0){const n=this.model.variants[0].size;return this.formatFileSize(n)}return null}},speed_computed(){return js(this.speed)},total_size_computed(){return js(this.total_size)},downloaded_size_computed(){return js(this.downloaded_size)}},watch:{linkNotValid(){Ue(()=>{Ge.replace()})}}},Wet=["title"],Ket={key:0,class:"flex flex-row"},jet={class:"max-w-[300px] overflow-x-auto"},Qet={class:"flex gap-3 items-center grow"},Xet=["href"],Zet=["src"],Jet={class:"flex-1 overflow-hidden"},ett={class:"font-bold font-large text-lg truncate"},ttt={key:1,class:"flex items-center flex-row gap-2 my-1"},ntt={class:"flex grow items-center"},stt=c("i",{"data-feather":"box",class:"w-5"},null,-1),itt=c("span",{class:"sr-only"},"Custom model / local model",-1),rtt=[stt,itt],ott=c("span",{class:"sr-only"},"Remove",-1),att={key:2,class:"absolute z-10 -m-4 p-5 shadow-md text-center rounded-lg w-full h-full bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel bg-opacity-70 dark:bg-opacity-70 flex justify-center items-center"},ltt={class:"relative flex flex-col items-center justify-center flex-grow h-full"},ctt=c("div",{role:"status",class:"justify-center"},[c("svg",{"aria-hidden":"true",class:"w-24 h-24 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),dtt={class:"relative flex flex-row flex-grow items-center w-full h-full bottom-0"},utt={class:"w-full bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel rounded-lg p-2"},ptt={class:"flex justify-between mb-1"},_tt=c("span",{class:"text-base font-medium text-blue-700 dark:text-white"},"Downloading",-1),htt={class:"text-sm font-medium text-blue-700 dark:text-white"},ftt={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},mtt={class:"flex justify-between mb-1"},gtt={class:"text-base font-medium text-blue-700 dark:text-white"},btt={class:"text-sm font-medium text-blue-700 dark:text-white"},Ett={class:"flex flex-grow"},ytt={class:"flex flex-row flex-grow gap-3"},vtt={class:"p-2 text-center grow"},Stt={key:3},Ttt={class:"flex flex-row items-center gap-3"},xtt=["src"],Ctt={class:"font-bold font-large text-lg truncate"},wtt=c("div",{class:"grow"},null,-1),Rtt={class:"flex items-center flex-row-reverse gap-2 my-1"},Att={class:"flex flex-row items-center"},Ntt={key:0,class:"text-base text-red-600 flex items-center mt-1"},Ott=c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0 mx-1"},null,-1),Itt=["title"],Mtt={class:""},Dtt={class:"flex flex-row items-center"},ktt=c("i",{"data-feather":"download",class:"w-5 m-1 flex-shrink-0"},null,-1),Ltt=c("b",null,"Card: ",-1),Ptt=["href","title"],Utt=c("div",{class:"grow"},null,-1),Ftt=c("i",{"data-feather":"clipboard",class:"w-5"},null,-1),Btt=[Ftt],Gtt={class:"flex items-center"},Vtt=c("i",{"data-feather":"file",class:"w-5 m-1"},null,-1),ztt=c("b",null,"File size: ",-1),Htt={class:"flex items-center"},qtt=c("i",{"data-feather":"key",class:"w-5 m-1"},null,-1),Ytt=c("b",null,"License: ",-1),$tt={key:0,class:"flex items-center"},Wtt=c("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),Ktt=c("b",null,"quantizer: ",-1),jtt=["href"],Qtt={class:"flex items-center"},Xtt=c("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),Ztt=c("b",null,"Model creator: ",-1),Jtt=["href"],ent={class:"flex items-center"},tnt=c("i",{"data-feather":"clock",class:"w-5 m-1"},null,-1),nnt=c("b",null,"Release date: ",-1),snt={class:"flex items-center"},int=c("i",{"data-feather":"grid",class:"w-5 m-1"},null,-1),rnt=c("b",null,"Category: ",-1),ont=["href"];function ant(n,e,t,s,i,r){const o=dt("InteractiveMenu");return C(),R("div",{class:Fe(["relative items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 select-none",r.computed_classes]),title:t.model.name,onClick:e[10]||(e[10]=ae(a=>r.toggleSelected(a),["prevent"]))},[t.model.isCustomModel?(C(),R("div",Ket,[c("div",jet,[c("div",Qet,[c("a",{href:t.model.model_creator_link,target:"_blank"},[c("img",{src:r.getImgUrl(),onError:e[0]||(e[0]=a=>r.defaultImg(a)),class:"w-10 h-10 rounded-lg object-fill"},null,40,Zet)],8,Xet),c("div",Jet,[c("h3",ett,se(t.model.name),1)])])])])):G("",!0),t.model.isCustomModel?(C(),R("div",ttt,[c("div",ntt,[c("button",{type:"button",title:"Custom model / local model",class:"font-medium rounded-lg text-sm p-2 text-center inline-flex items-center",onClick:e[1]||(e[1]=ae(()=>{},["stop"]))},rtt),Xe(" Custom model ")]),c("div",null,[t.model.isInstalled?(C(),R("button",{key:0,title:"Delete file from disk",type:"button",onClick:e[2]||(e[2]=ae((...a)=>r.uninstall&&r.uninstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 rounded-lg dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900"},[Xe(" Uninstall "),ott])):G("",!0)])])):G("",!0),i.installing?(C(),R("div",att,[c("div",ltt,[ctt,c("div",dtt,[c("div",utt,[c("div",ptt,[_tt,c("span",htt,se(Math.floor(i.progress))+"%",1)]),c("div",ftt,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:jt({width:i.progress+"%"})},null,4)]),c("div",mtt,[c("span",gtt,"Download speed: "+se(r.speed_computed)+"/s",1),c("span",btt,se(r.downloaded_size_computed)+"/"+se(r.total_size_computed),1)])])]),c("div",Ett,[c("div",ytt,[c("div",vtt,[c("button",{onClick:e[3]||(e[3]=ae((...a)=>r.toggleCancelInstall&&r.toggleCancelInstall(...a),["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 ")])])])])])):G("",!0),t.model.isCustomModel?G("",!0):(C(),R("div",Stt,[c("div",Ttt,[c("img",{ref:"imgElement",src:r.getImgUrl(),onError:e[4]||(e[4]=a=>r.defaultImg(a)),class:Fe(["w-10 h-10 rounded-lg object-fill",i.linkNotValid?"grayscale":""])},null,42,xtt),c("h3",Ctt,se(t.model.name),1),wtt,_e(o,{commands:r.commandsList,force_position:2,title:"Menu"},null,8,["commands"])]),c("div",Rtt,[c("div",Att,[i.linkNotValid?(C(),R("div",Ntt,[Ott,Xe(" Link is not valid ")])):G("",!0)])]),c("div",{class:"",title:t.model.isInstalled?t.model.name:"Not installed"},[c("div",Mtt,[c("div",Dtt,[ktt,Ltt,c("a",{href:"https://huggingface.co/"+t.model.quantizer+"/"+t.model.name,target:"_blank",onClick:e[5]||(e[5]=ae(()=>{},["stop"])),class:"m-1 flex items-center hover:text-secondary duration-75 active:scale-90 truncate",title:i.linkNotValid?"Link is not valid":"Download this manually (faster) and put it in the models/ folder then refresh"}," View full model card ",8,Ptt),Utt,c("button",{class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center",title:"Copy link to clipboard",onClick:e[6]||(e[6]=ae(a=>r.toggleCopyLink(),["stop"]))},Btt)]),c("div",Gtt,[c("div",{class:Fe(["flex flex-shrink-0 items-center",i.linkNotValid?"text-red-600":""])},[Vtt,ztt,Xe(" "+se(r.fileSize),1)],2)]),c("div",Htt,[qtt,Ytt,Xe(" "+se(t.model.license),1)]),t.model.quantizer!="None"&&t.model.type!="transformers"?(C(),R("div",$tt,[Wtt,Ktt,c("a",{href:"https://huggingface.co/"+t.model.quantizer,target:"_blank",rel:"noopener noreferrer",onClick:e[7]||(e[7]=ae(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},se(t.model.quantizer),9,jtt)])):G("",!0),c("div",Qtt,[Xtt,Ztt,c("a",{href:t.model.model_creator_link,target:"_blank",rel:"noopener noreferrer",onClick:e[8]||(e[8]=ae(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},se(t.model.model_creator),9,Jtt)]),c("div",ent,[tnt,nnt,Xe(" "+se(t.model.last_commit_time),1)]),c("div",snt,[int,rnt,c("a",{href:"https://huggingface.co/"+t.model.model_creator,target:"_blank",rel:"noopener noreferrer",onClick:e[9]||(e[9]=ae(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},se(t.model.category),9,ont)])])],8,Itt)]))],10,Wet)}const lnt=pt($et,[["render",ant]]),cnt={data(){return{editMode:!1,avatar:"path/to/avatar.jpg",personalityName:"Personality Name",personalityAuthor:"Author Name",personalityDescription:"Personality Description",personalityCategory:"Category",disclaimer:"Disclaimer text",conditioningText:"Conditioning Text",aiPrefix:"AI Prefix",userPrefix:"User Prefix",antipromptsList:[{id:1,text:"Antiprompt 1"},{id:2,text:"Antiprompt 2"},{id:3,text:"Antiprompt 3"}]}},methods:{commitChanges(){console.log("Personality changes committed"),this.editMode=!1}}},dnt={class:"p-4"},unt={class:"flex items-center mb-4"},pnt=["src"],_nt={class:"text-lg font-semibold"},hnt=c("strong",null,"Author:",-1),fnt=c("strong",null,"Description:",-1),mnt=c("strong",null,"Category:",-1),gnt={key:0},bnt=c("strong",null,"Disclaimer:",-1),Ent=c("strong",null,"Conditioning Text:",-1),ynt=c("strong",null,"AI Prefix:",-1),vnt=c("strong",null,"User Prefix:",-1),Snt=c("strong",null,"Antiprompts:",-1);function Tnt(n,e,t,s,i,r){return C(),R("div",dnt,[c("div",unt,[c("img",{src:i.avatar,class:"w-12 h-12 rounded-full mr-2",alt:"Avatar"},null,8,pnt),c("h2",_nt,se(i.personalityName),1)]),c("p",null,[hnt,Xe(" "+se(i.personalityAuthor),1)]),c("p",null,[fnt,Xe(" "+se(i.personalityDescription),1)]),c("p",null,[mnt,Xe(" "+se(i.personalityCategory),1)]),i.disclaimer?(C(),R("p",gnt,[bnt,Xe(" "+se(i.disclaimer),1)])):G("",!0),c("p",null,[Ent,Xe(" "+se(i.conditioningText),1)]),c("p",null,[ynt,Xe(" "+se(i.aiPrefix),1)]),c("p",null,[vnt,Xe(" "+se(i.userPrefix),1)]),c("div",null,[Snt,c("ul",null,[(C(!0),R(ze,null,st(i.antipromptsList,o=>(C(),R("li",{key:o.id},se(o.text),1))),128))])]),c("button",{onClick:e[0]||(e[0]=o=>i.editMode=!0),class:"mt-4 bg-blue-500 text-white px-4 py-2 rounded"}," Edit "),i.editMode?(C(),R("button",{key:1,onClick:e[1]||(e[1]=(...o)=>r.commitChanges&&r.commitChanges(...o)),class:"mt-4 bg-green-500 text-white px-4 py-2 rounded"}," Commit ")):G("",!0)])}const xnt=pt(cnt,[["render",Tnt]]),Gu="/assets/logo-9d653710.svg",Cnt="/",wnt={props:{personality:{},select_language:Boolean,selected:Boolean,full_path:String,onTalk:Function,onOpenFolder:Function,onSelected:Function,onMount:Function,onUnMount:Function,onRemount:Function,onCopyToCustom:Function,onEdit:Function,onReinstall:Function,onSettings:Function,onCopyPersonalityName:Function},components:{InteractiveMenu:Jb},data(){return{isMounted:!1,name:this.personality.name,thumbnailVisible:!1,thumbnailPosition:{x:0,y:0}}},computed:{commandsList(){let n=[{name:this.isMounted?"unmount":"mount",icon:"feather:settings",is_file:!1,value:this.isMounted?this.unmount:this.mount},{name:"reinstall",icon:"feather:terminal",is_file:!1,value:this.toggleReinstall}];return console.log("this.category",this.personality.category),this.personality.category=="custom_personalities"?n.push({name:"edit",icon:"feather:settings",is_file:!1,value:this.edit}):n.push({name:"Copy to custom personas folder for editing",icon:"feather:copy",is_file:!1,value:this.copyToCustom}),this.isMounted&&n.push({name:"remount",icon:"feather:refresh-ccw",is_file:!1,value:this.reMount}),this.selected&&this.personality.has_scripts&&n.push({name:"settings",icon:"feather:settings",is_file:!1,value:this.toggleSettings}),n},selected_computed(){return this.selected}},mounted(){this.isMounted=this.personality.isMounted,Ue(()=>{Ge.replace()})},methods:{showThumbnail(){this.thumbnailVisible=!0},hideThumbnail(){this.thumbnailVisible=!1},updateThumbnailPosition(n){this.thumbnailPosition={x:n.clientX+10,y:n.clientY+10}},getImgUrl(){return Cnt+this.personality.avatar},defaultImg(n){n.target.src=Gu},showFolder(){this.onOpenFolder(this)},toggleTalk(){this.onTalk(this)},toggleCopyLink(){this.onCopyPersonalityName(this)},toggleSelected(){this.isMounted&&this.onSelected(this)},edit(){this.onEdit(this)},copyToCustom(){this.onCopyToCustom(this)},reMount(){this.onRemount(this)},mount(){console.log("Mounting"),this.onMount(this)},unmount(){console.log("Unmounting"),console.log(this.onUnMount),this.onUnMount(this),this.isMounted=!1},toggleSettings(){this.onSettings(this)},toggleReinstall(){this.onReinstall(this)}},watch:{selected(){Ue(()=>{Ge.replace()})}}},Rnt=["title"],Ant={class:"flex flex-row items-center flex-shrink-0 gap-3"},Nnt=["src"],Ont=c("i",{"data-feather":"clipboard",class:"w-5"},null,-1),Int=[Ont],Mnt=["src"],Dnt={class:""},knt={class:""},Lnt={class:"flex items-center"},Pnt=c("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),Unt=c("b",null,"Author: ",-1),Fnt={class:"flex items-center"},Bnt=c("i",{"data-feather":"git-commit",class:"w-5 m-1"},null,-1),Gnt=c("b",null,"Version: ",-1),Vnt={key:0,class:"flex items-center"},znt=c("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),Hnt=c("b",null,"Languages: ",-1),qnt=["selected"],Ynt={key:1,class:"flex items-center"},$nt=c("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),Wnt=c("b",null,"Language: ",-1),Knt={class:"flex items-center"},jnt=c("i",{"data-feather":"bookmark",class:"w-5 m-1"},null,-1),Qnt=c("b",null,"Category: ",-1),Xnt=c("div",{class:"flex items-center"},[c("i",{"data-feather":"info",class:"w-5 m-1"}),c("b",null,"Description: "),c("br")],-1),Znt=["title","innerHTML"],Jnt={class:"rounded bg-blue-300"},est=c("i",{"data-feather":"check"},null,-1),tst=c("span",{class:"sr-only"},"Select",-1),nst=[est,tst],sst=c("i",{"data-feather":"send",class:"w-5"},null,-1),ist=c("span",{class:"sr-only"},"Talk",-1),rst=[sst,ist],ost=c("i",{"data-feather":"folder",class:"w-5"},null,-1),ast=c("span",{class:"sr-only"},"Show Folder",-1),lst=[ost,ast];function cst(n,e,t,s,i,r){const o=dt("InteractiveMenu");return C(),R("div",{class:Fe(["min-w-96 items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer select-none",r.selected_computed?"border-2 border-primary-light":"border-transparent",i.isMounted?"bg-blue-200 dark:bg-blue-700":""]),tabindex:"-1",title:t.personality.installed?"":"Not installed"},[c("div",{class:Fe(t.personality.installed?"":"border-red-500")},[c("div",Ant,[c("img",{onClick:e[0]||(e[0]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),ref:"imgElement",src:r.getImgUrl(),onError:e[1]||(e[1]=a=>r.defaultImg(a)),class:"w-10 h-10 rounded-full object-fill text-red-700 cursor-pointer",onMouseover:e[2]||(e[2]=(...a)=>r.showThumbnail&&r.showThumbnail(...a)),onMousemove:e[3]||(e[3]=(...a)=>r.updateThumbnailPosition&&r.updateThumbnailPosition(...a)),onMouseleave:e[4]||(e[4]=(...a)=>r.hideThumbnail&&r.hideThumbnail(...a))},null,40,Nnt),c("h3",{onClick:e[5]||(e[5]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),class:"font-bold font-large text-lg line-clamp-3 cursor-pointer",onMouseover:e[6]||(e[6]=(...a)=>r.showThumbnail&&r.showThumbnail(...a)),onMousemove:e[7]||(e[7]=(...a)=>r.updateThumbnailPosition&&r.updateThumbnailPosition(...a)),onMouseleave:e[8]||(e[8]=(...a)=>r.hideThumbnail&&r.hideThumbnail(...a))},se(t.personality.name),33),c("button",{class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center",title:"Copy link to clipboard",onClick:e[9]||(e[9]=ae(a=>r.toggleCopyLink(),["stop"]))},Int),i.thumbnailVisible?(C(),R("div",{key:0,style:jt({top:i.thumbnailPosition.y+"px",left:i.thumbnailPosition.x+"px"}),class:"fixed z-50 w-20 h-20 rounded-full overflow-hidden"},[c("img",{src:r.getImgUrl(),class:"w-full h-full object-fill"},null,8,Mnt)],4)):G("",!0)]),c("div",Dnt,[c("div",knt,[c("div",Lnt,[Pnt,Unt,Xe(" "+se(t.personality.author),1)]),c("div",Fnt,[Bnt,Gnt,Xe(" "+se(t.personality.version),1)]),t.personality.languages&&t.select_language?(C(),R("div",Vnt,[znt,Hnt,i.isMounted?G("",!0):B((C(),R("select",{key:0,id:"languages","onUpdate:modelValue":e[10]||(e[10]=a=>t.personality.language=a),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"},[(C(!0),R(ze,null,st(t.personality.languages,(a,l)=>(C(),R("option",{key:l,selected:a==t.personality.languages[0]},se(a),9,qnt))),128))],512)),[[qt,t.personality.language]])])):G("",!0),t.personality.language?(C(),R("div",Ynt,[$nt,Wnt,Xe(" "+se(t.personality.language),1)])):G("",!0),c("div",Knt,[jnt,Qnt,Xe(" "+se(t.personality.category),1)])]),Xnt,c("p",{class:"mx-1 opacity-80 h-20 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",title:t.personality.description,innerHTML:t.personality.description},null,8,Znt)]),c("div",Jnt,[i.isMounted?(C(),R("button",{key:0,type:"button",title:"Select",onClick:[e[11]||(e[11]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),e[12]||(e[12]=ae(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},nst)):G("",!0),i.isMounted?(C(),R("button",{key:1,type:"button",title:"Talk",onClick:[e[13]||(e[13]=(...a)=>r.toggleTalk&&r.toggleTalk(...a)),e[14]||(e[14]=ae(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},rst)):G("",!0),c("button",{type:"button",title:"Show_folder",onClick:[e[15]||(e[15]=(...a)=>r.showFolder&&r.showFolder(...a)),e[16]||(e[16]=ae(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},lst),_e(o,{commands:r.commandsList,force_position:2,title:"Menu"},null,8,["commands"])])],2)],10,Rnt)}const CN=pt(wnt,[["render",cst]]);const dst={props:{ui:{type:String,required:!0,default:""}},watch:{ui(n,e){console.log(`ui changed from ${e} to ${n}`),this.$nextTick(()=>{this.evaluateScriptTags()})}},data(){return{}},mounted(){this.$nextTick(()=>{this.evaluateScriptTags()})},methods:{evaluateScriptTags(){console.log("evaluateScriptTags");const n=document.createElement("div");n.innerHTML=this.ui,n.querySelectorAll("script").forEach(t=>{const s=document.createElement("script");s.textContent=t.textContent,document.body.appendChild(s),document.body.removeChild(s)}),this.$refs.ui.innerHTML=n.innerHTML,console.log("this.$refs.ui.innerHTML"),console.log(this.$refs.ui.innerHTML)}}},ust={class:"w-full h-auto 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",ref:"ui"};function pst(n,e,t,s,i,r){return C(),R("div",ust,null,512)}const wN=pt(dst,[["render",pst]]),_st="/",hst={components:{DynamicUIRenderer:wN},props:{binding:{},onSelected:Function,onReinstall:Function,onInstall:Function,onUnInstall:Function,onSettings:Function,onReloadBinding:Function,selected:Boolean},data(){return{isTemplate:!1}},mounted(){Ue(()=>{Ge.replace()})},methods:{copyToClipBoard(n){console.log("Copying to clipboard :",n),navigator.clipboard.writeText(n)},getImgUrl(){return _st+this.binding.icon},defaultImg(n){n.target.src=Gu},toggleSelected(){this.onSelected(this)},toggleInstall(){this.onInstall(this)},toggleUnInstall(){this.onUnInstall(this)},toggleReinstall(){this.onReinstall(this)},toggleReloadBinding(){this.onReloadBinding(this)},toggleSettings(){this.onSettings(this)},getStatus(){(this.binding.folder==="backend_template"||this.binding.folder==="binding_template")&&(this.isTemplate=!0)}},watch:{selected(){Ue(()=>{Ge.replace()})}}},fst=["title"],mst={class:"flex flex-row items-center gap-3"},gst=["src"],bst={class:"font-bold font-large text-lg truncate"},Est=c("div",{class:"grow"},null,-1),yst={class:"flex-none gap-1"},vst=c("i",{"data-feather":"refresh-cw",class:"w-5"},null,-1),Sst=c("span",{class:"sr-only"},"Help",-1),Tst=[vst,Sst],xst={class:"flex items-center flex-row-reverse gap-2 my-1"},Cst=c("span",{class:"sr-only"},"Click to install",-1),wst=c("span",{class:"sr-only"},"Reinstall",-1),Rst=c("span",{class:"sr-only"},"UnInstall",-1),Ast=c("span",{class:"sr-only"},"Settings",-1),Nst={class:""},Ost={class:""},Ist={class:"flex items-center"},Mst=c("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),Dst=c("b",null,"Author: ",-1),kst={class:"flex items-center"},Lst=c("i",{"data-feather":"folder",class:"w-5 m-1"},null,-1),Pst=c("b",null,"Folder: ",-1),Ust=c("div",{class:"grow"},null,-1),Fst=c("i",{"data-feather":"clipboard",class:"w-5"},null,-1),Bst=[Fst],Gst={class:"flex items-center"},Vst=c("i",{"data-feather":"git-merge",class:"w-5 m-1"},null,-1),zst=c("b",null,"Version: ",-1),Hst={class:"flex items-center"},qst=c("i",{"data-feather":"github",class:"w-5 m-1"},null,-1),Yst=c("b",null,"Link: ",-1),$st=["href"],Wst=c("div",{class:"flex items-center"},[c("i",{"data-feather":"info",class:"w-5 m-1"}),c("b",null,"Description: "),c("br")],-1),Kst=["title","innerHTML"];function jst(n,e,t,s,i,r){const o=dt("DynamicUIRenderer");return C(),R("div",{class:Fe(["items-start p-4 hover:bg-primary-light hover:border-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer select-none",t.selected?" border-primary bg-primary":"border-transparent"]),onClick:e[8]||(e[8]=ae((...a)=>r.toggleSelected&&r.toggleSelected(...a),["stop"])),title:t.binding.installed?t.binding.name:"Not installed"},[c("div",null,[c("div",mst,[c("img",{ref:"imgElement",src:r.getImgUrl(),onError:e[0]||(e[0]=a=>r.defaultImg(a)),class:"w-10 h-10 rounded-full object-fill text-blue-700"},null,40,gst),c("h3",bst,se(t.binding.name),1),Est,c("div",yst,[t.selected?(C(),R("button",{key:0,type:"button",title:"Reload binding",onClick:[e[1]||(e[1]=(...a)=>r.toggleReloadBinding&&r.toggleReloadBinding(...a)),e[2]||(e[2]=ae(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},Tst)):G("",!0)])]),c("div",xst,[t.binding.installed?G("",!0):(C(),R("button",{key:0,title:"Click to install",type:"button",onClick:e[3]||(e[3]=ae((...a)=>r.toggleInstall&&r.toggleInstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},[Xe(" Install "),Cst])),t.binding.installed?(C(),R("button",{key:1,title:"Click to Reinstall binding",type:"button",onClick:e[4]||(e[4]=ae((...a)=>r.toggleReinstall&&r.toggleReinstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-green-700 hover:bg-red-800 focus:ring-4 focus:ring-green-300 rounded-lg dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-red-900"},[Xe(" Reinstall "),wst])):G("",!0),t.binding.installed?(C(),R("button",{key:2,title:"Click to Reinstall binding",type:"button",onClick:e[5]||(e[5]=ae((...a)=>r.toggleUnInstall&&r.toggleUnInstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 rounded-lg dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900"},[Xe(" Uninstall "),Rst])):G("",!0),t.selected?(C(),R("button",{key:3,title:"Click to open Settings",type:"button",onClick:e[6]||(e[6]=ae((...a)=>r.toggleSettings&&r.toggleSettings(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},[Xe(" Settings "),Ast])):G("",!0)]),t.binding.ui?(C(),St(o,{key:0,class:"w-full h-full",code:t.binding.ui},null,8,["code"])):G("",!0),c("div",Nst,[c("div",Ost,[c("div",Ist,[Mst,Dst,Xe(" "+se(t.binding.author),1)]),c("div",kst,[Lst,Pst,Xe(" "+se(t.binding.folder)+" ",1),Ust,c("button",{class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center",title:"Copy link to clipboard",onClick:e[7]||(e[7]=ae(a=>r.copyToClipBoard(this.binding.folder),["stop"]))},Bst)]),c("div",Gst,[Vst,zst,Xe(" "+se(t.binding.version),1)]),c("div",Hst,[qst,Yst,c("a",{href:t.binding.link,target:"_blank",class:"flex items-center hover:text-secondary duration-75 active:scale-90"},se(t.binding.link),9,$st)])]),Wst,c("p",{class:"mx-1 opacity-80 line-clamp-3",title:t.binding.description,innerHTML:t.binding.description},null,8,Kst)])])],10,fst)}const Qst=pt(hst,[["render",jst]]),Xst={data(){return{show:!1,model_path:"",resolve:null}},methods:{cancel(){this.resolve(null)},openInputBox(){return new Promise(n=>{this.resolve=n})},hide(n){this.show=!1,this.resolve&&(this.resolve(n),this.resolve=null)},showDialog(n){return new Promise(e=>{this.model_path=n,this.show=!0,this.resolve=e})}}},Zst={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50"},Jst={class:"relative w-full max-w-md max-h-full"},eit={class:"relative bg-white rounded-lg shadow dark:bg-gray-700"},tit=c("svg",{"aria-hidden":"true",class:"w-5 h-5",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),nit=c("span",{class:"sr-only"},"Close modal",-1),sit=[tit,nit],iit={class:"p-4 text-center"},rit=c("svg",{"aria-hidden":"true",class:"mx-auto mb-4 text-gray-400 w-14 h-14 dark:text-gray-200",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:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),oit={class:"p-4 text-center mx-auto mb-4"},ait=c("label",{class:"mr-2"},"Model path",-1);function lit(n,e,t,s,i,r){return i.show?(C(),R("div",Zst,[c("div",Jst,[c("div",eit,[c("button",{type:"button",onClick:e[0]||(e[0]=o=>r.hide(!1)),class:"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white"},sit),c("div",iit,[rit,c("div",oit,[ait,B(c("input",{"onUpdate:modelValue":e[1]||(e[1]=o=>i.model_path=o),class:"px-4 py-2 border border-gray-300 rounded-lg",type:"text"},null,512),[[he,i.model_path]])]),c("button",{onClick:e[2]||(e[2]=o=>r.hide(!0)),type:"button",class:"text-white bg-green-600 hover:bg-green-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2"}," Add "),c("button",{onClick:e[3]||(e[3]=o=>r.hide(!1)),type:"button",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"},"No, cancel")])])])])):G("",!0)}const cit=pt(Xst,[["render",lit]]);const dit={props:{show:{type:Boolean,default:!1,required:!1},can_remove:{type:Boolean,default:!1},title:{type:String,default:"Select an option"},choices:{type:Array,required:!0}},data(){return{selectedChoice:null,showInput:!1,newFilename:""}},methods:{displayName(n){return console.log("choice:",n),typeof n=="string"?n:n&&n.name?n.name:""},selectChoice(n){this.selectedChoice=n,this.$emit("choice-selected",n)},closeDialog(){this.$emit("close-dialog")},validateChoice(){this.$emit("choice-validated",this.selectedChoice)},formatSize(n){return n<1024?n+" bytes":n<1024*1024?(n/1024).toFixed(2)+" KB":n<1024*1024*1024?(n/(1024*1024)).toFixed(2)+" MB":(n/(1024*1024*1024)).toFixed(2)+" GB"},toggleInput(){this.showInput=!this.showInput},addNewFilename(){const n=this.newFilename.trim();n!==""&&(this.choices.push(n),this.newFilename="",this.selectChoice(n)),this.showInput=!1},removeChoice(n,e){this.choices.splice(e,1),n===this.selectedChoice&&(this.selectedChoice=null),this.$emit("choice-removed",n)}}},uit={key:0,class:"fixed inset-0 flex items-center justify-center bg-black bg-opacity-50 z-20"},pit={class:"bg-bg-light dark:bg-bg-dark rounded-lg p-6 w-96"},_it={class:"text-xl font-bold text-5xl drop-shadow-md align-middle"},hit={class:"h-48 text-light-text-panel dark:text-dark-text-panel bg-bg-light-tone-panel dark:bg-dark-tone-panel overflow-y-auto rounded drop-shadow-md 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"},fit=["onClick"],mit={class:"font-bold text-dark-text-panel dark:text-light-text-panel"},git=c("br",null,null,-1),bit={key:0,class:"text-xs text-gray-500"},Eit=["onClick"],yit={key:0,class:"flex flex-row mt-4 bg-light-tone-panel dark:bg-dark-tone-panel"},vit={class:"flex justify-end mt-4"},Sit=["disabled"];function Tit(n,e,t,s,i,r){return C(),St(Ms,{name:"fade"},{default:qe(()=>[t.show?(C(),R("div",uit,[c("div",pit,[c("h2",_it,se(t.title),1),c("div",hit,[c("ul",null,[(C(!0),R(ze,null,st(t.choices,(o,a)=>(C(),R("li",{key:a,onClick:l=>r.selectChoice(o),class:Fe([{"selected-choice":o===i.selectedChoice},"py-2 px-4 cursor-pointer hover:bg-accent dark:hover:bg-secondary"])},[c("span",mit,se(r.displayName(o)),1),git,o.size?(C(),R("span",bit,se(r.formatSize(o.size)),1)):G("",!0),t.can_remove?(C(),R("button",{key:1,onClick:ae(l=>r.removeChoice(o,a),["stop"]),class:"ml-2 text-red-500 hover:text-red-600"}," X ",8,Eit)):G("",!0)],10,fit))),128))])]),i.showInput?(C(),R("div",yit,[B(c("input",{"onUpdate:modelValue":e[0]||(e[0]=o=>i.newFilename=o),placeholder:"Enter a filename",class:"border border-gray-300 p-2 rounded-lg w-full"},null,512),[[he,i.newFilename]]),c("button",{onClick:e[1]||(e[1]=(...o)=>r.addNewFilename&&r.addNewFilename(...o)),class:"ml-2 grow pl-2 pr-2 bg-primary hover:bg-primary-light text-white rounded-lg transition duration-300"}," Add ")])):G("",!0),c("div",vit,[c("button",{onClick:e[2]||(e[2]=(...o)=>r.closeDialog&&r.closeDialog(...o)),class:"py-2 px-4 mr-2 bg-secondary hover:bg-accent text-white rounded-lg transition duration-300"}," Cancel "),c("button",{onClick:e[3]||(e[3]=(...o)=>r.validateChoice&&r.validateChoice(...o)),class:Fe([{"bg-gray-400 cursor-not-allowed":!i.selectedChoice,"bg-primary hover:bg-primary-light":i.selectedChoice,"text-white":i.selectedChoice,"text-gray-500":!i.selectedChoice},"py-2 px-4 rounded-lg transition duration-300"]),disabled:!i.selectedChoice}," Validate ",10,Sit),c("button",{onClick:e[4]||(e[4]=(...o)=>r.toggleInput&&r.toggleInput(...o)),class:"py-2 px-4 ml-2 bg-accent hover:bg-secondary text-white rounded-lg transition duration-300"}," Add New ")])])])):G("",!0)]),_:1})}const eE=pt(dit,[["render",Tit]]),xit={props:{radioOptions:{type:Array,required:!0},defaultValue:{type:String,default:"0"}},data(){return{selectedValue:this.defaultValue}},computed:{selectedLabel(){const n=this.radioOptions.find(e=>e.value===this.selectedValue);return n?n.label:""}},watch:{selectedValue(n,e){this.$emit("radio-selected",n)}},methods:{handleRadioChange(){}}},Cit={class:"flex space-x-4"},wit=["value","aria-checked"],Rit={class:"text-gray-700"};function Ait(n,e,t,s,i,r){return C(),R("div",Cit,[(C(!0),R(ze,null,st(t.radioOptions,(o,a)=>(C(),R("label",{key:o.value,class:"flex items-center space-x-2"},[B(c("input",{type:"radio",value:o.value,"onUpdate:modelValue":e[0]||(e[0]=l=>i.selectedValue=l),onChange:e[1]||(e[1]=(...l)=>r.handleRadioChange&&r.handleRadioChange(...l)),class:"text-blue-500 focus:ring-2 focus:ring-blue-200","aria-checked":i.selectedValue===o.value.toString(),role:"radio"},null,40,wit),[[eD,i.selectedValue]]),c("span",Rit,se(o.label),1)]))),128))])}const Nit=pt(xit,[["render",Ait]]),Oit="/assets/gpu-df72bf63.svg";const Iit="/";de.defaults.baseURL="/";const Mit={components:{AddModelDialog:cit,ModelEntry:lnt,PersonalityViewer:xnt,PersonalityEntry:CN,BindingEntry:Qst,ChoiceDialog:eE,Card:Bu,RadioOptions:Nit},data(){return{posts_headers:{accept:"application/json","Content-Type":"application/json"},defaultModelImgPlaceholder:ws,snd_input_devices:[],snd_input_devices_indexes:[],snd_output_devices:[],snd_output_devices_indexes:[],voices:[],voice_languages:{Arabic:"ar","Brazilian Portuguese":"pt",Chinese:"zh-cn",Czech:"cs",Dutch:"nl",English:"en",French:"fr",German:"de",Italian:"it",Polish:"pl",Russian:"ru",Spanish:"es",Turkish:"tr",Japanese:"ja",Korean:"ko",Hungarian:"hu",Hindi:"hi"},storeLogo:hs,binding_changed:!1,SVGGPU:Oit,models_zoo:[],models_zoo_initialLoadCount:10,models_zoo_loadMoreCount:5,models_zoo_loadedEntries:[],models_zoo_scrollThreshold:200,sortOptions:[{label:"Sort by Date",value:0},{label:"Sort by Rank",value:1},{label:"Sort by Name",value:2},{label:"Sort by Maker",value:3},{label:"Sort by Quantizer",value:4}],comfyui_models:[],show_only_installed_models:!1,reference_path:"",audioVoices:[],has_updates:!1,variant_choices:[],variantSelectionDialogVisible:!1,currenModelToInstall:null,loading_text:"",personality_category:null,addModelDialogVisibility:!1,modelPath:"",personalitiesFiltered:[],modelsFiltered:[],collapsedArr:[],all_collapsed:!0,data_conf_collapsed:!0,internet_conf_collapsed:!0,servers_conf_collapsed:!0,minconf_collapsed:!0,bec_collapsed:!0,sort_type:0,is_loading_zoo:!1,mzc_collapsed:!0,mzdc_collapsed:!0,pzc_collapsed:!0,bzc_collapsed:!0,pc_collapsed:!0,mc_collapsed:!0,sc_collapsed:!0,mzl_collapsed:!1,pzl_collapsed:!1,ezl_collapsed:!1,bzl_collapsed:!1,extCatgArr:[],persCatgArr:[],persArr:[],showConfirmation:!1,showToast:!1,isLoading:!1,settingsChanged:!1,isModelSelected:!1,isMounted:!1,bUrl:Iit,searchPersonality:"",searchModel:"",searchPersonalityTimer:{},searchPersonalityTimerInterval:1500,searchModelTimerInterval:1500,searchPersonalityInProgress:!1,searchModelInProgress:!1,addModel:{},modelDownlaodInProgress:!1,uploadData:[]}},async created(){try{this.$store.state.loading_infos="Getting Hardware usage",await this.refreshHardwareUsage(this.$store)}catch(n){console.log("Error cought:",n)}He.on("loading_text",this.on_loading_text),this.updateHasUpdates()},methods:{async refreshHardwareUsage(n){await n.dispatch("refreshDiskUsage"),await n.dispatch("refreshRamUsage"),await n.dispatch("refreshVramUsage")},addDataSource(){this.$store.state.config.rag_databases.push(""),this.settingsChanged=!0},removeDataSource(n){this.$store.state.config.rag_databases.splice(n,1),this.settingsChanged=!0},async vectorize_folder(n){await de.post("/vectorize_folder",{client_id:this.$store.state.client_id,db_path:this.$store.state.config.rag_databases[n]},this.posts_headers)},async select_folder(n){try{He.on("rag_db_added",e=>{console.log(e),e?(this.$store.state.config.rag_databases[n]=`${e.database_name}::${e.database_path}`,this.settingsChanged=!0):this.$store.state.toast.showToast("Failed to select a folder",4,!1)}),await de.post("/add_rag_database",{client_id:this.$store.state.client_id},this.posts_headers)}catch{this.$store.state.toast.showToast("Failed to select a folder",4,!1)}},handleTemplateSelection(n){console.log("handleTemplateSelection");const e=n.target.value;console.log("handleTemplateSelection: ",e),e==="lollms"?(console.log("Using lollms template"),this.configFile.start_header_id_template="!@>",this.configFile.system_message_template="system",this.configFile.end_header_id_template=": ",this.configFile.separator_template=` `,this.configFile.start_user_header_id_template="!@>",this.configFile.end_user_header_id_template=": ",this.configFile.end_user_message_id_template="",this.configFile.start_ai_header_id_template="!@>",this.configFile.end_ai_header_id_template=": ",this.configFile.end_ai_message_id_template="",this.settingsChanged=!0):e==="lollms_simplified"?(console.log("Using lollms template"),this.configFile.start_header_id_template="@>",this.configFile.system_message_template="system",this.configFile.end_header_id_template=": ",this.configFile.separator_template=` -`,this.configFile.start_user_header_id_template="@>",this.configFile.end_user_header_id_template=": ",this.configFile.end_user_message_id_template="",this.configFile.start_ai_header_id_template="@>",this.configFile.end_ai_header_id_template=": ",this.configFile.end_ai_message_id_template="",this.settingsChanged=!0):e==="llama3"?(console.log("Using llama3 template"),this.configFile.start_header_id_template="<|start_header_id|>",this.configFile.system_message_template="system",this.configFile.end_header_id_template="<|end_header_id|>",this.configFile.separator_template="<|eot_id|>",this.configFile.start_user_header_id_template="<|start_header_id|>",this.configFile.end_user_header_id_template="<|end_header_id|>",this.configFile.end_user_message_id_template="",this.configFile.start_ai_header_id_template="<|start_header_id|>",this.configFile.end_ai_header_id_template="<|end_header_id|>",this.configFile.end_ai_message_id_template="",this.settingsChanged=!0):e==="mistral"&&(console.log("Using mistral template"),this.configFile.start_header_id_template="[INST]",this.configFile.system_message_template=" Using this information",this.configFile.end_header_id_template=": ",this.configFile.separator_template=` +`,this.configFile.start_user_header_id_template="@>",this.configFile.end_user_header_id_template=": ",this.configFile.end_user_message_id_template="",this.configFile.start_ai_header_id_template="@>",this.configFile.end_ai_header_id_template=": ",this.configFile.end_ai_message_id_template="",this.settingsChanged=!0):e==="bare"?(console.log("Using lollms template"),this.configFile.start_header_id_template="",this.configFile.system_message_template="system",this.configFile.end_header_id_template=": ",this.configFile.separator_template=` +`,this.configFile.start_user_header_id_template="",this.configFile.end_user_header_id_template=": ",this.configFile.end_user_message_id_template="",this.configFile.start_ai_header_id_template="",this.configFile.end_ai_header_id_template=": ",this.configFile.end_ai_message_id_template="",this.settingsChanged=!0):e==="llama3"?(console.log("Using llama3 template"),this.configFile.start_header_id_template="<|start_header_id|>",this.configFile.system_message_template="system",this.configFile.end_header_id_template="<|end_header_id|>",this.configFile.separator_template="<|eot_id|>",this.configFile.start_user_header_id_template="<|start_header_id|>",this.configFile.end_user_header_id_template="<|end_header_id|>",this.configFile.end_user_message_id_template="",this.configFile.start_ai_header_id_template="<|start_header_id|>",this.configFile.end_ai_header_id_template="<|end_header_id|>",this.configFile.end_ai_message_id_template="",this.settingsChanged=!0):e==="mistral"&&(console.log("Using mistral template"),this.configFile.start_header_id_template="[INST]",this.configFile.system_message_template=" Using this information",this.configFile.end_header_id_template=": ",this.configFile.separator_template=` `,this.configFile.start_user_header_id_template="[INST]",this.configFile.end_user_header_id_template=": ",this.configFile.end_user_message_id_template="[/INST]",this.configFile.start_ai_header_id_template="[INST]",this.configFile.end_ai_header_id_template=": ",this.configFile.end_ai_message_id_template="[/INST]",this.settingsChanged=!0)},install_model(){},reinstallDiffusersService(){de.post("/install_diffusers",{client_id:this.$store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},upgradeDiffusersService(){de.post("upgrade_sd",{client_id:this.$store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},reinstallSDService(){de.post("/install_sd",{client_id:this.$store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},upgradeSDService(){de.post("upgrade_sd",{client_id:this.$store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},startSDService(){de.post("start_sd",{client_id:this.$store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},showSD(){de.post("show_sd",{client_id:this.$store.state.client_id},this.posts_headers).then(n=>{}).catch(n=>{console.error(n)})},reinstallComfyUIService(){de.post("install_comfyui",{client_id:this.$store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},upgradeComfyUIService(){de.post("upgrade_comfyui",{client_id:this.$store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},startComfyUIService(){de.post("start_comfyui",{client_id:this.$store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},showComfyui(){de.post("show_comfyui",{client_id:this.$store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},reinstallMotionCtrlService(){de.post("install_motion_ctrl",{client_id:this.$store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},reinstallvLLMService(){de.post("install_vllm",{client_id:this.$store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},startvLLMService(){de.post("start_vllm",{client_id:this.$store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},startollamaService(){de.post("start_ollama",{client_id:this.$store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},reinstallPetalsService(){de.post("install_petals",{client_id:this.$store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},reinstallOLLAMAService(){de.post("install_ollama",{client_id:this.$store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},reinstallElasticSearchService(){de.post("install_vllm",{client_id:this.$store.state.client_id}).then(n=>{}).catch(n=>{console.error(n)})},getSeviceVoices(){de.get("list_voices").then(n=>{this.voices=n.data.voices}).catch(n=>{console.error(n)})},load_more_models(){this.models_zoo_initialLoadCount+10{Ge.replace()}),this.binding_changed&&!this.mzc_collapsed&&(this.modelsZoo==null||this.modelsZoo.length==0)&&(console.log("Refreshing models"),await this.$store.dispatch("refreshConfig"),this.models_zoo=[],this.refreshModelsZoo(),this.binding_changed=!1)},async selectSortOption(n){this.$store.state.sort_type=n,this.updateModelsZoo(),console.log(`Selected sorting:${n}`),console.log(`models:${this.models_zoo}`)},handleRadioSelected(n){this.isLoading=!0,this.selectSortOption(n).then(()=>{this.isLoading=!1})},filter_installed(n){return console.log("filtering"),n.filter(e=>e.isInstalled===!0)},getVoices(){"speechSynthesis"in window&&(console.log("voice synthesis"),this.audioVoices=speechSynthesis.getVoices(),console.log("Voices:"+this.audioVoices),!this.audio_out_voice&&this.audioVoices.length>0&&(this.audio_out_voice=this.audioVoices[0].name),speechSynthesis.onvoiceschanged=()=>{})},async updateHasUpdates(){let n=await this.api_get_req("check_update");this.has_updates=n.update_availability,console.log("has_updates",this.has_updates)},onVariantChoiceSelected(n){this.selected_variant=n},oncloseVariantChoiceDialog(){this.variantSelectionDialogVisible=!1},onvalidateVariantChoice(n){this.variantSelectionDialogVisible=!1,this.currenModelToInstall.installing=!0;let e=this.currenModelToInstall;if(e.linkNotValid){e.installing=!1,this.$store.state.toast.showToast("Link is not valid, file does not exist",4,!1);return}let t="https://huggingface.co/"+e.model.quantizer+"/"+e.model.name+"/resolve/main/"+this.selected_variant.name;this.showProgress=!0,this.progress=0,this.addModel={model_name:this.selected_variant.name,binding_folder:this.configFile.binding_name,model_url:t},console.log("installing...",this.addModel);const s=i=>{if(console.log("received something"),i.status&&i.progress<=100){if(this.addModel=i,console.log("Progress",i),e.progress=i.progress,e.speed=i.speed,e.total_size=i.total_size,e.downloaded_size=i.downloaded_size,e.start_time=i.start_time,e.installing=!0,e.progress==100){const r=this.models_zoo.findIndex(o=>o.name===e.model.name);this.models_zoo[r].isInstalled=!0,this.showProgress=!1,e.installing=!1,console.log("Received succeeded"),He.off("install_progress",s),console.log("Installed successfully"),this.$store.state.toast.showToast(`Model: `+e.model.name+` installed!`,4,!0),this.$store.dispatch("refreshDiskUsage")}}else He.off("install_progress",s),console.log("Install failed"),e.installing=!1,this.showProgress=!1,console.error("Installation failed:",i.error),this.$store.state.toast.showToast(`Model: @@ -145,25 +146,25 @@ Verify that the personality is not already copied there.`,4,!1)}).catch(e=>{this `,4,!1),console.error(e)})},async remountPersonality(n){await this.unmountPersonality(n),await this.mountPersonality(n)},onPersonalityReinstall(n){console.log("on reinstall ",n),this.isLoading=!0,console.log("Personality path:",n.personality.path),de.post("/reinstall_personality",{client_id:this.$store.state.client_id,name:n.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(n){n.target.src=hs},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 n=await de.get("/get_snd_input_devices");this.snd_input_devices=n.data.device_names,this.snd_input_devices_indexes=n.data.device_indexes}catch{console.log("Couldin't list input devices")}try{console.log("Loading output devices list");const n=await de.get("/get_snd_output_devices");this.snd_output_devices=n.data.device_names,this.snd_output_devices_indexes=n.data.device_indexes}catch{console.log("Couldin't list output devices")}try{console.log("Getting comfyui models");const n=await de.get("/list_comfyui_models");console.log("res is ",n),n.data.status&&(this.comfyui_models=n.data.models)}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(n=>n.isInstalled===!0):this.modelsFiltered.slice(0,Math.min(this.models_zoo.length,this.models_zoo_initialLoadCount)):(console.log("this.models_zoo"),console.log(this.models_zoo),console.log(this.models_zoo_initialLoadCount),this.show_only_installed_models?this.models_zoo.filter(n=>n.isInstalled===!0):this.models_zoo.slice(0,Math.min(this.models_zoo.length,this.models_zoo_initialLoadCount)))}},imgBinding:{get(){if(!this.isMounted)return ws;try{return this.$refs.bindingZoo[this.$refs.bindingZoo.findIndex(n=>n.binding.folder==this.configFile.binding_name)].$refs.imgElement.src}catch{return ws}}},imgModel:{get(){try{let n=this.$store.state.modelsZoo.findIndex(e=>e.name==this.$store.state.selectedModel);return n>=0?(console.log(`model avatar : ${this.$store.state.modelsZoo[n].icon}`),this.$store.state.modelsZoo[n].icon):ws}catch{console.log("error")}if(!this.isMounted)return ws;try{return this.$refs.bindingZoo[this.$refs.bindingZoo.findIndex(n=>n.binding.folder==this.configFile.binding_name)].$refs.imgElement.src}catch{return ws}}},isReady:{get(){return this.$store.state.ready}},audio_out_voice:{get(){return this.$store.state.config.audio_out_voice},set(n){this.$store.state.config.audio_out_voice=n}},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(n){this.$store.commit("setConfig",n)}},userName:{get(){return this.$store.state.config.user_name},set(n){this.$store.state.config.user_name=n}},user_avatar:{get(){return this.$store.state.config.user_avatar!=""?"/user_infos/"+this.$store.state.config.user_avatar:hs},set(n){this.$store.state.config.user_avatar=n}},hardware_mode:{get(){return this.$store.state.config.hardware_mode},set(n){this.$store.state.config.hardware_mode=n}},auto_update:{get(){return this.$store.state.config.auto_update},set(n){this.$store.state.config.auto_update=n}},auto_speak:{get(){return this.$store.state.config.auto_speak},set(n){this.$store.state.config.auto_speak=n}},auto_read:{get(){return this.$store.state.config.auto_read},set(n){this.$store.state.config.auto_read=n}},xtts_current_language:{get(){return this.$store.state.config.xtts_current_language},set(n){console.log("Current xtts voice set to ",n),this.$store.state.config.xtts_current_language=n}},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(n){n=="main_voice"||n===void 0?(console.log("Current voice set to None"),this.$store.state.config.xtts_current_voice=null):(console.log("Current voice set to ",n),this.$store.state.config.xtts_current_voice=n)}},audio_pitch:{get(){return this.$store.state.config.audio_pitch},set(n){this.$store.state.config.audio_pitch=n}},audio_in_language:{get(){return this.$store.state.config.audio_in_language},set(n){this.$store.state.config.audio_in_language=n}},use_user_name_in_discussions:{get(){return this.$store.state.config.use_user_name_in_discussions},set(n){this.$store.state.config.use_user_name_in_discussions=n}},discussion_db_name:{get(){return this.$store.state.config.discussion_db_name},set(n){this.$store.state.config.discussion_db_name=n}},personalities:{get(){return this.$store.state.personalities},set(n){this.$store.commit("setPersonalities",n)}},mountedPersArr:{get(){return this.$store.state.mountedPersArr},set(n){this.$store.commit("setMountedPers",n)}},bindingsZoo:{get(){return this.$store.state.bindingsZoo},set(n){this.$store.commit("setbindingsZoo",n)}},modelsArr:{get(){return this.$store.state.modelsArr},set(n){this.$store.commit("setModelsArr",n)}},models:{get(){return this.models_zoo},set(n){this.$store.commit("setModelsZoo",n)}},installed_models:{get(){return this.models_zoo},set(n){this.$store.commit("setModelsZoo",n)}},diskUsage:{get(){return this.$store.state.diskUsage},set(n){this.$store.commit("setDiskUsage",n)}},ramUsage:{get(){return this.$store.state.ramUsage},set(n){this.$store.commit("setRamUsage",n)}},vramUsage:{get(){return this.$store.state.vramUsage},set(n){this.$store.commit("setVramUsage",n)}},disk_available_space(){return this.computedFileSize(this.diskUsage.available_space)},disk_binding_models_usage(){return console.log(`this.diskUsage : ${this.diskUsage}`),this.computedFileSize(this.diskUsage.binding_models_usage)},disk_percent_usage(){return this.diskUsage.percent_usage},disk_total_space(){return this.computedFileSize(this.diskUsage.total_space)},ram_available_space(){return this.computedFileSize(this.ramUsage.available_space)},ram_usage(){return this.computedFileSize(this.ramUsage.ram_usage)},ram_percent_usage(){return this.ramUsage.percent_usage},ram_total_space(){return this.computedFileSize(this.ramUsage.total_space)},model_name(){if(this.isMounted)return this.configFile.model_name},binding_name(){if(!this.isMounted)return null;const n=this.bindingsZoo.findIndex(e=>e.folder===this.configFile.binding_name);return n>-1?this.bindingsZoo[n].name:null},active_pesonality(){if(!this.isMounted)return null;const n=this.personalities.findIndex(e=>e.full_path===this.configFile.personalities[this.configFile.active_personality_id]);return n>-1?this.personalities[n].name:null},speed_computed(){return js(this.addModel.speed)},total_size_computed(){return js(this.addModel.total_size)},downloaded_size_computed(){return js(this.addModel.downloaded_size)}},watch:{bec_collapsed(){Ue(()=>{Ge.replace()})},pc_collapsed(){Ue(()=>{Ge.replace()})},mc_collapsed(){Ue(()=>{Ge.replace()})},sc_collapsed(){Ue(()=>{Ge.replace()})},showConfirmation(){Ue(()=>{Ge.replace()})},mzl_collapsed(){Ue(()=>{Ge.replace()})},pzl_collapsed(){Ue(()=>{Ge.replace()})},ezl_collapsed(){Ue(()=>{Ge.replace()})},bzl_collapsed(){Ue(()=>{Ge.replace()})},all_collapsed(n){this.collapseAll(n),Ue(()=>{Ge.replace()})},settingsChanged(n){this.$store.state.settingsChanged=n,Ue(()=>{Ge.replace()})},isLoading(){Ue(()=>{Ge.replace()})},searchPersonality(n){n==""&&this.filterPersonalities()},mzdc_collapsed(){Ue(()=>{Ge.replace()})}},async beforeRouteLeave(n){if(await this.$router.isReady(),this.settingsChanged)return await this.$store.state.yesNoDialog.askQuestion(`Did You forget to apply changes? -You need to apply changes before you leave, or else.`,"Apply configuration","Cancel")&&this.applyConfiguration(),!1}},L=n=>(no("data-v-2d3d13af"),n=n(),so(),n),Dit={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"},kit={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"},Lit={key:0,class:"flex gap-3 flex-1 items-center duration-75"},Pit=L(()=>c("i",{"data-feather":"x"},null,-1)),Uit=[Pit],Fit=L(()=>c("i",{"data-feather":"check"},null,-1)),Bit=[Fit],Git={key:1,class:"flex gap-3 flex-1 items-center"},Vit=L(()=>c("i",{"data-feather":"refresh-ccw"},null,-1)),zit=[Vit],Hit=L(()=>c("i",{"data-feather":"list"},null,-1)),qit=[Hit],Yit={class:"flex gap-3 flex-1 items-center justify-end"},$it=L(()=>c("i",{"data-feather":"trash-2"},null,-1)),Wit=[$it],Kit=L(()=>c("i",{"data-feather":"refresh-ccw"},null,-1)),jit=[Kit],Qit=L(()=>c("i",{"data-feather":"arrow-up-circle"},null,-1)),Xit=L(()=>c("i",{"data-feather":"alert-circle"},null,-1)),Zit={class:"flex gap-3 items-center"},Jit={key:0,class:"flex gap-3 items-center"},ert=L(()=>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)),trt=[ert],nrt=L(()=>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)),srt=[nrt],irt={key:1,role:"status"},rrt=L(()=>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)),ort=L(()=>c("span",{class:"sr-only"},"Loading...",-1)),art={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"},lrt={class:"flex flex-row p-3"},crt=L(()=>c("i",{"data-feather":"chevron-right"},null,-1)),drt=[crt],urt=L(()=>c("i",{"data-feather":"chevron-down"},null,-1)),prt=[urt],_rt=L(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," System status",-1)),hrt=L(()=>c("div",{class:"mr-2"},"|",-1)),frt={class:"text-base font-semibold cursor-pointer select-none items-center"},mrt={class:"flex gap-2 items-center"},grt={key:0},brt=["src"],Ert={class:"font-bold font-large text-lg"},yrt={key:1},vrt={class:"flex gap-2 items-center"},Srt=["src"],Trt={class:"font-bold font-large text-lg"},xrt=L(()=>c("i",{"data-feather":"cpu",title:"CPU Ram",class:"w-5 h-5 mx-1 flex-shrink-0"},null,-1)),Crt={class:"font-bold font-large text-lg"},wrt=L(()=>c("i",{"data-feather":"hard-drive",title:"Hard drive",class:"w-5 h-5 mx-1 flex-shrink-0"},null,-1)),Rrt={class:"font-bold font-large text-lg"},Art={class:"mb-2"},Nrt=L(()=>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"})]),Xe(" CPU Ram usage: ")],-1)),Ort={class:"flex flex-col mx-2"},Irt=L(()=>c("b",null,"Avaliable ram: ",-1)),Mrt=L(()=>c("b",null,"Ram usage: ",-1)),Drt={class:"p-2"},krt={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},Lrt={class:"mb-2"},Prt=L(()=>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"}),Xe(" Disk usage: ")],-1)),Urt={class:"flex flex-col mx-2"},Frt=L(()=>c("b",null,"Avaliable disk space: ",-1)),Brt=L(()=>c("b",null,"Disk usage: ",-1)),Grt={class:"p-2"},Vrt={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},zrt={class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},Hrt=["src"],qrt={class:"flex flex-col mx-2"},Yrt=L(()=>c("b",null,"Model: ",-1)),$rt=L(()=>c("b",null,"Avaliable vram: ",-1)),Wrt=L(()=>c("b",null,"GPU usage: ",-1)),Krt={class:"p-2"},jrt={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},Qrt={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"},Xrt={class:"flex flex-row p-3"},Zrt=L(()=>c("i",{"data-feather":"chevron-right"},null,-1)),Jrt=[Zrt],eot=L(()=>c("i",{"data-feather":"chevron-down"},null,-1)),tot=[eot],not=L(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Main configurations",-1)),sot={class:"flex flex-col mb-2 px-3 pb-2"},iot={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"},rot=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"app_custom_logo",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Application logo:")],-1)),oot={for:"logo-upload"},aot=["src"],lot={style:{width:"10%"}},cot=L(()=>c("i",{"data-feather":"x"},null,-1)),dot=[cot],uot=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"hardware_mode",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Hardware mode:")],-1)),pot={class:"text-center items-center"},_ot={class:"flex flex-row"},hot=L(()=>c("option",{value:"cpu"},"CPU",-1)),fot=L(()=>c("option",{value:"cpu-noavx"},"CPU (No AVX)",-1)),mot=L(()=>c("option",{value:"nvidia-tensorcores"},"NVIDIA (Tensor Cores)",-1)),got=L(()=>c("option",{value:"nvidia"},"NVIDIA",-1)),bot=L(()=>c("option",{value:"amd-noavx"},"AMD (No AVX)",-1)),Eot=L(()=>c("option",{value:"amd"},"AMD",-1)),yot=L(()=>c("option",{value:"apple-intel"},"Apple Intel",-1)),vot=L(()=>c("option",{value:"apple-silicon"},"Apple Silicon",-1)),Sot=[hot,fot,mot,got,bot,Eot,yot,vot],Tot=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"discussion_db_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Database path:")],-1)),xot={style:{width:"100%"}},Cot=L(()=>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)),wot={class:"flex flex-row"},Rot=L(()=>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)),Aot={class:"flex flex-row"},Not=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"activate_debug",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate debug mode:")],-1)),Oot={class:"flex flex-row"},Iot=L(()=>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)),Mot={class:"flex flex-row"},Dot=L(()=>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)),kot={class:"flex flex-row"},Lot=L(()=>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)),Pot={class:"flex flex-row"},Uot=L(()=>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)),Fot={class:"flex flex-row"},Bot=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"auto_save",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto save:")],-1)),Got={class:"flex flex-row"},Vot=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"auto_update",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto update:")],-1)),zot={class:"flex flex-row"},Hot=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"auto_update",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto title:")],-1)),qot={class:"flex flex-row"},Yot={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},$ot=L(()=>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)),Wot=L(()=>c("option",{value:"lollms"},"Lollms communication template",-1)),Kot=L(()=>c("option",{value:"lollms_simplified"},"Lollms simplified communication template",-1)),jot=L(()=>c("option",{value:"llama3"},"LLama3 communication template",-1)),Qot=L(()=>c("option",{value:"mistral"},"Mistral communication template",-1)),Xot=[Wot,Kot,jot,Qot],Zot=L(()=>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)),Jot=L(()=>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)),eat=L(()=>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)),tat=L(()=>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)),nat=L(()=>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)),sat=L(()=>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)),iat=L(()=>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)),rat=L(()=>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)),oat=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"separator_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Separator template:")],-1)),aat=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"system_message_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"System template:")],-1)),lat=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"full_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Full template:")],-1)),cat=["innerHTML"],dat=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"use_continue_message",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"useful for chat models and repote models but can be less useful for instruct ones"},"Use continue message:")],-1)),uat={style:{width:"100%"}},pat={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"},_at=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"user_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User name:")],-1)),hat={style:{width:"100%"}},fat=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"user_description",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User description:")],-1)),mat={style:{width:"100%"}},gat=L(()=>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)),bat={style:{width:"100%"}},Eat=L(()=>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)),yat={style:{width:"100%"}},vat=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"user_avatar",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User avatar:")],-1)),Sat={for:"avatar-upload"},Tat=["src"],xat={style:{width:"10%"}},Cat=L(()=>c("i",{"data-feather":"x"},null,-1)),wat=[Cat],Rat=L(()=>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)),Aat={class:"flex flex-row"},Nat=L(()=>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)),Oat={style:{width:"100%"}},Iat=L(()=>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)),Mat={style:{width:"100%"}},Dat={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"},kat=L(()=>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)),Lat={style:{width:"100%"}},Pat=L(()=>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)),Uat={style:{width:"100%"}},Fat=L(()=>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)),Bat={style:{width:"100%"}},Gat=L(()=>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)),Vat={style:{width:"100%"}},zat=L(()=>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)),Hat={style:{width:"100%"}},qat={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"},Yat=L(()=>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)),$at={class:"flex flex-row"},Wat=L(()=>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)),Kat={style:{width:"100%"}},jat={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"},Qat=L(()=>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)),Xat={class:"flex flex-row"},Zat={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"},Jat=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"positive_boost",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Positive Boost:")],-1)),elt={class:"flex flex-row"},tlt=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"negative_boost",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Negative Boost:")],-1)),nlt={class:"flex flex-row"},slt=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"fun_mode",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Fun mode:")],-1)),ilt={class:"flex flex-row"},rlt={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"},olt={class:"flex flex-row p-3"},alt=L(()=>c("i",{"data-feather":"chevron-right"},null,-1)),llt=[alt],clt=L(()=>c("i",{"data-feather":"chevron-down"},null,-1)),dlt=[clt],ult=L(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Data management settings",-1)),plt={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"},_lt=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"rag_databases",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data Sources:")],-1)),hlt={style:{width:"100%"}},flt=["onUpdate:modelValue"],mlt=["onClick"],glt=["onClick"],blt=["onClick"],Elt=L(()=>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)),ylt=L(()=>c("option",{value:"bert"},"Bert Vectorizer",-1)),vlt=L(()=>c("option",{value:"tfidf"},"TFIDF Vectorizer",-1)),Slt=L(()=>c("option",{value:"word2vec"},"Word2Vec Vectorizer",-1)),Tlt=[ylt,vlt,Slt],xlt=L(()=>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)),Clt=L(()=>c("option",{value:"bert-base-nli-mean-tokens"},"bert-base-nli-mean-tokens",-1)),wlt=[Clt],Rlt=L(()=>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)),Alt=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"rag_overlap",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"RAG overlap size:")],-1)),Nlt=L(()=>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)),Olt=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"rag_clean_chunks",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Clean chunks:")],-1)),Ilt=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"rag_follow_subfolders",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Follow subfolders:")],-1)),Mlt=L(()=>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)),Dlt=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"rag_preprocess_chunks",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Preprocess chunks:")],-1)),klt=L(()=>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)),Llt=L(()=>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)),Plt={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"},Ult=L(()=>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)),Flt={class:"flex flex-row"},Blt=L(()=>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)),Glt={class:"flex flex-row"},Vlt=L(()=>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)),zlt={class:"flex flex-row"},Hlt=L(()=>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)),qlt={class:"flex flex-row"},Ylt=L(()=>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)),$lt={class:"flex flex-row"},Wlt=L(()=>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)),Klt=L(()=>c("option",{value:"tfidf_vectorizer"},"tfidf Vectorizer",-1)),jlt=L(()=>c("option",{value:"bm25_vectorizer"},"bm25 Vectorizer",-1)),Qlt=L(()=>c("option",{value:"model_embedding"},"Model Embedding",-1)),Xlt=L(()=>c("option",{value:"sentense_transformer"},"Sentense Transformer",-1)),Zlt=[Klt,jlt,Qlt,Xlt],Jlt=L(()=>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)),ect={style:{width:"100%"}},tct=L(()=>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)),nct=L(()=>c("option",{value:"PCA"},"PCA",-1)),sct=L(()=>c("option",{value:"TSNE"},"TSNE",-1)),ict=[nct,sct],rct=L(()=>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)),oct={class:"flex flex-row"},act=L(()=>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)),lct=L(()=>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)),cct=L(()=>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)),dct={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},uct={class:"flex flex-row p-3"},pct=L(()=>c("i",{"data-feather":"chevron-right"},null,-1)),_ct=[pct],hct=L(()=>c("i",{"data-feather":"chevron-down"},null,-1)),fct=[hct],mct=L(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Internet",-1)),gct={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"},bct=L(()=>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)),Ect={class:"flex flex-row"},yct=L(()=>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)),vct={class:"flex flex-row"},Sct=L(()=>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)),Tct={class:"flex flex-row"},xct=L(()=>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)),Cct={class:"flex flex-row"},wct=L(()=>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)),Rct={class:"flex flex-col"},Act=L(()=>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)),Nct={class:"flex flex-col"},Oct=L(()=>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)),Ict={class:"flex flex-col"},Mct=L(()=>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)),Dct={class:"flex flex-col"},kct={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},Lct={class:"flex flex-row p-3"},Pct=L(()=>c("i",{"data-feather":"chevron-right"},null,-1)),Uct=[Pct],Fct=L(()=>c("i",{"data-feather":"chevron-down"},null,-1)),Bct=[Fct],Gct=L(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Services Zoo",-1)),Vct={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"},zct=L(()=>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)),Hct={style:{width:"100%"}},qct=L(()=>c("option",{value:"None"},"None",-1)),Yct=L(()=>c("option",{value:"browser"},"Use Browser TTS (doesn't work in realtime mode)",-1)),$ct=L(()=>c("option",{value:"xtts"},"XTTS",-1)),Wct=L(()=>c("option",{value:"openai_tts"},"Open AI TTS",-1)),Kct=[qct,Yct,$ct,Wct],jct=L(()=>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)),Qct={style:{width:"100%"}},Xct=L(()=>c("option",{value:"None"},"None",-1)),Zct=L(()=>c("option",{value:"whisper"},"Whisper",-1)),Jct=L(()=>c("option",{value:"openai_whisper"},"Open AI Whisper",-1)),edt=[Xct,Zct,Jct],tdt=L(()=>c("tr",null,null,-1)),ndt=L(()=>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)),sdt={style:{width:"100%"}},idt=L(()=>c("option",{value:"None"},"None",-1)),rdt=L(()=>c("option",{value:"diffusers"},"Diffusers",-1)),odt=L(()=>c("option",{value:"autosd"},"AUTO1111's SD",-1)),adt=L(()=>c("option",{value:"dall-e"},"Open AI DALL-E",-1)),ldt=L(()=>c("option",{value:"midjourney"},"Midjourney",-1)),cdt=L(()=>c("option",{value:"comfyui"},"Comfyui",-1)),ddt=L(()=>c("option",{value:"fooocus"},"Fooocus",-1)),udt=[idt,rdt,odt,adt,ldt,cdt,ddt],pdt=L(()=>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)),_dt={style:{width:"100%"}},hdt=L(()=>c("option",{value:"None"},"None",-1)),fdt=L(()=>c("option",{value:"musicgen"},"Music Gen",-1)),mdt=[hdt,fdt],gdt={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"},bdt=L(()=>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)),Edt={class:"flex flex-row"},ydt=L(()=>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)),vdt={class:"flex flex-row"},Sdt=L(()=>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)),Tdt={class:"flex flex-row"},xdt=L(()=>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)),Cdt={class:"flex flex-row"},wdt={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"},Rdt=L(()=>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)),Adt={style:{width:"100%"}},Ndt=L(()=>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)),Odt={style:{width:"100%"}},Idt=L(()=>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)),Mdt={style:{width:"100%"}},Ddt=L(()=>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)),kdt={style:{width:"100%"}},Ldt=L(()=>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)),Pdt={style:{width:"100%"}},Udt=L(()=>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)),Fdt={style:{width:"100%"}},Bdt=L(()=>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)),Gdt={style:{width:"100%"}},Vdt=L(()=>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)),zdt={class:"flex flex-row"},Hdt=L(()=>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)),qdt={class:"flex flex-row"},Ydt={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"},$dt=L(()=>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)),Wdt={style:{width:"100%"}},Kdt=["value"],jdt=L(()=>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)),Qdt={style:{width:"100%"}},Xdt=["value"],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=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"host",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Host:")],-1)),eut={style:{width:"100%"}},tut=L(()=>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)),nut={style:{width:"100%"}},sut=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"discussion_db_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Port:")],-1)),iut={style:{width:"100%"}},rut=L(()=>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)),out={style:{width:"100%"}},aut=L(()=>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)),lut={style:{width:"100%"}},cut=L(()=>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)),dut={style:{width:"100%"}},uut=L(()=>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)),put={style:{width:"100%"}},_ut=L(()=>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)),hut={style:{width:"100%"}},fut={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"},mut=L(()=>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)),gut={class:"flex flex-row"},but=L(()=>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)),Eut={class:"flex flex-row"},yut=L(()=>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)),vut=L(()=>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)),Sut=["value"],Tut={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"},xut=L(()=>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)),Cut={class:"flex flex-row"},wut=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"whisper_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Whisper model:")],-1)),Rut={class:"flex flex-row"},Aut=["value"],Nut={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"},Out=L(()=>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)),Iut={class:"flex flex-row"},Mut=L(()=>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)),Dut={class:"flex flex-row"},kut=["value"],Lut={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"},Put=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"auto_speak",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable auto speak:")],-1)),Uut={class:"flex flex-row"},Fut=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"audio_pitch",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"audio pitch:")],-1)),But=L(()=>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)),Gut=["value"],Vut={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"},zut=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_current_language",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Current language:")],-1)),Hut={class:"flex flex-row"},qut=["value"],Yut=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_current_voice",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Current voice:")],-1)),$ut={class:"flex flex-row"},Wut=["value"],Kut=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_freq",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Frequency (controls the tone):")],-1)),jut={class:"flex flex-row"},Qut=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"auto_read",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable auto read:")],-1)),Xut={class:"flex flex-row"},Zut=L(()=>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)),Jut={class:"flex flex-row"},ept=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_temperature",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Temperature:")],-1)),tpt={class:"flex flex-row"},npt=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_length_penalty",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Length Penalty:")],-1)),spt={class:"flex flex-row"},ipt=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_repetition_penalty",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Repetition Penalty:")],-1)),rpt={class:"flex flex-row"},opt=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_top_k",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Top K:")],-1)),apt={class:"flex flex-row"},lpt=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_top_p",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Top P:")],-1)),cpt={class:"flex flex-row"},dpt=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_speed",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Speed:")],-1)),upt={class:"flex flex-row"},ppt=L(()=>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)),_pt={class:"flex flex-row"},hpt={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"},fpt=L(()=>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)),mpt={class:"flex flex-row"},gpt=L(()=>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)),bpt={class:"flex flex-row"},Ept=L(()=>c("option",null," tts-1 ",-1)),ypt=L(()=>c("option",null," tts-2 ",-1)),vpt=[Ept,ypt],Spt=L(()=>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)),Tpt={class:"flex flex-row"},xpt=L(()=>c("option",null," alloy ",-1)),Cpt=L(()=>c("option",null," echo ",-1)),wpt=L(()=>c("option",null," fable ",-1)),Rpt=L(()=>c("option",null," nova ",-1)),Apt=L(()=>c("option",null," shimmer ",-1)),Npt=[xpt,Cpt,wpt,Rpt,Apt],Opt={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=L(()=>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)),Mpt={class:"flex flex-row"},Dpt=L(()=>c("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),kpt=[Dpt],Lpt=L(()=>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)),Ppt={class:"flex flex-row"},Upt=L(()=>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)),Fpt={class:"flex flex-row"},Bpt=L(()=>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)),Gpt={class:"flex flex-row"},Vpt={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=L(()=>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)),Hpt={class:"flex flex-row"},qpt=L(()=>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)),Ypt=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"diffusers_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Diffusers model:")],-1)),$pt={class:"flex flex-row"},Wpt=L(()=>c("td",null,null,-1)),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"},jpt=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"midjourney_key",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"midjourney key:")],-1)),Qpt={class:"flex flex-row"},Xpt=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"midjourney_timeout",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"request timeout(s):")],-1)),Zpt={class:"flex flex-row"},Jpt=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"midjourney_retries",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"number of retries:")],-1)),e_t={class:"flex flex-row"},t_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"},n_t=L(()=>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)),s_t={class:"flex flex-row"},i_t=L(()=>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)),r_t={class:"flex flex-row"},o_t=L(()=>c("option",null," dall-e-2 ",-1)),a_t=L(()=>c("option",null," dall-e-3 ",-1)),l_t=[o_t,a_t],c_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"},d_t=L(()=>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)),u_t={class:"flex flex-row"},p_t=L(()=>c("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),__t=[p_t],h_t=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"comfyui_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Available models (only if local):")],-1)),f_t={class:"flex flex-row"},m_t=["value"],g_t=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"comfyui_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable comfyui model:")],-1)),b_t={class:"flex flex-row"},E_t=L(()=>c("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),y_t=[E_t],v_t=L(()=>c("td",{style:{"min-width":"200px"}},null,-1)),S_t={class:"flex flex-row"},T_t=L(()=>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)),x_t=L(()=>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)),C_t={class:"flex flex-row"},w_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"},R_t=L(()=>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)),A_t={class:"flex flex-row"},N_t=L(()=>c("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),O_t=[N_t],I_t=L(()=>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)),M_t={class:"flex flex-row"},D_t=L(()=>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)),k_t={class:"flex flex-row"},L_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"},P_t=L(()=>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)),U_t={class:"flex flex-row"},F_t=L(()=>c("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),B_t=[F_t],G_t=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"vllm_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install vLLM service:")],-1)),V_t={class:"flex flex-row"},z_t=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"vllm_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"vllm base url:")],-1)),H_t={class:"flex flex-row"},q_t=L(()=>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)),Y_t={class:"flex flex-col align-bottom"},$_t={class:"relative"},W_t=L(()=>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)),K_t={class:"absolute right-0"},j_t=L(()=>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)),Q_t={class:"flex flex-row"},X_t=L(()=>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)),Z_t={class:"flex flex-row"},J_t=L(()=>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)),eht={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"},nht=L(()=>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)),sht={class:"flex flex-row"},iht=L(()=>c("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),rht=[iht],oht=L(()=>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)),aht={class:"flex flex-row"},lht=L(()=>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)),cht={class:"flex flex-row"},dht={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"},uht=L(()=>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)),pht={class:"flex flex-row"},_ht=L(()=>c("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),hht=[_ht],fht=L(()=>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)),mht={class:"flex flex-row"},ght=L(()=>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)),bht={class:"flex flex-row"},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=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"elastic_search_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable elastic search service:")],-1)),vht={class:"flex flex-row"},Sht=L(()=>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)),Tht={class:"flex flex-row"},xht=L(()=>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)),Cht={class:"flex flex-row"},wht={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"},Rht={class:"flex flex-row p-3"},Aht=L(()=>c("i",{"data-feather":"chevron-right"},null,-1)),Nht=[Aht],Oht=L(()=>c("i",{"data-feather":"chevron-down"},null,-1)),Iht=[Oht],Mht=L(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Binding zoo",-1)),Dht={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},kht=L(()=>c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),Lht={key:1,class:"mr-2"},Pht={key:2,class:"text-base font-semibold cursor-pointer select-none items-center"},Uht={class:"flex gap-1 items-center"},Fht=["src"],Bht={class:"font-bold font-large text-lg line-clamp-1"},Ght={key:0,class:"mb-2"},Vht={for:"binding",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},zht=L(()=>c("i",{"data-feather":"chevron-up"},null,-1)),Hht=[zht],qht=L(()=>c("i",{"data-feather":"chevron-down"},null,-1)),Yht=[qht],$ht={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"},Wht={class:"flex flex-row p-3"},Kht=L(()=>c("i",{"data-feather":"chevron-right"},null,-1)),jht=[Kht],Qht=L(()=>c("i",{"data-feather":"chevron-down"},null,-1)),Xht=[Qht],Zht=L(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Models zoo",-1)),Jht={class:"flex flex-row items-center"},eft={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},tft=L(()=>c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),nft={key:1,class:"text-base text-red-600 flex gap-3 items-center mr-2"},sft=L(()=>c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),ift={key:2,class:"mr-2"},rft={key:3,class:"text-base font-semibold cursor-pointer select-none items-center"},oft={class:"flex gap-1 items-center"},aft=["src"],lft={class:"font-bold font-large text-lg line-clamp-1"},cft={class:"mx-2 mb-4"},dft={class:"relative"},uft={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},pft={key:0},_ft=L(()=>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)),hft=[_ft],fft={key:1},mft=L(()=>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)),gft=[mft],bft=L(()=>c("label",{for:"only_installed"},"Show only installed models",-1)),Eft=L(()=>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)),yft={key:0,role:"status",class:"text-center w-full display: flex;align-items: center;"},vft=L(()=>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)),Sft=L(()=>c("p",{class:"heartbeat-text"},"Loading models Zoo",-1)),Tft=[vft,Sft],xft={key:1,class:"mb-2"},Cft={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},wft=L(()=>c("i",{"data-feather":"chevron-up"},null,-1)),Rft=[wft],Aft=L(()=>c("i",{"data-feather":"chevron-down"},null,-1)),Nft=[Aft],Oft={class:"mb-2"},Ift={class:"p-2"},Mft={class:"mb-3"},Dft=L(()=>c("label",{class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},"Create a reference from local file path:",-1)),kft={key:0},Lft={class:"mb-3"},Pft=L(()=>c("label",{class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},"Download from web:",-1)),Uft={key:1,class:"relative flex flex-col items-center justify-center flex-grow h-full"},Fft=L(()=>c("div",{role:"status",class:"justify-center"},null,-1)),Bft={class:"relative flex flex-row flex-grow items-center w-full h-full bottom-0"},Gft={class:"w-full p-2"},Vft={class:"flex justify-between mb-1"},zft=gu(' Downloading Loading...',1),Hft={class:"text-sm font-medium text-blue-700 dark:text-white"},qft=["title"],Yft={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},$ft={class:"flex justify-between mb-1"},Wft={class:"text-base font-medium text-blue-700 dark:text-white"},Kft={class:"text-sm font-medium text-blue-700 dark:text-white"},jft={class:"flex flex-grow"},Qft={class:"flex flex-row flex-grow gap-3"},Xft={class:"p-2 text-center grow"},Zft={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"},Jft={class:"flex flex-row p-3 items-center"},emt=L(()=>c("i",{"data-feather":"chevron-right"},null,-1)),tmt=[emt],nmt=L(()=>c("i",{"data-feather":"chevron-down"},null,-1)),smt=[nmt],imt=L(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Personalities zoo",-1)),rmt={key:0,class:"mr-2"},omt={class:"mr-2 font-bold font-large text-lg line-clamp-1"},amt={key:1,class:"mr-2"},lmt={key:2,class:"text-base font-semibold cursor-pointer select-none items-center flex flex-row"},cmt={key:0,class:"flex -space-x-4 items-center"},dmt={class:"group items-center flex flex-row"},umt=["onClick"],pmt=["src","title"],_mt=["onClick"],hmt=L(()=>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)),fmt=[hmt],mmt=L(()=>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)),gmt=[mmt],bmt={class:"mx-2 mb-4"},Emt=L(()=>c("label",{for:"personality-search",class:"mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white"},"Search",-1)),ymt={class:"relative"},vmt={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},Smt={key:0},Tmt=L(()=>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)),xmt=[Tmt],Cmt={key:1},wmt=L(()=>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)),Rmt=[wmt],Amt={key:0,class:"mx-2 mb-4"},Nmt={for:"persCat",class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},Omt=["selected"],Imt={key:0,class:"mb-2"},Mmt={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},Dmt=L(()=>c("i",{"data-feather":"chevron-up"},null,-1)),kmt=[Dmt],Lmt=L(()=>c("i",{"data-feather":"chevron-down"},null,-1)),Pmt=[Lmt],Umt={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"},Fmt={class:"flex flex-row"},Bmt=L(()=>c("i",{"data-feather":"chevron-right"},null,-1)),Gmt=[Bmt],Vmt=L(()=>c("i",{"data-feather":"chevron-down"},null,-1)),zmt=[Vmt],Hmt=L(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none"}," Model Configuration",-1)),qmt={class:"m-2"},Ymt={class:"flex flex-row gap-2 items-center"},$mt=L(()=>c("label",{for:"override-model-parameters",class:"block text-sm font-medium"}," Override personality model parameters ",-1)),Wmt={class:"m-2"},Kmt=L(()=>c("label",{for:"seed",class:"block mb-2 text-sm font-medium"}," Seed: ",-1)),jmt={class:"m-2"},Qmt={class:"flex flex-col align-bottom"},Xmt={class:"relative"},Zmt=L(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"temperature",class:"text-sm font-medium"}," Temperature: ")],-1)),Jmt={class:"absolute right-0"},egt={class:"m-2"},tgt={class:"flex flex-col align-bottom"},ngt={class:"relative"},sgt=L(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"predict",class:"text-sm font-medium"}," N Predict: ")],-1)),igt={class:"absolute right-0"},rgt={class:"m-2"},ogt={class:"flex flex-col align-bottom"},agt={class:"relative"},lgt=L(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"top_k",class:"text-sm font-medium"}," Top-K: ")],-1)),cgt={class:"absolute right-0"},dgt={class:"m-2"},ugt={class:"flex flex-col align-bottom"},pgt={class:"relative"},_gt=L(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"top_p",class:"text-sm font-medium"}," Top-P: ")],-1)),hgt={class:"absolute right-0"},fgt={class:"m-2"},mgt={class:"flex flex-col align-bottom"},ggt={class:"relative"},bgt=L(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"repeat_penalty",class:"text-sm font-medium"}," Repeat penalty: ")],-1)),Egt={class:"absolute right-0"},ygt={class:"m-2"},vgt={class:"flex flex-col align-bottom"},Sgt={class:"relative"},Tgt=L(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"repeat_last_n",class:"text-sm font-medium"}," Repeat last N: ")],-1)),xgt={class:"absolute right-0"};function Cgt(n,e,t,s,i,r){const o=dt("Card"),a=dt("BindingEntry"),l=dt("RadioOptions"),u=dt("model-entry"),d=dt("personality-entry"),h=dt("AddModelDialog"),f=dt("ChoiceDialog");return C(),R(ze,null,[c("div",Dit,[c("div",kit,[i.showConfirmation?(C(),R("div",Lit,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel",type:"button",onClick:e[0]||(e[0]=ae(_=>i.showConfirmation=!1,["stop"]))},Uit),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm save changes",type:"button",onClick:e[1]||(e[1]=ae(_=>r.save_configuration(),["stop"]))},Bit)])):G("",!0),i.showConfirmation?G("",!0):(C(),R("div",Git,[c("button",{title:"Reset configuration",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[2]||(e[2]=_=>r.reset_configuration())},zit),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]=ae(_=>i.all_collapsed=!i.all_collapsed,["stop"]))},qit)])),c("div",Yit,[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)}))},Wit),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)}))},jit),i.has_updates?(C(),R("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)}))},[Qit,Xit,Xe(" = ")])):G("",!0),c("div",Zit,[i.settingsChanged?(C(),R("div",Jit,[i.isLoading?G("",!0):(C(),R("button",{key:0,class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Apply changes",type:"button",onClick:e[7]||(e[7]=ae(_=>r.applyConfiguration(),["stop"]))},trt)),i.isLoading?G("",!0):(C(),R("button",{key:1,class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Cancel changes",type:"button",onClick:e[8]||(e[8]=ae(_=>r.cancelConfiguration(),["stop"]))},srt))])):G("",!0),i.isLoading?(C(),R("div",irt,[c("p",null,se(i.loading_text),1),rrt,ort])):G("",!0)])])]),c("div",{class:Fe(i.isLoading?"pointer-events-none opacity-30 w-full":"w-full")},[c("div",art,[c("div",lrt,[c("button",{onClick:e[9]||(e[9]=ae(_=>i.sc_collapsed=!i.sc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[B(c("div",null,drt,512),[[Ot,i.sc_collapsed]]),B(c("div",null,prt,512),[[Ot,!i.sc_collapsed]]),_rt,hrt,c("div",frt,[c("div",mrt,[c("div",null,[r.vramUsage&&r.vramUsage.gpus&&r.vramUsage.gpus.length==1?(C(),R("div",grt,[(C(!0),R(ze,null,st(r.vramUsage.gpus,_=>(C(),R("div",{class:"flex gap-2 items-center",key:_},[c("img",{src:i.SVGGPU,width:"25",height:"25"},null,8,brt),c("h3",Ert,[c("div",null,se(r.computedFileSize(_.used_vram))+" / "+se(r.computedFileSize(_.total_vram))+" ("+se(_.percentage)+"%) ",1)])]))),128))])):G("",!0),r.vramUsage&&r.vramUsage.gpus&&r.vramUsage.gpus.length>1?(C(),R("div",yrt,[c("div",vrt,[c("img",{src:i.SVGGPU,width:"25",height:"25"},null,8,Srt),c("h3",Trt,[c("div",null,se(r.vramUsage.gpus.length)+"x ",1)])])])):G("",!0)]),xrt,c("h3",Crt,[c("div",null,se(r.ram_usage)+" / "+se(r.ram_total_space)+" ("+se(r.ram_percent_usage)+"%)",1)]),wrt,c("h3",Rrt,[c("div",null,se(r.disk_binding_models_usage)+" / "+se(r.disk_total_space)+" ("+se(r.disk_percent_usage)+"%)",1)])])])])]),c("div",{class:Fe([{hidden:i.sc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",Art,[Nrt,c("div",Ort,[c("div",null,[Irt,Xe(se(r.ram_available_space),1)]),c("div",null,[Mrt,Xe(" "+se(r.ram_usage)+" / "+se(r.ram_total_space)+" ("+se(r.ram_percent_usage)+")% ",1)])]),c("div",Drt,[c("div",krt,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:jt("width: "+r.ram_percent_usage+"%;")},null,4)])])]),c("div",Lrt,[Prt,c("div",Urt,[c("div",null,[Frt,Xe(se(r.disk_available_space),1)]),c("div",null,[Brt,Xe(" "+se(r.disk_binding_models_usage)+" / "+se(r.disk_total_space)+" ("+se(r.disk_percent_usage)+"%)",1)])]),c("div",Grt,[c("div",Vrt,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:jt("width: "+r.disk_percent_usage+"%;")},null,4)])])]),(C(!0),R(ze,null,st(r.vramUsage.gpus,_=>(C(),R("div",{class:"mb-2",key:_},[c("label",zrt,[c("img",{src:i.SVGGPU,width:"25",height:"25"},null,8,Hrt),Xe(" GPU usage: ")]),c("div",qrt,[c("div",null,[Yrt,Xe(se(_.gpu_model),1)]),c("div",null,[$rt,Xe(se(this.computedFileSize(_.available_space)),1)]),c("div",null,[Wrt,Xe(" "+se(this.computedFileSize(_.used_vram))+" / "+se(this.computedFileSize(_.total_vram))+" ("+se(_.percentage)+"%)",1)])]),c("div",Krt,[c("div",jrt,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:jt("width: "+_.percentage+"%;")},null,4)])])]))),128))],2)]),c("div",Qrt,[c("div",Xrt,[c("button",{onClick:e[10]||(e[10]=ae(_=>i.minconf_collapsed=!i.minconf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[B(c("div",null,Jrt,512),[[Ot,i.minconf_collapsed]]),B(c("div",null,tot,512),[[Ot,!i.minconf_collapsed]]),not])]),c("div",{class:Fe([{hidden:i.minconf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",sot,[_e(o,{title:"General",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",iot,[c("tr",null,[rot,c("td",null,[c("label",oot,[c("img",{src:r.configFile.app_custom_logo!=null&&r.configFile.app_custom_logo!=""?"/user_infos/"+r.configFile.app_custom_logo:i.storeLogo,class:"w-50 h-50 rounded-full",style:{"max-width":"50px","max-height":"50px",cursor:"pointer"}},null,8,aot)]),c("input",{type:"file",id:"logo-upload",style:{display:"none"},onChange:e[11]||(e[11]=(..._)=>r.uploadLogo&&r.uploadLogo(..._))},null,32)]),c("td",lot,[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]=ae(_=>r.resetLogo(),["stop"]))},dot)])]),c("tr",null,[uot,c("td",pot,[c("div",_ot,[B(c("select",{id:"hardware_mode",required:"","onUpdate:modelValue":e[13]||(e[13]=_=>r.configFile.hardware_mode=_),onChange:e[14]||(e[14]=_=>i.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},Sot,544),[[qt,r.configFile.hardware_mode]])])])]),c("tr",null,[Tot,c("td",xot,[B(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]=_=>i.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),[[he,r.configFile.discussion_db_name]])])]),c("tr",null,[Cot,c("td",null,[c("div",wot,[B(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]=_=>i.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.copy_to_clipboard_add_all_details]])])])]),c("tr",null,[Rot,c("td",null,[c("div",Aot,[B(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]=_=>i.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.auto_show_browser]])])])]),c("tr",null,[Not,c("td",null,[c("div",Oot,[B(c("input",{type:"checkbox",id:"activate_debug",required:"","onUpdate:modelValue":e[21]||(e[21]=_=>r.configFile.debug=_),onChange:e[22]||(e[22]=_=>i.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.debug]])])])]),c("tr",null,[Iot,c("td",null,[c("div",Mot,[B(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]=_=>i.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.debug_show_final_full_prompt]])])])]),c("tr",null,[Dot,c("td",null,[c("div",kot,[B(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]=_=>i.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.debug_show_chunks]])])])]),c("tr",null,[Lot,c("td",null,[c("div",Pot,[B(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]=_=>i.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.debug_log_file_path]])])])]),c("tr",null,[Uot,c("td",null,[c("div",Fot,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.show_news_panel]])])])]),c("tr",null,[Bot,c("td",null,[c("div",Got,[B(c("input",{type:"checkbox",id:"auto_save",required:"","onUpdate:modelValue":e[31]||(e[31]=_=>r.configFile.auto_save=_),onChange:e[32]||(e[32]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.auto_save]])])])]),c("tr",null,[Vot,c("td",null,[c("div",zot,[B(c("input",{type:"checkbox",id:"auto_update",required:"","onUpdate:modelValue":e[33]||(e[33]=_=>r.configFile.auto_update=_),onChange:e[34]||(e[34]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.auto_update]])])])]),c("tr",null,[Hot,c("td",null,[c("div",qot,[B(c("input",{type:"checkbox",id:"auto_title",required:"","onUpdate:modelValue":e[35]||(e[35]=_=>r.configFile.auto_title=_),onChange:e[36]||(e[36]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.auto_title]])])])])])]),_:1}),_e(o,{title:"Model template",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",Yot,[c("tr",null,[$ot,c("td",null,[c("select",{onChange:e[37]||(e[37]=(..._)=>r.handleTemplateSelection&&r.handleTemplateSelection(..._))},Xot,32)])]),c("tr",null,[Zot,c("td",null,[B(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]=_=>i.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),[[he,r.configFile.start_header_id_template]])])]),c("tr",null,[Jot,c("td",null,[B(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]=_=>i.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),[[he,r.configFile.end_header_id_template]])])]),c("tr",null,[eat,c("td",null,[B(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]=_=>i.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),[[he,r.configFile.start_user_header_id_template]])])]),c("tr",null,[tat,c("td",null,[B(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]=_=>i.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),[[he,r.configFile.end_user_header_id_template]])])]),c("tr",null,[nat,c("td",null,[B(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]=_=>i.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),[[he,r.configFile.end_user_message_id_template]])])]),c("tr",null,[sat,c("td",null,[B(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]=_=>i.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),[[he,r.configFile.start_ai_header_id_template]])])]),c("tr",null,[iat,c("td",null,[B(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]=_=>i.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),[[he,r.configFile.end_ai_header_id_template]])])]),c("tr",null,[rat,c("td",null,[B(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]=_=>i.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),[[he,r.configFile.end_ai_message_id_template]])])]),c("tr",null,[oat,c("td",null,[B(c("textarea",{id:"separator_template",required:"","onUpdate:modelValue":e[54]||(e[54]=_=>r.configFile.separator_template=_),onChange:e[55]||(e[55]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.separator_template]])])]),c("tr",null,[aat,c("td",null,[B(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]=_=>i.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),[[he,r.configFile.system_message_template]])])]),c("tr",null,[lat,c("td",null,[c("div",{innerHTML:r.full_template},null,8,cat)])]),c("tr",null,[dat,c("td",uat,[B(c("input",{type:"checkbox",id:"use_continue_message",required:"","onUpdate:modelValue":e[58]||(e[58]=_=>r.configFile.use_continue_message=_),onChange:e[59]||(e[59]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.use_continue_message]])])])])]),_:1}),_e(o,{title:"User",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",pat,[c("tr",null,[_at,c("td",hat,[B(c("input",{type:"text",id:"user_name",required:"","onUpdate:modelValue":e[60]||(e[60]=_=>r.configFile.user_name=_),onChange:e[61]||(e[61]=_=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.user_name]])])]),c("tr",null,[fat,c("td",mat,[B(c("textarea",{id:"user_description",required:"","onUpdate:modelValue":e[62]||(e[62]=_=>r.configFile.user_description=_),onChange:e[63]||(e[63]=_=>i.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),[[he,r.configFile.user_description]])])]),c("tr",null,[gat,c("td",bat,[B(c("input",{type:"checkbox",id:"use_user_informations_in_discussion",required:"","onUpdate:modelValue":e[64]||(e[64]=_=>r.configFile.use_user_informations_in_discussion=_),onChange:e[65]||(e[65]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.use_user_informations_in_discussion]])])]),c("tr",null,[Eat,c("td",yat,[B(c("input",{type:"checkbox",id:"use_model_name_in_discussions",required:"","onUpdate:modelValue":e[66]||(e[66]=_=>r.configFile.use_model_name_in_discussions=_),onChange:e[67]||(e[67]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.use_model_name_in_discussions]])])]),c("tr",null,[vat,c("td",null,[c("label",Sat,[c("img",{src:r.configFile.user_avatar!=null&&r.configFile.user_avatar!=""?"/user_infos/"+r.configFile.user_avatar:i.storeLogo,class:"w-50 h-50 rounded-full",style:{"max-width":"50px","max-height":"50px",cursor:"pointer"}},null,8,Tat)]),c("input",{type:"file",id:"avatar-upload",style:{display:"none"},onChange:e[68]||(e[68]=(..._)=>r.uploadAvatar&&r.uploadAvatar(..._))},null,32)]),c("td",xat,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Discard title changes",type:"button",onClick:e[69]||(e[69]=ae(_=>r.resetAvatar(),["stop"]))},wat)])]),c("tr",null,[Rat,c("td",null,[c("div",Aat,[B(c("input",{type:"checkbox",id:"use_user_name_in_discussions",required:"","onUpdate:modelValue":e[70]||(e[70]=_=>r.configFile.use_user_name_in_discussions=_),onChange:e[71]||(e[71]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.use_user_name_in_discussions]])])])]),c("tr",null,[Nat,c("td",Oat,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.max_n_predict]])])]),c("tr",null,[Iat,c("td",Mat,[B(c("input",{type:"number",id:"max_n_predict",required:"","onUpdate:modelValue":e[74]||(e[74]=_=>r.configFile.max_n_predict=_),onChange:e[75]||(e[75]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.max_n_predict]])])])])]),_:1}),_e(o,{title:"Security settings",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",Dat,[c("tr",null,[kat,c("td",Lat,[B(c("input",{type:"checkbox",id:"turn_on_code_execution",required:"","onUpdate:modelValue":e[76]||(e[76]=_=>r.configFile.turn_on_code_execution=_),onChange:e[77]||(e[77]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.turn_on_code_execution]])])]),c("tr",null,[Pat,c("td",Uat,[B(c("input",{type:"checkbox",id:"turn_on_code_validation",required:"","onUpdate:modelValue":e[78]||(e[78]=_=>r.configFile.turn_on_code_validation=_),onChange:e[79]||(e[79]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.turn_on_code_validation]])])]),c("tr",null,[Fat,c("td",Bat,[B(c("input",{type:"checkbox",id:"turn_on_setting_update_validation",required:"","onUpdate:modelValue":e[80]||(e[80]=_=>r.configFile.turn_on_setting_update_validation=_),onChange:e[81]||(e[81]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.turn_on_setting_update_validation]])])]),c("tr",null,[Gat,c("td",Vat,[B(c("input",{type:"checkbox",id:"turn_on_open_file_validation",required:"","onUpdate:modelValue":e[82]||(e[82]=_=>r.configFile.turn_on_open_file_validation=_),onChange:e[83]||(e[83]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.turn_on_open_file_validation]])])]),c("tr",null,[zat,c("td",Hat,[B(c("input",{type:"checkbox",id:"turn_on_send_file_validation",required:"","onUpdate:modelValue":e[84]||(e[84]=_=>r.configFile.turn_on_send_file_validation=_),onChange:e[85]||(e[85]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.turn_on_send_file_validation]])])])])]),_:1}),_e(o,{title:"Knowledge database",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",qat,[c("tr",null,[Yat,c("td",null,[c("div",$at,[B(c("input",{type:"checkbox",id:"activate_skills_lib",required:"","onUpdate:modelValue":e[86]||(e[86]=_=>r.configFile.activate_skills_lib=_),onChange:e[87]||(e[87]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.activate_skills_lib]])])])]),c("tr",null,[Wat,c("td",Kat,[B(c("input",{type:"text",id:"skills_lib_database_name",required:"","onUpdate:modelValue":e[88]||(e[88]=_=>r.configFile.skills_lib_database_name=_),onChange:e[89]||(e[89]=_=>i.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),[[he,r.configFile.skills_lib_database_name]])])])])]),_:1}),_e(o,{title:"Latex",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",jat,[c("tr",null,[Qat,c("td",null,[c("div",Xat,[B(c("input",{type:"text",id:"pdf_latex_path",required:"","onUpdate:modelValue":e[90]||(e[90]=_=>r.configFile.pdf_latex_path=_),onChange:e[91]||(e[91]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.pdf_latex_path]])])])])])]),_:1}),_e(o,{title:"Boost",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",Zat,[c("tr",null,[Jat,c("td",null,[c("div",elt,[B(c("input",{type:"text",id:"positive_boost",required:"","onUpdate:modelValue":e[92]||(e[92]=_=>r.configFile.positive_boost=_),onChange:e[93]||(e[93]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.positive_boost]])])])]),c("tr",null,[tlt,c("td",null,[c("div",nlt,[B(c("input",{type:"text",id:"negative_boost",required:"","onUpdate:modelValue":e[94]||(e[94]=_=>r.configFile.negative_boost=_),onChange:e[95]||(e[95]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.negative_boost]])])])]),c("tr",null,[slt,c("td",null,[c("div",ilt,[B(c("input",{type:"checkbox",id:"fun_mode",required:"","onUpdate:modelValue":e[96]||(e[96]=_=>r.configFile.fun_mode=_),onChange:e[97]||(e[97]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.fun_mode]])])])])])]),_:1})])],2)]),c("div",rlt,[c("div",olt,[c("button",{onClick:e[98]||(e[98]=ae(_=>i.data_conf_collapsed=!i.data_conf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[B(c("div",null,llt,512),[[Ot,i.data_conf_collapsed]]),B(c("div",null,dlt,512),[[Ot,!i.data_conf_collapsed]]),ult])]),c("div",{class:Fe([{hidden:i.data_conf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[_e(o,{title:"Data Sources",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",plt,[c("tr",null,[_lt,c("td",hlt,[(C(!0),R(ze,null,st(r.configFile.rag_databases,(_,m)=>(C(),R("div",{key:m,class:"flex items-center mb-2"},[B(c("input",{type:"text","onUpdate:modelValue":E=>r.configFile.rag_databases[m]=E,onChange:e[99]||(e[99]=E=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,40,flt),[[he,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,mlt),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,glt),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,blt)]))),128)),c("button",{onClick:e[100]||(e[100]=(..._)=>r.addDataSource&&r.addDataSource(..._)),class:"mt-2 px-2 py-1 bg-blue-500 text-white rounded"},"Add Data Source")])]),c("tr",null,[Elt,c("td",null,[B(c("select",{id:"rag_vectorizer",required:"","onUpdate:modelValue":e[101]||(e[101]=_=>r.configFile.rag_vectorizer=_),onChange:e[102]||(e[102]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},Tlt,544),[[qt,r.configFile.rag_vectorizer]])])]),c("tr",null,[xlt,c("td",null,[B(c("select",{id:"rag_vectorizer_model",required:"","onUpdate:modelValue":e[103]||(e[103]=_=>r.configFile.rag_vectorizer_model=_),onChange:e[104]||(e[104]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},wlt,544),[[qt,r.configFile.rag_vectorizer_model]])])]),c("tr",null,[Rlt,c("td",null,[B(c("input",{id:"rag_chunk_size","onUpdate:modelValue":e[105]||(e[105]=_=>r.configFile.rag_chunk_size=_),onChange:e[106]||(e[106]=_=>i.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),[[he,r.configFile.rag_chunk_size]]),B(c("input",{"onUpdate:modelValue":e[107]||(e[107]=_=>r.configFile.rag_chunk_size=_),type:"number",onChange:e[108]||(e[108]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.rag_chunk_size]])])]),c("tr",null,[Alt,c("td",null,[B(c("input",{id:"rag_overlap","onUpdate:modelValue":e[109]||(e[109]=_=>r.configFile.rag_overlap=_),onChange:e[110]||(e[110]=_=>i.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),[[he,r.configFile.rag_overlap]]),B(c("input",{"onUpdate:modelValue":e[111]||(e[111]=_=>r.configFile.rag_overlap=_),type:"number",onChange:e[112]||(e[112]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.rag_overlap]])])]),c("tr",null,[Nlt,c("td",null,[B(c("input",{id:"rag_n_chunks","onUpdate:modelValue":e[113]||(e[113]=_=>r.configFile.rag_n_chunks=_),onChange:e[114]||(e[114]=_=>i.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),[[he,r.configFile.rag_n_chunks]]),B(c("input",{"onUpdate:modelValue":e[115]||(e[115]=_=>r.configFile.rag_n_chunks=_),type:"number",onChange:e[116]||(e[116]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.rag_n_chunks]])])]),c("tr",null,[Olt,c("td",null,[B(c("input",{"onUpdate:modelValue":e[117]||(e[117]=_=>r.configFile.rag_clean_chunks=_),type:"checkbox",onChange:e[118]||(e[118]=_=>i.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.rag_clean_chunks]])])]),c("tr",null,[Ilt,c("td",null,[B(c("input",{"onUpdate:modelValue":e[119]||(e[119]=_=>r.configFile.rag_follow_subfolders=_),type:"checkbox",onChange:e[120]||(e[120]=_=>i.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.rag_follow_subfolders]])])]),c("tr",null,[Mlt,c("td",null,[B(c("input",{"onUpdate:modelValue":e[121]||(e[121]=_=>r.configFile.rag_check_new_files_at_startup=_),type:"checkbox",onChange:e[122]||(e[122]=_=>i.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.rag_check_new_files_at_startup]])])]),c("tr",null,[Dlt,c("td",null,[B(c("input",{"onUpdate:modelValue":e[123]||(e[123]=_=>r.configFile.rag_preprocess_chunks=_),type:"checkbox",onChange:e[124]||(e[124]=_=>i.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.rag_preprocess_chunks]])])]),c("tr",null,[klt,c("td",null,[B(c("input",{"onUpdate:modelValue":e[125]||(e[125]=_=>r.configFile.rag_activate_multi_hops=_),type:"checkbox",onChange:e[126]||(e[126]=_=>i.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.rag_activate_multi_hops]])])]),c("tr",null,[Llt,c("td",null,[B(c("input",{"onUpdate:modelValue":e[127]||(e[127]=_=>r.configFile.contextual_summary=_),type:"checkbox",onChange:e[128]||(e[128]=_=>i.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.contextual_summary]])])])])]),_:1}),_e(o,{title:"Data Vectorization",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",Plt,[c("tr",null,[Ult,c("td",null,[c("div",Flt,[B(c("input",{type:"checkbox",id:"data_vectorization_save_db",required:"","onUpdate:modelValue":e[129]||(e[129]=_=>r.configFile.data_vectorization_save_db=_),onChange:e[130]||(e[130]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.data_vectorization_save_db]])])])]),c("tr",null,[Blt,c("td",null,[c("div",Glt,[B(c("input",{type:"checkbox",id:"data_vectorization_visualize_on_vectorization",required:"","onUpdate:modelValue":e[131]||(e[131]=_=>r.configFile.data_vectorization_visualize_on_vectorization=_),onChange:e[132]||(e[132]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.data_vectorization_visualize_on_vectorization]])])])]),c("tr",null,[Vlt,c("td",null,[c("div",zlt,[B(c("input",{type:"checkbox",id:"data_vectorization_build_keys_words",required:"","onUpdate:modelValue":e[133]||(e[133]=_=>r.configFile.data_vectorization_build_keys_words=_),onChange:e[134]||(e[134]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.data_vectorization_build_keys_words]])])])]),c("tr",null,[Hlt,c("td",null,[c("div",qlt,[B(c("input",{type:"checkbox",id:"data_vectorization_force_first_chunk",required:"","onUpdate:modelValue":e[135]||(e[135]=_=>r.configFile.data_vectorization_force_first_chunk=_),onChange:e[136]||(e[136]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.data_vectorization_force_first_chunk]])])])]),c("tr",null,[Ylt,c("td",null,[c("div",$lt,[B(c("input",{type:"checkbox",id:"data_vectorization_put_chunk_informations_into_context",required:"","onUpdate:modelValue":e[137]||(e[137]=_=>r.configFile.data_vectorization_put_chunk_informations_into_context=_),onChange:e[138]||(e[138]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.data_vectorization_put_chunk_informations_into_context]])])])]),c("tr",null,[Wlt,c("td",null,[B(c("select",{id:"data_vectorization_method",required:"","onUpdate:modelValue":e[139]||(e[139]=_=>r.configFile.data_vectorization_method=_),onChange:e[140]||(e[140]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},Zlt,544),[[qt,r.configFile.data_vectorization_method]])])]),c("tr",null,[Jlt,c("td",ect,[B(c("input",{type:"text",id:"data_vectorization_sentense_transformer_model",required:"","onUpdate:modelValue":e[141]||(e[141]=_=>r.configFile.data_vectorization_sentense_transformer_model=_),onChange:e[142]||(e[142]=_=>i.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),[[he,r.configFile.data_vectorization_sentense_transformer_model]])])]),c("tr",null,[tct,c("td",null,[B(c("select",{id:"data_visualization_method",required:"","onUpdate:modelValue":e[143]||(e[143]=_=>r.configFile.data_visualization_method=_),onChange:e[144]||(e[144]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},ict,544),[[qt,r.configFile.data_visualization_method]])])]),c("tr",null,[rct,c("td",null,[c("div",oct,[B(c("input",{type:"checkbox",id:"data_vectorization_save_db",required:"","onUpdate:modelValue":e[145]||(e[145]=_=>r.configFile.data_vectorization_save_db=_),onChange:e[146]||(e[146]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.data_vectorization_save_db]])])])]),c("tr",null,[act,c("td",null,[B(c("input",{id:"data_vectorization_chunk_size","onUpdate:modelValue":e[147]||(e[147]=_=>r.configFile.data_vectorization_chunk_size=_),onChange:e[148]||(e[148]=_=>i.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),[[he,r.configFile.data_vectorization_chunk_size]]),B(c("input",{"onUpdate:modelValue":e[149]||(e[149]=_=>r.configFile.data_vectorization_chunk_size=_),type:"number",onChange:e[150]||(e[150]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.data_vectorization_chunk_size]])])]),c("tr",null,[lct,c("td",null,[B(c("input",{id:"data_vectorization_overlap_size","onUpdate:modelValue":e[151]||(e[151]=_=>r.configFile.data_vectorization_overlap_size=_),onChange:e[152]||(e[152]=_=>i.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),[[he,r.configFile.data_vectorization_overlap_size]]),B(c("input",{"onUpdate:modelValue":e[153]||(e[153]=_=>r.configFile.data_vectorization_overlap_size=_),type:"number",onChange:e[154]||(e[154]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.data_vectorization_overlap_size]])])]),c("tr",null,[cct,c("td",null,[B(c("input",{id:"data_vectorization_nb_chunks","onUpdate:modelValue":e[155]||(e[155]=_=>r.configFile.data_vectorization_nb_chunks=_),onChange:e[156]||(e[156]=_=>i.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),[[he,r.configFile.data_vectorization_nb_chunks]]),B(c("input",{"onUpdate:modelValue":e[157]||(e[157]=_=>r.configFile.data_vectorization_nb_chunks=_),type:"number",onChange:e[158]||(e[158]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.data_vectorization_nb_chunks]])])])])]),_:1})],2)]),c("div",dct,[c("div",uct,[c("button",{onClick:e[159]||(e[159]=ae(_=>i.internet_conf_collapsed=!i.internet_conf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[B(c("div",null,_ct,512),[[Ot,i.internet_conf_collapsed]]),B(c("div",null,fct,512),[[Ot,!i.internet_conf_collapsed]]),mct])]),c("div",{class:Fe([{hidden:i.internet_conf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[_e(o,{title:"Internet search",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",gct,[c("tr",null,[bct,c("td",null,[c("div",Ect,[B(c("input",{type:"checkbox",id:"fun_mode",required:"","onUpdate:modelValue":e[160]||(e[160]=_=>r.configFile.activate_internet_search=_),onChange:e[161]||(e[161]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.activate_internet_search]])])])]),c("tr",null,[yct,c("td",null,[c("div",vct,[B(c("input",{type:"checkbox",id:"activate_internet_pages_judgement",required:"","onUpdate:modelValue":e[162]||(e[162]=_=>r.configFile.activate_internet_pages_judgement=_),onChange:e[163]||(e[163]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.activate_internet_pages_judgement]])])])]),c("tr",null,[Sct,c("td",null,[c("div",Tct,[B(c("input",{type:"checkbox",id:"internet_quick_search",required:"","onUpdate:modelValue":e[164]||(e[164]=_=>r.configFile.internet_quick_search=_),onChange:e[165]||(e[165]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.internet_quick_search]])])])]),c("tr",null,[xct,c("td",null,[c("div",Cct,[B(c("input",{type:"checkbox",id:"internet_activate_search_decision",required:"","onUpdate:modelValue":e[166]||(e[166]=_=>r.configFile.internet_activate_search_decision=_),onChange:e[167]||(e[167]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.internet_activate_search_decision]])])])]),c("tr",null,[wct,c("td",null,[c("div",Rct,[B(c("input",{id:"internet_vectorization_chunk_size","onUpdate:modelValue":e[168]||(e[168]=_=>r.configFile.internet_vectorization_chunk_size=_),onChange:e[169]||(e[169]=_=>i.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),[[he,r.configFile.internet_vectorization_chunk_size]]),B(c("input",{"onUpdate:modelValue":e[170]||(e[170]=_=>r.configFile.internet_vectorization_chunk_size=_),type:"number",onChange:e[171]||(e[171]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.internet_vectorization_chunk_size]])])])]),c("tr",null,[Act,c("td",null,[c("div",Nct,[B(c("input",{id:"internet_vectorization_overlap_size","onUpdate:modelValue":e[172]||(e[172]=_=>r.configFile.internet_vectorization_overlap_size=_),onChange:e[173]||(e[173]=_=>i.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),[[he,r.configFile.internet_vectorization_overlap_size]]),B(c("input",{"onUpdate:modelValue":e[174]||(e[174]=_=>r.configFile.internet_vectorization_overlap_size=_),type:"number",onChange:e[175]||(e[175]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.internet_vectorization_overlap_size]])])])]),c("tr",null,[Oct,c("td",null,[c("div",Ict,[B(c("input",{id:"internet_vectorization_nb_chunks","onUpdate:modelValue":e[176]||(e[176]=_=>r.configFile.internet_vectorization_nb_chunks=_),onChange:e[177]||(e[177]=_=>i.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),[[he,r.configFile.internet_vectorization_nb_chunks]]),B(c("input",{"onUpdate:modelValue":e[178]||(e[178]=_=>r.configFile.internet_vectorization_nb_chunks=_),type:"number",onChange:e[179]||(e[179]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.internet_vectorization_nb_chunks]])])])]),c("tr",null,[Mct,c("td",null,[c("div",Dct,[B(c("input",{id:"internet_nb_search_pages","onUpdate:modelValue":e[180]||(e[180]=_=>r.configFile.internet_nb_search_pages=_),onChange:e[181]||(e[181]=_=>i.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),[[he,r.configFile.internet_nb_search_pages]]),B(c("input",{"onUpdate:modelValue":e[182]||(e[182]=_=>r.configFile.internet_nb_search_pages=_),type:"number",onChange:e[183]||(e[183]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.internet_nb_search_pages]])])])])])]),_:1})],2)]),c("div",kct,[c("div",Lct,[c("button",{onClick:e[184]||(e[184]=ae(_=>i.servers_conf_collapsed=!i.servers_conf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[B(c("div",null,Uct,512),[[Ot,i.servers_conf_collapsed]]),B(c("div",null,Bct,512),[[Ot,!i.servers_conf_collapsed]]),Gct])]),c("div",{class:Fe([{hidden:i.servers_conf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[_e(o,{title:"Default services selection",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",Vct,[c("tr",null,[zct,c("td",Hct,[B(c("select",{id:"active_tts_service",required:"","onUpdate:modelValue":e[185]||(e[185]=_=>r.configFile.active_tts_service=_),onChange:e[186]||(e[186]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},Kct,544),[[qt,r.configFile.active_tts_service]])])]),c("tr",null,[jct,c("td",Qct,[B(c("select",{id:"active_stt_service",required:"","onUpdate:modelValue":e[187]||(e[187]=_=>r.configFile.active_stt_service=_),onChange:e[188]||(e[188]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},edt,544),[[qt,r.configFile.active_stt_service]])])]),tdt,c("tr",null,[ndt,c("td",sdt,[B(c("select",{id:"active_tti_service",required:"","onUpdate:modelValue":e[189]||(e[189]=_=>r.configFile.active_tti_service=_),onChange:e[190]||(e[190]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},udt,544),[[qt,r.configFile.active_tti_service]])])]),c("tr",null,[pdt,c("td",_dt,[B(c("select",{id:"active_ttm_service",required:"","onUpdate:modelValue":e[191]||(e[191]=_=>r.configFile.active_ttm_service=_),onChange:e[192]||(e[192]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},mdt,544),[[qt,r.configFile.active_ttm_service]])])])])]),_:1}),_e(o,{title:"TTI settings",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",gdt,[c("tr",null,[bdt,c("td",null,[c("div",Edt,[B(c("input",{type:"checkbox",id:"use_negative_prompt",required:"","onUpdate:modelValue":e[193]||(e[193]=_=>r.configFile.use_negative_prompt=_),onChange:e[194]||(e[194]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.use_negative_prompt]])])])]),c("tr",null,[ydt,c("td",null,[c("div",vdt,[B(c("input",{type:"checkbox",id:"use_ai_generated_negative_prompt",required:"","onUpdate:modelValue":e[195]||(e[195]=_=>r.configFile.use_ai_generated_negative_prompt=_),onChange:e[196]||(e[196]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.use_ai_generated_negative_prompt]])])])]),c("tr",null,[Sdt,c("td",null,[c("div",Tdt,[B(c("input",{type:"text",id:"negative_prompt_generation_prompt",required:"","onUpdate:modelValue":e[197]||(e[197]=_=>r.configFile.negative_prompt_generation_prompt=_),onChange:e[198]||(e[198]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.negative_prompt_generation_prompt]])])])]),c("tr",null,[xdt,c("td",null,[c("div",Cdt,[B(c("input",{type:"text",id:"default_negative_prompt",required:"","onUpdate:modelValue":e[199]||(e[199]=_=>r.configFile.default_negative_prompt=_),onChange:e[200]||(e[200]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.default_negative_prompt]])])])])])]),_:1}),_e(o,{title:"Full Audio settings",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",wdt,[c("tr",null,[Rdt,c("td",Adt,[B(c("input",{type:"number",step:"1",id:"stt_listening_threshold",required:"","onUpdate:modelValue":e[201]||(e[201]=_=>r.configFile.stt_listening_threshold=_),onChange:e[202]||(e[202]=_=>i.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),[[he,r.configFile.stt_listening_threshold]])])]),c("tr",null,[Ndt,c("td",Odt,[B(c("input",{type:"number",step:"1",id:"stt_silence_duration",required:"","onUpdate:modelValue":e[203]||(e[203]=_=>r.configFile.stt_silence_duration=_),onChange:e[204]||(e[204]=_=>i.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),[[he,r.configFile.stt_silence_duration]])])]),c("tr",null,[Idt,c("td",Mdt,[B(c("input",{type:"number",step:"1",id:"stt_sound_threshold_percentage",required:"","onUpdate:modelValue":e[205]||(e[205]=_=>r.configFile.stt_sound_threshold_percentage=_),onChange:e[206]||(e[206]=_=>i.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),[[he,r.configFile.stt_sound_threshold_percentage]])])]),c("tr",null,[Ddt,c("td",kdt,[B(c("input",{type:"number",step:"1",id:"stt_gain",required:"","onUpdate:modelValue":e[207]||(e[207]=_=>r.configFile.stt_gain=_),onChange:e[208]||(e[208]=_=>i.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),[[he,r.configFile.stt_gain]])])]),c("tr",null,[Ldt,c("td",Pdt,[B(c("input",{type:"number",step:"1",id:"stt_rate",required:"","onUpdate:modelValue":e[209]||(e[209]=_=>r.configFile.stt_rate=_),onChange:e[210]||(e[210]=_=>i.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),[[he,r.configFile.stt_rate]])])]),c("tr",null,[Udt,c("td",Fdt,[B(c("input",{type:"number",step:"1",id:"stt_channels",required:"","onUpdate:modelValue":e[211]||(e[211]=_=>r.configFile.stt_channels=_),onChange:e[212]||(e[212]=_=>i.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),[[he,r.configFile.stt_channels]])])]),c("tr",null,[Bdt,c("td",Gdt,[B(c("input",{type:"number",step:"1",id:"stt_buffer_size",required:"","onUpdate:modelValue":e[213]||(e[213]=_=>r.configFile.stt_buffer_size=_),onChange:e[214]||(e[214]=_=>i.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),[[he,r.configFile.stt_buffer_size]])])]),c("tr",null,[Vdt,c("td",null,[c("div",zdt,[B(c("input",{type:"checkbox",id:"stt_activate_word_detection",required:"","onUpdate:modelValue":e[215]||(e[215]=_=>r.configFile.stt_activate_word_detection=_),onChange:e[216]||(e[216]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.stt_activate_word_detection]])])])]),c("tr",null,[Hdt,c("td",null,[c("div",qdt,[B(c("input",{type:"text",id:"stt_word_detection_file",required:"","onUpdate:modelValue":e[217]||(e[217]=_=>r.configFile.stt_word_detection_file=_),onChange:e[218]||(e[218]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.stt_word_detection_file]])])])])])]),_:1}),_e(o,{title:"Audio devices settings",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",Ydt,[c("tr",null,[$dt,c("td",Wdt,[B(c("select",{id:"stt_input_device",required:"","onUpdate:modelValue":e[219]||(e[219]=_=>r.configFile.stt_input_device=_),onChange:e[220]||(e[220]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(C(!0),R(ze,null,st(i.snd_input_devices,(_,m)=>(C(),R("option",{key:_,value:i.snd_input_devices_indexes[m]},se(_),9,Kdt))),128))],544),[[qt,r.configFile.stt_input_device]])])]),c("tr",null,[jdt,c("td",Qdt,[B(c("select",{id:"tts_output_device",required:"","onUpdate:modelValue":e[221]||(e[221]=_=>r.configFile.tts_output_device=_),onChange:e[222]||(e[222]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(C(!0),R(ze,null,st(i.snd_output_devices,(_,m)=>(C(),R("option",{key:_,value:i.snd_output_devices_indexes[m]},se(_),9,Xdt))),128))],544),[[qt,r.configFile.tts_output_device]])])])])]),_:1}),_e(o,{title:"Lollms service",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",Zdt,[c("tr",null,[Jdt,c("td",eut,[B(c("input",{type:"text",id:"host",required:"","onUpdate:modelValue":e[223]||(e[223]=_=>r.configFile.host=_),onChange:e[224]||(e[224]=_=>i.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),[[he,r.configFile.host]])])]),c("tr",null,[tut,c("td",nut,[B(c("input",{type:"text",id:"lollms_access_keys",required:"","onUpdate:modelValue":e[225]||(e[225]=_=>r.configFile.lollms_access_keys=_),onChange:e[226]||(e[226]=_=>i.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),[[he,r.configFile.lollms_access_keys]])])]),c("tr",null,[sut,c("td",iut,[B(c("input",{type:"number",step:"1",id:"port",required:"","onUpdate:modelValue":e[227]||(e[227]=_=>r.configFile.port=_),onChange:e[228]||(e[228]=_=>i.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),[[he,r.configFile.port]])])]),c("tr",null,[rut,c("td",out,[B(c("input",{type:"checkbox",id:"headless_server_mode",required:"","onUpdate:modelValue":e[229]||(e[229]=_=>r.configFile.headless_server_mode=_),onChange:e[230]||(e[230]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Ke,r.configFile.headless_server_mode]])])]),c("tr",null,[aut,c("td",lut,[B(c("input",{type:"checkbox",id:"activate_lollms_server",required:"","onUpdate:modelValue":e[231]||(e[231]=_=>r.configFile.activate_lollms_server=_),onChange:e[232]||(e[232]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Ke,r.configFile.activate_lollms_server]])])]),c("tr",null,[cut,c("td",dut,[B(c("input",{type:"checkbox",id:"activate_ollama_emulator",required:"","onUpdate:modelValue":e[233]||(e[233]=_=>r.configFile.activate_ollama_emulator=_),onChange:e[234]||(e[234]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Ke,r.configFile.activate_ollama_emulator]])])]),c("tr",null,[uut,c("td",put,[B(c("input",{type:"checkbox",id:"activate_openai_emulator",required:"","onUpdate:modelValue":e[235]||(e[235]=_=>r.configFile.activate_openai_emulator=_),onChange:e[236]||(e[236]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Ke,r.configFile.activate_openai_emulator]])])]),c("tr",null,[_ut,c("td",hut,[B(c("input",{type:"checkbox",id:"activate_mistralai_emulator",required:"","onUpdate:modelValue":e[237]||(e[237]=_=>r.configFile.activate_mistralai_emulator=_),onChange:e[238]||(e[238]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Ke,r.configFile.activate_mistralai_emulator]])])])])]),_:1}),_e(o,{title:"STT services",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[_e(o,{title:"Browser Audio STT",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",fut,[c("tr",null,[mut,c("td",null,[c("div",gut,[B(c("input",{type:"checkbox",id:"activate_audio_infos",required:"","onUpdate:modelValue":e[239]||(e[239]=_=>r.configFile.activate_audio_infos=_),onChange:e[240]||(e[240]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.activate_audio_infos]])])])]),c("tr",null,[but,c("td",null,[c("div",Eut,[B(c("input",{type:"checkbox",id:"audio_auto_send_input",required:"","onUpdate:modelValue":e[241]||(e[241]=_=>r.configFile.audio_auto_send_input=_),onChange:e[242]||(e[242]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.audio_auto_send_input]])])])]),c("tr",null,[yut,c("td",null,[B(c("input",{id:"audio_silenceTimer","onUpdate:modelValue":e[243]||(e[243]=_=>r.configFile.audio_silenceTimer=_),onChange:e[244]||(e[244]=_=>i.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),[[he,r.configFile.audio_silenceTimer]]),B(c("input",{"onUpdate:modelValue":e[245]||(e[245]=_=>r.configFile.audio_silenceTimer=_),onChange:e[246]||(e[246]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.audio_silenceTimer]])])]),c("tr",null,[vut,c("td",null,[B(c("select",{id:"audio_in_language","onUpdate:modelValue":e[247]||(e[247]=_=>r.configFile.audio_in_language=_),onChange:e[248]||(e[248]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(C(!0),R(ze,null,st(r.audioLanguages,_=>(C(),R("option",{key:_.code,value:_.code},se(_.name),9,Sut))),128))],544),[[qt,r.configFile.audio_in_language]])])])])]),_:1}),_e(o,{title:"Whisper audio transcription",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",Tut,[c("tr",null,[xut,c("td",null,[c("div",Cut,[B(c("input",{type:"checkbox",id:"whisper_activate",required:"","onUpdate:modelValue":e[249]||(e[249]=_=>r.configFile.whisper_activate=_),onChange:e[250]||(e[250]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.whisper_activate]])])])]),c("tr",null,[wut,c("td",null,[c("div",Rut,[B(c("select",{id:"whisper_model","onUpdate:modelValue":e[251]||(e[251]=_=>r.configFile.whisper_model=_),onChange:e[252]||(e[252]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(C(!0),R(ze,null,st(r.whisperModels,_=>(C(),R("option",{key:_,value:_},se(_),9,Aut))),128))],544),[[qt,r.configFile.whisper_model]])])])])])]),_:1}),_e(o,{title:"Open AI Whisper audio transcription",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",Nut,[c("tr",null,[Out,c("td",null,[c("div",Iut,[B(c("input",{type:"text",id:"openai_whisper_key",required:"","onUpdate:modelValue":e[253]||(e[253]=_=>r.configFile.openai_whisper_key=_),onChange:e[254]||(e[254]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.openai_whisper_key]])])])]),c("tr",null,[Mut,c("td",null,[c("div",Dut,[B(c("select",{id:"openai_whisper_model","onUpdate:modelValue":e[255]||(e[255]=_=>r.configFile.openai_whisper_model=_),onChange:e[256]||(e[256]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(C(!0),R(ze,null,st(r.openaiWhisperModels,_=>(C(),R("option",{key:_,value:_},se(_),9,kut))),128))],544),[[qt,r.configFile.openai_whisper_model]])])])])])]),_:1})]),_:1}),_e(o,{title:"TTS services",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[_e(o,{title:"Browser Audio TTS",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",Lut,[c("tr",null,[Put,c("td",null,[c("div",Uut,[B(c("input",{type:"checkbox",id:"auto_speak",required:"","onUpdate:modelValue":e[257]||(e[257]=_=>r.configFile.auto_speak=_),onChange:e[258]||(e[258]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.auto_speak]])])])]),c("tr",null,[Fut,c("td",null,[B(c("input",{id:"audio_pitch","onUpdate:modelValue":e[259]||(e[259]=_=>r.configFile.audio_pitch=_),onChange:e[260]||(e[260]=_=>i.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),[[he,r.configFile.audio_pitch]]),B(c("input",{"onUpdate:modelValue":e[261]||(e[261]=_=>r.configFile.audio_pitch=_),onChange:e[262]||(e[262]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.audio_pitch]])])]),c("tr",null,[But,c("td",null,[B(c("select",{id:"audio_out_voice","onUpdate:modelValue":e[263]||(e[263]=_=>r.configFile.audio_out_voice=_),onChange:e[264]||(e[264]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(C(!0),R(ze,null,st(i.audioVoices,_=>(C(),R("option",{key:_.name,value:_.name},se(_.name),9,Gut))),128))],544),[[qt,r.configFile.audio_out_voice]])])])])]),_:1}),_e(o,{title:"XTTS service",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",Vut,[c("tr",null,[zut,c("td",null,[c("div",Hut,[B(c("select",{"onUpdate:modelValue":e[265]||(e[265]=_=>r.xtts_current_language=_),onChange:e[266]||(e[266]=_=>i.settingsChanged=!0)},[(C(!0),R(ze,null,st(i.voice_languages,(_,m)=>(C(),R("option",{key:m,value:_},se(m),9,qut))),128))],544),[[qt,r.xtts_current_language]])])])]),c("tr",null,[Yut,c("td",null,[c("div",$ut,[B(c("select",{"onUpdate:modelValue":e[267]||(e[267]=_=>r.xtts_current_voice=_),onChange:e[268]||(e[268]=_=>i.settingsChanged=!0)},[(C(!0),R(ze,null,st(i.voices,_=>(C(),R("option",{key:_,value:_},se(_),9,Wut))),128))],544),[[qt,r.xtts_current_voice]])])])]),c("tr",null,[Kut,c("td",null,[c("div",jut,[B(c("input",{type:"number",id:"xtts_freq",required:"","onUpdate:modelValue":e[269]||(e[269]=_=>r.configFile.xtts_freq=_),onChange:e[270]||(e[270]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",step:"0.01"},null,544),[[he,r.configFile.xtts_freq,void 0,{number:!0}]])])])]),c("tr",null,[Qut,c("td",null,[c("div",Xut,[B(c("input",{type:"checkbox",id:"auto_read",required:"","onUpdate:modelValue":e[271]||(e[271]=_=>r.configFile.auto_read=_),onChange:e[272]||(e[272]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.auto_read]])])])]),c("tr",null,[Zut,c("td",null,[c("div",Jut,[B(c("input",{type:"text",id:"xtts_stream_chunk_size",required:"","onUpdate:modelValue":e[273]||(e[273]=_=>r.configFile.xtts_stream_chunk_size=_),onChange:e[274]||(e[274]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.xtts_stream_chunk_size]])])])]),c("tr",null,[ept,c("td",null,[c("div",tpt,[B(c("input",{type:"number",id:"xtts_temperature",required:"","onUpdate:modelValue":e[275]||(e[275]=_=>r.configFile.xtts_temperature=_),onChange:e[276]||(e[276]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",step:"0.01"},null,544),[[he,r.configFile.xtts_temperature,void 0,{number:!0}]])])])]),c("tr",null,[npt,c("td",null,[c("div",spt,[B(c("input",{type:"number",id:"xtts_length_penalty",required:"","onUpdate:modelValue":e[277]||(e[277]=_=>r.configFile.xtts_length_penalty=_),onChange:e[278]||(e[278]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",step:"0.1"},null,544),[[he,r.configFile.xtts_length_penalty,void 0,{number:!0}]])])])]),c("tr",null,[ipt,c("td",null,[c("div",rpt,[B(c("input",{type:"number",id:"xtts_repetition_penalty",required:"","onUpdate:modelValue":e[279]||(e[279]=_=>r.configFile.xtts_repetition_penalty=_),onChange:e[280]||(e[280]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",step:"0.1"},null,544),[[he,r.configFile.xtts_repetition_penalty,void 0,{number:!0}]])])])]),c("tr",null,[opt,c("td",null,[c("div",apt,[B(c("input",{type:"number",id:"xtts_top_k",required:"","onUpdate:modelValue":e[281]||(e[281]=_=>r.configFile.xtts_top_k=_),onChange:e[282]||(e[282]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.xtts_top_k,void 0,{number:!0}]])])])]),c("tr",null,[lpt,c("td",null,[c("div",cpt,[B(c("input",{type:"number",id:"xtts_top_p",required:"","onUpdate:modelValue":e[283]||(e[283]=_=>r.configFile.xtts_top_p=_),onChange:e[284]||(e[284]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.xtts_top_p,void 0,{number:!0}]])])])]),c("tr",null,[dpt,c("td",null,[c("div",upt,[B(c("input",{type:"number",id:"xtts_speed",required:"","onUpdate:modelValue":e[285]||(e[285]=_=>r.configFile.xtts_speed=_),onChange:e[286]||(e[286]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",step:"0.1"},null,544),[[he,r.configFile.xtts_speed,void 0,{number:!0}]])])])]),c("tr",null,[ppt,c("td",null,[c("div",_pt,[B(c("input",{type:"checkbox",id:"enable_text_splitting","onUpdate:modelValue":e[287]||(e[287]=_=>r.configFile.enable_text_splitting=_),onChange:e[288]||(e[288]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.enable_text_splitting]])])])])])]),_:1}),_e(o,{title:"Open AI TTS service",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",hpt,[c("tr",null,[fpt,c("td",null,[c("div",mpt,[B(c("input",{type:"text",id:"openai_tts_key",required:"","onUpdate:modelValue":e[289]||(e[289]=_=>r.configFile.openai_tts_key=_),onChange:e[290]||(e[290]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.openai_tts_key]])])])]),c("tr",null,[gpt,c("td",null,[c("div",bpt,[B(c("select",{"onUpdate:modelValue":e[291]||(e[291]=_=>r.configFile.openai_tts_model=_),onChange:e[292]||(e[292]=_=>i.settingsChanged=!0)},vpt,544),[[qt,r.configFile.openai_tts_model]])])])]),c("tr",null,[Spt,c("td",null,[c("div",Tpt,[B(c("select",{"onUpdate:modelValue":e[293]||(e[293]=_=>r.configFile.openai_tts_voice=_),onChange:e[294]||(e[294]=_=>i.settingsChanged=!0)},Npt,544),[[qt,r.configFile.openai_tts_voice]])])])])])]),_:1})]),_:1}),_e(o,{title:"TTI services",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[_e(o,{title:"Stable diffusion service",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",Opt,[c("tr",null,[Ipt,c("td",null,[c("div",Mpt,[B(c("input",{type:"checkbox",id:"enable_sd_service",required:"","onUpdate:modelValue":e[295]||(e[295]=_=>r.configFile.enable_sd_service=_),onChange:e[296]||(e[296]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,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[297]||(e[297]=_=>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"))},kpt)])]),c("tr",null,[Lpt,c("td",null,[c("div",Ppt,[c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[298]||(e[298]=(..._)=>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[299]||(e[299]=(..._)=>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[300]||(e[300]=(..._)=>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[301]||(e[301]=(..._)=>r.showSD&&r.showSD(..._))},"show sd ui"),Upt])]),c("td",null,[c("div",Fpt,[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("tr",null,[Bpt,c("td",null,[c("div",Gpt,[B(c("input",{type:"text",id:"sd_base_url",required:"","onUpdate:modelValue":e[303]||(e[303]=_=>r.configFile.sd_base_url=_),onChange:e[304]||(e[304]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.sd_base_url]])])])])])]),_:1}),_e(o,{title:"Diffusers service",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",Vpt,[c("tr",null,[zpt,c("td",null,[c("div",Hpt,[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.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[306]||(e[306]=(..._)=>r.upgradeDiffusersService&&r.upgradeDiffusersService(..._))},"upgrade diffusers service"),qpt])])]),c("tr",null,[Ypt,c("td",null,[c("div",$pt,[B(c("input",{type:"text",id:"diffusers_model",required:"","onUpdate:modelValue":e[307]||(e[307]=_=>r.configFile.diffusers_model=_),onChange:e[308]||(e[308]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.diffusers_model]])])]),Wpt])])]),_:1}),_e(o,{title:"Midjourney",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",Kpt,[c("tr",null,[jpt,c("td",null,[c("div",Qpt,[B(c("input",{type:"text",id:"midjourney_key",required:"","onUpdate:modelValue":e[309]||(e[309]=_=>r.configFile.midjourney_key=_),onChange:e[310]||(e[310]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.midjourney_key]])])])]),c("tr",null,[Xpt,c("td",null,[c("div",Zpt,[B(c("input",{type:"number",min:"10",max:"2048",id:"midjourney_timeout",required:"","onUpdate:modelValue":e[311]||(e[311]=_=>r.configFile.midjourney_timeout=_),onChange:e[312]||(e[312]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.midjourney_timeout]])])])]),c("tr",null,[Jpt,c("td",null,[c("div",e_t,[B(c("input",{type:"number",min:"0",max:"2048",id:"midjourney_retries",required:"","onUpdate:modelValue":e[313]||(e[313]=_=>r.configFile.midjourney_retries=_),onChange:e[314]||(e[314]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.midjourney_retries]])])])])])]),_:1}),_e(o,{title:"Dall-E",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",t_t,[c("tr",null,[n_t,c("td",null,[c("div",s_t,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.dall_e_key]])])])]),c("tr",null,[i_t,c("td",null,[c("div",r_t,[B(c("select",{"onUpdate:modelValue":e[317]||(e[317]=_=>r.configFile.dall_e_generation_engine=_),onChange:e[318]||(e[318]=_=>i.settingsChanged=!0)},l_t,544),[[qt,r.configFile.dall_e_generation_engine]])])])])])]),_:1}),_e(o,{title:"ComfyUI service",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",c_t,[c("tr",null,[d_t,c("td",null,[c("div",u_t,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,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"))},__t)])]),c("tr",null,[h_t,c("td",null,[c("div",f_t,[B(c("select",{id:"comfyui_model",required:"","onUpdate:modelValue":e[322]||(e[322]=_=>r.configFile.comfyui_model=_),onChange:e[323]||(e[323]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(C(!0),R(ze,null,st(i.comfyui_models,(_,m)=>(C(),R("option",{key:_,value:_},se(_),9,m_t))),128))],544),[[qt,r.configFile.comfyui_model]])])])]),c("tr",null,[g_t,c("td",null,[c("div",b_t,[B(c("input",{type:"text",id:"comfyui_model",required:"","onUpdate:modelValue":e[324]||(e[324]=_=>r.configFile.comfyui_model=_),onChange:e[325]||(e[325]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,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"))},y_t)])]),c("tr",null,[v_t,c("td",null,[c("div",S_t,[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"),T_t])])]),c("tr",null,[x_t,c("td",null,[c("div",C_t,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.comfyui_base_url]])])])])])]),_:1})]),_:1}),_e(o,{title:"TTT services",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[_e(o,{title:"Ollama service",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",w_t,[c("tr",null,[R_t,c("td",null,[c("div",A_t,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,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. +You need to apply changes before you leave, or else.`,"Apply configuration","Cancel")&&this.applyConfiguration(),!1}},L=n=>(no("data-v-e519cdb3"),n=n(),so(),n),Dit={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"},kit={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"},Lit={key:0,class:"flex gap-3 flex-1 items-center duration-75"},Pit=L(()=>c("i",{"data-feather":"x"},null,-1)),Uit=[Pit],Fit=L(()=>c("i",{"data-feather":"check"},null,-1)),Bit=[Fit],Git={key:1,class:"flex gap-3 flex-1 items-center"},Vit=L(()=>c("i",{"data-feather":"refresh-ccw"},null,-1)),zit=[Vit],Hit=L(()=>c("i",{"data-feather":"list"},null,-1)),qit=[Hit],Yit={class:"flex gap-3 flex-1 items-center justify-end"},$it=L(()=>c("i",{"data-feather":"trash-2"},null,-1)),Wit=[$it],Kit=L(()=>c("i",{"data-feather":"refresh-ccw"},null,-1)),jit=[Kit],Qit=L(()=>c("i",{"data-feather":"arrow-up-circle"},null,-1)),Xit=L(()=>c("i",{"data-feather":"alert-circle"},null,-1)),Zit={class:"flex gap-3 items-center"},Jit={key:0,class:"flex gap-3 items-center"},ert=L(()=>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)),trt=[ert],nrt=L(()=>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)),srt=[nrt],irt={key:1,role:"status"},rrt=L(()=>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)),ort=L(()=>c("span",{class:"sr-only"},"Loading...",-1)),art={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"},lrt={class:"flex flex-row p-3"},crt=L(()=>c("i",{"data-feather":"chevron-right"},null,-1)),drt=[crt],urt=L(()=>c("i",{"data-feather":"chevron-down"},null,-1)),prt=[urt],_rt=L(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," System status",-1)),hrt=L(()=>c("div",{class:"mr-2"},"|",-1)),frt={class:"text-base font-semibold cursor-pointer select-none items-center"},mrt={class:"flex gap-2 items-center"},grt={key:0},brt=["src"],Ert={class:"font-bold font-large text-lg"},yrt={key:1},vrt={class:"flex gap-2 items-center"},Srt=["src"],Trt={class:"font-bold font-large text-lg"},xrt=L(()=>c("i",{"data-feather":"cpu",title:"CPU Ram",class:"w-5 h-5 mx-1 flex-shrink-0"},null,-1)),Crt={class:"font-bold font-large text-lg"},wrt=L(()=>c("i",{"data-feather":"hard-drive",title:"Hard drive",class:"w-5 h-5 mx-1 flex-shrink-0"},null,-1)),Rrt={class:"font-bold font-large text-lg"},Art={class:"mb-2"},Nrt=L(()=>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"})]),Xe(" CPU Ram usage: ")],-1)),Ort={class:"flex flex-col mx-2"},Irt=L(()=>c("b",null,"Avaliable ram: ",-1)),Mrt=L(()=>c("b",null,"Ram usage: ",-1)),Drt={class:"p-2"},krt={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},Lrt={class:"mb-2"},Prt=L(()=>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"}),Xe(" Disk usage: ")],-1)),Urt={class:"flex flex-col mx-2"},Frt=L(()=>c("b",null,"Avaliable disk space: ",-1)),Brt=L(()=>c("b",null,"Disk usage: ",-1)),Grt={class:"p-2"},Vrt={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},zrt={class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},Hrt=["src"],qrt={class:"flex flex-col mx-2"},Yrt=L(()=>c("b",null,"Model: ",-1)),$rt=L(()=>c("b",null,"Avaliable vram: ",-1)),Wrt=L(()=>c("b",null,"GPU usage: ",-1)),Krt={class:"p-2"},jrt={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},Qrt={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"},Xrt={class:"flex flex-row p-3"},Zrt=L(()=>c("i",{"data-feather":"chevron-right"},null,-1)),Jrt=[Zrt],eot=L(()=>c("i",{"data-feather":"chevron-down"},null,-1)),tot=[eot],not=L(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Main configurations",-1)),sot={class:"flex flex-col mb-2 px-3 pb-2"},iot={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"},rot=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"app_custom_logo",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Application logo:")],-1)),oot={for:"logo-upload"},aot=["src"],lot={style:{width:"10%"}},cot=L(()=>c("i",{"data-feather":"x"},null,-1)),dot=[cot],uot=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"hardware_mode",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Hardware mode:")],-1)),pot={class:"text-center items-center"},_ot={class:"flex flex-row"},hot=L(()=>c("option",{value:"cpu"},"CPU",-1)),fot=L(()=>c("option",{value:"cpu-noavx"},"CPU (No AVX)",-1)),mot=L(()=>c("option",{value:"nvidia-tensorcores"},"NVIDIA (Tensor Cores)",-1)),got=L(()=>c("option",{value:"nvidia"},"NVIDIA",-1)),bot=L(()=>c("option",{value:"amd-noavx"},"AMD (No AVX)",-1)),Eot=L(()=>c("option",{value:"amd"},"AMD",-1)),yot=L(()=>c("option",{value:"apple-intel"},"Apple Intel",-1)),vot=L(()=>c("option",{value:"apple-silicon"},"Apple Silicon",-1)),Sot=[hot,fot,mot,got,bot,Eot,yot,vot],Tot=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"discussion_db_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Database path:")],-1)),xot={style:{width:"100%"}},Cot=L(()=>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)),wot={class:"flex flex-row"},Rot=L(()=>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)),Aot={class:"flex flex-row"},Not=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"activate_debug",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate debug mode:")],-1)),Oot={class:"flex flex-row"},Iot=L(()=>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)),Mot={class:"flex flex-row"},Dot=L(()=>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)),kot={class:"flex flex-row"},Lot=L(()=>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)),Pot={class:"flex flex-row"},Uot=L(()=>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)),Fot={class:"flex flex-row"},Bot=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"auto_save",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto save:")],-1)),Got={class:"flex flex-row"},Vot=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"auto_update",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto update:")],-1)),zot={class:"flex flex-row"},Hot=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"auto_update",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto title:")],-1)),qot={class:"flex flex-row"},Yot={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},$ot=L(()=>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)),Wot=L(()=>c("option",{value:"lollms"},"Lollms communication template",-1)),Kot=L(()=>c("option",{value:"lollms_simplified"},"Lollms simplified communication template",-1)),jot=L(()=>c("option",{value:"bare"},"Bare, useful when in chat mode",-1)),Qot=L(()=>c("option",{value:"llama3"},"LLama3 communication template",-1)),Xot=L(()=>c("option",{value:"mistral"},"Mistral communication template",-1)),Zot=[Wot,Kot,jot,Qot,Xot],Jot=L(()=>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)),eat=L(()=>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)),tat=L(()=>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)),nat=L(()=>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)),sat=L(()=>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)),iat=L(()=>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)),rat=L(()=>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)),oat=L(()=>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)),aat=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"separator_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Separator template:")],-1)),lat=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"system_message_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"System template:")],-1)),cat=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"full_template",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Full template:")],-1)),dat=["innerHTML"],uat=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"use_continue_message",class:"text-sm font-bold",style:{"margin-right":"1rem"},title:"useful for chat models and repote models but can be less useful for instruct ones"},"Use continue message:")],-1)),pat={style:{width:"100%"}},_at={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"},hat=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"user_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User name:")],-1)),fat={style:{width:"100%"}},mat=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"user_description",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User description:")],-1)),gat={style:{width:"100%"}},bat=L(()=>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)),Eat={style:{width:"100%"}},yat=L(()=>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)),vat={style:{width:"100%"}},Sat=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"user_avatar",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User avatar:")],-1)),Tat={for:"avatar-upload"},xat=["src"],Cat={style:{width:"10%"}},wat=L(()=>c("i",{"data-feather":"x"},null,-1)),Rat=[wat],Aat=L(()=>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)),Nat={class:"flex flex-row"},Oat=L(()=>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)),Iat={style:{width:"100%"}},Mat=L(()=>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)),Dat={style:{width:"100%"}},kat={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"},Lat=L(()=>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)),Pat={style:{width:"100%"}},Uat=L(()=>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)),Fat={style:{width:"100%"}},Bat=L(()=>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)),Gat={style:{width:"100%"}},Vat=L(()=>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)),zat={style:{width:"100%"}},Hat=L(()=>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)),qat={style:{width:"100%"}},Yat={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},$at=L(()=>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)),Wat={class:"flex flex-row"},Kat=L(()=>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)),jat={style:{width:"100%"}},Qat={class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},Xat=L(()=>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)),Zat={class:"flex flex-row"},Jat={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"},elt=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"positive_boost",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Positive Boost:")],-1)),tlt={class:"flex flex-row"},nlt=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"negative_boost",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Negative Boost:")],-1)),slt={class:"flex flex-row"},ilt=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"fun_mode",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Fun mode:")],-1)),rlt={class:"flex flex-row"},olt={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"},alt={class:"flex flex-row p-3"},llt=L(()=>c("i",{"data-feather":"chevron-right"},null,-1)),clt=[llt],dlt=L(()=>c("i",{"data-feather":"chevron-down"},null,-1)),ult=[dlt],plt=L(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Data management settings",-1)),_lt={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"},hlt=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"rag_databases",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data Sources:")],-1)),flt={style:{width:"100%"}},mlt=["onUpdate:modelValue"],glt=["onClick"],blt=["onClick"],Elt=["onClick"],ylt=L(()=>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)),vlt=L(()=>c("option",{value:"bert"},"Bert Vectorizer",-1)),Slt=L(()=>c("option",{value:"tfidf"},"TFIDF Vectorizer",-1)),Tlt=L(()=>c("option",{value:"word2vec"},"Word2Vec Vectorizer",-1)),xlt=[vlt,Slt,Tlt],Clt=L(()=>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)),wlt=L(()=>c("option",{value:"bert-base-nli-mean-tokens"},"bert-base-nli-mean-tokens",-1)),Rlt=[wlt],Alt=L(()=>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)),Nlt=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"rag_overlap",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"RAG overlap size:")],-1)),Olt=L(()=>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)),Ilt=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"rag_clean_chunks",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Clean chunks:")],-1)),Mlt=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"rag_follow_subfolders",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Follow subfolders:")],-1)),Dlt=L(()=>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)),klt=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"rag_preprocess_chunks",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Preprocess chunks:")],-1)),Llt=L(()=>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)),Plt=L(()=>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)),Ult={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"},Flt=L(()=>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)),Blt={class:"flex flex-row"},Glt=L(()=>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)),Vlt={class:"flex flex-row"},zlt=L(()=>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)),Hlt={class:"flex flex-row"},qlt=L(()=>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)),Ylt={class:"flex flex-row"},$lt=L(()=>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)),Wlt={class:"flex flex-row"},Klt=L(()=>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)),jlt=L(()=>c("option",{value:"tfidf_vectorizer"},"tfidf Vectorizer",-1)),Qlt=L(()=>c("option",{value:"bm25_vectorizer"},"bm25 Vectorizer",-1)),Xlt=L(()=>c("option",{value:"model_embedding"},"Model Embedding",-1)),Zlt=L(()=>c("option",{value:"sentense_transformer"},"Sentense Transformer",-1)),Jlt=[jlt,Qlt,Xlt,Zlt],ect=L(()=>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)),tct={style:{width:"100%"}},nct=L(()=>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)),sct=L(()=>c("option",{value:"PCA"},"PCA",-1)),ict=L(()=>c("option",{value:"TSNE"},"TSNE",-1)),rct=[sct,ict],oct=L(()=>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)),act={class:"flex flex-row"},lct=L(()=>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)),cct=L(()=>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)),dct=L(()=>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)),uct={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"},pct={class:"flex flex-row p-3"},_ct=L(()=>c("i",{"data-feather":"chevron-right"},null,-1)),hct=[_ct],fct=L(()=>c("i",{"data-feather":"chevron-down"},null,-1)),mct=[fct],gct=L(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Internet",-1)),bct={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"},Ect=L(()=>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)),yct={class:"flex flex-row"},vct=L(()=>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)),Sct={class:"flex flex-row"},Tct=L(()=>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)),xct={class:"flex flex-row"},Cct=L(()=>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)),wct={class:"flex flex-row"},Rct=L(()=>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)),Act={class:"flex flex-col"},Nct=L(()=>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)),Oct={class:"flex flex-col"},Ict=L(()=>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)),Mct={class:"flex flex-col"},Dct=L(()=>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)),kct={class:"flex flex-col"},Lct={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},Pct={class:"flex flex-row p-3"},Uct=L(()=>c("i",{"data-feather":"chevron-right"},null,-1)),Fct=[Uct],Bct=L(()=>c("i",{"data-feather":"chevron-down"},null,-1)),Gct=[Bct],Vct=L(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Services Zoo",-1)),zct={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"},Hct=L(()=>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)),qct={style:{width:"100%"}},Yct=L(()=>c("option",{value:"None"},"None",-1)),$ct=L(()=>c("option",{value:"browser"},"Use Browser TTS (doesn't work in realtime mode)",-1)),Wct=L(()=>c("option",{value:"xtts"},"XTTS",-1)),Kct=L(()=>c("option",{value:"openai_tts"},"Open AI TTS",-1)),jct=[Yct,$ct,Wct,Kct],Qct=L(()=>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)),Xct={style:{width:"100%"}},Zct=L(()=>c("option",{value:"None"},"None",-1)),Jct=L(()=>c("option",{value:"whisper"},"Whisper",-1)),edt=L(()=>c("option",{value:"openai_whisper"},"Open AI Whisper",-1)),tdt=[Zct,Jct,edt],ndt=L(()=>c("tr",null,null,-1)),sdt=L(()=>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)),idt={style:{width:"100%"}},rdt=L(()=>c("option",{value:"None"},"None",-1)),odt=L(()=>c("option",{value:"diffusers"},"Diffusers",-1)),adt=L(()=>c("option",{value:"autosd"},"AUTO1111's SD",-1)),ldt=L(()=>c("option",{value:"dall-e"},"Open AI DALL-E",-1)),cdt=L(()=>c("option",{value:"midjourney"},"Midjourney",-1)),ddt=L(()=>c("option",{value:"comfyui"},"Comfyui",-1)),udt=L(()=>c("option",{value:"fooocus"},"Fooocus",-1)),pdt=[rdt,odt,adt,ldt,cdt,ddt,udt],_dt=L(()=>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)),hdt={style:{width:"100%"}},fdt=L(()=>c("option",{value:"None"},"None",-1)),mdt=L(()=>c("option",{value:"musicgen"},"Music Gen",-1)),gdt=[fdt,mdt],bdt={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"},Edt=L(()=>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)),ydt={class:"flex flex-row"},vdt=L(()=>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)),Sdt={class:"flex flex-row"},Tdt=L(()=>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)),xdt={class:"flex flex-row"},Cdt=L(()=>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)),wdt={class:"flex flex-row"},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=L(()=>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)),Ndt={style:{width:"100%"}},Odt=L(()=>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)),Idt={style:{width:"100%"}},Mdt=L(()=>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)),Ddt={style:{width:"100%"}},kdt=L(()=>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)),Ldt={style:{width:"100%"}},Pdt=L(()=>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)),Udt={style:{width:"100%"}},Fdt=L(()=>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)),Bdt={style:{width:"100%"}},Gdt=L(()=>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)),Vdt={style:{width:"100%"}},zdt=L(()=>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)),Hdt={class:"flex flex-row"},qdt=L(()=>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)),Ydt={class:"flex flex-row"},$dt={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"},Wdt=L(()=>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)),Kdt={style:{width:"100%"}},jdt=["value"],Qdt=L(()=>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)),Xdt={style:{width:"100%"}},Zdt=["value"],Jdt={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"},eut=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"host",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Host:")],-1)),tut={style:{width:"100%"}},nut=L(()=>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)),sut={style:{width:"100%"}},iut=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"discussion_db_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Port:")],-1)),rut={style:{width:"100%"}},out=L(()=>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)),aut={style:{width:"100%"}},lut=L(()=>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)),cut={style:{width:"100%"}},dut=L(()=>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)),uut={style:{width:"100%"}},put=L(()=>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)),_ut={style:{width:"100%"}},hut=L(()=>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)),fut={style:{width:"100%"}},mut={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"},gut=L(()=>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)),but={class:"flex flex-row"},Eut=L(()=>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)),yut={class:"flex flex-row"},vut=L(()=>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)),Sut=L(()=>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)),Tut=["value"],xut={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"},Cut=L(()=>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)),wut={class:"flex flex-row"},Rut=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"whisper_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Whisper model:")],-1)),Aut={class:"flex flex-row"},Nut=["value"],Out={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"},Iut=L(()=>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)),Mut={class:"flex flex-row"},Dut=L(()=>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)),kut={class:"flex flex-row"},Lut=["value"],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=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"auto_speak",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable auto speak:")],-1)),Fut={class:"flex flex-row"},But=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"audio_pitch",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"audio pitch:")],-1)),Gut=L(()=>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)),Vut=["value"],zut={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"},Hut=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_current_language",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Current language:")],-1)),qut={class:"flex flex-row"},Yut=["value"],$ut=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_current_voice",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Current voice:")],-1)),Wut={class:"flex flex-row"},Kut=["value"],jut=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_freq",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Frequency (controls the tone):")],-1)),Qut={class:"flex flex-row"},Xut=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"auto_read",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable auto read:")],-1)),Zut={class:"flex flex-row"},Jut=L(()=>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)),ept={class:"flex flex-row"},tpt=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_temperature",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Temperature:")],-1)),npt={class:"flex flex-row"},spt=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_length_penalty",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Length Penalty:")],-1)),ipt={class:"flex flex-row"},rpt=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_repetition_penalty",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Repetition Penalty:")],-1)),opt={class:"flex flex-row"},apt=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_top_k",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Top K:")],-1)),lpt={class:"flex flex-row"},cpt=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_top_p",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Top P:")],-1)),dpt={class:"flex flex-row"},upt=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"xtts_speed",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Speed:")],-1)),ppt={class:"flex flex-row"},_pt=L(()=>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)),hpt={class:"flex flex-row"},fpt={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"},mpt=L(()=>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)),gpt={class:"flex flex-row"},bpt=L(()=>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)),Ept={class:"flex flex-row"},ypt=L(()=>c("option",null," tts-1 ",-1)),vpt=L(()=>c("option",null," tts-2 ",-1)),Spt=[ypt,vpt],Tpt=L(()=>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)),xpt={class:"flex flex-row"},Cpt=L(()=>c("option",null," alloy ",-1)),wpt=L(()=>c("option",null," echo ",-1)),Rpt=L(()=>c("option",null," fable ",-1)),Apt=L(()=>c("option",null," nova ",-1)),Npt=L(()=>c("option",null," shimmer ",-1)),Opt=[Cpt,wpt,Rpt,Apt,Npt],Ipt={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"},Mpt=L(()=>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)),Dpt={class:"flex flex-row"},kpt=L(()=>c("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),Lpt=[kpt],Ppt=L(()=>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)),Upt={class:"flex flex-row"},Fpt=L(()=>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)),Bpt={class:"flex flex-row"},Gpt=L(()=>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)),Vpt={class:"flex flex-row"},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"},Hpt=L(()=>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)),qpt={class:"flex flex-row"},Ypt=L(()=>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)),$pt=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"diffusers_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Diffusers model:")],-1)),Wpt={class:"flex flex-row"},Kpt=L(()=>c("td",null,null,-1)),jpt={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"},Qpt=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"midjourney_key",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"midjourney key:")],-1)),Xpt={class:"flex flex-row"},Zpt=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"midjourney_timeout",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"request timeout(s):")],-1)),Jpt={class:"flex flex-row"},e_t=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"midjourney_retries",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"number of retries:")],-1)),t_t={class:"flex flex-row"},n_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"},s_t=L(()=>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)),i_t={class:"flex flex-row"},r_t=L(()=>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)),o_t={class:"flex flex-row"},a_t=L(()=>c("option",null," dall-e-2 ",-1)),l_t=L(()=>c("option",null," dall-e-3 ",-1)),c_t=[a_t,l_t],d_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"},u_t=L(()=>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)),p_t={class:"flex flex-row"},__t=L(()=>c("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),h_t=[__t],f_t=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"comfyui_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Available models (only if local):")],-1)),m_t={class:"flex flex-row"},g_t=["value"],b_t=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"comfyui_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable comfyui model:")],-1)),E_t={class:"flex flex-row"},y_t=L(()=>c("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),v_t=[y_t],S_t=L(()=>c("td",{style:{"min-width":"200px"}},null,-1)),T_t={class:"flex flex-row"},x_t=L(()=>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)),C_t=L(()=>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)),w_t={class:"flex flex-row"},R_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"},A_t=L(()=>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)),N_t={class:"flex flex-row"},O_t=L(()=>c("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),I_t=[O_t],M_t=L(()=>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)),D_t={class:"flex flex-row"},k_t=L(()=>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)),L_t={class:"flex flex-row"},P_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"},U_t=L(()=>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)),F_t={class:"flex flex-row"},B_t=L(()=>c("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),G_t=[B_t],V_t=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"vllm_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install vLLM service:")],-1)),z_t={class:"flex flex-row"},H_t=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"vllm_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"vllm base url:")],-1)),q_t={class:"flex flex-row"},Y_t=L(()=>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)),$_t={class:"flex flex-col align-bottom"},W_t={class:"relative"},K_t=L(()=>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)),j_t={class:"absolute right-0"},Q_t=L(()=>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)),X_t={class:"flex flex-row"},Z_t=L(()=>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)),J_t={class:"flex flex-row"},eht=L(()=>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)),tht={class:"flex flex-row"},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"},sht=L(()=>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)),iht={class:"flex flex-row"},rht=L(()=>c("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),oht=[rht],aht=L(()=>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)),lht={class:"flex flex-row"},cht=L(()=>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)),dht={class:"flex flex-row"},uht={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"},pht=L(()=>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)),_ht={class:"flex flex-row"},hht=L(()=>c("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),fht=[hht],mht=L(()=>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)),ght={class:"flex flex-row"},bht=L(()=>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)),Eht={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"},vht=L(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"elastic_search_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable elastic search service:")],-1)),Sht={class:"flex flex-row"},Tht=L(()=>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)),xht={class:"flex flex-row"},Cht=L(()=>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)),wht={class:"flex flex-row"},Rht={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"},Aht={class:"flex flex-row p-3"},Nht=L(()=>c("i",{"data-feather":"chevron-right"},null,-1)),Oht=[Nht],Iht=L(()=>c("i",{"data-feather":"chevron-down"},null,-1)),Mht=[Iht],Dht=L(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Binding zoo",-1)),kht={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},Lht=L(()=>c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),Pht={key:1,class:"mr-2"},Uht={key:2,class:"text-base font-semibold cursor-pointer select-none items-center"},Fht={class:"flex gap-1 items-center"},Bht=["src"],Ght={class:"font-bold font-large text-lg line-clamp-1"},Vht={key:0,class:"mb-2"},zht={for:"binding",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},Hht=L(()=>c("i",{"data-feather":"chevron-up"},null,-1)),qht=[Hht],Yht=L(()=>c("i",{"data-feather":"chevron-down"},null,-1)),$ht=[Yht],Wht={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"},Kht={class:"flex flex-row p-3"},jht=L(()=>c("i",{"data-feather":"chevron-right"},null,-1)),Qht=[jht],Xht=L(()=>c("i",{"data-feather":"chevron-down"},null,-1)),Zht=[Xht],Jht=L(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Models zoo",-1)),eft={class:"flex flex-row items-center"},tft={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},nft=L(()=>c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),sft={key:1,class:"text-base text-red-600 flex gap-3 items-center mr-2"},ift=L(()=>c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),rft={key:2,class:"mr-2"},oft={key:3,class:"text-base font-semibold cursor-pointer select-none items-center"},aft={class:"flex gap-1 items-center"},lft=["src"],cft={class:"font-bold font-large text-lg line-clamp-1"},dft={class:"mx-2 mb-4"},uft={class:"relative"},pft={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},_ft={key:0},hft=L(()=>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)),fft=[hft],mft={key:1},gft=L(()=>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)),bft=[gft],Eft=L(()=>c("label",{for:"only_installed"},"Show only installed models",-1)),yft=L(()=>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)),vft={key:0,role:"status",class:"text-center w-full display: flex;align-items: center;"},Sft=L(()=>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)),Tft=L(()=>c("p",{class:"heartbeat-text"},"Loading models Zoo",-1)),xft=[Sft,Tft],Cft={key:1,class:"mb-2"},wft={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},Rft=L(()=>c("i",{"data-feather":"chevron-up"},null,-1)),Aft=[Rft],Nft=L(()=>c("i",{"data-feather":"chevron-down"},null,-1)),Oft=[Nft],Ift={class:"mb-2"},Mft={class:"p-2"},Dft={class:"mb-3"},kft=L(()=>c("label",{class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},"Create a reference from local file path:",-1)),Lft={key:0},Pft={class:"mb-3"},Uft=L(()=>c("label",{class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},"Download from web:",-1)),Fft={key:1,class:"relative flex flex-col items-center justify-center flex-grow h-full"},Bft=L(()=>c("div",{role:"status",class:"justify-center"},null,-1)),Gft={class:"relative flex flex-row flex-grow items-center w-full h-full bottom-0"},Vft={class:"w-full p-2"},zft={class:"flex justify-between mb-1"},Hft=gu(' Downloading Loading...',1),qft={class:"text-sm font-medium text-blue-700 dark:text-white"},Yft=["title"],$ft={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},Wft={class:"flex justify-between mb-1"},Kft={class:"text-base font-medium text-blue-700 dark:text-white"},jft={class:"text-sm font-medium text-blue-700 dark:text-white"},Qft={class:"flex flex-grow"},Xft={class:"flex flex-row flex-grow gap-3"},Zft={class:"p-2 text-center grow"},Jft={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"},emt={class:"flex flex-row p-3 items-center"},tmt=L(()=>c("i",{"data-feather":"chevron-right"},null,-1)),nmt=[tmt],smt=L(()=>c("i",{"data-feather":"chevron-down"},null,-1)),imt=[smt],rmt=L(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Personalities zoo",-1)),omt={key:0,class:"mr-2"},amt={class:"mr-2 font-bold font-large text-lg line-clamp-1"},lmt={key:1,class:"mr-2"},cmt={key:2,class:"text-base font-semibold cursor-pointer select-none items-center flex flex-row"},dmt={key:0,class:"flex -space-x-4 items-center"},umt={class:"group items-center flex flex-row"},pmt=["onClick"],_mt=["src","title"],hmt=["onClick"],fmt=L(()=>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)),mmt=[fmt],gmt=L(()=>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)),bmt=[gmt],Emt={class:"mx-2 mb-4"},ymt=L(()=>c("label",{for:"personality-search",class:"mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white"},"Search",-1)),vmt={class:"relative"},Smt={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},Tmt={key:0},xmt=L(()=>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)),Cmt=[xmt],wmt={key:1},Rmt=L(()=>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)),Amt=[Rmt],Nmt={key:0,class:"mx-2 mb-4"},Omt={for:"persCat",class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},Imt=["selected"],Mmt={key:0,class:"mb-2"},Dmt={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},kmt=L(()=>c("i",{"data-feather":"chevron-up"},null,-1)),Lmt=[kmt],Pmt=L(()=>c("i",{"data-feather":"chevron-down"},null,-1)),Umt=[Pmt],Fmt={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"},Bmt={class:"flex flex-row"},Gmt=L(()=>c("i",{"data-feather":"chevron-right"},null,-1)),Vmt=[Gmt],zmt=L(()=>c("i",{"data-feather":"chevron-down"},null,-1)),Hmt=[zmt],qmt=L(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none"}," Model Configuration",-1)),Ymt={class:"m-2"},$mt={class:"flex flex-row gap-2 items-center"},Wmt=L(()=>c("label",{for:"override-model-parameters",class:"block text-sm font-medium"}," Override personality model parameters ",-1)),Kmt={class:"m-2"},jmt=L(()=>c("label",{for:"seed",class:"block mb-2 text-sm font-medium"}," Seed: ",-1)),Qmt={class:"m-2"},Xmt={class:"flex flex-col align-bottom"},Zmt={class:"relative"},Jmt=L(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"temperature",class:"text-sm font-medium"}," Temperature: ")],-1)),egt={class:"absolute right-0"},tgt={class:"m-2"},ngt={class:"flex flex-col align-bottom"},sgt={class:"relative"},igt=L(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"predict",class:"text-sm font-medium"}," N Predict: ")],-1)),rgt={class:"absolute right-0"},ogt={class:"m-2"},agt={class:"flex flex-col align-bottom"},lgt={class:"relative"},cgt=L(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"top_k",class:"text-sm font-medium"}," Top-K: ")],-1)),dgt={class:"absolute right-0"},ugt={class:"m-2"},pgt={class:"flex flex-col align-bottom"},_gt={class:"relative"},hgt=L(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"top_p",class:"text-sm font-medium"}," Top-P: ")],-1)),fgt={class:"absolute right-0"},mgt={class:"m-2"},ggt={class:"flex flex-col align-bottom"},bgt={class:"relative"},Egt=L(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"repeat_penalty",class:"text-sm font-medium"}," Repeat penalty: ")],-1)),ygt={class:"absolute right-0"},vgt={class:"m-2"},Sgt={class:"flex flex-col align-bottom"},Tgt={class:"relative"},xgt=L(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"repeat_last_n",class:"text-sm font-medium"}," Repeat last N: ")],-1)),Cgt={class:"absolute right-0"};function wgt(n,e,t,s,i,r){const o=dt("Card"),a=dt("BindingEntry"),l=dt("RadioOptions"),u=dt("model-entry"),d=dt("personality-entry"),h=dt("AddModelDialog"),f=dt("ChoiceDialog");return C(),R(ze,null,[c("div",Dit,[c("div",kit,[i.showConfirmation?(C(),R("div",Lit,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel",type:"button",onClick:e[0]||(e[0]=ae(_=>i.showConfirmation=!1,["stop"]))},Uit),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm save changes",type:"button",onClick:e[1]||(e[1]=ae(_=>r.save_configuration(),["stop"]))},Bit)])):G("",!0),i.showConfirmation?G("",!0):(C(),R("div",Git,[c("button",{title:"Reset configuration",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[2]||(e[2]=_=>r.reset_configuration())},zit),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]=ae(_=>i.all_collapsed=!i.all_collapsed,["stop"]))},qit)])),c("div",Yit,[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)}))},Wit),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)}))},jit),i.has_updates?(C(),R("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)}))},[Qit,Xit,Xe(" = ")])):G("",!0),c("div",Zit,[i.settingsChanged?(C(),R("div",Jit,[i.isLoading?G("",!0):(C(),R("button",{key:0,class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Apply changes",type:"button",onClick:e[7]||(e[7]=ae(_=>r.applyConfiguration(),["stop"]))},trt)),i.isLoading?G("",!0):(C(),R("button",{key:1,class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Cancel changes",type:"button",onClick:e[8]||(e[8]=ae(_=>r.cancelConfiguration(),["stop"]))},srt))])):G("",!0),i.isLoading?(C(),R("div",irt,[c("p",null,se(i.loading_text),1),rrt,ort])):G("",!0)])])]),c("div",{class:Fe(i.isLoading?"pointer-events-none opacity-30 w-full":"w-full")},[c("div",art,[c("div",lrt,[c("button",{onClick:e[9]||(e[9]=ae(_=>i.sc_collapsed=!i.sc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[B(c("div",null,drt,512),[[Ot,i.sc_collapsed]]),B(c("div",null,prt,512),[[Ot,!i.sc_collapsed]]),_rt,hrt,c("div",frt,[c("div",mrt,[c("div",null,[r.vramUsage&&r.vramUsage.gpus&&r.vramUsage.gpus.length==1?(C(),R("div",grt,[(C(!0),R(ze,null,st(r.vramUsage.gpus,_=>(C(),R("div",{class:"flex gap-2 items-center",key:_},[c("img",{src:i.SVGGPU,width:"25",height:"25"},null,8,brt),c("h3",Ert,[c("div",null,se(r.computedFileSize(_.used_vram))+" / "+se(r.computedFileSize(_.total_vram))+" ("+se(_.percentage)+"%) ",1)])]))),128))])):G("",!0),r.vramUsage&&r.vramUsage.gpus&&r.vramUsage.gpus.length>1?(C(),R("div",yrt,[c("div",vrt,[c("img",{src:i.SVGGPU,width:"25",height:"25"},null,8,Srt),c("h3",Trt,[c("div",null,se(r.vramUsage.gpus.length)+"x ",1)])])])):G("",!0)]),xrt,c("h3",Crt,[c("div",null,se(r.ram_usage)+" / "+se(r.ram_total_space)+" ("+se(r.ram_percent_usage)+"%)",1)]),wrt,c("h3",Rrt,[c("div",null,se(r.disk_binding_models_usage)+" / "+se(r.disk_total_space)+" ("+se(r.disk_percent_usage)+"%)",1)])])])])]),c("div",{class:Fe([{hidden:i.sc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",Art,[Nrt,c("div",Ort,[c("div",null,[Irt,Xe(se(r.ram_available_space),1)]),c("div",null,[Mrt,Xe(" "+se(r.ram_usage)+" / "+se(r.ram_total_space)+" ("+se(r.ram_percent_usage)+")% ",1)])]),c("div",Drt,[c("div",krt,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:jt("width: "+r.ram_percent_usage+"%;")},null,4)])])]),c("div",Lrt,[Prt,c("div",Urt,[c("div",null,[Frt,Xe(se(r.disk_available_space),1)]),c("div",null,[Brt,Xe(" "+se(r.disk_binding_models_usage)+" / "+se(r.disk_total_space)+" ("+se(r.disk_percent_usage)+"%)",1)])]),c("div",Grt,[c("div",Vrt,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:jt("width: "+r.disk_percent_usage+"%;")},null,4)])])]),(C(!0),R(ze,null,st(r.vramUsage.gpus,_=>(C(),R("div",{class:"mb-2",key:_},[c("label",zrt,[c("img",{src:i.SVGGPU,width:"25",height:"25"},null,8,Hrt),Xe(" GPU usage: ")]),c("div",qrt,[c("div",null,[Yrt,Xe(se(_.gpu_model),1)]),c("div",null,[$rt,Xe(se(this.computedFileSize(_.available_space)),1)]),c("div",null,[Wrt,Xe(" "+se(this.computedFileSize(_.used_vram))+" / "+se(this.computedFileSize(_.total_vram))+" ("+se(_.percentage)+"%)",1)])]),c("div",Krt,[c("div",jrt,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:jt("width: "+_.percentage+"%;")},null,4)])])]))),128))],2)]),c("div",Qrt,[c("div",Xrt,[c("button",{onClick:e[10]||(e[10]=ae(_=>i.minconf_collapsed=!i.minconf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[B(c("div",null,Jrt,512),[[Ot,i.minconf_collapsed]]),B(c("div",null,tot,512),[[Ot,!i.minconf_collapsed]]),not])]),c("div",{class:Fe([{hidden:i.minconf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",sot,[_e(o,{title:"General",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",iot,[c("tr",null,[rot,c("td",null,[c("label",oot,[c("img",{src:r.configFile.app_custom_logo!=null&&r.configFile.app_custom_logo!=""?"/user_infos/"+r.configFile.app_custom_logo:i.storeLogo,class:"w-50 h-50 rounded-full",style:{"max-width":"50px","max-height":"50px",cursor:"pointer"}},null,8,aot)]),c("input",{type:"file",id:"logo-upload",style:{display:"none"},onChange:e[11]||(e[11]=(..._)=>r.uploadLogo&&r.uploadLogo(..._))},null,32)]),c("td",lot,[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]=ae(_=>r.resetLogo(),["stop"]))},dot)])]),c("tr",null,[uot,c("td",pot,[c("div",_ot,[B(c("select",{id:"hardware_mode",required:"","onUpdate:modelValue":e[13]||(e[13]=_=>r.configFile.hardware_mode=_),onChange:e[14]||(e[14]=_=>i.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},Sot,544),[[qt,r.configFile.hardware_mode]])])])]),c("tr",null,[Tot,c("td",xot,[B(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]=_=>i.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),[[he,r.configFile.discussion_db_name]])])]),c("tr",null,[Cot,c("td",null,[c("div",wot,[B(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]=_=>i.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.copy_to_clipboard_add_all_details]])])])]),c("tr",null,[Rot,c("td",null,[c("div",Aot,[B(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]=_=>i.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.auto_show_browser]])])])]),c("tr",null,[Not,c("td",null,[c("div",Oot,[B(c("input",{type:"checkbox",id:"activate_debug",required:"","onUpdate:modelValue":e[21]||(e[21]=_=>r.configFile.debug=_),onChange:e[22]||(e[22]=_=>i.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.debug]])])])]),c("tr",null,[Iot,c("td",null,[c("div",Mot,[B(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]=_=>i.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.debug_show_final_full_prompt]])])])]),c("tr",null,[Dot,c("td",null,[c("div",kot,[B(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]=_=>i.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.debug_show_chunks]])])])]),c("tr",null,[Lot,c("td",null,[c("div",Pot,[B(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]=_=>i.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.debug_log_file_path]])])])]),c("tr",null,[Uot,c("td",null,[c("div",Fot,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.show_news_panel]])])])]),c("tr",null,[Bot,c("td",null,[c("div",Got,[B(c("input",{type:"checkbox",id:"auto_save",required:"","onUpdate:modelValue":e[31]||(e[31]=_=>r.configFile.auto_save=_),onChange:e[32]||(e[32]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.auto_save]])])])]),c("tr",null,[Vot,c("td",null,[c("div",zot,[B(c("input",{type:"checkbox",id:"auto_update",required:"","onUpdate:modelValue":e[33]||(e[33]=_=>r.configFile.auto_update=_),onChange:e[34]||(e[34]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.auto_update]])])])]),c("tr",null,[Hot,c("td",null,[c("div",qot,[B(c("input",{type:"checkbox",id:"auto_title",required:"","onUpdate:modelValue":e[35]||(e[35]=_=>r.configFile.auto_title=_),onChange:e[36]||(e[36]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.auto_title]])])])])])]),_:1}),_e(o,{title:"Model template",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",Yot,[c("tr",null,[$ot,c("td",null,[c("select",{onChange:e[37]||(e[37]=(..._)=>r.handleTemplateSelection&&r.handleTemplateSelection(..._))},Zot,32)])]),c("tr",null,[Jot,c("td",null,[B(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]=_=>i.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),[[he,r.configFile.start_header_id_template]])])]),c("tr",null,[eat,c("td",null,[B(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]=_=>i.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),[[he,r.configFile.end_header_id_template]])])]),c("tr",null,[tat,c("td",null,[B(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]=_=>i.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),[[he,r.configFile.start_user_header_id_template]])])]),c("tr",null,[nat,c("td",null,[B(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]=_=>i.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),[[he,r.configFile.end_user_header_id_template]])])]),c("tr",null,[sat,c("td",null,[B(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]=_=>i.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),[[he,r.configFile.end_user_message_id_template]])])]),c("tr",null,[iat,c("td",null,[B(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]=_=>i.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),[[he,r.configFile.start_ai_header_id_template]])])]),c("tr",null,[rat,c("td",null,[B(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]=_=>i.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),[[he,r.configFile.end_ai_header_id_template]])])]),c("tr",null,[oat,c("td",null,[B(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]=_=>i.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),[[he,r.configFile.end_ai_message_id_template]])])]),c("tr",null,[aat,c("td",null,[B(c("textarea",{id:"separator_template",required:"","onUpdate:modelValue":e[54]||(e[54]=_=>r.configFile.separator_template=_),onChange:e[55]||(e[55]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.separator_template]])])]),c("tr",null,[lat,c("td",null,[B(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]=_=>i.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),[[he,r.configFile.system_message_template]])])]),c("tr",null,[cat,c("td",null,[c("div",{innerHTML:r.full_template},null,8,dat)])]),c("tr",null,[uat,c("td",pat,[B(c("input",{type:"checkbox",id:"use_continue_message",required:"","onUpdate:modelValue":e[58]||(e[58]=_=>r.configFile.use_continue_message=_),onChange:e[59]||(e[59]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.use_continue_message]])])])])]),_:1}),_e(o,{title:"User",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",_at,[c("tr",null,[hat,c("td",fat,[B(c("input",{type:"text",id:"user_name",required:"","onUpdate:modelValue":e[60]||(e[60]=_=>r.configFile.user_name=_),onChange:e[61]||(e[61]=_=>i.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.user_name]])])]),c("tr",null,[mat,c("td",gat,[B(c("textarea",{id:"user_description",required:"","onUpdate:modelValue":e[62]||(e[62]=_=>r.configFile.user_description=_),onChange:e[63]||(e[63]=_=>i.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),[[he,r.configFile.user_description]])])]),c("tr",null,[bat,c("td",Eat,[B(c("input",{type:"checkbox",id:"use_user_informations_in_discussion",required:"","onUpdate:modelValue":e[64]||(e[64]=_=>r.configFile.use_user_informations_in_discussion=_),onChange:e[65]||(e[65]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.use_user_informations_in_discussion]])])]),c("tr",null,[yat,c("td",vat,[B(c("input",{type:"checkbox",id:"use_model_name_in_discussions",required:"","onUpdate:modelValue":e[66]||(e[66]=_=>r.configFile.use_model_name_in_discussions=_),onChange:e[67]||(e[67]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.use_model_name_in_discussions]])])]),c("tr",null,[Sat,c("td",null,[c("label",Tat,[c("img",{src:r.configFile.user_avatar!=null&&r.configFile.user_avatar!=""?"/user_infos/"+r.configFile.user_avatar:i.storeLogo,class:"w-50 h-50 rounded-full",style:{"max-width":"50px","max-height":"50px",cursor:"pointer"}},null,8,xat)]),c("input",{type:"file",id:"avatar-upload",style:{display:"none"},onChange:e[68]||(e[68]=(..._)=>r.uploadAvatar&&r.uploadAvatar(..._))},null,32)]),c("td",Cat,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Discard title changes",type:"button",onClick:e[69]||(e[69]=ae(_=>r.resetAvatar(),["stop"]))},Rat)])]),c("tr",null,[Aat,c("td",null,[c("div",Nat,[B(c("input",{type:"checkbox",id:"use_user_name_in_discussions",required:"","onUpdate:modelValue":e[70]||(e[70]=_=>r.configFile.use_user_name_in_discussions=_),onChange:e[71]||(e[71]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.use_user_name_in_discussions]])])])]),c("tr",null,[Oat,c("td",Iat,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.max_n_predict]])])]),c("tr",null,[Mat,c("td",Dat,[B(c("input",{type:"number",id:"max_n_predict",required:"","onUpdate:modelValue":e[74]||(e[74]=_=>r.configFile.max_n_predict=_),onChange:e[75]||(e[75]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.max_n_predict]])])])])]),_:1}),_e(o,{title:"Security settings",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",kat,[c("tr",null,[Lat,c("td",Pat,[B(c("input",{type:"checkbox",id:"turn_on_code_execution",required:"","onUpdate:modelValue":e[76]||(e[76]=_=>r.configFile.turn_on_code_execution=_),onChange:e[77]||(e[77]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.turn_on_code_execution]])])]),c("tr",null,[Uat,c("td",Fat,[B(c("input",{type:"checkbox",id:"turn_on_code_validation",required:"","onUpdate:modelValue":e[78]||(e[78]=_=>r.configFile.turn_on_code_validation=_),onChange:e[79]||(e[79]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.turn_on_code_validation]])])]),c("tr",null,[Bat,c("td",Gat,[B(c("input",{type:"checkbox",id:"turn_on_setting_update_validation",required:"","onUpdate:modelValue":e[80]||(e[80]=_=>r.configFile.turn_on_setting_update_validation=_),onChange:e[81]||(e[81]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.turn_on_setting_update_validation]])])]),c("tr",null,[Vat,c("td",zat,[B(c("input",{type:"checkbox",id:"turn_on_open_file_validation",required:"","onUpdate:modelValue":e[82]||(e[82]=_=>r.configFile.turn_on_open_file_validation=_),onChange:e[83]||(e[83]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.turn_on_open_file_validation]])])]),c("tr",null,[Hat,c("td",qat,[B(c("input",{type:"checkbox",id:"turn_on_send_file_validation",required:"","onUpdate:modelValue":e[84]||(e[84]=_=>r.configFile.turn_on_send_file_validation=_),onChange:e[85]||(e[85]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.turn_on_send_file_validation]])])])])]),_:1}),_e(o,{title:"Knowledge database",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",Yat,[c("tr",null,[$at,c("td",null,[c("div",Wat,[B(c("input",{type:"checkbox",id:"activate_skills_lib",required:"","onUpdate:modelValue":e[86]||(e[86]=_=>r.configFile.activate_skills_lib=_),onChange:e[87]||(e[87]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.activate_skills_lib]])])])]),c("tr",null,[Kat,c("td",jat,[B(c("input",{type:"text",id:"skills_lib_database_name",required:"","onUpdate:modelValue":e[88]||(e[88]=_=>r.configFile.skills_lib_database_name=_),onChange:e[89]||(e[89]=_=>i.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),[[he,r.configFile.skills_lib_database_name]])])])])]),_:1}),_e(o,{title:"Latex",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",Qat,[c("tr",null,[Xat,c("td",null,[c("div",Zat,[B(c("input",{type:"text",id:"pdf_latex_path",required:"","onUpdate:modelValue":e[90]||(e[90]=_=>r.configFile.pdf_latex_path=_),onChange:e[91]||(e[91]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.pdf_latex_path]])])])])])]),_:1}),_e(o,{title:"Boost",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",Jat,[c("tr",null,[elt,c("td",null,[c("div",tlt,[B(c("input",{type:"text",id:"positive_boost",required:"","onUpdate:modelValue":e[92]||(e[92]=_=>r.configFile.positive_boost=_),onChange:e[93]||(e[93]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.positive_boost]])])])]),c("tr",null,[nlt,c("td",null,[c("div",slt,[B(c("input",{type:"text",id:"negative_boost",required:"","onUpdate:modelValue":e[94]||(e[94]=_=>r.configFile.negative_boost=_),onChange:e[95]||(e[95]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.negative_boost]])])])]),c("tr",null,[ilt,c("td",null,[c("div",rlt,[B(c("input",{type:"checkbox",id:"fun_mode",required:"","onUpdate:modelValue":e[96]||(e[96]=_=>r.configFile.fun_mode=_),onChange:e[97]||(e[97]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.fun_mode]])])])])])]),_:1})])],2)]),c("div",olt,[c("div",alt,[c("button",{onClick:e[98]||(e[98]=ae(_=>i.data_conf_collapsed=!i.data_conf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[B(c("div",null,clt,512),[[Ot,i.data_conf_collapsed]]),B(c("div",null,ult,512),[[Ot,!i.data_conf_collapsed]]),plt])]),c("div",{class:Fe([{hidden:i.data_conf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[_e(o,{title:"Data Sources",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",_lt,[c("tr",null,[hlt,c("td",flt,[(C(!0),R(ze,null,st(r.configFile.rag_databases,(_,m)=>(C(),R("div",{key:m,class:"flex items-center mb-2"},[B(c("input",{type:"text","onUpdate:modelValue":E=>r.configFile.rag_databases[m]=E,onChange:e[99]||(e[99]=E=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,40,mlt),[[he,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,glt),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,blt),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,Elt)]))),128)),c("button",{onClick:e[100]||(e[100]=(..._)=>r.addDataSource&&r.addDataSource(..._)),class:"mt-2 px-2 py-1 bg-blue-500 text-white rounded"},"Add Data Source")])]),c("tr",null,[ylt,c("td",null,[B(c("select",{id:"rag_vectorizer",required:"","onUpdate:modelValue":e[101]||(e[101]=_=>r.configFile.rag_vectorizer=_),onChange:e[102]||(e[102]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},xlt,544),[[qt,r.configFile.rag_vectorizer]])])]),c("tr",null,[Clt,c("td",null,[B(c("select",{id:"rag_vectorizer_model",required:"","onUpdate:modelValue":e[103]||(e[103]=_=>r.configFile.rag_vectorizer_model=_),onChange:e[104]||(e[104]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},Rlt,544),[[qt,r.configFile.rag_vectorizer_model]])])]),c("tr",null,[Alt,c("td",null,[B(c("input",{id:"rag_chunk_size","onUpdate:modelValue":e[105]||(e[105]=_=>r.configFile.rag_chunk_size=_),onChange:e[106]||(e[106]=_=>i.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),[[he,r.configFile.rag_chunk_size]]),B(c("input",{"onUpdate:modelValue":e[107]||(e[107]=_=>r.configFile.rag_chunk_size=_),type:"number",onChange:e[108]||(e[108]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.rag_chunk_size]])])]),c("tr",null,[Nlt,c("td",null,[B(c("input",{id:"rag_overlap","onUpdate:modelValue":e[109]||(e[109]=_=>r.configFile.rag_overlap=_),onChange:e[110]||(e[110]=_=>i.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),[[he,r.configFile.rag_overlap]]),B(c("input",{"onUpdate:modelValue":e[111]||(e[111]=_=>r.configFile.rag_overlap=_),type:"number",onChange:e[112]||(e[112]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.rag_overlap]])])]),c("tr",null,[Olt,c("td",null,[B(c("input",{id:"rag_n_chunks","onUpdate:modelValue":e[113]||(e[113]=_=>r.configFile.rag_n_chunks=_),onChange:e[114]||(e[114]=_=>i.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),[[he,r.configFile.rag_n_chunks]]),B(c("input",{"onUpdate:modelValue":e[115]||(e[115]=_=>r.configFile.rag_n_chunks=_),type:"number",onChange:e[116]||(e[116]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.rag_n_chunks]])])]),c("tr",null,[Ilt,c("td",null,[B(c("input",{"onUpdate:modelValue":e[117]||(e[117]=_=>r.configFile.rag_clean_chunks=_),type:"checkbox",onChange:e[118]||(e[118]=_=>i.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.rag_clean_chunks]])])]),c("tr",null,[Mlt,c("td",null,[B(c("input",{"onUpdate:modelValue":e[119]||(e[119]=_=>r.configFile.rag_follow_subfolders=_),type:"checkbox",onChange:e[120]||(e[120]=_=>i.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.rag_follow_subfolders]])])]),c("tr",null,[Dlt,c("td",null,[B(c("input",{"onUpdate:modelValue":e[121]||(e[121]=_=>r.configFile.rag_check_new_files_at_startup=_),type:"checkbox",onChange:e[122]||(e[122]=_=>i.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.rag_check_new_files_at_startup]])])]),c("tr",null,[klt,c("td",null,[B(c("input",{"onUpdate:modelValue":e[123]||(e[123]=_=>r.configFile.rag_preprocess_chunks=_),type:"checkbox",onChange:e[124]||(e[124]=_=>i.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.rag_preprocess_chunks]])])]),c("tr",null,[Llt,c("td",null,[B(c("input",{"onUpdate:modelValue":e[125]||(e[125]=_=>r.configFile.rag_activate_multi_hops=_),type:"checkbox",onChange:e[126]||(e[126]=_=>i.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.rag_activate_multi_hops]])])]),c("tr",null,[Plt,c("td",null,[B(c("input",{"onUpdate:modelValue":e[127]||(e[127]=_=>r.configFile.contextual_summary=_),type:"checkbox",onChange:e[128]||(e[128]=_=>i.settingsChanged=!0),class:"w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.contextual_summary]])])])])]),_:1}),_e(o,{title:"Data Vectorization",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",Ult,[c("tr",null,[Flt,c("td",null,[c("div",Blt,[B(c("input",{type:"checkbox",id:"data_vectorization_save_db",required:"","onUpdate:modelValue":e[129]||(e[129]=_=>r.configFile.data_vectorization_save_db=_),onChange:e[130]||(e[130]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.data_vectorization_save_db]])])])]),c("tr",null,[Glt,c("td",null,[c("div",Vlt,[B(c("input",{type:"checkbox",id:"data_vectorization_visualize_on_vectorization",required:"","onUpdate:modelValue":e[131]||(e[131]=_=>r.configFile.data_vectorization_visualize_on_vectorization=_),onChange:e[132]||(e[132]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.data_vectorization_visualize_on_vectorization]])])])]),c("tr",null,[zlt,c("td",null,[c("div",Hlt,[B(c("input",{type:"checkbox",id:"data_vectorization_build_keys_words",required:"","onUpdate:modelValue":e[133]||(e[133]=_=>r.configFile.data_vectorization_build_keys_words=_),onChange:e[134]||(e[134]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.data_vectorization_build_keys_words]])])])]),c("tr",null,[qlt,c("td",null,[c("div",Ylt,[B(c("input",{type:"checkbox",id:"data_vectorization_force_first_chunk",required:"","onUpdate:modelValue":e[135]||(e[135]=_=>r.configFile.data_vectorization_force_first_chunk=_),onChange:e[136]||(e[136]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.data_vectorization_force_first_chunk]])])])]),c("tr",null,[$lt,c("td",null,[c("div",Wlt,[B(c("input",{type:"checkbox",id:"data_vectorization_put_chunk_informations_into_context",required:"","onUpdate:modelValue":e[137]||(e[137]=_=>r.configFile.data_vectorization_put_chunk_informations_into_context=_),onChange:e[138]||(e[138]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.data_vectorization_put_chunk_informations_into_context]])])])]),c("tr",null,[Klt,c("td",null,[B(c("select",{id:"data_vectorization_method",required:"","onUpdate:modelValue":e[139]||(e[139]=_=>r.configFile.data_vectorization_method=_),onChange:e[140]||(e[140]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},Jlt,544),[[qt,r.configFile.data_vectorization_method]])])]),c("tr",null,[ect,c("td",tct,[B(c("input",{type:"text",id:"data_vectorization_sentense_transformer_model",required:"","onUpdate:modelValue":e[141]||(e[141]=_=>r.configFile.data_vectorization_sentense_transformer_model=_),onChange:e[142]||(e[142]=_=>i.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),[[he,r.configFile.data_vectorization_sentense_transformer_model]])])]),c("tr",null,[nct,c("td",null,[B(c("select",{id:"data_visualization_method",required:"","onUpdate:modelValue":e[143]||(e[143]=_=>r.configFile.data_visualization_method=_),onChange:e[144]||(e[144]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},rct,544),[[qt,r.configFile.data_visualization_method]])])]),c("tr",null,[oct,c("td",null,[c("div",act,[B(c("input",{type:"checkbox",id:"data_vectorization_save_db",required:"","onUpdate:modelValue":e[145]||(e[145]=_=>r.configFile.data_vectorization_save_db=_),onChange:e[146]||(e[146]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.data_vectorization_save_db]])])])]),c("tr",null,[lct,c("td",null,[B(c("input",{id:"data_vectorization_chunk_size","onUpdate:modelValue":e[147]||(e[147]=_=>r.configFile.data_vectorization_chunk_size=_),onChange:e[148]||(e[148]=_=>i.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),[[he,r.configFile.data_vectorization_chunk_size]]),B(c("input",{"onUpdate:modelValue":e[149]||(e[149]=_=>r.configFile.data_vectorization_chunk_size=_),type:"number",onChange:e[150]||(e[150]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.data_vectorization_chunk_size]])])]),c("tr",null,[cct,c("td",null,[B(c("input",{id:"data_vectorization_overlap_size","onUpdate:modelValue":e[151]||(e[151]=_=>r.configFile.data_vectorization_overlap_size=_),onChange:e[152]||(e[152]=_=>i.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),[[he,r.configFile.data_vectorization_overlap_size]]),B(c("input",{"onUpdate:modelValue":e[153]||(e[153]=_=>r.configFile.data_vectorization_overlap_size=_),type:"number",onChange:e[154]||(e[154]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.data_vectorization_overlap_size]])])]),c("tr",null,[dct,c("td",null,[B(c("input",{id:"data_vectorization_nb_chunks","onUpdate:modelValue":e[155]||(e[155]=_=>r.configFile.data_vectorization_nb_chunks=_),onChange:e[156]||(e[156]=_=>i.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),[[he,r.configFile.data_vectorization_nb_chunks]]),B(c("input",{"onUpdate:modelValue":e[157]||(e[157]=_=>r.configFile.data_vectorization_nb_chunks=_),type:"number",onChange:e[158]||(e[158]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.data_vectorization_nb_chunks]])])])])]),_:1})],2)]),c("div",uct,[c("div",pct,[c("button",{onClick:e[159]||(e[159]=ae(_=>i.internet_conf_collapsed=!i.internet_conf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[B(c("div",null,hct,512),[[Ot,i.internet_conf_collapsed]]),B(c("div",null,mct,512),[[Ot,!i.internet_conf_collapsed]]),gct])]),c("div",{class:Fe([{hidden:i.internet_conf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[_e(o,{title:"Internet search",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",bct,[c("tr",null,[Ect,c("td",null,[c("div",yct,[B(c("input",{type:"checkbox",id:"fun_mode",required:"","onUpdate:modelValue":e[160]||(e[160]=_=>r.configFile.activate_internet_search=_),onChange:e[161]||(e[161]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.activate_internet_search]])])])]),c("tr",null,[vct,c("td",null,[c("div",Sct,[B(c("input",{type:"checkbox",id:"activate_internet_pages_judgement",required:"","onUpdate:modelValue":e[162]||(e[162]=_=>r.configFile.activate_internet_pages_judgement=_),onChange:e[163]||(e[163]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.activate_internet_pages_judgement]])])])]),c("tr",null,[Tct,c("td",null,[c("div",xct,[B(c("input",{type:"checkbox",id:"internet_quick_search",required:"","onUpdate:modelValue":e[164]||(e[164]=_=>r.configFile.internet_quick_search=_),onChange:e[165]||(e[165]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.internet_quick_search]])])])]),c("tr",null,[Cct,c("td",null,[c("div",wct,[B(c("input",{type:"checkbox",id:"internet_activate_search_decision",required:"","onUpdate:modelValue":e[166]||(e[166]=_=>r.configFile.internet_activate_search_decision=_),onChange:e[167]||(e[167]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.internet_activate_search_decision]])])])]),c("tr",null,[Rct,c("td",null,[c("div",Act,[B(c("input",{id:"internet_vectorization_chunk_size","onUpdate:modelValue":e[168]||(e[168]=_=>r.configFile.internet_vectorization_chunk_size=_),onChange:e[169]||(e[169]=_=>i.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),[[he,r.configFile.internet_vectorization_chunk_size]]),B(c("input",{"onUpdate:modelValue":e[170]||(e[170]=_=>r.configFile.internet_vectorization_chunk_size=_),type:"number",onChange:e[171]||(e[171]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.internet_vectorization_chunk_size]])])])]),c("tr",null,[Nct,c("td",null,[c("div",Oct,[B(c("input",{id:"internet_vectorization_overlap_size","onUpdate:modelValue":e[172]||(e[172]=_=>r.configFile.internet_vectorization_overlap_size=_),onChange:e[173]||(e[173]=_=>i.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),[[he,r.configFile.internet_vectorization_overlap_size]]),B(c("input",{"onUpdate:modelValue":e[174]||(e[174]=_=>r.configFile.internet_vectorization_overlap_size=_),type:"number",onChange:e[175]||(e[175]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.internet_vectorization_overlap_size]])])])]),c("tr",null,[Ict,c("td",null,[c("div",Mct,[B(c("input",{id:"internet_vectorization_nb_chunks","onUpdate:modelValue":e[176]||(e[176]=_=>r.configFile.internet_vectorization_nb_chunks=_),onChange:e[177]||(e[177]=_=>i.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),[[he,r.configFile.internet_vectorization_nb_chunks]]),B(c("input",{"onUpdate:modelValue":e[178]||(e[178]=_=>r.configFile.internet_vectorization_nb_chunks=_),type:"number",onChange:e[179]||(e[179]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.internet_vectorization_nb_chunks]])])])]),c("tr",null,[Dct,c("td",null,[c("div",kct,[B(c("input",{id:"internet_nb_search_pages","onUpdate:modelValue":e[180]||(e[180]=_=>r.configFile.internet_nb_search_pages=_),onChange:e[181]||(e[181]=_=>i.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),[[he,r.configFile.internet_nb_search_pages]]),B(c("input",{"onUpdate:modelValue":e[182]||(e[182]=_=>r.configFile.internet_nb_search_pages=_),type:"number",onChange:e[183]||(e[183]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.internet_nb_search_pages]])])])])])]),_:1})],2)]),c("div",Lct,[c("div",Pct,[c("button",{onClick:e[184]||(e[184]=ae(_=>i.servers_conf_collapsed=!i.servers_conf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[B(c("div",null,Fct,512),[[Ot,i.servers_conf_collapsed]]),B(c("div",null,Gct,512),[[Ot,!i.servers_conf_collapsed]]),Vct])]),c("div",{class:Fe([{hidden:i.servers_conf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[_e(o,{title:"Default services selection",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",zct,[c("tr",null,[Hct,c("td",qct,[B(c("select",{id:"active_tts_service",required:"","onUpdate:modelValue":e[185]||(e[185]=_=>r.configFile.active_tts_service=_),onChange:e[186]||(e[186]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},jct,544),[[qt,r.configFile.active_tts_service]])])]),c("tr",null,[Qct,c("td",Xct,[B(c("select",{id:"active_stt_service",required:"","onUpdate:modelValue":e[187]||(e[187]=_=>r.configFile.active_stt_service=_),onChange:e[188]||(e[188]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},tdt,544),[[qt,r.configFile.active_stt_service]])])]),ndt,c("tr",null,[sdt,c("td",idt,[B(c("select",{id:"active_tti_service",required:"","onUpdate:modelValue":e[189]||(e[189]=_=>r.configFile.active_tti_service=_),onChange:e[190]||(e[190]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},pdt,544),[[qt,r.configFile.active_tti_service]])])]),c("tr",null,[_dt,c("td",hdt,[B(c("select",{id:"active_ttm_service",required:"","onUpdate:modelValue":e[191]||(e[191]=_=>r.configFile.active_ttm_service=_),onChange:e[192]||(e[192]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},gdt,544),[[qt,r.configFile.active_ttm_service]])])])])]),_:1}),_e(o,{title:"TTI settings",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",bdt,[c("tr",null,[Edt,c("td",null,[c("div",ydt,[B(c("input",{type:"checkbox",id:"use_negative_prompt",required:"","onUpdate:modelValue":e[193]||(e[193]=_=>r.configFile.use_negative_prompt=_),onChange:e[194]||(e[194]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.use_negative_prompt]])])])]),c("tr",null,[vdt,c("td",null,[c("div",Sdt,[B(c("input",{type:"checkbox",id:"use_ai_generated_negative_prompt",required:"","onUpdate:modelValue":e[195]||(e[195]=_=>r.configFile.use_ai_generated_negative_prompt=_),onChange:e[196]||(e[196]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.use_ai_generated_negative_prompt]])])])]),c("tr",null,[Tdt,c("td",null,[c("div",xdt,[B(c("input",{type:"text",id:"negative_prompt_generation_prompt",required:"","onUpdate:modelValue":e[197]||(e[197]=_=>r.configFile.negative_prompt_generation_prompt=_),onChange:e[198]||(e[198]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.negative_prompt_generation_prompt]])])])]),c("tr",null,[Cdt,c("td",null,[c("div",wdt,[B(c("input",{type:"text",id:"default_negative_prompt",required:"","onUpdate:modelValue":e[199]||(e[199]=_=>r.configFile.default_negative_prompt=_),onChange:e[200]||(e[200]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.default_negative_prompt]])])])])])]),_:1}),_e(o,{title:"Full Audio settings",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",Rdt,[c("tr",null,[Adt,c("td",Ndt,[B(c("input",{type:"number",step:"1",id:"stt_listening_threshold",required:"","onUpdate:modelValue":e[201]||(e[201]=_=>r.configFile.stt_listening_threshold=_),onChange:e[202]||(e[202]=_=>i.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),[[he,r.configFile.stt_listening_threshold]])])]),c("tr",null,[Odt,c("td",Idt,[B(c("input",{type:"number",step:"1",id:"stt_silence_duration",required:"","onUpdate:modelValue":e[203]||(e[203]=_=>r.configFile.stt_silence_duration=_),onChange:e[204]||(e[204]=_=>i.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),[[he,r.configFile.stt_silence_duration]])])]),c("tr",null,[Mdt,c("td",Ddt,[B(c("input",{type:"number",step:"1",id:"stt_sound_threshold_percentage",required:"","onUpdate:modelValue":e[205]||(e[205]=_=>r.configFile.stt_sound_threshold_percentage=_),onChange:e[206]||(e[206]=_=>i.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),[[he,r.configFile.stt_sound_threshold_percentage]])])]),c("tr",null,[kdt,c("td",Ldt,[B(c("input",{type:"number",step:"1",id:"stt_gain",required:"","onUpdate:modelValue":e[207]||(e[207]=_=>r.configFile.stt_gain=_),onChange:e[208]||(e[208]=_=>i.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),[[he,r.configFile.stt_gain]])])]),c("tr",null,[Pdt,c("td",Udt,[B(c("input",{type:"number",step:"1",id:"stt_rate",required:"","onUpdate:modelValue":e[209]||(e[209]=_=>r.configFile.stt_rate=_),onChange:e[210]||(e[210]=_=>i.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),[[he,r.configFile.stt_rate]])])]),c("tr",null,[Fdt,c("td",Bdt,[B(c("input",{type:"number",step:"1",id:"stt_channels",required:"","onUpdate:modelValue":e[211]||(e[211]=_=>r.configFile.stt_channels=_),onChange:e[212]||(e[212]=_=>i.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),[[he,r.configFile.stt_channels]])])]),c("tr",null,[Gdt,c("td",Vdt,[B(c("input",{type:"number",step:"1",id:"stt_buffer_size",required:"","onUpdate:modelValue":e[213]||(e[213]=_=>r.configFile.stt_buffer_size=_),onChange:e[214]||(e[214]=_=>i.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),[[he,r.configFile.stt_buffer_size]])])]),c("tr",null,[zdt,c("td",null,[c("div",Hdt,[B(c("input",{type:"checkbox",id:"stt_activate_word_detection",required:"","onUpdate:modelValue":e[215]||(e[215]=_=>r.configFile.stt_activate_word_detection=_),onChange:e[216]||(e[216]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.stt_activate_word_detection]])])])]),c("tr",null,[qdt,c("td",null,[c("div",Ydt,[B(c("input",{type:"text",id:"stt_word_detection_file",required:"","onUpdate:modelValue":e[217]||(e[217]=_=>r.configFile.stt_word_detection_file=_),onChange:e[218]||(e[218]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.stt_word_detection_file]])])])])])]),_:1}),_e(o,{title:"Audio devices settings",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",$dt,[c("tr",null,[Wdt,c("td",Kdt,[B(c("select",{id:"stt_input_device",required:"","onUpdate:modelValue":e[219]||(e[219]=_=>r.configFile.stt_input_device=_),onChange:e[220]||(e[220]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(C(!0),R(ze,null,st(i.snd_input_devices,(_,m)=>(C(),R("option",{key:_,value:i.snd_input_devices_indexes[m]},se(_),9,jdt))),128))],544),[[qt,r.configFile.stt_input_device]])])]),c("tr",null,[Qdt,c("td",Xdt,[B(c("select",{id:"tts_output_device",required:"","onUpdate:modelValue":e[221]||(e[221]=_=>r.configFile.tts_output_device=_),onChange:e[222]||(e[222]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(C(!0),R(ze,null,st(i.snd_output_devices,(_,m)=>(C(),R("option",{key:_,value:i.snd_output_devices_indexes[m]},se(_),9,Zdt))),128))],544),[[qt,r.configFile.tts_output_device]])])])])]),_:1}),_e(o,{title:"Lollms service",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",Jdt,[c("tr",null,[eut,c("td",tut,[B(c("input",{type:"text",id:"host",required:"","onUpdate:modelValue":e[223]||(e[223]=_=>r.configFile.host=_),onChange:e[224]||(e[224]=_=>i.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),[[he,r.configFile.host]])])]),c("tr",null,[nut,c("td",sut,[B(c("input",{type:"text",id:"lollms_access_keys",required:"","onUpdate:modelValue":e[225]||(e[225]=_=>r.configFile.lollms_access_keys=_),onChange:e[226]||(e[226]=_=>i.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),[[he,r.configFile.lollms_access_keys]])])]),c("tr",null,[iut,c("td",rut,[B(c("input",{type:"number",step:"1",id:"port",required:"","onUpdate:modelValue":e[227]||(e[227]=_=>r.configFile.port=_),onChange:e[228]||(e[228]=_=>i.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),[[he,r.configFile.port]])])]),c("tr",null,[out,c("td",aut,[B(c("input",{type:"checkbox",id:"headless_server_mode",required:"","onUpdate:modelValue":e[229]||(e[229]=_=>r.configFile.headless_server_mode=_),onChange:e[230]||(e[230]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Ke,r.configFile.headless_server_mode]])])]),c("tr",null,[lut,c("td",cut,[B(c("input",{type:"checkbox",id:"activate_lollms_server",required:"","onUpdate:modelValue":e[231]||(e[231]=_=>r.configFile.activate_lollms_server=_),onChange:e[232]||(e[232]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Ke,r.configFile.activate_lollms_server]])])]),c("tr",null,[dut,c("td",uut,[B(c("input",{type:"checkbox",id:"activate_ollama_emulator",required:"","onUpdate:modelValue":e[233]||(e[233]=_=>r.configFile.activate_ollama_emulator=_),onChange:e[234]||(e[234]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Ke,r.configFile.activate_ollama_emulator]])])]),c("tr",null,[put,c("td",_ut,[B(c("input",{type:"checkbox",id:"activate_openai_emulator",required:"","onUpdate:modelValue":e[235]||(e[235]=_=>r.configFile.activate_openai_emulator=_),onChange:e[236]||(e[236]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Ke,r.configFile.activate_openai_emulator]])])]),c("tr",null,[hut,c("td",fut,[B(c("input",{type:"checkbox",id:"activate_mistralai_emulator",required:"","onUpdate:modelValue":e[237]||(e[237]=_=>r.configFile.activate_mistralai_emulator=_),onChange:e[238]||(e[238]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Ke,r.configFile.activate_mistralai_emulator]])])])])]),_:1}),_e(o,{title:"STT services",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[_e(o,{title:"Browser Audio STT",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",mut,[c("tr",null,[gut,c("td",null,[c("div",but,[B(c("input",{type:"checkbox",id:"activate_audio_infos",required:"","onUpdate:modelValue":e[239]||(e[239]=_=>r.configFile.activate_audio_infos=_),onChange:e[240]||(e[240]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.activate_audio_infos]])])])]),c("tr",null,[Eut,c("td",null,[c("div",yut,[B(c("input",{type:"checkbox",id:"audio_auto_send_input",required:"","onUpdate:modelValue":e[241]||(e[241]=_=>r.configFile.audio_auto_send_input=_),onChange:e[242]||(e[242]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.audio_auto_send_input]])])])]),c("tr",null,[vut,c("td",null,[B(c("input",{id:"audio_silenceTimer","onUpdate:modelValue":e[243]||(e[243]=_=>r.configFile.audio_silenceTimer=_),onChange:e[244]||(e[244]=_=>i.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),[[he,r.configFile.audio_silenceTimer]]),B(c("input",{"onUpdate:modelValue":e[245]||(e[245]=_=>r.configFile.audio_silenceTimer=_),onChange:e[246]||(e[246]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.audio_silenceTimer]])])]),c("tr",null,[Sut,c("td",null,[B(c("select",{id:"audio_in_language","onUpdate:modelValue":e[247]||(e[247]=_=>r.configFile.audio_in_language=_),onChange:e[248]||(e[248]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(C(!0),R(ze,null,st(r.audioLanguages,_=>(C(),R("option",{key:_.code,value:_.code},se(_.name),9,Tut))),128))],544),[[qt,r.configFile.audio_in_language]])])])])]),_:1}),_e(o,{title:"Whisper audio transcription",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",xut,[c("tr",null,[Cut,c("td",null,[c("div",wut,[B(c("input",{type:"checkbox",id:"whisper_activate",required:"","onUpdate:modelValue":e[249]||(e[249]=_=>r.configFile.whisper_activate=_),onChange:e[250]||(e[250]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.whisper_activate]])])])]),c("tr",null,[Rut,c("td",null,[c("div",Aut,[B(c("select",{id:"whisper_model","onUpdate:modelValue":e[251]||(e[251]=_=>r.configFile.whisper_model=_),onChange:e[252]||(e[252]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(C(!0),R(ze,null,st(r.whisperModels,_=>(C(),R("option",{key:_,value:_},se(_),9,Nut))),128))],544),[[qt,r.configFile.whisper_model]])])])])])]),_:1}),_e(o,{title:"Open AI Whisper audio transcription",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",Out,[c("tr",null,[Iut,c("td",null,[c("div",Mut,[B(c("input",{type:"text",id:"openai_whisper_key",required:"","onUpdate:modelValue":e[253]||(e[253]=_=>r.configFile.openai_whisper_key=_),onChange:e[254]||(e[254]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.openai_whisper_key]])])])]),c("tr",null,[Dut,c("td",null,[c("div",kut,[B(c("select",{id:"openai_whisper_model","onUpdate:modelValue":e[255]||(e[255]=_=>r.configFile.openai_whisper_model=_),onChange:e[256]||(e[256]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(C(!0),R(ze,null,st(r.openaiWhisperModels,_=>(C(),R("option",{key:_,value:_},se(_),9,Lut))),128))],544),[[qt,r.configFile.openai_whisper_model]])])])])])]),_:1})]),_:1}),_e(o,{title:"TTS services",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[_e(o,{title:"Browser Audio TTS",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",Put,[c("tr",null,[Uut,c("td",null,[c("div",Fut,[B(c("input",{type:"checkbox",id:"auto_speak",required:"","onUpdate:modelValue":e[257]||(e[257]=_=>r.configFile.auto_speak=_),onChange:e[258]||(e[258]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.auto_speak]])])])]),c("tr",null,[But,c("td",null,[B(c("input",{id:"audio_pitch","onUpdate:modelValue":e[259]||(e[259]=_=>r.configFile.audio_pitch=_),onChange:e[260]||(e[260]=_=>i.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),[[he,r.configFile.audio_pitch]]),B(c("input",{"onUpdate:modelValue":e[261]||(e[261]=_=>r.configFile.audio_pitch=_),onChange:e[262]||(e[262]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.audio_pitch]])])]),c("tr",null,[Gut,c("td",null,[B(c("select",{id:"audio_out_voice","onUpdate:modelValue":e[263]||(e[263]=_=>r.configFile.audio_out_voice=_),onChange:e[264]||(e[264]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(C(!0),R(ze,null,st(i.audioVoices,_=>(C(),R("option",{key:_.name,value:_.name},se(_.name),9,Vut))),128))],544),[[qt,r.configFile.audio_out_voice]])])])])]),_:1}),_e(o,{title:"XTTS service",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",zut,[c("tr",null,[Hut,c("td",null,[c("div",qut,[B(c("select",{"onUpdate:modelValue":e[265]||(e[265]=_=>r.xtts_current_language=_),onChange:e[266]||(e[266]=_=>i.settingsChanged=!0)},[(C(!0),R(ze,null,st(i.voice_languages,(_,m)=>(C(),R("option",{key:m,value:_},se(m),9,Yut))),128))],544),[[qt,r.xtts_current_language]])])])]),c("tr",null,[$ut,c("td",null,[c("div",Wut,[B(c("select",{"onUpdate:modelValue":e[267]||(e[267]=_=>r.xtts_current_voice=_),onChange:e[268]||(e[268]=_=>i.settingsChanged=!0)},[(C(!0),R(ze,null,st(i.voices,_=>(C(),R("option",{key:_,value:_},se(_),9,Kut))),128))],544),[[qt,r.xtts_current_voice]])])])]),c("tr",null,[jut,c("td",null,[c("div",Qut,[B(c("input",{type:"number",id:"xtts_freq",required:"","onUpdate:modelValue":e[269]||(e[269]=_=>r.configFile.xtts_freq=_),onChange:e[270]||(e[270]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",step:"0.01"},null,544),[[he,r.configFile.xtts_freq,void 0,{number:!0}]])])])]),c("tr",null,[Xut,c("td",null,[c("div",Zut,[B(c("input",{type:"checkbox",id:"auto_read",required:"","onUpdate:modelValue":e[271]||(e[271]=_=>r.configFile.auto_read=_),onChange:e[272]||(e[272]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.auto_read]])])])]),c("tr",null,[Jut,c("td",null,[c("div",ept,[B(c("input",{type:"text",id:"xtts_stream_chunk_size",required:"","onUpdate:modelValue":e[273]||(e[273]=_=>r.configFile.xtts_stream_chunk_size=_),onChange:e[274]||(e[274]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.xtts_stream_chunk_size]])])])]),c("tr",null,[tpt,c("td",null,[c("div",npt,[B(c("input",{type:"number",id:"xtts_temperature",required:"","onUpdate:modelValue":e[275]||(e[275]=_=>r.configFile.xtts_temperature=_),onChange:e[276]||(e[276]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",step:"0.01"},null,544),[[he,r.configFile.xtts_temperature,void 0,{number:!0}]])])])]),c("tr",null,[spt,c("td",null,[c("div",ipt,[B(c("input",{type:"number",id:"xtts_length_penalty",required:"","onUpdate:modelValue":e[277]||(e[277]=_=>r.configFile.xtts_length_penalty=_),onChange:e[278]||(e[278]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",step:"0.1"},null,544),[[he,r.configFile.xtts_length_penalty,void 0,{number:!0}]])])])]),c("tr",null,[rpt,c("td",null,[c("div",opt,[B(c("input",{type:"number",id:"xtts_repetition_penalty",required:"","onUpdate:modelValue":e[279]||(e[279]=_=>r.configFile.xtts_repetition_penalty=_),onChange:e[280]||(e[280]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",step:"0.1"},null,544),[[he,r.configFile.xtts_repetition_penalty,void 0,{number:!0}]])])])]),c("tr",null,[apt,c("td",null,[c("div",lpt,[B(c("input",{type:"number",id:"xtts_top_k",required:"","onUpdate:modelValue":e[281]||(e[281]=_=>r.configFile.xtts_top_k=_),onChange:e[282]||(e[282]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.xtts_top_k,void 0,{number:!0}]])])])]),c("tr",null,[cpt,c("td",null,[c("div",dpt,[B(c("input",{type:"number",id:"xtts_top_p",required:"","onUpdate:modelValue":e[283]||(e[283]=_=>r.configFile.xtts_top_p=_),onChange:e[284]||(e[284]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.xtts_top_p,void 0,{number:!0}]])])])]),c("tr",null,[upt,c("td",null,[c("div",ppt,[B(c("input",{type:"number",id:"xtts_speed",required:"","onUpdate:modelValue":e[285]||(e[285]=_=>r.configFile.xtts_speed=_),onChange:e[286]||(e[286]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",step:"0.1"},null,544),[[he,r.configFile.xtts_speed,void 0,{number:!0}]])])])]),c("tr",null,[_pt,c("td",null,[c("div",hpt,[B(c("input",{type:"checkbox",id:"enable_text_splitting","onUpdate:modelValue":e[287]||(e[287]=_=>r.configFile.enable_text_splitting=_),onChange:e[288]||(e[288]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.enable_text_splitting]])])])])])]),_:1}),_e(o,{title:"Open AI TTS service",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",fpt,[c("tr",null,[mpt,c("td",null,[c("div",gpt,[B(c("input",{type:"text",id:"openai_tts_key",required:"","onUpdate:modelValue":e[289]||(e[289]=_=>r.configFile.openai_tts_key=_),onChange:e[290]||(e[290]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.openai_tts_key]])])])]),c("tr",null,[bpt,c("td",null,[c("div",Ept,[B(c("select",{"onUpdate:modelValue":e[291]||(e[291]=_=>r.configFile.openai_tts_model=_),onChange:e[292]||(e[292]=_=>i.settingsChanged=!0)},Spt,544),[[qt,r.configFile.openai_tts_model]])])])]),c("tr",null,[Tpt,c("td",null,[c("div",xpt,[B(c("select",{"onUpdate:modelValue":e[293]||(e[293]=_=>r.configFile.openai_tts_voice=_),onChange:e[294]||(e[294]=_=>i.settingsChanged=!0)},Opt,544),[[qt,r.configFile.openai_tts_voice]])])])])])]),_:1})]),_:1}),_e(o,{title:"TTI services",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[_e(o,{title:"Stable diffusion service",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",Ipt,[c("tr",null,[Mpt,c("td",null,[c("div",Dpt,[B(c("input",{type:"checkbox",id:"enable_sd_service",required:"","onUpdate:modelValue":e[295]||(e[295]=_=>r.configFile.enable_sd_service=_),onChange:e[296]||(e[296]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,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[297]||(e[297]=_=>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"))},Lpt)])]),c("tr",null,[Ppt,c("td",null,[c("div",Upt,[c("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[298]||(e[298]=(..._)=>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[299]||(e[299]=(..._)=>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[300]||(e[300]=(..._)=>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[301]||(e[301]=(..._)=>r.showSD&&r.showSD(..._))},"show sd ui"),Fpt])]),c("td",null,[c("div",Bpt,[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("tr",null,[Gpt,c("td",null,[c("div",Vpt,[B(c("input",{type:"text",id:"sd_base_url",required:"","onUpdate:modelValue":e[303]||(e[303]=_=>r.configFile.sd_base_url=_),onChange:e[304]||(e[304]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.sd_base_url]])])])])])]),_:1}),_e(o,{title:"Diffusers service",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",zpt,[c("tr",null,[Hpt,c("td",null,[c("div",qpt,[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.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[306]||(e[306]=(..._)=>r.upgradeDiffusersService&&r.upgradeDiffusersService(..._))},"upgrade diffusers service"),Ypt])])]),c("tr",null,[$pt,c("td",null,[c("div",Wpt,[B(c("input",{type:"text",id:"diffusers_model",required:"","onUpdate:modelValue":e[307]||(e[307]=_=>r.configFile.diffusers_model=_),onChange:e[308]||(e[308]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.diffusers_model]])])]),Kpt])])]),_:1}),_e(o,{title:"Midjourney",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",jpt,[c("tr",null,[Qpt,c("td",null,[c("div",Xpt,[B(c("input",{type:"text",id:"midjourney_key",required:"","onUpdate:modelValue":e[309]||(e[309]=_=>r.configFile.midjourney_key=_),onChange:e[310]||(e[310]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.midjourney_key]])])])]),c("tr",null,[Zpt,c("td",null,[c("div",Jpt,[B(c("input",{type:"number",min:"10",max:"2048",id:"midjourney_timeout",required:"","onUpdate:modelValue":e[311]||(e[311]=_=>r.configFile.midjourney_timeout=_),onChange:e[312]||(e[312]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.midjourney_timeout]])])])]),c("tr",null,[e_t,c("td",null,[c("div",t_t,[B(c("input",{type:"number",min:"0",max:"2048",id:"midjourney_retries",required:"","onUpdate:modelValue":e[313]||(e[313]=_=>r.configFile.midjourney_retries=_),onChange:e[314]||(e[314]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.midjourney_retries]])])])])])]),_:1}),_e(o,{title:"Dall-E",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",n_t,[c("tr",null,[s_t,c("td",null,[c("div",i_t,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.dall_e_key]])])])]),c("tr",null,[r_t,c("td",null,[c("div",o_t,[B(c("select",{"onUpdate:modelValue":e[317]||(e[317]=_=>r.configFile.dall_e_generation_engine=_),onChange:e[318]||(e[318]=_=>i.settingsChanged=!0)},c_t,544),[[qt,r.configFile.dall_e_generation_engine]])])])])])]),_:1}),_e(o,{title:"ComfyUI service",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",d_t,[c("tr",null,[u_t,c("td",null,[c("div",p_t,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,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"))},h_t)])]),c("tr",null,[f_t,c("td",null,[c("div",m_t,[B(c("select",{id:"comfyui_model",required:"","onUpdate:modelValue":e[322]||(e[322]=_=>r.configFile.comfyui_model=_),onChange:e[323]||(e[323]=_=>i.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(C(!0),R(ze,null,st(i.comfyui_models,(_,m)=>(C(),R("option",{key:_,value:_},se(_),9,g_t))),128))],544),[[qt,r.configFile.comfyui_model]])])])]),c("tr",null,[b_t,c("td",null,[c("div",E_t,[B(c("input",{type:"text",id:"comfyui_model",required:"","onUpdate:modelValue":e[324]||(e[324]=_=>r.configFile.comfyui_model=_),onChange:e[325]||(e[325]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,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"))},v_t)])]),c("tr",null,[S_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[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"),x_t])])]),c("tr",null,[C_t,c("td",null,[c("div",w_t,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.comfyui_base_url]])])])])])]),_:1})]),_:1}),_e(o,{title:"TTT services",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[_e(o,{title:"Ollama service",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",R_t,[c("tr",null,[A_t,c("td",null,[c("div",N_t,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,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`))},O_t)])]),c("tr",null,[I_t,c("td",null,[c("div",M_t,[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,[D_t,c("td",null,[c("div",k_t,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.ollama_base_url]])])])])])]),_:1}),_e(o,{title:"vLLM service",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",L_t,[c("tr",null,[P_t,c("td",null,[c("div",U_t,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,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. +Here is how you can do that`))},I_t)])]),c("tr",null,[M_t,c("td",null,[c("div",D_t,[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,[k_t,c("td",null,[c("div",L_t,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.ollama_base_url]])])])])])]),_:1}),_e(o,{title:"vLLM service",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",P_t,[c("tr",null,[U_t,c("td",null,[c("div",F_t,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,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`))},B_t)])]),c("tr",null,[G_t,c("td",null,[c("div",V_t,[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,[z_t,c("td",null,[c("div",H_t,[B(c("input",{type:"text",id:"vllm_url",required:"","onUpdate:modelValue":e[345]||(e[345]=_=>r.configFile.vllm_url=_),onChange:e[346]||(e[346]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.vllm_url]])])])]),c("tr",null,[q_t,c("td",null,[c("div",Y_t,[c("div",$_t,[W_t,c("p",K_t,[B(c("input",{type:"text",id:"temp-val","onUpdate:modelValue":e[347]||(e[347]=_=>r.configFile.vllm_gpu_memory_utilization=_),onChange:e[348]||(e[348]=_=>i.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),[[he,r.configFile.vllm_gpu_memory_utilization]])])]),B(c("input",{id:"vllm_gpu_memory_utilization",onChange:e[349]||(e[349]=_=>i.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),[[he,r.configFile.vllm_gpu_memory_utilization]])])])]),c("tr",null,[j_t,c("td",null,[c("div",Q_t,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.vllm_max_num_seqs]])])])]),c("tr",null,[X_t,c("td",null,[c("div",Z_t,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.vllm_max_model_len]])])])]),c("tr",null,[J_t,c("td",null,[c("div",eht,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.vllm_model_path]])])])])])]),_:1}),_e(o,{title:"Petals service",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",tht,[c("tr",null,[nht,c("td",null,[c("div",sht,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,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. +Here is how you can do that`))},G_t)])]),c("tr",null,[V_t,c("td",null,[c("div",z_t,[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,[H_t,c("td",null,[c("div",q_t,[B(c("input",{type:"text",id:"vllm_url",required:"","onUpdate:modelValue":e[345]||(e[345]=_=>r.configFile.vllm_url=_),onChange:e[346]||(e[346]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.vllm_url]])])])]),c("tr",null,[Y_t,c("td",null,[c("div",$_t,[c("div",W_t,[K_t,c("p",j_t,[B(c("input",{type:"text",id:"temp-val","onUpdate:modelValue":e[347]||(e[347]=_=>r.configFile.vllm_gpu_memory_utilization=_),onChange:e[348]||(e[348]=_=>i.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),[[he,r.configFile.vllm_gpu_memory_utilization]])])]),B(c("input",{id:"vllm_gpu_memory_utilization",onChange:e[349]||(e[349]=_=>i.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),[[he,r.configFile.vllm_gpu_memory_utilization]])])])]),c("tr",null,[Q_t,c("td",null,[c("div",X_t,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.vllm_max_num_seqs]])])])]),c("tr",null,[Z_t,c("td",null,[c("div",J_t,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.vllm_max_model_len]])])])]),c("tr",null,[eht,c("td",null,[c("div",tht,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.vllm_model_path]])])])])])]),_:1}),_e(o,{title:"Petals service",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",nht,[c("tr",null,[sht,c("td",null,[c("div",iht,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,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`))},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[360]||(e[360]=(..._)=>r.reinstallPetalsService&&r.reinstallPetalsService(..._))},"install petals service")])])]),c("tr",null,[lht,c("td",null,[c("div",cht,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.petals_base_url]])])])])])]),_:1})]),_:1}),_e(o,{title:"Misc",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[_e(o,{title:"Motion Ctrl service",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",dht,[c("tr",null,[uht,c("td",null,[c("div",pht,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,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"))},hht)])]),c("tr",null,[fht,c("td",null,[c("div",mht,[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,[ght,c("td",null,[c("div",bht,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.sd_base_url]])])])])])]),_:1}),_e(o,{title:"Elastic search Service (under construction)",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",Eht,[c("tr",null,[yht,c("td",null,[c("div",vht,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.elastic_search_service]])])])]),c("tr",null,[Sht,c("td",null,[c("div",Tht,[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,[xht,c("td",null,[c("div",Cht,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.elastic_search_url]])])])])])]),_:1})]),_:1})],2)]),c("div",wht,[c("div",Rht,[c("button",{onClick:e[374]||(e[374]=ae(_=>i.bzc_collapsed=!i.bzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[B(c("div",null,Nht,512),[[Ot,i.bzc_collapsed]]),B(c("div",null,Iht,512),[[Ot,!i.bzc_collapsed]]),Mht,r.configFile.binding_name?G("",!0):(C(),R("div",Dht,[kht,Xe(" No binding selected! ")])),r.configFile.binding_name?(C(),R("div",Lht,"|")):G("",!0),r.configFile.binding_name?(C(),R("div",Pht,[c("div",Uht,[c("img",{src:r.imgBinding,class:"w-8 h-8 rounded-full object-fill text-blue-700"},null,8,Fht),c("h3",Bht,se(r.binding_name),1)])])):G("",!0)])]),c("div",{class:Fe([{hidden:i.bzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[r.bindingsZoo&&r.bindingsZoo.length>0?(C(),R("div",Ght,[c("label",Vht," Bindings: ("+se(r.bindingsZoo.length)+") ",1),c("div",{class:Fe(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",i.bzl_collapsed?"":"max-h-96"])},[_e(Qs,{name:"list"},{default:qe(()=>[(C(!0),R(ze,null,st(r.bindingsZoo,(_,m)=>(C(),St(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)])):G("",!0),i.bzl_collapsed?(C(),R("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]=_=>i.bzl_collapsed=!i.bzl_collapsed)},Hht)):(C(),R("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]=_=>i.bzl_collapsed=!i.bzl_collapsed)},Yht))],2)]),c("div",$ht,[c("div",Wht,[c("button",{onClick:e[377]||(e[377]=ae(_=>r.modelsZooToggleCollapse(),["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[B(c("div",null,jht,512),[[Ot,i.mzc_collapsed]]),B(c("div",null,Xht,512),[[Ot,!i.mzc_collapsed]]),Zht,c("div",Jht,[r.configFile.binding_name?G("",!0):(C(),R("div",eft,[tft,Xe(" Select binding first! ")])),!r.configFile.model_name&&r.configFile.binding_name?(C(),R("div",nft,[sft,Xe(" No model selected! ")])):G("",!0),r.configFile.model_name?(C(),R("div",ift,"|")):G("",!0),r.configFile.model_name?(C(),R("div",rft,[c("div",oft,[c("img",{src:r.imgModel,class:"w-8 h-8 rounded-lg object-fill"},null,8,aft),c("h3",lft,se(r.configFile.model_name),1)])])):G("",!0)])])]),c("div",{class:Fe([{hidden:i.mzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",cft,[c("div",dft,[c("div",uft,[i.searchModelInProgress?(C(),R("div",pft,hft)):G("",!0),i.searchModelInProgress?G("",!0):(C(),R("div",fft,gft))]),B(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]=_=>i.searchModel=_),onKeyup:e[379]||(e[379]=Ai((..._)=>r.searchModel_func&&r.searchModel_func(..._),["enter"]))},null,544),[[he,i.searchModel]]),i.searchModel?(C(),R("button",{key:0,onClick:e[380]||(e[380]=ae(_=>i.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")):G("",!0)])]),c("div",null,[B(c("input",{"onUpdate:modelValue":e[381]||(e[381]=_=>i.show_only_installed_models=_),class:"m-2 p-2",type:"checkbox",ref:"only_installed"},null,512),[[Ke,i.show_only_installed_models]]),bft]),c("div",null,[_e(l,{radioOptions:i.sortOptions,onRadioSelected:r.handleRadioSelected},null,8,["radioOptions","onRadioSelected"])]),Eft,i.is_loading_zoo?(C(),R("div",yft,Tft)):G("",!0),i.models_zoo&&i.models_zoo.length>0?(C(),R("div",xft,[c("label",Cft," Models: ("+se(i.models_zoo.length)+") ",1),c("div",{class:Fe(["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",i.mzl_collapsed?"":"max-h-96"])},[_e(Qs,{name:"list"},{default:qe(()=>[(C(!0),R(ze,null,st(r.rendered_models_zoo,(_,m)=>(C(),St(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)])):G("",!0),i.mzl_collapsed?(C(),R("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(..._))},Rft)):(C(),R("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(..._))},Nft)),c("div",Oft,[c("div",Ift,[c("div",null,[c("div",Mft,[Dft,B(c("input",{type:"text","onUpdate:modelValue":e[385]||(e[385]=_=>i.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),[[he,i.reference_path]])]),c("button",{type:"button",onClick:e[386]||(e[386]=ae(_=>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")]),i.modelDownlaodInProgress?G("",!0):(C(),R("div",kft,[c("div",Lft,[Pft,B(c("input",{type:"text","onUpdate:modelValue":e[387]||(e[387]=_=>i.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),[[he,i.addModel.url]])]),c("button",{type:"button",onClick:e[388]||(e[388]=ae(_=>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")])),i.modelDownlaodInProgress?(C(),R("div",Uft,[Fft,c("div",Bft,[c("div",Gft,[c("div",Vft,[zft,c("span",Hft,se(Math.floor(i.addModel.progress))+"%",1)]),c("div",{class:"mx-1 opacity-80 line-clamp-1",title:i.addModel.url},se(i.addModel.url),9,qft),c("div",Yft,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:jt({width:i.addModel.progress+"%"})},null,4)]),c("div",$ft,[c("span",Wft,"Download speed: "+se(r.speed_computed)+"/s",1),c("span",Kft,se(r.downloaded_size_computed)+"/"+se(r.total_size_computed),1)])])]),c("div",jft,[c("div",Qft,[c("div",Xft,[c("button",{onClick:e[389]||(e[389]=ae((..._)=>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 ")])])])])):G("",!0)])])],2)]),c("div",Zft,[c("div",Jft,[c("button",{onClick:e[392]||(e[392]=ae(_=>i.pzc_collapsed=!i.pzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 text-left w-full flex items-center"},[B(c("div",null,tmt,512),[[Ot,i.pzc_collapsed]]),B(c("div",null,smt,512),[[Ot,!i.pzc_collapsed]]),imt,r.configFile.personalities?(C(),R("div",rmt,"|")):G("",!0),c("div",omt,se(r.active_pesonality),1),r.configFile.personalities?(C(),R("div",amt,"|")):G("",!0),r.configFile.personalities?(C(),R("div",lmt,[r.mountedPersArr.length>0?(C(),R("div",cmt,[(C(!0),R(ze,null,st(r.mountedPersArr,(_,m)=>(C(),R("div",{class:"relative hover:-translate-y-2 duration-300 hover:z-10 shrink-0",key:m+"-"+_.name,ref_for:!0,ref:"mountedPersonalities"},[c("div",dmt,[c("button",{onClick:ae(E=>r.onPersonalitySelected(_),["stop"])},[c("img",{src:i.bUrl+_.avatar,onError:e[390]||(e[390]=(...E)=>r.personalityImgPlacehodler&&r.personalityImgPlacehodler(...E)),class:Fe(["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,pmt)],8,umt),c("button",{onClick:ae(E=>r.unmountPersonality(_),["stop"])},fmt,8,_mt)])]))),128))])):G("",!0)])):G("",!0),c("button",{onClick:e[391]||(e[391]=ae(_=>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"},gmt)])]),c("div",{class:Fe([{hidden:i.pzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",bmt,[Emt,c("div",ymt,[c("div",vmt,[i.searchPersonalityInProgress?(C(),R("div",Smt,xmt)):G("",!0),i.searchPersonalityInProgress?G("",!0):(C(),R("div",Cmt,Rmt))]),B(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]=_=>i.searchPersonality=_),onKeyup:e[394]||(e[394]=ae((..._)=>r.searchPersonality_func&&r.searchPersonality_func(..._),["stop"]))},null,544),[[he,i.searchPersonality]]),i.searchPersonality?(C(),R("button",{key:0,onClick:e[395]||(e[395]=ae(_=>i.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")):G("",!0)])]),i.searchPersonality?G("",!0):(C(),R("div",Amt,[c("label",Nmt," Personalities Category: ("+se(i.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"},[(C(!0),R(ze,null,st(i.persCatgArr,(_,m)=>(C(),R("option",{key:m,selected:_==this.configFile.personality_category},se(_),9,Omt))),128))],32)])),c("div",null,[i.personalitiesFiltered.length>0?(C(),R("div",Imt,[c("label",Mmt,se(i.searchPersonality?"Search results":"Personalities")+": ("+se(i.personalitiesFiltered.length)+") ",1),c("div",{class:Fe(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",i.pzl_collapsed?"":"max-h-96"])},[_e(Qs,{name:"bounce"},{default:qe(()=>[(C(!0),R(ze,null,st(i.personalitiesFiltered,(_,m)=>(C(),St(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)])):G("",!0)]),i.pzl_collapsed?(C(),R("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]=_=>i.pzl_collapsed=!i.pzl_collapsed)},kmt)):(C(),R("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]=_=>i.pzl_collapsed=!i.pzl_collapsed)},Pmt))],2)]),c("div",Umt,[c("div",Fmt,[c("button",{onClick:e[399]||(e[399]=ae(_=>i.mc_collapsed=!i.mc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[B(c("div",null,Gmt,512),[[Ot,i.mc_collapsed]]),B(c("div",null,zmt,512),[[Ot,!i.mc_collapsed]]),Hmt])]),c("div",{class:Fe([{hidden:i.mc_collapsed},"flex flex-col mb-2 p-2"])},[c("div",qmt,[c("div",Ymt,[B(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]=ae(()=>{},["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),[[Ke,r.configFile.override_personality_model_parameters]]),$mt])]),c("div",{class:Fe(r.configFile.override_personality_model_parameters?"":"pointer-events-none opacity-30")},[c("div",Wmt,[Kmt,B(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),[[he,r.configFile.seed]])]),c("div",jmt,[c("div",Qmt,[c("div",Xmt,[Zmt,c("p",Jmt,[B(c("input",{type:"text",id:"temp-val","onUpdate:modelValue":e[404]||(e[404]=_=>r.configFile.temperature=_),onChange:e[405]||(e[405]=_=>i.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),[[he,r.configFile.temperature]])])]),B(c("input",{id:"temperature",onChange:e[406]||(e[406]=_=>i.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),[[he,r.configFile.temperature]])])]),c("div",egt,[c("div",tgt,[c("div",ngt,[sgt,c("p",igt,[B(c("input",{type:"text",id:"predict-val","onUpdate:modelValue":e[408]||(e[408]=_=>r.configFile.n_predict=_),onChange:e[409]||(e[409]=_=>i.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),[[he,r.configFile.n_predict]])])]),B(c("input",{id:"predict",type:"range",onChange:e[410]||(e[410]=_=>i.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),[[he,r.configFile.n_predict]])])]),c("div",rgt,[c("div",ogt,[c("div",agt,[lgt,c("p",cgt,[B(c("input",{type:"text",id:"top_k-val","onUpdate:modelValue":e[412]||(e[412]=_=>r.configFile.top_k=_),onChange:e[413]||(e[413]=_=>i.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),[[he,r.configFile.top_k]])])]),B(c("input",{id:"top_k",type:"range",onChange:e[414]||(e[414]=_=>i.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),[[he,r.configFile.top_k]])])]),c("div",dgt,[c("div",ugt,[c("div",pgt,[_gt,c("p",hgt,[B(c("input",{type:"text",id:"top_p-val","onUpdate:modelValue":e[416]||(e[416]=_=>r.configFile.top_p=_),onChange:e[417]||(e[417]=_=>i.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),[[he,r.configFile.top_p]])])]),B(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]=_=>i.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),[[he,r.configFile.top_p]])])]),c("div",fgt,[c("div",mgt,[c("div",ggt,[bgt,c("p",Egt,[B(c("input",{type:"text",id:"repeat_penalty-val","onUpdate:modelValue":e[420]||(e[420]=_=>r.configFile.repeat_penalty=_),onChange:e[421]||(e[421]=_=>i.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),[[he,r.configFile.repeat_penalty]])])]),B(c("input",{id:"repeat_penalty",onChange:e[422]||(e[422]=_=>i.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),[[he,r.configFile.repeat_penalty]])])]),c("div",ygt,[c("div",vgt,[c("div",Sgt,[Tgt,c("p",xgt,[B(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]=_=>i.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),[[he,r.configFile.repeat_last_n]])])]),B(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]=_=>i.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),[[he,r.configFile.repeat_last_n]])])])],2)],2)])],2)]),_e(h,{ref:"addmodeldialog"},null,512),_e(f,{class:"z-20",show:i.variantSelectionDialogVisible,choices:i.variant_choices,onChoiceSelected:r.onVariantChoiceSelected,onCloseDialog:r.oncloseVariantChoiceDialog,onChoiceValidated:r.onvalidateVariantChoice},null,8,["show","choices","onChoiceSelected","onCloseDialog","onChoiceValidated"])],64)}const wgt=pt(Mit,[["render",Cgt],["__scopeId","data-v-2d3d13af"]]),Rgt={components:{ClipBoardTextInput:Zb,Card:Bu},data(){return{dataset_path:"",max_length:1024,batch_size:4,lr:5e-5,num_epochs:2,selectedFolder:"",selectedDataset:""}},methods:{submitForm(){const n={model_name:this.selectedModel,dataset_file:this.selectedDataset,max_length:this.max_length,batch_size:this.batch_size,lr:this.lr,num_epochs:this.num_epochs,output_dir:this.selectedFolder};de.post("/start_training",n).then(e=>{})},openFolderSelector(){this.$refs.folder_selector.click()},selectOutputDirectory(n){var t;console.log("here");const e=(t=n.target.files[0])==null?void 0:t.path;console.log(e),e&&(this.selectedFolder=e)},selectDataset(n){const e=n.target.files;e.length>0&&(this.selectedDataset=e[0])}},computed:{selectedModel:{get(){return this.$store.state.selectedModel}},models:{get(){return this.$store.state.modelsArr}}},watch:{model_name(n){console.log("watching model_name",n),this.$refs.clipboardInput.inputValue=n}}},Agt={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"},Ngt={class:"mb-4"},Ogt=c("label",{for:"model_name",class:"text-sm"},"Model Name:",-1),Igt=["value"],Mgt={class:"mb-4"},Dgt=c("label",{for:"dataset_path",class:"text-sm"},"Dataset:",-1),kgt={class:"mb-4"},Lgt=c("label",{for:"lr",class:"text-sm"},"Learning Rate:",-1),Pgt={class:"mb-4"},Ugt=c("label",{for:"num_epochs",class:"text-sm"},"Number of Epochs:",-1),Fgt={class:"mb-4"},Bgt=c("label",{for:"max_length",class:"text-sm"},"Max Length:",-1),Ggt={class:"mb-4"},Vgt=c("label",{for:"batch_size",class:"text-sm"},"Batch Size:",-1),zgt={class:"mb-4"},Hgt=c("label",{for:"output_dir",class:"text-sm"},"Output Directory:",-1),qgt=c("button",{class:"bg-blue-500 text-white px-4 py-2 rounded"},"Start training",-1),Ygt={key:1};function $gt(n,e,t,s,i,r){const o=dt("Card"),a=dt("ClipBoardTextInput");return r.selectedModel!==null&&r.selectedModel.toLowerCase().includes("gptq")?(C(),R("div",Agt,[c("form",{onSubmit:e[2]||(e[2]=ae((...l)=>r.submitForm&&r.submitForm(...l),["prevent"])),class:""},[_e(o,{title:"Training configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:qe(()=>[_e(o,{title:"Model",class:"",isHorizontal:!1},{default:qe(()=>[c("div",Ngt,[Ogt,B(c("select",{"onUpdate:modelValue":e[0]||(e[0]=l=>r.selectedModel=l),onChange:e[1]||(e[1]=(...l)=>n.setModel&&n.setModel(...l)),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},[(C(!0),R(ze,null,st(r.models,l=>(C(),R("option",{key:l,value:l},se(l),9,Igt))),128))],544),[[qt,r.selectedModel]])])]),_:1}),_e(o,{title:"Data",isHorizontal:!1},{default:qe(()=>[c("div",Mgt,[Dgt,_e(a,{id:"model_path",inputType:"file",value:i.dataset_path,onchange:"selectDataset()"},null,8,["value"])])]),_:1}),_e(o,{title:"Training",isHorizontal:!1},{default:qe(()=>[c("div",kgt,[Lgt,_e(a,{id:"model_path",inputType:"integer",value:i.lr},null,8,["value"])]),c("div",Pgt,[Ugt,_e(a,{id:"model_path",inputType:"integer",value:i.num_epochs},null,8,["value"])]),c("div",Fgt,[Bgt,_e(a,{id:"model_path",inputType:"integer",value:i.max_length},null,8,["value"])]),c("div",Ggt,[Vgt,_e(a,{id:"model_path",inputType:"integer",value:i.batch_size},null,8,["value"])])]),_:1}),_e(o,{title:"Output",isHorizontal:!1},{default:qe(()=>[c("div",zgt,[Hgt,_e(a,{id:"model_path",inputType:"text",value:n.output_dir},null,8,["value"])])]),_:1})]),_:1}),_e(o,{disableHoverAnimation:!0,disableFocus:!0},{default:qe(()=>[qgt]),_:1})],32)])):(C(),R("div",Ygt,[_e(o,{title:"Info",class:"",isHorizontal:!1},{default:qe(()=>[Xe(" Only GPTQ models are supported for QLora fine tuning. Please select a GPTQ compatible binding. ")]),_:1})]))}const Wgt=pt(Rgt,[["render",$gt]]),Kgt={components:{ClipBoardTextInput:Zb,Card:Bu},data(){return{model_name:"jondurbin/airoboros-7b-gpt4",tokenizer_name:"jondurbin/airoboros-7b-gpt4",dataset_path:"",max_length:1024,batch_size:4,lr:5e-5,num_epochs:2,selectedFolder:"",selectedDatasetPath:""}},methods:{submitForm(){this.model_name,this.tokenizer_name,this.selectedDatasetPath,this.max_length,this.batch_size,this.lr,this.num_epochs,this.selectedFolder},openFolderSelector(){this.$refs.folder_selector.click()},selectOutputDirectory(n){var t;console.log("here");const e=(t=n.target.files[0])==null?void 0:t.path;console.log(e),e&&(this.selectedFolder=e)},selectDatasetPath(n){const e=n.target.files;e.length>0&&(this.selectedDatasetPath=e[0].webkitRelativePath)}}},jgt={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"},Qgt={class:"mb-4"},Xgt=c("label",{for:"model_name",class:"text-sm"},"Model Name:",-1),Zgt={class:"mb-4"},Jgt=c("label",{for:"tokenizer_name",class:"text-sm"},"Tokenizer Name:",-1),ebt=c("button",{type:"submit",class:"bg-blue-500 text-white px-4 py-2 rounded"},"Quantize LLM",-1);function tbt(n,e,t,s,i,r){const o=dt("ClipBoardTextInput"),a=dt("Card");return C(),R("div",jgt,[c("form",{onSubmit:e[0]||(e[0]=ae((...l)=>r.submitForm&&r.submitForm(...l),["prevent"])),class:"max-w-md mx-auto"},[_e(a,{title:"Quantizing configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:qe(()=>[_e(a,{title:"Model",class:"",isHorizontal:!1},{default:qe(()=>[c("div",Qgt,[Xgt,_e(o,{id:"model_path",inputType:"text",value:i.model_name},null,8,["value"])]),c("div",Zgt,[Jgt,_e(o,{id:"model_path",inputType:"text",value:i.tokenizer_name},null,8,["value"])])]),_:1})]),_:1}),_e(a,{disableHoverAnimation:!0,disableFocus:!0},{default:qe(()=>[ebt]),_:1})],32)])}const nbt=pt(Kgt,[["render",tbt]]),sbt={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(n){this.newTitle=n},checkedChangeEvent(n,e){this.$emit("checked",n,e)}},mounted(){this.newTitle=this.title,Ue(()=>{Ge.replace()})},watch:{showConfirmation(){Ue(()=>{Ge.replace()})},editTitleMode(n){this.showConfirmation=n,this.editTitle=n,n&&Ue(()=>{try{this.$refs.titleBox.focus()}catch{}})},deleteMode(n){this.showConfirmation=n,n&&Ue(()=>{this.$refs.titleBox.focus()})},makeTitleMode(n){this.showConfirmation=n},checkBoxValue(n,e){this.checkBoxValue_local=n}}},ibt=["id"],rbt={class:"flex flex-row items-center gap-2"},obt={key:0},abt={class:"flex flex-row items-center w-full"},lbt=["title"],cbt=["value"],dbt={class:"flex items-center flex-1 max-h-6"},ubt={key:0,class:"flex gap-3 flex-1 items-center justify-end duration-75"},pbt=c("i",{"data-feather":"x"},null,-1),_bt=[pbt],hbt=c("i",{"data-feather":"check"},null,-1),fbt=[hbt],mbt={key:1,class:"flex gap-3 flex-1 items-center justify-end invisible group-hover:visible duration-75"},gbt=c("i",{"data-feather":"folder"},null,-1),bbt=[gbt],Ebt=c("i",{"data-feather":"type"},null,-1),ybt=[Ebt],vbt=c("i",{"data-feather":"edit-2"},null,-1),Sbt=[vbt],Tbt=c("i",{"data-feather":"trash"},null,-1),xbt=[Tbt];function Cbt(n,e,t,s,i,r){return C(),R("div",{class:Fe([t.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-"+t.id,onClick:e[13]||(e[13]=ae(o=>r.selectEvent(),["stop"]))},[c("div",rbt,[t.isCheckbox?(C(),R("div",obt,[B(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]=ae(()=>{},["stop"])),"onUpdate:modelValue":e[1]||(e[1]=o=>i.checkBoxValue_local=o),onInput:e[2]||(e[2]=o=>r.checkedChangeEvent(o,t.id))},null,544),[[Ke,i.checkBoxValue_local]])])):G("",!0),t.selected?(C(),R("div",{key:1,class:Fe(["min-h-full w-2 rounded-xl self-stretch",t.loading?"animate-bounce bg-accent ":" bg-secondary "])},null,2)):G("",!0),t.selected?G("",!0):(C(),R("div",{key:2,class:Fe(["w-2",t.loading?"min-h-full w-2 rounded-xl self-stretch animate-bounce bg-accent ":" "])},null,2))]),c("div",abt,[i.editTitle?G("",!0):(C(),R("p",{key:0,title:t.title,class:"line-clamp-1 w-4/6 ml-1 -mx-5"},se(t.title?t.title==="untitled"?"New discussion":t.title:"New discussion"),9,lbt)),i.editTitle?(C(),R("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:t.title,required:"",onKeydown:[e[3]||(e[3]=Ai(ae(o=>r.editTitleEvent(),["exact"]),["enter"])),e[4]||(e[4]=Ai(ae(o=>i.editTitleMode=!1,["exact"]),["esc"]))],onInput:e[5]||(e[5]=o=>r.chnageTitle(o.target.value)),onClick:e[6]||(e[6]=ae(()=>{},["stop"]))},null,40,cbt)):G("",!0),c("div",dbt,[i.showConfirmation?(C(),R("div",ubt,[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]=ae(o=>r.cancel(),["stop"]))},_bt),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm title changes",type:"button",onClick:e[8]||(e[8]=ae(o=>i.editTitleMode?r.editTitleEvent():i.deleteMode?r.deleteEvent():r.makeTitleEvent(),["stop"]))},fbt)])):G("",!0),i.showConfirmation?G("",!0):(C(),R("div",mbt,[c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Open folder",type:"button",onClick:e[9]||(e[9]=ae(o=>r.openFolderEvent(),["stop"]))},bbt),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Make a title",type:"button",onClick:e[10]||(e[10]=ae(o=>i.makeTitleMode=!0,["stop"]))},ybt),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Edit title",type:"button",onClick:e[11]||(e[11]=ae(o=>i.editTitleMode=!0,["stop"]))},Sbt),c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Remove discussion",type:"button",onClick:e[12]||(e[12]=ae(o=>i.deleteMode=!0,["stop"]))},xbt)]))])])],10,ibt)}const tE=pt(sbt,[["render",Cbt]]),wbt={data(){return{show:!1,prompt:"",inputText:""}},methods:{showPanel(){this.show=!0},ok(){this.show=!1,this.$emit("ok",this.inputText)},cancel(){this.show=!1,this.inputText=""}},props:{promptText:{type:String,required:!0}},watch:{promptText(n){this.prompt=n}}},Rbt={key:0,class:"fixed top-0 left-0 w-full h-full flex justify-center items-center bg-black bg-opacity-50"},Abt={class:"bg-white p-8 rounded"},Nbt={class:"text-xl font-bold mb-4"};function Obt(n,e,t,s,i,r){return C(),R("div",null,[i.show?(C(),R("div",Rbt,[c("div",Abt,[c("h2",Nbt,se(t.promptText),1),B(c("input",{type:"text","onUpdate:modelValue":e[0]||(e[0]=o=>i.inputText=o),class:"border border-gray-300 px-4 py-2 rounded mb-4"},null,512),[[he,i.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")])])):G("",!0)])}const RN=pt(wbt,[["render",Obt]]),Ibt={data(){return{id:0,loading:!1,isCheckbox:!1,isVisible:!1,categories:[],titles:[],content:"",searchQuery:""}},components:{Discussion:tE,MarkdownRenderer:Uu},props:{host:{type:String,required:!1,default:"http://localhost:9600"}},methods:{showSkillsLibrary(){this.isVisible=!0,this.fetchTitles()},closeComponent(){this.isVisible=!1},fetchCategories(){de.post("/get_skills_library_categories",{client_id:this.$store.state.client_id}).then(n=>{this.categories=n.data.categories}).catch(n=>{console.error("Error fetching categories:",n)})},fetchTitles(){console.log("Fetching categories"),de.post("/get_skills_library_titles",{client_id:this.$store.state.client_id}).then(n=>{this.titles=n.data.titles,console.log("titles recovered")}).catch(n=>{console.error("Error fetching titles:",n)})},fetchContent(n){de.post("/get_skills_library_content",{client_id:this.$store.state.client_id,skill_id:n}).then(e=>{const t=e.data.contents[0];this.id=t.id,this.content=t.content}).catch(e=>{console.error("Error fetching content:",e)})},deleteCategory(n){console.log("Delete category")},editCategory(n){console.log("Edit category")},checkUncheckCategory(n){console.log("Unchecked category")},deleteSkill(n){console.log("Delete skill ",n),de.post("/delete_skill",{client_id:this.$store.state.client_id,skill_id:n}).then(()=>{this.fetchTitles()})},editTitle(n){de.post("/edit_skill_title",{client_id:this.$store.state.client_id,skill_id:n,title:n}).then(()=>{this.fetchTitles()}),console.log("Edit title")},makeTitle(n){console.log("Make title")},checkUncheckTitle(n){},searchSkills(){}}},Mbt={id:"leftPanel",class:"flex flex-row h-full flex-grow shadow-lg rounded"},Dbt={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"},kbt={class:"search p-4"},Lbt={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"},Pbt=c("h2",{class:"text-xl font-bold m-4"},"Titles",-1),Ubt={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"},Fbt=c("h2",{class:"text-xl font-bold m-4"},"Content",-1);function Bbt(n,e,t,s,i,r){const o=dt("Discussion"),a=dt("MarkdownRenderer");return C(),R("div",{class:Fe([{hidden:!i.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",Mbt,[c("div",Dbt,[c("div",kbt,[B(c("input",{type:"text","onUpdate:modelValue":e[0]||(e[0]=l=>i.searchQuery=l),placeholder:"Search skills",class:"border border-gray-300 rounded px-2 py-1 mr-2"},null,512),[[he,i.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",Lbt,[Pbt,i.titles.length>0?(C(),St(Qs,{key:0,name:"list"},{default:qe(()=>[(C(!0),R(ze,null,st(i.titles,l=>(C(),St(o,{key:l.id,id:l.id,title:l.title,selected:r.fetchContent(l.id),loading:i.loading,isCheckbox:i.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})):G("",!0)])]),c("div",Ubt,[Fbt,_e(a,{host:t.host,"markdown-text":i.content,message_id:i.id,discussion_id:i.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 AN=pt(Ibt,[["render",Bbt]]),Gbt={props:{htmlContent:{type:String,required:!0}}},Vbt=["innerHTML"];function zbt(n,e,t,s,i,r){return C(),R("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:t.htmlContent},null,8,Vbt)}const Hbt=pt(Gbt,[["render",zbt]]);const qbt={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}}},Ybt={key:0},$bt={class:"toggle-icon mr-1"},Wbt={key:0,class:"fas fa-plus-circle text-gray-600"},Kbt={key:1,class:"fas fa-minus-circle text-gray-600"},jbt={class:"json-viewer max-h-64 overflow-auto p-4 bg-gray-100 border border-gray-300 rounded dark:bg-gray-600"},Qbt={key:0,class:"fas fa-plus-circle text-gray-600"},Xbt={key:1,class:"fas fa-minus-circle text-gray-600"},Zbt=["innerHTML"];function Jbt(n,e,t,s,i,r){return r.isContentPresent?(C(),R("div",Ybt,[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",$bt,[i.collapsed?(C(),R("i",Wbt)):(C(),R("i",Kbt))]),Xe(" "+se(t.jsonFormText),1)]),B(c("div",null,[c("div",jbt,[r.isObject?(C(),R("span",{key:0,onClick:e[1]||(e[1]=(...o)=>r.toggleCollapsed&&r.toggleCollapsed(...o)),class:"toggle-icon cursor-pointer mr-1"},[i.collapsed?(C(),R("i",Qbt)):(C(),R("i",Xbt))])):G("",!0),c("pre",{innerHTML:r.formattedJson},null,8,Zbt)])],512),[[Ot,!i.collapsed]])])):G("",!0)}const eEt=pt(qbt,[["render",Jbt]]),tEt={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"}}},nEt={class:"flex items-start"},sEt={class:"step flex items-center mb-4"},iEt={key:0,class:"flex items-center justify-center w-6 h-6 mr-2"},rEt={key:0},oEt=c("i",{"data-feather":"square",class:"text-gray-400 w-4 h-4"},null,-1),aEt=[oEt],lEt={key:1},cEt=c("i",{"data-feather":"check-square",class:"text-green-500 w-4 h-4"},null,-1),dEt=[cEt],uEt={key:2},pEt=c("i",{"data-feather":"x-square",class:"text-red-500 w-4 h-4"},null,-1),_Et=[pEt],hEt={key:1,role:"status",class:"m-15"},fEt=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),mEt=[fEt],gEt={class:"text-sm ml-6"};function bEt(n,e,t,s,i,r){return C(),R("div",nEt,[c("div",sEt,[t.step_type=="start_end"?(C(),R("div",iEt,[t.done?G("",!0):(C(),R("div",rEt,aEt)),t.done&&t.status?(C(),R("div",lEt,dEt)):G("",!0),t.done&&!t.status?(C(),R("div",uEt,_Et)):G("",!0)])):G("",!0),t.done?G("",!0):(C(),R("div",hEt,mEt)),c("h3",gEt,se(t.message),1)])])}const EEt=pt(tEt,[["render",bEt]]),yEt="/assets/process-61f7a21b.svg",vEt="/assets/ok-a0b56451.svg",SEt="/assets/failed-183609e7.svg",NN="/assets/send_globe-305330b9.svg";const TEt="/",xEt={name:"Message",emits:["copy","delete","rankUp","rankDown","updateMessage","resendMessage","continueMessage"],components:{MarkdownRenderer:Uu,Step:EEt,RenderHTMLJS:Hbt,JsonViewer:eEt,DynamicUIRenderer:wN},props:{host:{type:String,required:!1,default:"http://localhost:9600"},message:Object,avatar:{default:""}},data(){return{ui_componentKey:0,isSynthesizingVoice:!1,cpp_block:yN,html5_block:vN,LaTeX_block:SN,json_block:EN,javascript_block:bN,process_svg:yEt,ok_svg:vEt,failed_svg:SEt,loading_svg:xN,sendGlobe:NN,code_block:mN,python_block:gN,bash_block:TN,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."),Ue(()=>{Ge.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 n of this.message.metadata)Object.prototype.hasOwnProperty.call(n,"audio_url")&&n.audio_url!=null&&(this.audio_url=n.audio_url,console.log("Audio URL:",this.audio_url))}},methods:{computeTimeDiff(n,e){let t=e.getTime()-n.getTime();const s=Math.floor(t/(1e3*60*60));t-=s*(1e3*60*60);const i=Math.floor(t/(1e3*60));t-=i*(1e3*60);const r=Math.floor(t/1e3);return t-=r*1e3,[s,i,r]},insertTab(n){const e=n.target,t=e.selectionStart,s=e.selectionEnd,i=n.shiftKey;if(t===s)if(i){if(e.value.substring(t-4,t)==" "){const r=e.value.substring(0,t-4),o=e.value.substring(s),a=r+o;this.message.content=a,this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t-4})}}else{const r=e.value.substring(0,t),o=e.value.substring(s),a=r+" "+o;this.message.content=a,this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t+4})}else{const o=e.value.substring(t,s).split(` +Here is how you can do that`))},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[360]||(e[360]=(..._)=>r.reinstallPetalsService&&r.reinstallPetalsService(..._))},"install petals service")])])]),c("tr",null,[cht,c("td",null,[c("div",dht,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.petals_base_url]])])])])])]),_:1})]),_:1}),_e(o,{title:"Misc",is_shrunk:!0,is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[_e(o,{title:"Motion Ctrl service",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",uht,[c("tr",null,[pht,c("td",null,[c("div",_ht,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,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"))},fht)])]),c("tr",null,[mht,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[366]||(e[366]=(..._)=>r.reinstallMotionCtrlService&&r.reinstallMotionCtrlService(..._))},"install Motion Ctrl service")])])]),c("tr",null,[bht,c("td",null,[c("div",Eht,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.sd_base_url]])])])])])]),_:1}),_e(o,{title:"Elastic search Service (under construction)",is_subcard:!0,class:"pb-2 m-2"},{default:qe(()=>[c("table",yht,[c("tr",null,[vht,c("td",null,[c("div",Sht,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Ke,r.configFile.elastic_search_service]])])])]),c("tr",null,[Tht,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[371]||(e[371]=(..._)=>r.reinstallElasticSearchService&&r.reinstallElasticSearchService(..._))},"install ElasticSearch service")])])]),c("tr",null,[Cht,c("td",null,[c("div",wht,[B(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]=_=>i.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[he,r.configFile.elastic_search_url]])])])])])]),_:1})]),_:1})],2)]),c("div",Rht,[c("div",Aht,[c("button",{onClick:e[374]||(e[374]=ae(_=>i.bzc_collapsed=!i.bzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[B(c("div",null,Oht,512),[[Ot,i.bzc_collapsed]]),B(c("div",null,Mht,512),[[Ot,!i.bzc_collapsed]]),Dht,r.configFile.binding_name?G("",!0):(C(),R("div",kht,[Lht,Xe(" No binding selected! ")])),r.configFile.binding_name?(C(),R("div",Pht,"|")):G("",!0),r.configFile.binding_name?(C(),R("div",Uht,[c("div",Fht,[c("img",{src:r.imgBinding,class:"w-8 h-8 rounded-full object-fill text-blue-700"},null,8,Bht),c("h3",Ght,se(r.binding_name),1)])])):G("",!0)])]),c("div",{class:Fe([{hidden:i.bzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[r.bindingsZoo&&r.bindingsZoo.length>0?(C(),R("div",Vht,[c("label",zht," Bindings: ("+se(r.bindingsZoo.length)+") ",1),c("div",{class:Fe(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",i.bzl_collapsed?"":"max-h-96"])},[_e(Qs,{name:"list"},{default:qe(()=>[(C(!0),R(ze,null,st(r.bindingsZoo,(_,m)=>(C(),St(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)])):G("",!0),i.bzl_collapsed?(C(),R("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]=_=>i.bzl_collapsed=!i.bzl_collapsed)},qht)):(C(),R("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]=_=>i.bzl_collapsed=!i.bzl_collapsed)},$ht))],2)]),c("div",Wht,[c("div",Kht,[c("button",{onClick:e[377]||(e[377]=ae(_=>r.modelsZooToggleCollapse(),["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[B(c("div",null,Qht,512),[[Ot,i.mzc_collapsed]]),B(c("div",null,Zht,512),[[Ot,!i.mzc_collapsed]]),Jht,c("div",eft,[r.configFile.binding_name?G("",!0):(C(),R("div",tft,[nft,Xe(" Select binding first! ")])),!r.configFile.model_name&&r.configFile.binding_name?(C(),R("div",sft,[ift,Xe(" No model selected! ")])):G("",!0),r.configFile.model_name?(C(),R("div",rft,"|")):G("",!0),r.configFile.model_name?(C(),R("div",oft,[c("div",aft,[c("img",{src:r.imgModel,class:"w-8 h-8 rounded-lg object-fill"},null,8,lft),c("h3",cft,se(r.configFile.model_name),1)])])):G("",!0)])])]),c("div",{class:Fe([{hidden:i.mzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",dft,[c("div",uft,[c("div",pft,[i.searchModelInProgress?(C(),R("div",_ft,fft)):G("",!0),i.searchModelInProgress?G("",!0):(C(),R("div",mft,bft))]),B(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]=_=>i.searchModel=_),onKeyup:e[379]||(e[379]=Ai((..._)=>r.searchModel_func&&r.searchModel_func(..._),["enter"]))},null,544),[[he,i.searchModel]]),i.searchModel?(C(),R("button",{key:0,onClick:e[380]||(e[380]=ae(_=>i.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")):G("",!0)])]),c("div",null,[B(c("input",{"onUpdate:modelValue":e[381]||(e[381]=_=>i.show_only_installed_models=_),class:"m-2 p-2",type:"checkbox",ref:"only_installed"},null,512),[[Ke,i.show_only_installed_models]]),Eft]),c("div",null,[_e(l,{radioOptions:i.sortOptions,onRadioSelected:r.handleRadioSelected},null,8,["radioOptions","onRadioSelected"])]),yft,i.is_loading_zoo?(C(),R("div",vft,xft)):G("",!0),i.models_zoo&&i.models_zoo.length>0?(C(),R("div",Cft,[c("label",wft," Models: ("+se(i.models_zoo.length)+") ",1),c("div",{class:Fe(["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",i.mzl_collapsed?"":"max-h-96"])},[_e(Qs,{name:"list"},{default:qe(()=>[(C(!0),R(ze,null,st(r.rendered_models_zoo,(_,m)=>(C(),St(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)])):G("",!0),i.mzl_collapsed?(C(),R("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(..._))},Aft)):(C(),R("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(..._))},Oft)),c("div",Ift,[c("div",Mft,[c("div",null,[c("div",Dft,[kft,B(c("input",{type:"text","onUpdate:modelValue":e[385]||(e[385]=_=>i.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),[[he,i.reference_path]])]),c("button",{type:"button",onClick:e[386]||(e[386]=ae(_=>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")]),i.modelDownlaodInProgress?G("",!0):(C(),R("div",Lft,[c("div",Pft,[Uft,B(c("input",{type:"text","onUpdate:modelValue":e[387]||(e[387]=_=>i.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),[[he,i.addModel.url]])]),c("button",{type:"button",onClick:e[388]||(e[388]=ae(_=>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")])),i.modelDownlaodInProgress?(C(),R("div",Fft,[Bft,c("div",Gft,[c("div",Vft,[c("div",zft,[Hft,c("span",qft,se(Math.floor(i.addModel.progress))+"%",1)]),c("div",{class:"mx-1 opacity-80 line-clamp-1",title:i.addModel.url},se(i.addModel.url),9,Yft),c("div",$ft,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:jt({width:i.addModel.progress+"%"})},null,4)]),c("div",Wft,[c("span",Kft,"Download speed: "+se(r.speed_computed)+"/s",1),c("span",jft,se(r.downloaded_size_computed)+"/"+se(r.total_size_computed),1)])])]),c("div",Qft,[c("div",Xft,[c("div",Zft,[c("button",{onClick:e[389]||(e[389]=ae((..._)=>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 ")])])])])):G("",!0)])])],2)]),c("div",Jft,[c("div",emt,[c("button",{onClick:e[392]||(e[392]=ae(_=>i.pzc_collapsed=!i.pzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 text-left w-full flex items-center"},[B(c("div",null,nmt,512),[[Ot,i.pzc_collapsed]]),B(c("div",null,imt,512),[[Ot,!i.pzc_collapsed]]),rmt,r.configFile.personalities?(C(),R("div",omt,"|")):G("",!0),c("div",amt,se(r.active_pesonality),1),r.configFile.personalities?(C(),R("div",lmt,"|")):G("",!0),r.configFile.personalities?(C(),R("div",cmt,[r.mountedPersArr.length>0?(C(),R("div",dmt,[(C(!0),R(ze,null,st(r.mountedPersArr,(_,m)=>(C(),R("div",{class:"relative hover:-translate-y-2 duration-300 hover:z-10 shrink-0",key:m+"-"+_.name,ref_for:!0,ref:"mountedPersonalities"},[c("div",umt,[c("button",{onClick:ae(E=>r.onPersonalitySelected(_),["stop"])},[c("img",{src:i.bUrl+_.avatar,onError:e[390]||(e[390]=(...E)=>r.personalityImgPlacehodler&&r.personalityImgPlacehodler(...E)),class:Fe(["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,_mt)],8,pmt),c("button",{onClick:ae(E=>r.unmountPersonality(_),["stop"])},mmt,8,hmt)])]))),128))])):G("",!0)])):G("",!0),c("button",{onClick:e[391]||(e[391]=ae(_=>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"},bmt)])]),c("div",{class:Fe([{hidden:i.pzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",Emt,[ymt,c("div",vmt,[c("div",Smt,[i.searchPersonalityInProgress?(C(),R("div",Tmt,Cmt)):G("",!0),i.searchPersonalityInProgress?G("",!0):(C(),R("div",wmt,Amt))]),B(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]=_=>i.searchPersonality=_),onKeyup:e[394]||(e[394]=ae((..._)=>r.searchPersonality_func&&r.searchPersonality_func(..._),["stop"]))},null,544),[[he,i.searchPersonality]]),i.searchPersonality?(C(),R("button",{key:0,onClick:e[395]||(e[395]=ae(_=>i.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")):G("",!0)])]),i.searchPersonality?G("",!0):(C(),R("div",Nmt,[c("label",Omt," Personalities Category: ("+se(i.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"},[(C(!0),R(ze,null,st(i.persCatgArr,(_,m)=>(C(),R("option",{key:m,selected:_==this.configFile.personality_category},se(_),9,Imt))),128))],32)])),c("div",null,[i.personalitiesFiltered.length>0?(C(),R("div",Mmt,[c("label",Dmt,se(i.searchPersonality?"Search results":"Personalities")+": ("+se(i.personalitiesFiltered.length)+") ",1),c("div",{class:Fe(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",i.pzl_collapsed?"":"max-h-96"])},[_e(Qs,{name:"bounce"},{default:qe(()=>[(C(!0),R(ze,null,st(i.personalitiesFiltered,(_,m)=>(C(),St(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)])):G("",!0)]),i.pzl_collapsed?(C(),R("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]=_=>i.pzl_collapsed=!i.pzl_collapsed)},Lmt)):(C(),R("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]=_=>i.pzl_collapsed=!i.pzl_collapsed)},Umt))],2)]),c("div",Fmt,[c("div",Bmt,[c("button",{onClick:e[399]||(e[399]=ae(_=>i.mc_collapsed=!i.mc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[B(c("div",null,Vmt,512),[[Ot,i.mc_collapsed]]),B(c("div",null,Hmt,512),[[Ot,!i.mc_collapsed]]),qmt])]),c("div",{class:Fe([{hidden:i.mc_collapsed},"flex flex-col mb-2 p-2"])},[c("div",Ymt,[c("div",$mt,[B(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]=ae(()=>{},["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),[[Ke,r.configFile.override_personality_model_parameters]]),Wmt])]),c("div",{class:Fe(r.configFile.override_personality_model_parameters?"":"pointer-events-none opacity-30")},[c("div",Kmt,[jmt,B(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),[[he,r.configFile.seed]])]),c("div",Qmt,[c("div",Xmt,[c("div",Zmt,[Jmt,c("p",egt,[B(c("input",{type:"text",id:"temp-val","onUpdate:modelValue":e[404]||(e[404]=_=>r.configFile.temperature=_),onChange:e[405]||(e[405]=_=>i.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),[[he,r.configFile.temperature]])])]),B(c("input",{id:"temperature",onChange:e[406]||(e[406]=_=>i.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),[[he,r.configFile.temperature]])])]),c("div",tgt,[c("div",ngt,[c("div",sgt,[igt,c("p",rgt,[B(c("input",{type:"text",id:"predict-val","onUpdate:modelValue":e[408]||(e[408]=_=>r.configFile.n_predict=_),onChange:e[409]||(e[409]=_=>i.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),[[he,r.configFile.n_predict]])])]),B(c("input",{id:"predict",type:"range",onChange:e[410]||(e[410]=_=>i.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),[[he,r.configFile.n_predict]])])]),c("div",ogt,[c("div",agt,[c("div",lgt,[cgt,c("p",dgt,[B(c("input",{type:"text",id:"top_k-val","onUpdate:modelValue":e[412]||(e[412]=_=>r.configFile.top_k=_),onChange:e[413]||(e[413]=_=>i.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),[[he,r.configFile.top_k]])])]),B(c("input",{id:"top_k",type:"range",onChange:e[414]||(e[414]=_=>i.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),[[he,r.configFile.top_k]])])]),c("div",ugt,[c("div",pgt,[c("div",_gt,[hgt,c("p",fgt,[B(c("input",{type:"text",id:"top_p-val","onUpdate:modelValue":e[416]||(e[416]=_=>r.configFile.top_p=_),onChange:e[417]||(e[417]=_=>i.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),[[he,r.configFile.top_p]])])]),B(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]=_=>i.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),[[he,r.configFile.top_p]])])]),c("div",mgt,[c("div",ggt,[c("div",bgt,[Egt,c("p",ygt,[B(c("input",{type:"text",id:"repeat_penalty-val","onUpdate:modelValue":e[420]||(e[420]=_=>r.configFile.repeat_penalty=_),onChange:e[421]||(e[421]=_=>i.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),[[he,r.configFile.repeat_penalty]])])]),B(c("input",{id:"repeat_penalty",onChange:e[422]||(e[422]=_=>i.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),[[he,r.configFile.repeat_penalty]])])]),c("div",vgt,[c("div",Sgt,[c("div",Tgt,[xgt,c("p",Cgt,[B(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]=_=>i.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),[[he,r.configFile.repeat_last_n]])])]),B(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]=_=>i.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),[[he,r.configFile.repeat_last_n]])])])],2)],2)])],2)]),_e(h,{ref:"addmodeldialog"},null,512),_e(f,{class:"z-20",show:i.variantSelectionDialogVisible,choices:i.variant_choices,onChoiceSelected:r.onVariantChoiceSelected,onCloseDialog:r.oncloseVariantChoiceDialog,onChoiceValidated:r.onvalidateVariantChoice},null,8,["show","choices","onChoiceSelected","onCloseDialog","onChoiceValidated"])],64)}const Rgt=pt(Mit,[["render",wgt],["__scopeId","data-v-e519cdb3"]]),Agt={components:{ClipBoardTextInput:Zb,Card:Bu},data(){return{dataset_path:"",max_length:1024,batch_size:4,lr:5e-5,num_epochs:2,selectedFolder:"",selectedDataset:""}},methods:{submitForm(){const n={model_name:this.selectedModel,dataset_file:this.selectedDataset,max_length:this.max_length,batch_size:this.batch_size,lr:this.lr,num_epochs:this.num_epochs,output_dir:this.selectedFolder};de.post("/start_training",n).then(e=>{})},openFolderSelector(){this.$refs.folder_selector.click()},selectOutputDirectory(n){var t;console.log("here");const e=(t=n.target.files[0])==null?void 0:t.path;console.log(e),e&&(this.selectedFolder=e)},selectDataset(n){const e=n.target.files;e.length>0&&(this.selectedDataset=e[0])}},computed:{selectedModel:{get(){return this.$store.state.selectedModel}},models:{get(){return this.$store.state.modelsArr}}},watch:{model_name(n){console.log("watching model_name",n),this.$refs.clipboardInput.inputValue=n}}},Ngt={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"},Ogt={class:"mb-4"},Igt=c("label",{for:"model_name",class:"text-sm"},"Model Name:",-1),Mgt=["value"],Dgt={class:"mb-4"},kgt=c("label",{for:"dataset_path",class:"text-sm"},"Dataset:",-1),Lgt={class:"mb-4"},Pgt=c("label",{for:"lr",class:"text-sm"},"Learning Rate:",-1),Ugt={class:"mb-4"},Fgt=c("label",{for:"num_epochs",class:"text-sm"},"Number of Epochs:",-1),Bgt={class:"mb-4"},Ggt=c("label",{for:"max_length",class:"text-sm"},"Max Length:",-1),Vgt={class:"mb-4"},zgt=c("label",{for:"batch_size",class:"text-sm"},"Batch Size:",-1),Hgt={class:"mb-4"},qgt=c("label",{for:"output_dir",class:"text-sm"},"Output Directory:",-1),Ygt=c("button",{class:"bg-blue-500 text-white px-4 py-2 rounded"},"Start training",-1),$gt={key:1};function Wgt(n,e,t,s,i,r){const o=dt("Card"),a=dt("ClipBoardTextInput");return r.selectedModel!==null&&r.selectedModel.toLowerCase().includes("gptq")?(C(),R("div",Ngt,[c("form",{onSubmit:e[2]||(e[2]=ae((...l)=>r.submitForm&&r.submitForm(...l),["prevent"])),class:""},[_e(o,{title:"Training configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:qe(()=>[_e(o,{title:"Model",class:"",isHorizontal:!1},{default:qe(()=>[c("div",Ogt,[Igt,B(c("select",{"onUpdate:modelValue":e[0]||(e[0]=l=>r.selectedModel=l),onChange:e[1]||(e[1]=(...l)=>n.setModel&&n.setModel(...l)),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},[(C(!0),R(ze,null,st(r.models,l=>(C(),R("option",{key:l,value:l},se(l),9,Mgt))),128))],544),[[qt,r.selectedModel]])])]),_:1}),_e(o,{title:"Data",isHorizontal:!1},{default:qe(()=>[c("div",Dgt,[kgt,_e(a,{id:"model_path",inputType:"file",value:i.dataset_path,onchange:"selectDataset()"},null,8,["value"])])]),_:1}),_e(o,{title:"Training",isHorizontal:!1},{default:qe(()=>[c("div",Lgt,[Pgt,_e(a,{id:"model_path",inputType:"integer",value:i.lr},null,8,["value"])]),c("div",Ugt,[Fgt,_e(a,{id:"model_path",inputType:"integer",value:i.num_epochs},null,8,["value"])]),c("div",Bgt,[Ggt,_e(a,{id:"model_path",inputType:"integer",value:i.max_length},null,8,["value"])]),c("div",Vgt,[zgt,_e(a,{id:"model_path",inputType:"integer",value:i.batch_size},null,8,["value"])])]),_:1}),_e(o,{title:"Output",isHorizontal:!1},{default:qe(()=>[c("div",Hgt,[qgt,_e(a,{id:"model_path",inputType:"text",value:n.output_dir},null,8,["value"])])]),_:1})]),_:1}),_e(o,{disableHoverAnimation:!0,disableFocus:!0},{default:qe(()=>[Ygt]),_:1})],32)])):(C(),R("div",$gt,[_e(o,{title:"Info",class:"",isHorizontal:!1},{default:qe(()=>[Xe(" Only GPTQ models are supported for QLora fine tuning. Please select a GPTQ compatible binding. ")]),_:1})]))}const Kgt=pt(Agt,[["render",Wgt]]),jgt={components:{ClipBoardTextInput:Zb,Card:Bu},data(){return{model_name:"jondurbin/airoboros-7b-gpt4",tokenizer_name:"jondurbin/airoboros-7b-gpt4",dataset_path:"",max_length:1024,batch_size:4,lr:5e-5,num_epochs:2,selectedFolder:"",selectedDatasetPath:""}},methods:{submitForm(){this.model_name,this.tokenizer_name,this.selectedDatasetPath,this.max_length,this.batch_size,this.lr,this.num_epochs,this.selectedFolder},openFolderSelector(){this.$refs.folder_selector.click()},selectOutputDirectory(n){var t;console.log("here");const e=(t=n.target.files[0])==null?void 0:t.path;console.log(e),e&&(this.selectedFolder=e)},selectDatasetPath(n){const e=n.target.files;e.length>0&&(this.selectedDatasetPath=e[0].webkitRelativePath)}}},Qgt={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"},Xgt={class:"mb-4"},Zgt=c("label",{for:"model_name",class:"text-sm"},"Model Name:",-1),Jgt={class:"mb-4"},ebt=c("label",{for:"tokenizer_name",class:"text-sm"},"Tokenizer Name:",-1),tbt=c("button",{type:"submit",class:"bg-blue-500 text-white px-4 py-2 rounded"},"Quantize LLM",-1);function nbt(n,e,t,s,i,r){const o=dt("ClipBoardTextInput"),a=dt("Card");return C(),R("div",Qgt,[c("form",{onSubmit:e[0]||(e[0]=ae((...l)=>r.submitForm&&r.submitForm(...l),["prevent"])),class:"max-w-md mx-auto"},[_e(a,{title:"Quantizing configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:qe(()=>[_e(a,{title:"Model",class:"",isHorizontal:!1},{default:qe(()=>[c("div",Xgt,[Zgt,_e(o,{id:"model_path",inputType:"text",value:i.model_name},null,8,["value"])]),c("div",Jgt,[ebt,_e(o,{id:"model_path",inputType:"text",value:i.tokenizer_name},null,8,["value"])])]),_:1})]),_:1}),_e(a,{disableHoverAnimation:!0,disableFocus:!0},{default:qe(()=>[tbt]),_:1})],32)])}const sbt=pt(jgt,[["render",nbt]]),ibt={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(n){this.newTitle=n},checkedChangeEvent(n,e){this.$emit("checked",n,e)}},mounted(){this.newTitle=this.title,Ue(()=>{Ge.replace()})},watch:{showConfirmation(){Ue(()=>{Ge.replace()})},editTitleMode(n){this.showConfirmation=n,this.editTitle=n,n&&Ue(()=>{try{this.$refs.titleBox.focus()}catch{}})},deleteMode(n){this.showConfirmation=n,n&&Ue(()=>{this.$refs.titleBox.focus()})},makeTitleMode(n){this.showConfirmation=n},checkBoxValue(n,e){this.checkBoxValue_local=n}}},rbt=["id"],obt={class:"flex flex-row items-center gap-2"},abt={key:0},lbt={class:"flex flex-row items-center w-full"},cbt=["title"],dbt=["value"],ubt={class:"flex items-center flex-1 max-h-6"},pbt={key:0,class:"flex gap-3 flex-1 items-center justify-end duration-75"},_bt=c("i",{"data-feather":"x"},null,-1),hbt=[_bt],fbt=c("i",{"data-feather":"check"},null,-1),mbt=[fbt],gbt={key:1,class:"flex gap-3 flex-1 items-center justify-end invisible group-hover:visible duration-75"},bbt=c("i",{"data-feather":"folder"},null,-1),Ebt=[bbt],ybt=c("i",{"data-feather":"type"},null,-1),vbt=[ybt],Sbt=c("i",{"data-feather":"edit-2"},null,-1),Tbt=[Sbt],xbt=c("i",{"data-feather":"trash"},null,-1),Cbt=[xbt];function wbt(n,e,t,s,i,r){return C(),R("div",{class:Fe([t.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-"+t.id,onClick:e[13]||(e[13]=ae(o=>r.selectEvent(),["stop"]))},[c("div",obt,[t.isCheckbox?(C(),R("div",abt,[B(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]=ae(()=>{},["stop"])),"onUpdate:modelValue":e[1]||(e[1]=o=>i.checkBoxValue_local=o),onInput:e[2]||(e[2]=o=>r.checkedChangeEvent(o,t.id))},null,544),[[Ke,i.checkBoxValue_local]])])):G("",!0),t.selected?(C(),R("div",{key:1,class:Fe(["min-h-full w-2 rounded-xl self-stretch",t.loading?"animate-bounce bg-accent ":" bg-secondary "])},null,2)):G("",!0),t.selected?G("",!0):(C(),R("div",{key:2,class:Fe(["w-2",t.loading?"min-h-full w-2 rounded-xl self-stretch animate-bounce bg-accent ":" "])},null,2))]),c("div",lbt,[i.editTitle?G("",!0):(C(),R("p",{key:0,title:t.title,class:"line-clamp-1 w-4/6 ml-1 -mx-5"},se(t.title?t.title==="untitled"?"New discussion":t.title:"New discussion"),9,cbt)),i.editTitle?(C(),R("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:t.title,required:"",onKeydown:[e[3]||(e[3]=Ai(ae(o=>r.editTitleEvent(),["exact"]),["enter"])),e[4]||(e[4]=Ai(ae(o=>i.editTitleMode=!1,["exact"]),["esc"]))],onInput:e[5]||(e[5]=o=>r.chnageTitle(o.target.value)),onClick:e[6]||(e[6]=ae(()=>{},["stop"]))},null,40,dbt)):G("",!0),c("div",ubt,[i.showConfirmation?(C(),R("div",pbt,[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]=ae(o=>r.cancel(),["stop"]))},hbt),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm title changes",type:"button",onClick:e[8]||(e[8]=ae(o=>i.editTitleMode?r.editTitleEvent():i.deleteMode?r.deleteEvent():r.makeTitleEvent(),["stop"]))},mbt)])):G("",!0),i.showConfirmation?G("",!0):(C(),R("div",gbt,[c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Open folder",type:"button",onClick:e[9]||(e[9]=ae(o=>r.openFolderEvent(),["stop"]))},Ebt),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Make a title",type:"button",onClick:e[10]||(e[10]=ae(o=>i.makeTitleMode=!0,["stop"]))},vbt),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Edit title",type:"button",onClick:e[11]||(e[11]=ae(o=>i.editTitleMode=!0,["stop"]))},Tbt),c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Remove discussion",type:"button",onClick:e[12]||(e[12]=ae(o=>i.deleteMode=!0,["stop"]))},Cbt)]))])])],10,rbt)}const tE=pt(ibt,[["render",wbt]]),Rbt={data(){return{show:!1,prompt:"",inputText:""}},methods:{showPanel(){this.show=!0},ok(){this.show=!1,this.$emit("ok",this.inputText)},cancel(){this.show=!1,this.inputText=""}},props:{promptText:{type:String,required:!0}},watch:{promptText(n){this.prompt=n}}},Abt={key:0,class:"fixed top-0 left-0 w-full h-full flex justify-center items-center bg-black bg-opacity-50"},Nbt={class:"bg-white p-8 rounded"},Obt={class:"text-xl font-bold mb-4"};function Ibt(n,e,t,s,i,r){return C(),R("div",null,[i.show?(C(),R("div",Abt,[c("div",Nbt,[c("h2",Obt,se(t.promptText),1),B(c("input",{type:"text","onUpdate:modelValue":e[0]||(e[0]=o=>i.inputText=o),class:"border border-gray-300 px-4 py-2 rounded mb-4"},null,512),[[he,i.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")])])):G("",!0)])}const RN=pt(Rbt,[["render",Ibt]]),Mbt={data(){return{id:0,loading:!1,isCheckbox:!1,isVisible:!1,categories:[],titles:[],content:"",searchQuery:""}},components:{Discussion:tE,MarkdownRenderer:Uu},props:{host:{type:String,required:!1,default:"http://localhost:9600"}},methods:{showSkillsLibrary(){this.isVisible=!0,this.fetchTitles()},closeComponent(){this.isVisible=!1},fetchCategories(){de.post("/get_skills_library_categories",{client_id:this.$store.state.client_id}).then(n=>{this.categories=n.data.categories}).catch(n=>{console.error("Error fetching categories:",n)})},fetchTitles(){console.log("Fetching categories"),de.post("/get_skills_library_titles",{client_id:this.$store.state.client_id}).then(n=>{this.titles=n.data.titles,console.log("titles recovered")}).catch(n=>{console.error("Error fetching titles:",n)})},fetchContent(n){de.post("/get_skills_library_content",{client_id:this.$store.state.client_id,skill_id:n}).then(e=>{const t=e.data.contents[0];this.id=t.id,this.content=t.content}).catch(e=>{console.error("Error fetching content:",e)})},deleteCategory(n){console.log("Delete category")},editCategory(n){console.log("Edit category")},checkUncheckCategory(n){console.log("Unchecked category")},deleteSkill(n){console.log("Delete skill ",n),de.post("/delete_skill",{client_id:this.$store.state.client_id,skill_id:n}).then(()=>{this.fetchTitles()})},editTitle(n){de.post("/edit_skill_title",{client_id:this.$store.state.client_id,skill_id:n,title:n}).then(()=>{this.fetchTitles()}),console.log("Edit title")},makeTitle(n){console.log("Make title")},checkUncheckTitle(n){},searchSkills(){}}},Dbt={id:"leftPanel",class:"flex flex-row h-full flex-grow shadow-lg rounded"},kbt={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"},Lbt={class:"search p-4"},Pbt={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"},Ubt=c("h2",{class:"text-xl font-bold m-4"},"Titles",-1),Fbt={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"},Bbt=c("h2",{class:"text-xl font-bold m-4"},"Content",-1);function Gbt(n,e,t,s,i,r){const o=dt("Discussion"),a=dt("MarkdownRenderer");return C(),R("div",{class:Fe([{hidden:!i.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",Dbt,[c("div",kbt,[c("div",Lbt,[B(c("input",{type:"text","onUpdate:modelValue":e[0]||(e[0]=l=>i.searchQuery=l),placeholder:"Search skills",class:"border border-gray-300 rounded px-2 py-1 mr-2"},null,512),[[he,i.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",Pbt,[Ubt,i.titles.length>0?(C(),St(Qs,{key:0,name:"list"},{default:qe(()=>[(C(!0),R(ze,null,st(i.titles,l=>(C(),St(o,{key:l.id,id:l.id,title:l.title,selected:r.fetchContent(l.id),loading:i.loading,isCheckbox:i.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})):G("",!0)])]),c("div",Fbt,[Bbt,_e(a,{host:t.host,"markdown-text":i.content,message_id:i.id,discussion_id:i.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 AN=pt(Mbt,[["render",Gbt]]),Vbt={props:{htmlContent:{type:String,required:!0}}},zbt=["innerHTML"];function Hbt(n,e,t,s,i,r){return C(),R("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:t.htmlContent},null,8,zbt)}const qbt=pt(Vbt,[["render",Hbt]]);const Ybt={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}}},$bt={key:0},Wbt={class:"toggle-icon mr-1"},Kbt={key:0,class:"fas fa-plus-circle text-gray-600"},jbt={key:1,class:"fas fa-minus-circle text-gray-600"},Qbt={class:"json-viewer max-h-64 overflow-auto p-4 bg-gray-100 border border-gray-300 rounded dark:bg-gray-600"},Xbt={key:0,class:"fas fa-plus-circle text-gray-600"},Zbt={key:1,class:"fas fa-minus-circle text-gray-600"},Jbt=["innerHTML"];function eEt(n,e,t,s,i,r){return r.isContentPresent?(C(),R("div",$bt,[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",Wbt,[i.collapsed?(C(),R("i",Kbt)):(C(),R("i",jbt))]),Xe(" "+se(t.jsonFormText),1)]),B(c("div",null,[c("div",Qbt,[r.isObject?(C(),R("span",{key:0,onClick:e[1]||(e[1]=(...o)=>r.toggleCollapsed&&r.toggleCollapsed(...o)),class:"toggle-icon cursor-pointer mr-1"},[i.collapsed?(C(),R("i",Xbt)):(C(),R("i",Zbt))])):G("",!0),c("pre",{innerHTML:r.formattedJson},null,8,Jbt)])],512),[[Ot,!i.collapsed]])])):G("",!0)}const tEt=pt(Ybt,[["render",eEt]]),nEt={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"}}},sEt={class:"flex items-start"},iEt={class:"step flex items-center mb-4"},rEt={key:0,class:"flex items-center justify-center w-6 h-6 mr-2"},oEt={key:0},aEt=c("i",{"data-feather":"square",class:"text-gray-400 w-4 h-4"},null,-1),lEt=[aEt],cEt={key:1},dEt=c("i",{"data-feather":"check-square",class:"text-green-500 w-4 h-4"},null,-1),uEt=[dEt],pEt={key:2},_Et=c("i",{"data-feather":"x-square",class:"text-red-500 w-4 h-4"},null,-1),hEt=[_Et],fEt={key:1,role:"status",class:"m-15"},mEt=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),gEt=[mEt],bEt={class:"text-sm ml-6"};function EEt(n,e,t,s,i,r){return C(),R("div",sEt,[c("div",iEt,[t.step_type=="start_end"?(C(),R("div",rEt,[t.done?G("",!0):(C(),R("div",oEt,lEt)),t.done&&t.status?(C(),R("div",cEt,uEt)):G("",!0),t.done&&!t.status?(C(),R("div",pEt,hEt)):G("",!0)])):G("",!0),t.done?G("",!0):(C(),R("div",fEt,gEt)),c("h3",bEt,se(t.message),1)])])}const yEt=pt(nEt,[["render",EEt]]),vEt="/assets/process-61f7a21b.svg",SEt="/assets/ok-a0b56451.svg",TEt="/assets/failed-183609e7.svg",NN="/assets/send_globe-305330b9.svg";const xEt="/",CEt={name:"Message",emits:["copy","delete","rankUp","rankDown","updateMessage","resendMessage","continueMessage"],components:{MarkdownRenderer:Uu,Step:yEt,RenderHTMLJS:qbt,JsonViewer:tEt,DynamicUIRenderer:wN},props:{host:{type:String,required:!1,default:"http://localhost:9600"},message:Object,avatar:{default:""}},data(){return{ui_componentKey:0,isSynthesizingVoice:!1,cpp_block:yN,html5_block:vN,LaTeX_block:SN,json_block:EN,javascript_block:bN,process_svg:vEt,ok_svg:SEt,failed_svg:TEt,loading_svg:xN,sendGlobe:NN,code_block:mN,python_block:gN,bash_block:TN,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."),Ue(()=>{Ge.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 n of this.message.metadata)Object.prototype.hasOwnProperty.call(n,"audio_url")&&n.audio_url!=null&&(this.audio_url=n.audio_url,console.log("Audio URL:",this.audio_url))}},methods:{computeTimeDiff(n,e){let t=e.getTime()-n.getTime();const s=Math.floor(t/(1e3*60*60));t-=s*(1e3*60*60);const i=Math.floor(t/(1e3*60));t-=i*(1e3*60);const r=Math.floor(t/1e3);return t-=r*1e3,[s,i,r]},insertTab(n){const e=n.target,t=e.selectionStart,s=e.selectionEnd,i=n.shiftKey;if(t===s)if(i){if(e.value.substring(t-4,t)==" "){const r=e.value.substring(0,t-4),o=e.value.substring(s),a=r+o;this.message.content=a,this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t-4})}}else{const r=e.value.substring(0,t),o=e.value.substring(s),a=r+" "+o;this.message.content=a,this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t+4})}else{const o=e.value.substring(t,s).split(` `).map(d=>d.trim()===""?d:i?d.startsWith(" ")?d.substring(4):d:" "+d),a=e.value.substring(0,t),l=e.value.substring(s),u=a+o.join(` `)+l;this.message.content=u,this.$nextTick(()=>{e.selectionStart=t,e.selectionEnd=s+o.length*4})}n.preventDefault()},onVoicesChanged(){this.voices=this.speechSynthesis.getVoices()},read(){this.isSynthesizingVoice?(this.isSynthesizingVoice=!1,this.$refs.audio_player.pause()):(this.isSynthesizingVoice=!0,de.post("./text2wav",{text:this.message.content}).then(n=>{this.isSynthesizingVoice=!1;let e=n.data.url;console.log(e),this.audio_url=e,this.message.metadata||(this.message.metadata=[]);let t=!1;for(let s of this.message.metadata)Object.prototype.hasOwnProperty.call(s,"audio_url")&&(s.audio_url=this.audio_url,t=!0);t||this.message.metadata.push({audio_url:this.audio_url}),this.$emit("updateMessage",this.message.id,this.message.content,this.audio_url)}).catch(n=>{this.$store.state.toast.showToast(`Error: ${n}`,4,!1),this.isSynthesizingVoice=!1}))},async speak(){if(this.$store.state.config.active_tts_service!="browser"&&this.$store.state.config.active_tts_service!="None")this.isSpeaking?(this.isSpeaking=!0,de.post("./stop",{text:this.message.content}).then(n=>{this.isSpeaking=!1}).catch(n=>{this.$store.state.toast.showToast(`Error: ${n}`,4,!1),this.isSpeaking=!1})):(this.isSpeaking=!0,de.post("./text2Audio",{client_id:this.$store.state.client_id,text:this.message.content}).then(n=>{this.isSpeaking=!1}).catch(n=>{this.$store.state.toast.showToast(`Error: ${n}`,4,!1),this.isSpeaking=!1}));else{if(this.msg){this.speechSynthesis.cancel(),this.msg=null,this.isSpeaking=!1;return}let n=0;console.log("voice on"),this.isSpeaking=!0;const e=200;this.message.content,this.msg=new SpeechSynthesisUtterance,this.msg.pitch=this.$store.state.config.audio_pitch,this.voices.length>0&&(this.msg.voice=this.voices.filter(i=>i.name===this.$store.state.config.audio_out_voice)[0]);const t=i=>{let r=this.message.content.substring(i,i+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+i+1},s=()=>{if(this.status_message=="Done"||this.message.content.includes(".")||this.message.content.includes("?")||this.message.content.includes("!")){const i=t(n),r=this.message.content.substring(n,i);this.msg.text=r,n=i+1,this.msg.onend=o=>{n{s()},1):(this.isSpeaking=!1,console.log("voice off :",this.message.content.length," ",i))},this.speechSynthesis.speak(this.msg)}else setTimeout(()=>{s()},1)};console.log("Speaking chunk"),s()}},toggleModel(){this.expanded=!this.expanded},addBlock(n){let e=this.$refs.mdTextarea.selectionStart,t=this.$refs.mdTextarea.selectionEnd;e==t?speechSynthesis==0||this.message.content[e-1]==` `?(this.message.content=this.message.content.slice(0,e)+"```"+n+"\n\n```\n"+this.message.content.slice(e),e=e+4+n.length):(this.message.content=this.message.content.slice(0,e)+"\n```"+n+"\n\n```\n"+this.message.content.slice(e),e=e+3+n.length):speechSynthesis==0||this.message.content[e-1]==` `?(this.message.content=this.message.content.slice(0,e)+"```"+n+` `+this.message.content.slice(e,t)+"\n```\n"+this.message.content.slice(t),e=e+4+n.length):(this.message.content=this.message.content.slice(0,e)+"\n```"+n+` -`+this.message.content.slice(e,t)+"\n```\n"+this.message.content.slice(t),p=p+3+n.length),this.$refs.mdTextarea.focus(),this.$refs.mdTextarea.selectionStart=this.$refs.mdTextarea.selectionEnd=p},copyContentToClipboard(){this.$emit("copy",this)},deleteMsg(){this.$emit("delete",this.message.id),this.deleteMsgMode=!1},rankUp(){this.$emit("rankUp",this.message.id)},rankDown(){this.$emit("rankDown",this.message.id)},updateMessage(){this.$emit("updateMessage",this.message.id,this.message.content,this.audio_url),this.editMsgMode=!1},resendMessage(n){this.$emit("resendMessage",this.message.id,this.message.content,n)},continueMessage(){this.$emit("continueMessage",this.message.id,this.message.content)},getImgUrl(){return this.avatar?TEt+this.avatar:(console.log("No avatar found"),hs)},defaultImg(n){n.target.src=hs},parseDate(n){let e=new Date(Date.parse(n)),s=Math.floor((new Date-e)/1e3);return s<=1?"just now":s<20?s+" seconds ago":s<40?"half a minute ago":s<60?"less than a minute ago":s<=90?"one minute ago":s<=3540?Math.round(s/60)+" minutes ago":s<=5400?"1 hour ago":s<=86400?Math.round(s/3600)+" hours ago":s<=129600?"1 day ago":s<604800?Math.round(s/86400)+" days ago":s<=777600?"1 week ago":n},prettyDate(n){let e=new Date((n||"").replace(/-/g,"/").replace(/[TZ]/g," ")),t=(new Date().getTime()-e.getTime())/1e3,s=Math.floor(t/86400);if(!(isNaN(s)||s<0||s>=31))return s==0&&(t<60&&"just now"||t<120&&"1 minute ago"||t<3600&&Math.floor(t/60)+" minutes ago"||t<7200&&"1 hour ago"||t<86400&&Math.floor(t/3600)+" hours ago")||s==1&&"Yesterday"||s<7&&s+" days ago"||s<31&&Math.ceil(s/7)+" weeks ago"},checkForFullSentence(){if(this.message.content.trim().split(" ").length>3){this.speak();return}}},watch:{audio_url(n){n&&(this.$refs.audio_player.src=n)},"message.content":function(n){this.$store.state.config.auto_speak&&(this.$store.state.config.xtts_enable&&this.$store.state.config.xtts_use_streaming_mode||this.isSpeaking||this.checkForFullSentence())},"message.ui":function(n){console.log("ui changed"),this.ui_componentKey++},showConfirmation(){Ue(()=>{Ge.replace()})},deleteMsgMode(){Ue(()=>{Ge.replace()})}},computed:{editMsgMode:{get(){return this.message.hasOwnProperty("open")?this.editMsgMode_||this.message.open:this.editMsgMode_},set(n){this.message.open=n,this.editMsgMode_=n,Ue(()=>{Ge.replace()})}},isTalking:{get(){return this.isSpeaking}},created_at(){return this.prettyDate(this.message.created_at)},created_at_parsed(){return new Date(Date.parse(this.message.created_at)).toLocaleString()},finished_generating_at_parsed(){return new Date(Date.parse(this.message.finished_generating_at)).toLocaleString()},time_spent(){const n=new Date(Date.parse(this.message.started_generating_at)),e=new Date(Date.parse(this.message.finished_generating_at));if(e.getTime()===n.getTime()||!n.getTime()||!e.getTime())return;let[s,i,r]=this.computeTimeDiff(n,e);function o(l){return l<10&&(l="0"+l),l}return o(s)+"h:"+o(i)+"m:"+o(r)+"s"},warmup_duration(){const n=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, ",n," -> ",e),e.getTime()===n.getTime())return 0;if(!n.getTime()||!e.getTime())return;let s,i,r;[s,i,r]=this.computeTimeDiff(n,e);function o(l){return l<10&&(l="0"+l),l}return o(s)+"h:"+o(i)+"m:"+o(r)+"s"},generation_rate(){const n=new Date(Date.parse(this.message.started_generating_at)),e=new Date(Date.parse(this.message.finished_generating_at)),t=this.message.nb_tokens;if(e.getTime()===n.getTime()||!t||!n.getTime()||!e.getTime())return;let i=e.getTime()-n.getTime();const r=Math.floor(i/1e3),o=t/r;return Math.round(o)+" t/s"}}},CEt={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"},wEt={class:"flex flex-row gap-2"},REt={class:"flex-shrink-0"},AEt={class:"group/avatar"},NEt=["src","data-popover-target"],OEt={class:"flex flex-col w-full flex-grow-0"},IEt={class:"flex flex-row flex-grow items-start"},MEt={class:"flex flex-col mb-2"},DEt={class:"drop-shadow-sm text-lg text-opacity-95 font-bold grow"},kEt=["title"],LEt=c("div",{class:"flex-grow"},null,-1),PEt={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"},UEt={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"},FEt={class:"grid min-w-72 select-none grid-cols-[40px,1fr] items-center gap-2.5 p-2"},BEt={class:"relative grid aspect-square place-content-center overflow-hidden rounded-lg bg-gray-300 dark:bg-gray-200"},GEt=["src"],VEt=["src"],zEt=["src"],HEt={class:"leading-4"},qEt=c("dd",{class:"text-sm"},"Processing infos",-1),YEt={class:"flex items-center gap-1 truncate whitespace-nowrap text-[.82rem] text-gray-400"},$Et={class:"content px-5 pb-5 pt-4"},WEt={class:"list-none"},KEt=c("div",{class:"flex flex-col items-start w-full"},null,-1),jEt={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"},QEt={key:1},XEt={key:2},ZEt=["src"],JEt={class:"flex-row justify-end mx-2"},eyt={class:"invisible group-hover:visible flex flex-row"},tyt={key:0,class:"flex items-center duration-75"},nyt=c("i",{"data-feather":"x"},null,-1),syt=[nyt],iyt=c("i",{"data-feather":"check"},null,-1),ryt=[iyt],oyt=c("i",{"data-feather":"edit"},null,-1),ayt=[oyt],lyt=["src"],cyt=["src"],dyt=["src"],uyt=["src"],pyt=["src"],_yt=["src"],hyt=["src"],fyt=["src"],myt=c("i",{"data-feather":"copy"},null,-1),gyt=[myt],byt=c("i",{"data-feather":"send"},null,-1),Eyt=[byt],yyt=["src"],vyt=c("i",{"data-feather":"send"},null,-1),Syt=[vyt],Tyt=c("i",{"data-feather":"fast-forward"},null,-1),xyt=[Tyt],Cyt={key:14,class:"flex items-center duration-75"},wyt=c("i",{"data-feather":"x"},null,-1),Ryt=[wyt],Ayt=c("i",{"data-feather":"check"},null,-1),Nyt=[Ayt],Oyt=c("i",{"data-feather":"trash"},null,-1),Iyt=[Oyt],Myt=c("i",{"data-feather":"thumbs-up"},null,-1),Dyt=[Myt],kyt={class:"flex flex-row items-center"},Lyt=c("i",{"data-feather":"thumbs-down"},null,-1),Pyt=[Lyt],Uyt={class:"flex flex-row items-center"},Fyt=c("i",{"data-feather":"volume-2"},null,-1),Byt=[Fyt],Gyt={key:16,class:"flex flex-row items-center"},Vyt=c("i",{"data-feather":"voicemail"},null,-1),zyt=[Vyt],Hyt=["src"],qyt={class:"text-sm text-gray-400 mt-2"},Yyt={class:"flex flex-row items-center gap-2"},$yt={key:0},Wyt={class:"font-thin"},Kyt={key:1},jyt={class:"font-thin"},Qyt={key:2},Xyt={class:"font-thin"},Zyt={key:3},Jyt=["title"],evt={key:4},tvt=["title"],nvt={key:5},svt=["title"],ivt={key:6},rvt=["title"];function ovt(n,e,t,s,i,r){var h;const o=dt("Step"),a=dt("RenderHTMLJS"),l=dt("MarkdownRenderer"),u=dt("JsonViewer"),d=dt("DynamicUIRenderer");return C(),R("div",CEt,[c("div",wEt,[c("div",REt,[c("div",AEt,[c("img",{src:r.getImgUrl(),onError:e[0]||(e[0]=f=>r.defaultImg(f)),"data-popover-target":"avatar"+t.message.id,"data-popover-placement":"bottom",class:"w-10 h-10 rounded-full object-fill text-red-700"},null,40,NEt)])]),c("div",OEt,[c("div",IEt,[c("div",MEt,[c("div",DEt,se(t.message.sender)+" ",1),t.message.created_at?(C(),R("div",{key:0,class:"text-sm text-gray-400 font-thin",title:"Created at: "+r.created_at_parsed},se(r.created_at),9,kEt)):G("",!0)]),LEt]),c("div",PEt,[B(c("details",UEt,[c("summary",FEt,[c("div",BEt,[t.message.status_message!="Done"&t.message.status_message!="Generation canceled"?(C(),R("img",{key:0,src:i.loading_svg,class:"w-50 h-50 absolute inset-0 text-gray-100 transition-opacity dark:text-gray-800 opacity-100"},null,8,GEt)):G("",!0),t.message.status_message=="Generation canceled"?(C(),R("img",{key:1,src:i.failed_svg,class:"w-50 h-50 absolute inset-0 text-gray-100 transition-opacity dark:text-gray-800 opacity-100"},null,8,VEt)):G("",!0),t.message.status_message=="Done"?(C(),R("img",{key:2,src:i.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,zEt)):G("",!0)]),c("dl",HEt,[qEt,c("dt",YEt,se(t.message==null?"":t.message.status_message),1)])]),c("div",$Et,[c("ol",WEt,[(C(!0),R(ze,null,st(t.message.steps,(f,_)=>(C(),R("div",{key:"step-"+t.message.id+"-"+_,class:"group border-l pb-6 last:!border-transparent last:pb-0 dark:border-gray-800",style:jt({backgroundColor:f.done?"transparent":"inherit"})},[_e(o,{done:f.done,message:f.message,status:f.status,step_type:f.type},null,8,["done","message","status","step_type"])],4))),128))])])],512),[[Ot,t.message!=null&&t.message.steps!=null&&t.message.steps.length>0]]),KEt,c("div",jEt,[(C(!0),R(ze,null,st(t.message.html_js_s,(f,_)=>(C(),R("div",{key:"htmljs-"+t.message.id+"-"+_,class:"htmljs font-bold",style:jt({backgroundColor:n.step.done?"transparent":"inherit"})},[_e(a,{htmlContent:f},null,8,["htmlContent"])],4))),128))]),r.editMsgMode?G("",!0):(C(),St(l,{key:0,ref:"mdRender",host:t.host,"markdown-text":t.message.content,message_id:t.message.id,discussion_id:t.message.discussion_id,client_id:this.$store.state.client_id},null,8,["host","markdown-text","message_id","discussion_id","client_id"])),c("div",null,[t.message.open?B((C(),R("textarea",{key:0,ref:"mdTextarea",onKeydown:e[1]||(e[1]=Ai(ae((...f)=>r.insertTab&&r.insertTab(...f),["prevent"]),["tab"])),class:"block min-h-[500px] 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[2]||(e[2]=f=>t.message.content=f)},`\r - `,544)),[[he,t.message.content]]):G("",!0)]),t.message.metadata!==null?(C(),R("div",QEt,[(C(!0),R(ze,null,st(((h=t.message.metadata)==null?void 0:h.filter(f=>f!=null&&f.hasOwnProperty("title")&&f.hasOwnProperty("content")))||[],(f,_)=>(C(),R("div",{key:"json-"+t.message.id+"-"+_,class:"json font-bold"},[_e(u,{jsonFormText:f.title,jsonData:f.content},null,8,["jsonFormText","jsonData"])]))),128))])):G("",!0),t.message.ui!==null?(C(),R("div",XEt,[_e(d,{ref:"ui",class:"w-full",ui:t.message.ui},null,8,["ui"])])):G("",!0),i.audio_url!=null?(C(),R("audio",{controls:"",key:i.audio_url},[c("source",{src:i.audio_url,type:"audio/wav",ref:"audio_player"},null,8,ZEt),Xe(" Your browser does not support the audio element. ")])):G("",!0)]),c("div",JEt,[c("div",eyt,[r.editMsgMode?(C(),R("div",tyt,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90 p-2",title:"Cancel edit",type:"button",onClick:e[3]||(e[3]=ae(f=>r.editMsgMode=!1,["stop"]))},syt),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 p-2",title:"Update message",type:"button",onClick:e[4]||(e[4]=ae((...f)=>r.updateMessage&&r.updateMessage(...f),["stop"]))},ryt)])):G("",!0),r.editMsgMode?G("",!0):(C(),R("div",{key:1,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Edit message",onClick:e[5]||(e[5]=ae(f=>r.editMsgMode=!0,["stop"]))},ayt)),r.editMsgMode?(C(),R("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[6]||(e[6]=ae(f=>r.addBlock(""),["stop"]))},[c("img",{src:i.code_block,width:"25",height:"25"},null,8,lyt)])):G("",!0),r.editMsgMode?(C(),R("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[7]||(e[7]=ae(f=>r.addBlock("python"),["stop"]))},[c("img",{src:i.python_block,width:"25",height:"25"},null,8,cyt)])):G("",!0),r.editMsgMode?(C(),R("div",{key:4,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add javascript block",onClick:e[8]||(e[8]=ae(f=>r.addBlock("javascript"),["stop"]))},[c("img",{src:i.javascript_block,width:"25",height:"25"},null,8,dyt)])):G("",!0),r.editMsgMode?(C(),R("div",{key:5,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add json block",onClick:e[9]||(e[9]=ae(f=>r.addBlock("json"),["stop"]))},[c("img",{src:i.json_block,width:"25",height:"25"},null,8,uyt)])):G("",!0),r.editMsgMode?(C(),R("div",{key:6,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add c++ block",onClick:e[10]||(e[10]=ae(f=>r.addBlock("c++"),["stop"]))},[c("img",{src:i.cpp_block,width:"25",height:"25"},null,8,pyt)])):G("",!0),r.editMsgMode?(C(),R("div",{key:7,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add html block",onClick:e[11]||(e[11]=ae(f=>r.addBlock("html"),["stop"]))},[c("img",{src:i.html5_block,width:"25",height:"25"},null,8,_yt)])):G("",!0),r.editMsgMode?(C(),R("div",{key:8,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add LaTex block",onClick:e[12]||(e[12]=ae(f=>r.addBlock("latex"),["stop"]))},[c("img",{src:i.LaTeX_block,width:"25",height:"25"},null,8,hyt)])):G("",!0),r.editMsgMode?(C(),R("div",{key:9,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add bash block",onClick:e[13]||(e[13]=ae(f=>r.addBlock("bash"),["stop"]))},[c("img",{src:i.bash_block,width:"25",height:"25"},null,8,fyt)])):G("",!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[14]||(e[14]=ae(f=>r.copyContentToClipboard(),["stop"]))},gyt),!r.editMsgMode&&t.message.sender!=this.$store.state.mountedPers.name?(C(),R("div",{key:10,class:Fe(["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[15]||(e[15]=ae(f=>r.resendMessage("full_context"),["stop"]))},Eyt,2)):G("",!0),!r.editMsgMode&&t.message.sender!=this.$store.state.mountedPers.name?(C(),R("div",{key:11,class:Fe(["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[16]||(e[16]=ae(f=>r.resendMessage("full_context_with_internet"),["stop"]))},[c("img",{src:i.sendGlobe,width:"25",height:"25"},null,8,yyt)],2)):G("",!0),!r.editMsgMode&&t.message.sender!=this.$store.state.mountedPers.name?(C(),R("div",{key:12,class:Fe(["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[17]||(e[17]=ae(f=>r.resendMessage("simple_question"),["stop"]))},Syt,2)):G("",!0),!r.editMsgMode&&t.message.sender==this.$store.state.mountedPers.name?(C(),R("div",{key:13,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Resend message",onClick:e[18]||(e[18]=ae(f=>r.continueMessage(),["stop"]))},xyt)):G("",!0),i.deleteMsgMode?(C(),R("div",Cyt,[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[19]||(e[19]=ae(f=>i.deleteMsgMode=!1,["stop"]))},Ryt),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Confirm removal",type:"button",onClick:e[20]||(e[20]=ae(f=>r.deleteMsg(),["stop"]))},Nyt)])):G("",!0),!r.editMsgMode&&!i.deleteMsgMode?(C(),R("div",{key:15,class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"Remove message",onClick:e[21]||(e[21]=f=>i.deleteMsgMode=!0)},Iyt)):G("",!0),c("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Upvote",onClick:e[22]||(e[22]=ae(f=>r.rankUp(),["stop"]))},Dyt),c("div",kyt,[c("div",{class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"Downvote",onClick:e[23]||(e[23]=ae(f=>r.rankDown(),["stop"]))},Pyt),t.message.rank!=0?(C(),R("div",{key:0,class:Fe(["rounded-full px-2 text-sm flex items-center justify-center font-bold cursor-pointer",t.message.rank>0?"bg-secondary":"bg-red-600"]),title:"Rank"},se(t.message.rank),3)):G("",!0)]),c("div",Uyt,[this.$store.state.config.active_tts_service!="None"?(C(),R("div",{key:0,class:Fe(["text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",{"text-red-500":r.isTalking}]),title:"speak",onClick:e[24]||(e[24]=ae(f=>r.speak(),["stop"]))},Byt,2)):G("",!0)]),this.$store.state.config.xtts_enable&&!this.$store.state.config.xtts_use_streaming_mode?(C(),R("div",Gyt,[i.isSynthesizingVoice?(C(),R("img",{key:1,src:i.loading_svg},null,8,Hyt)):(C(),R("div",{key:0,class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"generate_audio",onClick:e[25]||(e[25]=ae(f=>r.read(),["stop"]))},zyt))])):G("",!0)])]),c("div",qyt,[c("div",Yyt,[t.message.binding?(C(),R("p",$yt,[Xe("Binding: "),c("span",Wyt,se(t.message.binding),1)])):G("",!0),t.message.model?(C(),R("p",Kyt,[Xe("Model: "),c("span",jyt,se(t.message.model),1)])):G("",!0),t.message.seed?(C(),R("p",Qyt,[Xe("Seed: "),c("span",Xyt,se(t.message.seed),1)])):G("",!0),t.message.nb_tokens?(C(),R("p",Zyt,[Xe("Number of tokens: "),c("span",{class:"font-thin",title:"Number of Tokens: "+t.message.nb_tokens},se(t.message.nb_tokens),9,Jyt)])):G("",!0),r.warmup_duration?(C(),R("p",evt,[Xe("Warmup duration: "),c("span",{class:"font-thin",title:"Warmup duration: "+r.warmup_duration},se(r.warmup_duration),9,tvt)])):G("",!0),r.time_spent?(C(),R("p",nvt,[Xe("Generation duration: "),c("span",{class:"font-thin",title:"Finished generating: "+r.time_spent},se(r.time_spent),9,svt)])):G("",!0),r.generation_rate?(C(),R("p",ivt,[Xe("Rate: "),c("span",{class:"font-thin",title:"Generation rate: "+r.generation_rate},se(r.generation_rate),9,rvt)])):G("",!0)])])])])])}const ON=pt(xEt,[["render",ovt]]),avt="/";de.defaults.baseURL="/";const lvt={name:"MountedPersonalities",props:{onShowPersList:Function,onReady:Function},components:{Toast:Wl,UniversalForm:Xl},data(){return{bUrl:avt,isMounted:!1,show:!1}},async mounted(){await this.constructor(),this.isMounted=!0},async activated(){this.isMounted&&await this.constructor()},computed:{configFile:{get(){return this.$store.state.config},set(n){this.$store.commit("setConfig",n)}},mountedPers:{get(){return this.$store.state.mountedPers},set(n){this.$store.commit("setMountedPers",n)}},personalities:{get(){return this.$store.state.personalities},set(n){this.$store.commit("setPersonalities",n)}},mountedPersArr:{get(){return this.$store.state.mountedPersArr},set(n){this.$store.commit("setMountedPers",n)}}},methods:{async handleOnTalk(){const n=this.mountedPers;console.log("pers:",n),this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating);let e=await de.get("/get_generation_status",{});if(e)if(e.data.status)console.log("Already generating");else{const t=this.$store.state.config.personalities.findIndex(i=>i===n.full_path),s={client_id:this.$store.state.client_id,id:t};e=await de.post("/select_personality",s),console.log("Generating message from ",e.data.status),He.emit("generate_msg_from",{id:-1})}},async remount_personality(){const n=this.mountedPers;if(console.log("Remounting personality ",n),!n)return{status:!1,error:"no personality - mount_personality"};try{console.log("before");const e={client_id:this.$store.state.client_id,category:n.category,folder:n.folder,language:n.language};console.log("after");const t=await de.post("/remount_personality",e);if(console.log("Remounting personality executed:",t),t)return console.log("Remounting personality res"),this.$store.state.toast.showToast("Personality remounted",4,!0),t.data;console.log("failed remount_personality")}catch(e){console.log(e.message,"remount_personality - settings");return}},onSettingsPersonality(n){try{de.get("/get_active_personality_settings").then(e=>{e&&(console.log("pers sett",e),e.data&&Object.keys(e.data).length>0?this.$refs.universalForm.showForm(e.data,"Personality settings - "+n.name,"Save changes","Cancel").then(t=>{try{de.post("/set_active_personality_settings",t).then(s=>{s&&s.data?(console.log("personality set with new settings",s.data),this.$refs.toast.showToast("Personality settings updated successfully!",4,!0)):this.$refs.toast.showToast(`Did not get Personality settings responses. +`+this.message.content.slice(e,t)+"\n```\n"+this.message.content.slice(t),p=p+3+n.length),this.$refs.mdTextarea.focus(),this.$refs.mdTextarea.selectionStart=this.$refs.mdTextarea.selectionEnd=p},copyContentToClipboard(){this.$emit("copy",this)},deleteMsg(){this.$emit("delete",this.message.id),this.deleteMsgMode=!1},rankUp(){this.$emit("rankUp",this.message.id)},rankDown(){this.$emit("rankDown",this.message.id)},updateMessage(){this.$emit("updateMessage",this.message.id,this.message.content,this.audio_url),this.editMsgMode=!1},resendMessage(n){this.$emit("resendMessage",this.message.id,this.message.content,n)},continueMessage(){this.$emit("continueMessage",this.message.id,this.message.content)},getImgUrl(){return this.avatar?xEt+this.avatar:(console.log("No avatar found"),hs)},defaultImg(n){n.target.src=hs},parseDate(n){let e=new Date(Date.parse(n)),s=Math.floor((new Date-e)/1e3);return s<=1?"just now":s<20?s+" seconds ago":s<40?"half a minute ago":s<60?"less than a minute ago":s<=90?"one minute ago":s<=3540?Math.round(s/60)+" minutes ago":s<=5400?"1 hour ago":s<=86400?Math.round(s/3600)+" hours ago":s<=129600?"1 day ago":s<604800?Math.round(s/86400)+" days ago":s<=777600?"1 week ago":n},prettyDate(n){let e=new Date((n||"").replace(/-/g,"/").replace(/[TZ]/g," ")),t=(new Date().getTime()-e.getTime())/1e3,s=Math.floor(t/86400);if(!(isNaN(s)||s<0||s>=31))return s==0&&(t<60&&"just now"||t<120&&"1 minute ago"||t<3600&&Math.floor(t/60)+" minutes ago"||t<7200&&"1 hour ago"||t<86400&&Math.floor(t/3600)+" hours ago")||s==1&&"Yesterday"||s<7&&s+" days ago"||s<31&&Math.ceil(s/7)+" weeks ago"},checkForFullSentence(){if(this.message.content.trim().split(" ").length>3){this.speak();return}}},watch:{audio_url(n){n&&(this.$refs.audio_player.src=n)},"message.content":function(n){this.$store.state.config.auto_speak&&(this.$store.state.config.xtts_enable&&this.$store.state.config.xtts_use_streaming_mode||this.isSpeaking||this.checkForFullSentence())},"message.ui":function(n){console.log("ui changed"),this.ui_componentKey++},showConfirmation(){Ue(()=>{Ge.replace()})},deleteMsgMode(){Ue(()=>{Ge.replace()})}},computed:{editMsgMode:{get(){return this.message.hasOwnProperty("open")?this.editMsgMode_||this.message.open:this.editMsgMode_},set(n){this.message.open=n,this.editMsgMode_=n,Ue(()=>{Ge.replace()})}},isTalking:{get(){return this.isSpeaking}},created_at(){return this.prettyDate(this.message.created_at)},created_at_parsed(){return new Date(Date.parse(this.message.created_at)).toLocaleString()},finished_generating_at_parsed(){return new Date(Date.parse(this.message.finished_generating_at)).toLocaleString()},time_spent(){const n=new Date(Date.parse(this.message.started_generating_at)),e=new Date(Date.parse(this.message.finished_generating_at));if(e.getTime()===n.getTime()||!n.getTime()||!e.getTime())return;let[s,i,r]=this.computeTimeDiff(n,e);function o(l){return l<10&&(l="0"+l),l}return o(s)+"h:"+o(i)+"m:"+o(r)+"s"},warmup_duration(){const n=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, ",n," -> ",e),e.getTime()===n.getTime())return 0;if(!n.getTime()||!e.getTime())return;let s,i,r;[s,i,r]=this.computeTimeDiff(n,e);function o(l){return l<10&&(l="0"+l),l}return o(s)+"h:"+o(i)+"m:"+o(r)+"s"},generation_rate(){const n=new Date(Date.parse(this.message.started_generating_at)),e=new Date(Date.parse(this.message.finished_generating_at)),t=this.message.nb_tokens;if(e.getTime()===n.getTime()||!t||!n.getTime()||!e.getTime())return;let i=e.getTime()-n.getTime();const r=Math.floor(i/1e3),o=t/r;return Math.round(o)+" t/s"}}},wEt={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"},REt={class:"flex flex-row gap-2"},AEt={class:"flex-shrink-0"},NEt={class:"group/avatar"},OEt=["src","data-popover-target"],IEt={class:"flex flex-col w-full flex-grow-0"},MEt={class:"flex flex-row flex-grow items-start"},DEt={class:"flex flex-col mb-2"},kEt={class:"drop-shadow-sm text-lg text-opacity-95 font-bold grow"},LEt=["title"],PEt=c("div",{class:"flex-grow"},null,-1),UEt={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"},FEt={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"},BEt={class:"grid min-w-72 select-none grid-cols-[40px,1fr] items-center gap-2.5 p-2"},GEt={class:"relative grid aspect-square place-content-center overflow-hidden rounded-lg bg-gray-300 dark:bg-gray-200"},VEt=["src"],zEt=["src"],HEt=["src"],qEt={class:"leading-4"},YEt=c("dd",{class:"text-sm"},"Processing infos",-1),$Et={class:"flex items-center gap-1 truncate whitespace-nowrap text-[.82rem] text-gray-400"},WEt={class:"content px-5 pb-5 pt-4"},KEt={class:"list-none"},jEt=c("div",{class:"flex flex-col items-start w-full"},null,-1),QEt={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"},XEt={key:1},ZEt={key:2},JEt=["src"],eyt={class:"flex-row justify-end mx-2"},tyt={class:"invisible group-hover:visible flex flex-row"},nyt={key:0,class:"flex items-center duration-75"},syt=c("i",{"data-feather":"x"},null,-1),iyt=[syt],ryt=c("i",{"data-feather":"check"},null,-1),oyt=[ryt],ayt=c("i",{"data-feather":"edit"},null,-1),lyt=[ayt],cyt=["src"],dyt=["src"],uyt=["src"],pyt=["src"],_yt=["src"],hyt=["src"],fyt=["src"],myt=["src"],gyt=c("i",{"data-feather":"copy"},null,-1),byt=[gyt],Eyt=c("i",{"data-feather":"send"},null,-1),yyt=[Eyt],vyt=["src"],Syt=c("i",{"data-feather":"send"},null,-1),Tyt=[Syt],xyt=c("i",{"data-feather":"fast-forward"},null,-1),Cyt=[xyt],wyt={key:14,class:"flex items-center duration-75"},Ryt=c("i",{"data-feather":"x"},null,-1),Ayt=[Ryt],Nyt=c("i",{"data-feather":"check"},null,-1),Oyt=[Nyt],Iyt=c("i",{"data-feather":"trash"},null,-1),Myt=[Iyt],Dyt=c("i",{"data-feather":"thumbs-up"},null,-1),kyt=[Dyt],Lyt={class:"flex flex-row items-center"},Pyt=c("i",{"data-feather":"thumbs-down"},null,-1),Uyt=[Pyt],Fyt={class:"flex flex-row items-center"},Byt=c("i",{"data-feather":"volume-2"},null,-1),Gyt=[Byt],Vyt={key:16,class:"flex flex-row items-center"},zyt=c("i",{"data-feather":"voicemail"},null,-1),Hyt=[zyt],qyt=["src"],Yyt={class:"text-sm text-gray-400 mt-2"},$yt={class:"flex flex-row items-center gap-2"},Wyt={key:0},Kyt={class:"font-thin"},jyt={key:1},Qyt={class:"font-thin"},Xyt={key:2},Zyt={class:"font-thin"},Jyt={key:3},evt=["title"],tvt={key:4},nvt=["title"],svt={key:5},ivt=["title"],rvt={key:6},ovt=["title"];function avt(n,e,t,s,i,r){var h;const o=dt("Step"),a=dt("RenderHTMLJS"),l=dt("MarkdownRenderer"),u=dt("JsonViewer"),d=dt("DynamicUIRenderer");return C(),R("div",wEt,[c("div",REt,[c("div",AEt,[c("div",NEt,[c("img",{src:r.getImgUrl(),onError:e[0]||(e[0]=f=>r.defaultImg(f)),"data-popover-target":"avatar"+t.message.id,"data-popover-placement":"bottom",class:"w-10 h-10 rounded-full object-fill text-red-700"},null,40,OEt)])]),c("div",IEt,[c("div",MEt,[c("div",DEt,[c("div",kEt,se(t.message.sender)+" ",1),t.message.created_at?(C(),R("div",{key:0,class:"text-sm text-gray-400 font-thin",title:"Created at: "+r.created_at_parsed},se(r.created_at),9,LEt)):G("",!0)]),PEt]),c("div",UEt,[B(c("details",FEt,[c("summary",BEt,[c("div",GEt,[t.message.status_message!="Done"&t.message.status_message!="Generation canceled"?(C(),R("img",{key:0,src:i.loading_svg,class:"w-50 h-50 absolute inset-0 text-gray-100 transition-opacity dark:text-gray-800 opacity-100"},null,8,VEt)):G("",!0),t.message.status_message=="Generation canceled"?(C(),R("img",{key:1,src:i.failed_svg,class:"w-50 h-50 absolute inset-0 text-gray-100 transition-opacity dark:text-gray-800 opacity-100"},null,8,zEt)):G("",!0),t.message.status_message=="Done"?(C(),R("img",{key:2,src:i.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,HEt)):G("",!0)]),c("dl",qEt,[YEt,c("dt",$Et,se(t.message==null?"":t.message.status_message),1)])]),c("div",WEt,[c("ol",KEt,[(C(!0),R(ze,null,st(t.message.steps,(f,_)=>(C(),R("div",{key:"step-"+t.message.id+"-"+_,class:"group border-l pb-6 last:!border-transparent last:pb-0 dark:border-gray-800",style:jt({backgroundColor:f.done?"transparent":"inherit"})},[_e(o,{done:f.done,message:f.message,status:f.status,step_type:f.type},null,8,["done","message","status","step_type"])],4))),128))])])],512),[[Ot,t.message!=null&&t.message.steps!=null&&t.message.steps.length>0]]),jEt,c("div",QEt,[(C(!0),R(ze,null,st(t.message.html_js_s,(f,_)=>(C(),R("div",{key:"htmljs-"+t.message.id+"-"+_,class:"htmljs font-bold",style:jt({backgroundColor:n.step.done?"transparent":"inherit"})},[_e(a,{htmlContent:f},null,8,["htmlContent"])],4))),128))]),r.editMsgMode?G("",!0):(C(),St(l,{key:0,ref:"mdRender",host:t.host,"markdown-text":t.message.content,message_id:t.message.id,discussion_id:t.message.discussion_id,client_id:this.$store.state.client_id},null,8,["host","markdown-text","message_id","discussion_id","client_id"])),c("div",null,[t.message.open?B((C(),R("textarea",{key:0,ref:"mdTextarea",onKeydown:e[1]||(e[1]=Ai(ae((...f)=>r.insertTab&&r.insertTab(...f),["prevent"]),["tab"])),class:"block min-h-[500px] 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[2]||(e[2]=f=>t.message.content=f)},`\r + `,544)),[[he,t.message.content]]):G("",!0)]),t.message.metadata!==null?(C(),R("div",XEt,[(C(!0),R(ze,null,st(((h=t.message.metadata)==null?void 0:h.filter(f=>f!=null&&f.hasOwnProperty("title")&&f.hasOwnProperty("content")))||[],(f,_)=>(C(),R("div",{key:"json-"+t.message.id+"-"+_,class:"json font-bold"},[_e(u,{jsonFormText:f.title,jsonData:f.content},null,8,["jsonFormText","jsonData"])]))),128))])):G("",!0),t.message.ui!==null?(C(),R("div",ZEt,[_e(d,{ref:"ui",class:"w-full",ui:t.message.ui},null,8,["ui"])])):G("",!0),i.audio_url!=null?(C(),R("audio",{controls:"",key:i.audio_url},[c("source",{src:i.audio_url,type:"audio/wav",ref:"audio_player"},null,8,JEt),Xe(" Your browser does not support the audio element. ")])):G("",!0)]),c("div",eyt,[c("div",tyt,[r.editMsgMode?(C(),R("div",nyt,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90 p-2",title:"Cancel edit",type:"button",onClick:e[3]||(e[3]=ae(f=>r.editMsgMode=!1,["stop"]))},iyt),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 p-2",title:"Update message",type:"button",onClick:e[4]||(e[4]=ae((...f)=>r.updateMessage&&r.updateMessage(...f),["stop"]))},oyt)])):G("",!0),r.editMsgMode?G("",!0):(C(),R("div",{key:1,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Edit message",onClick:e[5]||(e[5]=ae(f=>r.editMsgMode=!0,["stop"]))},lyt)),r.editMsgMode?(C(),R("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[6]||(e[6]=ae(f=>r.addBlock(""),["stop"]))},[c("img",{src:i.code_block,width:"25",height:"25"},null,8,cyt)])):G("",!0),r.editMsgMode?(C(),R("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[7]||(e[7]=ae(f=>r.addBlock("python"),["stop"]))},[c("img",{src:i.python_block,width:"25",height:"25"},null,8,dyt)])):G("",!0),r.editMsgMode?(C(),R("div",{key:4,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add javascript block",onClick:e[8]||(e[8]=ae(f=>r.addBlock("javascript"),["stop"]))},[c("img",{src:i.javascript_block,width:"25",height:"25"},null,8,uyt)])):G("",!0),r.editMsgMode?(C(),R("div",{key:5,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add json block",onClick:e[9]||(e[9]=ae(f=>r.addBlock("json"),["stop"]))},[c("img",{src:i.json_block,width:"25",height:"25"},null,8,pyt)])):G("",!0),r.editMsgMode?(C(),R("div",{key:6,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add c++ block",onClick:e[10]||(e[10]=ae(f=>r.addBlock("c++"),["stop"]))},[c("img",{src:i.cpp_block,width:"25",height:"25"},null,8,_yt)])):G("",!0),r.editMsgMode?(C(),R("div",{key:7,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add html block",onClick:e[11]||(e[11]=ae(f=>r.addBlock("html"),["stop"]))},[c("img",{src:i.html5_block,width:"25",height:"25"},null,8,hyt)])):G("",!0),r.editMsgMode?(C(),R("div",{key:8,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add LaTex block",onClick:e[12]||(e[12]=ae(f=>r.addBlock("latex"),["stop"]))},[c("img",{src:i.LaTeX_block,width:"25",height:"25"},null,8,fyt)])):G("",!0),r.editMsgMode?(C(),R("div",{key:9,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add bash block",onClick:e[13]||(e[13]=ae(f=>r.addBlock("bash"),["stop"]))},[c("img",{src:i.bash_block,width:"25",height:"25"},null,8,myt)])):G("",!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[14]||(e[14]=ae(f=>r.copyContentToClipboard(),["stop"]))},byt),!r.editMsgMode&&t.message.sender!=this.$store.state.mountedPers.name?(C(),R("div",{key:10,class:Fe(["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[15]||(e[15]=ae(f=>r.resendMessage("full_context"),["stop"]))},yyt,2)):G("",!0),!r.editMsgMode&&t.message.sender!=this.$store.state.mountedPers.name?(C(),R("div",{key:11,class:Fe(["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[16]||(e[16]=ae(f=>r.resendMessage("full_context_with_internet"),["stop"]))},[c("img",{src:i.sendGlobe,width:"25",height:"25"},null,8,vyt)],2)):G("",!0),!r.editMsgMode&&t.message.sender!=this.$store.state.mountedPers.name?(C(),R("div",{key:12,class:Fe(["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[17]||(e[17]=ae(f=>r.resendMessage("simple_question"),["stop"]))},Tyt,2)):G("",!0),!r.editMsgMode&&t.message.sender==this.$store.state.mountedPers.name?(C(),R("div",{key:13,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Resend message",onClick:e[18]||(e[18]=ae(f=>r.continueMessage(),["stop"]))},Cyt)):G("",!0),i.deleteMsgMode?(C(),R("div",wyt,[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[19]||(e[19]=ae(f=>i.deleteMsgMode=!1,["stop"]))},Ayt),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Confirm removal",type:"button",onClick:e[20]||(e[20]=ae(f=>r.deleteMsg(),["stop"]))},Oyt)])):G("",!0),!r.editMsgMode&&!i.deleteMsgMode?(C(),R("div",{key:15,class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"Remove message",onClick:e[21]||(e[21]=f=>i.deleteMsgMode=!0)},Myt)):G("",!0),c("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Upvote",onClick:e[22]||(e[22]=ae(f=>r.rankUp(),["stop"]))},kyt),c("div",Lyt,[c("div",{class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"Downvote",onClick:e[23]||(e[23]=ae(f=>r.rankDown(),["stop"]))},Uyt),t.message.rank!=0?(C(),R("div",{key:0,class:Fe(["rounded-full px-2 text-sm flex items-center justify-center font-bold cursor-pointer",t.message.rank>0?"bg-secondary":"bg-red-600"]),title:"Rank"},se(t.message.rank),3)):G("",!0)]),c("div",Fyt,[this.$store.state.config.active_tts_service!="None"?(C(),R("div",{key:0,class:Fe(["text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",{"text-red-500":r.isTalking}]),title:"speak",onClick:e[24]||(e[24]=ae(f=>r.speak(),["stop"]))},Gyt,2)):G("",!0)]),this.$store.state.config.xtts_enable&&!this.$store.state.config.xtts_use_streaming_mode?(C(),R("div",Vyt,[i.isSynthesizingVoice?(C(),R("img",{key:1,src:i.loading_svg},null,8,qyt)):(C(),R("div",{key:0,class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"generate_audio",onClick:e[25]||(e[25]=ae(f=>r.read(),["stop"]))},Hyt))])):G("",!0)])]),c("div",Yyt,[c("div",$yt,[t.message.binding?(C(),R("p",Wyt,[Xe("Binding: "),c("span",Kyt,se(t.message.binding),1)])):G("",!0),t.message.model?(C(),R("p",jyt,[Xe("Model: "),c("span",Qyt,se(t.message.model),1)])):G("",!0),t.message.seed?(C(),R("p",Xyt,[Xe("Seed: "),c("span",Zyt,se(t.message.seed),1)])):G("",!0),t.message.nb_tokens?(C(),R("p",Jyt,[Xe("Number of tokens: "),c("span",{class:"font-thin",title:"Number of Tokens: "+t.message.nb_tokens},se(t.message.nb_tokens),9,evt)])):G("",!0),r.warmup_duration?(C(),R("p",tvt,[Xe("Warmup duration: "),c("span",{class:"font-thin",title:"Warmup duration: "+r.warmup_duration},se(r.warmup_duration),9,nvt)])):G("",!0),r.time_spent?(C(),R("p",svt,[Xe("Generation duration: "),c("span",{class:"font-thin",title:"Finished generating: "+r.time_spent},se(r.time_spent),9,ivt)])):G("",!0),r.generation_rate?(C(),R("p",rvt,[Xe("Rate: "),c("span",{class:"font-thin",title:"Generation rate: "+r.generation_rate},se(r.generation_rate),9,ovt)])):G("",!0)])])])])])}const ON=pt(CEt,[["render",avt]]),lvt="/";de.defaults.baseURL="/";const cvt={name:"MountedPersonalities",props:{onShowPersList:Function,onReady:Function},components:{Toast:Wl,UniversalForm:Xl},data(){return{bUrl:lvt,isMounted:!1,show:!1}},async mounted(){await this.constructor(),this.isMounted=!0},async activated(){this.isMounted&&await this.constructor()},computed:{configFile:{get(){return this.$store.state.config},set(n){this.$store.commit("setConfig",n)}},mountedPers:{get(){return this.$store.state.mountedPers},set(n){this.$store.commit("setMountedPers",n)}},personalities:{get(){return this.$store.state.personalities},set(n){this.$store.commit("setPersonalities",n)}},mountedPersArr:{get(){return this.$store.state.mountedPersArr},set(n){this.$store.commit("setMountedPers",n)}}},methods:{async handleOnTalk(){const n=this.mountedPers;console.log("pers:",n),this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating);let e=await de.get("/get_generation_status",{});if(e)if(e.data.status)console.log("Already generating");else{const t=this.$store.state.config.personalities.findIndex(i=>i===n.full_path),s={client_id:this.$store.state.client_id,id:t};e=await de.post("/select_personality",s),console.log("Generating message from ",e.data.status),He.emit("generate_msg_from",{id:-1})}},async remount_personality(){const n=this.mountedPers;if(console.log("Remounting personality ",n),!n)return{status:!1,error:"no personality - mount_personality"};try{console.log("before");const e={client_id:this.$store.state.client_id,category:n.category,folder:n.folder,language:n.language};console.log("after");const t=await de.post("/remount_personality",e);if(console.log("Remounting personality executed:",t),t)return console.log("Remounting personality res"),this.$store.state.toast.showToast("Personality remounted",4,!0),t.data;console.log("failed remount_personality")}catch(e){console.log(e.message,"remount_personality - settings");return}},onSettingsPersonality(n){try{de.get("/get_active_personality_settings").then(e=>{e&&(console.log("pers sett",e),e.data&&Object.keys(e.data).length>0?this.$refs.universalForm.showForm(e.data,"Personality settings - "+n.name,"Save changes","Cancel").then(t=>{try{de.post("/set_active_personality_settings",t).then(s=>{s&&s.data?(console.log("personality set with new settings",s.data),this.$refs.toast.showToast("Personality settings updated successfully!",4,!0)):this.$refs.toast.showToast(`Did not get Personality settings responses. `+s,4,!1)})}catch(s){this.$refs.toast.showToast(`Did not get Personality settings responses. - Endpoint error: `+s.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(Ue(()=>{Ge.replace()});this.$store.state.ready===!1;)await new Promise(n=>setTimeout(n,100));this.onReady()},async api_get_req(n){try{const e=await de.get("/"+n);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - mountedPersonalities");return}},personalityImgPlacehodler(n){n.target.src=Gu}}},cvt={class:"w-fit flex select-none"},dvt={class:"w-fit flex select-none"},uvt={class:"w-8 h-8 group relative"},pvt=["src","title"],_vt={class:"opacity-0 group-hover:opacity-100"},hvt=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),fvt=[hvt],mvt=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),gvt=[mvt];function bvt(n,e,t,s,i,r){const o=dt("UniversalForm");return C(),R(ze,null,[c("div",cvt,[c("div",dvt,[c("div",uvt,[c("img",{src:i.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,pvt),c("div",_vt,[n.personalityHoveredIndex===n.index?(C(),R("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]=ae(a=>r.remount_personality(),["prevent"]))},fvt)):G("",!0),n.personalityHoveredIndex===n.index?(C(),R("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]=ae(a=>r.handleOnTalk(),["prevent"]))},gvt)):G("",!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]=ae((...a)=>r.toggleShowPersList&&r.toggleShowPersList(...a),["stop"])),title:"Click to show more"},"+"+se(r.mountedPersArr.length-1),1)])])])]),_e(o,{ref:"universalForm",class:"z-50"},null,512)],64)}const Evt=pt(lvt,[["render",bvt]]);const yvt="/";de.defaults.baseURL="/";const vvt={props:{onTalk:Function,onMounted:Function,onUnmounted:Function,onRemounted:Function,discussionPersonalities:Array,onShowPersList:Function},components:{PersonalityEntry:CN,Toast:Wl,UniversalForm:Xl},name:"MountedPersonalitiesList",data(){return{posts_headers:{accept:"application/json","Content-Type":"application/json"},bUrl:yvt,isMounted:!1,isLoading:!1}},async mounted(){await this.constructor(),this.isMounted=!0},async activated(){this.isMounted&&await this.constructor()},computed:{configFile:{get(){return this.$store.state.config},set(n){this.$store.commit("setConfig",n)}},personalities:{get(){return this.$store.state.personalities},set(n){this.$store.commit("setPersonalities",n)}},mountedPersArr:{get(){return this.$store.state.mountedPersArr},set(n){this.$store.commit("setMountedPers",n)}}},methods:{async onCopyToCustom(n){await de.post("/copy_to_custom_personas",{client_id:this.$store.state.client_id,category:n.personality.category,name:n.personality.name})},onCopyPersonalityName(n){this.$store.state.toast.showToast("Copied name to clipboard!",4,!0),navigator.clipboard.writeText(n.name)},toggleShowPersList(){this.onShowPersList()},async constructor(){},async api_get_req(n){try{const e=await de.get("/"+n);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - mountedPersonalities");return}},personalityImgPlacehodler(n){n.target.src=Gu},onPersonalityReinstall(n){console.log("on reinstall ",n),this.isLoading=!0,de.post("/reinstall_personality",{name:n.personality.full_path}).then(e=>{if(e)return this.isLoading=!1,console.log("reinstall_personality",e),e.data.status?this.$refs.toast.showToast("Personality reinstalled successfully!",4,!0):this.$refs.toast.showToast("Could not reinstall personality",4,!1),e.data;this.isLoading=!1}).catch(e=>(this.isLoading=!1,this.$refs.toast.showToast(`Could not reinstall personality + Endpoint error: `+s.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(Ue(()=>{Ge.replace()});this.$store.state.ready===!1;)await new Promise(n=>setTimeout(n,100));this.onReady()},async api_get_req(n){try{const e=await de.get("/"+n);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - mountedPersonalities");return}},personalityImgPlacehodler(n){n.target.src=Gu}}},dvt={class:"w-fit flex select-none"},uvt={class:"w-fit flex select-none"},pvt={class:"w-8 h-8 group relative"},_vt=["src","title"],hvt={class:"opacity-0 group-hover:opacity-100"},fvt=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),mvt=[fvt],gvt=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),bvt=[gvt];function Evt(n,e,t,s,i,r){const o=dt("UniversalForm");return C(),R(ze,null,[c("div",dvt,[c("div",uvt,[c("div",pvt,[c("img",{src:i.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,_vt),c("div",hvt,[n.personalityHoveredIndex===n.index?(C(),R("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]=ae(a=>r.remount_personality(),["prevent"]))},mvt)):G("",!0),n.personalityHoveredIndex===n.index?(C(),R("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]=ae(a=>r.handleOnTalk(),["prevent"]))},bvt)):G("",!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]=ae((...a)=>r.toggleShowPersList&&r.toggleShowPersList(...a),["stop"])),title:"Click to show more"},"+"+se(r.mountedPersArr.length-1),1)])])])]),_e(o,{ref:"universalForm",class:"z-50"},null,512)],64)}const yvt=pt(cvt,[["render",Evt]]);const vvt="/";de.defaults.baseURL="/";const Svt={props:{onTalk:Function,onMounted:Function,onUnmounted:Function,onRemounted:Function,discussionPersonalities:Array,onShowPersList:Function},components:{PersonalityEntry:CN,Toast:Wl,UniversalForm:Xl},name:"MountedPersonalitiesList",data(){return{posts_headers:{accept:"application/json","Content-Type":"application/json"},bUrl:vvt,isMounted:!1,isLoading:!1}},async mounted(){await this.constructor(),this.isMounted=!0},async activated(){this.isMounted&&await this.constructor()},computed:{configFile:{get(){return this.$store.state.config},set(n){this.$store.commit("setConfig",n)}},personalities:{get(){return this.$store.state.personalities},set(n){this.$store.commit("setPersonalities",n)}},mountedPersArr:{get(){return this.$store.state.mountedPersArr},set(n){this.$store.commit("setMountedPers",n)}}},methods:{async onCopyToCustom(n){await de.post("/copy_to_custom_personas",{client_id:this.$store.state.client_id,category:n.personality.category,name:n.personality.name})},onCopyPersonalityName(n){this.$store.state.toast.showToast("Copied name to clipboard!",4,!0),navigator.clipboard.writeText(n.name)},toggleShowPersList(){this.onShowPersList()},async constructor(){},async api_get_req(n){try{const e=await de.get("/"+n);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - mountedPersonalities");return}},personalityImgPlacehodler(n){n.target.src=Gu},onPersonalityReinstall(n){console.log("on reinstall ",n),this.isLoading=!0,de.post("/reinstall_personality",{name:n.personality.full_path}).then(e=>{if(e)return this.isLoading=!1,console.log("reinstall_personality",e),e.data.status?this.$refs.toast.showToast("Personality reinstalled successfully!",4,!0):this.$refs.toast.showToast("Could not reinstall personality",4,!1),e.data;this.isLoading=!1}).catch(e=>(this.isLoading=!1,this.$refs.toast.showToast(`Could not reinstall personality `+e.message,4,!1),{status:!1}))},editPersonality(n){n=n.personality,de.post("/get_personality_config",{client_id:this.$store.state.client_id,category:n.category,name:n.folder}).then(e=>{const t=e.data;console.log("Done"),t.status?(this.$store.state.currentPersonConfig=t.config,this.$store.state.showPersonalityEditor=!0,this.$store.state.personality_editor.showPanel(),this.$store.state.selectedPersonality=n):console.error(t.error)}).catch(e=>{console.error(e)})},onPersonalityMounted(n){this.mountPersonality(n)},onPersonalityUnMounted(n){this.unmountPersonality(n)},onPersonalityRemount(n){this.reMountPersonality(n)},async handleOpenFolder(n){const e={client_id:this.$store.state.client_id,personality_folder:n.personality.folder};console.log(e),await de.post("/open_personality_folder",e)},async handleOnTalk(n){if(Ge.replace(),console.log("ppa",n),n){if(n.isMounted){const e=await this.select_personality(n);e&&e.status&&(await this.constructor(),this.$refs.toast.showToast(`Selected personality: `+n.name,4,!0))}else this.onPersonalityMounted(n);this.onTalk(n)}},async onPersonalitySelected(n){if(Ge.replace(),console.log("Selected personality : ",JSON.stringify(n.personality)),n){if(n.selected){this.$refs.toast.showToast("Personality already selected",4,!0);return}if(n.isMounted){const e=await this.select_personality(n);e&&e.status&&(await this.constructor(),this.$refs.toast.showToast(`Selected personality: `+n.name,4,!0))}else this.onPersonalityMounted(n)}},onSettingsPersonality(n){try{de.get("/get_active_personality_settings").then(e=>{e&&(console.log("pers sett",e),e.data&&Object.keys(e.data).length>0?this.$refs.universalForm.showForm(e.data,"Personality settings - "+n.personality.name,"Save changes","Cancel").then(t=>{try{de.post("/set_active_personality_settings",t).then(s=>{s&&s.data?(console.log("personality set with new settings",s.data),this.$refs.toast.showToast("Personality settings updated successfully!",4,!0)):this.$refs.toast.showToast(`Did not get Personality settings responses. @@ -173,15 +174,15 @@ If You are using windows, this will install wsl so you need to activate it. Error: `+e.error,4,!1))},async reMountPersonality(n){if(console.log("remount pers",n),!n)return;if(!this.configFile.personalities.includes(n.personality.full_path)){this.$refs.toast.showToast("Personality not mounted",4,!1);return}const e=await this.remount_personality(n.personality);console.log("remount_personality res",e),e.status?(this.configFile.personalities=e.personalities,this.$refs.toast.showToast("Personality remounted",4,!0),n.isMounted=!0,this.onMounted(this),(await this.select_personality(n.personality)).status&&this.$refs.toast.showToast(`Selected personality: `+n.personality.name,4,!0),this.getMountedPersonalities()):(n.isMounted=!1,this.$refs.toast.showToast(`Could not mount personality Error: `+e.error,4,!1))},async unmountPersonality(n){if(!n)return;console.log(`Unmounting ${JSON.stringify(n.personality)}`);const e=await this.unmount_personality(n.personality);if(e.status){console.log("unmount response",e),this.configFile.active_personality_id=e.active_personality_id,this.configFile.personalities=e.personalities;const t=this.configFile.personalities[this.configFile.active_personality_id],s=this.personalities.findIndex(a=>a.full_path==t),i=this.$refs.personalitiesZoo.findIndex(a=>a.full_path==n.full_path),r=this.personalities[s];r.isMounted=!1,r.selected=!0,this.$refs.personalitiesZoo[i].isMounted=!1,this.getMountedPersonalities(),(await this.select_personality(r)).status&&Ge.replace(),this.$refs.toast.showToast("Personality unmounted",4,!0),this.onUnMounted(this)}else this.$refs.toast.showToast(`Could not unmount personality -Error: `+e.error,4,!1)},getMountedPersonalities(){this.isLoading=!0;let n=[];console.log(this.configFile.personalities.length);for(let e=0;er.full_path==t),i=this.personalities[s];if(i)console.log("adding from config"),n.push(i);else{console.log("adding default");const r=this.personalities.findIndex(a=>a.full_path=="english/generic/lollms"),o=this.personalities[r];n.push(o)}}if(this.mountedPersArr=[],this.mountedPersArr=n,console.log("discussionPersonalities",this.discussionPersonalities),this.discussionPersonalities!=null&&this.discussionPersonalities.length>0)for(let e=0;ei.full_path==t);if(console.log("discussionPersonalities -includes",s),console.log("discussionPersonalities -mounted list",this.mountedPersArr),s==-1){const i=this.personalities.findIndex(o=>o.full_path==t),r=this.personalities[i];console.log("adding discucc121",r,t),r&&(this.mountedPersArr.push(r),console.log("adding discucc",r))}}this.isLoading=!1,console.log("getMountedPersonalities",this.mountedPersArr),console.log("fig",this.configFile)}}},nE=n=>(no("data-v-de7bc8fe"),n=n(),so(),n),Svt={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"},Tvt={key:0,role:"status",class:"flex justify-center overflow-y-hidden"},xvt=nE(()=>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)),Cvt=nE(()=>c("span",{class:"sr-only"},"Loading...",-1)),wvt=[xvt,Cvt],Rvt=nE(()=>c("i",{"data-feather":"chevron-down"},null,-1)),Avt=[Rvt],Nvt={class:"block my-2 text-sm font-medium text-gray-900 dark:text-white"},Ovt={class:"overflow-y-auto no-scrollbar pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4 max-h-96"};function Ivt(n,e,t,s,i,r){const o=dt("personality-entry"),a=dt("Toast"),l=dt("UniversalForm");return C(),R("div",Svt,[i.isLoading?(C(),R("div",Tvt,wvt)):G("",!0),c("div",null,[r.mountedPersArr.length>0?(C(),R("div",{key:0,class:Fe(i.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]=ae((...u)=>r.toggleShowPersList&&r.toggleShowPersList(...u),["stop"]))},Avt),c("label",Nvt," Mounted Personalities: ("+se(r.mountedPersArr.length)+") ",1),c("div",Ovt,[_e(Qs,{name:"bounce"},{default:qe(()=>[(C(!0),R(ze,null,st(this.$store.state.mountedPersArr,(u,d)=>(C(),St(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)):G("",!0)]),_e(a,{ref:"toast"},null,512),_e(l,{ref:"universalForm",class:"z-20"},null,512)])}const Mvt=pt(vvt,[["render",Ivt],["__scopeId","data-v-de7bc8fe"]]);const Dvt={components:{InteractiveMenu:Jb},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),Ue(()=>{Ge.replace()})},methods:{isHTML(n){const t=new DOMParser().parseFromString(n,"text/html");return Array.from(t.body.childNodes).some(s=>s.nodeType===Node.ELEMENT_NODE)},selectFile(n,e){const t=document.createElement("input");t.type="file",t.accept=n,t.onchange=s=>{this.selectedFile=s.target.files[0],console.log("File selected"),e()},t.click()},uploadFile(){new FormData().append("file",this.selectedFile),console.log("Uploading file"),this.loading=!0;const e=new FileReader;e.onload=()=>{const t={filename:this.selectedFile.name,fileData:e.result};He.on("file_received",s=>{s.status?this.onShowToastMessage("File uploaded successfully",4,!0):this.onShowToastMessage(`Couldn't upload file -`+s.error,4,!1),this.loading=!1,He.off("file_received")}),He.emit("send_file",t)},e.readAsDataURL(this.selectedFile)},async constructor(){Ue(()=>{Ge.replace()})},toggleMenu(){this.showMenu=!this.showMenu},execute_cmd(n){this.showMenu=!this.showMenu,n.hasOwnProperty("is_file")?(console.log("Need to send a file."),this.selectFile(n.hasOwnProperty("file_types")?n.file_types:"*",()=>{this.selectedFile!=null&&this.uploadFile()})):this.sendCommand(n.value)},handleClickOutside(n){const e=this.$el.querySelector(".commands-menu-items-wrapper");e&&!e.contains(n.target)&&(this.showMenu=!1)}},beforeUnmount(){document.removeEventListener("click",this.handleClickOutside)}},kvt=n=>(no("data-v-1a32c141"),n=n(),so(),n),Lvt={key:0,title:"Loading..",class:"flex flex-row flex-grow justify-end"},Pvt=kvt(()=>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)),Uvt=[Pvt];function Fvt(n,e,t,s,i,r){const o=dt("InteractiveMenu");return i.loading?(C(),R("div",Lvt,Uvt)):(C(),St(o,{key:1,commands:t.commandsList,execute_cmd:r.execute_cmd},null,8,["commands","execute_cmd"]))}const Bvt=pt(Dvt,[["render",Fvt],["__scopeId","data-v-1a32c141"]]),Gvt="/assets/loader_v0-16906488.svg";console.log("modelImgPlaceholder:",ws);const Vvt="/",zvt={name:"ChatBox",emits:["messageSentEvent","sendCMDEvent","stopGenerating","loaded","createEmptyUserMessage","createEmptyAIMessage","personalitySelected","addWebLink"],props:{onTalk:Function,discussionList:Array,loading:{default:!1},onShowToastMessage:Function},components:{UniversalForm:Xl,MountedPersonalities:Evt,MountedPersonalitiesList:Mvt,PersonalitiesCommands:Bvt},setup(){},data(){return{is_rt:!1,bindingHoveredIndex:null,modelHoveredIndex:null,personalityHoveredIndex:null,loader_v0:Gvt,sendGlobe:NN,modelImgPlaceholder:ws,bUrl:Vvt,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 n=this.$store.state.config.rag_databases.map(e=>{console.log("entry",e);const t=e.split("::");console.log("extracted",t[0]);const i=e.endsWith("mounted")?"feather:check":"";return console.log("icon decision",i),{name:t[0],value:t[0]||"default_value",icon:i,help:"mounts the database"}});return console.log("formatted data sources",n),n},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 n=[];for(let e=0;e0&&this.addFiles(t)},toggleSwitch(){this.$store.state.config.activate_internet_search=!this.$store.state.config.activate_internet_search,this.isLoading=!0,de.post("/apply_settings",{config:this.$store.state.config}).then(n=>{this.isLoading=!1,n.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),Ue(()=>{Ge.replace()})})},copyModelName(){navigator.clipboard.writeText(this.binding_name+"::"+this.model_name),this.$store.state.toast.showToast("Model name copyed to clipboard: "+this.binding_name+"::"+this.model_name,4,!0)},showModelConfig(){try{this.isLoading=!0,de.get("/get_active_binding_settings").then(n=>{this.isLoading=!1,n&&(console.log("binding sett",n),n.data&&Object.keys(n.data).length>0?this.$refs.universalForm.showForm(n.data,"Binding settings ","Save changes","Cancel").then(e=>{try{de.post("/set_active_binding_settings",{client_id:this.$store.state.client_id,settings:e}).then(t=>{t&&t.data?(console.log("binding set with new settings",t.data),this.$store.state.toast.showToast("Binding settings updated successfully!",4,!0)):(this.$store.state.toast.showToast(`Did not get binding settings responses. +Error: `+e.error,4,!1)},getMountedPersonalities(){this.isLoading=!0;let n=[];console.log(this.configFile.personalities.length);for(let e=0;er.full_path==t),i=this.personalities[s];if(i)console.log("adding from config"),n.push(i);else{console.log("adding default");const r=this.personalities.findIndex(a=>a.full_path=="english/generic/lollms"),o=this.personalities[r];n.push(o)}}if(this.mountedPersArr=[],this.mountedPersArr=n,console.log("discussionPersonalities",this.discussionPersonalities),this.discussionPersonalities!=null&&this.discussionPersonalities.length>0)for(let e=0;ei.full_path==t);if(console.log("discussionPersonalities -includes",s),console.log("discussionPersonalities -mounted list",this.mountedPersArr),s==-1){const i=this.personalities.findIndex(o=>o.full_path==t),r=this.personalities[i];console.log("adding discucc121",r,t),r&&(this.mountedPersArr.push(r),console.log("adding discucc",r))}}this.isLoading=!1,console.log("getMountedPersonalities",this.mountedPersArr),console.log("fig",this.configFile)}}},nE=n=>(no("data-v-de7bc8fe"),n=n(),so(),n),Tvt={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"},xvt={key:0,role:"status",class:"flex justify-center overflow-y-hidden"},Cvt=nE(()=>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)),wvt=nE(()=>c("span",{class:"sr-only"},"Loading...",-1)),Rvt=[Cvt,wvt],Avt=nE(()=>c("i",{"data-feather":"chevron-down"},null,-1)),Nvt=[Avt],Ovt={class:"block my-2 text-sm font-medium text-gray-900 dark:text-white"},Ivt={class:"overflow-y-auto no-scrollbar pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4 max-h-96"};function Mvt(n,e,t,s,i,r){const o=dt("personality-entry"),a=dt("Toast"),l=dt("UniversalForm");return C(),R("div",Tvt,[i.isLoading?(C(),R("div",xvt,Rvt)):G("",!0),c("div",null,[r.mountedPersArr.length>0?(C(),R("div",{key:0,class:Fe(i.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]=ae((...u)=>r.toggleShowPersList&&r.toggleShowPersList(...u),["stop"]))},Nvt),c("label",Ovt," Mounted Personalities: ("+se(r.mountedPersArr.length)+") ",1),c("div",Ivt,[_e(Qs,{name:"bounce"},{default:qe(()=>[(C(!0),R(ze,null,st(this.$store.state.mountedPersArr,(u,d)=>(C(),St(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)):G("",!0)]),_e(a,{ref:"toast"},null,512),_e(l,{ref:"universalForm",class:"z-20"},null,512)])}const Dvt=pt(Svt,[["render",Mvt],["__scopeId","data-v-de7bc8fe"]]);const kvt={components:{InteractiveMenu:Jb},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),Ue(()=>{Ge.replace()})},methods:{isHTML(n){const t=new DOMParser().parseFromString(n,"text/html");return Array.from(t.body.childNodes).some(s=>s.nodeType===Node.ELEMENT_NODE)},selectFile(n,e){const t=document.createElement("input");t.type="file",t.accept=n,t.onchange=s=>{this.selectedFile=s.target.files[0],console.log("File selected"),e()},t.click()},uploadFile(){new FormData().append("file",this.selectedFile),console.log("Uploading file"),this.loading=!0;const e=new FileReader;e.onload=()=>{const t={filename:this.selectedFile.name,fileData:e.result};He.on("file_received",s=>{s.status?this.onShowToastMessage("File uploaded successfully",4,!0):this.onShowToastMessage(`Couldn't upload file +`+s.error,4,!1),this.loading=!1,He.off("file_received")}),He.emit("send_file",t)},e.readAsDataURL(this.selectedFile)},async constructor(){Ue(()=>{Ge.replace()})},toggleMenu(){this.showMenu=!this.showMenu},execute_cmd(n){this.showMenu=!this.showMenu,n.hasOwnProperty("is_file")?(console.log("Need to send a file."),this.selectFile(n.hasOwnProperty("file_types")?n.file_types:"*",()=>{this.selectedFile!=null&&this.uploadFile()})):this.sendCommand(n.value)},handleClickOutside(n){const e=this.$el.querySelector(".commands-menu-items-wrapper");e&&!e.contains(n.target)&&(this.showMenu=!1)}},beforeUnmount(){document.removeEventListener("click",this.handleClickOutside)}},Lvt=n=>(no("data-v-1a32c141"),n=n(),so(),n),Pvt={key:0,title:"Loading..",class:"flex flex-row flex-grow justify-end"},Uvt=Lvt(()=>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)),Fvt=[Uvt];function Bvt(n,e,t,s,i,r){const o=dt("InteractiveMenu");return i.loading?(C(),R("div",Pvt,Fvt)):(C(),St(o,{key:1,commands:t.commandsList,execute_cmd:r.execute_cmd},null,8,["commands","execute_cmd"]))}const Gvt=pt(kvt,[["render",Bvt],["__scopeId","data-v-1a32c141"]]),Vvt="/assets/loader_v0-16906488.svg";console.log("modelImgPlaceholder:",ws);const zvt="/",Hvt={name:"ChatBox",emits:["messageSentEvent","sendCMDEvent","stopGenerating","loaded","createEmptyUserMessage","createEmptyAIMessage","personalitySelected","addWebLink"],props:{onTalk:Function,discussionList:Array,loading:{default:!1},onShowToastMessage:Function},components:{UniversalForm:Xl,MountedPersonalities:yvt,MountedPersonalitiesList:Dvt,PersonalitiesCommands:Gvt},setup(){},data(){return{is_rt:!1,bindingHoveredIndex:null,modelHoveredIndex:null,personalityHoveredIndex:null,loader_v0:Vvt,sendGlobe:NN,modelImgPlaceholder:ws,bUrl:zvt,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 n=this.$store.state.config.rag_databases.map(e=>{console.log("entry",e);const t=e.split("::");console.log("extracted",t[0]);const i=e.endsWith("mounted")?"feather:check":"";return console.log("icon decision",i),{name:t[0],value:t[0]||"default_value",icon:i,help:"mounts the database"}});return console.log("formatted data sources",n),n},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 n=[];for(let e=0;e0&&this.addFiles(t)},toggleSwitch(){this.$store.state.config.activate_internet_search=!this.$store.state.config.activate_internet_search,this.isLoading=!0,de.post("/apply_settings",{config:this.$store.state.config}).then(n=>{this.isLoading=!1,n.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),Ue(()=>{Ge.replace()})})},copyModelName(){navigator.clipboard.writeText(this.binding_name+"::"+this.model_name),this.$store.state.toast.showToast("Model name copyed to clipboard: "+this.binding_name+"::"+this.model_name,4,!0)},showModelConfig(){try{this.isLoading=!0,de.get("/get_active_binding_settings").then(n=>{this.isLoading=!1,n&&(console.log("binding sett",n),n.data&&Object.keys(n.data).length>0?this.$refs.universalForm.showForm(n.data,"Binding settings ","Save changes","Cancel").then(e=>{try{de.post("/set_active_binding_settings",{client_id:this.$store.state.client_id,settings:e}).then(t=>{t&&t.data?(console.log("binding set with new settings",t.data),this.$store.state.toast.showToast("Binding settings updated successfully!",4,!0)):(this.$store.state.toast.showToast(`Did not get binding settings responses. `+t,4,!1),this.isLoading=!1)})}catch(t){this.$store.state.toast.showToast(`Did not get binding settings responses. Endpoint error: `+t.message,4,!1),this.isLoading=!1}}):(this.$store.state.toast.showToast("Binding has no settings",4,!1),this.isLoading=!1))})}catch(n){this.isLoading=!1,this.$store.state.toast.showToast("Could not open binding settings. Endpoint error: "+n.message,4,!1)}},async remount_personality(n){if(console.log("Remounting personality ",n),!n)return{status:!1,error:"no personality - mount_personality"};try{console.log("before");const e={client_id:this.$store.state.client_id,category:n.category,folder:n.folder,language:n.language};console.log("after");const t=await de.post("/remount_personality",e);if(console.log("Remounting personality executed:",t),t)return console.log("Remounting personality res"),this.$store.state.toast.showToast("Personality remounted",4,!0),t.data;console.log("failed remount_personality")}catch(e){console.log(e.message,"remount_personality - settings");return}},async unmountPersonality(n){if(console.log("Unmounting personality:",n),!n)return;const e=await this.unmount_personality(n.personality||n);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 t=this.$store.state.mountedPersArr[this.$store.state.mountedPersArr.length-1];console.log(t,this.$store.state.mountedPersArr.length),(await this.select_personality(n.personality)).status&&this.$store.state.toast.showToast(`Selected personality: `+t.name,4,!0)}else this.$store.state.toast.showToast(`Could not unmount personality Error: `+e.error,4,!1)},async unmount_personality(n){if(!n)return{status:!1,error:"no personality - unmount_personality"};const e={client_id:this.$store.state.client_id,language:n.language,category:n.category,folder:n.folder};try{const t=await de.post("/unmount_personality",e);if(t)return t.data}catch(t){console.log(t.message,"unmount_personality - settings");return}},async showBindingHoveredIn(n){this.bindingHoveredIndex=n},async showBindingHoveredOut(){this.bindingHoveredIndex=null},async showModelHoveredIn(n){this.modelHoveredIndex=n},async showModelHoveredOut(){this.modelHoveredIndex=null},async showPersonalityHoveredIn(n){this.personalityHoveredIndex=n},async showPersonalityHoveredOut(){this.personalityHoveredIndex=null},async onPersonalitySelected(n){if(n){if(n.selected){this.$store.state.toast.showToast("Personality already selected",4,!0);return}const e=n.language===null?n.full_path:n.full_path+":"+n.language;if(console.log("pers_path",e),console.log("this.$store.state.config.personalities",this.$store.state.config.personalities),this.$store.state.config.personalities.includes(e)){const t=await this.select_personality(n);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",t),t&&t.status&&t.active_personality_id>-1?this.$store.state.toast.showToast(`Selected personality: `+n.name,4,!0):this.$store.state.toast.showToast(`Error on select personality: -`+n.name,4,!1)}else console.log("mounting pers");this.$emit("personalitySelected"),Ue(()=>{Ge.replace()})}},async select_personality(n){if(!n)return{status:!1,error:"no personality - select_personality"};const e=n.language===null?n.full_path:n.full_path+":"+n.language;console.log("Selecting personality ",e);const t=this.$store.state.config.personalities.findIndex(i=>i===e),s={client_id:this.$store.state.client_id,id:t};try{const i=await de.post("/select_personality",s);if(i)return this.$store.dispatch("refreshConfig").then(()=>{this.$store.dispatch("refreshPersonalitiesZoo").then(()=>{this.$store.dispatch("refreshMountedPersonalities")})}),i.data}catch(i){console.log(i.message,"select_personality - settings");return}},emitloaded(){this.$emit("loaded")},showModels(n){n.preventDefault();const e=this.$refs.modelsSelectionList;console.log(e);const t=new MouseEvent("click");e.dispatchEvent(t)},setBinding(n){console.log("Setting binding to "+n.name),this.selecting_binding=!0,this.selectedBinding=n,this.$store.state.messageBox.showBlockingMessage("Loading binding"),de.post("/update_setting",{client_id:this.$store.state.client_id,setting_name:"binding_name",setting_value:n.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(n){console.log("Setting model to "+n.name),this.selecting_model=!0,this.selectedModel=n,this.$store.state.messageBox.showBlockingMessage("Loading model"),de.post("/update_setting",{client_id:this.$store.state.client_id,setting_name:"model_name",setting_value:n.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(){de.get("/download_files")},remove_file(n){de.get("/remove_discussion_file",{client_id:this.$store.state.client_id,name:n}).then(e=>{console.log(e)})},clear_files(){de.post("/clear_discussion_files_list",{client_id:this.$store.state.client_id}).then(n=>{console.log(n),n.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(n,e){console.log("Send file triggered");const t=new FileReader,s=24*1024;let i=0,r=0;t.onloadend=()=>{if(t.error){console.error("Error reading file:",t.error);return}const a=t.result,l=i+a.byteLength>=n.size;He.emit("send_file_chunk",{filename:n.name,chunk:a,offset:i,isLastChunk:l,chunkIndex:r}),i+=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=n.slice(i,i+s);t.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),He.emit("start_bidirectional_audio_stream"),Ue(()=>{Ge.replace()})},stopRTCom(){this.is_rt=!1,console.log("is_rt:",this.is_rt),He.emit("stop_bidirectional_audio_stream"),Ue(()=>{Ge.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=n=>{let e="";for(let t=n.resultIndex;t{this.recognition.stop()},this.silenceTimeout)},this.recognition.onerror=n=>{console.error("Speech recognition error:",n.error),this.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(n){this.showPersonalities=!this.showPersonalities},handleOnTalk(n){console.log("talking"),this.showPersonalities=!1,this.$store.state.toast.showToast(`Personality ${n.name} is Talking`,4,!0),this.onTalk(n)},onMountFun(n){console.log("Mounting personality"),this.$refs.mountedPers.constructor()},onUnmountFun(n){console.log("Unmounting personality"),this.$refs.mountedPers.constructor()},onRemount(n){console.log("Remounting chat"),this.$refs.mountedPers.constructor()},computedFileSize(n){return Ue(()=>{Ge.replace()}),js(n)},removeItem(n){console.log("Removing ",n.name),de.post("/remove_discussion_file",{client_id:this.$store.state.client_id,name:n.name},{headers:this.posts_headers}).then(()=>{this.filesList=this.filesList.filter(e=>e!=n)}),console.log(this.filesList)},sendMessageEvent(n,e="no_internet"){this.$emit("messageSentEvent",n,e)},sendCMDEvent(n){this.$emit("sendCMDEvent",n)},async mountDB(n){await de.post("/toggle_mount_rag_database",{client_id:this.$store.state.client_id,database_name:n}),await this.$store.dispatch("refreshConfig"),console.log("Refreshed")},addWebLink(){console.log("Emitting addWebLink"),this.$emit("addWebLink")},add_file(){const n=document.createElement("input");n.type="file",n.style.display="none",n.multiple=!0,document.body.appendChild(n),n.addEventListener("change",()=>{console.log("Calling Add file..."),this.addFiles(n.files),document.body.removeChild(n)}),n.click()},takePicture(){He.emit("take_picture"),He.on("picture_taken",()=>{de.post("/get_discussion_files_list",{client_id:this.$store.state.client_id}).then(n=>{this.filesList=n.data.files,this.isFileSentList=n.data.files.map(e=>!0),console.log(`Files recovered: ${this.filesList}`)})})},submitOnEnter(n){this.loading||n.which===13&&(n.preventDefault(),n.repeat||(this.sendMessageEvent(this.message),this.message=""))},submit(){this.message&&(this.sendMessageEvent(this.message),this.message="")},submitWithInternetSearch(){this.message&&(this.sendMessageEvent(this.message,"internet"),this.message="")},stopGenerating(){this.$emit("stopGenerating")},addFiles(n){console.log("Adding files");const e=[...n];let t=0;const s=()=>{if(t>=e.length){console.log(`Files_list: ${this.filesList}`);return}const i=e[t];this.filesList.push(i),this.isFileSentList.push(!1),this.send_file(i,()=>{t++,s()})};s()}},watch:{installedModels:{immediate:!0,handler(n){this.$nextTick(()=>{this.installedModels=n})}},model_name:{immediate:!0,handler(n){this.$nextTick(()=>{this.model_name=n})}},showfilesList(){Ue(()=>{Ge.replace()})},loading(n,e){Ue(()=>{Ge.replace()})},filesList:{handler(n,e){let t=0;if(n.length>0)for(let s=0;s{Ge.replace()}),console.log("Chatbar mounted"),He.on("rtcom_status_changed",n=>{this.$store.dispatch("fetchisRTOn"),console.log("rtcom_status_changed: ",n.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(){Ue(()=>{Ge.replace()})}},kt=n=>(no("data-v-64fb461b"),n=n(),so(),n),Hvt={class:"absolute bottom-0 left-0 w-fit min-w-96 w-full justify-center text-center"},qvt={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"},Yvt={class:"flex"},$vt=["title"],Wvt=kt(()=>c("i",{"data-feather":"list"},null,-1)),Kvt=[Wvt],jvt={key:0},Qvt={class:"flex flex-col max-h-64"},Xvt=["title"],Zvt={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"},Jvt={key:0,filesList:"",role:"status"},eSt=kt(()=>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)),tSt=kt(()=>c("span",{class:"sr-only"},"Loading...",-1)),nSt=[eSt,tSt],sSt=kt(()=>c("div",null,[c("i",{"data-feather":"file",class:"w-5 h-5"})],-1)),iSt=kt(()=>c("div",{class:"grow"},null,-1)),rSt={class:"flex flex-row items-center"},oSt={class:"whitespace-nowrap"},aSt=["onClick"],lSt=kt(()=>c("i",{"data-feather":"x",class:"w-5 h-5"},null,-1)),cSt=[lSt],dSt={key:1,class:"flex mx-1 w-500"},uSt={class:"whitespace-nowrap flex flex-row gap-2"},pSt=kt(()=>c("p",{class:"font-bold"}," Total size: ",-1)),_St=kt(()=>c("div",{class:"grow"},null,-1)),hSt=kt(()=>c("i",{"data-feather":"trash",class:"w-5 h-5"},null,-1)),fSt=[hSt],mSt=kt(()=>c("i",{"data-feather":"download-cloud",class:"w-5 h-5"},null,-1)),gSt=[mSt],bSt={key:2,class:"mx-1"},ESt={key:1,title:"Selecting model",class:"flex flex-row flex-grow justify-end bg-primary"},ySt={role:"status"},vSt=["src"],SSt=kt(()=>c("span",{class:"sr-only"},"Selecting model...",-1)),TSt={class:"flex w-fit relative grow w-full"},xSt={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"},CSt={key:0,title:"Waiting for reply"},wSt=["src"],RSt=kt(()=>c("div",{role:"status"},[c("span",{class:"sr-only"},"Loading...")],-1)),ASt={key:1,class:"w-fit group relative"},NSt={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"},OSt={class:"w-fit flex-wrap flex bg-white bg-opacity-50 backdrop-blur-md rounded p-4"},ISt=["onMouseover"],MSt={class:"relative"},DSt=["onClick"],kSt=["src","title"],LSt={class:"group items-center flex flex-row"},PSt=["src","title"],USt={key:2,class:"w-fit group relative"},FSt={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"},BSt={class:"w-fit flex-wrap flex bg-white bg-opacity-50 backdrop-blur-md rounded p-4"},GSt=["onMouseover"],VSt={class:"relative"},zSt=["onClick"],HSt=["src","title"],qSt={class:"group items-center flex flex-row"},YSt=["src","title"],$St={key:3,class:"w-fit group relative"},WSt={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"},KSt={class:"w-fit flex-wrap flex bg-white bg-opacity-50 backdrop-blur-md rounded p-4"},jSt=["onMouseover"],QSt={class:"relative"},XSt=["onClick"],ZSt=["src","title"],JSt=["onClick"],e0t=kt(()=>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)),t0t=[e0t],n0t=["onClick"],s0t=kt(()=>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)),i0t=[s0t],r0t=["onClick"],o0t=kt(()=>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)),a0t=[o0t],l0t={class:"w-fit"},c0t={class:"w-fit"},d0t={class:"relative grow"},u0t={class:"group relative w-max"},p0t=kt(()=>c("i",{"data-feather":"send"},null,-1)),_0t=[p0t],h0t=kt(()=>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)),f0t={class:"group relative w-max"},m0t=["src"],g0t=kt(()=>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)),b0t={class:"group relative w-max"},E0t=kt(()=>c("i",{"data-feather":"mic"},null,-1)),y0t=[E0t],v0t=kt(()=>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)),S0t={key:5,class:"group relative w-max"},T0t=kt(()=>c("i",{"data-feather":"mic"},null,-1)),x0t=[T0t],C0t=kt(()=>c("i",{"data-feather":"mic"},null,-1)),w0t=[C0t],R0t=kt(()=>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)),A0t={key:6,class:"group relative w-max"},N0t=kt(()=>c("i",{"data-feather":"file-plus"},null,-1)),O0t=[N0t],I0t=kt(()=>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)),M0t={class:"group relative w-max"},D0t=kt(()=>c("i",{"data-feather":"camera"},null,-1)),k0t=[D0t],L0t=kt(()=>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)),P0t={class:"group relative w-max"},U0t=kt(()=>c("i",{"data-feather":"globe"},null,-1)),F0t=[U0t],B0t=kt(()=>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)),G0t={class:"group relative w-max"},V0t=kt(()=>c("i",{"data-feather":"message-square"},null,-1)),z0t=[V0t],H0t=kt(()=>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)),q0t={class:"group relative w-max"},Y0t=kt(()=>c("i",{"data-feather":"message-square"},null,-1)),$0t=[Y0t],W0t=kt(()=>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)),K0t=kt(()=>c("div",{class:"ml-auto gap-2"},null,-1));function j0t(n,e,t,s,i,r){const o=dt("MountedPersonalitiesList"),a=dt("MountedPersonalities"),l=dt("PersonalitiesCommands"),u=dt("UniversalForm");return C(),R(ze,null,[c("form",null,[c("div",Hvt,[i.filesList.length>0||i.showPersonalities?(C(),R("div",qvt,[c("div",Yvt,[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:i.showfilesList?"Hide file list":"Show file list",type:"button",onClick:e[0]||(e[0]=ae(d=>i.showfilesList=!i.showfilesList,["stop"]))},Kvt,8,$vt)]),i.filesList.length>0&&i.showfilesList==!0?(C(),R("div",jvt,[c("div",Qvt,[_e(Qs,{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:qe(()=>[(C(!0),R(ze,null,st(i.filesList,(d,h)=>(C(),R("div",{key:h+"-"+d.name},[c("div",{class:"m-1",title:d.name},[c("div",Zvt,[i.isFileSentList[h]?G("",!0):(C(),R("div",Jvt,nSt)),sSt,c("div",{class:Fe(["line-clamp-1 w-3/5",i.isFileSentList[h]?"text-green-500":"text-red-200"])},se(d.name),3),iSt,c("div",rSt,[c("p",oSt,se(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)},cSt,8,aSt)])])],8,Xvt)]))),128))]),_:1})])])):G("",!0),i.filesList.length>0?(C(),R("div",dSt,[c("div",uSt,[pSt,Xe(" "+se(i.totalSize)+" ("+se(i.filesList.length)+") ",1)]),_St,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))},fSt),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))},gSt)])):G("",!0),i.showPersonalities?(C(),R("div",bSt,[_e(o,{ref:"mountedPersList",onShowPersList:r.onShowPersListFun,"on-mounted":r.onMountFun,"on-un-mounted":r.onUnmountFun,"on-remounted":n.onRemountFun,"on-talk":r.handleOnTalk,discussionPersonalities:r.allDiscussionPersonalities},null,8,["onShowPersList","on-mounted","on-un-mounted","on-remounted","on-talk","discussionPersonalities"])])):G("",!0)])):G("",!0),i.selecting_model||i.selecting_binding?(C(),R("div",ESt,[c("div",ySt,[c("img",{src:i.loader_v0,class:"w-50 h-50"},null,8,vSt),SSt])])):G("",!0),c("div",TSt,[c("div",xSt,[t.loading?(C(),R("div",CSt,[c("img",{src:i.loader_v0},null,8,wSt),RSt])):G("",!0),t.loading?G("",!0):(C(),R("div",ASt,[c("div",NSt,[c("div",OSt,[(C(!0),R(ze,null,st(r.installedBindings,(d,h)=>(C(),R("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?(C(),R("div",{key:0,class:Fe(["items-center flex flex-row relative z-20 hover:-translate-y-8 duration-300",i.bindingHoveredIndex===h?"scale-150":""])},[c("div",MSt,[c("button",{onClick:ae(f=>r.setBinding(d),["prevent"]),class:"w-10 h-10 relative"},[c("img",{src:d.icon?d.icon:i.modelImgPlaceholder,onError:e[3]||(e[3]=(...f)=>i.modelImgPlaceholder&&i.modelImgPlaceholder(...f)),class:Fe(["z-50 w-10 h-10 rounded-full object-fill text-red-700 border-2 border-gray-500 active:scale-90",i.bindingHoveredIndex===h?"scale-150 ":""+d.name==r.binding_name?"border-secondary":"border-transparent z-0"]),title:d.name},null,42,kSt)],8,DSt)])],2)):G("",!0)],40,ISt))),128))])]),c("div",LSt,[c("button",{onClick:e[5]||(e[5]=ae(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,PSt)])])])),t.loading?G("",!0):(C(),R("div",USt,[c("div",FSt,[c("div",BSt,[(C(!0),R(ze,null,st(r.installedModels,(d,h)=>(C(),R("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?(C(),R("div",{key:0,class:Fe(["items-center flex flex-row relative z-20 hover:-translate-y-8 duration-300",i.modelHoveredIndex===h?"scale-150":""])},[c("div",VSt,[c("button",{onClick:ae(f=>r.setModel(d),["prevent"]),class:"w-10 h-10 relative"},[c("img",{src:d.icon?d.icon:i.modelImgPlaceholder,onError:e[6]||(e[6]=(...f)=>n.personalityImgPlacehodler&&n.personalityImgPlacehodler(...f)),class:Fe(["z-50 w-10 h-10 rounded-full object-fill text-red-700 border-2 border-gray-500 active:scale-90",i.modelHoveredIndex===h?"scale-150 ":""+d.name==r.model_name?"border-secondary":"border-transparent z-0"]),title:d.name},null,42,HSt)],8,zSt)])],2)):G("",!0)],40,GSt))),128))])]),c("div",qSt,[c("button",{onClick:e[8]||(e[8]=ae(d=>r.copyModelName(),["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,YSt)])])])),t.loading?G("",!0):(C(),R("div",$St,[c("div",WSt,[c("div",KSt,[(C(!0),R(ze,null,st(r.mountedPersonalities,(d,h)=>(C(),R("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?(C(),R("div",{key:0,class:Fe(["items-center flex flex-row relative z-20 hover:-translate-y-8 duration-300",i.personalityHoveredIndex===h?"scale-150":""])},[c("div",QSt,[c("button",{onClick:ae(f=>r.onPersonalitySelected(d),["prevent"]),class:"w-10 h-10 relative"},[c("img",{src:i.bUrl+d.avatar,onError:e[9]||(e[9]=(...f)=>n.personalityImgPlacehodler&&n.personalityImgPlacehodler(...f)),class:Fe(["z-50 w-10 h-10 rounded-full object-fill text-red-700 border-2 border-gray-500 active:scale-90",i.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,ZSt)],8,XSt),i.personalityHoveredIndex===h?(C(),R("button",{key:0,onClick:ae(f=>r.unmountPersonality(d),["prevent"])},t0t,8,JSt)):G("",!0),i.personalityHoveredIndex===h?(C(),R("button",{key:1,onClick:ae(f=>r.remount_personality(d),["prevent"])},i0t,8,n0t)):G("",!0),i.personalityHoveredIndex===h?(C(),R("button",{key:2,onClick:ae(f=>r.handleOnTalk(d),["prevent"])},a0t,8,r0t)):G("",!0)])],2)):G("",!0)],40,jSt))),128))])]),_e(a,{ref:"mountedPers",onShowPersList:r.onShowPersListFun,onReady:r.onPersonalitiesReadyFun},null,8,["onShowPersList","onReady"])])),c("div",l0t,[i.personalities_ready&&this.$store.state.mountedPersArr[this.$store.state.config.active_personality_id].commands!=""?(C(),St(l,{key:0,commandsList:this.$store.state.mountedPersArr[this.$store.state.config.active_personality_id].commands,sendCommand:r.sendCMDEvent,"on-show-toast-message":t.onShowToastMessage,ref:"personalityCMD"},null,8,["commandsList","sendCommand","on-show-toast-message"])):G("",!0)]),c("div",c0t,[r.isDataSourceNamesValid?(C(),St(l,{key:0,icon:"feather:book",commandsList:r.dataSourceNames,sendCommand:r.mountDB,"on-show-toast-message":t.onShowToastMessage,ref:"databasesList"},null,8,["commandsList","sendCommand","on-show-toast-message"])):G("",!0)]),c("div",d0t,[B(c("textarea",{id:"chat",rows:"1","onUpdate:modelValue":e[11]||(e[11]=d=>i.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]=Ai(ae(d=>r.submitOnEnter(d),["exact"]),["enter"]))},`\r - `,544),[[he,i.message]])]),t.loading?(C(),R("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]=ae((...d)=>r.stopGenerating&&r.stopGenerating(...d),["stop"]))}," Stop generating ")):G("",!0),c("div",u0t,[t.loading?G("",!0):(C(),R("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"},_0t)),h0t]),c("div",f0t,[t.loading?G("",!0):(C(),R("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:i.sendGlobe,width:"50",height:"50",style:{stroke:"currentColor",fill:"currentColor"}},null,8,m0t)])),g0t]),c("div",b0t,[t.loading?G("",!0):(C(),R("button",{key:0,type:"button",onClick:e[17]||(e[17]=(...d)=>r.startSpeechRecognition&&r.startSpeechRecognition(...d)),class:Fe([{"text-red-500":i.isListeningToVoice},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer transform transition-transform hover:translate-y-[-5px] active:scale-90"])},y0t,2)),v0t]),n.$store.state.config.active_tts_service!="None"?(C(),R("div",S0t,[i.is_rt?(C(),R("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"},x0t)):(C(),R("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"},w0t)),R0t])):G("",!0),t.loading?G("",!0):(C(),R("div",A0t,[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]=ae((...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"},O0t),I0t])),c("div",M0t,[t.loading?G("",!0):(C(),R("button",{key:0,type:"button",onClick:e[22]||(e[22]=ae((...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"},k0t)),L0t]),c("div",P0t,[t.loading?G("",!0):(C(),R("button",{key:0,type:"button",onClick:e[23]||(e[23]=ae((...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"},F0t)),B0t]),c("div",G0t,[t.loading?G("",!0):(C(),R("button",{key:0,type:"button",onClick:e[24]||(e[24]=ae((...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]"},z0t)),H0t]),c("div",q0t,[t.loading?G("",!0):(C(),R("button",{key:0,type:"button",onClick:e[25]||(e[25]=ae((...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]"},$0t)),W0t])]),K0t])])]),_e(u,{ref:"universalForm",class:"z-20"},null,512)],64)}const IN=pt(zvt,[["render",j0t],["__scopeId","data-v-64fb461b"]]),Q0t={name:"WelcomeComponent",computed:{storeLogo(){return this.$store.state.config?hs:this.$store.state.config.app_custom_logo!=""?"/user_infos/"+this.$store.state.config.app_custom_logo:hs}},data(){},setup(){return{}}},X0t={class:"flex flex-col text-center w-full h-full"},Z0t={class:"flex flex-col text-center items-center"},J0t={class:"flex items-center gap-3 text-5xl drop-shadow-md align-middle pt-24"},eTt=["src"],tTt=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),nTt=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),sTt=c("p",{class:"text-2xl"},"Welcome",-1),iTt=c("p",{class:"text-lg"},"Please create a new discussion or select existing one to start",-1);function rTt(n,e,t,s,i,r){return C(),R("div",X0t,[c("div",Z0t,[c("div",J0t,[c("img",{class:"w-12 hover:scale-95 duration-150",title:"LoLLMS WebUI",src:n.$store.state.config==null?r.storeLogo:n.$store.state.config.app_custom_logo!=""?"/user_infos/"+n.$store.state.config.app_custom_logo:r.storeLogo,alt:"Logo"},null,8,eTt),tTt]),nTt,sTt,iTt])])}const MN=pt(Q0t,[["render",rTt]]);var oTt=function(){function n(e,t){t===void 0&&(t=[]),this._eventType=e,this._eventFunctions=t}return n.prototype.init=function(){var e=this;this._eventFunctions.forEach(function(t){typeof window<"u"&&window.addEventListener(e._eventType,t)})},n}(),Pd=globalThis&&globalThis.__assign||function(){return Pd=Object.assign||function(n){for(var e,t=1,s=arguments.length;t"u")return!1;var e=Jn(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function ETt(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var s=e.styles[t]||{},i=e.attributes[t]||{},r=e.elements[t];!fs(r)||!ei(r)||(Object.assign(r.style,s),Object.keys(i).forEach(function(o){var a=i[o];a===!1?r.removeAttribute(o):r.setAttribute(o,a===!0?"":a)}))})}function yTt(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(s){var i=e.elements[s],r=e.attributes[s]||{},o=Object.keys(e.styles.hasOwnProperty(s)?e.styles[s]:t[s]),a=o.reduce(function(l,u){return l[u]="",l},{});!fs(i)||!ei(i)||(Object.assign(i.style,a),Object.keys(r).forEach(function(l){i.removeAttribute(l)}))})}}const vTt={name:"applyStyles",enabled:!0,phase:"write",fn:ETt,effect:yTt,requires:["computeStyles"]};function Xs(n){return n.split("-")[0]}var zr=Math.max,Gd=Math.min,ia=Math.round;function Og(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function BN(){return!/^((?!chrome|android).)*safari/i.test(Og())}function ra(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var s=n.getBoundingClientRect(),i=1,r=1;e&&fs(n)&&(i=n.offsetWidth>0&&ia(s.width)/n.offsetWidth||1,r=n.offsetHeight>0&&ia(s.height)/n.offsetHeight||1);var o=Qr(n)?Jn(n):window,a=o.visualViewport,l=!BN()&&t,u=(s.left+(l&&a?a.offsetLeft:0))/i,d=(s.top+(l&&a?a.offsetTop:0))/r,h=s.width/i,f=s.height/r;return{width:h,height:f,top:d,right:u+h,bottom:d+f,left:u,x:u,y:d}}function cE(n){var e=ra(n),t=n.offsetWidth,s=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-s)<=1&&(s=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:s}}function GN(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&lE(t)){var s=e;do{if(s&&n.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function Ni(n){return Jn(n).getComputedStyle(n)}function STt(n){return["table","td","th"].indexOf(ei(n))>=0}function fr(n){return((Qr(n)?n.ownerDocument:n.document)||window.document).documentElement}function Vu(n){return ei(n)==="html"?n:n.assignedSlot||n.parentNode||(lE(n)?n.host:null)||fr(n)}function Kx(n){return!fs(n)||Ni(n).position==="fixed"?null:n.offsetParent}function TTt(n){var e=/firefox/i.test(Og()),t=/Trident/i.test(Og());if(t&&fs(n)){var s=Ni(n);if(s.position==="fixed")return null}var i=Vu(n);for(lE(i)&&(i=i.host);fs(i)&&["html","body"].indexOf(ei(i))<0;){var r=Ni(i);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 i;i=i.parentNode}return null}function Jl(n){for(var e=Jn(n),t=Kx(n);t&&STt(t)&&Ni(t).position==="static";)t=Kx(t);return t&&(ei(t)==="html"||ei(t)==="body"&&Ni(t).position==="static")?e:t||TTt(n)||e}function dE(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function _l(n,e,t){return zr(n,Gd(e,t))}function xTt(n,e,t){var s=_l(n,e,t);return s>t?t:s}function VN(){return{top:0,right:0,bottom:0,left:0}}function zN(n){return Object.assign({},VN(),n)}function HN(n,e){return e.reduce(function(t,s){return t[s]=n,t},{})}var CTt=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,zN(typeof e!="number"?e:HN(e,Zl))};function wTt(n){var e,t=n.state,s=n.name,i=n.options,r=t.elements.arrow,o=t.modifiersData.popperOffsets,a=Xs(t.placement),l=dE(a),u=[qn,bs].indexOf(a)>=0,d=u?"height":"width";if(!(!r||!o)){var h=CTt(i.padding,t),f=cE(r),_=l==="y"?Hn:qn,m=l==="y"?gs:bs,E=t.rects.reference[d]+t.rects.reference[l]-o[l]-t.rects.popper[d],b=o[l]-t.rects.reference[l],g=Jl(r),y=g?l==="y"?g.clientHeight||0:g.clientWidth||0:0,v=E/2-b/2,S=h[_],w=y-f[d]-h[m],x=y/2-f[d]/2+v,A=_l(S,x,w),D=l;t.modifiersData[s]=(e={},e[D]=A,e.centerOffset=A-x,e)}}function RTt(n){var e=n.state,t=n.options,s=t.element,i=s===void 0?"[data-popper-arrow]":s;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||GN(e.elements.popper,i)&&(e.elements.arrow=i))}const ATt={name:"arrow",enabled:!0,phase:"main",fn:wTt,effect:RTt,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function oa(n){return n.split("-")[1]}var NTt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function OTt(n,e){var t=n.x,s=n.y,i=e.devicePixelRatio||1;return{x:ia(t*i)/i||0,y:ia(s*i)/i||0}}function jx(n){var e,t=n.popper,s=n.popperRect,i=n.placement,r=n.variation,o=n.offsets,a=n.position,l=n.gpuAcceleration,u=n.adaptive,d=n.roundOffsets,h=n.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=qn,S=Hn,w=window;if(u){var x=Jl(t),A="clientHeight",D="clientWidth";if(x===Jn(t)&&(x=fr(t),Ni(x).position!=="static"&&a==="absolute"&&(A="scrollHeight",D="scrollWidth")),x=x,i===Hn||(i===qn||i===bs)&&r===Pl){S=gs;var T=h&&x===w&&w.visualViewport?w.visualViewport.height:x[A];E-=T-s.height,E*=l?1:-1}if(i===qn||(i===Hn||i===gs)&&r===Pl){v=bs;var O=h&&x===w&&w.visualViewport?w.visualViewport.width:x[D];_-=O-s.width,_*=l?1:-1}}var F=Object.assign({position:a},u&&NTt),z=d===!0?OTt({x:_,y:E},Jn(t)):{x:_,y:E};if(_=z.x,E=z.y,l){var Z;return Object.assign({},F,(Z={},Z[S]=y?"0":"",Z[v]=g?"0":"",Z.transform=(w.devicePixelRatio||1)<=1?"translate("+_+"px, "+E+"px)":"translate3d("+_+"px, "+E+"px, 0)",Z))}return Object.assign({},F,(e={},e[S]=y?E+"px":"",e[v]=g?_+"px":"",e.transform="",e))}function ITt(n){var e=n.state,t=n.options,s=t.gpuAcceleration,i=s===void 0?!0:s,r=t.adaptive,o=r===void 0?!0:r,a=t.roundOffsets,l=a===void 0?!0:a,u={placement:Xs(e.placement),variation:oa(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,jx(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,jx(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 MTt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:ITt,data:{}};var xc={passive:!0};function DTt(n){var e=n.state,t=n.instance,s=n.options,i=s.scroll,r=i===void 0?!0:i,o=s.resize,a=o===void 0?!0:o,l=Jn(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&u.forEach(function(d){d.addEventListener("scroll",t.update,xc)}),a&&l.addEventListener("resize",t.update,xc),function(){r&&u.forEach(function(d){d.removeEventListener("scroll",t.update,xc)}),a&&l.removeEventListener("resize",t.update,xc)}}const kTt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:DTt,data:{}};var LTt={left:"right",right:"left",bottom:"top",top:"bottom"};function gd(n){return n.replace(/left|right|bottom|top/g,function(e){return LTt[e]})}var PTt={start:"end",end:"start"};function Qx(n){return n.replace(/start|end/g,function(e){return PTt[e]})}function uE(n){var e=Jn(n),t=e.pageXOffset,s=e.pageYOffset;return{scrollLeft:t,scrollTop:s}}function pE(n){return ra(fr(n)).left+uE(n).scrollLeft}function UTt(n,e){var t=Jn(n),s=fr(n),i=t.visualViewport,r=s.clientWidth,o=s.clientHeight,a=0,l=0;if(i){r=i.width,o=i.height;var u=BN();(u||!u&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:r,height:o,x:a+pE(n),y:l}}function FTt(n){var e,t=fr(n),s=uE(n),i=(e=n.ownerDocument)==null?void 0:e.body,r=zr(t.scrollWidth,t.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=zr(t.scrollHeight,t.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-s.scrollLeft+pE(n),l=-s.scrollTop;return Ni(i||t).direction==="rtl"&&(a+=zr(t.clientWidth,i?i.clientWidth:0)-r),{width:r,height:o,x:a,y:l}}function _E(n){var e=Ni(n),t=e.overflow,s=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+i+s)}function qN(n){return["html","body","#document"].indexOf(ei(n))>=0?n.ownerDocument.body:fs(n)&&_E(n)?n:qN(Vu(n))}function hl(n,e){var t;e===void 0&&(e=[]);var s=qN(n),i=s===((t=n.ownerDocument)==null?void 0:t.body),r=Jn(s),o=i?[r].concat(r.visualViewport||[],_E(s)?s:[]):s,a=e.concat(o);return i?a:a.concat(hl(Vu(o)))}function Ig(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function BTt(n,e){var t=ra(n,!1,e==="fixed");return t.top=t.top+n.clientTop,t.left=t.left+n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top,t}function Xx(n,e,t){return e===UN?Ig(UTt(n,t)):Qr(e)?BTt(e,t):Ig(FTt(fr(n)))}function GTt(n){var e=hl(Vu(n)),t=["absolute","fixed"].indexOf(Ni(n).position)>=0,s=t&&fs(n)?Jl(n):n;return Qr(s)?e.filter(function(i){return Qr(i)&&GN(i,s)&&ei(i)!=="body"}):[]}function VTt(n,e,t,s){var i=e==="clippingParents"?GTt(n):[].concat(e),r=[].concat(i,[t]),o=r[0],a=r.reduce(function(l,u){var d=Xx(n,u,s);return l.top=zr(d.top,l.top),l.right=Gd(d.right,l.right),l.bottom=Gd(d.bottom,l.bottom),l.left=zr(d.left,l.left),l},Xx(n,o,s));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function YN(n){var e=n.reference,t=n.element,s=n.placement,i=s?Xs(s):null,r=s?oa(s):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,l;switch(i){case Hn:l={x:o,y:e.y-t.height};break;case gs:l={x:o,y:e.y+e.height};break;case bs:l={x:e.x+e.width,y:a};break;case qn:l={x:e.x-t.width,y:a};break;default:l={x:e.x,y:e.y}}var u=i?dE(i):null;if(u!=null){var d=u==="y"?"height":"width";switch(r){case sa:l[u]=l[u]-(e[d]/2-t[d]/2);break;case Pl:l[u]=l[u]+(e[d]/2-t[d]/2);break}}return l}function Ul(n,e){e===void 0&&(e={});var t=e,s=t.placement,i=s===void 0?n.placement:s,r=t.strategy,o=r===void 0?n.strategy:r,a=t.boundary,l=a===void 0?aTt:a,u=t.rootBoundary,d=u===void 0?UN:u,h=t.elementContext,f=h===void 0?Wa:h,_=t.altBoundary,m=_===void 0?!1:_,E=t.padding,b=E===void 0?0:E,g=zN(typeof b!="number"?b:HN(b,Zl)),y=f===Wa?lTt:Wa,v=n.rects.popper,S=n.elements[m?y:f],w=VTt(Qr(S)?S:S.contextElement||fr(n.elements.popper),l,d,o),x=ra(n.elements.reference),A=YN({reference:x,element:v,strategy:"absolute",placement:i}),D=Ig(Object.assign({},v,A)),T=f===Wa?D:x,O={top:w.top-T.top+g.top,bottom:T.bottom-w.bottom+g.bottom,left:w.left-T.left+g.left,right:T.right-w.right+g.right},F=n.modifiersData.offset;if(f===Wa&&F){var z=F[i];Object.keys(O).forEach(function(Z){var M=[bs,gs].indexOf(Z)>=0?1:-1,q=[Hn,gs].indexOf(Z)>=0?"y":"x";O[Z]+=z[q]*M})}return O}function zTt(n,e){e===void 0&&(e={});var t=e,s=t.placement,i=t.boundary,r=t.rootBoundary,o=t.padding,a=t.flipVariations,l=t.allowedAutoPlacements,u=l===void 0?FN:l,d=oa(s),h=d?a?Wx:Wx.filter(function(m){return oa(m)===d}):Zl,f=h.filter(function(m){return u.indexOf(m)>=0});f.length===0&&(f=h);var _=f.reduce(function(m,E){return m[E]=Ul(n,{placement:E,boundary:i,rootBoundary:r,padding:o})[Xs(E)],m},{});return Object.keys(_).sort(function(m,E){return _[m]-_[E]})}function HTt(n){if(Xs(n)===aE)return[];var e=gd(n);return[Qx(n),e,Qx(e)]}function qTt(n){var e=n.state,t=n.options,s=n.name;if(!e.modifiersData[s]._skip){for(var i=t.mainAxis,r=i===void 0?!0:i,o=t.altAxis,a=o===void 0?!0:o,l=t.fallbackPlacements,u=t.padding,d=t.boundary,h=t.rootBoundary,f=t.altBoundary,_=t.flipVariations,m=_===void 0?!0:_,E=t.allowedAutoPlacements,b=e.options.placement,g=Xs(b),y=g===b,v=l||(y||!m?[gd(b)]:HTt(b)),S=[b].concat(v).reduce(function(Ee,Oe){return Ee.concat(Xs(Oe)===aE?zTt(e,{placement:Oe,boundary:d,rootBoundary:h,padding:u,flipVariations:m,allowedAutoPlacements:E}):Oe)},[]),w=e.rects.reference,x=e.rects.popper,A=new Map,D=!0,T=S[0],O=0;O=0,q=M?"width":"height",H=Ul(e,{placement:F,boundary:d,rootBoundary:h,altBoundary:f,padding:u}),P=M?Z?bs:qn:Z?gs:Hn;w[q]>x[q]&&(P=gd(P));var $=gd(P),J=[];if(r&&J.push(H[z]<=0),a&&J.push(H[P]<=0,H[$]<=0),J.every(function(Ee){return Ee})){T=F,D=!1;break}A.set(F,J)}if(D)for(var re=m?3:1,me=function(Oe){var Me=S.find(function(j){var pe=A.get(j);if(pe)return pe.slice(0,Oe).every(function(ue){return ue})});if(Me)return T=Me,"break"},Se=re;Se>0;Se--){var le=me(Se);if(le==="break")break}e.placement!==T&&(e.modifiersData[s]._skip=!0,e.placement=T,e.reset=!0)}}const YTt={name:"flip",enabled:!0,phase:"main",fn:qTt,requiresIfExists:["offset"],data:{_skip:!1}};function Zx(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function Jx(n){return[Hn,bs,gs,qn].some(function(e){return n[e]>=0})}function $Tt(n){var e=n.state,t=n.name,s=e.rects.reference,i=e.rects.popper,r=e.modifiersData.preventOverflow,o=Ul(e,{elementContext:"reference"}),a=Ul(e,{altBoundary:!0}),l=Zx(o,s),u=Zx(a,i,r),d=Jx(l),h=Jx(u);e.modifiersData[t]={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 WTt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:$Tt};function KTt(n,e,t){var s=Xs(n),i=[qn,Hn].indexOf(s)>=0?-1:1,r=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,o=r[0],a=r[1];return o=o||0,a=(a||0)*i,[qn,bs].indexOf(s)>=0?{x:a,y:o}:{x:o,y:a}}function jTt(n){var e=n.state,t=n.options,s=n.name,i=t.offset,r=i===void 0?[0,0]:i,o=FN.reduce(function(d,h){return d[h]=KTt(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[s]=o}const QTt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:jTt};function XTt(n){var e=n.state,t=n.name;e.modifiersData[t]=YN({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const ZTt={name:"popperOffsets",enabled:!0,phase:"read",fn:XTt,data:{}};function JTt(n){return n==="x"?"y":"x"}function ext(n){var e=n.state,t=n.options,s=n.name,i=t.mainAxis,r=i===void 0?!0:i,o=t.altAxis,a=o===void 0?!1:o,l=t.boundary,u=t.rootBoundary,d=t.altBoundary,h=t.padding,f=t.tether,_=f===void 0?!0:f,m=t.tetherOffset,E=m===void 0?0:m,b=Ul(e,{boundary:l,rootBoundary:u,padding:h,altBoundary:d}),g=Xs(e.placement),y=oa(e.placement),v=!y,S=dE(g),w=JTt(S),x=e.modifiersData.popperOffsets,A=e.rects.reference,D=e.rects.popper,T=typeof E=="function"?E(Object.assign({},e.rects,{placement:e.placement})):E,O=typeof T=="number"?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),F=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,z={x:0,y:0};if(x){if(r){var Z,M=S==="y"?Hn:qn,q=S==="y"?gs:bs,H=S==="y"?"height":"width",P=x[S],$=P+b[M],J=P-b[q],re=_?-D[H]/2:0,me=y===sa?A[H]:D[H],Se=y===sa?-D[H]:-A[H],le=e.elements.arrow,Ee=_&&le?cE(le):{width:0,height:0},Oe=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:VN(),Me=Oe[M],j=Oe[q],pe=_l(0,A[H],Ee[H]),ue=v?A[H]/2-re-pe-Me-O.mainAxis:me-pe-Me-O.mainAxis,Ce=v?-A[H]/2+re+pe+j+O.mainAxis:Se+pe+j+O.mainAxis,ke=e.elements.arrow&&Jl(e.elements.arrow),N=ke?S==="y"?ke.clientTop||0:ke.clientLeft||0:0,V=(Z=F==null?void 0:F[S])!=null?Z:0,Y=P+ue-V-N,oe=P+Ce-V,ne=_l(_?Gd($,Y):$,P,_?zr(J,oe):J);x[S]=ne,z[S]=ne-P}if(a){var Te,Ae=S==="x"?Hn:qn,te=S==="x"?gs:bs,we=x[w],ge=w==="y"?"height":"width",De=we+b[Ae],k=we-b[te],I=[Hn,qn].indexOf(g)!==-1,W=(Te=F==null?void 0:F[w])!=null?Te:0,ye=I?De:we-A[ge]-D[ge]-W+O.altAxis,K=I?we+A[ge]+D[ge]-W-O.altAxis:k,ee=_&&I?xTt(ye,we,K):_l(_?ye:De,we,_?K:k);x[w]=ee,z[w]=ee-we}e.modifiersData[s]=z}}const txt={name:"preventOverflow",enabled:!0,phase:"main",fn:ext,requiresIfExists:["offset"]};function nxt(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function sxt(n){return n===Jn(n)||!fs(n)?uE(n):nxt(n)}function ixt(n){var e=n.getBoundingClientRect(),t=ia(e.width)/n.offsetWidth||1,s=ia(e.height)/n.offsetHeight||1;return t!==1||s!==1}function rxt(n,e,t){t===void 0&&(t=!1);var s=fs(e),i=fs(e)&&ixt(e),r=fr(e),o=ra(n,i,t),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(s||!s&&!t)&&((ei(e)!=="body"||_E(r))&&(a=sxt(e)),fs(e)?(l=ra(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):r&&(l.x=pE(r))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function oxt(n){var e=new Map,t=new Set,s=[];n.forEach(function(r){e.set(r.name,r)});function i(r){t.add(r.name);var o=[].concat(r.requires||[],r.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var l=e.get(a);l&&i(l)}}),s.push(r)}return n.forEach(function(r){t.has(r.name)||i(r)}),s}function axt(n){var e=oxt(n);return bTt.reduce(function(t,s){return t.concat(e.filter(function(i){return i.phase===s}))},[])}function lxt(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function cxt(n){var e=n.reduce(function(t,s){var i=t[s.name];return t[s.name]=i?Object.assign({},i,s,{options:Object.assign({},i.options,s.options),data:Object.assign({},i.data,s.data)}):s,t},{});return Object.keys(e).map(function(t){return e[t]})}var eC={placement:"bottom",modifiers:[],strategy:"absolute"};function tC(){for(var n=arguments.length,e=new Array(n),t=0;t(no("data-v-c538ea16"),n=n(),so(),n),bxt={key:0,class:"fixed top-0 left-0 w-screen h-screen flex items-center justify-center"},Ext={class:"flex flex-col text-center"},yxt={class:"flex flex-col text-center items-center"},vxt={class:"flex items-center gap-3 text-5xl drop-shadow-md align-middle pt-24"},Sxt=At(()=>c("img",{class:"w-24 animate-bounce",title:"LoLLMS WebUI",src:hs,alt:"Logo"},null,-1)),Txt={class:"flex flex-col items-start"},xxt={class:"text-2xl font-bold text-5xl drop-shadow-md align-middle"},Cxt=At(()=>c("p",{class:"text-gray-400 text-base"},"One tool to rule them all",-1)),wxt=At(()=>c("p",{class:"text-gray-400 text-base"},"by ParisNeo",-1)),Rxt=At(()=>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)),Axt=At(()=>c("p",{class:"text-2xl mb-10 font-bold drop-shadow-md"},"Welcome",-1)),Nxt={role:"status",class:"text-center w-full display: flex; flex-row align-items: center;"},Oxt={class:"text-2xl animate-pulse mt-2"},Ixt=At(()=>c("i",{"data-feather":"chevron-right"},null,-1)),Mxt=[Ixt],Dxt=At(()=>c("i",{"data-feather":"chevron-left"},null,-1)),kxt=[Dxt],Lxt=gu('',1),Pxt=[Lxt],Uxt={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"},Fxt={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"},Bxt={class:"flex-row p-4 flex items-center gap-3 flex-0"},Gxt=At(()=>c("i",{"data-feather":"plus"},null,-1)),Vxt=[Gxt],zxt=At(()=>c("i",{"data-feather":"check-square"},null,-1)),Hxt=[zxt],qxt={class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Reset database, remove all discussions"},Yxt=At(()=>c("i",{"data-feather":"database"},null,-1)),$xt=[Yxt],Wxt=At(()=>c("i",{"data-feather":"log-in"},null,-1)),Kxt=[Wxt],jxt=At(()=>c("i",{"data-feather":"folder"},null,-1)),Qxt=[jxt],Xxt={key:1,class:"dropdown"},Zxt=At(()=>c("i",{"data-feather":"search"},null,-1)),Jxt=[Zxt],eCt={key:2,class:"flex gap-3 flex-1 items-center duration-75"},tCt=At(()=>c("i",{"data-feather":"x"},null,-1)),nCt=[tCt],sCt=At(()=>c("i",{"data-feather":"check"},null,-1)),iCt=[sCt],rCt=At(()=>c("i",{"data-feather":"hard-drive"},null,-1)),oCt=[rCt],aCt=At(()=>c("i",{"data-feather":"check-circle"},null,-1)),lCt=[aCt],cCt=At(()=>c("i",{"data-feather":"x-octagon"},null,-1)),dCt=[cCt],uCt=At(()=>c("i",{"data-feather":"book"},null,-1)),pCt=[uCt],_Ct={key:7,title:"Loading..",class:"flex flex-row flex-grow justify-end"},hCt=At(()=>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)),fCt=[hCt],mCt={key:0,class:"flex-row items-center gap-3 flex-0 w-full"},gCt={class:"p-4 pt-2"},bCt={class:"relative"},ECt=At(()=>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)),yCt={class:"absolute inset-y-0 right-0 flex items-center pr-3"},vCt=At(()=>c("i",{"data-feather":"x"},null,-1)),SCt=[vCt],TCt={key:1,class:"h-px bg-bg-light p-0 mb-4 px-4 mx-4 border-0 dark:bg-bg-dark"},xCt={key:2,class:"flex flex-row flex-grow p-4 pt-0 items-center"},CCt={class:"flex flex-row flex-grow"},wCt={key:0},RCt={class:"flex flex-row"},ACt={key:0,class:"flex gap-3"},NCt=At(()=>c("i",{"data-feather":"trash"},null,-1)),OCt=[NCt],ICt={key:1,class:"flex gap-3 mx-3 flex-1 items-center justify-end group-hover:visible duration-75"},MCt=At(()=>c("i",{"data-feather":"check"},null,-1)),DCt=[MCt],kCt=At(()=>c("i",{"data-feather":"x"},null,-1)),LCt=[kCt],PCt={class:"flex gap-3"},UCt=At(()=>c("i",{"data-feather":"codepen"},null,-1)),FCt=[UCt],BCt=At(()=>c("i",{"data-feather":"folder"},null,-1)),GCt=[BCt],VCt=At(()=>c("i",{"data-feather":"bookmark"},null,-1)),zCt=[VCt],HCt=At(()=>c("i",{"data-feather":"list"},null,-1)),qCt=[HCt],YCt={class:"relative flex flex-row flex-grow mb-10 z-0 w-full"},$Ct={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"},WCt=At(()=>c("p",{class:"px-3"},"No discussions are found",-1)),KCt=[WCt],jCt=At(()=>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)),QCt={class:"text-center font-large font-bold text-l drop-shadow-md align-middle"},XCt={key:2,class:"relative flex flex-col flex-grow"},ZCt={class:"container pt-4 pb-50 mb-50 w-full"},JCt={key:0,class:"w-full 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 overflow-hidden p-4 pb-2 h-[600px]"},e1t=At(()=>c("h2",{class:"text-2xl font-bold mb-4"},"Prompt examples",-1)),t1t={key:0,class:"overflow-y-auto flex-grow pr-2 custom-scrollbar"},n1t={class:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 p-2"},s1t=["onClick"],i1t=["title"],r1t={class:"absolute inset-0 overflow-hidden"},o1t=At(()=>c("div",{class:"absolute inset-0 bg-gradient-to-b from-transparent via-transparent to-white dark:to-gray-800 group-hover:opacity-0 transition-opacity duration-300"},null,-1)),a1t=At(()=>c("div",{class:"mt-2 text-sm text-gray-500 dark:text-gray-400 opacity-0 group-hover:opacity-100 transition-opacity duration-300"}," Click to select ",-1)),l1t=At(()=>c("div",null,[c("br"),c("br"),c("br"),c("br"),c("br"),c("br"),c("br")],-1)),c1t=At(()=>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)),d1t={key:0,class:"flex flex-row items-center justify-center h-10"},u1t={key:0,class:"relative flex flex-col no-scrollbar shadow-lg w-1/2 bg-bg-light-tone dark:bg-bg-dark-tone h-full"},p1t={ref:"isolatedContent",class:"h-full"},_1t={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"},h1t={class:"text-2xl animate-pulse mt-2 text-light-text-panel dark:text-dark-text-panel"},f1t={setup(){},data(){return{lastMessageHtml:"",defaultMessageHtml:` +`+n.name,4,!1)}else console.log("mounting pers");this.$emit("personalitySelected"),Ue(()=>{Ge.replace()})}},async select_personality(n){if(!n)return{status:!1,error:"no personality - select_personality"};const e=n.language===null?n.full_path:n.full_path+":"+n.language;console.log("Selecting personality ",e);const t=this.$store.state.config.personalities.findIndex(i=>i===e),s={client_id:this.$store.state.client_id,id:t};try{const i=await de.post("/select_personality",s);if(i)return this.$store.dispatch("refreshConfig").then(()=>{this.$store.dispatch("refreshPersonalitiesZoo").then(()=>{this.$store.dispatch("refreshMountedPersonalities")})}),i.data}catch(i){console.log(i.message,"select_personality - settings");return}},emitloaded(){this.$emit("loaded")},showModels(n){n.preventDefault();const e=this.$refs.modelsSelectionList;console.log(e);const t=new MouseEvent("click");e.dispatchEvent(t)},setBinding(n){console.log("Setting binding to "+n.name),this.selecting_binding=!0,this.selectedBinding=n,this.$store.state.messageBox.showBlockingMessage("Loading binding"),de.post("/update_setting",{client_id:this.$store.state.client_id,setting_name:"binding_name",setting_value:n.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(n){console.log("Setting model to "+n.name),this.selecting_model=!0,this.selectedModel=n,this.$store.state.messageBox.showBlockingMessage("Loading model"),de.post("/update_setting",{client_id:this.$store.state.client_id,setting_name:"model_name",setting_value:n.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(){de.get("/download_files")},remove_file(n){de.get("/remove_discussion_file",{client_id:this.$store.state.client_id,name:n}).then(e=>{console.log(e)})},clear_files(){de.post("/clear_discussion_files_list",{client_id:this.$store.state.client_id}).then(n=>{console.log(n),n.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(n,e){console.log("Send file triggered");const t=new FileReader,s=24*1024;let i=0,r=0;t.onloadend=()=>{if(t.error){console.error("Error reading file:",t.error);return}const a=t.result,l=i+a.byteLength>=n.size;He.emit("send_file_chunk",{filename:n.name,chunk:a,offset:i,isLastChunk:l,chunkIndex:r}),i+=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=n.slice(i,i+s);t.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),He.emit("start_bidirectional_audio_stream"),Ue(()=>{Ge.replace()})},stopRTCom(){this.is_rt=!1,console.log("is_rt:",this.is_rt),He.emit("stop_bidirectional_audio_stream"),Ue(()=>{Ge.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=n=>{let e="";for(let t=n.resultIndex;t{this.recognition.stop()},this.silenceTimeout)},this.recognition.onerror=n=>{console.error("Speech recognition error:",n.error),this.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(n){this.showPersonalities=!this.showPersonalities},handleOnTalk(n){console.log("talking"),this.showPersonalities=!1,this.$store.state.toast.showToast(`Personality ${n.name} is Talking`,4,!0),this.onTalk(n)},onMountFun(n){console.log("Mounting personality"),this.$refs.mountedPers.constructor()},onUnmountFun(n){console.log("Unmounting personality"),this.$refs.mountedPers.constructor()},onRemount(n){console.log("Remounting chat"),this.$refs.mountedPers.constructor()},computedFileSize(n){return Ue(()=>{Ge.replace()}),js(n)},removeItem(n){console.log("Removing ",n.name),de.post("/remove_discussion_file",{client_id:this.$store.state.client_id,name:n.name},{headers:this.posts_headers}).then(()=>{this.filesList=this.filesList.filter(e=>e!=n)}),console.log(this.filesList)},sendMessageEvent(n,e="no_internet"){this.$emit("messageSentEvent",n,e)},sendCMDEvent(n){this.$emit("sendCMDEvent",n)},async mountDB(n){await de.post("/toggle_mount_rag_database",{client_id:this.$store.state.client_id,database_name:n}),await this.$store.dispatch("refreshConfig"),console.log("Refreshed")},addWebLink(){console.log("Emitting addWebLink"),this.$emit("addWebLink")},add_file(){const n=document.createElement("input");n.type="file",n.style.display="none",n.multiple=!0,document.body.appendChild(n),n.addEventListener("change",()=>{console.log("Calling Add file..."),this.addFiles(n.files),document.body.removeChild(n)}),n.click()},takePicture(){He.emit("take_picture"),He.on("picture_taken",()=>{de.post("/get_discussion_files_list",{client_id:this.$store.state.client_id}).then(n=>{this.filesList=n.data.files,this.isFileSentList=n.data.files.map(e=>!0),console.log(`Files recovered: ${this.filesList}`)})})},submitOnEnter(n){this.loading||n.which===13&&(n.preventDefault(),n.repeat||(this.sendMessageEvent(this.message),this.message=""))},submit(){this.message&&(this.sendMessageEvent(this.message),this.message="")},submitWithInternetSearch(){this.message&&(this.sendMessageEvent(this.message,"internet"),this.message="")},stopGenerating(){this.$emit("stopGenerating")},addFiles(n){console.log("Adding files");const e=[...n];let t=0;const s=()=>{if(t>=e.length){console.log(`Files_list: ${this.filesList}`);return}const i=e[t];this.filesList.push(i),this.isFileSentList.push(!1),this.send_file(i,()=>{t++,s()})};s()}},watch:{installedModels:{immediate:!0,handler(n){this.$nextTick(()=>{this.installedModels=n})}},model_name:{immediate:!0,handler(n){this.$nextTick(()=>{this.model_name=n})}},showfilesList(){Ue(()=>{Ge.replace()})},loading(n,e){Ue(()=>{Ge.replace()})},filesList:{handler(n,e){let t=0;if(n.length>0)for(let s=0;s{Ge.replace()}),console.log("Chatbar mounted"),He.on("rtcom_status_changed",n=>{this.$store.dispatch("fetchisRTOn"),console.log("rtcom_status_changed: ",n.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(){Ue(()=>{Ge.replace()})}},kt=n=>(no("data-v-64fb461b"),n=n(),so(),n),qvt={class:"absolute bottom-0 left-0 w-fit min-w-96 w-full justify-center text-center"},Yvt={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"},$vt={class:"flex"},Wvt=["title"],Kvt=kt(()=>c("i",{"data-feather":"list"},null,-1)),jvt=[Kvt],Qvt={key:0},Xvt={class:"flex flex-col max-h-64"},Zvt=["title"],Jvt={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"},eSt={key:0,filesList:"",role:"status"},tSt=kt(()=>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)),nSt=kt(()=>c("span",{class:"sr-only"},"Loading...",-1)),sSt=[tSt,nSt],iSt=kt(()=>c("div",null,[c("i",{"data-feather":"file",class:"w-5 h-5"})],-1)),rSt=kt(()=>c("div",{class:"grow"},null,-1)),oSt={class:"flex flex-row items-center"},aSt={class:"whitespace-nowrap"},lSt=["onClick"],cSt=kt(()=>c("i",{"data-feather":"x",class:"w-5 h-5"},null,-1)),dSt=[cSt],uSt={key:1,class:"flex mx-1 w-500"},pSt={class:"whitespace-nowrap flex flex-row gap-2"},_St=kt(()=>c("p",{class:"font-bold"}," Total size: ",-1)),hSt=kt(()=>c("div",{class:"grow"},null,-1)),fSt=kt(()=>c("i",{"data-feather":"trash",class:"w-5 h-5"},null,-1)),mSt=[fSt],gSt=kt(()=>c("i",{"data-feather":"download-cloud",class:"w-5 h-5"},null,-1)),bSt=[gSt],ESt={key:2,class:"mx-1"},ySt={key:1,title:"Selecting model",class:"flex flex-row flex-grow justify-end bg-primary"},vSt={role:"status"},SSt=["src"],TSt=kt(()=>c("span",{class:"sr-only"},"Selecting model...",-1)),xSt={class:"flex w-fit relative grow w-full"},CSt={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"},wSt={key:0,title:"Waiting for reply"},RSt=["src"],ASt=kt(()=>c("div",{role:"status"},[c("span",{class:"sr-only"},"Loading...")],-1)),NSt={key:1,class:"w-fit group relative"},OSt={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"},ISt={class:"w-fit flex-wrap flex bg-white bg-opacity-50 backdrop-blur-md rounded p-4"},MSt=["onMouseover"],DSt={class:"relative"},kSt=["onClick"],LSt=["src","title"],PSt={class:"group items-center flex flex-row"},USt=["src","title"],FSt={key:2,class:"w-fit group relative"},BSt={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"},GSt={class:"w-fit flex-wrap flex bg-white bg-opacity-50 backdrop-blur-md rounded p-4"},VSt=["onMouseover"],zSt={class:"relative"},HSt=["onClick"],qSt=["src","title"],YSt={class:"group items-center flex flex-row"},$St=["src","title"],WSt={key:3,class:"w-fit group relative"},KSt={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"},jSt={class:"w-fit flex-wrap flex bg-white bg-opacity-50 backdrop-blur-md rounded p-4"},QSt=["onMouseover"],XSt={class:"relative"},ZSt=["onClick"],JSt=["src","title"],e0t=["onClick"],t0t=kt(()=>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)),n0t=[t0t],s0t=["onClick"],i0t=kt(()=>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)),r0t=[i0t],o0t=["onClick"],a0t=kt(()=>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)),l0t=[a0t],c0t={class:"w-fit"},d0t={class:"w-fit"},u0t={class:"relative grow"},p0t={class:"group relative w-max"},_0t=kt(()=>c("i",{"data-feather":"send"},null,-1)),h0t=[_0t],f0t=kt(()=>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)),m0t={class:"group relative w-max"},g0t=["src"],b0t=kt(()=>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)),E0t={class:"group relative w-max"},y0t=kt(()=>c("i",{"data-feather":"mic"},null,-1)),v0t=[y0t],S0t=kt(()=>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)),T0t={key:5,class:"group relative w-max"},x0t=kt(()=>c("i",{"data-feather":"mic"},null,-1)),C0t=[x0t],w0t=kt(()=>c("i",{"data-feather":"mic"},null,-1)),R0t=[w0t],A0t=kt(()=>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)),N0t={key:6,class:"group relative w-max"},O0t=kt(()=>c("i",{"data-feather":"file-plus"},null,-1)),I0t=[O0t],M0t=kt(()=>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)),D0t={class:"group relative w-max"},k0t=kt(()=>c("i",{"data-feather":"camera"},null,-1)),L0t=[k0t],P0t=kt(()=>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)),U0t={class:"group relative w-max"},F0t=kt(()=>c("i",{"data-feather":"globe"},null,-1)),B0t=[F0t],G0t=kt(()=>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)),V0t={class:"group relative w-max"},z0t=kt(()=>c("i",{"data-feather":"message-square"},null,-1)),H0t=[z0t],q0t=kt(()=>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)),Y0t={class:"group relative w-max"},$0t=kt(()=>c("i",{"data-feather":"message-square"},null,-1)),W0t=[$0t],K0t=kt(()=>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)),j0t=kt(()=>c("div",{class:"ml-auto gap-2"},null,-1));function Q0t(n,e,t,s,i,r){const o=dt("MountedPersonalitiesList"),a=dt("MountedPersonalities"),l=dt("PersonalitiesCommands"),u=dt("UniversalForm");return C(),R(ze,null,[c("form",null,[c("div",qvt,[i.filesList.length>0||i.showPersonalities?(C(),R("div",Yvt,[c("div",$vt,[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:i.showfilesList?"Hide file list":"Show file list",type:"button",onClick:e[0]||(e[0]=ae(d=>i.showfilesList=!i.showfilesList,["stop"]))},jvt,8,Wvt)]),i.filesList.length>0&&i.showfilesList==!0?(C(),R("div",Qvt,[c("div",Xvt,[_e(Qs,{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:qe(()=>[(C(!0),R(ze,null,st(i.filesList,(d,h)=>(C(),R("div",{key:h+"-"+d.name},[c("div",{class:"m-1",title:d.name},[c("div",Jvt,[i.isFileSentList[h]?G("",!0):(C(),R("div",eSt,sSt)),iSt,c("div",{class:Fe(["line-clamp-1 w-3/5",i.isFileSentList[h]?"text-green-500":"text-red-200"])},se(d.name),3),rSt,c("div",oSt,[c("p",aSt,se(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)},dSt,8,lSt)])])],8,Zvt)]))),128))]),_:1})])])):G("",!0),i.filesList.length>0?(C(),R("div",uSt,[c("div",pSt,[_St,Xe(" "+se(i.totalSize)+" ("+se(i.filesList.length)+") ",1)]),hSt,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))},mSt),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))},bSt)])):G("",!0),i.showPersonalities?(C(),R("div",ESt,[_e(o,{ref:"mountedPersList",onShowPersList:r.onShowPersListFun,"on-mounted":r.onMountFun,"on-un-mounted":r.onUnmountFun,"on-remounted":n.onRemountFun,"on-talk":r.handleOnTalk,discussionPersonalities:r.allDiscussionPersonalities},null,8,["onShowPersList","on-mounted","on-un-mounted","on-remounted","on-talk","discussionPersonalities"])])):G("",!0)])):G("",!0),i.selecting_model||i.selecting_binding?(C(),R("div",ySt,[c("div",vSt,[c("img",{src:i.loader_v0,class:"w-50 h-50"},null,8,SSt),TSt])])):G("",!0),c("div",xSt,[c("div",CSt,[t.loading?(C(),R("div",wSt,[c("img",{src:i.loader_v0},null,8,RSt),ASt])):G("",!0),t.loading?G("",!0):(C(),R("div",NSt,[c("div",OSt,[c("div",ISt,[(C(!0),R(ze,null,st(r.installedBindings,(d,h)=>(C(),R("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?(C(),R("div",{key:0,class:Fe(["items-center flex flex-row relative z-20 hover:-translate-y-8 duration-300",i.bindingHoveredIndex===h?"scale-150":""])},[c("div",DSt,[c("button",{onClick:ae(f=>r.setBinding(d),["prevent"]),class:"w-10 h-10 relative"},[c("img",{src:d.icon?d.icon:i.modelImgPlaceholder,onError:e[3]||(e[3]=(...f)=>i.modelImgPlaceholder&&i.modelImgPlaceholder(...f)),class:Fe(["z-50 w-10 h-10 rounded-full object-fill text-red-700 border-2 border-gray-500 active:scale-90",i.bindingHoveredIndex===h?"scale-150 ":""+d.name==r.binding_name?"border-secondary":"border-transparent z-0"]),title:d.name},null,42,LSt)],8,kSt)])],2)):G("",!0)],40,MSt))),128))])]),c("div",PSt,[c("button",{onClick:e[5]||(e[5]=ae(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,USt)])])])),t.loading?G("",!0):(C(),R("div",FSt,[c("div",BSt,[c("div",GSt,[(C(!0),R(ze,null,st(r.installedModels,(d,h)=>(C(),R("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?(C(),R("div",{key:0,class:Fe(["items-center flex flex-row relative z-20 hover:-translate-y-8 duration-300",i.modelHoveredIndex===h?"scale-150":""])},[c("div",zSt,[c("button",{onClick:ae(f=>r.setModel(d),["prevent"]),class:"w-10 h-10 relative"},[c("img",{src:d.icon?d.icon:i.modelImgPlaceholder,onError:e[6]||(e[6]=(...f)=>n.personalityImgPlacehodler&&n.personalityImgPlacehodler(...f)),class:Fe(["z-50 w-10 h-10 rounded-full object-fill text-red-700 border-2 border-gray-500 active:scale-90",i.modelHoveredIndex===h?"scale-150 ":""+d.name==r.model_name?"border-secondary":"border-transparent z-0"]),title:d.name},null,42,qSt)],8,HSt)])],2)):G("",!0)],40,VSt))),128))])]),c("div",YSt,[c("button",{onClick:e[8]||(e[8]=ae(d=>r.copyModelName(),["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,$St)])])])),t.loading?G("",!0):(C(),R("div",WSt,[c("div",KSt,[c("div",jSt,[(C(!0),R(ze,null,st(r.mountedPersonalities,(d,h)=>(C(),R("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?(C(),R("div",{key:0,class:Fe(["items-center flex flex-row relative z-20 hover:-translate-y-8 duration-300",i.personalityHoveredIndex===h?"scale-150":""])},[c("div",XSt,[c("button",{onClick:ae(f=>r.onPersonalitySelected(d),["prevent"]),class:"w-10 h-10 relative"},[c("img",{src:i.bUrl+d.avatar,onError:e[9]||(e[9]=(...f)=>n.personalityImgPlacehodler&&n.personalityImgPlacehodler(...f)),class:Fe(["z-50 w-10 h-10 rounded-full object-fill text-red-700 border-2 border-gray-500 active:scale-90",i.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,JSt)],8,ZSt),i.personalityHoveredIndex===h?(C(),R("button",{key:0,onClick:ae(f=>r.unmountPersonality(d),["prevent"])},n0t,8,e0t)):G("",!0),i.personalityHoveredIndex===h?(C(),R("button",{key:1,onClick:ae(f=>r.remount_personality(d),["prevent"])},r0t,8,s0t)):G("",!0),i.personalityHoveredIndex===h?(C(),R("button",{key:2,onClick:ae(f=>r.handleOnTalk(d),["prevent"])},l0t,8,o0t)):G("",!0)])],2)):G("",!0)],40,QSt))),128))])]),_e(a,{ref:"mountedPers",onShowPersList:r.onShowPersListFun,onReady:r.onPersonalitiesReadyFun},null,8,["onShowPersList","onReady"])])),c("div",c0t,[i.personalities_ready&&this.$store.state.mountedPersArr[this.$store.state.config.active_personality_id].commands!=""?(C(),St(l,{key:0,commandsList:this.$store.state.mountedPersArr[this.$store.state.config.active_personality_id].commands,sendCommand:r.sendCMDEvent,"on-show-toast-message":t.onShowToastMessage,ref:"personalityCMD"},null,8,["commandsList","sendCommand","on-show-toast-message"])):G("",!0)]),c("div",d0t,[r.isDataSourceNamesValid?(C(),St(l,{key:0,icon:"feather:book",commandsList:r.dataSourceNames,sendCommand:r.mountDB,"on-show-toast-message":t.onShowToastMessage,ref:"databasesList"},null,8,["commandsList","sendCommand","on-show-toast-message"])):G("",!0)]),c("div",u0t,[B(c("textarea",{id:"chat",rows:"1","onUpdate:modelValue":e[11]||(e[11]=d=>i.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]=Ai(ae(d=>r.submitOnEnter(d),["exact"]),["enter"]))},`\r + `,544),[[he,i.message]])]),t.loading?(C(),R("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]=ae((...d)=>r.stopGenerating&&r.stopGenerating(...d),["stop"]))}," Stop generating ")):G("",!0),c("div",p0t,[t.loading?G("",!0):(C(),R("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"},h0t)),f0t]),c("div",m0t,[t.loading?G("",!0):(C(),R("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:i.sendGlobe,width:"50",height:"50",style:{stroke:"currentColor",fill:"currentColor"}},null,8,g0t)])),b0t]),c("div",E0t,[t.loading?G("",!0):(C(),R("button",{key:0,type:"button",onClick:e[17]||(e[17]=(...d)=>r.startSpeechRecognition&&r.startSpeechRecognition(...d)),class:Fe([{"text-red-500":i.isListeningToVoice},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer transform transition-transform hover:translate-y-[-5px] active:scale-90"])},v0t,2)),S0t]),n.$store.state.config.active_tts_service!="None"?(C(),R("div",T0t,[i.is_rt?(C(),R("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"},C0t)):(C(),R("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"},R0t)),A0t])):G("",!0),t.loading?G("",!0):(C(),R("div",N0t,[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]=ae((...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"},I0t),M0t])),c("div",D0t,[t.loading?G("",!0):(C(),R("button",{key:0,type:"button",onClick:e[22]||(e[22]=ae((...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"},L0t)),P0t]),c("div",U0t,[t.loading?G("",!0):(C(),R("button",{key:0,type:"button",onClick:e[23]||(e[23]=ae((...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"},B0t)),G0t]),c("div",V0t,[t.loading?G("",!0):(C(),R("button",{key:0,type:"button",onClick:e[24]||(e[24]=ae((...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]"},H0t)),q0t]),c("div",Y0t,[t.loading?G("",!0):(C(),R("button",{key:0,type:"button",onClick:e[25]||(e[25]=ae((...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]"},W0t)),K0t])]),j0t])])]),_e(u,{ref:"universalForm",class:"z-20"},null,512)],64)}const IN=pt(Hvt,[["render",Q0t],["__scopeId","data-v-64fb461b"]]),X0t={name:"WelcomeComponent",computed:{storeLogo(){return this.$store.state.config?hs:this.$store.state.config.app_custom_logo!=""?"/user_infos/"+this.$store.state.config.app_custom_logo:hs}},data(){},setup(){return{}}},Z0t={class:"flex flex-col text-center w-full h-full"},J0t={class:"flex flex-col text-center items-center"},eTt={class:"flex items-center gap-3 text-5xl drop-shadow-md align-middle pt-24"},tTt=["src"],nTt=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),sTt=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),iTt=c("p",{class:"text-2xl"},"Welcome",-1),rTt=c("p",{class:"text-lg"},"Please create a new discussion or select existing one to start",-1);function oTt(n,e,t,s,i,r){return C(),R("div",Z0t,[c("div",J0t,[c("div",eTt,[c("img",{class:"w-12 hover:scale-95 duration-150",title:"LoLLMS WebUI",src:n.$store.state.config==null?r.storeLogo:n.$store.state.config.app_custom_logo!=""?"/user_infos/"+n.$store.state.config.app_custom_logo:r.storeLogo,alt:"Logo"},null,8,tTt),nTt]),sTt,iTt,rTt])])}const MN=pt(X0t,[["render",oTt]]);var aTt=function(){function n(e,t){t===void 0&&(t=[]),this._eventType=e,this._eventFunctions=t}return n.prototype.init=function(){var e=this;this._eventFunctions.forEach(function(t){typeof window<"u"&&window.addEventListener(e._eventType,t)})},n}(),Pd=globalThis&&globalThis.__assign||function(){return Pd=Object.assign||function(n){for(var e,t=1,s=arguments.length;t"u")return!1;var e=Jn(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function yTt(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var s=e.styles[t]||{},i=e.attributes[t]||{},r=e.elements[t];!fs(r)||!ei(r)||(Object.assign(r.style,s),Object.keys(i).forEach(function(o){var a=i[o];a===!1?r.removeAttribute(o):r.setAttribute(o,a===!0?"":a)}))})}function vTt(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(s){var i=e.elements[s],r=e.attributes[s]||{},o=Object.keys(e.styles.hasOwnProperty(s)?e.styles[s]:t[s]),a=o.reduce(function(l,u){return l[u]="",l},{});!fs(i)||!ei(i)||(Object.assign(i.style,a),Object.keys(r).forEach(function(l){i.removeAttribute(l)}))})}}const STt={name:"applyStyles",enabled:!0,phase:"write",fn:yTt,effect:vTt,requires:["computeStyles"]};function Xs(n){return n.split("-")[0]}var zr=Math.max,Gd=Math.min,ia=Math.round;function Og(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function BN(){return!/^((?!chrome|android).)*safari/i.test(Og())}function ra(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var s=n.getBoundingClientRect(),i=1,r=1;e&&fs(n)&&(i=n.offsetWidth>0&&ia(s.width)/n.offsetWidth||1,r=n.offsetHeight>0&&ia(s.height)/n.offsetHeight||1);var o=Qr(n)?Jn(n):window,a=o.visualViewport,l=!BN()&&t,u=(s.left+(l&&a?a.offsetLeft:0))/i,d=(s.top+(l&&a?a.offsetTop:0))/r,h=s.width/i,f=s.height/r;return{width:h,height:f,top:d,right:u+h,bottom:d+f,left:u,x:u,y:d}}function cE(n){var e=ra(n),t=n.offsetWidth,s=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-s)<=1&&(s=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:s}}function GN(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&lE(t)){var s=e;do{if(s&&n.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function Ni(n){return Jn(n).getComputedStyle(n)}function TTt(n){return["table","td","th"].indexOf(ei(n))>=0}function fr(n){return((Qr(n)?n.ownerDocument:n.document)||window.document).documentElement}function Vu(n){return ei(n)==="html"?n:n.assignedSlot||n.parentNode||(lE(n)?n.host:null)||fr(n)}function Kx(n){return!fs(n)||Ni(n).position==="fixed"?null:n.offsetParent}function xTt(n){var e=/firefox/i.test(Og()),t=/Trident/i.test(Og());if(t&&fs(n)){var s=Ni(n);if(s.position==="fixed")return null}var i=Vu(n);for(lE(i)&&(i=i.host);fs(i)&&["html","body"].indexOf(ei(i))<0;){var r=Ni(i);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 i;i=i.parentNode}return null}function Jl(n){for(var e=Jn(n),t=Kx(n);t&&TTt(t)&&Ni(t).position==="static";)t=Kx(t);return t&&(ei(t)==="html"||ei(t)==="body"&&Ni(t).position==="static")?e:t||xTt(n)||e}function dE(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function _l(n,e,t){return zr(n,Gd(e,t))}function CTt(n,e,t){var s=_l(n,e,t);return s>t?t:s}function VN(){return{top:0,right:0,bottom:0,left:0}}function zN(n){return Object.assign({},VN(),n)}function HN(n,e){return e.reduce(function(t,s){return t[s]=n,t},{})}var wTt=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,zN(typeof e!="number"?e:HN(e,Zl))};function RTt(n){var e,t=n.state,s=n.name,i=n.options,r=t.elements.arrow,o=t.modifiersData.popperOffsets,a=Xs(t.placement),l=dE(a),u=[qn,bs].indexOf(a)>=0,d=u?"height":"width";if(!(!r||!o)){var h=wTt(i.padding,t),f=cE(r),_=l==="y"?Hn:qn,m=l==="y"?gs:bs,E=t.rects.reference[d]+t.rects.reference[l]-o[l]-t.rects.popper[d],b=o[l]-t.rects.reference[l],g=Jl(r),y=g?l==="y"?g.clientHeight||0:g.clientWidth||0:0,v=E/2-b/2,S=h[_],w=y-f[d]-h[m],x=y/2-f[d]/2+v,A=_l(S,x,w),D=l;t.modifiersData[s]=(e={},e[D]=A,e.centerOffset=A-x,e)}}function ATt(n){var e=n.state,t=n.options,s=t.element,i=s===void 0?"[data-popper-arrow]":s;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||GN(e.elements.popper,i)&&(e.elements.arrow=i))}const NTt={name:"arrow",enabled:!0,phase:"main",fn:RTt,effect:ATt,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function oa(n){return n.split("-")[1]}var OTt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ITt(n,e){var t=n.x,s=n.y,i=e.devicePixelRatio||1;return{x:ia(t*i)/i||0,y:ia(s*i)/i||0}}function jx(n){var e,t=n.popper,s=n.popperRect,i=n.placement,r=n.variation,o=n.offsets,a=n.position,l=n.gpuAcceleration,u=n.adaptive,d=n.roundOffsets,h=n.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=qn,S=Hn,w=window;if(u){var x=Jl(t),A="clientHeight",D="clientWidth";if(x===Jn(t)&&(x=fr(t),Ni(x).position!=="static"&&a==="absolute"&&(A="scrollHeight",D="scrollWidth")),x=x,i===Hn||(i===qn||i===bs)&&r===Pl){S=gs;var T=h&&x===w&&w.visualViewport?w.visualViewport.height:x[A];E-=T-s.height,E*=l?1:-1}if(i===qn||(i===Hn||i===gs)&&r===Pl){v=bs;var O=h&&x===w&&w.visualViewport?w.visualViewport.width:x[D];_-=O-s.width,_*=l?1:-1}}var F=Object.assign({position:a},u&&OTt),z=d===!0?ITt({x:_,y:E},Jn(t)):{x:_,y:E};if(_=z.x,E=z.y,l){var Z;return Object.assign({},F,(Z={},Z[S]=y?"0":"",Z[v]=g?"0":"",Z.transform=(w.devicePixelRatio||1)<=1?"translate("+_+"px, "+E+"px)":"translate3d("+_+"px, "+E+"px, 0)",Z))}return Object.assign({},F,(e={},e[S]=y?E+"px":"",e[v]=g?_+"px":"",e.transform="",e))}function MTt(n){var e=n.state,t=n.options,s=t.gpuAcceleration,i=s===void 0?!0:s,r=t.adaptive,o=r===void 0?!0:r,a=t.roundOffsets,l=a===void 0?!0:a,u={placement:Xs(e.placement),variation:oa(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,jx(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,jx(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 DTt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:MTt,data:{}};var xc={passive:!0};function kTt(n){var e=n.state,t=n.instance,s=n.options,i=s.scroll,r=i===void 0?!0:i,o=s.resize,a=o===void 0?!0:o,l=Jn(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&u.forEach(function(d){d.addEventListener("scroll",t.update,xc)}),a&&l.addEventListener("resize",t.update,xc),function(){r&&u.forEach(function(d){d.removeEventListener("scroll",t.update,xc)}),a&&l.removeEventListener("resize",t.update,xc)}}const LTt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:kTt,data:{}};var PTt={left:"right",right:"left",bottom:"top",top:"bottom"};function gd(n){return n.replace(/left|right|bottom|top/g,function(e){return PTt[e]})}var UTt={start:"end",end:"start"};function Qx(n){return n.replace(/start|end/g,function(e){return UTt[e]})}function uE(n){var e=Jn(n),t=e.pageXOffset,s=e.pageYOffset;return{scrollLeft:t,scrollTop:s}}function pE(n){return ra(fr(n)).left+uE(n).scrollLeft}function FTt(n,e){var t=Jn(n),s=fr(n),i=t.visualViewport,r=s.clientWidth,o=s.clientHeight,a=0,l=0;if(i){r=i.width,o=i.height;var u=BN();(u||!u&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:r,height:o,x:a+pE(n),y:l}}function BTt(n){var e,t=fr(n),s=uE(n),i=(e=n.ownerDocument)==null?void 0:e.body,r=zr(t.scrollWidth,t.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=zr(t.scrollHeight,t.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-s.scrollLeft+pE(n),l=-s.scrollTop;return Ni(i||t).direction==="rtl"&&(a+=zr(t.clientWidth,i?i.clientWidth:0)-r),{width:r,height:o,x:a,y:l}}function _E(n){var e=Ni(n),t=e.overflow,s=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+i+s)}function qN(n){return["html","body","#document"].indexOf(ei(n))>=0?n.ownerDocument.body:fs(n)&&_E(n)?n:qN(Vu(n))}function hl(n,e){var t;e===void 0&&(e=[]);var s=qN(n),i=s===((t=n.ownerDocument)==null?void 0:t.body),r=Jn(s),o=i?[r].concat(r.visualViewport||[],_E(s)?s:[]):s,a=e.concat(o);return i?a:a.concat(hl(Vu(o)))}function Ig(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function GTt(n,e){var t=ra(n,!1,e==="fixed");return t.top=t.top+n.clientTop,t.left=t.left+n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top,t}function Xx(n,e,t){return e===UN?Ig(FTt(n,t)):Qr(e)?GTt(e,t):Ig(BTt(fr(n)))}function VTt(n){var e=hl(Vu(n)),t=["absolute","fixed"].indexOf(Ni(n).position)>=0,s=t&&fs(n)?Jl(n):n;return Qr(s)?e.filter(function(i){return Qr(i)&&GN(i,s)&&ei(i)!=="body"}):[]}function zTt(n,e,t,s){var i=e==="clippingParents"?VTt(n):[].concat(e),r=[].concat(i,[t]),o=r[0],a=r.reduce(function(l,u){var d=Xx(n,u,s);return l.top=zr(d.top,l.top),l.right=Gd(d.right,l.right),l.bottom=Gd(d.bottom,l.bottom),l.left=zr(d.left,l.left),l},Xx(n,o,s));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function YN(n){var e=n.reference,t=n.element,s=n.placement,i=s?Xs(s):null,r=s?oa(s):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,l;switch(i){case Hn:l={x:o,y:e.y-t.height};break;case gs:l={x:o,y:e.y+e.height};break;case bs:l={x:e.x+e.width,y:a};break;case qn:l={x:e.x-t.width,y:a};break;default:l={x:e.x,y:e.y}}var u=i?dE(i):null;if(u!=null){var d=u==="y"?"height":"width";switch(r){case sa:l[u]=l[u]-(e[d]/2-t[d]/2);break;case Pl:l[u]=l[u]+(e[d]/2-t[d]/2);break}}return l}function Ul(n,e){e===void 0&&(e={});var t=e,s=t.placement,i=s===void 0?n.placement:s,r=t.strategy,o=r===void 0?n.strategy:r,a=t.boundary,l=a===void 0?lTt:a,u=t.rootBoundary,d=u===void 0?UN:u,h=t.elementContext,f=h===void 0?Wa:h,_=t.altBoundary,m=_===void 0?!1:_,E=t.padding,b=E===void 0?0:E,g=zN(typeof b!="number"?b:HN(b,Zl)),y=f===Wa?cTt:Wa,v=n.rects.popper,S=n.elements[m?y:f],w=zTt(Qr(S)?S:S.contextElement||fr(n.elements.popper),l,d,o),x=ra(n.elements.reference),A=YN({reference:x,element:v,strategy:"absolute",placement:i}),D=Ig(Object.assign({},v,A)),T=f===Wa?D:x,O={top:w.top-T.top+g.top,bottom:T.bottom-w.bottom+g.bottom,left:w.left-T.left+g.left,right:T.right-w.right+g.right},F=n.modifiersData.offset;if(f===Wa&&F){var z=F[i];Object.keys(O).forEach(function(Z){var M=[bs,gs].indexOf(Z)>=0?1:-1,q=[Hn,gs].indexOf(Z)>=0?"y":"x";O[Z]+=z[q]*M})}return O}function HTt(n,e){e===void 0&&(e={});var t=e,s=t.placement,i=t.boundary,r=t.rootBoundary,o=t.padding,a=t.flipVariations,l=t.allowedAutoPlacements,u=l===void 0?FN:l,d=oa(s),h=d?a?Wx:Wx.filter(function(m){return oa(m)===d}):Zl,f=h.filter(function(m){return u.indexOf(m)>=0});f.length===0&&(f=h);var _=f.reduce(function(m,E){return m[E]=Ul(n,{placement:E,boundary:i,rootBoundary:r,padding:o})[Xs(E)],m},{});return Object.keys(_).sort(function(m,E){return _[m]-_[E]})}function qTt(n){if(Xs(n)===aE)return[];var e=gd(n);return[Qx(n),e,Qx(e)]}function YTt(n){var e=n.state,t=n.options,s=n.name;if(!e.modifiersData[s]._skip){for(var i=t.mainAxis,r=i===void 0?!0:i,o=t.altAxis,a=o===void 0?!0:o,l=t.fallbackPlacements,u=t.padding,d=t.boundary,h=t.rootBoundary,f=t.altBoundary,_=t.flipVariations,m=_===void 0?!0:_,E=t.allowedAutoPlacements,b=e.options.placement,g=Xs(b),y=g===b,v=l||(y||!m?[gd(b)]:qTt(b)),S=[b].concat(v).reduce(function(Ee,Oe){return Ee.concat(Xs(Oe)===aE?HTt(e,{placement:Oe,boundary:d,rootBoundary:h,padding:u,flipVariations:m,allowedAutoPlacements:E}):Oe)},[]),w=e.rects.reference,x=e.rects.popper,A=new Map,D=!0,T=S[0],O=0;O=0,q=M?"width":"height",H=Ul(e,{placement:F,boundary:d,rootBoundary:h,altBoundary:f,padding:u}),P=M?Z?bs:qn:Z?gs:Hn;w[q]>x[q]&&(P=gd(P));var $=gd(P),J=[];if(r&&J.push(H[z]<=0),a&&J.push(H[P]<=0,H[$]<=0),J.every(function(Ee){return Ee})){T=F,D=!1;break}A.set(F,J)}if(D)for(var re=m?3:1,me=function(Oe){var Me=S.find(function(j){var pe=A.get(j);if(pe)return pe.slice(0,Oe).every(function(ue){return ue})});if(Me)return T=Me,"break"},Se=re;Se>0;Se--){var le=me(Se);if(le==="break")break}e.placement!==T&&(e.modifiersData[s]._skip=!0,e.placement=T,e.reset=!0)}}const $Tt={name:"flip",enabled:!0,phase:"main",fn:YTt,requiresIfExists:["offset"],data:{_skip:!1}};function Zx(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function Jx(n){return[Hn,bs,gs,qn].some(function(e){return n[e]>=0})}function WTt(n){var e=n.state,t=n.name,s=e.rects.reference,i=e.rects.popper,r=e.modifiersData.preventOverflow,o=Ul(e,{elementContext:"reference"}),a=Ul(e,{altBoundary:!0}),l=Zx(o,s),u=Zx(a,i,r),d=Jx(l),h=Jx(u);e.modifiersData[t]={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 KTt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:WTt};function jTt(n,e,t){var s=Xs(n),i=[qn,Hn].indexOf(s)>=0?-1:1,r=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,o=r[0],a=r[1];return o=o||0,a=(a||0)*i,[qn,bs].indexOf(s)>=0?{x:a,y:o}:{x:o,y:a}}function QTt(n){var e=n.state,t=n.options,s=n.name,i=t.offset,r=i===void 0?[0,0]:i,o=FN.reduce(function(d,h){return d[h]=jTt(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[s]=o}const XTt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:QTt};function ZTt(n){var e=n.state,t=n.name;e.modifiersData[t]=YN({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const JTt={name:"popperOffsets",enabled:!0,phase:"read",fn:ZTt,data:{}};function ext(n){return n==="x"?"y":"x"}function txt(n){var e=n.state,t=n.options,s=n.name,i=t.mainAxis,r=i===void 0?!0:i,o=t.altAxis,a=o===void 0?!1:o,l=t.boundary,u=t.rootBoundary,d=t.altBoundary,h=t.padding,f=t.tether,_=f===void 0?!0:f,m=t.tetherOffset,E=m===void 0?0:m,b=Ul(e,{boundary:l,rootBoundary:u,padding:h,altBoundary:d}),g=Xs(e.placement),y=oa(e.placement),v=!y,S=dE(g),w=ext(S),x=e.modifiersData.popperOffsets,A=e.rects.reference,D=e.rects.popper,T=typeof E=="function"?E(Object.assign({},e.rects,{placement:e.placement})):E,O=typeof T=="number"?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),F=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,z={x:0,y:0};if(x){if(r){var Z,M=S==="y"?Hn:qn,q=S==="y"?gs:bs,H=S==="y"?"height":"width",P=x[S],$=P+b[M],J=P-b[q],re=_?-D[H]/2:0,me=y===sa?A[H]:D[H],Se=y===sa?-D[H]:-A[H],le=e.elements.arrow,Ee=_&&le?cE(le):{width:0,height:0},Oe=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:VN(),Me=Oe[M],j=Oe[q],pe=_l(0,A[H],Ee[H]),ue=v?A[H]/2-re-pe-Me-O.mainAxis:me-pe-Me-O.mainAxis,Ce=v?-A[H]/2+re+pe+j+O.mainAxis:Se+pe+j+O.mainAxis,ke=e.elements.arrow&&Jl(e.elements.arrow),N=ke?S==="y"?ke.clientTop||0:ke.clientLeft||0:0,V=(Z=F==null?void 0:F[S])!=null?Z:0,Y=P+ue-V-N,oe=P+Ce-V,ne=_l(_?Gd($,Y):$,P,_?zr(J,oe):J);x[S]=ne,z[S]=ne-P}if(a){var Te,Ae=S==="x"?Hn:qn,te=S==="x"?gs:bs,we=x[w],ge=w==="y"?"height":"width",De=we+b[Ae],k=we-b[te],I=[Hn,qn].indexOf(g)!==-1,W=(Te=F==null?void 0:F[w])!=null?Te:0,ye=I?De:we-A[ge]-D[ge]-W+O.altAxis,K=I?we+A[ge]+D[ge]-W-O.altAxis:k,ee=_&&I?CTt(ye,we,K):_l(_?ye:De,we,_?K:k);x[w]=ee,z[w]=ee-we}e.modifiersData[s]=z}}const nxt={name:"preventOverflow",enabled:!0,phase:"main",fn:txt,requiresIfExists:["offset"]};function sxt(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function ixt(n){return n===Jn(n)||!fs(n)?uE(n):sxt(n)}function rxt(n){var e=n.getBoundingClientRect(),t=ia(e.width)/n.offsetWidth||1,s=ia(e.height)/n.offsetHeight||1;return t!==1||s!==1}function oxt(n,e,t){t===void 0&&(t=!1);var s=fs(e),i=fs(e)&&rxt(e),r=fr(e),o=ra(n,i,t),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(s||!s&&!t)&&((ei(e)!=="body"||_E(r))&&(a=ixt(e)),fs(e)?(l=ra(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):r&&(l.x=pE(r))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function axt(n){var e=new Map,t=new Set,s=[];n.forEach(function(r){e.set(r.name,r)});function i(r){t.add(r.name);var o=[].concat(r.requires||[],r.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var l=e.get(a);l&&i(l)}}),s.push(r)}return n.forEach(function(r){t.has(r.name)||i(r)}),s}function lxt(n){var e=axt(n);return ETt.reduce(function(t,s){return t.concat(e.filter(function(i){return i.phase===s}))},[])}function cxt(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function dxt(n){var e=n.reduce(function(t,s){var i=t[s.name];return t[s.name]=i?Object.assign({},i,s,{options:Object.assign({},i.options,s.options),data:Object.assign({},i.data,s.data)}):s,t},{});return Object.keys(e).map(function(t){return e[t]})}var eC={placement:"bottom",modifiers:[],strategy:"absolute"};function tC(){for(var n=arguments.length,e=new Array(n),t=0;t(no("data-v-c538ea16"),n=n(),so(),n),Ext={key:0,class:"fixed top-0 left-0 w-screen h-screen flex items-center justify-center"},yxt={class:"flex flex-col text-center"},vxt={class:"flex flex-col text-center items-center"},Sxt={class:"flex items-center gap-3 text-5xl drop-shadow-md align-middle pt-24"},Txt=At(()=>c("img",{class:"w-24 animate-bounce",title:"LoLLMS WebUI",src:hs,alt:"Logo"},null,-1)),xxt={class:"flex flex-col items-start"},Cxt={class:"text-2xl font-bold text-5xl drop-shadow-md align-middle"},wxt=At(()=>c("p",{class:"text-gray-400 text-base"},"One tool to rule them all",-1)),Rxt=At(()=>c("p",{class:"text-gray-400 text-base"},"by ParisNeo",-1)),Axt=At(()=>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)),Nxt=At(()=>c("p",{class:"text-2xl mb-10 font-bold drop-shadow-md"},"Welcome",-1)),Oxt={role:"status",class:"text-center w-full display: flex; flex-row align-items: center;"},Ixt={class:"text-2xl animate-pulse mt-2"},Mxt=At(()=>c("i",{"data-feather":"chevron-right"},null,-1)),Dxt=[Mxt],kxt=At(()=>c("i",{"data-feather":"chevron-left"},null,-1)),Lxt=[kxt],Pxt=gu('',1),Uxt=[Pxt],Fxt={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"},Bxt={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"},Gxt={class:"flex-row p-4 flex items-center gap-3 flex-0"},Vxt=At(()=>c("i",{"data-feather":"plus"},null,-1)),zxt=[Vxt],Hxt=At(()=>c("i",{"data-feather":"check-square"},null,-1)),qxt=[Hxt],Yxt={class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Reset database, remove all discussions"},$xt=At(()=>c("i",{"data-feather":"database"},null,-1)),Wxt=[$xt],Kxt=At(()=>c("i",{"data-feather":"log-in"},null,-1)),jxt=[Kxt],Qxt=At(()=>c("i",{"data-feather":"folder"},null,-1)),Xxt=[Qxt],Zxt={key:1,class:"dropdown"},Jxt=At(()=>c("i",{"data-feather":"search"},null,-1)),eCt=[Jxt],tCt={key:2,class:"flex gap-3 flex-1 items-center duration-75"},nCt=At(()=>c("i",{"data-feather":"x"},null,-1)),sCt=[nCt],iCt=At(()=>c("i",{"data-feather":"check"},null,-1)),rCt=[iCt],oCt=At(()=>c("i",{"data-feather":"hard-drive"},null,-1)),aCt=[oCt],lCt=At(()=>c("i",{"data-feather":"check-circle"},null,-1)),cCt=[lCt],dCt=At(()=>c("i",{"data-feather":"x-octagon"},null,-1)),uCt=[dCt],pCt=At(()=>c("i",{"data-feather":"book"},null,-1)),_Ct=[pCt],hCt={key:7,title:"Loading..",class:"flex flex-row flex-grow justify-end"},fCt=At(()=>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)),mCt=[fCt],gCt={key:0,class:"flex-row items-center gap-3 flex-0 w-full"},bCt={class:"p-4 pt-2"},ECt={class:"relative"},yCt=At(()=>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)),vCt={class:"absolute inset-y-0 right-0 flex items-center pr-3"},SCt=At(()=>c("i",{"data-feather":"x"},null,-1)),TCt=[SCt],xCt={key:1,class:"h-px bg-bg-light p-0 mb-4 px-4 mx-4 border-0 dark:bg-bg-dark"},CCt={key:2,class:"flex flex-row flex-grow p-4 pt-0 items-center"},wCt={class:"flex flex-row flex-grow"},RCt={key:0},ACt={class:"flex flex-row"},NCt={key:0,class:"flex gap-3"},OCt=At(()=>c("i",{"data-feather":"trash"},null,-1)),ICt=[OCt],MCt={key:1,class:"flex gap-3 mx-3 flex-1 items-center justify-end group-hover:visible duration-75"},DCt=At(()=>c("i",{"data-feather":"check"},null,-1)),kCt=[DCt],LCt=At(()=>c("i",{"data-feather":"x"},null,-1)),PCt=[LCt],UCt={class:"flex gap-3"},FCt=At(()=>c("i",{"data-feather":"codepen"},null,-1)),BCt=[FCt],GCt=At(()=>c("i",{"data-feather":"folder"},null,-1)),VCt=[GCt],zCt=At(()=>c("i",{"data-feather":"bookmark"},null,-1)),HCt=[zCt],qCt=At(()=>c("i",{"data-feather":"list"},null,-1)),YCt=[qCt],$Ct={class:"relative flex flex-row flex-grow mb-10 z-0 w-full"},WCt={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"},KCt=At(()=>c("p",{class:"px-3"},"No discussions are found",-1)),jCt=[KCt],QCt=At(()=>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)),XCt={class:"text-center font-large font-bold text-l drop-shadow-md align-middle"},ZCt={key:2,class:"relative flex flex-col flex-grow"},JCt={class:"container pt-4 pb-50 mb-50 w-full"},e1t={key:0,class:"w-full 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 overflow-hidden p-4 pb-2 h-[600px]"},t1t=At(()=>c("h2",{class:"text-2xl font-bold mb-4"},"Prompt examples",-1)),n1t={key:0,class:"overflow-y-auto flex-grow pr-2 custom-scrollbar"},s1t={class:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 p-2"},i1t=["onClick"],r1t=["title"],o1t={class:"absolute inset-0 overflow-hidden"},a1t=At(()=>c("div",{class:"absolute inset-0 bg-gradient-to-b from-transparent via-transparent to-white dark:to-gray-800 group-hover:opacity-0 transition-opacity duration-300"},null,-1)),l1t=At(()=>c("div",{class:"mt-2 text-sm text-gray-500 dark:text-gray-400 opacity-0 group-hover:opacity-100 transition-opacity duration-300"}," Click to select ",-1)),c1t=At(()=>c("div",null,[c("br"),c("br"),c("br"),c("br"),c("br"),c("br"),c("br")],-1)),d1t=At(()=>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)),u1t={key:0,class:"flex flex-row items-center justify-center h-10"},p1t={key:0,class:"relative flex flex-col no-scrollbar shadow-lg w-1/2 bg-bg-light-tone dark:bg-bg-dark-tone h-full"},_1t={ref:"isolatedContent",class:"h-full"},h1t={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"},f1t={class:"text-2xl animate-pulse mt-2 text-light-text-panel dark:text-dark-text-panel"},m1t={setup(){},data(){return{lastMessageHtml:"",defaultMessageHtml:` @@ -242,7 +243,7 @@ Error: `+e.error,4,!1)},async unmount_personality(n){if(!n)return{status:!1,erro - `,memory_icon:_xt,active_skills:hxt,inactive_skills:fxt,skillsRegistry:mxt,robot:gxt,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,leftPanelCollapsed:!1,rightPanelCollapsed:!0,isOpen:!1,discussion_id:0}},methods:{selectPrompt(n){this.$refs.chatBox.message=n},extractHtml(){if(this.discussionArr.length>0){const n=this.discussionArr[this.discussionArr.length-1].content,e="```html",t="```";let s=n.indexOf(e);if(s===-1)return this.lastMessageHtml=this.defaultMessageHtml,this.renderIsolatedContent(),this.defaultMessageHtml;s+=e.length;let i=n.indexOf(t,s);i===-1?this.lastMessageHtml=n.slice(s).trim():this.lastMessageHtml=n.slice(s,i).trim()}else this.lastMessageHtml=this.defaultMessageHtml;this.renderIsolatedContent()},renderIsolatedContent(){const n=document.createElement("iframe");if(n.style.border="none",n.style.width="100%",n.style.height="100%",this.$refs.isolatedContent){this.$refs.isolatedContent.innerHTML="",this.$refs.isolatedContent.appendChild(n);const e=n.contentDocument||n.contentWindow.document;e.open(),e.write(` + `,memory_icon:hxt,active_skills:fxt,inactive_skills:mxt,skillsRegistry:gxt,robot:bxt,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,leftPanelCollapsed:!1,rightPanelCollapsed:!0,isOpen:!1,discussion_id:0}},methods:{selectPrompt(n){this.$refs.chatBox.message=n},extractHtml(){if(this.discussionArr.length>0){const n=this.discussionArr[this.discussionArr.length-1].content,e="```html",t="```";let s=n.indexOf(e);if(s===-1)return this.lastMessageHtml=this.defaultMessageHtml,this.renderIsolatedContent(),this.defaultMessageHtml;s+=e.length;let i=n.indexOf(t,s);i===-1?this.lastMessageHtml=n.slice(s).trim():this.lastMessageHtml=n.slice(s,i).trim()}else this.lastMessageHtml=this.defaultMessageHtml;this.renderIsolatedContent()},renderIsolatedContent(){const n=document.createElement("iframe");if(n.style.border="none",n.style.width="100%",n.style.height="100%",this.$refs.isolatedContent){this.$refs.isolatedContent.innerHTML="",this.$refs.isolatedContent.appendChild(n);const e=n.contentDocument||n.contentWindow.document;e.open(),e.write(` ${this.lastMessageHtml} `),e.close()}},async triggerRobotAction(){this.rightPanelCollapsed=!this.rightPanelCollapsed,this.rightPanelCollapsed||(this.leftPanelCollapsed=!0,this.$nextTick(()=>{this.extractHtml()})),console.log(this.rightPanelCollapsed)},add_webpage(){console.log("addWebLink received"),this.$refs.web_url_input_box.showPanel()},addWebpage(){de.post("/add_webpage",{client_id:this.client_id,url:this.$refs.web_url_input_box.inputText},{headers:this.posts_headers}).then(n=>{n&&n.status&&(console.log("Done"),this.recoverFiles())})},show_progress(n){this.progress_visibility_val=!0},hide_progress(n){this.progress_visibility_val=!1},update_progress(n){console.log("Progress update"),this.progress_value=n.value},onSettingsBinding(){try{this.isLoading=!0,de.get("/get_active_binding_settings").then(n=>{this.isLoading=!1,n&&(n.data&&Object.keys(n.data).length>0?this.$store.state.universalForm.showForm(n.data,"Binding settings - "+bindingEntry.binding.name,"Save changes","Cancel").then(e=>{try{de.post("/set_active_binding_settings",{client_id:this.$store.state.client_id,settings:e}).then(t=>{t&&t.data?(console.log("binding set with new settings",t.data),this.$store.state.toast.showToast("Binding settings updated successfully!",4,!0)):(this.$store.state.toast.showToast(`Did not get binding settings responses. `+t,4,!1),this.isLoading=!1)})}catch(t){this.$store.state.toast.showToast(`Did not get binding settings responses. @@ -255,15 +256,15 @@ ${e} ${l}`;navigator.clipboard.writeText(u)}else navigator.clipboard.writeText(e);this.$store.state.toast.showToast("Copied to clipboard successfully",4,!0),Ue(()=>{Ge.replace()})},closeToast(){this.showToast=!1},saveJSONtoFile(n,e){e=e||"data.json";const t=document.createElement("a");t.href=URL.createObjectURL(new Blob([JSON.stringify(n,null,2)],{type:"text/plain"})),t.setAttribute("download",e),document.body.appendChild(t),t.click(),document.body.removeChild(t)},saveMarkdowntoFile(n,e){e=e||"data.md";const t=document.createElement("a");t.href=URL.createObjectURL(new Blob([n],{type:"text/plain"})),t.setAttribute("download",e),document.body.appendChild(t),t.click(),document.body.removeChild(t)},parseJsonObj(n){try{return JSON.parse(n)}catch(e){return this.$store.state.toast.showToast(`Could not parse JSON. `+e.message,4,!1),null}},async parseJsonFile(n){return new Promise((e,t)=>{const s=new FileReader;s.onload=i=>e(this.parseJsonObj(i.target.result)),s.onerror=i=>t(i),s.readAsText(n)})},async exportDiscussionsAsMarkdown(){const n=this.list.filter(e=>e.checkBoxValue==!0).map(e=>e.id);if(n.length>0){console.log("export",n);let e=new Date;const t=e.getFullYear(),s=(e.getMonth()+1).toString().padStart(2,"0"),i=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_"+(t+"."+s+"."+i+"."+r+o+a)+".md";this.loading=!0;const d=await this.export_multiple_discussions(n,"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 n=this.list.filter(e=>e.checkBoxValue==!0).map(e=>e.id);if(n.length>0){console.log("export",n);let e=new Date;const t=e.getFullYear(),s=(e.getMonth()+1).toString().padStart(2,"0"),i=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_"+(t+"."+s+"."+i+"."+r+o+a)+".json";this.loading=!0;const d=await this.export_multiple_discussions(n,"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(n){},async importDiscussions(n){const e=await this.parseJsonFile(n.target.files[0]);await this.import_multiple_discussions(e)?(this.$store.state.toast.showToast("Successfully imported ("+e.length+")",4,!0),await this.list_discussions()):this.$store.state.toast.showToast("Failed to import discussions",4,!1)},async getPersonalityAvatars(){for(;this.$store.state.personalities===null;)await new Promise(e=>setTimeout(e,100));let n=this.$store.state.personalities;this.personalityAvatars=n.map(e=>({name:e.name,avatar:e.avatar}))},getAvatar(n){if(n.toLowerCase().trim()==this.$store.state.config.user_name.toLowerCase().trim())return"user_infos/"+this.$store.state.config.user_avatar;const e=this.personalityAvatars.findIndex(s=>s.name===n),t=this.personalityAvatars[e];if(t)return console.log("Avatar",t.avatar),t.avatar},setFileListChat(n){try{this.$refs.chatBox.fileList=this.$refs.chatBox.fileList.concat(n)}catch(e){this.$store.state.toast.showToast(`Failed to set filelist in chatbox -`+e.message,4,!1)}this.isDragOverChat=!1},async setFileListDiscussion(n){if(n.length>1){this.$store.state.toast.showToast("Failed to import discussions. Too many files",4,!1);return}const e=await this.parseJsonFile(n[0]);await this.import_multiple_discussions(e)?(this.$store.state.toast.showToast("Successfully imported ("+e.length+")",4,!0),await this.list_discussions()):this.$store.state.toast.showToast("Failed to import discussions",4,!1),this.isDragOverDiscussion=!1}},async created(){console.log("Created discussions view");const e=(await de.get("/get_versionID")).data.versionId;He.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.versionId!==e&&(this.$store.commit("updateVersionId",e),window.location.reload(!0)),this.$nextTick(()=>{Ge.replace()}),console.log("Connected to socket io");try{this.$store.state.loading_infos="Getting version",this.$store.state.loading_progress=30,await this.$store.dispatch("getVersion")}catch(t){console.log("Error cought:",t)}try{for(this.$store.state.loading_infos="Loading Configuration";He.id===void 0;)await new Promise(t=>setTimeout(t,100));this.$store.state.client_id=He.id,console.log(this.$store.state.client_id),await this.$store.dispatch("refreshConfig"),console.log("Config ready")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Loading Database",this.$store.state.loading_progress=20,await this.$store.dispatch("refreshDatabase")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Getting Bindings list",this.$store.state.loading_progress=40,await this.$store.dispatch("refreshBindings")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Getting personalities zoo",this.$store.state.loading_progress=70,await this.$store.dispatch("refreshPersonalitiesZoo")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Getting mounted personalities",this.$store.state.loading_progress=80,await this.$store.dispatch("refreshMountedPersonalities")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Getting models zoo",this.$store.state.loading_progress=90,await this.$store.dispatch("refreshModelsZoo")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Getting active models",this.$store.state.loading_progress=100,await this.$store.dispatch("refreshModels"),await this.$store.dispatch("refreshModelStatus")}catch(t){console.log("Error cought:",t)}try{await this.$store.dispatch("fetchLanguages"),await this.$store.dispatch("fetchLanguage")}catch(t){console.log("Error cought:",t)}try{await this.$store.dispatch("fetchisRTOn")}catch(t){console.log("Error cought:",t)}this.$store.state.isConnected=!0,this.$store.state.client_id=He.id,console.log("Ready"),this.setPageTitle(),await this.list_discussions(),this.loadLastUsedDiscussion(),this.isCreated=!0,this.$store.state.ready=!0,He.on("connected",this.socketIOConnected),He.on("disconnected",this.socketIODisconnected),console.log("Added events"),He.on("show_progress",this.show_progress),He.on("hide_progress",this.hide_progress),He.on("update_progress",this.update_progress),He.on("notification",this.notify),He.on("new_message",this.new_message),He.on("update_message",this.streamMessageContent),He.on("close_message",this.finalMsgEvent),He.on("disucssion_renamed",t=>{console.log("Received new title",t.discussion_id,t.title);const s=this.list.findIndex(r=>r.id==t.discussion_id),i=this.list[s];i.title=t.title}),He.onclose=t=>{console.log("WebSocket connection closed:",t.code,t.reason),this.socketIODisconnected()},He.on("connect_error",t=>{t.message==="ERR_CONNECTION_REFUSED"?console.error("Connection refused. The server is not available."):console.error("Connection error:",t),this.$store.state.isConnected=!1}),He.onerror=t=>{console.log("WebSocket connection error:",t.code,t.reason),this.socketIODisconnected(),He.disconnect()}},async mounted(){He.on("refresh_files",()=>{this.recoverFiles()}),this.$nextTick(()=>{Ge.replace()})},async activated(){for(;this.isReady===!1;)await new Promise(n=>setTimeout(n,100));await this.getPersonalityAvatars(),console.log("Avatars found:",this.personalityAvatars),this.isCreated&&Ue(()=>{const n=document.getElementById("messages-list");this.scrollBottom(n)}),this.$store.state.config.show_news_panel&&this.$store.state.news.show()},components:{Discussion:tE,Message:ON,ChatBox:IN,WelcomeComponent:MN,ChoiceDialog:eE,ProgressBar:Ll,InputBox:RN,SkillsLibraryViewer:AN},watch:{messages:{handler:"extractHtml",deep:!0},progress_visibility_val(n){console.log("progress_visibility changed to "+n)},filterTitle(n){n==""&&(this.filterInProgress=!0,this.list=this.tempList,this.filterInProgress=!1)},isCheckbox(n){Ue(()=>{Ge.replace()}),n||(this.isSelectAll=!1)},socketConnected(n){console.log("Websocket connected (watch)",n)},showConfirmation(){Ue(()=>{Ge.replace()})},isSearch(){Ue(()=>{Ge.replace()})}},computed:{...DD({versionId:n=>n.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(n){this.$store.state.isModelOk=n}},isGenerating:{get(){return this.$store.state.isGenerating},set(n){this.$store.state.isGenerating=n}},personality(){console.log("personality:",this.$store.state.config.personalities[this.$store.state.config.active_personality_id]);const n=this.$store.state.config.personalities[this.$store.state.config.active_personality_id];console.log("peronslities",this.$store.state.personalities[0]);const e=this.$store.state.personalities.find(t=>t.full_path===n);return console.log("personality:",e),e},prompts_list(){return console.log(this.personality.prompts_list),this.personality.prompts_list},formatted_database_name(){return this.$store.state.config.discussion_db_name},UseDiscussionHistory(){return this.$store.state.config.activate_skills_lib},isReady(){return this.$store.state.ready},databases(){return this.$store.state.databases},client_id(){return He.id},showLeftPanel(){return this.$store.state.ready&&!this.leftPanelCollapsed},showRightPanel(){return this.$store.state.ready&&!this.rightPanelCollapsed},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 Ue(()=>{Ge.replace()}),this.list.filter(n=>n.checkBoxValue==!0)}}},m1t=Object.assign(f1t,{__name:"DiscussionsView",setup(n){return Mi(()=>{ZN()}),de.defaults.baseURL="/",(e,t)=>(C(),R(ze,null,[_e(Ms,{name:"fade-and-fly"},{default:qe(()=>[e.isReady?G("",!0):(C(),R("div",bxt,[c("div",Ext,[c("div",yxt,[c("div",vxt,[Sxt,c("div",Txt,[c("p",xxt,"LoLLMS "+se(e.version_info),1),Cxt,wxt])]),Rxt,Axt,c("div",Nxt,[_e(Ll,{ref:"loading_progress",progress:e.loading_progress},null,8,["progress"]),c("p",Oxt,se(e.loading_infos)+" ...",1)])])])]))]),_:1}),e.isReady?(C(),R("button",{key:0,onClick:t[0]||(t[0]=(...s)=>e.togglePanel&&e.togglePanel(...s)),class:"absolute top-2 left-2 p-3 bg-white bg-opacity-0 cursor-pointer transition-all duration-300 hover:scale-110 hover:bg-opacity-20 hover:shadow-xl group"},[B(c("div",null,Mxt,512),[[Ot,e.leftPanelCollapsed]]),B(c("div",null,kxt,512),[[Ot,!e.leftPanelCollapsed]])])):G("",!0),e.isReady?(C(),R("button",{key:1,onClick:t[1]||(t[1]=ae(s=>e.triggerRobotAction(),["stop"])),class:"absolute top-2 right-2 p-3 bg-white bg-opacity-10 rounded-full cursor-pointer transition-all duration-300 hover:scale-110 hover:bg-opacity-20 animate-pulse shadow-lg hover:shadow-xl group"},Pxt)):G("",!0),_e(Ms,{name:"slide-right"},{default:qe(()=>[e.showLeftPanel?(C(),R("div",Uxt,[c("div",{id:"leftPanel",class:"flex flex-col flex-grow overflow-y-scroll no-scrollbar",onDragover:t[29]||(t[29]=ae(s=>e.setDropZoneDiscussion(),["stop","prevent"]))},[c("div",Fxt,[c("div",Bxt,[c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Create new discussion",type:"button",onClick:t[2]||(t[2]=s=>e.createNewDiscussion())},Vxt),c("button",{class:Fe(["text-2xl hover:text-secondary duration-75 active:scale-90",e.isCheckbox?"text-secondary":""]),title:"Edit discussion list",type:"button",onClick:t[3]||(t[3]=s=>e.isCheckbox=!e.isCheckbox)},Hxt,2),c("button",qxt,[c("i",{"data-feather":"trash-2",onClick:t[4]||(t[4]=ae(()=>{},["stop"]))})]),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Export database",type:"button",onClick:t[5]||(t[5]=ae(s=>e.database_selectorDialogVisible=!0,["stop"]))},$xt),c("input",{type:"file",ref:"fileDialog",style:{display:"none"},onChange:t[6]||(t[6]=(...s)=>e.importDiscussions&&e.importDiscussions(...s))},null,544),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Import discussions",type:"button",onClick:t[7]||(t[7]=ae(s=>e.$refs.fileDialog.click(),["stop"]))},Kxt),c("input",{type:"file",ref:"bundleLoadingDialog",style:{display:"none"},onChange:t[8]||(t[8]=(...s)=>e.importDiscussionsBundle&&e.importDiscussionsBundle(...s))},null,544),e.showSaveConfirmation?G("",!0):(C(),R("button",{key:0,title:"Import discussion bundle",onClick:t[9]||(t[9]=ae(s=>e.$refs.bundleLoadingDialog.click(),["stop"])),class:"text-2xl hover:text-secondary duration-75 active:scale-90"},Qxt)),e.isOpen?(C(),R("div",Xxt,[c("button",{onClick:t[10]||(t[10]=(...s)=>e.importDiscussions&&e.importDiscussions(...s))},"LOLLMS"),c("button",{onClick:t[11]||(t[11]=(...s)=>e.importChatGPT&&e.importChatGPT(...s))},"ChatGPT")])):G("",!0),c("button",{class:Fe(["text-2xl hover:text-secondary duration-75 active:scale-90",e.isSearch?"text-secondary":""]),title:"Filter discussions",type:"button",onClick:t[12]||(t[12]=s=>e.isSearch=!e.isSearch)},Jxt,2),e.showSaveConfirmation?(C(),R("div",eCt,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel",type:"button",onClick:t[13]||(t[13]=ae(s=>e.showSaveConfirmation=!1,["stop"]))},nCt),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm save changes",type:"button",onClick:t[14]||(t[14]=ae(s=>e.save_configuration(),["stop"]))},iCt)])):G("",!0),e.loading?G("",!0):(C(),R("button",{key:3,type:"button",onClick:t[15]||(t[15]=ae((...s)=>e.addDiscussion2SkillsLibrary&&e.addDiscussion2SkillsLibrary(...s),["stop"])),title:"Add this discussion content to skills database",class:"w-6 hover:text-secondary duration-75 active:scale-90"},oCt)),!e.loading&&e.$store.state.config.activate_skills_lib?(C(),R("button",{key:4,type:"button",onClick:t[16]||(t[16]=ae((...s)=>e.toggleSkillsLib&&e.toggleSkillsLib(...s),["stop"])),title:"Skills database is activated",class:"w-6 hover:text-secondary duration-75 active:scale-90"},lCt)):G("",!0),!e.loading&&!e.$store.state.config.activate_skills_lib?(C(),R("button",{key:5,type:"button",onClick:t[17]||(t[17]=ae((...s)=>e.toggleSkillsLib&&e.toggleSkillsLib(...s),["stop"])),title:"Skills database is deactivated",class:"w-6 hover:text-secondary duration-75 active:scale-90"},dCt)):G("",!0),e.loading?G("",!0):(C(),R("button",{key:6,type:"button",onClick:t[18]||(t[18]=ae((...s)=>e.showSkillsLib&&e.showSkillsLib(...s),["stop"])),title:"Show Skills database",class:"w-6 hover:text-secondary duration-75 active:scale-90"},pCt)),e.loading?(C(),R("div",_Ct,fCt)):G("",!0)]),e.isSearch?(C(),R("div",mCt,[c("div",gCt,[c("div",bCt,[ECt,c("div",yCt,[c("div",{class:Fe(["hover:text-secondary duration-75 active:scale-90",e.filterTitle?"visible":"invisible"]),title:"Clear",onClick:t[19]||(t[19]=s=>e.filterTitle="")},SCt,2)]),B(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":t[20]||(t[20]=s=>e.filterTitle=s),onInput:t[21]||(t[21]=s=>e.filterDiscussions())},null,544),[[he,e.filterTitle]])])])])):G("",!0),e.isCheckbox?(C(),R("hr",TCt)):G("",!0),e.isCheckbox?(C(),R("div",xCt,[c("div",CCt,[e.selectedDiscussions.length>0?(C(),R("p",wCt,"Selected: "+se(e.selectedDiscussions.length),1)):G("",!0)]),c("div",RCt,[e.selectedDiscussions.length>0?(C(),R("div",ACt,[e.showConfirmation?G("",!0):(C(),R("button",{key:0,class:"flex mx-3 flex-1 text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Remove selected",type:"button",onClick:t[22]||(t[22]=ae(s=>e.showConfirmation=!0,["stop"]))},OCt)),e.showConfirmation?(C(),R("div",ICt,[c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm removal",type:"button",onClick:t[23]||(t[23]=ae((...s)=>e.deleteDiscussionMulti&&e.deleteDiscussionMulti(...s),["stop"]))},DCt),c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel removal",type:"button",onClick:t[24]||(t[24]=ae(s=>e.showConfirmation=!1,["stop"]))},LCt)])):G("",!0)])):G("",!0),c("div",PCt,[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:t[25]||(t[25]=ae((...s)=>e.exportDiscussionsAsJson&&e.exportDiscussionsAsJson(...s),["stop"]))},FCt),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:t[26]||(t[26]=ae((...s)=>e.exportDiscussions&&e.exportDiscussions(...s),["stop"]))},GCt),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:t[27]||(t[27]=ae((...s)=>e.exportDiscussionsAsMarkdown&&e.exportDiscussionsAsMarkdown(...s),["stop"]))},zCt),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Select All",type:"button",onClick:t[28]||(t[28]=ae((...s)=>e.selectAllDiscussions&&e.selectAllDiscussions(...s),["stop"]))},qCt)])])])):G("",!0)]),c("div",YCt,[c("div",{class:Fe(["mx-4 flex flex-col flex-grow w-full",e.isDragOverDiscussion?"pointer-events-none":""])},[c("div",{id:"dis-list",class:Fe([e.filterInProgress?"opacity-20 pointer-events-none":"","flex flex-col flex-grow w-full"])},[e.list.length>0?(C(),St(Qs,{key:0,name:"list"},{default:qe(()=>[(C(!0),R(ze,null,st(e.list,(s,i)=>(C(),St(tE,{key:s.id,id:s.id,title:s.title,selected:e.currentDiscussion.id==s.id,loading:s.loading,isCheckbox:e.isCheckbox,checkBoxValue:s.checkBoxValue,onSelect:r=>e.selectDiscussion(s),onDelete:r=>e.deleteDiscussion(s.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})):G("",!0),e.list.length<1?(C(),R("div",$Ct,KCt)):G("",!0),jCt],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:t[30]||(t[30]=(...s)=>e.showDatabaseSelector&&e.showDatabaseSelector(...s))},[c("p",QCt,se(e.formatted_database_name.replace("_"," ")),1)])])):G("",!0)]),_:1}),e.isReady?(C(),R("div",XCt,[c("div",{id:"messages-list",class:Fe(["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",ZCt,[e.discussionArr.length>0?(C(),St(Qs,{key:0,name:"list"},{default:qe(()=>[(C(!0),R(ze,null,st(e.discussionArr,(s,i)=>(C(),St(ON,{key:s.id,message:s,id:"msg-"+s.id,ref_for:!0,ref:"msg-"+s.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(s.sender)},null,8,["message","id","host","onCopy","onDelete","onRankUp","onRankDown","onUpdateMessage","onResendMessage","onContinueMessage","avatar"]))),128)),e.discussionArr.length<2&&e.personality.prompts_list.length>0?(C(),R("div",JCt,[e1t,e.discussionArr.length<2&&e.personality.prompts_list.length>0?(C(),R("div",t1t,[c("div",n1t,[(C(!0),R(ze,null,st(e.personality.prompts_list,(s,i)=>(C(),R("div",{key:i,onClick:r=>e.selectPrompt(s),class:"bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg p-4 cursor-pointer hover:shadow-lg transition-all duration-300 ease-in-out transform hover:scale-105 flex flex-col justify-between h-[220px] overflow-hidden group"},[c("div",{title:s,class:"text-base text-gray-700 dark:text-gray-300 overflow-hidden relative h-full"},[c("div",r1t,se(s),1),o1t],8,i1t),a1t],8,s1t))),128))])])):G("",!0)])):G("",!0)]),_:1})):G("",!0),e.currentDiscussion.id?G("",!0):(C(),St(MN,{key:1})),l1t]),c1t],2),e.currentDiscussion.id?(C(),R("div",d1t,[_e(IN,{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"])])):G("",!0)])):G("",!0),_e(Ms,{name:"slide-left"},{default:qe(()=>[e.showRightPanel?(C(),R("div",u1t,[c("div",p1t,null,512)])):G("",!0)]),_:1}),_e(eE,{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"]),B(c("div",_1t,[_e(Ll,{ref:"progress",progress:e.progress_value,class:"w-full h-4"},null,8,["progress"]),c("p",h1t,se(e.loading_infos)+" ...",1)],512),[[Ot,e.progress_visibility]]),_e(RN,{"prompt-text":"Enter the url to the page to use as discussion support",onOk:e.addWebpage,ref:"web_url_input_box"},null,8,["onOk"]),_e(AN,{ref:"skills_lib"},null,512)],64))}}),g1t=pt(m1t,[["__scopeId","data-v-c538ea16"]]);/** +`+e.message,4,!1)}this.isDragOverChat=!1},async setFileListDiscussion(n){if(n.length>1){this.$store.state.toast.showToast("Failed to import discussions. Too many files",4,!1);return}const e=await this.parseJsonFile(n[0]);await this.import_multiple_discussions(e)?(this.$store.state.toast.showToast("Successfully imported ("+e.length+")",4,!0),await this.list_discussions()):this.$store.state.toast.showToast("Failed to import discussions",4,!1),this.isDragOverDiscussion=!1}},async created(){console.log("Created discussions view");const e=(await de.get("/get_versionID")).data.versionId;He.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.versionId!==e&&(this.$store.commit("updateVersionId",e),window.location.reload(!0)),this.$nextTick(()=>{Ge.replace()}),console.log("Connected to socket io");try{this.$store.state.loading_infos="Getting version",this.$store.state.loading_progress=30,await this.$store.dispatch("getVersion")}catch(t){console.log("Error cought:",t)}try{for(this.$store.state.loading_infos="Loading Configuration";He.id===void 0;)await new Promise(t=>setTimeout(t,100));this.$store.state.client_id=He.id,console.log(this.$store.state.client_id),await this.$store.dispatch("refreshConfig"),console.log("Config ready")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Loading Database",this.$store.state.loading_progress=20,await this.$store.dispatch("refreshDatabase")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Getting Bindings list",this.$store.state.loading_progress=40,await this.$store.dispatch("refreshBindings")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Getting personalities zoo",this.$store.state.loading_progress=70,await this.$store.dispatch("refreshPersonalitiesZoo")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Getting mounted personalities",this.$store.state.loading_progress=80,await this.$store.dispatch("refreshMountedPersonalities")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Getting models zoo",this.$store.state.loading_progress=90,await this.$store.dispatch("refreshModelsZoo")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Getting active models",this.$store.state.loading_progress=100,await this.$store.dispatch("refreshModels"),await this.$store.dispatch("refreshModelStatus")}catch(t){console.log("Error cought:",t)}try{await this.$store.dispatch("fetchLanguages"),await this.$store.dispatch("fetchLanguage")}catch(t){console.log("Error cought:",t)}try{await this.$store.dispatch("fetchisRTOn")}catch(t){console.log("Error cought:",t)}this.$store.state.isConnected=!0,this.$store.state.client_id=He.id,console.log("Ready"),this.setPageTitle(),await this.list_discussions(),this.loadLastUsedDiscussion(),this.isCreated=!0,this.$store.state.ready=!0,He.on("connected",this.socketIOConnected),He.on("disconnected",this.socketIODisconnected),console.log("Added events"),He.on("show_progress",this.show_progress),He.on("hide_progress",this.hide_progress),He.on("update_progress",this.update_progress),He.on("notification",this.notify),He.on("new_message",this.new_message),He.on("update_message",this.streamMessageContent),He.on("close_message",this.finalMsgEvent),He.on("disucssion_renamed",t=>{console.log("Received new title",t.discussion_id,t.title);const s=this.list.findIndex(r=>r.id==t.discussion_id),i=this.list[s];i.title=t.title}),He.onclose=t=>{console.log("WebSocket connection closed:",t.code,t.reason),this.socketIODisconnected()},He.on("connect_error",t=>{t.message==="ERR_CONNECTION_REFUSED"?console.error("Connection refused. The server is not available."):console.error("Connection error:",t),this.$store.state.isConnected=!1}),He.onerror=t=>{console.log("WebSocket connection error:",t.code,t.reason),this.socketIODisconnected(),He.disconnect()}},async mounted(){He.on("refresh_files",()=>{this.recoverFiles()}),this.$nextTick(()=>{Ge.replace()})},async activated(){for(;this.isReady===!1;)await new Promise(n=>setTimeout(n,100));await this.getPersonalityAvatars(),console.log("Avatars found:",this.personalityAvatars),this.isCreated&&Ue(()=>{const n=document.getElementById("messages-list");this.scrollBottom(n)}),this.$store.state.config.show_news_panel&&this.$store.state.news.show()},components:{Discussion:tE,Message:ON,ChatBox:IN,WelcomeComponent:MN,ChoiceDialog:eE,ProgressBar:Ll,InputBox:RN,SkillsLibraryViewer:AN},watch:{messages:{handler:"extractHtml",deep:!0},progress_visibility_val(n){console.log("progress_visibility changed to "+n)},filterTitle(n){n==""&&(this.filterInProgress=!0,this.list=this.tempList,this.filterInProgress=!1)},isCheckbox(n){Ue(()=>{Ge.replace()}),n||(this.isSelectAll=!1)},socketConnected(n){console.log("Websocket connected (watch)",n)},showConfirmation(){Ue(()=>{Ge.replace()})},isSearch(){Ue(()=>{Ge.replace()})}},computed:{...DD({versionId:n=>n.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(n){this.$store.state.isModelOk=n}},isGenerating:{get(){return this.$store.state.isGenerating},set(n){this.$store.state.isGenerating=n}},personality(){console.log("personality:",this.$store.state.config.personalities[this.$store.state.config.active_personality_id]);const n=this.$store.state.config.personalities[this.$store.state.config.active_personality_id];console.log("peronslities",this.$store.state.personalities[0]);const e=this.$store.state.personalities.find(t=>t.full_path===n);return console.log("personality:",e),e},prompts_list(){return console.log(this.personality.prompts_list),this.personality.prompts_list},formatted_database_name(){return this.$store.state.config.discussion_db_name},UseDiscussionHistory(){return this.$store.state.config.activate_skills_lib},isReady(){return this.$store.state.ready},databases(){return this.$store.state.databases},client_id(){return He.id},showLeftPanel(){return this.$store.state.ready&&!this.leftPanelCollapsed},showRightPanel(){return this.$store.state.ready&&!this.rightPanelCollapsed},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 Ue(()=>{Ge.replace()}),this.list.filter(n=>n.checkBoxValue==!0)}}},g1t=Object.assign(m1t,{__name:"DiscussionsView",setup(n){return Mi(()=>{ZN()}),de.defaults.baseURL="/",(e,t)=>(C(),R(ze,null,[_e(Ms,{name:"fade-and-fly"},{default:qe(()=>[e.isReady?G("",!0):(C(),R("div",Ext,[c("div",yxt,[c("div",vxt,[c("div",Sxt,[Txt,c("div",xxt,[c("p",Cxt,"LoLLMS "+se(e.version_info),1),wxt,Rxt])]),Axt,Nxt,c("div",Oxt,[_e(Ll,{ref:"loading_progress",progress:e.loading_progress},null,8,["progress"]),c("p",Ixt,se(e.loading_infos)+" ...",1)])])])]))]),_:1}),e.isReady?(C(),R("button",{key:0,onClick:t[0]||(t[0]=(...s)=>e.togglePanel&&e.togglePanel(...s)),class:"absolute top-2 left-2 p-3 bg-white bg-opacity-0 cursor-pointer transition-all duration-300 hover:scale-110 hover:bg-opacity-20 hover:shadow-xl group"},[B(c("div",null,Dxt,512),[[Ot,e.leftPanelCollapsed]]),B(c("div",null,Lxt,512),[[Ot,!e.leftPanelCollapsed]])])):G("",!0),e.isReady?(C(),R("button",{key:1,onClick:t[1]||(t[1]=ae(s=>e.triggerRobotAction(),["stop"])),class:"absolute top-2 right-2 p-3 bg-white bg-opacity-10 rounded-full cursor-pointer transition-all duration-300 hover:scale-110 hover:bg-opacity-20 animate-pulse shadow-lg hover:shadow-xl group"},Uxt)):G("",!0),_e(Ms,{name:"slide-right"},{default:qe(()=>[e.showLeftPanel?(C(),R("div",Fxt,[c("div",{id:"leftPanel",class:"flex flex-col flex-grow overflow-y-scroll no-scrollbar",onDragover:t[29]||(t[29]=ae(s=>e.setDropZoneDiscussion(),["stop","prevent"]))},[c("div",Bxt,[c("div",Gxt,[c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Create new discussion",type:"button",onClick:t[2]||(t[2]=s=>e.createNewDiscussion())},zxt),c("button",{class:Fe(["text-2xl hover:text-secondary duration-75 active:scale-90",e.isCheckbox?"text-secondary":""]),title:"Edit discussion list",type:"button",onClick:t[3]||(t[3]=s=>e.isCheckbox=!e.isCheckbox)},qxt,2),c("button",Yxt,[c("i",{"data-feather":"trash-2",onClick:t[4]||(t[4]=ae(()=>{},["stop"]))})]),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Export database",type:"button",onClick:t[5]||(t[5]=ae(s=>e.database_selectorDialogVisible=!0,["stop"]))},Wxt),c("input",{type:"file",ref:"fileDialog",style:{display:"none"},onChange:t[6]||(t[6]=(...s)=>e.importDiscussions&&e.importDiscussions(...s))},null,544),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Import discussions",type:"button",onClick:t[7]||(t[7]=ae(s=>e.$refs.fileDialog.click(),["stop"]))},jxt),c("input",{type:"file",ref:"bundleLoadingDialog",style:{display:"none"},onChange:t[8]||(t[8]=(...s)=>e.importDiscussionsBundle&&e.importDiscussionsBundle(...s))},null,544),e.showSaveConfirmation?G("",!0):(C(),R("button",{key:0,title:"Import discussion bundle",onClick:t[9]||(t[9]=ae(s=>e.$refs.bundleLoadingDialog.click(),["stop"])),class:"text-2xl hover:text-secondary duration-75 active:scale-90"},Xxt)),e.isOpen?(C(),R("div",Zxt,[c("button",{onClick:t[10]||(t[10]=(...s)=>e.importDiscussions&&e.importDiscussions(...s))},"LOLLMS"),c("button",{onClick:t[11]||(t[11]=(...s)=>e.importChatGPT&&e.importChatGPT(...s))},"ChatGPT")])):G("",!0),c("button",{class:Fe(["text-2xl hover:text-secondary duration-75 active:scale-90",e.isSearch?"text-secondary":""]),title:"Filter discussions",type:"button",onClick:t[12]||(t[12]=s=>e.isSearch=!e.isSearch)},eCt,2),e.showSaveConfirmation?(C(),R("div",tCt,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel",type:"button",onClick:t[13]||(t[13]=ae(s=>e.showSaveConfirmation=!1,["stop"]))},sCt),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm save changes",type:"button",onClick:t[14]||(t[14]=ae(s=>e.save_configuration(),["stop"]))},rCt)])):G("",!0),e.loading?G("",!0):(C(),R("button",{key:3,type:"button",onClick:t[15]||(t[15]=ae((...s)=>e.addDiscussion2SkillsLibrary&&e.addDiscussion2SkillsLibrary(...s),["stop"])),title:"Add this discussion content to skills database",class:"w-6 hover:text-secondary duration-75 active:scale-90"},aCt)),!e.loading&&e.$store.state.config.activate_skills_lib?(C(),R("button",{key:4,type:"button",onClick:t[16]||(t[16]=ae((...s)=>e.toggleSkillsLib&&e.toggleSkillsLib(...s),["stop"])),title:"Skills database is activated",class:"w-6 hover:text-secondary duration-75 active:scale-90"},cCt)):G("",!0),!e.loading&&!e.$store.state.config.activate_skills_lib?(C(),R("button",{key:5,type:"button",onClick:t[17]||(t[17]=ae((...s)=>e.toggleSkillsLib&&e.toggleSkillsLib(...s),["stop"])),title:"Skills database is deactivated",class:"w-6 hover:text-secondary duration-75 active:scale-90"},uCt)):G("",!0),e.loading?G("",!0):(C(),R("button",{key:6,type:"button",onClick:t[18]||(t[18]=ae((...s)=>e.showSkillsLib&&e.showSkillsLib(...s),["stop"])),title:"Show Skills database",class:"w-6 hover:text-secondary duration-75 active:scale-90"},_Ct)),e.loading?(C(),R("div",hCt,mCt)):G("",!0)]),e.isSearch?(C(),R("div",gCt,[c("div",bCt,[c("div",ECt,[yCt,c("div",vCt,[c("div",{class:Fe(["hover:text-secondary duration-75 active:scale-90",e.filterTitle?"visible":"invisible"]),title:"Clear",onClick:t[19]||(t[19]=s=>e.filterTitle="")},TCt,2)]),B(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":t[20]||(t[20]=s=>e.filterTitle=s),onInput:t[21]||(t[21]=s=>e.filterDiscussions())},null,544),[[he,e.filterTitle]])])])])):G("",!0),e.isCheckbox?(C(),R("hr",xCt)):G("",!0),e.isCheckbox?(C(),R("div",CCt,[c("div",wCt,[e.selectedDiscussions.length>0?(C(),R("p",RCt,"Selected: "+se(e.selectedDiscussions.length),1)):G("",!0)]),c("div",ACt,[e.selectedDiscussions.length>0?(C(),R("div",NCt,[e.showConfirmation?G("",!0):(C(),R("button",{key:0,class:"flex mx-3 flex-1 text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Remove selected",type:"button",onClick:t[22]||(t[22]=ae(s=>e.showConfirmation=!0,["stop"]))},ICt)),e.showConfirmation?(C(),R("div",MCt,[c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm removal",type:"button",onClick:t[23]||(t[23]=ae((...s)=>e.deleteDiscussionMulti&&e.deleteDiscussionMulti(...s),["stop"]))},kCt),c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel removal",type:"button",onClick:t[24]||(t[24]=ae(s=>e.showConfirmation=!1,["stop"]))},PCt)])):G("",!0)])):G("",!0),c("div",UCt,[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:t[25]||(t[25]=ae((...s)=>e.exportDiscussionsAsJson&&e.exportDiscussionsAsJson(...s),["stop"]))},BCt),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:t[26]||(t[26]=ae((...s)=>e.exportDiscussions&&e.exportDiscussions(...s),["stop"]))},VCt),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:t[27]||(t[27]=ae((...s)=>e.exportDiscussionsAsMarkdown&&e.exportDiscussionsAsMarkdown(...s),["stop"]))},HCt),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Select All",type:"button",onClick:t[28]||(t[28]=ae((...s)=>e.selectAllDiscussions&&e.selectAllDiscussions(...s),["stop"]))},YCt)])])])):G("",!0)]),c("div",$Ct,[c("div",{class:Fe(["mx-4 flex flex-col flex-grow w-full",e.isDragOverDiscussion?"pointer-events-none":""])},[c("div",{id:"dis-list",class:Fe([e.filterInProgress?"opacity-20 pointer-events-none":"","flex flex-col flex-grow w-full"])},[e.list.length>0?(C(),St(Qs,{key:0,name:"list"},{default:qe(()=>[(C(!0),R(ze,null,st(e.list,(s,i)=>(C(),St(tE,{key:s.id,id:s.id,title:s.title,selected:e.currentDiscussion.id==s.id,loading:s.loading,isCheckbox:e.isCheckbox,checkBoxValue:s.checkBoxValue,onSelect:r=>e.selectDiscussion(s),onDelete:r=>e.deleteDiscussion(s.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})):G("",!0),e.list.length<1?(C(),R("div",WCt,jCt)):G("",!0),QCt],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:t[30]||(t[30]=(...s)=>e.showDatabaseSelector&&e.showDatabaseSelector(...s))},[c("p",XCt,se(e.formatted_database_name.replace("_"," ")),1)])])):G("",!0)]),_:1}),e.isReady?(C(),R("div",ZCt,[c("div",{id:"messages-list",class:Fe(["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",JCt,[e.discussionArr.length>0?(C(),St(Qs,{key:0,name:"list"},{default:qe(()=>[(C(!0),R(ze,null,st(e.discussionArr,(s,i)=>(C(),St(ON,{key:s.id,message:s,id:"msg-"+s.id,ref_for:!0,ref:"msg-"+s.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(s.sender)},null,8,["message","id","host","onCopy","onDelete","onRankUp","onRankDown","onUpdateMessage","onResendMessage","onContinueMessage","avatar"]))),128)),e.discussionArr.length<2&&e.personality.prompts_list.length>0?(C(),R("div",e1t,[t1t,e.discussionArr.length<2&&e.personality.prompts_list.length>0?(C(),R("div",n1t,[c("div",s1t,[(C(!0),R(ze,null,st(e.personality.prompts_list,(s,i)=>(C(),R("div",{key:i,onClick:r=>e.selectPrompt(s),class:"bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg p-4 cursor-pointer hover:shadow-lg transition-all duration-300 ease-in-out transform hover:scale-105 flex flex-col justify-between h-[220px] overflow-hidden group"},[c("div",{title:s,class:"text-base text-gray-700 dark:text-gray-300 overflow-hidden relative h-full"},[c("div",o1t,se(s),1),a1t],8,r1t),l1t],8,i1t))),128))])])):G("",!0)])):G("",!0)]),_:1})):G("",!0),e.currentDiscussion.id?G("",!0):(C(),St(MN,{key:1})),c1t]),d1t],2),e.currentDiscussion.id?(C(),R("div",u1t,[_e(IN,{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"])])):G("",!0)])):G("",!0),_e(Ms,{name:"slide-left"},{default:qe(()=>[e.showRightPanel?(C(),R("div",p1t,[c("div",_1t,null,512)])):G("",!0)]),_:1}),_e(eE,{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"]),B(c("div",h1t,[_e(Ll,{ref:"progress",progress:e.progress_value,class:"w-full h-4"},null,8,["progress"]),c("p",f1t,se(e.loading_infos)+" ...",1)],512),[[Ot,e.progress_visibility]]),_e(RN,{"prompt-text":"Enter the url to the page to use as discussion support",onOk:e.addWebpage,ref:"web_url_input_box"},null,8,["onOk"]),_e(AN,{ref:"skills_lib"},null,512)],64))}}),b1t=pt(g1t,[["__scopeId","data-v-c538ea16"]]);/** * @license * Copyright 2010-2023 Three.js Authors * SPDX-License-Identifier: MIT - */const SE="159",b1t=0,sC=1,E1t=2,JN=1,y1t=2,gi=3,Oi=0,Yn=1,qs=2,ar=0,Yo=1,iC=2,rC=3,oC=4,v1t=5,kr=100,S1t=101,T1t=102,aC=103,lC=104,x1t=200,C1t=201,w1t=202,R1t=203,kg=204,Lg=205,A1t=206,N1t=207,O1t=208,I1t=209,M1t=210,D1t=211,k1t=212,L1t=213,P1t=214,U1t=0,F1t=1,B1t=2,$d=3,G1t=4,V1t=5,z1t=6,H1t=7,TE=0,q1t=1,Y1t=2,lr=0,$1t=1,W1t=2,K1t=3,j1t=4,Q1t=5,cC="attached",X1t="detached",eO=300,aa=301,la=302,Pg=303,Ug=304,zu=306,ca=1e3,as=1001,Wd=1002,mn=1003,Fg=1004,bd=1005,zn=1006,tO=1007,Xr=1008,cr=1009,Z1t=1010,J1t=1011,xE=1012,nO=1013,sr=1014,vi=1015,Fl=1016,sO=1017,iO=1018,Hr=1020,ewt=1021,ls=1023,twt=1024,nwt=1025,qr=1026,da=1027,swt=1028,rO=1029,iwt=1030,oO=1031,aO=1033,hm=33776,fm=33777,mm=33778,gm=33779,dC=35840,uC=35841,pC=35842,_C=35843,lO=36196,hC=37492,fC=37496,mC=37808,gC=37809,bC=37810,EC=37811,yC=37812,vC=37813,SC=37814,TC=37815,xC=37816,CC=37817,wC=37818,RC=37819,AC=37820,NC=37821,bm=36492,OC=36494,IC=36495,rwt=36283,MC=36284,DC=36285,kC=36286,Bl=2300,ua=2301,Em=2302,LC=2400,PC=2401,UC=2402,owt=2500,awt=0,cO=1,Bg=2,dO=3e3,Yr=3001,lwt=3200,cwt=3201,CE=0,dwt=1,cs="",en="srgb",Cn="srgb-linear",wE="display-p3",Hu="display-p3-linear",Kd="linear",Wt="srgb",jd="rec709",Qd="p3",ho=7680,FC=519,uwt=512,pwt=513,_wt=514,uO=515,hwt=516,fwt=517,mwt=518,gwt=519,Gg=35044,BC="300 es",Vg=1035,Si=2e3,Xd=2001;class Ma{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const s=this._listeners;s[e]===void 0&&(s[e]=[]),s[e].indexOf(t)===-1&&s[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const s=this._listeners;return s[e]!==void 0&&s[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const r=i.indexOf(t);r!==-1&&i.splice(r,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const s=this._listeners[e.type];if(s!==void 0){e.target=this;const i=s.slice(0);for(let r=0,o=i.length;r>8&255]+wn[n>>16&255]+wn[n>>24&255]+"-"+wn[e&255]+wn[e>>8&255]+"-"+wn[e>>16&15|64]+wn[e>>24&255]+"-"+wn[t&63|128]+wn[t>>8&255]+"-"+wn[t>>16&255]+wn[t>>24&255]+wn[s&255]+wn[s>>8&255]+wn[s>>16&255]+wn[s>>24&255]).toLowerCase()}function Nn(n,e,t){return Math.max(e,Math.min(t,n))}function RE(n,e){return(n%e+e)%e}function bwt(n,e,t,s,i){return s+(n-e)*(i-s)/(t-e)}function Ewt(n,e,t){return n!==e?(t-n)/(e-n):0}function gl(n,e,t){return(1-t)*n+t*e}function ywt(n,e,t,s){return gl(n,e,1-Math.exp(-t*s))}function vwt(n,e=1){return e-Math.abs(RE(n,e*2)-e)}function Swt(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function Twt(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function xwt(n,e){return n+Math.floor(Math.random()*(e-n+1))}function Cwt(n,e){return n+Math.random()*(e-n)}function wwt(n){return n*(.5-Math.random())}function Rwt(n){n!==void 0&&(GC=n);let e=GC+=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 Awt(n){return n*ml}function Nwt(n){return n*pa}function zg(n){return(n&n-1)===0&&n!==0}function Owt(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function Zd(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function Iwt(n,e,t,s,i){const r=Math.cos,o=Math.sin,a=r(t/2),l=o(t/2),u=r((e+s)/2),d=o((e+s)/2),h=r((e-s)/2),f=o((e-s)/2),_=r((s-e)/2),m=o((s-e)/2);switch(i){case"XYX":n.set(a*d,l*h,l*f,a*u);break;case"YZY":n.set(l*f,a*d,l*h,a*u);break;case"ZXZ":n.set(l*h,l*f,a*d,a*u);break;case"XZX":n.set(a*d,l*m,l*_,a*u);break;case"YXY":n.set(l*_,a*d,l*m,a*u);break;case"ZYZ":n.set(l*m,l*_,a*d,a*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Ys(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Vt(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const Mwt={DEG2RAD:ml,RAD2DEG:pa,generateUUID:Ds,clamp:Nn,euclideanModulo:RE,mapLinear:bwt,inverseLerp:Ewt,lerp:gl,damp:ywt,pingpong:vwt,smoothstep:Swt,smootherstep:Twt,randInt:xwt,randFloat:Cwt,randFloatSpread:wwt,seededRandom:Rwt,degToRad:Awt,radToDeg:Nwt,isPowerOfTwo:zg,ceilPowerOfTwo:Owt,floorPowerOfTwo:Zd,setQuaternionFromProperEuler:Iwt,normalize:Vt,denormalize:Ys};class Rt{constructor(e=0,t=0){Rt.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,s=this.y,i=e.elements;return this.x=i[0]*t+i[3]*s+i[6],this.y=i[1]*t+i[4]*s+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(e,Math.min(t,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const s=this.dot(e)/t;return Math.acos(Nn(s,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,s=this.y-e.y;return t*t+s*s}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,s){return this.x=e.x+(t.x-e.x)*s,this.y=e.y+(t.y-e.y)*s,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const s=Math.cos(t),i=Math.sin(t),r=this.x-e.x,o=this.y-e.y;return this.x=r*s-o*i+e.x,this.y=r*i+o*s+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Tt{constructor(e,t,s,i,r,o,a,l,u){Tt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,s,i,r,o,a,l,u)}set(e,t,s,i,r,o,a,l,u){const d=this.elements;return d[0]=e,d[1]=i,d[2]=a,d[3]=t,d[4]=r,d[5]=l,d[6]=s,d[7]=o,d[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,s=e.elements;return t[0]=s[0],t[1]=s[1],t[2]=s[2],t[3]=s[3],t[4]=s[4],t[5]=s[5],t[6]=s[6],t[7]=s[7],t[8]=s[8],this}extractBasis(e,t,s){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),s.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const s=e.elements,i=t.elements,r=this.elements,o=s[0],a=s[3],l=s[6],u=s[1],d=s[4],h=s[7],f=s[2],_=s[5],m=s[8],E=i[0],b=i[3],g=i[6],y=i[1],v=i[4],S=i[7],w=i[2],x=i[5],A=i[8];return r[0]=o*E+a*y+l*w,r[3]=o*b+a*v+l*x,r[6]=o*g+a*S+l*A,r[1]=u*E+d*y+h*w,r[4]=u*b+d*v+h*x,r[7]=u*g+d*S+h*A,r[2]=f*E+_*y+m*w,r[5]=f*b+_*v+m*x,r[8]=f*g+_*S+m*A,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],s=e[1],i=e[2],r=e[3],o=e[4],a=e[5],l=e[6],u=e[7],d=e[8];return t*o*d-t*a*u-s*r*d+s*a*l+i*r*u-i*o*l}invert(){const e=this.elements,t=e[0],s=e[1],i=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=t*h+s*f+i*_;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]=(i*u-d*s)*E,e[2]=(a*s-i*o)*E,e[3]=f*E,e[4]=(d*t-i*l)*E,e[5]=(i*r-a*t)*E,e[6]=_*E,e[7]=(s*l-u*t)*E,e[8]=(o*t-s*r)*E,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,s,i,r,o,a){const l=Math.cos(r),u=Math.sin(r);return this.set(s*l,s*u,-s*(l*o+u*a)+o+e,-i*u,i*l,-i*(-u*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(ym.makeScale(e,t)),this}rotate(e){return this.premultiply(ym.makeRotation(-e)),this}translate(e,t){return this.premultiply(ym.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),s=Math.sin(e);return this.set(t,-s,0,s,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,s=e.elements;for(let i=0;i<9;i++)if(t[i]!==s[i])return!1;return!0}fromArray(e,t=0){for(let s=0;s<9;s++)this.elements[s]=e[s+t];return this}toArray(e=[],t=0){const s=this.elements;return e[t]=s[0],e[t+1]=s[1],e[t+2]=s[2],e[t+3]=s[3],e[t+4]=s[4],e[t+5]=s[5],e[t+6]=s[6],e[t+7]=s[7],e[t+8]=s[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const ym=new Tt;function pO(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}function Gl(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function Dwt(){const n=Gl("canvas");return n.style.display="block",n}const VC={};function bl(n){n in VC||(VC[n]=!0,console.warn(n))}const zC=new Tt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),HC=new Tt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Oc={[Cn]:{transfer:Kd,primaries:jd,toReference:n=>n,fromReference:n=>n},[en]:{transfer:Wt,primaries:jd,toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[Hu]:{transfer:Kd,primaries:Qd,toReference:n=>n.applyMatrix3(HC),fromReference:n=>n.applyMatrix3(zC)},[wE]:{transfer:Wt,primaries:Qd,toReference:n=>n.convertSRGBToLinear().applyMatrix3(HC),fromReference:n=>n.applyMatrix3(zC).convertLinearToSRGB()}},kwt=new Set([Cn,Hu]),Ut={enabled:!0,_workingColorSpace:Cn,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(n){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!n},get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!kwt.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,e,t){if(this.enabled===!1||e===t||!e||!t)return n;const s=Oc[e].toReference,i=Oc[t].fromReference;return i(s(n))},fromWorkingColorSpace:function(n,e){return this.convert(n,this._workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this._workingColorSpace)},getPrimaries:function(n){return Oc[n].primaries},getTransfer:function(n){return n===cs?Kd:Oc[n].transfer}};function $o(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function vm(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let fo;class _O{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{fo===void 0&&(fo=Gl("canvas")),fo.width=e.width,fo.height=e.height;const s=fo.getContext("2d");e instanceof ImageData?s.putImageData(e,0,0):s.drawImage(e,0,0,e.width,e.height),t=fo}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Gl("canvas");t.width=e.width,t.height=e.height;const s=t.getContext("2d");s.drawImage(e,0,0,e.width,e.height);const i=s.getImageData(0,0,e.width,e.height),r=i.data;for(let o=0;o0&&(s.userData=this.userData),t||(e.textures[this.uuid]=s),s}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==eO)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 as:e.x=e.x<0?0:1;break;case Wd: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 as:e.y=e.y<0?0:1;break;case Wd: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===en?Yr:dO}set encoding(e){bl("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===Yr?en:cs}}xn.DEFAULT_IMAGE=null;xn.DEFAULT_MAPPING=eO;xn.DEFAULT_ANISOTROPY=1;class Yt{constructor(e=0,t=0,s=0,i=1){Yt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=s,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,s,i){return this.x=e,this.y=t,this.z=s,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,s=this.y,i=this.z,r=this.w,o=e.elements;return this.x=o[0]*t+o[4]*s+o[8]*i+o[12]*r,this.y=o[1]*t+o[5]*s+o[9]*i+o[13]*r,this.z=o[2]*t+o[6]*s+o[10]*i+o[14]*r,this.w=o[3]*t+o[7]*s+o[11]*i+o[15]*r,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,s,i,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;t=Math.PI;const v=(u+1)/2,S=(_+1)/2,w=(g+1)/2,x=(d+f)/4,A=(h+E)/4,D=(m+b)/4;return v>S&&v>w?v<.01?(s=0,i=.707106781,r=.707106781):(s=Math.sqrt(v),i=x/s,r=A/s):S>w?S<.01?(s=.707106781,i=0,r=.707106781):(i=Math.sqrt(S),s=x/i,r=D/i):w<.01?(s=.707106781,i=.707106781,r=0):(r=Math.sqrt(w),s=A/r,i=D/r),this.set(s,i,r,t),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,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(e,Math.min(t,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,s){return this.x=e.x+(t.x-e.x)*s,this.y=e.y+(t.y-e.y)*s,this.z=e.z+(t.z-e.z)*s,this.w=e.w+(t.w-e.w)*s,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Uwt extends Ma{constructor(e=1,t=1,s={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Yt(0,0,e,t),this.scissorTest=!1,this.viewport=new Yt(0,0,e,t);const i={width:e,height:t,depth:1};s.encoding!==void 0&&(bl("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),s.colorSpace=s.encoding===Yr?en:cs),s=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:zn,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},s),this.texture=new xn(i,s.mapping,s.wrapS,s.wrapT,s.magFilter,s.minFilter,s.format,s.type,s.anisotropy,s.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=s.generateMipmaps,this.texture.internalFormat=s.internalFormat,this.depthBuffer=s.depthBuffer,this.stencilBuffer=s.stencilBuffer,this.depthTexture=s.depthTexture,this.samples=s.samples}setSize(e,t,s=1){(this.width!==e||this.height!==t||this.depth!==s)&&(this.width=e,this.height=t,this.depth=s,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=s,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new hO(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Zr extends Uwt{constructor(e=1,t=1,s={}){super(e,t,s),this.isWebGLRenderTarget=!0}}class fO extends xn{constructor(e=null,t=1,s=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:s,depth:i},this.magFilter=mn,this.minFilter=mn,this.wrapR=as,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Fwt extends xn{constructor(e=null,t=1,s=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:s,depth:i},this.magFilter=mn,this.minFilter=mn,this.wrapR=as,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class mr{constructor(e=0,t=0,s=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=s,this._w=i}static slerpFlat(e,t,s,i,r,o,a){let l=s[i+0],u=s[i+1],d=s[i+2],h=s[i+3];const f=r[o+0],_=r[o+1],m=r[o+2],E=r[o+3];if(a===0){e[t+0]=l,e[t+1]=u,e[t+2]=d,e[t+3]=h;return}if(a===1){e[t+0]=f,e[t+1]=_,e[t+2]=m,e[t+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 w=Math.sqrt(v),x=Math.atan2(w,g*y);b=Math.sin(b*x)/w,a=Math.sin(a*x)/w}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 w=1/Math.sqrt(l*l+u*u+d*d+h*h);l*=w,u*=w,d*=w,h*=w}}e[t]=l,e[t+1]=u,e[t+2]=d,e[t+3]=h}static multiplyQuaternionsFlat(e,t,s,i,r,o){const a=s[i],l=s[i+1],u=s[i+2],d=s[i+3],h=r[o],f=r[o+1],_=r[o+2],m=r[o+3];return e[t]=a*m+d*h+l*_-u*f,e[t+1]=l*m+d*f+u*h-a*_,e[t+2]=u*m+d*_+a*f-l*h,e[t+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,t,s,i){return this._x=e,this._y=t,this._z=s,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){const s=e._x,i=e._y,r=e._z,o=e._order,a=Math.cos,l=Math.sin,u=a(s/2),d=a(i/2),h=a(r/2),f=l(s/2),_=l(i/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 t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const s=t/2,i=Math.sin(s);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(s),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,s=t[0],i=t[4],r=t[8],o=t[1],a=t[5],l=t[9],u=t[2],d=t[6],h=t[10],f=s+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-i)*_}else if(s>a&&s>h){const _=2*Math.sqrt(1+s-a-h);this._w=(d-l)/_,this._x=.25*_,this._y=(i+o)/_,this._z=(r+u)/_}else if(a>h){const _=2*Math.sqrt(1+a-s-h);this._w=(r-u)/_,this._x=(i+o)/_,this._y=.25*_,this._z=(l+d)/_}else{const _=2*Math.sqrt(1+h-s-a);this._w=(o-i)/_,this._x=(r+u)/_,this._y=(l+d)/_,this._z=.25*_}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let s=e.dot(t)+1;return sMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=s):(this._x=0,this._y=-e.z,this._z=e.y,this._w=s)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=s),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Nn(this.dot(e),-1,1)))}rotateTowards(e,t){const s=this.angleTo(e);if(s===0)return this;const i=Math.min(1,t/s);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const s=e._x,i=e._y,r=e._z,o=e._w,a=t._x,l=t._y,u=t._z,d=t._w;return this._x=s*d+o*a+i*u-r*l,this._y=i*d+o*l+r*a-s*u,this._z=r*d+o*u+s*l-i*a,this._w=o*d-s*a-i*l-r*u,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const s=this._x,i=this._y,r=this._z,o=this._w;let a=o*e._w+s*e._x+i*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=s,this._y=i,this._z=r,this;const l=1-a*a;if(l<=Number.EPSILON){const _=1-t;return this._w=_*o+t*this._w,this._x=_*s+t*this._x,this._y=_*i+t*this._y,this._z=_*r+t*this._z,this.normalize(),this._onChangeCallback(),this}const u=Math.sqrt(l),d=Math.atan2(u,a),h=Math.sin((1-t)*d)/u,f=Math.sin(t*d)/u;return this._w=o*h+this._w*f,this._x=s*h+this._x*f,this._y=i*h+this._y*f,this._z=r*h+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,t,s){return this.copy(e).slerp(t,s)}random(){const e=Math.random(),t=Math.sqrt(1-e),s=Math.sqrt(e),i=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(t*Math.cos(i),s*Math.sin(r),s*Math.cos(r),t*Math.sin(i))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class ie{constructor(e=0,t=0,s=0){ie.prototype.isVector3=!0,this.x=e,this.y=t,this.z=s}set(e,t,s){return s===void 0&&(s=this.z),this.x=e,this.y=t,this.z=s,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(qC.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(qC.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,s=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[3]*s+r[6]*i,this.y=r[1]*t+r[4]*s+r[7]*i,this.z=r[2]*t+r[5]*s+r[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,s=this.y,i=this.z,r=e.elements,o=1/(r[3]*t+r[7]*s+r[11]*i+r[15]);return this.x=(r[0]*t+r[4]*s+r[8]*i+r[12])*o,this.y=(r[1]*t+r[5]*s+r[9]*i+r[13])*o,this.z=(r[2]*t+r[6]*s+r[10]*i+r[14])*o,this}applyQuaternion(e){const t=this.x,s=this.y,i=this.z,r=e.x,o=e.y,a=e.z,l=e.w,u=2*(o*i-a*s),d=2*(a*t-r*i),h=2*(r*s-o*t);return this.x=t+l*u+o*h-a*d,this.y=s+l*d+a*u-r*h,this.z=i+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 t=this.x,s=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[4]*s+r[8]*i,this.y=r[1]*t+r[5]*s+r[9]*i,this.z=r[2]*t+r[6]*s+r[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(e,Math.min(t,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,s){return this.x=e.x+(t.x-e.x)*s,this.y=e.y+(t.y-e.y)*s,this.z=e.z+(t.z-e.z)*s,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const s=e.x,i=e.y,r=e.z,o=t.x,a=t.y,l=t.z;return this.x=i*l-r*a,this.y=r*o-s*l,this.z=s*a-i*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const s=e.dot(this)/t;return this.copy(e).multiplyScalar(s)}projectOnPlane(e){return Tm.copy(this).projectOnVector(e),this.sub(Tm)}reflect(e){return this.sub(Tm.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const s=this.dot(e)/t;return Math.acos(Nn(s,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,s=this.y-e.y,i=this.z-e.z;return t*t+s*s+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,s){const i=Math.sin(t)*e;return this.x=i*Math.sin(s),this.y=Math.cos(t)*e,this.z=i*Math.cos(s),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,s){return this.x=e*Math.sin(t),this.y=s,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),s=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=s,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,t=Math.random()*Math.PI*2,s=Math.sqrt(1-e**2);return this.x=s*Math.cos(t),this.y=s*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Tm=new ie,qC=new mr;class ki{constructor(e=new ie(1/0,1/0,1/0),t=new ie(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,s=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Ss),Ss.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,s;return e.normal.x>0?(t=e.normal.x*this.min.x,s=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,s=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,s+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,s+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,s+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,s+=e.normal.z*this.min.z),t<=-e.constant&&s>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Ka),Mc.subVectors(this.max,Ka),mo.subVectors(e.a,Ka),go.subVectors(e.b,Ka),bo.subVectors(e.c,Ka),Gi.subVectors(go,mo),Vi.subVectors(bo,go),Sr.subVectors(mo,bo);let t=[0,-Gi.z,Gi.y,0,-Vi.z,Vi.y,0,-Sr.z,Sr.y,Gi.z,0,-Gi.x,Vi.z,0,-Vi.x,Sr.z,0,-Sr.x,-Gi.y,Gi.x,0,-Vi.y,Vi.x,0,-Sr.y,Sr.x,0];return!xm(t,mo,go,bo,Mc)||(t=[1,0,0,0,1,0,0,0,1],!xm(t,mo,go,bo,Mc))?!1:(Dc.crossVectors(Gi,Vi),t=[Dc.x,Dc.y,Dc.z],xm(t,mo,go,bo,Mc))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Ss).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Ss).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:(di[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),di[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),di[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),di[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),di[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),di[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),di[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),di[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(di),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 di=[new ie,new ie,new ie,new ie,new ie,new ie,new ie,new ie],Ss=new ie,Ic=new ki,mo=new ie,go=new ie,bo=new ie,Gi=new ie,Vi=new ie,Sr=new ie,Ka=new ie,Mc=new ie,Dc=new ie,Tr=new ie;function xm(n,e,t,s,i){for(let r=0,o=n.length-3;r<=o;r+=3){Tr.fromArray(n,r);const a=i.x*Math.abs(Tr.x)+i.y*Math.abs(Tr.y)+i.z*Math.abs(Tr.z),l=e.dot(Tr),u=t.dot(Tr),d=s.dot(Tr);if(Math.max(-Math.max(l,u,d),Math.min(l,u,d))>a)return!1}return!0}const Bwt=new ki,ja=new ie,Cm=new ie;class ii{constructor(e=new ie,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const s=this.center;t!==void 0?s.copy(t):Bwt.setFromPoints(e).getCenter(s);let i=0;for(let r=0,o=e.length;rthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;ja.subVectors(e,this.center);const t=ja.lengthSq();if(t>this.radius*this.radius){const s=Math.sqrt(t),i=(s-this.radius)*.5;this.center.addScaledVector(ja,i/s),this.radius+=i}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):(Cm.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(ja.copy(e.center).add(Cm)),this.expandByPoint(ja.copy(e.center).sub(Cm))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const ui=new ie,wm=new ie,kc=new ie,zi=new ie,Rm=new ie,Lc=new ie,Am=new ie;class qu{constructor(e=new ie,t=new ie(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,ui)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const s=t.dot(this.direction);return s<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,s)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=ui.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(ui.copy(this.origin).addScaledVector(this.direction,t),ui.distanceToSquared(e))}distanceSqToSegment(e,t,s,i){wm.copy(e).add(t).multiplyScalar(.5),kc.copy(t).sub(e).normalize(),zi.copy(this.origin).sub(wm);const r=e.distanceTo(t)*.5,o=-this.direction.dot(kc),a=zi.dot(this.direction),l=-zi.dot(kc),u=zi.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 s&&s.copy(this.origin).addScaledVector(this.direction,h),i&&i.copy(wm).addScaledVector(kc,f),_}intersectSphere(e,t){ui.subVectors(e.center,this.origin);const s=ui.dot(this.direction),i=ui.dot(ui)-s*s,r=e.radius*e.radius;if(i>r)return null;const o=Math.sqrt(r-i),a=s-o,l=s+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const s=-(this.origin.dot(e.normal)+e.constant)/t;return s>=0?s:null}intersectPlane(e,t){const s=this.distanceToPlane(e);return s===null?null:this.at(s,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let s,i,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?(s=(e.min.x-f.x)*u,i=(e.max.x-f.x)*u):(s=(e.max.x-f.x)*u,i=(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),s>o||r>i||((r>s||isNaN(s))&&(s=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),s>l||a>i)||((a>s||s!==s)&&(s=a),(l=0?s:i,t)}intersectsBox(e){return this.intersectBox(e,ui)!==null}intersectTriangle(e,t,s,i,r){Rm.subVectors(t,e),Lc.subVectors(s,e),Am.crossVectors(Rm,Lc);let o=this.direction.dot(Am),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;zi.subVectors(this.origin,e);const l=a*this.direction.dot(Lc.crossVectors(zi,Lc));if(l<0)return null;const u=a*this.direction.dot(Rm.cross(zi));if(u<0||l+u>o)return null;const d=-a*zi.dot(Am);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 xt{constructor(e,t,s,i,r,o,a,l,u,d,h,f,_,m,E,b){xt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,s,i,r,o,a,l,u,d,h,f,_,m,E,b)}set(e,t,s,i,r,o,a,l,u,d,h,f,_,m,E,b){const g=this.elements;return g[0]=e,g[4]=t,g[8]=s,g[12]=i,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 xt().fromArray(this.elements)}copy(e){const t=this.elements,s=e.elements;return t[0]=s[0],t[1]=s[1],t[2]=s[2],t[3]=s[3],t[4]=s[4],t[5]=s[5],t[6]=s[6],t[7]=s[7],t[8]=s[8],t[9]=s[9],t[10]=s[10],t[11]=s[11],t[12]=s[12],t[13]=s[13],t[14]=s[14],t[15]=s[15],this}copyPosition(e){const t=this.elements,s=e.elements;return t[12]=s[12],t[13]=s[13],t[14]=s[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,s){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),s.setFromMatrixColumn(this,2),this}makeBasis(e,t,s){return this.set(e.x,t.x,s.x,0,e.y,t.y,s.y,0,e.z,t.z,s.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,s=e.elements,i=1/Eo.setFromMatrixColumn(e,0).length(),r=1/Eo.setFromMatrixColumn(e,1).length(),o=1/Eo.setFromMatrixColumn(e,2).length();return t[0]=s[0]*i,t[1]=s[1]*i,t[2]=s[2]*i,t[3]=0,t[4]=s[4]*r,t[5]=s[5]*r,t[6]=s[6]*r,t[7]=0,t[8]=s[8]*o,t[9]=s[9]*o,t[10]=s[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,s=e.x,i=e.y,r=e.z,o=Math.cos(s),a=Math.sin(s),l=Math.cos(i),u=Math.sin(i),d=Math.cos(r),h=Math.sin(r);if(e.order==="XYZ"){const f=o*d,_=o*h,m=a*d,E=a*h;t[0]=l*d,t[4]=-l*h,t[8]=u,t[1]=_+m*u,t[5]=f-E*u,t[9]=-a*l,t[2]=E-f*u,t[6]=m+_*u,t[10]=o*l}else if(e.order==="YXZ"){const f=l*d,_=l*h,m=u*d,E=u*h;t[0]=f+E*a,t[4]=m*a-_,t[8]=o*u,t[1]=o*h,t[5]=o*d,t[9]=-a,t[2]=_*a-m,t[6]=E+f*a,t[10]=o*l}else if(e.order==="ZXY"){const f=l*d,_=l*h,m=u*d,E=u*h;t[0]=f-E*a,t[4]=-o*h,t[8]=m+_*a,t[1]=_+m*a,t[5]=o*d,t[9]=E-f*a,t[2]=-o*u,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const f=o*d,_=o*h,m=a*d,E=a*h;t[0]=l*d,t[4]=m*u-_,t[8]=f*u+E,t[1]=l*h,t[5]=E*u+f,t[9]=_*u-m,t[2]=-u,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const f=o*l,_=o*u,m=a*l,E=a*u;t[0]=l*d,t[4]=E-f*h,t[8]=m*h+_,t[1]=h,t[5]=o*d,t[9]=-a*d,t[2]=-u*d,t[6]=_*h+m,t[10]=f-E*h}else if(e.order==="XZY"){const f=o*l,_=o*u,m=a*l,E=a*u;t[0]=l*d,t[4]=-h,t[8]=u*d,t[1]=f*h+E,t[5]=o*d,t[9]=_*h-m,t[2]=m*h-_,t[6]=a*d,t[10]=E*h+f}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Gwt,e,Vwt)}lookAt(e,t,s){const i=this.elements;return jn.subVectors(e,t),jn.lengthSq()===0&&(jn.z=1),jn.normalize(),Hi.crossVectors(s,jn),Hi.lengthSq()===0&&(Math.abs(s.z)===1?jn.x+=1e-4:jn.z+=1e-4,jn.normalize(),Hi.crossVectors(s,jn)),Hi.normalize(),Pc.crossVectors(jn,Hi),i[0]=Hi.x,i[4]=Pc.x,i[8]=jn.x,i[1]=Hi.y,i[5]=Pc.y,i[9]=jn.y,i[2]=Hi.z,i[6]=Pc.z,i[10]=jn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const s=e.elements,i=t.elements,r=this.elements,o=s[0],a=s[4],l=s[8],u=s[12],d=s[1],h=s[5],f=s[9],_=s[13],m=s[2],E=s[6],b=s[10],g=s[14],y=s[3],v=s[7],S=s[11],w=s[15],x=i[0],A=i[4],D=i[8],T=i[12],O=i[1],F=i[5],z=i[9],Z=i[13],M=i[2],q=i[6],H=i[10],P=i[14],$=i[3],J=i[7],re=i[11],me=i[15];return r[0]=o*x+a*O+l*M+u*$,r[4]=o*A+a*F+l*q+u*J,r[8]=o*D+a*z+l*H+u*re,r[12]=o*T+a*Z+l*P+u*me,r[1]=d*x+h*O+f*M+_*$,r[5]=d*A+h*F+f*q+_*J,r[9]=d*D+h*z+f*H+_*re,r[13]=d*T+h*Z+f*P+_*me,r[2]=m*x+E*O+b*M+g*$,r[6]=m*A+E*F+b*q+g*J,r[10]=m*D+E*z+b*H+g*re,r[14]=m*T+E*Z+b*P+g*me,r[3]=y*x+v*O+S*M+w*$,r[7]=y*A+v*F+S*q+w*J,r[11]=y*D+v*z+S*H+w*re,r[15]=y*T+v*Z+S*P+w*me,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],s=e[4],i=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-i*u*h-r*a*f+s*u*f+i*a*_-s*l*_)+E*(+t*l*_-t*u*f+r*o*f-i*o*_+i*u*d-r*l*d)+b*(+t*u*h-t*a*_-r*o*h+s*o*_+r*a*d-s*u*d)+g*(-i*a*d-t*l*h+t*a*f+i*o*h-s*o*f+s*l*d)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,s){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=s),this}invert(){const e=this.elements,t=e[0],s=e[1],i=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,w=m*h*l-d*E*l-m*a*f+o*E*f+d*a*b-o*h*b,x=t*y+s*v+i*S+r*w;if(x===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const A=1/x;return e[0]=y*A,e[1]=(E*f*r-h*b*r-E*i*_+s*b*_+h*i*g-s*f*g)*A,e[2]=(a*b*r-E*l*r+E*i*u-s*b*u-a*i*g+s*l*g)*A,e[3]=(h*l*r-a*f*r-h*i*u+s*f*u+a*i*_-s*l*_)*A,e[4]=v*A,e[5]=(d*b*r-m*f*r+m*i*_-t*b*_-d*i*g+t*f*g)*A,e[6]=(m*l*r-o*b*r-m*i*u+t*b*u+o*i*g-t*l*g)*A,e[7]=(o*f*r-d*l*r+d*i*u-t*f*u-o*i*_+t*l*_)*A,e[8]=S*A,e[9]=(m*h*r-d*E*r-m*s*_+t*E*_+d*s*g-t*h*g)*A,e[10]=(o*E*r-m*a*r+m*s*u-t*E*u-o*s*g+t*a*g)*A,e[11]=(d*a*r-o*h*r-d*s*u+t*h*u+o*s*_-t*a*_)*A,e[12]=w*A,e[13]=(d*E*i-m*h*i+m*s*f-t*E*f-d*s*b+t*h*b)*A,e[14]=(m*a*i-o*E*i-m*s*l+t*E*l+o*s*b-t*a*b)*A,e[15]=(o*h*i-d*a*i+d*s*l-t*h*l-o*s*f+t*a*f)*A,this}scale(e){const t=this.elements,s=e.x,i=e.y,r=e.z;return t[0]*=s,t[4]*=i,t[8]*=r,t[1]*=s,t[5]*=i,t[9]*=r,t[2]*=s,t[6]*=i,t[10]*=r,t[3]*=s,t[7]*=i,t[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],s=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,s,i))}makeTranslation(e,t,s){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,s,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),s=Math.sin(e);return this.set(1,0,0,0,0,t,-s,0,0,s,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),s=Math.sin(e);return this.set(t,0,s,0,0,1,0,0,-s,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),s=Math.sin(e);return this.set(t,-s,0,0,s,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const s=Math.cos(t),i=Math.sin(t),r=1-s,o=e.x,a=e.y,l=e.z,u=r*o,d=r*a;return this.set(u*o+s,u*a-i*l,u*l+i*a,0,u*a+i*l,d*a+s,d*l-i*o,0,u*l-i*a,d*l+i*o,r*l*l+s,0,0,0,0,1),this}makeScale(e,t,s){return this.set(e,0,0,0,0,t,0,0,0,0,s,0,0,0,0,1),this}makeShear(e,t,s,i,r,o){return this.set(1,s,r,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,s){const i=this.elements,r=t._x,o=t._y,a=t._z,l=t._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,w=s.x,x=s.y,A=s.z;return i[0]=(1-(E+g))*w,i[1]=(_+S)*w,i[2]=(m-v)*w,i[3]=0,i[4]=(_-S)*x,i[5]=(1-(f+g))*x,i[6]=(b+y)*x,i[7]=0,i[8]=(m+v)*A,i[9]=(b-y)*A,i[10]=(1-(f+E))*A,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,s){const i=this.elements;let r=Eo.set(i[0],i[1],i[2]).length();const o=Eo.set(i[4],i[5],i[6]).length(),a=Eo.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),e.x=i[12],e.y=i[13],e.z=i[14],Ts.copy(this);const u=1/r,d=1/o,h=1/a;return Ts.elements[0]*=u,Ts.elements[1]*=u,Ts.elements[2]*=u,Ts.elements[4]*=d,Ts.elements[5]*=d,Ts.elements[6]*=d,Ts.elements[8]*=h,Ts.elements[9]*=h,Ts.elements[10]*=h,t.setFromRotationMatrix(Ts),s.x=r,s.y=o,s.z=a,this}makePerspective(e,t,s,i,r,o,a=Si){const l=this.elements,u=2*r/(t-e),d=2*r/(s-i),h=(t+e)/(t-e),f=(s+i)/(s-i);let _,m;if(a===Si)_=-(o+r)/(o-r),m=-2*o*r/(o-r);else if(a===Xd)_=-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,t,s,i,r,o,a=Si){const l=this.elements,u=1/(t-e),d=1/(s-i),h=1/(o-r),f=(t+e)*u,_=(s+i)*d;let m,E;if(a===Si)m=(o+r)*h,E=-2*h;else if(a===Xd)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 t=this.elements,s=e.elements;for(let i=0;i<16;i++)if(t[i]!==s[i])return!1;return!0}fromArray(e,t=0){for(let s=0;s<16;s++)this.elements[s]=e[s+t];return this}toArray(e=[],t=0){const s=this.elements;return e[t]=s[0],e[t+1]=s[1],e[t+2]=s[2],e[t+3]=s[3],e[t+4]=s[4],e[t+5]=s[5],e[t+6]=s[6],e[t+7]=s[7],e[t+8]=s[8],e[t+9]=s[9],e[t+10]=s[10],e[t+11]=s[11],e[t+12]=s[12],e[t+13]=s[13],e[t+14]=s[14],e[t+15]=s[15],e}}const Eo=new ie,Ts=new xt,Gwt=new ie(0,0,0),Vwt=new ie(1,1,1),Hi=new ie,Pc=new ie,jn=new ie,YC=new xt,$C=new mr;class Yu{constructor(e=0,t=0,s=0,i=Yu.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=s,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,s,i=this._order){return this._x=e,this._y=t,this._z=s,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,s=!0){const i=e.elements,r=i[0],o=i[4],a=i[8],l=i[1],u=i[5],d=i[9],h=i[2],f=i[6],_=i[10];switch(t){case"XYZ":this._y=Math.asin(Nn(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(-Nn(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(Nn(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(-Nn(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(Nn(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(-Nn(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: "+t)}return this._order=t,s===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,s){return YC.makeRotationFromQuaternion(e),this.setFromRotationMatrix(YC,t,s)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return $C.setFromEuler(this),this.setFromQuaternion($C,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Yu.DEFAULT_ORDER="XYZ";class mO{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let s=0;s0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.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()})),i.maxGeometryCount=this._maxGeometryCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.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?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.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){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(s.geometries=a),l.length>0&&(s.materials=l),u.length>0&&(s.textures=u),d.length>0&&(s.images=d),h.length>0&&(s.shapes=h),f.length>0&&(s.skeletons=f),_.length>0&&(s.animations=_),m.length>0&&(s.nodes=m)}return s.object=i,s;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,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let s=0;s0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(e,t,s,i,r){xs.subVectors(i,t),_i.subVectors(s,t),Nm.subVectors(e,t);const o=xs.dot(xs),a=xs.dot(_i),l=xs.dot(Nm),u=_i.dot(_i),d=_i.dot(Nm),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,t,s,i){return this.getBarycoord(e,t,s,i,hi),hi.x>=0&&hi.y>=0&&hi.x+hi.y<=1}static getUV(e,t,s,i,r,o,a,l){return Fc===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Fc=!0),this.getInterpolation(e,t,s,i,r,o,a,l)}static getInterpolation(e,t,s,i,r,o,a,l){return this.getBarycoord(e,t,s,i,hi),l.setScalar(0),l.addScaledVector(r,hi.x),l.addScaledVector(o,hi.y),l.addScaledVector(a,hi.z),l}static isFrontFacing(e,t,s,i){return xs.subVectors(s,t),_i.subVectors(e,t),xs.cross(_i).dot(i)<0}set(e,t,s){return this.a.copy(e),this.b.copy(t),this.c.copy(s),this}setFromPointsAndIndices(e,t,s,i){return this.a.copy(e[t]),this.b.copy(e[s]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,s,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,s),this.c.fromBufferAttribute(e,i),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 xs.subVectors(this.c,this.b),_i.subVectors(this.a,this.b),xs.cross(_i).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Rs.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Rs.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,s,i,r){return Fc===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Fc=!0),Rs.getInterpolation(e,this.a,this.b,this.c,t,s,i,r)}getInterpolation(e,t,s,i,r){return Rs.getInterpolation(e,this.a,this.b,this.c,t,s,i,r)}containsPoint(e){return Rs.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Rs.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const s=this.a,i=this.b,r=this.c;let o,a;vo.subVectors(i,s),So.subVectors(r,s),Om.subVectors(e,s);const l=vo.dot(Om),u=So.dot(Om);if(l<=0&&u<=0)return t.copy(s);Im.subVectors(e,i);const d=vo.dot(Im),h=So.dot(Im);if(d>=0&&h<=d)return t.copy(i);const f=l*h-d*u;if(f<=0&&l>=0&&d<=0)return o=l/(l-d),t.copy(s).addScaledVector(vo,o);Mm.subVectors(e,r);const _=vo.dot(Mm),m=So.dot(Mm);if(m>=0&&_<=m)return t.copy(r);const E=_*u-l*m;if(E<=0&&u>=0&&m<=0)return a=u/(u-m),t.copy(s).addScaledVector(So,a);const b=d*m-_*h;if(b<=0&&h-d>=0&&_-m>=0)return XC.subVectors(r,i),a=(h-d)/(h-d+(_-m)),t.copy(i).addScaledVector(XC,a);const g=1/(b+E+f);return o=E*g,a=f*g,t.copy(s).addScaledVector(vo,o).addScaledVector(So,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const gO={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},qi={h:0,s:0,l:0},Bc={h:0,s:0,l:0};function Dm(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class ut{constructor(e,t,s){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,s)}set(e,t,s){if(t===void 0&&s===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,s);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=en){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Ut.toWorkingColorSpace(this,t),this}setRGB(e,t,s,i=Ut.workingColorSpace){return this.r=e,this.g=t,this.b=s,Ut.toWorkingColorSpace(this,i),this}setHSL(e,t,s,i=Ut.workingColorSpace){if(e=RE(e,1),t=Nn(t,0,1),s=Nn(s,0,1),t===0)this.r=this.g=this.b=s;else{const r=s<=.5?s*(1+t):s+t-s*t,o=2*s-r;this.r=Dm(o,r,e+1/3),this.g=Dm(o,r,e),this.b=Dm(o,r,e-1/3)}return Ut.toWorkingColorSpace(this,i),this}setStyle(e,t=en){function s(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const o=i[1],a=i[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 s(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return s(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return s(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=i[1],o=r.length;if(o===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(r,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=en){const s=gO[e.toLowerCase()];return s!==void 0?this.setHex(s,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=$o(e.r),this.g=$o(e.g),this.b=$o(e.b),this}copyLinearToSRGB(e){return this.r=vm(e.r),this.g=vm(e.g),this.b=vm(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=en){return Ut.fromWorkingColorSpace(Rn.copy(this),e),Math.round(Nn(Rn.r*255,0,255))*65536+Math.round(Nn(Rn.g*255,0,255))*256+Math.round(Nn(Rn.b*255,0,255))}getHexString(e=en){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Ut.workingColorSpace){Ut.fromWorkingColorSpace(Rn.copy(this),t);const s=Rn.r,i=Rn.g,r=Rn.b,o=Math.max(s,i,r),a=Math.min(s,i,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 s:l=(i-r)/h+(i0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const s=e[t];if(s===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(s):i&&i.isVector3&&s&&s.isVector3?i.copy(s):this[t]=s}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const s={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};s.uuid=this.uuid,s.type=this.type,this.name!==""&&(s.name=this.name),this.color&&this.color.isColor&&(s.color=this.color.getHex()),this.roughness!==void 0&&(s.roughness=this.roughness),this.metalness!==void 0&&(s.metalness=this.metalness),this.sheen!==void 0&&(s.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(s.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(s.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(s.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(s.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(s.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(s.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(s.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(s.shininess=this.shininess),this.clearcoat!==void 0&&(s.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(s.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(s.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(s.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(s.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,s.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(s.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(s.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(s.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(s.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(s.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(s.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(s.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(s.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(s.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(s.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(s.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(s.lightMap=this.lightMap.toJSON(e).uuid,s.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(s.aoMap=this.aoMap.toJSON(e).uuid,s.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(s.bumpMap=this.bumpMap.toJSON(e).uuid,s.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(s.normalMap=this.normalMap.toJSON(e).uuid,s.normalMapType=this.normalMapType,s.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(s.displacementMap=this.displacementMap.toJSON(e).uuid,s.displacementScale=this.displacementScale,s.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(s.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(s.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(s.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(s.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(s.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(s.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(s.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(s.combine=this.combine)),this.envMapIntensity!==void 0&&(s.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(s.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(s.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(s.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(s.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(s.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(s.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(s.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(s.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(s.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(s.size=this.size),this.shadowSide!==null&&(s.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(s.sizeAttenuation=this.sizeAttenuation),this.blending!==Yo&&(s.blending=this.blending),this.side!==Oi&&(s.side=this.side),this.vertexColors===!0&&(s.vertexColors=!0),this.opacity<1&&(s.opacity=this.opacity),this.transparent===!0&&(s.transparent=!0),this.blendSrc!==kg&&(s.blendSrc=this.blendSrc),this.blendDst!==Lg&&(s.blendDst=this.blendDst),this.blendEquation!==kr&&(s.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(s.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(s.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(s.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(s.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(s.blendAlpha=this.blendAlpha),this.depthFunc!==$d&&(s.depthFunc=this.depthFunc),this.depthTest===!1&&(s.depthTest=this.depthTest),this.depthWrite===!1&&(s.depthWrite=this.depthWrite),this.colorWrite===!1&&(s.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(s.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==FC&&(s.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(s.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(s.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ho&&(s.stencilFail=this.stencilFail),this.stencilZFail!==ho&&(s.stencilZFail=this.stencilZFail),this.stencilZPass!==ho&&(s.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(s.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(s.rotation=this.rotation),this.polygonOffset===!0&&(s.polygonOffset=!0),this.polygonOffsetFactor!==0&&(s.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(s.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(s.linewidth=this.linewidth),this.dashSize!==void 0&&(s.dashSize=this.dashSize),this.gapSize!==void 0&&(s.gapSize=this.gapSize),this.scale!==void 0&&(s.scale=this.scale),this.dithering===!0&&(s.dithering=!0),this.alphaTest>0&&(s.alphaTest=this.alphaTest),this.alphaHash===!0&&(s.alphaHash=!0),this.alphaToCoverage===!0&&(s.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(s.premultipliedAlpha=!0),this.forceSinglePass===!0&&(s.forceSinglePass=!0),this.wireframe===!0&&(s.wireframe=!0),this.wireframeLinewidth>1&&(s.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(s.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(s.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(s.flatShading=!0),this.visible===!1&&(s.visible=!1),this.toneMapped===!1&&(s.toneMapped=!1),this.fog===!1&&(s.fog=!1),Object.keys(this.userData).length>0&&(s.userData=this.userData);function i(r){const o=[];for(const a in r){const l=r[a];delete l.metadata,o.push(l)}return o}if(t){const r=i(e.textures),o=i(e.images);r.length>0&&(s.textures=r),o.length>0&&(s.images=o)}return s}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let s=null;if(t!==null){const i=t.length;s=new Array(i);for(let r=0;r!==i;++r)s[r]=t[r].clone()}return this.clippingPlanes=s,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 ir extends ks{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ut(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=TE,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 on=new ie,Gc=new Rt;class Bn{constructor(e,t,s=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=s,this.usage=Gg,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=vi,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return console.warn('THREE.BufferAttribute: "updateRange" is deprecated and removed in r169. Use "addUpdateRange()" instead.'),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,s){e*=this.itemSize,s*=t.itemSize;for(let i=0,r=this.itemSize;i0&&(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 t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const s=this.attributes;for(const l in s){const u=s[l];e.data.attributes[l]=u.toJSON(e.data)}const i={};let r=!1;for(const l in this.morphAttributes){const u=this.morphAttributes[l],d=[];for(let h=0,f=u.length;h0&&(i[l]=d,r=!0)}r&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const s=e.index;s!==null&&this.setIndex(s.clone(t));const i=e.attributes;for(const u in i){const d=i[u];this.setAttribute(u,d.clone(t))}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(t));this.morphAttributes[u]=d}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let u=0,d=o.length;u0){const i=t[s[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=i.length;r(e.far-e.near)**2))&&(ZC.copy(r).invert(),xr.copy(e.ray).applyMatrix4(ZC),!(s.boundingBox!==null&&xr.intersectsBox(s.boundingBox)===!1)&&this._computeIntersections(e,t,xr)))}_computeIntersections(e,t,s){let i;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;mt.far?null:{distance:u,point:Wc.clone(),object:n}}function Kc(n,e,t,s,i,r,o,a,l,u){n.getVertexPosition(a,xo),n.getVertexPosition(l,Co),n.getVertexPosition(u,wo);const d=jwt(n,e,t,s,xo,Co,wo,$c);if(d){i&&(Hc.fromBufferAttribute(i,a),qc.fromBufferAttribute(i,l),Yc.fromBufferAttribute(i,u),d.uv=Rs.getInterpolation($c,xo,Co,wo,Hc,qc,Yc,new Rt)),r&&(Hc.fromBufferAttribute(r,a),qc.fromBufferAttribute(r,l),Yc.fromBufferAttribute(r,u),d.uv1=Rs.getInterpolation($c,xo,Co,wo,Hc,qc,Yc,new Rt),d.uv2=d.uv1),o&&(e1.fromBufferAttribute(o,a),t1.fromBufferAttribute(o,l),n1.fromBufferAttribute(o,u),d.normal=Rs.getInterpolation($c,xo,Co,wo,e1,t1,n1,new ie),d.normal.dot(s.direction)>0&&d.normal.multiplyScalar(-1));const h={a,b:l,c:u,normal:new ie,materialIndex:0};Rs.getNormal(xo,Co,wo,h.normal),d.face=h}return d}class dr extends ri{constructor(e=1,t=1,s=1,i=1,r=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:s,widthSegments:i,heightSegments:r,depthSegments:o};const a=this;i=Math.floor(i),r=Math.floor(r),o=Math.floor(o);const l=[],u=[],d=[],h=[];let f=0,_=0;m("z","y","x",-1,-1,s,t,e,o,r,0),m("z","y","x",1,-1,s,t,-e,o,r,1),m("x","z","y",1,1,e,s,t,i,o,2),m("x","z","y",1,-1,e,s,-t,i,o,3),m("x","y","z",1,-1,e,t,s,i,r,4),m("x","y","z",-1,-1,e,t,-s,i,r,5),this.setIndex(l),this.setAttribute("position",new xi(u,3)),this.setAttribute("normal",new xi(d,3)),this.setAttribute("uv",new xi(h,2));function m(E,b,g,y,v,S,w,x,A,D,T){const O=S/A,F=w/D,z=S/2,Z=w/2,M=x/2,q=A+1,H=D+1;let P=0,$=0;const J=new ie;for(let re=0;re0?1:-1,d.push(J.x,J.y,J.z),h.push(Se/A),h.push(1-re/D),P+=1}}for(let re=0;re>8&255]+wn[n>>16&255]+wn[n>>24&255]+"-"+wn[e&255]+wn[e>>8&255]+"-"+wn[e>>16&15|64]+wn[e>>24&255]+"-"+wn[t&63|128]+wn[t>>8&255]+"-"+wn[t>>16&255]+wn[t>>24&255]+wn[s&255]+wn[s>>8&255]+wn[s>>16&255]+wn[s>>24&255]).toLowerCase()}function Nn(n,e,t){return Math.max(e,Math.min(t,n))}function RE(n,e){return(n%e+e)%e}function Ewt(n,e,t,s,i){return s+(n-e)*(i-s)/(t-e)}function ywt(n,e,t){return n!==e?(t-n)/(e-n):0}function gl(n,e,t){return(1-t)*n+t*e}function vwt(n,e,t,s){return gl(n,e,1-Math.exp(-t*s))}function Swt(n,e=1){return e-Math.abs(RE(n,e*2)-e)}function Twt(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function xwt(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function Cwt(n,e){return n+Math.floor(Math.random()*(e-n+1))}function wwt(n,e){return n+Math.random()*(e-n)}function Rwt(n){return n*(.5-Math.random())}function Awt(n){n!==void 0&&(GC=n);let e=GC+=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 Nwt(n){return n*ml}function Owt(n){return n*pa}function zg(n){return(n&n-1)===0&&n!==0}function Iwt(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function Zd(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function Mwt(n,e,t,s,i){const r=Math.cos,o=Math.sin,a=r(t/2),l=o(t/2),u=r((e+s)/2),d=o((e+s)/2),h=r((e-s)/2),f=o((e-s)/2),_=r((s-e)/2),m=o((s-e)/2);switch(i){case"XYX":n.set(a*d,l*h,l*f,a*u);break;case"YZY":n.set(l*f,a*d,l*h,a*u);break;case"ZXZ":n.set(l*h,l*f,a*d,a*u);break;case"XZX":n.set(a*d,l*m,l*_,a*u);break;case"YXY":n.set(l*_,a*d,l*m,a*u);break;case"ZYZ":n.set(l*m,l*_,a*d,a*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Ys(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Vt(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const Dwt={DEG2RAD:ml,RAD2DEG:pa,generateUUID:Ds,clamp:Nn,euclideanModulo:RE,mapLinear:Ewt,inverseLerp:ywt,lerp:gl,damp:vwt,pingpong:Swt,smoothstep:Twt,smootherstep:xwt,randInt:Cwt,randFloat:wwt,randFloatSpread:Rwt,seededRandom:Awt,degToRad:Nwt,radToDeg:Owt,isPowerOfTwo:zg,ceilPowerOfTwo:Iwt,floorPowerOfTwo:Zd,setQuaternionFromProperEuler:Mwt,normalize:Vt,denormalize:Ys};class Rt{constructor(e=0,t=0){Rt.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,s=this.y,i=e.elements;return this.x=i[0]*t+i[3]*s+i[6],this.y=i[1]*t+i[4]*s+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(e,Math.min(t,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const s=this.dot(e)/t;return Math.acos(Nn(s,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,s=this.y-e.y;return t*t+s*s}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,s){return this.x=e.x+(t.x-e.x)*s,this.y=e.y+(t.y-e.y)*s,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const s=Math.cos(t),i=Math.sin(t),r=this.x-e.x,o=this.y-e.y;return this.x=r*s-o*i+e.x,this.y=r*i+o*s+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Tt{constructor(e,t,s,i,r,o,a,l,u){Tt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,s,i,r,o,a,l,u)}set(e,t,s,i,r,o,a,l,u){const d=this.elements;return d[0]=e,d[1]=i,d[2]=a,d[3]=t,d[4]=r,d[5]=l,d[6]=s,d[7]=o,d[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,s=e.elements;return t[0]=s[0],t[1]=s[1],t[2]=s[2],t[3]=s[3],t[4]=s[4],t[5]=s[5],t[6]=s[6],t[7]=s[7],t[8]=s[8],this}extractBasis(e,t,s){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),s.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const s=e.elements,i=t.elements,r=this.elements,o=s[0],a=s[3],l=s[6],u=s[1],d=s[4],h=s[7],f=s[2],_=s[5],m=s[8],E=i[0],b=i[3],g=i[6],y=i[1],v=i[4],S=i[7],w=i[2],x=i[5],A=i[8];return r[0]=o*E+a*y+l*w,r[3]=o*b+a*v+l*x,r[6]=o*g+a*S+l*A,r[1]=u*E+d*y+h*w,r[4]=u*b+d*v+h*x,r[7]=u*g+d*S+h*A,r[2]=f*E+_*y+m*w,r[5]=f*b+_*v+m*x,r[8]=f*g+_*S+m*A,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],s=e[1],i=e[2],r=e[3],o=e[4],a=e[5],l=e[6],u=e[7],d=e[8];return t*o*d-t*a*u-s*r*d+s*a*l+i*r*u-i*o*l}invert(){const e=this.elements,t=e[0],s=e[1],i=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=t*h+s*f+i*_;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]=(i*u-d*s)*E,e[2]=(a*s-i*o)*E,e[3]=f*E,e[4]=(d*t-i*l)*E,e[5]=(i*r-a*t)*E,e[6]=_*E,e[7]=(s*l-u*t)*E,e[8]=(o*t-s*r)*E,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,s,i,r,o,a){const l=Math.cos(r),u=Math.sin(r);return this.set(s*l,s*u,-s*(l*o+u*a)+o+e,-i*u,i*l,-i*(-u*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(ym.makeScale(e,t)),this}rotate(e){return this.premultiply(ym.makeRotation(-e)),this}translate(e,t){return this.premultiply(ym.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),s=Math.sin(e);return this.set(t,-s,0,s,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,s=e.elements;for(let i=0;i<9;i++)if(t[i]!==s[i])return!1;return!0}fromArray(e,t=0){for(let s=0;s<9;s++)this.elements[s]=e[s+t];return this}toArray(e=[],t=0){const s=this.elements;return e[t]=s[0],e[t+1]=s[1],e[t+2]=s[2],e[t+3]=s[3],e[t+4]=s[4],e[t+5]=s[5],e[t+6]=s[6],e[t+7]=s[7],e[t+8]=s[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const ym=new Tt;function pO(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}function Gl(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function kwt(){const n=Gl("canvas");return n.style.display="block",n}const VC={};function bl(n){n in VC||(VC[n]=!0,console.warn(n))}const zC=new Tt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),HC=new Tt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Oc={[Cn]:{transfer:Kd,primaries:jd,toReference:n=>n,fromReference:n=>n},[en]:{transfer:Wt,primaries:jd,toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[Hu]:{transfer:Kd,primaries:Qd,toReference:n=>n.applyMatrix3(HC),fromReference:n=>n.applyMatrix3(zC)},[wE]:{transfer:Wt,primaries:Qd,toReference:n=>n.convertSRGBToLinear().applyMatrix3(HC),fromReference:n=>n.applyMatrix3(zC).convertLinearToSRGB()}},Lwt=new Set([Cn,Hu]),Ut={enabled:!0,_workingColorSpace:Cn,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(n){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!n},get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!Lwt.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,e,t){if(this.enabled===!1||e===t||!e||!t)return n;const s=Oc[e].toReference,i=Oc[t].fromReference;return i(s(n))},fromWorkingColorSpace:function(n,e){return this.convert(n,this._workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this._workingColorSpace)},getPrimaries:function(n){return Oc[n].primaries},getTransfer:function(n){return n===cs?Kd:Oc[n].transfer}};function $o(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function vm(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let fo;class _O{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{fo===void 0&&(fo=Gl("canvas")),fo.width=e.width,fo.height=e.height;const s=fo.getContext("2d");e instanceof ImageData?s.putImageData(e,0,0):s.drawImage(e,0,0,e.width,e.height),t=fo}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Gl("canvas");t.width=e.width,t.height=e.height;const s=t.getContext("2d");s.drawImage(e,0,0,e.width,e.height);const i=s.getImageData(0,0,e.width,e.height),r=i.data;for(let o=0;o0&&(s.userData=this.userData),t||(e.textures[this.uuid]=s),s}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==eO)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 as:e.x=e.x<0?0:1;break;case Wd: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 as:e.y=e.y<0?0:1;break;case Wd: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===en?Yr:dO}set encoding(e){bl("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===Yr?en:cs}}xn.DEFAULT_IMAGE=null;xn.DEFAULT_MAPPING=eO;xn.DEFAULT_ANISOTROPY=1;class Yt{constructor(e=0,t=0,s=0,i=1){Yt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=s,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,s,i){return this.x=e,this.y=t,this.z=s,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,s=this.y,i=this.z,r=this.w,o=e.elements;return this.x=o[0]*t+o[4]*s+o[8]*i+o[12]*r,this.y=o[1]*t+o[5]*s+o[9]*i+o[13]*r,this.z=o[2]*t+o[6]*s+o[10]*i+o[14]*r,this.w=o[3]*t+o[7]*s+o[11]*i+o[15]*r,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,s,i,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;t=Math.PI;const v=(u+1)/2,S=(_+1)/2,w=(g+1)/2,x=(d+f)/4,A=(h+E)/4,D=(m+b)/4;return v>S&&v>w?v<.01?(s=0,i=.707106781,r=.707106781):(s=Math.sqrt(v),i=x/s,r=A/s):S>w?S<.01?(s=.707106781,i=0,r=.707106781):(i=Math.sqrt(S),s=x/i,r=D/i):w<.01?(s=.707106781,i=.707106781,r=0):(r=Math.sqrt(w),s=A/r,i=D/r),this.set(s,i,r,t),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,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(e,Math.min(t,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,s){return this.x=e.x+(t.x-e.x)*s,this.y=e.y+(t.y-e.y)*s,this.z=e.z+(t.z-e.z)*s,this.w=e.w+(t.w-e.w)*s,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Fwt extends Ma{constructor(e=1,t=1,s={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Yt(0,0,e,t),this.scissorTest=!1,this.viewport=new Yt(0,0,e,t);const i={width:e,height:t,depth:1};s.encoding!==void 0&&(bl("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),s.colorSpace=s.encoding===Yr?en:cs),s=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:zn,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},s),this.texture=new xn(i,s.mapping,s.wrapS,s.wrapT,s.magFilter,s.minFilter,s.format,s.type,s.anisotropy,s.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=s.generateMipmaps,this.texture.internalFormat=s.internalFormat,this.depthBuffer=s.depthBuffer,this.stencilBuffer=s.stencilBuffer,this.depthTexture=s.depthTexture,this.samples=s.samples}setSize(e,t,s=1){(this.width!==e||this.height!==t||this.depth!==s)&&(this.width=e,this.height=t,this.depth=s,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=s,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new hO(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Zr extends Fwt{constructor(e=1,t=1,s={}){super(e,t,s),this.isWebGLRenderTarget=!0}}class fO extends xn{constructor(e=null,t=1,s=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:s,depth:i},this.magFilter=mn,this.minFilter=mn,this.wrapR=as,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Bwt extends xn{constructor(e=null,t=1,s=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:s,depth:i},this.magFilter=mn,this.minFilter=mn,this.wrapR=as,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class mr{constructor(e=0,t=0,s=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=s,this._w=i}static slerpFlat(e,t,s,i,r,o,a){let l=s[i+0],u=s[i+1],d=s[i+2],h=s[i+3];const f=r[o+0],_=r[o+1],m=r[o+2],E=r[o+3];if(a===0){e[t+0]=l,e[t+1]=u,e[t+2]=d,e[t+3]=h;return}if(a===1){e[t+0]=f,e[t+1]=_,e[t+2]=m,e[t+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 w=Math.sqrt(v),x=Math.atan2(w,g*y);b=Math.sin(b*x)/w,a=Math.sin(a*x)/w}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 w=1/Math.sqrt(l*l+u*u+d*d+h*h);l*=w,u*=w,d*=w,h*=w}}e[t]=l,e[t+1]=u,e[t+2]=d,e[t+3]=h}static multiplyQuaternionsFlat(e,t,s,i,r,o){const a=s[i],l=s[i+1],u=s[i+2],d=s[i+3],h=r[o],f=r[o+1],_=r[o+2],m=r[o+3];return e[t]=a*m+d*h+l*_-u*f,e[t+1]=l*m+d*f+u*h-a*_,e[t+2]=u*m+d*_+a*f-l*h,e[t+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,t,s,i){return this._x=e,this._y=t,this._z=s,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){const s=e._x,i=e._y,r=e._z,o=e._order,a=Math.cos,l=Math.sin,u=a(s/2),d=a(i/2),h=a(r/2),f=l(s/2),_=l(i/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 t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const s=t/2,i=Math.sin(s);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(s),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,s=t[0],i=t[4],r=t[8],o=t[1],a=t[5],l=t[9],u=t[2],d=t[6],h=t[10],f=s+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-i)*_}else if(s>a&&s>h){const _=2*Math.sqrt(1+s-a-h);this._w=(d-l)/_,this._x=.25*_,this._y=(i+o)/_,this._z=(r+u)/_}else if(a>h){const _=2*Math.sqrt(1+a-s-h);this._w=(r-u)/_,this._x=(i+o)/_,this._y=.25*_,this._z=(l+d)/_}else{const _=2*Math.sqrt(1+h-s-a);this._w=(o-i)/_,this._x=(r+u)/_,this._y=(l+d)/_,this._z=.25*_}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let s=e.dot(t)+1;return sMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=s):(this._x=0,this._y=-e.z,this._z=e.y,this._w=s)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=s),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Nn(this.dot(e),-1,1)))}rotateTowards(e,t){const s=this.angleTo(e);if(s===0)return this;const i=Math.min(1,t/s);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const s=e._x,i=e._y,r=e._z,o=e._w,a=t._x,l=t._y,u=t._z,d=t._w;return this._x=s*d+o*a+i*u-r*l,this._y=i*d+o*l+r*a-s*u,this._z=r*d+o*u+s*l-i*a,this._w=o*d-s*a-i*l-r*u,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const s=this._x,i=this._y,r=this._z,o=this._w;let a=o*e._w+s*e._x+i*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=s,this._y=i,this._z=r,this;const l=1-a*a;if(l<=Number.EPSILON){const _=1-t;return this._w=_*o+t*this._w,this._x=_*s+t*this._x,this._y=_*i+t*this._y,this._z=_*r+t*this._z,this.normalize(),this._onChangeCallback(),this}const u=Math.sqrt(l),d=Math.atan2(u,a),h=Math.sin((1-t)*d)/u,f=Math.sin(t*d)/u;return this._w=o*h+this._w*f,this._x=s*h+this._x*f,this._y=i*h+this._y*f,this._z=r*h+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,t,s){return this.copy(e).slerp(t,s)}random(){const e=Math.random(),t=Math.sqrt(1-e),s=Math.sqrt(e),i=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(t*Math.cos(i),s*Math.sin(r),s*Math.cos(r),t*Math.sin(i))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class ie{constructor(e=0,t=0,s=0){ie.prototype.isVector3=!0,this.x=e,this.y=t,this.z=s}set(e,t,s){return s===void 0&&(s=this.z),this.x=e,this.y=t,this.z=s,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(qC.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(qC.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,s=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[3]*s+r[6]*i,this.y=r[1]*t+r[4]*s+r[7]*i,this.z=r[2]*t+r[5]*s+r[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,s=this.y,i=this.z,r=e.elements,o=1/(r[3]*t+r[7]*s+r[11]*i+r[15]);return this.x=(r[0]*t+r[4]*s+r[8]*i+r[12])*o,this.y=(r[1]*t+r[5]*s+r[9]*i+r[13])*o,this.z=(r[2]*t+r[6]*s+r[10]*i+r[14])*o,this}applyQuaternion(e){const t=this.x,s=this.y,i=this.z,r=e.x,o=e.y,a=e.z,l=e.w,u=2*(o*i-a*s),d=2*(a*t-r*i),h=2*(r*s-o*t);return this.x=t+l*u+o*h-a*d,this.y=s+l*d+a*u-r*h,this.z=i+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 t=this.x,s=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[4]*s+r[8]*i,this.y=r[1]*t+r[5]*s+r[9]*i,this.z=r[2]*t+r[6]*s+r[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(e,Math.min(t,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,s){return this.x=e.x+(t.x-e.x)*s,this.y=e.y+(t.y-e.y)*s,this.z=e.z+(t.z-e.z)*s,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const s=e.x,i=e.y,r=e.z,o=t.x,a=t.y,l=t.z;return this.x=i*l-r*a,this.y=r*o-s*l,this.z=s*a-i*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const s=e.dot(this)/t;return this.copy(e).multiplyScalar(s)}projectOnPlane(e){return Tm.copy(this).projectOnVector(e),this.sub(Tm)}reflect(e){return this.sub(Tm.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const s=this.dot(e)/t;return Math.acos(Nn(s,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,s=this.y-e.y,i=this.z-e.z;return t*t+s*s+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,s){const i=Math.sin(t)*e;return this.x=i*Math.sin(s),this.y=Math.cos(t)*e,this.z=i*Math.cos(s),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,s){return this.x=e*Math.sin(t),this.y=s,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),s=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=s,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,t=Math.random()*Math.PI*2,s=Math.sqrt(1-e**2);return this.x=s*Math.cos(t),this.y=s*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Tm=new ie,qC=new mr;class ki{constructor(e=new ie(1/0,1/0,1/0),t=new ie(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,s=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Ss),Ss.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,s;return e.normal.x>0?(t=e.normal.x*this.min.x,s=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,s=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,s+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,s+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,s+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,s+=e.normal.z*this.min.z),t<=-e.constant&&s>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Ka),Mc.subVectors(this.max,Ka),mo.subVectors(e.a,Ka),go.subVectors(e.b,Ka),bo.subVectors(e.c,Ka),Gi.subVectors(go,mo),Vi.subVectors(bo,go),Sr.subVectors(mo,bo);let t=[0,-Gi.z,Gi.y,0,-Vi.z,Vi.y,0,-Sr.z,Sr.y,Gi.z,0,-Gi.x,Vi.z,0,-Vi.x,Sr.z,0,-Sr.x,-Gi.y,Gi.x,0,-Vi.y,Vi.x,0,-Sr.y,Sr.x,0];return!xm(t,mo,go,bo,Mc)||(t=[1,0,0,0,1,0,0,0,1],!xm(t,mo,go,bo,Mc))?!1:(Dc.crossVectors(Gi,Vi),t=[Dc.x,Dc.y,Dc.z],xm(t,mo,go,bo,Mc))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Ss).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Ss).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:(di[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),di[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),di[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),di[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),di[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),di[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),di[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),di[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(di),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 di=[new ie,new ie,new ie,new ie,new ie,new ie,new ie,new ie],Ss=new ie,Ic=new ki,mo=new ie,go=new ie,bo=new ie,Gi=new ie,Vi=new ie,Sr=new ie,Ka=new ie,Mc=new ie,Dc=new ie,Tr=new ie;function xm(n,e,t,s,i){for(let r=0,o=n.length-3;r<=o;r+=3){Tr.fromArray(n,r);const a=i.x*Math.abs(Tr.x)+i.y*Math.abs(Tr.y)+i.z*Math.abs(Tr.z),l=e.dot(Tr),u=t.dot(Tr),d=s.dot(Tr);if(Math.max(-Math.max(l,u,d),Math.min(l,u,d))>a)return!1}return!0}const Gwt=new ki,ja=new ie,Cm=new ie;class ii{constructor(e=new ie,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const s=this.center;t!==void 0?s.copy(t):Gwt.setFromPoints(e).getCenter(s);let i=0;for(let r=0,o=e.length;rthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;ja.subVectors(e,this.center);const t=ja.lengthSq();if(t>this.radius*this.radius){const s=Math.sqrt(t),i=(s-this.radius)*.5;this.center.addScaledVector(ja,i/s),this.radius+=i}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):(Cm.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(ja.copy(e.center).add(Cm)),this.expandByPoint(ja.copy(e.center).sub(Cm))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const ui=new ie,wm=new ie,kc=new ie,zi=new ie,Rm=new ie,Lc=new ie,Am=new ie;class qu{constructor(e=new ie,t=new ie(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,ui)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const s=t.dot(this.direction);return s<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,s)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=ui.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(ui.copy(this.origin).addScaledVector(this.direction,t),ui.distanceToSquared(e))}distanceSqToSegment(e,t,s,i){wm.copy(e).add(t).multiplyScalar(.5),kc.copy(t).sub(e).normalize(),zi.copy(this.origin).sub(wm);const r=e.distanceTo(t)*.5,o=-this.direction.dot(kc),a=zi.dot(this.direction),l=-zi.dot(kc),u=zi.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 s&&s.copy(this.origin).addScaledVector(this.direction,h),i&&i.copy(wm).addScaledVector(kc,f),_}intersectSphere(e,t){ui.subVectors(e.center,this.origin);const s=ui.dot(this.direction),i=ui.dot(ui)-s*s,r=e.radius*e.radius;if(i>r)return null;const o=Math.sqrt(r-i),a=s-o,l=s+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const s=-(this.origin.dot(e.normal)+e.constant)/t;return s>=0?s:null}intersectPlane(e,t){const s=this.distanceToPlane(e);return s===null?null:this.at(s,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let s,i,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?(s=(e.min.x-f.x)*u,i=(e.max.x-f.x)*u):(s=(e.max.x-f.x)*u,i=(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),s>o||r>i||((r>s||isNaN(s))&&(s=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),s>l||a>i)||((a>s||s!==s)&&(s=a),(l=0?s:i,t)}intersectsBox(e){return this.intersectBox(e,ui)!==null}intersectTriangle(e,t,s,i,r){Rm.subVectors(t,e),Lc.subVectors(s,e),Am.crossVectors(Rm,Lc);let o=this.direction.dot(Am),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;zi.subVectors(this.origin,e);const l=a*this.direction.dot(Lc.crossVectors(zi,Lc));if(l<0)return null;const u=a*this.direction.dot(Rm.cross(zi));if(u<0||l+u>o)return null;const d=-a*zi.dot(Am);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 xt{constructor(e,t,s,i,r,o,a,l,u,d,h,f,_,m,E,b){xt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,s,i,r,o,a,l,u,d,h,f,_,m,E,b)}set(e,t,s,i,r,o,a,l,u,d,h,f,_,m,E,b){const g=this.elements;return g[0]=e,g[4]=t,g[8]=s,g[12]=i,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 xt().fromArray(this.elements)}copy(e){const t=this.elements,s=e.elements;return t[0]=s[0],t[1]=s[1],t[2]=s[2],t[3]=s[3],t[4]=s[4],t[5]=s[5],t[6]=s[6],t[7]=s[7],t[8]=s[8],t[9]=s[9],t[10]=s[10],t[11]=s[11],t[12]=s[12],t[13]=s[13],t[14]=s[14],t[15]=s[15],this}copyPosition(e){const t=this.elements,s=e.elements;return t[12]=s[12],t[13]=s[13],t[14]=s[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,s){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),s.setFromMatrixColumn(this,2),this}makeBasis(e,t,s){return this.set(e.x,t.x,s.x,0,e.y,t.y,s.y,0,e.z,t.z,s.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,s=e.elements,i=1/Eo.setFromMatrixColumn(e,0).length(),r=1/Eo.setFromMatrixColumn(e,1).length(),o=1/Eo.setFromMatrixColumn(e,2).length();return t[0]=s[0]*i,t[1]=s[1]*i,t[2]=s[2]*i,t[3]=0,t[4]=s[4]*r,t[5]=s[5]*r,t[6]=s[6]*r,t[7]=0,t[8]=s[8]*o,t[9]=s[9]*o,t[10]=s[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,s=e.x,i=e.y,r=e.z,o=Math.cos(s),a=Math.sin(s),l=Math.cos(i),u=Math.sin(i),d=Math.cos(r),h=Math.sin(r);if(e.order==="XYZ"){const f=o*d,_=o*h,m=a*d,E=a*h;t[0]=l*d,t[4]=-l*h,t[8]=u,t[1]=_+m*u,t[5]=f-E*u,t[9]=-a*l,t[2]=E-f*u,t[6]=m+_*u,t[10]=o*l}else if(e.order==="YXZ"){const f=l*d,_=l*h,m=u*d,E=u*h;t[0]=f+E*a,t[4]=m*a-_,t[8]=o*u,t[1]=o*h,t[5]=o*d,t[9]=-a,t[2]=_*a-m,t[6]=E+f*a,t[10]=o*l}else if(e.order==="ZXY"){const f=l*d,_=l*h,m=u*d,E=u*h;t[0]=f-E*a,t[4]=-o*h,t[8]=m+_*a,t[1]=_+m*a,t[5]=o*d,t[9]=E-f*a,t[2]=-o*u,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const f=o*d,_=o*h,m=a*d,E=a*h;t[0]=l*d,t[4]=m*u-_,t[8]=f*u+E,t[1]=l*h,t[5]=E*u+f,t[9]=_*u-m,t[2]=-u,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const f=o*l,_=o*u,m=a*l,E=a*u;t[0]=l*d,t[4]=E-f*h,t[8]=m*h+_,t[1]=h,t[5]=o*d,t[9]=-a*d,t[2]=-u*d,t[6]=_*h+m,t[10]=f-E*h}else if(e.order==="XZY"){const f=o*l,_=o*u,m=a*l,E=a*u;t[0]=l*d,t[4]=-h,t[8]=u*d,t[1]=f*h+E,t[5]=o*d,t[9]=_*h-m,t[2]=m*h-_,t[6]=a*d,t[10]=E*h+f}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Vwt,e,zwt)}lookAt(e,t,s){const i=this.elements;return jn.subVectors(e,t),jn.lengthSq()===0&&(jn.z=1),jn.normalize(),Hi.crossVectors(s,jn),Hi.lengthSq()===0&&(Math.abs(s.z)===1?jn.x+=1e-4:jn.z+=1e-4,jn.normalize(),Hi.crossVectors(s,jn)),Hi.normalize(),Pc.crossVectors(jn,Hi),i[0]=Hi.x,i[4]=Pc.x,i[8]=jn.x,i[1]=Hi.y,i[5]=Pc.y,i[9]=jn.y,i[2]=Hi.z,i[6]=Pc.z,i[10]=jn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const s=e.elements,i=t.elements,r=this.elements,o=s[0],a=s[4],l=s[8],u=s[12],d=s[1],h=s[5],f=s[9],_=s[13],m=s[2],E=s[6],b=s[10],g=s[14],y=s[3],v=s[7],S=s[11],w=s[15],x=i[0],A=i[4],D=i[8],T=i[12],O=i[1],F=i[5],z=i[9],Z=i[13],M=i[2],q=i[6],H=i[10],P=i[14],$=i[3],J=i[7],re=i[11],me=i[15];return r[0]=o*x+a*O+l*M+u*$,r[4]=o*A+a*F+l*q+u*J,r[8]=o*D+a*z+l*H+u*re,r[12]=o*T+a*Z+l*P+u*me,r[1]=d*x+h*O+f*M+_*$,r[5]=d*A+h*F+f*q+_*J,r[9]=d*D+h*z+f*H+_*re,r[13]=d*T+h*Z+f*P+_*me,r[2]=m*x+E*O+b*M+g*$,r[6]=m*A+E*F+b*q+g*J,r[10]=m*D+E*z+b*H+g*re,r[14]=m*T+E*Z+b*P+g*me,r[3]=y*x+v*O+S*M+w*$,r[7]=y*A+v*F+S*q+w*J,r[11]=y*D+v*z+S*H+w*re,r[15]=y*T+v*Z+S*P+w*me,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],s=e[4],i=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-i*u*h-r*a*f+s*u*f+i*a*_-s*l*_)+E*(+t*l*_-t*u*f+r*o*f-i*o*_+i*u*d-r*l*d)+b*(+t*u*h-t*a*_-r*o*h+s*o*_+r*a*d-s*u*d)+g*(-i*a*d-t*l*h+t*a*f+i*o*h-s*o*f+s*l*d)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,s){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=s),this}invert(){const e=this.elements,t=e[0],s=e[1],i=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,w=m*h*l-d*E*l-m*a*f+o*E*f+d*a*b-o*h*b,x=t*y+s*v+i*S+r*w;if(x===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const A=1/x;return e[0]=y*A,e[1]=(E*f*r-h*b*r-E*i*_+s*b*_+h*i*g-s*f*g)*A,e[2]=(a*b*r-E*l*r+E*i*u-s*b*u-a*i*g+s*l*g)*A,e[3]=(h*l*r-a*f*r-h*i*u+s*f*u+a*i*_-s*l*_)*A,e[4]=v*A,e[5]=(d*b*r-m*f*r+m*i*_-t*b*_-d*i*g+t*f*g)*A,e[6]=(m*l*r-o*b*r-m*i*u+t*b*u+o*i*g-t*l*g)*A,e[7]=(o*f*r-d*l*r+d*i*u-t*f*u-o*i*_+t*l*_)*A,e[8]=S*A,e[9]=(m*h*r-d*E*r-m*s*_+t*E*_+d*s*g-t*h*g)*A,e[10]=(o*E*r-m*a*r+m*s*u-t*E*u-o*s*g+t*a*g)*A,e[11]=(d*a*r-o*h*r-d*s*u+t*h*u+o*s*_-t*a*_)*A,e[12]=w*A,e[13]=(d*E*i-m*h*i+m*s*f-t*E*f-d*s*b+t*h*b)*A,e[14]=(m*a*i-o*E*i-m*s*l+t*E*l+o*s*b-t*a*b)*A,e[15]=(o*h*i-d*a*i+d*s*l-t*h*l-o*s*f+t*a*f)*A,this}scale(e){const t=this.elements,s=e.x,i=e.y,r=e.z;return t[0]*=s,t[4]*=i,t[8]*=r,t[1]*=s,t[5]*=i,t[9]*=r,t[2]*=s,t[6]*=i,t[10]*=r,t[3]*=s,t[7]*=i,t[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],s=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,s,i))}makeTranslation(e,t,s){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,s,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),s=Math.sin(e);return this.set(1,0,0,0,0,t,-s,0,0,s,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),s=Math.sin(e);return this.set(t,0,s,0,0,1,0,0,-s,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),s=Math.sin(e);return this.set(t,-s,0,0,s,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const s=Math.cos(t),i=Math.sin(t),r=1-s,o=e.x,a=e.y,l=e.z,u=r*o,d=r*a;return this.set(u*o+s,u*a-i*l,u*l+i*a,0,u*a+i*l,d*a+s,d*l-i*o,0,u*l-i*a,d*l+i*o,r*l*l+s,0,0,0,0,1),this}makeScale(e,t,s){return this.set(e,0,0,0,0,t,0,0,0,0,s,0,0,0,0,1),this}makeShear(e,t,s,i,r,o){return this.set(1,s,r,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,s){const i=this.elements,r=t._x,o=t._y,a=t._z,l=t._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,w=s.x,x=s.y,A=s.z;return i[0]=(1-(E+g))*w,i[1]=(_+S)*w,i[2]=(m-v)*w,i[3]=0,i[4]=(_-S)*x,i[5]=(1-(f+g))*x,i[6]=(b+y)*x,i[7]=0,i[8]=(m+v)*A,i[9]=(b-y)*A,i[10]=(1-(f+E))*A,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,s){const i=this.elements;let r=Eo.set(i[0],i[1],i[2]).length();const o=Eo.set(i[4],i[5],i[6]).length(),a=Eo.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),e.x=i[12],e.y=i[13],e.z=i[14],Ts.copy(this);const u=1/r,d=1/o,h=1/a;return Ts.elements[0]*=u,Ts.elements[1]*=u,Ts.elements[2]*=u,Ts.elements[4]*=d,Ts.elements[5]*=d,Ts.elements[6]*=d,Ts.elements[8]*=h,Ts.elements[9]*=h,Ts.elements[10]*=h,t.setFromRotationMatrix(Ts),s.x=r,s.y=o,s.z=a,this}makePerspective(e,t,s,i,r,o,a=Si){const l=this.elements,u=2*r/(t-e),d=2*r/(s-i),h=(t+e)/(t-e),f=(s+i)/(s-i);let _,m;if(a===Si)_=-(o+r)/(o-r),m=-2*o*r/(o-r);else if(a===Xd)_=-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,t,s,i,r,o,a=Si){const l=this.elements,u=1/(t-e),d=1/(s-i),h=1/(o-r),f=(t+e)*u,_=(s+i)*d;let m,E;if(a===Si)m=(o+r)*h,E=-2*h;else if(a===Xd)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 t=this.elements,s=e.elements;for(let i=0;i<16;i++)if(t[i]!==s[i])return!1;return!0}fromArray(e,t=0){for(let s=0;s<16;s++)this.elements[s]=e[s+t];return this}toArray(e=[],t=0){const s=this.elements;return e[t]=s[0],e[t+1]=s[1],e[t+2]=s[2],e[t+3]=s[3],e[t+4]=s[4],e[t+5]=s[5],e[t+6]=s[6],e[t+7]=s[7],e[t+8]=s[8],e[t+9]=s[9],e[t+10]=s[10],e[t+11]=s[11],e[t+12]=s[12],e[t+13]=s[13],e[t+14]=s[14],e[t+15]=s[15],e}}const Eo=new ie,Ts=new xt,Vwt=new ie(0,0,0),zwt=new ie(1,1,1),Hi=new ie,Pc=new ie,jn=new ie,YC=new xt,$C=new mr;class Yu{constructor(e=0,t=0,s=0,i=Yu.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=s,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,s,i=this._order){return this._x=e,this._y=t,this._z=s,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,s=!0){const i=e.elements,r=i[0],o=i[4],a=i[8],l=i[1],u=i[5],d=i[9],h=i[2],f=i[6],_=i[10];switch(t){case"XYZ":this._y=Math.asin(Nn(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(-Nn(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(Nn(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(-Nn(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(Nn(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(-Nn(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: "+t)}return this._order=t,s===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,s){return YC.makeRotationFromQuaternion(e),this.setFromRotationMatrix(YC,t,s)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return $C.setFromEuler(this),this.setFromQuaternion($C,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Yu.DEFAULT_ORDER="XYZ";class mO{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let s=0;s0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.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()})),i.maxGeometryCount=this._maxGeometryCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.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?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.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){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(s.geometries=a),l.length>0&&(s.materials=l),u.length>0&&(s.textures=u),d.length>0&&(s.images=d),h.length>0&&(s.shapes=h),f.length>0&&(s.skeletons=f),_.length>0&&(s.animations=_),m.length>0&&(s.nodes=m)}return s.object=i,s;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,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let s=0;s0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(e,t,s,i,r){xs.subVectors(i,t),_i.subVectors(s,t),Nm.subVectors(e,t);const o=xs.dot(xs),a=xs.dot(_i),l=xs.dot(Nm),u=_i.dot(_i),d=_i.dot(Nm),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,t,s,i){return this.getBarycoord(e,t,s,i,hi),hi.x>=0&&hi.y>=0&&hi.x+hi.y<=1}static getUV(e,t,s,i,r,o,a,l){return Fc===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Fc=!0),this.getInterpolation(e,t,s,i,r,o,a,l)}static getInterpolation(e,t,s,i,r,o,a,l){return this.getBarycoord(e,t,s,i,hi),l.setScalar(0),l.addScaledVector(r,hi.x),l.addScaledVector(o,hi.y),l.addScaledVector(a,hi.z),l}static isFrontFacing(e,t,s,i){return xs.subVectors(s,t),_i.subVectors(e,t),xs.cross(_i).dot(i)<0}set(e,t,s){return this.a.copy(e),this.b.copy(t),this.c.copy(s),this}setFromPointsAndIndices(e,t,s,i){return this.a.copy(e[t]),this.b.copy(e[s]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,s,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,s),this.c.fromBufferAttribute(e,i),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 xs.subVectors(this.c,this.b),_i.subVectors(this.a,this.b),xs.cross(_i).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Rs.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Rs.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,s,i,r){return Fc===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Fc=!0),Rs.getInterpolation(e,this.a,this.b,this.c,t,s,i,r)}getInterpolation(e,t,s,i,r){return Rs.getInterpolation(e,this.a,this.b,this.c,t,s,i,r)}containsPoint(e){return Rs.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Rs.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const s=this.a,i=this.b,r=this.c;let o,a;vo.subVectors(i,s),So.subVectors(r,s),Om.subVectors(e,s);const l=vo.dot(Om),u=So.dot(Om);if(l<=0&&u<=0)return t.copy(s);Im.subVectors(e,i);const d=vo.dot(Im),h=So.dot(Im);if(d>=0&&h<=d)return t.copy(i);const f=l*h-d*u;if(f<=0&&l>=0&&d<=0)return o=l/(l-d),t.copy(s).addScaledVector(vo,o);Mm.subVectors(e,r);const _=vo.dot(Mm),m=So.dot(Mm);if(m>=0&&_<=m)return t.copy(r);const E=_*u-l*m;if(E<=0&&u>=0&&m<=0)return a=u/(u-m),t.copy(s).addScaledVector(So,a);const b=d*m-_*h;if(b<=0&&h-d>=0&&_-m>=0)return XC.subVectors(r,i),a=(h-d)/(h-d+(_-m)),t.copy(i).addScaledVector(XC,a);const g=1/(b+E+f);return o=E*g,a=f*g,t.copy(s).addScaledVector(vo,o).addScaledVector(So,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const gO={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},qi={h:0,s:0,l:0},Bc={h:0,s:0,l:0};function Dm(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class ut{constructor(e,t,s){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,s)}set(e,t,s){if(t===void 0&&s===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,s);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=en){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Ut.toWorkingColorSpace(this,t),this}setRGB(e,t,s,i=Ut.workingColorSpace){return this.r=e,this.g=t,this.b=s,Ut.toWorkingColorSpace(this,i),this}setHSL(e,t,s,i=Ut.workingColorSpace){if(e=RE(e,1),t=Nn(t,0,1),s=Nn(s,0,1),t===0)this.r=this.g=this.b=s;else{const r=s<=.5?s*(1+t):s+t-s*t,o=2*s-r;this.r=Dm(o,r,e+1/3),this.g=Dm(o,r,e),this.b=Dm(o,r,e-1/3)}return Ut.toWorkingColorSpace(this,i),this}setStyle(e,t=en){function s(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const o=i[1],a=i[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 s(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return s(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return s(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=i[1],o=r.length;if(o===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(r,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=en){const s=gO[e.toLowerCase()];return s!==void 0?this.setHex(s,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=$o(e.r),this.g=$o(e.g),this.b=$o(e.b),this}copyLinearToSRGB(e){return this.r=vm(e.r),this.g=vm(e.g),this.b=vm(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=en){return Ut.fromWorkingColorSpace(Rn.copy(this),e),Math.round(Nn(Rn.r*255,0,255))*65536+Math.round(Nn(Rn.g*255,0,255))*256+Math.round(Nn(Rn.b*255,0,255))}getHexString(e=en){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Ut.workingColorSpace){Ut.fromWorkingColorSpace(Rn.copy(this),t);const s=Rn.r,i=Rn.g,r=Rn.b,o=Math.max(s,i,r),a=Math.min(s,i,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 s:l=(i-r)/h+(i0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const s=e[t];if(s===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(s):i&&i.isVector3&&s&&s.isVector3?i.copy(s):this[t]=s}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const s={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};s.uuid=this.uuid,s.type=this.type,this.name!==""&&(s.name=this.name),this.color&&this.color.isColor&&(s.color=this.color.getHex()),this.roughness!==void 0&&(s.roughness=this.roughness),this.metalness!==void 0&&(s.metalness=this.metalness),this.sheen!==void 0&&(s.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(s.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(s.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(s.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(s.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(s.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(s.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(s.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(s.shininess=this.shininess),this.clearcoat!==void 0&&(s.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(s.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(s.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(s.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(s.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,s.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(s.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(s.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(s.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(s.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(s.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(s.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(s.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(s.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(s.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(s.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(s.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(s.lightMap=this.lightMap.toJSON(e).uuid,s.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(s.aoMap=this.aoMap.toJSON(e).uuid,s.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(s.bumpMap=this.bumpMap.toJSON(e).uuid,s.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(s.normalMap=this.normalMap.toJSON(e).uuid,s.normalMapType=this.normalMapType,s.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(s.displacementMap=this.displacementMap.toJSON(e).uuid,s.displacementScale=this.displacementScale,s.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(s.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(s.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(s.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(s.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(s.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(s.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(s.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(s.combine=this.combine)),this.envMapIntensity!==void 0&&(s.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(s.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(s.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(s.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(s.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(s.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(s.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(s.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(s.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(s.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(s.size=this.size),this.shadowSide!==null&&(s.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(s.sizeAttenuation=this.sizeAttenuation),this.blending!==Yo&&(s.blending=this.blending),this.side!==Oi&&(s.side=this.side),this.vertexColors===!0&&(s.vertexColors=!0),this.opacity<1&&(s.opacity=this.opacity),this.transparent===!0&&(s.transparent=!0),this.blendSrc!==kg&&(s.blendSrc=this.blendSrc),this.blendDst!==Lg&&(s.blendDst=this.blendDst),this.blendEquation!==kr&&(s.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(s.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(s.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(s.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(s.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(s.blendAlpha=this.blendAlpha),this.depthFunc!==$d&&(s.depthFunc=this.depthFunc),this.depthTest===!1&&(s.depthTest=this.depthTest),this.depthWrite===!1&&(s.depthWrite=this.depthWrite),this.colorWrite===!1&&(s.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(s.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==FC&&(s.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(s.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(s.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ho&&(s.stencilFail=this.stencilFail),this.stencilZFail!==ho&&(s.stencilZFail=this.stencilZFail),this.stencilZPass!==ho&&(s.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(s.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(s.rotation=this.rotation),this.polygonOffset===!0&&(s.polygonOffset=!0),this.polygonOffsetFactor!==0&&(s.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(s.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(s.linewidth=this.linewidth),this.dashSize!==void 0&&(s.dashSize=this.dashSize),this.gapSize!==void 0&&(s.gapSize=this.gapSize),this.scale!==void 0&&(s.scale=this.scale),this.dithering===!0&&(s.dithering=!0),this.alphaTest>0&&(s.alphaTest=this.alphaTest),this.alphaHash===!0&&(s.alphaHash=!0),this.alphaToCoverage===!0&&(s.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(s.premultipliedAlpha=!0),this.forceSinglePass===!0&&(s.forceSinglePass=!0),this.wireframe===!0&&(s.wireframe=!0),this.wireframeLinewidth>1&&(s.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(s.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(s.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(s.flatShading=!0),this.visible===!1&&(s.visible=!1),this.toneMapped===!1&&(s.toneMapped=!1),this.fog===!1&&(s.fog=!1),Object.keys(this.userData).length>0&&(s.userData=this.userData);function i(r){const o=[];for(const a in r){const l=r[a];delete l.metadata,o.push(l)}return o}if(t){const r=i(e.textures),o=i(e.images);r.length>0&&(s.textures=r),o.length>0&&(s.images=o)}return s}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let s=null;if(t!==null){const i=t.length;s=new Array(i);for(let r=0;r!==i;++r)s[r]=t[r].clone()}return this.clippingPlanes=s,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 ir extends ks{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ut(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=TE,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 on=new ie,Gc=new Rt;class Bn{constructor(e,t,s=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=s,this.usage=Gg,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=vi,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return console.warn('THREE.BufferAttribute: "updateRange" is deprecated and removed in r169. Use "addUpdateRange()" instead.'),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,s){e*=this.itemSize,s*=t.itemSize;for(let i=0,r=this.itemSize;i0&&(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 t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const s=this.attributes;for(const l in s){const u=s[l];e.data.attributes[l]=u.toJSON(e.data)}const i={};let r=!1;for(const l in this.morphAttributes){const u=this.morphAttributes[l],d=[];for(let h=0,f=u.length;h0&&(i[l]=d,r=!0)}r&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const s=e.index;s!==null&&this.setIndex(s.clone(t));const i=e.attributes;for(const u in i){const d=i[u];this.setAttribute(u,d.clone(t))}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(t));this.morphAttributes[u]=d}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let u=0,d=o.length;u0){const i=t[s[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=i.length;r(e.far-e.near)**2))&&(ZC.copy(r).invert(),xr.copy(e.ray).applyMatrix4(ZC),!(s.boundingBox!==null&&xr.intersectsBox(s.boundingBox)===!1)&&this._computeIntersections(e,t,xr)))}_computeIntersections(e,t,s){let i;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;mt.far?null:{distance:u,point:Wc.clone(),object:n}}function Kc(n,e,t,s,i,r,o,a,l,u){n.getVertexPosition(a,xo),n.getVertexPosition(l,Co),n.getVertexPosition(u,wo);const d=Qwt(n,e,t,s,xo,Co,wo,$c);if(d){i&&(Hc.fromBufferAttribute(i,a),qc.fromBufferAttribute(i,l),Yc.fromBufferAttribute(i,u),d.uv=Rs.getInterpolation($c,xo,Co,wo,Hc,qc,Yc,new Rt)),r&&(Hc.fromBufferAttribute(r,a),qc.fromBufferAttribute(r,l),Yc.fromBufferAttribute(r,u),d.uv1=Rs.getInterpolation($c,xo,Co,wo,Hc,qc,Yc,new Rt),d.uv2=d.uv1),o&&(e1.fromBufferAttribute(o,a),t1.fromBufferAttribute(o,l),n1.fromBufferAttribute(o,u),d.normal=Rs.getInterpolation($c,xo,Co,wo,e1,t1,n1,new ie),d.normal.dot(s.direction)>0&&d.normal.multiplyScalar(-1));const h={a,b:l,c:u,normal:new ie,materialIndex:0};Rs.getNormal(xo,Co,wo,h.normal),d.face=h}return d}class dr extends ri{constructor(e=1,t=1,s=1,i=1,r=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:s,widthSegments:i,heightSegments:r,depthSegments:o};const a=this;i=Math.floor(i),r=Math.floor(r),o=Math.floor(o);const l=[],u=[],d=[],h=[];let f=0,_=0;m("z","y","x",-1,-1,s,t,e,o,r,0),m("z","y","x",1,-1,s,t,-e,o,r,1),m("x","z","y",1,1,e,s,t,i,o,2),m("x","z","y",1,-1,e,s,-t,i,o,3),m("x","y","z",1,-1,e,t,s,i,r,4),m("x","y","z",-1,-1,e,t,-s,i,r,5),this.setIndex(l),this.setAttribute("position",new xi(u,3)),this.setAttribute("normal",new xi(d,3)),this.setAttribute("uv",new xi(h,2));function m(E,b,g,y,v,S,w,x,A,D,T){const O=S/A,F=w/D,z=S/2,Z=w/2,M=x/2,q=A+1,H=D+1;let P=0,$=0;const J=new ie;for(let re=0;re0?1:-1,d.push(J.x,J.y,J.z),h.push(Se/A),h.push(1-re/D),P+=1}}for(let re=0;re0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const s={};for(const i in this.extensions)this.extensions[i]===!0&&(s[i]=!0);return Object.keys(s).length>0&&(t.extensions=s),t}}class vO extends Jt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new xt,this.projectionMatrix=new xt,this.projectionMatrixInverse=new xt,this.coordinateSystem=Si}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class Pn extends vO{constructor(e=50,t=1,s=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=s,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=pa*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(ml*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return pa*2*Math.atan(Math.tan(ml*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,s,i,r,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=s,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(ml*.5*this.fov)/this.zoom,s=2*t,i=this.aspect*s,r=-.5*i;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,u=o.fullHeight;r+=o.offsetX*i/l,t-=o.offsetY*s/u,i*=o.width/l,s*=o.height/u}const a=this.filmOffset;a!==0&&(r+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,t,t-s,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Ro=-90,Ao=1;class eRt extends Jt{constructor(e,t,s){super(),this.type="CubeCamera",this.renderTarget=s,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new Pn(Ro,Ao,e,t);i.layers=this.layers,this.add(i);const r=new Pn(Ro,Ao,e,t);r.layers=this.layers,this.add(r);const o=new Pn(Ro,Ao,e,t);o.layers=this.layers,this.add(o);const a=new Pn(Ro,Ao,e,t);a.layers=this.layers,this.add(a);const l=new Pn(Ro,Ao,e,t);l.layers=this.layers,this.add(l);const u=new Pn(Ro,Ao,e,t);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[s,i,r,o,a,l]=t;for(const u of t)this.remove(u);if(e===Si)s.up.set(0,1,0),s.lookAt(1,0,0),i.up.set(0,1,0),i.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===Xd)s.up.set(0,-1,0),s.lookAt(-1,0,0),i.up.set(0,-1,0),i.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 t)this.add(u),u.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:s,activeMipmapLevel:i}=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=s.texture.generateMipmaps;s.texture.generateMipmaps=!1,e.setRenderTarget(s,0,i),e.render(t,r),e.setRenderTarget(s,1,i),e.render(t,o),e.setRenderTarget(s,2,i),e.render(t,a),e.setRenderTarget(s,3,i),e.render(t,l),e.setRenderTarget(s,4,i),e.render(t,u),s.texture.generateMipmaps=E,e.setRenderTarget(s,5,i),e.render(t,d),e.setRenderTarget(h,f,_),e.xr.enabled=m,s.texture.needsPMREMUpdate=!0}}class SO extends xn{constructor(e,t,s,i,r,o,a,l,u,d){e=e!==void 0?e:[],t=t!==void 0?t:aa,super(e,t,s,i,r,o,a,l,u,d),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class tRt extends Zr{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const s={width:e,height:e,depth:1},i=[s,s,s,s,s,s];t.encoding!==void 0&&(bl("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===Yr?en:cs),this.texture=new SO(i,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:zn}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const s={uniforms:{tEquirect:{value:null}},vertexShader:` +}`;class Jr extends ks{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=Jwt,this.fragmentShader=eRt,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=_a(e.uniforms),this.uniformsGroups=Xwt(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const i in this.uniforms){const o=this.uniforms[i].value;o&&o.isTexture?t.uniforms[i]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[i]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[i]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[i]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[i]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[i]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[i]={type:"m4",value:o.toArray()}:t.uniforms[i]={value:o}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const s={};for(const i in this.extensions)this.extensions[i]===!0&&(s[i]=!0);return Object.keys(s).length>0&&(t.extensions=s),t}}class vO extends Jt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new xt,this.projectionMatrix=new xt,this.projectionMatrixInverse=new xt,this.coordinateSystem=Si}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class Pn extends vO{constructor(e=50,t=1,s=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=s,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=pa*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(ml*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return pa*2*Math.atan(Math.tan(ml*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,s,i,r,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=s,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(ml*.5*this.fov)/this.zoom,s=2*t,i=this.aspect*s,r=-.5*i;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,u=o.fullHeight;r+=o.offsetX*i/l,t-=o.offsetY*s/u,i*=o.width/l,s*=o.height/u}const a=this.filmOffset;a!==0&&(r+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,t,t-s,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Ro=-90,Ao=1;class tRt extends Jt{constructor(e,t,s){super(),this.type="CubeCamera",this.renderTarget=s,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new Pn(Ro,Ao,e,t);i.layers=this.layers,this.add(i);const r=new Pn(Ro,Ao,e,t);r.layers=this.layers,this.add(r);const o=new Pn(Ro,Ao,e,t);o.layers=this.layers,this.add(o);const a=new Pn(Ro,Ao,e,t);a.layers=this.layers,this.add(a);const l=new Pn(Ro,Ao,e,t);l.layers=this.layers,this.add(l);const u=new Pn(Ro,Ao,e,t);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[s,i,r,o,a,l]=t;for(const u of t)this.remove(u);if(e===Si)s.up.set(0,1,0),s.lookAt(1,0,0),i.up.set(0,1,0),i.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===Xd)s.up.set(0,-1,0),s.lookAt(-1,0,0),i.up.set(0,-1,0),i.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 t)this.add(u),u.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:s,activeMipmapLevel:i}=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=s.texture.generateMipmaps;s.texture.generateMipmaps=!1,e.setRenderTarget(s,0,i),e.render(t,r),e.setRenderTarget(s,1,i),e.render(t,o),e.setRenderTarget(s,2,i),e.render(t,a),e.setRenderTarget(s,3,i),e.render(t,l),e.setRenderTarget(s,4,i),e.render(t,u),s.texture.generateMipmaps=E,e.setRenderTarget(s,5,i),e.render(t,d),e.setRenderTarget(h,f,_),e.xr.enabled=m,s.texture.needsPMREMUpdate=!0}}class SO extends xn{constructor(e,t,s,i,r,o,a,l,u,d){e=e!==void 0?e:[],t=t!==void 0?t:aa,super(e,t,s,i,r,o,a,l,u,d),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class nRt extends Zr{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const s={width:e,height:e,depth:1},i=[s,s,s,s,s,s];t.encoding!==void 0&&(bl("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===Yr?en:cs),this.texture=new SO(i,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:zn}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const s={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; @@ -298,9 +299,9 @@ ${l}`;navigator.clipboard.writeText(u)}else navigator.clipboard.writeText(e);thi gl_FragColor = texture2D( tEquirect, sampleUV ); } - `},i=new dr(5,5,5),r=new Jr({name:"CubemapFromEquirect",uniforms:_a(s.uniforms),vertexShader:s.vertexShader,fragmentShader:s.fragmentShader,side:Yn,blending:ar});r.uniforms.tEquirect.value=t;const o=new Un(i,r),a=t.minFilter;return t.minFilter===Xr&&(t.minFilter=zn),new eRt(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,s,i){const r=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,s,i);e.setRenderTarget(r)}}const Pm=new ie,nRt=new ie,sRt=new Tt;class Ar{constructor(e=new ie(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,s,i){return this.normal.set(e,t,s),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,s){const i=Pm.subVectors(s,t).cross(nRt.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const s=e.delta(Pm),i=this.normal.dot(s);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const r=-(e.start.dot(this.normal)+this.constant)/i;return r<0||r>1?null:t.copy(e.start).addScaledVector(s,r)}intersectsLine(e){const t=this.distanceToPoint(e.start),s=this.distanceToPoint(e.end);return t<0&&s>0||s<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const s=t||sRt.getNormalMatrix(e),i=this.coplanarPoint(Pm).applyMatrix4(e),r=this.normal.applyMatrix3(s).normalize();return this.constant=-i.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 Cr=new ii,jc=new ie;class AE{constructor(e=new Ar,t=new Ar,s=new Ar,i=new Ar,r=new Ar,o=new Ar){this.planes=[e,t,s,i,r,o]}set(e,t,s,i,r,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(s),a[3].copy(i),a[4].copy(r),a[5].copy(o),this}copy(e){const t=this.planes;for(let s=0;s<6;s++)t[s].copy(e.planes[s]);return this}setFromProjectionMatrix(e,t=Si){const s=this.planes,i=e.elements,r=i[0],o=i[1],a=i[2],l=i[3],u=i[4],d=i[5],h=i[6],f=i[7],_=i[8],m=i[9],E=i[10],b=i[11],g=i[12],y=i[13],v=i[14],S=i[15];if(s[0].setComponents(l-r,f-u,b-_,S-g).normalize(),s[1].setComponents(l+r,f+u,b+_,S+g).normalize(),s[2].setComponents(l+o,f+d,b+m,S+y).normalize(),s[3].setComponents(l-o,f-d,b-m,S-y).normalize(),s[4].setComponents(l-a,f-h,b-E,S-v).normalize(),t===Si)s[5].setComponents(l+a,f+h,b+E,S+v).normalize();else if(t===Xd)s[5].setComponents(a,h,E,v).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Cr.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Cr.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Cr)}intersectsSprite(e){return Cr.center.set(0,0,0),Cr.radius=.7071067811865476,Cr.applyMatrix4(e.matrixWorld),this.intersectsSphere(Cr)}intersectsSphere(e){const t=this.planes,s=e.center,i=-e.radius;for(let r=0;r<6;r++)if(t[r].distanceToPoint(s)0?e.max.x:e.min.x,jc.y=i.normal.y>0?e.max.y:e.min.y,jc.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(jc)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let s=0;s<6;s++)if(t[s].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function TO(){let n=null,e=!1,t=null,s=null;function i(r,o){t(r,o),s=n.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(s=n.requestAnimationFrame(i),e=!0)},stop:function(){n.cancelAnimationFrame(s),e=!1},setAnimationLoop:function(r){t=r},setContext:function(r){n=r}}}function iRt(n,e){const t=e.isWebGL2,s=new WeakMap;function i(u,d){const h=u.array,f=u.usage,_=h.byteLength,m=n.createBuffer();n.bindBuffer(d,m),n.bufferData(d,h,f),u.onUploadCallback();let E;if(h instanceof Float32Array)E=n.FLOAT;else if(h instanceof Uint16Array)if(u.isFloat16BufferAttribute)if(t)E=n.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else E=n.UNSIGNED_SHORT;else if(h instanceof Int16Array)E=n.SHORT;else if(h instanceof Uint32Array)E=n.UNSIGNED_INT;else if(h instanceof Int32Array)E=n.INT;else if(h instanceof Int8Array)E=n.BYTE;else if(h instanceof Uint8Array)E=n.UNSIGNED_BYTE;else if(h instanceof Uint8ClampedArray)E=n.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(n.bindBuffer(h,u),_.count===-1&&m.length===0&&n.bufferSubData(h,0,f),m.length!==0){for(let E=0,b=m.length;E1?null:t.copy(e.start).addScaledVector(s,r)}intersectsLine(e){const t=this.distanceToPoint(e.start),s=this.distanceToPoint(e.end);return t<0&&s>0||s<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const s=t||iRt.getNormalMatrix(e),i=this.coplanarPoint(Pm).applyMatrix4(e),r=this.normal.applyMatrix3(s).normalize();return this.constant=-i.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 Cr=new ii,jc=new ie;class AE{constructor(e=new Ar,t=new Ar,s=new Ar,i=new Ar,r=new Ar,o=new Ar){this.planes=[e,t,s,i,r,o]}set(e,t,s,i,r,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(s),a[3].copy(i),a[4].copy(r),a[5].copy(o),this}copy(e){const t=this.planes;for(let s=0;s<6;s++)t[s].copy(e.planes[s]);return this}setFromProjectionMatrix(e,t=Si){const s=this.planes,i=e.elements,r=i[0],o=i[1],a=i[2],l=i[3],u=i[4],d=i[5],h=i[6],f=i[7],_=i[8],m=i[9],E=i[10],b=i[11],g=i[12],y=i[13],v=i[14],S=i[15];if(s[0].setComponents(l-r,f-u,b-_,S-g).normalize(),s[1].setComponents(l+r,f+u,b+_,S+g).normalize(),s[2].setComponents(l+o,f+d,b+m,S+y).normalize(),s[3].setComponents(l-o,f-d,b-m,S-y).normalize(),s[4].setComponents(l-a,f-h,b-E,S-v).normalize(),t===Si)s[5].setComponents(l+a,f+h,b+E,S+v).normalize();else if(t===Xd)s[5].setComponents(a,h,E,v).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Cr.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Cr.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Cr)}intersectsSprite(e){return Cr.center.set(0,0,0),Cr.radius=.7071067811865476,Cr.applyMatrix4(e.matrixWorld),this.intersectsSphere(Cr)}intersectsSphere(e){const t=this.planes,s=e.center,i=-e.radius;for(let r=0;r<6;r++)if(t[r].distanceToPoint(s)0?e.max.x:e.min.x,jc.y=i.normal.y>0?e.max.y:e.min.y,jc.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(jc)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let s=0;s<6;s++)if(t[s].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function TO(){let n=null,e=!1,t=null,s=null;function i(r,o){t(r,o),s=n.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(s=n.requestAnimationFrame(i),e=!0)},stop:function(){n.cancelAnimationFrame(s),e=!1},setAnimationLoop:function(r){t=r},setContext:function(r){n=r}}}function rRt(n,e){const t=e.isWebGL2,s=new WeakMap;function i(u,d){const h=u.array,f=u.usage,_=h.byteLength,m=n.createBuffer();n.bindBuffer(d,m),n.bufferData(d,h,f),u.onUploadCallback();let E;if(h instanceof Float32Array)E=n.FLOAT;else if(h instanceof Uint16Array)if(u.isFloat16BufferAttribute)if(t)E=n.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else E=n.UNSIGNED_SHORT;else if(h instanceof Int16Array)E=n.SHORT;else if(h instanceof Uint32Array)E=n.UNSIGNED_INT;else if(h instanceof Int32Array)E=n.INT;else if(h instanceof Int8Array)E=n.BYTE;else if(h instanceof Uint8Array)E=n.UNSIGNED_BYTE;else if(h instanceof Uint8ClampedArray)E=n.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(n.bindBuffer(h,u),_.count===-1&&m.length===0&&n.bufferSubData(h,0,f),m.length!==0){for(let E=0,b=m.length;E 0 +#endif`,vRt=`#if NUM_CLIPPING_PLANES > 0 vec4 plane; #pragma unroll_loop_start for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { @@ -497,26 +498,26 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve #pragma unroll_loop_end if ( clipped ) discard; #endif -#endif`,vRt=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; #endif`,SRt=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; #endif`,TRt=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,xRt=`#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; -#endif`,xRt=`#if defined( USE_COLOR_ALPHA ) +#endif`,CRt=`#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; -#endif`,CRt=`#if defined( USE_COLOR_ALPHA ) +#endif`,wRt=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; -#endif`,wRt=`#if defined( USE_COLOR_ALPHA ) +#endif`,RRt=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) varying vec3 vColor; -#endif`,RRt=`#if defined( USE_COLOR_ALPHA ) +#endif`,ARt=`#if defined( USE_COLOR_ALPHA ) vColor = vec4( 1.0 ); #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) vColor = vec3( 1.0 ); @@ -526,7 +527,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`,ARt=`#define PI 3.141592653589793 +#endif`,NRt=`#define PI 3.141592653589793 #define PI2 6.283185307179586 #define PI_HALF 1.5707963267948966 #define RECIPROCAL_PI 0.3183098861837907 @@ -604,7 +605,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`,NRt=`#ifdef ENVMAP_TYPE_CUBE_UV +} // validated`,ORt=`#ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_minMipLevel 4.0 #define cubeUV_minTileSize 16.0 float getFace( vec3 direction ) { @@ -702,7 +703,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`,ORt=`vec3 transformedNormal = objectNormal; +#endif`,IRt=`vec3 transformedNormal = objectNormal; #ifdef USE_TANGENT vec3 transformedTangent = objectTangent; #endif @@ -731,18 +732,18 @@ transformedNormal = normalMatrix * transformedNormal; #ifdef FLIP_SIDED transformedTangent = - transformedTangent; #endif -#endif`,IRt=`#ifdef USE_DISPLACEMENTMAP +#endif`,MRt=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; -#endif`,MRt=`#ifdef USE_DISPLACEMENTMAP +#endif`,DRt=`#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); -#endif`,DRt=`#ifdef USE_EMISSIVEMAP +#endif`,kRt=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,kRt=`#ifdef USE_EMISSIVEMAP +#endif`,LRt=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; -#endif`,LRt="gl_FragColor = linearToOutputTexel( gl_FragColor );",PRt=` +#endif`,PRt="gl_FragColor = linearToOutputTexel( gl_FragColor );",URt=` const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3( vec3( 0.8224621, 0.177538, 0.0 ), vec3( 0.0331941, 0.9668058, 0.0 ), @@ -770,7 +771,7 @@ vec4 LinearToLinear( in vec4 value ) { } vec4 LinearTosRGB( in vec4 value ) { return sRGBTransferOETF( value ); -}`,URt=`#ifdef USE_ENVMAP +}`,FRt=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vec3 cameraToFrag; if ( isOrthographic ) { @@ -799,7 +800,7 @@ vec4 LinearTosRGB( in vec4 value ) { #elif defined( ENVMAP_BLENDING_ADD ) outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif -#endif`,FRt=`#ifdef USE_ENVMAP +#endif`,BRt=`#ifdef USE_ENVMAP uniform float envMapIntensity; uniform float flipEnvMap; #ifdef ENVMAP_TYPE_CUBE @@ -808,7 +809,7 @@ vec4 LinearTosRGB( in vec4 value ) { uniform sampler2D envMap; #endif -#endif`,BRt=`#ifdef USE_ENVMAP +#endif`,GRt=`#ifdef USE_ENVMAP uniform float reflectivity; #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS @@ -819,7 +820,7 @@ vec4 LinearTosRGB( in vec4 value ) { #else varying vec3 vReflect; #endif -#endif`,GRt=`#ifdef USE_ENVMAP +#endif`,VRt=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS #endif @@ -830,7 +831,7 @@ vec4 LinearTosRGB( in vec4 value ) { varying vec3 vReflect; uniform float refractionRatio; #endif -#endif`,VRt=`#ifdef USE_ENVMAP +#endif`,zRt=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vWorldPosition = worldPosition.xyz; #else @@ -847,18 +848,18 @@ vec4 LinearTosRGB( in vec4 value ) { vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); #endif #endif -#endif`,zRt=`#ifdef USE_FOG - vFogDepth = - mvPosition.z; #endif`,HRt=`#ifdef USE_FOG - varying float vFogDepth; + vFogDepth = - mvPosition.z; #endif`,qRt=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,YRt=`#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`,YRt=`#ifdef USE_FOG +#endif`,$Rt=`#ifdef USE_FOG uniform vec3 fogColor; varying float vFogDepth; #ifdef FOG_EXP2 @@ -867,7 +868,7 @@ vec4 LinearTosRGB( in vec4 value ) { uniform float fogNear; uniform float fogFar; #endif -#endif`,$Rt=`#ifdef USE_GRADIENTMAP +#endif`,WRt=`#ifdef USE_GRADIENTMAP uniform sampler2D gradientMap; #endif vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { @@ -879,16 +880,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 -}`,WRt=`#ifdef USE_LIGHTMAP +}`,KRt=`#ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; reflectedLight.indirectDiffuse += lightMapIrradiance; -#endif`,KRt=`#ifdef USE_LIGHTMAP +#endif`,jRt=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; -#endif`,jRt=`LambertMaterial material; +#endif`,QRt=`LambertMaterial material; material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,QRt=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,XRt=`varying vec3 vViewPosition; struct LambertMaterial { vec3 diffuseColor; float specularStrength; @@ -902,7 +903,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`,XRt=`uniform bool receiveShadow; +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,ZRt=`uniform bool receiveShadow; uniform vec3 ambientLightColor; #if defined( USE_LIGHT_PROBES ) uniform vec3 lightProbe[ 9 ]; @@ -1025,7 +1026,7 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); return irradiance; } -#endif`,ZRt=`#ifdef USE_ENVMAP +#endif`,JRt=`#ifdef USE_ENVMAP vec3 getIBLIrradiance( const in vec3 normal ) { #ifdef ENVMAP_TYPE_CUBE_UV vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); @@ -1058,8 +1059,8 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi #endif } #endif -#endif`,JRt=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,eAt=`varying vec3 vViewPosition; +#endif`,eAt=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,tAt=`varying vec3 vViewPosition; struct ToonMaterial { vec3 diffuseColor; }; @@ -1071,11 +1072,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`,tAt=`BlinnPhongMaterial material; +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,nAt=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; -material.specularStrength = specularStrength;`,nAt=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,sAt=`varying vec3 vViewPosition; struct BlinnPhongMaterial { vec3 diffuseColor; vec3 specularColor; @@ -1092,7 +1093,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`,sAt=`PhysicalMaterial material; +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,iAt=`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 ); @@ -1175,7 +1176,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`,iAt=`struct PhysicalMaterial { +#endif`,rAt=`struct PhysicalMaterial { vec3 diffuseColor; float roughness; vec3 specularColor; @@ -1475,7 +1476,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 ); -}`,rAt=` +}`,oAt=` vec3 geometryPosition = - vViewPosition; vec3 geometryNormal = normal; vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); @@ -1590,7 +1591,7 @@ IncidentLight directLight; #if defined( RE_IndirectSpecular ) vec3 radiance = vec3( 0.0 ); vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,oAt=`#if defined( RE_IndirectDiffuse ) +#endif`,aAt=`#if defined( RE_IndirectDiffuse ) #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; @@ -1609,25 +1610,25 @@ IncidentLight directLight; #ifdef USE_CLEARCOAT clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); #endif -#endif`,aAt=`#if defined( RE_IndirectDiffuse ) +#endif`,lAt=`#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`,lAt=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; #endif`,cAt=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) + gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,dAt=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; -#endif`,dAt=`#ifdef USE_LOGDEPTHBUF +#endif`,uAt=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT varying float vFragDepth; varying float vIsPerspective; #else uniform float logDepthBufFC; #endif -#endif`,uAt=`#ifdef USE_LOGDEPTHBUF +#endif`,pAt=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); @@ -1637,16 +1638,16 @@ IncidentLight directLight; gl_Position.z *= gl_Position.w; } #endif -#endif`,pAt=`#ifdef USE_MAP +#endif`,_At=`#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`,_At=`#ifdef USE_MAP +#endif`,hAt=`#ifdef USE_MAP uniform sampler2D map; -#endif`,hAt=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) +#endif`,fAt=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) #if defined( USE_POINTS_UV ) vec2 uv = vUv; #else @@ -1658,7 +1659,7 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,fAt=`#if defined( USE_POINTS_UV ) +#endif`,mAt=`#if defined( USE_POINTS_UV ) varying vec2 vUv; #else #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) @@ -1670,13 +1671,13 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP uniform sampler2D alphaMap; -#endif`,mAt=`float metalnessFactor = metalness; +#endif`,gAt=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); metalnessFactor *= texelMetalness.b; -#endif`,gAt=`#ifdef USE_METALNESSMAP +#endif`,bAt=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; -#endif`,bAt=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) +#endif`,EAt=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) vColor *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { #if defined( USE_COLOR_ALPHA ) @@ -1685,7 +1686,7 @@ IncidentLight directLight; if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; #endif } -#endif`,EAt=`#ifdef USE_MORPHNORMALS +#endif`,yAt=`#ifdef USE_MORPHNORMALS objectNormal *= morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { @@ -1697,7 +1698,7 @@ IncidentLight directLight; objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; #endif -#endif`,yAt=`#ifdef USE_MORPHTARGETS +#endif`,vAt=`#ifdef USE_MORPHTARGETS uniform float morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; @@ -1717,7 +1718,7 @@ IncidentLight directLight; uniform float morphTargetInfluences[ 4 ]; #endif #endif -#endif`,vAt=`#ifdef USE_MORPHTARGETS +#endif`,SAt=`#ifdef USE_MORPHTARGETS transformed *= morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { @@ -1735,7 +1736,7 @@ IncidentLight directLight; transformed += morphTarget7 * morphTargetInfluences[ 7 ]; #endif #endif -#endif`,SAt=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#endif`,TAt=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; #ifdef FLAT_SHADED vec3 fdx = dFdx( vViewPosition ); vec3 fdy = dFdy( vViewPosition ); @@ -1776,7 +1777,7 @@ IncidentLight directLight; tbn2[1] *= faceDirection; #endif #endif -vec3 nonPerturbedNormal = normal;`,TAt=`#ifdef USE_NORMALMAP_OBJECTSPACE +vec3 nonPerturbedNormal = normal;`,xAt=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; #ifdef FLIP_SIDED normal = - normal; @@ -1791,12 +1792,6 @@ vec3 nonPerturbedNormal = normal;`,TAt=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = normalize( tbn * mapN ); #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,xAt=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif #endif`,CAt=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT @@ -1804,12 +1799,18 @@ vec3 nonPerturbedNormal = normal;`,TAt=`#ifdef USE_NORMALMAP_OBJECTSPACE varying vec3 vBitangent; #endif #endif`,wAt=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,RAt=`#ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif -#endif`,RAt=`#ifdef USE_NORMALMAP +#endif`,AAt=`#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; #endif @@ -1831,13 +1832,13 @@ vec3 nonPerturbedNormal = normal;`,TAt=`#ifdef USE_NORMALMAP_OBJECTSPACE float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); return mat3( T * scale, B * scale, N ); } -#endif`,AAt=`#ifdef USE_CLEARCOAT +#endif`,NAt=`#ifdef USE_CLEARCOAT vec3 clearcoatNormal = nonPerturbedNormal; -#endif`,NAt=`#ifdef USE_CLEARCOAT_NORMALMAP +#endif`,OAt=`#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; clearcoatNormal = normalize( tbn2 * clearcoatMapN ); -#endif`,OAt=`#ifdef USE_CLEARCOATMAP +#endif`,IAt=`#ifdef USE_CLEARCOATMAP uniform sampler2D clearcoatMap; #endif #ifdef USE_CLEARCOAT_NORMALMAP @@ -1846,18 +1847,18 @@ vec3 nonPerturbedNormal = normal;`,TAt=`#ifdef USE_NORMALMAP_OBJECTSPACE #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP uniform sampler2D clearcoatRoughnessMap; -#endif`,IAt=`#ifdef USE_IRIDESCENCEMAP +#endif`,MAt=`#ifdef USE_IRIDESCENCEMAP uniform sampler2D iridescenceMap; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform sampler2D iridescenceThicknessMap; -#endif`,MAt=`#ifdef OPAQUE +#endif`,DAt=`#ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= material.transmissionAlpha; #endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,DAt=`vec3 packNormalToRGB( const in vec3 normal ) { +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,kAt=`vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { @@ -1898,9 +1899,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 ); -}`,kAt=`#ifdef PREMULTIPLIED_ALPHA +}`,LAt=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; -#endif`,LAt=`vec4 mvPosition = vec4( transformed, 1.0 ); +#endif`,PAt=`vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING mvPosition = batchingMatrix * mvPosition; #endif @@ -1908,22 +1909,22 @@ float perspectiveDepthToViewZ( const in float depth, const in float near, const mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,PAt=`#ifdef DITHERING +gl_Position = projectionMatrix * mvPosition;`,UAt=`#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,UAt=`#ifdef DITHERING +#endif`,FAt=`#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`,FAt=`float roughnessFactor = roughness; +#endif`,BAt=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); roughnessFactor *= texelRoughness.g; -#endif`,BAt=`#ifdef USE_ROUGHNESSMAP +#endif`,GAt=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; -#endif`,GAt=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,VAt=`#if NUM_SPOT_LIGHT_COORDS > 0 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #if NUM_SPOT_LIGHT_MAPS > 0 @@ -2100,7 +2101,7 @@ gl_Position = projectionMatrix * mvPosition;`,PAt=`#ifdef DITHERING return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); #endif } -#endif`,VAt=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,zAt=`#if NUM_SPOT_LIGHT_COORDS > 0 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif @@ -2138,7 +2139,7 @@ gl_Position = projectionMatrix * mvPosition;`,PAt=`#ifdef DITHERING }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif -#endif`,zAt=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) +#endif`,HAt=`#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 @@ -2170,7 +2171,7 @@ gl_Position = projectionMatrix * mvPosition;`,PAt=`#ifdef DITHERING vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end -#endif`,HAt=`float getShadowMask() { +#endif`,qAt=`float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 @@ -2202,12 +2203,12 @@ gl_Position = projectionMatrix * mvPosition;`,PAt=`#ifdef DITHERING #endif #endif return shadow; -}`,qAt=`#ifdef USE_SKINNING +}`,YAt=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,YAt=`#ifdef USE_SKINNING +#endif`,$At=`#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; uniform highp sampler2D boneTexture; @@ -2222,7 +2223,7 @@ gl_Position = projectionMatrix * mvPosition;`,PAt=`#ifdef DITHERING vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); return mat4( v1, v2, v3, v4 ); } -#endif`,$At=`#ifdef USE_SKINNING +#endif`,WAt=`#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; @@ -2230,7 +2231,7 @@ gl_Position = projectionMatrix * mvPosition;`,PAt=`#ifdef DITHERING skinned += boneMatZ * skinVertex * skinWeight.z; skinned += boneMatW * skinVertex * skinWeight.w; transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,WAt=`#ifdef USE_SKINNING +#endif`,KAt=`#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; @@ -2241,17 +2242,17 @@ gl_Position = projectionMatrix * mvPosition;`,PAt=`#ifdef DITHERING #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif -#endif`,KAt=`float specularStrength; +#endif`,jAt=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; -#endif`,jAt=`#ifdef USE_SPECULARMAP +#endif`,QAt=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; -#endif`,QAt=`#if defined( TONE_MAPPING ) +#endif`,XAt=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,XAt=`#ifndef saturate +#endif`,ZAt=`#ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif uniform float toneMappingExposure; @@ -2287,7 +2288,7 @@ vec3 ACESFilmicToneMapping( vec3 color ) { color = ACESOutputMat * color; return saturate( color ); } -vec3 CustomToneMapping( vec3 color ) { return color; }`,ZAt=`#ifdef USE_TRANSMISSION +vec3 CustomToneMapping( vec3 color ) { return color; }`,JAt=`#ifdef USE_TRANSMISSION material.transmission = transmission; material.transmissionAlpha = 1.0; material.thickness = thickness; @@ -2308,7 +2309,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,ZAt=`#ifdef USE_TRANSMIS material.attenuationColor, material.attenuationDistance ); material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); -#endif`,JAt=`#ifdef USE_TRANSMISSION +#endif`,eNt=`#ifdef USE_TRANSMISSION uniform float transmission; uniform float thickness; uniform float attenuationDistance; @@ -2414,7 +2415,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,ZAt=`#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`,eNt=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,tNt=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -2484,7 +2485,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,ZAt=`#ifdef USE_TRANSMIS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,tNt=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,nNt=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -2578,7 +2579,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,ZAt=`#ifdef USE_TRANSMIS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,nNt=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,sNt=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) vUv = vec3( uv, 1 ).xy; #endif #ifdef USE_MAP @@ -2649,7 +2650,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,ZAt=`#ifdef USE_TRANSMIS #endif #ifdef USE_THICKNESSMAP vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; -#endif`,sNt=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 +#endif`,iNt=`#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; @@ -2658,12 +2659,12 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,ZAt=`#ifdef USE_TRANSMIS worldPosition = instanceMatrix * worldPosition; #endif worldPosition = modelMatrix * worldPosition; -#endif`;const iNt=`varying vec2 vUv; +#endif`;const rNt=`varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,rNt=`uniform sampler2D t2D; +}`,oNt=`uniform sampler2D t2D; uniform float backgroundIntensity; varying vec2 vUv; void main() { @@ -2675,14 +2676,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,oNt=`varying vec3 vWorldDirection; +}`,aNt=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,aNt=`#ifdef ENVMAP_TYPE_CUBE +}`,lNt=`#ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #elif defined( ENVMAP_TYPE_CUBE_UV ) uniform sampler2D envMap; @@ -2704,14 +2705,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,lNt=`varying vec3 vWorldDirection; +}`,cNt=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,cNt=`uniform samplerCube tCube; +}`,dNt=`uniform samplerCube tCube; uniform float tFlip; uniform float opacity; varying vec3 vWorldDirection; @@ -2721,7 +2722,7 @@ void main() { gl_FragColor.a *= opacity; #include #include -}`,dNt=`#include +}`,uNt=`#include #include #include #include @@ -2747,7 +2748,7 @@ void main() { #include #include vHighPrecisionZW = gl_Position.zw; -}`,uNt=`#if DEPTH_PACKING == 3200 +}`,pNt=`#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include @@ -2777,7 +2778,7 @@ void main() { #elif DEPTH_PACKING == 3201 gl_FragColor = packDepthToRGBA( fragCoordZ ); #endif -}`,pNt=`#define DISTANCE +}`,_Nt=`#define DISTANCE varying vec3 vWorldPosition; #include #include @@ -2803,7 +2804,7 @@ void main() { #include #include vWorldPosition = worldPosition.xyz; -}`,_Nt=`#define DISTANCE +}`,hNt=`#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; @@ -2827,13 +2828,13 @@ void main () { dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = packDepthToRGBA( dist ); -}`,hNt=`varying vec3 vWorldDirection; +}`,fNt=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include -}`,fNt=`uniform sampler2D tEquirect; +}`,mNt=`uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { @@ -2842,7 +2843,7 @@ void main() { gl_FragColor = texture2D( tEquirect, sampleUV ); #include #include -}`,mNt=`uniform float scale; +}`,gNt=`uniform float scale; attribute float lineDistance; varying float vLineDistance; #include @@ -2863,7 +2864,7 @@ void main() { #include #include #include -}`,gNt=`uniform vec3 diffuse; +}`,bNt=`uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; @@ -2891,7 +2892,7 @@ void main() { #include #include #include -}`,bNt=`#include +}`,ENt=`#include #include #include #include @@ -2922,7 +2923,7 @@ void main() { #include #include #include -}`,ENt=`uniform vec3 diffuse; +}`,yNt=`uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; @@ -2970,7 +2971,7 @@ void main() { #include #include #include -}`,yNt=`#define LAMBERT +}`,vNt=`#define LAMBERT varying vec3 vViewPosition; #include #include @@ -3008,7 +3009,7 @@ void main() { #include #include #include -}`,vNt=`#define LAMBERT +}`,SNt=`#define LAMBERT uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -3065,7 +3066,7 @@ void main() { #include #include #include -}`,SNt=`#define MATCAP +}`,TNt=`#define MATCAP varying vec3 vViewPosition; #include #include @@ -3098,7 +3099,7 @@ void main() { #include #include vViewPosition = - mvPosition.xyz; -}`,TNt=`#define MATCAP +}`,xNt=`#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; @@ -3144,7 +3145,7 @@ void main() { #include #include #include -}`,xNt=`#define NORMAL +}`,CNt=`#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; #endif @@ -3176,7 +3177,7 @@ void main() { #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) vViewPosition = - mvPosition.xyz; #endif -}`,CNt=`#define NORMAL +}`,wNt=`#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; @@ -3197,7 +3198,7 @@ void main() { #ifdef OPAQUE gl_FragColor.a = 1.0; #endif -}`,wNt=`#define PHONG +}`,RNt=`#define PHONG varying vec3 vViewPosition; #include #include @@ -3235,7 +3236,7 @@ void main() { #include #include #include -}`,RNt=`#define PHONG +}`,ANt=`#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; @@ -3294,7 +3295,7 @@ void main() { #include #include #include -}`,ANt=`#define STANDARD +}`,NNt=`#define STANDARD varying vec3 vViewPosition; #ifdef USE_TRANSMISSION varying vec3 vWorldPosition; @@ -3336,7 +3337,7 @@ void main() { #ifdef USE_TRANSMISSION vWorldPosition = worldPosition.xyz; #endif -}`,NNt=`#define STANDARD +}`,ONt=`#define STANDARD #ifdef PHYSICAL #define IOR #define USE_SPECULAR @@ -3458,7 +3459,7 @@ void main() { #include #include #include -}`,ONt=`#define TOON +}`,INt=`#define TOON varying vec3 vViewPosition; #include #include @@ -3494,7 +3495,7 @@ void main() { #include #include #include -}`,INt=`#define TOON +}`,MNt=`#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -3547,7 +3548,7 @@ void main() { #include #include #include -}`,MNt=`uniform float size; +}`,DNt=`uniform float size; uniform float scale; #include #include @@ -3577,7 +3578,7 @@ void main() { #include #include #include -}`,DNt=`uniform vec3 diffuse; +}`,kNt=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3602,7 +3603,7 @@ void main() { #include #include #include -}`,kNt=`#include +}`,LNt=`#include #include #include #include @@ -3624,7 +3625,7 @@ void main() { #include #include #include -}`,LNt=`uniform vec3 color; +}`,PNt=`uniform vec3 color; uniform float opacity; #include #include @@ -3640,7 +3641,7 @@ void main() { #include #include #include -}`,PNt=`uniform float rotation; +}`,UNt=`uniform float rotation; uniform vec2 center; #include #include @@ -3666,7 +3667,7 @@ void main() { #include #include #include -}`,UNt=`uniform vec3 diffuse; +}`,FNt=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3691,7 +3692,7 @@ void main() { #include #include #include -}`,vt={alphahash_fragment:rRt,alphahash_pars_fragment:oRt,alphamap_fragment:aRt,alphamap_pars_fragment:lRt,alphatest_fragment:cRt,alphatest_pars_fragment:dRt,aomap_fragment:uRt,aomap_pars_fragment:pRt,batching_pars_vertex:_Rt,batching_vertex:hRt,begin_vertex:fRt,beginnormal_vertex:mRt,bsdfs:gRt,iridescence_fragment:bRt,bumpmap_pars_fragment:ERt,clipping_planes_fragment:yRt,clipping_planes_pars_fragment:vRt,clipping_planes_pars_vertex:SRt,clipping_planes_vertex:TRt,color_fragment:xRt,color_pars_fragment:CRt,color_pars_vertex:wRt,color_vertex:RRt,common:ARt,cube_uv_reflection_fragment:NRt,defaultnormal_vertex:ORt,displacementmap_pars_vertex:IRt,displacementmap_vertex:MRt,emissivemap_fragment:DRt,emissivemap_pars_fragment:kRt,colorspace_fragment:LRt,colorspace_pars_fragment:PRt,envmap_fragment:URt,envmap_common_pars_fragment:FRt,envmap_pars_fragment:BRt,envmap_pars_vertex:GRt,envmap_physical_pars_fragment:ZRt,envmap_vertex:VRt,fog_vertex:zRt,fog_pars_vertex:HRt,fog_fragment:qRt,fog_pars_fragment:YRt,gradientmap_pars_fragment:$Rt,lightmap_fragment:WRt,lightmap_pars_fragment:KRt,lights_lambert_fragment:jRt,lights_lambert_pars_fragment:QRt,lights_pars_begin:XRt,lights_toon_fragment:JRt,lights_toon_pars_fragment:eAt,lights_phong_fragment:tAt,lights_phong_pars_fragment:nAt,lights_physical_fragment:sAt,lights_physical_pars_fragment:iAt,lights_fragment_begin:rAt,lights_fragment_maps:oAt,lights_fragment_end:aAt,logdepthbuf_fragment:lAt,logdepthbuf_pars_fragment:cAt,logdepthbuf_pars_vertex:dAt,logdepthbuf_vertex:uAt,map_fragment:pAt,map_pars_fragment:_At,map_particle_fragment:hAt,map_particle_pars_fragment:fAt,metalnessmap_fragment:mAt,metalnessmap_pars_fragment:gAt,morphcolor_vertex:bAt,morphnormal_vertex:EAt,morphtarget_pars_vertex:yAt,morphtarget_vertex:vAt,normal_fragment_begin:SAt,normal_fragment_maps:TAt,normal_pars_fragment:xAt,normal_pars_vertex:CAt,normal_vertex:wAt,normalmap_pars_fragment:RAt,clearcoat_normal_fragment_begin:AAt,clearcoat_normal_fragment_maps:NAt,clearcoat_pars_fragment:OAt,iridescence_pars_fragment:IAt,opaque_fragment:MAt,packing:DAt,premultiplied_alpha_fragment:kAt,project_vertex:LAt,dithering_fragment:PAt,dithering_pars_fragment:UAt,roughnessmap_fragment:FAt,roughnessmap_pars_fragment:BAt,shadowmap_pars_fragment:GAt,shadowmap_pars_vertex:VAt,shadowmap_vertex:zAt,shadowmask_pars_fragment:HAt,skinbase_vertex:qAt,skinning_pars_vertex:YAt,skinning_vertex:$At,skinnormal_vertex:WAt,specularmap_fragment:KAt,specularmap_pars_fragment:jAt,tonemapping_fragment:QAt,tonemapping_pars_fragment:XAt,transmission_fragment:ZAt,transmission_pars_fragment:JAt,uv_pars_fragment:eNt,uv_pars_vertex:tNt,uv_vertex:nNt,worldpos_vertex:sNt,background_vert:iNt,background_frag:rNt,backgroundCube_vert:oNt,backgroundCube_frag:aNt,cube_vert:lNt,cube_frag:cNt,depth_vert:dNt,depth_frag:uNt,distanceRGBA_vert:pNt,distanceRGBA_frag:_Nt,equirect_vert:hNt,equirect_frag:fNt,linedashed_vert:mNt,linedashed_frag:gNt,meshbasic_vert:bNt,meshbasic_frag:ENt,meshlambert_vert:yNt,meshlambert_frag:vNt,meshmatcap_vert:SNt,meshmatcap_frag:TNt,meshnormal_vert:xNt,meshnormal_frag:CNt,meshphong_vert:wNt,meshphong_frag:RNt,meshphysical_vert:ANt,meshphysical_frag:NNt,meshtoon_vert:ONt,meshtoon_frag:INt,points_vert:MNt,points_frag:DNt,shadow_vert:kNt,shadow_frag:LNt,sprite_vert:PNt,sprite_frag:UNt},$e={common:{diffuse:{value:new ut(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Tt},alphaMap:{value:null},alphaMapTransform:{value:new Tt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Tt}},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 Tt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Tt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Tt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Tt},normalScale:{value:new Rt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Tt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Tt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Tt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Tt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ut(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new ut(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Tt},alphaTest:{value:0},uvTransform:{value:new Tt}},sprite:{diffuse:{value:new ut(16777215)},opacity:{value:1},center:{value:new Rt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Tt},alphaMap:{value:null},alphaMapTransform:{value:new Tt},alphaTest:{value:0}}},zs={basic:{uniforms:Ln([$e.common,$e.specularmap,$e.envmap,$e.aomap,$e.lightmap,$e.fog]),vertexShader:vt.meshbasic_vert,fragmentShader:vt.meshbasic_frag},lambert:{uniforms:Ln([$e.common,$e.specularmap,$e.envmap,$e.aomap,$e.lightmap,$e.emissivemap,$e.bumpmap,$e.normalmap,$e.displacementmap,$e.fog,$e.lights,{emissive:{value:new ut(0)}}]),vertexShader:vt.meshlambert_vert,fragmentShader:vt.meshlambert_frag},phong:{uniforms:Ln([$e.common,$e.specularmap,$e.envmap,$e.aomap,$e.lightmap,$e.emissivemap,$e.bumpmap,$e.normalmap,$e.displacementmap,$e.fog,$e.lights,{emissive:{value:new ut(0)},specular:{value:new ut(1118481)},shininess:{value:30}}]),vertexShader:vt.meshphong_vert,fragmentShader:vt.meshphong_frag},standard:{uniforms:Ln([$e.common,$e.envmap,$e.aomap,$e.lightmap,$e.emissivemap,$e.bumpmap,$e.normalmap,$e.displacementmap,$e.roughnessmap,$e.metalnessmap,$e.fog,$e.lights,{emissive:{value:new ut(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:vt.meshphysical_vert,fragmentShader:vt.meshphysical_frag},toon:{uniforms:Ln([$e.common,$e.aomap,$e.lightmap,$e.emissivemap,$e.bumpmap,$e.normalmap,$e.displacementmap,$e.gradientmap,$e.fog,$e.lights,{emissive:{value:new ut(0)}}]),vertexShader:vt.meshtoon_vert,fragmentShader:vt.meshtoon_frag},matcap:{uniforms:Ln([$e.common,$e.bumpmap,$e.normalmap,$e.displacementmap,$e.fog,{matcap:{value:null}}]),vertexShader:vt.meshmatcap_vert,fragmentShader:vt.meshmatcap_frag},points:{uniforms:Ln([$e.points,$e.fog]),vertexShader:vt.points_vert,fragmentShader:vt.points_frag},dashed:{uniforms:Ln([$e.common,$e.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:vt.linedashed_vert,fragmentShader:vt.linedashed_frag},depth:{uniforms:Ln([$e.common,$e.displacementmap]),vertexShader:vt.depth_vert,fragmentShader:vt.depth_frag},normal:{uniforms:Ln([$e.common,$e.bumpmap,$e.normalmap,$e.displacementmap,{opacity:{value:1}}]),vertexShader:vt.meshnormal_vert,fragmentShader:vt.meshnormal_frag},sprite:{uniforms:Ln([$e.sprite,$e.fog]),vertexShader:vt.sprite_vert,fragmentShader:vt.sprite_frag},background:{uniforms:{uvTransform:{value:new Tt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:vt.background_vert,fragmentShader:vt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:vt.backgroundCube_vert,fragmentShader:vt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:vt.cube_vert,fragmentShader:vt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:vt.equirect_vert,fragmentShader:vt.equirect_frag},distanceRGBA:{uniforms:Ln([$e.common,$e.displacementmap,{referencePosition:{value:new ie},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:vt.distanceRGBA_vert,fragmentShader:vt.distanceRGBA_frag},shadow:{uniforms:Ln([$e.lights,$e.fog,{color:{value:new ut(0)},opacity:{value:1}}]),vertexShader:vt.shadow_vert,fragmentShader:vt.shadow_frag}};zs.physical={uniforms:Ln([zs.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Tt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Tt},clearcoatNormalScale:{value:new Rt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Tt},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Tt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Tt},sheen:{value:0},sheenColor:{value:new ut(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Tt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Tt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Tt},transmissionSamplerSize:{value:new Rt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Tt},attenuationDistance:{value:0},attenuationColor:{value:new ut(0)},specularColor:{value:new ut(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Tt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Tt},anisotropyVector:{value:new Rt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Tt}}]),vertexShader:vt.meshphysical_vert,fragmentShader:vt.meshphysical_frag};const Qc={r:0,b:0,g:0};function FNt(n,e,t,s,i,r,o){const a=new ut(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?t:e).get(v)),v===null?E(a,l):v&&v.isColor&&(E(v,1),y=!0);const S=n.xr.getEnvironmentBlendMode();S==="additive"?s.buffers.color.setClear(0,0,0,1,o):S==="alpha-blend"&&s.buffers.color.setClear(0,0,0,0,o),(n.autoClear||y)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),v&&(v.isCubeTexture||v.mapping===zu)?(d===void 0&&(d=new Un(new dr(1,1,1),new Jr({name:"BackgroundCubeMaterial",uniforms:_a(zs.backgroundCube.uniforms),vertexShader:zs.backgroundCube.vertexShader,fragmentShader:zs.backgroundCube.fragmentShader,side:Yn,depthTest:!1,depthWrite:!1,fog:!1})),d.geometry.deleteAttribute("normal"),d.geometry.deleteAttribute("uv"),d.onBeforeRender=function(w,x,A){this.matrixWorld.copyPosition(A.matrixWorld)},Object.defineProperty(d.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.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=Ut.getTransfer(v.colorSpace)!==Wt,(h!==v||f!==v.version||_!==n.toneMapping)&&(d.material.needsUpdate=!0,h=v,f=v.version,_=n.toneMapping),d.layers.enableAll(),b.unshift(d,d.geometry,d.material,0,0,null)):v&&v.isTexture&&(u===void 0&&(u=new Un(new NE(2,2),new Jr({name:"BackgroundMaterial",uniforms:_a(zs.background.uniforms),vertexShader:zs.background.vertexShader,fragmentShader:zs.background.fragmentShader,side:Oi,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(u)),u.material.uniforms.t2D.value=v,u.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,u.material.toneMapped=Ut.getTransfer(v.colorSpace)!==Wt,v.matrixAutoUpdate===!0&&v.updateMatrix(),u.material.uniforms.uvTransform.value.copy(v.matrix),(h!==v||f!==v.version||_!==n.toneMapping)&&(u.material.needsUpdate=!0,h=v,f=v.version,_=n.toneMapping),u.layers.enableAll(),b.unshift(u,u.geometry,u.material,0,0,null))}function E(b,g){b.getRGB(Qc,yO(n)),s.buffers.color.setClear(Qc.r,Qc.g,Qc.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 BNt(n,e,t,s){const i=n.getParameter(n.MAX_VERTEX_ATTRIBS),r=s.isWebGL2?null:e.get("OES_vertex_array_object"),o=s.isWebGL2||r!==null,a={},l=b(null);let u=l,d=!1;function h(M,q,H,P,$){let J=!1;if(o){const re=E(P,H,q);u!==re&&(u=re,_(u.object)),J=g(M,P,H,$),J&&y(M,P,H,$)}else{const re=q.wireframe===!0;(u.geometry!==P.id||u.program!==H.id||u.wireframe!==re)&&(u.geometry=P.id,u.program=H.id,u.wireframe=re,J=!0)}$!==null&&t.update($,n.ELEMENT_ARRAY_BUFFER),(J||d)&&(d=!1,D(M,q,H,P),$!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get($).buffer))}function f(){return s.isWebGL2?n.createVertexArray():r.createVertexArrayOES()}function _(M){return s.isWebGL2?n.bindVertexArray(M):r.bindVertexArrayOES(M)}function m(M){return s.isWebGL2?n.deleteVertexArray(M):r.deleteVertexArrayOES(M)}function E(M,q,H){const P=H.wireframe===!0;let $=a[M.id];$===void 0&&($={},a[M.id]=$);let J=$[q.id];J===void 0&&(J={},$[q.id]=J);let re=J[P];return re===void 0&&(re=b(f()),J[P]=re),re}function b(M){const q=[],H=[],P=[];for(let $=0;$=0){const Ee=$[Se];let Oe=J[Se];if(Oe===void 0&&(Se==="instanceMatrix"&&M.instanceMatrix&&(Oe=M.instanceMatrix),Se==="instanceColor"&&M.instanceColor&&(Oe=M.instanceColor)),Ee===void 0||Ee.attribute!==Oe||Oe&&Ee.data!==Oe.data)return!0;re++}return u.attributesNum!==re||u.index!==P}function y(M,q,H,P){const $={},J=q.attributes;let re=0;const me=H.getAttributes();for(const Se in me)if(me[Se].location>=0){let Ee=J[Se];Ee===void 0&&(Se==="instanceMatrix"&&M.instanceMatrix&&(Ee=M.instanceMatrix),Se==="instanceColor"&&M.instanceColor&&(Ee=M.instanceColor));const Oe={};Oe.attribute=Ee,Ee&&Ee.data&&(Oe.data=Ee.data),$[Se]=Oe,re++}u.attributes=$,u.attributesNum=re,u.index=P}function v(){const M=u.newAttributes;for(let q=0,H=M.length;q=0){let le=$[me];if(le===void 0&&(me==="instanceMatrix"&&M.instanceMatrix&&(le=M.instanceMatrix),me==="instanceColor"&&M.instanceColor&&(le=M.instanceColor)),le!==void 0){const Ee=le.normalized,Oe=le.itemSize,Me=t.get(le);if(Me===void 0)continue;const j=Me.buffer,pe=Me.type,ue=Me.bytesPerElement,Ce=s.isWebGL2===!0&&(pe===n.INT||pe===n.UNSIGNED_INT||le.gpuType===nO);if(le.isInterleavedBufferAttribute){const ke=le.data,N=ke.stride,V=le.offset;if(ke.isInstancedInterleavedBuffer){for(let Y=0;Y0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";A="mediump"}return A==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&n.constructor.name==="WebGL2RenderingContext";let a=t.precision!==void 0?t.precision:"highp";const l=r(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const u=o||e.has("WEBGL_draw_buffers"),d=t.logarithmicDepthBuffer===!0,h=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),f=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=n.getParameter(n.MAX_TEXTURE_SIZE),m=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),E=n.getParameter(n.MAX_VERTEX_ATTRIBS),b=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),g=n.getParameter(n.MAX_VARYING_VECTORS),y=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),v=f>0,S=o||e.has("OES_texture_float"),w=v&&S,x=o?n.getParameter(n.MAX_SAMPLES):0;return{isWebGL2:o,drawBuffers:u,getMaxAnisotropy:i,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:w,maxSamples:x}}function zNt(n){const e=this;let t=null,s=0,i=!1,r=!1;const o=new Ar,a=new Tt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,f){const _=h.length!==0||f||s!==0||i;return i=f,s=h.length,_},this.beginShadows=function(){r=!0,d(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(h,f){t=d(h,f,0)},this.setState=function(h,f,_){const m=h.clippingPlanes,E=h.clipIntersection,b=h.clipShadows,g=n.get(h);if(!i||m===null||m.length===0||r&&!b)r?d(null):u();else{const y=r?0:s,v=y*4;let S=g.clippingState||null;l.value=S,S=d(m,f,v,_);for(let w=0;w!==v;++w)S[w]=t[w];g.clippingState=S,this.numIntersection=E?this.numPlanes:0,this.numPlanes+=y}};function u(){l.value!==t&&(l.value=t,l.needsUpdate=s>0),e.numPlanes=s,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 tRt(l.height/2);return u.fromEquirectangularTexture(n,o),e.set(o,u),o.addEventListener("dispose",i),t(u.texture,o.mapping)}else return null}}return o}function i(o){const a=o.target;a.removeEventListener("dispose",i);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function r(){e=new WeakMap}return{get:s,dispose:r}}class OE extends vO{constructor(e=-1,t=1,s=1,i=-1,r=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=s,this.bottom=i,this.near=r,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,s,i,r,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=s,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),s=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let r=s-e,o=s+e,a=i+t,l=i-t;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 t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const Lo=4,s1=[.125,.215,.35,.446,.526,.582],Lr=20,Um=new OE,i1=new ut;let Fm=null,Bm=0,Gm=0;const Nr=(1+Math.sqrt(5))/2,No=1/Nr,r1=[new ie(1,1,1),new ie(-1,1,1),new ie(1,1,-1),new ie(-1,1,-1),new ie(0,Nr,No),new ie(0,Nr,-No),new ie(No,0,Nr),new ie(-No,0,Nr),new ie(Nr,No,0),new ie(-Nr,No,0)];class o1{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,s=.1,i=100){Fm=this._renderer.getRenderTarget(),Bm=this._renderer.getActiveCubeFace(),Gm=this._renderer.getActiveMipmapLevel(),this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(e,s,i,r),t>0&&this._blur(r,0,0,t),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=c1(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=l1(),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(i),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,t){const s=this._renderer,i=e.mapping===aa||e.mapping===la;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=c1()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=l1());const r=i?this._cubemapMaterial:this._equirectMaterial,o=new Un(this._lodPlanes[0],r),a=r.uniforms;a.envMap.value=e;const l=this._cubeSize;Xc(t,0,0,3*l,2*l),s.setRenderTarget(t),s.render(o,Um)}_applyPMREM(e){const t=this._renderer,s=t.autoClear;t.autoClear=!1;for(let i=1;iLr&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${b} samples when the maximum is set to ${Lr}`);const g=[];let y=0;for(let A=0;Av-Lo?i-v+Lo:0),x=4*(this._cubeSize-S);Xc(t,w,x,3*S,2*S),l.setRenderTarget(t),l.render(h,Um)}}function qNt(n){const e=[],t=[],s=[];let i=n;const r=n-Lo+1+s1.length;for(let o=0;on-Lo?l=s1[o-n+Lo-1]:o===0&&(l=0),s.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 x=0;x<_;x++){const A=x%3*2/3-1,D=x>2?0:-1,T=[A,D,0,A+2/3,D,0,A+2/3,D+1,0,A,D,0,A+2/3,D+1,0,A,D+1,0];y.set(T,E*m*x),v.set(f,b*m*x);const O=[x,x,x,x,x,x];S.set(O,g*m*x)}const w=new ri;w.setAttribute("position",new Bn(y,E)),w.setAttribute("uv",new Bn(v,b)),w.setAttribute("faceIndex",new Bn(S,g)),e.push(w),i>Lo&&i--}return{lodPlanes:e,sizeLods:t,sigmas:s}}function a1(n,e,t){const s=new Zr(n,e,t);return s.texture.mapping=zu,s.texture.name="PMREM.cubeUv",s.scissorTest=!0,s}function Xc(n,e,t,s,i){n.viewport.set(e,t,s,i),n.scissor.set(e,t,s,i)}function YNt(n,e,t){const s=new Float32Array(Lr),i=new ie(0,1,0);return new Jr({name:"SphericalGaussianBlur",defines:{n:Lr,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:s},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:IE(),fragmentShader:` +}`,vt={alphahash_fragment:oRt,alphahash_pars_fragment:aRt,alphamap_fragment:lRt,alphamap_pars_fragment:cRt,alphatest_fragment:dRt,alphatest_pars_fragment:uRt,aomap_fragment:pRt,aomap_pars_fragment:_Rt,batching_pars_vertex:hRt,batching_vertex:fRt,begin_vertex:mRt,beginnormal_vertex:gRt,bsdfs:bRt,iridescence_fragment:ERt,bumpmap_pars_fragment:yRt,clipping_planes_fragment:vRt,clipping_planes_pars_fragment:SRt,clipping_planes_pars_vertex:TRt,clipping_planes_vertex:xRt,color_fragment:CRt,color_pars_fragment:wRt,color_pars_vertex:RRt,color_vertex:ARt,common:NRt,cube_uv_reflection_fragment:ORt,defaultnormal_vertex:IRt,displacementmap_pars_vertex:MRt,displacementmap_vertex:DRt,emissivemap_fragment:kRt,emissivemap_pars_fragment:LRt,colorspace_fragment:PRt,colorspace_pars_fragment:URt,envmap_fragment:FRt,envmap_common_pars_fragment:BRt,envmap_pars_fragment:GRt,envmap_pars_vertex:VRt,envmap_physical_pars_fragment:JRt,envmap_vertex:zRt,fog_vertex:HRt,fog_pars_vertex:qRt,fog_fragment:YRt,fog_pars_fragment:$Rt,gradientmap_pars_fragment:WRt,lightmap_fragment:KRt,lightmap_pars_fragment:jRt,lights_lambert_fragment:QRt,lights_lambert_pars_fragment:XRt,lights_pars_begin:ZRt,lights_toon_fragment:eAt,lights_toon_pars_fragment:tAt,lights_phong_fragment:nAt,lights_phong_pars_fragment:sAt,lights_physical_fragment:iAt,lights_physical_pars_fragment:rAt,lights_fragment_begin:oAt,lights_fragment_maps:aAt,lights_fragment_end:lAt,logdepthbuf_fragment:cAt,logdepthbuf_pars_fragment:dAt,logdepthbuf_pars_vertex:uAt,logdepthbuf_vertex:pAt,map_fragment:_At,map_pars_fragment:hAt,map_particle_fragment:fAt,map_particle_pars_fragment:mAt,metalnessmap_fragment:gAt,metalnessmap_pars_fragment:bAt,morphcolor_vertex:EAt,morphnormal_vertex:yAt,morphtarget_pars_vertex:vAt,morphtarget_vertex:SAt,normal_fragment_begin:TAt,normal_fragment_maps:xAt,normal_pars_fragment:CAt,normal_pars_vertex:wAt,normal_vertex:RAt,normalmap_pars_fragment:AAt,clearcoat_normal_fragment_begin:NAt,clearcoat_normal_fragment_maps:OAt,clearcoat_pars_fragment:IAt,iridescence_pars_fragment:MAt,opaque_fragment:DAt,packing:kAt,premultiplied_alpha_fragment:LAt,project_vertex:PAt,dithering_fragment:UAt,dithering_pars_fragment:FAt,roughnessmap_fragment:BAt,roughnessmap_pars_fragment:GAt,shadowmap_pars_fragment:VAt,shadowmap_pars_vertex:zAt,shadowmap_vertex:HAt,shadowmask_pars_fragment:qAt,skinbase_vertex:YAt,skinning_pars_vertex:$At,skinning_vertex:WAt,skinnormal_vertex:KAt,specularmap_fragment:jAt,specularmap_pars_fragment:QAt,tonemapping_fragment:XAt,tonemapping_pars_fragment:ZAt,transmission_fragment:JAt,transmission_pars_fragment:eNt,uv_pars_fragment:tNt,uv_pars_vertex:nNt,uv_vertex:sNt,worldpos_vertex:iNt,background_vert:rNt,background_frag:oNt,backgroundCube_vert:aNt,backgroundCube_frag:lNt,cube_vert:cNt,cube_frag:dNt,depth_vert:uNt,depth_frag:pNt,distanceRGBA_vert:_Nt,distanceRGBA_frag:hNt,equirect_vert:fNt,equirect_frag:mNt,linedashed_vert:gNt,linedashed_frag:bNt,meshbasic_vert:ENt,meshbasic_frag:yNt,meshlambert_vert:vNt,meshlambert_frag:SNt,meshmatcap_vert:TNt,meshmatcap_frag:xNt,meshnormal_vert:CNt,meshnormal_frag:wNt,meshphong_vert:RNt,meshphong_frag:ANt,meshphysical_vert:NNt,meshphysical_frag:ONt,meshtoon_vert:INt,meshtoon_frag:MNt,points_vert:DNt,points_frag:kNt,shadow_vert:LNt,shadow_frag:PNt,sprite_vert:UNt,sprite_frag:FNt},$e={common:{diffuse:{value:new ut(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Tt},alphaMap:{value:null},alphaMapTransform:{value:new Tt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Tt}},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 Tt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Tt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Tt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Tt},normalScale:{value:new Rt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Tt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Tt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Tt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Tt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ut(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new ut(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Tt},alphaTest:{value:0},uvTransform:{value:new Tt}},sprite:{diffuse:{value:new ut(16777215)},opacity:{value:1},center:{value:new Rt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Tt},alphaMap:{value:null},alphaMapTransform:{value:new Tt},alphaTest:{value:0}}},zs={basic:{uniforms:Ln([$e.common,$e.specularmap,$e.envmap,$e.aomap,$e.lightmap,$e.fog]),vertexShader:vt.meshbasic_vert,fragmentShader:vt.meshbasic_frag},lambert:{uniforms:Ln([$e.common,$e.specularmap,$e.envmap,$e.aomap,$e.lightmap,$e.emissivemap,$e.bumpmap,$e.normalmap,$e.displacementmap,$e.fog,$e.lights,{emissive:{value:new ut(0)}}]),vertexShader:vt.meshlambert_vert,fragmentShader:vt.meshlambert_frag},phong:{uniforms:Ln([$e.common,$e.specularmap,$e.envmap,$e.aomap,$e.lightmap,$e.emissivemap,$e.bumpmap,$e.normalmap,$e.displacementmap,$e.fog,$e.lights,{emissive:{value:new ut(0)},specular:{value:new ut(1118481)},shininess:{value:30}}]),vertexShader:vt.meshphong_vert,fragmentShader:vt.meshphong_frag},standard:{uniforms:Ln([$e.common,$e.envmap,$e.aomap,$e.lightmap,$e.emissivemap,$e.bumpmap,$e.normalmap,$e.displacementmap,$e.roughnessmap,$e.metalnessmap,$e.fog,$e.lights,{emissive:{value:new ut(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:vt.meshphysical_vert,fragmentShader:vt.meshphysical_frag},toon:{uniforms:Ln([$e.common,$e.aomap,$e.lightmap,$e.emissivemap,$e.bumpmap,$e.normalmap,$e.displacementmap,$e.gradientmap,$e.fog,$e.lights,{emissive:{value:new ut(0)}}]),vertexShader:vt.meshtoon_vert,fragmentShader:vt.meshtoon_frag},matcap:{uniforms:Ln([$e.common,$e.bumpmap,$e.normalmap,$e.displacementmap,$e.fog,{matcap:{value:null}}]),vertexShader:vt.meshmatcap_vert,fragmentShader:vt.meshmatcap_frag},points:{uniforms:Ln([$e.points,$e.fog]),vertexShader:vt.points_vert,fragmentShader:vt.points_frag},dashed:{uniforms:Ln([$e.common,$e.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:vt.linedashed_vert,fragmentShader:vt.linedashed_frag},depth:{uniforms:Ln([$e.common,$e.displacementmap]),vertexShader:vt.depth_vert,fragmentShader:vt.depth_frag},normal:{uniforms:Ln([$e.common,$e.bumpmap,$e.normalmap,$e.displacementmap,{opacity:{value:1}}]),vertexShader:vt.meshnormal_vert,fragmentShader:vt.meshnormal_frag},sprite:{uniforms:Ln([$e.sprite,$e.fog]),vertexShader:vt.sprite_vert,fragmentShader:vt.sprite_frag},background:{uniforms:{uvTransform:{value:new Tt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:vt.background_vert,fragmentShader:vt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:vt.backgroundCube_vert,fragmentShader:vt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:vt.cube_vert,fragmentShader:vt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:vt.equirect_vert,fragmentShader:vt.equirect_frag},distanceRGBA:{uniforms:Ln([$e.common,$e.displacementmap,{referencePosition:{value:new ie},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:vt.distanceRGBA_vert,fragmentShader:vt.distanceRGBA_frag},shadow:{uniforms:Ln([$e.lights,$e.fog,{color:{value:new ut(0)},opacity:{value:1}}]),vertexShader:vt.shadow_vert,fragmentShader:vt.shadow_frag}};zs.physical={uniforms:Ln([zs.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Tt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Tt},clearcoatNormalScale:{value:new Rt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Tt},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Tt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Tt},sheen:{value:0},sheenColor:{value:new ut(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Tt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Tt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Tt},transmissionSamplerSize:{value:new Rt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Tt},attenuationDistance:{value:0},attenuationColor:{value:new ut(0)},specularColor:{value:new ut(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Tt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Tt},anisotropyVector:{value:new Rt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Tt}}]),vertexShader:vt.meshphysical_vert,fragmentShader:vt.meshphysical_frag};const Qc={r:0,b:0,g:0};function BNt(n,e,t,s,i,r,o){const a=new ut(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?t:e).get(v)),v===null?E(a,l):v&&v.isColor&&(E(v,1),y=!0);const S=n.xr.getEnvironmentBlendMode();S==="additive"?s.buffers.color.setClear(0,0,0,1,o):S==="alpha-blend"&&s.buffers.color.setClear(0,0,0,0,o),(n.autoClear||y)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),v&&(v.isCubeTexture||v.mapping===zu)?(d===void 0&&(d=new Un(new dr(1,1,1),new Jr({name:"BackgroundCubeMaterial",uniforms:_a(zs.backgroundCube.uniforms),vertexShader:zs.backgroundCube.vertexShader,fragmentShader:zs.backgroundCube.fragmentShader,side:Yn,depthTest:!1,depthWrite:!1,fog:!1})),d.geometry.deleteAttribute("normal"),d.geometry.deleteAttribute("uv"),d.onBeforeRender=function(w,x,A){this.matrixWorld.copyPosition(A.matrixWorld)},Object.defineProperty(d.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.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=Ut.getTransfer(v.colorSpace)!==Wt,(h!==v||f!==v.version||_!==n.toneMapping)&&(d.material.needsUpdate=!0,h=v,f=v.version,_=n.toneMapping),d.layers.enableAll(),b.unshift(d,d.geometry,d.material,0,0,null)):v&&v.isTexture&&(u===void 0&&(u=new Un(new NE(2,2),new Jr({name:"BackgroundMaterial",uniforms:_a(zs.background.uniforms),vertexShader:zs.background.vertexShader,fragmentShader:zs.background.fragmentShader,side:Oi,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(u)),u.material.uniforms.t2D.value=v,u.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,u.material.toneMapped=Ut.getTransfer(v.colorSpace)!==Wt,v.matrixAutoUpdate===!0&&v.updateMatrix(),u.material.uniforms.uvTransform.value.copy(v.matrix),(h!==v||f!==v.version||_!==n.toneMapping)&&(u.material.needsUpdate=!0,h=v,f=v.version,_=n.toneMapping),u.layers.enableAll(),b.unshift(u,u.geometry,u.material,0,0,null))}function E(b,g){b.getRGB(Qc,yO(n)),s.buffers.color.setClear(Qc.r,Qc.g,Qc.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 GNt(n,e,t,s){const i=n.getParameter(n.MAX_VERTEX_ATTRIBS),r=s.isWebGL2?null:e.get("OES_vertex_array_object"),o=s.isWebGL2||r!==null,a={},l=b(null);let u=l,d=!1;function h(M,q,H,P,$){let J=!1;if(o){const re=E(P,H,q);u!==re&&(u=re,_(u.object)),J=g(M,P,H,$),J&&y(M,P,H,$)}else{const re=q.wireframe===!0;(u.geometry!==P.id||u.program!==H.id||u.wireframe!==re)&&(u.geometry=P.id,u.program=H.id,u.wireframe=re,J=!0)}$!==null&&t.update($,n.ELEMENT_ARRAY_BUFFER),(J||d)&&(d=!1,D(M,q,H,P),$!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get($).buffer))}function f(){return s.isWebGL2?n.createVertexArray():r.createVertexArrayOES()}function _(M){return s.isWebGL2?n.bindVertexArray(M):r.bindVertexArrayOES(M)}function m(M){return s.isWebGL2?n.deleteVertexArray(M):r.deleteVertexArrayOES(M)}function E(M,q,H){const P=H.wireframe===!0;let $=a[M.id];$===void 0&&($={},a[M.id]=$);let J=$[q.id];J===void 0&&(J={},$[q.id]=J);let re=J[P];return re===void 0&&(re=b(f()),J[P]=re),re}function b(M){const q=[],H=[],P=[];for(let $=0;$=0){const Ee=$[Se];let Oe=J[Se];if(Oe===void 0&&(Se==="instanceMatrix"&&M.instanceMatrix&&(Oe=M.instanceMatrix),Se==="instanceColor"&&M.instanceColor&&(Oe=M.instanceColor)),Ee===void 0||Ee.attribute!==Oe||Oe&&Ee.data!==Oe.data)return!0;re++}return u.attributesNum!==re||u.index!==P}function y(M,q,H,P){const $={},J=q.attributes;let re=0;const me=H.getAttributes();for(const Se in me)if(me[Se].location>=0){let Ee=J[Se];Ee===void 0&&(Se==="instanceMatrix"&&M.instanceMatrix&&(Ee=M.instanceMatrix),Se==="instanceColor"&&M.instanceColor&&(Ee=M.instanceColor));const Oe={};Oe.attribute=Ee,Ee&&Ee.data&&(Oe.data=Ee.data),$[Se]=Oe,re++}u.attributes=$,u.attributesNum=re,u.index=P}function v(){const M=u.newAttributes;for(let q=0,H=M.length;q=0){let le=$[me];if(le===void 0&&(me==="instanceMatrix"&&M.instanceMatrix&&(le=M.instanceMatrix),me==="instanceColor"&&M.instanceColor&&(le=M.instanceColor)),le!==void 0){const Ee=le.normalized,Oe=le.itemSize,Me=t.get(le);if(Me===void 0)continue;const j=Me.buffer,pe=Me.type,ue=Me.bytesPerElement,Ce=s.isWebGL2===!0&&(pe===n.INT||pe===n.UNSIGNED_INT||le.gpuType===nO);if(le.isInterleavedBufferAttribute){const ke=le.data,N=ke.stride,V=le.offset;if(ke.isInstancedInterleavedBuffer){for(let Y=0;Y0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";A="mediump"}return A==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&n.constructor.name==="WebGL2RenderingContext";let a=t.precision!==void 0?t.precision:"highp";const l=r(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const u=o||e.has("WEBGL_draw_buffers"),d=t.logarithmicDepthBuffer===!0,h=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),f=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=n.getParameter(n.MAX_TEXTURE_SIZE),m=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),E=n.getParameter(n.MAX_VERTEX_ATTRIBS),b=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),g=n.getParameter(n.MAX_VARYING_VECTORS),y=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),v=f>0,S=o||e.has("OES_texture_float"),w=v&&S,x=o?n.getParameter(n.MAX_SAMPLES):0;return{isWebGL2:o,drawBuffers:u,getMaxAnisotropy:i,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:w,maxSamples:x}}function HNt(n){const e=this;let t=null,s=0,i=!1,r=!1;const o=new Ar,a=new Tt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,f){const _=h.length!==0||f||s!==0||i;return i=f,s=h.length,_},this.beginShadows=function(){r=!0,d(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(h,f){t=d(h,f,0)},this.setState=function(h,f,_){const m=h.clippingPlanes,E=h.clipIntersection,b=h.clipShadows,g=n.get(h);if(!i||m===null||m.length===0||r&&!b)r?d(null):u();else{const y=r?0:s,v=y*4;let S=g.clippingState||null;l.value=S,S=d(m,f,v,_);for(let w=0;w!==v;++w)S[w]=t[w];g.clippingState=S,this.numIntersection=E?this.numPlanes:0,this.numPlanes+=y}};function u(){l.value!==t&&(l.value=t,l.needsUpdate=s>0),e.numPlanes=s,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 nRt(l.height/2);return u.fromEquirectangularTexture(n,o),e.set(o,u),o.addEventListener("dispose",i),t(u.texture,o.mapping)}else return null}}return o}function i(o){const a=o.target;a.removeEventListener("dispose",i);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function r(){e=new WeakMap}return{get:s,dispose:r}}class OE extends vO{constructor(e=-1,t=1,s=1,i=-1,r=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=s,this.bottom=i,this.near=r,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,s,i,r,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=s,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),s=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let r=s-e,o=s+e,a=i+t,l=i-t;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 t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const Lo=4,s1=[.125,.215,.35,.446,.526,.582],Lr=20,Um=new OE,i1=new ut;let Fm=null,Bm=0,Gm=0;const Nr=(1+Math.sqrt(5))/2,No=1/Nr,r1=[new ie(1,1,1),new ie(-1,1,1),new ie(1,1,-1),new ie(-1,1,-1),new ie(0,Nr,No),new ie(0,Nr,-No),new ie(No,0,Nr),new ie(-No,0,Nr),new ie(Nr,No,0),new ie(-Nr,No,0)];class o1{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,s=.1,i=100){Fm=this._renderer.getRenderTarget(),Bm=this._renderer.getActiveCubeFace(),Gm=this._renderer.getActiveMipmapLevel(),this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(e,s,i,r),t>0&&this._blur(r,0,0,t),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=c1(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=l1(),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(i),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,t){const s=this._renderer,i=e.mapping===aa||e.mapping===la;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=c1()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=l1());const r=i?this._cubemapMaterial:this._equirectMaterial,o=new Un(this._lodPlanes[0],r),a=r.uniforms;a.envMap.value=e;const l=this._cubeSize;Xc(t,0,0,3*l,2*l),s.setRenderTarget(t),s.render(o,Um)}_applyPMREM(e){const t=this._renderer,s=t.autoClear;t.autoClear=!1;for(let i=1;iLr&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${b} samples when the maximum is set to ${Lr}`);const g=[];let y=0;for(let A=0;Av-Lo?i-v+Lo:0),x=4*(this._cubeSize-S);Xc(t,w,x,3*S,2*S),l.setRenderTarget(t),l.render(h,Um)}}function YNt(n){const e=[],t=[],s=[];let i=n;const r=n-Lo+1+s1.length;for(let o=0;on-Lo?l=s1[o-n+Lo-1]:o===0&&(l=0),s.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 x=0;x<_;x++){const A=x%3*2/3-1,D=x>2?0:-1,T=[A,D,0,A+2/3,D,0,A+2/3,D+1,0,A,D,0,A+2/3,D+1,0,A,D+1,0];y.set(T,E*m*x),v.set(f,b*m*x);const O=[x,x,x,x,x,x];S.set(O,g*m*x)}const w=new ri;w.setAttribute("position",new Bn(y,E)),w.setAttribute("uv",new Bn(v,b)),w.setAttribute("faceIndex",new Bn(S,g)),e.push(w),i>Lo&&i--}return{lodPlanes:e,sizeLods:t,sigmas:s}}function a1(n,e,t){const s=new Zr(n,e,t);return s.texture.mapping=zu,s.texture.name="PMREM.cubeUv",s.scissorTest=!0,s}function Xc(n,e,t,s,i){n.viewport.set(e,t,s,i),n.scissor.set(e,t,s,i)}function $Nt(n,e,t){const s=new Float32Array(Lr),i=new ie(0,1,0);return new Jr({name:"SphericalGaussianBlur",defines:{n:Lr,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:s},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:IE(),fragmentShader:` precision mediump float; precision mediump int; @@ -3841,26 +3842,26 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function $Nt(n){let e=new WeakMap,t=null;function s(a){if(a&&a.isTexture){const l=a.mapping,u=l===Pg||l===Ug,d=l===aa||l===la;if(u||d)if(a.isRenderTargetTexture&&a.needsPMREMUpdate===!0){a.needsPMREMUpdate=!1;let h=e.get(a);return t===null&&(t=new o1(n)),h=u?t.fromEquirectangular(a,h):t.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&&i(h)){t===null&&(t=new o1(n));const f=u?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,f),a.addEventListener("dispose",r),f.texture}else return null}}}return a}function i(a){let l=0;const u=6;for(let d=0;de.maxTextureSize&&(F=Math.ceil(O/e.maxTextureSize),O=e.maxTextureSize);const z=new Float32Array(O*F*4*E),Z=new fO(z,O,F,E);Z.type=vi,Z.needsUpdate=!0;const M=T*4;for(let H=0;H0)return n;const i=e*t;let r=d1[i];if(r===void 0&&(r=new Float32Array(i),d1[i]=r),e!==0){s.toArray(r,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(r,a)}return r}function pn(n,e){if(n.length!==e.length)return!1;for(let t=0,s=n.length;t0||d&&h&&i(h)){t===null&&(t=new o1(n));const f=u?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,f),a.addEventListener("dispose",r),f.texture}else return null}}}return a}function i(a){let l=0;const u=6;for(let d=0;de.maxTextureSize&&(F=Math.ceil(O/e.maxTextureSize),O=e.maxTextureSize);const z=new Float32Array(O*F*4*E),Z=new fO(z,O,F,E);Z.type=vi,Z.needsUpdate=!0;const M=T*4;for(let H=0;H0)return n;const i=e*t;let r=d1[i];if(r===void 0&&(r=new Float32Array(i),d1[i]=r),e!==0){s.toArray(r,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(r,a)}return r}function pn(n,e){if(n.length!==e.length)return!1;for(let t=0,s=n.length;t":" "} ${a}: ${t[o]}`)}return s.join(` -`)}function KOt(n){const e=Ut.getPrimaries(Ut.workingColorSpace),t=Ut.getPrimaries(n);let s;switch(e===t?s="":e===Qd&&t===jd?s="LinearDisplayP3ToLinearSRGB":e===jd&&t===Qd&&(s="LinearSRGBToLinearDisplayP3"),n){case Cn:case Hu:return[s,"LinearTransferOETF"];case en:case wE:return[s,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),[s,"LinearTransferOETF"]}}function g1(n,e,t){const s=n.getShaderParameter(e,n.COMPILE_STATUS),i=n.getShaderInfoLog(e).trim();if(s&&i==="")return"";const r=/ERROR: 0:(\d+)/.exec(i);if(r){const o=parseInt(r[1]);return t.toUpperCase()+` +`)}function jOt(n){const e=Ut.getPrimaries(Ut.workingColorSpace),t=Ut.getPrimaries(n);let s;switch(e===t?s="":e===Qd&&t===jd?s="LinearDisplayP3ToLinearSRGB":e===jd&&t===Qd&&(s="LinearSRGBToLinearDisplayP3"),n){case Cn:case Hu:return[s,"LinearTransferOETF"];case en:case wE:return[s,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),[s,"LinearTransferOETF"]}}function g1(n,e,t){const s=n.getShaderParameter(e,n.COMPILE_STATUS),i=n.getShaderInfoLog(e).trim();if(s&&i==="")return"";const r=/ERROR: 0:(\d+)/.exec(i);if(r){const o=parseInt(r[1]);return t.toUpperCase()+` `+i+` -`+WOt(n.getShaderSource(e),o)}else return i}function jOt(n,e){const t=KOt(e);return`vec4 ${n}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function QOt(n,e){let t;switch(e){case $1t:t="Linear";break;case W1t:t="Reinhard";break;case K1t:t="OptimizedCineon";break;case j1t:t="ACESFilmic";break;case Q1t:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function XOt(n){return[n.extensionDerivatives||n.envMapCubeUVHeight||n.bumpMap||n.normalMapTangentSpace||n.clearcoatNormalMap||n.flatShading||n.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(n.extensionFragDepth||n.logarithmicDepthBuffer)&&n.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",n.extensionDrawBuffers&&n.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(n.extensionShaderTextureLOD||n.envMap||n.transmission)&&n.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(ol).join(` -`)}function ZOt(n){const e=[];for(const t in n){const s=n[t];s!==!1&&e.push("#define "+t+" "+s)}return e.join(` -`)}function JOt(n,e){const t={},s=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let i=0;i/gm;function Hg(n){return n.replace(eIt,nIt)}const tIt=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function nIt(n,e){let t=vt[e];if(t===void 0){const s=tIt.get(e);if(s!==void 0)t=vt[s],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,s);else throw new Error("Can not resolve #include <"+e+">")}return Hg(t)}const sIt=/#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 y1(n){return n.replace(sIt,iIt)}function iIt(n,e,t,s){let i="";for(let r=parseInt(e);r/gm;function Hg(n){return n.replace(tIt,sIt)}const nIt=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function sIt(n,e){let t=vt[e];if(t===void 0){const s=nIt.get(e);if(s!==void 0)t=vt[s],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,s);else throw new Error("Can not resolve #include <"+e+">")}return Hg(t)}const iIt=/#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 y1(n){return n.replace(iIt,rIt)}function rIt(n,e,t,s){let i="";for(let r=parseInt(e);r0&&(b+=` `),g=[_,"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m].filter(ol).join(` `),g.length>0&&(g+=` `)):(b=[v1(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m,t.batching?"#define USE_BATCHING":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+d:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` `].filter(ol).join(` -`),g=[_,v1(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.envMap?"#define "+d:"",t.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":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==lr?"#define TONE_MAPPING":"",t.toneMapping!==lr?vt.tonemapping_pars_fragment:"",t.toneMapping!==lr?QOt("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",vt.colorspace_pars_fragment,jOt("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` +`),g=[_,v1(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.envMap?"#define "+d:"",t.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":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==lr?"#define TONE_MAPPING":"",t.toneMapping!==lr?vt.tonemapping_pars_fragment:"",t.toneMapping!==lr?XOt("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",vt.colorspace_pars_fragment,QOt("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` `].filter(ol).join(` `)),o=Hg(o),o=b1(o,t),o=E1(o,t),a=Hg(a),a=b1(a,t),a=E1(a,t),o=y1(o),a=y1(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(y=`#version 300 es `,b=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` @@ -3871,9 +3872,9 @@ precision `+n.precision+" int;";return n.precision==="highp"?e+=` Program Info Log: `+z+` `+P+` -`+$)}else z!==""?console.warn("THREE.WebGLProgram: Program Info Log:",z):(Z===""||M==="")&&(H=!1);H&&(F.diagnostics={runnable:q,programLog:z,vertexShader:{log:Z,prefix:b},fragmentShader:{log:M,prefix:g}})}i.deleteShader(w),i.deleteShader(x),D=new Ed(i,E),T=JOt(i,E)}let D;this.getUniforms=function(){return D===void 0&&A(this),D};let T;this.getAttributes=function(){return T===void 0&&A(this),T};let O=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return O===!1&&(O=i.getProgramParameter(E,YOt)),O},this.destroy=function(){s.releaseStatesOfProgram(this),i.deleteProgram(E),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=$Ot++,this.cacheKey=e,this.usedTimes=1,this.program=E,this.vertexShader=w,this.fragmentShader=x,this}let uIt=0;class pIt{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,s=e.fragmentShader,i=this._getShaderStage(t),r=this._getShaderStage(s),o=this._getShaderCacheForMaterial(e);return o.has(i)===!1&&(o.add(i),i.usedTimes++),o.has(r)===!1&&(o.add(r),r.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const s of t)s.usedTimes--,s.usedTimes===0&&this.shaderCache.delete(s.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let s=t.get(e);return s===void 0&&(s=new Set,t.set(e,s)),s}_getShaderStage(e){const t=this.shaderCache;let s=t.get(e);return s===void 0&&(s=new _It(e),t.set(e,s)),s}}class _It{constructor(e){this.id=uIt++,this.code=e,this.usedTimes=0}}function hIt(n,e,t,s,i,r,o){const a=new mO,l=new pIt,u=[],d=i.isWebGL2,h=i.logarithmicDepthBuffer,f=i.vertexTextures;let _=i.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(T){return T===0?"uv":`uv${T}`}function b(T,O,F,z,Z){const M=z.fog,q=Z.geometry,H=T.isMeshStandardMaterial?z.environment:null,P=(T.isMeshStandardMaterial?t:e).get(T.envMap||H),$=P&&P.mapping===zu?P.image.height:null,J=m[T.type];T.precision!==null&&(_=i.getMaxPrecision(T.precision),_!==T.precision&&console.warn("THREE.WebGLProgram.getParameters:",T.precision,"not supported, using",_,"instead."));const re=q.morphAttributes.position||q.morphAttributes.normal||q.morphAttributes.color,me=re!==void 0?re.length:0;let Se=0;q.morphAttributes.position!==void 0&&(Se=1),q.morphAttributes.normal!==void 0&&(Se=2),q.morphAttributes.color!==void 0&&(Se=3);let le,Ee,Oe,Me;if(J){const bn=zs[J];le=bn.vertexShader,Ee=bn.fragmentShader}else le=T.vertexShader,Ee=T.fragmentShader,l.update(T),Oe=l.getVertexShaderID(T),Me=l.getFragmentShaderID(T);const j=n.getRenderTarget(),pe=Z.isInstancedMesh===!0,ue=Z.isBatchedMesh===!0,Ce=!!T.map,ke=!!T.matcap,N=!!P,V=!!T.aoMap,Y=!!T.lightMap,oe=!!T.bumpMap,ne=!!T.normalMap,Te=!!T.displacementMap,Ae=!!T.emissiveMap,te=!!T.metalnessMap,we=!!T.roughnessMap,ge=T.anisotropy>0,De=T.clearcoat>0,k=T.iridescence>0,I=T.sheen>0,W=T.transmission>0,ye=ge&&!!T.anisotropyMap,K=De&&!!T.clearcoatMap,ee=De&&!!T.clearcoatNormalMap,Re=De&&!!T.clearcoatRoughnessMap,xe=k&&!!T.iridescenceMap,Le=k&&!!T.iridescenceThicknessMap,Ze=I&&!!T.sheenColorMap,ht=I&&!!T.sheenRoughnessMap,Pe=!!T.specularMap,ct=!!T.specularColorMap,tt=!!T.specularIntensityMap,Ye=W&&!!T.transmissionMap,et=W&&!!T.thicknessMap,We=!!T.gradientMap,Et=!!T.alphaMap,X=T.alphaTest>0,je=!!T.alphaHash,Be=!!T.extensions,Ne=!!q.attributes.uv1,Ve=!!q.attributes.uv2,ot=!!q.attributes.uv3;let Nt=lr;return T.toneMapped&&(j===null||j.isXRRenderTarget===!0)&&(Nt=n.toneMapping),{isWebGL2:d,shaderID:J,shaderType:T.type,shaderName:T.name,vertexShader:le,fragmentShader:Ee,defines:T.defines,customVertexShaderID:Oe,customFragmentShaderID:Me,isRawShaderMaterial:T.isRawShaderMaterial===!0,glslVersion:T.glslVersion,precision:_,batching:ue,instancing:pe,instancingColor:pe&&Z.instanceColor!==null,supportsVertexTextures:f,outputColorSpace:j===null?n.outputColorSpace:j.isXRRenderTarget===!0?j.texture.colorSpace:Cn,map:Ce,matcap:ke,envMap:N,envMapMode:N&&P.mapping,envMapCubeUVHeight:$,aoMap:V,lightMap:Y,bumpMap:oe,normalMap:ne,displacementMap:f&&Te,emissiveMap:Ae,normalMapObjectSpace:ne&&T.normalMapType===dwt,normalMapTangentSpace:ne&&T.normalMapType===CE,metalnessMap:te,roughnessMap:we,anisotropy:ge,anisotropyMap:ye,clearcoat:De,clearcoatMap:K,clearcoatNormalMap:ee,clearcoatRoughnessMap:Re,iridescence:k,iridescenceMap:xe,iridescenceThicknessMap:Le,sheen:I,sheenColorMap:Ze,sheenRoughnessMap:ht,specularMap:Pe,specularColorMap:ct,specularIntensityMap:tt,transmission:W,transmissionMap:Ye,thicknessMap:et,gradientMap:We,opaque:T.transparent===!1&&T.blending===Yo,alphaMap:Et,alphaTest:X,alphaHash:je,combine:T.combine,mapUv:Ce&&E(T.map.channel),aoMapUv:V&&E(T.aoMap.channel),lightMapUv:Y&&E(T.lightMap.channel),bumpMapUv:oe&&E(T.bumpMap.channel),normalMapUv:ne&&E(T.normalMap.channel),displacementMapUv:Te&&E(T.displacementMap.channel),emissiveMapUv:Ae&&E(T.emissiveMap.channel),metalnessMapUv:te&&E(T.metalnessMap.channel),roughnessMapUv:we&&E(T.roughnessMap.channel),anisotropyMapUv:ye&&E(T.anisotropyMap.channel),clearcoatMapUv:K&&E(T.clearcoatMap.channel),clearcoatNormalMapUv:ee&&E(T.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Re&&E(T.clearcoatRoughnessMap.channel),iridescenceMapUv:xe&&E(T.iridescenceMap.channel),iridescenceThicknessMapUv:Le&&E(T.iridescenceThicknessMap.channel),sheenColorMapUv:Ze&&E(T.sheenColorMap.channel),sheenRoughnessMapUv:ht&&E(T.sheenRoughnessMap.channel),specularMapUv:Pe&&E(T.specularMap.channel),specularColorMapUv:ct&&E(T.specularColorMap.channel),specularIntensityMapUv:tt&&E(T.specularIntensityMap.channel),transmissionMapUv:Ye&&E(T.transmissionMap.channel),thicknessMapUv:et&&E(T.thicknessMap.channel),alphaMapUv:Et&&E(T.alphaMap.channel),vertexTangents:!!q.attributes.tangent&&(ne||ge),vertexColors:T.vertexColors,vertexAlphas:T.vertexColors===!0&&!!q.attributes.color&&q.attributes.color.itemSize===4,vertexUv1s:Ne,vertexUv2s:Ve,vertexUv3s:ot,pointsUvs:Z.isPoints===!0&&!!q.attributes.uv&&(Ce||Et),fog:!!M,useFog:T.fog===!0,fogExp2:M&&M.isFogExp2,flatShading:T.flatShading===!0,sizeAttenuation:T.sizeAttenuation===!0,logarithmicDepthBuffer:h,skinning:Z.isSkinnedMesh===!0,morphTargets:q.morphAttributes.position!==void 0,morphNormals:q.morphAttributes.normal!==void 0,morphColors:q.morphAttributes.color!==void 0,morphTargetsCount:me,morphTextureStride:Se,numDirLights:O.directional.length,numPointLights:O.point.length,numSpotLights:O.spot.length,numSpotLightMaps:O.spotLightMap.length,numRectAreaLights:O.rectArea.length,numHemiLights:O.hemi.length,numDirLightShadows:O.directionalShadowMap.length,numPointLightShadows:O.pointShadowMap.length,numSpotLightShadows:O.spotShadowMap.length,numSpotLightShadowsWithMaps:O.numSpotLightShadowsWithMaps,numLightProbes:O.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:T.dithering,shadowMapEnabled:n.shadowMap.enabled&&F.length>0,shadowMapType:n.shadowMap.type,toneMapping:Nt,useLegacyLights:n._useLegacyLights,decodeVideoTexture:Ce&&T.map.isVideoTexture===!0&&Ut.getTransfer(T.map.colorSpace)===Wt,premultipliedAlpha:T.premultipliedAlpha,doubleSided:T.side===qs,flipSided:T.side===Yn,useDepthPacking:T.depthPacking>=0,depthPacking:T.depthPacking||0,index0AttributeName:T.index0AttributeName,extensionDerivatives:Be&&T.extensions.derivatives===!0,extensionFragDepth:Be&&T.extensions.fragDepth===!0,extensionDrawBuffers:Be&&T.extensions.drawBuffers===!0,extensionShaderTextureLOD:Be&&T.extensions.shaderTextureLOD===!0,rendererExtensionFragDepth:d||s.has("EXT_frag_depth"),rendererExtensionDrawBuffers:d||s.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:d||s.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:s.has("KHR_parallel_shader_compile"),customProgramCacheKey:T.customProgramCacheKey()}}function g(T){const O=[];if(T.shaderID?O.push(T.shaderID):(O.push(T.customVertexShaderID),O.push(T.customFragmentShaderID)),T.defines!==void 0)for(const F in T.defines)O.push(F),O.push(T.defines[F]);return T.isRawShaderMaterial===!1&&(y(O,T),v(O,T),O.push(n.outputColorSpace)),O.push(T.customProgramCacheKey),O.join()}function y(T,O){T.push(O.precision),T.push(O.outputColorSpace),T.push(O.envMapMode),T.push(O.envMapCubeUVHeight),T.push(O.mapUv),T.push(O.alphaMapUv),T.push(O.lightMapUv),T.push(O.aoMapUv),T.push(O.bumpMapUv),T.push(O.normalMapUv),T.push(O.displacementMapUv),T.push(O.emissiveMapUv),T.push(O.metalnessMapUv),T.push(O.roughnessMapUv),T.push(O.anisotropyMapUv),T.push(O.clearcoatMapUv),T.push(O.clearcoatNormalMapUv),T.push(O.clearcoatRoughnessMapUv),T.push(O.iridescenceMapUv),T.push(O.iridescenceThicknessMapUv),T.push(O.sheenColorMapUv),T.push(O.sheenRoughnessMapUv),T.push(O.specularMapUv),T.push(O.specularColorMapUv),T.push(O.specularIntensityMapUv),T.push(O.transmissionMapUv),T.push(O.thicknessMapUv),T.push(O.combine),T.push(O.fogExp2),T.push(O.sizeAttenuation),T.push(O.morphTargetsCount),T.push(O.morphAttributeCount),T.push(O.numDirLights),T.push(O.numPointLights),T.push(O.numSpotLights),T.push(O.numSpotLightMaps),T.push(O.numHemiLights),T.push(O.numRectAreaLights),T.push(O.numDirLightShadows),T.push(O.numPointLightShadows),T.push(O.numSpotLightShadows),T.push(O.numSpotLightShadowsWithMaps),T.push(O.numLightProbes),T.push(O.shadowMapType),T.push(O.toneMapping),T.push(O.numClippingPlanes),T.push(O.numClipIntersection),T.push(O.depthPacking)}function v(T,O){a.disableAll(),O.isWebGL2&&a.enable(0),O.supportsVertexTextures&&a.enable(1),O.instancing&&a.enable(2),O.instancingColor&&a.enable(3),O.matcap&&a.enable(4),O.envMap&&a.enable(5),O.normalMapObjectSpace&&a.enable(6),O.normalMapTangentSpace&&a.enable(7),O.clearcoat&&a.enable(8),O.iridescence&&a.enable(9),O.alphaTest&&a.enable(10),O.vertexColors&&a.enable(11),O.vertexAlphas&&a.enable(12),O.vertexUv1s&&a.enable(13),O.vertexUv2s&&a.enable(14),O.vertexUv3s&&a.enable(15),O.vertexTangents&&a.enable(16),O.anisotropy&&a.enable(17),O.alphaHash&&a.enable(18),O.batching&&a.enable(19),T.push(a.mask),a.disableAll(),O.fog&&a.enable(0),O.useFog&&a.enable(1),O.flatShading&&a.enable(2),O.logarithmicDepthBuffer&&a.enable(3),O.skinning&&a.enable(4),O.morphTargets&&a.enable(5),O.morphNormals&&a.enable(6),O.morphColors&&a.enable(7),O.premultipliedAlpha&&a.enable(8),O.shadowMapEnabled&&a.enable(9),O.useLegacyLights&&a.enable(10),O.doubleSided&&a.enable(11),O.flipSided&&a.enable(12),O.useDepthPacking&&a.enable(13),O.dithering&&a.enable(14),O.transmission&&a.enable(15),O.sheen&&a.enable(16),O.opaque&&a.enable(17),O.pointsUvs&&a.enable(18),O.decodeVideoTexture&&a.enable(19),T.push(a.mask)}function S(T){const O=m[T.type];let F;if(O){const z=zs[O];F=Xwt.clone(z.uniforms)}else F=T.uniforms;return F}function w(T,O){let F;for(let z=0,Z=u.length;z0?s.push(g):_.transparent===!0?i.push(g):t.push(g)}function l(h,f,_,m,E,b){const g=o(h,f,_,m,E,b);_.transmission>0?s.unshift(g):_.transparent===!0?i.unshift(g):t.unshift(g)}function u(h,f){t.length>1&&t.sort(h||mIt),s.length>1&&s.sort(f||S1),i.length>1&&i.sort(f||S1)}function d(){for(let h=e,f=n.length;h=r.length?(o=new T1,r.push(o)):o=r[i],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function bIt(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new ie,color:new ut};break;case"SpotLight":t={position:new ie,direction:new ie,color:new ut,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new ie,color:new ut,distance:0,decay:0};break;case"HemisphereLight":t={direction:new ie,skyColor:new ut,groundColor:new ut};break;case"RectAreaLight":t={color:new ut,position:new ie,halfWidth:new ie,halfHeight:new ie};break}return n[e.id]=t,t}}}function EIt(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Rt};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Rt};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Rt,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let yIt=0;function vIt(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function SIt(n,e){const t=new bIt,s=EIt(),i={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++)i.probe.push(new ie);const r=new ie,o=new xt,a=new xt;function l(d,h){let f=0,_=0,m=0;for(let z=0;z<9;z++)i.probe[z].set(0,0,0);let E=0,b=0,g=0,y=0,v=0,S=0,w=0,x=0,A=0,D=0,T=0;d.sort(vIt);const O=h===!0?Math.PI:1;for(let z=0,Z=d.length;z0&&(e.isWebGL2||n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=$e.LTC_FLOAT_1,i.rectAreaLTC2=$e.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=$e.LTC_HALF_1,i.rectAreaLTC2=$e.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=f,i.ambient[1]=_,i.ambient[2]=m;const F=i.hash;(F.directionalLength!==E||F.pointLength!==b||F.spotLength!==g||F.rectAreaLength!==y||F.hemiLength!==v||F.numDirectionalShadows!==S||F.numPointShadows!==w||F.numSpotShadows!==x||F.numSpotMaps!==A||F.numLightProbes!==T)&&(i.directional.length=E,i.spot.length=g,i.rectArea.length=y,i.point.length=b,i.hemi.length=v,i.directionalShadow.length=S,i.directionalShadowMap.length=S,i.pointShadow.length=w,i.pointShadowMap.length=w,i.spotShadow.length=x,i.spotShadowMap.length=x,i.directionalShadowMatrix.length=S,i.pointShadowMatrix.length=w,i.spotLightMatrix.length=x+A-D,i.spotLightMap.length=A,i.numSpotLightShadowsWithMaps=D,i.numLightProbes=T,F.directionalLength=E,F.pointLength=b,F.spotLength=g,F.rectAreaLength=y,F.hemiLength=v,F.numDirectionalShadows=S,F.numPointShadows=w,F.numSpotShadows=x,F.numSpotMaps=A,F.numLightProbes=T,i.version=yIt++)}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 x1(n,e),a.push(l)):l=a[o],l}function i(){t=new WeakMap}return{get:s,dispose:i}}class xIt extends ks{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=lwt,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 CIt extends ks{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 wIt=`void main() { +`+$)}else z!==""?console.warn("THREE.WebGLProgram: Program Info Log:",z):(Z===""||M==="")&&(H=!1);H&&(F.diagnostics={runnable:q,programLog:z,vertexShader:{log:Z,prefix:b},fragmentShader:{log:M,prefix:g}})}i.deleteShader(w),i.deleteShader(x),D=new Ed(i,E),T=eIt(i,E)}let D;this.getUniforms=function(){return D===void 0&&A(this),D};let T;this.getAttributes=function(){return T===void 0&&A(this),T};let O=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return O===!1&&(O=i.getProgramParameter(E,$Ot)),O},this.destroy=function(){s.releaseStatesOfProgram(this),i.deleteProgram(E),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=WOt++,this.cacheKey=e,this.usedTimes=1,this.program=E,this.vertexShader=w,this.fragmentShader=x,this}let pIt=0;class _It{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,s=e.fragmentShader,i=this._getShaderStage(t),r=this._getShaderStage(s),o=this._getShaderCacheForMaterial(e);return o.has(i)===!1&&(o.add(i),i.usedTimes++),o.has(r)===!1&&(o.add(r),r.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const s of t)s.usedTimes--,s.usedTimes===0&&this.shaderCache.delete(s.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let s=t.get(e);return s===void 0&&(s=new Set,t.set(e,s)),s}_getShaderStage(e){const t=this.shaderCache;let s=t.get(e);return s===void 0&&(s=new hIt(e),t.set(e,s)),s}}class hIt{constructor(e){this.id=pIt++,this.code=e,this.usedTimes=0}}function fIt(n,e,t,s,i,r,o){const a=new mO,l=new _It,u=[],d=i.isWebGL2,h=i.logarithmicDepthBuffer,f=i.vertexTextures;let _=i.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(T){return T===0?"uv":`uv${T}`}function b(T,O,F,z,Z){const M=z.fog,q=Z.geometry,H=T.isMeshStandardMaterial?z.environment:null,P=(T.isMeshStandardMaterial?t:e).get(T.envMap||H),$=P&&P.mapping===zu?P.image.height:null,J=m[T.type];T.precision!==null&&(_=i.getMaxPrecision(T.precision),_!==T.precision&&console.warn("THREE.WebGLProgram.getParameters:",T.precision,"not supported, using",_,"instead."));const re=q.morphAttributes.position||q.morphAttributes.normal||q.morphAttributes.color,me=re!==void 0?re.length:0;let Se=0;q.morphAttributes.position!==void 0&&(Se=1),q.morphAttributes.normal!==void 0&&(Se=2),q.morphAttributes.color!==void 0&&(Se=3);let le,Ee,Oe,Me;if(J){const bn=zs[J];le=bn.vertexShader,Ee=bn.fragmentShader}else le=T.vertexShader,Ee=T.fragmentShader,l.update(T),Oe=l.getVertexShaderID(T),Me=l.getFragmentShaderID(T);const j=n.getRenderTarget(),pe=Z.isInstancedMesh===!0,ue=Z.isBatchedMesh===!0,Ce=!!T.map,ke=!!T.matcap,N=!!P,V=!!T.aoMap,Y=!!T.lightMap,oe=!!T.bumpMap,ne=!!T.normalMap,Te=!!T.displacementMap,Ae=!!T.emissiveMap,te=!!T.metalnessMap,we=!!T.roughnessMap,ge=T.anisotropy>0,De=T.clearcoat>0,k=T.iridescence>0,I=T.sheen>0,W=T.transmission>0,ye=ge&&!!T.anisotropyMap,K=De&&!!T.clearcoatMap,ee=De&&!!T.clearcoatNormalMap,Re=De&&!!T.clearcoatRoughnessMap,xe=k&&!!T.iridescenceMap,Le=k&&!!T.iridescenceThicknessMap,Ze=I&&!!T.sheenColorMap,ht=I&&!!T.sheenRoughnessMap,Pe=!!T.specularMap,ct=!!T.specularColorMap,tt=!!T.specularIntensityMap,Ye=W&&!!T.transmissionMap,et=W&&!!T.thicknessMap,We=!!T.gradientMap,Et=!!T.alphaMap,X=T.alphaTest>0,je=!!T.alphaHash,Be=!!T.extensions,Ne=!!q.attributes.uv1,Ve=!!q.attributes.uv2,ot=!!q.attributes.uv3;let Nt=lr;return T.toneMapped&&(j===null||j.isXRRenderTarget===!0)&&(Nt=n.toneMapping),{isWebGL2:d,shaderID:J,shaderType:T.type,shaderName:T.name,vertexShader:le,fragmentShader:Ee,defines:T.defines,customVertexShaderID:Oe,customFragmentShaderID:Me,isRawShaderMaterial:T.isRawShaderMaterial===!0,glslVersion:T.glslVersion,precision:_,batching:ue,instancing:pe,instancingColor:pe&&Z.instanceColor!==null,supportsVertexTextures:f,outputColorSpace:j===null?n.outputColorSpace:j.isXRRenderTarget===!0?j.texture.colorSpace:Cn,map:Ce,matcap:ke,envMap:N,envMapMode:N&&P.mapping,envMapCubeUVHeight:$,aoMap:V,lightMap:Y,bumpMap:oe,normalMap:ne,displacementMap:f&&Te,emissiveMap:Ae,normalMapObjectSpace:ne&&T.normalMapType===uwt,normalMapTangentSpace:ne&&T.normalMapType===CE,metalnessMap:te,roughnessMap:we,anisotropy:ge,anisotropyMap:ye,clearcoat:De,clearcoatMap:K,clearcoatNormalMap:ee,clearcoatRoughnessMap:Re,iridescence:k,iridescenceMap:xe,iridescenceThicknessMap:Le,sheen:I,sheenColorMap:Ze,sheenRoughnessMap:ht,specularMap:Pe,specularColorMap:ct,specularIntensityMap:tt,transmission:W,transmissionMap:Ye,thicknessMap:et,gradientMap:We,opaque:T.transparent===!1&&T.blending===Yo,alphaMap:Et,alphaTest:X,alphaHash:je,combine:T.combine,mapUv:Ce&&E(T.map.channel),aoMapUv:V&&E(T.aoMap.channel),lightMapUv:Y&&E(T.lightMap.channel),bumpMapUv:oe&&E(T.bumpMap.channel),normalMapUv:ne&&E(T.normalMap.channel),displacementMapUv:Te&&E(T.displacementMap.channel),emissiveMapUv:Ae&&E(T.emissiveMap.channel),metalnessMapUv:te&&E(T.metalnessMap.channel),roughnessMapUv:we&&E(T.roughnessMap.channel),anisotropyMapUv:ye&&E(T.anisotropyMap.channel),clearcoatMapUv:K&&E(T.clearcoatMap.channel),clearcoatNormalMapUv:ee&&E(T.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Re&&E(T.clearcoatRoughnessMap.channel),iridescenceMapUv:xe&&E(T.iridescenceMap.channel),iridescenceThicknessMapUv:Le&&E(T.iridescenceThicknessMap.channel),sheenColorMapUv:Ze&&E(T.sheenColorMap.channel),sheenRoughnessMapUv:ht&&E(T.sheenRoughnessMap.channel),specularMapUv:Pe&&E(T.specularMap.channel),specularColorMapUv:ct&&E(T.specularColorMap.channel),specularIntensityMapUv:tt&&E(T.specularIntensityMap.channel),transmissionMapUv:Ye&&E(T.transmissionMap.channel),thicknessMapUv:et&&E(T.thicknessMap.channel),alphaMapUv:Et&&E(T.alphaMap.channel),vertexTangents:!!q.attributes.tangent&&(ne||ge),vertexColors:T.vertexColors,vertexAlphas:T.vertexColors===!0&&!!q.attributes.color&&q.attributes.color.itemSize===4,vertexUv1s:Ne,vertexUv2s:Ve,vertexUv3s:ot,pointsUvs:Z.isPoints===!0&&!!q.attributes.uv&&(Ce||Et),fog:!!M,useFog:T.fog===!0,fogExp2:M&&M.isFogExp2,flatShading:T.flatShading===!0,sizeAttenuation:T.sizeAttenuation===!0,logarithmicDepthBuffer:h,skinning:Z.isSkinnedMesh===!0,morphTargets:q.morphAttributes.position!==void 0,morphNormals:q.morphAttributes.normal!==void 0,morphColors:q.morphAttributes.color!==void 0,morphTargetsCount:me,morphTextureStride:Se,numDirLights:O.directional.length,numPointLights:O.point.length,numSpotLights:O.spot.length,numSpotLightMaps:O.spotLightMap.length,numRectAreaLights:O.rectArea.length,numHemiLights:O.hemi.length,numDirLightShadows:O.directionalShadowMap.length,numPointLightShadows:O.pointShadowMap.length,numSpotLightShadows:O.spotShadowMap.length,numSpotLightShadowsWithMaps:O.numSpotLightShadowsWithMaps,numLightProbes:O.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:T.dithering,shadowMapEnabled:n.shadowMap.enabled&&F.length>0,shadowMapType:n.shadowMap.type,toneMapping:Nt,useLegacyLights:n._useLegacyLights,decodeVideoTexture:Ce&&T.map.isVideoTexture===!0&&Ut.getTransfer(T.map.colorSpace)===Wt,premultipliedAlpha:T.premultipliedAlpha,doubleSided:T.side===qs,flipSided:T.side===Yn,useDepthPacking:T.depthPacking>=0,depthPacking:T.depthPacking||0,index0AttributeName:T.index0AttributeName,extensionDerivatives:Be&&T.extensions.derivatives===!0,extensionFragDepth:Be&&T.extensions.fragDepth===!0,extensionDrawBuffers:Be&&T.extensions.drawBuffers===!0,extensionShaderTextureLOD:Be&&T.extensions.shaderTextureLOD===!0,rendererExtensionFragDepth:d||s.has("EXT_frag_depth"),rendererExtensionDrawBuffers:d||s.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:d||s.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:s.has("KHR_parallel_shader_compile"),customProgramCacheKey:T.customProgramCacheKey()}}function g(T){const O=[];if(T.shaderID?O.push(T.shaderID):(O.push(T.customVertexShaderID),O.push(T.customFragmentShaderID)),T.defines!==void 0)for(const F in T.defines)O.push(F),O.push(T.defines[F]);return T.isRawShaderMaterial===!1&&(y(O,T),v(O,T),O.push(n.outputColorSpace)),O.push(T.customProgramCacheKey),O.join()}function y(T,O){T.push(O.precision),T.push(O.outputColorSpace),T.push(O.envMapMode),T.push(O.envMapCubeUVHeight),T.push(O.mapUv),T.push(O.alphaMapUv),T.push(O.lightMapUv),T.push(O.aoMapUv),T.push(O.bumpMapUv),T.push(O.normalMapUv),T.push(O.displacementMapUv),T.push(O.emissiveMapUv),T.push(O.metalnessMapUv),T.push(O.roughnessMapUv),T.push(O.anisotropyMapUv),T.push(O.clearcoatMapUv),T.push(O.clearcoatNormalMapUv),T.push(O.clearcoatRoughnessMapUv),T.push(O.iridescenceMapUv),T.push(O.iridescenceThicknessMapUv),T.push(O.sheenColorMapUv),T.push(O.sheenRoughnessMapUv),T.push(O.specularMapUv),T.push(O.specularColorMapUv),T.push(O.specularIntensityMapUv),T.push(O.transmissionMapUv),T.push(O.thicknessMapUv),T.push(O.combine),T.push(O.fogExp2),T.push(O.sizeAttenuation),T.push(O.morphTargetsCount),T.push(O.morphAttributeCount),T.push(O.numDirLights),T.push(O.numPointLights),T.push(O.numSpotLights),T.push(O.numSpotLightMaps),T.push(O.numHemiLights),T.push(O.numRectAreaLights),T.push(O.numDirLightShadows),T.push(O.numPointLightShadows),T.push(O.numSpotLightShadows),T.push(O.numSpotLightShadowsWithMaps),T.push(O.numLightProbes),T.push(O.shadowMapType),T.push(O.toneMapping),T.push(O.numClippingPlanes),T.push(O.numClipIntersection),T.push(O.depthPacking)}function v(T,O){a.disableAll(),O.isWebGL2&&a.enable(0),O.supportsVertexTextures&&a.enable(1),O.instancing&&a.enable(2),O.instancingColor&&a.enable(3),O.matcap&&a.enable(4),O.envMap&&a.enable(5),O.normalMapObjectSpace&&a.enable(6),O.normalMapTangentSpace&&a.enable(7),O.clearcoat&&a.enable(8),O.iridescence&&a.enable(9),O.alphaTest&&a.enable(10),O.vertexColors&&a.enable(11),O.vertexAlphas&&a.enable(12),O.vertexUv1s&&a.enable(13),O.vertexUv2s&&a.enable(14),O.vertexUv3s&&a.enable(15),O.vertexTangents&&a.enable(16),O.anisotropy&&a.enable(17),O.alphaHash&&a.enable(18),O.batching&&a.enable(19),T.push(a.mask),a.disableAll(),O.fog&&a.enable(0),O.useFog&&a.enable(1),O.flatShading&&a.enable(2),O.logarithmicDepthBuffer&&a.enable(3),O.skinning&&a.enable(4),O.morphTargets&&a.enable(5),O.morphNormals&&a.enable(6),O.morphColors&&a.enable(7),O.premultipliedAlpha&&a.enable(8),O.shadowMapEnabled&&a.enable(9),O.useLegacyLights&&a.enable(10),O.doubleSided&&a.enable(11),O.flipSided&&a.enable(12),O.useDepthPacking&&a.enable(13),O.dithering&&a.enable(14),O.transmission&&a.enable(15),O.sheen&&a.enable(16),O.opaque&&a.enable(17),O.pointsUvs&&a.enable(18),O.decodeVideoTexture&&a.enable(19),T.push(a.mask)}function S(T){const O=m[T.type];let F;if(O){const z=zs[O];F=Zwt.clone(z.uniforms)}else F=T.uniforms;return F}function w(T,O){let F;for(let z=0,Z=u.length;z0?s.push(g):_.transparent===!0?i.push(g):t.push(g)}function l(h,f,_,m,E,b){const g=o(h,f,_,m,E,b);_.transmission>0?s.unshift(g):_.transparent===!0?i.unshift(g):t.unshift(g)}function u(h,f){t.length>1&&t.sort(h||gIt),s.length>1&&s.sort(f||S1),i.length>1&&i.sort(f||S1)}function d(){for(let h=e,f=n.length;h=r.length?(o=new T1,r.push(o)):o=r[i],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function EIt(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new ie,color:new ut};break;case"SpotLight":t={position:new ie,direction:new ie,color:new ut,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new ie,color:new ut,distance:0,decay:0};break;case"HemisphereLight":t={direction:new ie,skyColor:new ut,groundColor:new ut};break;case"RectAreaLight":t={color:new ut,position:new ie,halfWidth:new ie,halfHeight:new ie};break}return n[e.id]=t,t}}}function yIt(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Rt};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Rt};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Rt,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let vIt=0;function SIt(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function TIt(n,e){const t=new EIt,s=yIt(),i={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++)i.probe.push(new ie);const r=new ie,o=new xt,a=new xt;function l(d,h){let f=0,_=0,m=0;for(let z=0;z<9;z++)i.probe[z].set(0,0,0);let E=0,b=0,g=0,y=0,v=0,S=0,w=0,x=0,A=0,D=0,T=0;d.sort(SIt);const O=h===!0?Math.PI:1;for(let z=0,Z=d.length;z0&&(e.isWebGL2||n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=$e.LTC_FLOAT_1,i.rectAreaLTC2=$e.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=$e.LTC_HALF_1,i.rectAreaLTC2=$e.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=f,i.ambient[1]=_,i.ambient[2]=m;const F=i.hash;(F.directionalLength!==E||F.pointLength!==b||F.spotLength!==g||F.rectAreaLength!==y||F.hemiLength!==v||F.numDirectionalShadows!==S||F.numPointShadows!==w||F.numSpotShadows!==x||F.numSpotMaps!==A||F.numLightProbes!==T)&&(i.directional.length=E,i.spot.length=g,i.rectArea.length=y,i.point.length=b,i.hemi.length=v,i.directionalShadow.length=S,i.directionalShadowMap.length=S,i.pointShadow.length=w,i.pointShadowMap.length=w,i.spotShadow.length=x,i.spotShadowMap.length=x,i.directionalShadowMatrix.length=S,i.pointShadowMatrix.length=w,i.spotLightMatrix.length=x+A-D,i.spotLightMap.length=A,i.numSpotLightShadowsWithMaps=D,i.numLightProbes=T,F.directionalLength=E,F.pointLength=b,F.spotLength=g,F.rectAreaLength=y,F.hemiLength=v,F.numDirectionalShadows=S,F.numPointShadows=w,F.numSpotShadows=x,F.numSpotMaps=A,F.numLightProbes=T,i.version=vIt++)}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 x1(n,e),a.push(l)):l=a[o],l}function i(){t=new WeakMap}return{get:s,dispose:i}}class CIt extends ks{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=cwt,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 wIt extends ks{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 RIt=`void main() { gl_Position = vec4( position, 1.0 ); -}`,RIt=`uniform sampler2D shadow_pass; +}`,AIt=`uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; #include @@ -3899,8 +3900,8 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function AIt(n,e,t){let s=new AE;const i=new Rt,r=new Rt,o=new Yt,a=new xIt({depthPacking:cwt}),l=new CIt,u={},d=t.maxTextureSize,h={[Oi]:Yn,[Yn]:Oi,[qs]:qs},f=new Jr({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Rt},radius:{value:4}},vertexShader:wIt,fragmentShader:RIt}),_=f.clone();_.defines.HORIZONTAL_PASS=1;const m=new ri;m.setAttribute("position",new Bn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const E=new Un(m,f),b=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=JN;let g=this.type;this.render=function(w,x,A){if(b.enabled===!1||b.autoUpdate===!1&&b.needsUpdate===!1||w.length===0)return;const D=n.getRenderTarget(),T=n.getActiveCubeFace(),O=n.getActiveMipmapLevel(),F=n.state;F.setBlending(ar),F.buffers.color.setClear(1,1,1,1),F.buffers.depth.setTest(!0),F.setScissorTest(!1);const z=g!==gi&&this.type===gi,Z=g===gi&&this.type!==gi;for(let M=0,q=w.length;Md||i.y>d)&&(i.x>d&&(r.x=Math.floor(d/$.x),i.x=r.x*$.x,P.mapSize.x=r.x),i.y>d&&(r.y=Math.floor(d/$.y),i.y=r.y*$.y,P.mapSize.y=r.y)),P.map===null||z===!0||Z===!0){const re=this.type!==gi?{minFilter:mn,magFilter:mn}:{};P.map!==null&&P.map.dispose(),P.map=new Zr(i.x,i.y,re),P.map.texture.name=H.name+".shadowMap",P.camera.updateProjectionMatrix()}n.setRenderTarget(P.map),n.clear();const J=P.getViewportCount();for(let re=0;re0||x.map&&x.alphaTest>0){const F=T.uuid,z=x.uuid;let Z=u[F];Z===void 0&&(Z={},u[F]=Z);let M=Z[z];M===void 0&&(M=T.clone(),Z[z]=M),T=M}if(T.visible=x.visible,T.wireframe=x.wireframe,D===gi?T.side=x.shadowSide!==null?x.shadowSide:x.side:T.side=x.shadowSide!==null?x.shadowSide:h[x.side],T.alphaMap=x.alphaMap,T.alphaTest=x.alphaTest,T.map=x.map,T.clipShadows=x.clipShadows,T.clippingPlanes=x.clippingPlanes,T.clipIntersection=x.clipIntersection,T.displacementMap=x.displacementMap,T.displacementScale=x.displacementScale,T.displacementBias=x.displacementBias,T.wireframeLinewidth=x.wireframeLinewidth,T.linewidth=x.linewidth,A.isPointLight===!0&&T.isMeshDistanceMaterial===!0){const F=n.properties.get(T);F.light=A}return T}function S(w,x,A,D,T){if(w.visible===!1)return;if(w.layers.test(x.layers)&&(w.isMesh||w.isLine||w.isPoints)&&(w.castShadow||w.receiveShadow&&T===gi)&&(!w.frustumCulled||s.intersectsObject(w))){w.modelViewMatrix.multiplyMatrices(A.matrixWorldInverse,w.matrixWorld);const z=e.update(w),Z=w.material;if(Array.isArray(Z)){const M=z.groups;for(let q=0,H=M.length;q=1):re.indexOf("OpenGL ES")!==-1&&(J=parseFloat(/^OpenGL ES (\d)/.exec(re)[1]),$=J>=2);let me=null,Se={};const le=n.getParameter(n.SCISSOR_BOX),Ee=n.getParameter(n.VIEWPORT),Oe=new Yt().fromArray(le),Me=new Yt().fromArray(Ee);function j(X,je,Be,Ne){const Ve=new Uint8Array(4),ot=n.createTexture();n.bindTexture(X,ot),n.texParameteri(X,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(X,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Nt=0;Nt"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(k,I){return g?new OffscreenCanvas(k,I):Gl("canvas")}function v(k,I,W,ye){let K=1;if((k.width>ye||k.height>ye)&&(K=ye/Math.max(k.width,k.height)),K<1||I===!0)if(typeof HTMLImageElement<"u"&&k instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&k instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&k instanceof ImageBitmap){const ee=I?Zd:Math.floor,Re=ee(K*k.width),xe=ee(K*k.height);E===void 0&&(E=y(Re,xe));const Le=W?y(Re,xe):E;return Le.width=Re,Le.height=xe,Le.getContext("2d").drawImage(k,0,0,Re,xe),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+k.width+"x"+k.height+") to ("+Re+"x"+xe+")."),Le}else return"data"in k&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+k.width+"x"+k.height+")."),k;return k}function S(k){return zg(k.width)&&zg(k.height)}function w(k){return a?!1:k.wrapS!==as||k.wrapT!==as||k.minFilter!==mn&&k.minFilter!==zn}function x(k,I){return k.generateMipmaps&&I&&k.minFilter!==mn&&k.minFilter!==zn}function A(k){n.generateMipmap(k)}function D(k,I,W,ye,K=!1){if(a===!1)return I;if(k!==null){if(n[k]!==void 0)return n[k];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+k+"'")}let ee=I;if(I===n.RED&&(W===n.FLOAT&&(ee=n.R32F),W===n.HALF_FLOAT&&(ee=n.R16F),W===n.UNSIGNED_BYTE&&(ee=n.R8)),I===n.RED_INTEGER&&(W===n.UNSIGNED_BYTE&&(ee=n.R8UI),W===n.UNSIGNED_SHORT&&(ee=n.R16UI),W===n.UNSIGNED_INT&&(ee=n.R32UI),W===n.BYTE&&(ee=n.R8I),W===n.SHORT&&(ee=n.R16I),W===n.INT&&(ee=n.R32I)),I===n.RG&&(W===n.FLOAT&&(ee=n.RG32F),W===n.HALF_FLOAT&&(ee=n.RG16F),W===n.UNSIGNED_BYTE&&(ee=n.RG8)),I===n.RGBA){const Re=K?Kd:Ut.getTransfer(ye);W===n.FLOAT&&(ee=n.RGBA32F),W===n.HALF_FLOAT&&(ee=n.RGBA16F),W===n.UNSIGNED_BYTE&&(ee=Re===Wt?n.SRGB8_ALPHA8:n.RGBA8),W===n.UNSIGNED_SHORT_4_4_4_4&&(ee=n.RGBA4),W===n.UNSIGNED_SHORT_5_5_5_1&&(ee=n.RGB5_A1)}return(ee===n.R16F||ee===n.R32F||ee===n.RG16F||ee===n.RG32F||ee===n.RGBA16F||ee===n.RGBA32F)&&e.get("EXT_color_buffer_float"),ee}function T(k,I,W){return x(k,W)===!0||k.isFramebufferTexture&&k.minFilter!==mn&&k.minFilter!==zn?Math.log2(Math.max(I.width,I.height))+1:k.mipmaps!==void 0&&k.mipmaps.length>0?k.mipmaps.length:k.isCompressedTexture&&Array.isArray(k.image)?I.mipmaps.length:1}function O(k){return k===mn||k===Fg||k===bd?n.NEAREST:n.LINEAR}function F(k){const I=k.target;I.removeEventListener("dispose",F),Z(I),I.isVideoTexture&&m.delete(I)}function z(k){const I=k.target;I.removeEventListener("dispose",z),q(I)}function Z(k){const I=s.get(k);if(I.__webglInit===void 0)return;const W=k.source,ye=b.get(W);if(ye){const K=ye[I.__cacheKey];K.usedTimes--,K.usedTimes===0&&M(k),Object.keys(ye).length===0&&b.delete(W)}s.remove(k)}function M(k){const I=s.get(k);n.deleteTexture(I.__webglTexture);const W=k.source,ye=b.get(W);delete ye[I.__cacheKey],o.memory.textures--}function q(k){const I=k.texture,W=s.get(k),ye=s.get(I);if(ye.__webglTexture!==void 0&&(n.deleteTexture(ye.__webglTexture),o.memory.textures--),k.depthTexture&&k.depthTexture.dispose(),k.isWebGLCubeRenderTarget)for(let K=0;K<6;K++){if(Array.isArray(W.__webglFramebuffer[K]))for(let ee=0;ee=l&&console.warn("THREE.WebGLTextures: Trying to use "+k+" texture units while this GPU supports only "+l),H+=1,k}function J(k){const I=[];return I.push(k.wrapS),I.push(k.wrapT),I.push(k.wrapR||0),I.push(k.magFilter),I.push(k.minFilter),I.push(k.anisotropy),I.push(k.internalFormat),I.push(k.format),I.push(k.type),I.push(k.generateMipmaps),I.push(k.premultiplyAlpha),I.push(k.flipY),I.push(k.unpackAlignment),I.push(k.colorSpace),I.join()}function re(k,I){const W=s.get(k);if(k.isVideoTexture&&ge(k),k.isRenderTargetTexture===!1&&k.version>0&&W.__version!==k.version){const ye=k.image;if(ye===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ye.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ue(W,k,I);return}}t.bindTexture(n.TEXTURE_2D,W.__webglTexture,n.TEXTURE0+I)}function me(k,I){const W=s.get(k);if(k.version>0&&W.__version!==k.version){ue(W,k,I);return}t.bindTexture(n.TEXTURE_2D_ARRAY,W.__webglTexture,n.TEXTURE0+I)}function Se(k,I){const W=s.get(k);if(k.version>0&&W.__version!==k.version){ue(W,k,I);return}t.bindTexture(n.TEXTURE_3D,W.__webglTexture,n.TEXTURE0+I)}function le(k,I){const W=s.get(k);if(k.version>0&&W.__version!==k.version){Ce(W,k,I);return}t.bindTexture(n.TEXTURE_CUBE_MAP,W.__webglTexture,n.TEXTURE0+I)}const Ee={[ca]:n.REPEAT,[as]:n.CLAMP_TO_EDGE,[Wd]:n.MIRRORED_REPEAT},Oe={[mn]:n.NEAREST,[Fg]:n.NEAREST_MIPMAP_NEAREST,[bd]:n.NEAREST_MIPMAP_LINEAR,[zn]:n.LINEAR,[tO]:n.LINEAR_MIPMAP_NEAREST,[Xr]:n.LINEAR_MIPMAP_LINEAR},Me={[uwt]:n.NEVER,[gwt]:n.ALWAYS,[pwt]:n.LESS,[uO]:n.LEQUAL,[_wt]:n.EQUAL,[mwt]:n.GEQUAL,[hwt]:n.GREATER,[fwt]:n.NOTEQUAL};function j(k,I,W){if(W?(n.texParameteri(k,n.TEXTURE_WRAP_S,Ee[I.wrapS]),n.texParameteri(k,n.TEXTURE_WRAP_T,Ee[I.wrapT]),(k===n.TEXTURE_3D||k===n.TEXTURE_2D_ARRAY)&&n.texParameteri(k,n.TEXTURE_WRAP_R,Ee[I.wrapR]),n.texParameteri(k,n.TEXTURE_MAG_FILTER,Oe[I.magFilter]),n.texParameteri(k,n.TEXTURE_MIN_FILTER,Oe[I.minFilter])):(n.texParameteri(k,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(k,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),(k===n.TEXTURE_3D||k===n.TEXTURE_2D_ARRAY)&&n.texParameteri(k,n.TEXTURE_WRAP_R,n.CLAMP_TO_EDGE),(I.wrapS!==as||I.wrapT!==as)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(k,n.TEXTURE_MAG_FILTER,O(I.magFilter)),n.texParameteri(k,n.TEXTURE_MIN_FILTER,O(I.minFilter)),I.minFilter!==mn&&I.minFilter!==zn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),I.compareFunction&&(n.texParameteri(k,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(k,n.TEXTURE_COMPARE_FUNC,Me[I.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const ye=e.get("EXT_texture_filter_anisotropic");if(I.magFilter===mn||I.minFilter!==bd&&I.minFilter!==Xr||I.type===vi&&e.has("OES_texture_float_linear")===!1||a===!1&&I.type===Fl&&e.has("OES_texture_half_float_linear")===!1)return;(I.anisotropy>1||s.get(I).__currentAnisotropy)&&(n.texParameterf(k,ye.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(I.anisotropy,i.getMaxAnisotropy())),s.get(I).__currentAnisotropy=I.anisotropy)}}function pe(k,I){let W=!1;k.__webglInit===void 0&&(k.__webglInit=!0,I.addEventListener("dispose",F));const ye=I.source;let K=b.get(ye);K===void 0&&(K={},b.set(ye,K));const ee=J(I);if(ee!==k.__cacheKey){K[ee]===void 0&&(K[ee]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,W=!0),K[ee].usedTimes++;const Re=K[k.__cacheKey];Re!==void 0&&(K[k.__cacheKey].usedTimes--,Re.usedTimes===0&&M(I)),k.__cacheKey=ee,k.__webglTexture=K[ee].texture}return W}function ue(k,I,W){let ye=n.TEXTURE_2D;(I.isDataArrayTexture||I.isCompressedArrayTexture)&&(ye=n.TEXTURE_2D_ARRAY),I.isData3DTexture&&(ye=n.TEXTURE_3D);const K=pe(k,I),ee=I.source;t.bindTexture(ye,k.__webglTexture,n.TEXTURE0+W);const Re=s.get(ee);if(ee.version!==Re.__version||K===!0){t.activeTexture(n.TEXTURE0+W);const xe=Ut.getPrimaries(Ut.workingColorSpace),Le=I.colorSpace===cs?null:Ut.getPrimaries(I.colorSpace),Ze=I.colorSpace===cs||xe===Le?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,I.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,I.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,I.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ze);const ht=w(I)&&S(I.image)===!1;let Pe=v(I.image,ht,!1,d);Pe=De(I,Pe);const ct=S(Pe)||a,tt=r.convert(I.format,I.colorSpace);let Ye=r.convert(I.type),et=D(I.internalFormat,tt,Ye,I.colorSpace,I.isVideoTexture);j(ye,I,ct);let We;const Et=I.mipmaps,X=a&&I.isVideoTexture!==!0&&et!==lO,je=Re.__version===void 0||K===!0,Be=T(I,Pe,ct);if(I.isDepthTexture)et=n.DEPTH_COMPONENT,a?I.type===vi?et=n.DEPTH_COMPONENT32F:I.type===sr?et=n.DEPTH_COMPONENT24:I.type===Hr?et=n.DEPTH24_STENCIL8:et=n.DEPTH_COMPONENT16:I.type===vi&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),I.format===qr&&et===n.DEPTH_COMPONENT&&I.type!==xE&&I.type!==sr&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),I.type=sr,Ye=r.convert(I.type)),I.format===da&&et===n.DEPTH_COMPONENT&&(et=n.DEPTH_STENCIL,I.type!==Hr&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),I.type=Hr,Ye=r.convert(I.type))),je&&(X?t.texStorage2D(n.TEXTURE_2D,1,et,Pe.width,Pe.height):t.texImage2D(n.TEXTURE_2D,0,et,Pe.width,Pe.height,0,tt,Ye,null));else if(I.isDataTexture)if(Et.length>0&&ct){X&&je&&t.texStorage2D(n.TEXTURE_2D,Be,et,Et[0].width,Et[0].height);for(let Ne=0,Ve=Et.length;Ne>=1,Ve>>=1}}else if(Et.length>0&&ct){X&&je&&t.texStorage2D(n.TEXTURE_2D,Be,et,Et[0].width,Et[0].height);for(let Ne=0,Ve=Et.length;Ne0&&je++,t.texStorage2D(n.TEXTURE_CUBE_MAP,je,We,Pe[0].width,Pe[0].height));for(let Ne=0;Ne<6;Ne++)if(ht){Et?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ne,0,0,0,Pe[Ne].width,Pe[Ne].height,Ye,et,Pe[Ne].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ne,0,We,Pe[Ne].width,Pe[Ne].height,0,Ye,et,Pe[Ne].data);for(let Ve=0;Ve>ee),Pe=Math.max(1,I.height>>ee);K===n.TEXTURE_3D||K===n.TEXTURE_2D_ARRAY?t.texImage3D(K,ee,Le,ht,Pe,I.depth,0,Re,xe,null):t.texImage2D(K,ee,Le,ht,Pe,0,Re,xe,null)}t.bindFramebuffer(n.FRAMEBUFFER,k),we(I)?f.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,ye,K,s.get(W).__webglTexture,0,te(I)):(K===n.TEXTURE_2D||K>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&K<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,ye,K,s.get(W).__webglTexture,ee),t.bindFramebuffer(n.FRAMEBUFFER,null)}function N(k,I,W){if(n.bindRenderbuffer(n.RENDERBUFFER,k),I.depthBuffer&&!I.stencilBuffer){let ye=a===!0?n.DEPTH_COMPONENT24:n.DEPTH_COMPONENT16;if(W||we(I)){const K=I.depthTexture;K&&K.isDepthTexture&&(K.type===vi?ye=n.DEPTH_COMPONENT32F:K.type===sr&&(ye=n.DEPTH_COMPONENT24));const ee=te(I);we(I)?f.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,ee,ye,I.width,I.height):n.renderbufferStorageMultisample(n.RENDERBUFFER,ee,ye,I.width,I.height)}else n.renderbufferStorage(n.RENDERBUFFER,ye,I.width,I.height);n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,k)}else if(I.depthBuffer&&I.stencilBuffer){const ye=te(I);W&&we(I)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,ye,n.DEPTH24_STENCIL8,I.width,I.height):we(I)?f.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,ye,n.DEPTH24_STENCIL8,I.width,I.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,I.width,I.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,k)}else{const ye=I.isWebGLMultipleRenderTargets===!0?I.texture:[I.texture];for(let K=0;K0){W.__webglFramebuffer[xe]=[];for(let Le=0;Le0){W.__webglFramebuffer=[];for(let xe=0;xe0&&we(k)===!1){const xe=ee?I:[I];W.__webglMultisampledFramebuffer=n.createFramebuffer(),W.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,W.__webglMultisampledFramebuffer);for(let Le=0;Le0)for(let Le=0;Le0)for(let Le=0;Le0&&we(k)===!1){const I=k.isWebGLMultipleRenderTargets?k.texture:[k.texture],W=k.width,ye=k.height;let K=n.COLOR_BUFFER_BIT;const ee=[],Re=k.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,xe=s.get(k),Le=k.isWebGLMultipleRenderTargets===!0;if(Le)for(let Ze=0;Ze0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&I.__useRenderToTexture!==!1}function ge(k){const I=o.render.frame;m.get(k)!==I&&(m.set(k,I),k.update())}function De(k,I){const W=k.colorSpace,ye=k.format,K=k.type;return k.isCompressedTexture===!0||k.isVideoTexture===!0||k.format===Vg||W!==Cn&&W!==cs&&(Ut.getTransfer(W)===Wt?a===!1?e.has("EXT_sRGB")===!0&&ye===ls?(k.format=Vg,k.minFilter=zn,k.generateMipmaps=!1):I=_O.sRGBToLinear(I):(ye!==ls||K!==cr)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",W)),I}this.allocateTextureUnit=$,this.resetTextureUnits=P,this.setTexture2D=re,this.setTexture2DArray=me,this.setTexture3D=Se,this.setTextureCube=le,this.rebindTextures=oe,this.setupRenderTarget=ne,this.updateRenderTargetMipmap=Te,this.updateMultisampleRenderTarget=Ae,this.setupDepthRenderbuffer=Y,this.setupFrameBufferTexture=ke,this.useMultisampledRTT=we}function IIt(n,e,t){const s=t.isWebGL2;function i(r,o=cs){let a;const l=Ut.getTransfer(o);if(r===cr)return n.UNSIGNED_BYTE;if(r===sO)return n.UNSIGNED_SHORT_4_4_4_4;if(r===iO)return n.UNSIGNED_SHORT_5_5_5_1;if(r===Z1t)return n.BYTE;if(r===J1t)return n.SHORT;if(r===xE)return n.UNSIGNED_SHORT;if(r===nO)return n.INT;if(r===sr)return n.UNSIGNED_INT;if(r===vi)return n.FLOAT;if(r===Fl)return s?n.HALF_FLOAT:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(r===ewt)return n.ALPHA;if(r===ls)return n.RGBA;if(r===twt)return n.LUMINANCE;if(r===nwt)return n.LUMINANCE_ALPHA;if(r===qr)return n.DEPTH_COMPONENT;if(r===da)return n.DEPTH_STENCIL;if(r===Vg)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(r===swt)return n.RED;if(r===rO)return n.RED_INTEGER;if(r===iwt)return n.RG;if(r===oO)return n.RG_INTEGER;if(r===aO)return n.RGBA_INTEGER;if(r===hm||r===fm||r===mm||r===gm)if(l===Wt)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(r===hm)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===fm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===mm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===gm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(r===hm)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===fm)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===mm)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===gm)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(r===dC||r===uC||r===pC||r===_C)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(r===dC)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===uC)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===pC)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===_C)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(r===lO)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(r===hC||r===fC)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(r===hC)return l===Wt?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(r===fC)return l===Wt?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(r===mC||r===gC||r===bC||r===EC||r===yC||r===vC||r===SC||r===TC||r===xC||r===CC||r===wC||r===RC||r===AC||r===NC)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(r===mC)return l===Wt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===gC)return l===Wt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===bC)return l===Wt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===EC)return l===Wt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===yC)return l===Wt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===vC)return l===Wt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===SC)return l===Wt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===TC)return l===Wt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===xC)return l===Wt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===CC)return l===Wt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===wC)return l===Wt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===RC)return l===Wt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===AC)return l===Wt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===NC)return l===Wt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(r===bm||r===OC||r===IC)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(r===bm)return l===Wt?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(r===OC)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(r===IC)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(r===rwt||r===MC||r===DC||r===kC)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(r===bm)return a.COMPRESSED_RED_RGTC1_EXT;if(r===MC)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(r===DC)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(r===kC)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return r===Hr?s?n.UNSIGNED_INT_24_8:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):n[r]!==void 0?n[r]:null}return{convert:i}}class MIt extends Pn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class Fr extends Jt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const DIt={type:"move"};class zm{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Fr,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 Fr,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new ie,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new ie),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Fr,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new ie,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new ie),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const s of e.hand.values())this._getHandJoint(t,s)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,s){let i=null,r=null,o=null;const a=this._targetRay,l=this._grip,u=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(u&&e.hand){o=!0;for(const E of e.hand.values()){const b=t.getJointPose(E,s),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=t.getPose(e.gripSpace,s),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&&(i=t.getPose(e.targetRaySpace,s),i===null&&r!==null&&(i=r),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(DIt)))}return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=r!==null),u!==null&&(u.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const s=new Fr;s.matrixAutoUpdate=!1,s.visible=!1,e.joints[t.jointName]=s,e.add(s)}return e.joints[t.jointName]}}class kIt extends Ma{constructor(e,t){super();const s=this;let i=null,r=1,o=null,a="local-floor",l=1,u=null,d=null,h=null,f=null,_=null,m=null;const E=t.getContextAttributes();let b=null,g=null;const y=[],v=[],S=new Rt;let w=null;const x=new Pn;x.layers.enable(1),x.viewport=new Yt;const A=new Pn;A.layers.enable(2),A.viewport=new Yt;const D=[x,A],T=new MIt;T.layers.enable(1),T.layers.enable(2);let O=null,F=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(le){let Ee=y[le];return Ee===void 0&&(Ee=new zm,y[le]=Ee),Ee.getTargetRaySpace()},this.getControllerGrip=function(le){let Ee=y[le];return Ee===void 0&&(Ee=new zm,y[le]=Ee),Ee.getGripSpace()},this.getHand=function(le){let Ee=y[le];return Ee===void 0&&(Ee=new zm,y[le]=Ee),Ee.getHandSpace()};function z(le){const Ee=v.indexOf(le.inputSource);if(Ee===-1)return;const Oe=y[Ee];Oe!==void 0&&(Oe.update(le.inputSource,le.frame,u||o),Oe.dispatchEvent({type:le.type,data:le.inputSource}))}function Z(){i.removeEventListener("select",z),i.removeEventListener("selectstart",z),i.removeEventListener("selectend",z),i.removeEventListener("squeeze",z),i.removeEventListener("squeezestart",z),i.removeEventListener("squeezeend",z),i.removeEventListener("end",Z),i.removeEventListener("inputsourceschange",M);for(let le=0;le=0&&(v[Me]=null,y[Me].disconnect(Oe))}for(let Ee=0;Ee=v.length){v.push(Oe),Me=pe;break}else if(v[pe]===null){v[pe]=Oe,Me=pe;break}if(Me===-1)break}const j=y[Me];j&&j.connect(Oe)}}const q=new ie,H=new ie;function P(le,Ee,Oe){q.setFromMatrixPosition(Ee.matrixWorld),H.setFromMatrixPosition(Oe.matrixWorld);const Me=q.distanceTo(H),j=Ee.projectionMatrix.elements,pe=Oe.projectionMatrix.elements,ue=j[14]/(j[10]-1),Ce=j[14]/(j[10]+1),ke=(j[9]+1)/j[5],N=(j[9]-1)/j[5],V=(j[8]-1)/j[0],Y=(pe[8]+1)/pe[0],oe=ue*V,ne=ue*Y,Te=Me/(-V+Y),Ae=Te*-V;Ee.matrixWorld.decompose(le.position,le.quaternion,le.scale),le.translateX(Ae),le.translateZ(Te),le.matrixWorld.compose(le.position,le.quaternion,le.scale),le.matrixWorldInverse.copy(le.matrixWorld).invert();const te=ue+Te,we=Ce+Te,ge=oe-Ae,De=ne+(Me-Ae),k=ke*Ce/we*te,I=N*Ce/we*te;le.projectionMatrix.makePerspective(ge,De,k,I,te,we),le.projectionMatrixInverse.copy(le.projectionMatrix).invert()}function $(le,Ee){Ee===null?le.matrixWorld.copy(le.matrix):le.matrixWorld.multiplyMatrices(Ee.matrixWorld,le.matrix),le.matrixWorldInverse.copy(le.matrixWorld).invert()}this.updateCamera=function(le){if(i===null)return;T.near=A.near=x.near=le.near,T.far=A.far=x.far=le.far,(O!==T.near||F!==T.far)&&(i.updateRenderState({depthNear:T.near,depthFar:T.far}),O=T.near,F=T.far);const Ee=le.parent,Oe=T.cameras;$(T,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=n._useLegacyLights===!0?Math.PI:1;b.lightMapIntensity.value=g.lightMapIntensity*v,t(g.lightMap,b.lightMapTransform)}g.aoMap&&(b.aoMap.value=g.aoMap,b.aoMapIntensity.value=g.aoMapIntensity,t(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,t(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,t(g.map,b.uvTransform)),g.alphaMap&&(b.alphaMap.value=g.alphaMap,t(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,t(g.map,b.mapTransform)),g.alphaMap&&(b.alphaMap.value=g.alphaMap,t(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,t(g.metalnessMap,b.metalnessMapTransform)),b.roughness.value=g.roughness,g.roughnessMap&&(b.roughnessMap.value=g.roughnessMap,t(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,t(g.sheenColorMap,b.sheenColorMapTransform)),g.sheenRoughnessMap&&(b.sheenRoughnessMap.value=g.sheenRoughnessMap,t(g.sheenRoughnessMap,b.sheenRoughnessMapTransform))),g.clearcoat>0&&(b.clearcoat.value=g.clearcoat,b.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(b.clearcoatMap.value=g.clearcoatMap,t(g.clearcoatMap,b.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(b.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,t(g.clearcoatRoughnessMap,b.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(b.clearcoatNormalMap.value=g.clearcoatNormalMap,t(g.clearcoatNormalMap,b.clearcoatNormalMapTransform),b.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===Yn&&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,t(g.iridescenceMap,b.iridescenceMapTransform)),g.iridescenceThicknessMap&&(b.iridescenceThicknessMap.value=g.iridescenceThicknessMap,t(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,t(g.transmissionMap,b.transmissionMapTransform)),b.thickness.value=g.thickness,g.thicknessMap&&(b.thicknessMap.value=g.thicknessMap,t(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,t(g.anisotropyMap,b.anisotropyMapTransform))),b.specularIntensity.value=g.specularIntensity,b.specularColor.value.copy(g.specularColor),g.specularColorMap&&(b.specularColorMap.value=g.specularColorMap,t(g.specularColorMap,b.specularColorMapTransform)),g.specularIntensityMap&&(b.specularIntensityMap.value=g.specularIntensityMap,t(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:s,refreshMaterialUniforms:i}}function PIt(n,e,t,s){let i={},r={},o=[];const a=t.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(y,v){const S=v.program;s.uniformBlockBinding(y,S)}function u(y,v){let S=i[y.id];S===void 0&&(m(y),S=d(y),i[y.id]=S,y.addEventListener("dispose",b));const w=v.program;s.updateUBOMapping(y,w);const x=e.render.frame;r[y.id]!==x&&(f(y),r[y.id]=x)}function d(y){const v=h();y.__bindingPointIndex=v;const S=n.createBuffer(),w=y.__size,x=y.usage;return n.bindBuffer(n.UNIFORM_BUFFER,S),n.bufferData(n.UNIFORM_BUFFER,w,x),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,v,S),S}function h(){for(let y=0;y0){x=S%w;const z=w-x;x!==0&&z-O.boundary<0&&(S+=w-x,T.__offset=S)}S+=O.storage}return x=S%w,x>0&&(S+=w-x),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),n.deleteBuffer(i[v.id]),delete i[v.id],delete r[v.id]}function g(){for(const y in i)n.deleteBuffer(i[y]);o=[],i={},r={}}return{bind:l,update:u,dispose:g}}class OO{constructor(e={}){const{canvas:t=Dwt(),context:s=null,depth:i=!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;s!==null?f=s.getContextAttributes().alpha:f=o;const _=new Uint32Array(4),m=new Int32Array(4);let E=null,b=null;const g=[],y=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=en,this._useLegacyLights=!1,this.toneMapping=lr,this.toneMappingExposure=1;const v=this;let S=!1,w=0,x=0,A=null,D=-1,T=null;const O=new Yt,F=new Yt;let z=null;const Z=new ut(0);let M=0,q=t.width,H=t.height,P=1,$=null,J=null;const re=new Yt(0,0,q,H),me=new Yt(0,0,q,H);let Se=!1;const le=new AE;let Ee=!1,Oe=!1,Me=null;const j=new xt,pe=new Rt,ue=new ie,Ce={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ke(){return A===null?P:1}let N=s;function V(U,ce){for(let be=0;be{function Qe(){if(ve.forEach(function(nt){Ae.get(nt).currentProgram.isReady()&&ve.delete(nt)}),ve.size===0){fe(U);return}setTimeout(Qe,10)}Y.get("KHR_parallel_shader_compile")!==null?Qe():setTimeout(Qe,10)})};let Nt=null;function sn(U){Nt&&Nt(U)}function bn(){En.stop()}function Gt(){En.start()}const En=new TO;En.setAnimationLoop(sn),typeof self<"u"&&En.setContext(self),this.setAnimationLoop=function(U){Nt=U,We.setAnimationLoop(U),U===null?En.stop():En.start()},We.addEventListener("sessionstart",bn),We.addEventListener("sessionend",Gt),this.render=function(U,ce){if(ce!==void 0&&ce.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(S===!0)return;U.matrixWorldAutoUpdate===!0&&U.updateMatrixWorld(),ce.parent===null&&ce.matrixWorldAutoUpdate===!0&&ce.updateMatrixWorld(),We.enabled===!0&&We.isPresenting===!0&&(We.cameraAutoUpdate===!0&&We.updateCamera(ce),ce=We.getCamera()),U.isScene===!0&&U.onBeforeRender(v,U,ce,A),b=ee.get(U,y.length),b.init(),y.push(b),j.multiplyMatrices(ce.projectionMatrix,ce.matrixWorldInverse),le.setFromProjectionMatrix(j),Oe=this.localClippingEnabled,Ee=Re.init(this.clippingPlanes,Oe),E=K.get(U,g.length),E.init(),g.push(E),ts(U,ce,0,v.sortObjects),E.finish(),v.sortObjects===!0&&E.sort($,J),this.info.render.frame++,Ee===!0&&Re.beginShadows();const be=b.state.shadowsArray;if(xe.render(be,U,ce),Ee===!0&&Re.endShadows(),this.info.autoReset===!0&&this.info.reset(),Le.render(E,U),b.setupLights(v._useLegacyLights),ce.isArrayCamera){const ve=ce.cameras;for(let fe=0,Qe=ve.length;fe0?b=y[y.length-1]:b=null,g.pop(),g.length>0?E=g[g.length-1]:E=null};function ts(U,ce,be,ve){if(U.visible===!1)return;if(U.layers.test(ce.layers)){if(U.isGroup)be=U.renderOrder;else if(U.isLOD)U.autoUpdate===!0&&U.update(ce);else if(U.isLight)b.pushLight(U),U.castShadow&&b.pushShadow(U);else if(U.isSprite){if(!U.frustumCulled||le.intersectsSprite(U)){ve&&ue.setFromMatrixPosition(U.matrixWorld).applyMatrix4(j);const nt=I.update(U),rt=U.material;rt.visible&&E.push(U,nt,rt,be,ue.z,null)}}else if((U.isMesh||U.isLine||U.isPoints)&&(!U.frustumCulled||le.intersectsObject(U))){const nt=I.update(U),rt=U.material;if(ve&&(U.boundingSphere!==void 0?(U.boundingSphere===null&&U.computeBoundingSphere(),ue.copy(U.boundingSphere.center)):(nt.boundingSphere===null&&nt.computeBoundingSphere(),ue.copy(nt.boundingSphere.center)),ue.applyMatrix4(U.matrixWorld).applyMatrix4(j)),Array.isArray(rt)){const at=nt.groups;for(let bt=0,_t=at.length;bt<_t;bt++){const ft=at[bt],Zt=rt[ft.materialIndex];Zt&&Zt.visible&&E.push(U,nt,Zt,be,ue.z,ft)}}else rt.visible&&E.push(U,nt,rt,be,ue.z,null)}}const Qe=U.children;for(let nt=0,rt=Qe.length;nt0&&Qu(fe,Qe,ce,be),ve&&ne.viewport(O.copy(ve)),fe.length>0&&oo(fe,ce,be),Qe.length>0&&oo(Qe,ce,be),nt.length>0&&oo(nt,ce,be),ne.buffers.depth.setTest(!0),ne.buffers.depth.setMask(!0),ne.buffers.color.setMask(!0),ne.setPolygonOffset(!1)}function Qu(U,ce,be,ve){if((be.isScene===!0?be.overrideMaterial:null)!==null)return;const Qe=oe.isWebGL2;Me===null&&(Me=new Zr(1,1,{generateMipmaps:!0,type:Y.has("EXT_color_buffer_half_float")?Fl:cr,minFilter:Xr,samples:Qe?4:0})),v.getDrawingBufferSize(pe),Qe?Me.setSize(pe.x,pe.y):Me.setSize(Zd(pe.x),Zd(pe.y));const nt=v.getRenderTarget();v.setRenderTarget(Me),v.getClearColor(Z),M=v.getClearAlpha(),M<1&&v.setClearColor(16777215,.5),v.clear();const rt=v.toneMapping;v.toneMapping=lr,oo(U,be,ve),te.updateMultisampleRenderTarget(Me),te.updateRenderTargetMipmap(Me);let at=!1;for(let bt=0,_t=ce.length;bt<_t;bt++){const ft=ce[bt],Zt=ft.object,Mn=ft.geometry,rn=ft.material,vs=ft.group;if(rn.side===qs&&Zt.layers.test(ve.layers)){const $t=rn.side;rn.side=Yn,rn.needsUpdate=!0,ic(Zt,be,ve,Mn,rn,vs),rn.side=$t,rn.needsUpdate=!0,at=!0}}at===!0&&(te.updateMultisampleRenderTarget(Me),te.updateRenderTargetMipmap(Me)),v.setRenderTarget(nt),v.setClearColor(Z,M),v.toneMapping=rt}function oo(U,ce,be){const ve=ce.isScene===!0?ce.overrideMaterial:null;for(let fe=0,Qe=U.length;fe0),ft=!!be.morphAttributes.position,Zt=!!be.morphAttributes.normal,Mn=!!be.morphAttributes.color;let rn=lr;ve.toneMapped&&(A===null||A.isXRRenderTarget===!0)&&(rn=v.toneMapping);const vs=be.morphAttributes.position||be.morphAttributes.normal||be.morphAttributes.color,$t=vs!==void 0?vs.length:0,yt=Ae.get(ve),Fa=b.state.lights;if(Ee===!0&&(Oe===!0||U!==T)){const Gn=U===T&&ve.id===D;Re.setState(ve,U,Gn)}let Qt=!1;ve.version===yt.__version?(yt.needsLights&&yt.lightsStateVersion!==Fa.state.version||yt.outputColorSpace!==rt||fe.isBatchedMesh&&yt.batching===!1||!fe.isBatchedMesh&&yt.batching===!0||fe.isInstancedMesh&&yt.instancing===!1||!fe.isInstancedMesh&&yt.instancing===!0||fe.isSkinnedMesh&&yt.skinning===!1||!fe.isSkinnedMesh&&yt.skinning===!0||fe.isInstancedMesh&&yt.instancingColor===!0&&fe.instanceColor===null||fe.isInstancedMesh&&yt.instancingColor===!1&&fe.instanceColor!==null||yt.envMap!==at||ve.fog===!0&&yt.fog!==Qe||yt.numClippingPlanes!==void 0&&(yt.numClippingPlanes!==Re.numPlanes||yt.numIntersection!==Re.numIntersection)||yt.vertexAlphas!==bt||yt.vertexTangents!==_t||yt.morphTargets!==ft||yt.morphNormals!==Zt||yt.morphColors!==Mn||yt.toneMapping!==rn||oe.isWebGL2===!0&&yt.morphTargetsCount!==$t)&&(Qt=!0):(Qt=!0,yt.__version=ve.version);let ai=yt.currentProgram;Qt===!0&&(ai=ao(ve,ce,fe));let ac=!1,gr=!1,Ba=!1;const hn=ai.getUniforms(),li=yt.uniforms;if(ne.useProgram(ai.program)&&(ac=!0,gr=!0,Ba=!0),ve.id!==D&&(D=ve.id,gr=!0),ac||T!==U){hn.setValue(N,"projectionMatrix",U.projectionMatrix),hn.setValue(N,"viewMatrix",U.matrixWorldInverse);const Gn=hn.map.cameraPosition;Gn!==void 0&&Gn.setValue(N,ue.setFromMatrixPosition(U.matrixWorld)),oe.logarithmicDepthBuffer&&hn.setValue(N,"logDepthBufFC",2/(Math.log(U.far+1)/Math.LN2)),(ve.isMeshPhongMaterial||ve.isMeshToonMaterial||ve.isMeshLambertMaterial||ve.isMeshBasicMaterial||ve.isMeshStandardMaterial||ve.isShaderMaterial)&&hn.setValue(N,"isOrthographic",U.isOrthographicCamera===!0),T!==U&&(T=U,gr=!0,Ba=!0)}if(fe.isSkinnedMesh){hn.setOptional(N,fe,"bindMatrix"),hn.setOptional(N,fe,"bindMatrixInverse");const Gn=fe.skeleton;Gn&&(oe.floatVertexTextures?(Gn.boneTexture===null&&Gn.computeBoneTexture(),hn.setValue(N,"boneTexture",Gn.boneTexture,te)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}fe.isBatchedMesh&&(hn.setOptional(N,fe,"batchingTexture"),hn.setValue(N,"batchingTexture",fe._matricesTexture,te));const Ga=be.morphAttributes;if((Ga.position!==void 0||Ga.normal!==void 0||Ga.color!==void 0&&oe.isWebGL2===!0)&&Ze.update(fe,be,ai),(gr||yt.receiveShadow!==fe.receiveShadow)&&(yt.receiveShadow=fe.receiveShadow,hn.setValue(N,"receiveShadow",fe.receiveShadow)),ve.isMeshGouraudMaterial&&ve.envMap!==null&&(li.envMap.value=at,li.flipEnvMap.value=at.isCubeTexture&&at.isRenderTargetTexture===!1?-1:1),gr&&(hn.setValue(N,"toneMappingExposure",v.toneMappingExposure),yt.needsLights&&Zu(li,Ba),Qe&&ve.fog===!0&&ye.refreshFogUniforms(li,Qe),ye.refreshMaterialUniforms(li,ve,P,H,Me),Ed.upload(N,rc(yt),li,te)),ve.isShaderMaterial&&ve.uniformsNeedUpdate===!0&&(Ed.upload(N,rc(yt),li,te),ve.uniformsNeedUpdate=!1),ve.isSpriteMaterial&&hn.setValue(N,"center",fe.center),hn.setValue(N,"modelViewMatrix",fe.modelViewMatrix),hn.setValue(N,"normalMatrix",fe.normalMatrix),hn.setValue(N,"modelMatrix",fe.matrixWorld),ve.isShaderMaterial||ve.isRawShaderMaterial){const Gn=ve.uniformsGroups;for(let Va=0,ep=Gn.length;Va0&&te.useMultisampledRTT(U)===!1?fe=Ae.get(U).__webglMultisampledFramebuffer:Array.isArray(_t)?fe=_t[be]:fe=_t,O.copy(U.viewport),F.copy(U.scissor),z=U.scissorTest}else O.copy(re).multiplyScalar(P).floor(),F.copy(me).multiplyScalar(P).floor(),z=Se;if(ne.bindFramebuffer(N.FRAMEBUFFER,fe)&&oe.drawBuffers&&ve&&ne.drawBuffers(U,fe),ne.viewport(O),ne.scissor(F),ne.setScissorTest(z),Qe){const at=Ae.get(U.texture);N.framebufferTexture2D(N.FRAMEBUFFER,N.COLOR_ATTACHMENT0,N.TEXTURE_CUBE_MAP_POSITIVE_X+ce,at.__webglTexture,be)}else if(nt){const at=Ae.get(U.texture),bt=ce||0;N.framebufferTextureLayer(N.FRAMEBUFFER,N.COLOR_ATTACHMENT0,at.__webglTexture,be||0,bt)}D=-1},this.readRenderTargetPixels=function(U,ce,be,ve,fe,Qe,nt){if(!(U&&U.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let rt=Ae.get(U).__webglFramebuffer;if(U.isWebGLCubeRenderTarget&&nt!==void 0&&(rt=rt[nt]),rt){ne.bindFramebuffer(N.FRAMEBUFFER,rt);try{const at=U.texture,bt=at.format,_t=at.type;if(bt!==ls&&ct.convert(bt)!==N.getParameter(N.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const ft=_t===Fl&&(Y.has("EXT_color_buffer_half_float")||oe.isWebGL2&&Y.has("EXT_color_buffer_float"));if(_t!==cr&&ct.convert(_t)!==N.getParameter(N.IMPLEMENTATION_COLOR_READ_TYPE)&&!(_t===vi&&(oe.isWebGL2||Y.has("OES_texture_float")||Y.has("WEBGL_color_buffer_float")))&&!ft){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ce>=0&&ce<=U.width-ve&&be>=0&&be<=U.height-fe&&N.readPixels(ce,be,ve,fe,ct.convert(bt),ct.convert(_t),Qe)}finally{const at=A!==null?Ae.get(A).__webglFramebuffer:null;ne.bindFramebuffer(N.FRAMEBUFFER,at)}}},this.copyFramebufferToTexture=function(U,ce,be=0){const ve=Math.pow(2,-be),fe=Math.floor(ce.image.width*ve),Qe=Math.floor(ce.image.height*ve);te.setTexture2D(ce,0),N.copyTexSubImage2D(N.TEXTURE_2D,be,0,0,U.x,U.y,fe,Qe),ne.unbindTexture()},this.copyTextureToTexture=function(U,ce,be,ve=0){const fe=ce.image.width,Qe=ce.image.height,nt=ct.convert(be.format),rt=ct.convert(be.type);te.setTexture2D(be,0),N.pixelStorei(N.UNPACK_FLIP_Y_WEBGL,be.flipY),N.pixelStorei(N.UNPACK_PREMULTIPLY_ALPHA_WEBGL,be.premultiplyAlpha),N.pixelStorei(N.UNPACK_ALIGNMENT,be.unpackAlignment),ce.isDataTexture?N.texSubImage2D(N.TEXTURE_2D,ve,U.x,U.y,fe,Qe,nt,rt,ce.image.data):ce.isCompressedTexture?N.compressedTexSubImage2D(N.TEXTURE_2D,ve,U.x,U.y,ce.mipmaps[0].width,ce.mipmaps[0].height,nt,ce.mipmaps[0].data):N.texSubImage2D(N.TEXTURE_2D,ve,U.x,U.y,nt,rt,ce.image),ve===0&&be.generateMipmaps&&N.generateMipmap(N.TEXTURE_2D),ne.unbindTexture()},this.copyTextureToTexture3D=function(U,ce,be,ve,fe=0){if(v.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Qe=U.max.x-U.min.x+1,nt=U.max.y-U.min.y+1,rt=U.max.z-U.min.z+1,at=ct.convert(ve.format),bt=ct.convert(ve.type);let _t;if(ve.isData3DTexture)te.setTexture3D(ve,0),_t=N.TEXTURE_3D;else if(ve.isDataArrayTexture)te.setTexture2DArray(ve,0),_t=N.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}N.pixelStorei(N.UNPACK_FLIP_Y_WEBGL,ve.flipY),N.pixelStorei(N.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ve.premultiplyAlpha),N.pixelStorei(N.UNPACK_ALIGNMENT,ve.unpackAlignment);const ft=N.getParameter(N.UNPACK_ROW_LENGTH),Zt=N.getParameter(N.UNPACK_IMAGE_HEIGHT),Mn=N.getParameter(N.UNPACK_SKIP_PIXELS),rn=N.getParameter(N.UNPACK_SKIP_ROWS),vs=N.getParameter(N.UNPACK_SKIP_IMAGES),$t=be.isCompressedTexture?be.mipmaps[0]:be.image;N.pixelStorei(N.UNPACK_ROW_LENGTH,$t.width),N.pixelStorei(N.UNPACK_IMAGE_HEIGHT,$t.height),N.pixelStorei(N.UNPACK_SKIP_PIXELS,U.min.x),N.pixelStorei(N.UNPACK_SKIP_ROWS,U.min.y),N.pixelStorei(N.UNPACK_SKIP_IMAGES,U.min.z),be.isDataTexture||be.isData3DTexture?N.texSubImage3D(_t,fe,ce.x,ce.y,ce.z,Qe,nt,rt,at,bt,$t.data):be.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),N.compressedTexSubImage3D(_t,fe,ce.x,ce.y,ce.z,Qe,nt,rt,at,$t.data)):N.texSubImage3D(_t,fe,ce.x,ce.y,ce.z,Qe,nt,rt,at,bt,$t),N.pixelStorei(N.UNPACK_ROW_LENGTH,ft),N.pixelStorei(N.UNPACK_IMAGE_HEIGHT,Zt),N.pixelStorei(N.UNPACK_SKIP_PIXELS,Mn),N.pixelStorei(N.UNPACK_SKIP_ROWS,rn),N.pixelStorei(N.UNPACK_SKIP_IMAGES,vs),fe===0&&ve.generateMipmaps&&N.generateMipmap(_t),ne.unbindTexture()},this.initTexture=function(U){U.isCubeTexture?te.setTextureCube(U,0):U.isData3DTexture?te.setTexture3D(U,0):U.isDataArrayTexture||U.isCompressedArrayTexture?te.setTexture2DArray(U,0):te.setTexture2D(U,0),ne.unbindTexture()},this.resetState=function(){w=0,x=0,A=null,ne.reset(),tt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Si}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===wE?"display-p3":"srgb",t.unpackColorSpace=Ut.workingColorSpace===Hu?"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===en?Yr:dO}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===Yr?en:Cn}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class UIt extends OO{}UIt.prototype.isWebGL1Renderer=!0;class FIt extends Jt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t}}class BIt{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Gg,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Ds()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return console.warn('THREE.InterleavedBuffer: "updateRange" is deprecated and removed in r169. Use "addUpdateRange()" instead.'),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,s){e*=this.stride,s*=t.stride;for(let i=0,r=this.stride;il)continue;f.applyMatrix4(this.matrixWorld);const D=e.ray.origin.distanceTo(f);De.far||t.push({distance:D,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 x=e.ray.origin.distanceTo(f);xe.far||t.push({distance:x,point:h.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,s=Object.keys(t);if(s.length>0){const i=t[s[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=i.length;r0){const i=t[s[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=i.length;ri.far)return;r.push({distance:u,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}class LE extends ks{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new ut(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ut(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=CE,this.normalScale=new Rt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Li extends LE{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Rt(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Nn(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new ut(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new ut(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new ut(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class G1 extends ks{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new ut(16777215),this.specular=new ut(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ut(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=CE,this.normalScale=new Rt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=TE,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 sd(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function jIt(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function QIt(n){function e(i,r){return n[i]-n[r]}const t=n.length,s=new Array(t);for(let i=0;i!==t;++i)s[i]=i;return s.sort(e),s}function V1(n,e,t){const s=n.length,i=new n.constructor(s);for(let r=0,o=0;o!==s;++r){const a=t[r]*e;for(let l=0;l!==e;++l)i[o++]=n[a+l]}return i}function kO(n,e,t,s){let i=1,r=n[0];for(;r!==void 0&&r[s]===void 0;)r=n[i++];if(r===void 0)return;let o=r[s];if(o!==void 0)if(Array.isArray(o))do o=r[s],o!==void 0&&(e.push(r.time),t.push.apply(t,o)),r=n[i++];while(r!==void 0);else if(o.toArray!==void 0)do o=r[s],o!==void 0&&(e.push(r.time),o.toArray(t,t.length)),r=n[i++];while(r!==void 0);else do o=r[s],o!==void 0&&(e.push(r.time),t.push(o)),r=n[i++];while(r!==void 0)}class ec{constructor(e,t,s,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(s),this.sampleValues=t,this.valueSize=s,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let s=this._cachedIndex,i=t[s],r=t[s-1];e:{t:{let o;n:{s:if(!(e=r)){const a=t[1];e=r)break t}o=s,s=0;break n}break e}for(;s>>1;et;)--o;if(++o,r!==0||o!==i){r>=o&&(o=Math.max(o,1),r=o-1);const a=this.getValueSize();this.times=s.slice(r,o),this.values=this.values.slice(r*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const s=this.times,i=this.values,r=s.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=s[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(i!==void 0&&jIt(i))for(let a=0,l=i.length;a!==l;++a){const u=i[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(),t=this.values.slice(),s=this.getValueSize(),i=this.getInterpolation()===Em,r=e.length-1;let o=1;for(let a=1;a0){e[o]=e[r];for(let a=r*s,l=o*s,u=0;u!==s;++u)t[l+u]=t[a+u];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*s)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),s=this.constructor,i=new s(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}oi.prototype.TimeBufferType=Float32Array;oi.prototype.ValueBufferType=Float32Array;oi.prototype.DefaultInterpolation=ua;class ka extends oi{}ka.prototype.ValueTypeName="bool";ka.prototype.ValueBufferType=Array;ka.prototype.DefaultInterpolation=Bl;ka.prototype.InterpolantFactoryMethodLinear=void 0;ka.prototype.InterpolantFactoryMethodSmooth=void 0;class LO extends oi{}LO.prototype.ValueTypeName="color";class ha extends oi{}ha.prototype.ValueTypeName="number";class eMt extends ec{constructor(e,t,s,i){super(e,t,s,i)}interpolate_(e,t,s,i){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(s-t)/(i-t);let u=e*a;for(let d=u+a;u!==d;u+=4)mr.slerpFlat(r,0,o,u-a,o,u,l);return r}}class eo extends oi{InterpolantFactoryMethodLinear(e){return new eMt(this.times,this.values,this.getValueSize(),e)}}eo.prototype.ValueTypeName="quaternion";eo.prototype.DefaultInterpolation=ua;eo.prototype.InterpolantFactoryMethodSmooth=void 0;class La extends oi{}La.prototype.ValueTypeName="string";La.prototype.ValueBufferType=Array;La.prototype.DefaultInterpolation=Bl;La.prototype.InterpolantFactoryMethodLinear=void 0;La.prototype.InterpolantFactoryMethodSmooth=void 0;class fa extends oi{}fa.prototype.ValueTypeName="vector";class tMt{constructor(e,t=-1,s,i=owt){this.name=e,this.tracks=s,this.duration=t,this.blendMode=i,this.uuid=Ds(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],s=e.tracks,i=1/(e.fps||1);for(let o=0,a=s.length;o!==a;++o)t.push(sMt(s[o]).scale(i));const r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){const t=[],s=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let r=0,o=s.length;r!==o;++r)t.push(oi.toJSON(s[r]));return i}static CreateFromMorphTargetSequence(e,t,s,i){const r=t.length,o=[];for(let a=0;a1){const h=d[1];let f=i[h];f||(i[h]=f=[]),f.push(u)}}const o=[];for(const a in i)o.push(this.CreateFromMorphTargetSequence(a,i[a],t,s));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const s=function(h,f,_,m,E){if(_.length!==0){const b=[],g=[];kO(_,b,g,m),b.length!==0&&E.push(new h(f,b,g))}},i=[],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{t&&t(r),this.manager.itemEnd(e)},0),r;if(fi[e]!==void 0){fi[e].push({onLoad:t,onProgress:s,onError:i});return}fi[e]=[],fi[e].push({onLoad:t,onProgress:s,onError:i});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=fi[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 w=new ProgressEvent("progress",{lengthComputable:m,loaded:E,total:_});for(let x=0,A=d.length;x{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=fi[e];delete fi[e];for(let h=0,f=d.length;h{const d=fi[e];if(d===void 0)throw this.manager.itemError(e),u;delete fi[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 aMt extends Pa{constructor(e){super(e)}load(e,t,s,i){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(){t&&t(o),r.manager.itemEnd(e)},0),o;const a=Gl("img");function l(){d(),ma.add(e,this),t&&t(this),r.manager.itemEnd(e)}function u(h){d(),i&&i(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 UO extends Pa{constructor(e){super(e)}load(e,t,s,i){const r=new xn,o=new aMt(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(a){r.image=a,r.needsUpdate=!0,t!==void 0&&t(r)},s,i),r}}class Wu extends Jt{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new ut(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}const $m=new xt,z1=new ie,H1=new ie;class PE{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Rt(512,512),this.map=null,this.mapPass=null,this.matrix=new xt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new AE,this._frameExtents=new Rt(1,1),this._viewportCount=1,this._viewports=[new Yt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,s=this.matrix;z1.setFromMatrixPosition(e.matrixWorld),t.position.copy(z1),H1.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(H1),t.updateMatrixWorld(),$m.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix($m),s.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),s.multiply($m)}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 lMt extends PE{constructor(){super(new Pn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,s=pa*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,r=e.distance||t.far;(s!==t.fov||i!==t.aspect||r!==t.far)&&(t.fov=s,t.aspect=i,t.far=r,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class cMt extends Wu{constructor(e,t,s=0,i=Math.PI/3,r=0,o=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Jt.DEFAULT_UP),this.updateMatrix(),this.target=new Jt,this.distance=s,this.angle=i,this.penumbra=r,this.decay=o,this.map=null,this.shadow=new lMt}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const q1=new xt,el=new ie,Wm=new ie;class dMt extends PE{constructor(){super(new Pn(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Rt(4,2),this._viewportCount=6,this._viewports=[new Yt(2,1,1,1),new Yt(0,1,1,1),new Yt(3,1,1,1),new Yt(1,1,1,1),new Yt(3,0,1,1),new Yt(1,0,1,1)],this._cubeDirections=[new ie(1,0,0),new ie(-1,0,0),new ie(0,0,1),new ie(0,0,-1),new ie(0,1,0),new ie(0,-1,0)],this._cubeUps=[new ie(0,1,0),new ie(0,1,0),new ie(0,1,0),new ie(0,1,0),new ie(0,0,1),new ie(0,0,-1)]}updateMatrices(e,t=0){const s=this.camera,i=this.matrix,r=e.distance||s.far;r!==s.far&&(s.far=r,s.updateProjectionMatrix()),el.setFromMatrixPosition(e.matrixWorld),s.position.copy(el),Wm.copy(s.position),Wm.add(this._cubeDirections[t]),s.up.copy(this._cubeUps[t]),s.lookAt(Wm),s.updateMatrixWorld(),i.makeTranslation(-el.x,-el.y,-el.z),q1.multiplyMatrices(s.projectionMatrix,s.matrixWorldInverse),this._frustum.setFromProjectionMatrix(q1)}}class uMt extends Wu{constructor(e,t,s=0,i=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=s,this.decay=i,this.shadow=new dMt}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class pMt extends PE{constructor(){super(new OE(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class FO extends Wu{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Jt.DEFAULT_UP),this.updateMatrix(),this.target=new Jt,this.shadow=new pMt}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class _Mt extends Wu{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class El{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let s=0,i=e.length;s"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,s,i){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(){t&&t(o),r.manager.itemEnd(e)},0),o;const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(l){ma.add(e,l),t&&t(l),r.manager.itemEnd(e)}).catch(function(l){i&&i(l),r.manager.itemError(e),r.manager.itemEnd(e)}),r.manager.itemStart(e)}}const UE="\\[\\]\\.:\\/",fMt=new RegExp("["+UE+"]","g"),FE="[^"+UE+"]",mMt="[^"+UE.replace("\\.","")+"]",gMt=/((?:WC+[\/:])*)/.source.replace("WC",FE),bMt=/(WCOD+)?/.source.replace("WCOD",mMt),EMt=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",FE),yMt=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",FE),vMt=new RegExp("^"+gMt+bMt+EMt+yMt+"$"),SMt=["material","materials","bones","map"];class TMt{constructor(e,t,s){const i=s||Bt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const s=this._targetGroup.nCachedObjects_,i=this._bindings[s];i!==void 0&&i.getValue(e,t)}setValue(e,t){const s=this._bindings;for(let i=this._targetGroup.nCachedObjects_,r=s.length;i!==r;++i)s[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,s=e.length;t!==s;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,s=e.length;t!==s;++t)e[t].unbind()}}class Bt{constructor(e,t,s){this.path=t,this.parsedPath=s||Bt.parseTrackName(t),this.node=Bt.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,s){return e&&e.isAnimationObjectGroup?new Bt.Composite(e,t,s):new Bt(e,t,s)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(fMt,"")}static parseTrackName(e){const t=vMt.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const s={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=s.nodeName&&s.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const r=s.nodeName.substring(i+1);SMt.indexOf(r)!==-1&&(s.nodeName=s.nodeName.substring(0,i),s.objectName=r)}if(s.propertyName===null||s.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return s}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const s=e.skeleton.getBoneByName(t);if(s!==void 0)return s}if(e.children){const s=function(r){for(let o=0;o=2.0 are supported."));return}const u=new n2t(r,{path:t||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(s,i)}parseAsync(e,t){const s=this;return new Promise(function(i,r){s.parse(e,t,i,r)})}}function CMt(){let n={};return{get:function(e){return n[e]},add:function(e,t){n[e]=t},remove:function(e){delete n[e]},removeAll:function(){n={}}}}const wt={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 wMt{constructor(e){this.parser=e,this.name=wt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let s=0,i=t.length;s=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,r.source,o)}}class BMt{constructor(e){this.parser=e,this.name=wt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,s=this.parser,i=s.json,r=i.textures[e];if(!r.extensions||!r.extensions[t])return null;const o=r.extensions[t],a=i.images[o.source];let l=s.textureLoader;if(a.uri){const u=s.options.manager.getHandler(a.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return s.loadTextureImage(e,o.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return s.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class GMt{constructor(e){this.parser=e,this.name=wt.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,s=this.parser,i=s.json,r=i.textures[e];if(!r.extensions||!r.extensions[t])return null;const o=r.extensions[t],a=i.images[o.source];let l=s.textureLoader;if(a.uri){const u=s.options.manager.getHandler(a.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return s.loadTextureImage(e,o.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return s.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class VMt{constructor(e){this.name=wt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,s=t.bufferViews[e];if(s.extensions&&s.extensions[this.name]){const i=s.extensions[this.name],r=this.parser.getDependency("buffer",i.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return r.then(function(a){const l=i.byteOffset||0,u=i.byteLength||0,d=i.count,h=i.byteStride,f=new Uint8Array(a,l,u);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(d,h,f,i.mode,i.filter).then(function(_){return _.buffer}):o.ready.then(function(){const _=new ArrayBuffer(d*h);return o.decodeGltfBuffer(new Uint8Array(_),d,h,f,i.mode,i.filter),_})})}else return null}}class zMt{constructor(e){this.name=wt.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,s=t.nodes[e];if(!s.extensions||!s.extensions[this.name]||s.mesh===void 0)return null;const i=t.meshes[s.mesh];for(const u of i.primitives)if(u.mode!==rs.TRIANGLES&&u.mode!==rs.TRIANGLE_STRIP&&u.mode!==rs.TRIANGLE_FAN&&u.mode!==void 0)return null;const o=s.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 xt,b=new ie,g=new mr,y=new ie(1,1,1),v=new YIt(m.geometry,m.material,f);for(let S=0;S0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const t2t=new xt;class n2t{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new CMt,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 s=!1,i=!1,r=-1;typeof navigator<"u"&&(s=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,i=navigator.userAgent.indexOf("Firefox")>-1,r=i?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||s||i&&r<98?this.textureLoader=new UO(this.options.manager):this.textureLoader=new hMt(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new PO(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const s=this,i=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([s.getDependencies("scene"),s.getDependencies("animation"),s.getDependencies("camera")])}).then(function(o){const a={scene:o[0][i.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:i.asset,parser:s,userData:{}};return wr(r,a,i),er(a,i),Promise.all(s._invokeAll(function(l){return l.afterRoot&&l.afterRoot(a)})).then(function(){e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],s=this.json.meshes||[];for(let i=0,r=t.length;i{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(s,i),i.name+="_instance_"+e.uses[t]++,i}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let s=0;s=2&&b.setY(T,x[A*l+1]),l>=3&&b.setZ(T,x[A*l+2]),l>=4&&b.setW(T,x[A*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return b})}loadTexture(e){const t=this.json,s=this.options,r=t.textures[e].source,o=t.images[r];let a=this.textureLoader;if(o.uri){const l=s.manager.getHandler(o.uri);l!==null&&(a=l)}return this.loadTextureImage(e,r,a)}loadTextureImage(e,t,s){const i=this,r=this.json,o=r.textures[e],a=r.images[t],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const u=this.loadImageSource(t,s).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=W1[f.magFilter]||zn,d.minFilter=W1[f.minFilter]||Xr,d.wrapS=K1[f.wrapS]||ca,d.wrapT=K1[f.wrapT]||ca,i.associations.set(d,{textures:e}),d}).catch(function(){return null});return this.textureCache[l]=u,u}loadImageSource(e,t){const s=this,i=this.json,r=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(h=>h.clone());const o=i.images[e],a=self.URL||self.webkitURL;let l=o.uri||"",u=!1;if(o.bufferView!==void 0)l=s.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;t.isImageBitmapLoader===!0&&(m=function(E){const b=new xn(E);b.needsUpdate=!0,f(b)}),t.load(El.resolveURL(h,r.path),m,void 0,_)})}).then(function(h){return u===!0&&a.revokeObjectURL(l),h.userData.mimeType=o.mimeType||e2t(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,t,s,i){const r=this;return this.getDependency("texture",s.index).then(function(o){if(!o)return null;if(s.texCoord!==void 0&&s.texCoord>0&&(o=o.clone(),o.channel=s.texCoord),r.extensions[wt.KHR_TEXTURE_TRANSFORM]){const a=s.extensions!==void 0?s.extensions[wt.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const l=r.associations.get(o);o=r.extensions[wt.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),r.associations.set(o,l)}}return i!==void 0&&(o.colorSpace=i),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let s=e.material;const i=t.attributes.tangent===void 0,r=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+s.uuid;let l=this.cache.get(a);l||(l=new DO,ks.prototype.copy.call(l,s),l.color.copy(s.color),l.map=s.map,l.sizeAttenuation=!1,this.cache.add(a,l)),s=l}else if(e.isLine){const a="LineBasicMaterial:"+s.uuid;let l=this.cache.get(a);l||(l=new MO,ks.prototype.copy.call(l,s),l.color.copy(s.color),l.map=s.map,this.cache.add(a,l)),s=l}if(i||r||o){let a="ClonedMaterial:"+s.uuid+":";i&&(a+="derivative-tangents:"),r&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=s.clone(),r&&(l.vertexColors=!0),o&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(s))),s=l}e.material=s}getMaterialType(){return LE}loadMaterial(e){const t=this,s=this.json,i=this.extensions,r=s.materials[e];let o;const a={},l=r.extensions||{},u=[];if(l[wt.KHR_MATERIALS_UNLIT]){const h=i[wt.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),u.push(h.extendParams(a,r,t))}else{const h=r.pbrMetallicRoughness||{};if(a.color=new ut(1,1,1),a.opacity=1,Array.isArray(h.baseColorFactor)){const f=h.baseColorFactor;a.color.setRGB(f[0],f[1],f[2],Cn),a.opacity=f[3]}h.baseColorTexture!==void 0&&u.push(t.assignTexture(a,"map",h.baseColorTexture,en)),a.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,a.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(u.push(t.assignTexture(a,"metalnessMap",h.metallicRoughnessTexture)),u.push(t.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=qs);const d=r.alphaMode||jm.OPAQUE;if(d===jm.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,d===jm.MASK&&(a.alphaTest=r.alphaCutoff!==void 0?r.alphaCutoff:.5)),r.normalTexture!==void 0&&o!==ir&&(u.push(t.assignTexture(a,"normalMap",r.normalTexture)),a.normalScale=new Rt(1,1),r.normalTexture.scale!==void 0)){const h=r.normalTexture.scale;a.normalScale.set(h,h)}if(r.occlusionTexture!==void 0&&o!==ir&&(u.push(t.assignTexture(a,"aoMap",r.occlusionTexture)),r.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=r.occlusionTexture.strength)),r.emissiveFactor!==void 0&&o!==ir){const h=r.emissiveFactor;a.emissive=new ut().setRGB(h[0],h[1],h[2],Cn)}return r.emissiveTexture!==void 0&&o!==ir&&u.push(t.assignTexture(a,"emissiveMap",r.emissiveTexture,en)),Promise.all(u).then(function(){const h=new o(a);return r.name&&(h.name=r.name),er(h,r),t.associations.set(h,{materials:e}),r.extensions&&wr(i,h,r),h})}createUniqueName(e){const t=Bt.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,s=this.extensions,i=this.primitiveCache;function r(a){return s[wt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return j1(l,a,t)})}const o=[];for(let a=0,l=e.length;a0&&ZMt(g,r),g.name=t.createUniqueName(r.name||"mesh_"+e),er(g,r),b.extensions&&wr(i,g,b),t.assignFinalMaterial(g),h.push(g)}for(let _=0,m=h.length;_1?d=new Fr:u.length===1?d=u[0]:d=new Jt,d!==u[0])for(let h=0,f=u.length;h{const h=new Map;for(const[f,_]of i.associations)(f instanceof ks||f instanceof xn)&&h.set(f,_);return d.traverse(f=>{const _=i.associations.get(f);_!=null&&h.set(f,_)}),h};return i.associations=u(r),r})}_createAnimationTracks(e,t,s,i,r){const o=[],a=e.name?e.name:e.uuid,l=[];Yi[r.path]===Yi.weights?e.traverse(function(f){f.morphTargetInfluences&&l.push(f.name?f.name:f.uuid)}):l.push(a);let u;switch(Yi[r.path]){case Yi.weights:u=ha;break;case Yi.rotation:u=eo;break;case Yi.position:case Yi.scale:u=fa;break;default:switch(s.itemSize){case 1:u=ha;break;case 2:case 3:default:u=fa;break}break}const d=i.interpolation!==void 0?jMt[i.interpolation]:ua,h=this._getArrayFromAccessor(s);for(let f=0,_=l.length;f<_;f++){const m=new u(l[f]+"."+Yi[r.path],t.array,h,d);i.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(m),o.push(m)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const s=Wg(t.constructor),i=new Float32Array(t.length);for(let r=0,o=t.length;r{Ge.replace()})},stopVideoStream(){this.isVideoActive=!1,this.imageData=null,He.emit("stop_webcam_video_stream"),Ue(()=>{Ge.replace()})},startDrag(n){this.isDragging=!0,this.zIndex=5001,this.dragStart.x=n.clientX,this.dragStart.y=n.clientY,document.addEventListener("mousemove",this.drag),document.addEventListener("mouseup",this.stopDrag)},drag(n){if(this.isDragging){const e=n.clientX-this.dragStart.x,t=n.clientY-this.dragStart.y;this.position.bottom-=t,this.position.right-=e,this.dragStart.x=n.clientX,this.dragStart.y=n.clientY}},stopDrag(){this.isDragging=!1,this.zIndex=0,document.removeEventListener("mousemove",this.drag),document.removeEventListener("mouseup",this.stopDrag)}},mounted(){Ge.replace(),He.on("video_stream_image",n=>{if(this.isVideoActive){this.imageDataUrl="data:image/jpeg;base64,"+n,this.frameCount++;const e=Date.now();e-this.lastFrameTime>=1e3&&(this.frameRate=this.frameCount,this.frameCount=0,this.lastFrameTime=e)}})}},r2t=["src"],o2t=["src"],a2t={class:"controls"},l2t=c("i",{"data-feather":"video"},null,-1),c2t=[l2t],d2t=c("i",{"data-feather":"video"},null,-1),u2t=[d2t],p2t={key:2};function _2t(n,e,t,s,i,r){return C(),R("div",{class:"floating-frame bg-white",style:jt({bottom:i.position.bottom+"px",right:i.position.right+"px","z-index":i.zIndex}),onMousedown:e[4]||(e[4]=ae((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[5]||(e[5]=ae((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},[c("div",{class:"handle",onMousedown:e[0]||(e[0]=ae((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[1]||(e[1]=ae((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},"Drag Me",32),i.isVideoActive&&i.imageDataUrl!=null?(C(),R("img",{key:0,src:i.imageDataUrl,alt:"Webcam Frame",width:"300",height:"300"},null,8,r2t)):G("",!0),i.isVideoActive&&i.imageDataUrl==null?(C(),R("p",{key:1,src:i.imageDataUrl,alt:"Webcam Frame",width:"300",height:"300"},"Loading. Please wait...",8,o2t)):G("",!0),c("div",a2t,[i.isVideoActive?G("",!0):(C(),R("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))},c2t)),i.isVideoActive?(C(),R("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))},u2t)):G("",!0),i.isVideoActive?(C(),R("span",p2t,"FPS: "+se(i.frameRate),1)):G("",!0)])],36)}const h2t=pt(i2t,[["render",_2t]]);const f2t={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(){He.emit("start_audio_stream",()=>{this.isAudioActive=!0}),Ue(()=>{Ge.replace()})},stopAudioStream(){He.emit("stop_audio_stream",()=>{this.isAudioActive=!1,this.imageDataUrl=null}),Ue(()=>{Ge.replace()})},startDrag(n){this.isDragging=!0,this.zIndex=5001,this.dragStart.x=n.clientX,this.dragStart.y=n.clientY,document.addEventListener("mousemove",this.drag),document.addEventListener("mouseup",this.stopDrag)},drag(n){if(this.isDragging){const e=n.clientX-this.dragStart.x,t=n.clientY-this.dragStart.y;this.position.bottom-=t,this.position.right-=e,this.dragStart.x=n.clientX,this.dragStart.y=n.clientY}},stopDrag(){this.isDragging=!1,this.zIndex=0,document.removeEventListener("mousemove",this.drag),document.removeEventListener("mouseup",this.stopDrag)}},mounted(){Ge.replace(),He.on("update_spectrogram",n=>{if(this.isAudioActive){this.imageDataUrl="data:image/jpeg;base64,"+n,this.frameCount++;const e=Date.now();e-this.lastFrameTime>=1e3&&(this.frameRate=this.frameCount,this.frameCount=0,this.lastFrameTime=e)}})}},m2t=["src"],g2t={class:"controls"},b2t=c("i",{"data-feather":"mic"},null,-1),E2t=[b2t],y2t=c("i",{"data-feather":"mic"},null,-1),v2t=[y2t];function S2t(n,e,t,s,i,r){return C(),R("div",{class:"floating-frame bg-white",style:jt({bottom:i.position.bottom+"px",right:i.position.right+"px","z-index":i.zIndex}),onMousedown:e[4]||(e[4]=ae((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[5]||(e[5]=ae((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},[c("div",{class:"handle",onMousedown:e[0]||(e[0]=ae((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[1]||(e[1]=ae((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},"Drag Me",32),i.isAudioActive&&i.imageDataUrl!=null?(C(),R("img",{key:0,src:i.imageDataUrl,alt:"Spectrogram",width:"300",height:"300"},null,8,m2t)):G("",!0),c("div",g2t,[i.isAudioActive?G("",!0):(C(),R("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))},E2t)),i.isAudioActive?(C(),R("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))},v2t)):G("",!0)])],36)}const T2t=pt(f2t,[["render",S2t]]);const x2t={data(){return{activePersonality:null}},props:{personality:{type:Object,default:()=>({})}},components:{VideoFrame:h2t,AudioFrame:T2t},computed:{isReady:{get(){return this.$store.state.ready}}},watch:{"$store.state.mountedPersArr":"updatePersonality","$store.state.config.active_personality_id":"updatePersonality"},async mounted(){for(;this.isReady===!1;)await new Promise(n=>setTimeout(n,100));console.log("Personality:",this.personality),this.initWebGLScene(),this.updatePersonality(),Ue(()=>{Ge.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 FIt,this.camera=new Pn(75,window.innerWidth/window.innerHeight,.1,1e3),this.renderer=new OO,this.renderer.setSize(window.innerWidth,window.innerHeight),this.$refs.webglContainer.appendChild(this.renderer.domElement);const n=new dr,e=new G1({color:65280});this.cube=new Un(n,e),this.scene.add(this.cube);const t=new _Mt(4210752),s=new FO(16777215,.5);s.position.set(0,1,0),this.scene.add(t),this.scene.add(s),this.camera.position.z=5,this.animate()},updatePersonality(){const{mountedPersArr:n,config:e}=this.$store.state;this.activePersonality=n[e.active_personality_id],this.activePersonality.avatar?this.showBoxWithAvatar(this.activePersonality.avatar):this.showDefaultCube(),this.$emit("update:personality",this.activePersonality)},loadScene(n){new xMt().load(n,t=>{this.scene.remove(this.cube),this.cube=t.scene,this.scene.add(this.cube)})},showBoxWithAvatar(n){this.cube&&this.scene.remove(this.cube);const e=new dr,t=new UO().load(n),s=new ir({map:t});this.cube=new Un(e,s),this.scene.add(this.cube)},showDefaultCube(){this.scene.remove(this.cube);const n=new dr,e=new G1({color:65280});this.cube=new Un(n,e),this.scene.add(this.cube)},animate(){requestAnimationFrame(this.animate),this.cube&&(this.cube.rotation.x+=.01,this.cube.rotation.y+=.01),this.renderer.render(this.scene,this.camera)}}},C2t={ref:"webglContainer"},w2t={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"},R2t={key:0,class:"text-center"},A2t={key:1,class:"text-center"},N2t={class:"floating-frame2"},O2t=["innerHTML"];function I2t(n,e,t,s,i,r){const o=dt("VideoFrame"),a=dt("AudioFrame");return C(),R(ze,null,[c("div",C2t,null,512),c("div",w2t,[!i.activePersonality||!i.activePersonality.scene_path?(C(),R("div",R2t," Personality does not have a 3d avatar. ")):G("",!0),!i.activePersonality||!i.activePersonality.avatar||i.activePersonality.avatar===""?(C(),R("div",A2t," Personality does not have an avatar. ")):G("",!0),c("div",N2t,[c("div",{innerHTML:n.htmlContent},null,8,O2t)])]),_e(o,{ref:"video_frame"},null,512),_e(a,{ref:"audio_frame"},null,512)],64)}const M2t=pt(x2t,[["render",I2t]]);let id;const D2t=new Uint8Array(16);function k2t(){if(!id&&(id=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!id))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return id(D2t)}const yn=[];for(let n=0;n<256;++n)yn.push((n+256).toString(16).slice(1));function L2t(n,e=0){return yn[n[e+0]]+yn[n[e+1]]+yn[n[e+2]]+yn[n[e+3]]+"-"+yn[n[e+4]]+yn[n[e+5]]+"-"+yn[n[e+6]]+yn[n[e+7]]+"-"+yn[n[e+8]]+yn[n[e+9]]+"-"+yn[n[e+10]]+yn[n[e+11]]+yn[n[e+12]]+yn[n[e+13]]+yn[n[e+14]]+yn[n[e+15]]}const P2t=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Q1={randomUUID:P2t};function Ci(n,e,t){if(Q1.randomUUID&&!e&&!n)return Q1.randomUUID();n=n||{};const s=n.random||(n.rng||k2t)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,e){t=t||0;for(let i=0;i<16;++i)e[t+i]=s[i];return e}return L2t(s)}class $r{constructor(){this.listenerMap=new Map,this._listeners=[],this.proxyMap=new Map,this.proxies=[]}get listeners(){return this._listeners.concat(this.proxies.flatMap(e=>e()))}subscribe(e,t){this.listenerMap.has(e)&&(console.warn(`Already subscribed. Unsubscribing for you. +}`;function NIt(n,e,t){let s=new AE;const i=new Rt,r=new Rt,o=new Yt,a=new CIt({depthPacking:dwt}),l=new wIt,u={},d=t.maxTextureSize,h={[Oi]:Yn,[Yn]:Oi,[qs]:qs},f=new Jr({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Rt},radius:{value:4}},vertexShader:RIt,fragmentShader:AIt}),_=f.clone();_.defines.HORIZONTAL_PASS=1;const m=new ri;m.setAttribute("position",new Bn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const E=new Un(m,f),b=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=JN;let g=this.type;this.render=function(w,x,A){if(b.enabled===!1||b.autoUpdate===!1&&b.needsUpdate===!1||w.length===0)return;const D=n.getRenderTarget(),T=n.getActiveCubeFace(),O=n.getActiveMipmapLevel(),F=n.state;F.setBlending(ar),F.buffers.color.setClear(1,1,1,1),F.buffers.depth.setTest(!0),F.setScissorTest(!1);const z=g!==gi&&this.type===gi,Z=g===gi&&this.type!==gi;for(let M=0,q=w.length;Md||i.y>d)&&(i.x>d&&(r.x=Math.floor(d/$.x),i.x=r.x*$.x,P.mapSize.x=r.x),i.y>d&&(r.y=Math.floor(d/$.y),i.y=r.y*$.y,P.mapSize.y=r.y)),P.map===null||z===!0||Z===!0){const re=this.type!==gi?{minFilter:mn,magFilter:mn}:{};P.map!==null&&P.map.dispose(),P.map=new Zr(i.x,i.y,re),P.map.texture.name=H.name+".shadowMap",P.camera.updateProjectionMatrix()}n.setRenderTarget(P.map),n.clear();const J=P.getViewportCount();for(let re=0;re0||x.map&&x.alphaTest>0){const F=T.uuid,z=x.uuid;let Z=u[F];Z===void 0&&(Z={},u[F]=Z);let M=Z[z];M===void 0&&(M=T.clone(),Z[z]=M),T=M}if(T.visible=x.visible,T.wireframe=x.wireframe,D===gi?T.side=x.shadowSide!==null?x.shadowSide:x.side:T.side=x.shadowSide!==null?x.shadowSide:h[x.side],T.alphaMap=x.alphaMap,T.alphaTest=x.alphaTest,T.map=x.map,T.clipShadows=x.clipShadows,T.clippingPlanes=x.clippingPlanes,T.clipIntersection=x.clipIntersection,T.displacementMap=x.displacementMap,T.displacementScale=x.displacementScale,T.displacementBias=x.displacementBias,T.wireframeLinewidth=x.wireframeLinewidth,T.linewidth=x.linewidth,A.isPointLight===!0&&T.isMeshDistanceMaterial===!0){const F=n.properties.get(T);F.light=A}return T}function S(w,x,A,D,T){if(w.visible===!1)return;if(w.layers.test(x.layers)&&(w.isMesh||w.isLine||w.isPoints)&&(w.castShadow||w.receiveShadow&&T===gi)&&(!w.frustumCulled||s.intersectsObject(w))){w.modelViewMatrix.multiplyMatrices(A.matrixWorldInverse,w.matrixWorld);const z=e.update(w),Z=w.material;if(Array.isArray(Z)){const M=z.groups;for(let q=0,H=M.length;q=1):re.indexOf("OpenGL ES")!==-1&&(J=parseFloat(/^OpenGL ES (\d)/.exec(re)[1]),$=J>=2);let me=null,Se={};const le=n.getParameter(n.SCISSOR_BOX),Ee=n.getParameter(n.VIEWPORT),Oe=new Yt().fromArray(le),Me=new Yt().fromArray(Ee);function j(X,je,Be,Ne){const Ve=new Uint8Array(4),ot=n.createTexture();n.bindTexture(X,ot),n.texParameteri(X,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(X,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Nt=0;Nt"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(k,I){return g?new OffscreenCanvas(k,I):Gl("canvas")}function v(k,I,W,ye){let K=1;if((k.width>ye||k.height>ye)&&(K=ye/Math.max(k.width,k.height)),K<1||I===!0)if(typeof HTMLImageElement<"u"&&k instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&k instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&k instanceof ImageBitmap){const ee=I?Zd:Math.floor,Re=ee(K*k.width),xe=ee(K*k.height);E===void 0&&(E=y(Re,xe));const Le=W?y(Re,xe):E;return Le.width=Re,Le.height=xe,Le.getContext("2d").drawImage(k,0,0,Re,xe),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+k.width+"x"+k.height+") to ("+Re+"x"+xe+")."),Le}else return"data"in k&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+k.width+"x"+k.height+")."),k;return k}function S(k){return zg(k.width)&&zg(k.height)}function w(k){return a?!1:k.wrapS!==as||k.wrapT!==as||k.minFilter!==mn&&k.minFilter!==zn}function x(k,I){return k.generateMipmaps&&I&&k.minFilter!==mn&&k.minFilter!==zn}function A(k){n.generateMipmap(k)}function D(k,I,W,ye,K=!1){if(a===!1)return I;if(k!==null){if(n[k]!==void 0)return n[k];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+k+"'")}let ee=I;if(I===n.RED&&(W===n.FLOAT&&(ee=n.R32F),W===n.HALF_FLOAT&&(ee=n.R16F),W===n.UNSIGNED_BYTE&&(ee=n.R8)),I===n.RED_INTEGER&&(W===n.UNSIGNED_BYTE&&(ee=n.R8UI),W===n.UNSIGNED_SHORT&&(ee=n.R16UI),W===n.UNSIGNED_INT&&(ee=n.R32UI),W===n.BYTE&&(ee=n.R8I),W===n.SHORT&&(ee=n.R16I),W===n.INT&&(ee=n.R32I)),I===n.RG&&(W===n.FLOAT&&(ee=n.RG32F),W===n.HALF_FLOAT&&(ee=n.RG16F),W===n.UNSIGNED_BYTE&&(ee=n.RG8)),I===n.RGBA){const Re=K?Kd:Ut.getTransfer(ye);W===n.FLOAT&&(ee=n.RGBA32F),W===n.HALF_FLOAT&&(ee=n.RGBA16F),W===n.UNSIGNED_BYTE&&(ee=Re===Wt?n.SRGB8_ALPHA8:n.RGBA8),W===n.UNSIGNED_SHORT_4_4_4_4&&(ee=n.RGBA4),W===n.UNSIGNED_SHORT_5_5_5_1&&(ee=n.RGB5_A1)}return(ee===n.R16F||ee===n.R32F||ee===n.RG16F||ee===n.RG32F||ee===n.RGBA16F||ee===n.RGBA32F)&&e.get("EXT_color_buffer_float"),ee}function T(k,I,W){return x(k,W)===!0||k.isFramebufferTexture&&k.minFilter!==mn&&k.minFilter!==zn?Math.log2(Math.max(I.width,I.height))+1:k.mipmaps!==void 0&&k.mipmaps.length>0?k.mipmaps.length:k.isCompressedTexture&&Array.isArray(k.image)?I.mipmaps.length:1}function O(k){return k===mn||k===Fg||k===bd?n.NEAREST:n.LINEAR}function F(k){const I=k.target;I.removeEventListener("dispose",F),Z(I),I.isVideoTexture&&m.delete(I)}function z(k){const I=k.target;I.removeEventListener("dispose",z),q(I)}function Z(k){const I=s.get(k);if(I.__webglInit===void 0)return;const W=k.source,ye=b.get(W);if(ye){const K=ye[I.__cacheKey];K.usedTimes--,K.usedTimes===0&&M(k),Object.keys(ye).length===0&&b.delete(W)}s.remove(k)}function M(k){const I=s.get(k);n.deleteTexture(I.__webglTexture);const W=k.source,ye=b.get(W);delete ye[I.__cacheKey],o.memory.textures--}function q(k){const I=k.texture,W=s.get(k),ye=s.get(I);if(ye.__webglTexture!==void 0&&(n.deleteTexture(ye.__webglTexture),o.memory.textures--),k.depthTexture&&k.depthTexture.dispose(),k.isWebGLCubeRenderTarget)for(let K=0;K<6;K++){if(Array.isArray(W.__webglFramebuffer[K]))for(let ee=0;ee=l&&console.warn("THREE.WebGLTextures: Trying to use "+k+" texture units while this GPU supports only "+l),H+=1,k}function J(k){const I=[];return I.push(k.wrapS),I.push(k.wrapT),I.push(k.wrapR||0),I.push(k.magFilter),I.push(k.minFilter),I.push(k.anisotropy),I.push(k.internalFormat),I.push(k.format),I.push(k.type),I.push(k.generateMipmaps),I.push(k.premultiplyAlpha),I.push(k.flipY),I.push(k.unpackAlignment),I.push(k.colorSpace),I.join()}function re(k,I){const W=s.get(k);if(k.isVideoTexture&&ge(k),k.isRenderTargetTexture===!1&&k.version>0&&W.__version!==k.version){const ye=k.image;if(ye===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ye.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ue(W,k,I);return}}t.bindTexture(n.TEXTURE_2D,W.__webglTexture,n.TEXTURE0+I)}function me(k,I){const W=s.get(k);if(k.version>0&&W.__version!==k.version){ue(W,k,I);return}t.bindTexture(n.TEXTURE_2D_ARRAY,W.__webglTexture,n.TEXTURE0+I)}function Se(k,I){const W=s.get(k);if(k.version>0&&W.__version!==k.version){ue(W,k,I);return}t.bindTexture(n.TEXTURE_3D,W.__webglTexture,n.TEXTURE0+I)}function le(k,I){const W=s.get(k);if(k.version>0&&W.__version!==k.version){Ce(W,k,I);return}t.bindTexture(n.TEXTURE_CUBE_MAP,W.__webglTexture,n.TEXTURE0+I)}const Ee={[ca]:n.REPEAT,[as]:n.CLAMP_TO_EDGE,[Wd]:n.MIRRORED_REPEAT},Oe={[mn]:n.NEAREST,[Fg]:n.NEAREST_MIPMAP_NEAREST,[bd]:n.NEAREST_MIPMAP_LINEAR,[zn]:n.LINEAR,[tO]:n.LINEAR_MIPMAP_NEAREST,[Xr]:n.LINEAR_MIPMAP_LINEAR},Me={[pwt]:n.NEVER,[bwt]:n.ALWAYS,[_wt]:n.LESS,[uO]:n.LEQUAL,[hwt]:n.EQUAL,[gwt]:n.GEQUAL,[fwt]:n.GREATER,[mwt]:n.NOTEQUAL};function j(k,I,W){if(W?(n.texParameteri(k,n.TEXTURE_WRAP_S,Ee[I.wrapS]),n.texParameteri(k,n.TEXTURE_WRAP_T,Ee[I.wrapT]),(k===n.TEXTURE_3D||k===n.TEXTURE_2D_ARRAY)&&n.texParameteri(k,n.TEXTURE_WRAP_R,Ee[I.wrapR]),n.texParameteri(k,n.TEXTURE_MAG_FILTER,Oe[I.magFilter]),n.texParameteri(k,n.TEXTURE_MIN_FILTER,Oe[I.minFilter])):(n.texParameteri(k,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(k,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),(k===n.TEXTURE_3D||k===n.TEXTURE_2D_ARRAY)&&n.texParameteri(k,n.TEXTURE_WRAP_R,n.CLAMP_TO_EDGE),(I.wrapS!==as||I.wrapT!==as)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(k,n.TEXTURE_MAG_FILTER,O(I.magFilter)),n.texParameteri(k,n.TEXTURE_MIN_FILTER,O(I.minFilter)),I.minFilter!==mn&&I.minFilter!==zn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),I.compareFunction&&(n.texParameteri(k,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(k,n.TEXTURE_COMPARE_FUNC,Me[I.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const ye=e.get("EXT_texture_filter_anisotropic");if(I.magFilter===mn||I.minFilter!==bd&&I.minFilter!==Xr||I.type===vi&&e.has("OES_texture_float_linear")===!1||a===!1&&I.type===Fl&&e.has("OES_texture_half_float_linear")===!1)return;(I.anisotropy>1||s.get(I).__currentAnisotropy)&&(n.texParameterf(k,ye.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(I.anisotropy,i.getMaxAnisotropy())),s.get(I).__currentAnisotropy=I.anisotropy)}}function pe(k,I){let W=!1;k.__webglInit===void 0&&(k.__webglInit=!0,I.addEventListener("dispose",F));const ye=I.source;let K=b.get(ye);K===void 0&&(K={},b.set(ye,K));const ee=J(I);if(ee!==k.__cacheKey){K[ee]===void 0&&(K[ee]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,W=!0),K[ee].usedTimes++;const Re=K[k.__cacheKey];Re!==void 0&&(K[k.__cacheKey].usedTimes--,Re.usedTimes===0&&M(I)),k.__cacheKey=ee,k.__webglTexture=K[ee].texture}return W}function ue(k,I,W){let ye=n.TEXTURE_2D;(I.isDataArrayTexture||I.isCompressedArrayTexture)&&(ye=n.TEXTURE_2D_ARRAY),I.isData3DTexture&&(ye=n.TEXTURE_3D);const K=pe(k,I),ee=I.source;t.bindTexture(ye,k.__webglTexture,n.TEXTURE0+W);const Re=s.get(ee);if(ee.version!==Re.__version||K===!0){t.activeTexture(n.TEXTURE0+W);const xe=Ut.getPrimaries(Ut.workingColorSpace),Le=I.colorSpace===cs?null:Ut.getPrimaries(I.colorSpace),Ze=I.colorSpace===cs||xe===Le?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,I.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,I.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,I.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ze);const ht=w(I)&&S(I.image)===!1;let Pe=v(I.image,ht,!1,d);Pe=De(I,Pe);const ct=S(Pe)||a,tt=r.convert(I.format,I.colorSpace);let Ye=r.convert(I.type),et=D(I.internalFormat,tt,Ye,I.colorSpace,I.isVideoTexture);j(ye,I,ct);let We;const Et=I.mipmaps,X=a&&I.isVideoTexture!==!0&&et!==lO,je=Re.__version===void 0||K===!0,Be=T(I,Pe,ct);if(I.isDepthTexture)et=n.DEPTH_COMPONENT,a?I.type===vi?et=n.DEPTH_COMPONENT32F:I.type===sr?et=n.DEPTH_COMPONENT24:I.type===Hr?et=n.DEPTH24_STENCIL8:et=n.DEPTH_COMPONENT16:I.type===vi&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),I.format===qr&&et===n.DEPTH_COMPONENT&&I.type!==xE&&I.type!==sr&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),I.type=sr,Ye=r.convert(I.type)),I.format===da&&et===n.DEPTH_COMPONENT&&(et=n.DEPTH_STENCIL,I.type!==Hr&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),I.type=Hr,Ye=r.convert(I.type))),je&&(X?t.texStorage2D(n.TEXTURE_2D,1,et,Pe.width,Pe.height):t.texImage2D(n.TEXTURE_2D,0,et,Pe.width,Pe.height,0,tt,Ye,null));else if(I.isDataTexture)if(Et.length>0&&ct){X&&je&&t.texStorage2D(n.TEXTURE_2D,Be,et,Et[0].width,Et[0].height);for(let Ne=0,Ve=Et.length;Ne>=1,Ve>>=1}}else if(Et.length>0&&ct){X&&je&&t.texStorage2D(n.TEXTURE_2D,Be,et,Et[0].width,Et[0].height);for(let Ne=0,Ve=Et.length;Ne0&&je++,t.texStorage2D(n.TEXTURE_CUBE_MAP,je,We,Pe[0].width,Pe[0].height));for(let Ne=0;Ne<6;Ne++)if(ht){Et?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ne,0,0,0,Pe[Ne].width,Pe[Ne].height,Ye,et,Pe[Ne].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ne,0,We,Pe[Ne].width,Pe[Ne].height,0,Ye,et,Pe[Ne].data);for(let Ve=0;Ve>ee),Pe=Math.max(1,I.height>>ee);K===n.TEXTURE_3D||K===n.TEXTURE_2D_ARRAY?t.texImage3D(K,ee,Le,ht,Pe,I.depth,0,Re,xe,null):t.texImage2D(K,ee,Le,ht,Pe,0,Re,xe,null)}t.bindFramebuffer(n.FRAMEBUFFER,k),we(I)?f.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,ye,K,s.get(W).__webglTexture,0,te(I)):(K===n.TEXTURE_2D||K>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&K<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,ye,K,s.get(W).__webglTexture,ee),t.bindFramebuffer(n.FRAMEBUFFER,null)}function N(k,I,W){if(n.bindRenderbuffer(n.RENDERBUFFER,k),I.depthBuffer&&!I.stencilBuffer){let ye=a===!0?n.DEPTH_COMPONENT24:n.DEPTH_COMPONENT16;if(W||we(I)){const K=I.depthTexture;K&&K.isDepthTexture&&(K.type===vi?ye=n.DEPTH_COMPONENT32F:K.type===sr&&(ye=n.DEPTH_COMPONENT24));const ee=te(I);we(I)?f.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,ee,ye,I.width,I.height):n.renderbufferStorageMultisample(n.RENDERBUFFER,ee,ye,I.width,I.height)}else n.renderbufferStorage(n.RENDERBUFFER,ye,I.width,I.height);n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,k)}else if(I.depthBuffer&&I.stencilBuffer){const ye=te(I);W&&we(I)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,ye,n.DEPTH24_STENCIL8,I.width,I.height):we(I)?f.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,ye,n.DEPTH24_STENCIL8,I.width,I.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,I.width,I.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,k)}else{const ye=I.isWebGLMultipleRenderTargets===!0?I.texture:[I.texture];for(let K=0;K0){W.__webglFramebuffer[xe]=[];for(let Le=0;Le0){W.__webglFramebuffer=[];for(let xe=0;xe0&&we(k)===!1){const xe=ee?I:[I];W.__webglMultisampledFramebuffer=n.createFramebuffer(),W.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,W.__webglMultisampledFramebuffer);for(let Le=0;Le0)for(let Le=0;Le0)for(let Le=0;Le0&&we(k)===!1){const I=k.isWebGLMultipleRenderTargets?k.texture:[k.texture],W=k.width,ye=k.height;let K=n.COLOR_BUFFER_BIT;const ee=[],Re=k.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,xe=s.get(k),Le=k.isWebGLMultipleRenderTargets===!0;if(Le)for(let Ze=0;Ze0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&I.__useRenderToTexture!==!1}function ge(k){const I=o.render.frame;m.get(k)!==I&&(m.set(k,I),k.update())}function De(k,I){const W=k.colorSpace,ye=k.format,K=k.type;return k.isCompressedTexture===!0||k.isVideoTexture===!0||k.format===Vg||W!==Cn&&W!==cs&&(Ut.getTransfer(W)===Wt?a===!1?e.has("EXT_sRGB")===!0&&ye===ls?(k.format=Vg,k.minFilter=zn,k.generateMipmaps=!1):I=_O.sRGBToLinear(I):(ye!==ls||K!==cr)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",W)),I}this.allocateTextureUnit=$,this.resetTextureUnits=P,this.setTexture2D=re,this.setTexture2DArray=me,this.setTexture3D=Se,this.setTextureCube=le,this.rebindTextures=oe,this.setupRenderTarget=ne,this.updateRenderTargetMipmap=Te,this.updateMultisampleRenderTarget=Ae,this.setupDepthRenderbuffer=Y,this.setupFrameBufferTexture=ke,this.useMultisampledRTT=we}function MIt(n,e,t){const s=t.isWebGL2;function i(r,o=cs){let a;const l=Ut.getTransfer(o);if(r===cr)return n.UNSIGNED_BYTE;if(r===sO)return n.UNSIGNED_SHORT_4_4_4_4;if(r===iO)return n.UNSIGNED_SHORT_5_5_5_1;if(r===J1t)return n.BYTE;if(r===ewt)return n.SHORT;if(r===xE)return n.UNSIGNED_SHORT;if(r===nO)return n.INT;if(r===sr)return n.UNSIGNED_INT;if(r===vi)return n.FLOAT;if(r===Fl)return s?n.HALF_FLOAT:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(r===twt)return n.ALPHA;if(r===ls)return n.RGBA;if(r===nwt)return n.LUMINANCE;if(r===swt)return n.LUMINANCE_ALPHA;if(r===qr)return n.DEPTH_COMPONENT;if(r===da)return n.DEPTH_STENCIL;if(r===Vg)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(r===iwt)return n.RED;if(r===rO)return n.RED_INTEGER;if(r===rwt)return n.RG;if(r===oO)return n.RG_INTEGER;if(r===aO)return n.RGBA_INTEGER;if(r===hm||r===fm||r===mm||r===gm)if(l===Wt)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(r===hm)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===fm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===mm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===gm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(r===hm)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===fm)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===mm)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===gm)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(r===dC||r===uC||r===pC||r===_C)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(r===dC)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===uC)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===pC)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===_C)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(r===lO)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(r===hC||r===fC)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(r===hC)return l===Wt?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(r===fC)return l===Wt?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(r===mC||r===gC||r===bC||r===EC||r===yC||r===vC||r===SC||r===TC||r===xC||r===CC||r===wC||r===RC||r===AC||r===NC)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(r===mC)return l===Wt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===gC)return l===Wt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===bC)return l===Wt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===EC)return l===Wt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===yC)return l===Wt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===vC)return l===Wt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===SC)return l===Wt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===TC)return l===Wt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===xC)return l===Wt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===CC)return l===Wt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===wC)return l===Wt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===RC)return l===Wt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===AC)return l===Wt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===NC)return l===Wt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(r===bm||r===OC||r===IC)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(r===bm)return l===Wt?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(r===OC)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(r===IC)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(r===owt||r===MC||r===DC||r===kC)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(r===bm)return a.COMPRESSED_RED_RGTC1_EXT;if(r===MC)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(r===DC)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(r===kC)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return r===Hr?s?n.UNSIGNED_INT_24_8:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):n[r]!==void 0?n[r]:null}return{convert:i}}class DIt extends Pn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class Fr extends Jt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const kIt={type:"move"};class zm{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Fr,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 Fr,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new ie,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new ie),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Fr,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new ie,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new ie),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const s of e.hand.values())this._getHandJoint(t,s)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,s){let i=null,r=null,o=null;const a=this._targetRay,l=this._grip,u=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(u&&e.hand){o=!0;for(const E of e.hand.values()){const b=t.getJointPose(E,s),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=t.getPose(e.gripSpace,s),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&&(i=t.getPose(e.targetRaySpace,s),i===null&&r!==null&&(i=r),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(kIt)))}return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=r!==null),u!==null&&(u.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const s=new Fr;s.matrixAutoUpdate=!1,s.visible=!1,e.joints[t.jointName]=s,e.add(s)}return e.joints[t.jointName]}}class LIt extends Ma{constructor(e,t){super();const s=this;let i=null,r=1,o=null,a="local-floor",l=1,u=null,d=null,h=null,f=null,_=null,m=null;const E=t.getContextAttributes();let b=null,g=null;const y=[],v=[],S=new Rt;let w=null;const x=new Pn;x.layers.enable(1),x.viewport=new Yt;const A=new Pn;A.layers.enable(2),A.viewport=new Yt;const D=[x,A],T=new DIt;T.layers.enable(1),T.layers.enable(2);let O=null,F=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(le){let Ee=y[le];return Ee===void 0&&(Ee=new zm,y[le]=Ee),Ee.getTargetRaySpace()},this.getControllerGrip=function(le){let Ee=y[le];return Ee===void 0&&(Ee=new zm,y[le]=Ee),Ee.getGripSpace()},this.getHand=function(le){let Ee=y[le];return Ee===void 0&&(Ee=new zm,y[le]=Ee),Ee.getHandSpace()};function z(le){const Ee=v.indexOf(le.inputSource);if(Ee===-1)return;const Oe=y[Ee];Oe!==void 0&&(Oe.update(le.inputSource,le.frame,u||o),Oe.dispatchEvent({type:le.type,data:le.inputSource}))}function Z(){i.removeEventListener("select",z),i.removeEventListener("selectstart",z),i.removeEventListener("selectend",z),i.removeEventListener("squeeze",z),i.removeEventListener("squeezestart",z),i.removeEventListener("squeezeend",z),i.removeEventListener("end",Z),i.removeEventListener("inputsourceschange",M);for(let le=0;le=0&&(v[Me]=null,y[Me].disconnect(Oe))}for(let Ee=0;Ee=v.length){v.push(Oe),Me=pe;break}else if(v[pe]===null){v[pe]=Oe,Me=pe;break}if(Me===-1)break}const j=y[Me];j&&j.connect(Oe)}}const q=new ie,H=new ie;function P(le,Ee,Oe){q.setFromMatrixPosition(Ee.matrixWorld),H.setFromMatrixPosition(Oe.matrixWorld);const Me=q.distanceTo(H),j=Ee.projectionMatrix.elements,pe=Oe.projectionMatrix.elements,ue=j[14]/(j[10]-1),Ce=j[14]/(j[10]+1),ke=(j[9]+1)/j[5],N=(j[9]-1)/j[5],V=(j[8]-1)/j[0],Y=(pe[8]+1)/pe[0],oe=ue*V,ne=ue*Y,Te=Me/(-V+Y),Ae=Te*-V;Ee.matrixWorld.decompose(le.position,le.quaternion,le.scale),le.translateX(Ae),le.translateZ(Te),le.matrixWorld.compose(le.position,le.quaternion,le.scale),le.matrixWorldInverse.copy(le.matrixWorld).invert();const te=ue+Te,we=Ce+Te,ge=oe-Ae,De=ne+(Me-Ae),k=ke*Ce/we*te,I=N*Ce/we*te;le.projectionMatrix.makePerspective(ge,De,k,I,te,we),le.projectionMatrixInverse.copy(le.projectionMatrix).invert()}function $(le,Ee){Ee===null?le.matrixWorld.copy(le.matrix):le.matrixWorld.multiplyMatrices(Ee.matrixWorld,le.matrix),le.matrixWorldInverse.copy(le.matrixWorld).invert()}this.updateCamera=function(le){if(i===null)return;T.near=A.near=x.near=le.near,T.far=A.far=x.far=le.far,(O!==T.near||F!==T.far)&&(i.updateRenderState({depthNear:T.near,depthFar:T.far}),O=T.near,F=T.far);const Ee=le.parent,Oe=T.cameras;$(T,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=n._useLegacyLights===!0?Math.PI:1;b.lightMapIntensity.value=g.lightMapIntensity*v,t(g.lightMap,b.lightMapTransform)}g.aoMap&&(b.aoMap.value=g.aoMap,b.aoMapIntensity.value=g.aoMapIntensity,t(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,t(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,t(g.map,b.uvTransform)),g.alphaMap&&(b.alphaMap.value=g.alphaMap,t(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,t(g.map,b.mapTransform)),g.alphaMap&&(b.alphaMap.value=g.alphaMap,t(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,t(g.metalnessMap,b.metalnessMapTransform)),b.roughness.value=g.roughness,g.roughnessMap&&(b.roughnessMap.value=g.roughnessMap,t(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,t(g.sheenColorMap,b.sheenColorMapTransform)),g.sheenRoughnessMap&&(b.sheenRoughnessMap.value=g.sheenRoughnessMap,t(g.sheenRoughnessMap,b.sheenRoughnessMapTransform))),g.clearcoat>0&&(b.clearcoat.value=g.clearcoat,b.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(b.clearcoatMap.value=g.clearcoatMap,t(g.clearcoatMap,b.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(b.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,t(g.clearcoatRoughnessMap,b.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(b.clearcoatNormalMap.value=g.clearcoatNormalMap,t(g.clearcoatNormalMap,b.clearcoatNormalMapTransform),b.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===Yn&&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,t(g.iridescenceMap,b.iridescenceMapTransform)),g.iridescenceThicknessMap&&(b.iridescenceThicknessMap.value=g.iridescenceThicknessMap,t(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,t(g.transmissionMap,b.transmissionMapTransform)),b.thickness.value=g.thickness,g.thicknessMap&&(b.thicknessMap.value=g.thicknessMap,t(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,t(g.anisotropyMap,b.anisotropyMapTransform))),b.specularIntensity.value=g.specularIntensity,b.specularColor.value.copy(g.specularColor),g.specularColorMap&&(b.specularColorMap.value=g.specularColorMap,t(g.specularColorMap,b.specularColorMapTransform)),g.specularIntensityMap&&(b.specularIntensityMap.value=g.specularIntensityMap,t(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:s,refreshMaterialUniforms:i}}function UIt(n,e,t,s){let i={},r={},o=[];const a=t.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(y,v){const S=v.program;s.uniformBlockBinding(y,S)}function u(y,v){let S=i[y.id];S===void 0&&(m(y),S=d(y),i[y.id]=S,y.addEventListener("dispose",b));const w=v.program;s.updateUBOMapping(y,w);const x=e.render.frame;r[y.id]!==x&&(f(y),r[y.id]=x)}function d(y){const v=h();y.__bindingPointIndex=v;const S=n.createBuffer(),w=y.__size,x=y.usage;return n.bindBuffer(n.UNIFORM_BUFFER,S),n.bufferData(n.UNIFORM_BUFFER,w,x),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,v,S),S}function h(){for(let y=0;y0){x=S%w;const z=w-x;x!==0&&z-O.boundary<0&&(S+=w-x,T.__offset=S)}S+=O.storage}return x=S%w,x>0&&(S+=w-x),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),n.deleteBuffer(i[v.id]),delete i[v.id],delete r[v.id]}function g(){for(const y in i)n.deleteBuffer(i[y]);o=[],i={},r={}}return{bind:l,update:u,dispose:g}}class OO{constructor(e={}){const{canvas:t=kwt(),context:s=null,depth:i=!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;s!==null?f=s.getContextAttributes().alpha:f=o;const _=new Uint32Array(4),m=new Int32Array(4);let E=null,b=null;const g=[],y=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=en,this._useLegacyLights=!1,this.toneMapping=lr,this.toneMappingExposure=1;const v=this;let S=!1,w=0,x=0,A=null,D=-1,T=null;const O=new Yt,F=new Yt;let z=null;const Z=new ut(0);let M=0,q=t.width,H=t.height,P=1,$=null,J=null;const re=new Yt(0,0,q,H),me=new Yt(0,0,q,H);let Se=!1;const le=new AE;let Ee=!1,Oe=!1,Me=null;const j=new xt,pe=new Rt,ue=new ie,Ce={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ke(){return A===null?P:1}let N=s;function V(U,ce){for(let be=0;be{function Qe(){if(ve.forEach(function(nt){Ae.get(nt).currentProgram.isReady()&&ve.delete(nt)}),ve.size===0){fe(U);return}setTimeout(Qe,10)}Y.get("KHR_parallel_shader_compile")!==null?Qe():setTimeout(Qe,10)})};let Nt=null;function sn(U){Nt&&Nt(U)}function bn(){En.stop()}function Gt(){En.start()}const En=new TO;En.setAnimationLoop(sn),typeof self<"u"&&En.setContext(self),this.setAnimationLoop=function(U){Nt=U,We.setAnimationLoop(U),U===null?En.stop():En.start()},We.addEventListener("sessionstart",bn),We.addEventListener("sessionend",Gt),this.render=function(U,ce){if(ce!==void 0&&ce.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(S===!0)return;U.matrixWorldAutoUpdate===!0&&U.updateMatrixWorld(),ce.parent===null&&ce.matrixWorldAutoUpdate===!0&&ce.updateMatrixWorld(),We.enabled===!0&&We.isPresenting===!0&&(We.cameraAutoUpdate===!0&&We.updateCamera(ce),ce=We.getCamera()),U.isScene===!0&&U.onBeforeRender(v,U,ce,A),b=ee.get(U,y.length),b.init(),y.push(b),j.multiplyMatrices(ce.projectionMatrix,ce.matrixWorldInverse),le.setFromProjectionMatrix(j),Oe=this.localClippingEnabled,Ee=Re.init(this.clippingPlanes,Oe),E=K.get(U,g.length),E.init(),g.push(E),ts(U,ce,0,v.sortObjects),E.finish(),v.sortObjects===!0&&E.sort($,J),this.info.render.frame++,Ee===!0&&Re.beginShadows();const be=b.state.shadowsArray;if(xe.render(be,U,ce),Ee===!0&&Re.endShadows(),this.info.autoReset===!0&&this.info.reset(),Le.render(E,U),b.setupLights(v._useLegacyLights),ce.isArrayCamera){const ve=ce.cameras;for(let fe=0,Qe=ve.length;fe0?b=y[y.length-1]:b=null,g.pop(),g.length>0?E=g[g.length-1]:E=null};function ts(U,ce,be,ve){if(U.visible===!1)return;if(U.layers.test(ce.layers)){if(U.isGroup)be=U.renderOrder;else if(U.isLOD)U.autoUpdate===!0&&U.update(ce);else if(U.isLight)b.pushLight(U),U.castShadow&&b.pushShadow(U);else if(U.isSprite){if(!U.frustumCulled||le.intersectsSprite(U)){ve&&ue.setFromMatrixPosition(U.matrixWorld).applyMatrix4(j);const nt=I.update(U),rt=U.material;rt.visible&&E.push(U,nt,rt,be,ue.z,null)}}else if((U.isMesh||U.isLine||U.isPoints)&&(!U.frustumCulled||le.intersectsObject(U))){const nt=I.update(U),rt=U.material;if(ve&&(U.boundingSphere!==void 0?(U.boundingSphere===null&&U.computeBoundingSphere(),ue.copy(U.boundingSphere.center)):(nt.boundingSphere===null&&nt.computeBoundingSphere(),ue.copy(nt.boundingSphere.center)),ue.applyMatrix4(U.matrixWorld).applyMatrix4(j)),Array.isArray(rt)){const at=nt.groups;for(let bt=0,_t=at.length;bt<_t;bt++){const ft=at[bt],Zt=rt[ft.materialIndex];Zt&&Zt.visible&&E.push(U,nt,Zt,be,ue.z,ft)}}else rt.visible&&E.push(U,nt,rt,be,ue.z,null)}}const Qe=U.children;for(let nt=0,rt=Qe.length;nt0&&Qu(fe,Qe,ce,be),ve&&ne.viewport(O.copy(ve)),fe.length>0&&oo(fe,ce,be),Qe.length>0&&oo(Qe,ce,be),nt.length>0&&oo(nt,ce,be),ne.buffers.depth.setTest(!0),ne.buffers.depth.setMask(!0),ne.buffers.color.setMask(!0),ne.setPolygonOffset(!1)}function Qu(U,ce,be,ve){if((be.isScene===!0?be.overrideMaterial:null)!==null)return;const Qe=oe.isWebGL2;Me===null&&(Me=new Zr(1,1,{generateMipmaps:!0,type:Y.has("EXT_color_buffer_half_float")?Fl:cr,minFilter:Xr,samples:Qe?4:0})),v.getDrawingBufferSize(pe),Qe?Me.setSize(pe.x,pe.y):Me.setSize(Zd(pe.x),Zd(pe.y));const nt=v.getRenderTarget();v.setRenderTarget(Me),v.getClearColor(Z),M=v.getClearAlpha(),M<1&&v.setClearColor(16777215,.5),v.clear();const rt=v.toneMapping;v.toneMapping=lr,oo(U,be,ve),te.updateMultisampleRenderTarget(Me),te.updateRenderTargetMipmap(Me);let at=!1;for(let bt=0,_t=ce.length;bt<_t;bt++){const ft=ce[bt],Zt=ft.object,Mn=ft.geometry,rn=ft.material,vs=ft.group;if(rn.side===qs&&Zt.layers.test(ve.layers)){const $t=rn.side;rn.side=Yn,rn.needsUpdate=!0,ic(Zt,be,ve,Mn,rn,vs),rn.side=$t,rn.needsUpdate=!0,at=!0}}at===!0&&(te.updateMultisampleRenderTarget(Me),te.updateRenderTargetMipmap(Me)),v.setRenderTarget(nt),v.setClearColor(Z,M),v.toneMapping=rt}function oo(U,ce,be){const ve=ce.isScene===!0?ce.overrideMaterial:null;for(let fe=0,Qe=U.length;fe0),ft=!!be.morphAttributes.position,Zt=!!be.morphAttributes.normal,Mn=!!be.morphAttributes.color;let rn=lr;ve.toneMapped&&(A===null||A.isXRRenderTarget===!0)&&(rn=v.toneMapping);const vs=be.morphAttributes.position||be.morphAttributes.normal||be.morphAttributes.color,$t=vs!==void 0?vs.length:0,yt=Ae.get(ve),Fa=b.state.lights;if(Ee===!0&&(Oe===!0||U!==T)){const Gn=U===T&&ve.id===D;Re.setState(ve,U,Gn)}let Qt=!1;ve.version===yt.__version?(yt.needsLights&&yt.lightsStateVersion!==Fa.state.version||yt.outputColorSpace!==rt||fe.isBatchedMesh&&yt.batching===!1||!fe.isBatchedMesh&&yt.batching===!0||fe.isInstancedMesh&&yt.instancing===!1||!fe.isInstancedMesh&&yt.instancing===!0||fe.isSkinnedMesh&&yt.skinning===!1||!fe.isSkinnedMesh&&yt.skinning===!0||fe.isInstancedMesh&&yt.instancingColor===!0&&fe.instanceColor===null||fe.isInstancedMesh&&yt.instancingColor===!1&&fe.instanceColor!==null||yt.envMap!==at||ve.fog===!0&&yt.fog!==Qe||yt.numClippingPlanes!==void 0&&(yt.numClippingPlanes!==Re.numPlanes||yt.numIntersection!==Re.numIntersection)||yt.vertexAlphas!==bt||yt.vertexTangents!==_t||yt.morphTargets!==ft||yt.morphNormals!==Zt||yt.morphColors!==Mn||yt.toneMapping!==rn||oe.isWebGL2===!0&&yt.morphTargetsCount!==$t)&&(Qt=!0):(Qt=!0,yt.__version=ve.version);let ai=yt.currentProgram;Qt===!0&&(ai=ao(ve,ce,fe));let ac=!1,gr=!1,Ba=!1;const hn=ai.getUniforms(),li=yt.uniforms;if(ne.useProgram(ai.program)&&(ac=!0,gr=!0,Ba=!0),ve.id!==D&&(D=ve.id,gr=!0),ac||T!==U){hn.setValue(N,"projectionMatrix",U.projectionMatrix),hn.setValue(N,"viewMatrix",U.matrixWorldInverse);const Gn=hn.map.cameraPosition;Gn!==void 0&&Gn.setValue(N,ue.setFromMatrixPosition(U.matrixWorld)),oe.logarithmicDepthBuffer&&hn.setValue(N,"logDepthBufFC",2/(Math.log(U.far+1)/Math.LN2)),(ve.isMeshPhongMaterial||ve.isMeshToonMaterial||ve.isMeshLambertMaterial||ve.isMeshBasicMaterial||ve.isMeshStandardMaterial||ve.isShaderMaterial)&&hn.setValue(N,"isOrthographic",U.isOrthographicCamera===!0),T!==U&&(T=U,gr=!0,Ba=!0)}if(fe.isSkinnedMesh){hn.setOptional(N,fe,"bindMatrix"),hn.setOptional(N,fe,"bindMatrixInverse");const Gn=fe.skeleton;Gn&&(oe.floatVertexTextures?(Gn.boneTexture===null&&Gn.computeBoneTexture(),hn.setValue(N,"boneTexture",Gn.boneTexture,te)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}fe.isBatchedMesh&&(hn.setOptional(N,fe,"batchingTexture"),hn.setValue(N,"batchingTexture",fe._matricesTexture,te));const Ga=be.morphAttributes;if((Ga.position!==void 0||Ga.normal!==void 0||Ga.color!==void 0&&oe.isWebGL2===!0)&&Ze.update(fe,be,ai),(gr||yt.receiveShadow!==fe.receiveShadow)&&(yt.receiveShadow=fe.receiveShadow,hn.setValue(N,"receiveShadow",fe.receiveShadow)),ve.isMeshGouraudMaterial&&ve.envMap!==null&&(li.envMap.value=at,li.flipEnvMap.value=at.isCubeTexture&&at.isRenderTargetTexture===!1?-1:1),gr&&(hn.setValue(N,"toneMappingExposure",v.toneMappingExposure),yt.needsLights&&Zu(li,Ba),Qe&&ve.fog===!0&&ye.refreshFogUniforms(li,Qe),ye.refreshMaterialUniforms(li,ve,P,H,Me),Ed.upload(N,rc(yt),li,te)),ve.isShaderMaterial&&ve.uniformsNeedUpdate===!0&&(Ed.upload(N,rc(yt),li,te),ve.uniformsNeedUpdate=!1),ve.isSpriteMaterial&&hn.setValue(N,"center",fe.center),hn.setValue(N,"modelViewMatrix",fe.modelViewMatrix),hn.setValue(N,"normalMatrix",fe.normalMatrix),hn.setValue(N,"modelMatrix",fe.matrixWorld),ve.isShaderMaterial||ve.isRawShaderMaterial){const Gn=ve.uniformsGroups;for(let Va=0,ep=Gn.length;Va0&&te.useMultisampledRTT(U)===!1?fe=Ae.get(U).__webglMultisampledFramebuffer:Array.isArray(_t)?fe=_t[be]:fe=_t,O.copy(U.viewport),F.copy(U.scissor),z=U.scissorTest}else O.copy(re).multiplyScalar(P).floor(),F.copy(me).multiplyScalar(P).floor(),z=Se;if(ne.bindFramebuffer(N.FRAMEBUFFER,fe)&&oe.drawBuffers&&ve&&ne.drawBuffers(U,fe),ne.viewport(O),ne.scissor(F),ne.setScissorTest(z),Qe){const at=Ae.get(U.texture);N.framebufferTexture2D(N.FRAMEBUFFER,N.COLOR_ATTACHMENT0,N.TEXTURE_CUBE_MAP_POSITIVE_X+ce,at.__webglTexture,be)}else if(nt){const at=Ae.get(U.texture),bt=ce||0;N.framebufferTextureLayer(N.FRAMEBUFFER,N.COLOR_ATTACHMENT0,at.__webglTexture,be||0,bt)}D=-1},this.readRenderTargetPixels=function(U,ce,be,ve,fe,Qe,nt){if(!(U&&U.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let rt=Ae.get(U).__webglFramebuffer;if(U.isWebGLCubeRenderTarget&&nt!==void 0&&(rt=rt[nt]),rt){ne.bindFramebuffer(N.FRAMEBUFFER,rt);try{const at=U.texture,bt=at.format,_t=at.type;if(bt!==ls&&ct.convert(bt)!==N.getParameter(N.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const ft=_t===Fl&&(Y.has("EXT_color_buffer_half_float")||oe.isWebGL2&&Y.has("EXT_color_buffer_float"));if(_t!==cr&&ct.convert(_t)!==N.getParameter(N.IMPLEMENTATION_COLOR_READ_TYPE)&&!(_t===vi&&(oe.isWebGL2||Y.has("OES_texture_float")||Y.has("WEBGL_color_buffer_float")))&&!ft){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ce>=0&&ce<=U.width-ve&&be>=0&&be<=U.height-fe&&N.readPixels(ce,be,ve,fe,ct.convert(bt),ct.convert(_t),Qe)}finally{const at=A!==null?Ae.get(A).__webglFramebuffer:null;ne.bindFramebuffer(N.FRAMEBUFFER,at)}}},this.copyFramebufferToTexture=function(U,ce,be=0){const ve=Math.pow(2,-be),fe=Math.floor(ce.image.width*ve),Qe=Math.floor(ce.image.height*ve);te.setTexture2D(ce,0),N.copyTexSubImage2D(N.TEXTURE_2D,be,0,0,U.x,U.y,fe,Qe),ne.unbindTexture()},this.copyTextureToTexture=function(U,ce,be,ve=0){const fe=ce.image.width,Qe=ce.image.height,nt=ct.convert(be.format),rt=ct.convert(be.type);te.setTexture2D(be,0),N.pixelStorei(N.UNPACK_FLIP_Y_WEBGL,be.flipY),N.pixelStorei(N.UNPACK_PREMULTIPLY_ALPHA_WEBGL,be.premultiplyAlpha),N.pixelStorei(N.UNPACK_ALIGNMENT,be.unpackAlignment),ce.isDataTexture?N.texSubImage2D(N.TEXTURE_2D,ve,U.x,U.y,fe,Qe,nt,rt,ce.image.data):ce.isCompressedTexture?N.compressedTexSubImage2D(N.TEXTURE_2D,ve,U.x,U.y,ce.mipmaps[0].width,ce.mipmaps[0].height,nt,ce.mipmaps[0].data):N.texSubImage2D(N.TEXTURE_2D,ve,U.x,U.y,nt,rt,ce.image),ve===0&&be.generateMipmaps&&N.generateMipmap(N.TEXTURE_2D),ne.unbindTexture()},this.copyTextureToTexture3D=function(U,ce,be,ve,fe=0){if(v.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Qe=U.max.x-U.min.x+1,nt=U.max.y-U.min.y+1,rt=U.max.z-U.min.z+1,at=ct.convert(ve.format),bt=ct.convert(ve.type);let _t;if(ve.isData3DTexture)te.setTexture3D(ve,0),_t=N.TEXTURE_3D;else if(ve.isDataArrayTexture)te.setTexture2DArray(ve,0),_t=N.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}N.pixelStorei(N.UNPACK_FLIP_Y_WEBGL,ve.flipY),N.pixelStorei(N.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ve.premultiplyAlpha),N.pixelStorei(N.UNPACK_ALIGNMENT,ve.unpackAlignment);const ft=N.getParameter(N.UNPACK_ROW_LENGTH),Zt=N.getParameter(N.UNPACK_IMAGE_HEIGHT),Mn=N.getParameter(N.UNPACK_SKIP_PIXELS),rn=N.getParameter(N.UNPACK_SKIP_ROWS),vs=N.getParameter(N.UNPACK_SKIP_IMAGES),$t=be.isCompressedTexture?be.mipmaps[0]:be.image;N.pixelStorei(N.UNPACK_ROW_LENGTH,$t.width),N.pixelStorei(N.UNPACK_IMAGE_HEIGHT,$t.height),N.pixelStorei(N.UNPACK_SKIP_PIXELS,U.min.x),N.pixelStorei(N.UNPACK_SKIP_ROWS,U.min.y),N.pixelStorei(N.UNPACK_SKIP_IMAGES,U.min.z),be.isDataTexture||be.isData3DTexture?N.texSubImage3D(_t,fe,ce.x,ce.y,ce.z,Qe,nt,rt,at,bt,$t.data):be.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),N.compressedTexSubImage3D(_t,fe,ce.x,ce.y,ce.z,Qe,nt,rt,at,$t.data)):N.texSubImage3D(_t,fe,ce.x,ce.y,ce.z,Qe,nt,rt,at,bt,$t),N.pixelStorei(N.UNPACK_ROW_LENGTH,ft),N.pixelStorei(N.UNPACK_IMAGE_HEIGHT,Zt),N.pixelStorei(N.UNPACK_SKIP_PIXELS,Mn),N.pixelStorei(N.UNPACK_SKIP_ROWS,rn),N.pixelStorei(N.UNPACK_SKIP_IMAGES,vs),fe===0&&ve.generateMipmaps&&N.generateMipmap(_t),ne.unbindTexture()},this.initTexture=function(U){U.isCubeTexture?te.setTextureCube(U,0):U.isData3DTexture?te.setTexture3D(U,0):U.isDataArrayTexture||U.isCompressedArrayTexture?te.setTexture2DArray(U,0):te.setTexture2D(U,0),ne.unbindTexture()},this.resetState=function(){w=0,x=0,A=null,ne.reset(),tt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Si}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===wE?"display-p3":"srgb",t.unpackColorSpace=Ut.workingColorSpace===Hu?"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===en?Yr:dO}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===Yr?en:Cn}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class FIt extends OO{}FIt.prototype.isWebGL1Renderer=!0;class BIt extends Jt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t}}class GIt{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Gg,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Ds()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return console.warn('THREE.InterleavedBuffer: "updateRange" is deprecated and removed in r169. Use "addUpdateRange()" instead.'),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,s){e*=this.stride,s*=t.stride;for(let i=0,r=this.stride;il)continue;f.applyMatrix4(this.matrixWorld);const D=e.ray.origin.distanceTo(f);De.far||t.push({distance:D,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 x=e.ray.origin.distanceTo(f);xe.far||t.push({distance:x,point:h.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,s=Object.keys(t);if(s.length>0){const i=t[s[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=i.length;r0){const i=t[s[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=i.length;ri.far)return;r.push({distance:u,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}class LE extends ks{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new ut(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ut(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=CE,this.normalScale=new Rt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Li extends LE{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Rt(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Nn(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new ut(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new ut(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new ut(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class G1 extends ks{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new ut(16777215),this.specular=new ut(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ut(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=CE,this.normalScale=new Rt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=TE,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 sd(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function QIt(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function XIt(n){function e(i,r){return n[i]-n[r]}const t=n.length,s=new Array(t);for(let i=0;i!==t;++i)s[i]=i;return s.sort(e),s}function V1(n,e,t){const s=n.length,i=new n.constructor(s);for(let r=0,o=0;o!==s;++r){const a=t[r]*e;for(let l=0;l!==e;++l)i[o++]=n[a+l]}return i}function kO(n,e,t,s){let i=1,r=n[0];for(;r!==void 0&&r[s]===void 0;)r=n[i++];if(r===void 0)return;let o=r[s];if(o!==void 0)if(Array.isArray(o))do o=r[s],o!==void 0&&(e.push(r.time),t.push.apply(t,o)),r=n[i++];while(r!==void 0);else if(o.toArray!==void 0)do o=r[s],o!==void 0&&(e.push(r.time),o.toArray(t,t.length)),r=n[i++];while(r!==void 0);else do o=r[s],o!==void 0&&(e.push(r.time),t.push(o)),r=n[i++];while(r!==void 0)}class ec{constructor(e,t,s,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(s),this.sampleValues=t,this.valueSize=s,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let s=this._cachedIndex,i=t[s],r=t[s-1];e:{t:{let o;n:{s:if(!(e=r)){const a=t[1];e=r)break t}o=s,s=0;break n}break e}for(;s>>1;et;)--o;if(++o,r!==0||o!==i){r>=o&&(o=Math.max(o,1),r=o-1);const a=this.getValueSize();this.times=s.slice(r,o),this.values=this.values.slice(r*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const s=this.times,i=this.values,r=s.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=s[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(i!==void 0&&QIt(i))for(let a=0,l=i.length;a!==l;++a){const u=i[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(),t=this.values.slice(),s=this.getValueSize(),i=this.getInterpolation()===Em,r=e.length-1;let o=1;for(let a=1;a0){e[o]=e[r];for(let a=r*s,l=o*s,u=0;u!==s;++u)t[l+u]=t[a+u];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*s)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),s=this.constructor,i=new s(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}oi.prototype.TimeBufferType=Float32Array;oi.prototype.ValueBufferType=Float32Array;oi.prototype.DefaultInterpolation=ua;class ka extends oi{}ka.prototype.ValueTypeName="bool";ka.prototype.ValueBufferType=Array;ka.prototype.DefaultInterpolation=Bl;ka.prototype.InterpolantFactoryMethodLinear=void 0;ka.prototype.InterpolantFactoryMethodSmooth=void 0;class LO extends oi{}LO.prototype.ValueTypeName="color";class ha extends oi{}ha.prototype.ValueTypeName="number";class tMt extends ec{constructor(e,t,s,i){super(e,t,s,i)}interpolate_(e,t,s,i){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(s-t)/(i-t);let u=e*a;for(let d=u+a;u!==d;u+=4)mr.slerpFlat(r,0,o,u-a,o,u,l);return r}}class eo extends oi{InterpolantFactoryMethodLinear(e){return new tMt(this.times,this.values,this.getValueSize(),e)}}eo.prototype.ValueTypeName="quaternion";eo.prototype.DefaultInterpolation=ua;eo.prototype.InterpolantFactoryMethodSmooth=void 0;class La extends oi{}La.prototype.ValueTypeName="string";La.prototype.ValueBufferType=Array;La.prototype.DefaultInterpolation=Bl;La.prototype.InterpolantFactoryMethodLinear=void 0;La.prototype.InterpolantFactoryMethodSmooth=void 0;class fa extends oi{}fa.prototype.ValueTypeName="vector";class nMt{constructor(e,t=-1,s,i=awt){this.name=e,this.tracks=s,this.duration=t,this.blendMode=i,this.uuid=Ds(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],s=e.tracks,i=1/(e.fps||1);for(let o=0,a=s.length;o!==a;++o)t.push(iMt(s[o]).scale(i));const r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){const t=[],s=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let r=0,o=s.length;r!==o;++r)t.push(oi.toJSON(s[r]));return i}static CreateFromMorphTargetSequence(e,t,s,i){const r=t.length,o=[];for(let a=0;a1){const h=d[1];let f=i[h];f||(i[h]=f=[]),f.push(u)}}const o=[];for(const a in i)o.push(this.CreateFromMorphTargetSequence(a,i[a],t,s));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const s=function(h,f,_,m,E){if(_.length!==0){const b=[],g=[];kO(_,b,g,m),b.length!==0&&E.push(new h(f,b,g))}},i=[],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{t&&t(r),this.manager.itemEnd(e)},0),r;if(fi[e]!==void 0){fi[e].push({onLoad:t,onProgress:s,onError:i});return}fi[e]=[],fi[e].push({onLoad:t,onProgress:s,onError:i});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=fi[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 w=new ProgressEvent("progress",{lengthComputable:m,loaded:E,total:_});for(let x=0,A=d.length;x{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=fi[e];delete fi[e];for(let h=0,f=d.length;h{const d=fi[e];if(d===void 0)throw this.manager.itemError(e),u;delete fi[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 lMt extends Pa{constructor(e){super(e)}load(e,t,s,i){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(){t&&t(o),r.manager.itemEnd(e)},0),o;const a=Gl("img");function l(){d(),ma.add(e,this),t&&t(this),r.manager.itemEnd(e)}function u(h){d(),i&&i(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 UO extends Pa{constructor(e){super(e)}load(e,t,s,i){const r=new xn,o=new lMt(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(a){r.image=a,r.needsUpdate=!0,t!==void 0&&t(r)},s,i),r}}class Wu extends Jt{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new ut(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}const $m=new xt,z1=new ie,H1=new ie;class PE{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Rt(512,512),this.map=null,this.mapPass=null,this.matrix=new xt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new AE,this._frameExtents=new Rt(1,1),this._viewportCount=1,this._viewports=[new Yt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,s=this.matrix;z1.setFromMatrixPosition(e.matrixWorld),t.position.copy(z1),H1.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(H1),t.updateMatrixWorld(),$m.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix($m),s.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),s.multiply($m)}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 cMt extends PE{constructor(){super(new Pn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,s=pa*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,r=e.distance||t.far;(s!==t.fov||i!==t.aspect||r!==t.far)&&(t.fov=s,t.aspect=i,t.far=r,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class dMt extends Wu{constructor(e,t,s=0,i=Math.PI/3,r=0,o=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Jt.DEFAULT_UP),this.updateMatrix(),this.target=new Jt,this.distance=s,this.angle=i,this.penumbra=r,this.decay=o,this.map=null,this.shadow=new cMt}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const q1=new xt,el=new ie,Wm=new ie;class uMt extends PE{constructor(){super(new Pn(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Rt(4,2),this._viewportCount=6,this._viewports=[new Yt(2,1,1,1),new Yt(0,1,1,1),new Yt(3,1,1,1),new Yt(1,1,1,1),new Yt(3,0,1,1),new Yt(1,0,1,1)],this._cubeDirections=[new ie(1,0,0),new ie(-1,0,0),new ie(0,0,1),new ie(0,0,-1),new ie(0,1,0),new ie(0,-1,0)],this._cubeUps=[new ie(0,1,0),new ie(0,1,0),new ie(0,1,0),new ie(0,1,0),new ie(0,0,1),new ie(0,0,-1)]}updateMatrices(e,t=0){const s=this.camera,i=this.matrix,r=e.distance||s.far;r!==s.far&&(s.far=r,s.updateProjectionMatrix()),el.setFromMatrixPosition(e.matrixWorld),s.position.copy(el),Wm.copy(s.position),Wm.add(this._cubeDirections[t]),s.up.copy(this._cubeUps[t]),s.lookAt(Wm),s.updateMatrixWorld(),i.makeTranslation(-el.x,-el.y,-el.z),q1.multiplyMatrices(s.projectionMatrix,s.matrixWorldInverse),this._frustum.setFromProjectionMatrix(q1)}}class pMt extends Wu{constructor(e,t,s=0,i=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=s,this.decay=i,this.shadow=new uMt}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class _Mt extends PE{constructor(){super(new OE(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class FO extends Wu{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Jt.DEFAULT_UP),this.updateMatrix(),this.target=new Jt,this.shadow=new _Mt}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class hMt extends Wu{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class El{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let s=0,i=e.length;s"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,s,i){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(){t&&t(o),r.manager.itemEnd(e)},0),o;const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(l){ma.add(e,l),t&&t(l),r.manager.itemEnd(e)}).catch(function(l){i&&i(l),r.manager.itemError(e),r.manager.itemEnd(e)}),r.manager.itemStart(e)}}const UE="\\[\\]\\.:\\/",mMt=new RegExp("["+UE+"]","g"),FE="[^"+UE+"]",gMt="[^"+UE.replace("\\.","")+"]",bMt=/((?:WC+[\/:])*)/.source.replace("WC",FE),EMt=/(WCOD+)?/.source.replace("WCOD",gMt),yMt=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",FE),vMt=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",FE),SMt=new RegExp("^"+bMt+EMt+yMt+vMt+"$"),TMt=["material","materials","bones","map"];class xMt{constructor(e,t,s){const i=s||Bt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const s=this._targetGroup.nCachedObjects_,i=this._bindings[s];i!==void 0&&i.getValue(e,t)}setValue(e,t){const s=this._bindings;for(let i=this._targetGroup.nCachedObjects_,r=s.length;i!==r;++i)s[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,s=e.length;t!==s;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,s=e.length;t!==s;++t)e[t].unbind()}}class Bt{constructor(e,t,s){this.path=t,this.parsedPath=s||Bt.parseTrackName(t),this.node=Bt.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,s){return e&&e.isAnimationObjectGroup?new Bt.Composite(e,t,s):new Bt(e,t,s)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(mMt,"")}static parseTrackName(e){const t=SMt.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const s={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=s.nodeName&&s.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const r=s.nodeName.substring(i+1);TMt.indexOf(r)!==-1&&(s.nodeName=s.nodeName.substring(0,i),s.objectName=r)}if(s.propertyName===null||s.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return s}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const s=e.skeleton.getBoneByName(t);if(s!==void 0)return s}if(e.children){const s=function(r){for(let o=0;o=2.0 are supported."));return}const u=new s2t(r,{path:t||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(s,i)}parseAsync(e,t){const s=this;return new Promise(function(i,r){s.parse(e,t,i,r)})}}function wMt(){let n={};return{get:function(e){return n[e]},add:function(e,t){n[e]=t},remove:function(e){delete n[e]},removeAll:function(){n={}}}}const wt={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 RMt{constructor(e){this.parser=e,this.name=wt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let s=0,i=t.length;s=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,r.source,o)}}class GMt{constructor(e){this.parser=e,this.name=wt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,s=this.parser,i=s.json,r=i.textures[e];if(!r.extensions||!r.extensions[t])return null;const o=r.extensions[t],a=i.images[o.source];let l=s.textureLoader;if(a.uri){const u=s.options.manager.getHandler(a.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return s.loadTextureImage(e,o.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return s.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class VMt{constructor(e){this.parser=e,this.name=wt.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,s=this.parser,i=s.json,r=i.textures[e];if(!r.extensions||!r.extensions[t])return null;const o=r.extensions[t],a=i.images[o.source];let l=s.textureLoader;if(a.uri){const u=s.options.manager.getHandler(a.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return s.loadTextureImage(e,o.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return s.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class zMt{constructor(e){this.name=wt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,s=t.bufferViews[e];if(s.extensions&&s.extensions[this.name]){const i=s.extensions[this.name],r=this.parser.getDependency("buffer",i.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return r.then(function(a){const l=i.byteOffset||0,u=i.byteLength||0,d=i.count,h=i.byteStride,f=new Uint8Array(a,l,u);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(d,h,f,i.mode,i.filter).then(function(_){return _.buffer}):o.ready.then(function(){const _=new ArrayBuffer(d*h);return o.decodeGltfBuffer(new Uint8Array(_),d,h,f,i.mode,i.filter),_})})}else return null}}class HMt{constructor(e){this.name=wt.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,s=t.nodes[e];if(!s.extensions||!s.extensions[this.name]||s.mesh===void 0)return null;const i=t.meshes[s.mesh];for(const u of i.primitives)if(u.mode!==rs.TRIANGLES&&u.mode!==rs.TRIANGLE_STRIP&&u.mode!==rs.TRIANGLE_FAN&&u.mode!==void 0)return null;const o=s.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 xt,b=new ie,g=new mr,y=new ie(1,1,1),v=new $It(m.geometry,m.material,f);for(let S=0;S0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const n2t=new xt;class s2t{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new wMt,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 s=!1,i=!1,r=-1;typeof navigator<"u"&&(s=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,i=navigator.userAgent.indexOf("Firefox")>-1,r=i?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||s||i&&r<98?this.textureLoader=new UO(this.options.manager):this.textureLoader=new fMt(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new PO(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const s=this,i=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([s.getDependencies("scene"),s.getDependencies("animation"),s.getDependencies("camera")])}).then(function(o){const a={scene:o[0][i.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:i.asset,parser:s,userData:{}};return wr(r,a,i),er(a,i),Promise.all(s._invokeAll(function(l){return l.afterRoot&&l.afterRoot(a)})).then(function(){e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],s=this.json.meshes||[];for(let i=0,r=t.length;i{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(s,i),i.name+="_instance_"+e.uses[t]++,i}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let s=0;s=2&&b.setY(T,x[A*l+1]),l>=3&&b.setZ(T,x[A*l+2]),l>=4&&b.setW(T,x[A*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return b})}loadTexture(e){const t=this.json,s=this.options,r=t.textures[e].source,o=t.images[r];let a=this.textureLoader;if(o.uri){const l=s.manager.getHandler(o.uri);l!==null&&(a=l)}return this.loadTextureImage(e,r,a)}loadTextureImage(e,t,s){const i=this,r=this.json,o=r.textures[e],a=r.images[t],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const u=this.loadImageSource(t,s).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=W1[f.magFilter]||zn,d.minFilter=W1[f.minFilter]||Xr,d.wrapS=K1[f.wrapS]||ca,d.wrapT=K1[f.wrapT]||ca,i.associations.set(d,{textures:e}),d}).catch(function(){return null});return this.textureCache[l]=u,u}loadImageSource(e,t){const s=this,i=this.json,r=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(h=>h.clone());const o=i.images[e],a=self.URL||self.webkitURL;let l=o.uri||"",u=!1;if(o.bufferView!==void 0)l=s.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;t.isImageBitmapLoader===!0&&(m=function(E){const b=new xn(E);b.needsUpdate=!0,f(b)}),t.load(El.resolveURL(h,r.path),m,void 0,_)})}).then(function(h){return u===!0&&a.revokeObjectURL(l),h.userData.mimeType=o.mimeType||t2t(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,t,s,i){const r=this;return this.getDependency("texture",s.index).then(function(o){if(!o)return null;if(s.texCoord!==void 0&&s.texCoord>0&&(o=o.clone(),o.channel=s.texCoord),r.extensions[wt.KHR_TEXTURE_TRANSFORM]){const a=s.extensions!==void 0?s.extensions[wt.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const l=r.associations.get(o);o=r.extensions[wt.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),r.associations.set(o,l)}}return i!==void 0&&(o.colorSpace=i),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let s=e.material;const i=t.attributes.tangent===void 0,r=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+s.uuid;let l=this.cache.get(a);l||(l=new DO,ks.prototype.copy.call(l,s),l.color.copy(s.color),l.map=s.map,l.sizeAttenuation=!1,this.cache.add(a,l)),s=l}else if(e.isLine){const a="LineBasicMaterial:"+s.uuid;let l=this.cache.get(a);l||(l=new MO,ks.prototype.copy.call(l,s),l.color.copy(s.color),l.map=s.map,this.cache.add(a,l)),s=l}if(i||r||o){let a="ClonedMaterial:"+s.uuid+":";i&&(a+="derivative-tangents:"),r&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=s.clone(),r&&(l.vertexColors=!0),o&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(s))),s=l}e.material=s}getMaterialType(){return LE}loadMaterial(e){const t=this,s=this.json,i=this.extensions,r=s.materials[e];let o;const a={},l=r.extensions||{},u=[];if(l[wt.KHR_MATERIALS_UNLIT]){const h=i[wt.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),u.push(h.extendParams(a,r,t))}else{const h=r.pbrMetallicRoughness||{};if(a.color=new ut(1,1,1),a.opacity=1,Array.isArray(h.baseColorFactor)){const f=h.baseColorFactor;a.color.setRGB(f[0],f[1],f[2],Cn),a.opacity=f[3]}h.baseColorTexture!==void 0&&u.push(t.assignTexture(a,"map",h.baseColorTexture,en)),a.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,a.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(u.push(t.assignTexture(a,"metalnessMap",h.metallicRoughnessTexture)),u.push(t.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=qs);const d=r.alphaMode||jm.OPAQUE;if(d===jm.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,d===jm.MASK&&(a.alphaTest=r.alphaCutoff!==void 0?r.alphaCutoff:.5)),r.normalTexture!==void 0&&o!==ir&&(u.push(t.assignTexture(a,"normalMap",r.normalTexture)),a.normalScale=new Rt(1,1),r.normalTexture.scale!==void 0)){const h=r.normalTexture.scale;a.normalScale.set(h,h)}if(r.occlusionTexture!==void 0&&o!==ir&&(u.push(t.assignTexture(a,"aoMap",r.occlusionTexture)),r.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=r.occlusionTexture.strength)),r.emissiveFactor!==void 0&&o!==ir){const h=r.emissiveFactor;a.emissive=new ut().setRGB(h[0],h[1],h[2],Cn)}return r.emissiveTexture!==void 0&&o!==ir&&u.push(t.assignTexture(a,"emissiveMap",r.emissiveTexture,en)),Promise.all(u).then(function(){const h=new o(a);return r.name&&(h.name=r.name),er(h,r),t.associations.set(h,{materials:e}),r.extensions&&wr(i,h,r),h})}createUniqueName(e){const t=Bt.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,s=this.extensions,i=this.primitiveCache;function r(a){return s[wt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return j1(l,a,t)})}const o=[];for(let a=0,l=e.length;a0&&JMt(g,r),g.name=t.createUniqueName(r.name||"mesh_"+e),er(g,r),b.extensions&&wr(i,g,b),t.assignFinalMaterial(g),h.push(g)}for(let _=0,m=h.length;_1?d=new Fr:u.length===1?d=u[0]:d=new Jt,d!==u[0])for(let h=0,f=u.length;h{const h=new Map;for(const[f,_]of i.associations)(f instanceof ks||f instanceof xn)&&h.set(f,_);return d.traverse(f=>{const _=i.associations.get(f);_!=null&&h.set(f,_)}),h};return i.associations=u(r),r})}_createAnimationTracks(e,t,s,i,r){const o=[],a=e.name?e.name:e.uuid,l=[];Yi[r.path]===Yi.weights?e.traverse(function(f){f.morphTargetInfluences&&l.push(f.name?f.name:f.uuid)}):l.push(a);let u;switch(Yi[r.path]){case Yi.weights:u=ha;break;case Yi.rotation:u=eo;break;case Yi.position:case Yi.scale:u=fa;break;default:switch(s.itemSize){case 1:u=ha;break;case 2:case 3:default:u=fa;break}break}const d=i.interpolation!==void 0?QMt[i.interpolation]:ua,h=this._getArrayFromAccessor(s);for(let f=0,_=l.length;f<_;f++){const m=new u(l[f]+"."+Yi[r.path],t.array,h,d);i.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(m),o.push(m)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const s=Wg(t.constructor),i=new Float32Array(t.length);for(let r=0,o=t.length;r{Ge.replace()})},stopVideoStream(){this.isVideoActive=!1,this.imageData=null,He.emit("stop_webcam_video_stream"),Ue(()=>{Ge.replace()})},startDrag(n){this.isDragging=!0,this.zIndex=5001,this.dragStart.x=n.clientX,this.dragStart.y=n.clientY,document.addEventListener("mousemove",this.drag),document.addEventListener("mouseup",this.stopDrag)},drag(n){if(this.isDragging){const e=n.clientX-this.dragStart.x,t=n.clientY-this.dragStart.y;this.position.bottom-=t,this.position.right-=e,this.dragStart.x=n.clientX,this.dragStart.y=n.clientY}},stopDrag(){this.isDragging=!1,this.zIndex=0,document.removeEventListener("mousemove",this.drag),document.removeEventListener("mouseup",this.stopDrag)}},mounted(){Ge.replace(),He.on("video_stream_image",n=>{if(this.isVideoActive){this.imageDataUrl="data:image/jpeg;base64,"+n,this.frameCount++;const e=Date.now();e-this.lastFrameTime>=1e3&&(this.frameRate=this.frameCount,this.frameCount=0,this.lastFrameTime=e)}})}},o2t=["src"],a2t=["src"],l2t={class:"controls"},c2t=c("i",{"data-feather":"video"},null,-1),d2t=[c2t],u2t=c("i",{"data-feather":"video"},null,-1),p2t=[u2t],_2t={key:2};function h2t(n,e,t,s,i,r){return C(),R("div",{class:"floating-frame bg-white",style:jt({bottom:i.position.bottom+"px",right:i.position.right+"px","z-index":i.zIndex}),onMousedown:e[4]||(e[4]=ae((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[5]||(e[5]=ae((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},[c("div",{class:"handle",onMousedown:e[0]||(e[0]=ae((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[1]||(e[1]=ae((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},"Drag Me",32),i.isVideoActive&&i.imageDataUrl!=null?(C(),R("img",{key:0,src:i.imageDataUrl,alt:"Webcam Frame",width:"300",height:"300"},null,8,o2t)):G("",!0),i.isVideoActive&&i.imageDataUrl==null?(C(),R("p",{key:1,src:i.imageDataUrl,alt:"Webcam Frame",width:"300",height:"300"},"Loading. Please wait...",8,a2t)):G("",!0),c("div",l2t,[i.isVideoActive?G("",!0):(C(),R("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))},d2t)),i.isVideoActive?(C(),R("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))},p2t)):G("",!0),i.isVideoActive?(C(),R("span",_2t,"FPS: "+se(i.frameRate),1)):G("",!0)])],36)}const f2t=pt(r2t,[["render",h2t]]);const m2t={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(){He.emit("start_audio_stream",()=>{this.isAudioActive=!0}),Ue(()=>{Ge.replace()})},stopAudioStream(){He.emit("stop_audio_stream",()=>{this.isAudioActive=!1,this.imageDataUrl=null}),Ue(()=>{Ge.replace()})},startDrag(n){this.isDragging=!0,this.zIndex=5001,this.dragStart.x=n.clientX,this.dragStart.y=n.clientY,document.addEventListener("mousemove",this.drag),document.addEventListener("mouseup",this.stopDrag)},drag(n){if(this.isDragging){const e=n.clientX-this.dragStart.x,t=n.clientY-this.dragStart.y;this.position.bottom-=t,this.position.right-=e,this.dragStart.x=n.clientX,this.dragStart.y=n.clientY}},stopDrag(){this.isDragging=!1,this.zIndex=0,document.removeEventListener("mousemove",this.drag),document.removeEventListener("mouseup",this.stopDrag)}},mounted(){Ge.replace(),He.on("update_spectrogram",n=>{if(this.isAudioActive){this.imageDataUrl="data:image/jpeg;base64,"+n,this.frameCount++;const e=Date.now();e-this.lastFrameTime>=1e3&&(this.frameRate=this.frameCount,this.frameCount=0,this.lastFrameTime=e)}})}},g2t=["src"],b2t={class:"controls"},E2t=c("i",{"data-feather":"mic"},null,-1),y2t=[E2t],v2t=c("i",{"data-feather":"mic"},null,-1),S2t=[v2t];function T2t(n,e,t,s,i,r){return C(),R("div",{class:"floating-frame bg-white",style:jt({bottom:i.position.bottom+"px",right:i.position.right+"px","z-index":i.zIndex}),onMousedown:e[4]||(e[4]=ae((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[5]||(e[5]=ae((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},[c("div",{class:"handle",onMousedown:e[0]||(e[0]=ae((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[1]||(e[1]=ae((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},"Drag Me",32),i.isAudioActive&&i.imageDataUrl!=null?(C(),R("img",{key:0,src:i.imageDataUrl,alt:"Spectrogram",width:"300",height:"300"},null,8,g2t)):G("",!0),c("div",b2t,[i.isAudioActive?G("",!0):(C(),R("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))},y2t)),i.isAudioActive?(C(),R("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))},S2t)):G("",!0)])],36)}const x2t=pt(m2t,[["render",T2t]]);const C2t={data(){return{activePersonality:null}},props:{personality:{type:Object,default:()=>({})}},components:{VideoFrame:f2t,AudioFrame:x2t},computed:{isReady:{get(){return this.$store.state.ready}}},watch:{"$store.state.mountedPersArr":"updatePersonality","$store.state.config.active_personality_id":"updatePersonality"},async mounted(){for(;this.isReady===!1;)await new Promise(n=>setTimeout(n,100));console.log("Personality:",this.personality),this.initWebGLScene(),this.updatePersonality(),Ue(()=>{Ge.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 BIt,this.camera=new Pn(75,window.innerWidth/window.innerHeight,.1,1e3),this.renderer=new OO,this.renderer.setSize(window.innerWidth,window.innerHeight),this.$refs.webglContainer.appendChild(this.renderer.domElement);const n=new dr,e=new G1({color:65280});this.cube=new Un(n,e),this.scene.add(this.cube);const t=new hMt(4210752),s=new FO(16777215,.5);s.position.set(0,1,0),this.scene.add(t),this.scene.add(s),this.camera.position.z=5,this.animate()},updatePersonality(){const{mountedPersArr:n,config:e}=this.$store.state;this.activePersonality=n[e.active_personality_id],this.activePersonality.avatar?this.showBoxWithAvatar(this.activePersonality.avatar):this.showDefaultCube(),this.$emit("update:personality",this.activePersonality)},loadScene(n){new CMt().load(n,t=>{this.scene.remove(this.cube),this.cube=t.scene,this.scene.add(this.cube)})},showBoxWithAvatar(n){this.cube&&this.scene.remove(this.cube);const e=new dr,t=new UO().load(n),s=new ir({map:t});this.cube=new Un(e,s),this.scene.add(this.cube)},showDefaultCube(){this.scene.remove(this.cube);const n=new dr,e=new G1({color:65280});this.cube=new Un(n,e),this.scene.add(this.cube)},animate(){requestAnimationFrame(this.animate),this.cube&&(this.cube.rotation.x+=.01,this.cube.rotation.y+=.01),this.renderer.render(this.scene,this.camera)}}},w2t={ref:"webglContainer"},R2t={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"},A2t={key:0,class:"text-center"},N2t={key:1,class:"text-center"},O2t={class:"floating-frame2"},I2t=["innerHTML"];function M2t(n,e,t,s,i,r){const o=dt("VideoFrame"),a=dt("AudioFrame");return C(),R(ze,null,[c("div",w2t,null,512),c("div",R2t,[!i.activePersonality||!i.activePersonality.scene_path?(C(),R("div",A2t," Personality does not have a 3d avatar. ")):G("",!0),!i.activePersonality||!i.activePersonality.avatar||i.activePersonality.avatar===""?(C(),R("div",N2t," Personality does not have an avatar. ")):G("",!0),c("div",O2t,[c("div",{innerHTML:n.htmlContent},null,8,I2t)])]),_e(o,{ref:"video_frame"},null,512),_e(a,{ref:"audio_frame"},null,512)],64)}const D2t=pt(C2t,[["render",M2t]]);let id;const k2t=new Uint8Array(16);function L2t(){if(!id&&(id=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!id))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return id(k2t)}const yn=[];for(let n=0;n<256;++n)yn.push((n+256).toString(16).slice(1));function P2t(n,e=0){return yn[n[e+0]]+yn[n[e+1]]+yn[n[e+2]]+yn[n[e+3]]+"-"+yn[n[e+4]]+yn[n[e+5]]+"-"+yn[n[e+6]]+yn[n[e+7]]+"-"+yn[n[e+8]]+yn[n[e+9]]+"-"+yn[n[e+10]]+yn[n[e+11]]+yn[n[e+12]]+yn[n[e+13]]+yn[n[e+14]]+yn[n[e+15]]}const U2t=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Q1={randomUUID:U2t};function Ci(n,e,t){if(Q1.randomUUID&&!e&&!n)return Q1.randomUUID();n=n||{};const s=n.random||(n.rng||L2t)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,e){t=t||0;for(let i=0;i<16;++i)e[t+i]=s[i];return e}return P2t(s)}class $r{constructor(){this.listenerMap=new Map,this._listeners=[],this.proxyMap=new Map,this.proxies=[]}get listeners(){return this._listeners.concat(this.proxies.flatMap(e=>e()))}subscribe(e,t){this.listenerMap.has(e)&&(console.warn(`Already subscribed. Unsubscribing for you. Please check that you don't accidentally use the same token twice to register two different handlers for the same event/hook.`),this.unsubscribe(e)),this.listenerMap.set(e,t),this._listeners.push(t)}unsubscribe(e){if(this.listenerMap.has(e)){const t=this.listenerMap.get(e);this.listenerMap.delete(e);const s=this._listeners.indexOf(t);s>=0&&this._listeners.splice(s,1)}}registerProxy(e,t){this.proxyMap.has(e)&&(console.warn(`Already subscribed. Unsubscribing for you. -Please check that you don't accidentally use the same token twice to register two different proxies for the same event/hook.`),this.unregisterProxy(e)),this.proxyMap.set(e,t),this.proxies.push(t)}unregisterProxy(e){if(!this.proxyMap.has(e))return;const t=this.proxyMap.get(e);this.proxyMap.delete(e);const s=this.proxies.indexOf(t);s>=0&&this.proxies.splice(s,1)}}class zt extends $r{constructor(e){super(),this.entity=e}emit(e){this.listeners.forEach(t=>t(e,this.entity))}}class In extends $r{constructor(e){super(),this.entity=e}emit(e){let t=!1;const s=()=>[t=!0];for(const i of Array.from(this.listeners.values()))if(i(e,s,this.entity),t)return{prevented:!0};return{prevented:!1}}}class VO extends $r{execute(e,t){let s=e;for(const i of this.listeners)s=i(s,t);return s}}class es extends VO{constructor(e){super(),this.entity=e}execute(e){return super.execute(e,this.entity)}}class U2t extends $r{constructor(e){super(),this.entity=e}execute(e){const t=[];for(const s of this.listeners)t.push(s(e,this.entity));return t}}function Gs(){const n=Symbol(),e=new Map,t=new Set,s=(l,u)=>{u instanceof $r&&u.registerProxy(n,()=>{var d,h;return(h=(d=e.get(l))===null||d===void 0?void 0:d.listeners)!==null&&h!==void 0?h:[]})},i=l=>{const u=new $r;e.set(l,u),t.forEach(d=>s(l,d[l]))},r=l=>{t.add(l);for(const u of e.keys())s(u,l[u])},o=l=>{for(const u of e.keys())l[u]instanceof $r&&l[u].unregisterProxy(n);t.delete(l)},a=()=>{t.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)||i(u),e.get(u))}})}class X1{constructor(e,t){if(this.destructed=!1,this.events={destruct:new zt(this)},!e||!t)throw new Error("Cannot initialize connection with null/undefined for 'from' or 'to' values");this.id=Ci(),this.from=e,this.to=t,this.from.connectionCount++,this.to.connectionCount++}destruct(){this.events.destruct.emit(),this.from.connectionCount--,this.to.connectionCount--,this.destructed=!0}}class zO{constructor(e,t){if(!e||!t)throw new Error("Cannot initialize connection with null/undefined for 'from' or 'to' values");this.id=Ci(),this.from=e,this.to=t}}function Kg(n,e){return Object.fromEntries(Object.entries(n).map(([t,s])=>[t,e(s)]))}class HO{constructor(){this._title="",this.id=Ci(),this.events={loaded:new zt(this),beforeAddInput:new In(this),addInput:new zt(this),beforeRemoveInput:new In(this),removeInput:new zt(this),beforeAddOutput:new In(this),addOutput:new zt(this),beforeRemoveOutput:new In(this),removeOutput:new zt(this),beforeTitleChanged:new In(this),titleChanged:new zt(this),update:new zt(this)},this.hooks={beforeLoad:new es(this),afterSave:new es(this)}}get graph(){return this.graphInstance}get title(){return this._title}set title(e){this.events.beforeTitleChanged.emit(e).prevented||(this._title=e,this.events.titleChanged.emit(e))}addInput(e,t){return this.addInterface("input",e,t)}addOutput(e,t){return this.addInterface("output",e,t)}removeInput(e){return this.removeInterface("input",e)}removeOutput(e){return this.removeInterface("output",e)}registerGraph(e){this.graphInstance=e}load(e){this.hooks.beforeLoad.execute(e),this.id=e.id,this._title=e.title,Object.entries(e.inputs).forEach(([t,s])=>{this.inputs[t]&&(this.inputs[t].load(s),this.inputs[t].nodeId=this.id)}),Object.entries(e.outputs).forEach(([t,s])=>{this.outputs[t]&&(this.outputs[t].load(s),this.outputs[t].nodeId=this.id)}),this.events.loaded.emit(this)}save(){const e=Kg(this.inputs,i=>i.save()),t=Kg(this.outputs,i=>i.save()),s={type:this.type,id:this.id,title:this.title,inputs:e,outputs:t};return this.hooks.afterSave.execute(s)}onPlaced(){}onDestroy(){}initializeIo(){Object.entries(this.inputs).forEach(([e,t])=>this.initializeIntf("input",e,t)),Object.entries(this.outputs).forEach(([e,t])=>this.initializeIntf("output",e,t))}initializeIntf(e,t,s){s.isInput=e==="input",s.nodeId=this.id,s.events.setValue.subscribe(this,()=>this.events.update.emit({type:e,name:t,intf:s}))}addInterface(e,t,s){const i=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 i.emit(s).prevented?!1:(o[t]=s,this.initializeIntf(e,t,s),r.emit(s),!0)}removeInterface(e,t){const s=e==="input"?this.events.beforeRemoveInput:this.events.beforeRemoveOutput,i=e==="input"?this.events.removeInput:this.events.removeOutput,r=e==="input"?this.inputs[t]:this.outputs[t];if(!r||s.emit(r).prevented)return!1;if(r.connectionCount>0)if(this.graphInstance)this.graphInstance.connections.filter(a=>a.from===r||a.to===r).forEach(a=>{this.graphInstance.removeConnection(a)});else throw new Error("Interface is connected, but no graph instance is specified. Unable to delete interface");return r.events.setValue.unsubscribe(this),e==="input"?delete this.inputs[t]:delete this.outputs[t],i.emit(r),!0}}let qO=class extends HO{load(e){super.load(e)}save(){return super.save()}};function Ua(n){return class extends qO{constructor(){var e,t;super(),this.type=n.type,this.inputs={},this.outputs={},this.calculate=n.calculate?(s,i)=>n.calculate.call(this,s,i):void 0,this._title=(e=n.title)!==null&&e!==void 0?e:n.type,this.executeFactory("input",n.inputs),this.executeFactory("output",n.outputs),(t=n.onCreate)===null||t===void 0||t.call(this)}onPlaced(){var e;(e=n.onPlaced)===null||e===void 0||e.call(this)}onDestroy(){var e;(e=n.onDestroy)===null||e===void 0||e.call(this)}executeFactory(e,t){Object.keys(t||{}).forEach(s=>{const i=t[s]();e==="input"?this.addInput(s,i):this.addOutput(s,i)})}}}class Xt{set connectionCount(e){this._connectionCount=e,this.events.setConnectionCount.emit(e)}get connectionCount(){return this._connectionCount}set value(e){this.events.beforeSetValue.emit(e).prevented||(this._value=e,this.events.setValue.emit(e))}get value(){return this._value}constructor(e,t){this.id=Ci(),this.nodeId="",this.port=!0,this.hidden=!1,this.events={setConnectionCount:new zt(this),beforeSetValue:new In(this),setValue:new zt(this),updated:new zt(this)},this.hooks={load:new es(this),save:new es(this)},this._connectionCount=0,this.name=e,this._value=t}load(e){this.id=e.id,this.templateId=e.templateId,this.value=e.value,this.hooks.load.execute(e)}save(){const e={id:this.id,templateId:this.templateId,value:this.value};return this.hooks.save.execute(e)}setComponent(e){return this.component=e,this}setPort(e){return this.port=e,this}setHidden(e){return this.hidden=e,this}use(e,...t){return e(this,...t),this}}const ga="__baklava_SubgraphInputNode",ba="__baklava_SubgraphOutputNode";class YO extends qO{constructor(){super(),this.graphInterfaceId=Ci()}onPlaced(){super.onPlaced(),this.initializeIo()}save(){return{...super.save(),graphInterfaceId:this.graphInterfaceId}}load(e){super.load(e),this.graphInterfaceId=e.graphInterfaceId}}class $O extends YO{constructor(){super(...arguments),this.type=ga,this.inputs={name:new Xt("Name","Input")},this.outputs={placeholder:new Xt("Value",void 0)}}static isGraphInputNode(e){return e.type===ga}}class WO extends YO{constructor(){super(...arguments),this.type=ba,this.inputs={name:new Xt("Name","Output"),placeholder:new Xt("Value",void 0)},this.outputs={output:new Xt("Output",void 0).setHidden(!0)},this.calculate=({placeholder:e})=>({output:e})}static isGraphOutputNode(e){return e.type===ba}}class tc{get nodes(){return this._nodes}get connections(){return this._connections}get loading(){return this._loading}get destroying(){return this._destroying}get inputs(){return this.nodes.filter(t=>t.type===ga).map(t=>({id:t.graphInterfaceId,name:t.inputs.name.value,nodeId:t.id,nodeInterfaceId:t.outputs.placeholder.id}))}get outputs(){return this.nodes.filter(t=>t.type===ba).map(t=>({id:t.graphInterfaceId,name:t.inputs.name.value,nodeId:t.id,nodeInterfaceId:t.outputs.output.id}))}constructor(e,t){this.id=Ci(),this.activeTransactions=0,this._nodes=[],this._connections=[],this._loading=!1,this._destroying=!1,this.events={beforeAddNode:new In(this),addNode:new zt(this),beforeRemoveNode:new In(this),removeNode:new zt(this),beforeAddConnection:new In(this),addConnection:new zt(this),checkConnection:new In(this),beforeRemoveConnection:new In(this),removeConnection:new zt(this)},this.hooks={save:new es(this),load:new es(this),checkConnection:new U2t(this)},this.nodeEvents=Gs(),this.nodeHooks=Gs(),this.connectionEvents=Gs(),this.editor=e,this.template=t,e.registerGraph(this)}addNode(e){if(!this.events.beforeAddNode.emit(e).prevented)return this.nodeEvents.addTarget(e.events),this.nodeHooks.addTarget(e.hooks),e.registerGraph(this),this._nodes.push(e),e=this.nodes.find(t=>t.id===e.id),e.onPlaced(),this.events.addNode.emit(e),e}removeNode(e){if(this.nodes.includes(e)){if(this.events.beforeRemoveNode.emit(e).prevented)return;const t=[...Object.values(e.inputs),...Object.values(e.outputs)];this.connections.filter(s=>t.includes(s.from)||t.includes(s.to)).forEach(s=>this.removeConnection(s)),this._nodes.splice(this.nodes.indexOf(e),1),this.events.removeNode.emit(e),e.onDestroy(),this.nodeEvents.removeTarget(e.events),this.nodeHooks.removeTarget(e.hooks)}}addConnection(e,t){const s=this.checkConnection(e,t);if(!s.connectionAllowed||this.events.beforeAddConnection.emit({from:e,to:t}).prevented)return;for(const r of s.connectionsInDanger){const o=this.connections.find(a=>a.id===r.id);o&&this.removeConnection(o)}const i=new X1(s.dummyConnection.from,s.dummyConnection.to);return this.internalAddConnection(i),i}removeConnection(e){if(this.connections.includes(e)){if(this.events.beforeRemoveConnection.emit(e).prevented)return;e.destruct(),this._connections.splice(this.connections.indexOf(e),1),this.events.removeConnection.emit(e),this.connectionEvents.removeTarget(e.events)}}checkConnection(e,t){if(!e||!t)return{connectionAllowed:!1};const s=this.findNodeById(e.nodeId),i=this.findNodeById(t.nodeId);if(s&&i&&s===i)return{connectionAllowed:!1};if(e.isInput&&!t.isInput){const a=e;e=t,t=a}if(e.isInput||!t.isInput)return{connectionAllowed:!1};if(this.connections.some(a=>a.from===e&&a.to===t))return{connectionAllowed:!1};if(this.events.checkConnection.emit({from:e,to:t}).prevented)return{connectionAllowed:!1};const r=this.hooks.checkConnection.execute({from:e,to:t});if(r.some(a=>!a.connectionAllowed))return{connectionAllowed:!1};const o=Array.from(new Set(r.flatMap(a=>a.connectionsInDanger)));return{connectionAllowed:!0,dummyConnection:new zO(e,t),connectionsInDanger:o}}findNodeInterface(e){for(const t of this.nodes){for(const s in t.inputs){const i=t.inputs[s];if(i.id===e)return i}for(const s in t.outputs){const i=t.outputs[s];if(i.id===e)return i}}}findNodeById(e){return this.nodes.find(t=>t.id===e)}load(e){try{this._loading=!0;const t=[];for(let s=this.connections.length-1;s>=0;s--)this.removeConnection(this.connections[s]);for(let s=this.nodes.length-1;s>=0;s--)this.removeNode(this.nodes[s]);this.id=e.id;for(const s of e.nodes){const i=this.editor.nodeTypes.get(s.type);if(!i){t.push(`Node type ${s.type} is not registered`);continue}const r=new i.type;this.addNode(r),r.load(s)}for(const s of e.connections){const i=this.findNodeInterface(s.from),r=this.findNodeInterface(s.to);if(i)if(r){const o=new X1(i,r);o.id=s.id,this.internalAddConnection(o)}else{t.push(`Could not find interface with id ${s.to}`);continue}else{t.push(`Could not find interface with id ${s.from}`);continue}}return this.hooks.load.execute(e),t}finally{this._loading=!1}}save(){const e={id:this.id,nodes:this.nodes.map(t=>t.save()),connections:this.connections.map(t=>({id:t.id,from:t.from.id,to:t.to.id})),inputs:this.inputs,outputs:this.outputs};return this.hooks.save.execute(e)}destroy(){this._destroying=!0;for(const e of this.nodes)this.removeNode(e);this.editor.unregisterGraph(this)}internalAddConnection(e){this.connectionEvents.addTarget(e.events),this._connections.push(e),this.events.addConnection.emit(e)}}const Vl="__baklava_GraphNode-";function Ea(n){return Vl+n.id}function F2t(n){return class extends HO{constructor(){super(...arguments),this.type=Ea(n),this.inputs={},this.outputs={},this.template=n,this.calculate=async(t,s)=>{var i;if(!this.subgraph)throw new Error(`GraphNode ${this.id}: calculate called without subgraph being initialized`);if(!s.engine||typeof s.engine!="object")throw new Error(`GraphNode ${this.id}: calculate called but no engine provided in context`);const r=s.engine.getInputValues(this.subgraph);for(const l of this.subgraph.inputs)r.set(l.nodeInterfaceId,t[l.id]);const o=await s.engine.runGraph(this.subgraph,r,s.globalValues),a={};for(const l of this.subgraph.outputs)a[l.id]=(i=o.get(l.nodeId))===null||i===void 0?void 0:i.get("output");return a._calculationResults=o,a}}get title(){return this._title}set title(t){this.template.name=t}load(t){if(!this.subgraph)throw new Error("Cannot load a graph node without a graph");if(!this.template)throw new Error("Unable to load graph node without graph template");this.subgraph.load(t.graphState),super.load(t)}save(){if(!this.subgraph)throw new Error("Cannot save a graph node without a graph");return{...super.save(),graphState:this.subgraph.save()}}onPlaced(){this.template.events.updated.subscribe(this,()=>this.initialize()),this.template.events.nameChanged.subscribe(this,t=>{this._title=t}),this.initialize()}onDestroy(){var t;this.template.events.updated.unsubscribe(this),this.template.events.nameChanged.unsubscribe(this),(t=this.subgraph)===null||t===void 0||t.destroy()}initialize(){this.subgraph&&this.subgraph.destroy(),this.subgraph=this.template.createGraph(),this._title=this.template.name,this.updateInterfaces(),this.events.update.emit(null)}updateInterfaces(){if(!this.subgraph)throw new Error("Trying to update interfaces without graph instance");for(const t of this.subgraph.inputs)t.id in this.inputs?this.inputs[t.id].name=t.name:this.addInput(t.id,new Xt(t.name,void 0));for(const t of Object.keys(this.inputs))this.subgraph.inputs.some(s=>s.id===t)||this.removeInput(t);for(const t of this.subgraph.outputs)t.id in this.outputs?this.outputs[t.id].name=t.name:this.addOutput(t.id,new Xt(t.name,void 0));for(const t of Object.keys(this.outputs))this.subgraph.outputs.some(s=>s.id===t)||this.removeOutput(t);this.addOutput("_calculationResults",new Xt("_calculationResults",void 0).setHidden(!0))}}}class Ku{static fromGraph(e,t){return new Ku(e.save(),t)}get name(){return this._name}set name(e){this._name=e,this.events.nameChanged.emit(e);const t=this.editor.nodeTypes.get(Ea(this));t&&(t.title=e)}get inputs(){return this.nodes.filter(t=>t.type===ga).map(t=>({id:t.graphInterfaceId,name:t.inputs.name.value,nodeId:t.id,nodeInterfaceId:t.outputs.placeholder.id}))}get outputs(){return this.nodes.filter(t=>t.type===ba).map(t=>({id:t.graphInterfaceId,name:t.inputs.name.value,nodeId:t.id,nodeInterfaceId:t.outputs.output.id}))}constructor(e,t){this.id=Ci(),this._name="Subgraph",this.events={nameChanged:new zt(this),updated:new zt(this)},this.hooks={beforeLoad:new es(this),afterSave:new es(this)},this.editor=t,e.id&&(this.id=e.id),e.name&&(this._name=e.name),this.update(e)}update(e){this.nodes=e.nodes,this.connections=e.connections,this.events.updated.emit()}save(){return{id:this.id,name:this.name,nodes:this.nodes,connections:this.connections,inputs:this.inputs,outputs:this.outputs}}createGraph(e){const t=new Map,s=f=>{const _=Ci();return t.set(f,_),_},i=f=>{const _=t.get(f);if(!_)throw new Error(`Unable to create graph from template: Could not map old id ${f} to new id`);return _},r=f=>Kg(f,_=>({id:s(_.id),templateId:_.id,value:_.value})),o=this.nodes.map(f=>({...f,id:s(f.id),inputs:r(f.inputs),outputs:r(f.outputs)})),a=this.connections.map(f=>({id:s(f.id),from:i(f.from),to:i(f.to)})),l=this.inputs.map(f=>({id:f.id,name:f.name,nodeId:i(f.nodeId),nodeInterfaceId:i(f.nodeInterfaceId)})),u=this.outputs.map(f=>({id:f.id,name:f.name,nodeId:i(f.nodeId),nodeInterfaceId:i(f.nodeInterfaceId)})),d={id:Ci(),nodes:o,connections:a,inputs:l,outputs:u};return e||(e=new tc(this.editor)),e.load(d).forEach(f=>console.warn(f)),e.template=this,e}}class B2t{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 zt(this),beforeRegisterNodeType:new In(this),registerNodeType:new zt(this),beforeUnregisterNodeType:new In(this),unregisterNodeType:new zt(this),beforeAddGraphTemplate:new In(this),addGraphTemplate:new zt(this),beforeRemoveGraphTemplate:new In(this),removeGraphTemplate:new zt(this),registerGraph:new zt(this),unregisterGraph:new zt(this)},this.hooks={save:new es(this),load:new es(this)},this.graphTemplateEvents=Gs(),this.graphTemplateHooks=Gs(),this.graphEvents=Gs(),this.graphHooks=Gs(),this.nodeEvents=Gs(),this.nodeHooks=Gs(),this.connectionEvents=Gs(),this._graphs=new Set,this._nodeTypes=new Map,this._graph=new tc(this),this._graphTemplates=[],this._loading=!1,this.registerNodeType($O),this.registerNodeType(WO)}registerNodeType(e,t){var s,i;if(this.events.beforeRegisterNodeType.emit({type:e,options:t}).prevented)return;const r=new e;this._nodeTypes.set(r.type,{type:e,category:(s=t==null?void 0:t.category)!==null&&s!==void 0?s:"default",title:(i=t==null?void 0:t.title)!==null&&i!==void 0?i:r.title}),this.events.registerNodeType.emit({type:e,options:t})}unregisterNodeType(e){const t=typeof e=="string"?e:new e().type;if(this.nodeTypes.has(t)){if(this.events.beforeUnregisterNodeType.emit(t).prevented)return;this._nodeTypes.delete(t),this.events.unregisterNodeType.emit(t)}}addGraphTemplate(e){if(this.events.beforeAddGraphTemplate.emit(e).prevented)return;this._graphTemplates.push(e),this.graphTemplateEvents.addTarget(e.events),this.graphTemplateHooks.addTarget(e.hooks);const t=F2t(e);this.registerNodeType(t,{category:"Subgraphs",title:e.name}),this.events.addGraphTemplate.emit(e)}removeGraphTemplate(e){if(this.graphTemplates.includes(e)){if(this.events.beforeRemoveGraphTemplate.emit(e).prevented)return;const t=Ea(e);for(const s of[this.graph,...this.graphs.values()]){const i=s.nodes.filter(r=>r.type===t);for(const r of i)s.removeNode(r)}this.unregisterNodeType(t),this._graphTemplates.splice(this._graphTemplates.indexOf(e),1),this.graphTemplateEvents.removeTarget(e.events),this.graphTemplateHooks.removeTarget(e.hooks),this.events.removeGraphTemplate.emit(e)}}registerGraph(e){this.graphEvents.addTarget(e.events),this.graphHooks.addTarget(e.hooks),this.nodeEvents.addTarget(e.nodeEvents),this.nodeHooks.addTarget(e.nodeHooks),this.connectionEvents.addTarget(e.connectionEvents),this.events.registerGraph.emit(e),this._graphs.add(e)}unregisterGraph(e){this.graphEvents.removeTarget(e.events),this.graphHooks.removeTarget(e.hooks),this.nodeEvents.removeTarget(e.nodeEvents),this.nodeHooks.removeTarget(e.nodeHooks),this.connectionEvents.removeTarget(e.connectionEvents),this.events.unregisterGraph.emit(e),this._graphs.delete(e)}load(e){try{this._loading=!0,e=this.hooks.load.execute(e),e.graphTemplates.forEach(s=>{const i=new Ku(s,this);this.addGraphTemplate(i)});const t=this._graph.load(e.graph);return this.events.loaded.emit(),t.forEach(s=>console.warn(s)),t}finally{this._loading=!1}}save(){const e={graph:this.graph.save(),graphTemplates:this.graphTemplates.map(t=>t.save())};return this.hooks.save.execute(e)}}function G2t(n,e){const t=new Map;e.graphs.forEach(s=>{s.nodes.forEach(i=>t.set(i.id,i))}),n.forEach((s,i)=>{const r=t.get(i);r&&s.forEach((o,a)=>{const l=r.outputs[a];l&&(l.value=o)})})}class KO extends Error{constructor(){super("Cycle detected")}}function V2t(n){return typeof n=="string"}function jO(n,e){const t=new Map,s=new Map,i=new Map;let r,o;if(n instanceof tc)r=n.nodes,o=n.connections;else{if(!e)throw new Error("Invalid argument value: expected array of connections");r=n,o=e}r.forEach(u=>{Object.values(u.inputs).forEach(d=>t.set(d.id,u.id)),Object.values(u.outputs).forEach(d=>t.set(d.id,u.id))}),r.forEach(u=>{const d=o.filter(f=>f.from&&t.get(f.from.id)===u.id),h=new Set(d.map(f=>t.get(f.to.id)).filter(V2t));s.set(u.id,h),i.set(u,d)});const a=r.slice();o.forEach(u=>{const d=a.findIndex(h=>t.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=s.get(u.id);for(;d.size>0;){const h=d.values().next().value;if(d.delete(h),Array.from(s.values()).every(f=>!f.has(h))){const f=r.find(_=>_.id===h);a.push(f)}}}if(Array.from(s.values()).some(u=>u.size>0))throw new KO;return{calculationOrder:l,connectionsFromNode:i,interfaceIdToNodeId:t}}function z2t(n,e){try{return jO(n,e),!1}catch(t){if(t instanceof KO)return!0;throw t}}var Vn;(function(n){n.Running="Running",n.Idle="Idle",n.Paused="Paused",n.Stopped="Stopped"})(Vn||(Vn={}));class H2t{get status(){return this.isRunning?Vn.Running:this.internalStatus}constructor(e){this.editor=e,this.events={beforeRun:new In(this),afterRun:new zt(this),statusChange:new zt(this),beforeNodeCalculation:new zt(this),afterNodeCalculation:new zt(this)},this.hooks={gatherCalculationData:new es(this),transferData:new VO},this.recalculateOrder=!0,this.internalStatus=Vn.Stopped,this.isRunning=!1,this.editor.nodeEvents.update.subscribe(this,(t,s)=>{s.graph&&!s.graph.loading&&s.graph.activeTransactions===0&&this.internalOnChange(s,t??void 0)}),this.editor.graphEvents.addNode.subscribe(this,(t,s)=>{this.recalculateOrder=!0,!s.loading&&s.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.removeNode.subscribe(this,(t,s)=>{this.recalculateOrder=!0,!s.loading&&s.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.addConnection.subscribe(this,(t,s)=>{this.recalculateOrder=!0,!s.loading&&s.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.removeConnection.subscribe(this,(t,s)=>{this.recalculateOrder=!0,!s.loading&&s.activeTransactions===0&&this.internalOnChange()}),this.editor.graphHooks.checkConnection.subscribe(this,t=>this.checkConnection(t.from,t.to))}start(){this.internalStatus===Vn.Stopped&&(this.internalStatus=Vn.Idle,this.events.statusChange.emit(this.status))}pause(){this.internalStatus===Vn.Idle&&(this.internalStatus=Vn.Paused,this.events.statusChange.emit(this.status))}resume(){this.internalStatus===Vn.Paused&&(this.internalStatus=Vn.Idle,this.events.statusChange.emit(this.status))}stop(){(this.internalStatus===Vn.Idle||this.internalStatus===Vn.Paused)&&(this.internalStatus=Vn.Stopped,this.events.statusChange.emit(this.status))}async runOnce(e,...t){if(this.events.beforeRun.emit(e).prevented)return null;try{this.isRunning=!0,this.events.statusChange.emit(this.status),this.recalculateOrder&&this.calculateOrder();const s=await this.execute(e,...t);return this.events.afterRun.emit(s),s}finally{this.isRunning=!1,this.events.statusChange.emit(this.status)}}checkConnection(e,t){if(e.templateId){const r=this.findInterfaceByTemplateId(this.editor.graph.nodes,e.templateId);if(!r)return{connectionAllowed:!0,connectionsInDanger:[]};e=r}if(t.templateId){const r=this.findInterfaceByTemplateId(this.editor.graph.nodes,t.templateId);if(!r)return{connectionAllowed:!0,connectionsInDanger:[]};t=r}const s=new zO(e,t);let i=this.editor.graph.connections.slice();return t.allowMultipleConnections||(i=i.filter(r=>r.to!==t)),i.push(s),z2t(this.editor.graph.nodes,i)?{connectionAllowed:!1,connectionsInDanger:[]}:{connectionAllowed:!0,connectionsInDanger:t.allowMultipleConnections?[]:this.editor.graph.connections.filter(r=>r.to===t)}}calculateOrder(){this.recalculateOrder=!0}async calculateWithoutData(...e){const t=this.hooks.gatherCalculationData.execute(void 0);return await this.runOnce(t,...e)}validateNodeCalculationOutput(e,t){if(typeof t!="object")throw new Error(`Invalid calculation return value from node ${e.id} (type ${e.type})`);Object.keys(e.outputs).forEach(s=>{if(!(s in t))throw new Error(`Calculation return value from node ${e.id} (type ${e.type}) is missing key "${s}"`)})}internalOnChange(e,t){this.internalStatus===Vn.Idle&&this.onChange(this.recalculateOrder,e,t)}findInterfaceByTemplateId(e,t){for(const s of e)for(const i of[...Object.values(s.inputs),...Object.values(s.outputs)])if(i.templateId===t)return i;return null}}class q2t extends H2t{constructor(e){super(e),this.order=new Map}start(){super.start(),this.recalculateOrder=!0,this.calculateWithoutData()}async runGraph(e,t,s){this.order.has(e.id)||this.order.set(e.id,jO(e));const{calculationOrder:i,connectionsFromNode:r}=this.order.get(e.id),o=new Map;for(const a of i){const l={};Object.entries(a.inputs).forEach(([d,h])=>{l[d]=this.getInterfaceValue(t,h.id)}),this.events.beforeNodeCalculation.emit({inputValues:l,node:a});let u;if(a.calculate)u=await a.calculate(l,{globalValues:s,engine:this});else{u={};for(const[d,h]of Object.entries(a.outputs))u[d]=this.getInterfaceValue(t,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,t),this.proxies.push(t)}unregisterProxy(e){if(!this.proxyMap.has(e))return;const t=this.proxyMap.get(e);this.proxyMap.delete(e);const s=this.proxies.indexOf(t);s>=0&&this.proxies.splice(s,1)}}class zt extends $r{constructor(e){super(),this.entity=e}emit(e){this.listeners.forEach(t=>t(e,this.entity))}}class In extends $r{constructor(e){super(),this.entity=e}emit(e){let t=!1;const s=()=>[t=!0];for(const i of Array.from(this.listeners.values()))if(i(e,s,this.entity),t)return{prevented:!0};return{prevented:!1}}}class VO extends $r{execute(e,t){let s=e;for(const i of this.listeners)s=i(s,t);return s}}class es extends VO{constructor(e){super(),this.entity=e}execute(e){return super.execute(e,this.entity)}}class F2t extends $r{constructor(e){super(),this.entity=e}execute(e){const t=[];for(const s of this.listeners)t.push(s(e,this.entity));return t}}function Gs(){const n=Symbol(),e=new Map,t=new Set,s=(l,u)=>{u instanceof $r&&u.registerProxy(n,()=>{var d,h;return(h=(d=e.get(l))===null||d===void 0?void 0:d.listeners)!==null&&h!==void 0?h:[]})},i=l=>{const u=new $r;e.set(l,u),t.forEach(d=>s(l,d[l]))},r=l=>{t.add(l);for(const u of e.keys())s(u,l[u])},o=l=>{for(const u of e.keys())l[u]instanceof $r&&l[u].unregisterProxy(n);t.delete(l)},a=()=>{t.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)||i(u),e.get(u))}})}class X1{constructor(e,t){if(this.destructed=!1,this.events={destruct:new zt(this)},!e||!t)throw new Error("Cannot initialize connection with null/undefined for 'from' or 'to' values");this.id=Ci(),this.from=e,this.to=t,this.from.connectionCount++,this.to.connectionCount++}destruct(){this.events.destruct.emit(),this.from.connectionCount--,this.to.connectionCount--,this.destructed=!0}}class zO{constructor(e,t){if(!e||!t)throw new Error("Cannot initialize connection with null/undefined for 'from' or 'to' values");this.id=Ci(),this.from=e,this.to=t}}function Kg(n,e){return Object.fromEntries(Object.entries(n).map(([t,s])=>[t,e(s)]))}class HO{constructor(){this._title="",this.id=Ci(),this.events={loaded:new zt(this),beforeAddInput:new In(this),addInput:new zt(this),beforeRemoveInput:new In(this),removeInput:new zt(this),beforeAddOutput:new In(this),addOutput:new zt(this),beforeRemoveOutput:new In(this),removeOutput:new zt(this),beforeTitleChanged:new In(this),titleChanged:new zt(this),update:new zt(this)},this.hooks={beforeLoad:new es(this),afterSave:new es(this)}}get graph(){return this.graphInstance}get title(){return this._title}set title(e){this.events.beforeTitleChanged.emit(e).prevented||(this._title=e,this.events.titleChanged.emit(e))}addInput(e,t){return this.addInterface("input",e,t)}addOutput(e,t){return this.addInterface("output",e,t)}removeInput(e){return this.removeInterface("input",e)}removeOutput(e){return this.removeInterface("output",e)}registerGraph(e){this.graphInstance=e}load(e){this.hooks.beforeLoad.execute(e),this.id=e.id,this._title=e.title,Object.entries(e.inputs).forEach(([t,s])=>{this.inputs[t]&&(this.inputs[t].load(s),this.inputs[t].nodeId=this.id)}),Object.entries(e.outputs).forEach(([t,s])=>{this.outputs[t]&&(this.outputs[t].load(s),this.outputs[t].nodeId=this.id)}),this.events.loaded.emit(this)}save(){const e=Kg(this.inputs,i=>i.save()),t=Kg(this.outputs,i=>i.save()),s={type:this.type,id:this.id,title:this.title,inputs:e,outputs:t};return this.hooks.afterSave.execute(s)}onPlaced(){}onDestroy(){}initializeIo(){Object.entries(this.inputs).forEach(([e,t])=>this.initializeIntf("input",e,t)),Object.entries(this.outputs).forEach(([e,t])=>this.initializeIntf("output",e,t))}initializeIntf(e,t,s){s.isInput=e==="input",s.nodeId=this.id,s.events.setValue.subscribe(this,()=>this.events.update.emit({type:e,name:t,intf:s}))}addInterface(e,t,s){const i=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 i.emit(s).prevented?!1:(o[t]=s,this.initializeIntf(e,t,s),r.emit(s),!0)}removeInterface(e,t){const s=e==="input"?this.events.beforeRemoveInput:this.events.beforeRemoveOutput,i=e==="input"?this.events.removeInput:this.events.removeOutput,r=e==="input"?this.inputs[t]:this.outputs[t];if(!r||s.emit(r).prevented)return!1;if(r.connectionCount>0)if(this.graphInstance)this.graphInstance.connections.filter(a=>a.from===r||a.to===r).forEach(a=>{this.graphInstance.removeConnection(a)});else throw new Error("Interface is connected, but no graph instance is specified. Unable to delete interface");return r.events.setValue.unsubscribe(this),e==="input"?delete this.inputs[t]:delete this.outputs[t],i.emit(r),!0}}let qO=class extends HO{load(e){super.load(e)}save(){return super.save()}};function Ua(n){return class extends qO{constructor(){var e,t;super(),this.type=n.type,this.inputs={},this.outputs={},this.calculate=n.calculate?(s,i)=>n.calculate.call(this,s,i):void 0,this._title=(e=n.title)!==null&&e!==void 0?e:n.type,this.executeFactory("input",n.inputs),this.executeFactory("output",n.outputs),(t=n.onCreate)===null||t===void 0||t.call(this)}onPlaced(){var e;(e=n.onPlaced)===null||e===void 0||e.call(this)}onDestroy(){var e;(e=n.onDestroy)===null||e===void 0||e.call(this)}executeFactory(e,t){Object.keys(t||{}).forEach(s=>{const i=t[s]();e==="input"?this.addInput(s,i):this.addOutput(s,i)})}}}class Xt{set connectionCount(e){this._connectionCount=e,this.events.setConnectionCount.emit(e)}get connectionCount(){return this._connectionCount}set value(e){this.events.beforeSetValue.emit(e).prevented||(this._value=e,this.events.setValue.emit(e))}get value(){return this._value}constructor(e,t){this.id=Ci(),this.nodeId="",this.port=!0,this.hidden=!1,this.events={setConnectionCount:new zt(this),beforeSetValue:new In(this),setValue:new zt(this),updated:new zt(this)},this.hooks={load:new es(this),save:new es(this)},this._connectionCount=0,this.name=e,this._value=t}load(e){this.id=e.id,this.templateId=e.templateId,this.value=e.value,this.hooks.load.execute(e)}save(){const e={id:this.id,templateId:this.templateId,value:this.value};return this.hooks.save.execute(e)}setComponent(e){return this.component=e,this}setPort(e){return this.port=e,this}setHidden(e){return this.hidden=e,this}use(e,...t){return e(this,...t),this}}const ga="__baklava_SubgraphInputNode",ba="__baklava_SubgraphOutputNode";class YO extends qO{constructor(){super(),this.graphInterfaceId=Ci()}onPlaced(){super.onPlaced(),this.initializeIo()}save(){return{...super.save(),graphInterfaceId:this.graphInterfaceId}}load(e){super.load(e),this.graphInterfaceId=e.graphInterfaceId}}class $O extends YO{constructor(){super(...arguments),this.type=ga,this.inputs={name:new Xt("Name","Input")},this.outputs={placeholder:new Xt("Value",void 0)}}static isGraphInputNode(e){return e.type===ga}}class WO extends YO{constructor(){super(...arguments),this.type=ba,this.inputs={name:new Xt("Name","Output"),placeholder:new Xt("Value",void 0)},this.outputs={output:new Xt("Output",void 0).setHidden(!0)},this.calculate=({placeholder:e})=>({output:e})}static isGraphOutputNode(e){return e.type===ba}}class tc{get nodes(){return this._nodes}get connections(){return this._connections}get loading(){return this._loading}get destroying(){return this._destroying}get inputs(){return this.nodes.filter(t=>t.type===ga).map(t=>({id:t.graphInterfaceId,name:t.inputs.name.value,nodeId:t.id,nodeInterfaceId:t.outputs.placeholder.id}))}get outputs(){return this.nodes.filter(t=>t.type===ba).map(t=>({id:t.graphInterfaceId,name:t.inputs.name.value,nodeId:t.id,nodeInterfaceId:t.outputs.output.id}))}constructor(e,t){this.id=Ci(),this.activeTransactions=0,this._nodes=[],this._connections=[],this._loading=!1,this._destroying=!1,this.events={beforeAddNode:new In(this),addNode:new zt(this),beforeRemoveNode:new In(this),removeNode:new zt(this),beforeAddConnection:new In(this),addConnection:new zt(this),checkConnection:new In(this),beforeRemoveConnection:new In(this),removeConnection:new zt(this)},this.hooks={save:new es(this),load:new es(this),checkConnection:new F2t(this)},this.nodeEvents=Gs(),this.nodeHooks=Gs(),this.connectionEvents=Gs(),this.editor=e,this.template=t,e.registerGraph(this)}addNode(e){if(!this.events.beforeAddNode.emit(e).prevented)return this.nodeEvents.addTarget(e.events),this.nodeHooks.addTarget(e.hooks),e.registerGraph(this),this._nodes.push(e),e=this.nodes.find(t=>t.id===e.id),e.onPlaced(),this.events.addNode.emit(e),e}removeNode(e){if(this.nodes.includes(e)){if(this.events.beforeRemoveNode.emit(e).prevented)return;const t=[...Object.values(e.inputs),...Object.values(e.outputs)];this.connections.filter(s=>t.includes(s.from)||t.includes(s.to)).forEach(s=>this.removeConnection(s)),this._nodes.splice(this.nodes.indexOf(e),1),this.events.removeNode.emit(e),e.onDestroy(),this.nodeEvents.removeTarget(e.events),this.nodeHooks.removeTarget(e.hooks)}}addConnection(e,t){const s=this.checkConnection(e,t);if(!s.connectionAllowed||this.events.beforeAddConnection.emit({from:e,to:t}).prevented)return;for(const r of s.connectionsInDanger){const o=this.connections.find(a=>a.id===r.id);o&&this.removeConnection(o)}const i=new X1(s.dummyConnection.from,s.dummyConnection.to);return this.internalAddConnection(i),i}removeConnection(e){if(this.connections.includes(e)){if(this.events.beforeRemoveConnection.emit(e).prevented)return;e.destruct(),this._connections.splice(this.connections.indexOf(e),1),this.events.removeConnection.emit(e),this.connectionEvents.removeTarget(e.events)}}checkConnection(e,t){if(!e||!t)return{connectionAllowed:!1};const s=this.findNodeById(e.nodeId),i=this.findNodeById(t.nodeId);if(s&&i&&s===i)return{connectionAllowed:!1};if(e.isInput&&!t.isInput){const a=e;e=t,t=a}if(e.isInput||!t.isInput)return{connectionAllowed:!1};if(this.connections.some(a=>a.from===e&&a.to===t))return{connectionAllowed:!1};if(this.events.checkConnection.emit({from:e,to:t}).prevented)return{connectionAllowed:!1};const r=this.hooks.checkConnection.execute({from:e,to:t});if(r.some(a=>!a.connectionAllowed))return{connectionAllowed:!1};const o=Array.from(new Set(r.flatMap(a=>a.connectionsInDanger)));return{connectionAllowed:!0,dummyConnection:new zO(e,t),connectionsInDanger:o}}findNodeInterface(e){for(const t of this.nodes){for(const s in t.inputs){const i=t.inputs[s];if(i.id===e)return i}for(const s in t.outputs){const i=t.outputs[s];if(i.id===e)return i}}}findNodeById(e){return this.nodes.find(t=>t.id===e)}load(e){try{this._loading=!0;const t=[];for(let s=this.connections.length-1;s>=0;s--)this.removeConnection(this.connections[s]);for(let s=this.nodes.length-1;s>=0;s--)this.removeNode(this.nodes[s]);this.id=e.id;for(const s of e.nodes){const i=this.editor.nodeTypes.get(s.type);if(!i){t.push(`Node type ${s.type} is not registered`);continue}const r=new i.type;this.addNode(r),r.load(s)}for(const s of e.connections){const i=this.findNodeInterface(s.from),r=this.findNodeInterface(s.to);if(i)if(r){const o=new X1(i,r);o.id=s.id,this.internalAddConnection(o)}else{t.push(`Could not find interface with id ${s.to}`);continue}else{t.push(`Could not find interface with id ${s.from}`);continue}}return this.hooks.load.execute(e),t}finally{this._loading=!1}}save(){const e={id:this.id,nodes:this.nodes.map(t=>t.save()),connections:this.connections.map(t=>({id:t.id,from:t.from.id,to:t.to.id})),inputs:this.inputs,outputs:this.outputs};return this.hooks.save.execute(e)}destroy(){this._destroying=!0;for(const e of this.nodes)this.removeNode(e);this.editor.unregisterGraph(this)}internalAddConnection(e){this.connectionEvents.addTarget(e.events),this._connections.push(e),this.events.addConnection.emit(e)}}const Vl="__baklava_GraphNode-";function Ea(n){return Vl+n.id}function B2t(n){return class extends HO{constructor(){super(...arguments),this.type=Ea(n),this.inputs={},this.outputs={},this.template=n,this.calculate=async(t,s)=>{var i;if(!this.subgraph)throw new Error(`GraphNode ${this.id}: calculate called without subgraph being initialized`);if(!s.engine||typeof s.engine!="object")throw new Error(`GraphNode ${this.id}: calculate called but no engine provided in context`);const r=s.engine.getInputValues(this.subgraph);for(const l of this.subgraph.inputs)r.set(l.nodeInterfaceId,t[l.id]);const o=await s.engine.runGraph(this.subgraph,r,s.globalValues),a={};for(const l of this.subgraph.outputs)a[l.id]=(i=o.get(l.nodeId))===null||i===void 0?void 0:i.get("output");return a._calculationResults=o,a}}get title(){return this._title}set title(t){this.template.name=t}load(t){if(!this.subgraph)throw new Error("Cannot load a graph node without a graph");if(!this.template)throw new Error("Unable to load graph node without graph template");this.subgraph.load(t.graphState),super.load(t)}save(){if(!this.subgraph)throw new Error("Cannot save a graph node without a graph");return{...super.save(),graphState:this.subgraph.save()}}onPlaced(){this.template.events.updated.subscribe(this,()=>this.initialize()),this.template.events.nameChanged.subscribe(this,t=>{this._title=t}),this.initialize()}onDestroy(){var t;this.template.events.updated.unsubscribe(this),this.template.events.nameChanged.unsubscribe(this),(t=this.subgraph)===null||t===void 0||t.destroy()}initialize(){this.subgraph&&this.subgraph.destroy(),this.subgraph=this.template.createGraph(),this._title=this.template.name,this.updateInterfaces(),this.events.update.emit(null)}updateInterfaces(){if(!this.subgraph)throw new Error("Trying to update interfaces without graph instance");for(const t of this.subgraph.inputs)t.id in this.inputs?this.inputs[t.id].name=t.name:this.addInput(t.id,new Xt(t.name,void 0));for(const t of Object.keys(this.inputs))this.subgraph.inputs.some(s=>s.id===t)||this.removeInput(t);for(const t of this.subgraph.outputs)t.id in this.outputs?this.outputs[t.id].name=t.name:this.addOutput(t.id,new Xt(t.name,void 0));for(const t of Object.keys(this.outputs))this.subgraph.outputs.some(s=>s.id===t)||this.removeOutput(t);this.addOutput("_calculationResults",new Xt("_calculationResults",void 0).setHidden(!0))}}}class Ku{static fromGraph(e,t){return new Ku(e.save(),t)}get name(){return this._name}set name(e){this._name=e,this.events.nameChanged.emit(e);const t=this.editor.nodeTypes.get(Ea(this));t&&(t.title=e)}get inputs(){return this.nodes.filter(t=>t.type===ga).map(t=>({id:t.graphInterfaceId,name:t.inputs.name.value,nodeId:t.id,nodeInterfaceId:t.outputs.placeholder.id}))}get outputs(){return this.nodes.filter(t=>t.type===ba).map(t=>({id:t.graphInterfaceId,name:t.inputs.name.value,nodeId:t.id,nodeInterfaceId:t.outputs.output.id}))}constructor(e,t){this.id=Ci(),this._name="Subgraph",this.events={nameChanged:new zt(this),updated:new zt(this)},this.hooks={beforeLoad:new es(this),afterSave:new es(this)},this.editor=t,e.id&&(this.id=e.id),e.name&&(this._name=e.name),this.update(e)}update(e){this.nodes=e.nodes,this.connections=e.connections,this.events.updated.emit()}save(){return{id:this.id,name:this.name,nodes:this.nodes,connections:this.connections,inputs:this.inputs,outputs:this.outputs}}createGraph(e){const t=new Map,s=f=>{const _=Ci();return t.set(f,_),_},i=f=>{const _=t.get(f);if(!_)throw new Error(`Unable to create graph from template: Could not map old id ${f} to new id`);return _},r=f=>Kg(f,_=>({id:s(_.id),templateId:_.id,value:_.value})),o=this.nodes.map(f=>({...f,id:s(f.id),inputs:r(f.inputs),outputs:r(f.outputs)})),a=this.connections.map(f=>({id:s(f.id),from:i(f.from),to:i(f.to)})),l=this.inputs.map(f=>({id:f.id,name:f.name,nodeId:i(f.nodeId),nodeInterfaceId:i(f.nodeInterfaceId)})),u=this.outputs.map(f=>({id:f.id,name:f.name,nodeId:i(f.nodeId),nodeInterfaceId:i(f.nodeInterfaceId)})),d={id:Ci(),nodes:o,connections:a,inputs:l,outputs:u};return e||(e=new tc(this.editor)),e.load(d).forEach(f=>console.warn(f)),e.template=this,e}}class G2t{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 zt(this),beforeRegisterNodeType:new In(this),registerNodeType:new zt(this),beforeUnregisterNodeType:new In(this),unregisterNodeType:new zt(this),beforeAddGraphTemplate:new In(this),addGraphTemplate:new zt(this),beforeRemoveGraphTemplate:new In(this),removeGraphTemplate:new zt(this),registerGraph:new zt(this),unregisterGraph:new zt(this)},this.hooks={save:new es(this),load:new es(this)},this.graphTemplateEvents=Gs(),this.graphTemplateHooks=Gs(),this.graphEvents=Gs(),this.graphHooks=Gs(),this.nodeEvents=Gs(),this.nodeHooks=Gs(),this.connectionEvents=Gs(),this._graphs=new Set,this._nodeTypes=new Map,this._graph=new tc(this),this._graphTemplates=[],this._loading=!1,this.registerNodeType($O),this.registerNodeType(WO)}registerNodeType(e,t){var s,i;if(this.events.beforeRegisterNodeType.emit({type:e,options:t}).prevented)return;const r=new e;this._nodeTypes.set(r.type,{type:e,category:(s=t==null?void 0:t.category)!==null&&s!==void 0?s:"default",title:(i=t==null?void 0:t.title)!==null&&i!==void 0?i:r.title}),this.events.registerNodeType.emit({type:e,options:t})}unregisterNodeType(e){const t=typeof e=="string"?e:new e().type;if(this.nodeTypes.has(t)){if(this.events.beforeUnregisterNodeType.emit(t).prevented)return;this._nodeTypes.delete(t),this.events.unregisterNodeType.emit(t)}}addGraphTemplate(e){if(this.events.beforeAddGraphTemplate.emit(e).prevented)return;this._graphTemplates.push(e),this.graphTemplateEvents.addTarget(e.events),this.graphTemplateHooks.addTarget(e.hooks);const t=B2t(e);this.registerNodeType(t,{category:"Subgraphs",title:e.name}),this.events.addGraphTemplate.emit(e)}removeGraphTemplate(e){if(this.graphTemplates.includes(e)){if(this.events.beforeRemoveGraphTemplate.emit(e).prevented)return;const t=Ea(e);for(const s of[this.graph,...this.graphs.values()]){const i=s.nodes.filter(r=>r.type===t);for(const r of i)s.removeNode(r)}this.unregisterNodeType(t),this._graphTemplates.splice(this._graphTemplates.indexOf(e),1),this.graphTemplateEvents.removeTarget(e.events),this.graphTemplateHooks.removeTarget(e.hooks),this.events.removeGraphTemplate.emit(e)}}registerGraph(e){this.graphEvents.addTarget(e.events),this.graphHooks.addTarget(e.hooks),this.nodeEvents.addTarget(e.nodeEvents),this.nodeHooks.addTarget(e.nodeHooks),this.connectionEvents.addTarget(e.connectionEvents),this.events.registerGraph.emit(e),this._graphs.add(e)}unregisterGraph(e){this.graphEvents.removeTarget(e.events),this.graphHooks.removeTarget(e.hooks),this.nodeEvents.removeTarget(e.nodeEvents),this.nodeHooks.removeTarget(e.nodeHooks),this.connectionEvents.removeTarget(e.connectionEvents),this.events.unregisterGraph.emit(e),this._graphs.delete(e)}load(e){try{this._loading=!0,e=this.hooks.load.execute(e),e.graphTemplates.forEach(s=>{const i=new Ku(s,this);this.addGraphTemplate(i)});const t=this._graph.load(e.graph);return this.events.loaded.emit(),t.forEach(s=>console.warn(s)),t}finally{this._loading=!1}}save(){const e={graph:this.graph.save(),graphTemplates:this.graphTemplates.map(t=>t.save())};return this.hooks.save.execute(e)}}function V2t(n,e){const t=new Map;e.graphs.forEach(s=>{s.nodes.forEach(i=>t.set(i.id,i))}),n.forEach((s,i)=>{const r=t.get(i);r&&s.forEach((o,a)=>{const l=r.outputs[a];l&&(l.value=o)})})}class KO extends Error{constructor(){super("Cycle detected")}}function z2t(n){return typeof n=="string"}function jO(n,e){const t=new Map,s=new Map,i=new Map;let r,o;if(n instanceof tc)r=n.nodes,o=n.connections;else{if(!e)throw new Error("Invalid argument value: expected array of connections");r=n,o=e}r.forEach(u=>{Object.values(u.inputs).forEach(d=>t.set(d.id,u.id)),Object.values(u.outputs).forEach(d=>t.set(d.id,u.id))}),r.forEach(u=>{const d=o.filter(f=>f.from&&t.get(f.from.id)===u.id),h=new Set(d.map(f=>t.get(f.to.id)).filter(z2t));s.set(u.id,h),i.set(u,d)});const a=r.slice();o.forEach(u=>{const d=a.findIndex(h=>t.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=s.get(u.id);for(;d.size>0;){const h=d.values().next().value;if(d.delete(h),Array.from(s.values()).every(f=>!f.has(h))){const f=r.find(_=>_.id===h);a.push(f)}}}if(Array.from(s.values()).some(u=>u.size>0))throw new KO;return{calculationOrder:l,connectionsFromNode:i,interfaceIdToNodeId:t}}function H2t(n,e){try{return jO(n,e),!1}catch(t){if(t instanceof KO)return!0;throw t}}var Vn;(function(n){n.Running="Running",n.Idle="Idle",n.Paused="Paused",n.Stopped="Stopped"})(Vn||(Vn={}));class q2t{get status(){return this.isRunning?Vn.Running:this.internalStatus}constructor(e){this.editor=e,this.events={beforeRun:new In(this),afterRun:new zt(this),statusChange:new zt(this),beforeNodeCalculation:new zt(this),afterNodeCalculation:new zt(this)},this.hooks={gatherCalculationData:new es(this),transferData:new VO},this.recalculateOrder=!0,this.internalStatus=Vn.Stopped,this.isRunning=!1,this.editor.nodeEvents.update.subscribe(this,(t,s)=>{s.graph&&!s.graph.loading&&s.graph.activeTransactions===0&&this.internalOnChange(s,t??void 0)}),this.editor.graphEvents.addNode.subscribe(this,(t,s)=>{this.recalculateOrder=!0,!s.loading&&s.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.removeNode.subscribe(this,(t,s)=>{this.recalculateOrder=!0,!s.loading&&s.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.addConnection.subscribe(this,(t,s)=>{this.recalculateOrder=!0,!s.loading&&s.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.removeConnection.subscribe(this,(t,s)=>{this.recalculateOrder=!0,!s.loading&&s.activeTransactions===0&&this.internalOnChange()}),this.editor.graphHooks.checkConnection.subscribe(this,t=>this.checkConnection(t.from,t.to))}start(){this.internalStatus===Vn.Stopped&&(this.internalStatus=Vn.Idle,this.events.statusChange.emit(this.status))}pause(){this.internalStatus===Vn.Idle&&(this.internalStatus=Vn.Paused,this.events.statusChange.emit(this.status))}resume(){this.internalStatus===Vn.Paused&&(this.internalStatus=Vn.Idle,this.events.statusChange.emit(this.status))}stop(){(this.internalStatus===Vn.Idle||this.internalStatus===Vn.Paused)&&(this.internalStatus=Vn.Stopped,this.events.statusChange.emit(this.status))}async runOnce(e,...t){if(this.events.beforeRun.emit(e).prevented)return null;try{this.isRunning=!0,this.events.statusChange.emit(this.status),this.recalculateOrder&&this.calculateOrder();const s=await this.execute(e,...t);return this.events.afterRun.emit(s),s}finally{this.isRunning=!1,this.events.statusChange.emit(this.status)}}checkConnection(e,t){if(e.templateId){const r=this.findInterfaceByTemplateId(this.editor.graph.nodes,e.templateId);if(!r)return{connectionAllowed:!0,connectionsInDanger:[]};e=r}if(t.templateId){const r=this.findInterfaceByTemplateId(this.editor.graph.nodes,t.templateId);if(!r)return{connectionAllowed:!0,connectionsInDanger:[]};t=r}const s=new zO(e,t);let i=this.editor.graph.connections.slice();return t.allowMultipleConnections||(i=i.filter(r=>r.to!==t)),i.push(s),H2t(this.editor.graph.nodes,i)?{connectionAllowed:!1,connectionsInDanger:[]}:{connectionAllowed:!0,connectionsInDanger:t.allowMultipleConnections?[]:this.editor.graph.connections.filter(r=>r.to===t)}}calculateOrder(){this.recalculateOrder=!0}async calculateWithoutData(...e){const t=this.hooks.gatherCalculationData.execute(void 0);return await this.runOnce(t,...e)}validateNodeCalculationOutput(e,t){if(typeof t!="object")throw new Error(`Invalid calculation return value from node ${e.id} (type ${e.type})`);Object.keys(e.outputs).forEach(s=>{if(!(s in t))throw new Error(`Calculation return value from node ${e.id} (type ${e.type}) is missing key "${s}"`)})}internalOnChange(e,t){this.internalStatus===Vn.Idle&&this.onChange(this.recalculateOrder,e,t)}findInterfaceByTemplateId(e,t){for(const s of e)for(const i of[...Object.values(s.inputs),...Object.values(s.outputs)])if(i.templateId===t)return i;return null}}class Y2t extends q2t{constructor(e){super(e),this.order=new Map}start(){super.start(),this.recalculateOrder=!0,this.calculateWithoutData()}async runGraph(e,t,s){this.order.has(e.id)||this.order.set(e.id,jO(e));const{calculationOrder:i,connectionsFromNode:r}=this.order.get(e.id),o=new Map;for(const a of i){const l={};Object.entries(a.inputs).forEach(([d,h])=>{l[d]=this.getInterfaceValue(t,h.id)}),this.events.beforeNodeCalculation.emit({inputValues:l,node:a});let u;if(a.calculate)u=await a.calculate(l,{globalValues:s,engine:this});else{u={};for(const[d,h]of Object.entries(a.outputs))u[d]=this.getInterfaceValue(t,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?t.has(d.to.id)?t.get(d.to.id).push(_):t.set(d.to.id,[_]):t.set(d.to.id,_)})}return o}async execute(e){this.recalculateOrder&&(this.order.clear(),this.recalculateOrder=!1);const t=this.getInputValues(this.editor.graph);return await this.runGraph(this.editor.graph,t,e)}getInputValues(e){const t=new Map;for(const s of e.nodes)Object.values(s.inputs).forEach(i=>{i.connectionCount===0&&t.set(i.id,i.value)}),s.calculate||Object.values(s.outputs).forEach(i=>{t.set(i.id,i.value)});return t}onChange(e){this.recalculateOrder=e||this.recalculateOrder,this.calculateWithoutData()}getInterfaceValue(e,t){if(!e.has(t))throw new Error(`Could not find value for interface ${t} -This is likely a Baklava internal issue. Please report it on GitHub.`);return e.get(t)}}let jg=null;function Y2t(n){jg=n}function ys(){if(!jg)throw new Error("providePlugin() must be called before usePlugin()");return{viewModel:jg}}function Fs(){const{viewModel:n}=ys();return{graph:Cd(n.value,"displayedGraph"),switchGraph:n.value.switchGraph}}function QO(n){const{graph:e}=Fs(),t=lt(null),s=lt(null);return{dragging:Je(()=>!!t.value),onPointerDown:l=>{t.value={x:l.pageX,y:l.pageY},s.value={x:n.value.x,y:n.value.y}},onPointerMove:l=>{if(t.value){const u=l.pageX-t.value.x,d=l.pageY-t.value.y;n.value.x=s.value.x+u/e.value.scaling,n.value.y=s.value.y+d/e.value.scaling}},onPointerUp:()=>{t.value=null,s.value=null}}}function XO(n,e,t){if(!e.template)return!1;if(Ea(e.template)===t)return!0;const s=n.graphTemplates.find(r=>Ea(r)===t);return s?s.nodes.filter(r=>r.type.startsWith(Vl)).some(r=>XO(n,e,r.type)):!1}function ZO(n){return Je(()=>{const e=Array.from(n.value.editor.nodeTypes.entries()),t=new Set(e.map(([,i])=>i.category)),s=[];for(const i of t.values()){let r=e.filter(([,o])=>o.category===i);n.value.displayedGraph.template?r=r.filter(([o])=>!XO(n.value.editor,n.value.displayedGraph,o)):r=r.filter(([o])=>![ga,ba].includes(o)),r.length>0&&s.push({name:i,nodeTypes:Object.fromEntries(r)})}return s.sort((i,r)=>i.name==="default"?-1:r.name==="default"||i.name>r.name?1:-1),s})}function JO(){const{graph:n}=Fs();return{transform:(t,s)=>{const i=t/n.value.scaling-n.value.panning.x,r=s/n.value.scaling-n.value.panning.y;return[i,r]}}}function $2t(){const{graph:n}=Fs();let e=[],t=-1,s={x:0,y:0};const i=Je(()=>n.value.panning),r=QO(i),o=Je(()=>({"transform-origin":"0 0",transform:`scale(${n.value.scaling}) translate(${n.value.panning.x}px, ${n.value.panning.y}px)`})),a=(_,m,E)=>{const b=[_/n.value.scaling-n.value.panning.x,m/n.value.scaling-n.value.panning.y],g=[_/E-n.value.panning.x,m/E-n.value.panning.y],y=[g[0]-b[0],g[1]-b[1]];n.value.panning.x+=y[0],n.value.panning.y+=y[1],n.value.scaling=E},l=_=>{_.preventDefault();let m=_.deltaY;_.deltaMode===1&&(m*=32);const E=n.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();s={x:m+(b-m)/2,y:E+(g-E)/2}}},onPointerMove:_=>{for(let m=0;m0){const w=n.value.scaling*(1+(S-t)/500);a(s.x,s.y,w)}t=S}else r.onPointerMove(_)},onPointerUp:_=>{e=e.filter(m=>m.pointerId!==_.pointerId),t=-1,r.onPointerUp()},onMouseWheel:l}}var ds=(n=>(n[n.NONE=0]="NONE",n[n.ALLOWED=1]="ALLOWED",n[n.FORBIDDEN=2]="FORBIDDEN",n))(ds||{});const eI=Symbol();function W2t(){const{graph:n}=Fs(),e=lt(null),t=lt(null),s=a=>{e.value&&(e.value.mx=a.offsetX/n.value.scaling-n.value.panning.x,e.value.my=a.offsetY/n.value.scaling-n.value.panning.y)},i=()=>{if(t.value){if(e.value)return;const a=n.value.connections.find(l=>l.to===t.value);t.value.isInput&&a?(e.value={status:ds.NONE,from:a.from},n.value.removeConnection(a)):e.value={status:ds.NONE,from:t.value},e.value.mx=void 0,e.value.my=void 0}},r=()=>{if(e.value&&t.value){if(e.value.from===t.value)return;n.value.addConnection(e.value.from,e.value.to)}e.value=null},o=a=>{if(t.value=a??null,a&&e.value){e.value.to=a;const l=n.value.checkConnection(e.value.from,e.value.to);if(e.value.status=l.connectionAllowed?ds.ALLOWED:ds.FORBIDDEN,l.connectionAllowed){const u=l.connectionsInDanger.map(d=>d.id);n.value.connections.forEach(d=>{u.includes(d.id)&&(d.isInDanger=!0)})}}else!a&&e.value&&(e.value.to=void 0,e.value.status=ds.NONE,n.value.connections.forEach(l=>{l.isInDanger=!1}))};return zo(eI,{temporaryConnection:e,hoveredOver:o}),{temporaryConnection:e,onMouseMove:s,onMouseDown:i,onMouseUp:r,hoveredOver:o}}function K2t(n){const e=lt(!1),t=lt(0),s=lt(0),i=ZO(n),{transform:r}=JO(),o=Je(()=>{let d=[];const h={};for(const _ of i.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=Je(()=>n.value.settings.contextMenu.additionalItems.length===0?o.value:[{label:"Add node",submenu:o.value},...n.value.settings.contextMenu.additionalItems.map(d=>"isDivider"in d||"submenu"in d?d:{label:d.label,value:"command:"+d.command,disabled:!n.value.commandHandler.canExecuteCommand(d.command)})]);function l(d){e.value=!0,t.value=d.offsetX,s.value=d.offsetY}function u(d){if(d.startsWith("addNode:")){const h=d.substring(8),f=n.value.editor.nodeTypes.get(h);if(!f)return;const _=Wn(new f.type);n.value.displayedGraph.addNode(_);const[m,E]=r(t.value,s.value);_.position.x=m,_.position.y=E}else if(d.startsWith("command:")){const h=d.substring(8);n.value.commandHandler.canExecuteCommand(h)&&n.value.commandHandler.executeCommand(h)}}return{show:e,x:t,y:s,items:a,open:l,onClick:u}}const j2t=cn({setup(){const{viewModel:n}=ys(),{graph:e}=Fs();return{styles:Je(()=>{const s=n.value.settings.background,i=e.value.panning.x*e.value.scaling,r=e.value.panning.y*e.value.scaling,o=e.value.scaling*s.gridSize,a=o/s.gridDivision,l=`${o}px ${o}px, ${o}px ${o}px`,u=e.value.scaling>s.subGridVisibleThreshold?`, ${a}px ${a}px, ${a}px ${a}px`:"";return{backgroundPosition:`left ${i}px top ${r}px`,backgroundSize:`${l} ${u}`}})}}}),dn=(n,e)=>{const t=n.__vccOpts||n;for(const[s,i]of e)t[s]=i;return t};function Q2t(n,e,t,s,i,r){return C(),R("div",{class:"background",style:jt(n.styles)},null,4)}const X2t=dn(j2t,[["render",Q2t]]);function Z2t(n){return fw()?(GI(n),!0):!1}function BE(n){return typeof n=="function"?n():mt(n)}const tI=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const J2t=Object.prototype.toString,eDt=n=>J2t.call(n)==="[object Object]",yd=()=>{},tDt=nDt();function nDt(){var n,e;return tI&&((n=window==null?void 0:window.navigator)==null?void 0:n.userAgent)&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||((e=window==null?void 0:window.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function sDt(n,e,t=!1){return e.reduce((s,i)=>(i in n&&(!t||n[i]!==void 0)&&(s[i]=n[i]),s),{})}function iDt(n,e={}){if(!un(n))return vM(n);const t=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const s in n.value)t[s]=yM(()=>({get(){return n.value[s]},set(i){var r;if((r=BE(e.replaceRef))!=null?r:!0)if(Array.isArray(n.value)){const a=[...n.value];a[s]=i,n.value=a}else{const a={...n.value,[s]:i};Object.setPrototypeOf(a,Object.getPrototypeOf(n.value)),n.value=a}else n.value[s]=i}}));return t}function al(n){var e;const t=BE(n);return(e=t==null?void 0:t.$el)!=null?e:t}const GE=tI?window:void 0;function yl(...n){let e,t,s,i;if(typeof n[0]=="string"||Array.isArray(n[0])?([t,s,i]=n,e=GE):[e,t,s,i]=n,!e)return yd;Array.isArray(t)||(t=[t]),Array.isArray(s)||(s=[s]);const r=[],o=()=>{r.forEach(d=>d()),r.length=0},a=(d,h,f,_)=>(d.addEventListener(h,f,_),()=>d.removeEventListener(h,f,_)),l=Fn(()=>[al(e),BE(i)],([d,h])=>{if(o(),!d)return;const f=eDt(h)?{...h}:h;r.push(...t.flatMap(_=>s.map(m=>a(d,_,m,f))))},{immediate:!0,flush:"post"}),u=()=>{l(),o()};return Z2t(u),u}let Z1=!1;function nI(n,e,t={}){const{window:s=GE,ignore:i=[],capture:r=!0,detectIframe:o=!1}=t;if(!s)return yd;tDt&&!Z1&&(Z1=!0,Array.from(s.document.body.children).forEach(f=>f.addEventListener("click",yd)),s.document.documentElement.addEventListener("click",yd));let a=!0;const l=f=>i.some(_=>{if(typeof _=="string")return Array.from(s.document.querySelectorAll(_)).some(m=>m===f.target||f.composedPath().includes(m));{const m=al(_);return m&&(f.target===m||f.composedPath().includes(m))}}),d=[yl(s,"click",f=>{const _=al(n);if(!(!_||_===f.target||f.composedPath().includes(_))){if(f.detail===0&&(a=!l(f)),!a){a=!0;return}e(f)}},{passive:!0,capture:r}),yl(s,"pointerdown",f=>{const _=al(n);a=!l(f)&&!!(_&&!f.composedPath().includes(_))},{passive:!0}),o&&yl(s,"blur",f=>{setTimeout(()=>{var _;const m=al(n);((_=s.document.activeElement)==null?void 0:_.tagName)==="IFRAME"&&!(m!=null&&m.contains(s.document.activeElement))&&e(f)},0)})].filter(Boolean);return()=>d.forEach(f=>f())}const sI={x:0,y:0,pointerId:0,pressure:0,tiltX:0,tiltY:0,width:0,height:0,twist:0,pointerType:null},rDt=Object.keys(sI);function oDt(n={}){const{target:e=GE}=n,t=lt(!1),s=lt(n.initialValue||{});Object.assign(s.value,sI,s.value);const i=r=>{t.value=!0,!(n.pointerTypes&&!n.pointerTypes.includes(r.pointerType))&&(s.value=sDt(r,rDt,!1))};if(e){const r={passive:!0};yl(e,["pointerdown","pointermove","pointerup"],i,r),yl(e,"pointerleave",()=>t.value=!1,r)}return{...iDt(s),isInside:t}}const aDt=["onMouseenter","onMouseleave","onClick"],lDt={class:"flex-fill"},cDt={key:0,class:"__submenu-icon",style:{"line-height":"1em"}},dDt=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),uDt=[dDt],VE=cn({__name:"ContextMenu",props:{modelValue:{type:Boolean},items:{},x:{default:0},y:{default:0},isNested:{type:Boolean,default:!1},isFlipped:{default:()=>({x:!1,y:!1})},flippable:{type:Boolean,default:!1}},emits:["update:modelValue","click"],setup(n,{emit:e}){const t=n,s=e;let i=null;const r=lt(null),o=lt(-1),a=lt(0),l=lt({x:!1,y:!1}),u=Je(()=>t.flippable&&(l.value.x||t.isFlipped.x)),d=Je(()=>t.flippable&&(l.value.y||t.isFlipped.y)),h=Je(()=>{const y={};return t.isNested||(y.top=(d.value?t.y-a.value:t.y)+"px",y.left=t.x+"px"),y}),f=Je(()=>({"--flipped-x":u.value,"--flipped-y":d.value,"--nested":t.isNested})),_=Je(()=>t.items.map(y=>({...y,hover:!1})));Fn([()=>t.y,()=>t.items],()=>{var y,v,S,w;a.value=t.items.length*30;const x=((v=(y=r.value)==null?void 0:y.parentElement)==null?void 0:v.offsetWidth)??0,A=((w=(S=r.value)==null?void 0:S.parentElement)==null?void 0:w.offsetHeight)??0;l.value.x=!t.isNested&&t.x>x*.75,l.value.y=!t.isNested&&t.y+a.value>A-20}),nI(r,()=>{t.modelValue&&s("update:modelValue",!1)});const m=y=>{!y.submenu&&y.value&&(s("click",y.value),s("update:modelValue",!1))},E=y=>{s("click",y),o.value=-1,t.isNested||s("update:modelValue",!1)},b=(y,v)=>{t.items[v].submenu&&(o.value=v,i!==null&&(clearTimeout(i),i=null))},g=(y,v)=>{t.items[v].submenu&&(i=window.setTimeout(()=>{o.value=-1,i=null},200))};return(y,v)=>{const S=dt("ContextMenu",!0);return C(),St(Ms,{name:"slide-fade"},{default:qe(()=>[B(c("div",{ref_key:"el",ref:r,class:Fe(["baklava-context-menu",f.value]),style:jt(h.value)},[(C(!0),R(ze,null,st(_.value,(w,x)=>(C(),R(ze,null,[w.isDivider?(C(),R("div",{key:`d-${x}`,class:"divider"})):(C(),R("div",{key:`i-${x}`,class:Fe(["item",{submenu:!!w.submenu,"--disabled":!!w.disabled}]),onMouseenter:A=>b(A,x),onMouseleave:A=>g(A,x),onClick:ae(A=>m(w),["stop","prevent"])},[c("div",lDt,se(w.label),1),w.submenu?(C(),R("div",cDt,uDt)):G("",!0),w.submenu?(C(),St(S,{key:1,"model-value":o.value===x,items:w.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"])):G("",!0)],42,aDt))],64))),256))],6),[[Ot,y.modelValue]])]),_:1})}}}),pDt={},_Dt={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"},hDt=c("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),fDt=c("circle",{cx:"12",cy:"12",r:"1"},null,-1),mDt=c("circle",{cx:"12",cy:"19",r:"1"},null,-1),gDt=c("circle",{cx:"12",cy:"5",r:"1"},null,-1),bDt=[hDt,fDt,mDt,gDt];function EDt(n,e){return C(),R("svg",_Dt,bDt)}const iI=dn(pDt,[["render",EDt]]),yDt=["id"],vDt={key:0,class:"__tooltip"},SDt={key:2,class:"align-middle"},J1=cn({__name:"NodeInterface",props:{node:{},intf:{}},setup(n){const e=(b,g=100)=>{const y=b!=null&&b.toString?b.toString():"";return y.length>g?y.slice(0,g)+"...":y},t=n,{viewModel:s}=ys(),{hoveredOver:i,temporaryConnection:r}=Is(eI),o=lt(null),a=Je(()=>t.intf.connectionCount>0),l=lt(!1),u=Je(()=>s.value.settings.displayValueOnHover&&l.value),d=Je(()=>({"--input":t.intf.isInput,"--output":!t.intf.isInput,"--connected":a.value})),h=Je(()=>t.intf.component&&(!t.intf.isInput||!t.intf.port||t.intf.connectionCount===0)),f=()=>{l.value=!0,i(t.intf)},_=()=>{l.value=!1,i(void 0)},m=()=>{o.value&&s.value.hooks.renderInterface.execute({intf:t.intf,el:o.value})},E=()=>{const b=s.value.displayedGraph.sidebar;b.nodeId=t.node.id,b.optionName=t.intf.name,b.visible=!0};return Mi(m),ql(m),(b,g)=>{var y;return C(),R("div",{id:b.intf.id,ref_key:"el",ref:o,class:Fe(["baklava-node-interface",d.value])},[b.intf.port?(C(),R("div",{key:0,class:Fe(["__port",{"--selected":((y=mt(r))==null?void 0:y.from)===b.intf}]),onPointerover:f,onPointerout:_},[An(b.$slots,"portTooltip",{showTooltip:u.value},()=>[u.value===!0?(C(),R("span",vDt,se(e(b.intf.value)),1)):G("",!0)])],34)):G("",!0),h.value?(C(),St(hu(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"])):(C(),R("span",SDt,se(b.intf.name),1))],10,yDt)}}}),TDt=["id","data-node-type"],xDt={class:"__title-label"},CDt={class:"__menu"},wDt={class:"__outputs"},RDt={class:"__inputs"},ADt=cn({__name:"Node",props:{node:{},selected:{type:Boolean,default:!1},dragging:{type:Boolean}},emits:["select","start-drag"],setup(n,{emit:e}){const t=n,s=e,{viewModel:i}=ys(),{graph:r,switchGraph:o}=Fs(),a=lt(null),l=lt(!1),u=lt(""),d=lt(null),h=lt(!1),f=lt(!1),_=Je(()=>{const F=[{value:"rename",label:"Rename"},{value:"delete",label:"Delete"}];return t.node.type.startsWith(Vl)&&F.push({value:"editSubgraph",label:"Edit Subgraph"}),F}),m=Je(()=>({"--selected":t.selected,"--dragging":t.dragging,"--two-column":!!t.node.twoColumn})),E=Je(()=>{var F,z;return{top:`${((F=t.node.position)==null?void 0:F.y)??0}px`,left:`${((z=t.node.position)==null?void 0:z.x)??0}px`,"--width":`${t.node.width??i.value.settings.nodes.defaultWidth}px`}}),b=Je(()=>Object.values(t.node.inputs).filter(F=>!F.hidden)),g=Je(()=>Object.values(t.node.outputs).filter(F=>!F.hidden)),y=()=>{s("select")},v=F=>{t.selected||y(),s("start-drag",F)},S=()=>{f.value=!0},w=async F=>{var z;switch(F){case"delete":r.value.removeNode(t.node);break;case"rename":u.value=t.node.title,l.value=!0,await Ue(),(z=d.value)==null||z.focus();break;case"editSubgraph":o(t.node.template);break}},x=()=>{t.node.title=u.value,l.value=!1},A=()=>{a.value&&i.value.hooks.renderNode.execute({node:t.node,el:a.value})},D=F=>{h.value=!0,F.preventDefault()},T=F=>{if(!h.value)return;const z=t.node.width+F.movementX/r.value.scaling,Z=i.value.settings.nodes.minWidth,M=i.value.settings.nodes.maxWidth;t.node.width=Math.max(Z,Math.min(M,z))},O=()=>{h.value=!1};return Mi(()=>{A(),window.addEventListener("mousemove",T),window.addEventListener("mouseup",O)}),ql(A),Ca(()=>{window.removeEventListener("mousemove",T),window.removeEventListener("mouseup",O)}),(F,z)=>(C(),R("div",{id:F.node.id,ref_key:"el",ref:a,class:Fe(["baklava-node",m.value]),style:jt(E.value),"data-node-type":F.node.type,onPointerdown:y},[mt(i).settings.nodes.resizable?(C(),R("div",{key:0,class:"__resize-handle",onMousedown:D},null,32)):G("",!0),An(F.$slots,"title",{},()=>[c("div",{class:"__title",onPointerdown:ae(v,["self","stop"])},[l.value?B((C(),R("input",{key:1,ref_key:"renameInputEl",ref:d,"onUpdate:modelValue":z[1]||(z[1]=Z=>u.value=Z),type:"text",class:"baklava-input",placeholder:"Node Name",onBlur:x,onKeydown:Ai(x,["enter"])},null,544)),[[he,u.value]]):(C(),R(ze,{key:0},[c("div",xDt,se(F.node.title),1),c("div",CDt,[_e(iI,{class:"--clickable",onClick:S}),_e(VE,{modelValue:f.value,"onUpdate:modelValue":z[0]||(z[0]=Z=>f.value=Z),x:0,y:0,items:_.value,onClick:w},null,8,["modelValue","items"])])],64))],32)]),An(F.$slots,"content",{},()=>[c("div",{class:"__content",onKeydown:z[2]||(z[2]=Ai(ae(()=>{},["stop"]),["delete"]))},[c("div",wDt,[(C(!0),R(ze,null,st(g.value,Z=>An(F.$slots,"nodeInterface",{key:Z.id,type:"output",node:F.node,intf:Z},()=>[_e(J1,{node:F.node,intf:Z},null,8,["node","intf"])])),128))]),c("div",RDt,[(C(!0),R(ze,null,st(b.value,Z=>An(F.$slots,"nodeInterface",{key:Z.id,type:"input",node:F.node,intf:Z},()=>[_e(J1,{node:F.node,intf:Z},null,8,["node","intf"])])),128))])],32)])],46,TDt))}}),NDt=cn({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:ds.NONE},isTemporary:{type:Boolean,default:!1}},setup(n){const{viewModel:e}=ys(),{graph:t}=Fs(),s=(o,a)=>{const l=(o+t.value.panning.x)*t.value.scaling,u=(a+t.value.panning.y)*t.value.scaling;return[l,u]},i=Je(()=>{const[o,a]=s(n.x1,n.y1),[l,u]=s(n.x2,n.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=Je(()=>({"--temporary":n.isTemporary,"--allowed":n.state===ds.ALLOWED,"--forbidden":n.state===ds.FORBIDDEN}));return{d:i,classes:r}}}),ODt=["d"];function IDt(n,e,t,s,i,r){return C(),R("path",{class:Fe(["baklava-connection",n.classes]),d:n.d},null,10,ODt)}const rI=dn(NDt,[["render",IDt]]);function MDt(n){return document.getElementById(n.id)}function ya(n){const e=document.getElementById(n.id),t=e==null?void 0:e.getElementsByClassName("__port");return{node:(e==null?void 0:e.closest(".baklava-node"))??null,interface:e,port:t&&t.length>0?t[0]:null}}const DDt=cn({components:{"connection-view":rI},props:{connection:{type:Object,required:!0}},setup(n){const{graph:e}=Fs();let t;const s=lt({x1:0,y1:0,x2:0,y2:0}),i=Je(()=>n.connection.isInDanger?ds.FORBIDDEN:ds.NONE),r=Je(()=>{var u;return(u=e.value.findNodeById(n.connection.from.nodeId))==null?void 0:u.position}),o=Je(()=>{var u;return(u=e.value.findNodeById(n.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=ya(n.connection.from),d=ya(n.connection.to);u.node&&d.node&&(t||(t=new ResizeObserver(()=>{l()}),t.observe(u.node),t.observe(d.node)));const[h,f]=a(u),[_,m]=a(d);s.value={x1:h,y1:f,x2:_,y2:m}};return Mi(async()=>{await Ue(),l()}),Ca(()=>{t&&t.disconnect()}),Fn([r,o],()=>l(),{deep:!0}),{d:s,state:i}}});function kDt(n,e,t,s,i,r){const o=dt("connection-view");return C(),St(o,{x1:n.d.x1,y1:n.d.y1,x2:n.d.x2,y2:n.d.y2,state:n.state},null,8,["x1","y1","x2","y2","state"])}const LDt=dn(DDt,[["render",kDt]]);function Jd(n){return n.node&&n.interface&&n.port?[n.node.offsetLeft+n.interface.offsetLeft+n.port.offsetLeft+n.port.clientWidth/2,n.node.offsetTop+n.interface.offsetTop+n.port.offsetTop+n.port.clientHeight/2]:[0,0]}const PDt=cn({components:{"connection-view":rI},props:{connection:{type:Object,required:!0}},setup(n){const e=Je(()=>n.connection?n.connection.status:ds.NONE);return{d:Je(()=>{if(!n.connection)return{input:[0,0],output:[0,0]};const s=Jd(ya(n.connection.from)),i=n.connection.to?Jd(ya(n.connection.to)):[n.connection.mx||s[0],n.connection.my||s[1]];return n.connection.from.isInput?{input:i,output:s}:{input:s,output:i}}),status:e}}});function UDt(n,e,t,s,i,r){const o=dt("connection-view");return C(),St(o,{x1:n.d.input[0],y1:n.d.input[1],x2:n.d.output[0],y2:n.d.output[1],state:n.status,"is-temporary":""},null,8,["x1","y1","x2","y2","state"])}const FDt=dn(PDt,[["render",UDt]]),BDt=cn({setup(){const{viewModel:n}=ys(),{graph:e}=Fs(),t=lt(null),s=Cd(n.value.settings.sidebar,"width"),i=Je(()=>n.value.settings.sidebar.resizable),r=Je(()=>{const h=e.value.sidebar.nodeId;return e.value.nodes.find(f=>f.id===h)}),o=Je(()=>({width:`${s.value}px`})),a=Je(()=>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=t.value)==null?void 0:f.parentElement)==null?void 0:_.getBoundingClientRect().width)??500;let E=s.value-h.movementX;E<300?E=300:E>.9*m&&(E=.9*m),s.value=E};return{el:t,graph:e,resizable:i,node:r,styles:o,displayedInterfaces:a,startResize:u,close:l}}}),GDt={class:"__header"},VDt={class:"__node-name"};function zDt(n,e,t,s,i,r){return C(),R("div",{ref:"el",class:Fe(["baklava-sidebar",{"--open":n.graph.sidebar.visible}]),style:jt(n.styles)},[n.resizable?(C(),R("div",{key:0,class:"__resizer",onMousedown:e[0]||(e[0]=(...o)=>n.startResize&&n.startResize(...o))},null,32)):G("",!0),c("div",GDt,[c("button",{tabindex:"-1",class:"__close",onClick:e[1]||(e[1]=(...o)=>n.close&&n.close(...o))},"×"),c("div",VDt,[c("b",null,se(n.node?n.node.title:""),1)])]),(C(!0),R(ze,null,st(n.displayedInterfaces,o=>(C(),R("div",{key:o.id,class:"__interface"},[(C(),St(hu(o.component),{modelValue:o.value,"onUpdate:modelValue":a=>o.value=a,node:n.node,intf:o},null,8,["modelValue","onUpdate:modelValue","node","intf"]))]))),128))],6)}const HDt=dn(BDt,[["render",zDt]]),qDt=cn({__name:"Minimap",setup(n){const{viewModel:e}=ys(),{graph:t}=Fs(),s=lt(null),i=lt(!1);let r,o=!1,a={x1:0,y1:0,x2:0,y2:0},l;const u=()=>{var x,A;if(!r)return;r.canvas.width=s.value.offsetWidth,r.canvas.height=s.value.offsetHeight;const D=new Map,T=new Map;for(const M of t.value.nodes){const q=MDt(M),H=(q==null?void 0:q.offsetWidth)??0,P=(q==null?void 0:q.offsetHeight)??0,$=((x=M.position)==null?void 0:x.x)??0,J=((A=M.position)==null?void 0:A.y)??0;D.set(M,{x1:$,y1:J,x2:$+H,y2:J+P}),T.set(M,q)}const O={x1:Number.MAX_SAFE_INTEGER,y1:Number.MAX_SAFE_INTEGER,x2:Number.MIN_SAFE_INTEGER,y2:Number.MIN_SAFE_INTEGER};for(const M of D.values())M.x1O.x2&&(O.x2=M.x2),M.y2>O.y2&&(O.y2=M.y2);const F=50;O.x1-=F,O.y1-=F,O.x2+=F,O.y2+=F,a=O;const z=r.canvas.width/r.canvas.height,Z=(a.x2-a.x1)/(a.y2-a.y1);if(z>Z){const M=(z-Z)*(a.y2-a.y1)*.5;a.x1-=M,a.x2+=M}else{const M=a.x2-a.x1,q=a.y2-a.y1,H=(M-z*q)/z*.5;a.y1-=H,a.y2+=H}r.clearRect(0,0,r.canvas.width,r.canvas.height),r.strokeStyle="white";for(const M of t.value.connections){const[q,H]=Jd(ya(M.from)),[P,$]=Jd(ya(M.to)),[J,re]=d(q,H),[me,Se]=d(P,$);if(r.beginPath(),r.moveTo(J,re),e.value.settings.useStraightConnections)r.lineTo(me,Se);else{const le=.3*Math.abs(J-me);r.bezierCurveTo(J+le,re,me-le,Se,me,Se)}r.stroke()}r.strokeStyle="lightgray";for(const[M,q]of D.entries()){const[H,P]=d(q.x1,q.y1),[$,J]=d(q.x2,q.y2);r.fillStyle=f(T.get(M)),r.beginPath(),r.rect(H,P,$-H,J-P),r.fill(),r.stroke()}if(i.value){const M=m(),[q,H]=d(M.x1,M.y1),[P,$]=d(M.x2,M.y2);r.fillStyle="rgba(255, 255, 255, 0.2)",r.fillRect(q,H,P-q,$-H)}},d=(x,A)=>[(x-a.x1)/(a.x2-a.x1)*r.canvas.width,(A-a.y1)/(a.y2-a.y1)*r.canvas.height],h=(x,A)=>[x*(a.x2-a.x1)/r.canvas.width+a.x1,A*(a.y2-a.y1)/r.canvas.height+a.y1],f=x=>{if(x){const A=x.querySelector(".__content");if(A){const T=_(A);if(T)return T}const D=_(x);if(D)return D}return"gray"},_=x=>{const A=getComputedStyle(x).backgroundColor;if(A&&A!=="rgba(0, 0, 0, 0)")return A},m=()=>{const x=s.value.parentElement.offsetWidth,A=s.value.parentElement.offsetHeight,D=x/t.value.scaling-t.value.panning.x,T=A/t.value.scaling-t.value.panning.y;return{x1:-t.value.panning.x,y1:-t.value.panning.y,x2:D,y2:T}},E=x=>{x.button===0&&(o=!0,b(x))},b=x=>{if(o){const[A,D]=h(x.offsetX,x.offsetY),T=m(),O=(T.x2-T.x1)/2,F=(T.y2-T.y1)/2;t.value.panning.x=-(A-O),t.value.panning.y=-(D-F)}},g=()=>{o=!1},y=()=>{i.value=!0},v=()=>{i.value=!1,g()};Fn([i,t.value.panning,()=>t.value.scaling,()=>t.value.connections.length],()=>{u()});const S=Je(()=>t.value.nodes.map(x=>x.position)),w=Je(()=>t.value.nodes.map(x=>x.width));return Fn([S,w],()=>{u()},{deep:!0}),Mi(()=>{r=s.value.getContext("2d"),r.imageSmoothingQuality="high",u(),l=setInterval(u,500)}),Ca(()=>{clearInterval(l)}),(x,A)=>(C(),R("canvas",{ref_key:"canvas",ref:s,class:"baklava-minimap",onMouseenter:y,onMouseleave:v,onMousedown:ae(E,["self"]),onMousemove:ae(b,["self"]),onMouseup:g},null,544))}}),YDt=cn({components:{ContextMenu:VE,VerticalDots:iI},props:{type:{type:String,required:!0},title:{type:String,required:!0}},setup(n){const{viewModel:e}=ys(),{switchGraph:t}=Fs(),s=lt(!1),i=Je(()=>n.type.startsWith(Vl));return{showContextMenu:s,hasContextMenu:i,contextMenuItems:[{label:"Edit Subgraph",value:"editSubgraph"},{label:"Delete Subgraph",value:"deleteSubgraph"}],openContextMenu:()=>{s.value=!0},onContextMenuClick:l=>{const u=n.type.substring(Vl.length),d=e.value.editor.graphTemplates.find(h=>h.id===u);if(d)switch(l){case"editSubgraph":t(d);break;case"deleteSubgraph":e.value.editor.removeGraphTemplate(d);break}}}}}),$Dt=["data-node-type"],WDt={class:"__title"},KDt={class:"__title-label"},jDt={key:0,class:"__menu"};function QDt(n,e,t,s,i,r){const o=dt("vertical-dots"),a=dt("context-menu");return C(),R("div",{class:"baklava-node --palette","data-node-type":n.type},[c("div",WDt,[c("div",KDt,se(n.title),1),n.hasContextMenu?(C(),R("div",jDt,[_e(o,{class:"--clickable",onPointerdown:e[0]||(e[0]=ae(()=>{},["stop","prevent"])),onClick:ae(n.openContextMenu,["stop","prevent"])},null,8,["onClick"]),_e(a,{modelValue:n.showContextMenu,"onUpdate:modelValue":e[1]||(e[1]=l=>n.showContextMenu=l),x:-100,y:0,items:n.contextMenuItems,onClick:n.onContextMenuClick,onPointerdown:e[2]||(e[2]=ae(()=>{},["stop","prevent"]))},null,8,["modelValue","items","onClick"])])):G("",!0)])],8,$Dt)}const ew=dn(YDt,[["render",QDt]]),XDt={class:"baklava-node-palette"},ZDt={key:0},JDt=cn({__name:"NodePalette",setup(n){const{viewModel:e}=ys(),{x:t,y:s}=oDt(),{transform:i}=JO(),r=ZO(e),o=Is("editorEl"),a=lt(null),l=Je(()=>{if(!a.value||!(o!=null&&o.value))return{};const{left:d,top:h}=o.value.getBoundingClientRect();return{top:`${s.value-h}px`,left:`${t.value-d}px`}}),u=(d,h)=>{a.value={type:d,nodeInformation:h};const f=()=>{const _=Wn(new h.type);e.value.displayedGraph.addNode(_);const m=o.value.getBoundingClientRect(),[E,b]=i(t.value-m.left,s.value-m.top);_.position.x=E,_.position.y=b,a.value=null,document.removeEventListener("pointerup",f)};document.addEventListener("pointerup",f)};return(d,h)=>(C(),R(ze,null,[c("div",XDt,[(C(!0),R(ze,null,st(mt(r),f=>(C(),R("section",{key:f.name},[f.name!=="default"?(C(),R("h1",ZDt,se(f.name),1)):G("",!0),(C(!0),R(ze,null,st(f.nodeTypes,(_,m)=>(C(),St(ew,{key:m,type:m,title:_.title,onPointerdown:E=>u(m,_)},null,8,["type","title","onPointerdown"]))),128))]))),128))]),_e(Ms,{name:"fade"},{default:qe(()=>[a.value?(C(),R("div",{key:0,class:"baklava-dragged-node",style:jt(l.value)},[_e(ew,{type:a.value.type,title:a.value.nodeInformation.title},null,8,["type","title"])],4)):G("",!0)]),_:1})],64))}});let rd;const ekt=new Uint8Array(16);function tkt(){if(!rd&&(rd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!rd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return rd(ekt)}const vn=[];for(let n=0;n<256;++n)vn.push((n+256).toString(16).slice(1));function nkt(n,e=0){return vn[n[e+0]]+vn[n[e+1]]+vn[n[e+2]]+vn[n[e+3]]+"-"+vn[n[e+4]]+vn[n[e+5]]+"-"+vn[n[e+6]]+vn[n[e+7]]+"-"+vn[n[e+8]]+vn[n[e+9]]+"-"+vn[n[e+10]]+vn[n[e+11]]+vn[n[e+12]]+vn[n[e+13]]+vn[n[e+14]]+vn[n[e+15]]}const skt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),tw={randomUUID:skt};function eu(n,e,t){if(tw.randomUUID&&!e&&!n)return tw.randomUUID();n=n||{};const s=n.random||(n.rng||tkt)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,e){t=t||0;for(let i=0;i<16;++i)e[t+i]=s[i];return e}return nkt(s)}const zl="SAVE_SUBGRAPH";function ikt(n,e){const t=()=>{const s=n.value;if(!s.template)throw new Error("Graph template property not set");s.template.update(s.save()),s.template.panning=s.panning,s.template.scaling=s.scaling};e.registerCommand(zl,{canExecute:()=>{var s;return n.value!==((s=n.value.editor)==null?void 0:s.graph)},execute:t})}const rkt={},okt={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"},akt=c("polyline",{points:"6 9 12 15 18 9"},null,-1),lkt=[akt];function ckt(n,e){return C(),R("svg",okt,lkt)}const dkt=dn(rkt,[["render",ckt]]),ukt=cn({components:{"i-arrow":dkt},props:{intf:{type:Object,required:!0}},setup(n){const e=lt(null),t=lt(!1),s=Je(()=>n.intf.items.find(o=>typeof o=="string"?o===n.intf.value:o.value===n.intf.value)),i=Je(()=>s.value?typeof s.value=="string"?s.value:s.value.text:""),r=o=>{n.intf.value=typeof o=="string"?o:o.value};return nI(e,()=>{t.value=!1}),{el:e,open:t,selectedItem:s,selectedText:i,setSelected:r}}}),pkt=["title"],_kt={class:"__selected"},hkt={class:"__text"},fkt={class:"__icon"},mkt={class:"__dropdown"},gkt={class:"item --header"},bkt=["onClick"];function Ekt(n,e,t,s,i,r){const o=dt("i-arrow");return C(),R("div",{ref:"el",class:Fe(["baklava-select",{"--open":n.open}]),title:n.intf.name,onClick:e[0]||(e[0]=a=>n.open=!n.open)},[c("div",_kt,[c("div",hkt,se(n.selectedText),1),c("div",fkt,[_e(o)])]),_e(Ms,{name:"slide-fade"},{default:qe(()=>[B(c("div",mkt,[c("div",gkt,se(n.intf.name),1),(C(!0),R(ze,null,st(n.intf.items,(a,l)=>(C(),R("div",{key:l,class:Fe(["item",{"--active":a===n.selectedItem}]),onClick:u=>n.setSelected(a)},se(typeof a=="string"?a:a.text),11,bkt))),128))],512),[[Ot,n.open]])]),_:1})],10,pkt)}const ykt=dn(ukt,[["render",Ekt]]);class vkt extends Xt{constructor(e,t,s){super(e,t),this.component=Hl(ykt),this.items=s}}const Skt=cn({props:{intf:{type:Object,required:!0}}});function Tkt(n,e,t,s,i,r){return C(),R("div",null,se(n.intf.value),1)}const xkt=dn(Skt,[["render",Tkt]]);class Ckt extends Xt{constructor(e,t){super(e,t),this.component=Hl(xkt),this.setPort(!1)}}const wkt=cn({props:{intf:{type:Object,required:!0},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(n,{emit:e}){return{v:Je({get:()=>n.modelValue,set:s=>{e("update:modelValue",s)}})}}}),Rkt=["placeholder","title"];function Akt(n,e,t,s,i,r){return C(),R("div",null,[B(c("input",{"onUpdate:modelValue":e[0]||(e[0]=o=>n.v=o),type:"text",class:"baklava-input",placeholder:n.intf.name,title:n.intf.name},null,8,Rkt),[[he,n.v]])])}const Nkt=dn(wkt,[["render",Akt]]);class nc extends Xt{constructor(){super(...arguments),this.component=Hl(Nkt)}}class oI extends $O{constructor(){super(...arguments),this._title="Subgraph Input",this.inputs={name:new nc("Name","Input").setPort(!1)},this.outputs={placeholder:new Xt("Connection",void 0)}}}class aI extends WO{constructor(){super(...arguments),this._title="Subgraph Output",this.inputs={name:new nc("Name","Output").setPort(!1),placeholder:new Xt("Connection",void 0)},this.outputs={output:new Xt("Output",void 0).setHidden(!0)}}}const lI="CREATE_SUBGRAPH",nw=[ga,ba];function Okt(n,e,t){const s=()=>n.value.selectedNodes.filter(r=>!nw.includes(r.type)).length>0,i=()=>{const{viewModel:r}=ys(),o=n.value,a=n.value.editor;if(o.selectedNodes.length===0)return;const l=o.selectedNodes.filter(T=>!nw.includes(T.type)),u=l.flatMap(T=>Object.values(T.inputs)),d=l.flatMap(T=>Object.values(T.outputs)),h=o.connections.filter(T=>!d.includes(T.from)&&u.includes(T.to)),f=o.connections.filter(T=>d.includes(T.from)&&!u.includes(T.to)),_=o.connections.filter(T=>d.includes(T.from)&&u.includes(T.to)),m=l.map(T=>T.save()),E=_.map(T=>({id:T.id,from:T.from.id,to:T.to.id})),b=new Map,{xLeft:g,xRight:y,yTop:v}=Ikt(l);console.log(g,y,v);for(const[T,O]of h.entries()){const F=new oI;F.inputs.name.value=O.to.name,m.push({...F.save(),position:{x:y-r.value.settings.nodes.defaultWidth-100,y:v+T*200}}),E.push({id:eu(),from:F.outputs.placeholder.id,to:O.to.id}),b.set(O.to.id,F.graphInterfaceId)}for(const[T,O]of f.entries()){const F=new aI;F.inputs.name.value=O.from.name,m.push({...F.save(),position:{x:g+100,y:v+T*200}}),E.push({id:eu(),from:O.from.id,to:F.inputs.placeholder.id}),b.set(O.from.id,F.graphInterfaceId)}const S=Wn(new Ku({connections:E,nodes:m,inputs:[],outputs:[]},a));a.addGraphTemplate(S);const w=a.nodeTypes.get(Ea(S));if(!w)throw new Error("Unable to create subgraph: Could not find corresponding graph node type");const x=Wn(new w.type);o.addNode(x);const A=Math.round(l.map(T=>T.position.x).reduce((T,O)=>T+O,0)/l.length),D=Math.round(l.map(T=>T.position.y).reduce((T,O)=>T+O,0)/l.length);x.position.x=A,x.position.y=D,h.forEach(T=>{o.removeConnection(T),o.addConnection(T.from,x.inputs[b.get(T.to.id)])}),f.forEach(T=>{o.removeConnection(T),o.addConnection(x.outputs[b.get(T.from.id)],T.to)}),l.forEach(T=>o.removeNode(T)),e.canExecuteCommand(zl)&&e.executeCommand(zl),t(S),n.value.panning={...o.panning},n.value.scaling=o.scaling};e.registerCommand(lI,{canExecute:s,execute:i})}function Ikt(n){const e=n.reduce((i,r)=>{const o=r.position.x;return o{const o=r.position.y;return o{const o=r.position.x+r.width;return o>i?o:i},-1/0),xRight:e,yTop:t}}const sw="DELETE_NODES";function Mkt(n,e){e.registerCommand(sw,{canExecute:()=>n.value.selectedNodes.length>0,execute(){n.value.selectedNodes.forEach(t=>n.value.removeNode(t))}}),e.registerHotkey(["Delete"],sw)}const cI="SWITCH_TO_MAIN_GRAPH";function Dkt(n,e,t){e.registerCommand(cI,{canExecute:()=>n.value!==n.value.editor.graph,execute:()=>{e.executeCommand(zl),t(n.value.editor.graph)}})}function kkt(n,e,t){Mkt(n,e),Okt(n,e,t),ikt(n,e),Dkt(n,e,t)}class iw{constructor(e,t){this.type=e,e==="addNode"?this.nodeId=t:this.nodeState=t}undo(e){this.type==="addNode"?this.removeNode(e):this.addNode(e)}redo(e){this.type==="addNode"&&this.nodeState?this.addNode(e):this.type==="removeNode"&&this.nodeId&&this.removeNode(e)}addNode(e){const t=e.editor.nodeTypes.get(this.nodeState.type);if(!t)return;const s=new t.type;e.addNode(s),s.load(this.nodeState),this.nodeId=s.id}removeNode(e){const t=e.nodes.find(s=>s.id===this.nodeId);t&&(this.nodeState=t.save(),e.removeNode(t))}}class rw{constructor(e,t){if(this.type=e,e==="addConnection")this.connectionId=t;else{const s=t;this.connectionState={id:s.id,from:s.from.id,to:s.to.id}}}undo(e){this.type==="addConnection"?this.removeConnection(e):this.addConnection(e)}redo(e){this.type==="addConnection"&&this.connectionState?this.addConnection(e):this.type==="removeConnection"&&this.connectionId&&this.removeConnection(e)}addConnection(e){const t=e.findNodeInterface(this.connectionState.from),s=e.findNodeInterface(this.connectionState.to);!t||!s||e.addConnection(t,s)}removeConnection(e){const t=e.connections.find(s=>s.id===this.connectionId);t&&(this.connectionState={id:t.id,from:t.from.id,to:t.to.id},e.removeConnection(t))}}class Lkt{constructor(e){if(this.type="transaction",e.length===0)throw new Error("Can't create a transaction with no steps");this.steps=e}undo(e){for(let t=this.steps.length-1;t>=0;t--)this.steps[t].undo(e)}redo(e){for(let t=0;t{if(!r.value)if(a.value)l.value.push(b);else for(o.value!==i.value.length-1&&(i.value=i.value.slice(0,o.value+1)),i.value.push(b),o.value++;i.value.length>s.value;)i.value.shift()},d=()=>{a.value=!0},h=()=>{a.value=!1,l.value.length>0&&(u(new Lkt(l.value)),l.value=[])},f=()=>i.value.length!==0&&o.value!==-1,_=()=>{f()&&(r.value=!0,i.value[o.value--].undo(n.value),r.value=!1)},m=()=>i.value.length!==0&&o.value{m()&&(r.value=!0,i.value[++o.value].redo(n.value),r.value=!1)};return Fn(n,(b,g)=>{g&&(g.events.addNode.unsubscribe(t),g.events.removeNode.unsubscribe(t),g.events.addConnection.unsubscribe(t),g.events.removeConnection.unsubscribe(t)),b&&(b.events.addNode.subscribe(t,y=>{u(new iw("addNode",y.id))}),b.events.removeNode.subscribe(t,y=>{u(new iw("removeNode",y.save()))}),b.events.addConnection.subscribe(t,y=>{u(new rw("addConnection",y.id))}),b.events.removeConnection.subscribe(t,y=>{u(new rw("removeConnection",y))}))},{immediate:!0}),e.registerCommand(Qg,{canExecute:f,execute:_}),e.registerCommand(Xg,{canExecute:m,execute:E}),e.registerCommand(dI,{canExecute:()=>!a.value,execute:d}),e.registerCommand(uI,{canExecute:()=>a.value,execute:h}),e.registerHotkey(["Control","z"],Qg),e.registerHotkey(["Control","y"],Xg),Wn({maxSteps:s})}const Zg="COPY",Jg="PASTE",Ukt="CLEAR_CLIPBOARD";function Fkt(n,e,t){const s=Symbol("ClipboardToken"),i=lt(""),r=lt(""),o=Je(()=>!i.value),a=()=>{i.value="",r.value=""},l=()=>{const h=n.value.selectedNodes.flatMap(_=>[...Object.values(_.inputs),...Object.values(_.outputs)]),f=n.value.connections.filter(_=>h.includes(_.from)||h.includes(_.to)).map(_=>({from:_.from.id,to:_.to.id}));r.value=JSON.stringify(f),i.value=JSON.stringify(n.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(i.value),_=JSON.parse(r.value),m=[],E=[],b=n.value;t.executeCommand(dI);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(s,w=>{const x=w;return x.position&&(x.position.x+=100,x.position.y+=100),v.hooks.beforeLoad.unsubscribe(s),x}),b.addNode(v),v.load({...g,id:S}),v.id=S,h.set(g.id,S);for(const w of Object.values(v.inputs)){const x=eu();h.set(w.id,x),w.id=x}for(const w of Object.values(v.outputs)){const x=eu();h.set(w.id,x),w.id=x}}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 n.value.selectedNodes=m,t.executeCommand(uI),{newNodes:m,newConnections:E}};return t.registerCommand(Zg,{canExecute:()=>n.value.selectedNodes.length>0,execute:l}),t.registerHotkey(["Control","c"],Zg),t.registerCommand(Jg,{canExecute:()=>!o.value,execute:d}),t.registerHotkey(["Control","v"],Jg),t.registerCommand(Ukt,{canExecute:()=>!0,execute:a}),Wn({isEmpty:o})}const Bkt="OPEN_SIDEBAR";function Gkt(n,e){e.registerCommand(Bkt,{execute:t=>{n.value.sidebar.nodeId=t,n.value.sidebar.visible=!0},canExecute:()=>!0})}function Vkt(n,e){Gkt(n,e)}const zkt={},Hkt={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"},qkt=c("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),Ykt=c("path",{d:"M9 13l-4 -4l4 -4m-4 4h11a4 4 0 0 1 0 8h-1"},null,-1),$kt=[qkt,Ykt];function Wkt(n,e){return C(),R("svg",Hkt,$kt)}const Kkt=dn(zkt,[["render",Wkt]]),jkt={},Qkt={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"},Xkt=c("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),Zkt=c("path",{d:"M15 13l4 -4l-4 -4m4 4h-11a4 4 0 0 0 0 8h1"},null,-1),Jkt=[Xkt,Zkt];function eLt(n,e){return C(),R("svg",Qkt,Jkt)}const tLt=dn(jkt,[["render",eLt]]),nLt={},sLt={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"},iLt=c("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),rLt=c("line",{x1:"5",y1:"12",x2:"19",y2:"12"},null,-1),oLt=c("line",{x1:"5",y1:"12",x2:"11",y2:"18"},null,-1),aLt=c("line",{x1:"5",y1:"12",x2:"11",y2:"6"},null,-1),lLt=[iLt,rLt,oLt,aLt];function cLt(n,e){return C(),R("svg",sLt,lLt)}const dLt=dn(nLt,[["render",cLt]]),uLt={},pLt={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"},_Lt=c("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),hLt=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),fLt=c("rect",{x:"9",y:"3",width:"6",height:"4",rx:"2"},null,-1),mLt=[_Lt,hLt,fLt];function gLt(n,e){return C(),R("svg",pLt,mLt)}const bLt=dn(uLt,[["render",gLt]]),ELt={},yLt={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"},vLt=c("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),SLt=c("rect",{x:"8",y:"8",width:"12",height:"12",rx:"2"},null,-1),TLt=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),xLt=[vLt,SLt,TLt];function CLt(n,e){return C(),R("svg",yLt,xLt)}const wLt=dn(ELt,[["render",CLt]]),RLt={},ALt={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"},NLt=c("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),OLt=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),ILt=c("circle",{cx:"12",cy:"14",r:"2"},null,-1),MLt=c("polyline",{points:"14 4 14 8 8 8 8 4"},null,-1),DLt=[NLt,OLt,ILt,MLt];function kLt(n,e){return C(),R("svg",ALt,DLt)}const LLt=dn(RLt,[["render",kLt]]),PLt={},ULt={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"},FLt=gu('',6),BLt=[FLt];function GLt(n,e){return C(),R("svg",ULt,BLt)}const VLt=dn(PLt,[["render",GLt]]),zLt=cn({props:{command:{type:String,required:!0},title:{type:String,required:!0},icon:{type:Object,required:!1,default:void 0}},setup(){const{viewModel:n}=ys();return{viewModel:n}}}),HLt=["disabled","title"];function qLt(n,e,t,s,i,r){return C(),R("button",{class:"baklava-toolbar-entry baklava-toolbar-button",disabled:!n.viewModel.commandHandler.canExecuteCommand(n.command),title:n.title,onClick:e[0]||(e[0]=o=>n.viewModel.commandHandler.executeCommand(n.command))},[n.icon?(C(),St(hu(n.icon),{key:0})):(C(),R(ze,{key:1},[Xe(se(n.title),1)],64))],8,HLt)}const YLt=dn(zLt,[["render",qLt]]),$Lt=cn({components:{ToolbarButton:YLt},setup(){const{viewModel:n}=ys();return{isSubgraph:Je(()=>n.value.displayedGraph!==n.value.editor.graph),commands:[{command:Zg,title:"Copy",icon:wLt},{command:Jg,title:"Paste",icon:bLt},{command:Qg,title:"Undo",icon:Kkt},{command:Xg,title:"Redo",icon:tLt},{command:lI,title:"Create Subgraph",icon:VLt}],subgraphCommands:[{command:zl,title:"Save Subgraph",icon:LLt},{command:cI,title:"Back to Main Graph",icon:dLt}]}}}),WLt={class:"baklava-toolbar"};function KLt(n,e,t,s,i,r){const o=dt("toolbar-button");return C(),R("div",WLt,[(C(!0),R(ze,null,st(n.commands,a=>(C(),St(o,{key:a.command,command:a.command,title:a.title,icon:a.icon},null,8,["command","title","icon"]))),128)),n.isSubgraph?(C(!0),R(ze,{key:0},st(n.subgraphCommands,a=>(C(),St(o,{key:a.command,command:a.command,title:a.title,icon:a.icon},null,8,["command","title","icon"]))),128)):G("",!0)])}const jLt=dn($Lt,[["render",KLt]]),QLt={class:"connections-container"},XLt=cn({__name:"Editor",props:{viewModel:{}},setup(n){const e=n,t=Symbol("EditorToken"),s=Cd(e,"viewModel");Y2t(s);const i=lt(null);zo("editorEl",i);const r=Je(()=>e.viewModel.displayedGraph.nodes),o=Je(()=>e.viewModel.displayedGraph.nodes.map(A=>QO(Cd(A,"position")))),a=Je(()=>e.viewModel.displayedGraph.connections),l=Je(()=>e.viewModel.displayedGraph.selectedNodes),u=$2t(),d=W2t(),h=K2t(s),f=Je(()=>({...u.styles.value})),_=lt(0);e.viewModel.editor.hooks.load.subscribe(t,A=>(_.value++,A));const m=A=>{u.onPointerMove(A),d.onMouseMove(A)},E=A=>{A.button===0&&(A.target===i.value&&(S(),u.onPointerDown(A)),d.onMouseDown())},b=A=>{u.onPointerUp(A),d.onMouseUp()},g=A=>{A.key==="Tab"&&A.preventDefault(),e.viewModel.commandHandler.handleKeyDown(A)},y=A=>{e.viewModel.commandHandler.handleKeyUp(A)},v=A=>{["Control","Shift"].some(D=>e.viewModel.commandHandler.pressedKeys.includes(D))||S(),e.viewModel.displayedGraph.selectedNodes.push(A)},S=()=>{e.viewModel.displayedGraph.selectedNodes=[]},w=A=>{for(const D of e.viewModel.displayedGraph.selectedNodes){const T=r.value.indexOf(D),O=o.value[T];O.onPointerDown(A),document.addEventListener("pointermove",O.onPointerMove)}document.addEventListener("pointerup",x)},x=()=>{for(const A of e.viewModel.displayedGraph.selectedNodes){const D=r.value.indexOf(A),T=o.value[D];T.onPointerUp(),document.removeEventListener("pointermove",T.onPointerMove)}document.removeEventListener("pointerup",x)};return(A,D)=>(C(),R("div",{ref_key:"el",ref:i,tabindex:"-1",class:Fe(["baklava-editor",{"baklava-ignore-mouse":!!mt(d).temporaryConnection.value||mt(u).dragging.value,"--temporary-connection":!!mt(d).temporaryConnection.value}]),onPointermove:ae(m,["self"]),onPointerdown:E,onPointerup:b,onWheel:D[1]||(D[1]=ae((...T)=>mt(u).onMouseWheel&&mt(u).onMouseWheel(...T),["self"])),onKeydown:g,onKeyup:y,onContextmenu:D[2]||(D[2]=ae((...T)=>mt(h).open&&mt(h).open(...T),["self","prevent"]))},[An(A.$slots,"background",{},()=>[_e(X2t)]),An(A.$slots,"toolbar",{},()=>[_e(jLt)]),An(A.$slots,"palette",{},()=>[_e(JDt)]),(C(),R("svg",QLt,[(C(!0),R(ze,null,st(a.value,T=>(C(),R("g",{key:T.id+_.value.toString()},[An(A.$slots,"connection",{connection:T},()=>[_e(LDt,{connection:T},null,8,["connection"])])]))),128)),An(A.$slots,"temporaryConnection",{temporaryConnection:mt(d).temporaryConnection.value},()=>[mt(d).temporaryConnection.value?(C(),St(FDt,{key:0,connection:mt(d).temporaryConnection.value},null,8,["connection"])):G("",!0)])])),c("div",{class:"node-container",style:jt(f.value)},[_e(Qs,{name:"fade"},{default:qe(()=>[(C(!0),R(ze,null,st(r.value,(T,O)=>An(A.$slots,"node",{key:T.id+_.value.toString(),node:T,selected:l.value.includes(T),dragging:o.value[O].dragging.value,onSelect:F=>v(T),onStartDrag:w},()=>[_e(ADt,{node:T,selected:l.value.includes(T),dragging:o.value[O].dragging.value,onSelect:F=>v(T),onStartDrag:w},null,8,["node","selected","dragging","onSelect"])])),128))]),_:3})],4),An(A.$slots,"sidebar",{},()=>[_e(HDt)]),An(A.$slots,"minimap",{},()=>[A.viewModel.settings.enableMinimap?(C(),St(qDt,{key:0})):G("",!0)]),An(A.$slots,"contextMenu",{contextMenu:mt(h)},()=>[A.viewModel.settings.contextMenu.enabled?(C(),St(VE,{key:0,modelValue:mt(h).show.value,"onUpdate:modelValue":D[0]||(D[0]=T=>mt(h).show.value=T),items:mt(h).items.value,x:mt(h).x.value,y:mt(h).y.value,onClick:mt(h).onClick},null,8,["modelValue","items","x","y","onClick"])):G("",!0)])],34))}}),ZLt=["INPUT","TEXTAREA","SELECT"];function JLt(n){const e=lt([]),t=lt([]);return{pressedKeys:e,handleKeyDown:o=>{var a;e.value.includes(o.key)||e.value.push(o.key),!ZLt.includes(((a=document.activeElement)==null?void 0:a.tagName)??"")&&t.value.forEach(l=>{l.keys.every(u=>e.value.includes(u))&&n(l.commandName)})},handleKeyUp:o=>{const a=e.value.indexOf(o.key);a>=0&&e.value.splice(a,1)},registerHotkey:(o,a)=>{t.value.push({keys:o,commandName:a})}}}const ePt=()=>{const n=lt(new Map),e=(r,o)=>{if(n.value.has(r))throw new Error(`Command "${r}" already exists`);n.value.set(r,o)},t=(r,o=!1,...a)=>{if(!n.value.has(r)){if(o)throw new Error(`[CommandHandler] Command ${r} not registered`);return}return n.value.get(r).execute(...a)},s=(r,o=!1,...a)=>{if(!n.value.has(r)){if(o)throw new Error(`[CommandHandler] Command ${r} not registered`);return!1}return n.value.get(r).canExecute(a)},i=JLt(t);return Wn({registerCommand:e,executeCommand:t,canExecuteCommand:s,...i})},tPt=n=>!(n instanceof tc);function nPt(n,e){return{switchGraph:s=>{let i;if(tPt(s))i=new tc(n.value),s.createGraph(i);else{if(s!==n.value.graph)throw new Error("Can only switch using 'Graph' instance when it is the root graph. Otherwise a 'GraphTemplate' must be used.");i=s}e.value&&e.value!==n.value.graph&&e.value.destroy(),i.panning=i.panning??s.panning??{x:0,y:0},i.scaling=i.scaling??s.scaling??1,i.selectedNodes=i.selectedNodes??[],i.sidebar=i.sidebar??{visible:!1,nodeId:"",optionName:""},e.value=i}}}function sPt(n,e){n.position=n.position??{x:0,y:0},n.disablePointerEvents=!1,n.twoColumn=n.twoColumn??!1,n.width=n.width??e.defaultWidth}const iPt=()=>({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 rPt(n){const e=lt(n??new B2t),t=Symbol("ViewModelToken"),s=lt(null),i=fM(s),{switchGraph:r}=nPt(e,s),o=Je(()=>i.value&&i.value!==e.value.graph),a=Wn(iPt()),l=ePt(),u=Pkt(i,l),d=Fkt(i,e,l),h={renderNode:new es(null),renderInterface:new es(null)};return kkt(i,l,r),Vkt(i,l),Fn(e,(f,_)=>{_&&(_.events.registerGraph.unsubscribe(t),_.graphEvents.beforeAddNode.unsubscribe(t),f.nodeHooks.beforeLoad.unsubscribe(t),f.nodeHooks.afterSave.unsubscribe(t),f.graphTemplateHooks.beforeLoad.unsubscribe(t),f.graphTemplateHooks.afterSave.unsubscribe(t),f.graph.hooks.load.unsubscribe(t),f.graph.hooks.save.unsubscribe(t)),f&&(f.nodeHooks.beforeLoad.subscribe(t,(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(t,(m,E)=>(m.position=E.position,m.width=E.width,m.twoColumn=E.twoColumn,m)),f.graphTemplateHooks.beforeLoad.subscribe(t,(m,E)=>(E.panning=m.panning,E.scaling=m.scaling,m)),f.graphTemplateHooks.afterSave.subscribe(t,(m,E)=>(m.panning=E.panning,m.scaling=E.scaling,m)),f.graph.hooks.load.subscribe(t,(m,E)=>(E.panning=m.panning,E.scaling=m.scaling,m)),f.graph.hooks.save.subscribe(t,(m,E)=>(m.panning=E.panning,m.scaling=E.scaling,m)),f.graphEvents.beforeAddNode.subscribe(t,m=>sPt(m,{defaultWidth:a.nodes.defaultWidth})),e.value.registerNodeType(oI,{category:"Subgraphs"}),e.value.registerNodeType(aI,{category:"Subgraphs"}),r(f.graph))},{immediate:!0}),Wn({editor:e,displayedGraph:i,isSubgraph:o,settings:a,commandHandler:l,history:u,clipboard:d,hooks:h,switchGraph:r})}const oPt=Ua({type:"PersonalityNode",title:"Personality",inputs:{request:()=>new Xt("Request",""),agent_name:()=>new vkt("Personality","",tu.state.config.personalities).setPort(!1)},outputs:{response:()=>new Xt("Response","")},async calculate({request:n}){console.log(tu.state.config.personalities);let e="";try{e=(await de.post("/generate",{params:{text:n}})).data}catch(t){console.error(t)}return{display:e,response:e}}}),aPt=Ua({type:"RAGNode",title:"RAG",inputs:{request:()=>new Xt("Prompt",""),document_path:()=>new nc("Document path","").setPort(!1)},outputs:{prompt:()=>new Xt("Prompt with Data","")},async calculate({request:n,document_path:e}){let t="";try{t=(await de.get("/rag",{params:{text:n,doc_path:e}})).data}catch(s){console.error(s)}return{response:t}}}),ow=Ua({type:"Task",title:"Task",inputs:{description:()=>new nc("Task description","").setPort(!1)},outputs:{prompt:()=>new Xt("Prompt")},calculate({description:n}){return{prompt:n}}}),aw=Ua({type:"TextDisplayNode",title:"TextDisplay",inputs:{text2display:()=>new Xt("Input","")},outputs:{response:()=>new Ckt("Text","")},async calculate({request:n}){}}),lw=Ua({type:"LLMNode",title:"LLM",inputs:{request:()=>new Xt("Request","")},outputs:{response:()=>new Xt("Response","")},async calculate({request:n}){console.log(tu.state.config.personalities);let e="";try{e=(await de.post("/generate",{params:{text:n}})).data}catch(t){console.error(t)}return{display:e,response:e}}}),lPt=Ua({type:"MultichoiceNode",title:"Multichoice",inputs:{question:()=>new Xt("Question",""),outputs:()=>new nc("choices, one per line","","").setPort(!1)},outputs:{response:()=>new Xt("Response","")}}),cPt=cn({components:{"baklava-editor":XLt},setup(){const n=rPt(),e=new q2t(n.editor);n.editor.registerNodeType(oPt),n.editor.registerNodeType(ow),n.editor.registerNodeType(aPt),n.editor.registerNodeType(aw),n.editor.registerNodeType(lw),n.editor.registerNodeType(lPt);const t=Symbol();e.events.afterRun.subscribe(t,a=>{e.pause(),G2t(a,n.editor),e.resume()}),e.start();function s(a,l,u){const d=new a;return n.displayedGraph.addNode(d),d.position.x=l,d.position.y=u,d}const i=s(ow,300,140),r=s(lw,550,140),o=s(aw,850,140);return n.displayedGraph.addConnection(i.outputs.prompt,r.inputs.request),n.displayedGraph.addConnection(r.outputs.response,o.inputs.text2display),{baklava:n,saveGraph:()=>{const a=e.export();localStorage.setItem("myGraph",JSON.stringify(a))},loadGraph:()=>{const a=JSON.parse(localStorage.getItem("myGraph"));e.import(a)}}}}),dPt={style:{width:"100vw",height:"100vh"}};function uPt(n,e,t,s,i,r){const o=dt("baklava-editor");return C(),R("div",dPt,[_e(o,{"view-model":n.baklava},null,8,["view-model"]),c("button",{onClick:e[0]||(e[0]=(...a)=>n.saveGraph&&n.saveGraph(...a))},"Save Graph"),c("button",{onClick:e[1]||(e[1]=(...a)=>n.loadGraph&&n.loadGraph(...a))},"Load Graph")])}const pPt=pt(cPt,[["render",uPt]]),_Pt={},hPt={style:{width:"100vw",height:"100vh"}},fPt=["src"];function mPt(n,e,t,s,i,r){return C(),R("div",hPt,[c("iframe",{src:n.$store.state.config.comfyui_base_url,class:"m-0 p-0 w-full h-full"},null,8,fPt)])}const gPt=pt(_Pt,[["render",mPt]]),bPt={},EPt={style:{width:"100vw",height:"100vh"}},yPt=["src"];function vPt(n,e,t,s,i,r){return C(),R("div",EPt,[c("iframe",{src:n.$store.state.config.sd_base_url,class:"m-0 p-0 w-full h-full"},null,8,yPt)])}const SPt=pt(bPt,[["render",vPt]]),TPt=eP({history:bL("/"),routes:[{path:"/auto_sd_view/",name:"AutoSD",component:SPt},{path:"/autosd_view/",name:"ComfyUI",component:gPt},{path:"/playground/",name:"playground",component:_et},{path:"/extensions/",name:"extensions",component:Cet},{path:"/help_view/",name:"help_view",component:Iet},{path:"/settings/",name:"settings",component:wgt},{path:"/training/",name:"training",component:Wgt},{path:"/quantizing/",name:"quantizing",component:nbt},{path:"/",name:"discussions",component:g1t},{path:"/",name:"interactive",component:M2t},{path:"/",name:"nodes",component:pPt}]});const ju=oD(fXe);console.log("Loaded main.js");function xPt(n){const e={};for(const t in n)n.hasOwnProperty(t)&&(e[t]=n[t]);return e}const tu=MD({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(n,e){n.is_rt_on=e},setLanguages(n,e){n.languages=e},setLanguage(n,e){n.language=e},setIsReady(n,e){n.ready=e},setIsConnected(n,e){n.isConnected=e},setIsModelOk(n,e){n.isModelOk=e},setIsGenerating(n,e){n.isGenerating=e},setConfig(n,e){n.config=e},setPersonalities(n,e){n.personalities=e},setMountedPers(n,e){n.mountedPers=e},setMountedPersArr(n,e){n.mountedPersArr=e},setbindingsZoo(n,e){n.bindingsZoo=e},setModelsArr(n,e){n.modelsArr=e},setselectedModel(n,e){n.selectedModel=e},setDiskUsage(n,e){n.diskUsage=e},setRamUsage(n,e){n.ramUsage=e},setVramUsage(n,e){n.vramUsage=e},setModelsZoo(n,e){n.modelsZoo=e},setCurrentBinding(n,e){n.currentBinding=e},setCurrentModel(n,e){n.currentModel=e},setDatabases(n,e){n.databases=e},setTheme(n){this.currentTheme=n}},getters:{getisRTOn(n){return n.is_rt_on},getLanguages(n){return n.languages},getLanguage(n){return n.language},getIsConnected(n){return n.isConnected},getIsModelOk(n){return n.isModelOk},getIsGenerating(n){return n.isGenerating},getConfig(n){return n.config},getPersonalities(n){return n.personalities},getMountedPersArr(n){return n.mountedPersArr},getMountedPers(n){return n.mountedPers},getbindingsZoo(n){return n.bindingsZoo},getModelsArr(n){return n.modelsArr},getDiskUsage(n){return n.diskUsage},getRamUsage(n){return n.ramUsage},getVramUsage(n){return n.vramUsage},getDatabasesList(n){return n.databases},getModelsZoo(n){return n.modelsZoo},getCyrrentBinding(n){return n.currentBinding},getCurrentModel(n){return n.currentModel}},actions:{async getVersion(){try{let n=await de.get("/get_lollms_webui_version",{});n&&(this.state.version=n.data,console.log("version res:",n),console.log("version :",this.state.version))}catch{console.log("Coudln't get version")}},async refreshConfig({commit:n}){console.log("Fetching configuration");try{console.log("Fetching configuration with client id: ",this.state.client_id);const e=await pI("get_config",this.state.client_id);e.active_personality_id<0&&(e.active_personality_id=0);let t=e.personalities[e.active_personality_id].split("/");e.personality_category=t[0],e.personality_folder=t[1],console.log("Recovered config"),console.log(e),console.log("Committing config"),console.log(e),console.log(this.state.config),n("setConfig",e)}catch(e){console.log(e.message,"refreshConfig")}},async refreshDatabase({commit:n}){let e=await Bs("list_databases");console.log("databases:",e),n("setDatabases",e)},async fetchisRTOn({commit:n}){const t=(await de.get("/is_rt_on")).data.status;n("setisRTOn",t)},async fetchLanguages({commit:n}){console.log("get_personality_languages_list",this.state.client_id);const e=await de.post("/get_personality_languages_list",{client_id:this.state.client_id});console.log("response",e);const t=e.data;console.log("languages",t),n("setLanguages",t)},async fetchLanguage({commit:n}){console.log("get_personality_language",this.state.client_id);const e=await de.post("/get_personality_language",{client_id:this.state.client_id});console.log("response",e);const t=e.data;console.log("language",t),n("setLanguage",t)},async changeLanguage({commit:n},e){console.log("Changing language to ",e);let t=await de.post("/set_personality_language",{client_id:this.state.client_id,language:e});console.log("get_personality_languages_list",this.state.client_id),t=await de.post("/get_personality_languages_list",{client_id:this.state.client_id}),console.log("response",t);const s=t.data;console.log("languages",s),n("setLanguages",s),t=await de.post("/get_personality_language",{client_id:this.state.client_id}),console.log("response",t);const i=t.data;console.log("language",i),n("setLanguage",i),console.log("Language changed successfully:",t.data.message)},async deleteLanguage({commit:n},e){console.log("Deleting ",e);let t=await de.post("/del_personality_language",{client_id:this.state.client_id,language:e});console.log("get_personality_languages_list",this.state.client_id),t=await de.post("/get_personality_languages_list",{client_id:this.state.client_id}),console.log("response",t);const s=t.data;console.log("languages",s),n("setLanguages",s),t=await de.post("/get_personality_language",{client_id:this.state.client_id}),console.log("response",t);const i=t.data;console.log("language",i),n("setLanguage",i),console.log("Language changed successfully:",t.data.message)},async refreshPersonalitiesZoo({commit:n}){let e=[];const t=await Bs("get_all_personalities"),s=Object.keys(t);console.log("Personalities recovered:"+this.state.config.personalities);for(let i=0;i{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((i,r)=>i.name.localeCompare(r.name)),n("setPersonalities",e),console.log("Done loading personalities")},refreshMountedPersonalities({commit:n}){this.state.config.active_personality_id<0&&(this.state.config.active_personality_id=0);let e=[];const t=[];for(let s=0;sa.full_path==i||a.full_path==r[0]);if(o>=0){let a=xPt(this.state.personalities[o]);r.length>1&&(a.language=r[1]),a?e.push(a):e.push(this.state.personalities[this.state.personalities.findIndex(l=>l.full_path=="generic/lollms")])}else t.push(s),console.log("Couldn't load personality : ",i)}for(let s=t.length-1;s>=0;s--)console.log("Removing personality : ",this.state.config.personalities[t[s]]),this.state.config.personalities.splice(t[s],1),this.state.config.active_personality_id>t[s]&&(this.state.config.active_personality_id-=1);n("setMountedPersArr",e),this.state.mountedPers=this.state.personalities[this.state.personalities.findIndex(s=>s.full_path==this.state.config.personalities[this.state.config.active_personality_id]||s.full_path+":"+s.language==this.state.config.personalities[this.state.config.active_personality_id])]},async refreshBindings({commit:n}){let e=await Bs("list_bindings");console.log("Loaded bindings zoo :",e),this.state.installedBindings=e.filter(s=>s.installed),console.log("Loaded bindings zoo ",this.state.installedBindings),n("setbindingsZoo",e);const t=e.findIndex(s=>s.name==this.state.config.binding_name);t!=-1&&n("setCurrentBinding",e[t])},async refreshModelsZoo({commit:n}){console.log("Fetching models");const t=(await de.get("/get_available_models")).data.filter(s=>s.variants&&s.variants.length>0);console.log(`get_available_models: ${t}`),n("setModelsZoo",t)},async refreshModelStatus({commit:n}){let e=await Bs("get_model_status");n("setIsModelOk",e.status)},async refreshModels({commit:n}){console.log("Fetching models");let e=await Bs("list_models");console.log(`Found ${e}`);let t=await Bs("get_active_model");console.log("Selected model ",t),t!=null&&n("setselectedModel",t.model),n("setModelsArr",e),console.log("setModelsArr",e),console.log("this.state.modelsZoo",this.state.modelsZoo),this.state.modelsZoo.map(i=>{i.isInstalled=e.includes(i.name)}),this.state.installedModels=this.state.modelsZoo.filter(i=>i.isInstalled);const s=this.state.modelsZoo.findIndex(i=>i.name==this.state.config.model_name);s!=-1&&n("setCurrentModel",this.state.modelsZoo[s])},async refreshDiskUsage({commit:n}){this.state.diskUsage=await Bs("disk_usage")},async refreshRamUsage({commit:n}){this.state.ramUsage=await Bs("ram_usage")},async refreshVramUsage({commit:n}){const e=await Bs("vram_usage"),t=[];if(e.nb_gpus>0){for(let i=0;i!!t.value),onPointerDown:l=>{t.value={x:l.pageX,y:l.pageY},s.value={x:n.value.x,y:n.value.y}},onPointerMove:l=>{if(t.value){const u=l.pageX-t.value.x,d=l.pageY-t.value.y;n.value.x=s.value.x+u/e.value.scaling,n.value.y=s.value.y+d/e.value.scaling}},onPointerUp:()=>{t.value=null,s.value=null}}}function XO(n,e,t){if(!e.template)return!1;if(Ea(e.template)===t)return!0;const s=n.graphTemplates.find(r=>Ea(r)===t);return s?s.nodes.filter(r=>r.type.startsWith(Vl)).some(r=>XO(n,e,r.type)):!1}function ZO(n){return Je(()=>{const e=Array.from(n.value.editor.nodeTypes.entries()),t=new Set(e.map(([,i])=>i.category)),s=[];for(const i of t.values()){let r=e.filter(([,o])=>o.category===i);n.value.displayedGraph.template?r=r.filter(([o])=>!XO(n.value.editor,n.value.displayedGraph,o)):r=r.filter(([o])=>![ga,ba].includes(o)),r.length>0&&s.push({name:i,nodeTypes:Object.fromEntries(r)})}return s.sort((i,r)=>i.name==="default"?-1:r.name==="default"||i.name>r.name?1:-1),s})}function JO(){const{graph:n}=Fs();return{transform:(t,s)=>{const i=t/n.value.scaling-n.value.panning.x,r=s/n.value.scaling-n.value.panning.y;return[i,r]}}}function W2t(){const{graph:n}=Fs();let e=[],t=-1,s={x:0,y:0};const i=Je(()=>n.value.panning),r=QO(i),o=Je(()=>({"transform-origin":"0 0",transform:`scale(${n.value.scaling}) translate(${n.value.panning.x}px, ${n.value.panning.y}px)`})),a=(_,m,E)=>{const b=[_/n.value.scaling-n.value.panning.x,m/n.value.scaling-n.value.panning.y],g=[_/E-n.value.panning.x,m/E-n.value.panning.y],y=[g[0]-b[0],g[1]-b[1]];n.value.panning.x+=y[0],n.value.panning.y+=y[1],n.value.scaling=E},l=_=>{_.preventDefault();let m=_.deltaY;_.deltaMode===1&&(m*=32);const E=n.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();s={x:m+(b-m)/2,y:E+(g-E)/2}}},onPointerMove:_=>{for(let m=0;m0){const w=n.value.scaling*(1+(S-t)/500);a(s.x,s.y,w)}t=S}else r.onPointerMove(_)},onPointerUp:_=>{e=e.filter(m=>m.pointerId!==_.pointerId),t=-1,r.onPointerUp()},onMouseWheel:l}}var ds=(n=>(n[n.NONE=0]="NONE",n[n.ALLOWED=1]="ALLOWED",n[n.FORBIDDEN=2]="FORBIDDEN",n))(ds||{});const eI=Symbol();function K2t(){const{graph:n}=Fs(),e=lt(null),t=lt(null),s=a=>{e.value&&(e.value.mx=a.offsetX/n.value.scaling-n.value.panning.x,e.value.my=a.offsetY/n.value.scaling-n.value.panning.y)},i=()=>{if(t.value){if(e.value)return;const a=n.value.connections.find(l=>l.to===t.value);t.value.isInput&&a?(e.value={status:ds.NONE,from:a.from},n.value.removeConnection(a)):e.value={status:ds.NONE,from:t.value},e.value.mx=void 0,e.value.my=void 0}},r=()=>{if(e.value&&t.value){if(e.value.from===t.value)return;n.value.addConnection(e.value.from,e.value.to)}e.value=null},o=a=>{if(t.value=a??null,a&&e.value){e.value.to=a;const l=n.value.checkConnection(e.value.from,e.value.to);if(e.value.status=l.connectionAllowed?ds.ALLOWED:ds.FORBIDDEN,l.connectionAllowed){const u=l.connectionsInDanger.map(d=>d.id);n.value.connections.forEach(d=>{u.includes(d.id)&&(d.isInDanger=!0)})}}else!a&&e.value&&(e.value.to=void 0,e.value.status=ds.NONE,n.value.connections.forEach(l=>{l.isInDanger=!1}))};return zo(eI,{temporaryConnection:e,hoveredOver:o}),{temporaryConnection:e,onMouseMove:s,onMouseDown:i,onMouseUp:r,hoveredOver:o}}function j2t(n){const e=lt(!1),t=lt(0),s=lt(0),i=ZO(n),{transform:r}=JO(),o=Je(()=>{let d=[];const h={};for(const _ of i.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=Je(()=>n.value.settings.contextMenu.additionalItems.length===0?o.value:[{label:"Add node",submenu:o.value},...n.value.settings.contextMenu.additionalItems.map(d=>"isDivider"in d||"submenu"in d?d:{label:d.label,value:"command:"+d.command,disabled:!n.value.commandHandler.canExecuteCommand(d.command)})]);function l(d){e.value=!0,t.value=d.offsetX,s.value=d.offsetY}function u(d){if(d.startsWith("addNode:")){const h=d.substring(8),f=n.value.editor.nodeTypes.get(h);if(!f)return;const _=Wn(new f.type);n.value.displayedGraph.addNode(_);const[m,E]=r(t.value,s.value);_.position.x=m,_.position.y=E}else if(d.startsWith("command:")){const h=d.substring(8);n.value.commandHandler.canExecuteCommand(h)&&n.value.commandHandler.executeCommand(h)}}return{show:e,x:t,y:s,items:a,open:l,onClick:u}}const Q2t=cn({setup(){const{viewModel:n}=ys(),{graph:e}=Fs();return{styles:Je(()=>{const s=n.value.settings.background,i=e.value.panning.x*e.value.scaling,r=e.value.panning.y*e.value.scaling,o=e.value.scaling*s.gridSize,a=o/s.gridDivision,l=`${o}px ${o}px, ${o}px ${o}px`,u=e.value.scaling>s.subGridVisibleThreshold?`, ${a}px ${a}px, ${a}px ${a}px`:"";return{backgroundPosition:`left ${i}px top ${r}px`,backgroundSize:`${l} ${u}`}})}}}),dn=(n,e)=>{const t=n.__vccOpts||n;for(const[s,i]of e)t[s]=i;return t};function X2t(n,e,t,s,i,r){return C(),R("div",{class:"background",style:jt(n.styles)},null,4)}const Z2t=dn(Q2t,[["render",X2t]]);function J2t(n){return fw()?(GI(n),!0):!1}function BE(n){return typeof n=="function"?n():mt(n)}const tI=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const eDt=Object.prototype.toString,tDt=n=>eDt.call(n)==="[object Object]",yd=()=>{},nDt=sDt();function sDt(){var n,e;return tI&&((n=window==null?void 0:window.navigator)==null?void 0:n.userAgent)&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||((e=window==null?void 0:window.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function iDt(n,e,t=!1){return e.reduce((s,i)=>(i in n&&(!t||n[i]!==void 0)&&(s[i]=n[i]),s),{})}function rDt(n,e={}){if(!un(n))return vM(n);const t=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const s in n.value)t[s]=yM(()=>({get(){return n.value[s]},set(i){var r;if((r=BE(e.replaceRef))!=null?r:!0)if(Array.isArray(n.value)){const a=[...n.value];a[s]=i,n.value=a}else{const a={...n.value,[s]:i};Object.setPrototypeOf(a,Object.getPrototypeOf(n.value)),n.value=a}else n.value[s]=i}}));return t}function al(n){var e;const t=BE(n);return(e=t==null?void 0:t.$el)!=null?e:t}const GE=tI?window:void 0;function yl(...n){let e,t,s,i;if(typeof n[0]=="string"||Array.isArray(n[0])?([t,s,i]=n,e=GE):[e,t,s,i]=n,!e)return yd;Array.isArray(t)||(t=[t]),Array.isArray(s)||(s=[s]);const r=[],o=()=>{r.forEach(d=>d()),r.length=0},a=(d,h,f,_)=>(d.addEventListener(h,f,_),()=>d.removeEventListener(h,f,_)),l=Fn(()=>[al(e),BE(i)],([d,h])=>{if(o(),!d)return;const f=tDt(h)?{...h}:h;r.push(...t.flatMap(_=>s.map(m=>a(d,_,m,f))))},{immediate:!0,flush:"post"}),u=()=>{l(),o()};return J2t(u),u}let Z1=!1;function nI(n,e,t={}){const{window:s=GE,ignore:i=[],capture:r=!0,detectIframe:o=!1}=t;if(!s)return yd;nDt&&!Z1&&(Z1=!0,Array.from(s.document.body.children).forEach(f=>f.addEventListener("click",yd)),s.document.documentElement.addEventListener("click",yd));let a=!0;const l=f=>i.some(_=>{if(typeof _=="string")return Array.from(s.document.querySelectorAll(_)).some(m=>m===f.target||f.composedPath().includes(m));{const m=al(_);return m&&(f.target===m||f.composedPath().includes(m))}}),d=[yl(s,"click",f=>{const _=al(n);if(!(!_||_===f.target||f.composedPath().includes(_))){if(f.detail===0&&(a=!l(f)),!a){a=!0;return}e(f)}},{passive:!0,capture:r}),yl(s,"pointerdown",f=>{const _=al(n);a=!l(f)&&!!(_&&!f.composedPath().includes(_))},{passive:!0}),o&&yl(s,"blur",f=>{setTimeout(()=>{var _;const m=al(n);((_=s.document.activeElement)==null?void 0:_.tagName)==="IFRAME"&&!(m!=null&&m.contains(s.document.activeElement))&&e(f)},0)})].filter(Boolean);return()=>d.forEach(f=>f())}const sI={x:0,y:0,pointerId:0,pressure:0,tiltX:0,tiltY:0,width:0,height:0,twist:0,pointerType:null},oDt=Object.keys(sI);function aDt(n={}){const{target:e=GE}=n,t=lt(!1),s=lt(n.initialValue||{});Object.assign(s.value,sI,s.value);const i=r=>{t.value=!0,!(n.pointerTypes&&!n.pointerTypes.includes(r.pointerType))&&(s.value=iDt(r,oDt,!1))};if(e){const r={passive:!0};yl(e,["pointerdown","pointermove","pointerup"],i,r),yl(e,"pointerleave",()=>t.value=!1,r)}return{...rDt(s),isInside:t}}const lDt=["onMouseenter","onMouseleave","onClick"],cDt={class:"flex-fill"},dDt={key:0,class:"__submenu-icon",style:{"line-height":"1em"}},uDt=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),pDt=[uDt],VE=cn({__name:"ContextMenu",props:{modelValue:{type:Boolean},items:{},x:{default:0},y:{default:0},isNested:{type:Boolean,default:!1},isFlipped:{default:()=>({x:!1,y:!1})},flippable:{type:Boolean,default:!1}},emits:["update:modelValue","click"],setup(n,{emit:e}){const t=n,s=e;let i=null;const r=lt(null),o=lt(-1),a=lt(0),l=lt({x:!1,y:!1}),u=Je(()=>t.flippable&&(l.value.x||t.isFlipped.x)),d=Je(()=>t.flippable&&(l.value.y||t.isFlipped.y)),h=Je(()=>{const y={};return t.isNested||(y.top=(d.value?t.y-a.value:t.y)+"px",y.left=t.x+"px"),y}),f=Je(()=>({"--flipped-x":u.value,"--flipped-y":d.value,"--nested":t.isNested})),_=Je(()=>t.items.map(y=>({...y,hover:!1})));Fn([()=>t.y,()=>t.items],()=>{var y,v,S,w;a.value=t.items.length*30;const x=((v=(y=r.value)==null?void 0:y.parentElement)==null?void 0:v.offsetWidth)??0,A=((w=(S=r.value)==null?void 0:S.parentElement)==null?void 0:w.offsetHeight)??0;l.value.x=!t.isNested&&t.x>x*.75,l.value.y=!t.isNested&&t.y+a.value>A-20}),nI(r,()=>{t.modelValue&&s("update:modelValue",!1)});const m=y=>{!y.submenu&&y.value&&(s("click",y.value),s("update:modelValue",!1))},E=y=>{s("click",y),o.value=-1,t.isNested||s("update:modelValue",!1)},b=(y,v)=>{t.items[v].submenu&&(o.value=v,i!==null&&(clearTimeout(i),i=null))},g=(y,v)=>{t.items[v].submenu&&(i=window.setTimeout(()=>{o.value=-1,i=null},200))};return(y,v)=>{const S=dt("ContextMenu",!0);return C(),St(Ms,{name:"slide-fade"},{default:qe(()=>[B(c("div",{ref_key:"el",ref:r,class:Fe(["baklava-context-menu",f.value]),style:jt(h.value)},[(C(!0),R(ze,null,st(_.value,(w,x)=>(C(),R(ze,null,[w.isDivider?(C(),R("div",{key:`d-${x}`,class:"divider"})):(C(),R("div",{key:`i-${x}`,class:Fe(["item",{submenu:!!w.submenu,"--disabled":!!w.disabled}]),onMouseenter:A=>b(A,x),onMouseleave:A=>g(A,x),onClick:ae(A=>m(w),["stop","prevent"])},[c("div",cDt,se(w.label),1),w.submenu?(C(),R("div",dDt,pDt)):G("",!0),w.submenu?(C(),St(S,{key:1,"model-value":o.value===x,items:w.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"])):G("",!0)],42,lDt))],64))),256))],6),[[Ot,y.modelValue]])]),_:1})}}}),_Dt={},hDt={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"},fDt=c("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),mDt=c("circle",{cx:"12",cy:"12",r:"1"},null,-1),gDt=c("circle",{cx:"12",cy:"19",r:"1"},null,-1),bDt=c("circle",{cx:"12",cy:"5",r:"1"},null,-1),EDt=[fDt,mDt,gDt,bDt];function yDt(n,e){return C(),R("svg",hDt,EDt)}const iI=dn(_Dt,[["render",yDt]]),vDt=["id"],SDt={key:0,class:"__tooltip"},TDt={key:2,class:"align-middle"},J1=cn({__name:"NodeInterface",props:{node:{},intf:{}},setup(n){const e=(b,g=100)=>{const y=b!=null&&b.toString?b.toString():"";return y.length>g?y.slice(0,g)+"...":y},t=n,{viewModel:s}=ys(),{hoveredOver:i,temporaryConnection:r}=Is(eI),o=lt(null),a=Je(()=>t.intf.connectionCount>0),l=lt(!1),u=Je(()=>s.value.settings.displayValueOnHover&&l.value),d=Je(()=>({"--input":t.intf.isInput,"--output":!t.intf.isInput,"--connected":a.value})),h=Je(()=>t.intf.component&&(!t.intf.isInput||!t.intf.port||t.intf.connectionCount===0)),f=()=>{l.value=!0,i(t.intf)},_=()=>{l.value=!1,i(void 0)},m=()=>{o.value&&s.value.hooks.renderInterface.execute({intf:t.intf,el:o.value})},E=()=>{const b=s.value.displayedGraph.sidebar;b.nodeId=t.node.id,b.optionName=t.intf.name,b.visible=!0};return Mi(m),ql(m),(b,g)=>{var y;return C(),R("div",{id:b.intf.id,ref_key:"el",ref:o,class:Fe(["baklava-node-interface",d.value])},[b.intf.port?(C(),R("div",{key:0,class:Fe(["__port",{"--selected":((y=mt(r))==null?void 0:y.from)===b.intf}]),onPointerover:f,onPointerout:_},[An(b.$slots,"portTooltip",{showTooltip:u.value},()=>[u.value===!0?(C(),R("span",SDt,se(e(b.intf.value)),1)):G("",!0)])],34)):G("",!0),h.value?(C(),St(hu(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"])):(C(),R("span",TDt,se(b.intf.name),1))],10,vDt)}}}),xDt=["id","data-node-type"],CDt={class:"__title-label"},wDt={class:"__menu"},RDt={class:"__outputs"},ADt={class:"__inputs"},NDt=cn({__name:"Node",props:{node:{},selected:{type:Boolean,default:!1},dragging:{type:Boolean}},emits:["select","start-drag"],setup(n,{emit:e}){const t=n,s=e,{viewModel:i}=ys(),{graph:r,switchGraph:o}=Fs(),a=lt(null),l=lt(!1),u=lt(""),d=lt(null),h=lt(!1),f=lt(!1),_=Je(()=>{const F=[{value:"rename",label:"Rename"},{value:"delete",label:"Delete"}];return t.node.type.startsWith(Vl)&&F.push({value:"editSubgraph",label:"Edit Subgraph"}),F}),m=Je(()=>({"--selected":t.selected,"--dragging":t.dragging,"--two-column":!!t.node.twoColumn})),E=Je(()=>{var F,z;return{top:`${((F=t.node.position)==null?void 0:F.y)??0}px`,left:`${((z=t.node.position)==null?void 0:z.x)??0}px`,"--width":`${t.node.width??i.value.settings.nodes.defaultWidth}px`}}),b=Je(()=>Object.values(t.node.inputs).filter(F=>!F.hidden)),g=Je(()=>Object.values(t.node.outputs).filter(F=>!F.hidden)),y=()=>{s("select")},v=F=>{t.selected||y(),s("start-drag",F)},S=()=>{f.value=!0},w=async F=>{var z;switch(F){case"delete":r.value.removeNode(t.node);break;case"rename":u.value=t.node.title,l.value=!0,await Ue(),(z=d.value)==null||z.focus();break;case"editSubgraph":o(t.node.template);break}},x=()=>{t.node.title=u.value,l.value=!1},A=()=>{a.value&&i.value.hooks.renderNode.execute({node:t.node,el:a.value})},D=F=>{h.value=!0,F.preventDefault()},T=F=>{if(!h.value)return;const z=t.node.width+F.movementX/r.value.scaling,Z=i.value.settings.nodes.minWidth,M=i.value.settings.nodes.maxWidth;t.node.width=Math.max(Z,Math.min(M,z))},O=()=>{h.value=!1};return Mi(()=>{A(),window.addEventListener("mousemove",T),window.addEventListener("mouseup",O)}),ql(A),Ca(()=>{window.removeEventListener("mousemove",T),window.removeEventListener("mouseup",O)}),(F,z)=>(C(),R("div",{id:F.node.id,ref_key:"el",ref:a,class:Fe(["baklava-node",m.value]),style:jt(E.value),"data-node-type":F.node.type,onPointerdown:y},[mt(i).settings.nodes.resizable?(C(),R("div",{key:0,class:"__resize-handle",onMousedown:D},null,32)):G("",!0),An(F.$slots,"title",{},()=>[c("div",{class:"__title",onPointerdown:ae(v,["self","stop"])},[l.value?B((C(),R("input",{key:1,ref_key:"renameInputEl",ref:d,"onUpdate:modelValue":z[1]||(z[1]=Z=>u.value=Z),type:"text",class:"baklava-input",placeholder:"Node Name",onBlur:x,onKeydown:Ai(x,["enter"])},null,544)),[[he,u.value]]):(C(),R(ze,{key:0},[c("div",CDt,se(F.node.title),1),c("div",wDt,[_e(iI,{class:"--clickable",onClick:S}),_e(VE,{modelValue:f.value,"onUpdate:modelValue":z[0]||(z[0]=Z=>f.value=Z),x:0,y:0,items:_.value,onClick:w},null,8,["modelValue","items"])])],64))],32)]),An(F.$slots,"content",{},()=>[c("div",{class:"__content",onKeydown:z[2]||(z[2]=Ai(ae(()=>{},["stop"]),["delete"]))},[c("div",RDt,[(C(!0),R(ze,null,st(g.value,Z=>An(F.$slots,"nodeInterface",{key:Z.id,type:"output",node:F.node,intf:Z},()=>[_e(J1,{node:F.node,intf:Z},null,8,["node","intf"])])),128))]),c("div",ADt,[(C(!0),R(ze,null,st(b.value,Z=>An(F.$slots,"nodeInterface",{key:Z.id,type:"input",node:F.node,intf:Z},()=>[_e(J1,{node:F.node,intf:Z},null,8,["node","intf"])])),128))])],32)])],46,xDt))}}),ODt=cn({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:ds.NONE},isTemporary:{type:Boolean,default:!1}},setup(n){const{viewModel:e}=ys(),{graph:t}=Fs(),s=(o,a)=>{const l=(o+t.value.panning.x)*t.value.scaling,u=(a+t.value.panning.y)*t.value.scaling;return[l,u]},i=Je(()=>{const[o,a]=s(n.x1,n.y1),[l,u]=s(n.x2,n.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=Je(()=>({"--temporary":n.isTemporary,"--allowed":n.state===ds.ALLOWED,"--forbidden":n.state===ds.FORBIDDEN}));return{d:i,classes:r}}}),IDt=["d"];function MDt(n,e,t,s,i,r){return C(),R("path",{class:Fe(["baklava-connection",n.classes]),d:n.d},null,10,IDt)}const rI=dn(ODt,[["render",MDt]]);function DDt(n){return document.getElementById(n.id)}function ya(n){const e=document.getElementById(n.id),t=e==null?void 0:e.getElementsByClassName("__port");return{node:(e==null?void 0:e.closest(".baklava-node"))??null,interface:e,port:t&&t.length>0?t[0]:null}}const kDt=cn({components:{"connection-view":rI},props:{connection:{type:Object,required:!0}},setup(n){const{graph:e}=Fs();let t;const s=lt({x1:0,y1:0,x2:0,y2:0}),i=Je(()=>n.connection.isInDanger?ds.FORBIDDEN:ds.NONE),r=Je(()=>{var u;return(u=e.value.findNodeById(n.connection.from.nodeId))==null?void 0:u.position}),o=Je(()=>{var u;return(u=e.value.findNodeById(n.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=ya(n.connection.from),d=ya(n.connection.to);u.node&&d.node&&(t||(t=new ResizeObserver(()=>{l()}),t.observe(u.node),t.observe(d.node)));const[h,f]=a(u),[_,m]=a(d);s.value={x1:h,y1:f,x2:_,y2:m}};return Mi(async()=>{await Ue(),l()}),Ca(()=>{t&&t.disconnect()}),Fn([r,o],()=>l(),{deep:!0}),{d:s,state:i}}});function LDt(n,e,t,s,i,r){const o=dt("connection-view");return C(),St(o,{x1:n.d.x1,y1:n.d.y1,x2:n.d.x2,y2:n.d.y2,state:n.state},null,8,["x1","y1","x2","y2","state"])}const PDt=dn(kDt,[["render",LDt]]);function Jd(n){return n.node&&n.interface&&n.port?[n.node.offsetLeft+n.interface.offsetLeft+n.port.offsetLeft+n.port.clientWidth/2,n.node.offsetTop+n.interface.offsetTop+n.port.offsetTop+n.port.clientHeight/2]:[0,0]}const UDt=cn({components:{"connection-view":rI},props:{connection:{type:Object,required:!0}},setup(n){const e=Je(()=>n.connection?n.connection.status:ds.NONE);return{d:Je(()=>{if(!n.connection)return{input:[0,0],output:[0,0]};const s=Jd(ya(n.connection.from)),i=n.connection.to?Jd(ya(n.connection.to)):[n.connection.mx||s[0],n.connection.my||s[1]];return n.connection.from.isInput?{input:i,output:s}:{input:s,output:i}}),status:e}}});function FDt(n,e,t,s,i,r){const o=dt("connection-view");return C(),St(o,{x1:n.d.input[0],y1:n.d.input[1],x2:n.d.output[0],y2:n.d.output[1],state:n.status,"is-temporary":""},null,8,["x1","y1","x2","y2","state"])}const BDt=dn(UDt,[["render",FDt]]),GDt=cn({setup(){const{viewModel:n}=ys(),{graph:e}=Fs(),t=lt(null),s=Cd(n.value.settings.sidebar,"width"),i=Je(()=>n.value.settings.sidebar.resizable),r=Je(()=>{const h=e.value.sidebar.nodeId;return e.value.nodes.find(f=>f.id===h)}),o=Je(()=>({width:`${s.value}px`})),a=Je(()=>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=t.value)==null?void 0:f.parentElement)==null?void 0:_.getBoundingClientRect().width)??500;let E=s.value-h.movementX;E<300?E=300:E>.9*m&&(E=.9*m),s.value=E};return{el:t,graph:e,resizable:i,node:r,styles:o,displayedInterfaces:a,startResize:u,close:l}}}),VDt={class:"__header"},zDt={class:"__node-name"};function HDt(n,e,t,s,i,r){return C(),R("div",{ref:"el",class:Fe(["baklava-sidebar",{"--open":n.graph.sidebar.visible}]),style:jt(n.styles)},[n.resizable?(C(),R("div",{key:0,class:"__resizer",onMousedown:e[0]||(e[0]=(...o)=>n.startResize&&n.startResize(...o))},null,32)):G("",!0),c("div",VDt,[c("button",{tabindex:"-1",class:"__close",onClick:e[1]||(e[1]=(...o)=>n.close&&n.close(...o))},"×"),c("div",zDt,[c("b",null,se(n.node?n.node.title:""),1)])]),(C(!0),R(ze,null,st(n.displayedInterfaces,o=>(C(),R("div",{key:o.id,class:"__interface"},[(C(),St(hu(o.component),{modelValue:o.value,"onUpdate:modelValue":a=>o.value=a,node:n.node,intf:o},null,8,["modelValue","onUpdate:modelValue","node","intf"]))]))),128))],6)}const qDt=dn(GDt,[["render",HDt]]),YDt=cn({__name:"Minimap",setup(n){const{viewModel:e}=ys(),{graph:t}=Fs(),s=lt(null),i=lt(!1);let r,o=!1,a={x1:0,y1:0,x2:0,y2:0},l;const u=()=>{var x,A;if(!r)return;r.canvas.width=s.value.offsetWidth,r.canvas.height=s.value.offsetHeight;const D=new Map,T=new Map;for(const M of t.value.nodes){const q=DDt(M),H=(q==null?void 0:q.offsetWidth)??0,P=(q==null?void 0:q.offsetHeight)??0,$=((x=M.position)==null?void 0:x.x)??0,J=((A=M.position)==null?void 0:A.y)??0;D.set(M,{x1:$,y1:J,x2:$+H,y2:J+P}),T.set(M,q)}const O={x1:Number.MAX_SAFE_INTEGER,y1:Number.MAX_SAFE_INTEGER,x2:Number.MIN_SAFE_INTEGER,y2:Number.MIN_SAFE_INTEGER};for(const M of D.values())M.x1O.x2&&(O.x2=M.x2),M.y2>O.y2&&(O.y2=M.y2);const F=50;O.x1-=F,O.y1-=F,O.x2+=F,O.y2+=F,a=O;const z=r.canvas.width/r.canvas.height,Z=(a.x2-a.x1)/(a.y2-a.y1);if(z>Z){const M=(z-Z)*(a.y2-a.y1)*.5;a.x1-=M,a.x2+=M}else{const M=a.x2-a.x1,q=a.y2-a.y1,H=(M-z*q)/z*.5;a.y1-=H,a.y2+=H}r.clearRect(0,0,r.canvas.width,r.canvas.height),r.strokeStyle="white";for(const M of t.value.connections){const[q,H]=Jd(ya(M.from)),[P,$]=Jd(ya(M.to)),[J,re]=d(q,H),[me,Se]=d(P,$);if(r.beginPath(),r.moveTo(J,re),e.value.settings.useStraightConnections)r.lineTo(me,Se);else{const le=.3*Math.abs(J-me);r.bezierCurveTo(J+le,re,me-le,Se,me,Se)}r.stroke()}r.strokeStyle="lightgray";for(const[M,q]of D.entries()){const[H,P]=d(q.x1,q.y1),[$,J]=d(q.x2,q.y2);r.fillStyle=f(T.get(M)),r.beginPath(),r.rect(H,P,$-H,J-P),r.fill(),r.stroke()}if(i.value){const M=m(),[q,H]=d(M.x1,M.y1),[P,$]=d(M.x2,M.y2);r.fillStyle="rgba(255, 255, 255, 0.2)",r.fillRect(q,H,P-q,$-H)}},d=(x,A)=>[(x-a.x1)/(a.x2-a.x1)*r.canvas.width,(A-a.y1)/(a.y2-a.y1)*r.canvas.height],h=(x,A)=>[x*(a.x2-a.x1)/r.canvas.width+a.x1,A*(a.y2-a.y1)/r.canvas.height+a.y1],f=x=>{if(x){const A=x.querySelector(".__content");if(A){const T=_(A);if(T)return T}const D=_(x);if(D)return D}return"gray"},_=x=>{const A=getComputedStyle(x).backgroundColor;if(A&&A!=="rgba(0, 0, 0, 0)")return A},m=()=>{const x=s.value.parentElement.offsetWidth,A=s.value.parentElement.offsetHeight,D=x/t.value.scaling-t.value.panning.x,T=A/t.value.scaling-t.value.panning.y;return{x1:-t.value.panning.x,y1:-t.value.panning.y,x2:D,y2:T}},E=x=>{x.button===0&&(o=!0,b(x))},b=x=>{if(o){const[A,D]=h(x.offsetX,x.offsetY),T=m(),O=(T.x2-T.x1)/2,F=(T.y2-T.y1)/2;t.value.panning.x=-(A-O),t.value.panning.y=-(D-F)}},g=()=>{o=!1},y=()=>{i.value=!0},v=()=>{i.value=!1,g()};Fn([i,t.value.panning,()=>t.value.scaling,()=>t.value.connections.length],()=>{u()});const S=Je(()=>t.value.nodes.map(x=>x.position)),w=Je(()=>t.value.nodes.map(x=>x.width));return Fn([S,w],()=>{u()},{deep:!0}),Mi(()=>{r=s.value.getContext("2d"),r.imageSmoothingQuality="high",u(),l=setInterval(u,500)}),Ca(()=>{clearInterval(l)}),(x,A)=>(C(),R("canvas",{ref_key:"canvas",ref:s,class:"baklava-minimap",onMouseenter:y,onMouseleave:v,onMousedown:ae(E,["self"]),onMousemove:ae(b,["self"]),onMouseup:g},null,544))}}),$Dt=cn({components:{ContextMenu:VE,VerticalDots:iI},props:{type:{type:String,required:!0},title:{type:String,required:!0}},setup(n){const{viewModel:e}=ys(),{switchGraph:t}=Fs(),s=lt(!1),i=Je(()=>n.type.startsWith(Vl));return{showContextMenu:s,hasContextMenu:i,contextMenuItems:[{label:"Edit Subgraph",value:"editSubgraph"},{label:"Delete Subgraph",value:"deleteSubgraph"}],openContextMenu:()=>{s.value=!0},onContextMenuClick:l=>{const u=n.type.substring(Vl.length),d=e.value.editor.graphTemplates.find(h=>h.id===u);if(d)switch(l){case"editSubgraph":t(d);break;case"deleteSubgraph":e.value.editor.removeGraphTemplate(d);break}}}}}),WDt=["data-node-type"],KDt={class:"__title"},jDt={class:"__title-label"},QDt={key:0,class:"__menu"};function XDt(n,e,t,s,i,r){const o=dt("vertical-dots"),a=dt("context-menu");return C(),R("div",{class:"baklava-node --palette","data-node-type":n.type},[c("div",KDt,[c("div",jDt,se(n.title),1),n.hasContextMenu?(C(),R("div",QDt,[_e(o,{class:"--clickable",onPointerdown:e[0]||(e[0]=ae(()=>{},["stop","prevent"])),onClick:ae(n.openContextMenu,["stop","prevent"])},null,8,["onClick"]),_e(a,{modelValue:n.showContextMenu,"onUpdate:modelValue":e[1]||(e[1]=l=>n.showContextMenu=l),x:-100,y:0,items:n.contextMenuItems,onClick:n.onContextMenuClick,onPointerdown:e[2]||(e[2]=ae(()=>{},["stop","prevent"]))},null,8,["modelValue","items","onClick"])])):G("",!0)])],8,WDt)}const ew=dn($Dt,[["render",XDt]]),ZDt={class:"baklava-node-palette"},JDt={key:0},ekt=cn({__name:"NodePalette",setup(n){const{viewModel:e}=ys(),{x:t,y:s}=aDt(),{transform:i}=JO(),r=ZO(e),o=Is("editorEl"),a=lt(null),l=Je(()=>{if(!a.value||!(o!=null&&o.value))return{};const{left:d,top:h}=o.value.getBoundingClientRect();return{top:`${s.value-h}px`,left:`${t.value-d}px`}}),u=(d,h)=>{a.value={type:d,nodeInformation:h};const f=()=>{const _=Wn(new h.type);e.value.displayedGraph.addNode(_);const m=o.value.getBoundingClientRect(),[E,b]=i(t.value-m.left,s.value-m.top);_.position.x=E,_.position.y=b,a.value=null,document.removeEventListener("pointerup",f)};document.addEventListener("pointerup",f)};return(d,h)=>(C(),R(ze,null,[c("div",ZDt,[(C(!0),R(ze,null,st(mt(r),f=>(C(),R("section",{key:f.name},[f.name!=="default"?(C(),R("h1",JDt,se(f.name),1)):G("",!0),(C(!0),R(ze,null,st(f.nodeTypes,(_,m)=>(C(),St(ew,{key:m,type:m,title:_.title,onPointerdown:E=>u(m,_)},null,8,["type","title","onPointerdown"]))),128))]))),128))]),_e(Ms,{name:"fade"},{default:qe(()=>[a.value?(C(),R("div",{key:0,class:"baklava-dragged-node",style:jt(l.value)},[_e(ew,{type:a.value.type,title:a.value.nodeInformation.title},null,8,["type","title"])],4)):G("",!0)]),_:1})],64))}});let rd;const tkt=new Uint8Array(16);function nkt(){if(!rd&&(rd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!rd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return rd(tkt)}const vn=[];for(let n=0;n<256;++n)vn.push((n+256).toString(16).slice(1));function skt(n,e=0){return vn[n[e+0]]+vn[n[e+1]]+vn[n[e+2]]+vn[n[e+3]]+"-"+vn[n[e+4]]+vn[n[e+5]]+"-"+vn[n[e+6]]+vn[n[e+7]]+"-"+vn[n[e+8]]+vn[n[e+9]]+"-"+vn[n[e+10]]+vn[n[e+11]]+vn[n[e+12]]+vn[n[e+13]]+vn[n[e+14]]+vn[n[e+15]]}const ikt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),tw={randomUUID:ikt};function eu(n,e,t){if(tw.randomUUID&&!e&&!n)return tw.randomUUID();n=n||{};const s=n.random||(n.rng||nkt)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,e){t=t||0;for(let i=0;i<16;++i)e[t+i]=s[i];return e}return skt(s)}const zl="SAVE_SUBGRAPH";function rkt(n,e){const t=()=>{const s=n.value;if(!s.template)throw new Error("Graph template property not set");s.template.update(s.save()),s.template.panning=s.panning,s.template.scaling=s.scaling};e.registerCommand(zl,{canExecute:()=>{var s;return n.value!==((s=n.value.editor)==null?void 0:s.graph)},execute:t})}const okt={},akt={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"},lkt=c("polyline",{points:"6 9 12 15 18 9"},null,-1),ckt=[lkt];function dkt(n,e){return C(),R("svg",akt,ckt)}const ukt=dn(okt,[["render",dkt]]),pkt=cn({components:{"i-arrow":ukt},props:{intf:{type:Object,required:!0}},setup(n){const e=lt(null),t=lt(!1),s=Je(()=>n.intf.items.find(o=>typeof o=="string"?o===n.intf.value:o.value===n.intf.value)),i=Je(()=>s.value?typeof s.value=="string"?s.value:s.value.text:""),r=o=>{n.intf.value=typeof o=="string"?o:o.value};return nI(e,()=>{t.value=!1}),{el:e,open:t,selectedItem:s,selectedText:i,setSelected:r}}}),_kt=["title"],hkt={class:"__selected"},fkt={class:"__text"},mkt={class:"__icon"},gkt={class:"__dropdown"},bkt={class:"item --header"},Ekt=["onClick"];function ykt(n,e,t,s,i,r){const o=dt("i-arrow");return C(),R("div",{ref:"el",class:Fe(["baklava-select",{"--open":n.open}]),title:n.intf.name,onClick:e[0]||(e[0]=a=>n.open=!n.open)},[c("div",hkt,[c("div",fkt,se(n.selectedText),1),c("div",mkt,[_e(o)])]),_e(Ms,{name:"slide-fade"},{default:qe(()=>[B(c("div",gkt,[c("div",bkt,se(n.intf.name),1),(C(!0),R(ze,null,st(n.intf.items,(a,l)=>(C(),R("div",{key:l,class:Fe(["item",{"--active":a===n.selectedItem}]),onClick:u=>n.setSelected(a)},se(typeof a=="string"?a:a.text),11,Ekt))),128))],512),[[Ot,n.open]])]),_:1})],10,_kt)}const vkt=dn(pkt,[["render",ykt]]);class Skt extends Xt{constructor(e,t,s){super(e,t),this.component=Hl(vkt),this.items=s}}const Tkt=cn({props:{intf:{type:Object,required:!0}}});function xkt(n,e,t,s,i,r){return C(),R("div",null,se(n.intf.value),1)}const Ckt=dn(Tkt,[["render",xkt]]);class wkt extends Xt{constructor(e,t){super(e,t),this.component=Hl(Ckt),this.setPort(!1)}}const Rkt=cn({props:{intf:{type:Object,required:!0},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(n,{emit:e}){return{v:Je({get:()=>n.modelValue,set:s=>{e("update:modelValue",s)}})}}}),Akt=["placeholder","title"];function Nkt(n,e,t,s,i,r){return C(),R("div",null,[B(c("input",{"onUpdate:modelValue":e[0]||(e[0]=o=>n.v=o),type:"text",class:"baklava-input",placeholder:n.intf.name,title:n.intf.name},null,8,Akt),[[he,n.v]])])}const Okt=dn(Rkt,[["render",Nkt]]);class nc extends Xt{constructor(){super(...arguments),this.component=Hl(Okt)}}class oI extends $O{constructor(){super(...arguments),this._title="Subgraph Input",this.inputs={name:new nc("Name","Input").setPort(!1)},this.outputs={placeholder:new Xt("Connection",void 0)}}}class aI extends WO{constructor(){super(...arguments),this._title="Subgraph Output",this.inputs={name:new nc("Name","Output").setPort(!1),placeholder:new Xt("Connection",void 0)},this.outputs={output:new Xt("Output",void 0).setHidden(!0)}}}const lI="CREATE_SUBGRAPH",nw=[ga,ba];function Ikt(n,e,t){const s=()=>n.value.selectedNodes.filter(r=>!nw.includes(r.type)).length>0,i=()=>{const{viewModel:r}=ys(),o=n.value,a=n.value.editor;if(o.selectedNodes.length===0)return;const l=o.selectedNodes.filter(T=>!nw.includes(T.type)),u=l.flatMap(T=>Object.values(T.inputs)),d=l.flatMap(T=>Object.values(T.outputs)),h=o.connections.filter(T=>!d.includes(T.from)&&u.includes(T.to)),f=o.connections.filter(T=>d.includes(T.from)&&!u.includes(T.to)),_=o.connections.filter(T=>d.includes(T.from)&&u.includes(T.to)),m=l.map(T=>T.save()),E=_.map(T=>({id:T.id,from:T.from.id,to:T.to.id})),b=new Map,{xLeft:g,xRight:y,yTop:v}=Mkt(l);console.log(g,y,v);for(const[T,O]of h.entries()){const F=new oI;F.inputs.name.value=O.to.name,m.push({...F.save(),position:{x:y-r.value.settings.nodes.defaultWidth-100,y:v+T*200}}),E.push({id:eu(),from:F.outputs.placeholder.id,to:O.to.id}),b.set(O.to.id,F.graphInterfaceId)}for(const[T,O]of f.entries()){const F=new aI;F.inputs.name.value=O.from.name,m.push({...F.save(),position:{x:g+100,y:v+T*200}}),E.push({id:eu(),from:O.from.id,to:F.inputs.placeholder.id}),b.set(O.from.id,F.graphInterfaceId)}const S=Wn(new Ku({connections:E,nodes:m,inputs:[],outputs:[]},a));a.addGraphTemplate(S);const w=a.nodeTypes.get(Ea(S));if(!w)throw new Error("Unable to create subgraph: Could not find corresponding graph node type");const x=Wn(new w.type);o.addNode(x);const A=Math.round(l.map(T=>T.position.x).reduce((T,O)=>T+O,0)/l.length),D=Math.round(l.map(T=>T.position.y).reduce((T,O)=>T+O,0)/l.length);x.position.x=A,x.position.y=D,h.forEach(T=>{o.removeConnection(T),o.addConnection(T.from,x.inputs[b.get(T.to.id)])}),f.forEach(T=>{o.removeConnection(T),o.addConnection(x.outputs[b.get(T.from.id)],T.to)}),l.forEach(T=>o.removeNode(T)),e.canExecuteCommand(zl)&&e.executeCommand(zl),t(S),n.value.panning={...o.panning},n.value.scaling=o.scaling};e.registerCommand(lI,{canExecute:s,execute:i})}function Mkt(n){const e=n.reduce((i,r)=>{const o=r.position.x;return o{const o=r.position.y;return o{const o=r.position.x+r.width;return o>i?o:i},-1/0),xRight:e,yTop:t}}const sw="DELETE_NODES";function Dkt(n,e){e.registerCommand(sw,{canExecute:()=>n.value.selectedNodes.length>0,execute(){n.value.selectedNodes.forEach(t=>n.value.removeNode(t))}}),e.registerHotkey(["Delete"],sw)}const cI="SWITCH_TO_MAIN_GRAPH";function kkt(n,e,t){e.registerCommand(cI,{canExecute:()=>n.value!==n.value.editor.graph,execute:()=>{e.executeCommand(zl),t(n.value.editor.graph)}})}function Lkt(n,e,t){Dkt(n,e),Ikt(n,e,t),rkt(n,e),kkt(n,e,t)}class iw{constructor(e,t){this.type=e,e==="addNode"?this.nodeId=t:this.nodeState=t}undo(e){this.type==="addNode"?this.removeNode(e):this.addNode(e)}redo(e){this.type==="addNode"&&this.nodeState?this.addNode(e):this.type==="removeNode"&&this.nodeId&&this.removeNode(e)}addNode(e){const t=e.editor.nodeTypes.get(this.nodeState.type);if(!t)return;const s=new t.type;e.addNode(s),s.load(this.nodeState),this.nodeId=s.id}removeNode(e){const t=e.nodes.find(s=>s.id===this.nodeId);t&&(this.nodeState=t.save(),e.removeNode(t))}}class rw{constructor(e,t){if(this.type=e,e==="addConnection")this.connectionId=t;else{const s=t;this.connectionState={id:s.id,from:s.from.id,to:s.to.id}}}undo(e){this.type==="addConnection"?this.removeConnection(e):this.addConnection(e)}redo(e){this.type==="addConnection"&&this.connectionState?this.addConnection(e):this.type==="removeConnection"&&this.connectionId&&this.removeConnection(e)}addConnection(e){const t=e.findNodeInterface(this.connectionState.from),s=e.findNodeInterface(this.connectionState.to);!t||!s||e.addConnection(t,s)}removeConnection(e){const t=e.connections.find(s=>s.id===this.connectionId);t&&(this.connectionState={id:t.id,from:t.from.id,to:t.to.id},e.removeConnection(t))}}class Pkt{constructor(e){if(this.type="transaction",e.length===0)throw new Error("Can't create a transaction with no steps");this.steps=e}undo(e){for(let t=this.steps.length-1;t>=0;t--)this.steps[t].undo(e)}redo(e){for(let t=0;t{if(!r.value)if(a.value)l.value.push(b);else for(o.value!==i.value.length-1&&(i.value=i.value.slice(0,o.value+1)),i.value.push(b),o.value++;i.value.length>s.value;)i.value.shift()},d=()=>{a.value=!0},h=()=>{a.value=!1,l.value.length>0&&(u(new Pkt(l.value)),l.value=[])},f=()=>i.value.length!==0&&o.value!==-1,_=()=>{f()&&(r.value=!0,i.value[o.value--].undo(n.value),r.value=!1)},m=()=>i.value.length!==0&&o.value{m()&&(r.value=!0,i.value[++o.value].redo(n.value),r.value=!1)};return Fn(n,(b,g)=>{g&&(g.events.addNode.unsubscribe(t),g.events.removeNode.unsubscribe(t),g.events.addConnection.unsubscribe(t),g.events.removeConnection.unsubscribe(t)),b&&(b.events.addNode.subscribe(t,y=>{u(new iw("addNode",y.id))}),b.events.removeNode.subscribe(t,y=>{u(new iw("removeNode",y.save()))}),b.events.addConnection.subscribe(t,y=>{u(new rw("addConnection",y.id))}),b.events.removeConnection.subscribe(t,y=>{u(new rw("removeConnection",y))}))},{immediate:!0}),e.registerCommand(Qg,{canExecute:f,execute:_}),e.registerCommand(Xg,{canExecute:m,execute:E}),e.registerCommand(dI,{canExecute:()=>!a.value,execute:d}),e.registerCommand(uI,{canExecute:()=>a.value,execute:h}),e.registerHotkey(["Control","z"],Qg),e.registerHotkey(["Control","y"],Xg),Wn({maxSteps:s})}const Zg="COPY",Jg="PASTE",Fkt="CLEAR_CLIPBOARD";function Bkt(n,e,t){const s=Symbol("ClipboardToken"),i=lt(""),r=lt(""),o=Je(()=>!i.value),a=()=>{i.value="",r.value=""},l=()=>{const h=n.value.selectedNodes.flatMap(_=>[...Object.values(_.inputs),...Object.values(_.outputs)]),f=n.value.connections.filter(_=>h.includes(_.from)||h.includes(_.to)).map(_=>({from:_.from.id,to:_.to.id}));r.value=JSON.stringify(f),i.value=JSON.stringify(n.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(i.value),_=JSON.parse(r.value),m=[],E=[],b=n.value;t.executeCommand(dI);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(s,w=>{const x=w;return x.position&&(x.position.x+=100,x.position.y+=100),v.hooks.beforeLoad.unsubscribe(s),x}),b.addNode(v),v.load({...g,id:S}),v.id=S,h.set(g.id,S);for(const w of Object.values(v.inputs)){const x=eu();h.set(w.id,x),w.id=x}for(const w of Object.values(v.outputs)){const x=eu();h.set(w.id,x),w.id=x}}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 n.value.selectedNodes=m,t.executeCommand(uI),{newNodes:m,newConnections:E}};return t.registerCommand(Zg,{canExecute:()=>n.value.selectedNodes.length>0,execute:l}),t.registerHotkey(["Control","c"],Zg),t.registerCommand(Jg,{canExecute:()=>!o.value,execute:d}),t.registerHotkey(["Control","v"],Jg),t.registerCommand(Fkt,{canExecute:()=>!0,execute:a}),Wn({isEmpty:o})}const Gkt="OPEN_SIDEBAR";function Vkt(n,e){e.registerCommand(Gkt,{execute:t=>{n.value.sidebar.nodeId=t,n.value.sidebar.visible=!0},canExecute:()=>!0})}function zkt(n,e){Vkt(n,e)}const Hkt={},qkt={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"},Ykt=c("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),$kt=c("path",{d:"M9 13l-4 -4l4 -4m-4 4h11a4 4 0 0 1 0 8h-1"},null,-1),Wkt=[Ykt,$kt];function Kkt(n,e){return C(),R("svg",qkt,Wkt)}const jkt=dn(Hkt,[["render",Kkt]]),Qkt={},Xkt={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"},Zkt=c("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),Jkt=c("path",{d:"M15 13l4 -4l-4 -4m4 4h-11a4 4 0 0 0 0 8h1"},null,-1),eLt=[Zkt,Jkt];function tLt(n,e){return C(),R("svg",Xkt,eLt)}const nLt=dn(Qkt,[["render",tLt]]),sLt={},iLt={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"},rLt=c("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),oLt=c("line",{x1:"5",y1:"12",x2:"19",y2:"12"},null,-1),aLt=c("line",{x1:"5",y1:"12",x2:"11",y2:"18"},null,-1),lLt=c("line",{x1:"5",y1:"12",x2:"11",y2:"6"},null,-1),cLt=[rLt,oLt,aLt,lLt];function dLt(n,e){return C(),R("svg",iLt,cLt)}const uLt=dn(sLt,[["render",dLt]]),pLt={},_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"},hLt=c("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),fLt=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),mLt=c("rect",{x:"9",y:"3",width:"6",height:"4",rx:"2"},null,-1),gLt=[hLt,fLt,mLt];function bLt(n,e){return C(),R("svg",_Lt,gLt)}const ELt=dn(pLt,[["render",bLt]]),yLt={},vLt={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"},SLt=c("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),TLt=c("rect",{x:"8",y:"8",width:"12",height:"12",rx:"2"},null,-1),xLt=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),CLt=[SLt,TLt,xLt];function wLt(n,e){return C(),R("svg",vLt,CLt)}const RLt=dn(yLt,[["render",wLt]]),ALt={},NLt={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"},OLt=c("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),ILt=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),MLt=c("circle",{cx:"12",cy:"14",r:"2"},null,-1),DLt=c("polyline",{points:"14 4 14 8 8 8 8 4"},null,-1),kLt=[OLt,ILt,MLt,DLt];function LLt(n,e){return C(),R("svg",NLt,kLt)}const PLt=dn(ALt,[["render",LLt]]),ULt={},FLt={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"},BLt=gu('',6),GLt=[BLt];function VLt(n,e){return C(),R("svg",FLt,GLt)}const zLt=dn(ULt,[["render",VLt]]),HLt=cn({props:{command:{type:String,required:!0},title:{type:String,required:!0},icon:{type:Object,required:!1,default:void 0}},setup(){const{viewModel:n}=ys();return{viewModel:n}}}),qLt=["disabled","title"];function YLt(n,e,t,s,i,r){return C(),R("button",{class:"baklava-toolbar-entry baklava-toolbar-button",disabled:!n.viewModel.commandHandler.canExecuteCommand(n.command),title:n.title,onClick:e[0]||(e[0]=o=>n.viewModel.commandHandler.executeCommand(n.command))},[n.icon?(C(),St(hu(n.icon),{key:0})):(C(),R(ze,{key:1},[Xe(se(n.title),1)],64))],8,qLt)}const $Lt=dn(HLt,[["render",YLt]]),WLt=cn({components:{ToolbarButton:$Lt},setup(){const{viewModel:n}=ys();return{isSubgraph:Je(()=>n.value.displayedGraph!==n.value.editor.graph),commands:[{command:Zg,title:"Copy",icon:RLt},{command:Jg,title:"Paste",icon:ELt},{command:Qg,title:"Undo",icon:jkt},{command:Xg,title:"Redo",icon:nLt},{command:lI,title:"Create Subgraph",icon:zLt}],subgraphCommands:[{command:zl,title:"Save Subgraph",icon:PLt},{command:cI,title:"Back to Main Graph",icon:uLt}]}}}),KLt={class:"baklava-toolbar"};function jLt(n,e,t,s,i,r){const o=dt("toolbar-button");return C(),R("div",KLt,[(C(!0),R(ze,null,st(n.commands,a=>(C(),St(o,{key:a.command,command:a.command,title:a.title,icon:a.icon},null,8,["command","title","icon"]))),128)),n.isSubgraph?(C(!0),R(ze,{key:0},st(n.subgraphCommands,a=>(C(),St(o,{key:a.command,command:a.command,title:a.title,icon:a.icon},null,8,["command","title","icon"]))),128)):G("",!0)])}const QLt=dn(WLt,[["render",jLt]]),XLt={class:"connections-container"},ZLt=cn({__name:"Editor",props:{viewModel:{}},setup(n){const e=n,t=Symbol("EditorToken"),s=Cd(e,"viewModel");$2t(s);const i=lt(null);zo("editorEl",i);const r=Je(()=>e.viewModel.displayedGraph.nodes),o=Je(()=>e.viewModel.displayedGraph.nodes.map(A=>QO(Cd(A,"position")))),a=Je(()=>e.viewModel.displayedGraph.connections),l=Je(()=>e.viewModel.displayedGraph.selectedNodes),u=W2t(),d=K2t(),h=j2t(s),f=Je(()=>({...u.styles.value})),_=lt(0);e.viewModel.editor.hooks.load.subscribe(t,A=>(_.value++,A));const m=A=>{u.onPointerMove(A),d.onMouseMove(A)},E=A=>{A.button===0&&(A.target===i.value&&(S(),u.onPointerDown(A)),d.onMouseDown())},b=A=>{u.onPointerUp(A),d.onMouseUp()},g=A=>{A.key==="Tab"&&A.preventDefault(),e.viewModel.commandHandler.handleKeyDown(A)},y=A=>{e.viewModel.commandHandler.handleKeyUp(A)},v=A=>{["Control","Shift"].some(D=>e.viewModel.commandHandler.pressedKeys.includes(D))||S(),e.viewModel.displayedGraph.selectedNodes.push(A)},S=()=>{e.viewModel.displayedGraph.selectedNodes=[]},w=A=>{for(const D of e.viewModel.displayedGraph.selectedNodes){const T=r.value.indexOf(D),O=o.value[T];O.onPointerDown(A),document.addEventListener("pointermove",O.onPointerMove)}document.addEventListener("pointerup",x)},x=()=>{for(const A of e.viewModel.displayedGraph.selectedNodes){const D=r.value.indexOf(A),T=o.value[D];T.onPointerUp(),document.removeEventListener("pointermove",T.onPointerMove)}document.removeEventListener("pointerup",x)};return(A,D)=>(C(),R("div",{ref_key:"el",ref:i,tabindex:"-1",class:Fe(["baklava-editor",{"baklava-ignore-mouse":!!mt(d).temporaryConnection.value||mt(u).dragging.value,"--temporary-connection":!!mt(d).temporaryConnection.value}]),onPointermove:ae(m,["self"]),onPointerdown:E,onPointerup:b,onWheel:D[1]||(D[1]=ae((...T)=>mt(u).onMouseWheel&&mt(u).onMouseWheel(...T),["self"])),onKeydown:g,onKeyup:y,onContextmenu:D[2]||(D[2]=ae((...T)=>mt(h).open&&mt(h).open(...T),["self","prevent"]))},[An(A.$slots,"background",{},()=>[_e(Z2t)]),An(A.$slots,"toolbar",{},()=>[_e(QLt)]),An(A.$slots,"palette",{},()=>[_e(ekt)]),(C(),R("svg",XLt,[(C(!0),R(ze,null,st(a.value,T=>(C(),R("g",{key:T.id+_.value.toString()},[An(A.$slots,"connection",{connection:T},()=>[_e(PDt,{connection:T},null,8,["connection"])])]))),128)),An(A.$slots,"temporaryConnection",{temporaryConnection:mt(d).temporaryConnection.value},()=>[mt(d).temporaryConnection.value?(C(),St(BDt,{key:0,connection:mt(d).temporaryConnection.value},null,8,["connection"])):G("",!0)])])),c("div",{class:"node-container",style:jt(f.value)},[_e(Qs,{name:"fade"},{default:qe(()=>[(C(!0),R(ze,null,st(r.value,(T,O)=>An(A.$slots,"node",{key:T.id+_.value.toString(),node:T,selected:l.value.includes(T),dragging:o.value[O].dragging.value,onSelect:F=>v(T),onStartDrag:w},()=>[_e(NDt,{node:T,selected:l.value.includes(T),dragging:o.value[O].dragging.value,onSelect:F=>v(T),onStartDrag:w},null,8,["node","selected","dragging","onSelect"])])),128))]),_:3})],4),An(A.$slots,"sidebar",{},()=>[_e(qDt)]),An(A.$slots,"minimap",{},()=>[A.viewModel.settings.enableMinimap?(C(),St(YDt,{key:0})):G("",!0)]),An(A.$slots,"contextMenu",{contextMenu:mt(h)},()=>[A.viewModel.settings.contextMenu.enabled?(C(),St(VE,{key:0,modelValue:mt(h).show.value,"onUpdate:modelValue":D[0]||(D[0]=T=>mt(h).show.value=T),items:mt(h).items.value,x:mt(h).x.value,y:mt(h).y.value,onClick:mt(h).onClick},null,8,["modelValue","items","x","y","onClick"])):G("",!0)])],34))}}),JLt=["INPUT","TEXTAREA","SELECT"];function ePt(n){const e=lt([]),t=lt([]);return{pressedKeys:e,handleKeyDown:o=>{var a;e.value.includes(o.key)||e.value.push(o.key),!JLt.includes(((a=document.activeElement)==null?void 0:a.tagName)??"")&&t.value.forEach(l=>{l.keys.every(u=>e.value.includes(u))&&n(l.commandName)})},handleKeyUp:o=>{const a=e.value.indexOf(o.key);a>=0&&e.value.splice(a,1)},registerHotkey:(o,a)=>{t.value.push({keys:o,commandName:a})}}}const tPt=()=>{const n=lt(new Map),e=(r,o)=>{if(n.value.has(r))throw new Error(`Command "${r}" already exists`);n.value.set(r,o)},t=(r,o=!1,...a)=>{if(!n.value.has(r)){if(o)throw new Error(`[CommandHandler] Command ${r} not registered`);return}return n.value.get(r).execute(...a)},s=(r,o=!1,...a)=>{if(!n.value.has(r)){if(o)throw new Error(`[CommandHandler] Command ${r} not registered`);return!1}return n.value.get(r).canExecute(a)},i=ePt(t);return Wn({registerCommand:e,executeCommand:t,canExecuteCommand:s,...i})},nPt=n=>!(n instanceof tc);function sPt(n,e){return{switchGraph:s=>{let i;if(nPt(s))i=new tc(n.value),s.createGraph(i);else{if(s!==n.value.graph)throw new Error("Can only switch using 'Graph' instance when it is the root graph. Otherwise a 'GraphTemplate' must be used.");i=s}e.value&&e.value!==n.value.graph&&e.value.destroy(),i.panning=i.panning??s.panning??{x:0,y:0},i.scaling=i.scaling??s.scaling??1,i.selectedNodes=i.selectedNodes??[],i.sidebar=i.sidebar??{visible:!1,nodeId:"",optionName:""},e.value=i}}}function iPt(n,e){n.position=n.position??{x:0,y:0},n.disablePointerEvents=!1,n.twoColumn=n.twoColumn??!1,n.width=n.width??e.defaultWidth}const rPt=()=>({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 oPt(n){const e=lt(n??new G2t),t=Symbol("ViewModelToken"),s=lt(null),i=fM(s),{switchGraph:r}=sPt(e,s),o=Je(()=>i.value&&i.value!==e.value.graph),a=Wn(rPt()),l=tPt(),u=Ukt(i,l),d=Bkt(i,e,l),h={renderNode:new es(null),renderInterface:new es(null)};return Lkt(i,l,r),zkt(i,l),Fn(e,(f,_)=>{_&&(_.events.registerGraph.unsubscribe(t),_.graphEvents.beforeAddNode.unsubscribe(t),f.nodeHooks.beforeLoad.unsubscribe(t),f.nodeHooks.afterSave.unsubscribe(t),f.graphTemplateHooks.beforeLoad.unsubscribe(t),f.graphTemplateHooks.afterSave.unsubscribe(t),f.graph.hooks.load.unsubscribe(t),f.graph.hooks.save.unsubscribe(t)),f&&(f.nodeHooks.beforeLoad.subscribe(t,(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(t,(m,E)=>(m.position=E.position,m.width=E.width,m.twoColumn=E.twoColumn,m)),f.graphTemplateHooks.beforeLoad.subscribe(t,(m,E)=>(E.panning=m.panning,E.scaling=m.scaling,m)),f.graphTemplateHooks.afterSave.subscribe(t,(m,E)=>(m.panning=E.panning,m.scaling=E.scaling,m)),f.graph.hooks.load.subscribe(t,(m,E)=>(E.panning=m.panning,E.scaling=m.scaling,m)),f.graph.hooks.save.subscribe(t,(m,E)=>(m.panning=E.panning,m.scaling=E.scaling,m)),f.graphEvents.beforeAddNode.subscribe(t,m=>iPt(m,{defaultWidth:a.nodes.defaultWidth})),e.value.registerNodeType(oI,{category:"Subgraphs"}),e.value.registerNodeType(aI,{category:"Subgraphs"}),r(f.graph))},{immediate:!0}),Wn({editor:e,displayedGraph:i,isSubgraph:o,settings:a,commandHandler:l,history:u,clipboard:d,hooks:h,switchGraph:r})}const aPt=Ua({type:"PersonalityNode",title:"Personality",inputs:{request:()=>new Xt("Request",""),agent_name:()=>new Skt("Personality","",tu.state.config.personalities).setPort(!1)},outputs:{response:()=>new Xt("Response","")},async calculate({request:n}){console.log(tu.state.config.personalities);let e="";try{e=(await de.post("/generate",{params:{text:n}})).data}catch(t){console.error(t)}return{display:e,response:e}}}),lPt=Ua({type:"RAGNode",title:"RAG",inputs:{request:()=>new Xt("Prompt",""),document_path:()=>new nc("Document path","").setPort(!1)},outputs:{prompt:()=>new Xt("Prompt with Data","")},async calculate({request:n,document_path:e}){let t="";try{t=(await de.get("/rag",{params:{text:n,doc_path:e}})).data}catch(s){console.error(s)}return{response:t}}}),ow=Ua({type:"Task",title:"Task",inputs:{description:()=>new nc("Task description","").setPort(!1)},outputs:{prompt:()=>new Xt("Prompt")},calculate({description:n}){return{prompt:n}}}),aw=Ua({type:"TextDisplayNode",title:"TextDisplay",inputs:{text2display:()=>new Xt("Input","")},outputs:{response:()=>new wkt("Text","")},async calculate({request:n}){}}),lw=Ua({type:"LLMNode",title:"LLM",inputs:{request:()=>new Xt("Request","")},outputs:{response:()=>new Xt("Response","")},async calculate({request:n}){console.log(tu.state.config.personalities);let e="";try{e=(await de.post("/generate",{params:{text:n}})).data}catch(t){console.error(t)}return{display:e,response:e}}}),cPt=Ua({type:"MultichoiceNode",title:"Multichoice",inputs:{question:()=>new Xt("Question",""),outputs:()=>new nc("choices, one per line","","").setPort(!1)},outputs:{response:()=>new Xt("Response","")}}),dPt=cn({components:{"baklava-editor":ZLt},setup(){const n=oPt(),e=new Y2t(n.editor);n.editor.registerNodeType(aPt),n.editor.registerNodeType(ow),n.editor.registerNodeType(lPt),n.editor.registerNodeType(aw),n.editor.registerNodeType(lw),n.editor.registerNodeType(cPt);const t=Symbol();e.events.afterRun.subscribe(t,a=>{e.pause(),V2t(a,n.editor),e.resume()}),e.start();function s(a,l,u){const d=new a;return n.displayedGraph.addNode(d),d.position.x=l,d.position.y=u,d}const i=s(ow,300,140),r=s(lw,550,140),o=s(aw,850,140);return n.displayedGraph.addConnection(i.outputs.prompt,r.inputs.request),n.displayedGraph.addConnection(r.outputs.response,o.inputs.text2display),{baklava:n,saveGraph:()=>{const a=e.export();localStorage.setItem("myGraph",JSON.stringify(a))},loadGraph:()=>{const a=JSON.parse(localStorage.getItem("myGraph"));e.import(a)}}}}),uPt={style:{width:"100vw",height:"100vh"}};function pPt(n,e,t,s,i,r){const o=dt("baklava-editor");return C(),R("div",uPt,[_e(o,{"view-model":n.baklava},null,8,["view-model"]),c("button",{onClick:e[0]||(e[0]=(...a)=>n.saveGraph&&n.saveGraph(...a))},"Save Graph"),c("button",{onClick:e[1]||(e[1]=(...a)=>n.loadGraph&&n.loadGraph(...a))},"Load Graph")])}const _Pt=pt(dPt,[["render",pPt]]),hPt={},fPt={style:{width:"100vw",height:"100vh"}},mPt=["src"];function gPt(n,e,t,s,i,r){return C(),R("div",fPt,[c("iframe",{src:n.$store.state.config.comfyui_base_url,class:"m-0 p-0 w-full h-full"},null,8,mPt)])}const bPt=pt(hPt,[["render",gPt]]),EPt={},yPt={style:{width:"100vw",height:"100vh"}},vPt=["src"];function SPt(n,e,t,s,i,r){return C(),R("div",yPt,[c("iframe",{src:n.$store.state.config.sd_base_url,class:"m-0 p-0 w-full h-full"},null,8,vPt)])}const TPt=pt(EPt,[["render",SPt]]),xPt=eP({history:bL("/"),routes:[{path:"/auto_sd_view/",name:"AutoSD",component:TPt},{path:"/autosd_view/",name:"ComfyUI",component:bPt},{path:"/playground/",name:"playground",component:_et},{path:"/extensions/",name:"extensions",component:Cet},{path:"/help_view/",name:"help_view",component:Iet},{path:"/settings/",name:"settings",component:Rgt},{path:"/training/",name:"training",component:Kgt},{path:"/quantizing/",name:"quantizing",component:sbt},{path:"/",name:"discussions",component:b1t},{path:"/",name:"interactive",component:D2t},{path:"/",name:"nodes",component:_Pt}]});const ju=oD(fXe);console.log("Loaded main.js");function CPt(n){const e={};for(const t in n)n.hasOwnProperty(t)&&(e[t]=n[t]);return e}const tu=MD({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(n,e){n.is_rt_on=e},setLanguages(n,e){n.languages=e},setLanguage(n,e){n.language=e},setIsReady(n,e){n.ready=e},setIsConnected(n,e){n.isConnected=e},setIsModelOk(n,e){n.isModelOk=e},setIsGenerating(n,e){n.isGenerating=e},setConfig(n,e){n.config=e},setPersonalities(n,e){n.personalities=e},setMountedPers(n,e){n.mountedPers=e},setMountedPersArr(n,e){n.mountedPersArr=e},setbindingsZoo(n,e){n.bindingsZoo=e},setModelsArr(n,e){n.modelsArr=e},setselectedModel(n,e){n.selectedModel=e},setDiskUsage(n,e){n.diskUsage=e},setRamUsage(n,e){n.ramUsage=e},setVramUsage(n,e){n.vramUsage=e},setModelsZoo(n,e){n.modelsZoo=e},setCurrentBinding(n,e){n.currentBinding=e},setCurrentModel(n,e){n.currentModel=e},setDatabases(n,e){n.databases=e},setTheme(n){this.currentTheme=n}},getters:{getisRTOn(n){return n.is_rt_on},getLanguages(n){return n.languages},getLanguage(n){return n.language},getIsConnected(n){return n.isConnected},getIsModelOk(n){return n.isModelOk},getIsGenerating(n){return n.isGenerating},getConfig(n){return n.config},getPersonalities(n){return n.personalities},getMountedPersArr(n){return n.mountedPersArr},getMountedPers(n){return n.mountedPers},getbindingsZoo(n){return n.bindingsZoo},getModelsArr(n){return n.modelsArr},getDiskUsage(n){return n.diskUsage},getRamUsage(n){return n.ramUsage},getVramUsage(n){return n.vramUsage},getDatabasesList(n){return n.databases},getModelsZoo(n){return n.modelsZoo},getCyrrentBinding(n){return n.currentBinding},getCurrentModel(n){return n.currentModel}},actions:{async getVersion(){try{let n=await de.get("/get_lollms_webui_version",{});n&&(this.state.version=n.data,console.log("version res:",n),console.log("version :",this.state.version))}catch{console.log("Coudln't get version")}},async refreshConfig({commit:n}){console.log("Fetching configuration");try{console.log("Fetching configuration with client id: ",this.state.client_id);const e=await pI("get_config",this.state.client_id);e.active_personality_id<0&&(e.active_personality_id=0);let t=e.personalities[e.active_personality_id].split("/");e.personality_category=t[0],e.personality_folder=t[1],console.log("Recovered config"),console.log(e),console.log("Committing config"),console.log(e),console.log(this.state.config),n("setConfig",e)}catch(e){console.log(e.message,"refreshConfig")}},async refreshDatabase({commit:n}){let e=await Bs("list_databases");console.log("databases:",e),n("setDatabases",e)},async fetchisRTOn({commit:n}){const t=(await de.get("/is_rt_on")).data.status;n("setisRTOn",t)},async fetchLanguages({commit:n}){console.log("get_personality_languages_list",this.state.client_id);const e=await de.post("/get_personality_languages_list",{client_id:this.state.client_id});console.log("response",e);const t=e.data;console.log("languages",t),n("setLanguages",t)},async fetchLanguage({commit:n}){console.log("get_personality_language",this.state.client_id);const e=await de.post("/get_personality_language",{client_id:this.state.client_id});console.log("response",e);const t=e.data;console.log("language",t),n("setLanguage",t)},async changeLanguage({commit:n},e){console.log("Changing language to ",e);let t=await de.post("/set_personality_language",{client_id:this.state.client_id,language:e});console.log("get_personality_languages_list",this.state.client_id),t=await de.post("/get_personality_languages_list",{client_id:this.state.client_id}),console.log("response",t);const s=t.data;console.log("languages",s),n("setLanguages",s),t=await de.post("/get_personality_language",{client_id:this.state.client_id}),console.log("response",t);const i=t.data;console.log("language",i),n("setLanguage",i),console.log("Language changed successfully:",t.data.message)},async deleteLanguage({commit:n},e){console.log("Deleting ",e);let t=await de.post("/del_personality_language",{client_id:this.state.client_id,language:e});console.log("get_personality_languages_list",this.state.client_id),t=await de.post("/get_personality_languages_list",{client_id:this.state.client_id}),console.log("response",t);const s=t.data;console.log("languages",s),n("setLanguages",s),t=await de.post("/get_personality_language",{client_id:this.state.client_id}),console.log("response",t);const i=t.data;console.log("language",i),n("setLanguage",i),console.log("Language changed successfully:",t.data.message)},async refreshPersonalitiesZoo({commit:n}){let e=[];const t=await Bs("get_all_personalities"),s=Object.keys(t);console.log("Personalities recovered:"+this.state.config.personalities);for(let i=0;i{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((i,r)=>i.name.localeCompare(r.name)),n("setPersonalities",e),console.log("Done loading personalities")},refreshMountedPersonalities({commit:n}){this.state.config.active_personality_id<0&&(this.state.config.active_personality_id=0);let e=[];const t=[];for(let s=0;sa.full_path==i||a.full_path==r[0]);if(o>=0){let a=CPt(this.state.personalities[o]);r.length>1&&(a.language=r[1]),a?e.push(a):e.push(this.state.personalities[this.state.personalities.findIndex(l=>l.full_path=="generic/lollms")])}else t.push(s),console.log("Couldn't load personality : ",i)}for(let s=t.length-1;s>=0;s--)console.log("Removing personality : ",this.state.config.personalities[t[s]]),this.state.config.personalities.splice(t[s],1),this.state.config.active_personality_id>t[s]&&(this.state.config.active_personality_id-=1);n("setMountedPersArr",e),this.state.mountedPers=this.state.personalities[this.state.personalities.findIndex(s=>s.full_path==this.state.config.personalities[this.state.config.active_personality_id]||s.full_path+":"+s.language==this.state.config.personalities[this.state.config.active_personality_id])]},async refreshBindings({commit:n}){let e=await Bs("list_bindings");console.log("Loaded bindings zoo :",e),this.state.installedBindings=e.filter(s=>s.installed),console.log("Loaded bindings zoo ",this.state.installedBindings),n("setbindingsZoo",e);const t=e.findIndex(s=>s.name==this.state.config.binding_name);t!=-1&&n("setCurrentBinding",e[t])},async refreshModelsZoo({commit:n}){console.log("Fetching models");const t=(await de.get("/get_available_models")).data.filter(s=>s.variants&&s.variants.length>0);console.log(`get_available_models: ${t}`),n("setModelsZoo",t)},async refreshModelStatus({commit:n}){let e=await Bs("get_model_status");n("setIsModelOk",e.status)},async refreshModels({commit:n}){console.log("Fetching models");let e=await Bs("list_models");console.log(`Found ${e}`);let t=await Bs("get_active_model");console.log("Selected model ",t),t!=null&&n("setselectedModel",t.model),n("setModelsArr",e),console.log("setModelsArr",e),console.log("this.state.modelsZoo",this.state.modelsZoo),this.state.modelsZoo.map(i=>{i.isInstalled=e.includes(i.name)}),this.state.installedModels=this.state.modelsZoo.filter(i=>i.isInstalled);const s=this.state.modelsZoo.findIndex(i=>i.name==this.state.config.model_name);s!=-1&&n("setCurrentModel",this.state.modelsZoo[s])},async refreshDiskUsage({commit:n}){this.state.diskUsage=await Bs("disk_usage")},async refreshRamUsage({commit:n}){this.state.ramUsage=await Bs("ram_usage")},async refreshVramUsage({commit:n}){const e=await Bs("vram_usage"),t=[];if(e.nb_gpus>0){for(let i=0;i LoLLMS WebUI - - + +
diff --git a/web/src/views/SettingsView.vue b/web/src/views/SettingsView.vue index 1268429d..fb35caf1 100644 --- a/web/src/views/SettingsView.vue +++ b/web/src/views/SettingsView.vue @@ -469,6 +469,7 @@ @@ -4220,6 +4221,19 @@ export default { this.configFile.end_ai_header_id_template = ": " this.configFile.end_ai_message_id_template = "" this.settingsChanged=true + } else if (selectedOption === 'bare') { + console.log("Using lollms template") + this.configFile.start_header_id_template = "" + this.configFile.system_message_template = "system" + this.configFile.end_header_id_template = ": " + this.configFile.separator_template = "\n" + this.configFile.start_user_header_id_template = "" + this.configFile.end_user_header_id_template = ": " + this.configFile.end_user_message_id_template = "" + this.configFile.start_ai_header_id_template = "" + this.configFile.end_ai_header_id_template = ": " + this.configFile.end_ai_message_id_template = "" + this.settingsChanged=true } else if (selectedOption === 'llama3') { console.log("Using llama3 template") this.configFile.start_header_id_template = "<|start_header_id|>" diff --git a/zoos/models_zoo b/zoos/models_zoo index 09d09603..00c22785 160000 --- a/zoos/models_zoo +++ b/zoos/models_zoo @@ -1 +1 @@ -Subproject commit 09d096030dbfc75c3075fcd4b25ea061f6113fe8 +Subproject commit 00c227852bd61208c1ad261698bf06b9cbcfe184 diff --git a/zoos/personalities_zoo b/zoos/personalities_zoo index fbe2f392..a03ecace 160000 --- a/zoos/personalities_zoo +++ b/zoos/personalities_zoo @@ -1 +1 @@ -Subproject commit fbe2f39241435f7d663b1a05d4ac45d56bd23644 +Subproject commit a03ecace40232953deccfa922f409c8462d00042