@topthink/chat 1.1.37 → 1.1.39

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.
@@ -0,0 +1 @@
1
+ import*as c from"react";var l,e,t;function a(){return a=Object.assign?Object.assign.bind():function(c){for(var l=1;l<arguments.length;l++){var e=arguments[l];for(var t in e)({}).hasOwnProperty.call(e,t)&&(c[t]=e[t])}return c},a.apply(null,arguments)}const h=h=>c.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",width:200,height:200,className:"docx_svg__icon",viewBox:"0 0 1024 1024"},h),l||(l=c.createElement("path",{fill:"#1890FF",d:"m590.222 73.956 268.8 268.299v533.834c0 37.7-30.566 68.267-68.266 68.267H233.244c-37.7 0-68.266-30.567-68.266-68.267V142.222c0-37.7 30.566-68.266 68.266-68.266zm-11.77 28.438H233.244a39.83 39.83 0 0 0-39.799 38.457l-.023 1.371V876.09a39.82 39.82 0 0 0 38.457 39.8l1.365.022h557.512a39.82 39.82 0 0 0 39.799-38.457l.023-1.365V354.054z"})),e||(e=c.createElement("path",{fill:"#1890FF",d:"M854.756 370.648H639.613c-45.528 0-82.551-36.431-83.507-81.738l-.017-1.792V73.956h28.444v213.162c0 29.895 23.82 54.232 53.516 55.063l1.564.023h215.143zM85.333 489.244h853.334q28.444 0 28.444 28.445v284.444q0 28.445-28.444 28.445H85.333q-28.444 0-28.444-28.445V517.69q0-28.445 28.444-28.445"})),t||(t=c.createElement("path",{fill:"#FFF",d:"M303.53 756.622c55.553 0 93.953-29.952 93.953-96.256s-38.4-94.464-96.512-94.464h-54.784v190.72zm-5.375-36.864h-6.144V602.51h6.144c30.72 0 52.48 12.544 52.48 57.856s-21.76 59.392-52.48 59.392m213.248 40.448c51.968 0 87.296-37.376 87.296-99.84 0-62.208-35.328-97.792-87.296-97.792s-87.296 35.328-87.296 97.792 35.328 99.84 87.296 99.84m0-39.424c-25.088 0-40.448-23.552-40.448-60.416s15.36-58.624 40.448-58.624 40.704 21.76 40.704 58.624-15.616 60.416-40.704 60.416m203.264 39.424c24.832 0 46.08-9.472 62.208-28.16l-24.064-28.672c-8.96 9.728-20.992 17.408-36.352 17.408-26.88 0-44.288-22.016-44.288-59.904 0-37.12 20.224-59.136 44.8-59.136 13.568 0 23.552 6.144 33.28 14.848l23.808-29.184c-13.056-13.312-33.024-24.832-57.856-24.832-48.384 0-90.88 36.352-90.88 99.84 0 64.512 40.96 97.792 89.344 97.792"})));var s="data:image/svg+xml,%3c%3fxml version='1.0' standalone='no'%3f%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg class='icon' width='200px' height='200.00px' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M590.222222 73.955556L859.022222 342.254933V876.088889c0 37.700267-30.5664 68.266667-68.266666 68.266667H233.244444c-37.700267 0-68.266667-30.5664-68.266666-68.266667V142.222222c0-37.700267 30.5664-68.266667 68.266666-68.266666h356.977778z m-11.770311 28.438755H233.244444a39.827911 39.827911 0 0 0-39.799466 38.456889L193.422222 142.222222v733.866667a39.822222 39.822222 0 0 0 38.456889 39.799467L233.244444 915.911111h557.511112a39.822222 39.822222 0 0 0 39.799466-38.456889L830.577778 876.088889V354.053689l-252.125867-251.659378z' fill='%231890FF' /%3e%3cpath d='M854.755556 370.648178h-215.1424c-45.528178 0-82.551467-36.431644-83.5072-81.737956l-0.017067-1.792V73.955556h28.444444v213.162666c0 29.895111 23.819378 54.232178 53.515378 55.062756l1.564445 0.022755h215.1424v28.444445z' fill='%231890FF' /%3e%3cpath d='M56.888889 489.244444m28.444444 0l853.333334 0q28.444444 0 28.444444 28.444445l0 284.444444q0 28.444444-28.444444 28.444445l-853.333334 0q-28.444444 0-28.444444-28.444445l0-284.444444q0-28.444444 28.444444-28.444445Z' fill='%231890FF' /%3e%3cpath d='M303.530667 756.622222c55.552 0 93.952-29.952 93.952-96.256 0-66.304-38.4-94.464-96.512-94.464h-54.784V756.622222h57.344z m-5.376-36.864h-6.144v-117.248h6.144c30.72 0 52.48 12.544 52.48 57.856s-21.76 59.392-52.48 59.392z m213.248 40.448c51.968 0 87.296-37.376 87.296-99.84 0-62.208-35.328-97.792-87.296-97.792-51.968 0-87.296 35.328-87.296 97.792s35.328 99.84 87.296 99.84z m0-39.424c-25.088 0-40.448-23.552-40.448-60.416 0-36.864 15.36-58.624 40.448-58.624s40.704 21.76 40.704 58.624c0 36.864-15.616 60.416-40.704 60.416z m203.264 39.424c24.832 0 46.08-9.472 62.208-28.16l-24.064-28.672c-8.96 9.728-20.992 17.408-36.352 17.408-26.88 0-44.288-22.016-44.288-59.904 0-37.12 20.224-59.136 44.8-59.136 13.568 0 23.552 6.144 33.28 14.848l23.808-29.184c-13.056-13.312-33.024-24.832-57.856-24.832-48.384 0-90.88 36.352-90.88 99.84 0 64.512 40.96 97.792 89.344 97.792z' fill='white' /%3e%3c/svg%3e";export{h as ReactComponent,s as default};
package/es/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{styled as n,css as i,formatSize as o,Tooltip as s,useAsync as a,isRequestError as l,Form as c,Toast as d,InfiniteScroller as h,Offcanvas as u,dayjs as m,RequestButton as p,useImmer as g,getAbsoluteUrl as f,Lightbox as b,Clipboard as v,isImageUrl as x,request as y}from"@topthink/components";import*as k from"react";import{createContext as w,useContext as N,useEffect as E,useState as j,useRef as $,useCallback as C,forwardRef as M,useMemo as q,useImperativeHandle as z,Fragment as S,memo as F}from"react";import R from"react-textarea-autosize";import*as A from"path";import I from"path";import{Spinner as D,Badge as L,CloseButton as P,OverlayTrigger as T,Popover as O}from"react-bootstrap";import B from"eventemitter3";import _ from"lodash/isEqual";import{toString as U}from"hast-util-to-string";import H from"react-markdown";import"katex/dist/katex.min.css";import J from"rehype-highlight";import K from"rehype-katex";import Q from"remark-breaks";import W from"remark-gfm";import X from"remark-math";import{codes as V,types as Y}from"micromark-util-symbol";import{markdownLineEnding as G}from"micromark-util-character";import{createPortal as Z}from"react-dom";import ee from"use-resize-observer";const te=function(e){let{ext:r}=e;const{result:n}=a((async e=>(await function(e){switch(e){case"../../images/file/docx.svg":return import("./docx-nWXnlyT_.js");case"../../images/file/jpg.svg":return import("./jpg-6tBxSzWk.js");case"../../images/file/md.svg":return import("./md-GZ3HJPcw.js");case"../../images/file/pdf.svg":return import("./pdf-pVX1_E6T.js");case"../../images/file/png.svg":return import("./png-u0o1NMqQ.js");case"../../images/file/pptx.svg":return import("./pptx-Hprz0cON.js");case"../../images/file/txt.svg":return import("./txt-eHeCpvNO.js");case"../../images/file/xlsx.svg":return import("./xlsx-uOft-SV2.js");default:return new Promise((function(t,r){("function"==typeof queueMicrotask?queueMicrotask:setTimeout)(r.bind(null,new Error("Unknown variable dynamic import: "+e)))}))}}(`../../images/file/${e}.svg`)).default),[r]);return n?t("img",{width:30,height:30,src:n}):null};function re(r){let{className:n,name:i,size:a,loading:l,error:c,onRemove:d}=r;const h=I.extname(i).substring(1),u=e(se,{className:n,$error:!!c,children:[e(oe,{children:[t(te,{ext:h}),l&&t(D,{variant:"primary"})]}),e(ie,{children:[t("h4",{children:i}),t("p",{children:o(a,1)})]}),d&&t(ne,{onClick:e=>{e.preventDefault(),d()},children:t("i",{className:"bi bi-trash3"})})]});return c?t(s,{placement:"top",tooltip:c,children:u}):u}const ne=n.div`
1
+ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{styled as n,css as i,formatSize as o,Tooltip as s,useAsync as a,isRequestError as l,Form as c,Toast as d,InfiniteScroller as h,Offcanvas as u,dayjs as m,RequestButton as p,useImmer as g,getAbsoluteUrl as b,Lightbox as f,Clipboard as v,isImageUrl as x,request as y}from"@topthink/components";import*as w from"react";import{createContext as k,useContext as N,useEffect as E,useState as j,useRef as $,useCallback as C,forwardRef as M,useMemo as q,useImperativeHandle as z,Fragment as S,memo as F}from"react";import R from"react-textarea-autosize";import*as A from"path";import I from"path";import{Spinner as D,Badge as L,CloseButton as P,OverlayTrigger as T,Popover as O}from"react-bootstrap";import B from"eventemitter3";import _ from"lodash/isEqual";import{toString as U}from"hast-util-to-string";import H from"react-markdown";import"katex/dist/katex.min.css";import J from"rehype-highlight";import K from"rehype-katex";import Q from"remark-breaks";import W from"remark-gfm";import X from"remark-math";import{codes as V,types as Y}from"micromark-util-symbol";import{markdownLineEnding as G}from"micromark-util-character";import{createPortal as Z}from"react-dom";import ee from"use-resize-observer";const te=function({ext:e}){const{result:r}=a(async e=>(await function(e){switch(e){case"../../images/file/docx.svg":return import("./docx-2LwnwWwv.js");case"../../images/file/jpg.svg":return import("./jpg-muicsKjX.js");case"../../images/file/md.svg":return import("./md-DRS7QmE8.js");case"../../images/file/pdf.svg":return import("./pdf-CWBi2u4Z.js");case"../../images/file/png.svg":return import("./png-DNwbFeJk.js");case"../../images/file/pptx.svg":return import("./pptx-Bv4V_F_3.js");case"../../images/file/txt.svg":return import("./txt-CsqmEKjF.js");case"../../images/file/xlsx.svg":return import("./xlsx-CmkshfKZ.js");default:return new Promise(function(t,r){("function"==typeof queueMicrotask?queueMicrotask:setTimeout)(r.bind(null,new Error("Unknown variable dynamic import: "+e)))})}}(`../../images/file/${e}.svg`)).default,[e]);return r?t("img",{width:30,height:30,src:r}):null};function re({className:r,name:n,size:i,loading:a,error:l,onRemove:c}){const d=I.extname(n).substring(1),h=e(se,{className:r,$error:!!l,children:[e(oe,{children:[t(te,{ext:d}),a&&t(D,{variant:"primary"})]}),e(ie,{children:[t("h4",{children:n}),t("p",{children:o(i,1)})]}),c&&t(ne,{onClick:e=>{e.preventDefault(),c()},children:t("i",{className:"bi bi-trash3"})})]});return l?t(s,{placement:"top",tooltip:l,children:h}):h}const ne=n.div`
2
2
  width: 1.75rem;
3
3
  height: 1.75rem;
4
4
  align-items: center;
