@singlebase/elements 0.7.0 → 0.8.0
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/dist/authui-display-C2o9gApg.cjs +961 -0
- package/dist/authui-display-C2o9gApg.cjs.map +1 -0
- package/dist/{authui-display-BM_F3-5e.js → authui-display-CRUABt43.js} +1009 -862
- package/dist/authui-display-CRUABt43.js.map +1 -0
- package/dist/authui.cjs +1 -1
- package/dist/authui.js +2 -2
- package/dist/{chat-ezUmd9II.cjs → chat-BWcGH9lr.cjs} +2 -2
- package/dist/chat-BWcGH9lr.cjs.map +1 -0
- package/dist/{chat-BH_3e1jT.js → chat-t4o5FsxM.js} +5 -5
- package/dist/chat-t4o5FsxM.js.map +1 -0
- package/dist/chat.cjs +1 -1
- package/dist/chat.js +1 -1
- package/dist/elements/authui-account.d.ts +0 -1
- package/dist/elements/authui-buttons.d.ts +1 -1
- package/dist/elements/authui.d.ts +25 -1
- package/dist/elements/chat.d.ts +3 -3
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/messages.d.ts +34 -3
- package/dist/singlebase-elements.min.js +2197 -2021
- package/dist/singlebase-elements.min.js.map +1 -1
- package/dist/{uploader-COP8PkJ6.cjs → uploader-C57vgFME.cjs} +27 -1
- package/dist/uploader-C57vgFME.cjs.map +1 -0
- package/dist/{uploader-tdMU9Gxv.js → uploader-Cz9yfzfV.js} +27 -1
- package/dist/uploader-Cz9yfzfV.js.map +1 -0
- package/dist/uploader.cjs +1 -1
- package/dist/uploader.js +1 -1
- package/dist/utils/auth-errors.d.ts +7 -0
- package/dist/utils/oauth.d.ts +24 -0
- package/dist/utils/password.d.ts +16 -0
- package/package.json +3 -3
- package/dist/authui-display-BM_F3-5e.js.map +0 -1
- package/dist/authui-display-CMVHTNFz.cjs +0 -956
- package/dist/authui-display-CMVHTNFz.cjs.map +0 -1
- package/dist/chat-BH_3e1jT.js.map +0 -1
- package/dist/chat-ezUmd9II.cjs.map +0 -1
- package/dist/uploader-COP8PkJ6.cjs.map +0 -1
- package/dist/uploader-tdMU9Gxv.js.map +0 -1
package/dist/authui.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./authui-display-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./authui-display-C2o9gApg.cjs"),r=require("./uploader-C57vgFME.cjs"),t=require("@singlebase/core");exports.AuthController=e.AuthController;exports.SettingsController=e.SettingsController;Object.defineProperty(exports,"SinglebaseAccountScreen",{enumerable:!0,get:()=>e.SinglebaseAccountScreen});Object.defineProperty(exports,"SinglebaseAuthButtons",{enumerable:!0,get:()=>e.SinglebaseAuthButtons});Object.defineProperty(exports,"SinglebaseAuthDisplay",{enumerable:!0,get:()=>e.SinglebaseAuthDisplay});Object.defineProperty(exports,"SinglebaseAuthGuard",{enumerable:!0,get:()=>e.SinglebaseAuthGuard});Object.defineProperty(exports,"SinglebaseAuthScreen",{enumerable:!0,get:()=>e.SinglebaseAuthScreen});exports.defaultMessages=e.defaultMessages;exports.fullNameOf=e.fullNameOf;exports.initialsOf=e.initialsOf;exports.isGuestScreen=e.isGuestScreen;exports.isProtectedScreen=e.isProtectedScreen;exports.isScreen=e.isScreen;exports.resolveMessages=e.resolveMessages;exports.resolveRedirectTarget=r.resolveRedirectTarget;Object.defineProperty(exports,"OPERATORS",{enumerable:!0,get:()=>t.OPERATORS});Object.defineProperty(exports,"matchesPredicate",{enumerable:!0,get:()=>t.matchesPredicate});Object.defineProperty(exports,"validatePredicate",{enumerable:!0,get:()=>t.validatePredicate});
|
|
2
2
|
//# sourceMappingURL=authui.cjs.map
|
package/dist/authui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as a, S as t, a as r, b as i, c as l, d as n, e as o, f as c, g as S, i as u, h as g, j as d, k as f, r as A } from "./authui-display-
|
|
2
|
-
import { r as b } from "./uploader-
|
|
1
|
+
import { A as a, S as t, a as r, b as i, c as l, d as n, e as o, f as c, g as S, i as u, h as g, j as d, k as f, r as A } from "./authui-display-CRUABt43.js";
|
|
2
|
+
import { r as b } from "./uploader-Cz9yfzfV.js";
|
|
3
3
|
import { OPERATORS as p, matchesPredicate as O, validatePredicate as P } from "@singlebase/core";
|
|
4
4
|
export {
|
|
5
5
|
a as AuthController,
|
|
@@ -2473,7 +2473,7 @@
|
|
|
2473
2473
|
style="fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round"
|
|
2474
2474
|
>
|
|
2475
2475
|
<path d="M5 8l5 5 5-5"></path>
|
|
2476
|
-
</svg>`};let Ss=0;const gt=()=>`m${Date.now().toString(36)}${(Ss++).toString(36)}`;function At(l){var e;const o=l;return(o==null?void 0:o.message)==="NOT_FOUND"||(o==null?void 0:o.code)==="NOT_FOUND"||((e=o==null?void 0:o.details)==null?void 0:e.status)===404}function Ts(l){const o=l;return(o==null?void 0:o.code)||(o==null?void 0:o.message)||"UNKNOWN"}const Is=()=>typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches,ut=(l,o)=>(Number.isInteger(l)?l.toLocaleString("en-US"):l.toFixed(1))+o,mt=l=>{const o=l.lastIndexOf(".");return o>0?l.slice(o+1,o+5).toUpperCase():"FILE"};function L(l,o){const e=l??{},t=e.metadata&&typeof e.metadata=="object"?e.metadata:{},s=(...h)=>h.find(c=>typeof c=="string"&&c.trim()),a=s(e.content,e.text,e.page_content,e.body,e.snippet,e.chunk,t.content)??JSON.stringify(e,null,2),r=[e.score,e.relevance,e._score,t.score].find(h=>typeof h=="number"),n=typeof e.n=="number"&&e.n>0?e.n:o;return{n,title:s(e.title,e.name,e.filename,t.title,t.name)??`Source ${n}`,section:s(e.section,e.heading,t.section)??"",path:s(e.path,e.url,e.key,t.path,t.url)??"",collection:s(e.collection,e.namespace,e.dbname,t.collection)??"",updated:s(e.updated,e._modified_at,t.updated)??"",text:a,score:r===void 0?null:Math.max(0,Math.min(1,r))}}function Nt(l){return Array.isArray(l)?l.filter(o=>o&&typeof o=="object"&&(o._id||o.id)).filter(o=>o.saved!==!1&&o.status!=="failed").map(o=>({id:String(o._id??o.id),name:String(o.name??"file"),type:o.type,mime:o.mime,size:typeof o.size=="number"?o.size:void 0,status:o.status})):[]}function Ms(l){const o=[],e=[];for(const t of l)if(/\.csv$/i.test(t.name))o.push({type:"csv",data:t.content});else if(/\.json$/i.test(t.name))try{o.push({type:"json",data:JSON.parse(t.content)})}catch{e.push({title:t.name,content:t.content})}else e.push({title:t.name,content:t.content});return e.length&&o.push({type:"docs",payload:{documents:e}}),o}function Os(l){const o=l?Date.parse(l):NaN;if(Number.isNaN(o))return"older";const e=new Date;e.setHours(0,0,0,0);const t=864e5;return o>=e.getTime()?"today":o>=e.getTime()-t?"yesterday":o>=e.getTime()-7*t?"week":"older"}var j,A,N,R,E,B,D,F,K,P,U,W,H,J,q,G,V,X,Y,Q,Z,ee,te,se,ie,ae,re,ne,oe,le,ce,he,de,pe,ue,ge,me,be,fe,ve,xe,ye,we,ke,$e,Ce,Se,Te,Ie,Me,Oe,ze,_e,Le,je,Ae,Ne,Re,Ee,Be,De,Fe,Ke,Pe,Ue,We,He,Je,qe,Ge,Ve,Xe,Ye,Qe,Ze,et,tt,st,it,at,rt,nt,ot,lt,ct,ht,dt,pt,Rt;exports.SinglebaseChat=(Rt=class extends i.LitElement{constructor(){super(...arguments);p(this,j,null);p(this,A,{});p(this,N);p(this,R);p(this,E,"chat");p(this,B,"advanced");p(this,D,{});p(this,F,null);p(this,K,null);p(this,P,"subtle");p(this,U,"");p(this,W,"retrieval");p(this,H,!0);p(this,J,!0);p(this,q,!0);p(this,G,!0);p(this,V,!0);p(this,X,!0);p(this,Y,!0);p(this,Q,!0);p(this,Z,"");p(this,ee,{});p(this,te,"");p(this,se,[]);p(this,ie,{});p(this,ae,"page");p(this,re,"right");p(this,ne,"auto");p(this,oe,!0);p(this,le,"");p(this,ce,"Assistant");p(this,he,"");p(this,de,"");p(this,pe,"");p(this,ue);p(this,ge,"");p(this,me,"");p(this,be,!1);p(this,fe,!1);p(this,ve,!0);p(this,xe,!0);p(this,ye,!0);p(this,we,!0);p(this,ke,!0);p(this,$e,!0);p(this,Ce,!0);p(this,Se,!0);p(this,Te,!0);p(this,Ie,!0);p(this,Me);p(this,Oe,!1);p(this,ze,!0);p(this,_e,[]);p(this,Le,"idle");p(this,je,null);p(this,Ae,"");p(this,Ne,!1);p(this,Re,[]);p(this,Ee,!1);p(this,Be,"");p(this,De,!1);p(this,Fe,"");p(this,Ke,[]);p(this,Pe,"");p(this,Ue,null);p(this,We,0);p(this,He,null);p(this,Je,!1);p(this,qe,"");p(this,Ge,"");p(this,Ve,!1);p(this,Xe,"");p(this,Ye,null);p(this,Qe,"");p(this,Ze,new Set);p(this,et,new Set);p(this,tt,[]);p(this,st,!1);p(this,it,new Map);p(this,at,"");p(this,rt,!1);p(this,nt,!1);p(this,ot,!1);p(this,lt,!1);p(this,ct,!1);p(this,ht,!1);p(this,dt,!1);p(this,pt,!1);I(this,"run",0);I(this,"abort",null);I(this,"revealTimer");I(this,"timers",new Set);I(this,"toastTimer");I(this,"stick",!0);I(this,"renamed",new Set);I(this,"observer",null);I(this,"observed",null);I(this,"media",null);I(this,"focusNext","");I(this,"bubbleScheduled",!1);I(this,"pendingChatId","");I(this,"onNetwork",()=>{this.offline=navigator.onLine===!1});I(this,"onMedia",()=>{var e;this.mobile=!!((e=this.media)!=null&&e.matches)})}get client(){return d(this,j)}set client(e){u(this,j,e)}get messages(){return d(this,A)}set messages(e){u(this,A,e)}get theme(){return d(this,N)}set theme(e){u(this,N,e)}get radius(){return d(this,R)}set radius(e){u(this,R,e)}get mode(){return d(this,E)}set mode(e){u(this,E,e)}get format(){return d(this,B)}set format(e){u(this,B,e)}get renderers(){return d(this,D)}set renderers(e){u(this,D,e)}get beforeSend(){return d(this,F)}set beforeSend(e){u(this,F,e)}get afterParse(){return d(this,K)}set afterParse(e){u(this,K,e)}get glow(){return d(this,P)}set glow(e){u(this,P,e)}get docsets(){return d(this,U)}set docsets(e){u(this,U,e)}get attachmentsMode(){return d(this,W)}set attachmentsMode(e){u(this,W,e)}get saveAttachments(){return d(this,H)}set saveAttachments(e){u(this,H,e)}get followups(){return d(this,J)}set followups(e){u(this,J,e)}get showSources(){return d(this,q)}set showSources(e){u(this,q,e)}get showNewChat(){return d(this,G)}set showNewChat(e){u(this,G,e)}get showBookmarked(){return d(this,V)}set showBookmarked(e){u(this,V,e)}get showFollowups(){return d(this,X)}set showFollowups(e){u(this,X,e)}get allowSearch(){return d(this,Y)}set allowSearch(e){u(this,Y,e)}get autoTitle(){return d(this,Q)}set autoTitle(e){u(this,Q,e)}get model(){return d(this,Z)}set model(e){u(this,Z,e)}get params(){return d(this,ee)}set params(e){u(this,ee,e)}get systemMessage(){return d(this,te)}set systemMessage(e){u(this,te,e)}get retrieval(){return d(this,se)}set retrieval(e){u(this,se,e)}get metadata(){return d(this,ie)}set metadata(e){u(this,ie,e)}get embed(){return d(this,ae)}set embed(e){u(this,ae,e)}get position(){return d(this,re)}set position(e){u(this,re,e)}get sidebar(){return d(this,ne)}set sidebar(e){u(this,ne,e)}get showTitle(){return d(this,oe)}set showTitle(e){u(this,oe,e)}get chatIdAttr(){return d(this,le)}set chatIdAttr(e){u(this,le,e)}get assistantName(){return d(this,ce)}set assistantName(e){u(this,ce,e)}get logoUrl(){return d(this,he)}set logoUrl(e){u(this,he,e)}get heading(){return d(this,de)}set heading(e){u(this,de,e)}get description(){return d(this,pe)}set description(e){u(this,pe,e)}get eyebrow(){return d(this,ue)}set eyebrow(e){u(this,ue,e)}get prompts(){return d(this,ge)}set prompts(e){u(this,ge,e)}get bubbleText(){return d(this,me)}set bubbleText(e){u(this,me,e)}get greetingBubble(){return d(this,be)}set greetingBubble(e){u(this,be,e)}get unreadBadge(){return d(this,fe)}set unreadBadge(e){u(this,fe,e)}get allowUpload(){return d(this,ve)}set allowUpload(e){u(this,ve,e)}get allowExport(){return d(this,xe)}set allowExport(e){u(this,xe,e)}get allowCopy(){return d(this,ye)}set allowCopy(e){u(this,ye,e)}get allowRegenerate(){return d(this,we)}set allowRegenerate(e){u(this,we,e)}get allowBookmark(){return d(this,ke)}set allowBookmark(e){u(this,ke,e)}get allowDelete(){return d(this,$e)}set allowDelete(e){u(this,$e,e)}get allowRename(){return d(this,Ce)}set allowRename(e){u(this,Ce,e)}get allowFeedback(){return d(this,Se)}set allowFeedback(e){u(this,Se,e)}get showComposer(){return d(this,Te)}set showComposer(e){u(this,Te,e)}get showTime(){return d(this,Ie)}set showTime(e){u(this,Ie,e)}get footnote(){return d(this,Me)}set footnote(e){u(this,Me,e)}get allowRaw(){return d(this,Oe)}set allowRaw(e){u(this,Oe,e)}get branding(){return d(this,ze)}set branding(e){u(this,ze,e)}get chatList(){return d(this,_e)}set chatList(e){u(this,_e,e)}get listState(){return d(this,Le)}set listState(e){u(this,Le,e)}get activeId(){return d(this,je)}set activeId(e){u(this,je,e)}get chatTitle(){return d(this,Ae)}set chatTitle(e){u(this,Ae,e)}get bookmarked(){return d(this,Ne)}set bookmarked(e){u(this,Ne,e)}get msgs(){return d(this,Re)}set msgs(e){u(this,Re,e)}get loadingThread(){return d(this,Ee)}set loadingThread(e){u(this,Ee,e)}get threadError(){return d(this,Be)}set threadError(e){u(this,Be,e)}get busy(){return d(this,De)}set busy(e){u(this,De,e)}get draft(){return d(this,Fe)}set draft(e){u(this,Fe,e)}get files(){return d(this,Ke)}set files(e){u(this,Ke,e)}get search(){return d(this,Pe)}set search(e){u(this,Pe,e)}get sidebarOpen(){return d(this,Ue)}set sidebarOpen(e){u(this,Ue,e)}get width(){return d(this,We)}set width(e){u(this,We,e)}get panel(){return d(this,He)}set panel(e){u(this,He,e)}get menuOpen(){return d(this,Je)}set menuOpen(e){u(this,Je,e)}get editingKey(){return d(this,qe)}set editingKey(e){u(this,qe,e)}get editDraft(){return d(this,Ge)}set editDraft(e){u(this,Ge,e)}get editingTitle(){return d(this,Ve)}set editingTitle(e){u(this,Ve,e)}get renamingId(){return d(this,Xe)}set renamingId(e){u(this,Xe,e)}get toast(){return d(this,Ye)}set toast(e){u(this,Ye,e)}get copiedKey(){return d(this,Qe)}set copiedKey(e){u(this,Qe,e)}get retrievalOpen(){return d(this,Ze)}set retrievalOpen(e){u(this,Ze,e)}get rawKeys(){return d(this,et)}set rawKeys(e){u(this,et,e)}get savedFiles(){return d(this,tt)}set savedFiles(e){u(this,tt,e)}get hasSidebarContent(){return d(this,st)}set hasSidebarContent(e){u(this,st,e)}get sorts(){return d(this,it)}set sorts(e){u(this,it,e)}get arrivedKey(){return d(this,at)}set arrivedKey(e){u(this,at,e)}get dragging(){return d(this,rt)}set dragging(e){u(this,rt,e)}get showJump(){return d(this,nt)}set showJump(e){u(this,nt,e)}get offline(){return d(this,ot)}set offline(e){u(this,ot,e)}get isOpen(){return d(this,lt)}set isOpen(e){u(this,lt,e)}get expanded(){return d(this,ct)}set expanded(e){u(this,ct,e)}get bubble(){return d(this,ht)}set bubble(e){u(this,ht,e)}get seen(){return d(this,dt)}set seen(e){u(this,dt,e)}get mobile(){return d(this,pt)}set mobile(e){u(this,pt,e)}get msg(){return Bt(this.messages)}get resolvedClient(){return this.client??Vt.getDefaultClient()??null}get chatId(){return this.activeId}get thread(){return this.msgs}get docsetIds(){const e=this.docsets,t=Array.isArray(e)?e:String(e??"").split(/[\s,]+/);return[...new Set(t.map(s=>String(s).trim()).filter(Boolean))]}get attachments(){return this.savedFiles}get formatLevel(){return["raw","plain","advanced","rich"].includes(this.format)?this.format:"advanced"}get chats(){return this.chatList}set config(e){if(!e)return;const t=this;"client"in e&&(this.client=e.client??null);for(const s of Mt)s in e&&(t[s]=e[s]);e.chatId&&e.chatId!==this.activeId&&(this.hasUpdated?this.openChat(e.chatId):this.chatIdAttr=e.chatId)}configure(e){return this.config=e,this}get config(){const e=this;return{client:this.client,chatId:this.activeId??"",...Object.fromEntries(Mt.map(t=>[t,e[t]]))}}connectedCallback(){var e,t;super.connectedCallback(),this.offline=typeof navigator<"u"&&navigator.onLine===!1,window.addEventListener("online",this.onNetwork),window.addEventListener("offline",this.onNetwork),this.media=typeof matchMedia<"u"?matchMedia("(max-width: 559px)"):null,this.mobile=!!((e=this.media)!=null&&e.matches),(t=this.media)==null||t.addEventListener("change",this.onMedia)}disconnectedCallback(){var e,t;super.disconnectedCallback(),window.removeEventListener("online",this.onNetwork),window.removeEventListener("offline",this.onNetwork),(e=this.media)==null||e.removeEventListener("change",this.onMedia),(t=this.observer)==null||t.disconnect(),this.observer=null,this.observed=null,this.flushToast(),this.halt(),this.timers.forEach(clearTimeout),this.timers.clear()}willUpdate(e){if(e.has("retrieval")&&!Array.isArray(this.retrieval)){const t=this.retrieval;this.retrieval=t&&typeof t=="object"?[t]:[]}e.has("params")&&(!this.params||typeof this.params!="object")&&(this.params={}),e.has("metadata")&&(!this.metadata||typeof this.metadata!="object")&&(this.metadata={}),e.has("sidebar")&&(this.sidebar==="open"?this.sidebarOpen=!0:this.sidebar==="closed"||this.sidebar==="none"?this.sidebarOpen=!1:this.width&&(this.sidebarOpen=this.docked)),this.embed==="launcher"&&this.greetingBubble&&!this.bubbleScheduled&&(this.bubbleScheduled=!0,this.later(()=>{!this.isOpen&&!this.seen&&(this.bubble=!0)},1200))}firstUpdated(){this.chatIdAttr&&this.openChat(this.chatIdAttr)}updated(){var t;const e=this.renderRoot.querySelector(".root");if(e!==this.observed&&((t=this.observer)==null||t.disconnect(),this.observed=e,e&&typeof ResizeObserver<"u"&&(this.observer??(this.observer=new ResizeObserver(([s])=>{const a=Math.round(s.contentRect.width);a!==this.width&&(this.width=a,this.sidebarOpen===null&&(this.sidebarOpen=this.sidebar==="auto"&&this.docked))})),this.observer.observe(e))),this.sidebarOpen&&this.listState==="idle"&&this.resolvedClient&&this.loadChats(),this.pendingChatId&&this.resolvedClient&&this.openChat(this.pendingChatId),this.focusNext){const s=this.renderRoot.querySelector(this.focusNext);this.focusNext="",s&&(s.focus(),"select"in s&&s.tagName==="INPUT"&&s.select())}}later(e,t){const s=setTimeout(()=>{this.timers.delete(s),e()},t);this.timers.add(s)}emit(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}get docked(){return this.embed==="page"&&this.width>=bs}get panelDocked(){const e=this.docked&&this.sidebarOpen?ms:0;return this.width-e>=fs}newChat(){this.halt(),this.pendingChatId="",this.savedFiles=[],this.loadingThread=!1,this.activeId=null,this.chatTitle="",this.bookmarked=!1,this.msgs=[],this.threadError="",this.resetViewState(),this.focusNext="textarea.input"}async openChat(e){const t=this.resolvedClient;if(!e)return;this.halt(),this.savedFiles=[];const s=this.chatList.find(r=>r._id===e);if(this.activeId=e,this.chatTitle=(s==null?void 0:s.title)??"",this.bookmarked=!!(s!=null&&s.bookmarked),this.msgs=[],this.threadError="",this.resetViewState(),!t){this.pendingChatId=e,this.loadingThread=!0;return}const a=++this.run;this.pendingChatId="",this.loadingThread=!0;try{const r=await t.llm.call("get_chat",{_id:e});if(a!==this.run)return;this.chatTitle=(r==null?void 0:r.title)??"",this.bookmarked=!!(r!=null&&r.bookmarked),this.msgs=((r==null?void 0:r.messages)??[]).filter(n=>n&&(n.role==="user"||n.role==="assistant")).map(n=>this.fromServer(n)),this.savedFiles=Nt(r==null?void 0:r.attachments),this.upsertChat({...s,...r,_id:e}),this.stick=!0,this.scrollToBottom()}catch(r){if(a!==this.run)return;At(r)?(this.chatList=this.chatList.filter(n=>n._id!==e),this.newChat(),this.showToast(this.msg.errNotFound)):this.threadError=this.msg.errLoad}finally{a===this.run&&(this.loadingThread=!1)}}async send(e){const t=(typeof e=="string"?e:this.draft).trim();if(!t||this.busy)return;const s=this.files;this.draft="",this.files=[];const a=this.renderRoot.querySelector("textarea.input");a&&(a.style.height="auto"),await this.runTurn(this.userMessage(t,s))}stop(){if(!this.busy)return;const e=this.msgs[this.msgs.length-1];this.halt(),(e==null?void 0:e.role)==="assistant"&&(e.phase==="pending"||e.phase==="streaming")&&(e.phase="done",e.stopped=!0,e.followups=[],this.msgs=[...this.msgs])}exportChat(e="md"){var O;if(!this.msgs.length)return;this.menuOpen=!1;const t=this.chatTitle||this.msg.untitled,s=v=>v.role==="user"?this.msg.you:this.assistantName,a=v=>new Date(v||Date.now()).toLocaleString(),r=v=>v.sources.map((C,k)=>{const z=L(C,k+1);return`[${z.n}] ${z.title}${z.path?` — ${z.path}`:""}`}),n=v=>(v.attachments??[]).map(C=>C.name);let h,c="text/markdown",f="md";if(e==="json"?(h=JSON.stringify({exportedAt:new Date().toISOString(),id:this.activeId,title:t,mode:this.mode,bookmarked:this.bookmarked,messages:this.msgs.map(v=>({role:v.role,text:v.content,at:new Date(v.at||Date.now()).toISOString(),bookmarked:v.bookmarked,attachments:n(v),sources:r(v)}))},null,2),c="application/json",f="json"):e==="txt"?(h=`${t}
|
|
2476
|
+
</svg>`};let Ss=0;const gt=()=>`m${Date.now().toString(36)}${(Ss++).toString(36)}`;function At(l){var e;const o=l;return(o==null?void 0:o.message)==="NOT_FOUND"||(o==null?void 0:o.code)==="NOT_FOUND"||((e=o==null?void 0:o.details)==null?void 0:e.status)===404}function Ts(l){const o=l;return(o==null?void 0:o.code)||(o==null?void 0:o.message)||"UNKNOWN"}const Is=()=>typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches,ut=(l,o)=>(Number.isInteger(l)?l.toLocaleString("en-US"):l.toFixed(1))+o,mt=l=>{const o=l.lastIndexOf(".");return o>0?l.slice(o+1,o+5).toUpperCase():"FILE"};function L(l,o){const e=l??{},t=e.metadata&&typeof e.metadata=="object"?e.metadata:{},s=(...h)=>h.find(c=>typeof c=="string"&&c.trim()),a=s(e.content,e.text,e.page_content,e.body,e.snippet,e.chunk,t.content)??JSON.stringify(e,null,2),r=[e.score,e.relevance,e._score,t.score].find(h=>typeof h=="number"),n=typeof e.n=="number"&&e.n>0?e.n:o;return{n,title:s(e.title,e.name,e.filename,t.title,t.name)??`Source ${n}`,section:s(e.section,e.heading,t.section)??"",path:s(e.path,e.url,e.key,t.path,t.url)??"",collection:s(e.collection,e.namespace,e.dbname,t.collection)??"",updated:s(e.updated,e._modified_at,t.updated)??"",text:a,score:r===void 0?null:Math.max(0,Math.min(1,r))}}function Nt(l){return Array.isArray(l)?l.filter(o=>o&&typeof o=="object"&&(o._id||o.id)).filter(o=>o.saved!==!1&&o.status!=="failed").map(o=>({id:String(o._id??o.id),name:String(o.name??"file"),type:o.type,mime:o.mime,size:typeof o.size=="number"?o.size:void 0,status:o.status})):[]}function Ms(l){const o=[],e=[];for(const t of l)if(/\.csv$/i.test(t.name))o.push({source:"csv",data:t.content});else if(/\.json$/i.test(t.name))try{o.push({source:"json",data:JSON.parse(t.content)})}catch{e.push({title:t.name,content:t.content})}else e.push({title:t.name,content:t.content});return e.length&&o.push({source:"docs",payload:{documents:e}}),o}function Os(l){const o=l?Date.parse(l):NaN;if(Number.isNaN(o))return"older";const e=new Date;e.setHours(0,0,0,0);const t=864e5;return o>=e.getTime()?"today":o>=e.getTime()-t?"yesterday":o>=e.getTime()-7*t?"week":"older"}var j,A,N,R,E,B,D,F,K,P,U,W,H,J,q,G,V,X,Y,Q,Z,ee,te,se,ie,ae,re,ne,oe,le,ce,he,de,pe,ue,ge,me,be,fe,ve,xe,ye,we,ke,$e,Ce,Se,Te,Ie,Me,Oe,ze,_e,Le,je,Ae,Ne,Re,Ee,Be,De,Fe,Ke,Pe,Ue,We,He,Je,qe,Ge,Ve,Xe,Ye,Qe,Ze,et,tt,st,it,at,rt,nt,ot,lt,ct,ht,dt,pt,Rt;exports.SinglebaseChat=(Rt=class extends i.LitElement{constructor(){super(...arguments);p(this,j,null);p(this,A,{});p(this,N);p(this,R);p(this,E,"chat");p(this,B,"advanced");p(this,D,{});p(this,F,null);p(this,K,null);p(this,P,"subtle");p(this,U,"");p(this,W,"payload");p(this,H,!0);p(this,J,!0);p(this,q,!0);p(this,G,!0);p(this,V,!0);p(this,X,!0);p(this,Y,!0);p(this,Q,!0);p(this,Z,"");p(this,ee,{});p(this,te,"");p(this,se,[]);p(this,ie,{});p(this,ae,"page");p(this,re,"right");p(this,ne,"auto");p(this,oe,!0);p(this,le,"");p(this,ce,"Assistant");p(this,he,"");p(this,de,"");p(this,pe,"");p(this,ue);p(this,ge,"");p(this,me,"");p(this,be,!1);p(this,fe,!1);p(this,ve,!0);p(this,xe,!0);p(this,ye,!0);p(this,we,!0);p(this,ke,!0);p(this,$e,!0);p(this,Ce,!0);p(this,Se,!0);p(this,Te,!0);p(this,Ie,!0);p(this,Me);p(this,Oe,!1);p(this,ze,!0);p(this,_e,[]);p(this,Le,"idle");p(this,je,null);p(this,Ae,"");p(this,Ne,!1);p(this,Re,[]);p(this,Ee,!1);p(this,Be,"");p(this,De,!1);p(this,Fe,"");p(this,Ke,[]);p(this,Pe,"");p(this,Ue,null);p(this,We,0);p(this,He,null);p(this,Je,!1);p(this,qe,"");p(this,Ge,"");p(this,Ve,!1);p(this,Xe,"");p(this,Ye,null);p(this,Qe,"");p(this,Ze,new Set);p(this,et,new Set);p(this,tt,[]);p(this,st,!1);p(this,it,new Map);p(this,at,"");p(this,rt,!1);p(this,nt,!1);p(this,ot,!1);p(this,lt,!1);p(this,ct,!1);p(this,ht,!1);p(this,dt,!1);p(this,pt,!1);I(this,"run",0);I(this,"abort",null);I(this,"revealTimer");I(this,"timers",new Set);I(this,"toastTimer");I(this,"stick",!0);I(this,"renamed",new Set);I(this,"observer",null);I(this,"observed",null);I(this,"media",null);I(this,"focusNext","");I(this,"bubbleScheduled",!1);I(this,"pendingChatId","");I(this,"onNetwork",()=>{this.offline=navigator.onLine===!1});I(this,"onMedia",()=>{var e;this.mobile=!!((e=this.media)!=null&&e.matches)})}get client(){return d(this,j)}set client(e){u(this,j,e)}get messages(){return d(this,A)}set messages(e){u(this,A,e)}get theme(){return d(this,N)}set theme(e){u(this,N,e)}get radius(){return d(this,R)}set radius(e){u(this,R,e)}get mode(){return d(this,E)}set mode(e){u(this,E,e)}get format(){return d(this,B)}set format(e){u(this,B,e)}get renderers(){return d(this,D)}set renderers(e){u(this,D,e)}get beforeSend(){return d(this,F)}set beforeSend(e){u(this,F,e)}get afterParse(){return d(this,K)}set afterParse(e){u(this,K,e)}get glow(){return d(this,P)}set glow(e){u(this,P,e)}get docsets(){return d(this,U)}set docsets(e){u(this,U,e)}get attachmentsMode(){return d(this,W)}set attachmentsMode(e){u(this,W,e)}get saveAttachments(){return d(this,H)}set saveAttachments(e){u(this,H,e)}get followups(){return d(this,J)}set followups(e){u(this,J,e)}get showSources(){return d(this,q)}set showSources(e){u(this,q,e)}get showNewChat(){return d(this,G)}set showNewChat(e){u(this,G,e)}get showBookmarked(){return d(this,V)}set showBookmarked(e){u(this,V,e)}get showFollowups(){return d(this,X)}set showFollowups(e){u(this,X,e)}get allowSearch(){return d(this,Y)}set allowSearch(e){u(this,Y,e)}get autoTitle(){return d(this,Q)}set autoTitle(e){u(this,Q,e)}get model(){return d(this,Z)}set model(e){u(this,Z,e)}get params(){return d(this,ee)}set params(e){u(this,ee,e)}get systemMessage(){return d(this,te)}set systemMessage(e){u(this,te,e)}get retrieval(){return d(this,se)}set retrieval(e){u(this,se,e)}get metadata(){return d(this,ie)}set metadata(e){u(this,ie,e)}get embed(){return d(this,ae)}set embed(e){u(this,ae,e)}get position(){return d(this,re)}set position(e){u(this,re,e)}get sidebar(){return d(this,ne)}set sidebar(e){u(this,ne,e)}get showTitle(){return d(this,oe)}set showTitle(e){u(this,oe,e)}get chatIdAttr(){return d(this,le)}set chatIdAttr(e){u(this,le,e)}get assistantName(){return d(this,ce)}set assistantName(e){u(this,ce,e)}get logoUrl(){return d(this,he)}set logoUrl(e){u(this,he,e)}get heading(){return d(this,de)}set heading(e){u(this,de,e)}get description(){return d(this,pe)}set description(e){u(this,pe,e)}get eyebrow(){return d(this,ue)}set eyebrow(e){u(this,ue,e)}get prompts(){return d(this,ge)}set prompts(e){u(this,ge,e)}get bubbleText(){return d(this,me)}set bubbleText(e){u(this,me,e)}get greetingBubble(){return d(this,be)}set greetingBubble(e){u(this,be,e)}get unreadBadge(){return d(this,fe)}set unreadBadge(e){u(this,fe,e)}get allowUpload(){return d(this,ve)}set allowUpload(e){u(this,ve,e)}get allowExport(){return d(this,xe)}set allowExport(e){u(this,xe,e)}get allowCopy(){return d(this,ye)}set allowCopy(e){u(this,ye,e)}get allowRegenerate(){return d(this,we)}set allowRegenerate(e){u(this,we,e)}get allowBookmark(){return d(this,ke)}set allowBookmark(e){u(this,ke,e)}get allowDelete(){return d(this,$e)}set allowDelete(e){u(this,$e,e)}get allowRename(){return d(this,Ce)}set allowRename(e){u(this,Ce,e)}get allowFeedback(){return d(this,Se)}set allowFeedback(e){u(this,Se,e)}get showComposer(){return d(this,Te)}set showComposer(e){u(this,Te,e)}get showTime(){return d(this,Ie)}set showTime(e){u(this,Ie,e)}get footnote(){return d(this,Me)}set footnote(e){u(this,Me,e)}get allowRaw(){return d(this,Oe)}set allowRaw(e){u(this,Oe,e)}get branding(){return d(this,ze)}set branding(e){u(this,ze,e)}get chatList(){return d(this,_e)}set chatList(e){u(this,_e,e)}get listState(){return d(this,Le)}set listState(e){u(this,Le,e)}get activeId(){return d(this,je)}set activeId(e){u(this,je,e)}get chatTitle(){return d(this,Ae)}set chatTitle(e){u(this,Ae,e)}get bookmarked(){return d(this,Ne)}set bookmarked(e){u(this,Ne,e)}get msgs(){return d(this,Re)}set msgs(e){u(this,Re,e)}get loadingThread(){return d(this,Ee)}set loadingThread(e){u(this,Ee,e)}get threadError(){return d(this,Be)}set threadError(e){u(this,Be,e)}get busy(){return d(this,De)}set busy(e){u(this,De,e)}get draft(){return d(this,Fe)}set draft(e){u(this,Fe,e)}get files(){return d(this,Ke)}set files(e){u(this,Ke,e)}get search(){return d(this,Pe)}set search(e){u(this,Pe,e)}get sidebarOpen(){return d(this,Ue)}set sidebarOpen(e){u(this,Ue,e)}get width(){return d(this,We)}set width(e){u(this,We,e)}get panel(){return d(this,He)}set panel(e){u(this,He,e)}get menuOpen(){return d(this,Je)}set menuOpen(e){u(this,Je,e)}get editingKey(){return d(this,qe)}set editingKey(e){u(this,qe,e)}get editDraft(){return d(this,Ge)}set editDraft(e){u(this,Ge,e)}get editingTitle(){return d(this,Ve)}set editingTitle(e){u(this,Ve,e)}get renamingId(){return d(this,Xe)}set renamingId(e){u(this,Xe,e)}get toast(){return d(this,Ye)}set toast(e){u(this,Ye,e)}get copiedKey(){return d(this,Qe)}set copiedKey(e){u(this,Qe,e)}get retrievalOpen(){return d(this,Ze)}set retrievalOpen(e){u(this,Ze,e)}get rawKeys(){return d(this,et)}set rawKeys(e){u(this,et,e)}get savedFiles(){return d(this,tt)}set savedFiles(e){u(this,tt,e)}get hasSidebarContent(){return d(this,st)}set hasSidebarContent(e){u(this,st,e)}get sorts(){return d(this,it)}set sorts(e){u(this,it,e)}get arrivedKey(){return d(this,at)}set arrivedKey(e){u(this,at,e)}get dragging(){return d(this,rt)}set dragging(e){u(this,rt,e)}get showJump(){return d(this,nt)}set showJump(e){u(this,nt,e)}get offline(){return d(this,ot)}set offline(e){u(this,ot,e)}get isOpen(){return d(this,lt)}set isOpen(e){u(this,lt,e)}get expanded(){return d(this,ct)}set expanded(e){u(this,ct,e)}get bubble(){return d(this,ht)}set bubble(e){u(this,ht,e)}get seen(){return d(this,dt)}set seen(e){u(this,dt,e)}get mobile(){return d(this,pt)}set mobile(e){u(this,pt,e)}get msg(){return Bt(this.messages)}get resolvedClient(){return this.client??Vt.getDefaultClient()??null}get chatId(){return this.activeId}get thread(){return this.msgs}get docsetIds(){const e=this.docsets,t=Array.isArray(e)?e:String(e??"").split(/[\s,]+/);return[...new Set(t.map(s=>String(s).trim()).filter(Boolean))]}get attachments(){return this.savedFiles}get formatLevel(){return["raw","plain","advanced","rich"].includes(this.format)?this.format:"advanced"}get chats(){return this.chatList}set config(e){if(!e)return;const t=this;"client"in e&&(this.client=e.client??null);for(const s of Mt)s in e&&(t[s]=e[s]);e.chatId&&e.chatId!==this.activeId&&(this.hasUpdated?this.openChat(e.chatId):this.chatIdAttr=e.chatId)}configure(e){return this.config=e,this}get config(){const e=this;return{client:this.client,chatId:this.activeId??"",...Object.fromEntries(Mt.map(t=>[t,e[t]]))}}connectedCallback(){var e,t;super.connectedCallback(),this.offline=typeof navigator<"u"&&navigator.onLine===!1,window.addEventListener("online",this.onNetwork),window.addEventListener("offline",this.onNetwork),this.media=typeof matchMedia<"u"?matchMedia("(max-width: 559px)"):null,this.mobile=!!((e=this.media)!=null&&e.matches),(t=this.media)==null||t.addEventListener("change",this.onMedia)}disconnectedCallback(){var e,t;super.disconnectedCallback(),window.removeEventListener("online",this.onNetwork),window.removeEventListener("offline",this.onNetwork),(e=this.media)==null||e.removeEventListener("change",this.onMedia),(t=this.observer)==null||t.disconnect(),this.observer=null,this.observed=null,this.flushToast(),this.halt(),this.timers.forEach(clearTimeout),this.timers.clear()}willUpdate(e){if(e.has("retrieval")&&!Array.isArray(this.retrieval)){const t=this.retrieval;this.retrieval=t&&typeof t=="object"?[t]:[]}e.has("params")&&(!this.params||typeof this.params!="object")&&(this.params={}),e.has("metadata")&&(!this.metadata||typeof this.metadata!="object")&&(this.metadata={}),e.has("sidebar")&&(this.sidebar==="open"?this.sidebarOpen=!0:this.sidebar==="closed"||this.sidebar==="none"?this.sidebarOpen=!1:this.width&&(this.sidebarOpen=this.docked)),this.embed==="launcher"&&this.greetingBubble&&!this.bubbleScheduled&&(this.bubbleScheduled=!0,this.later(()=>{!this.isOpen&&!this.seen&&(this.bubble=!0)},1200))}firstUpdated(){this.chatIdAttr&&this.openChat(this.chatIdAttr)}updated(){var t;const e=this.renderRoot.querySelector(".root");if(e!==this.observed&&((t=this.observer)==null||t.disconnect(),this.observed=e,e&&typeof ResizeObserver<"u"&&(this.observer??(this.observer=new ResizeObserver(([s])=>{const a=Math.round(s.contentRect.width);a!==this.width&&(this.width=a,this.sidebarOpen===null&&(this.sidebarOpen=this.sidebar==="auto"&&this.docked))})),this.observer.observe(e))),this.sidebarOpen&&this.listState==="idle"&&this.resolvedClient&&this.loadChats(),this.pendingChatId&&this.resolvedClient&&this.openChat(this.pendingChatId),this.focusNext){const s=this.renderRoot.querySelector(this.focusNext);this.focusNext="",s&&(s.focus(),"select"in s&&s.tagName==="INPUT"&&s.select())}}later(e,t){const s=setTimeout(()=>{this.timers.delete(s),e()},t);this.timers.add(s)}emit(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}get docked(){return this.embed==="page"&&this.width>=bs}get panelDocked(){const e=this.docked&&this.sidebarOpen?ms:0;return this.width-e>=fs}newChat(){this.halt(),this.pendingChatId="",this.savedFiles=[],this.loadingThread=!1,this.activeId=null,this.chatTitle="",this.bookmarked=!1,this.msgs=[],this.threadError="",this.resetViewState(),this.focusNext="textarea.input"}async openChat(e){const t=this.resolvedClient;if(!e)return;this.halt(),this.savedFiles=[];const s=this.chatList.find(r=>r._id===e);if(this.activeId=e,this.chatTitle=(s==null?void 0:s.title)??"",this.bookmarked=!!(s!=null&&s.bookmarked),this.msgs=[],this.threadError="",this.resetViewState(),!t){this.pendingChatId=e,this.loadingThread=!0;return}const a=++this.run;this.pendingChatId="",this.loadingThread=!0;try{const r=await t.llm.call("get_chat",{_id:e});if(a!==this.run)return;this.chatTitle=(r==null?void 0:r.title)??"",this.bookmarked=!!(r!=null&&r.bookmarked),this.msgs=((r==null?void 0:r.messages)??[]).filter(n=>n&&(n.role==="user"||n.role==="assistant")).map(n=>this.fromServer(n)),this.savedFiles=Nt(r==null?void 0:r.attachments),this.upsertChat({...s,...r,_id:e}),this.stick=!0,this.scrollToBottom()}catch(r){if(a!==this.run)return;At(r)?(this.chatList=this.chatList.filter(n=>n._id!==e),this.newChat(),this.showToast(this.msg.errNotFound)):this.threadError=this.msg.errLoad}finally{a===this.run&&(this.loadingThread=!1)}}async send(e){const t=(typeof e=="string"?e:this.draft).trim();if(!t||this.busy)return;const s=this.files;this.draft="",this.files=[];const a=this.renderRoot.querySelector("textarea.input");a&&(a.style.height="auto"),await this.runTurn(this.userMessage(t,s))}stop(){if(!this.busy)return;const e=this.msgs[this.msgs.length-1];this.halt(),(e==null?void 0:e.role)==="assistant"&&(e.phase==="pending"||e.phase==="streaming")&&(e.phase="done",e.stopped=!0,e.followups=[],this.msgs=[...this.msgs])}exportChat(e="md"){var O;if(!this.msgs.length)return;this.menuOpen=!1;const t=this.chatTitle||this.msg.untitled,s=v=>v.role==="user"?this.msg.you:this.assistantName,a=v=>new Date(v||Date.now()).toLocaleString(),r=v=>v.sources.map((C,k)=>{const z=L(C,k+1);return`[${z.n}] ${z.title}${z.path?` — ${z.path}`:""}`}),n=v=>(v.attachments??[]).map(C=>C.name);let h,c="text/markdown",f="md";if(e==="json"?(h=JSON.stringify({exportedAt:new Date().toISOString(),id:this.activeId,title:t,mode:this.mode,bookmarked:this.bookmarked,messages:this.msgs.map(v=>({role:v.role,text:v.content,at:new Date(v.at||Date.now()).toISOString(),bookmarked:v.bookmarked,attachments:n(v),sources:r(v)}))},null,2),c="application/json",f="json"):e==="txt"?(h=`${t}
|
|
2477
2477
|
${"=".repeat(t.length)}
|
|
2478
2478
|
|
|
2479
2479
|
`+this.msgs.map(v=>[`${s(v)} · ${a(v.at)}`,n(v).length?`Attachments: ${n(v).join(", ")}`:"",v.content,r(v).length?`Sources:
|
|
@@ -3278,4 +3278,4 @@ ${s.path}`:""}${s.updated?` · Updated ${s.updated}`:""}`,f=[s.updated?`Updated
|
|
|
3278
3278
|
</div>`:i.html`<div class="composer-wrap reader">
|
|
3279
3279
|
<div class="composer-col">${a}</div>
|
|
3280
3280
|
</div>`}},j=new WeakMap,A=new WeakMap,N=new WeakMap,R=new WeakMap,E=new WeakMap,B=new WeakMap,D=new WeakMap,F=new WeakMap,K=new WeakMap,P=new WeakMap,U=new WeakMap,W=new WeakMap,H=new WeakMap,J=new WeakMap,q=new WeakMap,G=new WeakMap,V=new WeakMap,X=new WeakMap,Y=new WeakMap,Q=new WeakMap,Z=new WeakMap,ee=new WeakMap,te=new WeakMap,se=new WeakMap,ie=new WeakMap,ae=new WeakMap,re=new WeakMap,ne=new WeakMap,oe=new WeakMap,le=new WeakMap,ce=new WeakMap,he=new WeakMap,de=new WeakMap,pe=new WeakMap,ue=new WeakMap,ge=new WeakMap,me=new WeakMap,be=new WeakMap,fe=new WeakMap,ve=new WeakMap,xe=new WeakMap,ye=new WeakMap,we=new WeakMap,ke=new WeakMap,$e=new WeakMap,Ce=new WeakMap,Se=new WeakMap,Te=new WeakMap,Ie=new WeakMap,Me=new WeakMap,Oe=new WeakMap,ze=new WeakMap,_e=new WeakMap,Le=new WeakMap,je=new WeakMap,Ae=new WeakMap,Ne=new WeakMap,Re=new WeakMap,Ee=new WeakMap,Be=new WeakMap,De=new WeakMap,Fe=new WeakMap,Ke=new WeakMap,Pe=new WeakMap,Ue=new WeakMap,We=new WeakMap,He=new WeakMap,Je=new WeakMap,qe=new WeakMap,Ge=new WeakMap,Ve=new WeakMap,Xe=new WeakMap,Ye=new WeakMap,Qe=new WeakMap,Ze=new WeakMap,et=new WeakMap,tt=new WeakMap,st=new WeakMap,it=new WeakMap,at=new WeakMap,rt=new WeakMap,nt=new WeakMap,ot=new WeakMap,lt=new WeakMap,ct=new WeakMap,ht=new WeakMap,dt=new WeakMap,pt=new WeakMap,Rt);us(exports.SinglebaseChat,"styles",[T.tokenDefaults,T.brandingStyles,Xt]);m([g.property({attribute:!1})],exports.SinglebaseChat.prototype,"client",1);m([g.property({attribute:!1})],exports.SinglebaseChat.prototype,"messages",1);m([g.property({reflect:!0})],exports.SinglebaseChat.prototype,"theme",1);m([g.property({reflect:!0})],exports.SinglebaseChat.prototype,"radius",1);m([g.property({reflect:!0})],exports.SinglebaseChat.prototype,"mode",1);m([g.property({reflect:!0})],exports.SinglebaseChat.prototype,"format",1);m([g.property({attribute:!1})],exports.SinglebaseChat.prototype,"renderers",1);m([g.property({attribute:!1})],exports.SinglebaseChat.prototype,"beforeSend",1);m([g.property({attribute:!1})],exports.SinglebaseChat.prototype,"afterParse",1);m([g.property({reflect:!0})],exports.SinglebaseChat.prototype,"glow",1);m([g.property()],exports.SinglebaseChat.prototype,"docsets",1);m([g.property({attribute:"attachments-mode"})],exports.SinglebaseChat.prototype,"attachmentsMode",1);m([g.property({converter:S,attribute:"save-attachments"})],exports.SinglebaseChat.prototype,"saveAttachments",1);m([g.property({converter:S})],exports.SinglebaseChat.prototype,"followups",1);m([g.property({converter:S,attribute:"show-sources"})],exports.SinglebaseChat.prototype,"showSources",1);m([g.property({converter:S,attribute:"show-new-chat"})],exports.SinglebaseChat.prototype,"showNewChat",1);m([g.property({converter:S,attribute:"show-bookmarked"})],exports.SinglebaseChat.prototype,"showBookmarked",1);m([g.property({converter:S,attribute:"show-followups"})],exports.SinglebaseChat.prototype,"showFollowups",1);m([g.property({converter:S,attribute:"allow-search"})],exports.SinglebaseChat.prototype,"allowSearch",1);m([g.property({converter:S,attribute:"auto-title"})],exports.SinglebaseChat.prototype,"autoTitle",1);m([g.property()],exports.SinglebaseChat.prototype,"model",1);m([g.property({converter:vt})],exports.SinglebaseChat.prototype,"params",1);m([g.property({attribute:"system-message"})],exports.SinglebaseChat.prototype,"systemMessage",1);m([g.property({converter:vt})],exports.SinglebaseChat.prototype,"retrieval",1);m([g.property({converter:vt})],exports.SinglebaseChat.prototype,"metadata",1);m([g.property({reflect:!0})],exports.SinglebaseChat.prototype,"embed",1);m([g.property({reflect:!0})],exports.SinglebaseChat.prototype,"position",1);m([g.property({converter:gs})],exports.SinglebaseChat.prototype,"sidebar",1);m([g.property({converter:S,attribute:"show-title"})],exports.SinglebaseChat.prototype,"showTitle",1);m([g.property({attribute:"chat-id"})],exports.SinglebaseChat.prototype,"chatIdAttr",1);m([g.property({attribute:"assistant-name"})],exports.SinglebaseChat.prototype,"assistantName",1);m([g.property({attribute:"logo-url"})],exports.SinglebaseChat.prototype,"logoUrl",1);m([g.property()],exports.SinglebaseChat.prototype,"heading",1);m([g.property()],exports.SinglebaseChat.prototype,"description",1);m([g.property()],exports.SinglebaseChat.prototype,"eyebrow",1);m([g.property()],exports.SinglebaseChat.prototype,"prompts",1);m([g.property({attribute:"bubble-text"})],exports.SinglebaseChat.prototype,"bubbleText",1);m([g.property({type:Boolean,attribute:"greeting-bubble"})],exports.SinglebaseChat.prototype,"greetingBubble",1);m([g.property({type:Boolean,attribute:"unread-badge"})],exports.SinglebaseChat.prototype,"unreadBadge",1);m([g.property({converter:S,attribute:"allow-upload"})],exports.SinglebaseChat.prototype,"allowUpload",1);m([g.property({converter:S,attribute:"allow-export"})],exports.SinglebaseChat.prototype,"allowExport",1);m([g.property({converter:S,attribute:"allow-copy"})],exports.SinglebaseChat.prototype,"allowCopy",1);m([g.property({converter:S,attribute:"allow-regenerate"})],exports.SinglebaseChat.prototype,"allowRegenerate",1);m([g.property({converter:S,attribute:"allow-bookmark"})],exports.SinglebaseChat.prototype,"allowBookmark",1);m([g.property({converter:S,attribute:"allow-delete"})],exports.SinglebaseChat.prototype,"allowDelete",1);m([g.property({converter:S,attribute:"allow-rename"})],exports.SinglebaseChat.prototype,"allowRename",1);m([g.property({converter:S,attribute:"allow-feedback"})],exports.SinglebaseChat.prototype,"allowFeedback",1);m([g.property({converter:S,attribute:"show-composer"})],exports.SinglebaseChat.prototype,"showComposer",1);m([g.property({converter:S,attribute:"show-time"})],exports.SinglebaseChat.prototype,"showTime",1);m([g.property()],exports.SinglebaseChat.prototype,"footnote",1);m([g.property({type:Boolean,attribute:"allow-raw"})],exports.SinglebaseChat.prototype,"allowRaw",1);m([g.property({converter:S})],exports.SinglebaseChat.prototype,"branding",1);m([g.state()],exports.SinglebaseChat.prototype,"chatList",1);m([g.state()],exports.SinglebaseChat.prototype,"listState",1);m([g.state()],exports.SinglebaseChat.prototype,"activeId",1);m([g.state()],exports.SinglebaseChat.prototype,"chatTitle",1);m([g.state()],exports.SinglebaseChat.prototype,"bookmarked",1);m([g.state()],exports.SinglebaseChat.prototype,"msgs",1);m([g.state()],exports.SinglebaseChat.prototype,"loadingThread",1);m([g.state()],exports.SinglebaseChat.prototype,"threadError",1);m([g.state()],exports.SinglebaseChat.prototype,"busy",1);m([g.state()],exports.SinglebaseChat.prototype,"draft",1);m([g.state()],exports.SinglebaseChat.prototype,"files",1);m([g.state()],exports.SinglebaseChat.prototype,"search",1);m([g.state()],exports.SinglebaseChat.prototype,"sidebarOpen",1);m([g.state()],exports.SinglebaseChat.prototype,"width",1);m([g.state()],exports.SinglebaseChat.prototype,"panel",1);m([g.state()],exports.SinglebaseChat.prototype,"menuOpen",1);m([g.state()],exports.SinglebaseChat.prototype,"editingKey",1);m([g.state()],exports.SinglebaseChat.prototype,"editDraft",1);m([g.state()],exports.SinglebaseChat.prototype,"editingTitle",1);m([g.state()],exports.SinglebaseChat.prototype,"renamingId",1);m([g.state()],exports.SinglebaseChat.prototype,"toast",1);m([g.state()],exports.SinglebaseChat.prototype,"copiedKey",1);m([g.state()],exports.SinglebaseChat.prototype,"retrievalOpen",1);m([g.state()],exports.SinglebaseChat.prototype,"rawKeys",1);m([g.state()],exports.SinglebaseChat.prototype,"savedFiles",1);m([g.state()],exports.SinglebaseChat.prototype,"hasSidebarContent",1);m([g.state()],exports.SinglebaseChat.prototype,"sorts",1);m([g.state()],exports.SinglebaseChat.prototype,"arrivedKey",1);m([g.state()],exports.SinglebaseChat.prototype,"dragging",1);m([g.state()],exports.SinglebaseChat.prototype,"showJump",1);m([g.state()],exports.SinglebaseChat.prototype,"offline",1);m([g.state()],exports.SinglebaseChat.prototype,"isOpen",1);m([g.state()],exports.SinglebaseChat.prototype,"expanded",1);m([g.state()],exports.SinglebaseChat.prototype,"bubble",1);m([g.state()],exports.SinglebaseChat.prototype,"seen",1);m([g.state()],exports.SinglebaseChat.prototype,"mobile",1);exports.SinglebaseChat=m([g.customElement("singlebase-chat")],exports.SinglebaseChat);exports.adaptBlocks=Ut;exports.citedNumbers=bt;exports.defaultChatMessages=Et;exports.describeSource=L;exports.parseInline=Kt;exports.parseMarkdown=Dt;exports.resolveChatMessages=Bt;exports.settleStreaming=Pt;exports.splitFollowups=ft;exports.svgDataUrl=Wt;
|
|
3281
|
-
//# sourceMappingURL=chat-
|
|
3281
|
+
//# sourceMappingURL=chat-BWcGH9lr.cjs.map
|