deep-chat-dev 9.0.336 → 9.0.338
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/custom-elements.json +24492 -24478
- package/dist/deepChat.bundle.js +1 -1
- package/dist/deepChat.d.ts +1 -1
- package/dist/deepChat.d.ts.map +1 -1
- package/dist/deepChat.js +3 -3
- package/dist/views/chat/messages/stream/messageStream.d.ts +2 -1
- package/dist/views/chat/messages/stream/messageStream.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/deepChat.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { CameraFilesServiceConfig, FilesServiceConfig, MicrophoneFilesServiceCon
|
|
|
2
2
|
import { MessageContent, IntroMessage, MessageStyles, UserContent, OnMessage, DefaultInput } from './types/messages';
|
|
3
3
|
import { DisableSubmitButton, SubmitButtonStyles } from './types/submitButton';
|
|
4
4
|
import { RequestInterceptor, ResponseInterceptor } from './types/interceptors';
|
|
5
|
+
import { HiddenMessages, ScrollToBottomButton } from './types/scrollToBottom';
|
|
5
6
|
import { InsertKeyViewStyles } from './types/insertKeyViewStyles';
|
|
6
7
|
import { InternalHTML } from './utils/webComponent/internalHTML';
|
|
7
8
|
import { ValidationHandler } from './types/validationHandler';
|
|
@@ -9,7 +10,6 @@ import { DirectConnection } from './types/directConnection';
|
|
|
9
10
|
import { TextToSpeechConfig } from './types/textToSpeech';
|
|
10
11
|
import { SpeechToTextConfig } from './types/microphone';
|
|
11
12
|
import { BrowserStorage } from './types/browserStorage';
|
|
12
|
-
import { HiddenMessages, ScrollToBottomButton } from './types/scrollToBottom';
|
|
13
13
|
import { RemarkableOptions } from './types/remarkable';
|
|
14
14
|
import { MessageBody } from './types/messagesInternal';
|
|
15
15
|
import { ErrorMessages, OnError } from './types/error';
|
package/dist/deepChat.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deepChat.d.ts","sourceRoot":"","sources":["../src/deepChat.ts"],"names":[],"m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;IAEZ,gBAAgB,UAAS;IAEzB,sBAAsB,UAAS;IAE/B,cAAc,CAAC,EAAE,SAAS,CAAC;IAE3B,aAAa,CAAC,EAAE,WAAW,CAAC;IAE5B,kBAAkB,CAAC,EAAE,iBAAiB,CAAC;IAIvC,oBAAoB,CAAC,EAAE,mBAAmB,CAAC;;IAe3C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAc;IAE1C,OAAO,CAAC,gBAAgB;IAMf,QAAQ;IA2BjB,oBAAoB;CAGrB;AAKD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
|
package/dist/deepChat.js
CHANGED
|
@@ -89,8 +89,8 @@ function addInnerContainerElements(e,t,n){var s=this.messageElementRefs[this.mes
|
|
|
89
89
|
},{key:"classifyRoleMessages",value:function classifyRoleMessages(e,t){var n=t?N.buildRoleOuterContainerClass(t):void 0;for(var s=e.length-1;s>=0;s-=1){if(t||(n=Array.from(e[s].outerContainer[m]).find(function(p){return p.startsWith(gs);})),!n)continue;var r=e[s],o=r.outerContainer[m].contains(n),a=e[s-1],c=e[s+1],l=a==null?void 0:a.outerContainer[m].contains(n),d=c==null?void 0:c.outerContainer[m].contains(n);if(o)!l&&d?N.addNewPositionClasses(r,[li]):l&&d?N.addNewPositionClasses(r,[fr]):l&&!d?N.addNewPositionClasses(r,[di]):!l&&!d&&N.addNewPositionClasses(r,[li,di]);else if(t)break;}}},{key:"areOuterContainerClassRolesSame",value:function areOuterContainerClassRolesSame(e,t){return t?Array.from(t.outerContainer[m]).find(function(s){return s.startsWith(gs);})===N.buildRoleOuterContainerClass(e):!1;}},{key:"resetAllRoleElements",value:function resetAllRoleElements(e,t,n){if(!t&&!n)return;var s="";e.forEach(function(r,o){r.bubbleElement[m].contains(Cs)||N.revealRoleElements(r.innerContainer,t,n);var a=Array.from(r.outerContainer[m]).find(function(c){return c.startsWith(gs);});s===a&&N.hideRoleElements(e[o-1].innerContainer,t,n),s=a;});}// this is a workaround to prevent JSON.parse(JSON.stringify()) from removing the files' 'ref' property values
|
|
90
90
|
// and 'custom' property value if it is not shallow copyable
|
|
91
91
|
// note - structuredClone can fix this but it doesn't have good legacy compatibility
|
|
92
|
-
},{key:"deepCloneMessagesWithReferences",value:function deepCloneMessagesWithReferences(e){return e.map(function(t){return N.processMessageContent(t);});}},{key:"processMessageContent",value:function processMessageContent(e){if(e==null||_typeof(e)!==B)return e;if(Array.isArray(e))return e.map(function(n){return N.processMessageContent(n);});var t={};return Object.entries(e).forEach(function(_ref6){var _ref7=_slicedToArray(_ref6,2),n=_ref7[0],s=_ref7[1];n==="ref"&&s instanceof File||n==="custom"?t[n]=s:s!==null&&_typeof(s)===B?t[n]=N.processMessageContent(s):t[n]=s;}),t;}}]);}();var ut=/*#__PURE__*/function(){function ut(e,t){_classCallCheck(this,ut);this._fileAdded=!1,this._streamType="",this._hasStreamEnded=!1,this._partialText="",this._messages=e,_typeof(t)=="object"&&(this._partialRender=t.partialRender);}return _createClass(ut,[{key:"upsertStreamedMessage",value:function upsertStreamedMessage(e){if(this._hasStreamEnded)return;if((e==null?void 0:e[h])===void 0&&(e==null?void 0:e[M])===void 0)return console[f](mo);e!=null&&e.custom&&this._message&&(this._message.custom=e.custom);var t=(e==null?void 0:e[h])||(e==null?void 0:e[M])||"",n=oe.isScrollbarAtBottomOfElement(this._messages.elementRef),s=(e==null?void 0:e[h])!==void 0?h:M;if(!this._elements&&!this._message)this.setInitialState(s,t,e==null?void 0:e.role);else{if(this._streamType!==s)return console[f](sa);this.updateBasedOnType(t,s,e==null?void 0:e.overwrite);}e!=null&&e._sessionId&&(this._sessionId=e==null?void 0:e._sessionId),n&&oe.scrollToBottom(this._messages);}},{key:"setInitialState",value:function setInitialState(e,t,n){var o,a,c;this._streamType=e,n!==null&&n!==void 0?n:n=J;var s=((o=this._messages._customWrappers)==null?void 0:o[n])||((a=this._messages._customWrappers)==null?void 0:a[x]),r=s?"":t;this._elements=e===h?this._messages.addNewTextMessage(r,n):at.add(this._messages,r,n),this._elements&&(this._elements.bubbleElement[m].add(ut.MESSAGE_CLASS),this._message=_defineProperty({role:
|
|
93
|
-
},{key:"setTargetWrapperIfNeeded",value:function setTargetWrapperIfNeeded(e,t,n,s){e.bubbleElement.innerHTML=s,this._targetWrapper=Z.getTargetWrapper(e.bubbleElement),this._elements&&Z.apply(this._messages,this._elements.bubbleElement),this.updateBasedOnType(t,n);}},{key:"updateBasedOnType",value:function updateBasedOnType(e,t){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;var o;var s=this._targetWrapper||((o=this._elements)==null?void 0:o.bubbleElement);this._partialRender||N.unfillEmptyMessageElement(s,e),(t===h?this.updateText:this.updateHTML).bind(this)(e,s,n);}},{key:"updateText",value:function updateText(e,t,n){this._message&&(this._message[h]=n?e:this._message[h]+e,this._partialRender&&this.isNewPartialRenderParagraph(t,n)&&this.partialRenderNewParagraph(t),this._partialBubble?this.partialRenderBubbleUpdate(e):this._messages.renderText(t,this._message[h]));}},{key:"isNewPartialRenderParagraph",value:function isNewPartialRenderParagraph(e,t){var n;return t?(e.innerHTML="",!0):this._partialBubble?this._partialText&&this.shouldCreateNewParagraph(this._partialText):((n=this._message)==null?void 0:n[h])&&this.shouldCreateNewParagraph(this._message[h]);}},{key:"shouldCreateNewParagraph",value:function shouldCreateNewParagraph(e){var t=e.indexOf(ut.PARTIAL_RENDER_TEXT_MARK);return t===-1?!1:!e.substring(t+ut.PARTIAL_RENDER_TEXT_MARK.length).startsWith("---");}},{key:"partialRenderNewParagraph",value:function partialRenderNewParagraph(e){this._partialText="",this._partialBubble=S(),this._partialBubble[m].add("partial-render-message"),e.appendChild(this._partialBubble);}},{key:"partialRenderBubbleUpdate",value:function partialRenderBubbleUpdate(e){this._partialText+=e,this._messages.renderText(this._partialBubble,this._partialText);}},{key:"updateHTML",value:function updateHTML(e,t,n){if(this._message)if(n)this._message[M]=e,t.innerHTML=e;else{var s=S("span");s.innerHTML=e,t.appendChild(s),this._message[M]=(t==null?void 0:t.innerHTML)||"";}}},{key:"finaliseStreamedMessage",value:function finaliseStreamedMessage(){var e,
|
|
92
|
+
},{key:"deepCloneMessagesWithReferences",value:function deepCloneMessagesWithReferences(e){return e.map(function(t){return N.processMessageContent(t);});}},{key:"processMessageContent",value:function processMessageContent(e){if(e==null||_typeof(e)!==B)return e;if(Array.isArray(e))return e.map(function(n){return N.processMessageContent(n);});var t={};return Object.entries(e).forEach(function(_ref6){var _ref7=_slicedToArray(_ref6,2),n=_ref7[0],s=_ref7[1];n==="ref"&&s instanceof File||n==="custom"?t[n]=s:s!==null&&_typeof(s)===B?t[n]=N.processMessageContent(s):t[n]=s;}),t;}}]);}();var ut=/*#__PURE__*/function(){function ut(e,t){_classCallCheck(this,ut);this._fileAdded=!1,this._streamType="",this._hasStreamEnded=!1,this._partialText="",this._messages=e,_typeof(t)=="object"&&(this._partialRender=t.partialRender);}return _createClass(ut,[{key:"upsertStreamedMessage",value:function upsertStreamedMessage(e){if(this._hasStreamEnded)return;if((e==null?void 0:e[h])===void 0&&(e==null?void 0:e[M])===void 0)return console[f](mo);e!=null&&e.custom&&this._message&&(this._message.custom=e.custom);var t=(e==null?void 0:e[h])||(e==null?void 0:e[M])||"",n=oe.isScrollbarAtBottomOfElement(this._messages.elementRef),s=(e==null?void 0:e[h])!==void 0?h:M;if(!this._elements&&!this._message)this.setInitialState(s,t,e==null?void 0:e.role);else{if(this._streamType!==s)return console[f](sa);(e==null?void 0:e.role)!==this._activeMessageRole?(this.finaliseStreamedMessage(!1),this.setInitialState(s,t,e==null?void 0:e.role)):this.updateBasedOnType(t,s,e==null?void 0:e.overwrite);}e!=null&&e._sessionId&&(this._sessionId=e==null?void 0:e._sessionId),n&&oe.scrollToBottom(this._messages);}},{key:"setInitialState",value:function setInitialState(e,t,n){var o,a,c;this._streamType=e,n!==null&&n!==void 0?n:n=J;var s=((o=this._messages._customWrappers)==null?void 0:o[n])||((a=this._messages._customWrappers)==null?void 0:a[x]),r=s?"":t;this._elements=e===h?this._messages.addNewTextMessage(r,n):at.add(this._messages,r,n),this._elements&&(this._elements.bubbleElement[m].add(ut.MESSAGE_CLASS),this._activeMessageRole=n,this._message=_defineProperty({role:this._activeMessageRole},e,r),this._messages.messageToElements.push([this._message,_defineProperty({},e,this._elements)]),s&&this.setTargetWrapperIfNeeded(this._elements,t,this._streamType,s),(c=this._messages.scrollButton)==null||c.update());}// not using existing htmlUtils htmlWrappers logic to be able to stream html
|
|
93
|
+
},{key:"setTargetWrapperIfNeeded",value:function setTargetWrapperIfNeeded(e,t,n,s){e.bubbleElement.innerHTML=s,this._targetWrapper=Z.getTargetWrapper(e.bubbleElement),this._elements&&Z.apply(this._messages,this._elements.bubbleElement),this.updateBasedOnType(t,n);}},{key:"updateBasedOnType",value:function updateBasedOnType(e,t){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;var o;var s=this._targetWrapper||((o=this._elements)==null?void 0:o.bubbleElement);this._partialRender||N.unfillEmptyMessageElement(s,e),(t===h?this.updateText:this.updateHTML).bind(this)(e,s,n);}},{key:"updateText",value:function updateText(e,t,n){this._message&&(this._message[h]=n?e:this._message[h]+e,this._partialRender&&this.isNewPartialRenderParagraph(t,n)&&this.partialRenderNewParagraph(t),this._partialBubble?this.partialRenderBubbleUpdate(e):this._messages.renderText(t,this._message[h]));}},{key:"isNewPartialRenderParagraph",value:function isNewPartialRenderParagraph(e,t){var n;return t?(e.innerHTML="",!0):this._partialBubble?this._partialText&&this.shouldCreateNewParagraph(this._partialText):((n=this._message)==null?void 0:n[h])&&this.shouldCreateNewParagraph(this._message[h]);}},{key:"shouldCreateNewParagraph",value:function shouldCreateNewParagraph(e){var t=e.indexOf(ut.PARTIAL_RENDER_TEXT_MARK);return t===-1?!1:!e.substring(t+ut.PARTIAL_RENDER_TEXT_MARK.length).startsWith("---");}},{key:"partialRenderNewParagraph",value:function partialRenderNewParagraph(e){this._partialText="",this._partialBubble=S(),this._partialBubble[m].add("partial-render-message"),e.appendChild(this._partialBubble);}},{key:"partialRenderBubbleUpdate",value:function partialRenderBubbleUpdate(e){this._partialText+=e,this._messages.renderText(this._partialBubble,this._partialText);}},{key:"updateHTML",value:function updateHTML(e,t,n){if(this._message)if(n)this._message[M]=e,t.innerHTML=e;else{var s=S("span");s.innerHTML=e,t.appendChild(s),this._message[M]=(t==null?void 0:t.innerHTML)||"";}}},{key:"finaliseStreamedMessage",value:function finaliseStreamedMessage(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;var t,n;if(!(this._endStreamAfterOperation||!this._message)&&!(this._fileAdded&&!this._elements)){if(!this._elements)throw Error(ia);(t=this._elements.bubbleElement)!=null&&t[m].contains(ut.MESSAGE_CLASS)&&(this._streamType===h?this._messages.textToSpeech&&hn.speak(this._message[h]||"",this._messages.textToSpeech):this._streamType===M&&this._elements&&Z.apply(this._messages,this._elements.outerContainer),this._elements.bubbleElement[m].remove(ut.MESSAGE_CLASS),this._message&&(this._sessionId&&(this._message._sessionId=this._sessionId),this._messages.sendClientUpdate(Je.createMessageContent(this._message),!1),(n=this._messages.browserStorage)==null||n.addMessages(this._messages.messageToElements.map(function(_ref9){var _ref0=_slicedToArray(_ref9,1),s=_ref0[0];return s;}))),this._hasStreamEnded=e);}}},{key:"markFileAdded",value:function markFileAdded(){this._fileAdded=!0;}// prettier-ignore
|
|
94
94
|
},{key:"endStreamAfterFileDownloaded",value:function(){var _endStreamAfterFileDownloaded=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(e,t){var _yield$t,n,s;return _regenerator().w(function(_context2){while(1)switch(_context2.n){case 0:this._endStreamAfterOperation=!0;_context2.n=1;return t();case 1:_yield$t=_context2.v;n=_yield$t.text;s=_yield$t.files;n&&this.updateBasedOnType(n,h,!0),this._endStreamAfterOperation=!1,this.finaliseStreamedMessage(),s&&e.addNewMessage(_defineProperty({},y,s));case 2:return _context2.a(2);}},_callee2,this);}));function endStreamAfterFileDownloaded(_x3,_x4){return _endStreamAfterFileDownloaded.apply(this,arguments);}return endStreamAfterFileDownloaded;}()}]);}();ut.MESSAGE_CLASS="streamed-message",ut.PARTIAL_RENDER_TEXT_MARK="\n\n";var et=ut;var L=/*#__PURE__*/function(){function L(){_classCallCheck(this,L);}return _createClass(L,null,[{key:"tempRemoveContentHeader",value:// need to pass stringifyBody boolean separately as binding is throwing an error for some reason
|
|
95
95
|
// prettier-ignore
|
|
96
96
|
function(){var _tempRemoveContentHeader=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(e,t,n){var s,r,_t3;return _regenerator().w(function(_context3){while(1)switch(_context3.p=_context3.n){case 0:if(e!=null&&e.headers){_context3.n=1;break;}throw new Error(Ie);case 1:s=e.headers[D];delete e.headers[D];_context3.p=2;_context3.n=3;return t(n);case 3:r=_context3.v;_context3.n=5;break;case 4:_context3.p=4;_t3=_context3.v;throw e.headers[D]=s,_t3;case 5:return _context3.a(2,(e.headers[D]=s,r));}},_callee3,null,[[2,4]]);}));function tempRemoveContentHeader(_x9,_x0,_x1){return _tempRemoveContentHeader.apply(this,arguments);}return tempRemoveContentHeader;}()},{key:"displayError",value:function displayError(e,t){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"Service error, please try again.";if(console[f](t),_typeof(t)===B)return t instanceof Error?e.addNewErrorMessage(Y,t.message):Array.isArray(t)||typeof t[f]=="string"?e.addNewErrorMessage(Y,t):Object.keys(t).length===0?e.addNewErrorMessage(Y,n):e.addNewErrorMessage(Y,JSON.stringify(t));e.addNewErrorMessage(Y,t);}// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -279,4 +279,4 @@ function addClickEvent(e,t,n,s){var r=ar.createCameraModalFunc(e,t,n,s);this.ele
|
|
|
279
279
|
function createFileUploadComponents(e,t,n,s){var o,a,c,l;var r=new ms(this.elementRef,e.attachmentContainerStyle,t.demo);if(nn.createUploadButtons(e,t,t.fileTypes||{},r,n,s),(o=t[Re])!=null&&o[y]){var d=((a=s[V])==null?void 0:a.fileType)||r.addType(e,t,t[Re][y],V);s[Re]={button:new cr(n,d,t[Re])};}if((c=t.recordAudio)!=null&&c[y]){var _d3=((l=s[P])==null?void 0:l.fileType)||r.addType(e,t,t.recordAudio[y],P);s.microphone={button:new rh(_d3,t.recordAudio)};}return mt.isEnabled(r,e.dragAndDrop)&&mt.create(n,r,e.dragAndDrop),r;}// prettier-ignore
|
|
280
280
|
}],[{key:"createPanelElement",value:function createPanelElement(e){var t=S();return t.id="input",Object.assign(t[_],e),t;}},{key:"createUploadButtons",value:function createUploadButtons(e,t,n,s,r,o){Object.keys(n).forEach(function(a){var c=a,l=n[c];if(l[y]){var d=s.addType(e,t,l[y],c),_Ud$c=Ud[c],p=_Ud$c.id,u=_Ud$c.svgString,g=_Ud$c.dropupText,b=new Js(r,d,l,p,u,g);o[c]={button:b,fileType:d};}});}// prettier-ignore
|
|
281
281
|
},{key:"addElements",value:function addElements(e,t,n,s,r,o){oe.addElements(e,t.elementRef);var a=gn.create(),c=we.addButtons(a,n,s,o);Zn.set(t.inputElementRef,a,r.elementRef,c),gn.add(e,a);}},{key:"assignOnInput",value:function assignOnInput(e,t,n,s){t.onInput=function(r){setTimeout(function(){var o=n.getAllFileData(),a=s.inputElementRef.innerText.trim(),c=_defineProperty({},h,a);o&&(c[y]=o.map(function(l){return l[Q];})),Jt.onInput(e,c,r);});};}}]);}();var lr=/*#__PURE__*/function(){function lr(){_classCallCheck(this,lr);}return _createClass(lr,null,[{key:"createElements",value:function createElements(e,t,n){var s=S();s.id="chat-view";var r=!e.focusMode&&e.upwardsMode;s.classList.add(r?Md:Id);var o=new Ve(e,t,n);t.websocket&&Ee.createConnection(t,o);var a=new nn(e,o,t,s),c=r?o.elementRef.parentElement:o.elementRef;return oe.addElements(s,c,a.elementRef),s;}},{key:"render",value:function render(e,t,n,s){var r=lr.createElements(e,n,s);t.replaceChildren(r),n.isCustomView()&&n.setUpView(r,t);}}]);}();var uh="#validate-property-key-view{height:100%;position:relative;display:flex;justify-content:center;align-items:center;padding:8px}#loading-validate-key-property{display:inline-block;width:50px;height:50px}#loading-validate-key-property:after{content:\" \";display:block;width:38px;height:38px;margin:1px;border-radius:50%;border:5px solid #5fb2ff;border-color:#5fb2ff transparent #5fb2ff transparent;animation:loading-spinner 1.4s linear infinite}#deep-chat-openai-realtime-container{height:100%;width:100%}#deep-chat-openai-realtime-avatar-container{height:60%;width:100%;display:flex;justify-content:center;align-items:center}#deep-chat-openai-realtime-avatar{border-radius:50%;height:110px;border:1px solid rgb(215,215,215);padding:8px;-webkit-user-select:none;user-select:none;margin-top:20px}#deep-chat-openai-realtime-buttons-container{height:40%;display:flex;position:relative}.deep-chat-openai-realtime-button-container{height:100%;width:50%;display:flex;justify-content:center;align-items:center}.deep-chat-openai-realtime-button{width:70px;height:70px;border-radius:50%;display:flex;justify-content:center;align-items:center;cursor:pointer}.deep-chat-openai-realtime-button-default{background-color:#e3e3e3}.deep-chat-openai-realtime-button-default:hover{background-color:#d4d4d4}.deep-chat-openai-realtime-button-default:active{background-color:#c5c5c5}.deep-chat-openai-realtime-button-loading{opacity:.7;pointer-events:none}.deep-chat-openai-realtime-microphone-active{background-color:#ffe7e7}.deep-chat-openai-realtime-microphone-active:hover{background-color:#ffdede}.deep-chat-openai-realtime-microphone-active:active{background-color:#ffd2d2}.deep-chat-openai-realtime-microphone>*{height:30px;width:30px}.deep-chat-openai-realtime-microphone-active>*{filter:brightness(0) saturate(100%) invert(35%) sepia(60%) saturate(1360%) hue-rotate(325deg) brightness(95%) contrast(92%)}.deep-chat-openai-realtime-toggle>*{height:32px;width:32px;padding-inline-start:3px;filter:brightness(0) saturate(100%) invert(22%) sepia(0%) saturate(4537%) hue-rotate(208deg) brightness(105%) contrast(91%)}.deep-chat-openai-realtime-button-unavailable{opacity:.45;pointer-events:none}#deep-chat-openai-realtime-error{color:red;position:absolute;top:calc(50% + 40px);inset-inline-start:50%;transform:translate(-50%,-50%);font-size:17px}#deep-chat-openai-realtime-loading{position:absolute;font-size:15px;top:50%;inset-inline-start:50%;transform:translate(-50%,-50%)}#insert-key-view{height:100%;position:relative}#insert-key-contents{text-align:center;position:absolute;inset-block-start:44%;inset-inline-start:50%;transform:translate(-50%,-50%);width:82%;display:flex;max-width:700px}#insert-key-title{margin-bottom:15px}#insert-key-input-container{margin-inline-end:2.7em;width:calc(100% - 80px)}#insert-key-input{padding:.3em 1.7em .3em .3em;border-width:1px;border-style:solid;border-radius:3px;width:100%;font-size:inherit}.insert-key-input-valid{border-color:gray}.insert-key-input-invalid{border-color:red}#visibility-icon-container{position:relative;float:inline-end;cursor:pointer;-webkit-user-select:none;user-select:none}.visibility-icon{filter:brightness(0) saturate(100%) invert(63%) sepia(1%) saturate(9%) hue-rotate(43deg) brightness(98%) contrast(92%);position:absolute;inset-inline-end:-1.7em;inset-block-start:-1.43em}#visible-icon{inset-block-start:-1.4em}.visibility-icon:hover{filter:unset}.visibility-icon>*{pointer-events:none}#start-button{border:1px solid grey;color:#454545;border-radius:4px;width:3em;display:flex;justify-content:center;align-items:center;cursor:pointer;padding:.28em .3em;-webkit-user-select:none;user-select:none;background-color:#fff}#start-button:hover{background-color:#f2f2f2}#start-button:active{background-color:#d2d2d2}#insert-key-help-text-container{width:100%;position:absolute;margin-top:32px;margin-bottom:20px}#insert-key-help-text-contents{width:100%;position:absolute}#insert-key-input-invalid-text{display:block;margin-top:1em;margin-bottom:.5em;color:red}.insert-key-input-help-text{display:block;margin-top:16px}#loading-key{display:inline-block;width:16px;height:16px}#loading-key:after{content:\" \";display:block;width:11px;height:11px;margin:1px;border-radius:50%;border:2px solid #0084ff;border-color:#0084ff transparent #0084ff transparent;animation:loading-spinner 1.2s linear infinite}#error-view{color:red;font-size:1.2em;line-height:1.3em;margin-top:-5px;text-align:center;height:100%;display:flex;justify-content:center;align-items:center;padding-inline:8px}@keyframes loading-spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.intro-panel{position:absolute;display:flex;justify-content:center;right:0;bottom:0;left:0;margin:auto;height:fit-content;top:-2.5em}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!\n Theme: a11y-dark\n Author: @ericwbailey\n Maintainer: @ericwbailey\n\n Based on the Tomorrow Night Eighties theme: https://github.com/isagalaev/highlight.js/blob/master/src/styles/tomorrow-night-eighties.css\n*/.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,.deep-chat-upwards-mode #messages>div{overflow:auto;overflow-anchor:none}.deep-chat-upwards-mode #messages{height:100%;display:flex;flex-direction:column;justify-content:flex-end}.outer-message-container:last-child{margin-bottom:5px}.inner-message-container{display:flex;margin-inline: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-inline-end:0px;margin-inline-start:auto}.ai-message-text{color:#000;background-color:#e4e6eb;margin-inline-start:0px;margin-inline-end:auto}.deep-chat-last-group-messages-active{height:100%}#scroll-button{position:absolute;top:75%;left:50%;right:50%;transform:translate(-50%,-50%);transition:opacity .1s ease;display:flex;opacity:0;padding:8px;width:fit-content;height:fit-content;background-color:#fff;border:.5px solid #000000;z-index:2;justify-content:center;align-items:center;border-radius:10px;white-space:nowrap;cursor:pointer}#scroll-button:hover{background-color:#fafafa}.loading-history-message-full-view{position:absolute;height:70%;width:100%;display:flex;align-items:center}.deep-chat-upwards-mode #messages .loading-history-message-full-view{height:100%}.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-inline:auto;background-color:#f4c0c0;color:#474747;text-align:center;max-width:95%;margin-top:14px;margin-bottom:10px}.deep-chat-loading-message-dots-container{width:1em;padding-top:.6em;padding-bottom:.6em;padding-inline-start:1.3em;padding-inline-end:.75em}.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{inset-inline-start:-.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{inset-inline-start:.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,.html-wrapper>p:first-child{margin-top:0}.message-bubble>p:last-child,.message-bubble>.partial-render-message:last-child>p,.html-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-start{float:inline-start}.audio-player-safari-end{float:inline-end}.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-inline-start:6px;margin-inline-end: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-inline-end:7px}.message-bubble>a{color:inherit}.start-item-position{margin-inline-end:10px}.end-item-position{margin-inline-start: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:start;background-color:#d7d7d73b;padding-inline-start:4px}.file-attachment{width:2.85em;height:2.85em;display:inline-flex;margin-inline-end:.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{inset-inline: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-inline-start:.26rem}.audio-placeholder-text-4-digits{padding-inline-start:.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-inline-start:.13em;margin-inline:auto}.remove-file-attachment-button{height:1.25em;width:1.25em;border:1px solid #cfcfcf;border-radius:25px;background-color:#fff;top:-4px;inset-inline-end:-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-inline:1px solid rgb(217,217,217);border-start-start-radius:inherit;border-start-end-radius:inherit;background-color:#fff;overflow-y:auto;height:fit-content;max-height:calc(100% - 3.3em);width:100%}.modal-content>p{margin-inline:1em}.modal-content>ul{margin-inline-end: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-end-start-radius:inherit;border-end-end-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;inset-block:0;margin-top:auto;margin-bottom:auto;cursor:pointer;-webkit-user-select:none;user-select:none;margin-inline:.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-end{position:absolute;inset-inline-end:calc(10% + .35em);inset-block-end:.85em}.inside-start{position:absolute;inset-inline-start:calc(10% + .35em);inset-block-end:.85em}.outside-start{position:absolute;inset-inline-end:calc(11px - .55em);inset-block-end:.88em}.outside-end{position:absolute;inset-inline-start:calc(11px - .55em);inset-block-end:.88em}#upload-images-icon{position:absolute;pointer-events:none;width:1.45em;height:1.45em;inset-inline-start:.11em;inset-block-end:.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;inset-inline-start:.07em;inset-block-end:.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;inset-inline-start:.17em;inset-block-end:.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;inset-inline-start:.23em;inset-block-end:.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;inset-inline-start:.25em;inset-block-end:.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;inset-inline-start:.25em;inset-block-end:.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;inset-inline-start:.35em;inset-block-end:.35em;border-radius:2px}.submit-button-enlarged{scale:1.1;margin-inline:.3em}.loading-submit-button{position:relative;inset-inline-start: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;inset-block-end:-.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;padding-inline: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-inline-start: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-inline: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;inset-inline-start:.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-start-adjustment{margin-inline-start:1.5em}.text-input-container-end-adjustment{margin-inline-end:1.5em}.text-input-container-start-small-adjustment{margin-inline-start:1.1em}.text-input-container-start-small-adjustment>.outside-start{inset-inline-end:calc(14px - .55em)}.text-input-container-end-small-adjustment{margin-inline-end:1.1em}.text-input-container-end-small-adjustment>.outside-end{inset-inline-start:calc(14px - .55em)}#text-input{text-align:start;outline:none;word-wrap:break-word;line-break:auto}.text-input-styling{padding:.4em .5em;overflow:overlay;width:100%}.text-input-inner-start-adjustment{padding-inline-start:2.2em}.text-input-inner-end-adjustment{padding-inline-end: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-end>#dropup-menu,.inside-end>#dropup-menu{inset-inline-end:0px}#dropup-icon{position:absolute;pointer-events:none;width:1.16em;height:1.2em;inset-inline-start:.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-inline-start:.35em;padding-inline-end:.84em;padding-top:.28em;padding-bottom:.28em;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-start-start-radius:inherit;border-start-end-radius:inherit}.dropup-menu-item:last-child{padding-bottom:.45em;border-end-start-radius:inherit;border-end-end-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;inset-inline-start:.28em;filter:brightness(0) saturate(100%) invert(15%) sepia(0%) saturate(337%) hue-rotate(125deg) brightness(91%) contrast(94%)}.dropup-menu-item-text{margin-inline-start:.56em;margin-top:.08em;width:max-content}#input{width:100%;display:inline-flex;text-align:center;margin-inline:auto;margin-top:auto;position:relative;justify-content:center}#chat-view{height:100%;grid-template-columns:100%}.deep-chat-downwards-mode{display:grid}.deep-chat-upwards-mode{display:flex;flex-direction:column}::-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-inline-start:1px}:host{all:initial;display:table-cell}#container{height:inherit;width:inherit;overflow:hidden}";var ph=Object.defineProperty,O=function O(i,e,t,n){for(var s=void 0,r=i.length-1,o;r>=0;r--)(o=i[r])&&(s=o(e,t,s)||s);return s&&ph(e,t,s),s;};var I=/*#__PURE__*/function(_Si){function I(){var _this125;_classCallCheck(this,I);var e;_this125=_callSuper(this,I),_this125.getMessages=function(){return[];},_this125.submitUserMessage=function(){return console.warn(gr("submitUserMessage"));},_this125.addMessage=function(){return console.warn(gr("addMessage"));},_this125.updateMessage=function(){},_this125.clearMessages=function(){},_this125.focusInput=function(){return zt.focusFromParentElement(_this125._elementRef);},_this125.refreshMessages=function(){},_this125.scrollToBottom=function(){},_this125.disableSubmitButton=function(){},_this125.setPlaceholderText=function(){},_this125._hasBeenRendered=!1,_this125._auxiliaryStyleApplied=!1,_this125._elementRef=S(),_this125._elementRef.id="container",_this125.attachShadow({mode:"open"}).appendChild(_this125._elementRef),(e=_this125.shadowRoot)==null||e.appendChild(tt.buildElement()),Jn.apply(uh,_this125.shadowRoot),setTimeout(function(){_this125._hasBeenRendered||_this125.onRender();},20);return _this125;}_inherits(I,_Si);return _createClass(I,[{key:"changeToChatView",value:function changeToChatView(){this._activeService&&(this._activeService.validateKeyProperty=!1),this.onRender();}// prettier-ignore
|
|
282
|
-
},{key:"onRender",value:function onRender(){var _this$_childElement;Ts.attemptAppendStyleSheetToHead(this.style),te.processConnect(this),(!this._activeService||this._activeService.demo)&&(
|
|
282
|
+
},{key:"onRender",value:function onRender(){var _this$_childElement;Ts.attemptAppendStyleSheetToHead(this.style),te.processConnect(this),(!this._activeService||this._activeService.demo)&&(this._activeService=Rd.create(this)),this.auxiliaryStyle&&!this._auxiliaryStyleApplied&&(Jn.apply(this.auxiliaryStyle,this.shadowRoot),this._auxiliaryStyleApplied=!0),Jn.applyDefaultStyleToComponent(this.style,this.chatStyle),te.checkForContainerStyles(this,this._elementRef),this._activeService.key&&this._activeService.validateKeyProperty?ws.render(this._elementRef,this.changeToChatView.bind(this),this._activeService):!(this._activeService instanceof R)||this._activeService.key?((_this$_childElement=this._childElement)!==null&&_this$_childElement!==void 0?_this$_childElement:this._childElement=this.children[0],lr.render(this,this._elementRef,this._activeService,this._childElement)):this._activeService instanceof R&&Ae.render(this._elementRef,this.changeToChatView.bind(this),this._activeService),this._hasBeenRendered||Jt.onRender(this),this._hasBeenRendered=!0;}},{key:"disconnectedCallback",value:function disconnectedCallback(){ls.chat=void 0;}}]);}(Si);O([k("object")],I.prototype,"connect");O([k("object")],I.prototype,"directConnection");O([k("object")],I.prototype,"webModel");O([k("object")],I.prototype,"requestBodyLimits");O([k("function")],I.prototype,"requestInterceptor");O([k("function")],I.prototype,"responseInterceptor");O([k("function")],I.prototype,"validateInput");O([k("function")],I.prototype,"loadHistory");O([k("object")],I.prototype,"chatStyle");O([k("object")],I.prototype,"attachmentContainerStyle");O([k("object")],I.prototype,"dropupStyles");O([k("object")],I.prototype,"inputAreaStyle");O([k("object")],I.prototype,"textInput");O([k("object")],I.prototype,"defaultInput");O([k("object")],I.prototype,"submitButtonStyles");O([k("object")],I.prototype,"customButtons");O([k("string")],I.prototype,"auxiliaryStyle");O([k("array")],I.prototype,"history");O([k("object")],I.prototype,"browserStorage");O([k("object")],I.prototype,"introMessage");O([k("object")],I.prototype,"avatars");O([k("object")],I.prototype,"names");O([k("object")],I.prototype,"displayLoadingBubble");O([k("object")],I.prototype,"errorMessages");O([k("object")],I.prototype,"messageStyles");O([k("object")],I.prototype,"textToSpeech");O([k("object")],I.prototype,"speechToText");O([k("object")],I.prototype,"images");O([k("object")],I.prototype,"gifs");O([k("object")],I.prototype,"camera");O([k("object")],I.prototype,"audio");O([k("object")],I.prototype,"microphone");O([k("object")],I.prototype,"mixedFiles");O([k("object")],I.prototype,"dragAndDrop");O([k("object")],I.prototype,"htmlWrappers");O([k("object")],I.prototype,"htmlClassUtilities");O([k("object")],I.prototype,"remarkable");O([k("object")],I.prototype,"focusMode");O([k("boolean")],I.prototype,"upwardsMode");O([k("object")],I.prototype,"hiddenMessages");O([k("object")],I.prototype,"scrollButton");O([k("number")],I.prototype,"maxVisibleMessages");O([k("function")],I.prototype,"onMessage");O([k("function")],I.prototype,"onClearMessages");O([k("function")],I.prototype,"onComponentRender");O([k("function")],I.prototype,"onInput");O([k("function")],I.prototype,"onError");O([k("object")],I.prototype,"demo");O([k("object")],I.prototype,"_insertKeyViewStyles");customElements.define("deep-chat",I);export{I as DeepChat};
|
|
@@ -12,6 +12,7 @@ export declare class MessageStream {
|
|
|
12
12
|
private _streamType;
|
|
13
13
|
private _elements?;
|
|
14
14
|
private _hasStreamEnded;
|
|
15
|
+
private _activeMessageRole?;
|
|
15
16
|
private _message?;
|
|
16
17
|
private _endStreamAfterOperation?;
|
|
17
18
|
private _partialText;
|
|
@@ -29,7 +30,7 @@ export declare class MessageStream {
|
|
|
29
30
|
private partialRenderNewParagraph;
|
|
30
31
|
private partialRenderBubbleUpdate;
|
|
31
32
|
private updateHTML;
|
|
32
|
-
finaliseStreamedMessage(): void;
|
|
33
|
+
finaliseStreamedMessage(hasStreamEnded?: boolean): void;
|
|
33
34
|
markFileAdded(): void;
|
|
34
35
|
endStreamAfterFileDownloaded(messages: Messages, downloadCb: () => Promise<{
|
|
35
36
|
files?: MessageFile[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageStream.d.ts","sourceRoot":"","sources":["../../../../../src/views/chat/messages/stream/messageStream.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,WAAW,EAAC,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAkB,QAAQ,EAAC,MAAM,aAAa,CAAC;AACtD,OAAO,EAAC,QAAQ,EAAC,MAAM,4BAA4B,CAAC;AAGpD,OAAO,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAQ7C,qBAAa,aAAa;IACxB,MAAM,CAAC,QAAQ,CAAC,aAAa,sBAAsB;IACnD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,wBAAwB,CAAU;IAC1D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAU;IAC1C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAe;IACzC,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,WAAW,CAA4B;IAC/C,OAAO,CAAC,SAAS,CAAC,CAAkB;IACpC,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,CAAkB;IACnC,OAAO,CAAC,wBAAwB,CAAC,CAAU;IAC3C,OAAO,CAAC,YAAY,CAAc;IAClC,OAAO,CAAC,cAAc,CAAC,CAAiB;IACxC,OAAO,CAAC,cAAc,CAAC,CAAc;IACrC,OAAO,CAAC,UAAU,CAAC,CAAS;gBAEhB,QAAQ,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,MAAM;IAO5C,qBAAqB,CAAC,QAAQ,CAAC,EAAE,QAAQ;
|
|
1
|
+
{"version":3,"file":"messageStream.d.ts","sourceRoot":"","sources":["../../../../../src/views/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