@@ -64,7 +64,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{styled as
64
64
  ${e=>e.$error&&i`
65
65
  border-color: var(--bs-danger) !important;
66
66
  `}
67
- `,ae=[".txt",".md",".pdf",".docx",".xlsx",".pptx",".png",".jpg"],le=w(null);function ce(e){const t=N(le);if(!t)throw new Error("useContext must be used within a Provider");const{setHandles:r}=t;return E((()=>{if(e)return r(e),()=>{r({})}}),[e]),t}function de(e){let{children:r,...n}=e;const[i,o]=j({});return t(le.Provider,{value:{...n,handles:i,setHandles:o},children:r})}function he(){const{setMessages:e,setSuggestions:t,setLoading:r,conversationId:n,setConversationId:i,request:o,handles:s}=ce(),a=$(null),c=$(!1),d=$(n);E((()=>{d.current=n}),[n]);const{onSuccess:h,onComplete:u}=s,m=C((t=>{if(t.data)if("[DONE]"!=t.data)try{const r=JSON.parse(t.data);r.conversation?(d.current=r.conversation,i(r.conversation)):r.suspend?c.current=!0:e((e=>{const t=e[e.length-1];if(r.chunks){if(t.chunks){const e=r.chunks.index;if(t.chunks[e]||(t.chunks[e]={content:"",reasoning:"",tools:[]}),r.chunks.error)t.chunks[e].error=r.chunks.error;else if(r.chunks.tools){t.chunks[e].tools||(t.chunks[e].tools=[]);const n=r.chunks.tools.index;"response"in r.chunks.tools?(t.chunks[e].tools[n].response=r.chunks.tools.response,t.chunks[e].tools[n].error=r.chunks.tools.error,t.chunks[e].tools[n].content=r.chunks.tools.content):t.chunks[e].tools[n]={name:r.chunks.tools.name,title:r.chunks.tools.title,arguments:r.chunks.tools.arguments}}else if(r.chunks.reasoning)t.chunks[e].reasoning+=r.chunks.reasoning;else if(r.chunks.content)if("object"==typeof r.chunks.content){Array.isArray(t.chunks[e].content)||(t.chunks[e].content=[]);const n=r.chunks.content.index,i=r.chunks.content.value;"string"==typeof i?(t.chunks[e].content[n]||(t.chunks[e].content[n]=""),t.chunks[e].content[n]+=i):t.chunks[e].content[n]=i}else t.chunks[e].content+=r.chunks.content;else r.chunks.node&&(t.chunks[e].node={...t.chunks[e].node,...r.chunks.node})}}else r.stats?t.stats=r.stats:r.id&&(t.id=r.id)}))}catch(e){console.error(e)}else e((e=>{e[e.length-1].loading=!1}))}),[]),p=C((t=>{let r="未知错误";l(t)&&(r=401==t.response?.status?"未授权或授权已过期,请刷新页面后重试":"string"==typeof t.errors?t.errors:Object.values(t.errors).join("\n")),e((e=>{const t=e[e.length-1];t.chunks&&(0===t.chunks.length?t.chunks=[{error:r}]:t.chunks[t.chunks.length-1].error=r),t.loading=!1}))}),[]),g=C((async function(n){if("string"==typeof n){for(var i=arguments.length,s=new Array(i>1?i-1:0),l=1;l<i;l++)s[l-1]=arguments[l];n={query:n,...s}}const{query:g,files:f=[],variables:b={},quote:v}=n;if(g||f.length>0){a.current&&a.current.abort(),c.current=!1,r(!0),t([]),e((e=>{e.push({query:g,quote:v,files:f,variables:b,chunks:[],loading:!0})}));try{let e={method:"post",data:{query:g,quote:v,files:f,variables:b,conversation:d.current},onMessage:m};await o(e),c.current||h?.()}catch(e){p(e)}r(!1),u?.()}}),[o,s]);return{send:g,resume:C((async t=>{try{a.current&&a.current.abort(),c.current=!1,r(!0),e((e=>{e[e.length-1].loading=!0}));let n={url:"resume",method:"post",data:{conversation:d.current,chunk:t.chunk,payload:t.payload},onMessage:m};await o(n),c.current||h?.()}catch(e){p(e)}r(!1),u?.()}),[o,s]),suggest:C((async()=>{a.current=new AbortController;try{let e={method:"post",url:"/suggestion",data:{conversation:d.current},signal:a.current.signal};const r=await o(e);t(r)}catch{}finally{a.current=null}}),[o])}}function ue(e){let{variables:r,values:n,onSubmit:i,onChange:o,children:s}=e;const a={},l=[],d={};return r.forEach((e=>{a[e.key]={type:"string",title:e.label},"textarea"===e.type?d[e.key]={"ui:widget":"textarea"}:"select"===e.type&&e.options&&(a[e.key].enum=e.options,a[e.key].enumNames=e.options,e.options.length>0&&(a[e.key].default=e.options[0])),e.required&&l.push(e.key)})),t(c,{schema:{type:"object",properties:a,required:l},formData:n,omitExtraData:!0,uiSchema:d,submitText:"开始对话",onSubmit:i,onChange:o,children:s})}const me=n.button`
67
+ `,ae=[".txt",".md",".pdf",".docx",".xlsx",".pptx",".png",".jpg"],le=k(null);function ce(e){const t=N(le);if(!t)throw new Error("useContext must be used within a Provider");const{setHandles:r}=t;return E(()=>{if(e)return r(e),()=>{r({})}},[e]),t}function de({children:e,...r}){const[n,i]=j({});return t(le.Provider,{value:{...r,handles:n,setHandles:i},children:e})}function he(){const{setMessages:e,setSuggestions:t,setLoading:r,conversationId:n,setConversationId:i,request:o,handles:s}=ce(),a=$(null),c=$(!1),d=$(n);E(()=>{d.current=n},[n]);const{onSuccess:h,onComplete:u}=s,m=C(t=>{if(t.data)if("[DONE]"!=t.data)try{const r=JSON.parse(t.data);r.conversation?(d.current=r.conversation,i(r.conversation)):r.suspend?c.current=!0:e(e=>{const t=e[e.length-1];if(r.chunks){if(t.chunks){const e=r.chunks.index;if(t.chunks[e]||(t.chunks[e]={content:"",reasoning:"",tools:[]}),r.chunks.error)t.chunks[e].error=r.chunks.error;else if(r.chunks.tools){t.chunks[e].tools||(t.chunks[e].tools=[]);const n=r.chunks.tools.index;delete r.chunks.tools.index,t.chunks[e].tools[n]&&"arguments"in r.chunks.tools?t.chunks[e].tools[n].arguments+=r.chunks.tools.arguments:t.chunks[e].tools[n]={...t.chunks[e].tools[n],...r.chunks.tools}}else if(r.chunks.reasoning)t.chunks[e].reasoning+=r.chunks.reasoning;else if(r.chunks.content)if("object"==typeof r.chunks.content){Array.isArray(t.chunks[e].content)||(t.chunks[e].content=[]);const n=r.chunks.content.index,i=r.chunks.content.value;"string"==typeof i?(t.chunks[e].content[n]||(t.chunks[e].content[n]=""),t.chunks[e].content[n]+=i):t.chunks[e].content[n]=i}else t.chunks[e].content+=r.chunks.content;else r.chunks.node&&(t.chunks[e].node={...t.chunks[e].node,...r.chunks.node})}}else r.stats?t.stats=r.stats:r.id&&(t.id=r.id)})}catch(e){console.error(e)}else e(e=>{e[e.length-1].loading=!1})},[]),p=C(t=>{let r="未知错误";l(t)&&(r=401==t.response?.status?"未授权或授权已过期,请刷新页面后重试":"string"==typeof t.errors?t.errors:Object.values(t.errors).join("\n")),e(e=>{const t=e[e.length-1];t.chunks&&(0===t.chunks.length?t.chunks=[{error:r}]:t.chunks[t.chunks.length-1].error=r),t.loading=!1})},[]);return{send:C(async(n,...i)=>{"string"==typeof n&&(n={query:n,...i});const{query:s,files:l=[],variables:g={},quote:b}=n;if(s||l.length>0){a.current&&a.current.abort(),c.current=!1,r(!0),t([]),e(e=>{e.push({query:s,quote:b,files:l,variables:g,chunks:[],loading:!0})});try{let e={method:"post",data:{query:s,quote:b,files:l,variables:g,conversation:d.current},onMessage:m};await o(e),c.current||h?.()}catch(e){p(e)}r(!1),u?.()}},[o,s]),resume:C(async t=>{try{a.current&&a.current.abort(),c.current=!1,r(!0),e(e=>{e[e.length-1].loading=!0});let n={url:"resume",method:"post",data:{conversation:d.current,chunk:t.chunk,payload:t.payload},onMessage:m};await o(n),c.current||h?.()}catch(e){p(e)}r(!1),u?.()},[o,s]),suggest:C(async()=>{a.current=new AbortController;try{let e={method:"post",url:"/suggestion",data:{conversation:d.current},signal:a.current.signal};const r=await o(e);t(r)}catch{}finally{a.current=null}},[o])}}function ue({variables:e,values:r,onSubmit:n,onChange:i,children:o}){const s={},a=[],l={};return e.forEach(e=>{s[e.key]={type:"string",title:e.label},"textarea"===e.type?l[e.key]={"ui:widget":"textarea"}:"select"===e.type&&e.options&&(s[e.key].enum=e.options,s[e.key].enumNames=e.options,e.options.length>0&&(s[e.key].default=e.options[0])),e.required&&a.push(e.key)}),t(c,{schema:{type:"object",properties:s,required:a},formData:r,omitExtraData:!0,uiSchema:l,submitText:"开始对话",onSubmit:n,onChange:i,children:o})}const me=n.button`
68
68
  color: var(--bs-secondary);
69
69
  cursor: pointer;
70
70
  display: flex;
@@ -87,12 +87,12 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{styled as
87
87
  background-color: var(--bs-gray-200);
88
88
  }
89
89
 
90
- `;let pe=class{#e;#t;constructor(){this.#t=new B}onResult(e){this.#t.on("result",e)}onRecording(e){this.#t.on("recording",e)}onTranscribing(e){this.#t.on("transcribing",e)}start(){if(!this.#e){const e=window.SpeechRecognition||window.webkitSpeechRecognition;if(!e)return void d.error("浏览器不支持语音识别");const t=new e;t.continuous=!0,t.lang=navigator.language,t.onresult=e=>{const t=Array.from(e.results).at(-1)?.item(0).transcript;t&&this.#t.emit("result",t)},t.onspeechend=()=>{this.#t.emit("recording",!1)},t.onerror=e=>{this.#t.emit("recording",!1),d.error(e.error)},this.#e=t}this.#t.emit("recording",!0),this.#e.start()}stop(){this.#e?.stop(),this.#t.emit("recording",!1)}},ge=class{#t;#r;#n;#i;constructor(e){this.#r=e,this.#t=new B}async start(){try{this.#n=await navigator.mediaDevices.getUserMedia({audio:!0}),this.#i=new AudioContext;const e=this.#i.createScriptProcessor(0,1,1);this.#i.createMediaStreamSource(this.#n).connect(e),e.connect(this.#i.destination);let t=[],r=0;const n=.01,i=1;e.onaudioprocess=e=>{const o=e.playbackTime,s=e.inputBuffer.getChannelData(0);let a=!0;for(let e=0;e<s.length;e++)if(Math.abs(s[e])>n){a=!1;break}if(a){const e=o-r;e>i&&(t.length>1&&(this.save(t),t=[]),e>10&&this.stop())}else t.push(new Float32Array(s)),r=o},this.#t.emit("recording",!0)}catch(e){d.error(e.message)}}convertBuffer(e){const t=new Float32Array(e),r=new Int16Array(e.length);for(let e=0;e<t.length;e++){const n=Math.max(-1,Math.min(1,t[e]));r[e]=n<0?32768*n:32767*n}return r}async encodeMP3(e){const{Mp3Encoder:t}=await import("@breezystack/lamejs"),r=new t(1,44100,128),n=[];for(const t of e){const e=this.convertBuffer(t),i=1152;let o=e.length;for(let t=0;o>=0;t+=i){const s=e.subarray(t,t+i),a=r.encodeBuffer(s);n.push(new Int8Array(a)),o-=i}}return n.push(r.flush()),new Blob(n,{type:"audio/mp3"})}async save(e){const t=await this.encodeMP3(e);try{this.#t.emit("transcribing",!0);const e=await this.#r(t);e&&this.#t.emit("result",e)}catch(e){}finally{this.#t.emit("transcribing",!1)}}stop(){this.#n&&(this.#n.getTracks().forEach((e=>e.stop())),this.#n=void 0),this.#i&&(this.#i.close(),this.#i=void 0),this.#t.emit("recording",!1)}onResult(e){this.#t.on("result",e)}onRecording(e){this.#t.on("recording",e)}onTranscribing(e){this.#t.on("transcribing",e)}};const fe=M(((r,n)=>{let{onResult:i,model:o="builtin"}=r;const{request:a}=ce(),l=q((()=>{if("builtin"!==o)return async e=>{const t=new FormData;t.append("file",e,"audio.mp3"),t.append("model",o);return(await a({url:"/transcriptions",method:"post",data:t})).text}}),[o]),{start:c,stop:d,recording:h,transcribing:u}=function(e){let{onResult:t,loader:r}=e;const n=$(),[i,o]=j(!1),[s,a]=j(!1);return E((()=>()=>{n.current&&(n.current.stop(),n.current=void 0)}),[]),{recording:i,transcribing:s,start:async()=>{n.current||(n.current=r?new ge(r):new pe,n.current.onRecording(o),n.current.onTranscribing(a),n.current.onResult(t)),n.current.start()},stop:()=>{n.current&&n.current.stop()}}}({onResult:i,loader:l});return z(n,(()=>({start:c,stop:d})),[c,d]),t(s,{tooltip:h?"停止":"语音输入",placement:"top",children:e(me,{onMouseDown:e=>{e.preventDefault(),h?d():c()},children:[u&&t(be,{animation:"border",variant:"primary",size:"sm"}),t("i",h?{className:"bi bi-mic-fill text-danger"}:{className:"bi bi-mic"})]})})})),be=n(D)`
90
+ `;let pe=class{#e;#t;constructor(){this.#t=new B}onResult(e){this.#t.on("result",e)}onRecording(e){this.#t.on("recording",e)}onTranscribing(e){this.#t.on("transcribing",e)}start(){if(!this.#e){const e=window.SpeechRecognition||window.webkitSpeechRecognition;if(!e)return void d.error("浏览器不支持语音识别");const t=new e;t.continuous=!0,t.lang=navigator.language,t.onresult=e=>{const t=Array.from(e.results).at(-1)?.item(0).transcript;t&&this.#t.emit("result",t)},t.onspeechend=()=>{this.#t.emit("recording",!1)},t.onerror=e=>{this.#t.emit("recording",!1),d.error(e.error)},this.#e=t}this.#t.emit("recording",!0),this.#e.start()}stop(){this.#e?.stop(),this.#t.emit("recording",!1)}},ge=class{#t;#r;#n;#i;constructor(e){this.#r=e,this.#t=new B}async start(){try{this.#n=await navigator.mediaDevices.getUserMedia({audio:!0}),this.#i=new AudioContext;const e=this.#i.createScriptProcessor(0,1,1);this.#i.createMediaStreamSource(this.#n).connect(e),e.connect(this.#i.destination);let t=[],r=0;const n=.01,i=1;e.onaudioprocess=e=>{const o=e.playbackTime,s=e.inputBuffer.getChannelData(0);let a=!0;for(let e=0;e<s.length;e++)if(Math.abs(s[e])>n){a=!1;break}if(a){const e=o-r;e>i&&(t.length>1&&(this.save(t),t=[]),e>10&&this.stop())}else t.push(new Float32Array(s)),r=o},this.#t.emit("recording",!0)}catch(e){d.error(e.message)}}convertBuffer(e){const t=new Float32Array(e),r=new Int16Array(e.length);for(let e=0;e<t.length;e++){const n=Math.max(-1,Math.min(1,t[e]));r[e]=n<0?32768*n:32767*n}return r}async encodeMP3(e){const{Mp3Encoder:t}=await import("@breezystack/lamejs"),r=new t(1,44100,128),n=[];for(const t of e){const e=this.convertBuffer(t),i=1152;let o=e.length;for(let t=0;o>=0;t+=i){const s=e.subarray(t,t+i),a=r.encodeBuffer(s);n.push(new Int8Array(a)),o-=i}}return n.push(r.flush()),new Blob(n,{type:"audio/mp3"})}async save(e){const t=await this.encodeMP3(e);try{this.#t.emit("transcribing",!0);const e=await this.#r(t);e&&this.#t.emit("result",e)}catch(e){}finally{this.#t.emit("transcribing",!1)}}stop(){this.#n&&(this.#n.getTracks().forEach(e=>e.stop()),this.#n=void 0),this.#i&&(this.#i.close(),this.#i=void 0),this.#t.emit("recording",!1)}onResult(e){this.#t.on("result",e)}onRecording(e){this.#t.on("recording",e)}onTranscribing(e){this.#t.on("transcribing",e)}};const be=M(({onResult:r,model:n="builtin"},i)=>{const{request:o}=ce(),a=q(()=>{if("builtin"!==n)return async e=>{const t=new FormData;t.append("file",e,"audio.mp3"),t.append("model",n);return(await o({url:"/transcriptions",method:"post",data:t})).text}},[n]),{start:l,stop:c,recording:d,transcribing:h}=function({onResult:e,loader:t}){const r=$(),[n,i]=j(!1),[o,s]=j(!1);return E(()=>()=>{r.current&&(r.current.stop(),r.current=void 0)},[]),{recording:n,transcribing:o,start:async()=>{r.current||(r.current=t?new ge(t):new pe,r.current.onRecording(i),r.current.onTranscribing(s),r.current.onResult(e)),r.current.start()},stop:()=>{r.current&&r.current.stop()}}}({onResult:r,loader:a});return z(i,()=>({start:l,stop:c}),[l,c]),t(s,{tooltip:d?"停止":"语音输入",placement:"top",children:e(me,{onMouseDown:e=>{e.preventDefault(),d?c():l()},children:[h&&t(fe,{animation:"border",variant:"primary",size:"sm"}),t("i",d?{className:"bi bi-mic-fill text-danger"}:{className:"bi bi-mic"})]})})}),fe=n(D)`
91
91
  position: absolute;
92
92
  --bs-spinner-width: .75rem;
93
93
  --bs-spinner-height: .75rem;
94
94
  --bs-spinner-border-width: 0.1em;
95
- `,ve=M(((e,r)=>{let{className:n,children:i,size:o,tooltip:a,placement:l,onClick:c,onMouseDown:d}=e;const h=t(xe,{ref:r,className:n,onClick:c,onMouseDown:d,$size:o,children:i});return a?t(s,{tooltip:a,placement:l,children:h}):h})),xe=n.div`
95
+ `,ve=M(({className:e,children:r,size:n,tooltip:i,placement:o,onClick:a,onMouseDown:l},c)=>{const d=t(xe,{ref:c,className:e,onClick:a,onMouseDown:l,$size:n,children:r});return i?t(s,{tooltip:i,placement:o,children:d}):d}),xe=n.div`
96
96
  width: 2rem;
97
97
  height: 2rem;
98
98
  align-items: center;
@@ -107,19 +107,19 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{styled as
107
107
  font-size: 1.5rem;
108
108
  }
109
109
 
110
- ${e=>{let{$size:t}=e;return"sm"===t&&i`
110
+ ${({$size:e})=>"sm"===e&&i`
111
111
  width: 1.5rem;
112
112
  height: 1.5rem;
113
113
  font-size: 1rem;
114
- `}};
114
+ `};
115
115
 
116
116
  &:hover {
117
117
  background-color: var(--bs-secondary-bg-subtle);
118
118
  }
119
- `;function ye(){const{request:n,reset:i,conversationId:o}=ce(),[a,l]=j(!1);return e(r,{children:[t(ve,{tooltip:"历史记录",placement:"top",onClick:()=>l(!0),children:t("i",{className:"bi bi-clock-history"})}),t(u,{show:a,onHide:()=>{l(!1)},placement:"end",header:"聊天历史记录",bodyAs:ke,children:a&&t($e,{children:t(je,{useWindow:!1,source:e=>n({url:"/conversation",params:e}),render:r=>{let{data:a,loading:c,setData:d}=r;return a.length||c?a.map(((r,a)=>{const c=r.messages?.reduce(((e,t)=>e+t.chunks.reduce(((e,t)=>e+(t.content||"")),"")),"");return e(S,{children:[a>0&&t("hr",{className:"mx-2 my-2"}),e(Ee,{onClick:()=>{i(r),l(!1)},children:[e(Ne,{children:[o===r.id&&t(L,{bg:"secondary",children:"当前"}),t("span",{className:"fw-bold overflow-hidden text-truncate me-auto",children:r.title||"未命名对话"}),t("span",{className:"text-body text-opacity-50 flex-shrink-0 ms-5",children:m(r.update_time).fromNow()})]}),e(we,{children:[t("span",{className:"overflow-hidden text-truncate me-auto",children:c||" "}),t("span",{className:"ms-3",children:o!==r.id&&t(s,{tooltip:"删除",children:t(p,{as:"a",confirm:"确定要删除吗?",onRequest:()=>n({url:`/conversation/${r.id}`,method:"DELETE"}),onSuccess:()=>{d((e=>{const t=e.findIndex((e=>e.id===r.id));-1!==t&&e.splice(t,1)}))},children:t("i",{className:"bi bi-trash3"})})})})]})]})]},r.id)})):t("div",{className:"text-muted text-center py-5",children:"暂无对话记录"})}})})})]})}const ke=n.div`
119
+ `;function ye(){const{request:n,reset:i,conversationId:o}=ce(),[a,l]=j(!1);return e(r,{children:[t(ve,{tooltip:"历史记录",placement:"top",onClick:()=>l(!0),children:t("i",{className:"bi bi-clock-history"})}),t(u,{show:a,onHide:()=>{l(!1)},placement:"end",header:"聊天历史记录",bodyAs:we,children:a&&t($e,{children:t(je,{useWindow:!1,source:e=>n({url:"/conversation",params:e}),render:({data:r,loading:a,setData:c})=>r.length||a?r.map((r,a)=>{const d=r.messages?.reduce((e,t)=>e+t.chunks.reduce((e,t)=>e+(t.content||""),""),"");return e(S,{children:[a>0&&t("hr",{className:"mx-2 my-2"}),e(Ee,{onClick:()=>{i(r),l(!1)},children:[e(Ne,{children:[o===r.id&&t(L,{bg:"secondary",children:"当前"}),t("span",{className:"fw-bold overflow-hidden text-truncate me-auto",children:r.title||"未命名对话"}),t("span",{className:"text-body text-opacity-50 flex-shrink-0 ms-5",children:m(r.update_time).fromNow()})]}),e(ke,{children:[t("span",{className:"overflow-hidden text-truncate me-auto",children:d||" "}),t("span",{className:"ms-3",children:o!==r.id&&t(s,{tooltip:"删除",children:t(p,{as:"a",confirm:"确定要删除吗?",onRequest:()=>n({url:`/conversation/${r.id}`,method:"DELETE"}),onSuccess:()=>{c(e=>{const t=e.findIndex(e=>e.id===r.id);-1!==t&&e.splice(t,1)})},children:t("i",{className:"bi bi-trash3"})})})})]})]})]},r.id)}):t("div",{className:"text-muted text-center py-5",children:"暂无对话记录"})})})})]})}const we=n.div`
120
120
  padding: 0;
121
121
  overflow: hidden;
122
- `,we=n.div`
122
+ `,ke=n.div`
123
123
  color: var(--bs-gray-600);
124
124
  font-weight: 400;
125
125
  line-height: 22px;
@@ -146,7 +146,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{styled as
146
146
 
147
147
 
148
148
  &:hover {
149
- ${we} :last-child {
149
+ ${ke} :last-child {
150
150
  display: initial;
151
151
  }
152
152
  }
@@ -158,7 +158,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{styled as
158
158
  `,$e=n.div`
159
159
  height: 100%;
160
160
  overflow-y: auto;
161
- `;var Ce;function Me(){return Me=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Me.apply(this,arguments)}const qe=e=>k.createElement("svg",Me({width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256"},e),Ce||(Ce=k.createElement("path",{fillRule:"evenodd",d:"M128 22C69.458 22 22 69.458 22 128v96c0 5.523 4.477 10 10 10h96c58.542 0 106-47.458 106-106S186.542 22 128 22m0 56c5.523 0 10 4.477 10 10v30h30c5.523 0 10 4.477 10 10s-4.477 10-10 10h-30v30c0 5.523-4.477 10-10 10s-10-4.477-10-10v-30H88c-5.523 0-10-4.477-10-10s4.477-10 10-10h30V88c0-5.523 4.477-10 10-10",clipRule:"evenodd","data-follow-fill":"#000"})));function ze(){const{reset:e}=ce();return t(ve,{className:"text-primary",tooltip:"新会话",placement:"top",onClick:e,children:t(qe,{})})}function Se(r){let{children:n}=r;return e(Re,{children:[n,e(Fe,{children:[t(ye,{}),t(ze,{})]})]})}const Fe=n.div`
161
+ `;var Ce;function Me(){return Me=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Me.apply(null,arguments)}const qe=e=>w.createElement("svg",Me({width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 256 256"},e),Ce||(Ce=w.createElement("path",{fillRule:"evenodd",d:"M128 22C69.458 22 22 69.458 22 128v96c0 5.523 4.477 10 10 10h96c58.542 0 106-47.458 106-106S186.542 22 128 22m0 56c5.523 0 10 4.477 10 10v30h30c5.523 0 10 4.477 10 10s-4.477 10-10 10h-30v30c0 5.523-4.477 10-10 10s-10-4.477-10-10v-30H88c-5.523 0-10-4.477-10-10s4.477-10 10-10h30V88c0-5.523 4.477-10 10-10",clipRule:"evenodd","data-follow-fill":"#000"})));function ze(){const{reset:e}=ce();return t(ve,{className:"text-primary",tooltip:"新会话",placement:"top",onClick:e,children:t(qe,{})})}function Se({children:r}){return e(Re,{children:[r,e(Fe,{children:[t(ye,{}),t(ze,{})]})]})}const Fe=n.div`
162
162
  display: flex;
163
163
  gap: .25rem;
164
164
  margin-left: auto;
@@ -166,7 +166,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{styled as
166
166
  margin-bottom: .5rem;
167
167
  display: flex;
168
168
  padding: 0 .125rem;
169
- `;var Ae=M((function(r,n){let{suggestion:i,fileTypes:o,speech:a,scrollRef:c,variables:h,minRows:u,toolbar:m,disabled:p,autoFocus:f,placeholder:b="请输入你的问题, Enter+Shift换行, Enter发送"}=r;const v=$(null),x=$(null),y=$(null),[k,w]=j(""),[N,M]=j(""),[S,F]=g([]),[I,D]=j(!1),L=o&&o.length>0?o:ae,{send:T,resume:O,suggest:B}=he(),_=q((()=>({onSuccess(){i&&B()},onComplete(){requestAnimationFrame((()=>{v.current?.focus()}))}})),[i]),{messages:U,loading:H,request:J}=ce(_),[K,Q]=j();E((()=>{const e=U.filter((e=>!!e.query));Q(e.at(-1)?.variables)}),[U]),E((()=>{!o&&S.length>0&&F([])}),[o]),E((()=>{const e=c.current;if(e&&T){const t=e=>{if(e.target instanceof HTMLAnchorElement&&"#!question"===e.target.hash){e.preventDefault();const t={query:e.target.text};h&&(t.variables={...K,...h.values}),T(t)}};return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}}}),[h,K]);const W=C((e=>{let{target:t}=e;if(t.files){const e=Array.from(t.files).filter((e=>!!L.includes(A.extname(e.name))&&(!(e.size>20971520)&&e))).slice(0,6-S.length);F((t=>{t.push(...e.map((e=>({file:e}))))})),e.forEach((async e=>{try{const t=new FormData;t.set("file",e);const r=await J({method:"POST",url:"/upload",data:t});F((t=>{const n=t.find((t=>t.file===e));n&&(n.path=r.path)}))}catch(t){const r=l(t)?t.message:"unknown error";F((t=>{const n=t.find((t=>t.file===e));n&&(n.error=r)}))}}))}t.value=""}),[S,L]),X=S.flatMap((e=>{let{file:t,path:r}=e;return r?[{name:t.name,size:t.size,path:r}]:[]})),V=C((()=>{if(k||X.length>0){const e={query:k,files:X};h&&(e.variables={...K,...h.values}),N&&(e.quote=N),T(e),w(""),M(""),F([]),y.current?.stop(!0)}}),[k,X,h,K,N]);if(z(n,(()=>({setQuery:w,setQuote:M,send:T,resume:O,focus(){v.current?.focus()}}))),h){const e=h.config.filter((e=>!(e.key in(h.values||{})))),r=function(t){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!!t&&e.every((e=>{const n=!e.required||t?.[e.key];return!n&&r&&d.error("请完善必填信息"),n}))};if(e.length>0&&!r(K))return t(De,{children:t(Ie,{children:t(ue,{values:K,variables:e,onSubmit:e=>{let{formData:t}=e;if(r(t,!0))return Q(t),!0}})})})}return e(_e,{children:[m&&t(Se,{children:m}),e(Be,{$focused:I&&!H,children:[S.length>0&&t(Pe,{children:S.map(((e,r)=>{let{file:n,error:i,path:o}=e;const s=void 0===i&&void 0===o;return t(Le,{name:n.name,size:n.size,error:i,loading:s,onRemove:()=>{F((e=>{const t=e.findIndex((e=>e.file===n));-1!==t&&e.splice(t,1)}))}},r)}))}),!!N&&e(Oe,{children:[t("i",{className:"bi bi-quote"}),t("p",{children:N}),t(P,{onClick:()=>M("")})]}),e(Te,{children:[t(R,{disabled:H||p,ref:v,placeholder:b,minRows:u,maxRows:5,value:k,onChange:e=>w(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),V())},autoFocus:f,onFocus:()=>D(!0),onBlur:()=>D(!1)}),o&&t(s,{tooltip:"可上传不超过6个小于20MB的文件",placement:"top",children:e(me,{disabled:S.length>=6,onClick:()=>x.current?.click(),children:[t("input",{onChange:W,multiple:!0,accept:L.join(","),ref:x,type:"file",hidden:!0}),t("i",{className:"bi bi-file-earmark-arrow-up"})]})}),a&&t(fe,{ref:y,model:a.model,onResult:e=>{v.current?.focus(),w((t=>t+e+" "))}}),t(me,{className:"text-primary",disabled:!k&&0===X.length,onClick:e=>{e.preventDefault(),V()},children:t("i",{className:"bi bi-send-fill"})})]})]})]})}));const Ie=n.div`
169
+ `;var Ae=M(function({suggestion:r,fileTypes:n,speech:i,scrollRef:o,variables:a,minRows:c,toolbar:h,disabled:u,autoFocus:m,placeholder:p="请输入你的问题, Enter+Shift换行, Enter发送"},b){const f=$(null),v=$(null),x=$(null),[y,w]=j(""),[k,N]=j(""),[M,S]=g([]),[F,I]=j(!1),D=n&&n.length>0?n:ae,{send:L,resume:T,suggest:O}=he(),B=q(()=>({onSuccess(){r&&O()},onComplete(){requestAnimationFrame(()=>{f.current?.focus()})}}),[r]),{messages:_,loading:U,request:H}=ce(B),[J,K]=j();E(()=>{const e=_.filter(e=>!!e.query);K(e.at(-1)?.variables)},[_]),E(()=>{!n&&M.length>0&&S([])},[n]),E(()=>{const e=o.current;if(e&&L){const t=e=>{if(e.target instanceof HTMLAnchorElement&&"#!question"===e.target.hash){e.preventDefault();const t={query:e.target.text};a&&(t.variables={...J,...a.values}),L(t)}};return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}}},[a,J]);const Q=C(({target:e})=>{if(e.files){const t=Array.from(e.files).filter(e=>!!D.includes(A.extname(e.name))&&(!(e.size>20971520)&&e)).slice(0,6-M.length);S(e=>{e.push(...t.map(e=>({file:e})))}),t.forEach(async e=>{try{const t=new FormData;t.set("file",e);const r=await H({method:"POST",url:"/upload",data:t});S(t=>{const n=t.find(t=>t.file===e);n&&(n.path=r.path)})}catch(t){const r=l(t)?t.message:"unknown error";S(t=>{const n=t.find(t=>t.file===e);n&&(n.error=r)})}})}e.value=""},[M,D]),W=M.flatMap(({file:e,path:t})=>t?[{name:e.name,size:e.size,path:t}]:[]),X=C(()=>{if(y||W.length>0){const e={query:y,files:W};a&&(e.variables={...J,...a.values}),k&&(e.quote=k),L(e),w(""),N(""),S([]),x.current?.stop(!0)}},[y,W,a,J,k]);if(z(b,()=>({setQuery:w,setQuote:N,send:L,resume:T,focus(){f.current?.focus()}})),a){const e=a.config.filter(e=>!(e.key in(a.values||{}))),r=(t,r=!1)=>!!t&&e.every(e=>{const n=!e.required||t?.[e.key];return!n&&r&&d.error("请完善必填信息"),n});if(e.length>0&&!r(J))return t(De,{children:t(Ie,{children:t(ue,{values:J,variables:e,onSubmit:({formData:e})=>{if(r(e,!0))return K(e),!0}})})})}return e(_e,{children:[h&&t(Se,{children:h}),e(Be,{$focused:F&&!U,children:[M.length>0&&t(Pe,{children:M.map(({file:e,error:r,path:n},i)=>{const o=void 0===r&&void 0===n;return t(Le,{name:e.name,size:e.size,error:r,loading:o,onRemove:()=>{S(t=>{const r=t.findIndex(t=>t.file===e);-1!==r&&t.splice(r,1)})}},i)})}),!!k&&e(Oe,{children:[t("i",{className:"bi bi-quote"}),t("p",{children:k}),t(P,{onClick:()=>N("")})]}),e(Te,{children:[t(R,{disabled:U||u,ref:f,placeholder:p,minRows:c,maxRows:5,value:y,onChange:e=>w(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),X())},autoFocus:m,onFocus:()=>I(!0),onBlur:()=>I(!1)}),n&&t(s,{tooltip:"可上传不超过6个小于20MB的文件",placement:"top",children:e(me,{disabled:M.length>=6,onClick:()=>v.current?.click(),children:[t("input",{onChange:Q,multiple:!0,accept:D.join(","),ref:v,type:"file",hidden:!0}),t("i",{className:"bi bi-file-earmark-arrow-up"})]})}),i&&t(be,{ref:x,model:i.model,onResult:e=>{f.current?.focus(),w(t=>t+e+" ")}}),t(me,{className:"text-primary",disabled:!y&&0===W.length,onClick:e=>{e.preventDefault(),X()},children:t("i",{className:"bi bi-send-fill"})})]})]})]})});const Ie=n.div`
170
170
  border-radius: var(--bs-border-radius-lg);
171
171
  box-shadow: var(--bs-box-shadow-sm);
172
172
  margin: 1rem;
@@ -236,7 +236,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{styled as
236
236
  box-shadow: 0.125rem 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
237
237
  `,_e=n.div`
238
238
  margin: 0 1rem 1rem;
239
- `;function Ue(e){return e.map((e=>({id:e.id,query:e.query,quote:e.quote||void 0,files:e.files||void 0,variables:e.variables,chunks:e.chunks.map((e=>{let{content:t="",node:r,error:n,tools:i=[],reasoning:o}=e;return{content:t,reasoning:o,error:n,tools:i,node:r}})),annotation:e.annotation,stats:{usage:e.usage,latency:e.latency}})))}function He(e){if((e=e.filter((e=>!!e.trim()))).length>3){const t=[...e];let r=e.length-3;for(;r--;){let e=Math.floor(Math.random()*t.length);t.splice(e,1)}e=t}return e}var Je,Ke,Qe;function We(){return We=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},We.apply(this,arguments)}const Xe=e=>k.createElement("svg",We({xmlns:"http://www.w3.org/2000/svg",width:20,height:10,fill:"#fff",viewBox:"0 0 120 30"},e),Je||(Je=k.createElement("circle",{cx:15,cy:15,r:15,fill:"#3c60ff"},k.createElement("animate",{attributeName:"r",begin:"0s",calcMode:"linear",dur:"0.8s",from:15,repeatCount:"indefinite",to:15,values:"15;9;15"}),k.createElement("animate",{attributeName:"fill-opacity",begin:"0s",calcMode:"linear",dur:"0.8s",from:1,repeatCount:"indefinite",to:1,values:"1;.5;1"}))),Ke||(Ke=k.createElement("circle",{cx:60,cy:15,r:9,fill:"#3c60ff",fillOpacity:.3},k.createElement("animate",{attributeName:"r",begin:"0s",calcMode:"linear",dur:"0.8s",from:9,repeatCount:"indefinite",to:9,values:"9;15;9"}),k.createElement("animate",{attributeName:"fill-opacity",begin:"0s",calcMode:"linear",dur:"0.8s",from:.5,repeatCount:"indefinite",to:.5,values:".5;1;.5"}))),Qe||(Qe=k.createElement("circle",{cx:105,cy:15,r:15,fill:"#3c60ff"},k.createElement("animate",{attributeName:"r",begin:"0s",calcMode:"linear",dur:"0.8s",from:15,repeatCount:"indefinite",to:15,values:"15;9;15"}),k.createElement("animate",{attributeName:"fill-opacity",begin:"0s",calcMode:"linear",dur:"0.8s",from:1,repeatCount:"indefinite",to:1,values:"1;.5;1"}))));function Ve(e){if(!e)return"";if("string"==typeof e)return e;if("image"===e.type){return`![](${f(e.image)})`}return""}const Ye=function(e,t,r){function n(t){return t!==V.leftSquareBracket?(e.exit("citeMarker"),e.enter("citeData"),e.enter(Y.chunkString,{contentType:"string"}),i(t)):(e.consume(t),n)}function i(n){return n===V.rightSquareBracket?(e.exit(Y.chunkString),e.exit("citeData"),e.enter("citeMarker"),function(n){if(n!==V.rightSquareBracket)return r(n);return e.consume(n),e.exit("citeMarker"),e.exit("cite"),t(n)}(n)):G(n)||n===V.eof||n>57||n<48?r(n):(e.consume(n),i)}return function(t){return t!==V.leftSquareBracket?r(t):(e.enter("cite"),e.enter("citeMarker"),n(t))}},Ge=function(){const e=this.data();e.micromarkExtensions.push({text:{[V.leftSquareBracket]:{tokenize:Ye}}}),e.fromMarkdownExtensions.push({enter:{cite:function(e){this.enter({type:"cite",data:{hName:"cite",hChildren:[{type:"text",value:""}]}},e)},citeData:function(){this.buffer()}},exit:{cite:function(e){this.exit(e)},citeData:function(){const e=this.resume();this.stack[this.stack.length-1].data.hChildren[0].value=e}}})},Ze=b.Image,et={pre:r=>{let{children:n,node:i}=r;const[o,s]=j(!1),a=q((()=>{const e=i.children[0];return"element"===(t=e).type&&"code"===t.tagName&&!!e.properties?.className?.includes("language-svg");var t}),[i]);E((()=>{a&&s(a)}),[a]);const l=q((()=>U(i)),[i]);return e(st,{children:[e(ot,{children:[!o&&t(v,{tooltip:!1,as:it,content:l}),a&&o&&t(it,{onClick:()=>{const e=new Blob([l],{type:"image/svg+xml"}),t=URL.createObjectURL(e),r=document.createElement("a");r.href=t,r.download="image.svg",r.click(),URL.revokeObjectURL(t)},children:"下载"}),a&&t(it,{onClick:()=>s(!o),children:o?"源码":"预览"})]}),a&&o?t("div",{dangerouslySetInnerHTML:{__html:l}}):t("pre",{children:n})]})},a:e=>{let{node:r,href:n,...i}=e;const o=n?.startsWith("http")?"_blank":"_self";return t("a",{...i,href:n,target:o})},img:e=>{let{node:r,...n}=e;return t(Ze,{...n})}},tt=[[X,{singleDollarTextMath:!1}],W,Q],rt=[K,[J,{detect:!1,ignoreMissing:!0}]],nt=F((e=>{let{content:r,components:n,cite:i}=e;r=r.replace(/\\\(\s(.+?)\s\\\)/g,"$$$$ $1 $$$$");const o=q((()=>{const e={...et,...n};return i&&(e.cite=i),e}),[n,i]),s=q((()=>i?[...tt,Ge]:tt),[i]);return t(at,{remarkPlugins:s,rehypePlugins:rt,components:o,children:r})}),_),it=n.div`
239
+ `;function Ue(e){return e.map(e=>({id:e.id,query:e.query,quote:e.quote||void 0,files:e.files||void 0,variables:e.variables,chunks:e.chunks.map(({content:e="",node:t,error:r,tools:n=[],reasoning:i})=>({content:e,reasoning:i,error:r,tools:n,node:t})),annotation:e.annotation,stats:{usage:e.usage,latency:e.latency}}))}function He(e){if((e=e.filter(e=>!!e.trim())).length>3){const t=[...e];let r=e.length-3;for(;r--;){let e=Math.floor(Math.random()*t.length);t.splice(e,1)}e=t}return e}var Je,Ke,Qe;function We(){return We=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},We.apply(null,arguments)}const Xe=e=>w.createElement("svg",We({xmlns:"http://www.w3.org/2000/svg",width:20,height:10,fill:"#fff",viewBox:"0 0 120 30"},e),Je||(Je=w.createElement("circle",{cx:15,cy:15,r:15,fill:"#3c60ff"},w.createElement("animate",{attributeName:"r",begin:"0s",calcMode:"linear",dur:"0.8s",from:15,repeatCount:"indefinite",to:15,values:"15;9;15"}),w.createElement("animate",{attributeName:"fill-opacity",begin:"0s",calcMode:"linear",dur:"0.8s",from:1,repeatCount:"indefinite",to:1,values:"1;.5;1"}))),Ke||(Ke=w.createElement("circle",{cx:60,cy:15,r:9,fill:"#3c60ff",fillOpacity:.3},w.createElement("animate",{attributeName:"r",begin:"0s",calcMode:"linear",dur:"0.8s",from:9,repeatCount:"indefinite",to:9,values:"9;15;9"}),w.createElement("animate",{attributeName:"fill-opacity",begin:"0s",calcMode:"linear",dur:"0.8s",from:.5,repeatCount:"indefinite",to:.5,values:".5;1;.5"}))),Qe||(Qe=w.createElement("circle",{cx:105,cy:15,r:15,fill:"#3c60ff"},w.createElement("animate",{attributeName:"r",begin:"0s",calcMode:"linear",dur:"0.8s",from:15,repeatCount:"indefinite",to:15,values:"15;9;15"}),w.createElement("animate",{attributeName:"fill-opacity",begin:"0s",calcMode:"linear",dur:"0.8s",from:1,repeatCount:"indefinite",to:1,values:"1;.5;1"}))));function Ve(e){if(!e)return"";if("string"==typeof e)return e;if("image"===e.type){return`![](${b(e.image)})`}return""}const Ye=function(e,t,r){function n(t){return t!==V.leftSquareBracket?(e.exit("citeMarker"),e.enter("citeData"),e.enter(Y.chunkString,{contentType:"string"}),i(t)):(e.consume(t),n)}function i(n){return n===V.rightSquareBracket?(e.exit(Y.chunkString),e.exit("citeData"),e.enter("citeMarker"),function(n){if(n!==V.rightSquareBracket)return r(n);return e.consume(n),e.exit("citeMarker"),e.exit("cite"),t(n)}(n)):G(n)||n===V.eof||n>57||n<48?r(n):(e.consume(n),i)}return function(t){return t!==V.leftSquareBracket?r(t):(e.enter("cite"),e.enter("citeMarker"),n(t))}},Ge=function(){const e=this.data();e.micromarkExtensions.push({text:{[V.leftSquareBracket]:{tokenize:Ye}}}),e.fromMarkdownExtensions.push({enter:{cite:function(e){this.enter({type:"cite",data:{hName:"cite",hChildren:[{type:"text",value:""}]}},e)},citeData:function(){this.buffer()}},exit:{cite:function(e){this.exit(e)},citeData:function(){const e=this.resume();this.stack[this.stack.length-1].data.hChildren[0].value=e}}})},Ze=f.Image,et={pre:({children:r,node:n})=>{const[i,o]=j(!1),s=q(()=>{const e=n.children[0];return"element"===(t=e).type&&"code"===t.tagName&&!!e.properties?.className?.includes("language-svg");var t},[n]);E(()=>{s&&o(s)},[s]);const a=q(()=>U(n),[n]);return e(st,{children:[e(ot,{children:[!i&&t(v,{tooltip:!1,as:it,content:a}),s&&i&&t(it,{onClick:()=>{const e=new Blob([a],{type:"image/svg+xml"}),t=URL.createObjectURL(e),r=document.createElement("a");r.href=t,r.download="image.svg",r.click(),URL.revokeObjectURL(t)},children:"下载"}),s&&t(it,{onClick:()=>o(!i),children:i?"源码":"预览"})]}),s&&i?t("div",{dangerouslySetInnerHTML:{__html:a}}):t("pre",{children:r})]})},a:({node:e,href:r,...n})=>{const i=r?.startsWith("http")?"_blank":"_self";return t("a",{...n,href:r,target:i})},img:({node:e,...r})=>t(Ze,{...r})},tt=[[X,{singleDollarTextMath:!1}],W,Q],rt=[K,[J,{detect:!1,ignoreMissing:!0}]],nt=F(({content:e,components:r,cite:n})=>{e=e.replace(/\\\(\s(.+?)\s\\\)/g,"$$$$ $1 $$$$");const i=q(()=>{const e={...et,...r};return n&&(e.cite=n),e},[r,n]),o=q(()=>n?[...tt,Ge]:tt,[n]);return t(at,{remarkPlugins:o,rehypePlugins:rt,components:i,children:e})},_),it=n.div`
240
240
  cursor: pointer;
241
241
  padding: 2px 10px;
242
242
  background-color: #303030;
@@ -540,7 +540,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{styled as
540
540
  .hljs-strong {
541
541
  font-weight: 700;
542
542
  }
543
- `;var lt=M((function(e,r){let{children:n,tooltip:i,onClick:o,disabled:a,...l}=e;a&&(o=void 0);const c=t(ct,{ref:r,onClick:o,$disabled:a,...l,children:n});return i?t(s,{tooltip:i,placement:"top",children:c}):c}));const ct=n.div`
543
+ `;var lt=M(function({children:e,tooltip:r,onClick:n,disabled:i,...o},a){i&&(n=void 0);const l=t(ct,{ref:a,onClick:n,$disabled:i,...o,children:e});return r?t(s,{tooltip:r,placement:"top",children:l}):l});const ct=n.div`
544
544
  align-items: center;
545
545
  justify-content: center;
546
546
  border-radius: .375rem;
@@ -573,7 +573,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{styled as
573
573
  `}
574
574
 
575
575
  }
576
- `,dt=w(null);var ht=dt.Provider;const ut=b.Image;function mt(e){let{src:r,...n}=e;const{imageResolver:i}=ce();return i&&r&&(r=i(r)),t(pt,{children:t(ut,{src:r,...n})})}const pt=n.div`
576
+ `,dt=k(null);var ht=dt.Provider;const ut=f.Image;function mt({src:e,...r}){const{imageResolver:n}=ce();return n&&e&&(e=n(e)),t(pt,{children:t(ut,{src:e,...r})})}const pt=n.div`
577
577
  margin-bottom: .5rem;
578
578
  margin-top: .5rem;
579
579
  border: var(--bs-border-width) var(--bs-border-style) var(--bs-border-color);
@@ -598,7 +598,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{styled as
598
598
  max-height: 100%;
599
599
  max-width: 100%;
600
600
  }
601
- `,gt=w(null);function ft(){const e=N(gt);if(!e)throw new Error("useContext must be used within a Provider");return e}function bt(e){let{children:r,...n}=e;return t(gt.Provider,{value:n,children:r})}function vt(r){let{description:n,options:i}=r;const{resume:o,disabled:s,output:a}=ft(),[l,c]=j(a?.result),d=s||void 0!==l;return e(xt,{children:[n&&t(yt,{children:n}),i.map(((e,r)=>t(kt,{$selected:l===e,$disabled:d,onClick:()=>(e=>{d||(c(e),o(e))})(e),children:e},r)))]})}const xt=n.div`
601
+ `,gt=k(null);function bt(){const e=N(gt);if(!e)throw new Error("useContext must be used within a Provider");return e}function ft({children:e,...r}){return t(gt.Provider,{value:r,children:e})}function vt({description:r,options:n}){const{resume:i,disabled:o,output:s}=bt(),[a,l]=j(s?.result),c=o||void 0!==a;return e(xt,{children:[r&&t(yt,{children:r}),n.map((e,r)=>t(wt,{$selected:a===e,$disabled:c,onClick:()=>(e=>{c||(l(e),i(e))})(e),children:e},r))]})}const xt=n.div`
602
602
  display: flex;
603
603
  flex-direction: column;
604
604
  gap: 0.5rem;
@@ -614,7 +614,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{styled as
614
614
  `,yt=n.div`
615
615
  color: var(--bs-secondary);
616
616
  line-height: 1.5;
617
- `,kt=n.div`
617
+ `,wt=n.div`
618
618
  padding: 0.375rem 0.75rem;
619
619
  background-color: ${e=>e.$selected?"rgba(var(--bs-primary-rgb), 0.1)":"#FFFFFF"};
620
620
  border: 1px solid ${e=>e.$selected?"rgba(var(--bs-primary-rgb), 0.3)":"var(--bs-border-color)"};
@@ -633,7 +633,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{styled as
633
633
  &:active {
634
634
  transform: ${e=>e.$disabled?"none":"scale(0.98)"};
635
635
  }
636
- `;function wt(r){let{description:n,fields:i}=r;const{resume:o,disabled:s,output:a}=ft(),[l,d]=j(void 0!==a),h=s||l,{schema:u,uiSchema:m}=q((()=>{const e={},t=[],r={};for(const n of i)e[n.name]={type:"number"===n.type?"number":"string",title:n.label},n.placeholder&&(r[n.name]={"ui:placeholder":n.placeholder}),"textarea"===n.type?r[n.name]={...r[n.name],"ui:widget":"textarea"}:"select"===n.type&&n.options?(e[n.name].enum=n.options,e[n.name].enumNames=n.options):"email"===n.type?e[n.name].format="email":"date"===n.type?e[n.name].format="date":"tel"===n.type&&(r[n.name]={...r[n.name],"ui:options":{inputType:"tel"}}),n.required&&t.push(n.name);return{schema:{type:"object",properties:e,required:t},uiSchema:r}}),[i]);return e(Nt,{children:[n&&t(Et,{children:n}),t(c,{schema:u,uiSchema:m,formData:a,onSubmit:e=>{let{formData:t}=e;h||(d(!0),o(t))},disabled:h,validate:!0,showErrorList:!1,submitText:l?"已提交":"提交",omitExtraData:!0})]})}const Nt=n.div`
636
+ `;function kt({description:r,fields:n}){const{resume:i,disabled:o,output:s}=bt(),[a,l]=j(void 0!==s),d=o||a,{schema:h,uiSchema:u}=q(()=>{const e={},t=[],r={};for(const i of n)e[i.name]={type:"number"===i.type?"number":"string",title:i.label},i.placeholder&&(r[i.name]={"ui:placeholder":i.placeholder}),"textarea"===i.type?r[i.name]={...r[i.name],"ui:widget":"textarea"}:"select"===i.type&&i.options?(e[i.name].enum=i.options,e[i.name].enumNames=i.options):"email"===i.type?e[i.name].format="email":"date"===i.type?e[i.name].format="date":"tel"===i.type&&(r[i.name]={...r[i.name],"ui:options":{inputType:"tel"}}),i.required&&t.push(i.name);return{schema:{type:"object",properties:e,required:t},uiSchema:r}},[n]);return e(Nt,{children:[r&&t(Et,{children:r}),t(c,{schema:h,uiSchema:u,formData:s,onSubmit:({formData:e})=>{d||(l(!0),i(e))},disabled:d,validate:!0,showErrorList:!1,submitText:a?"已提交":"提交",omitExtraData:!0})]})}const Nt=n.div`
637
637
  display: flex;
638
638
  flex-direction: column;
639
639
  gap: 0.5rem;
@@ -653,7 +653,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{styled as
653
653
  `,Et=n.div`
654
654
  color: var(--bs-secondary);
655
655
  line-height: 1.5;
656
- `;function jt(e){let{suspend:r}=e;const{readonly:n}=ce(),{index:i,chunk:o,isLastMessage:s}=function(){const e=N(dt);if(!e)throw new Error("useContext must be used within a Provider");return e}(),{resume:a}=he(),l=C((e=>{a({chunk:i,payload:e})}),[]);let c=null;switch(r.type){case"select":c=t(vt,{...r.select});break;case"form":c=t(wt,{...r.form})}return t(bt,{resume:l,disabled:n||!!o.error||!s,output:o.node?.output,children:c})}function $t(e){let{value:n,cite:i}=e;const o=e=>"string"==typeof e?t(nt,{content:e,cite:i}):"image"===e.type?t(mt,{src:e.image}):"suspend"===e.type?t(jt,{suspend:e.suspend}):null;return Array.isArray(n)?t(r,{children:n.map(((e,r)=>t(S,{children:o(e)},r)))}):o(n)}const Ct=F((r=>{let{reasoning:n,loading:i}=r;const[o,s]=j(i);return E((()=>{i||s(!1)}),[i]),t(S,{children:t("div",{className:"mb-2",children:e("div",o||i?{className:"shadow-sm rounded bg-white fs-7",children:[e("div",{onClick:()=>s(i),role:"button",className:"d-flex align-items-center p-1 px-2 gap-2",children:[i?t(D,{animation:"border",variant:"primary",size:"sm"}):t("i",{className:"bi bi-check-circle-fill text-success"}),t("span",{className:"text-muted",children:i?"思考中":"已思考"}),t("i",{className:"bi bi-caret-up-fill text-muted"})]}),t("div",{className:"border-top p-2 d-flex flex-column gap-2",children:t("div",{className:"border rounded bg-light p-2",children:t(nt,{content:n})})})]}:{onClick:()=>s(!0),role:"button",className:"d-inline-flex align-items-center shadow-sm rounded bg-white p-1 px-2 fs-7 gap-2",children:[i?t(D,{animation:"border",variant:"primary",size:"sm"}):t("i",{className:"bi bi-check-circle-fill text-success"}),t("span",{className:"text-muted",children:i?"思考中":"已思考"}),t("i",{className:"bi bi-caret-down-fill text-muted"})]})})})}));class Mt{#t;#o=[];#s=0;constructor(){this.#t=new B}speak(){for(this.#t.emit("playing",!0);this.#s<this.#o.length;){const e=this.#o[this.#s],t=new SpeechSynthesisUtterance(e),r=++this.#s;t.onend=()=>{r>=this.#o.length&&this.clear()},t.onerror=()=>{this.clear()},window.speechSynthesis.speak(t)}}clear(){this.#t.emit("playing",!1)}start(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.#o=Array.isArray(e)?e:[e],t||(window.speechSynthesis.cancel(),this.#s=0),this.speak()}stop(){window.speechSynthesis.cancel(),this.clear()}onPlaying(e){this.#t.on("playing",e)}onSpeaking(e){this.#t.on("speaking",e)}}const qt=new Map;class zt{#r;#t;#o=[];#a=new Map;#l=!1;#s=0;#c=!1;constructor(e){this.#r=e,this.#t=new B}createLoader(e){const t=new Promise((async t=>{try{const{type:r,data:n}=await this.#r(e),i=new Audio(`data:${r};base64,${n}`);this.#a.set(e,i),t(i)}catch{this.#a.delete(e),t(void 0)}}));return this.#a.set(e,t),t}async loadAudioData(){this.#c=!0,this.#t.emit("speaking",!0);let e=0;for(;e<this.#o.length;){const t=this.#o[e];!this.#a.has(t)&&this.#c&&await this.createLoader(t),e++}this.#t.emit("speaking",!1),this.#c=!1}waitForAudioLoaded(e){const t=this.#a.get(e);return t instanceof Promise?t:Promise.resolve(t)}async playAudio(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.#l=!0;const t=await this.waitForAudioLoaded(this.#o[e]);this.#t.emit("playing",!0),t?(qt.set(this,t),t.onpause=async()=>{t.ended?(this.#s++,this.#s<this.#o.length?await this.playAudio(this.#s):this.clear()):this.clear()},await t.play()):this.clear()}clear(){this.#l=!1,this.#c=!1,this.#t.emit("playing",!1),this.#t.emit("speaking",!1),qt.delete(this)}start(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];qt.forEach(((e,t)=>{t!==this&&(e.pause(),e.currentTime=0)})),this.#o=Array.isArray(e)?e:[e],t||(this.#s=0),this.#c||this.loadAudioData(),this.#l||this.playAudio()}update(e){this.#o=Array.isArray(e)?e:[e]}stop(){const e=qt.get(this);e&&(e.pause(),e.currentTime=0)}onPlaying(e){this.#t.on("playing",e)}onSpeaking(e){this.#t.on("speaking",e)}}function St(e){let{text:t,loading:r,loader:n}=e;const i=$(),[o,s]=j(!1),[a,l]=j(!1),c=$(r),d=async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];i.current||(i.current=n?new zt(n):new Mt,i.current.onSpeaking(s),i.current.onPlaying(l));let o="";"string"==typeof t?o=t:t.current&&(o=function(e){const t=e.querySelectorAll("p, h1, h2, h3, h4, h5, h6, li:not(:has(p,h1, h2, h3, h4, h5, h6))");return Array.from(t).flatMap((e=>e.textContent?[e.textContent]:[]))}(t.current),r&&o.pop()),o&&0!==o.length&&i.current.start(o,e)};return E((()=>{if(c.current&&"string"!=typeof t&&t.current){if(r){const e={childList:!0,subtree:!0},r=new MutationObserver((function(){d(!0)}));return r.observe(t.current,e),d(),()=>{r.disconnect()}}d(!0)}}),[r]),E((()=>()=>{i.current&&(i.current.stop(),i.current=void 0)}),[]),{playing:a,speaking:o,start:d,stop:()=>{i.current&&i.current.stop()}}}function Ft(r){let{model:n="builtin",voice:i,loading:o,autoplay:s,contentRef:a,avatarRef:l}=r;const{request:c}=ce(),d=q((()=>{if("builtin"!==n)return async e=>(await c({url:"/speech",method:"post",data:{model:n,voice:i,input:e}})).audio}),[n,i]),{playing:h,speaking:u,start:m,stop:p}=St({loader:d,text:a,loading:s&&o});let g=null;return l.current&&(u&&(g=Z(t(Rt,{children:t(D,{size:"sm",variant:"light"})}),l.current)),h&&(g=Z(t(Rt,{children:t(At,{className:"bi bi-volume-down-fill text-light"})}),l.current))),e(lt,{disabled:o&&!h,onClick:()=>{h?p():m()},children:[h?t(At,{className:"bi bi-volume-down-fill"}):u?t(D,{size:"sm",variant:"primary"}):t(At,{className:"bi bi-volume-down"}),g]})}const Rt=n.div`
656
+ `;function jt({suspend:e}){const{readonly:r}=ce(),{index:n,chunk:i,isLastMessage:o}=function(){const e=N(dt);if(!e)throw new Error("useContext must be used within a Provider");return e}(),{resume:s}=he(),a=C(e=>{s({chunk:n,payload:e})},[]);let l=null;switch(e.type){case"select":l=t(vt,{...e.select});break;case"form":l=t(kt,{...e.form})}return t(ft,{resume:a,disabled:r||!!i.error||!o,output:i.node?.output,children:l})}function $t({value:e,cite:n}){const i=e=>"string"==typeof e?t(nt,{content:e,cite:n}):"image"===e.type?t(mt,{src:e.image}):"suspend"===e.type?t(jt,{suspend:e.suspend}):null;return Array.isArray(e)?t(r,{children:e.map((e,r)=>t(S,{children:i(e)},r))}):i(e)}const Ct=F(({reasoning:r,loading:n})=>{const[i,o]=j(n);return E(()=>{n||o(!1)},[n]),t(S,{children:t("div",{className:"mb-2",children:e("div",i||n?{className:"shadow-sm rounded bg-white fs-7",children:[e("div",{onClick:()=>o(n),role:"button",className:"d-flex align-items-center p-1 px-2 gap-2",children:[n?t(D,{animation:"border",variant:"primary",size:"sm"}):t("i",{className:"bi bi-check-circle-fill text-success"}),t("span",{className:"text-muted",children:n?"思考中":"已思考"}),t("i",{className:"bi bi-caret-up-fill text-muted"})]}),t("div",{className:"border-top p-2 d-flex flex-column gap-2",children:t("div",{className:"border rounded bg-light p-2",children:t(nt,{content:r})})})]}:{onClick:()=>o(!0),role:"button",className:"d-inline-flex align-items-center shadow-sm rounded bg-white p-1 px-2 fs-7 gap-2",children:[n?t(D,{animation:"border",variant:"primary",size:"sm"}):t("i",{className:"bi bi-check-circle-fill text-success"}),t("span",{className:"text-muted",children:n?"思考中":"已思考"}),t("i",{className:"bi bi-caret-down-fill text-muted"})]})})})});class Mt{#t;#o=[];#s=0;constructor(){this.#t=new B}speak(){for(this.#t.emit("playing",!0);this.#s<this.#o.length;){const e=this.#o[this.#s],t=new SpeechSynthesisUtterance(e),r=++this.#s;t.onend=()=>{r>=this.#o.length&&this.clear()},t.onerror=()=>{this.clear()},window.speechSynthesis.speak(t)}}clear(){this.#t.emit("playing",!1)}start(e,t=!1){this.#o=Array.isArray(e)?e:[e],t||(window.speechSynthesis.cancel(),this.#s=0),this.speak()}stop(){window.speechSynthesis.cancel(),this.clear()}onPlaying(e){this.#t.on("playing",e)}onSpeaking(e){this.#t.on("speaking",e)}}const qt=new Map;class zt{#r;#t;#o=[];#a=new Map;#l=!1;#s=0;#c=!1;constructor(e){this.#r=e,this.#t=new B}createLoader(e){const t=new Promise(async t=>{try{const{type:r,data:n}=await this.#r(e),i=new Audio(`data:${r};base64,${n}`);this.#a.set(e,i),t(i)}catch{this.#a.delete(e),t(void 0)}});return this.#a.set(e,t),t}async loadAudioData(){this.#c=!0,this.#t.emit("speaking",!0);let e=0;for(;e<this.#o.length;){const t=this.#o[e];!this.#a.has(t)&&this.#c&&await this.createLoader(t),e++}this.#t.emit("speaking",!1),this.#c=!1}waitForAudioLoaded(e){const t=this.#a.get(e);return t instanceof Promise?t:Promise.resolve(t)}async playAudio(e=0){this.#l=!0;const t=await this.waitForAudioLoaded(this.#o[e]);this.#t.emit("playing",!0),t?(qt.set(this,t),t.onpause=async()=>{t.ended?(this.#s++,this.#s<this.#o.length?await this.playAudio(this.#s):this.clear()):this.clear()},await t.play()):this.clear()}clear(){this.#l=!1,this.#c=!1,this.#t.emit("playing",!1),this.#t.emit("speaking",!1),qt.delete(this)}start(e,t=!1){qt.forEach((e,t)=>{t!==this&&(e.pause(),e.currentTime=0)}),this.#o=Array.isArray(e)?e:[e],t||(this.#s=0),this.#c||this.loadAudioData(),this.#l||this.playAudio()}update(e){this.#o=Array.isArray(e)?e:[e]}stop(){const e=qt.get(this);e&&(e.pause(),e.currentTime=0)}onPlaying(e){this.#t.on("playing",e)}onSpeaking(e){this.#t.on("speaking",e)}}function St({text:e,loading:t,loader:r}){const n=$(),[i,o]=j(!1),[s,a]=j(!1),l=$(t),c=async(i=!1)=>{n.current||(n.current=r?new zt(r):new Mt,n.current.onSpeaking(o),n.current.onPlaying(a));let s="";"string"==typeof e?s=e:e.current&&(s=function(e){const t=e.querySelectorAll("p, h1, h2, h3, h4, h5, h6, li:not(:has(p,h1, h2, h3, h4, h5, h6))");return Array.from(t).flatMap(e=>e.textContent?[e.textContent]:[])}(e.current),t&&s.pop()),s&&0!==s.length&&n.current.start(s,i)};return E(()=>{if(l.current&&"string"!=typeof e&&e.current){if(t){const t={childList:!0,subtree:!0},r=new MutationObserver(function(){c(!0)});return r.observe(e.current,t),c(),()=>{r.disconnect()}}c(!0)}},[t]),E(()=>()=>{n.current&&(n.current.stop(),n.current=void 0)},[]),{playing:s,speaking:i,start:c,stop:()=>{n.current&&n.current.stop()}}}function Ft({model:r="builtin",voice:n,loading:i,autoplay:o,contentRef:s,avatarRef:a}){const{request:l}=ce(),c=q(()=>{if("builtin"!==r)return async e=>(await l({url:"/speech",method:"post",data:{model:r,voice:n,input:e}})).audio},[r,n]),{playing:d,speaking:h,start:u,stop:m}=St({loader:c,text:s,loading:o&&i});let p=null;return a.current&&(h&&(p=Z(t(Rt,{children:t(D,{size:"sm",variant:"light"})}),a.current)),d&&(p=Z(t(Rt,{children:t(At,{className:"bi bi-volume-down-fill text-light"})}),a.current))),e(lt,{disabled:i&&!d,onClick:()=>{d?m():u()},children:[d?t(At,{className:"bi bi-volume-down-fill"}):h?t(D,{size:"sm",variant:"primary"}):t(At,{className:"bi bi-volume-down"}),p]})}const Rt=n.div`
657
657
  position: absolute;
658
658
  top: 0;
659
659
  left: 0;
@@ -668,15 +668,15 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{styled as
668
668
  &::before {
669
669
  transform: scale(1.4)
670
670
  }
671
- `;function It(r){let{tool:n,loading:i}=r;const[o,s]=j(!1),{logLevel:a="none"}=ce(),l="response"in n,c=!l&&!i;return e(S,{children:["stats"==a&&t("div",{className:"mb-2",children:e("div",{role:"button",className:"d-inline-flex align-items-center shadow-sm rounded bg-white p-1 px-2 fs-7 gap-2",children:[c?t("i",{className:"bi bi-dash-circle-fill text-muted"}):l?n.error?t("i",{className:"bi bi-x-circle-fill text-danger"}):t("i",{className:"bi bi-check-circle-fill text-success"}):t(D,{animation:"border",variant:"primary",size:"sm"}),t("span",{className:"text-muted",children:c?"已取消":l?"已使用":"正在使用"}),t("span",{children:n.title})]})}),"all"==a&&t("div",{className:"mb-2",children:e("div",o&&l?{className:"shadow-sm rounded bg-white fs-7",children:[e("div",{onClick:()=>s(!1),role:"button",className:"d-flex align-items-center p-1 px-2 gap-2",children:[n.error?t("i",{className:"bi bi-x-circle-fill text-danger"}):t("i",{className:"bi bi-check-circle-fill text-success"}),t("span",{className:"text-muted",children:"已使用"}),t("span",{children:n.title}),t("i",{className:"bi bi-caret-up-fill text-muted"})]}),e("div",{className:"border-top p-2 d-flex flex-column gap-2",children:[e("div",{className:"border rounded bg-light",children:[t("div",{className:"d-flex align-items-center p-1 px-2 fs-7 gap-2",children:t("span",{className:"text-muted",children:"参数"})}),t("div",{className:"border-top p-2 overflow-hidden",children:n.arguments})]}),e("div",{className:"border rounded bg-light",children:[t("div",{className:"d-flex align-items-center p-1 px-2 fs-7 gap-2",children:t("span",{className:"text-muted",children:"响应"})}),t(Dt,{className:"border-top p-2 overflow-hidden",children:n.response||"None"})]})]})]}:{onClick:()=>s(l),role:"button",className:"d-inline-flex align-items-center shadow-sm rounded bg-white p-1 px-2 fs-7 gap-2",children:[c?t("i",{className:"bi bi-dash-circle-fill text-muted"}):l?n.error?t("i",{className:"bi bi-x-circle-fill text-danger"}):t("i",{className:"bi bi-check-circle-fill text-success"}):t(D,{animation:"border",variant:"primary",size:"sm"}),t("span",{className:"text-muted",children:c?"已取消":l?"已使用":"正在使用"}),t("span",{children:n.title}),l&&t("i",{className:"bi bi-caret-down-fill text-muted"})]})}),n.content&&t($t,{value:n.content})]})}const Dt=n.div`
671
+ `;function It({tool:r,loading:n}){const[i,o]=j(!1),{logLevel:s="none"}=ce(),a="response"in r,l=!a&&!n;return e(S,{children:["stats"==s&&t("div",{className:"mb-2",children:e("div",{role:"button",className:"d-inline-flex align-items-center shadow-sm rounded bg-white p-1 px-2 fs-7 gap-2",children:[l?t("i",{className:"bi bi-dash-circle-fill text-muted"}):a?r.error?t("i",{className:"bi bi-x-circle-fill text-danger"}):t("i",{className:"bi bi-check-circle-fill text-success"}):t(D,{animation:"border",variant:"primary",size:"sm"}),t("span",{className:"text-muted",children:l?"已取消":a?"已使用":"正在使用"}),t("span",{children:r.title})]})}),"all"==s&&t("div",{className:"mb-2",children:e("div",i&&a?{className:"shadow-sm rounded bg-white fs-7",children:[e("div",{onClick:()=>o(!1),role:"button",className:"d-flex align-items-center p-1 px-2 gap-2",children:[r.error?t("i",{className:"bi bi-x-circle-fill text-danger"}):t("i",{className:"bi bi-check-circle-fill text-success"}),t("span",{className:"text-muted",children:"已使用"}),t("span",{children:r.title}),t("i",{className:"bi bi-caret-up-fill text-muted"})]}),e("div",{className:"border-top p-2 d-flex flex-column gap-2",children:[e("div",{className:"border rounded bg-light",children:[t("div",{className:"d-flex align-items-center p-1 px-2 fs-7 gap-2",children:t("span",{className:"text-muted",children:"参数"})}),t("div",{className:"border-top p-2 overflow-hidden",children:r.arguments})]}),e("div",{className:"border rounded bg-light",children:[t("div",{className:"d-flex align-items-center p-1 px-2 fs-7 gap-2",children:t("span",{className:"text-muted",children:"响应"})}),t(Dt,{className:"border-top p-2 overflow-hidden",children:r.response||"None"})]})]})]}:{onClick:()=>o(a),role:"button",className:"d-inline-flex align-items-center shadow-sm rounded bg-white p-1 px-2 fs-7 gap-2",children:[l?t("i",{className:"bi bi-dash-circle-fill text-muted"}):a?r.error?t("i",{className:"bi bi-x-circle-fill text-danger"}):t("i",{className:"bi bi-check-circle-fill text-success"}):t(D,{animation:"border",variant:"primary",size:"sm"}),t("span",{className:"text-muted",children:l?"已取消":a?"已使用":"正在使用"}),t("span",{children:r.title}),a&&t("i",{className:"bi bi-caret-down-fill text-muted"})]})}),r.content&&t($t,{value:r.content})]})}const Dt=n.div`
672
672
  white-space: pre-wrap;
673
- `;function Lt(r){let{node:n}=r;const[i,o]=j(!1),{nodeIconResolver:s}=ce(),a=!("latency"in n),l=a?t(D,{animation:"border",variant:"primary",size:"sm"}):n.error?t("i",{className:"bi bi-x-circle-fill text-danger"}):t("i",{className:"bi bi-check-circle-fill text-success"});return e("div",{className:"shadow-sm rounded bg-white fs-7",children:[e(Tt,{onClick:()=>o((e=>!e)),role:"button",className:"d-flex align-items-center p-1 px-2 gap-1",children:[t("i",{className:"bi bi-chevron-down text-muted"}),s?.(n.type),t(Ot,{className:"me-2 text-truncate",children:n.title}),t("span",{className:"me-auto"}),!a&&t("span",{className:"text-nowrap text-muted",children:Pt(n.latency)}),t("span",{children:l})]}),i&&e("div",{className:"border-top p-2 d-flex flex-column gap-2",children:[e("div",{className:"border rounded bg-light",children:[t("div",{className:"d-flex align-items-center p-1 px-2 fs-7 gap-2",children:t("span",{className:"text-muted",children:"输入"})}),t("div",{className:"border-top p-2 overflow-hidden text-pre-wrap",children:n.input?JSON.stringify(n.input,null,4):"None"})]}),e("div",{className:"border rounded bg-light",children:[t("div",{className:"d-flex align-items-center p-1 px-2 fs-7 gap-2",children:t("span",{className:"text-muted",children:"输出"})}),t("div",{className:"border-top p-2 overflow-hidden text-pre-wrap",children:n.output?JSON.stringify(n.output,null,4):"None"})]})]})]})}const Pt=e=>e<1?`${(1e3*e).toFixed(3)} ms`:e>60?`${parseInt(Math.round(e/60).toString())} m ${(e%60).toFixed(3)} s`:`${e.toFixed(3)} s`,Tt=n.div`
673
+ `;function Lt({node:r}){const[n,i]=j(!1),{nodeIconResolver:o}=ce(),s=!("latency"in r),a=s?t(D,{animation:"border",variant:"primary",size:"sm"}):r.error?t("i",{className:"bi bi-x-circle-fill text-danger"}):t("i",{className:"bi bi-check-circle-fill text-success"});return e("div",{className:"shadow-sm rounded bg-white fs-7",children:[e(Tt,{onClick:()=>i(e=>!e),role:"button",className:"d-flex align-items-center p-1 px-2 gap-1",children:[t("i",{className:"bi bi-chevron-down text-muted"}),o?.(r.type),t(Ot,{className:"me-2 text-truncate",children:r.title}),t("span",{className:"me-auto"}),!s&&t("span",{className:"text-nowrap text-muted",children:Pt(r.latency)}),t("span",{children:a})]}),n&&e("div",{className:"border-top p-2 d-flex flex-column gap-2",children:[e("div",{className:"border rounded bg-light",children:[t("div",{className:"d-flex align-items-center p-1 px-2 fs-7 gap-2",children:t("span",{className:"text-muted",children:"输入"})}),t("div",{className:"border-top p-2 overflow-hidden text-pre-wrap",children:r.input?JSON.stringify(r.input,null,4):"None"})]}),e("div",{className:"border rounded bg-light",children:[t("div",{className:"d-flex align-items-center p-1 px-2 fs-7 gap-2",children:t("span",{className:"text-muted",children:"输出"})}),t("div",{className:"border-top p-2 overflow-hidden text-pre-wrap",children:r.output?JSON.stringify(r.output,null,4):"None"})]})]})]})}const Pt=e=>e<1?`${(1e3*e).toFixed(3)} ms`:e>60?`${parseInt(Math.round(e/60).toString())} m ${(e%60).toFixed(3)} s`:`${e.toFixed(3)} s`,Tt=n.div`
674
674
  svg {
675
675
  flex-shrink: 0;
676
676
  }
677
677
  `,Ot=n.span`
678
678
  display: inline-block;
679
- `;function Bt(r){let{nodes:n,loading:i}=r;const[o,s]=j(!1),a=n.some((e=>"error"in e)),l=i?t(D,{animation:"border",variant:"primary",size:"sm"}):t("i",a?{className:"bi bi-x-circle-fill text-danger"}:{className:"bi bi-check-circle-fill text-success"});return t("div",{className:"mb-2",children:e("div",o?{className:"shadow-sm rounded bg-white fs-7",children:[e("div",{onClick:()=>s(!1),role:"button",className:"d-flex align-items-center p-1 px-2 gap-2",children:[l,t("span",{children:"工作流"}),t("i",{className:"bi bi-caret-up-fill text-muted"})]}),t("div",{className:"border-top p-2 d-flex flex-column gap-1 bg-light bg-opacity-50",children:n.map(((e,r)=>t(Lt,{node:e},r)))})]}:{onClick:()=>s(!0),role:"button",className:"d-inline-flex align-items-center shadow-sm rounded bg-white p-1 px-2 fs-7 gap-2",children:[l,t("span",{children:"工作流"}),t("i",{className:"bi bi-caret-down-fill text-muted"})]})})}const _t=F((n=>{let{message:i,actions:o,setMessage:s,cite:a,speech:l,isLast:c}=n;const{query:d,quote:h,files:u=[],chunks:m,annotation:p,loading:g}=i,{user:f,bot:b,logLevel:y="none",messages:k}=ce(),w=q((()=>m?m.reduce((function(e,t){const r=Array.isArray(t.content)?t.content.reduce(((e,t)=>{const r=Ve(t);return r?e+r+"\n":e}),""):Ve(t.content);return e+r+"\n"+(t.tools||[]).reduce(((e,t)=>{if(t.content){const r=Ve(t.content);if(r)return e+r+"\n"}return e}),"")}),""):""),[m]),N=$(null),E=$(null),j=$(null),C=q((()=>m?.flatMap((e=>e.node?[e.node]:[]))||[]),[m]),M=d||u.length>0;return e(r,{children:[M&&e(Zt,{$reverse:!0,children:[f&&t(Vt,{children:t("img",{src:f.avatar})}),t(Yt,{}),e(Gt,{ref:N,children:[d&&t(nt,{content:d}),h&&t(T,{trigger:"click",container:N,rootClose:!0,placement:"bottom",overlay:t(Ut,{body:!0,children:h}),children:t(Jt,{children:t(Ht,{children:h})})}),u.length>0&&u.map(((e,r)=>{let{name:n,size:i,path:o}=e;return x(o)?t(mt,{src:`/uploads/${o}`},r):t(Qt,{children:t(re,{name:n,size:i})},r)}))]})]}),m&&e(Zt,{children:[b&&t(Vt,{ref:E,children:t("img",{src:b.avatar})}),t(Yt,{}),e(Gt,{children:[M&&!1!==o&&e(Wt,{children:[t(v,{placement:"top",content:w,as:lt,tooltip:!0}),l&&t(Ft,{loading:i.loading,avatarRef:E,contentRef:j,...l}),o?.({Component:lt,message:i,content:w,setMessage:s,messages:k})]}),t(Xt,{children:["stats","all"].includes(y)&&i.stats&&e(r,{children:[e("span",{children:["耗时 ",i.stats.latency/1e3," 秒"]}),e("span",{children:["花费 Token ",i.stats.usage]})]})}),e(Kt,{ref:j,$deleted:!!p,children:["all"===y&&C.length>0&&t(Bt,{loading:g,nodes:C}),m.map(((r,n)=>e(ht,{value:{index:n,chunk:r,isLastMessage:c},children:[r.reasoning&&["stats","all"].includes(y)&&t(Ct,{reasoning:r.reasoning,loading:!r.content&&0===(r.tools||[]).length}),r.content&&t($t,{cite:a,value:r.content}),(r.tools||[]).map(((e,r)=>t(It,{tool:e,loading:g},r))),r.error&&t(nt,{content:`[${r.error}]`})]},n)))]}),p&&e("div",{children:[e("div",{className:"d-flex align-items-center",children:[t("span",{className:"fs-7 text-secondary me-2",children:"标注的答案"}),t("hr",{className:"flex-fill"})]}),t(nt,{content:p.answer})]}),i.loading&&t(Xe,{})]})]})]})})),Ut=n(O)`
679
+ `;function Bt({nodes:r,loading:n}){const[i,o]=j(!1),s=r.some(e=>"error"in e),a=n?t(D,{animation:"border",variant:"primary",size:"sm"}):t("i",s?{className:"bi bi-x-circle-fill text-danger"}:{className:"bi bi-check-circle-fill text-success"});return t("div",{className:"mb-2",children:e("div",i?{className:"shadow-sm rounded bg-white fs-7",children:[e("div",{onClick:()=>o(!1),role:"button",className:"d-flex align-items-center p-1 px-2 gap-2",children:[a,t("span",{children:"工作流"}),t("i",{className:"bi bi-caret-up-fill text-muted"})]}),t("div",{className:"border-top p-2 d-flex flex-column gap-1 bg-light bg-opacity-50",children:r.map((e,r)=>t(Lt,{node:e},r))})]}:{onClick:()=>o(!0),role:"button",className:"d-inline-flex align-items-center shadow-sm rounded bg-white p-1 px-2 fs-7 gap-2",children:[a,t("span",{children:"工作流"}),t("i",{className:"bi bi-caret-down-fill text-muted"})]})})}const _t=F(({message:n,actions:i,setMessage:o,cite:s,speech:a,isLast:l})=>{const{query:c,quote:d,files:h=[],chunks:u,annotation:m,loading:p}=n,{user:g,bot:b,logLevel:f="none",messages:y}=ce(),w=q(()=>u?u.reduce(function(e,t){const r=Array.isArray(t.content)?t.content.reduce((e,t)=>{const r=Ve(t);return r?e+r+"\n":e},""):Ve(t.content);return e+r+"\n"+(t.tools||[]).reduce((e,t)=>{if(t.content){const r=Ve(t.content);if(r)return e+r+"\n"}return e},"")},""):"",[u]),k=$(null),N=$(null),E=$(null),j=q(()=>u?.flatMap(e=>e.node?[e.node]:[])||[],[u]),C=c||h.length>0;return e(r,{children:[C&&e(Zt,{$reverse:!0,children:[g&&t(Vt,{children:t("img",{src:g.avatar})}),t(Yt,{}),e(Gt,{ref:k,children:[c&&t(nt,{content:c}),d&&t(T,{trigger:"click",container:k,rootClose:!0,placement:"bottom",overlay:t(Ut,{body:!0,children:d}),children:t(Jt,{children:t(Ht,{children:d})})}),h.length>0&&h.map(({name:e,size:r,path:n},i)=>x(n)?t(mt,{src:`/uploads/${n}`},i):t(Qt,{children:t(re,{name:e,size:r})},i))]})]}),u&&e(Zt,{children:[b&&t(Vt,{ref:N,children:t("img",{src:b.avatar})}),t(Yt,{}),e(Gt,{children:[C&&!1!==i&&e(Wt,{children:[t(v,{placement:"top",content:w,as:lt,tooltip:!0}),a&&t(Ft,{loading:n.loading,avatarRef:N,contentRef:E,...a}),i?.({Component:lt,message:n,content:w,setMessage:o,messages:y})]}),t(Xt,{children:["stats","all"].includes(f)&&n.stats&&e(r,{children:[e("span",{children:["耗时 ",n.stats.latency/1e3," 秒"]}),e("span",{children:["花费 Token ",n.stats.usage]})]})}),e(Kt,{ref:E,$deleted:!!m,children:["all"===f&&j.length>0&&t(Bt,{loading:p,nodes:j}),u.map((r,n)=>e(ht,{value:{index:n,chunk:r,isLastMessage:l},children:[r.reasoning&&["stats","all"].includes(f)&&t(Ct,{reasoning:r.reasoning,loading:!r.content&&0===(r.tools||[]).length}),r.content&&t($t,{cite:s,value:r.content}),(r.tools||[]).map((e,r)=>t(It,{tool:e,loading:p},r)),r.error&&t(nt,{content:`[${r.error}]`})]},n))]}),m&&e("div",{children:[e("div",{className:"d-flex align-items-center",children:[t("span",{className:"fs-7 text-secondary me-2",children:"标注的答案"}),t("hr",{className:"flex-fill"})]}),t(nt,{content:m.answer})]}),n.loading&&t(Xe,{})]})]})]})}),Ut=n(O)`
680
680
  max-width: calc(100% - .875rem * 2);
681
681
  width: calc(100% - .875rem * 2);
682
682
  font-size: 1rem;
@@ -782,7 +782,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{styled as
782
782
  background: rgba(var(--bs-primary-rgb), 0.1);
783
783
  }
784
784
  `};
785
- `;function er(r){const{placeholder:n,actions:i,cite:o,speech:s,renderItem:a,scrollRef:l}=r,{messages:c,setMessages:d,loading:h,suggestions:u,conversationId:m}=ce(),p=$(r.loaded),g=C((()=>{const e=l.current;e&&requestAnimationFrame((()=>{e.scrollTo({top:e.scrollHeight})}))}),[]),f=$(null),{height:b}=ee({ref:f});E((()=>{(h||!p.current)&&c.length>0&&(h&&(p.current=!0),g())}),[b,h,p,c]),E((()=>{u.length>0&&g()}),[u]),E((()=>{p.current=r.loaded}),[m]),E((()=>{const e=f.current;if(e){const t=()=>{p.current=!0};return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}}}),[f]);const v=c.slice(-30);return e(tr,{ref:f,children:[0===v.length&&n,v.map(((e,r)=>{const n={actions:i,cite:o,speech:s,message:e,setMessage:t=>{d((r=>{const n=r.findIndex((t=>t.id===e.id));-1!==n&&t(r[n])}))},isLast:r===v.length-1};return a?a({Component:_t,props:n},r):t(_t,{...n},r)})),u.length>0&&t(rr,{children:u.map(((e,r)=>t("a",{href:"#!question",children:e},r)))})]})}const tr=n.div`
785
+ `;function er(r){const{placeholder:n,actions:i,cite:o,speech:s,renderItem:a,scrollRef:l}=r,{messages:c,setMessages:d,loading:h,suggestions:u,conversationId:m}=ce(),p=$(r.loaded),g=C(()=>{const e=l.current;e&&requestAnimationFrame(()=>{e.scrollTo({top:e.scrollHeight})})},[]),b=$(null),{height:f}=ee({ref:b});E(()=>{(h||!p.current)&&c.length>0&&(h&&(p.current=!0),g())},[f,h,p,c]),E(()=>{u.length>0&&g()},[u]),E(()=>{p.current=r.loaded},[m]),E(()=>{const e=b.current;if(e){const t=()=>{p.current=!0};return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}}},[b]);const v=c.slice(-30);return e(tr,{ref:b,children:[0===v.length&&n,v.map((e,r)=>{const n={actions:i,cite:o,speech:s,message:e,setMessage:t=>{d(r=>{const n=r.findIndex(t=>t.id===e.id);-1!==n&&t(r[n])})},isLast:r===v.length-1};return a?a({Component:_t,props:n},r):t(_t,{...n},r)}),u.length>0&&t(rr,{children:u.map((e,r)=>t("a",{href:"#!question",children:e},r))})]})}const tr=n.div`
786
786
  display: flex;
787
787
  flex-direction: column;
788
788
  flex: 1;
@@ -803,7 +803,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{styled as
803
803
  background: var(--bs-secondary-bg-subtle);
804
804
  }
805
805
  }
806
- `,nr=F(M(((r,n)=>{let{className:i,bot:o,user:s,input:a,logLevel:l,imageResolver:c,nodeIconResolver:d,placeholder:h,actions:u,onboarding:m,conversation:p,cite:f,speech:v,renderItem:x,messages:k,request:w,transformMessages:N=Ue}=r;const M=C((e=>{const t=[];if(m&&!1!==m.enable){const e=He(m.questions||[]);t.push({chunks:[{content:[m.prologue,...e.map((e=>`[${e}](#!question)`))].join("\n"),tools:[]}],loading:m.loading})}return e?t.concat(N(e.messages||[])):k?t.concat(N(k)):t}),[m]),[S,F]=j(p?.id),[R,A]=g([]);E((()=>{A(M(p))}),[m]);const[I,D]=j(!1),L=$(null),[P,T]=j([]),O=C((e=>{I||(F(e?.id),A(M(e)),T([]))}),[I,M]);return z(n,(()=>({reset:O})),[O]),t(de,{request:q((()=>w?"string"==typeof w?y.create({baseURL:w}):w:y),[w]),bot:o,user:s,logLevel:l,imageResolver:c,nodeIconResolver:d,conversationId:S,setConversationId:F,messages:R,setMessages:A,suggestions:P,setSuggestions:T,loading:I,setLoading:D,reset:O,readonly:!a,children:t(or,{className:i,children:e(b,{children:[t(ir,{ref:L,children:t(er,{placeholder:h,cite:f,actions:u,loaded:!a,speech:v,renderItem:x,scrollRef:L})}),a&&t(Ae,{...a,scrollRef:L})]})})})})),_),ir=n.div`
806
+ `,nr=F(M(({className:r,bot:n,user:i,input:o,logLevel:s,imageResolver:a,nodeIconResolver:l,placeholder:c,actions:d,onboarding:h,conversation:u,cite:m,speech:p,renderItem:b,messages:v,request:x,transformMessages:w=Ue},k)=>{const N=C(e=>{const t=[];if(h&&!1!==h.enable){const e=He(h.questions||[]);t.push({chunks:[{content:[h.prologue,...e.map(e=>`[${e}](#!question)`)].join("\n"),tools:[]}],loading:h.loading})}return e?t.concat(w(e.messages||[])):v?t.concat(w(v)):t},[h]),[M,S]=j(u?.id),[F,R]=g([]);E(()=>{R(N(u))},[h]);const[A,I]=j(!1),D=$(null),[L,P]=j([]),T=C(e=>{A||(S(e?.id),R(N(e)),P([]))},[A,N]);return z(k,()=>({reset:T}),[T]),t(de,{request:q(()=>x?"string"==typeof x?y.create({baseURL:x}):x:y,[x]),bot:n,user:i,logLevel:s,imageResolver:a,nodeIconResolver:l,conversationId:M,setConversationId:S,messages:F,setMessages:R,suggestions:L,setSuggestions:P,loading:A,setLoading:I,reset:T,readonly:!o,children:t(or,{className:r,children:e(f,{children:[t(ir,{ref:D,children:t(er,{placeholder:c,cite:m,actions:d,loaded:!o,speech:p,renderItem:b,scrollRef:D})}),o&&t(Ae,{...o,scrollRef:D})]})})})}),_),ir=n.div`
807
807
  display: flex;
808
808
  flex-direction: column;
809
809
  flex: 1;
@@ -0,0 +1 @@
1
+ import*as c from"react";var l,e,t;function h(){return h=Object.assign?Object.assign.bind():function(c){for(var l=1;l<arguments.length;l++){var e=arguments[l];for(var t in e)({}).hasOwnProperty.call(e,t)&&(c[t]=e[t])}return c},h.apply(null,arguments)}const a=a=>c.createElement("svg",h({xmlns:"http://www.w3.org/2000/svg",width:200,height:200,className:"jpg_svg__icon",viewBox:"0 0 1024 1024"},a),l||(l=c.createElement("path",{fill:"#EFCB35",d:"m590.222 79.644 268.8 268.3v533.834c0 37.7-30.566 68.266-68.266 68.266H233.244c-37.7 0-68.266-30.566-68.266-68.266V147.91c0-37.7 30.566-68.267 68.266-68.267zm-11.764 28.445H233.244a39.82 39.82 0 0 0-39.799 38.457l-.023 1.365v733.867a39.82 39.82 0 0 0 38.457 39.8l1.365.022h557.512a39.82 39.82 0 0 0 39.799-38.457l.023-1.365V359.743z"})),e||(e=c.createElement("path",{fill:"#EFCB35",d:"M854.756 376.337H639.613c-45.528 0-82.551-36.432-83.507-81.738l-.017-1.792V79.644h28.444v213.163c0 29.895 23.82 54.232 53.516 55.063l1.564.023h215.143zM85.333 494.933h853.334q28.444 0 28.444 28.445v284.444q0 28.445-28.444 28.445H85.333q-28.444 0-28.444-28.445V523.378q0-28.445 28.444-28.445"})),t||(t=c.createElement("path",{fill:"#FFF",d:"M330.581 765.895c42.752 0 62.464-30.72 62.464-68.096V571.591h-45.824v122.624c0 24.832-7.936 32.256-22.784 32.256-9.216 0-18.944-5.888-25.6-18.944l-30.976 23.296c13.568 23.552 33.024 35.072 62.72 35.072m151.04-3.584V699.08h22.272c40.448 0 75.264-19.968 75.264-65.28 0-47.104-34.56-62.208-76.288-62.208h-67.072v190.72zm19.968-99.328h-19.968v-55.04h18.688c22.016 0 34.304 6.656 34.304 25.856 0 18.688-10.752 29.184-33.024 29.184m195.84 102.912c26.624 0 50.176-10.496 63.488-23.296v-89.088h-70.912v37.376h30.208v30.72c-4.096 3.072-11.264 4.864-17.92 4.864-35.584 0-52.48-22.016-52.48-59.904 0-37.12 20.224-59.136 48.384-59.136 15.872 0 25.856 6.4 35.328 14.848l24.064-29.184c-13.056-13.056-33.024-24.832-60.928-24.832-50.944 0-93.696 36.352-93.696 99.84 0 64.512 41.728 97.792 94.464 97.792"})));var v="data:image/svg+xml,%3c%3fxml version='1.0' standalone='no'%3f%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg class='icon' width='200px' height='200.00px' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M590.222222 79.644444L859.022222 347.943822V881.777778c0 37.700267-30.5664 68.266667-68.266666 68.266666H233.244444c-37.700267 0-68.266667-30.5664-68.266666-68.266666V147.911111c0-37.700267 30.5664-68.266667 68.266666-68.266667h356.977778z m-11.764622 28.444445H233.244444a39.822222 39.822222 0 0 0-39.799466 38.456889L193.422222 147.911111v733.866667a39.822222 39.822222 0 0 0 38.456889 39.799466L233.244444 921.6h557.511112a39.822222 39.822222 0 0 0 39.799466-38.456889L830.577778 881.777778V359.742578L578.4576 108.088889z' fill='%23EFCB35' /%3e%3cpath d='M854.755556 376.337067h-215.1424c-45.528178 0-82.551467-36.431644-83.5072-81.737956l-0.017067-1.792V79.644444h28.444444v213.162667c0 29.895111 23.819378 54.232178 53.515378 55.062756l1.564445 0.022755h215.1424v28.444445z' fill='%23EFCB35' /%3e%3cpath d='M56.888889 494.933333m28.444444 0l853.333334 0q28.444444 0 28.444444 28.444445l0 284.444444q0 28.444444-28.444444 28.444445l-853.333334 0q-28.444444 0-28.444444-28.444445l0-284.444444q0-28.444444 28.444444-28.444445Z' fill='%23EFCB35' /%3e%3cpath d='M330.581333 765.895111c42.752 0 62.464-30.72 62.464-68.096v-126.208h-45.824v122.624c0 24.832-7.936 32.256-22.784 32.256-9.216 0-18.944-5.888-25.6-18.944l-30.976 23.296c13.568 23.552 33.024 35.072 62.72 35.072z m151.04-3.584v-63.232h22.272c40.448 0 75.264-19.968 75.264-65.28 0-47.104-34.56-62.208-76.288-62.208h-67.072V762.311111h45.824z m19.968-99.328h-19.968v-55.04h18.688c22.016 0 34.304 6.656 34.304 25.856 0 18.688-10.752 29.184-33.024 29.184z m195.84 102.912c26.624 0 50.176-10.496 63.488-23.296v-89.088H690.005333v37.376h30.208v30.72c-4.096 3.072-11.264 4.864-17.92 4.864-35.584 0-52.48-22.016-52.48-59.904 0-37.12 20.224-59.136 48.384-59.136 15.872 0 25.856 6.4 35.328 14.848l24.064-29.184c-13.056-13.056-33.024-24.832-60.928-24.832-50.944 0-93.696 36.352-93.696 99.84 0 64.512 41.728 97.792 94.464 97.792z' fill='white' /%3e%3c/svg%3e";export{a as ReactComponent,v as default};
@@ -0,0 +1 @@
1
+ import*as l from"react";var h,c,e;function t(){return t=Object.assign?Object.assign.bind():function(l){for(var h=1;h<arguments.length;h++){var c=arguments[h];for(var e in c)({}).hasOwnProperty.call(c,e)&&(l[e]=c[e])}return l},t.apply(null,arguments)}const a=a=>l.createElement("svg",t({xmlns:"http://www.w3.org/2000/svg",width:200,height:200,className:"md_svg__icon",viewBox:"0 0 1024 1024"},a),h||(h=l.createElement("path",{fill:"#20B2AA",d:"m590.222 73.956 268.8 268.299v533.834c0 37.7-30.566 68.267-68.266 68.267H233.244c-37.7 0-68.266-30.567-68.266-68.267V142.222c0-37.7 30.566-68.266 68.266-68.266zM578.458 102.4H233.244a39.82 39.82 0 0 0-39.799 38.457l-.023 1.365V876.09a39.82 39.82 0 0 0 38.457 39.8l1.365.022h557.512a39.82 39.82 0 0 0 39.799-38.457l.023-1.365V354.054z"})),c||(c=l.createElement("path",{fill:"#20B2AA",d:"M854.756 370.648H639.613c-45.528 0-82.551-36.431-83.507-81.738l-.017-1.792V73.956h28.444v213.162c0 29.895 23.82 54.232 53.516 55.063l1.564.023h215.143zM85.333 489.244h853.334q28.444 0 28.444 28.445v284.444q0 28.445-28.444 28.445H85.333q-28.444 0-28.444-28.445V517.69q0-28.445 28.444-28.445"})),e||(e=l.createElement("path",{fill:"#FFF",d:"M366.564 756.622v-65.28c0-18.944-3.584-47.36-5.888-66.048h1.024l15.36 45.568 25.856 69.632h25.088l25.6-69.632 15.872-45.568h1.28c-2.56 18.688-6.144 47.104-6.144 66.048v65.28h41.728v-190.72h-49.664l-29.184 82.432c-3.584 11.008-6.656 23.04-10.496 34.56h-1.28c-3.584-11.52-6.656-23.552-10.496-34.56l-30.208-82.432h-49.408v190.72zm240.896 0c55.552 0 93.952-29.952 93.952-96.256s-38.4-94.464-96.512-94.464h-54.784v190.72zm-5.376-36.864h-6.144V602.51h6.144c30.72 0 52.48 12.544 52.48 57.856s-21.76 59.392-52.48 59.392"})));var s="data:image/svg+xml,%3c%3fxml version='1.0' standalone='no'%3f%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg class='icon' width='200px' height='200.00px' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M590.222222 73.955556L859.022222 342.254933V876.088889c0 37.700267-30.5664 68.266667-68.266666 68.266667H233.244444c-37.700267 0-68.266667-30.5664-68.266666-68.266667V142.222222c0-37.700267 30.5664-68.266667 68.266666-68.266666h356.977778z m-11.764622 28.444444H233.244444a39.822222 39.822222 0 0 0-39.799466 38.456889L193.422222 142.222222v733.866667a39.822222 39.822222 0 0 0 38.456889 39.799467L233.244444 915.911111h557.511112a39.822222 39.822222 0 0 0 39.799466-38.456889L830.577778 876.088889V354.053689L578.4576 102.4z' fill='%2320B2AA' /%3e%3cpath d='M854.755556 370.648178h-215.1424c-45.528178 0-82.551467-36.431644-83.5072-81.737956l-0.017067-1.792V73.955556h28.444444v213.162666c0 29.895111 23.819378 54.232178 53.515378 55.062756l1.564445 0.022755h215.1424v28.444445z' fill='%2320B2AA' /%3e%3cpath d='M56.888889 489.244444m28.444444 0l853.333334 0q28.444444 0 28.444444 28.444445l0 284.444444q0 28.444444-28.444444 28.444445l-853.333334 0q-28.444444 0-28.444444-28.444445l0-284.444444q0-28.444444 28.444444-28.444445Z' fill='%2320B2AA' /%3e%3cpath d='M366.563556 756.622222v-65.28c0-18.944-3.584-47.36-5.888-66.048h1.024l15.36 45.568 25.856 69.632h25.088l25.6-69.632 15.872-45.568h1.28c-2.56 18.688-6.144 47.104-6.144 66.048V756.622222h41.728V565.902222h-49.664l-29.184 82.432c-3.584 11.008-6.656 23.04-10.496 34.56h-1.28c-3.584-11.52-6.656-23.552-10.496-34.56l-30.208-82.432h-49.408V756.622222h40.96z m240.896 0c55.552 0 93.952-29.952 93.952-96.256 0-66.304-38.4-94.464-96.512-94.464H550.115556V756.622222h57.344z m-5.376-36.864h-6.144v-117.248h6.144c30.72 0 52.48 12.544 52.48 57.856s-21.76 59.392-52.48 59.392z' fill='white' /%3e%3c/svg%3e";export{a as ReactComponent,s as default};
@@ -0,0 +1 @@
1
+ import*as h from"react";var e,t,c;function l(){return l=Object.assign?Object.assign.bind():function(h){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var c in t)({}).hasOwnProperty.call(t,c)&&(h[c]=t[c])}return h},l.apply(null,arguments)}const a=a=>h.createElement("svg",l({xmlns:"http://www.w3.org/2000/svg",width:200,height:200,className:"pdf_svg__icon",viewBox:"0 0 1024 1024"},a),e||(e=h.createElement("path",{fill:"#FF7875",d:"m590.222 79.644 268.8 268.3v533.834c0 37.7-30.566 68.266-68.266 68.266H233.244c-37.7 0-68.266-30.566-68.266-68.266V147.91c0-37.7 30.566-68.267 68.266-68.267zm-11.764 28.445H233.244a39.82 39.82 0 0 0-39.799 38.457l-.023 1.365v733.867a39.82 39.82 0 0 0 38.457 39.8l1.365.022h557.512a39.82 39.82 0 0 0 39.799-38.457l.023-1.365V359.743z"})),t||(t=h.createElement("path",{fill:"#FF7875",d:"M854.756 376.337H639.613c-45.528 0-82.551-36.432-83.507-81.738l-.017-1.792V79.644h28.444v213.163c0 29.895 23.82 54.232 53.516 55.063l1.564.023h215.143zM85.333 494.933h853.334q28.444 0 28.444 28.445v284.444q0 28.445-28.444 28.445H85.333q-28.444 0-28.444-28.445V523.378q0-28.445 28.444-28.445"})),c||(c=h.createElement("path",{fill:"#FFF",d:"M318.436 762.311V699.08h22.272c40.448 0 75.264-19.968 75.264-65.28 0-47.104-34.56-62.208-76.288-62.208h-67.072v190.72zm19.968-99.328h-19.968v-55.04h18.688c22.016 0 34.304 6.656 34.304 25.856 0 18.688-10.752 29.184-33.024 29.184m167.424 99.328c55.552 0 93.952-29.952 93.952-96.256s-38.4-94.464-96.512-94.464h-54.784v190.72zm-5.376-36.864h-6.144V608.2h6.144c30.72 0 52.48 12.544 52.48 57.856s-21.76 59.392-52.48 59.392m180.48 36.864v-72.704h65.024v-38.144h-65.024v-41.728h75.776v-38.144h-121.6v190.72z"})));var v="data:image/svg+xml,%3c%3fxml version='1.0' standalone='no'%3f%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg class='icon' width='200px' height='200.00px' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M590.222222 79.644444L859.022222 347.943822V881.777778c0 37.700267-30.5664 68.266667-68.266666 68.266666H233.244444c-37.700267 0-68.266667-30.5664-68.266666-68.266666V147.911111c0-37.700267 30.5664-68.266667 68.266666-68.266667h356.977778z m-11.764622 28.444445H233.244444a39.822222 39.822222 0 0 0-39.799466 38.456889L193.422222 147.911111v733.866667a39.822222 39.822222 0 0 0 38.456889 39.799466L233.244444 921.6h557.511112a39.822222 39.822222 0 0 0 39.799466-38.456889L830.577778 881.777778V359.742578L578.4576 108.088889z' fill='%23FF7875' /%3e%3cpath d='M854.755556 376.337067h-215.1424c-45.528178 0-82.551467-36.431644-83.5072-81.737956l-0.017067-1.792V79.644444h28.444444v213.162667c0 29.895111 23.819378 54.232178 53.515378 55.062756l1.564445 0.022755h215.1424v28.444445z' fill='%23FF7875' /%3e%3cpath d='M56.888889 494.933333m28.444444 0l853.333334 0q28.444444 0 28.444444 28.444445l0 284.444444q0 28.444444-28.444444 28.444445l-853.333334 0q-28.444444 0-28.444444-28.444445l0-284.444444q0-28.444444 28.444444-28.444445Z' fill='%23FF7875' /%3e%3cpath d='M318.435556 762.311111v-63.232h22.272c40.448 0 75.264-19.968 75.264-65.28 0-47.104-34.56-62.208-76.288-62.208H272.611556V762.311111h45.824z m19.968-99.328h-19.968v-55.04h18.688c22.016 0 34.304 6.656 34.304 25.856 0 18.688-10.752 29.184-33.024 29.184zM505.827556 762.311111c55.552 0 93.952-29.952 93.952-96.256 0-66.304-38.4-94.464-96.512-94.464h-54.784V762.311111h57.344z m-5.376-36.864h-6.144v-117.248h6.144c30.72 0 52.48 12.544 52.48 57.856s-21.76 59.392-52.48 59.392z m180.48 36.864v-72.704h65.024v-38.144h-65.024v-41.728h75.776v-38.144H635.107556V762.311111h45.824z' fill='white' /%3e%3c/svg%3e";export{a as ReactComponent,v as default};
@@ -0,0 +1 @@
1
+ import*as h from"react";var c,l,e;function t(){return t=Object.assign?Object.assign.bind():function(h){for(var c=1;c<arguments.length;c++){var l=arguments[c];for(var e in l)({}).hasOwnProperty.call(l,e)&&(h[e]=l[e])}return h},t.apply(null,arguments)}const a=a=>h.createElement("svg",t({xmlns:"http://www.w3.org/2000/svg",width:200,height:200,className:"png_svg__icon",viewBox:"0 0 1024 1024"},a),c||(c=h.createElement("path",{fill:"#0075D5",d:"m590.222 73.956 268.8 268.299v533.834c0 37.7-30.566 68.267-68.266 68.267H233.244c-37.7 0-68.266-30.567-68.266-68.267V142.222c0-37.7 30.566-68.266 68.266-68.266zM578.458 102.4H233.244a39.82 39.82 0 0 0-39.799 38.457l-.023 1.365V876.09a39.82 39.82 0 0 0 38.457 39.8l1.365.022h557.512a39.82 39.82 0 0 0 39.799-38.457l.023-1.365V354.054z"})),l||(l=h.createElement("path",{fill:"#0075D5",d:"M854.756 370.648H639.613c-45.528 0-82.551-36.431-83.507-81.738l-.017-1.792V73.956h28.444v213.162c0 29.895 23.82 54.232 53.516 55.063l1.564.023h215.143zM85.333 506.311h853.334q28.444 0 28.444 28.445V819.2q0 28.444-28.444 28.444H85.333q-28.444 0-28.444-28.444V534.756q0-28.445 28.444-28.445"})),e||(e=h.createElement("path",{fill:"#FFF",d:"M251.62 762.311h45.824V699.08h22.272c40.448 0 75.264-19.968 75.264-65.28 0-47.104-34.56-62.208-76.288-62.208H251.62zm45.824-99.328v-55.04h18.688c22.016 0 34.304 6.656 34.304 25.856 0 18.688-10.752 29.184-33.024 29.184zm130.048 99.328h43.52V699.08c0-23.04-3.84-49.152-5.888-70.4h1.28l18.688 41.728 47.104 91.904h46.592v-190.72h-43.52v63.232c0 22.784 3.84 50.176 6.144 70.4h-1.28l-18.688-42.24-47.36-91.392h-46.592zm281.344 3.584c26.624 0 50.176-10.496 63.488-23.296v-89.088h-70.912v37.376h30.208v30.72c-4.096 3.072-11.264 4.864-17.92 4.864-35.584 0-52.48-22.016-52.48-59.904 0-37.12 20.224-59.136 48.384-59.136 15.872 0 25.856 6.4 35.328 14.848l24.064-29.184c-13.056-13.056-33.024-24.832-60.928-24.832-50.944 0-93.696 36.352-93.696 99.84 0 64.512 41.728 97.792 94.464 97.792"})));var v="data:image/svg+xml,%3c%3fxml version='1.0' standalone='no'%3f%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg class='icon' width='200px' height='200.00px' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M590.222222 73.955556L859.022222 342.254933V876.088889c0 37.700267-30.5664 68.266667-68.266666 68.266667H233.244444c-37.700267 0-68.266667-30.5664-68.266666-68.266667V142.222222c0-37.700267 30.5664-68.266667 68.266666-68.266666h356.977778z m-11.764622 28.444444H233.244444a39.822222 39.822222 0 0 0-39.799466 38.456889L193.422222 142.222222v733.866667a39.822222 39.822222 0 0 0 38.456889 39.799467L233.244444 915.911111h557.511112a39.822222 39.822222 0 0 0 39.799466-38.456889L830.577778 876.088889V354.053689L578.4576 102.4z' fill='%230075D5' /%3e%3cpath d='M854.755556 370.648178h-215.1424c-45.528178 0-82.551467-36.431644-83.5072-81.737956l-0.017067-1.792V73.955556h28.444444v213.162666c0 29.895111 23.819378 54.232178 53.515378 55.062756l1.564445 0.022755h215.1424v28.444445z' fill='%230075D5' /%3e%3cpath d='M56.888889 506.311111m28.444444 0l853.333334 0q28.444444 0 28.444444 28.444445l0 284.444444q0 28.444444-28.444444 28.444444l-853.333334 0q-28.444444 0-28.444444-28.444444l0-284.444444q0-28.444444 28.444444-28.444445Z' fill='%230075D5' /%3e%3cpath d='M251.619556 762.311111h45.824v-63.232H319.715556c40.448 0 75.264-19.968 75.264-65.28 0-47.104-34.56-62.208-76.288-62.208H251.619556V762.311111z m45.824-99.328v-55.04h18.688c22.016 0 34.304 6.656 34.304 25.856 0 18.688-10.752 29.184-33.024 29.184h-19.968zM427.491556 762.311111h43.52v-63.232c0-23.04-3.84-49.152-5.888-70.4h1.28l18.688 41.728L532.195556 762.311111h46.592v-190.72h-43.52v63.232c0 22.784 3.84 50.176 6.144 70.4h-1.28l-18.688-42.24-47.36-91.392h-46.592V762.311111zM708.835556 765.895111c26.624 0 50.176-10.496 63.488-23.296v-89.088h-70.912v37.376h30.208v30.72c-4.096 3.072-11.264 4.864-17.92 4.864-35.584 0-52.48-22.016-52.48-59.904 0-37.12 20.224-59.136 48.384-59.136 15.872 0 25.856 6.4 35.328 14.848l24.064-29.184c-13.056-13.056-33.024-24.832-60.928-24.832-50.944 0-93.696 36.352-93.696 99.84 0 64.512 41.728 97.792 94.464 97.792z' fill='white' /%3e%3c/svg%3e";export{a as ReactComponent,v as default};
@@ -0,0 +1 @@
1
+ import*as h from"react";var e,t,c;function l(){return l=Object.assign?Object.assign.bind():function(h){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var c in t)({}).hasOwnProperty.call(t,c)&&(h[c]=t[c])}return h},l.apply(null,arguments)}const a=a=>h.createElement("svg",l({xmlns:"http://www.w3.org/2000/svg",width:200,height:200,className:"pptx_svg__icon",viewBox:"0 0 1024 1024"},a),e||(e=h.createElement("path",{fill:"#FF7A45",d:"m590.222 73.956 268.8 268.299v533.834c0 37.7-30.566 68.267-68.266 68.267H233.244c-37.7 0-68.266-30.567-68.266-68.267V142.222c0-37.7 30.566-68.266 68.266-68.266zM578.458 102.4H233.244a39.82 39.82 0 0 0-39.799 38.457l-.023 1.365V876.09a39.82 39.82 0 0 0 38.457 39.8l1.365.022h557.512a39.82 39.82 0 0 0 39.799-38.457l.023-1.365V354.054z"})),t||(t=h.createElement("path",{fill:"#FF7A45",d:"M854.756 370.648H639.613c-45.528 0-82.551-36.431-83.507-81.738l-.017-1.792V73.956h28.444v213.162c0 29.895 23.82 54.232 53.516 55.063l1.564.023h215.143zM85.333 489.244h853.334q28.444 0 28.444 28.445v284.444q0 28.445-28.444 28.445H85.333q-28.444 0-28.444-28.445V517.69q0-28.445 28.444-28.445"})),c||(c=h.createElement("path",{fill:"#FFF",d:"M313.515 756.622V693.39h22.272c40.448 0 75.264-19.968 75.264-65.28 0-47.104-34.56-62.208-76.288-62.208H267.69v190.72zm19.968-99.328h-19.968v-55.04h18.688c22.016 0 34.304 6.656 34.304 25.856 0 18.688-10.752 29.184-33.024 29.184m155.904 99.328V693.39h22.272c40.448 0 75.264-19.968 75.264-65.28 0-47.104-34.56-62.208-76.288-62.208h-67.072v190.72zm19.968-99.328h-19.968v-55.04h18.688c22.016 0 34.304 6.656 34.304 25.856 0 18.688-10.752 29.184-33.024 29.184m192.768 99.328V604.046h51.712v-38.144H604.843v38.144h51.456v152.576z"})));var v="data:image/svg+xml,%3c%3fxml version='1.0' standalone='no'%3f%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg class='icon' width='200px' height='200.00px' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M590.222222 73.955556L859.022222 342.254933V876.088889c0 37.700267-30.5664 68.266667-68.266666 68.266667H233.244444c-37.700267 0-68.266667-30.5664-68.266666-68.266667V142.222222c0-37.700267 30.5664-68.266667 68.266666-68.266666h356.977778z m-11.764622 28.444444H233.244444a39.822222 39.822222 0 0 0-39.799466 38.456889L193.422222 142.222222v733.866667a39.822222 39.822222 0 0 0 38.456889 39.799467L233.244444 915.911111h557.511112a39.822222 39.822222 0 0 0 39.799466-38.456889L830.577778 876.088889V354.053689L578.4576 102.4z' fill='%23FF7A45' /%3e%3cpath d='M854.755556 370.648178h-215.1424c-45.528178 0-82.551467-36.431644-83.5072-81.737956l-0.017067-1.792V73.955556h28.444444v213.162666c0 29.895111 23.819378 54.232178 53.515378 55.062756l1.564445 0.022755h215.1424v28.444445z' fill='%23FF7A45' /%3e%3cpath d='M56.888889 489.244444m28.444444 0l853.333334 0q28.444444 0 28.444444 28.444445l0 284.444444q0 28.444444-28.444444 28.444445l-853.333334 0q-28.444444 0-28.444444-28.444445l0-284.444444q0-28.444444 28.444444-28.444445Z' fill='%23FF7A45' /%3e%3cpath d='M313.514667 756.622222v-63.232h22.272c40.448 0 75.264-19.968 75.264-65.28 0-47.104-34.56-62.208-76.288-62.208h-67.072V756.622222h45.824z m19.968-99.328h-19.968v-55.04h18.688c22.016 0 34.304 6.656 34.304 25.856 0 18.688-10.752 29.184-33.024 29.184zM489.386667 756.622222v-63.232h22.272c40.448 0 75.264-19.968 75.264-65.28 0-47.104-34.56-62.208-76.288-62.208H443.562667V756.622222h45.824z m19.968-99.328h-19.968v-55.04h18.688c22.016 0 34.304 6.656 34.304 25.856 0 18.688-10.752 29.184-33.024 29.184zM702.122667 756.622222v-152.576h51.712v-38.144h-148.992v38.144h51.456V756.622222h45.824z' fill='white' /%3e%3c/svg%3e";export{a as ReactComponent,v as default};
@@ -0,0 +1 @@
1
+ import*as l from"react";var h,t,e;function a(){return a=Object.assign?Object.assign.bind():function(l){for(var h=1;h<arguments.length;h++){var t=arguments[h];for(var e in t)({}).hasOwnProperty.call(t,e)&&(l[e]=t[e])}return l},a.apply(null,arguments)}const c=c=>l.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",width:200,height:200,className:"txt_svg__icon",viewBox:"0 0 1024 1024"},c),h||(h=l.createElement("path",{fill:"#91D5FF",d:"m590.222 73.956 268.8 268.299v533.834c0 37.7-30.566 68.267-68.266 68.267H233.244c-37.7 0-68.266-30.567-68.266-68.267V142.222c0-37.7 30.566-68.266 68.266-68.266zM578.458 102.4H233.244a39.82 39.82 0 0 0-39.799 38.457l-.023 1.365V876.09a39.82 39.82 0 0 0 38.457 39.8l1.365.022h557.512a39.82 39.82 0 0 0 39.799-38.457l.023-1.365V354.054z"})),t||(t=l.createElement("path",{fill:"#91D5FF",d:"M854.756 370.648H639.613c-45.528 0-82.551-36.431-83.507-81.738l-.017-1.792V73.956h28.444v213.162c0 29.895 23.82 54.232 53.516 55.063l1.564.023h215.143zM85.333 489.244h853.334q28.444 0 28.444 28.445v284.444q0 28.445-28.444 28.445H85.333q-28.444 0-28.444-28.445V517.69q0-28.445 28.444-28.445"})),e||(e=l.createElement("path",{fill:"#FFF",d:"M371.615 756.622V604.046h51.712v-38.144H274.335v38.144h51.45v152.576zm111.104 0 16.384-37.12c4.347-9.984 8.704-19.968 13.05-31.744h1.025c5.12 11.776 9.477 21.76 14.085 31.744l17.659 37.12h50.95l-52.48-96 49.151-94.72H544.16l-13.824 34.304a503 503 0 0 0-12.288 31.232h-1.024c-5.376-12.288-9.472-22.272-13.824-31.232l-15.36-34.304h-50.95l49.414 92.672-52.224 98.048zm220.928 0V604.046h51.712v-38.144H606.367v38.144h51.45v152.576h45.825z"})));var v="data:image/svg+xml,%3c%3fxml version='1.0' standalone='no'%3f%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg class='icon' width='200px' height='200.00px' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M590.222222 73.955556L859.022222 342.254933V876.088889c0 37.700267-30.5664 68.266667-68.266666 68.266667H233.244444c-37.700267 0-68.266667-30.5664-68.266666-68.266667V142.222222c0-37.700267 30.5664-68.266667 68.266666-68.266666h356.977778z m-11.764622 28.444444H233.244444a39.822222 39.822222 0 0 0-39.799466 38.456889L193.422222 142.222222v733.866667a39.822222 39.822222 0 0 0 38.456889 39.799467L233.244444 915.911111h557.511112a39.822222 39.822222 0 0 0 39.799466-38.456889L830.577778 876.088889V354.053689L578.4576 102.4z' fill='%2391D5FF' /%3e%3cpath d='M854.755556 370.648178h-215.1424c-45.528178 0-82.551467-36.431644-83.5072-81.737956l-0.017067-1.792V73.955556h28.444444v213.162666c0 29.895111 23.819378 54.232178 53.515378 55.062756l1.564445 0.022755h215.1424v28.444445z' fill='%2391D5FF' /%3e%3cpath d='M56.888889 489.244444m28.444444 0l853.333334 0q28.444444 0 28.444444 28.444445l0 284.444444q0 28.444444-28.444444 28.444445l-853.333334 0q-28.444444 0-28.444444-28.444445l0-284.444444q0-28.444444 28.444444-28.444445Z' fill='%2391D5FF' /%3e%3cpath d='M371.615289 756.622222v-152.576h51.712v-38.144h-148.992v38.144h51.450311V756.622222h45.829689z m111.104 0l16.384-37.12c4.346311-9.984 8.704-19.968 13.050311-31.744h1.024c5.12 11.776 9.477689 21.76 14.085689 31.744L544.9216 756.622222h50.949689l-52.48-96 49.152-94.72h-48.384l-13.824 34.304a503.443911 503.443911 0 0 0-12.288 31.232h-1.024c-5.376-12.288-9.472-22.272-13.824-31.232l-15.36-34.304h-50.949689l49.413689 92.672L434.079289 756.622222h48.64z m220.928 0v-152.576h51.712v-38.144h-148.992v38.144h51.450311V756.622222h45.824z' fill='white' /%3e%3c/svg%3e";export{c as ReactComponent,v as default};
@@ -0,0 +1 @@
1
+ import*as l from"react";var c,e,a;function t(){return t=Object.assign?Object.assign.bind():function(l){for(var c=1;c<arguments.length;c++){var e=arguments[c];for(var a in e)({}).hasOwnProperty.call(e,a)&&(l[a]=e[a])}return l},t.apply(null,arguments)}const h=h=>l.createElement("svg",t({xmlns:"http://www.w3.org/2000/svg",width:200,height:200,className:"xlsx_svg__icon",viewBox:"0 0 1024 1024"},h),c||(c=l.createElement("path",{fill:"#73D13D",d:"m590.222 73.956 268.8 268.299v533.834c0 37.7-30.566 68.267-68.266 68.267H233.244c-37.7 0-68.266-30.567-68.266-68.267V142.222c0-37.7 30.566-68.266 68.266-68.266zM578.458 102.4H233.244a39.82 39.82 0 0 0-39.799 38.457l-.023 1.365V876.09a39.82 39.82 0 0 0 38.457 39.8l1.365.022h557.512a39.82 39.82 0 0 0 39.799-38.457l.023-1.365V354.054z"})),e||(e=l.createElement("path",{fill:"#73D13D",d:"M854.756 370.648H639.613c-45.528 0-82.551-36.431-83.507-81.738l-.017-1.792V73.956h28.444v213.162c0 29.895 23.82 54.232 53.516 55.063l1.564.023h215.143zM85.333 489.244h853.334q28.444 0 28.444 28.445v284.444q0 28.445-28.444 28.445H85.333q-28.444 0-28.444-28.445V517.69q0-28.445 28.444-28.445"})),a||(a=l.createElement("path",{fill:"#FFF",d:"m327.225 756.622 16.384-37.12c4.352-9.984 8.704-19.968 13.056-31.744h1.024c5.12 11.776 9.472 21.76 14.08 31.744l17.664 37.12h50.944l-52.48-96 49.152-94.72h-48.384l-13.824 34.304a503 503 0 0 0-12.288 31.232h-1.024c-5.376-12.288-9.472-22.272-13.824-31.232l-15.36-34.304H281.4l49.408 92.672-52.224 98.048zm258.304 0v-38.4h-74.24v-152.32h-45.824v190.72zm92.16 3.584c46.08 0 72.704-27.904 72.704-59.648 0-26.88-14.08-42.752-37.632-52.224l-23.808-9.472c-16.896-6.656-28.672-10.752-28.672-21.504 0-9.984 8.448-15.616 22.528-15.616 14.848 0 26.624 5.12 39.168 14.592l22.784-28.672c-16.64-16.64-39.936-25.088-61.952-25.088-40.448 0-69.12 25.6-69.12 57.6 0 27.648 18.688 44.288 38.656 52.224l24.32 10.24c16.384 6.912 26.88 10.496 26.88 21.504 0 10.24-7.936 16.64-24.832 16.64-15.104 0-32.768-7.936-46.08-19.456l-26.112 31.488c19.712 18.176 46.336 27.392 71.168 27.392"})));var n="data:image/svg+xml,%3c%3fxml version='1.0' standalone='no'%3f%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg class='icon' width='200px' height='200.00px' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M590.222222 73.955556L859.022222 342.254933V876.088889c0 37.700267-30.5664 68.266667-68.266666 68.266667H233.244444c-37.700267 0-68.266667-30.5664-68.266666-68.266667V142.222222c0-37.700267 30.5664-68.266667 68.266666-68.266666h356.977778z m-11.764622 28.444444H233.244444a39.822222 39.822222 0 0 0-39.799466 38.456889L193.422222 142.222222v733.866667a39.822222 39.822222 0 0 0 38.456889 39.799467L233.244444 915.911111h557.511112a39.822222 39.822222 0 0 0 39.799466-38.456889L830.577778 876.088889V354.053689L578.4576 102.4z' fill='%2373D13D' /%3e%3cpath d='M854.755556 370.648178h-215.1424c-45.528178 0-82.551467-36.431644-83.5072-81.737956l-0.017067-1.792V73.955556h28.444444v213.162666c0 29.895111 23.819378 54.232178 53.515378 55.062756l1.564445 0.022755h215.1424v28.444445z' fill='%2373D13D' /%3e%3cpath d='M56.888889 489.244444m28.444444 0l853.333334 0q28.444444 0 28.444444 28.444445l0 284.444444q0 28.444444-28.444444 28.444445l-853.333334 0q-28.444444 0-28.444444-28.444445l0-284.444444q0-28.444444 28.444444-28.444445Z' fill='%2373D13D' /%3e%3cpath d='M327.224889 756.622222l16.384-37.12c4.352-9.984 8.704-19.968 13.056-31.744h1.024c5.12 11.776 9.472 21.76 14.08 31.744L389.432889 756.622222h50.944l-52.48-96 49.152-94.72H388.664889l-13.824 34.304a503.443911 503.443911 0 0 0-12.288 31.232h-1.024c-5.376-12.288-9.472-22.272-13.824-31.232l-15.36-34.304h-50.944l49.408 92.672L278.584889 756.622222h48.64z m258.304 0v-38.4h-74.24V565.902222H465.464889V756.622222h120.064z m92.16 3.584c46.08 0 72.704-27.904 72.704-59.648 0-26.88-14.08-42.752-37.632-52.224l-23.808-9.472c-16.896-6.656-28.672-10.752-28.672-21.504 0-9.984 8.448-15.616 22.528-15.616 14.848 0 26.624 5.12 39.168 14.592l22.784-28.672c-16.64-16.64-39.936-25.088-61.952-25.088-40.448 0-69.12 25.6-69.12 57.6 0 27.648 18.688 44.288 38.656 52.224l24.32 10.24c16.384 6.912 26.88 10.496 26.88 21.504 0 10.24-7.936 16.64-24.832 16.64-15.104 0-32.768-7.936-46.08-19.456l-26.112 31.488c19.712 18.176 46.336 27.392 71.168 27.392z' fill='white' /%3e%3c/svg%3e";export{h as ReactComponent,n as default};
package/package.json CHANGED
@@ -1,71 +1,70 @@
1
1
  {
2
- "name": "@topthink/chat",
3
- "version": "1.1.37",
4
- "scripts": {
5
- "prebuild": "rimraf es types",
6
- "build": "rollup -c --environment NODE_ENV:production",
7
- "build:dev": "rollup -c",
8
- "watch": "rollup -c -w",
9
- "prepack": "npm run build"
10
- },
11
- "module": "es/index.js",
12
- "types": "types/index.d.ts",
13
- "files": [
14
- "es",
15
- "types",
16
- "scss"
17
- ],
18
- "dependencies": {
19
- "@babel/runtime": "^7.11.2",
20
- "@breezystack/lamejs": "^1.2.7",
21
- "@topthink/components": "^1.1.23",
22
- "@types/hast": "^2.0.0",
23
- "@types/mdast": "^4.0.4",
24
- "eventemitter3": "^5.0.1",
25
- "hast-util-to-string": "^2.0.0",
26
- "katex": "^0.16.9",
27
- "mdast-util-from-markdown": "^2.0.1",
28
- "micromark-util-character": "^2.1.0",
29
- "micromark-util-symbol": "^2.0.0",
30
- "micromark-util-types": "^2.0.0",
31
- "react-markdown": "^8.0.7",
32
- "react-textarea-autosize": "^8.5.3",
33
- "rehype-highlight": "^6.0.0",
34
- "rehype-katex": "^6.0.3",
35
- "remark-breaks": "^3.0.2",
36
- "remark-gfm": "^3.0.1",
37
- "remark-math": "^5.1.1",
38
- "unified": "^10.0.0",
39
- "use-resize-observer": "^9.1.0"
40
- },
41
- "peerDependencies": {
42
- "lodash": "*",
43
- "react": "^17||^18",
44
- "react-bootstrap": "^2.1.2",
45
- "react-dom": "^17||^18"
46
- },
47
- "devDependencies": {
48
- "@babel/core": "^7.23.6",
49
- "@babel/plugin-transform-runtime": "^7.23.6",
50
- "@babel/preset-env": "^7.23.6",
51
- "@rollup/plugin-babel": "^6.0.4",
52
- "@rollup/plugin-commonjs": "^25.0.7",
53
- "@rollup/plugin-dynamic-import-vars": "^2.1.2",
54
- "@rollup/plugin-image": "^3.0.3",
55
- "@rollup/plugin-node-resolve": "^15.2.3",
56
- "@rollup/plugin-terser": "^0.4.4",
57
- "@rollup/plugin-typescript": "^11.1.5",
58
- "@svgr/rollup": "^8.1.0",
59
- "@types/dom-speech-recognition": "^0.0.4",
60
- "@types/lodash": "^4.14.161",
61
- "@types/node": "^18.11.18",
62
- "@types/react": "^17.0.0",
63
- "@types/react-dom": "^17.0.0",
64
- "react-bootstrap": "^2.1.2",
65
- "rollup": "^4.8.0",
66
- "typescript": "^5.3.3"
67
- },
68
- "author": "yunwuxin <tzzhangyajun@qq.com> (https://github.com/yunwuxin)",
69
- "license": "MIT",
70
- "gitHead": "a3b55b29586394f73a1a16982d2f1c13901d5061"
71
- }
2
+ "name": "@topthink/chat",
3
+ "version": "1.1.39",
4
+ "module": "es/index.js",
5
+ "types": "types/index.d.ts",
6
+ "files": [
7
+ "es",
8
+ "types",
9
+ "scss"
10
+ ],
11
+ "dependencies": {
12
+ "@babel/runtime": "^7.11.2",
13
+ "@breezystack/lamejs": "^1.2.7",
14
+ "@topthink/components": "^1.1.23",
15
+ "@types/hast": "^2.0.0",
16
+ "@types/mdast": "^4.0.4",
17
+ "eventemitter3": "^5.0.1",
18
+ "hast-util-to-string": "^2.0.0",
19
+ "katex": "^0.16.9",
20
+ "mdast-util-from-markdown": "^2.0.1",
21
+ "micromark-util-character": "^2.1.0",
22
+ "micromark-util-symbol": "^2.0.0",
23
+ "micromark-util-types": "^2.0.0",
24
+ "react-markdown": "^8.0.7",
25
+ "react-textarea-autosize": "^8.5.3",
26
+ "rehype-highlight": "^6.0.0",
27
+ "rehype-katex": "^6.0.3",
28
+ "remark-breaks": "^3.0.2",
29
+ "remark-gfm": "^3.0.1",
30
+ "remark-math": "^5.1.1",
31
+ "unified": "^10.0.0",
32
+ "use-resize-observer": "^9.1.0"
33
+ },
34
+ "peerDependencies": {
35
+ "lodash": "*",
36
+ "react": "^17||^18",
37
+ "react-bootstrap": "^2.1.2",
38
+ "react-dom": "^17||^18"
39
+ },
40
+ "devDependencies": {
41
+ "@babel/core": "^7.23.6",
42
+ "@babel/plugin-transform-runtime": "^7.23.6",
43
+ "@babel/preset-env": "^7.23.6",
44
+ "@rollup/plugin-babel": "^6.0.4",
45
+ "@rollup/plugin-commonjs": "^25.0.7",
46
+ "@rollup/plugin-dynamic-import-vars": "^2.1.2",
47
+ "@rollup/plugin-image": "^3.0.3",
48
+ "@rollup/plugin-node-resolve": "^15.2.3",
49
+ "@rollup/plugin-terser": "^0.4.4",
50
+ "@rollup/plugin-typescript": "^11.1.5",
51
+ "@svgr/rollup": "^8.1.0",
52
+ "@types/dom-speech-recognition": "^0.0.4",
53
+ "@types/lodash": "^4.14.161",
54
+ "@types/node": "^18.11.18",
55
+ "@types/react": "^17.0.0",
56
+ "@types/react-dom": "^17.0.0",
57
+ "react-bootstrap": "^2.1.2",
58
+ "rollup": "^4.8.0",
59
+ "typescript": "^5.9.2"
60
+ },
61
+ "author": "yunwuxin <tzzhangyajun@qq.com> (https://github.com/yunwuxin)",
62
+ "license": "MIT",
63
+ "gitHead": "8424ddbad97927bab02a5c420b9d1a15f62219b5",
64
+ "scripts": {
65
+ "prebuild": "rimraf es types",
66
+ "build": "rollup -c --environment NODE_ENV:production",
67
+ "build:dev": "rollup -c",
68
+ "watch": "rollup -c -w"
69
+ }
70
+ }
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Components } from 'react-markdown';
3
2
  import 'katex/dist/katex.min.css';
4
3
  interface Props {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Chunk } from '../../types';
3
2
  interface ContextType {
4
3
  index: number;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface Mic {
3
2
  start: () => void;
4
3
  stop: (force?: boolean) => void;
@@ -1,9 +1,5 @@
1
1
  export default function useChat(): {
2
- send: (params: string | import("../../../types").SendParams, files?: {
3
- path: string;
4
- name: string;
5
- size: number;
6
- }[] | undefined, variables?: Record<string, string> | undefined) => Promise<void>;
7
- resume: (params: import("../../../types").ResumeParams) => Promise<void>;
2
+ send: (params: string | import("../../..").SendParams, files?: import("../../..").Message["files"], variables?: import("../../..").Message["variables"]) => Promise<void>;
3
+ resume: (params: import("../../..").ResumeParams) => Promise<void>;
8
4
  suggest: () => Promise<void>;
9
5
  };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface Props {
3
2
  reasoning: string;
4
3
  loading?: boolean;
@@ -1 +0,0 @@
1
- import*as c from"react";var t,e,l;function a(){return a=Object.assign?Object.assign.bind():function(c){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&(c[l]=e[l])}return c},a.apply(this,arguments)}const h=h=>c.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",width:200,height:200,className:"docx_svg__icon",viewBox:"0 0 1024 1024"},h),t||(t=c.createElement("path",{fill:"#1890FF",d:"m590.222 73.956 268.8 268.299v533.834c0 37.7-30.566 68.267-68.266 68.267H233.244c-37.7 0-68.266-30.567-68.266-68.267V142.222c0-37.7 30.566-68.266 68.266-68.266zm-11.77 28.438H233.244a39.83 39.83 0 0 0-39.799 38.457l-.023 1.371V876.09a39.82 39.82 0 0 0 38.457 39.8l1.365.022h557.512a39.82 39.82 0 0 0 39.799-38.457l.023-1.365V354.054z"})),e||(e=c.createElement("path",{fill:"#1890FF",d:"M854.756 370.648H639.613c-45.528 0-82.551-36.431-83.507-81.738l-.017-1.792V73.956h28.444v213.162c0 29.895 23.82 54.232 53.516 55.063l1.564.023h215.143zM85.333 489.244h853.334q28.444 0 28.444 28.445v284.444q0 28.445-28.444 28.445H85.333q-28.444 0-28.444-28.445V517.69q0-28.445 28.444-28.445"})),l||(l=c.createElement("path",{fill:"#FFF",d:"M303.53 756.622c55.553 0 93.953-29.952 93.953-96.256s-38.4-94.464-96.512-94.464h-54.784v190.72zm-5.375-36.864h-6.144V602.51h6.144c30.72 0 52.48 12.544 52.48 57.856s-21.76 59.392-52.48 59.392m213.248 40.448c51.968 0 87.296-37.376 87.296-99.84 0-62.208-35.328-97.792-87.296-97.792s-87.296 35.328-87.296 97.792 35.328 99.84 87.296 99.84m0-39.424c-25.088 0-40.448-23.552-40.448-60.416s15.36-58.624 40.448-58.624 40.704 21.76 40.704 58.624-15.616 60.416-40.704 60.416m203.264 39.424c24.832 0 46.08-9.472 62.208-28.16l-24.064-28.672c-8.96 9.728-20.992 17.408-36.352 17.408-26.88 0-44.288-22.016-44.288-59.904 0-37.12 20.224-59.136 44.8-59.136 13.568 0 23.552 6.144 33.28 14.848l23.808-29.184c-13.056-13.312-33.024-24.832-57.856-24.832-48.384 0-90.88 36.352-90.88 99.84 0 64.512 40.96 97.792 89.344 97.792"})));var s="data:image/svg+xml,%3c%3fxml version='1.0' standalone='no'%3f%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg class='icon' width='200px' height='200.00px' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M590.222222 73.955556L859.022222 342.254933V876.088889c0 37.700267-30.5664 68.266667-68.266666 68.266667H233.244444c-37.700267 0-68.266667-30.5664-68.266666-68.266667V142.222222c0-37.700267 30.5664-68.266667 68.266666-68.266666h356.977778z m-11.770311 28.438755H233.244444a39.827911 39.827911 0 0 0-39.799466 38.456889L193.422222 142.222222v733.866667a39.822222 39.822222 0 0 0 38.456889 39.799467L233.244444 915.911111h557.511112a39.822222 39.822222 0 0 0 39.799466-38.456889L830.577778 876.088889V354.053689l-252.125867-251.659378z' fill='%231890FF' /%3e%3cpath d='M854.755556 370.648178h-215.1424c-45.528178 0-82.551467-36.431644-83.5072-81.737956l-0.017067-1.792V73.955556h28.444444v213.162666c0 29.895111 23.819378 54.232178 53.515378 55.062756l1.564445 0.022755h215.1424v28.444445z' fill='%231890FF' /%3e%3cpath d='M56.888889 489.244444m28.444444 0l853.333334 0q28.444444 0 28.444444 28.444445l0 284.444444q0 28.444444-28.444444 28.444445l-853.333334 0q-28.444444 0-28.444444-28.444445l0-284.444444q0-28.444444 28.444444-28.444445Z' fill='%231890FF' /%3e%3cpath d='M303.530667 756.622222c55.552 0 93.952-29.952 93.952-96.256 0-66.304-38.4-94.464-96.512-94.464h-54.784V756.622222h57.344z m-5.376-36.864h-6.144v-117.248h6.144c30.72 0 52.48 12.544 52.48 57.856s-21.76 59.392-52.48 59.392z m213.248 40.448c51.968 0 87.296-37.376 87.296-99.84 0-62.208-35.328-97.792-87.296-97.792-51.968 0-87.296 35.328-87.296 97.792s35.328 99.84 87.296 99.84z m0-39.424c-25.088 0-40.448-23.552-40.448-60.416 0-36.864 15.36-58.624 40.448-58.624s40.704 21.76 40.704 58.624c0 36.864-15.616 60.416-40.704 60.416z m203.264 39.424c24.832 0 46.08-9.472 62.208-28.16l-24.064-28.672c-8.96 9.728-20.992 17.408-36.352 17.408-26.88 0-44.288-22.016-44.288-59.904 0-37.12 20.224-59.136 44.8-59.136 13.568 0 23.552 6.144 33.28 14.848l23.808-29.184c-13.056-13.312-33.024-24.832-57.856-24.832-48.384 0-90.88 36.352-90.88 99.84 0 64.512 40.96 97.792 89.344 97.792z' fill='white' /%3e%3c/svg%3e";export{h as ReactComponent,s as default};
@@ -1 +0,0 @@
1
- import*as c from"react";var t,e,l;function h(){return h=Object.assign?Object.assign.bind():function(c){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&(c[l]=e[l])}return c},h.apply(this,arguments)}const a=a=>c.createElement("svg",h({xmlns:"http://www.w3.org/2000/svg",width:200,height:200,className:"jpg_svg__icon",viewBox:"0 0 1024 1024"},a),t||(t=c.createElement("path",{fill:"#EFCB35",d:"m590.222 79.644 268.8 268.3v533.834c0 37.7-30.566 68.266-68.266 68.266H233.244c-37.7 0-68.266-30.566-68.266-68.266V147.91c0-37.7 30.566-68.267 68.266-68.267zm-11.764 28.445H233.244a39.82 39.82 0 0 0-39.799 38.457l-.023 1.365v733.867a39.82 39.82 0 0 0 38.457 39.8l1.365.022h557.512a39.82 39.82 0 0 0 39.799-38.457l.023-1.365V359.743z"})),e||(e=c.createElement("path",{fill:"#EFCB35",d:"M854.756 376.337H639.613c-45.528 0-82.551-36.432-83.507-81.738l-.017-1.792V79.644h28.444v213.163c0 29.895 23.82 54.232 53.516 55.063l1.564.023h215.143zM85.333 494.933h853.334q28.444 0 28.444 28.445v284.444q0 28.445-28.444 28.445H85.333q-28.444 0-28.444-28.445V523.378q0-28.445 28.444-28.445"})),l||(l=c.createElement("path",{fill:"#FFF",d:"M330.581 765.895c42.752 0 62.464-30.72 62.464-68.096V571.591h-45.824v122.624c0 24.832-7.936 32.256-22.784 32.256-9.216 0-18.944-5.888-25.6-18.944l-30.976 23.296c13.568 23.552 33.024 35.072 62.72 35.072m151.04-3.584V699.08h22.272c40.448 0 75.264-19.968 75.264-65.28 0-47.104-34.56-62.208-76.288-62.208h-67.072v190.72zm19.968-99.328h-19.968v-55.04h18.688c22.016 0 34.304 6.656 34.304 25.856 0 18.688-10.752 29.184-33.024 29.184m195.84 102.912c26.624 0 50.176-10.496 63.488-23.296v-89.088h-70.912v37.376h30.208v30.72c-4.096 3.072-11.264 4.864-17.92 4.864-35.584 0-52.48-22.016-52.48-59.904 0-37.12 20.224-59.136 48.384-59.136 15.872 0 25.856 6.4 35.328 14.848l24.064-29.184c-13.056-13.056-33.024-24.832-60.928-24.832-50.944 0-93.696 36.352-93.696 99.84 0 64.512 41.728 97.792 94.464 97.792"})));var v="data:image/svg+xml,%3c%3fxml version='1.0' standalone='no'%3f%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg class='icon' width='200px' height='200.00px' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M590.222222 79.644444L859.022222 347.943822V881.777778c0 37.700267-30.5664 68.266667-68.266666 68.266666H233.244444c-37.700267 0-68.266667-30.5664-68.266666-68.266666V147.911111c0-37.700267 30.5664-68.266667 68.266666-68.266667h356.977778z m-11.764622 28.444445H233.244444a39.822222 39.822222 0 0 0-39.799466 38.456889L193.422222 147.911111v733.866667a39.822222 39.822222 0 0 0 38.456889 39.799466L233.244444 921.6h557.511112a39.822222 39.822222 0 0 0 39.799466-38.456889L830.577778 881.777778V359.742578L578.4576 108.088889z' fill='%23EFCB35' /%3e%3cpath d='M854.755556 376.337067h-215.1424c-45.528178 0-82.551467-36.431644-83.5072-81.737956l-0.017067-1.792V79.644444h28.444444v213.162667c0 29.895111 23.819378 54.232178 53.515378 55.062756l1.564445 0.022755h215.1424v28.444445z' fill='%23EFCB35' /%3e%3cpath d='M56.888889 494.933333m28.444444 0l853.333334 0q28.444444 0 28.444444 28.444445l0 284.444444q0 28.444444-28.444444 28.444445l-853.333334 0q-28.444444 0-28.444444-28.444445l0-284.444444q0-28.444444 28.444444-28.444445Z' fill='%23EFCB35' /%3e%3cpath d='M330.581333 765.895111c42.752 0 62.464-30.72 62.464-68.096v-126.208h-45.824v122.624c0 24.832-7.936 32.256-22.784 32.256-9.216 0-18.944-5.888-25.6-18.944l-30.976 23.296c13.568 23.552 33.024 35.072 62.72 35.072z m151.04-3.584v-63.232h22.272c40.448 0 75.264-19.968 75.264-65.28 0-47.104-34.56-62.208-76.288-62.208h-67.072V762.311111h45.824z m19.968-99.328h-19.968v-55.04h18.688c22.016 0 34.304 6.656 34.304 25.856 0 18.688-10.752 29.184-33.024 29.184z m195.84 102.912c26.624 0 50.176-10.496 63.488-23.296v-89.088H690.005333v37.376h30.208v30.72c-4.096 3.072-11.264 4.864-17.92 4.864-35.584 0-52.48-22.016-52.48-59.904 0-37.12 20.224-59.136 48.384-59.136 15.872 0 25.856 6.4 35.328 14.848l24.064-29.184c-13.056-13.056-33.024-24.832-60.928-24.832-50.944 0-93.696 36.352-93.696 99.84 0 64.512 41.728 97.792 94.464 97.792z' fill='white' /%3e%3c/svg%3e";export{a as ReactComponent,v as default};
package/es/md-GZ3HJPcw.js DELETED
@@ -1 +0,0 @@
1
- import*as h from"react";var l,c,t;function e(){return e=Object.assign?Object.assign.bind():function(h){for(var l=1;l<arguments.length;l++){var c=arguments[l];for(var t in c)Object.prototype.hasOwnProperty.call(c,t)&&(h[t]=c[t])}return h},e.apply(this,arguments)}const a=a=>h.createElement("svg",e({xmlns:"http://www.w3.org/2000/svg",width:200,height:200,className:"md_svg__icon",viewBox:"0 0 1024 1024"},a),l||(l=h.createElement("path",{fill:"#20B2AA",d:"m590.222 73.956 268.8 268.299v533.834c0 37.7-30.566 68.267-68.266 68.267H233.244c-37.7 0-68.266-30.567-68.266-68.267V142.222c0-37.7 30.566-68.266 68.266-68.266zM578.458 102.4H233.244a39.82 39.82 0 0 0-39.799 38.457l-.023 1.365V876.09a39.82 39.82 0 0 0 38.457 39.8l1.365.022h557.512a39.82 39.82 0 0 0 39.799-38.457l.023-1.365V354.054z"})),c||(c=h.createElement("path",{fill:"#20B2AA",d:"M854.756 370.648H639.613c-45.528 0-82.551-36.431-83.507-81.738l-.017-1.792V73.956h28.444v213.162c0 29.895 23.82 54.232 53.516 55.063l1.564.023h215.143zM85.333 489.244h853.334q28.444 0 28.444 28.445v284.444q0 28.445-28.444 28.445H85.333q-28.444 0-28.444-28.445V517.69q0-28.445 28.444-28.445"})),t||(t=h.createElement("path",{fill:"#FFF",d:"M366.564 756.622v-65.28c0-18.944-3.584-47.36-5.888-66.048h1.024l15.36 45.568 25.856 69.632h25.088l25.6-69.632 15.872-45.568h1.28c-2.56 18.688-6.144 47.104-6.144 66.048v65.28h41.728v-190.72h-49.664l-29.184 82.432c-3.584 11.008-6.656 23.04-10.496 34.56h-1.28c-3.584-11.52-6.656-23.552-10.496-34.56l-30.208-82.432h-49.408v190.72zm240.896 0c55.552 0 93.952-29.952 93.952-96.256s-38.4-94.464-96.512-94.464h-54.784v190.72zm-5.376-36.864h-6.144V602.51h6.144c30.72 0 52.48 12.544 52.48 57.856s-21.76 59.392-52.48 59.392"})));var s="data:image/svg+xml,%3c%3fxml version='1.0' standalone='no'%3f%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg class='icon' width='200px' height='200.00px' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M590.222222 73.955556L859.022222 342.254933V876.088889c0 37.700267-30.5664 68.266667-68.266666 68.266667H233.244444c-37.700267 0-68.266667-30.5664-68.266666-68.266667V142.222222c0-37.700267 30.5664-68.266667 68.266666-68.266666h356.977778z m-11.764622 28.444444H233.244444a39.822222 39.822222 0 0 0-39.799466 38.456889L193.422222 142.222222v733.866667a39.822222 39.822222 0 0 0 38.456889 39.799467L233.244444 915.911111h557.511112a39.822222 39.822222 0 0 0 39.799466-38.456889L830.577778 876.088889V354.053689L578.4576 102.4z' fill='%2320B2AA' /%3e%3cpath d='M854.755556 370.648178h-215.1424c-45.528178 0-82.551467-36.431644-83.5072-81.737956l-0.017067-1.792V73.955556h28.444444v213.162666c0 29.895111 23.819378 54.232178 53.515378 55.062756l1.564445 0.022755h215.1424v28.444445z' fill='%2320B2AA' /%3e%3cpath d='M56.888889 489.244444m28.444444 0l853.333334 0q28.444444 0 28.444444 28.444445l0 284.444444q0 28.444444-28.444444 28.444445l-853.333334 0q-28.444444 0-28.444444-28.444445l0-284.444444q0-28.444444 28.444444-28.444445Z' fill='%2320B2AA' /%3e%3cpath d='M366.563556 756.622222v-65.28c0-18.944-3.584-47.36-5.888-66.048h1.024l15.36 45.568 25.856 69.632h25.088l25.6-69.632 15.872-45.568h1.28c-2.56 18.688-6.144 47.104-6.144 66.048V756.622222h41.728V565.902222h-49.664l-29.184 82.432c-3.584 11.008-6.656 23.04-10.496 34.56h-1.28c-3.584-11.52-6.656-23.552-10.496-34.56l-30.208-82.432h-49.408V756.622222h40.96z m240.896 0c55.552 0 93.952-29.952 93.952-96.256 0-66.304-38.4-94.464-96.512-94.464H550.115556V756.622222h57.344z m-5.376-36.864h-6.144v-117.248h6.144c30.72 0 52.48 12.544 52.48 57.856s-21.76 59.392-52.48 59.392z' fill='white' /%3e%3c/svg%3e";export{a as ReactComponent,s as default};
@@ -1 +0,0 @@
1
- import*as h from"react";var t,e,c;function a(){return a=Object.assign?Object.assign.bind():function(h){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var c in e)Object.prototype.hasOwnProperty.call(e,c)&&(h[c]=e[c])}return h},a.apply(this,arguments)}const l=l=>h.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",width:200,height:200,className:"pdf_svg__icon",viewBox:"0 0 1024 1024"},l),t||(t=h.createElement("path",{fill:"#FF7875",d:"m590.222 79.644 268.8 268.3v533.834c0 37.7-30.566 68.266-68.266 68.266H233.244c-37.7 0-68.266-30.566-68.266-68.266V147.91c0-37.7 30.566-68.267 68.266-68.267zm-11.764 28.445H233.244a39.82 39.82 0 0 0-39.799 38.457l-.023 1.365v733.867a39.82 39.82 0 0 0 38.457 39.8l1.365.022h557.512a39.82 39.82 0 0 0 39.799-38.457l.023-1.365V359.743z"})),e||(e=h.createElement("path",{fill:"#FF7875",d:"M854.756 376.337H639.613c-45.528 0-82.551-36.432-83.507-81.738l-.017-1.792V79.644h28.444v213.163c0 29.895 23.82 54.232 53.516 55.063l1.564.023h215.143zM85.333 494.933h853.334q28.444 0 28.444 28.445v284.444q0 28.445-28.444 28.445H85.333q-28.444 0-28.444-28.445V523.378q0-28.445 28.444-28.445"})),c||(c=h.createElement("path",{fill:"#FFF",d:"M318.436 762.311V699.08h22.272c40.448 0 75.264-19.968 75.264-65.28 0-47.104-34.56-62.208-76.288-62.208h-67.072v190.72zm19.968-99.328h-19.968v-55.04h18.688c22.016 0 34.304 6.656 34.304 25.856 0 18.688-10.752 29.184-33.024 29.184m167.424 99.328c55.552 0 93.952-29.952 93.952-96.256s-38.4-94.464-96.512-94.464h-54.784v190.72zm-5.376-36.864h-6.144V608.2h6.144c30.72 0 52.48 12.544 52.48 57.856s-21.76 59.392-52.48 59.392m180.48 36.864v-72.704h65.024v-38.144h-65.024v-41.728h75.776v-38.144h-121.6v190.72z"})));var v="data:image/svg+xml,%3c%3fxml version='1.0' standalone='no'%3f%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg class='icon' width='200px' height='200.00px' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M590.222222 79.644444L859.022222 347.943822V881.777778c0 37.700267-30.5664 68.266667-68.266666 68.266666H233.244444c-37.700267 0-68.266667-30.5664-68.266666-68.266666V147.911111c0-37.700267 30.5664-68.266667 68.266666-68.266667h356.977778z m-11.764622 28.444445H233.244444a39.822222 39.822222 0 0 0-39.799466 38.456889L193.422222 147.911111v733.866667a39.822222 39.822222 0 0 0 38.456889 39.799466L233.244444 921.6h557.511112a39.822222 39.822222 0 0 0 39.799466-38.456889L830.577778 881.777778V359.742578L578.4576 108.088889z' fill='%23FF7875' /%3e%3cpath d='M854.755556 376.337067h-215.1424c-45.528178 0-82.551467-36.431644-83.5072-81.737956l-0.017067-1.792V79.644444h28.444444v213.162667c0 29.895111 23.819378 54.232178 53.515378 55.062756l1.564445 0.022755h215.1424v28.444445z' fill='%23FF7875' /%3e%3cpath d='M56.888889 494.933333m28.444444 0l853.333334 0q28.444444 0 28.444444 28.444445l0 284.444444q0 28.444444-28.444444 28.444445l-853.333334 0q-28.444444 0-28.444444-28.444445l0-284.444444q0-28.444444 28.444444-28.444445Z' fill='%23FF7875' /%3e%3cpath d='M318.435556 762.311111v-63.232h22.272c40.448 0 75.264-19.968 75.264-65.28 0-47.104-34.56-62.208-76.288-62.208H272.611556V762.311111h45.824z m19.968-99.328h-19.968v-55.04h18.688c22.016 0 34.304 6.656 34.304 25.856 0 18.688-10.752 29.184-33.024 29.184zM505.827556 762.311111c55.552 0 93.952-29.952 93.952-96.256 0-66.304-38.4-94.464-96.512-94.464h-54.784V762.311111h57.344z m-5.376-36.864h-6.144v-117.248h6.144c30.72 0 52.48 12.544 52.48 57.856s-21.76 59.392-52.48 59.392z m180.48 36.864v-72.704h65.024v-38.144h-65.024v-41.728h75.776v-38.144H635.107556V762.311111h45.824z' fill='white' /%3e%3c/svg%3e";export{l as ReactComponent,v as default};
@@ -1 +0,0 @@
1
- import*as h from"react";var c,t,e;function l(){return l=Object.assign?Object.assign.bind():function(h){for(var c=1;c<arguments.length;c++){var t=arguments[c];for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(h[e]=t[e])}return h},l.apply(this,arguments)}const a=a=>h.createElement("svg",l({xmlns:"http://www.w3.org/2000/svg",width:200,height:200,className:"png_svg__icon",viewBox:"0 0 1024 1024"},a),c||(c=h.createElement("path",{fill:"#0075D5",d:"m590.222 73.956 268.8 268.299v533.834c0 37.7-30.566 68.267-68.266 68.267H233.244c-37.7 0-68.266-30.567-68.266-68.267V142.222c0-37.7 30.566-68.266 68.266-68.266zM578.458 102.4H233.244a39.82 39.82 0 0 0-39.799 38.457l-.023 1.365V876.09a39.82 39.82 0 0 0 38.457 39.8l1.365.022h557.512a39.82 39.82 0 0 0 39.799-38.457l.023-1.365V354.054z"})),t||(t=h.createElement("path",{fill:"#0075D5",d:"M854.756 370.648H639.613c-45.528 0-82.551-36.431-83.507-81.738l-.017-1.792V73.956h28.444v213.162c0 29.895 23.82 54.232 53.516 55.063l1.564.023h215.143zM85.333 506.311h853.334q28.444 0 28.444 28.445V819.2q0 28.444-28.444 28.444H85.333q-28.444 0-28.444-28.444V534.756q0-28.445 28.444-28.445"})),e||(e=h.createElement("path",{fill:"#FFF",d:"M251.62 762.311h45.824V699.08h22.272c40.448 0 75.264-19.968 75.264-65.28 0-47.104-34.56-62.208-76.288-62.208H251.62zm45.824-99.328v-55.04h18.688c22.016 0 34.304 6.656 34.304 25.856 0 18.688-10.752 29.184-33.024 29.184zm130.048 99.328h43.52V699.08c0-23.04-3.84-49.152-5.888-70.4h1.28l18.688 41.728 47.104 91.904h46.592v-190.72h-43.52v63.232c0 22.784 3.84 50.176 6.144 70.4h-1.28l-18.688-42.24-47.36-91.392h-46.592zm281.344 3.584c26.624 0 50.176-10.496 63.488-23.296v-89.088h-70.912v37.376h30.208v30.72c-4.096 3.072-11.264 4.864-17.92 4.864-35.584 0-52.48-22.016-52.48-59.904 0-37.12 20.224-59.136 48.384-59.136 15.872 0 25.856 6.4 35.328 14.848l24.064-29.184c-13.056-13.056-33.024-24.832-60.928-24.832-50.944 0-93.696 36.352-93.696 99.84 0 64.512 41.728 97.792 94.464 97.792"})));var v="data:image/svg+xml,%3c%3fxml version='1.0' standalone='no'%3f%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg class='icon' width='200px' height='200.00px' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M590.222222 73.955556L859.022222 342.254933V876.088889c0 37.700267-30.5664 68.266667-68.266666 68.266667H233.244444c-37.700267 0-68.266667-30.5664-68.266666-68.266667V142.222222c0-37.700267 30.5664-68.266667 68.266666-68.266666h356.977778z m-11.764622 28.444444H233.244444a39.822222 39.822222 0 0 0-39.799466 38.456889L193.422222 142.222222v733.866667a39.822222 39.822222 0 0 0 38.456889 39.799467L233.244444 915.911111h557.511112a39.822222 39.822222 0 0 0 39.799466-38.456889L830.577778 876.088889V354.053689L578.4576 102.4z' fill='%230075D5' /%3e%3cpath d='M854.755556 370.648178h-215.1424c-45.528178 0-82.551467-36.431644-83.5072-81.737956l-0.017067-1.792V73.955556h28.444444v213.162666c0 29.895111 23.819378 54.232178 53.515378 55.062756l1.564445 0.022755h215.1424v28.444445z' fill='%230075D5' /%3e%3cpath d='M56.888889 506.311111m28.444444 0l853.333334 0q28.444444 0 28.444444 28.444445l0 284.444444q0 28.444444-28.444444 28.444444l-853.333334 0q-28.444444 0-28.444444-28.444444l0-284.444444q0-28.444444 28.444444-28.444445Z' fill='%230075D5' /%3e%3cpath d='M251.619556 762.311111h45.824v-63.232H319.715556c40.448 0 75.264-19.968 75.264-65.28 0-47.104-34.56-62.208-76.288-62.208H251.619556V762.311111z m45.824-99.328v-55.04h18.688c22.016 0 34.304 6.656 34.304 25.856 0 18.688-10.752 29.184-33.024 29.184h-19.968zM427.491556 762.311111h43.52v-63.232c0-23.04-3.84-49.152-5.888-70.4h1.28l18.688 41.728L532.195556 762.311111h46.592v-190.72h-43.52v63.232c0 22.784 3.84 50.176 6.144 70.4h-1.28l-18.688-42.24-47.36-91.392h-46.592V762.311111zM708.835556 765.895111c26.624 0 50.176-10.496 63.488-23.296v-89.088h-70.912v37.376h30.208v30.72c-4.096 3.072-11.264 4.864-17.92 4.864-35.584 0-52.48-22.016-52.48-59.904 0-37.12 20.224-59.136 48.384-59.136 15.872 0 25.856 6.4 35.328 14.848l24.064-29.184c-13.056-13.056-33.024-24.832-60.928-24.832-50.944 0-93.696 36.352-93.696 99.84 0 64.512 41.728 97.792 94.464 97.792z' fill='white' /%3e%3c/svg%3e";export{a as ReactComponent,v as default};
@@ -1 +0,0 @@
1
- import*as h from"react";var t,e,c;function a(){return a=Object.assign?Object.assign.bind():function(h){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var c in e)Object.prototype.hasOwnProperty.call(e,c)&&(h[c]=e[c])}return h},a.apply(this,arguments)}const l=l=>h.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",width:200,height:200,className:"pptx_svg__icon",viewBox:"0 0 1024 1024"},l),t||(t=h.createElement("path",{fill:"#FF7A45",d:"m590.222 73.956 268.8 268.299v533.834c0 37.7-30.566 68.267-68.266 68.267H233.244c-37.7 0-68.266-30.567-68.266-68.267V142.222c0-37.7 30.566-68.266 68.266-68.266zM578.458 102.4H233.244a39.82 39.82 0 0 0-39.799 38.457l-.023 1.365V876.09a39.82 39.82 0 0 0 38.457 39.8l1.365.022h557.512a39.82 39.82 0 0 0 39.799-38.457l.023-1.365V354.054z"})),e||(e=h.createElement("path",{fill:"#FF7A45",d:"M854.756 370.648H639.613c-45.528 0-82.551-36.431-83.507-81.738l-.017-1.792V73.956h28.444v213.162c0 29.895 23.82 54.232 53.516 55.063l1.564.023h215.143zM85.333 489.244h853.334q28.444 0 28.444 28.445v284.444q0 28.445-28.444 28.445H85.333q-28.444 0-28.444-28.445V517.69q0-28.445 28.444-28.445"})),c||(c=h.createElement("path",{fill:"#FFF",d:"M313.515 756.622V693.39h22.272c40.448 0 75.264-19.968 75.264-65.28 0-47.104-34.56-62.208-76.288-62.208H267.69v190.72zm19.968-99.328h-19.968v-55.04h18.688c22.016 0 34.304 6.656 34.304 25.856 0 18.688-10.752 29.184-33.024 29.184m155.904 99.328V693.39h22.272c40.448 0 75.264-19.968 75.264-65.28 0-47.104-34.56-62.208-76.288-62.208h-67.072v190.72zm19.968-99.328h-19.968v-55.04h18.688c22.016 0 34.304 6.656 34.304 25.856 0 18.688-10.752 29.184-33.024 29.184m192.768 99.328V604.046h51.712v-38.144H604.843v38.144h51.456v152.576z"})));var v="data:image/svg+xml,%3c%3fxml version='1.0' standalone='no'%3f%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg class='icon' width='200px' height='200.00px' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M590.222222 73.955556L859.022222 342.254933V876.088889c0 37.700267-30.5664 68.266667-68.266666 68.266667H233.244444c-37.700267 0-68.266667-30.5664-68.266666-68.266667V142.222222c0-37.700267 30.5664-68.266667 68.266666-68.266666h356.977778z m-11.764622 28.444444H233.244444a39.822222 39.822222 0 0 0-39.799466 38.456889L193.422222 142.222222v733.866667a39.822222 39.822222 0 0 0 38.456889 39.799467L233.244444 915.911111h557.511112a39.822222 39.822222 0 0 0 39.799466-38.456889L830.577778 876.088889V354.053689L578.4576 102.4z' fill='%23FF7A45' /%3e%3cpath d='M854.755556 370.648178h-215.1424c-45.528178 0-82.551467-36.431644-83.5072-81.737956l-0.017067-1.792V73.955556h28.444444v213.162666c0 29.895111 23.819378 54.232178 53.515378 55.062756l1.564445 0.022755h215.1424v28.444445z' fill='%23FF7A45' /%3e%3cpath d='M56.888889 489.244444m28.444444 0l853.333334 0q28.444444 0 28.444444 28.444445l0 284.444444q0 28.444444-28.444444 28.444445l-853.333334 0q-28.444444 0-28.444444-28.444445l0-284.444444q0-28.444444 28.444444-28.444445Z' fill='%23FF7A45' /%3e%3cpath d='M313.514667 756.622222v-63.232h22.272c40.448 0 75.264-19.968 75.264-65.28 0-47.104-34.56-62.208-76.288-62.208h-67.072V756.622222h45.824z m19.968-99.328h-19.968v-55.04h18.688c22.016 0 34.304 6.656 34.304 25.856 0 18.688-10.752 29.184-33.024 29.184zM489.386667 756.622222v-63.232h22.272c40.448 0 75.264-19.968 75.264-65.28 0-47.104-34.56-62.208-76.288-62.208H443.562667V756.622222h45.824z m19.968-99.328h-19.968v-55.04h18.688c22.016 0 34.304 6.656 34.304 25.856 0 18.688-10.752 29.184-33.024 29.184zM702.122667 756.622222v-152.576h51.712v-38.144h-148.992v38.144h51.456V756.622222h45.824z' fill='white' /%3e%3c/svg%3e";export{l as ReactComponent,v as default};
@@ -1 +0,0 @@
1
- import*as h from"react";var l,t,e;function a(){return a=Object.assign?Object.assign.bind():function(h){for(var l=1;l<arguments.length;l++){var t=arguments[l];for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(h[e]=t[e])}return h},a.apply(this,arguments)}const c=c=>h.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",width:200,height:200,className:"txt_svg__icon",viewBox:"0 0 1024 1024"},c),l||(l=h.createElement("path",{fill:"#91D5FF",d:"m590.222 73.956 268.8 268.299v533.834c0 37.7-30.566 68.267-68.266 68.267H233.244c-37.7 0-68.266-30.567-68.266-68.267V142.222c0-37.7 30.566-68.266 68.266-68.266zM578.458 102.4H233.244a39.82 39.82 0 0 0-39.799 38.457l-.023 1.365V876.09a39.82 39.82 0 0 0 38.457 39.8l1.365.022h557.512a39.82 39.82 0 0 0 39.799-38.457l.023-1.365V354.054z"})),t||(t=h.createElement("path",{fill:"#91D5FF",d:"M854.756 370.648H639.613c-45.528 0-82.551-36.431-83.507-81.738l-.017-1.792V73.956h28.444v213.162c0 29.895 23.82 54.232 53.516 55.063l1.564.023h215.143zM85.333 489.244h853.334q28.444 0 28.444 28.445v284.444q0 28.445-28.444 28.445H85.333q-28.444 0-28.444-28.445V517.69q0-28.445 28.444-28.445"})),e||(e=h.createElement("path",{fill:"#FFF",d:"M371.615 756.622V604.046h51.712v-38.144H274.335v38.144h51.45v152.576zm111.104 0 16.384-37.12c4.347-9.984 8.704-19.968 13.05-31.744h1.025c5.12 11.776 9.477 21.76 14.085 31.744l17.659 37.12h50.95l-52.48-96 49.151-94.72H544.16l-13.824 34.304a503 503 0 0 0-12.288 31.232h-1.024c-5.376-12.288-9.472-22.272-13.824-31.232l-15.36-34.304h-50.95l49.414 92.672-52.224 98.048zm220.928 0V604.046h51.712v-38.144H606.367v38.144h51.45v152.576h45.825z"})));var v="data:image/svg+xml,%3c%3fxml version='1.0' standalone='no'%3f%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg class='icon' width='200px' height='200.00px' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M590.222222 73.955556L859.022222 342.254933V876.088889c0 37.700267-30.5664 68.266667-68.266666 68.266667H233.244444c-37.700267 0-68.266667-30.5664-68.266666-68.266667V142.222222c0-37.700267 30.5664-68.266667 68.266666-68.266666h356.977778z m-11.764622 28.444444H233.244444a39.822222 39.822222 0 0 0-39.799466 38.456889L193.422222 142.222222v733.866667a39.822222 39.822222 0 0 0 38.456889 39.799467L233.244444 915.911111h557.511112a39.822222 39.822222 0 0 0 39.799466-38.456889L830.577778 876.088889V354.053689L578.4576 102.4z' fill='%2391D5FF' /%3e%3cpath d='M854.755556 370.648178h-215.1424c-45.528178 0-82.551467-36.431644-83.5072-81.737956l-0.017067-1.792V73.955556h28.444444v213.162666c0 29.895111 23.819378 54.232178 53.515378 55.062756l1.564445 0.022755h215.1424v28.444445z' fill='%2391D5FF' /%3e%3cpath d='M56.888889 489.244444m28.444444 0l853.333334 0q28.444444 0 28.444444 28.444445l0 284.444444q0 28.444444-28.444444 28.444445l-853.333334 0q-28.444444 0-28.444444-28.444445l0-284.444444q0-28.444444 28.444444-28.444445Z' fill='%2391D5FF' /%3e%3cpath d='M371.615289 756.622222v-152.576h51.712v-38.144h-148.992v38.144h51.450311V756.622222h45.829689z m111.104 0l16.384-37.12c4.346311-9.984 8.704-19.968 13.050311-31.744h1.024c5.12 11.776 9.477689 21.76 14.085689 31.744L544.9216 756.622222h50.949689l-52.48-96 49.152-94.72h-48.384l-13.824 34.304a503.443911 503.443911 0 0 0-12.288 31.232h-1.024c-5.376-12.288-9.472-22.272-13.824-31.232l-15.36-34.304h-50.949689l49.413689 92.672L434.079289 756.622222h48.64z m220.928 0v-152.576h51.712v-38.144h-148.992v38.144h51.450311V756.622222h45.824z' fill='white' /%3e%3c/svg%3e";export{c as ReactComponent,v as default};
@@ -1 +0,0 @@
1
- import*as l from"react";var c,t,e;function a(){return a=Object.assign?Object.assign.bind():function(l){for(var c=1;c<arguments.length;c++){var t=arguments[c];for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(l[e]=t[e])}return l},a.apply(this,arguments)}const h=h=>l.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",width:200,height:200,className:"xlsx_svg__icon",viewBox:"0 0 1024 1024"},h),c||(c=l.createElement("path",{fill:"#73D13D",d:"m590.222 73.956 268.8 268.299v533.834c0 37.7-30.566 68.267-68.266 68.267H233.244c-37.7 0-68.266-30.567-68.266-68.267V142.222c0-37.7 30.566-68.266 68.266-68.266zM578.458 102.4H233.244a39.82 39.82 0 0 0-39.799 38.457l-.023 1.365V876.09a39.82 39.82 0 0 0 38.457 39.8l1.365.022h557.512a39.82 39.82 0 0 0 39.799-38.457l.023-1.365V354.054z"})),t||(t=l.createElement("path",{fill:"#73D13D",d:"M854.756 370.648H639.613c-45.528 0-82.551-36.431-83.507-81.738l-.017-1.792V73.956h28.444v213.162c0 29.895 23.82 54.232 53.516 55.063l1.564.023h215.143zM85.333 489.244h853.334q28.444 0 28.444 28.445v284.444q0 28.445-28.444 28.445H85.333q-28.444 0-28.444-28.445V517.69q0-28.445 28.444-28.445"})),e||(e=l.createElement("path",{fill:"#FFF",d:"m327.225 756.622 16.384-37.12c4.352-9.984 8.704-19.968 13.056-31.744h1.024c5.12 11.776 9.472 21.76 14.08 31.744l17.664 37.12h50.944l-52.48-96 49.152-94.72h-48.384l-13.824 34.304a503 503 0 0 0-12.288 31.232h-1.024c-5.376-12.288-9.472-22.272-13.824-31.232l-15.36-34.304H281.4l49.408 92.672-52.224 98.048zm258.304 0v-38.4h-74.24v-152.32h-45.824v190.72zm92.16 3.584c46.08 0 72.704-27.904 72.704-59.648 0-26.88-14.08-42.752-37.632-52.224l-23.808-9.472c-16.896-6.656-28.672-10.752-28.672-21.504 0-9.984 8.448-15.616 22.528-15.616 14.848 0 26.624 5.12 39.168 14.592l22.784-28.672c-16.64-16.64-39.936-25.088-61.952-25.088-40.448 0-69.12 25.6-69.12 57.6 0 27.648 18.688 44.288 38.656 52.224l24.32 10.24c16.384 6.912 26.88 10.496 26.88 21.504 0 10.24-7.936 16.64-24.832 16.64-15.104 0-32.768-7.936-46.08-19.456l-26.112 31.488c19.712 18.176 46.336 27.392 71.168 27.392"})));var s="data:image/svg+xml,%3c%3fxml version='1.0' standalone='no'%3f%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg class='icon' width='200px' height='200.00px' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M590.222222 73.955556L859.022222 342.254933V876.088889c0 37.700267-30.5664 68.266667-68.266666 68.266667H233.244444c-37.700267 0-68.266667-30.5664-68.266666-68.266667V142.222222c0-37.700267 30.5664-68.266667 68.266666-68.266666h356.977778z m-11.764622 28.444444H233.244444a39.822222 39.822222 0 0 0-39.799466 38.456889L193.422222 142.222222v733.866667a39.822222 39.822222 0 0 0 38.456889 39.799467L233.244444 915.911111h557.511112a39.822222 39.822222 0 0 0 39.799466-38.456889L830.577778 876.088889V354.053689L578.4576 102.4z' fill='%2373D13D' /%3e%3cpath d='M854.755556 370.648178h-215.1424c-45.528178 0-82.551467-36.431644-83.5072-81.737956l-0.017067-1.792V73.955556h28.444444v213.162666c0 29.895111 23.819378 54.232178 53.515378 55.062756l1.564445 0.022755h215.1424v28.444445z' fill='%2373D13D' /%3e%3cpath d='M56.888889 489.244444m28.444444 0l853.333334 0q28.444444 0 28.444444 28.444445l0 284.444444q0 28.444444-28.444444 28.444445l-853.333334 0q-28.444444 0-28.444444-28.444445l0-284.444444q0-28.444444 28.444444-28.444445Z' fill='%2373D13D' /%3e%3cpath d='M327.224889 756.622222l16.384-37.12c4.352-9.984 8.704-19.968 13.056-31.744h1.024c5.12 11.776 9.472 21.76 14.08 31.744L389.432889 756.622222h50.944l-52.48-96 49.152-94.72H388.664889l-13.824 34.304a503.443911 503.443911 0 0 0-12.288 31.232h-1.024c-5.376-12.288-9.472-22.272-13.824-31.232l-15.36-34.304h-50.944l49.408 92.672L278.584889 756.622222h48.64z m258.304 0v-38.4h-74.24V565.902222H465.464889V756.622222h120.064z m92.16 3.584c46.08 0 72.704-27.904 72.704-59.648 0-26.88-14.08-42.752-37.632-52.224l-23.808-9.472c-16.896-6.656-28.672-10.752-28.672-21.504 0-9.984 8.448-15.616 22.528-15.616 14.848 0 26.624 5.12 39.168 14.592l22.784-28.672c-16.64-16.64-39.936-25.088-61.952-25.088-40.448 0-69.12 25.6-69.12 57.6 0 27.648 18.688 44.288 38.656 52.224l24.32 10.24c16.384 6.912 26.88 10.496 26.88 21.504 0 10.24-7.936 16.64-24.832 16.64-15.104 0-32.768-7.936-46.08-19.456l-26.112 31.488c19.712 18.176 46.336 27.392 71.168 27.392z' fill='white' /%3e%3c/svg%3e";export{h as ReactComponent,s as default};