@topthink/chat 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/docx-nWXnlyT_.js +1 -0
- package/es/index.js +576 -0
- package/es/jpg-6tBxSzWk.js +1 -0
- package/es/md-GZ3HJPcw.js +1 -0
- package/es/pdf-pVX1_E6T.js +1 -0
- package/es/png-u0o1NMqQ.js +1 -0
- package/es/pptx-Hprz0cON.js +1 -0
- package/es/txt-eHeCpvNO.js +1 -0
- package/es/xlsx-uOft-SV2.js +1 -0
- package/package.json +59 -0
- package/types/components/lightbox/Image.d.ts +2 -0
- package/types/components/lightbox/index.d.ts +16 -0
- package/types/components/markdown.d.ts +9 -0
- package/types/components/message-box/file-item.d.ts +11 -0
- package/types/components/message-box/image-item.d.ts +2 -0
- package/types/components/message-box/index.d.ts +13 -0
- package/types/components/message-box/input-box.d.ts +11 -0
- package/types/components/message-box/message-item.d.ts +9 -0
- package/types/components/message-box/tool.d.ts +6 -0
- package/types/constants.d.ts +1 -0
- package/types/hooks/use-chat.d.ts +21 -0
- package/types/index.d.ts +3 -0
- package/types/types.d.ts +34 -0
|
@@ -0,0 +1 @@
|
|
|
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};
|
package/es/index.js
ADDED
|
@@ -0,0 +1,576 @@
|
|
|
1
|
+
import*as e from"react";import{useCallback as t,useState as r,useEffect as o,useImperativeHandle as n,createContext as i,useContext as s,memo as a,useRef as l,Fragment as c}from"react";import{useImmer as d,request as h,isRequestError as m,styled as p,Clipboard as g,css as u,formatSize as f,Tooltip as b,useAsync as v,isImageUrl as x,getAbsoluteUrl as y}from"@topthink/components";import{jsxs as w,jsx as k,Fragment as j}from"react/jsx-runtime";import N from"yet-another-react-lightbox";import z from"yet-another-react-lightbox/plugins/counter";import M from"yet-another-react-lightbox/plugins/download";import C from"yet-another-react-lightbox/plugins/zoom";import"yet-another-react-lightbox/styles.css";import"yet-another-react-lightbox/plugins/counter.css";import E from"react-markdown";import"katex/dist/katex.min.css";import q from"remark-math";import $ from"remark-breaks";import O from"remark-gfm";import P from"rehype-katex";import F from"rehype-highlight";import{Spinner as T}from"react-bootstrap";import*as _ from"path";import D from"path";import R from"react-textarea-autosize";function S(e){let{url:i,transformRequest:s,onboarding:a,onSuccess:l,ref:c,...p}=e;const g=t((function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=[];if(a){let e=a.questions.filter((e=>!!e.trim()));if(e.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}t.push({chunks:[{content:[a.prologue,...e.map((e=>`[${e}](#!question)`))].join("\n"),tools:[]}]})}return p.messages&&e?t.concat(p.messages):t}),[a,p.messages]),[u,f]=d(g),[b,v]=r(!1),[x,y]=r(p.conversation);o((()=>{x||f(g(!1))}),[x]);const w=t((async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(e||t.length>0){v(!0),f((r=>{r.push({query:e,files:t,chunks:[],loading:!0})}));let r=0,o="";try{await h({method:"post",url:i,data:{query:e,files:t,conversation:x},transformRequest:s,onDownloadProgress:e=>{const t=e.target,{responseText:n}=t;for(;r<e.loaded;){const e=n.substring(r,++r);if(o+=e,"\n"===e){const e=o.match(/^data:(?<data>.*)/);if(e){const t=e.groups.data.trim();if("[DONE]"!=t)try{const e=JSON.parse(t);e.conversation?y(e.conversation):f((t=>{const r=t[t.length-1];if(r.chunks)if(e.chunks){const t=e.chunks.index;if(r.chunks[t]||(r.chunks[t]={content:"",tools:[]}),e.chunks.error)r.chunks[t].error=e.chunks.error;else if(e.chunks.tools){const o=e.chunks.tools.index;"response"in e.chunks.tools?(r.chunks[t].tools[o].response=e.chunks.tools.response,r.chunks[t].tools[o].error=e.chunks.tools.error):"content"in e.chunks.tools?r.chunks[t].tools[o].content=e.chunks.tools.content:r.chunks[t].tools[o]={name:e.chunks.tools.name,title:e.chunks.tools.title,arguments:e.chunks.tools.arguments}}else e.chunks.content&&(r.chunks[t].content+=e.chunks.content)}else e.stats&&(r.stats=e.stats)}))}catch(e){console.error(e)}else f((e=>{e[e.length-1].loading=!1}))}o=""}}}})}catch(e){let t="未知错误";m(e)&&(t=401==e.response?.status?"未授权或授权已过期,请刷新页面后重试":"string"==typeof e.errors?e.errors:Object.values(e.errors).join("\n")),f((e=>{const r=e[e.length-1];r.chunks&&(0===r.chunks.length?r.chunks=[{content:`[${t}]`,tools:[]}]:r.chunks[r.chunks.length-1].content=`[${t}]`),r.loading=!1}))}v(!1),l?.()}}),[s,x]),k=t((()=>{b||(y(void 0),f(g(!1)))}),[b,g]);return n(c,(()=>({reset:k,send:w}))),{messages:u,loading:b,send:w,reset:k}}const A=i({images:new Map,current:0,setCurrent:()=>null,setShow:()=>null,registerImage:()=>()=>null});function B(e){let{children:o}=e;const[n,i]=r((()=>new Map)),[s,a]=r(),[l,c]=r(!1),d=t(((e,t)=>(i((r=>new Map(r).set(e,t))),()=>{i((t=>{const r=new Map(t);return r.delete(e)?r:t}))})),[]),h=Array.from(n.keys()),m=h.indexOf(s),p=h.map((e=>({src:n.get(e)})));return w(A.Provider,{value:{images:n,current:s,setCurrent:a,setShow:c,registerImage:d},children:[o,k(N,{styles:{container:{backgroundColor:"rgba(0, 0, 0, .7)"}},plugins:[z,M,C],open:l,index:m,close:()=>c(!1),slides:p,render:{buttonPrev:p.length<=1?()=>null:void 0,buttonNext:p.length<=1?()=>null:void 0},controller:{closeOnBackdropClick:!0}})]})}let I=0;function U(e){const{registerImage:t,setShow:n,setCurrent:i}=s(A),[a]=r((()=>(I+=1,I)));return o((()=>{if(e.src)return t(a,e.src)}),[]),k("img",{...e,onClick:()=>{i(a),n(!0)}})}const L=a((e=>{let{content:t,components:r}=e;return k(X,{remarkPlugins:[[q,{singleDollarTextMath:!1}],O,$],rehypePlugins:[P,[F,{detect:!1,ignoreMissing:!0}]],components:{pre:e=>{let{children:t}=e;const r=l(null);return w(K,{ref:r,children:[k(H,{tooltip:!1,content:()=>{const e=r.current?.getElementsByTagName("code");return e?.[0]?.innerText||""}}),t]})},a:e=>{let{node:t,href:r,...o}=e;const n=r?.startsWith("http")?"_blank":"_self";return k("a",{...o,href:r,target:n})},img:e=>{let{node:t,...r}=e;return k(U,{...r})},...r},children:t})})),H=p(g)`
|
|
2
|
+
position: absolute;
|
|
3
|
+
right: 10px;
|
|
4
|
+
top: 1em;
|
|
5
|
+
cursor: pointer;
|
|
6
|
+
padding: 2px 10px;
|
|
7
|
+
background-color: #303030;
|
|
8
|
+
color: #fff;
|
|
9
|
+
border: 1px solid #dedede;
|
|
10
|
+
border-radius: 15px;
|
|
11
|
+
transform: translateX(10px);
|
|
12
|
+
pointer-events: none;
|
|
13
|
+
opacity: 0;
|
|
14
|
+
transition: all ease 0.3s;
|
|
15
|
+
font-size: 12px;
|
|
16
|
+
font-family: initial;
|
|
17
|
+
|
|
18
|
+
&:hover {
|
|
19
|
+
opacity: 1;
|
|
20
|
+
}
|
|
21
|
+
`,K=p.pre`
|
|
22
|
+
position: relative;
|
|
23
|
+
|
|
24
|
+
&:hover {
|
|
25
|
+
${H} {
|
|
26
|
+
pointer-events: all;
|
|
27
|
+
transform: translateX(0px);
|
|
28
|
+
opacity: 0.5;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
`,X=p(E)`
|
|
32
|
+
-ms-text-size-adjust: 100%;
|
|
33
|
+
-webkit-text-size-adjust: 100%;
|
|
34
|
+
line-height: 1.8;
|
|
35
|
+
word-wrap: break-word;
|
|
36
|
+
margin-bottom: .5rem;
|
|
37
|
+
|
|
38
|
+
&:last-child {
|
|
39
|
+
margin-bottom: 0 !important;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
& > *:first-child {
|
|
43
|
+
margin-top: 0 !important;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
& > *:last-child {
|
|
47
|
+
margin-bottom: 0 !important;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
h1, h2, h3, h4, h5, h6, p, ul, ol, li, hr, blockquote, pre, table, audio, video, p {
|
|
51
|
+
margin: .5em 0;
|
|
52
|
+
padding: 0;
|
|
53
|
+
|
|
54
|
+
&:first-child {
|
|
55
|
+
margin-bottom: 0 !important;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&:last-child {
|
|
59
|
+
margin-bottom: 0 !important;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
h1, h2, h3, h4, h5, h6 {
|
|
64
|
+
font-weight: normal;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
h1 {
|
|
68
|
+
font-size: 2em;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
h2 {
|
|
72
|
+
font-size: 1.5em;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
h3 {
|
|
76
|
+
font-size: 1.3em;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
h4 {
|
|
80
|
+
font-size: 1.15em;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
h5 {
|
|
84
|
+
font-size: 1em;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
hr {
|
|
88
|
+
border: 0;
|
|
89
|
+
border-bottom: 1px solid #b4b4b4;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
ul, ol {
|
|
93
|
+
padding-left: 1.5em;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
code {
|
|
97
|
+
display: inline-block;
|
|
98
|
+
border-radius: 4px;
|
|
99
|
+
padding: .2em .4em;
|
|
100
|
+
background-color: #e1e1e1;
|
|
101
|
+
word-break: break-all;
|
|
102
|
+
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
|
103
|
+
white-space: pre;
|
|
104
|
+
line-height: 1.3;
|
|
105
|
+
color: inherit;
|
|
106
|
+
font-size: inherit;
|
|
107
|
+
margin: -.2em .4em;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
pre {
|
|
111
|
+
padding: 1.05em;
|
|
112
|
+
overflow: auto;
|
|
113
|
+
line-height: 1.45;
|
|
114
|
+
background-color: #f7f7f7;
|
|
115
|
+
border: 0;
|
|
116
|
+
border-radius: 3px;
|
|
117
|
+
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
|
118
|
+
font-size: inherit;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
pre > code {
|
|
123
|
+
display: inline;
|
|
124
|
+
max-width: 100%;
|
|
125
|
+
padding: 0;
|
|
126
|
+
margin: 0;
|
|
127
|
+
overflow: initial;
|
|
128
|
+
line-height: inherit;
|
|
129
|
+
background-color: rgba(0, 0, 0, 0);
|
|
130
|
+
border: 0;
|
|
131
|
+
tab-size: 4;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
table {
|
|
135
|
+
border-collapse: collapse;
|
|
136
|
+
table-layout: fixed;
|
|
137
|
+
width: 100%;
|
|
138
|
+
line-height: 1.8;
|
|
139
|
+
border-spacing: 0;
|
|
140
|
+
|
|
141
|
+
th {
|
|
142
|
+
text-align: left;
|
|
143
|
+
|
|
144
|
+
&[align='center'] {
|
|
145
|
+
text-align: center;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&[align='right'] {
|
|
149
|
+
text-align: right;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
th, td {
|
|
154
|
+
border: 1px solid #e0e0e0;
|
|
155
|
+
padding: 3px 12px;
|
|
156
|
+
height: 34px;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
tr:hover td {
|
|
160
|
+
background-color: #f1f1f1;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
img {
|
|
165
|
+
max-width: 250px;
|
|
166
|
+
max-height: 250px;
|
|
167
|
+
display: inline-block;
|
|
168
|
+
padding: 3px;
|
|
169
|
+
vertical-align: middle;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
a {
|
|
173
|
+
text-decoration: none;
|
|
174
|
+
color: var(--bs-primary);
|
|
175
|
+
|
|
176
|
+
&:hover {
|
|
177
|
+
text-decoration: underline;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
blockquote {
|
|
182
|
+
padding: 5px 5px 5px 15px;
|
|
183
|
+
color: #777777;
|
|
184
|
+
border-left: 4px solid #dddddd;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
video {
|
|
188
|
+
display: block;
|
|
189
|
+
width: 100%;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
audio {
|
|
193
|
+
display: block;
|
|
194
|
+
width: 100%;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
pre {
|
|
198
|
+
padding: 0;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
pre,
|
|
202
|
+
code {
|
|
203
|
+
font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
pre code {
|
|
207
|
+
display: block;
|
|
208
|
+
overflow-x: auto;
|
|
209
|
+
padding: 1em;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
code {
|
|
213
|
+
padding: 3px 5px;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.hljs,
|
|
217
|
+
pre {
|
|
218
|
+
background: #1a1b26;
|
|
219
|
+
color: #cbd2ea;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.hljs-comment,
|
|
223
|
+
.hljs-meta {
|
|
224
|
+
color: #565f89;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.hljs-deletion,
|
|
228
|
+
.hljs-doctag,
|
|
229
|
+
.hljs-regexp,
|
|
230
|
+
.hljs-selector-attr,
|
|
231
|
+
.hljs-selector-class,
|
|
232
|
+
.hljs-selector-id,
|
|
233
|
+
.hljs-selector-pseudo,
|
|
234
|
+
.hljs-tag,
|
|
235
|
+
.hljs-template-tag,
|
|
236
|
+
.hljs-variable.language_ {
|
|
237
|
+
color: #f7768e;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.hljs-link,
|
|
241
|
+
.hljs-literal,
|
|
242
|
+
.hljs-number,
|
|
243
|
+
.hljs-params,
|
|
244
|
+
.hljs-template-variable,
|
|
245
|
+
.hljs-type,
|
|
246
|
+
.hljs-variable {
|
|
247
|
+
color: #ff9e64;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.hljs-attribute,
|
|
251
|
+
.hljs-built_in {
|
|
252
|
+
color: #e0af68;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.hljs-keyword,
|
|
256
|
+
.hljs-property,
|
|
257
|
+
.hljs-subst,
|
|
258
|
+
.hljs-title,
|
|
259
|
+
.hljs-title.class_,
|
|
260
|
+
.hljs-title.class_.inherited__,
|
|
261
|
+
.hljs-title.function_ {
|
|
262
|
+
color: #7dcfff;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.hljs-selector-tag {
|
|
266
|
+
color: #73daca;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.hljs-addition,
|
|
270
|
+
.hljs-bullet,
|
|
271
|
+
.hljs-quote,
|
|
272
|
+
.hljs-string,
|
|
273
|
+
.hljs-symbol {
|
|
274
|
+
color: #9ece6a;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.hljs-code,
|
|
278
|
+
.hljs-formula,
|
|
279
|
+
.hljs-section {
|
|
280
|
+
color: #7aa2f7;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.hljs-attr,
|
|
284
|
+
.hljs-char.escape_,
|
|
285
|
+
.hljs-keyword,
|
|
286
|
+
.hljs-name,
|
|
287
|
+
.hljs-operator {
|
|
288
|
+
color: #bb9af7;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.hljs-punctuation {
|
|
292
|
+
color: #c0caf5;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.hljs-emphasis {
|
|
296
|
+
font-style: italic;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.hljs-strong {
|
|
300
|
+
font-weight: 700;
|
|
301
|
+
}
|
|
302
|
+
`;function J(e){return k(W,{children:k(U,{...e})})}const W=p.div`
|
|
303
|
+
margin-bottom: .5rem;
|
|
304
|
+
margin-top: .5rem;
|
|
305
|
+
border: var(--bs-border-width) var(--bs-border-style) var(--bs-border-color);
|
|
306
|
+
border-radius: var(--bs-border-radius-lg);
|
|
307
|
+
overflow: hidden;
|
|
308
|
+
max-width: 250px;
|
|
309
|
+
max-height: 250px;
|
|
310
|
+
|
|
311
|
+
&:hover {
|
|
312
|
+
border-color: var(--bs-primary);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
&:first-child {
|
|
316
|
+
margin-top: 0;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
&:last-child {
|
|
320
|
+
margin-bottom: 0;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
img {
|
|
324
|
+
max-height: 100%;
|
|
325
|
+
max-width: 100%;
|
|
326
|
+
}
|
|
327
|
+
`;function G(e){let{tool:t,showProcess:o}=e;const[n,i]=r(!1);let s=null;t.content&&("string"==typeof t.content?s=k(L,{content:t.content}):"image"===t.content.type&&(s=k(J,{src:t.content.image})));const a="response"in t;return w(c,{children:["all"==o&&k("div",{className:"mb-2",children:w("div",n&&a?{className:"shadow-sm rounded bg-white fs-7",children:[w("div",{onClick:()=>i(!1),role:"button",className:"d-flex align-items-center p-1 px-2 gap-2",children:[t.error?k("i",{className:"bi bi-x-circle-fill text-danger"}):k("i",{className:"bi bi-check-circle-fill text-success"}),k("span",{className:"text-muted",children:"已使用"}),k("span",{children:t.title}),k("i",{className:"bi bi-caret-up-fill text-muted"})]}),w("div",{className:"border-top p-2 d-flex flex-column gap-2",children:[w("div",{className:"border rounded bg-light",children:[k("div",{className:"d-flex align-items-center p-1 px-2 fs-7 gap-2",children:k("span",{className:"text-muted",children:"参数"})}),k("div",{className:"border-top p-2 overflow-hidden",children:t.arguments})]}),w("div",{className:"border rounded bg-light",children:[k("div",{className:"d-flex align-items-center p-1 px-2 fs-7 gap-2",children:k("span",{className:"text-muted",children:"响应"})}),k(Q,{className:"border-top p-2 overflow-hidden",children:t.response||"None"})]})]})]}:{onClick:()=>i(a),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.error?k("i",{className:"bi bi-x-circle-fill text-danger"}):k("i",{className:"bi bi-check-circle-fill text-success"}):k(T,{animation:"border",variant:"primary",size:"sm"}),k("span",{className:"text-muted",children:a?"已使用":"正在使用"}),k("span",{children:t.title}),a&&k("i",{className:"bi bi-caret-down-fill text-muted"})]})}),s]})}const Q=p.div`
|
|
328
|
+
white-space: pre-wrap;
|
|
329
|
+
`;var V,Y,Z;function ee(){return ee=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},ee.apply(this,arguments)}const te=t=>e.createElement("svg",ee({xmlns:"http://www.w3.org/2000/svg",width:30,height:14,fill:"#fff",viewBox:"0 0 120 30"},t),V||(V=e.createElement("circle",{cx:15,cy:15,r:15,fill:"#3c60ff"},e.createElement("animate",{attributeName:"r",begin:"0s",calcMode:"linear",dur:"0.8s",from:15,repeatCount:"indefinite",to:15,values:"15;9;15"}),e.createElement("animate",{attributeName:"fill-opacity",begin:"0s",calcMode:"linear",dur:"0.8s",from:1,repeatCount:"indefinite",to:1,values:"1;.5;1"}))),Y||(Y=e.createElement("circle",{cx:60,cy:15,r:9,fill:"#3c60ff",fillOpacity:.3},e.createElement("animate",{attributeName:"r",begin:"0s",calcMode:"linear",dur:"0.8s",from:9,repeatCount:"indefinite",to:9,values:"9;15;9"}),e.createElement("animate",{attributeName:"fill-opacity",begin:"0s",calcMode:"linear",dur:"0.8s",from:.5,repeatCount:"indefinite",to:.5,values:".5;1;.5"}))),Z||(Z=e.createElement("circle",{cx:105,cy:15,r:15,fill:"#3c60ff"},e.createElement("animate",{attributeName:"r",begin:"0s",calcMode:"linear",dur:"0.8s",from:15,repeatCount:"indefinite",to:15,values:"15;9;15"}),e.createElement("animate",{attributeName:"fill-opacity",begin:"0s",calcMode:"linear",dur:"0.8s",from:1,repeatCount:"indefinite",to:1,values:"1;.5;1"}))));const re=function(e){let{ext:t}=e;const{result:r}=v((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),[t]);return r?k("img",{width:30,height:30,src:r}):null};function oe(e){let{className:t,name:r,size:o,loading:n,error:i,onRemove:s}=e;const a=D.extname(r).substring(1),l=w(ae,{className:t,$error:!!i,children:[w(se,{children:[k(re,{ext:a}),n&&k(T,{variant:"primary"})]}),w(ie,{children:[k("h4",{children:r}),k("p",{children:f(o,1)})]}),s&&k(ne,{onClick:e=>{e.preventDefault(),s()},children:k("i",{className:"bi bi-trash3"})})]});return i?k(b,{placement:"top",tooltip:i,children:l}):l}const ne=p.div`
|
|
330
|
+
width: 1.75rem;
|
|
331
|
+
height: 1.75rem;
|
|
332
|
+
align-items: center;
|
|
333
|
+
justify-content: center;
|
|
334
|
+
border-radius: .375rem;
|
|
335
|
+
cursor: pointer;
|
|
336
|
+
font-size: 0.9rem;
|
|
337
|
+
color: var(--bs-secondary);
|
|
338
|
+
display: flex;
|
|
339
|
+
|
|
340
|
+
&:hover {
|
|
341
|
+
color: var(--bs-danger);
|
|
342
|
+
background-color: var(--bs-danger-bg-subtle);
|
|
343
|
+
}
|
|
344
|
+
`,ie=p.div`
|
|
345
|
+
flex: 1;
|
|
346
|
+
overflow: hidden;
|
|
347
|
+
|
|
348
|
+
h4 {
|
|
349
|
+
font-weight: 500;
|
|
350
|
+
font-size: 12px;
|
|
351
|
+
color: #253044;
|
|
352
|
+
line-height: 20px;
|
|
353
|
+
overflow: hidden;
|
|
354
|
+
white-space: nowrap;
|
|
355
|
+
text-overflow: ellipsis;
|
|
356
|
+
margin-bottom: 0;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
p {
|
|
360
|
+
font-size: 12px;
|
|
361
|
+
color: rgba(37, 48, 68, .52);
|
|
362
|
+
line-height: 20px;
|
|
363
|
+
margin-bottom: 0;
|
|
364
|
+
}
|
|
365
|
+
`,se=p.div`
|
|
366
|
+
position: relative;
|
|
367
|
+
width: 3rem;
|
|
368
|
+
height: 3rem;
|
|
369
|
+
display: flex;
|
|
370
|
+
align-items: center;
|
|
371
|
+
justify-content: center;
|
|
372
|
+
background: var(--bs-gray-200);
|
|
373
|
+
border-radius: 6px;
|
|
374
|
+
|
|
375
|
+
.spinner-border {
|
|
376
|
+
position: absolute;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
`,ae=p.div`
|
|
380
|
+
display: flex;
|
|
381
|
+
gap: .5rem;
|
|
382
|
+
padding: .5rem;
|
|
383
|
+
border: var(--bs-border-width) var(--bs-border-style) var(--bs-border-color);
|
|
384
|
+
border-radius: var(--bs-border-radius-lg);
|
|
385
|
+
align-items: center;
|
|
386
|
+
background: #FFF;
|
|
387
|
+
|
|
388
|
+
&:hover {
|
|
389
|
+
border-color: var(--bs-primary);
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
${e=>e.$error&&u`
|
|
393
|
+
border-color: var(--bs-danger) !important;
|
|
394
|
+
`}
|
|
395
|
+
`,le=a((e=>{let{avatar:t,message:r,showProcess:o="none"}=e;const{query:n,files:i=[],chunks:s}=r;return w(j,{children:[(n||i.length>0)&&k(ue,{$reverse:!0,children:w(ge,{children:[n&&k(L,{content:n}),i.length>0&&i.map(((e,t)=>{let{name:r,size:o,path:n}=e;return x(n)?k(J,{src:y(`/uploads/${n}`)},t):k(ce,{children:k(oe,{name:r,size:o})},t)}))]})}),s&&w(ue,{children:[k(pe,{children:k("img",{src:t})}),w(ge,{children:[r.query&&k(he,{children:k(g,{placement:"top",content:s.reduce((function(e,t){return e+t.content+"\n"+t.tools.reduce(((e,t)=>t.content&&"string"==typeof t.content?e+t.content+"\n":e),"")}),""),as:de})}),k(me,{children:["stats","all"].includes(o)&&r.stats&&w(j,{children:[w("span",{children:["耗时 ",r.stats.latency/1e3," 秒"]}),w("span",{children:["花费 Token ",r.stats.usage]})]})}),s.length>0&&s.map(((e,t)=>w(c,{children:[e.content&&k(L,{content:e.content}),e.tools.map(((e,t)=>k(G,{tool:e,showProcess:o},t))),e.error&&k(L,{content:`[${e.error}]`})]},t))),r.loading&&k(te,{})]})]})]})})),ce=p.div`
|
|
396
|
+
width: 100%;
|
|
397
|
+
margin-bottom: .5rem;
|
|
398
|
+
margin-top: .5rem;
|
|
399
|
+
|
|
400
|
+
&:first-child {
|
|
401
|
+
margin-top: 0;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
&:last-child {
|
|
405
|
+
margin-bottom: 0;
|
|
406
|
+
}
|
|
407
|
+
`,de=p.div`
|
|
408
|
+
align-items: center;
|
|
409
|
+
justify-content: center;
|
|
410
|
+
border-radius: .375rem;
|
|
411
|
+
cursor: pointer;
|
|
412
|
+
font-size: 0.9rem;
|
|
413
|
+
color: var(--bs-secondary);
|
|
414
|
+
display: flex;
|
|
415
|
+
background: #FFF;
|
|
416
|
+
box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
|
|
417
|
+
padding: .125rem;
|
|
418
|
+
|
|
419
|
+
.bi {
|
|
420
|
+
width: 1.75rem;
|
|
421
|
+
height: 1.75rem;
|
|
422
|
+
border-radius: .375rem;
|
|
423
|
+
line-height: 1.75rem;
|
|
424
|
+
text-align: center;
|
|
425
|
+
|
|
426
|
+
&:hover {
|
|
427
|
+
color: var(--bs-dark);
|
|
428
|
+
background-color: var(--bs-gray-200);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
`,he=p.div`
|
|
432
|
+
position: absolute;
|
|
433
|
+
top: -1.1rem;
|
|
434
|
+
right: 0;
|
|
435
|
+
display: flex;
|
|
436
|
+
gap: .25rem;
|
|
437
|
+
opacity: 0;
|
|
438
|
+
z-index: 1;
|
|
439
|
+
`,me=p.div`
|
|
440
|
+
position: absolute;
|
|
441
|
+
bottom: -1.4rem;
|
|
442
|
+
left: 0;
|
|
443
|
+
font-size: 0.85rem;
|
|
444
|
+
line-height: 1rem;
|
|
445
|
+
color: var(--bs-gray-600);
|
|
446
|
+
gap: .5rem;
|
|
447
|
+
overflow: hidden;
|
|
448
|
+
white-space: nowrap;
|
|
449
|
+
display: flex;
|
|
450
|
+
opacity: 0;
|
|
451
|
+
z-index: 1;
|
|
452
|
+
`,pe=p.div`
|
|
453
|
+
width: 35px;
|
|
454
|
+
height: 35px;
|
|
455
|
+
border-radius: 50%;
|
|
456
|
+
overflow: hidden;
|
|
457
|
+
|
|
458
|
+
img, svg {
|
|
459
|
+
width: 100%;
|
|
460
|
+
height: 100%;
|
|
461
|
+
}
|
|
462
|
+
`,ge=p.div`
|
|
463
|
+
padding: .875rem;
|
|
464
|
+
background-color: rgb(243, 243, 243);
|
|
465
|
+
border-radius: var(--bs-border-radius-lg);
|
|
466
|
+
max-width: 80%;
|
|
467
|
+
margin-left: 10px;
|
|
468
|
+
position: relative;
|
|
469
|
+
|
|
470
|
+
&:before {
|
|
471
|
+
position: absolute;
|
|
472
|
+
top: 10px;
|
|
473
|
+
left: -10px;
|
|
474
|
+
width: 0;
|
|
475
|
+
height: 0;
|
|
476
|
+
content: "";
|
|
477
|
+
border: 5px solid transparent;
|
|
478
|
+
border-right-color: #f3f3f3;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
&:hover {
|
|
482
|
+
${me}, ${he} {
|
|
483
|
+
opacity: 1;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
`,ue=p.div`
|
|
487
|
+
display: flex;
|
|
488
|
+
justify-content: flex-start;
|
|
489
|
+
padding: 1rem 0 1rem 0;
|
|
490
|
+
${e=>e.$reverse&&u`
|
|
491
|
+
justify-content: flex-end;
|
|
492
|
+
|
|
493
|
+
${ge} {
|
|
494
|
+
background: rgba(var(--bs-primary-rgb), 0.1);
|
|
495
|
+
margin-right: 10px;
|
|
496
|
+
margin-left: 0;
|
|
497
|
+
|
|
498
|
+
&:before {
|
|
499
|
+
position: absolute;
|
|
500
|
+
top: 10px;
|
|
501
|
+
right: -10px;
|
|
502
|
+
left: auto;
|
|
503
|
+
border-left-color: rgba(var(--bs-primary-rgb), 0.1);
|
|
504
|
+
border-right-color: transparent;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
`};
|
|
508
|
+
`;var fe;function be(){return be=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},be.apply(this,arguments)}const ve=t=>e.createElement("svg",be({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 1024 1024"},t),fe||(fe=e.createElement("path",{fill:"currentColor",d:"m85.333 896 896-384-896-384v298.667l640 85.333-640 85.333z"}))),xe=[".txt",".md",".pdf",".docx",".xlsx",".pptx",".png",".jpg"];function ye(e){let{chat:n,fileTypes:i,scrollRef:s,onMessages:a}=e;const c=l(null),p=l(null),[g,u]=r(""),[f,v]=d([]),x=i&&i.length>0?i:xe,{loading:y,messages:j,send:N}=S({...n,onSuccess(){requestAnimationFrame((()=>{c.current?.focus()})),n.onSuccess?.()}});o((()=>{a(j)}),[j]),o((()=>{const e=s.current;if(e&&N){const t=e=>{e.target instanceof HTMLAnchorElement&&"#!question"===e.target.hash&&(e.preventDefault(),N(e.target.text))};return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}}}),[s,N]);const z=t((e=>{let{target:t}=e;if(t.files){const e=Array.from(t.files).filter((e=>!!x.includes(_.extname(e.name))&&(!(e.size>20971520)&&e))).slice(0,6-f.length);v((t=>{t.push(...e.map((e=>({file:e}))))})),e.forEach((async e=>{try{const t=new FormData;t.set("file",e);const r=await h({method:"POST",url:`${n.url}/upload`,transformRequest:n.transformRequest,data:t});v((t=>{const o=t.find((t=>t.file===e));o&&(o.path=r.path)}))}catch(t){const r=m(t)?t.message:"unknown error";v((t=>{const o=t.find((t=>t.file===e));o&&(o.error=r)}))}}))}t.value=""}),[f,x]),M=f.flatMap((e=>{let{file:t,path:r}=e;return r?[{name:t.name,size:t.size,path:r}]:[]})),C=()=>{(g||M.length>0)&&(N(g,M),u(""),v([]))};return w(ze,{children:[f.length>0&&k(ke,{children:f.map(((e,t)=>{let{file:r,error:o,path:n}=e;const i=void 0===o&&void 0===n;return k(we,{name:r.name,size:r.size,error:o,loading:i,onRemove:()=>{v((e=>{const t=e.findIndex((e=>e.file===r));-1!==t&&e.splice(t,1)}))}},t)}))}),w(Ne,{children:[k(R,{disabled:y,ref:c,placeholder:"请输入你的问题, Enter+Shift换行, Enter发送",maxRows:5,value:g,onChange:e=>u(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),C())}}),i&&k(b,{tooltip:"可上传不超过6个小于20MB的文件",placement:"top",children:w(je,{disabled:f.length>=6,onClick:()=>p.current?.click(),children:[k("input",{onChange:z,multiple:!0,accept:x.join(","),ref:p,type:"file",hidden:!0}),k("i",{className:"bi bi-file-earmark-arrow-up"})]})}),k(je,{disabled:!g&&0===M.length,onClick:e=>{e.preventDefault(),C()},children:k(ve,{})})]})]})}const we=p(oe)`
|
|
509
|
+
width: calc((100% - .75rem) / 2);
|
|
510
|
+
`,ke=p.div`
|
|
511
|
+
display: flex;
|
|
512
|
+
flex-wrap: wrap;
|
|
513
|
+
padding: .75rem;
|
|
514
|
+
gap: .75rem;
|
|
515
|
+
border-bottom: var(--bs-border-width) var(--bs-border-style) var(--bs-border-color);
|
|
516
|
+
`,je=p.button`
|
|
517
|
+
color: var(--bs-secondary);
|
|
518
|
+
cursor: pointer;
|
|
519
|
+
display: flex;
|
|
520
|
+
align-items: center;
|
|
521
|
+
justify-content: center;
|
|
522
|
+
width: 2rem;
|
|
523
|
+
height: 2rem;
|
|
524
|
+
border-radius: .5rem;
|
|
525
|
+
outline: none;
|
|
526
|
+
border: none;
|
|
527
|
+
background: transparent;
|
|
528
|
+
font-size: 1.25rem;
|
|
529
|
+
|
|
530
|
+
svg {
|
|
531
|
+
width: 1.25rem;
|
|
532
|
+
height: 1.25rem;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
&:disabled {
|
|
536
|
+
color: var(--bs-gray-400);
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
&:hover&:not(:disabled) {
|
|
540
|
+
background-color: var(--bs-gray-200);
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
`,Ne=p.div`
|
|
544
|
+
display: flex;
|
|
545
|
+
padding: .5rem .5rem .5rem 1rem;
|
|
546
|
+
gap: .25rem;
|
|
547
|
+
|
|
548
|
+
textarea {
|
|
549
|
+
border: none;
|
|
550
|
+
outline: none;
|
|
551
|
+
flex: 1;
|
|
552
|
+
resize: none;
|
|
553
|
+
background: transparent;
|
|
554
|
+
|
|
555
|
+
&::placeholder {
|
|
556
|
+
color: rgba(54, 54, 54, .3);
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
`,ze=p.div`
|
|
560
|
+
background: #FFF;
|
|
561
|
+
margin: 0 1rem 1rem;
|
|
562
|
+
border: var(--bs-border-width) var(--bs-border-style) var(--bs-border-color);
|
|
563
|
+
border-radius: var(--bs-border-radius-lg);
|
|
564
|
+
box-shadow: 0.125rem 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
|
|
565
|
+
`;function Me(e){let{className:n,avatar:i,chat:s,showProcess:a,fileTypes:c,...d}=e;const[h,m]=r([]),p=l(null),g=t((()=>{const e=p.current;e&&requestAnimationFrame((()=>e.scrollTo(0,e.scrollHeight)))}),[]);return o((()=>{d.messages&&m(d.messages)}),[d.messages]),o((()=>{g()})),k(Ee,{className:n,children:w(B,{children:[k(Ce,{ref:p,children:h.map(((e,t)=>k(le,{message:e,showProcess:a,avatar:i},t)))}),s&&k(ye,{chat:s,onMessages:m,scrollRef:p,fileTypes:c})]})})}const Ce=p.div`
|
|
566
|
+
display: flex;
|
|
567
|
+
flex-direction: column;
|
|
568
|
+
flex: 1;
|
|
569
|
+
overflow-y: auto;
|
|
570
|
+
padding: 0 1rem;
|
|
571
|
+
margin-bottom: 1rem;
|
|
572
|
+
`,Ee=p.div`
|
|
573
|
+
display: flex;
|
|
574
|
+
flex-direction: column;
|
|
575
|
+
height: 100%;
|
|
576
|
+
`;export{Me as MessageBox,S as useChat};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@topthink/chat",
|
|
3
|
+
"version": "1.0.1",
|
|
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
|
+
"@topthink/components": "^1.0.77",
|
|
21
|
+
"katex": "^0.16.9",
|
|
22
|
+
"react-markdown": "^8.0.7",
|
|
23
|
+
"react-textarea-autosize": "^8.5.3",
|
|
24
|
+
"rehype-highlight": "^6.0.0",
|
|
25
|
+
"rehype-katex": "^6.0.2",
|
|
26
|
+
"remark-breaks": "^3.0.2",
|
|
27
|
+
"remark-gfm": "^3.0.1",
|
|
28
|
+
"remark-math": "^5.1.1",
|
|
29
|
+
"yet-another-react-lightbox": "^3.17.5"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"lodash": "*",
|
|
33
|
+
"react": "^17||^18",
|
|
34
|
+
"react-bootstrap": "^2.1.2",
|
|
35
|
+
"react-dom": "^17||^18"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@babel/core": "^7.23.6",
|
|
39
|
+
"@babel/plugin-transform-runtime": "^7.23.6",
|
|
40
|
+
"@babel/preset-env": "^7.23.6",
|
|
41
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
42
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
|
43
|
+
"@rollup/plugin-dynamic-import-vars": "^2.1.2",
|
|
44
|
+
"@rollup/plugin-image": "^3.0.3",
|
|
45
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
46
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
47
|
+
"@rollup/plugin-typescript": "^11.1.5",
|
|
48
|
+
"@svgr/rollup": "^8.1.0",
|
|
49
|
+
"@types/lodash": "^4.14.161",
|
|
50
|
+
"@types/node": "^18.11.18",
|
|
51
|
+
"@types/react": "^17.0.0",
|
|
52
|
+
"@types/react-dom": "^17.0.0",
|
|
53
|
+
"react-bootstrap": "^2.1.2",
|
|
54
|
+
"rollup": "^4.8.0",
|
|
55
|
+
"typescript": "^5.3.3"
|
|
56
|
+
},
|
|
57
|
+
"author": "yunwuxin <tzzhangyajun@qq.com> (https://github.com/yunwuxin)",
|
|
58
|
+
"license": "MIT"
|
|
59
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Dispatch, ReactNode, SetStateAction } from 'react';
|
|
2
|
+
import 'yet-another-react-lightbox/styles.css';
|
|
3
|
+
import 'yet-another-react-lightbox/plugins/counter.css';
|
|
4
|
+
interface ImageContextType {
|
|
5
|
+
images: Map<number, string>;
|
|
6
|
+
current: number | undefined;
|
|
7
|
+
setCurrent: Dispatch<SetStateAction<number | undefined>>;
|
|
8
|
+
setShow: Dispatch<SetStateAction<boolean>>;
|
|
9
|
+
registerImage: (id: number, url: string) => () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const ImageContext: import("react").Context<ImageContextType>;
|
|
12
|
+
interface Props {
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export default function Lightbox({ children }: Props): JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Components } from 'react-markdown';
|
|
3
|
+
import 'katex/dist/katex.min.css';
|
|
4
|
+
interface Props {
|
|
5
|
+
content: string;
|
|
6
|
+
components?: Components;
|
|
7
|
+
}
|
|
8
|
+
export declare const Markdown: import("react").MemoExoticComponent<({ content, components }: Props) => JSX.Element>;
|
|
9
|
+
export default Markdown;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface Props {
|
|
3
|
+
className?: string;
|
|
4
|
+
name: string;
|
|
5
|
+
size: number;
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
error?: string;
|
|
8
|
+
onRemove?: () => void;
|
|
9
|
+
}
|
|
10
|
+
export default function FileItem({ className, name, size, loading, error, onRemove }: Props): JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Message, ShowProcess } from '../../types';
|
|
3
|
+
import { ChatOptions } from '../../hooks/use-chat';
|
|
4
|
+
interface Props {
|
|
5
|
+
className?: string;
|
|
6
|
+
avatar: string;
|
|
7
|
+
messages?: Message[];
|
|
8
|
+
showProcess?: ShowProcess;
|
|
9
|
+
chat?: ChatOptions;
|
|
10
|
+
fileTypes?: string[];
|
|
11
|
+
}
|
|
12
|
+
export default function MessageBox({ className, avatar, chat, showProcess, fileTypes, ...props }: Props): JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MutableRefObject } from 'react';
|
|
2
|
+
import { Message } from '../../types';
|
|
3
|
+
import { ChatOptions } from '../../hooks/use-chat';
|
|
4
|
+
interface Props {
|
|
5
|
+
chat: ChatOptions;
|
|
6
|
+
fileTypes?: string[];
|
|
7
|
+
scrollRef: MutableRefObject<HTMLDivElement | null>;
|
|
8
|
+
onMessages: (messages: Message[]) => void;
|
|
9
|
+
}
|
|
10
|
+
export default function ({ chat, fileTypes, scrollRef, onMessages }: Props): JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Message, ShowProcess } from '../../types';
|
|
3
|
+
interface Props {
|
|
4
|
+
message: Message;
|
|
5
|
+
avatar: string;
|
|
6
|
+
showProcess?: ShowProcess;
|
|
7
|
+
}
|
|
8
|
+
declare const MessageItem: import("react").MemoExoticComponent<({ avatar, message, showProcess }: Props) => JSX.Element>;
|
|
9
|
+
export default MessageItem;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SUPPORT_FILE_TYPES: string[];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { MutableRefObject } from 'react';
|
|
2
|
+
import { Chat, Message } from '../types';
|
|
3
|
+
import { RequestConfig } from '@topthink/components';
|
|
4
|
+
export interface ChatOptions {
|
|
5
|
+
url: string;
|
|
6
|
+
transformRequest?: Exclude<RequestConfig, string>['transformRequest'];
|
|
7
|
+
onSuccess?: () => void;
|
|
8
|
+
onboarding?: {
|
|
9
|
+
prologue: string;
|
|
10
|
+
questions: string[];
|
|
11
|
+
};
|
|
12
|
+
messages?: Message[];
|
|
13
|
+
conversation?: string;
|
|
14
|
+
ref?: MutableRefObject<Chat | null>;
|
|
15
|
+
}
|
|
16
|
+
export default function useChat({ url, transformRequest, onboarding, onSuccess, ref, ...props }: ChatOptions): {
|
|
17
|
+
messages: Message[];
|
|
18
|
+
loading: boolean;
|
|
19
|
+
send: (query: string, files?: Message['files']) => Promise<void>;
|
|
20
|
+
reset: () => void;
|
|
21
|
+
};
|
package/types/index.d.ts
ADDED
package/types/types.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface Chat {
|
|
2
|
+
reset(): void;
|
|
3
|
+
send(query: string): void;
|
|
4
|
+
}
|
|
5
|
+
export interface ToolMessage {
|
|
6
|
+
name: string;
|
|
7
|
+
title: string;
|
|
8
|
+
arguments: string;
|
|
9
|
+
response?: string;
|
|
10
|
+
error?: boolean;
|
|
11
|
+
content?: string | {
|
|
12
|
+
type: 'image';
|
|
13
|
+
image: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface Message {
|
|
17
|
+
query?: string;
|
|
18
|
+
files?: {
|
|
19
|
+
path: string;
|
|
20
|
+
name: string;
|
|
21
|
+
size: number;
|
|
22
|
+
}[];
|
|
23
|
+
chunks?: {
|
|
24
|
+
content: string;
|
|
25
|
+
tools: ToolMessage[];
|
|
26
|
+
error?: string;
|
|
27
|
+
}[];
|
|
28
|
+
stats?: {
|
|
29
|
+
usage: number;
|
|
30
|
+
latency: number;
|
|
31
|
+
};
|
|
32
|
+
loading?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export type ShowProcess = 'stats' | 'all' | 'none';
|