@5minds/node-red-dashboard-2-processcube-chat 0.1.3-develop-949973-mfeevugh → 0.1.3-develop-8aec47-mff4pbn0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".deep-chat-container[data-v-
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".deep-chat-container[data-v-7d066ac7]{display:flex;justify-content:center;width:100%}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
2
|
(function(Ae,me){typeof exports=="object"&&typeof module<"u"?me(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],me):(Ae=typeof globalThis<"u"?globalThis:Ae||self,me(Ae["ui-deepchat"]={},Ae.Vue))})(this,function(Ae,me){"use strict";function $a(r,s){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=nn(r))||s){t&&(r=t);var e=0,n=function(){};return{s:n,n:function(){return e>=r.length?{done:!0}:{done:!1,value:r[e++]}},e:function(u){throw u},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,i=!0,o=!1;return{s:function(){t=t.call(r)},n:function(){var u=t.next();return i=u.done,u},e:function(u){o=!0,a=u},f:function(){try{i||t.return==null||t.return()}finally{if(o)throw a}}}}function tn(r){var s=typeof Map=="function"?new Map:void 0;return tn=function(e){if(e===null||!Wa(e))return e;if(typeof e!="function")throw new TypeError("Super expression must either be null or a function");if(s!==void 0){if(s.has(e))return s.get(e);s.set(e,n)}function n(){return Ka(e,arguments,$e(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Ke(n,e)},tn(r)}function Ka(r,s,t){if(an())return Reflect.construct.apply(null,arguments);var e=[null];e.push.apply(e,s);var n=new(r.bind.apply(r,e));return t&&Ke(n,t.prototype),n}function Wa(r){try{return Function.toString.call(r).indexOf("[native code]")!==-1}catch{return typeof r=="function"}}function Me(r,s){return Ya(r)||Xa(r,s)||nn(r,s)||Ja()}function Ja(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
4
4
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xa(r,s){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var e,n,a,i,o=[],l=!0,u=!1;try{if(a=(t=t.call(r)).next,s===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(e=a.call(t)).done)&&(o.push(e.value),o.length!==s);l=!0);}catch(c){u=!0,n=c}finally{try{if(!l&&t.return!=null&&(i=t.return(),Object(i)!==i))return}finally{if(u)throw n}}return o}}function Ya(r){if(Array.isArray(r))return r}function Ge(r){return es(r)||Qa(r)||nn(r)||Za()}function Za(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
@@ -269,5 +269,5 @@ new Remarkable().use(linkify)
|
|
|
269
269
|
Maintainer: @ericwbailey
|
|
270
270
|
|
|
271
271
|
Based on the Tomorrow Night Eighties theme: https://github.com/isagalaev/highlight.js/blob/master/src/styles/tomorrow-night-eighties.css
|
|
272
|
-
*/.hljs{background:#2b2b2b;color:#f8f8f2}.hljs-comment,.hljs-quote{color:#d4d0ab}.hljs-deletion,.hljs-name,.hljs-regexp,.hljs-selector-class,.hljs-selector-id,.hljs-tag,.hljs-template-variable,.hljs-variable{color:#ffa07a}.hljs-built_in,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-type{color:#f5ab35}.hljs-attribute{color:gold}.hljs-addition,.hljs-bullet,.hljs-string,.hljs-symbol{color:#abe338}.hljs-section,.hljs-title{color:#00e0e0}.hljs-keyword,.hljs-selector-tag{color:#dcc6e0}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}@media screen and (-ms-high-contrast: active){.hljs-addition,.hljs-attribute,.hljs-built_in,.hljs-bullet,.hljs-comment,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-quote,.hljs-string,.hljs-symbol,.hljs-type{color:highlight}.hljs-keyword,.hljs-selector-tag{font-weight:700}}#messages{overflow:auto}.outer-message-container:last-child{margin-bottom:5px}.inner-message-container{display:flex;margin-left:auto;margin-right:auto;width:calc(97.5% - 24px);max-width:100%}.message-bubble{margin-top:10px;word-wrap:break-word;width:fit-content;max-width:60%;border-radius:10px;padding:.42em .55em;height:fit-content;line-height:1.26em}.user-message-text{color:#fff;background-color:#0084ff;margin-right:0;margin-left:auto}.ai-message-text{color:#000;background-color:#e4e6eb;margin-left:0;margin-right:auto}.deep-chat-last-group-messages-active{height:100%}.loading-history-message-full-view{position:absolute;height:70%;width:100%;display:flex;align-items:center}.loading-history-message-small{height:20px;margin-bottom:30px}.loading-history-message-small>div>div{scale:.6}.loading-history-message{margin-top:0;width:100%;max-width:100%;display:flex;justify-content:center;background-color:unset}.loading-history{width:70px}.loading-history div{position:absolute;width:var(--loading-history-width);height:var(--loading-history-height);margin:var(--loading-history-margin);border:var(--loading-history-border);border-radius:50%;animation:loading-spinner 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:var(--loading-history-color) transparent transparent transparent}.loading-history div:nth-child(1){animation-delay:-.45s}.loading-history div:nth-child(2){animation-delay:-.3s}.loading-history div:nth-child(3){animation-delay:-.15s}.html-message{max-width:unset}.error-message-text{margin:14px auto 10px;background-color:#f4c0c0;color:#474747;text-align:center;max-width:95%}.deep-chat-loading-message-dots-container{width:1em;padding:.6em .75em .6em 1.3em}.loading-message-dots{position:relative;width:.45em;height:.45em;border-radius:5px;background-color:var(--loading-message-color);color:var(--loading-message-color);animation:loading-message-dots 1s infinite linear alternate;animation-delay:.5s}.loading-message-dots:before,.loading-message-dots:after{content:"";display:inline-block;position:absolute;top:0}.loading-message-dots:before{left:-.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--loading-message-color);color:var(--loading-message-color);animation:loading-message-dots 1s infinite alternate;animation-delay:0s}.loading-message-dots:after{left:.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--loading-message-color);color:var(--loading-message-color);animation:loading-message-dots 1s infinite alternate;animation-delay:1s}@keyframes loading-message-dots{0%{background-color:var(--loading-message-color)}50%,to{background-color:var(--loading-message-color-fade)}}.message-bubble>p:first-child,.message-bubble>.partial-render-message>p:first-child,.stream-wrapper>p:first-child{margin-top:0}.message-bubble>p:last-child,.message-bubble>.partial-render-message:last-child>p,.stream-wrapper>p:last-child{margin-bottom:0}pre{overflow:auto;display:block;word-break:break-all;word-wrap:break-word;border-radius:7px;background:#2b2b2b;color:#f8f8f2;margin-top:.8em;margin-bottom:.8em;padding:.6em;font-size:.9em;line-height:1.5em}.image-message{padding:0;display:flex;background-color:#ddd}.image-message>*,.image-message>*>*{width:100%;border-radius:8px;display:flex}.audio-message{width:60%;max-width:300px;height:2.2em;max-height:54px;padding:0;background-color:unset}.audio-player{width:100%;height:100%}.audio-player-safari{height:fit-content;width:40px}.audio-player-safari-left{float:left}.audio-player-safari-right{float:right}.any-file-message{padding:1px}.any-file-message-contents{display:flex}.any-file-message-icon-container{width:1.3em;min-width:1.3em;position:relative;border-radius:4px;margin-left:6px;margin-right:2px}.any-file-message-icon{background-color:#fff;border-radius:4px;position:absolute;width:1em;height:1.25em;padding:1px;margin-top:auto;margin-bottom:auto;top:0;bottom:0}.any-file-message-text{padding-top:5px;overflow-wrap:anywhere;padding-bottom:5px;padding-right:7px}.message-bubble>a{color:inherit}.left-item-position{margin-right:10px}.right-item-position{margin-left:10px}.role-hidden{display:none}.avatar{padding-top:5px;width:1.5em;height:1.5em;border-radius:1px}.avatar-container{margin-top:9px}.name{margin-top:16px;font-size:15px}#drag-and-drop{position:absolute;display:none;z-index:10;height:calc(100% - 10px);width:calc(100% - 10px);background-color:#70c6ff4d;border:5px dashed #6dafff}#file-attachment-container{position:absolute;height:3.6em;width:calc(80% - 4px);top:-2.5em;border-radius:5px;overflow:auto;text-align:left;background-color:#d7d7d73b;padding-left:4px}.file-attachment{width:2.85em;height:2.85em;display:inline-flex;margin-right:.6em;margin-bottom:.44em;margin-top:4px;position:relative;background-color:#fff;border-radius:5px}.image-attachment{width:100%;height:100%;object-fit:cover;border-radius:5px}.border-bound-attachment{width:calc(100% - 2px);height:calc(100% - 2px);border:1px solid #c3c3c3;border-radius:5px;overflow:hidden}.border-bound-attachment-safari{width:calc(100% - 1px);height:calc(100% - 1px)}.audio-attachment-icon-container{cursor:pointer}.audio-attachment-icon-container:hover{background-color:#f8f8f8}.attachment-icon{left:0;right:0;bottom:0;top:2px;margin:auto;position:absolute;width:25px;-webkit-user-select:none;user-select:none}.not-removable-attachment-icon{top:0;right:0;bottom:0;left:0}.play-icon{filter:brightness(0) saturate(100%) invert(17%) sepia(0%) saturate(1392%) hue-rotate(67deg) brightness(98%) contrast(97%)}.stop-icon{filter:brightness(0) saturate(100%) invert(29%) sepia(90%) saturate(1228%) hue-rotate(198deg) brightness(93%) contrast(98%)}.audio-placeholder-text-3-digits{padding-left:.26rem}.audio-placeholder-text-4-digits{padding-left:.1rem}.any-file-attachment{padding:2px 0}.file-attachment-text-container{position:absolute;width:inherit;display:flex;align-items:center;height:100%;top:-1px}.audio-placeholder-text-3-digits-container{padding-top:1px;cursor:default}.any-file-attachment-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;padding-left:.13em;margin-left:auto;margin-right:auto}.remove-file-attachment-button{height:1.25em;width:1.25em;border:1px solid #cfcfcf;border-radius:25px;background-color:#fff;top:-4px;right:-5px;position:absolute;display:flex;justify-content:center;cursor:pointer;-webkit-user-select:none;user-select:none}.remove-file-attachment-button:hover{background-color:#e4e4e4}.remove-file-attachment-button:active{background-color:#d7d7d7}.x-icon{color:#4e4e4e;top:-.075em;position:relative;font-size:1.05em}.modal{display:none;flex-direction:column;align-items:center;justify-content:center;position:absolute;width:80%;max-width:420px;max-height:80%;margin:auto;top:0;right:0;bottom:0;left:0;z-index:3}.modal-content{border-top:1px solid rgb(217,217,217);border-left:1px solid rgb(217,217,217);border-right:1px solid rgb(217,217,217);border-top-left-radius:inherit;border-top-right-radius:inherit;background-color:#fff;overflow-y:auto;height:fit-content;max-height:calc(100% - 3.3em);width:100%}.modal-content>p{margin-left:1em;margin-right:1em}.modal-content>ul{margin-right:1em}.modal-button-panel{height:3.3em;border:1px solid;border-color:rgb(223,223,223) rgb(217,217,217) rgb(217,217,217);border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;background-color:#fff;text-align:center;justify-content:center;display:flex;width:100%}.modal-button{min-width:2.5em;text-align:center;color:#fff;border-radius:5px;padding:.4em .4em .3em;height:1.25em;background-color:#3279b2;top:0;bottom:0;cursor:pointer;-webkit-user-select:none;user-select:none;margin:auto .31em}.modal-button:hover{background-color:#276da7}.modal-button:active{background-color:#1b5687}.modal-svg-button{padding:0 0 2px;width:2em;height:1.8em}.modal-svg-button-icon{width:100%;height:100%;filter:brightness(0) saturate(100%) invert(100%) sepia(15%) saturate(4%) hue-rotate(346deg) brightness(101%) contrast(102%)}#modal-background-panel{position:absolute;width:100%;height:100%;background-color:#00000042;z-index:2;display:none}.show-modal-background{animation:fadeInBackground .3s ease-in-out}@keyframes fadeInBackground{0%{opacity:0}to{opacity:1}}.show-modal{animation:fadeInModal .3s ease-in-out}@keyframes fadeInModal{0%{opacity:0;scale:.95}to{opacity:1;scale:1}}.hide-modal-background{animation:fadeOutBackground .2s ease-in-out}@keyframes fadeOutBackground{0%{opacity:1}to{opacity:0}}.hide-modal{animation:fadeOutModal .2s ease-in-out}@keyframes fadeOutModal{0%{opacity:1;scale:1}to{opacity:0;scale:.95}}.modal-camera-content{overflow:hidden;text-align:center;border:unset;height:100%;background-color:#2a2a2a;display:flex;justify-content:center}.camera-modal-canvas{max-width:100%;max-height:100%;margin-top:auto;margin-bottom:auto}.modal-svg-submit-button{background-color:green}.modal-svg-submit-button:hover{background-color:#007500}.modal-svg-submit-button:active{background-color:#006500}.modal-svg-submit-disabled{pointer-events:none;background-color:#747474}.modal-svg-close-button{height:1.56em;padding-top:.37em;padding-bottom:0;background-color:#c13e3e}.modal-svg-close-button:hover{background-color:#b43434}.modal-svg-close-button:active{background-color:#972929}.modal-svg-close-icon{width:80%;height:80%}.modal-svg-camera-button{height:1.6em;padding-top:.38em;padding-bottom:0}.modal-svg-camera-icon{height:76%}.modal-svg-refresh-icon{height:105%}.modal-svg-refresh-button{height:1.66em;padding-top:.11em;padding-bottom:.21em}.input-button-container{position:relative;z-index:1}.inside-right{position:absolute;right:calc(10% + .35em);bottom:.85em}.inside-left{position:absolute;left:calc(10% + .35em);bottom:.85em}.outside-left{position:absolute;right:calc(11px - .55em);bottom:.88em}.outside-right{position:absolute;left:calc(11px - .55em);bottom:.88em}#upload-images-icon{position:absolute;pointer-events:none;width:1.45em;height:1.45em;left:.11em;bottom:.08em;filter:brightness(0) saturate(100%) invert(43%) sepia(0%) saturate(740%) hue-rotate(77deg) brightness(99%) contrast(92%)}#upload-gifs-icon{position:absolute;pointer-events:none;width:1.5em;height:1.48em;left:.07em;bottom:.08em;filter:brightness(0) saturate(100%) invert(49%) sepia(0%) saturate(2586%) hue-rotate(12deg) brightness(93%) contrast(90%)}#upload-audio-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.17em;bottom:.2em;filter:brightness(0) saturate(100%) invert(15%) sepia(0%) saturate(337%) hue-rotate(125deg) brightness(91%) contrast(94%);transform:scaleX(.95)}#camera-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.23em;bottom:.2em;filter:brightness(0) saturate(100%) invert(52%) sepia(0%) saturate(161%) hue-rotate(164deg) brightness(91%) contrast(92%);transform:scaleX(.95)}#upload-mixed-files-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.25em;bottom:.2em;filter:brightness(0) saturate(100%) invert(53%) sepia(0%) saturate(36%) hue-rotate(74deg) brightness(98%) contrast(93%);transform:scaleX(.95)}#interim-text{color:gray}#microphone-button{padding-top:.5px}.outer-button-container>#microphone-button{padding-bottom:1px}#microphone-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.25em;bottom:.25em}.default-microphone-icon{filter:brightness(0) saturate(100%) invert(32%) sepia(0%) saturate(924%) hue-rotate(46deg) brightness(95%) contrast(99%)}.active-microphone-icon{filter:brightness(0) saturate(100%) invert(10%) sepia(97%) saturate(7495%) hue-rotate(0deg) brightness(101%) contrast(107%);border-radius:10px}.command-microphone-icon{filter:brightness(0) saturate(100%) invert(42%) sepia(96%) saturate(1067%) hue-rotate(77deg) brightness(99%) contrast(102%)}.unsupported-microphone{display:none}#submit-icon{height:100%;filter:brightness(0) saturate(100%) invert(32%) sepia(0%) saturate(924%) hue-rotate(46deg) brightness(95%) contrast(99%);width:1.21em}#stop-icon{background-color:#acacac;position:absolute;width:.95em;height:.95em;left:.35em;bottom:.35em;border-radius:2px}.submit-button-enlarged{scale:1.1;margin-right:.3em;margin-left:.3em}.loading-submit-button{position:relative;left:calc(-9990px + .275em);width:.22em;height:.22em;border-radius:5px;background-color:#848484;color:#848484;box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484;animation:loading-submit-button 1.5s infinite linear;bottom:-.75em}@keyframes loading-submit-button{0%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}16.667%{box-shadow:9990px -6px #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}33.333%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}50%{box-shadow:9990px 0 #848484,calc(9990px + .44em) -6px 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}66.667%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}83.333%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) -6px 0 0 #848484}to{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}}.tooltip{position:absolute;visibility:hidden;z-index:1;pointer-events:none;padding:5px 7px;background-color:#333;border-radius:5px;width:max-content}.tooltip-text{color:#fff;font-size:13px}.input-button{border-radius:4px;cursor:pointer;margin-bottom:.2em;-webkit-user-select:none;user-select:none}.input-button-svg{width:1.65em;height:1.65em}.input-button-svg-text{padding:1px;height:1.65em;display:flex}.input-button-svg-text>svg{padding:.22rem}.input-button-svg-text>div{margin-left:2px}.input-button:hover,.input-button:focus-visible{background-color:#9c9c9c2e}.input-button:active{background-color:#9c9c9c5e}.input-button:active:not(:hover){background-color:transparent}.loading-button{cursor:auto}.loading-button:hover{background-color:unset}.text-button{filter:unset!important;display:flex;justify-content:center;align-items:center;margin-left:4px;margin-right:4px;height:1.6em;width:max-content}#custom-icon{height:100%;width:1.2em}.custom-button-container-default{color:#505050}.custom-button-container-default>.dropup-menu-item-icon{color:unset}.custom-button-container-default>svg{filter:brightness(0) saturate(100%) invert(39%) sepia(1%) saturate(0%) hue-rotate(83deg) brightness(93%) contrast(90%)}.custom-button-container-default>.dropup-menu-item-icon>svg{position:absolute;left:.2em}.custom-button-container-active{background-color:#edf7ff;color:#0285ff}.custom-button-container-active:hover,.custom-button-container-active:focus-visible{background-color:#def0ff}.custom-button-container-active:active{background-color:#d2eaff}.custom-button-container-active>svg{filter:brightness(0) saturate(100%) invert(32%) sepia(34%) saturate(4196%) hue-rotate(196deg) brightness(107%) contrast(104%)}.custom-button-container-disabled{color:#aeaeae;cursor:auto}.custom-button-container-disabled>div{pointer-events:none}.custom-button-container-disabled:hover,.custom-button-container-disabled:focus-visible{background-color:transparent}.custom-button-container-disabled:active{background-color:transparent}.custom-button-container-disabled>svg{filter:brightness(0) saturate(100%) invert(67%) sepia(0%) saturate(818%) hue-rotate(28deg) brightness(102%) contrast(100%)}#text-input-container{background-color:#fff;width:80%;display:flex;border:1px solid #0000001a;border-radius:5px;margin-top:.8em;margin-bottom:.8em;box-shadow:#959da533 0 1px 12px;overflow-y:auto;max-height:200px;position:relative}.text-input-container-left-adjustment{margin-left:1.5em}.text-input-container-right-adjustment{margin-right:1.5em}.text-input-container-left-small-adjustment{margin-left:1.1em}.text-input-container-left-small-adjustment>.outside-left{right:calc(14px - .55em)}.text-input-container-right-small-adjustment{margin-right:1.1em}.text-input-container-right-small-adjustment>.outside-right{left:calc(14px - .55em)}#text-input{text-align:left;outline:none;word-wrap:break-word;line-break:auto}.text-input-styling{padding:.4em .5em;overflow:overlay;width:100%}.text-input-inner-left-adjustment{padding-left:2.2em}.text-input-inner-right-adjustment{padding-right:2em}.text-input-disabled{pointer-events:none;-webkit-user-select:none;user-select:none}[contenteditable]:empty:before{content:attr(deep-chat-placeholder-text);pointer-events:none}[contenteditable][textcolor]:empty:before{color:gray}.outside-right>#dropup-menu,.inside-right>#dropup-menu{right:0}#dropup-icon{position:absolute;pointer-events:none;width:1.16em;height:1.2em;left:.265em;bottom:.43em;filter:brightness(0) saturate(100%) invert(54%) sepia(0%) saturate(724%) hue-rotate(6deg) brightness(92%) contrast(90%)}.dropup-button>*{pointer-events:none}#dropup-menu{background-color:#fff;position:absolute;transform:translateY(-100%);border-radius:5px;z-index:1;top:-.49em;box-shadow:#0003 -1px 2px 10px,#0000001a 0 2px 4px;cursor:pointer;-webkit-user-select:none;user-select:none}.dropup-menu-item{height:1.4em;padding:.28em .84em .28em .35em;display:flex;position:relative}.dropup-menu-item:hover,.dropup-menu-item:focus-visible{background-color:#f3f3f3}.dropup-menu-item:active{background-color:#ebebeb}.dropup-menu-item:active:not(:hover){background-color:transparent}.dropup-menu-item:first-child{padding-top:.49em;border-top-left-radius:inherit;border-top-right-radius:inherit}.dropup-menu-item:last-child{padding-bottom:.45em;border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.dropup-menu-item-icon{width:1.39em;position:relative}.dropup-menu-item-icon>svg{bottom:0!important;top:0!important;margin-bottom:auto;margin-top:auto}#dropup-menu-item-icon-element-custom{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.28em;filter:brightness(0) saturate(100%) invert(15%) sepia(0%) saturate(337%) hue-rotate(125deg) brightness(91%) contrast(94%)}.dropup-menu-item-text{margin-left:.56em;margin-top:.08em;width:max-content}#input{width:100%;display:inline-flex;text-align:center;margin-left:auto;margin-right:auto;margin-top:auto;position:relative;justify-content:center}#chat-view{height:100%;display:grid;grid-template-columns:100%}::-webkit-scrollbar{width:9px;height:9px}::-webkit-scrollbar-thumb{background-color:#d0d0d0;border-radius:5px}::-webkit-scrollbar-track{background-color:#f2f2f2}.deep-chat-web-model-button{margin-top:10px;margin-bottom:5px;margin-left:1px}:host{all:initial;display:table-cell}#container{height:inherit;width:inherit;overflow:hidden}`,jl=Object.defineProperty,q=function(s,t,e,n){for(var a=void 0,i=s.length-1,o;i>=0;i--)(o=s[i])&&(a=o(t,e,a)||a);return a&&jl(t,e,a),a},U=function(r){function s(){var t;b(this,s);var e;return t=N(this,s),t.getMessages=function(){return[]},t.submitUserMessage=function(){return console.warn("submitUserMessage failed - please wait for chat view to render before calling this property.")},t.addMessage=function(){return console.warn("addMessage failed - please wait for chat view to render before calling this property.")},t.updateMessage=function(){},t.clearMessages=function(){},t.focusInput=function(){return ln.focusFromParentElement(t._elementRef)},t.refreshMessages=function(){},t.scrollToBottom=function(){},t.disableSubmitButton=function(){},t.setPlaceholderText=function(){},t._hasBeenRendered=!1,t._auxiliaryStyleApplied=!1,t._elementRef=document.createElement("div"),t._elementRef.id="container",t.attachShadow({mode:"open"}).appendChild(t._elementRef),(e=t.shadowRoot)==null||e.appendChild(ve.buildElement()),on.apply(Ul,t.shadowRoot),setTimeout(function(){t._hasBeenRendered||t.onRender()},20),t}return B(s,r),_(s,[{key:"changeToChatView",value:function(){this._activeService&&(this._activeService.validateKeyProperty=!1),this.onRender()}},{key:"onRender",value:function(){var e;Qn.attemptAppendStyleSheetToHead(this.style),ie.processConnect(this),(!this._activeService||this._activeService.demo)&&(this._activeService=zo.create(this)),this.auxiliaryStyle&&!this._auxiliaryStyleApplied&&(on.apply(this.auxiliaryStyle,this.shadowRoot),this._auxiliaryStyleApplied=!0),on.applyDefaultStyleToComponent(this.style,this.chatStyle),ie.checkForContainerStyles(this,this._elementRef),this._activeService.key&&this._activeService.validateKeyProperty?as.render(this._elementRef,this.changeToChatView.bind(this),this._activeService):!(this._activeService instanceof te)||this._activeService.key?((e=this._childElement)!==null&&e!==void 0||(this._childElement=this.children[0]),Fl.render(this,this._elementRef,this._activeService,this._childElement)):this._activeService instanceof te&&ho.render(this._elementRef,this.changeToChatView.bind(this),this._activeService),this._hasBeenRendered||Xe.onRender(this),this._hasBeenRendered=!0}},{key:"disconnectedCallback",value:function(){In.chat=void 0}}])}(oo);q([H("object")],U.prototype,"connect"),q([H("object")],U.prototype,"directConnection"),q([H("object")],U.prototype,"webModel"),q([H("object")],U.prototype,"requestBodyLimits"),q([H("function")],U.prototype,"requestInterceptor"),q([H("function")],U.prototype,"responseInterceptor"),q([H("function")],U.prototype,"validateInput"),q([H("function")],U.prototype,"loadHistory"),q([H("object")],U.prototype,"chatStyle"),q([H("object")],U.prototype,"attachmentContainerStyle"),q([H("object")],U.prototype,"dropupStyles"),q([H("object")],U.prototype,"inputAreaStyle"),q([H("object")],U.prototype,"textInput"),q([H("object")],U.prototype,"submitButtonStyles"),q([H("object")],U.prototype,"customButtons"),q([H("string")],U.prototype,"auxiliaryStyle"),q([H("array")],U.prototype,"history"),q([H("object")],U.prototype,"browserStorage"),q([H("object")],U.prototype,"introMessage"),q([H("object")],U.prototype,"avatars"),q([H("object")],U.prototype,"names"),q([H("object")],U.prototype,"displayLoadingBubble"),q([H("object")],U.prototype,"errorMessages"),q([H("object")],U.prototype,"messageStyles"),q([H("object")],U.prototype,"textToSpeech"),q([H("object")],U.prototype,"speechToText"),q([H("object")],U.prototype,"images"),q([H("object")],U.prototype,"gifs"),q([H("object")],U.prototype,"camera"),q([H("object")],U.prototype,"audio"),q([H("object")],U.prototype,"microphone"),q([H("object")],U.prototype,"mixedFiles"),q([H("object")],U.prototype,"dragAndDrop"),q([H("object")],U.prototype,"introPanelStyle"),q([H("object")],U.prototype,"htmlClassUtilities"),q([H("object")],U.prototype,"remarkable"),q([H("object")],U.prototype,"focusMode"),q([H("function")],U.prototype,"onMessage"),q([H("function")],U.prototype,"onClearMessages"),q([H("function")],U.prototype,"onComponentRender"),q([H("function")],U.prototype,"onInput"),q([H("function")],U.prototype,"onError"),q([H("object")],U.prototype,"demo"),q([H("object")],U.prototype,"_insertKeyViewStyles"),customElements.define("deep-chat",U);const Hl=(r,s)=>{const t=r.__vccOpts||r;for(const[e,n]of s)t[e]=n;return t},ql={name:"UIDeepChat",props:["id","props","state"],inject:["$socket"],data(){return{conversation:[]}},computed:{deepChatStyle(){return{width:"100%",maxWidth:"600px",height:"80vh",borderRadius:"8px"}},textInputConfig(){return{placeholder:{text:this.props.placeholder||"Type a message..."}}},introMessageConfig(){return{text:this.props.introMessage||"Hello! How can I help you today?"}},connectConfig(){return{handler:this.handleConnection}}},mounted(){console.log("mounted"),this.$socket.on("msg-input:"+this.id,r=>{console.log(JSON.stringify(r)),this.handleNodeREDResponse(r)})},beforeUnmount(){this.$socket.off("msg-input:"+this.id)},methods:{async handleConnection(r,s){try{let t=[],e=[];if(r instanceof FormData){for(let[a,i]of r.entries())if(a.startsWith("message"))try{const o=JSON.parse(i);t.push(o)}catch(o){console.error("Error parsing message:",o)}else a==="files"&&e.push(i);if(e.length>0){const a=await this.processFiles(e);if(t.length>0){const i=t[t.length-1];i.files=a}else t.push({role:"user",text:"",files:a}),console.log("lus777",t)}}else r.messages&&(t=r.messages);this.conversation.push(...t);const n=this.formatForChatGPT(this.conversation);this.sendToNodeRED(n,s)}catch(t){console.error("Error in handleConnection:",t),this.sendErrorResponse("Sorry, there was an error processing your message.")}},async processFiles(r){try{return await Promise.all(r.map(async s=>s instanceof File?s.type.startsWith("image/")?await this.processImageFile(s):s.type.startsWith("audio/")?await this.processAudioFile(s):await this.processDocumentFile(s):s))}catch(s){return console.error("Error processing files:",s),[]}},processImageFile(r){return new Promise((s,t)=>{const e=new FileReader;e.onload=n=>s({name:r.name,type:r.type,size:r.size,src:n.target.result}),e.onerror=()=>t(new Error("Failed to read image")),e.readAsDataURL(r)})},processAudioFile(r){return new Promise((s,t)=>{const e=new FileReader;e.onload=n=>{try{const a=n.target.result;if(a.indexOf(",")===-1)throw new Error("Invalid data URL format: missing comma separator");const o=a.split(",")[1];s({name:r.name,type:r.type,size:r.size,base64Data:o})}catch(a){t(a)}},e.onerror=()=>t(new Error("Failed to read audio")),e.readAsDataURL(r)})},processDocumentFile(r){return new Promise((s,t)=>{const e=new FileReader;e.onload=n=>{try{const a=n.target.result.split(",")[1];s({name:r.name,type:r.type,size:r.size,fileData:a})}catch(a){t(a)}},e.onerror=()=>t(new Error("Failed to read document")),e.readAsDataURL(r)})},formatForChatGPT(r,s=!1){const t={messages:r.map(e=>this.formatMessage(e,s)),model:this.props.model};return this.props.tools&&(t.tools=this.props.tools),this.props.tool_choice&&(t.tool_choice=this.props.tool_choice),this.props.temperature!==void 0&&(t.temperature=this.props.temperature),this.props.max_tokens&&(t.max_tokens=this.props.max_tokens),this.props.top_p!==void 0&&(t.top_p=this.props.top_p),this.props.frequency_penalty!==void 0&&(t.frequency_penalty=this.props.frequency_penalty),this.props.presence_penalty!==void 0&&(t.presence_penalty=this.props.presence_penalty),this.props.response_format&&(t.response_format=this.props.response_format),t},formatMessage(r,s=!1){const t={role:r.role==="ai"?"assistant":"user"};return r.tool_calls?(t.tool_calls=r.tool_calls,t.content=r.content||null,t):r.role==="tool"?(t.role="tool",t.content=r.content,t.tool_call_id=r.tool_call_id,t):r.files&&r.files.length>0?(t.content=this.buildContentArray(r,s),t):(t.content=r.text||r.content||"",t)},buildContentArray(r,s){const t=[{type:"text",text:r.text||""}];return r.files.forEach(e=>{if(e.type&&e.type.startsWith("image/")&&e.src)t.push({type:"image_url",image_url:{url:e.src}});else if(!s&&e.type&&e.type.startsWith("audio/")&&e.base64Data){const n=this.getAudioFormat(e.type);t.push({type:"input_audio",input_audio:{data:e.base64Data,format:n}})}else!s&&e.fileData&&t.push({type:"file",file:{filename:e.name,file_data:e.fileData}})}),t},getAudioFormat(r){return r.includes("mp3")?"mp3":r.includes("wav")?"wav":r.includes("webm")?"webm":r.includes("m4a")?"m4a":"wav"},sendToNodeRED(r,s,t=null){this.$socket.emit("widget-action",this.id,{payload:r})},handleNodeREDResponse(r){var s,t,e,n,a,i;try{const o=r.payload,l={role:"ai",content:((s=o.message)==null?void 0:s.content)||o.content,text:((t=o.message)==null?void 0:t.content)||o.content,fullResponse:o};(e=o.message)!=null&&e.tool_calls&&(l.tool_calls=o.message.tool_calls,l.content=o.message.content||null),this.conversation.push(l),(n=o.message)!=null&&n.tool_calls?this.$refs.deepChat.addMessage({text:"Function call requested...",role:"ai"}):((a=o.message)!=null&&a.content||o.content)&&this.$refs.deepChat.addMessage({text:((i=o.message)==null?void 0:i.content)||o.content,role:"ai"})}catch(o){console.error("Error handling response:",o),this.sendErrorResponse("Error processing response")}},sendErrorResponse(r){this.$refs.deepChat.addMessage({text:r,role:"ai"})}}},Vl={class:"deep-chat-container"};function zl(r,s,t,e,n,a){const i=me.resolveComponent("deep-chat");return me.openBlock(),me.createElementBlock("div",Vl,[me.createVNode(i,{ref:"deepChat",style:me.normalizeStyle(a.deepChatStyle),textInput:a.textInputConfig,introMessage:a.introMessageConfig,connect:a.connectConfig,speechToText:t.props.speechToText,camera:t.props.camera,mixedFiles:t.props.attachments,avatars:t.props.avatars,names:t.props.names,timestamps:t.props.timestamps,stream:t.props.stream},null,8,["style","textInput","introMessage","connect","speechToText","camera","mixedFiles","avatars","names","timestamps","stream"])])}const Gl=Hl(ql,[["render",zl],["__scopeId","data-v-c41a0d95"]]);Ae.UIDeepChat=Gl,Object.defineProperty(Ae,Symbol.toStringTag,{value:"Module"})});
|
|
272
|
+
*/.hljs{background:#2b2b2b;color:#f8f8f2}.hljs-comment,.hljs-quote{color:#d4d0ab}.hljs-deletion,.hljs-name,.hljs-regexp,.hljs-selector-class,.hljs-selector-id,.hljs-tag,.hljs-template-variable,.hljs-variable{color:#ffa07a}.hljs-built_in,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-type{color:#f5ab35}.hljs-attribute{color:gold}.hljs-addition,.hljs-bullet,.hljs-string,.hljs-symbol{color:#abe338}.hljs-section,.hljs-title{color:#00e0e0}.hljs-keyword,.hljs-selector-tag{color:#dcc6e0}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}@media screen and (-ms-high-contrast: active){.hljs-addition,.hljs-attribute,.hljs-built_in,.hljs-bullet,.hljs-comment,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-quote,.hljs-string,.hljs-symbol,.hljs-type{color:highlight}.hljs-keyword,.hljs-selector-tag{font-weight:700}}#messages{overflow:auto}.outer-message-container:last-child{margin-bottom:5px}.inner-message-container{display:flex;margin-left:auto;margin-right:auto;width:calc(97.5% - 24px);max-width:100%}.message-bubble{margin-top:10px;word-wrap:break-word;width:fit-content;max-width:60%;border-radius:10px;padding:.42em .55em;height:fit-content;line-height:1.26em}.user-message-text{color:#fff;background-color:#0084ff;margin-right:0;margin-left:auto}.ai-message-text{color:#000;background-color:#e4e6eb;margin-left:0;margin-right:auto}.deep-chat-last-group-messages-active{height:100%}.loading-history-message-full-view{position:absolute;height:70%;width:100%;display:flex;align-items:center}.loading-history-message-small{height:20px;margin-bottom:30px}.loading-history-message-small>div>div{scale:.6}.loading-history-message{margin-top:0;width:100%;max-width:100%;display:flex;justify-content:center;background-color:unset}.loading-history{width:70px}.loading-history div{position:absolute;width:var(--loading-history-width);height:var(--loading-history-height);margin:var(--loading-history-margin);border:var(--loading-history-border);border-radius:50%;animation:loading-spinner 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:var(--loading-history-color) transparent transparent transparent}.loading-history div:nth-child(1){animation-delay:-.45s}.loading-history div:nth-child(2){animation-delay:-.3s}.loading-history div:nth-child(3){animation-delay:-.15s}.html-message{max-width:unset}.error-message-text{margin:14px auto 10px;background-color:#f4c0c0;color:#474747;text-align:center;max-width:95%}.deep-chat-loading-message-dots-container{width:1em;padding:.6em .75em .6em 1.3em}.loading-message-dots{position:relative;width:.45em;height:.45em;border-radius:5px;background-color:var(--loading-message-color);color:var(--loading-message-color);animation:loading-message-dots 1s infinite linear alternate;animation-delay:.5s}.loading-message-dots:before,.loading-message-dots:after{content:"";display:inline-block;position:absolute;top:0}.loading-message-dots:before{left:-.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--loading-message-color);color:var(--loading-message-color);animation:loading-message-dots 1s infinite alternate;animation-delay:0s}.loading-message-dots:after{left:.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--loading-message-color);color:var(--loading-message-color);animation:loading-message-dots 1s infinite alternate;animation-delay:1s}@keyframes loading-message-dots{0%{background-color:var(--loading-message-color)}50%,to{background-color:var(--loading-message-color-fade)}}.message-bubble>p:first-child,.message-bubble>.partial-render-message>p:first-child,.stream-wrapper>p:first-child{margin-top:0}.message-bubble>p:last-child,.message-bubble>.partial-render-message:last-child>p,.stream-wrapper>p:last-child{margin-bottom:0}pre{overflow:auto;display:block;word-break:break-all;word-wrap:break-word;border-radius:7px;background:#2b2b2b;color:#f8f8f2;margin-top:.8em;margin-bottom:.8em;padding:.6em;font-size:.9em;line-height:1.5em}.image-message{padding:0;display:flex;background-color:#ddd}.image-message>*,.image-message>*>*{width:100%;border-radius:8px;display:flex}.audio-message{width:60%;max-width:300px;height:2.2em;max-height:54px;padding:0;background-color:unset}.audio-player{width:100%;height:100%}.audio-player-safari{height:fit-content;width:40px}.audio-player-safari-left{float:left}.audio-player-safari-right{float:right}.any-file-message{padding:1px}.any-file-message-contents{display:flex}.any-file-message-icon-container{width:1.3em;min-width:1.3em;position:relative;border-radius:4px;margin-left:6px;margin-right:2px}.any-file-message-icon{background-color:#fff;border-radius:4px;position:absolute;width:1em;height:1.25em;padding:1px;margin-top:auto;margin-bottom:auto;top:0;bottom:0}.any-file-message-text{padding-top:5px;overflow-wrap:anywhere;padding-bottom:5px;padding-right:7px}.message-bubble>a{color:inherit}.left-item-position{margin-right:10px}.right-item-position{margin-left:10px}.role-hidden{display:none}.avatar{padding-top:5px;width:1.5em;height:1.5em;border-radius:1px}.avatar-container{margin-top:9px}.name{margin-top:16px;font-size:15px}#drag-and-drop{position:absolute;display:none;z-index:10;height:calc(100% - 10px);width:calc(100% - 10px);background-color:#70c6ff4d;border:5px dashed #6dafff}#file-attachment-container{position:absolute;height:3.6em;width:calc(80% - 4px);top:-2.5em;border-radius:5px;overflow:auto;text-align:left;background-color:#d7d7d73b;padding-left:4px}.file-attachment{width:2.85em;height:2.85em;display:inline-flex;margin-right:.6em;margin-bottom:.44em;margin-top:4px;position:relative;background-color:#fff;border-radius:5px}.image-attachment{width:100%;height:100%;object-fit:cover;border-radius:5px}.border-bound-attachment{width:calc(100% - 2px);height:calc(100% - 2px);border:1px solid #c3c3c3;border-radius:5px;overflow:hidden}.border-bound-attachment-safari{width:calc(100% - 1px);height:calc(100% - 1px)}.audio-attachment-icon-container{cursor:pointer}.audio-attachment-icon-container:hover{background-color:#f8f8f8}.attachment-icon{left:0;right:0;bottom:0;top:2px;margin:auto;position:absolute;width:25px;-webkit-user-select:none;user-select:none}.not-removable-attachment-icon{top:0;right:0;bottom:0;left:0}.play-icon{filter:brightness(0) saturate(100%) invert(17%) sepia(0%) saturate(1392%) hue-rotate(67deg) brightness(98%) contrast(97%)}.stop-icon{filter:brightness(0) saturate(100%) invert(29%) sepia(90%) saturate(1228%) hue-rotate(198deg) brightness(93%) contrast(98%)}.audio-placeholder-text-3-digits{padding-left:.26rem}.audio-placeholder-text-4-digits{padding-left:.1rem}.any-file-attachment{padding:2px 0}.file-attachment-text-container{position:absolute;width:inherit;display:flex;align-items:center;height:100%;top:-1px}.audio-placeholder-text-3-digits-container{padding-top:1px;cursor:default}.any-file-attachment-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;padding-left:.13em;margin-left:auto;margin-right:auto}.remove-file-attachment-button{height:1.25em;width:1.25em;border:1px solid #cfcfcf;border-radius:25px;background-color:#fff;top:-4px;right:-5px;position:absolute;display:flex;justify-content:center;cursor:pointer;-webkit-user-select:none;user-select:none}.remove-file-attachment-button:hover{background-color:#e4e4e4}.remove-file-attachment-button:active{background-color:#d7d7d7}.x-icon{color:#4e4e4e;top:-.075em;position:relative;font-size:1.05em}.modal{display:none;flex-direction:column;align-items:center;justify-content:center;position:absolute;width:80%;max-width:420px;max-height:80%;margin:auto;top:0;right:0;bottom:0;left:0;z-index:3}.modal-content{border-top:1px solid rgb(217,217,217);border-left:1px solid rgb(217,217,217);border-right:1px solid rgb(217,217,217);border-top-left-radius:inherit;border-top-right-radius:inherit;background-color:#fff;overflow-y:auto;height:fit-content;max-height:calc(100% - 3.3em);width:100%}.modal-content>p{margin-left:1em;margin-right:1em}.modal-content>ul{margin-right:1em}.modal-button-panel{height:3.3em;border:1px solid;border-color:rgb(223,223,223) rgb(217,217,217) rgb(217,217,217);border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;background-color:#fff;text-align:center;justify-content:center;display:flex;width:100%}.modal-button{min-width:2.5em;text-align:center;color:#fff;border-radius:5px;padding:.4em .4em .3em;height:1.25em;background-color:#3279b2;top:0;bottom:0;cursor:pointer;-webkit-user-select:none;user-select:none;margin:auto .31em}.modal-button:hover{background-color:#276da7}.modal-button:active{background-color:#1b5687}.modal-svg-button{padding:0 0 2px;width:2em;height:1.8em}.modal-svg-button-icon{width:100%;height:100%;filter:brightness(0) saturate(100%) invert(100%) sepia(15%) saturate(4%) hue-rotate(346deg) brightness(101%) contrast(102%)}#modal-background-panel{position:absolute;width:100%;height:100%;background-color:#00000042;z-index:2;display:none}.show-modal-background{animation:fadeInBackground .3s ease-in-out}@keyframes fadeInBackground{0%{opacity:0}to{opacity:1}}.show-modal{animation:fadeInModal .3s ease-in-out}@keyframes fadeInModal{0%{opacity:0;scale:.95}to{opacity:1;scale:1}}.hide-modal-background{animation:fadeOutBackground .2s ease-in-out}@keyframes fadeOutBackground{0%{opacity:1}to{opacity:0}}.hide-modal{animation:fadeOutModal .2s ease-in-out}@keyframes fadeOutModal{0%{opacity:1;scale:1}to{opacity:0;scale:.95}}.modal-camera-content{overflow:hidden;text-align:center;border:unset;height:100%;background-color:#2a2a2a;display:flex;justify-content:center}.camera-modal-canvas{max-width:100%;max-height:100%;margin-top:auto;margin-bottom:auto}.modal-svg-submit-button{background-color:green}.modal-svg-submit-button:hover{background-color:#007500}.modal-svg-submit-button:active{background-color:#006500}.modal-svg-submit-disabled{pointer-events:none;background-color:#747474}.modal-svg-close-button{height:1.56em;padding-top:.37em;padding-bottom:0;background-color:#c13e3e}.modal-svg-close-button:hover{background-color:#b43434}.modal-svg-close-button:active{background-color:#972929}.modal-svg-close-icon{width:80%;height:80%}.modal-svg-camera-button{height:1.6em;padding-top:.38em;padding-bottom:0}.modal-svg-camera-icon{height:76%}.modal-svg-refresh-icon{height:105%}.modal-svg-refresh-button{height:1.66em;padding-top:.11em;padding-bottom:.21em}.input-button-container{position:relative;z-index:1}.inside-right{position:absolute;right:calc(10% + .35em);bottom:.85em}.inside-left{position:absolute;left:calc(10% + .35em);bottom:.85em}.outside-left{position:absolute;right:calc(11px - .55em);bottom:.88em}.outside-right{position:absolute;left:calc(11px - .55em);bottom:.88em}#upload-images-icon{position:absolute;pointer-events:none;width:1.45em;height:1.45em;left:.11em;bottom:.08em;filter:brightness(0) saturate(100%) invert(43%) sepia(0%) saturate(740%) hue-rotate(77deg) brightness(99%) contrast(92%)}#upload-gifs-icon{position:absolute;pointer-events:none;width:1.5em;height:1.48em;left:.07em;bottom:.08em;filter:brightness(0) saturate(100%) invert(49%) sepia(0%) saturate(2586%) hue-rotate(12deg) brightness(93%) contrast(90%)}#upload-audio-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.17em;bottom:.2em;filter:brightness(0) saturate(100%) invert(15%) sepia(0%) saturate(337%) hue-rotate(125deg) brightness(91%) contrast(94%);transform:scaleX(.95)}#camera-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.23em;bottom:.2em;filter:brightness(0) saturate(100%) invert(52%) sepia(0%) saturate(161%) hue-rotate(164deg) brightness(91%) contrast(92%);transform:scaleX(.95)}#upload-mixed-files-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.25em;bottom:.2em;filter:brightness(0) saturate(100%) invert(53%) sepia(0%) saturate(36%) hue-rotate(74deg) brightness(98%) contrast(93%);transform:scaleX(.95)}#interim-text{color:gray}#microphone-button{padding-top:.5px}.outer-button-container>#microphone-button{padding-bottom:1px}#microphone-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.25em;bottom:.25em}.default-microphone-icon{filter:brightness(0) saturate(100%) invert(32%) sepia(0%) saturate(924%) hue-rotate(46deg) brightness(95%) contrast(99%)}.active-microphone-icon{filter:brightness(0) saturate(100%) invert(10%) sepia(97%) saturate(7495%) hue-rotate(0deg) brightness(101%) contrast(107%);border-radius:10px}.command-microphone-icon{filter:brightness(0) saturate(100%) invert(42%) sepia(96%) saturate(1067%) hue-rotate(77deg) brightness(99%) contrast(102%)}.unsupported-microphone{display:none}#submit-icon{height:100%;filter:brightness(0) saturate(100%) invert(32%) sepia(0%) saturate(924%) hue-rotate(46deg) brightness(95%) contrast(99%);width:1.21em}#stop-icon{background-color:#acacac;position:absolute;width:.95em;height:.95em;left:.35em;bottom:.35em;border-radius:2px}.submit-button-enlarged{scale:1.1;margin-right:.3em;margin-left:.3em}.loading-submit-button{position:relative;left:calc(-9990px + .275em);width:.22em;height:.22em;border-radius:5px;background-color:#848484;color:#848484;box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484;animation:loading-submit-button 1.5s infinite linear;bottom:-.75em}@keyframes loading-submit-button{0%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}16.667%{box-shadow:9990px -6px #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}33.333%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}50%{box-shadow:9990px 0 #848484,calc(9990px + .44em) -6px 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}66.667%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}83.333%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) -6px 0 0 #848484}to{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}}.tooltip{position:absolute;visibility:hidden;z-index:1;pointer-events:none;padding:5px 7px;background-color:#333;border-radius:5px;width:max-content}.tooltip-text{color:#fff;font-size:13px}.input-button{border-radius:4px;cursor:pointer;margin-bottom:.2em;-webkit-user-select:none;user-select:none}.input-button-svg{width:1.65em;height:1.65em}.input-button-svg-text{padding:1px;height:1.65em;display:flex}.input-button-svg-text>svg{padding:.22rem}.input-button-svg-text>div{margin-left:2px}.input-button:hover,.input-button:focus-visible{background-color:#9c9c9c2e}.input-button:active{background-color:#9c9c9c5e}.input-button:active:not(:hover){background-color:transparent}.loading-button{cursor:auto}.loading-button:hover{background-color:unset}.text-button{filter:unset!important;display:flex;justify-content:center;align-items:center;margin-left:4px;margin-right:4px;height:1.6em;width:max-content}#custom-icon{height:100%;width:1.2em}.custom-button-container-default{color:#505050}.custom-button-container-default>.dropup-menu-item-icon{color:unset}.custom-button-container-default>svg{filter:brightness(0) saturate(100%) invert(39%) sepia(1%) saturate(0%) hue-rotate(83deg) brightness(93%) contrast(90%)}.custom-button-container-default>.dropup-menu-item-icon>svg{position:absolute;left:.2em}.custom-button-container-active{background-color:#edf7ff;color:#0285ff}.custom-button-container-active:hover,.custom-button-container-active:focus-visible{background-color:#def0ff}.custom-button-container-active:active{background-color:#d2eaff}.custom-button-container-active>svg{filter:brightness(0) saturate(100%) invert(32%) sepia(34%) saturate(4196%) hue-rotate(196deg) brightness(107%) contrast(104%)}.custom-button-container-disabled{color:#aeaeae;cursor:auto}.custom-button-container-disabled>div{pointer-events:none}.custom-button-container-disabled:hover,.custom-button-container-disabled:focus-visible{background-color:transparent}.custom-button-container-disabled:active{background-color:transparent}.custom-button-container-disabled>svg{filter:brightness(0) saturate(100%) invert(67%) sepia(0%) saturate(818%) hue-rotate(28deg) brightness(102%) contrast(100%)}#text-input-container{background-color:#fff;width:80%;display:flex;border:1px solid #0000001a;border-radius:5px;margin-top:.8em;margin-bottom:.8em;box-shadow:#959da533 0 1px 12px;overflow-y:auto;max-height:200px;position:relative}.text-input-container-left-adjustment{margin-left:1.5em}.text-input-container-right-adjustment{margin-right:1.5em}.text-input-container-left-small-adjustment{margin-left:1.1em}.text-input-container-left-small-adjustment>.outside-left{right:calc(14px - .55em)}.text-input-container-right-small-adjustment{margin-right:1.1em}.text-input-container-right-small-adjustment>.outside-right{left:calc(14px - .55em)}#text-input{text-align:left;outline:none;word-wrap:break-word;line-break:auto}.text-input-styling{padding:.4em .5em;overflow:overlay;width:100%}.text-input-inner-left-adjustment{padding-left:2.2em}.text-input-inner-right-adjustment{padding-right:2em}.text-input-disabled{pointer-events:none;-webkit-user-select:none;user-select:none}[contenteditable]:empty:before{content:attr(deep-chat-placeholder-text);pointer-events:none}[contenteditable][textcolor]:empty:before{color:gray}.outside-right>#dropup-menu,.inside-right>#dropup-menu{right:0}#dropup-icon{position:absolute;pointer-events:none;width:1.16em;height:1.2em;left:.265em;bottom:.43em;filter:brightness(0) saturate(100%) invert(54%) sepia(0%) saturate(724%) hue-rotate(6deg) brightness(92%) contrast(90%)}.dropup-button>*{pointer-events:none}#dropup-menu{background-color:#fff;position:absolute;transform:translateY(-100%);border-radius:5px;z-index:1;top:-.49em;box-shadow:#0003 -1px 2px 10px,#0000001a 0 2px 4px;cursor:pointer;-webkit-user-select:none;user-select:none}.dropup-menu-item{height:1.4em;padding:.28em .84em .28em .35em;display:flex;position:relative}.dropup-menu-item:hover,.dropup-menu-item:focus-visible{background-color:#f3f3f3}.dropup-menu-item:active{background-color:#ebebeb}.dropup-menu-item:active:not(:hover){background-color:transparent}.dropup-menu-item:first-child{padding-top:.49em;border-top-left-radius:inherit;border-top-right-radius:inherit}.dropup-menu-item:last-child{padding-bottom:.45em;border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.dropup-menu-item-icon{width:1.39em;position:relative}.dropup-menu-item-icon>svg{bottom:0!important;top:0!important;margin-bottom:auto;margin-top:auto}#dropup-menu-item-icon-element-custom{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.28em;filter:brightness(0) saturate(100%) invert(15%) sepia(0%) saturate(337%) hue-rotate(125deg) brightness(91%) contrast(94%)}.dropup-menu-item-text{margin-left:.56em;margin-top:.08em;width:max-content}#input{width:100%;display:inline-flex;text-align:center;margin-left:auto;margin-right:auto;margin-top:auto;position:relative;justify-content:center}#chat-view{height:100%;display:grid;grid-template-columns:100%}::-webkit-scrollbar{width:9px;height:9px}::-webkit-scrollbar-thumb{background-color:#d0d0d0;border-radius:5px}::-webkit-scrollbar-track{background-color:#f2f2f2}.deep-chat-web-model-button{margin-top:10px;margin-bottom:5px;margin-left:1px}:host{all:initial;display:table-cell}#container{height:inherit;width:inherit;overflow:hidden}`,jl=Object.defineProperty,q=function(s,t,e,n){for(var a=void 0,i=s.length-1,o;i>=0;i--)(o=s[i])&&(a=o(t,e,a)||a);return a&&jl(t,e,a),a},U=function(r){function s(){var t;b(this,s);var e;return t=N(this,s),t.getMessages=function(){return[]},t.submitUserMessage=function(){return console.warn("submitUserMessage failed - please wait for chat view to render before calling this property.")},t.addMessage=function(){return console.warn("addMessage failed - please wait for chat view to render before calling this property.")},t.updateMessage=function(){},t.clearMessages=function(){},t.focusInput=function(){return ln.focusFromParentElement(t._elementRef)},t.refreshMessages=function(){},t.scrollToBottom=function(){},t.disableSubmitButton=function(){},t.setPlaceholderText=function(){},t._hasBeenRendered=!1,t._auxiliaryStyleApplied=!1,t._elementRef=document.createElement("div"),t._elementRef.id="container",t.attachShadow({mode:"open"}).appendChild(t._elementRef),(e=t.shadowRoot)==null||e.appendChild(ve.buildElement()),on.apply(Ul,t.shadowRoot),setTimeout(function(){t._hasBeenRendered||t.onRender()},20),t}return B(s,r),_(s,[{key:"changeToChatView",value:function(){this._activeService&&(this._activeService.validateKeyProperty=!1),this.onRender()}},{key:"onRender",value:function(){var e;Qn.attemptAppendStyleSheetToHead(this.style),ie.processConnect(this),(!this._activeService||this._activeService.demo)&&(this._activeService=zo.create(this)),this.auxiliaryStyle&&!this._auxiliaryStyleApplied&&(on.apply(this.auxiliaryStyle,this.shadowRoot),this._auxiliaryStyleApplied=!0),on.applyDefaultStyleToComponent(this.style,this.chatStyle),ie.checkForContainerStyles(this,this._elementRef),this._activeService.key&&this._activeService.validateKeyProperty?as.render(this._elementRef,this.changeToChatView.bind(this),this._activeService):!(this._activeService instanceof te)||this._activeService.key?((e=this._childElement)!==null&&e!==void 0||(this._childElement=this.children[0]),Fl.render(this,this._elementRef,this._activeService,this._childElement)):this._activeService instanceof te&&ho.render(this._elementRef,this.changeToChatView.bind(this),this._activeService),this._hasBeenRendered||Xe.onRender(this),this._hasBeenRendered=!0}},{key:"disconnectedCallback",value:function(){In.chat=void 0}}])}(oo);q([H("object")],U.prototype,"connect"),q([H("object")],U.prototype,"directConnection"),q([H("object")],U.prototype,"webModel"),q([H("object")],U.prototype,"requestBodyLimits"),q([H("function")],U.prototype,"requestInterceptor"),q([H("function")],U.prototype,"responseInterceptor"),q([H("function")],U.prototype,"validateInput"),q([H("function")],U.prototype,"loadHistory"),q([H("object")],U.prototype,"chatStyle"),q([H("object")],U.prototype,"attachmentContainerStyle"),q([H("object")],U.prototype,"dropupStyles"),q([H("object")],U.prototype,"inputAreaStyle"),q([H("object")],U.prototype,"textInput"),q([H("object")],U.prototype,"submitButtonStyles"),q([H("object")],U.prototype,"customButtons"),q([H("string")],U.prototype,"auxiliaryStyle"),q([H("array")],U.prototype,"history"),q([H("object")],U.prototype,"browserStorage"),q([H("object")],U.prototype,"introMessage"),q([H("object")],U.prototype,"avatars"),q([H("object")],U.prototype,"names"),q([H("object")],U.prototype,"displayLoadingBubble"),q([H("object")],U.prototype,"errorMessages"),q([H("object")],U.prototype,"messageStyles"),q([H("object")],U.prototype,"textToSpeech"),q([H("object")],U.prototype,"speechToText"),q([H("object")],U.prototype,"images"),q([H("object")],U.prototype,"gifs"),q([H("object")],U.prototype,"camera"),q([H("object")],U.prototype,"audio"),q([H("object")],U.prototype,"microphone"),q([H("object")],U.prototype,"mixedFiles"),q([H("object")],U.prototype,"dragAndDrop"),q([H("object")],U.prototype,"introPanelStyle"),q([H("object")],U.prototype,"htmlClassUtilities"),q([H("object")],U.prototype,"remarkable"),q([H("object")],U.prototype,"focusMode"),q([H("function")],U.prototype,"onMessage"),q([H("function")],U.prototype,"onClearMessages"),q([H("function")],U.prototype,"onComponentRender"),q([H("function")],U.prototype,"onInput"),q([H("function")],U.prototype,"onError"),q([H("object")],U.prototype,"demo"),q([H("object")],U.prototype,"_insertKeyViewStyles"),customElements.define("deep-chat",U);const Hl=(r,s)=>{const t=r.__vccOpts||r;for(const[e,n]of s)t[e]=n;return t},ql={name:"UIDeepChat",props:["id","props","state"],inject:["$socket"],data(){return{conversation:[],signals:void 0}},computed:{deepChatStyle(){return{width:"100%",maxWidth:"600px",height:"80vh",borderRadius:"8px"}},textInputConfig(){return{placeholder:{text:this.props.placeholder||"Type a message..."}}},introMessageConfig(){return{text:this.props.introMessage||"Hello! How can I help you today?"}},connectConfig(){return{handler:this.handleConnection}}},mounted(){this.$socket.on("msg-input:"+this.id,r=>{this.handleNodeREDResponse(r)})},beforeUnmount(){this.$socket.off("msg-input:"+this.id)},methods:{async handleConnection(r,s){this.signals=s;try{let t=[],e=[];if(r instanceof FormData){for(let[a,i]of r.entries())if(a.startsWith("message"))try{const o=JSON.parse(i);t.push(o)}catch(o){console.error("Error parsing message:",o)}else a==="files"&&e.push(i);if(e.length>0){const a=await this.processFiles(e);if(t.length>0){const i=t[t.length-1];i.files=a}else t.push({role:"user",text:"",files:a}),console.log("lus777",t)}}else r.messages&&(t=r.messages);this.conversation.push(...t);const n=this.formatForChatGPT(this.conversation);this.sendToNodeRED(n,s)}catch(t){console.error("Error in handleConnection:",t),this.sendErrorResponse("Sorry, there was an error processing your message.")}},async processFiles(r){try{return await Promise.all(r.map(async s=>s instanceof File?s.type.startsWith("image/")?await this.processImageFile(s):s.type.startsWith("audio/")?await this.processAudioFile(s):await this.processDocumentFile(s):s))}catch(s){return console.error("Error processing files:",s),[]}},processImageFile(r){return new Promise((s,t)=>{const e=new FileReader;e.onload=n=>s({name:r.name,type:r.type,size:r.size,src:n.target.result}),e.onerror=()=>t(new Error("Failed to read image")),e.readAsDataURL(r)})},processAudioFile(r){return new Promise((s,t)=>{const e=new FileReader;e.onload=n=>{try{const a=n.target.result;if(a.indexOf(",")===-1)throw new Error("Invalid data URL format: missing comma separator");const o=a.split(",")[1];s({name:r.name,type:r.type,size:r.size,base64Data:o})}catch(a){t(a)}},e.onerror=()=>t(new Error("Failed to read audio")),e.readAsDataURL(r)})},processDocumentFile(r){return new Promise((s,t)=>{const e=new FileReader;e.onload=n=>{try{const a=n.target.result.split(",")[1];s({name:r.name,type:r.type,size:r.size,fileData:a})}catch(a){t(a)}},e.onerror=()=>t(new Error("Failed to read document")),e.readAsDataURL(r)})},formatForChatGPT(r,s=!1){const t={messages:r.map(e=>this.formatMessage(e,s)),model:this.props.model};return this.props.tools&&(t.tools=this.props.tools),this.props.tool_choice&&(t.tool_choice=this.props.tool_choice),this.props.temperature!==void 0&&(t.temperature=this.props.temperature),this.props.max_tokens&&(t.max_tokens=this.props.max_tokens),this.props.top_p!==void 0&&(t.top_p=this.props.top_p),this.props.frequency_penalty!==void 0&&(t.frequency_penalty=this.props.frequency_penalty),this.props.presence_penalty!==void 0&&(t.presence_penalty=this.props.presence_penalty),this.props.response_format&&(t.response_format=this.props.response_format),t},formatMessage(r,s=!1){const t={role:r.role==="ai"?"assistant":"user"};return r.tool_calls?(t.tool_calls=r.tool_calls,t.content=r.content||null,t):r.role==="tool"?(t.role="tool",t.content=r.content,t.tool_call_id=r.tool_call_id,t):r.files&&r.files.length>0?(t.content=this.buildContentArray(r,s),t):(t.content=r.text||r.content||"",t)},buildContentArray(r,s){const t=[{type:"text",text:r.text||""}];return r.files.forEach(e=>{if(e.type&&e.type.startsWith("image/")&&e.src)t.push({type:"image_url",image_url:{url:e.src}});else if(!s&&e.type&&e.type.startsWith("audio/")&&e.base64Data){const n=this.getAudioFormat(e.type);t.push({type:"input_audio",input_audio:{data:e.base64Data,format:n}})}else!s&&e.fileData&&t.push({type:"file",file:{filename:e.name,file_data:e.fileData}})}),t},getAudioFormat(r){return r.includes("mp3")?"mp3":r.includes("wav")?"wav":r.includes("webm")?"webm":r.includes("m4a")?"m4a":"wav"},sendToNodeRED(r,s,t=null){this.$socket.emit("widget-action",this.id,{payload:r})},handleNodeREDResponse(r){var s,t,e,n,a,i;try{const o=r.payload,l={role:"ai",content:((s=o.message)==null?void 0:s.content)||o.content,text:((t=o.message)==null?void 0:t.content)||o.content,fullResponse:o};if((e=o.message)!=null&&e.tool_calls&&(l.tool_calls=o.message.tool_calls,l.content=o.message.content||null),this.conversation.push(l),(n=o.message)!=null&&n.tool_calls)this.$refs.deepChat.addMessage({text:`Tool **'${r.payload.message.tool_calls[0].function.name}'** aufgerufen.`,role:"ai"});else if((a=o.message)!=null&&a.content||o.content){const u={text:((i=o.message)==null?void 0:i.content)||o.content,role:"ai"};r.payload.intermediateMessage?this.$refs.deepChat.addMessage(u):this.signals.onResponse(u)}}catch(o){console.error("Error handling response:",o),this.sendErrorResponse("Error processing response")}},sendErrorResponse(r){this.$refs.deepChat.addMessage({text:r,role:"ai"},!0)}}},Vl={class:"deep-chat-container"};function zl(r,s,t,e,n,a){const i=me.resolveComponent("deep-chat");return me.openBlock(),me.createElementBlock("div",Vl,[me.createVNode(i,{ref:"deepChat",style:me.normalizeStyle(a.deepChatStyle),textInput:a.textInputConfig,introMessage:a.introMessageConfig,connect:a.connectConfig,speechToText:t.props.speechToText,camera:t.props.camera,mixedFiles:t.props.attachments,avatars:t.props.avatars,names:t.props.names,timestamps:t.props.timestamps,stream:t.props.stream},null,8,["style","textInput","introMessage","connect","speechToText","camera","mixedFiles","avatars","names","timestamps","stream"])])}const Gl=Hl(ql,[["render",zl],["__scopeId","data-v-7d066ac7"]]);Ae.UIDeepChat=Gl,Object.defineProperty(Ae,Symbol.toStringTag,{value:"Module"})});
|
|
273
273
|
//# sourceMappingURL=ui-deepchat.umd.js.map
|