@gientech/modual 1.9.1 → 1.9.2

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/chat.js CHANGED
@@ -1,4 +1,4 @@
1
- import{jsx as Z,jsxs as et,Fragment as fp}from"react/jsx-runtime";import*as C from"react";import ke,{useRef as tt,useEffect as vt,Component as $C,forwardRef as Ai,createElement as Ql,createContext as ds,version as $H,useMemo as Vt,useContext as or,useState as at,Children as aI,useCallback as o3,useImperativeHandle as Sc,useLayoutEffect as sI,cloneElement as lI,isValidElement as cI,PureComponent as AH}from"react";import{a as Ji,g as AC,au as uI,l as $c,an as dI,aN as fI,B as So,aB as OH,f as sr,u as hI,a5 as pI,aF as OC,H as NH,aE as MH,ad as Gl,J as n2,y as gI,A as Yi,bT as r2,T as NC,m as mI,r as vI,k as xo,K as o2,b5 as DH,av as TH,ay as PH,aw as IH,bU as FH,ac as bd,G as RH,bV as ja,bW as eo,_ as Fi,bz as yI,bA as bI,aW as xI,L as Er,bN as Lr,aV as EI,E as BH,aJ as wI,bh as CI,bX as i3,bC as _H,bY as jH,p as kI,bu as LH,bE as zH,ap as HH,o as a3,at as s3,aZ as WH,bZ as VH,aP as SI,b as Ur,I as MC,i as DC,F as Jl,aK as hp,b_ as $I,bR as GH,h as qH,b$ as am}from"./assets/index-g-SUxfJH.js";import{I as ar,d as l3,c as AI,T as UH,e as YH}from"./assets/index-x8IlxRuv.js";import*as XH from"react-dom";import c3,{flushSync as Wu,createPortal as OI,unstable_batchedUpdates as KH}from"react-dom";import{D as ZH,T as QH,F as JH,q as u3}from"./assets/index-BO-w4FPz.js";import{u as pa}from"./assets/index-CpW6Dhpp.js";/* empty css */import{A as eW,i as tW,s as rr,M as pp,S as Yd}from"./assets/style-CGmZ5osp.js";import{P as NI}from"./assets/plus-V9zUoSq6.js";import{S as i2}from"./assets/index-JwQuPQqQ.js";import{X as gp}from"./assets/x-CnaaLGJF.js";import{g as d3,P as nW,a as MI}from"./assets/index-CIwaLPGb.js";import{C as rW,G as DI,c as oW,r as iW}from"./assets/GientechStreamReader-DqJjNXCO.js";import{B as oCe}from"./assets/GientechStreamReader-DqJjNXCO.js";import{P as aW}from"./assets/index-BKe5FgcC.js";import"./database.js";import"./databaseTable.js";import"./modelManage.js";import"./sensitive.js";import{D as sW}from"./assets/index-D72cKELw.js";import"./assets/index-j0kQJd0a.js";import"./assets/index-DwoTKC3G.js";import"./assets/index-DdVFXD_y.js";/**
1
+ import{jsx as Z,jsxs as et,Fragment as fp}from"react/jsx-runtime";import*as C from"react";import ke,{useRef as tt,useEffect as vt,Component as $C,forwardRef as Ai,createElement as Ql,createContext as ds,version as $H,useMemo as Vt,useContext as or,useState as at,Children as aI,useCallback as o3,useImperativeHandle as Sc,useLayoutEffect as sI,cloneElement as lI,isValidElement as cI,PureComponent as AH}from"react";import{a as Ji,g as AC,au as uI,l as $c,an as dI,aN as fI,B as So,aB as OH,f as sr,u as hI,a5 as pI,aF as OC,H as NH,aE as MH,ad as Gl,J as n2,y as gI,A as Yi,bT as r2,T as NC,m as mI,r as vI,k as xo,K as o2,b5 as DH,av as TH,ay as PH,aw as IH,bU as FH,ac as bd,G as RH,bV as ja,bW as eo,_ as Fi,bz as yI,bA as bI,aW as xI,L as Er,bN as Lr,aV as EI,E as BH,aJ as wI,bh as CI,bX as i3,bC as _H,bY as jH,p as kI,bu as LH,bE as zH,ap as HH,o as a3,at as s3,aZ as WH,bZ as VH,aP as SI,b as Ur,I as MC,i as DC,F as Jl,aK as hp,b_ as $I,bR as GH,h as qH,b$ as am}from"./assets/index-g-SUxfJH.js";import{I as ar,d as l3,c as AI,T as UH,e as YH}from"./assets/index-x8IlxRuv.js";import*as XH from"react-dom";import c3,{flushSync as Wu,createPortal as OI,unstable_batchedUpdates as KH}from"react-dom";import{D as ZH,T as QH,F as JH,$ as u3}from"./assets/index-h59-yboB.js";import{u as pa}from"./assets/index-CpW6Dhpp.js";/* empty css */import{A as eW,i as tW,s as rr,M as pp,S as Yd}from"./assets/style-CGmZ5osp.js";import{P as NI}from"./assets/plus-V9zUoSq6.js";import{S as i2}from"./assets/index-JwQuPQqQ.js";import{X as gp}from"./assets/x-CnaaLGJF.js";import{g as d3,P as nW,a as MI}from"./assets/index-CF21Mbsz.js";import{C as rW,G as DI,c as oW,r as iW}from"./assets/GientechStreamReader-9YdiPc7N.js";import{B as oCe}from"./assets/GientechStreamReader-9YdiPc7N.js";import{P as aW}from"./assets/index-BKe5FgcC.js";import"./database.js";import"./databaseTable.js";import"./modelManage.js";import"./sensitive.js";import{D as sW}from"./assets/index-D72cKELw.js";import"./assets/index-j0kQJd0a.js";import"./assets/index-DwoTKC3G.js";import"./assets/index-DdVFXD_y.js";/**
2
2
  * @license lucide-react v0.456.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -604,7 +604,7 @@ ${v.substring(Y)}`;y(J),requestAnimationFrame(()=>{U.selectionStart=U.selectionE
604
604
  border-color: ${n.primary};
605
605
  box-shadow: 0 0 0 2px ${n.primary}1A;
606
606
  }
607
- `};function tse({config:e,styles:t}){if(!e)return null;const n=JSON.parse(e.configJson),r=Vt(()=>{var o;return{...DC.colors,...(o=t==null?void 0:t.theme)==null?void 0:o.colors}},[t]);return et("div",{className:"w-[340px] rounded-xl p-4 animate-fade-in bg-white",children:[et("div",{className:"flex items-center mb-2",children:[Z("span",{className:"text-md font-bold truncate mr-2",style:{color:r.primary},children:n.config_name||"\u52A9\u624B\u914D\u7F6E"}),Z("span",{className:"text-xs truncate rounded px-2 py-0.5",style:{backgroundColor:`${r.primary}1A`,color:r.disabled},children:n.model_name})]}),Z("div",{className:"border-b my-2",style:{borderColor:r.border}}),et("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs text-gray-700 mb-2",style:{color:r.text},children:[et("div",{children:["\u4E0A\u4E0B\u6587\u6700\u5927\u8F6E\u6570\uFF1A",Z("span",{className:"font-semibold",children:n.max_round})]}),et("div",{children:["\u6700\u5927\u4EE4\u724C\u6570\uFF1A",Z("span",{className:"font-semibold",children:n.max_tokens})]}),et("div",{children:["\u6E29\u5EA6\uFF1A",Z("span",{className:"font-semibold",children:n.temperature})]}),et("div",{children:["\u53EC\u56DE\u6570\uFF1A",Z("span",{className:"font-semibold",children:n.top_k})]}),et("div",{children:["\u591A\u6837\u6027\uFF1A",Z("span",{className:"font-semibold",children:n.top_p})]}),et("div",{children:["\u76F8\u4F3C\u5EA6\u9608\u503C\uFF1A",Z("span",{className:"font-semibold",children:n.score_threshold})]})]}),et("div",{className:"mb-2",children:[Z("div",{className:"text-xs text-gray-400 mb-1",style:{color:r.disabled},children:"\u5173\u8054\u77E5\u8BC6\u5E93\uFF1A"}),Z("div",{className:"flex flex-wrap gap-1",children:n.knowledge_base_name?n.knowledge_base_name.split(";").map((o,i)=>Z("span",{className:"px-2 py-0.5 rounded-full text-xs",style:{backgroundColor:`${r.primary}1A`,color:r.primary},children:o},i)):Z("span",{className:"text-gray-300",style:{color:r.disabled},children:"\u65E0"})})]}),et("div",{className:"mb-2",children:[Z("div",{className:"text-xs text-gray-400 mb-1",style:{color:r.disabled},children:"\u5F00\u542F\u529F\u80FD:"}),et("div",{className:"flex flex-wrap gap-2 text-xs mt-2",children:[!!n.enabled_faq&&Z("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"FAQ"}),!!n.enabled_graph&&Z("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u56FE\u8C31"}),!!n.dependOnKb&&Z("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u5F3A\u77E5\u8BC6\u4F9D\u8D56"}),!!n.enabled_table_select&&Z("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u8868\u683C\u7B5B\u9009"}),!!n.enabled_rerank&&Z("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u7CBE\u6392\u6A21\u5F0F"}),!!n.need_trace_source&&Z("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u6EAF\u6E90"}),!!n.is_download&&Z("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u4E0B\u8F7D\u6EAF\u6E90"})]})]})]})}function nse(e,t=[],n=60){const[r,o]=at("");return vt(()=>{o("");let i=0;const a=setInterval(()=>{o(s=>i>=e.length?(clearInterval(a),s):(i++,e.slice(0,i)))},n);return()=>clearInterval(a)},[e,...t]),r}function rse(e){const{assistantList:t,eventsEmit:n,styles:r,selectedId:o,onSelectAssistant:i,productLogo:a}=e,[s,l]=at(1),[c,u]=at(!1),[d,f]=at(""),h=c||d.trim()?6:12,m=tt(),g=tt(!1),p=tt(null),v=tt(null),y=tt("");vt(()=>{o&&m.current!==o&&(n==null||n("conversation:new_assistant_change",{assistantId:o}),m.current=o)},[o,n]);const b=Vt(()=>pa(),[]);vt(()=>{var A;if((A=r==null?void 0:r.theme)!=null&&A.colors){const N=document.createElement("style");return N.innerHTML=ese(r.theme.colors,b),N.id=`g-welcome-styles-${b}`,document.head.appendChild(N),()=>{const M=document.getElementById(N.id);M&&M.remove()}}},[r,b]);const E=Vt(()=>t.find(A=>A.id===o),[t,o]),x=Vt(()=>JSON.parse((E==null?void 0:E.configJson)||"{}"),[E]),w=Vt(()=>{if(!d.trim())return t||[];const A=d.toLowerCase().trim();return(t||[]).filter(N=>{var D,P;const M=((D=N.name)==null?void 0:D.toLowerCase())||"";try{const R=((P=JSON.parse(N.configJson||"{}").config_name)==null?void 0:P.toLowerCase())||"";return M.includes(A)||R.includes(A)}catch{return M.includes(A)}})},[t,d]),k=Math.ceil(((w==null?void 0:w.length)||0)/h),S=(w==null?void 0:w.slice((s-1)*h,s*h))||[];vt(()=>{if(o&&o!==v.current){if(g.current&&p.current!==null){v.current=o;return}const A=d.trim()?w:t;if(A&&A.length>0){const N=A.findIndex(M=>M.id===o);if(N!==-1){const M=Math.floor(N/h)+1;l(M),v.current=o}}}},[o,t,w,h,d]),vt(()=>{if(d!==y.current){if(g.current&&p.current!==null){l(p.current),g.current=!1,p.current=null,y.current=d;return}if(v.current===o){y.current=d;return}g.current||(d.trim()&&(v.current=null),l(1)),y.current=d}},[d,o]),vt(()=>{k>0&&s>k&&l(k)},[k,s]);const O=x.prologue||"\u60A8\u597D\uFF0C\u6B22\u8FCE\u4F7F\u7528\u5C0F\u9CB8\u667A\u80FD\u95EE\u7B54",$=nse(O,[o],30);return et("div",{className:`flex flex-col relative items-center justify-center h-full w-full g-welcome-${b}`,children:[Z("img",{src:a||Qae,alt:"logo",className:"mb-4",style:{width:68,height:68}}),Z("div",{className:"text-3xl font-bold mb-2 g-welcome-title",children:$}),!o&&Z("div",{className:"flex mb-2 g-welcome-subtitle",children:"\u8BF7\u9009\u62E9\u4E00\u4E2A\u667A\u80FD\u52A9\u624B"}),et("div",{style:{maxWidth:"1200px"},className:`flex mt-8 flex-wrap gap-3
607
+ `};function tse({config:e,styles:t}){if(!e)return null;const n=JSON.parse(e.configJson),r=Vt(()=>{var o;return{...DC.colors,...(o=t==null?void 0:t.theme)==null?void 0:o.colors}},[t]);return et("div",{className:"w-[340px] rounded-xl p-4 animate-fade-in bg-white",children:[et("div",{className:"flex items-center mb-2",children:[Z("span",{className:"text-md font-bold truncate mr-2",style:{color:r.primary},children:n.config_name||"\u52A9\u624B\u914D\u7F6E"}),Z("span",{className:"text-xs truncate rounded px-2 py-0.5",style:{backgroundColor:`${r.primary}1A`,color:r.disabled},children:n.model_name})]}),Z("div",{className:"border-b my-2",style:{borderColor:r.border}}),et("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs text-gray-700 mb-2",style:{color:r.text},children:[et("div",{children:["\u4E0A\u4E0B\u6587\u6700\u5927\u8F6E\u6570\uFF1A",Z("span",{className:"font-semibold",children:n.max_round})]}),et("div",{children:["\u6700\u5927\u4EE4\u724C\u6570\uFF1A",Z("span",{className:"font-semibold",children:n.max_tokens})]}),et("div",{children:["\u6E29\u5EA6\uFF1A",Z("span",{className:"font-semibold",children:n.temperature})]}),et("div",{children:["\u53EC\u56DE\u6570\uFF1A",Z("span",{className:"font-semibold",children:n.top_k})]}),et("div",{children:["\u591A\u6837\u6027\uFF1A",Z("span",{className:"font-semibold",children:n.top_p})]}),et("div",{children:["\u76F8\u4F3C\u5EA6\u9608\u503C\uFF1A",Z("span",{className:"font-semibold",children:n.score_threshold})]})]}),et("div",{className:"mb-2",children:[Z("div",{className:"text-xs text-gray-400 mb-1",style:{color:r.disabled},children:"\u5173\u8054\u77E5\u8BC6\u5E93\uFF1A"}),Z("div",{className:"flex flex-wrap gap-1",children:n.knowledge_base_name?n.knowledge_base_name.split(";").map((o,i)=>Z("span",{className:"px-2 py-0.5 rounded-full text-xs",style:{backgroundColor:`${r.primary}1A`,color:r.primary},children:o},i)):Z("span",{className:"text-gray-300",style:{color:r.disabled},children:"\u65E0"})})]}),et("div",{className:"mb-2",children:[Z("div",{className:"text-xs text-gray-400 mb-1",style:{color:r.disabled},children:"\u5F00\u542F\u529F\u80FD:"}),et("div",{className:"flex flex-wrap gap-2 text-xs mt-2",children:[!!n.enabled_faq&&Z("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"FAQ"}),!!n.enabled_graph&&Z("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u56FE\u8C31"}),!!n.dependOnKb&&Z("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u5F3A\u77E5\u8BC6\u4F9D\u8D56"}),!!n.enabled_table_select&&Z("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u8868\u683C\u7B5B\u9009"}),!!n.enabled_rerank&&Z("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u7CBE\u6392\u6A21\u5F0F"}),!!n.need_trace_source&&Z("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u6EAF\u6E90"}),!!n.is_download&&Z("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u4E0B\u8F7D\u6EAF\u6E90"})]})]})]})}function nse(e,t=[],n=60){const[r,o]=at("");return vt(()=>{o("");let i=0;const a=setInterval(()=>{o(s=>i>=e.length?(clearInterval(a),s):(i++,e.slice(0,i)))},n);return()=>clearInterval(a)},[e,...t]),r}function rse(e){const{assistantList:t,eventsEmit:n,styles:r,selectedId:o,onSelectAssistant:i,productLogo:a}=e,[s,l]=at(1),[c,u]=at(!1),[d,f]=at(""),h=c||d.trim()?6:12,m=tt(),g=tt(!1),p=tt(null),v=tt(null),y=tt("");vt(()=>{o&&m.current!==o&&(n==null||n("conversation:new_assistant_change",{assistantId:o}),m.current=o)},[o,n]);const b=Vt(()=>pa(),[]);vt(()=>{var A;if((A=r==null?void 0:r.theme)!=null&&A.colors){const N=document.createElement("style");return N.innerHTML=ese(r.theme.colors,b),N.id=`g-welcome-styles-${b}`,document.head.appendChild(N),()=>{const M=document.getElementById(N.id);M&&M.remove()}}},[r,b]);const E=Vt(()=>t.find(A=>A.id===o),[t,o]),x=Vt(()=>JSON.parse((E==null?void 0:E.configJson)||"{}"),[E]),w=Vt(()=>{if(!d.trim())return t||[];const A=d.toLowerCase().trim();return(t||[]).filter(N=>{var D,P;const M=((D=N.name)==null?void 0:D.toLowerCase())||"";try{const R=((P=JSON.parse(N.configJson||"{}").config_name)==null?void 0:P.toLowerCase())||"";return M.includes(A)||R.includes(A)}catch{return M.includes(A)}})},[t,d]),k=Math.ceil(((w==null?void 0:w.length)||0)/h),S=(w==null?void 0:w.slice((s-1)*h,s*h))||[];vt(()=>{if(o&&o!==v.current){if(g.current&&p.current!==null){v.current=o;return}const A=d.trim()?w:t;if(A&&A.length>0){const N=A.findIndex(M=>M.id===o);if(N!==-1){const M=Math.floor(N/h)+1;l(M),v.current=o}}}},[o,t,w,h,d]),vt(()=>{if(d!==y.current){if(g.current&&p.current!==null){l(p.current),g.current=!1,p.current=null,y.current=d;return}if(v.current===o){y.current=d;return}g.current||(d.trim()&&(v.current=null),l(1)),y.current=d}},[d,o]),vt(()=>{k>0&&s>k&&l(k)},[k,s]);const O=x.prologue||"\u60A8\u597D\uFF0C\u6B22\u8FCE\u4F7F\u7528\u5C0F\u9CB8\u667A\u80FD\u95EE\u7B54",$=nse(O,[o],30);return et("div",{className:`flex flex-col relative items-center justify-center h-full w-full g-welcome-${b}`,children:[Z("img",{src:a||Qae,alt:"logo",className:"mb-4",style:{width:68,height:68}}),Z("div",{className:"text-3xl font-bold mb-2 g-welcome-title",children:$}),!o&&Z("div",{className:"flex mb-2 g-welcome-subtitle",children:"\u8BF7\u9009\u62E9\u4E00\u4E2A\u667A\u80FD\u52A9\u624B"}),et("div",{style:{maxWidth:"1200px"},className:`flex mt-8 flex-wrap gap-3\r
608
608
  max-w-[1200px] px-8 w-full mx-auto justify-center mb-4`,children:[c?Z("div",{className:"flex items-center gap-2 px-5 w-full",style:{flexBasis:"100%"},children:Z(MC,{className:"g-welcome-search-input w-full",placeholder:"\u641C\u7D22\u52A9\u624B\u540D\u79F0",prefix:Z(i2,{size:16}),suffix:Z("button",{type:"button",onClick:()=>{u(!1),f("")},style:{background:"transparent",border:"none",cursor:"pointer"},children:Z(gp,{size:14})}),value:d,onChange:A=>f(A.target.value),autoFocus:!0})}):Z("button",{type:"button",className:"g-welcome-search-btn",onClick:()=>u(!0),children:Z(i2,{size:16})}),S&&S.length>0?Z(fp,{children:S.map(A=>{const N=o===A.id;let M=A.icon;try{const D=JSON.parse(A.configJson||"{}");M=M||D.icon||D.avatar||D.logo}catch{}return M=M||Jae,Z(MI,{content:()=>Z(tse,{config:t.find(D=>D.id===A.id),styles:r}),trigger:"hover",placement:"bottom",children:et("button",{type:"button",className:`g-welcome-btn px-3 cursor-pointer rounded-full border font-medium min-w-[160px] text-sm transition-all flex items-center gap-2 ${N?"active":""}`,onClick:()=>{i==null||i(A.id);const D=c||d.trim(),I=(D?t:d.trim()?w:t).findIndex(R=>R.id===A.id);if(I!==-1){const j=Math.floor(I/(D?12:h))+1;l(j),v.current=A.id,D&&(p.current=j,g.current=!0,setTimeout(()=>{f(""),u(!1)},100))}},title:A.name,children:[Z("span",{className:"icon-badge",children:Z("img",{src:M,alt:"icon",style:{width:16,height:16,borderRadius:4}})}),Z("span",{className:"truncate max-w-[180px]",children:A.name})]})},A.id)})}):Z("div",{className:"g-welcome-subtitle",children:"\u6682\u65E0\u53EF\u7528\u52A9\u624B"})]}),k>1&&et("div",{className:"flex items-center gap-2",children:[Z("button",{type:"button",className:"g-welcome-pagination-btn",onClick:()=>l(A=>Math.max(1,A-1)),disabled:s===1,children:Z(rW,{size:16})}),Z("div",{className:"flex items-center gap-1",children:(()=>{const A=[];if(k<=7)for(let M=1;M<=k;M++)A.push(M);else if(A.push(1),s<=4){for(let M=2;M<=5;M++)A.push(M);A.push("..."),A.push(k)}else if(s>=k-3){A.push("...");for(let M=k-4;M<=k;M++)A.push(M)}else{A.push("...");for(let M=s-1;M<=s+1;M++)A.push(M);A.push("..."),A.push(k)}return A.map((M,D)=>{if(M==="...")return Z("span",{className:"g-welcome-pagination-text px-1",children:"..."},`ellipsis-${D}`);const P=M;return Z("button",{type:"button",className:`g-welcome-pagination-btn ${s===P?"active":""}`,onClick:()=>l(P),children:P},P)})})()}),Z("button",{type:"button",className:"g-welcome-pagination-btn",onClick:()=>l(A=>Math.min(k,A+1)),disabled:s===k,children:Z(AI,{size:16})})]})]})}async function ose(e,t){const n=e.getReader();let r;for(;!(r=await n.read()).done;)t(r.value)}function ise(e){let t,n,r,o=!1;return function(a){t===void 0?(t=a,n=0,r=-1):t=sse(t,a);const s=t.length;let l=0;for(;n<s;){o&&(t[n]===10&&(l=++n),o=!1);let c=-1;for(;n<s&&c===-1;++n)switch(t[n]){case 58:r===-1&&(r=n-l);break;case 13:o=!0;case 10:c=n;break}if(c===-1)break;e(t.subarray(l,c),r),l=n,r=-1}l===s?t=void 0:l!==0&&(t=t.subarray(l),n-=l)}}function ase(e,t,n){let r=k6();const o=new TextDecoder;return function(a,s){if(a.length===0)n==null||n(r),r=k6();else if(s>0){const l=o.decode(a.subarray(0,s)),c=s+(a[s+1]===32?2:1),u=o.decode(a.subarray(c));switch(l){case"data":r.data=r.data?r.data+`
609
609
  `+u:u;break;case"event":r.event=u;break;case"id":e(r.id=u);break;case"retry":const d=parseInt(u,10);isNaN(d)||t(r.retry=d);break}}}}function sse(e,t){const n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function k6(){return{data:"",event:"",id:"",retry:void 0}}var lse=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const Nw="text/event-stream",cse=1e3,S6="last-event-id";function use(e,t){var{signal:n,headers:r,onopen:o,onmessage:i,onclose:a,onerror:s,openWhenHidden:l,fetch:c}=t,u=lse(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((d,f)=>{const h=Object.assign({},r);h.accept||(h.accept=Nw);let m;function g(){m.abort(),document.hidden||x()}l||document.addEventListener("visibilitychange",g);let p=cse,v=0;function y(){document.removeEventListener("visibilitychange",g),window.clearTimeout(v),m.abort()}n==null||n.addEventListener("abort",()=>{y(),d()});const b=c??window.fetch,E=o??dse;async function x(){var w;m=new AbortController;try{const k=await b(e,Object.assign(Object.assign({},u),{headers:h,signal:m.signal}));await E(k),await ose(k.body,ise(ase(S=>{S?h[S6]=S:delete h[S6]},S=>{p=S},i))),a==null||a(),y(),d()}catch(k){if(!m.signal.aborted)try{const S=(w=s==null?void 0:s(k))!==null&&w!==void 0?w:p;window.clearTimeout(v),v=window.setTimeout(x,S)}catch(S){y(),f(S)}}}x()})}function dse(e){const t=e.headers.get("content-type");if(!(t!=null&&t.startsWith(Nw)))throw new Error(`Expected content-type to be ${Nw}, Actual: ${t}`)}class nv extends Error{}let Po=null,ia=null;const fse=({baseUrl:e,token:t,CSRFToken:n,setChatData:r,activeSessionId:o,setAppStatus:i,setConversationList:a})=>{const s=p=>{if(!p)return!1;if(typeof p=="string"){const v=p.trim();return v!==""&&v!=="[]"&&v!=="null"}return!0},l=({content:p,status:v,respTime:y,filePaths:b,reference:E,webReference:x,graphReference:w,databaseReference:k,llmType:S,resultType:O,queryId:$,tokens:A})=>{r(N=>{var L;if(!N[0])return N;const M=N[0],D=M.messages||[],P=D.length-1;if(P<0)return N;const I=D[P];if(I.istype!=="ai")return N;let R=D.slice();if(b!=null&&b.length){const _=D.length-2;if(_>=0&&((L=D[_])==null?void 0:L.istype)==="user"){const F={...D[_],filePaths:b};R[_]=F}}const j=w!==void 0&&s(w)?w:I.graphReference;v===2&&w!==void 0&&console.log("[AichatUseController] reset_chat status=2 \u65F6\u7684 graphReference:",{graphReference:w,isValid:s(w),lastMessageGraphReference:I.graphReference,finalGraphReference:j});const z={...I,content:(I.content||"")+p,status:v,respTime:y,filePaths:b,reference:E,webReference:x,graphReference:j,databaseReference:k??I.databaseReference,resultType:O,llmType:S,tokens:A,queryId:$||I.queryId||pa(32)};return z.clientSideId=z.clientSideId||z.queryId+"-ai",R[P]=z,[{...M,isNew:!1,messages:R},...N.slice(1)]})},c=p=>{if(p instanceof nv)throw i(v=>({...v,display:"error",sender:"ready"})),Po&&(Po.abort(),Po=null),ia=null,p};return{updateUserFilesMessage:({currentFiles:p})=>{r(v=>{if(!v[0])return v;const y=v[0],b=y.messages||[];if(!b.length)return v;const E=b.length-2;if(E<0||b[E].istype!=="user")return v;const w=b.slice();return w[E]={...b[E],currentFiles:p},[{...y,messages:w},...v.slice(1)]})},api_startChat_re:(p,v)=>{Po&&Po.abort(),Po=new AbortController,ia=p.sessionId;const y=`${e}/qa/ai/question_re`;console.log("data",p);const b={...p};use(y,{method:"post",signal:Po.signal,headers:{"Content-Type":"application/json",Accept:"text/event-stream",Authorization:t||"","X-CSRF-TOKEN-IN":n||""},openWhenHidden:!0,body:JSON.stringify(b),onopen:async E=>{if(E.status===500)throw new nv("Internal Server Error");if(!E.ok)throw new nv(`HTTP error: ${E.status}`)},onmessage:E=>{const x=JSON.parse(E.data);if(ia!==x.sessionId){console.log("[AichatUseController] \u6D41\u5F0F\u8BF7\u6C42\u7684 sessionId \u5DF2\u4E0D\u5339\u914D\uFF0C\u5FFD\u7565\u6570\u636E",{currentStreamSessionId:ia,receivedSessionId:x.sessionId,activeSessionId:o});return}if(o!==x.sessionId)return;const{reply:w,resultType:k,respTime:S,reference:O,webReference:$,graphReference:A,filePaths:N,status:M,docs:D,llmType:P,databaseReference:I}=x,R=N?JSON.parse(N):[];M===2&&w&&w.content&&(w.content.includes("\u6A21\u578B\u6682\u65E0\u6CD5\u8FD4\u56DE")||w.content.includes("\u5931\u8D25")||w.content.includes("\u9519\u8BEF")||w.content.includes("\u8BF7\u7A0D\u540E\u518D\u8BD5"))&&i(z=>({...z,display:"ready",sender:"ready"}));const j=s(A)?A:void 0;if(M===2&&console.log("[AichatUseController] status=2 \u65F6\u7684 graphReference:",{graphReference:A,type:typeof A,isValid:s(A),finalGraphReference:j}),M===2){if(l({content:w.content||"",status:2,respTime:S,filePaths:R,reference:O||D||"",webReference:$||"",graphReference:j,databaseReference:I,llmType:P,resultType:k,queryId:x.queryId,tokens:x.tokens}),i(z=>({...z,display:"ready",sender:"ready"})),v){const z=S||Date.now();console.log("[AichatUseController] \u6D88\u606F\u53D1\u9001\u6210\u529F\uFF0CgmtModified:",z),v(z)}}else l({content:w.content||"",status:M,respTime:S,filePaths:R,reference:O||D||"",webReference:$||"",graphReference:j,databaseReference:I,llmType:P,resultType:k,queryId:x.queryId,tokens:x.tokens})},onerror:c,onclose:()=>{ia===p.sessionId&&(ia=null)}})},addEmptyMessage:({queryId:p,content:v,filePaths:y,currentFiles:b})=>{r(E=>{const x=new Date().toISOString(),w=p||pa(32),k={istype:"user",content:v,time:x,queryId:w,clientSideId:w+"-user",filePaths:y||"",currentFiles:b||[]},S={istype:"ai",content:"",time:new Date(Date.now()+1).toISOString(),streaming:!0,status:0,queryId:w,clientSideId:w+"-ai"},O=E.find($=>$.id===o);return O?O.messages.push(k,S):console.warn("addEmptyMessage called without an active session."),[...E]})},setLastEmptyMessage:({now:p})=>{r(v=>{if(!v[0])return v;const y=v[0],b=y.messages||[];if(!b.length)return v;const E=b.length-1;if(E<0)return v;const x=b[E];if(x.istype!=="ai")return v;const w=b.slice();return w[E]={...x,istype:"ai",content:"",time:p,streaming:!0,status:0},[{...y,messages:w},...v.slice(1)]})},stopStream:()=>{Po&&(Po.abort(),Po=null),ia=null,i(p=>({...p,display:"ready",sender:"ready"}))},cancelStreamBySessionId:p=>Po&&ia===p?(console.log("[AichatUseController] \u5207\u6362\u4F1A\u8BDD\uFF0C\u53D6\u6D88\u6B63\u5728\u8FDB\u884C\u7684\u6D41\u5F0F\u8BF7\u6C42",p),Po.abort(),Po=null,ia=null,i(v=>({...v,display:"ready",sender:"ready"})),!0):!1}},hse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACRSURBVHgB7ZJBCsQgDEWTmQvMncT7dOuqmY3iai6kMN31UmIjdNFFKuk+DwKahP9ABDAMQyTnvHCtT/ZjjIs0e0nN1hr03kkjGTu8+0PEjzR/S81a6+6cQz6S9x5KKdsknLi+IQRSC07JfybRhE8FM4k2fICgIKVE/MYrF427NlwtuEpOgSr8MUNy9x0Nw7jnAFsnZ7Uu5CkqAAAAAElFTkSuQmCC",{TextArea:$6}=MC,{useForm:pse}=Jl,f9={\u56DE\u7B54\u4E0D\u4F73:"ansPoor",\u683C\u5F0F\u95EE\u9898:"formatError",\u7406\u89E3\u95EE\u9898\u6709\u8BEF:"harmfulInfo",\u5176\u4ED6:"othres"},gse=({open:e,setOpen:t,feedBackList:n,handleConfirm:r})=>{const o={header:{padding:"20px 24px",borderBottom:"1px solid #F0F0F0",margin:0},body:{padding:"16px 24px 20px 24px",borderBottom:"1px solid #F0F0F0"},mask:{},footer:{padding:"16px 24px",margin:0},content:{padding:0,borderRadius:"4px",width:"563px"}},[i]=pse(),[a,s]=at({}),l=async()=>{try{const c=await i.validateFields();t(!1);const u={...c};Object.entries(a||{}).forEach(d=>{const[f,h]=d;h&&(u[f9[f]]=h)}),r(u)}catch(c){console.log(c);return}};return vt(()=>{e||(i.resetFields(),s(null))},[e]),Z(hp,{modal:{styles:o},children:et(pp,{open:e,onCancel:()=>t(!1),title:Z("div",{className:"text-[16px] text-[#2A2A2A] font-bold leading-[1]",children:"\u611F\u8C22\u60A8\u7684\u53CD\u9988\uFF01\u8FD9\u5C06\u5E2E\u52A9\u6211\u4EEC\u4E0D\u65AD\u4F18\u5316\u4E0E\u63D0\u5347\u3002"}),footer:et("div",{children:[Z(So,{className:"mr-[16px] w-[76px]",onClick:()=>{t(!1)},children:"\u53D6\u6D88"}),Z(So,{type:"primary",className:"w-[76px] border-none",onClick:l,children:"\u786E\u8BA4"})]}),children:[Z(mse,{feedBackList:n,treeSelectResult:a,setTreeSelectResult:s}),et(Jl,{form:i,layout:"vertical",children:[Z(Jl.Item,{name:"supplementExplain",label:"\u8865\u5145\u63CF\u8FF0",children:Z($6,{})})," ",Z(Jl.Item,{name:"idealAnswer",label:"\u60A8\u89C9\u5F97\u66F4\u597D\u7684\u56DE\u7B54\u662F\u4EC0\u4E48\uFF1F",children:Z($6,{})})]})]})})},mse=({feedBackList:e,treeSelectResult:t,setTreeSelectResult:n})=>{const[r,o]=at(!1),[i,a]=at([]),[s,l]=at([]),[c,u]=at([]),[d,f]=at(null),h=Vt(()=>(l([]),d!=null&&d.items?[{title:"\u5168\u9009",key:"\u5168\u9009",children:d.items.map(g=>({title:g,key:g}))}]:[]),[d]),m=g=>{u(p=>Array.isArray(p)&&Array.isArray(s)?Object.entries(t).reduce((y,b)=>{const[E,x]=b,k=(x?x.split(";"):[]).filter(S=>S!==g);return n(S=>({...S||{},[E]:k.join(";")})),[...y,...k]},[]):p)};return vt(()=>{if(a(["\u5168\u9009"]),!t||!(d!=null&&d.que_name))return;const g=t[d.que_name]||"",p=g?g.split(";"):[];l(p)},[h,r]),vt(()=>{t===null&&(u([]),f(null),l([]))},[t]),vt(()=>{console.log("treeSelectResult",t),console.log("selectedValue",c),console.log("feedBackList",e),console.log("pKey",f9),console.log("selectedParent",d)},[t,c]),et("div",{className:"relative mb-[24px] z-20",children:[et("div",{className:"absolute w-full z-10",children:[et("div",{className:"h-[32px] box-border flex items-center justify-between border-[1px] border-solid border-[#D9D9D9] rounded-[4px] cursor-pointer",onClick:()=>o(!r),children:[Z("div",{className:"ml-[16px]",children:"\u95EE\u9898\u7C7B\u578B"}),Z("img",{src:hse,width:24,height:24,className:"mr-[16px]"})]}),et("div",{style:{display:r?"":"none"},className:"h-[288px] rounded-[4px] shadow-md mt-[4px] bg-white",children:[et("div",{className:"h-[248px] flex",style:{borderBottom:"1px solid #F0F0F0"},children:[Z("div",{className:"w-[203px] px-[8px] py-[8px]",style:{borderRight:"1px solid #F0F0F0"},children:e.map((g,p)=>{var v;return et("div",{className:"rounded-[4px] h-[32px] cursor-pointer flex items-center",style:{backgroundColor:(d==null?void 0:d.que_name)===g.que_name?"#E6F4FF":""},children:[Z("div",{className:"h-full w-full leading-[32px]",onClick:()=>{f(g)},children:et("div",{className:"ml-[8px] text-[14px] text-[#2A2A2A]",children:[g.que_name,"(",t&&t[g.que_name]?t[g.que_name].split(";").length:0,"/",(v=g==null?void 0:g.items)==null?void 0:v.length,")"]})}),Z(AI,{className:"mr-[8px] w-3 h-3 text-[rgba(0,0,0,0.45)]"})]},p)})}),Z("div",{className:"selfTree h-full flex-1 mt-[8px] ml-[16px]",children:Z(QH,{checkable:!0,defaultSelectedKeys:["0-1"],treeData:h,blockNode:!0,checkedKeys:s,expandedKeys:i,onCheck:g=>{Array.isArray(g)&&n(p=>({...p||{},[(d==null?void 0:d.que_name)||""]:(g||[]).filter(v=>v!=="\u5168\u9009").join(";")})),l(g)}})})]}),et("div",{className:"flex justify-end h-[40px] items-center",children:[Z(So,{size:"small",className:"mr-[8px]",onClick:()=>o(!1),children:"\u53D6\u6D88"}),Z(So,{size:"small",type:"primary",className:"border-none mr-[16px]",onClick:()=>{u(g=>Array.isArray(g)&&Array.isArray(s)?Object.values(t).reduce((v,y)=>[...v,...y?y.split(";"):[]],[]):g),o(!1)},children:"\u786E\u8BA4"})]})]})]}),Z("div",{className:"h-[32px]"}),!!(c!=null&&c.length)&&et("div",{children:[et("div",{className:"mt-[5px] text-[12px] text-[#555555]",children:["\u5DF2\u9009\u62E9 ",c.length," \u4E2A"]}),(c||[]).map(g=>{let p="";return Object.entries(t||{}).forEach(v=>{const[y,b]=v;b.indexOf(g)>-1&&(p=y)}),et(UH,{closable:!0,className:"mt-[5px]",onClose:()=>m(g),children:[p,"\uFF08",g,"\uFF09"]},g)})]})]})},A6=e=>e?Array.isArray(e)?e.map(r=>"/minio/"+r.split("/").slice(3).join("/")):"/minio/"+e.split("/").slice(3).join("/"):"",O6="http://10.15.12.13:9000/",vse=e=>{if(typeof e=="string"){const t=e.split(".");return t.length?t[t.length-1]:""}else return""},yse=e=>{var x,w,k,S,O,$,A,N;const{file_type:t,file_name:n,url:r,parse_url:o,retrieve_tags:i,file_id:a,parsed_file_type:s,onlyDownloadTypes:l,references:c,eventsEmit:u,styles:d,isUploadFile:f,type:h,collectionItems:m,pdfPages:g=0,fileManagerData:p}=e;if(h==="collection"&&Array.isArray(m)){const P=`calc(90% - ${.5}px)`,I=m.slice(0,4),R=m.length>4,j="\u6253\u5F00\u5408\u96C6",z=()=>{if(p&&t==="pdf"&&!e.pdfPages){const V=((p==null?void 0:p.uploadedFiles)||[]).find(L=>{var _;return((L==null?void 0:L.name)||((_=L==null?void 0:L.file)==null?void 0:_.name))===n});if(!(V!=null&&V.pdfPages)){rr.warning("\u8BE5PDF\u6587\u4EF6\u672A\u89E3\u6790\u5B8C\u6210\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}u==null||u("reference_file:click",{...e,pdfPages:(V==null?void 0:V.pdfPages)||0})}else u==null||u("reference_file:click",e)};return et("div",{className:"user-file relative group flex flex-col items-center justify-center cursor-pointer backdrop-blur-sm rounded-lg border p-2 text-sm transition-all bg-white shadow",style:{width:94,height:94,minWidth:94,minHeight:94,borderColor:(w=(x=d==null?void 0:d.theme)==null?void 0:x.colors)==null?void 0:w.border},onClick:z,children:[Z("div",{className:"grid grid-cols-2 items-center justify-center grid-rows-2 gap-1 w-full h-full",style:{width:"100%",height:"100%",gap:1},children:I.map((V,L)=>{var T,B,H,G;if(R&&L===3)return Z("div",{className:"flex items-center justify-center bg-gray-100 rounded",style:{width:P,height:P},children:Z("span",{className:"text-xl text-gray-300 font-bold scale-75",children:"..."})},"ellipsis");if(V.file_type==="image"||V.file_type==="jpg"||V.file_type==="jpeg"||V.file_type==="png"||V.file_type==="gif"||V.file_type==="bmp"||V.file_type==="webp")return Z("div",{className:"relative flex items-center justify-center bg-white rounded-lg border overflow-hidden",style:{width:P,height:P,borderColor:(B=(T=d==null?void 0:d.theme)==null?void 0:T.colors)==null?void 0:B.border},children:Z("div",{className:"flex items-center justify-center w-full h-full scale-75",children:Z("img",{src:String(V.url||V.file_path||""),alt:V.file_name||"",className:"object-contain max-w-full max-h-full"})})},V.file_name||L);const F=Mw(String(V.file_type||""),d);return Z("div",{className:"user-file flex flex-col items-center justify-center rounded-lg border bg-gray-50 p-1 text-sm",title:V.file_name,style:{width:P,height:P,borderColor:(G=(H=d==null?void 0:d.theme)==null?void 0:H.colors)==null?void 0:G.border},children:Z("div",{className:"flex items-center justify-center w-full h-full scale-75",children:F})},V.file_name||L)})}),Z("div",{className:"absolute inset-0 bg-transparent group-hover:bg-black/40 transition-all duration-300 flex items-center justify-center rounded-lg pointer-events-none",children:et("div",{className:"flex flex-col items-center text-xs justify-center text-white opacity-0 group-hover:opacity-100 transition-opacity",children:[Z(sm,{size:20,className:"mb-1 text-white"}),Z("span",{className:"text-white text-center",style:{fontSize:12},children:j})]})})]})}const v=()=>{if(console.log(o,"parse_url",r,"url"),p&&t==="pdf"&&!g){const M=((p==null?void 0:p.uploadedFiles)||[]).find(D=>{var P;return((D==null?void 0:D.name)||((P=D==null?void 0:D.file)==null?void 0:P.name))===(n||"").replace(/\s+/g,"")});if(!(M!=null&&M.pdfPages)){rr.warning("\u8BE5PDF\u6587\u4EF6\u672A\u89E3\u6790\u5B8C\u6210\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}u==null||u("reference_file:click",{file:n,file_type:t,url:r,parse_url:o,retrieve_tags:i,file_id:a,parsed_file_type:s,references:c,type:y,isUploadFile:f,pdfPages:M.pdfPages||0})}else u==null||u("reference_file:click",{file:n,file_type:t,url:r,parse_url:o,retrieve_tags:i,file_id:a,parsed_file_type:s,references:c,type:y,isUploadFile:f,pdfPages:g})},y=Vt(()=>(n||"").split(".").pop()||"",[n]),b=Mw(y,d),E=async()=>{if(r){const M=A6(r.indexOf("http")>-1?r:`${O6}/${r}`);if(y.toLowerCase()==="json"){try{const I=await fetch(M);if(!I.ok)throw new Error("\u4E0B\u8F7D\u5931\u8D25");const R=await I.blob(),j=document.createElement("a");j.href=URL.createObjectURL(R),j.download=n||"",document.body.appendChild(j),j.click(),document.body.removeChild(j),setTimeout(()=>URL.revokeObjectURL(j.href),1e3)}catch{alert("\u6587\u4EF6\u4E0B\u8F7D\u5931\u8D25")}return}const P=document.createElement("a");P.href=M,P.download=n||"",document.body.appendChild(P),P.click(),document.body.removeChild(P)}};return l&&l.includes(y.toLowerCase())?et("div",{className:"user-file relative group w-24 h-24 flex flex-col items-center justify-center cursor-pointer backdrop-blur-sm rounded-lg border p-2 text-sm transition-all",title:n,onClick:E,style:{borderColor:(S=(k=d==null?void 0:d.theme)==null?void 0:k.colors)==null?void 0:S.border},children:[b,Z("span",{className:"file-name font-medium truncate text-center px-2 pt-1",style:{fontSize:10,maxWidth:"5.5rem"},children:n}),Z("div",{className:"absolute text-center inset-0 cursor-pointer bg-transparent group-hover:bg-black/40 transition-all duration-300 flex items-center justify-center rounded-lg",children:et("div",{className:"flex flex-col items-center text-xs justify-center text-white opacity-0 group-hover:opacity-100 transition-opacity",children:[Z(sm,{className:"text-white opacity-0 group-hover:opacity-100 transition-opacity mx-auto"}),Z("div",{className:"text-white text-center",style:{fontSize:10},children:"\u4E0B\u8F7D\u6587\u4EF6"})]})})]},n):y==="image"||y==="jpg"||y==="jpeg"||y==="png"||y==="gif"||y==="bmp"||y==="webp"?et("div",{className:"relative group w-24 h-24 cursor-pointer flex items-center justify-center",onClick:()=>v(),children:[r?Z("img",{src:String(A6(r&&r.indexOf("http")>-1?r:`${O6}/${r}`)||""),alt:n||"",className:"w-full h-full object-cover rounded-md border",style:{borderColor:($=(O=d==null?void 0:d.theme)==null?void 0:O.colors)==null?void 0:$.border}}):Z("div",{className:"w-full h-full flex items-center justify-center",children:Z("span",{className:"animate-spin rounded-full border-2 border-gray-300 border-t-blue-500 w-8 h-8 inline-block"})}),Z("div",{className:"absolute inset-0 bg-transparent group-hover:bg-black/40 transition-all duration-300 flex items-center justify-center rounded-md",children:et("div",{className:"flex flex-col items-center text-xs justify-center text-white opacity-0 group-hover:opacity-100 transition-opacity",children:[Z(cW,{className:"text-white opacity-0 group-hover:opacity-100 transition-opacity mx-auto"}),Z("div",{className:"text-white text-center",children:"\u67E5\u770B\u56FE\u7247"})]})})]},n):et("div",{className:"user-file relative group w-24 h-24 flex flex-col items-center justify-center cursor-pointer backdrop-blur-sm rounded-lg border p-2 text-sm transition-all",title:n,onClick:v,style:{borderColor:(N=(A=d==null?void 0:d.theme)==null?void 0:A.colors)==null?void 0:N.border},children:[b,Z("span",{className:"file-name font-medium truncate text-center px-2 pt-1",style:{fontSize:10,maxWidth:"5.5rem"},children:n}),Z("div",{className:"absolute text-center inset-0 cursor-pointer bg-transparent group-hover:bg-black/40 transition-all duration-300 flex items-center justify-center rounded-lg",children:et("div",{className:"flex flex-col items-center text-xs justify-center text-white opacity-0 group-hover:opacity-100 transition-opacity",children:[Z(sm,{className:"text-white opacity-0 group-hover:opacity-100 transition-opacity mx-auto"}),Z("div",{className:"text-white text-center",style:{fontSize:10},children:"\u6253\u5F00\u6587\u4EF6"})]})})]},n)},bse=e=>e?e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/1024/1024).toFixed(1)}MB`:"",xse=({fileName:e,fileSize:t,icon:n,statusText:r,statusColor:o="text-gray-400",statusIcon:i,onRemove:a,themeColors:s={},cardId:l,showRemove:c=!0,disabledRemove:u=!1,onRemoveWithAnim:d,extra:f,style:h})=>et("div",{id:l,className:"group gap-x-2.5 items-center file-display-card relative flex w-[210px] bg-white border border-gray-200 rounded-md shadow-sm px-2 py-1 transition-all hover:shadow-md hover:border-blue-300",style:h,children:[Z("div",{className:"pt-1",children:n}),et("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[et("div",{className:"flex items-center justify-between gap-1",children:[Z("span",{className:"text-[12px] font-medium truncate max-w-[120px]",title:e,children:e}),Z("span",{className:"ml-1 text-[11px] text-gray-400",children:bse(t)})]}),et("div",{className:`text-[10px] mt-0.5 flex items-center gap-3 ${o}`,children:[i,Z("span",{children:r})]})]}),f,c&&!u&&Z("button",{className:"absolute top-0.5 right-0.5 opacity-0 group-hover:opacity-100 transition-opacity text-gray-300 hover:text-red-400 text-xs p-0.5 rounded-full bg-white shadow-sm z-10",onClick:()=>{d&&l?d(l):a&&a()},title:"\u79FB\u9664",style:{lineHeight:0,color:s.error||"#FF0000"},children:Z(gp,{className:"w-3.5 h-3.5"})})]});function Mw(e,t){var r;const n=((r=t==null?void 0:t.theme)==null?void 0:r.icons)||{};switch(e.toLowerCase()){case"docx":case"doc":return n.docx?Z("img",{src:n.docx,alt:"docx",style:{width:20,height:20}}):Z(ar,{type:"rag/word",size:18});case"image":case"jpg":case"jpeg":case"png":case"gif":case"bmp":case"webp":case"svg":case"ico":return n.image?Z("img",{src:n.image,alt:"image",style:{width:20,height:20}}):Z(ar,{type:"rag/pic",size:18});case"pptx":case"ppt":return n.pptx?Z("img",{src:n.pptx,alt:"pptx",style:{width:20,height:20}}):Z(ar,{type:"rag/ppt",size:18});case"sheets":case"excel":case"xls":case"csv":case"xlsx":case"xlsm":case"xlsb":case"xltx":case"xltm":case"xlt":case"xlam":return n.sheets?Z("img",{src:n.sheets,alt:"sheets",style:{width:20,height:20}}):Z(ar,{type:"rag/excel",size:18});case"pdf":return n.pdf?Z("img",{src:n.pdf,alt:"pdf",style:{width:20,height:20}}):Z(ar,{type:"rag/pdf",size:18});case"txt":return n.txt?Z("img",{src:n.txt,alt:"txt",style:{width:20,height:20}}):Z(ar,{type:"rag/txt",size:18});case"md":return n.md?Z("img",{src:n.md,alt:"txt",style:{width:20,height:20}}):Z(ar,{type:"rag/document",size:18});case"json":return n.json?Z("img",{src:n.json,alt:"json",style:{width:20,height:20}}):Z(ar,{type:"rag/json",size:18});case"html":case"htm":return n.html?Z("img",{src:n.html,alt:"html",style:{width:20,height:20}}):Z(ar,{type:"rag/url",size:18});case"xml":default:return Z(ar,{type:"rag/file",size:18})}}const Ese=[{file:{name:"\u4EA7\u54C1\u9700\u6C42\u6587\u6863.pdf",size:1024*1024*2.5,type:"application/pdf"},type:"pdf",status:"uploaded",url:"https://example.com/file1.pdf"},{file:{name:"\u6570\u636E\u5206\u6790\u62A5\u544A.xlsx",size:1024*1024*1.2,type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},type:"excel",status:"uploaded",url:"https://example.com/file3.xlsx"},{file:{name:"\u7CFB\u7EDF\u67B6\u6784\u56FE.png",size:1024*512,type:"image/png"},type:"image",status:"uploaded",url:"https://example.com/file2.png"}];function wse({open:e,onCancel:t,files:n=Ese,currentFiles:r=[],onUpload:o,onRemoveFile:i,styles:a,eventsEmit:s}){const l={pending:"\u5F85\u4E0A\u4F20",uploading:"\u4E0A\u4F20\u4E2D",uploaded:"\u5DF2\u4E0A\u4F20",analyzing:"\u89E3\u6790\u4E2D",analyze_failed:"\u89E3\u6790\u5931\u8D25",error:"\u5931\u8D25"},[c,u]=at([]),d=(g,p)=>{s&&s("uploaded_file:removeFromTemp",{file:g,idx:p})},f=a&&a.theme&&a.theme.colors?a.theme.colors:{primary:"#007bff",secondary:"#6c757d",success:"#008000",warning:"#FFA500",error:"#FF0000",info:"#0000FF",background:"#f8f9fa",text:"#343a40",border:"#dee2e6",disabled:"#808080",disabledBackground:"#F5F5F5",disabledText:"#808080",shadow:"#000000",appBackground:"#fff"},h=n.map((g,p)=>et("div",{className:"relative flex flex-col gap-2.5 items-center justify-center",children:[Z("div",{className:"absolute right-1 top-1 z-10",children:Z(FI,{title:"\u786E\u8BA4\u4ECE\u4E34\u65F6\u5BF9\u8BDD\u77E5\u8BC6\u5E93\u79FB\u9664\u8BE5\u6587\u4EF6\uFF1F",onConfirm:()=>d(g,p),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",children:Z("button",{className:"bg-white cursor-pointer rounded-full p-0.5",style:{lineHeight:0,color:f&&f.text?f.text:"#FF0000",transition:"background 0.2s, color 0.2s"},onMouseOver:v=>{v.currentTarget.style.color=f&&f.error?f.error:"#FF0000"},onMouseOut:v=>{v.currentTarget.style.color=f.text},title:"\u79FB\u9664",children:Z(gp,{className:"w-3 h-3"})})})}),Z(yse,{file_type:vse(g.file.name||g.name),file_name:g.name||g.file.name,url:g.url,retrieve_tags:[],styles:a,isUploadFile:!0,eventsEmit:s,parse_url:g.convertedFilePath,pdfPages:g.pdfPages||0})]},g.file.name+p)),m=r.map((g,p)=>{const v=g.file.name.split(".").pop()||"",y=Mw(v,a);return Z(xse,{cardId:`pending-file-card-${p}`,fileName:g.file.name,fileSize:g.file.size,icon:y,statusText:l[g.status||"pending"],statusColor:"text-gray-400",showRemove:!0,onRemove:()=>i&&i(g,p,"pending"),themeColors:f,style:{boxShadow:"none",height:55,background:"#f8fafc"}},g.file.name+p)});return c.length>0?(f&&f.error&&f.error,f&&f.error&&f.error+"",f&&f.error&&f.error):(f&&f.disabledText&&f.disabledText,f&&f.disabledBackground&&f.disabledBackground,f&&f.disabledText&&f.disabledText),et(pp,{open:e,onCancel:t,footer:null,title:"\u5BF9\u8BDD\u4E34\u65F6\u6587\u4EF6\u77E5\u8BC6\u5E93",closable:!1,width:800,styles:{body:{padding:"0",maxHeight:"70vh",overflow:"auto"}},children:[et("div",{className:"file-manager-modal space-y-6 px-4 py-4",children:[et("div",{className:"",children:[Z("div",{className:"flex items-center mb-2 justify-between",children:et("div",{className:"flex items-center",children:[Z("span",{className:"text-xs font-semibold text-gray-700",children:"\u5DF2\u4E0A\u4F20\u6587\u4EF6"}),et("span",{className:"ml-2 text-xs text-gray-400",children:[n.length," \u4E2A"]})]})}),Z("div",{className:"w-full relative min-h-[200px] max-h-[260px] p-2 overflow-y-auto",style:{overflowX:"hidden"},children:Z("div",{className:"flex flex-wrap gap-1",children:h.length>0?h:Z("div",{className:"flex items-center w-full h-full py-10 justify-center text-gray-400 text-sm",children:"\u6682\u65E0\u5DF2\u4E0A\u4F20\u6587\u4EF6"})})})]}),et("div",{children:[et("div",{className:"flex items-center mb-2",children:[Z("span",{className:"text-xs font-semibold text-gray-700",children:"\u5F85\u4E0A\u4F20\u6587\u4EF6"}),et("span",{className:"ml-2 text-xs text-gray-400",children:[r.length," \u4E2A"]})]}),et("div",{className:"flex gap-2 overflow-x-auto pb-2",children:[m,Z(TC.Dragger,{multiple:!0,showUploadList:!1,beforeUpload:(g,p)=>(g===p[0]&&(o==null||o(p)),!1),className:"!bg-gray-50 !border-dashed !border-gray-300 hover:!border-blue-400 cursor-pointer min-w-[160px] max-w-[220px] flex flex-row items-center justify-center border-2 rounded-lg transition-all",style:{height:45,boxShadow:"none",padding:0},children:et("div",{className:"flex flex-row items-center pb-8 justify-center",children:[Z(NI,{size:20,className:"text-blue-400 mr-2"}),Z("div",{className:"text-xs text-gray-500",children:"\u4E0A\u4F20\u6587\u4EF6"})]})})]})]}),Z("div",{className:"flex justify-end gap-2",children:Z(So,{type:"primary",onClick:t,children:"\u786E\u8BA4"})})]}),Z("style",{children:`
610
610
  .file-manager-modal .ant-upload-wrapper,
package/database.js CHANGED
@@ -1,4 +1,4 @@
1
- import{jsxs as Z,jsx as l,Fragment as De}from"react/jsx-runtime";import{useState as y,useMemo as T,useRef as K,useEffect as me}from"react";import{J as Q,s as ge,m as be}from"./assets/index-x8IlxRuv.js";import{b as ye,T as Ee,d as Fe,i as O}from"./assets/index-g-SUxfJH.js";import{O as $}from"./assets/index-DwoTKC3G.js";import{M as ee,s as H}from"./assets/style-CGmZ5osp.js";/* empty css */import"react-dom";const pe=({url:m,token:z,role:B,eventsEmit:F})=>{const c=ye.create({baseURL:m,timeout:1e6});return c.interceptors.request.use(e=>{let t=z;return!t&&!["user/login","user/kaptcha","user/regist"].some(u=>e.url.includes(u))?(F&&F("request:error_auth",{errorMsg:"\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F",redirect:"/login"}),Promise.reject(new Error("\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F"))):(e.headers.Authorization=t||"",e.headers.userName=B==="\u672A\u767B\u5F55\u7528\u6237"?"":B,e)}),c.interceptors.response.use(e=>{const t=["user/kaptcha"],r=e.data;if(t.some(p=>e.config.url&&e.config.url.includes(p))||r.size&&r.type)return r;const{success:u,errorMsg:g,errorCode:D}=r;return u?r:(F&&F("request:error_business",{errorCode:D,errorMsg:g||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",response:r}),!1)},async e=>{var t,r,u,g,D,p,A,h,N;if(e.message==="canceled")return Promise.reject(e);if(F){let d="request:error_network",v={errorMsg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:e};((t=e==null?void 0:e.response)==null?void 0:t.status)===401?(d="request:error_auth",v={errorMsg:"\u6CA1\u6709\u8DB3\u591F\u6743\u9650",error:e,redirect:"/login"}):(((u=(r=e==null?void 0:e.response)==null?void 0:r.data)==null?void 0:u.errorCode)==="30013"||((D=(g=e==null?void 0:e.response)==null?void 0:g.data)==null?void 0:D.errorCode)==="30023")&&(d="request:error_business",v={errorCode:(A=(p=e==null?void 0:e.response)==null?void 0:p.data)==null?void 0:A.errorCode,errorMsg:((N=(h=e==null?void 0:e.response)==null?void 0:h.data)==null?void 0:N.errorMsg)||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",error:e}),F(d,v)}return console.log("Error occurs",e),Promise.reject(e)}),{getDatabaseList:async e=>{try{const t=await c.get(`/queryPageDBList?${new URLSearchParams(e).toString()}`),{success:r,data:u}=t;if(r)return u}catch(t){console.log("getDatabaseList error:",t)}},getShareDatabaseList:async e=>{try{const t=await c.get(`/queryShareDBList?${new URLSearchParams(e).toString()}`),{success:r,data:u}=t;if(r)return u}catch(t){console.log("getShareDatabaseList error:",t)}},delDatabaseById:async(e,t)=>{const r=q(t);try{const u=await c.delete(`/${r}/deleteDB/${e}`),{success:g,data:D}=u;if(g)return D}catch(u){console.log("delDatabaseById error:",u)}},saveDatabase:async(e,t)=>{const r=q(t);try{const u=await c.post(`/${r}/saveDBInfo`,e),{success:g,data:D}=u;if(g)return D}catch(u){console.log("saveDatabase error:",u)}},testConnection:async e=>{try{const t=await c.post("/directDB/testConnect",e),{success:r,data:u}=t;if(r)return u}catch(t){console.log("testConnection error:",t)}},syncSchema:async e=>{try{const t=await c.get(`/directDB/syncSchema/${e}`),{success:r,data:u}=t;if(r)return u}catch(t){console.log("syncSchema error:",t)}}}},q=m=>m=="DataTable"?"dataTable":"directDB",Ie="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzYiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCAzNiAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE0IDEyQzE0IDEwLjg5NTQgMTQuODk1NCAxMCAxNiAxMEgyOUMzMS4yMDkxIDEwIDMzIDExLjc5MDkgMzMgMTRWMjZDMzMgMzAuNDE4MyAyOS40MTgzIDM0IDI1IDM0SDE2QzE0Ljg5NTQgMzQgMTQgMzMuMTA0NiAxNCAzMlYxMloiIGZpbGw9InVybCgjcGFpbnQwX2xpbmVhcl80NDcyXzE4MDUyKSIvPgo8Zm9yZWlnbk9iamVjdCB4PSItMSIgeT0iLTEiIHdpZHRoPSIzMiIgaGVpZ2h0PSIzNiI+PGRpdiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94aHRtbCIgc3R5bGU9ImJhY2tkcm9wLWZpbHRlcjpibHVyKDJweCk7Y2xpcC1wYXRoOnVybCgjYmdibHVyXzBfNDQ3Ml8xODA1Ml9jbGlwX3BhdGgpO2hlaWdodDoxMDAlO3dpZHRoOjEwMCUiPjwvZGl2PjwvZm9yZWlnbk9iamVjdD48ZyBkYXRhLWZpZ21hLWJnLWJsdXItcmFkaXVzPSI0Ij4KPHBhdGggZD0iTTMgN0MzIDQuNzkwODYgNC43OTA4NiAzIDcgM0gyM0MyNS4yMDkxIDMgMjcgNC43OTA4NiAyNyA3VjE5QzI3IDI1LjYyNzQgMjEuNjI3NCAzMSAxNSAzMUg3QzQuNzkwODYgMzEgMyAyOS4yMDkxIDMgMjdWN1oiIGZpbGw9IndoaXRlIiBmaWxsLW9wYWNpdHk9IjAuNDYiLz4KPHBhdGggZD0iTTcgMy4yNUgyM0MyNS4wNzExIDMuMjUgMjYuNzUgNC45Mjg5MyAyNi43NSA3VjE5QzI2Ljc1IDI1LjQ4OTMgMjEuNDg5MyAzMC43NSAxNSAzMC43NUg3QzQuOTI4OTMgMzAuNzUgMy4yNSAyOS4wNzExIDMuMjUgMjdWN0MzLjI1IDQuOTI4OTMgNC45Mjg5MyAzLjI1IDcgMy4yNVoiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS1vcGFjaXR5PSIwLjM0IiBzdHJva2Utd2lkdGg9IjAuNSIvPgo8L2c+CjxnIGZpbHRlcj0idXJsKCNmaWx0ZXIxX2RfNDQ3Ml8xODA1MikiPgo8cGF0aCBkPSJNMTQgMTlWMTEuNjY2NyIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIxLjgzOTcyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPHBhdGggZD0iTTExIDE0TDEyIDEzTDE0IDExTDE2IDEzTDE3IDE0IiBzdHJva2U9IndoaXRlIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8cGF0aCBkPSJNMTAgMjJIMTgiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iYmdibHVyXzBfNDQ3Ml8xODA1Ml9jbGlwX3BhdGgiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEgMSkiPjxwYXRoIGQ9Ik0zIDdDMyA0Ljc5MDg2IDQuNzkwODYgMyA3IDNIMjNDMjUuMjA5MSAzIDI3IDQuNzkwODYgMjcgN1YxOUMyNyAyNS42Mjc0IDIxLjYyNzQgMzEgMTUgMzFIN0M0Ljc5MDg2IDMxIDMgMjkuMjA5MSAzIDI3VjdaIi8+CjwvY2xpcFBhdGg+PGZpbHRlciBpZD0iZmlsdGVyMV9kXzQ0NzJfMTgwNTIiIHg9IjUiIHk9IjYiIHdpZHRoPSIxOCIgaGVpZ2h0PSIyMSIgZmlsdGVyVW5pdHM9InVzZXJTcGFjZU9uVXNlIiBjb2xvci1pbnRlcnBvbGF0aW9uLWZpbHRlcnM9InNSR0IiPgo8ZmVGbG9vZCBmbG9vZC1vcGFjaXR5PSIwIiByZXN1bHQ9IkJhY2tncm91bmRJbWFnZUZpeCIvPgo8ZmVDb2xvck1hdHJpeCBpbj0iU291cmNlQWxwaGEiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAxMjcgMCIgcmVzdWx0PSJoYXJkQWxwaGEiLz4KPGZlT2Zmc2V0Lz4KPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iMiIvPgo8ZmVDb21wb3NpdGUgaW4yPSJoYXJkQWxwaGEiIG9wZXJhdG9yPSJvdXQiLz4KPGZlQ29sb3JNYXRyaXggdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAuMzk2MDc4IDAgMCAwIDAgMC45ODQzMTQgMCAwIDAgMC40IDAiLz4KPGZlQmxlbmQgbW9kZT0ibm9ybWFsIiBpbjI9IkJhY2tncm91bmRJbWFnZUZpeCIgcmVzdWx0PSJlZmZlY3QxX2Ryb3BTaGFkb3dfNDQ3Ml8xODA1MiIvPgo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9ImVmZmVjdDFfZHJvcFNoYWRvd180NDcyXzE4MDUyIiByZXN1bHQ9InNoYXBlIi8+CjwvZmlsdGVyPgo8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50MF9saW5lYXJfNDQ3Ml8xODA1MiIgeDE9IjIzLjUiIHkxPSIxMCIgeDI9IjIzLjUiIHkyPSIzNCIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSIjNjRBMEZEIi8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzAxNUFGRiIvPgo8L2xpbmVhckdyYWRpZW50Pgo8L2RlZnM+Cjwvc3ZnPgo=",fe=""+new URL("assets/database_connect.svg",import.meta.url).href,Me=""+new URL("assets/MySQL.svg",import.meta.url).href,Ce=""+new URL("assets/SQLServer.png",import.meta.url).href,Ae=""+new URL("assets/PostgreSQL.png",import.meta.url).href,he=""+new URL("assets/Doris.png",import.meta.url).href,Be=[{label:"MySQL",value:"MySQL",icon:Me},{label:"PostgreSQL",value:"PostgreSQL",icon:Ae},{label:"SQLServer",value:"SQLServer",icon:Ce},{label:"Doris",value:"Doris",icon:he}],we=({drawerTitle:m,drawerVisible:z,isConnectSuccess:B,handleDrawerClose:F,dbInfo:c,dbType:n,eventsEmit:f})=>{const[G,W]=y(!1),[R,w]=y(!1),[e,t]=y({}),[r,u]=y(!1),g=T(()=>({id:n,layout:"vertical",formWidth:"500px",fields:[{id:"name",name:"name",label:"\u6570\u636E\u5E93\u540D\u79F0",type:"input",required:!0,placeholder:"\u4EC5\u652F\u6301\u6C49\u5B57\u3001\u6570\u5B57\u3001\u82F1\u6587\u3001\u7B26\u53F7",validate:a=>{if(!a)return"\u6570\u636E\u5E93\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A";if(!/[\u4E00-\u9FA5A-Za-z0-9\W]/.test(a))return"\u4EC5\u652F\u6301\u6C49\u5B57\u3001\u6570\u5B57\u3001\u82F1\u6587\u3001\u7B26\u53F7"},counter:100},{id:"description",name:"description",label:"\u6570\u636E\u5E93\u63CF\u8FF0",type:"textarea",counter:150,required:!1,placeholder:"\u8BF7\u8F93\u5165\u6570\u636E\u5E93\u63CF\u8FF0,\u6B64\u63CF\u8FF0\u4EC5\u7528\u4E8E\u533A\u5206\u4E0D\u540C\u6570\u636E\u5E93,\u4E0D\u4F1A\u5F71\u54CD\u6570\u636E\u5E93\u8C03\u7528",defaultValue:""}]}),[n,c]),D=T(()=>({id:n,layout:"vertical",formWidth:"470px",fields:[{id:"name",name:"name",label:"\u6570\u636E\u5E93\u540D\u79F0",type:"input",required:!0,placeholder:"\u4EC5\u652F\u6301\u6C49\u5B57\u3001\u6570\u5B57\u3001\u82F1\u6587\u3001\u7B26\u53F7",validate:a=>{if(!a)return"\u6570\u636E\u5E93\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A";if(!/[\u4E00-\u9FA5A-Za-z0-9\W]/.test(a))return"\u4EC5\u652F\u6301\u6C49\u5B57\u3001\u6570\u5B57\u3001\u82F1\u6587\u3001\u7B26\u53F7"},counter:100},{id:"description",name:"description",label:"\u6570\u636E\u5E93\u63CF\u8FF0",type:"textarea",required:!1,counter:150,placeholder:"\u8BF7\u8F93\u5165\u6570\u636E\u5E93\u63CF\u8FF0,\u6B64\u63CF\u8FF0\u4EC5\u7528\u4E8E\u533A\u5206\u4E0D\u540C\u6570\u636E\u5E93,\u4E0D\u4F1A\u5F71\u54CD\u6570\u636E\u5E93\u8C03\u7528",defaultValue:""},{id:"db-info",label:"\u76F4\u8FDE\u6570\u636E\u6E90\u4FE1\u606F",type:"title",level:2},{id:"dbType",name:"dbType",label:"\u6570\u636E\u6E90\u7C7B\u578B",type:"select",disabled:!!c,required:!0,options:Be.map(a=>{const{label:i,value:I,icon:x}=a;return{label:i,value:I,render:()=>Z("div",{className:"flex items-center gap-2",children:[l("img",{src:x,width:24}),l("span",{children:i})]})}})},{id:"dbHost",name:"dbHost",label:"\u4E3B\u673A\u5730\u5740",type:"input",required:!0,disabled:!!c,placeholder:"\u8BF7\u8F93\u5165IP\u5730\u5740\u6216\u8005\u57DF\u540D"},{id:"dbPort",name:"dbPort",label:"\u7AEF\u53E3\u53F7",type:"number",required:!0,disabled:!!c,placeholder:"\u8BF7\u8F93\u5165\u7AEF\u53E3\u540D\u79F0"},{id:"dbDatabase",name:"dbDatabase",label:"\u8FDE\u63A5\u6570\u636E\u5E93\u540D",disabled:!!c,placeholder:"\u8BF7\u8F93\u5165\u8FDE\u63A5\u6570\u636E\u5E93\u540D",required:!0,type:"input"},{type:"col",children:[{id:"dbUser",type:"input",name:"dbUser",label:"\u7528\u6237\u540D",disabled:!!c,placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u540D",required:!0},{id:"dbPassword",type:"password",name:"dbPassword",label:"\u5BC6\u7801",placeholder:"\u8BF7\u8F93\u5165\u5BC6\u7801",required:!0,disabled:r?!1:!!c}]}]}),[n,c,r]),p=K(null),A=(a,i,I)=>{switch(console.log("[Form] eventsEmit:",a,i,I),a){case"form:ready":i.formRef&&(p.current=i.formRef);break;case"form_field_change":console.log("\u5B57\u6BB5\u503C\u53D8\u5316:",i),t(x=>({...x,[i.fieldId]:i.value}));break;case"form_validation_error":console.log("\u8868\u5355\u9A8C\u8BC1\u9519\u8BEF:",i);break;default:console.log("\u672A\u5904\u7406\u7684\u4E8B\u4EF6:",a,i)}f==null||f(a,i,I)},h=async()=>{try{W(!0);const a=await p.current.getAllData();a.isValid&&(console.log(a,"==="),n=="DirectDB"&&m=="\u7F16\u8F91\u6570\u636E\u5E93"&&!r&&(a.fields=a.fields.filter(i=>i.name=="name"||i.name=="description")),await f("form_submitted",a,void 0),u(!1))}catch(a){console.error("\u274C \u63D0\u4EA4\u8868\u5355\u6570\u636E\u5931\u8D25:",a)}finally{W(!1)}},N=async()=>{try{w(!0);const a=await p.current.getAllData();if(a.isValid){const i=a.fields.reduce((I,x)=>(I[x.name]=x.value,I),{});await f("form:connect_test",i,void 0)}}catch{w(!1)}finally{w(!1)}},d=T(()=>{const a=n=="DataTable"?g:D;return{label:"\u52A8\u6001\u8868\u5355\u793A\u4F8B",defaultActiveId:a.id,model:null,views:[{label:"\u7528\u6237\u6CE8\u518C\u8868\u5355",id:a.id,type:"form",size:"md",formWidth:a.formWidth,formConfig:{layout:a.layout,showReset:!1,showSubmit:!1,formWidth:a.formWidth,getFormData:()=>({...e,timestamp:new Date().toISOString(),formId:a.id}),onFieldChange:(i,I)=>{A("form_field_change",{fieldId:i,value:I},void 0)},onValidationError:i=>{A("form_validation_error",i,void 0)}}}],dataSource:[{id:a.id,fields:a.fields,defaultValues:{...c}}],eventsEmit:A}},[n,g,D,z,c]),v=T(()=>n=="DirectDB"?c?r&&!B:!B:!1,[n,B,r,z]);return Z(ee,{title:m,width:620,onCancel:()=>{F(),u(!1)},open:z,destroyOnHidden:!0,footer:Z("div",{className:"flex justify-end gap-3",style:{justifyContent:"end"},children:[l(Q,{mode:"default",label:"\u53D6\u6D88",onClick:()=>{F(),u(!1)}}),l(Q,{mode:"primary",label:"\u786E\u8BA4",loading:G,disabled:v,onClick:h})]}),children:[l($,{...d},"example-form"),n==="DirectDB"&&l(De,{children:m=="\u7F16\u8F91\u6570\u636E\u5E93"&&!r?l(Q,{mode:"primary",className:"mt-[10px]",label:"\u4FEE\u6539\u5BC6\u7801",onClick:()=>{u(!0),p.current.setValues({dbPassword:void 0})}}):l(Ee,{title:"\u9700\u901A\u8FC7\u6D4B\u8BD5\u624D\u53EF\u521B\u5EFA\u6210\u529F",children:l(Q,{mode:"primary",className:"mt-[10px]",label:"\u8FDE\u63A5\u6D4B\u8BD5",loading:R,onClick:N})})})]})},Ne=""+new URL("assets/empty.png",import.meta.url).href,{confirm:ve}=ee,xe=Fe.div`
1
+ import{jsxs as L,jsx as n,Fragment as De}from"react/jsx-runtime";import{useState as F,useMemo as W,useRef as $,useEffect as me}from"react";import{J,s as be,m as ye}from"./assets/index-x8IlxRuv.js";import{b as Fe,T as Ie,d as ge,i as O}from"./assets/index-g-SUxfJH.js";import{O as K}from"./assets/index-DwoTKC3G.js";import{M as ee,s as R}from"./assets/style-CGmZ5osp.js";/* empty css */import"react-dom";const Ee=({url:m,token:v,role:B,eventsEmit:g})=>{const c=Fe.create({baseURL:m,timeout:1e6});return c.interceptors.request.use(e=>{let t=v;return!t&&!["user/login","user/kaptcha","user/regist"].some(u=>e.url.includes(u))?(g&&g("request:error_auth",{errorMsg:"\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F",redirect:"/login"}),Promise.reject(new Error("\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F"))):(e.headers.Authorization=t||"",e.headers.userName=B==="\u672A\u767B\u5F55\u7528\u6237"?"":B,e)}),c.interceptors.response.use(e=>{const t=["user/kaptcha"],r=e.data;if(t.some(E=>e.config.url&&e.config.url.includes(E))||r.size&&r.type)return r;const{success:u,errorMsg:b,errorCode:D}=r;return u?r:(g&&g("request:error_business",{errorCode:D,errorMsg:b||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",response:r}),!1)},async e=>{var t,r,u,b,D,E,C,h,w;if(e.message==="canceled")return Promise.reject(e);if(g){let d="request:error_network",j={errorMsg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:e};((t=e==null?void 0:e.response)==null?void 0:t.status)===401?(d="request:error_auth",j={errorMsg:"\u6CA1\u6709\u8DB3\u591F\u6743\u9650",error:e,redirect:"/login"}):(((u=(r=e==null?void 0:e.response)==null?void 0:r.data)==null?void 0:u.errorCode)==="30013"||((D=(b=e==null?void 0:e.response)==null?void 0:b.data)==null?void 0:D.errorCode)==="30023")&&(d="request:error_business",j={errorCode:(C=(E=e==null?void 0:e.response)==null?void 0:E.data)==null?void 0:C.errorCode,errorMsg:((w=(h=e==null?void 0:e.response)==null?void 0:h.data)==null?void 0:w.errorMsg)||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",error:e}),g(d,j)}return console.log("Error occurs",e),Promise.reject(e)}),{getDatabaseList:async e=>{try{const t=await c.get(`/queryPageDBList?${new URLSearchParams(e).toString()}`),{success:r,data:u}=t;if(r)return u}catch(t){console.log("getDatabaseList error:",t)}},getShareDatabaseList:async e=>{try{const t=await c.get(`/queryShareDBList?${new URLSearchParams(e).toString()}`),{success:r,data:u}=t;if(r)return u}catch(t){console.log("getShareDatabaseList error:",t)}},delDatabaseById:async(e,t)=>{const r=q(t);try{const u=await c.delete(`/${r}/deleteDB/${e}`),{success:b,data:D}=u;if(b)return D}catch(u){console.log("delDatabaseById error:",u)}},saveDatabase:async(e,t)=>{const r=q(t);try{const u=await c.post(`/${r}/saveDBInfo`,e),{success:b,data:D}=u;if(b)return D}catch(u){console.log("saveDatabase error:",u)}},testConnection:async e=>{try{const t=await c.post("/directDB/testConnect",e),{success:r,data:u}=t;if(r)return u}catch(t){console.log("testConnection error:",t)}},syncSchema:async e=>{try{const t=await c.get(`/directDB/syncSchema/${e}`),{success:r,data:u}=t;if(r)return u}catch(t){console.log("syncSchema error:",t)}}}},q=m=>m=="DataTable"?"dataTable":"directDB",Me="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzYiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCAzNiAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik0xNCAxMkMxNCAxMC44OTU0IDE0Ljg5NTQgMTAgMTYgMTBIMjlDMzEuMjA5MSAxMCAzMyAxMS43OTA5IDMzIDE0VjI2QzMzIDMwLjQxODMgMjkuNDE4MyAzNCAyNSAzNEgxNkMxNC44OTU0IDM0IDE0IDMzLjEwNDYgMTQgMzJWMTJaIiBmaWxsPSJ1cmwoI3BhaW50MF9saW5lYXJfNDQ3Ml8xODA1MikiLz4NCjxmb3JlaWduT2JqZWN0IHg9Ii0xIiB5PSItMSIgd2lkdGg9IjMyIiBoZWlnaHQ9IjM2Ij48ZGl2IHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hodG1sIiBzdHlsZT0iYmFja2Ryb3AtZmlsdGVyOmJsdXIoMnB4KTtjbGlwLXBhdGg6dXJsKCNiZ2JsdXJfMF80NDcyXzE4MDUyX2NsaXBfcGF0aCk7aGVpZ2h0OjEwMCU7d2lkdGg6MTAwJSI+PC9kaXY+PC9mb3JlaWduT2JqZWN0PjxnIGRhdGEtZmlnbWEtYmctYmx1ci1yYWRpdXM9IjQiPg0KPHBhdGggZD0iTTMgN0MzIDQuNzkwODYgNC43OTA4NiAzIDcgM0gyM0MyNS4yMDkxIDMgMjcgNC43OTA4NiAyNyA3VjE5QzI3IDI1LjYyNzQgMjEuNjI3NCAzMSAxNSAzMUg3QzQuNzkwODYgMzEgMyAyOS4yMDkxIDMgMjdWN1oiIGZpbGw9IndoaXRlIiBmaWxsLW9wYWNpdHk9IjAuNDYiLz4NCjxwYXRoIGQ9Ik03IDMuMjVIMjNDMjUuMDcxMSAzLjI1IDI2Ljc1IDQuOTI4OTMgMjYuNzUgN1YxOUMyNi43NSAyNS40ODkzIDIxLjQ4OTMgMzAuNzUgMTUgMzAuNzVIN0M0LjkyODkzIDMwLjc1IDMuMjUgMjkuMDcxMSAzLjI1IDI3VjdDMy4yNSA0LjkyODkzIDQuOTI4OTMgMy4yNSA3IDMuMjVaIiBzdHJva2U9IndoaXRlIiBzdHJva2Utb3BhY2l0eT0iMC4zNCIgc3Ryb2tlLXdpZHRoPSIwLjUiLz4NCjwvZz4NCjxnIGZpbHRlcj0idXJsKCNmaWx0ZXIxX2RfNDQ3Ml8xODA1MikiPg0KPHBhdGggZD0iTTE0IDE5VjExLjY2NjciIHN0cm9rZT0id2hpdGUiIHN0cm9rZS13aWR0aD0iMS44Mzk3MiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+DQo8cGF0aCBkPSJNMTEgMTRMMTIgMTNMMTQgMTFMMTYgMTNMMTcgMTQiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+DQo8cGF0aCBkPSJNMTAgMjJIMTgiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+DQo8L2c+DQo8ZGVmcz4NCjxjbGlwUGF0aCBpZD0iYmdibHVyXzBfNDQ3Ml8xODA1Ml9jbGlwX3BhdGgiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEgMSkiPjxwYXRoIGQ9Ik0zIDdDMyA0Ljc5MDg2IDQuNzkwODYgMyA3IDNIMjNDMjUuMjA5MSAzIDI3IDQuNzkwODYgMjcgN1YxOUMyNyAyNS42Mjc0IDIxLjYyNzQgMzEgMTUgMzFIN0M0Ljc5MDg2IDMxIDMgMjkuMjA5MSAzIDI3VjdaIi8+DQo8L2NsaXBQYXRoPjxmaWx0ZXIgaWQ9ImZpbHRlcjFfZF80NDcyXzE4MDUyIiB4PSI1IiB5PSI2IiB3aWR0aD0iMTgiIGhlaWdodD0iMjEiIGZpbHRlclVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgY29sb3ItaW50ZXJwb2xhdGlvbi1maWx0ZXJzPSJzUkdCIj4NCjxmZUZsb29kIGZsb29kLW9wYWNpdHk9IjAiIHJlc3VsdD0iQmFja2dyb3VuZEltYWdlRml4Ii8+DQo8ZmVDb2xvck1hdHJpeCBpbj0iU291cmNlQWxwaGEiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAxMjcgMCIgcmVzdWx0PSJoYXJkQWxwaGEiLz4NCjxmZU9mZnNldC8+DQo8ZmVHYXVzc2lhbkJsdXIgc3RkRGV2aWF0aW9uPSIyIi8+DQo8ZmVDb21wb3NpdGUgaW4yPSJoYXJkQWxwaGEiIG9wZXJhdG9yPSJvdXQiLz4NCjxmZUNvbG9yTWF0cml4IHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgMCAwIDAgMCAwLjM5NjA3OCAwIDAgMCAwIDAuOTg0MzE0IDAgMCAwIDAuNCAwIi8+DQo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluMj0iQmFja2dyb3VuZEltYWdlRml4IiByZXN1bHQ9ImVmZmVjdDFfZHJvcFNoYWRvd180NDcyXzE4MDUyIi8+DQo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9ImVmZmVjdDFfZHJvcFNoYWRvd180NDcyXzE4MDUyIiByZXN1bHQ9InNoYXBlIi8+DQo8L2ZpbHRlcj4NCjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQwX2xpbmVhcl80NDcyXzE4MDUyIiB4MT0iMjMuNSIgeTE9IjEwIiB4Mj0iMjMuNSIgeTI9IjM0IiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+DQo8c3RvcCBzdG9wLWNvbG9yPSIjNjRBMEZEIi8+DQo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiMwMTVBRkYiLz4NCjwvbGluZWFyR3JhZGllbnQ+DQo8L2RlZnM+DQo8L3N2Zz4NCg==",pe=""+new URL("assets/database_connect.svg",import.meta.url).href,fe=""+new URL("assets/mysql.svg",import.meta.url).href,Ae=""+new URL("assets/SQLServer.png",import.meta.url).href,Ce=""+new URL("assets/PostgreSQL.png",import.meta.url).href,he=""+new URL("assets/Doris.png",import.meta.url).href,Be=[{label:"MySQL",value:"MySQL",icon:fe},{label:"PostgreSQL",value:"PostgreSQL",icon:Ce},{label:"SQLServer",value:"SQLServer",icon:Ae},{label:"Doris",value:"Doris",icon:he}],Ne=({drawerTitle:m,drawerVisible:v,isConnectSuccess:B,handleDrawerClose:g,dbInfo:c,dbType:l,eventsEmit:p})=>{const[Q,V]=F(!1),[G,N]=F(!1),[e,t]=F({}),[r,u]=F(!1),b=W(()=>({id:l,layout:"vertical",formWidth:"500px",fields:[{id:"name",name:"name",label:"\u6570\u636E\u5E93\u540D\u79F0",type:"input",required:!0,placeholder:"\u4EC5\u652F\u6301\u6C49\u5B57\u3001\u6570\u5B57\u3001\u82F1\u6587\u3001\u7B26\u53F7",validate:a=>{if(!a)return"\u6570\u636E\u5E93\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A";if(!/[\u4E00-\u9FA5A-Za-z0-9\W]/.test(a))return"\u4EC5\u652F\u6301\u6C49\u5B57\u3001\u6570\u5B57\u3001\u82F1\u6587\u3001\u7B26\u53F7"},counter:100},{id:"description",name:"description",label:"\u6570\u636E\u5E93\u63CF\u8FF0",type:"textarea",counter:150,required:!1,placeholder:"\u8BF7\u8F93\u5165\u6570\u636E\u5E93\u63CF\u8FF0,\u6B64\u63CF\u8FF0\u4EC5\u7528\u4E8E\u533A\u5206\u4E0D\u540C\u6570\u636E\u5E93,\u4E0D\u4F1A\u5F71\u54CD\u6570\u636E\u5E93\u8C03\u7528",defaultValue:""}]}),[l,c]),D=W(()=>({id:l,layout:"vertical",formWidth:"470px",fields:[{id:"name",name:"name",label:"\u6570\u636E\u5E93\u540D\u79F0",type:"input",required:!0,placeholder:"\u4EC5\u652F\u6301\u6C49\u5B57\u3001\u6570\u5B57\u3001\u82F1\u6587\u3001\u7B26\u53F7",validate:a=>{if(!a)return"\u6570\u636E\u5E93\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A";if(!/[\u4E00-\u9FA5A-Za-z0-9\W]/.test(a))return"\u4EC5\u652F\u6301\u6C49\u5B57\u3001\u6570\u5B57\u3001\u82F1\u6587\u3001\u7B26\u53F7"},counter:100},{id:"description",name:"description",label:"\u6570\u636E\u5E93\u63CF\u8FF0",type:"textarea",required:!1,counter:150,placeholder:"\u8BF7\u8F93\u5165\u6570\u636E\u5E93\u63CF\u8FF0,\u6B64\u63CF\u8FF0\u4EC5\u7528\u4E8E\u533A\u5206\u4E0D\u540C\u6570\u636E\u5E93,\u4E0D\u4F1A\u5F71\u54CD\u6570\u636E\u5E93\u8C03\u7528",defaultValue:""},{id:"db-info",label:"\u76F4\u8FDE\u6570\u636E\u6E90\u4FE1\u606F",type:"title",level:2},{id:"dbType",name:"dbType",label:"\u6570\u636E\u6E90\u7C7B\u578B",type:"select",disabled:!!c,required:!0,options:Be.map(a=>{const{label:i,value:M,icon:k}=a;return{label:i,value:M,render:()=>L("div",{className:"flex items-center gap-2",children:[n("img",{src:k,width:24}),n("span",{children:i})]})}})},{id:"dbHost",name:"dbHost",label:"\u4E3B\u673A\u5730\u5740",type:"input",required:!0,disabled:!!c,placeholder:"\u8BF7\u8F93\u5165IP\u5730\u5740\u6216\u8005\u57DF\u540D"},{id:"dbPort",name:"dbPort",label:"\u7AEF\u53E3\u53F7",type:"number",required:!0,disabled:!!c,placeholder:"\u8BF7\u8F93\u5165\u7AEF\u53E3\u540D\u79F0"},{id:"dbDatabase",name:"dbDatabase",label:"\u8FDE\u63A5\u6570\u636E\u5E93\u540D",disabled:!!c,placeholder:"\u8BF7\u8F93\u5165\u8FDE\u63A5\u6570\u636E\u5E93\u540D",required:!0,type:"input"},{type:"col",children:[{id:"dbUser",type:"input",name:"dbUser",label:"\u7528\u6237\u540D",disabled:!!c,placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u540D",required:!0},{id:"dbPassword",type:"password",name:"dbPassword",label:"\u5BC6\u7801",placeholder:"\u8BF7\u8F93\u5165\u5BC6\u7801",required:!0,disabled:r?!1:!!c}]}]}),[l,c,r]),E=$(null),C=(a,i,M)=>{switch(console.log("[Form] eventsEmit:",a,i,M),a){case"form:ready":i.formRef&&(E.current=i.formRef);break;case"form_field_change":console.log("\u5B57\u6BB5\u503C\u53D8\u5316:",i),t(k=>({...k,[i.fieldId]:i.value}));break;case"form_validation_error":console.log("\u8868\u5355\u9A8C\u8BC1\u9519\u8BEF:",i);break;default:console.log("\u672A\u5904\u7406\u7684\u4E8B\u4EF6:",a,i)}p==null||p(a,i,M)},h=async()=>{try{V(!0);const a=await E.current.getAllData();a.isValid&&(console.log(a,"==="),l=="DirectDB"&&m=="\u7F16\u8F91\u6570\u636E\u5E93"&&!r&&(a.fields=a.fields.filter(i=>i.name=="name"||i.name=="description")),await p("form_submitted",a,void 0),u(!1))}catch(a){console.error("\u274C \u63D0\u4EA4\u8868\u5355\u6570\u636E\u5931\u8D25:",a)}finally{V(!1)}},w=async()=>{try{N(!0);const a=await E.current.getAllData();if(a.isValid){const i=a.fields.reduce((M,k)=>(M[k.name]=k.value,M),{});await p("form:connect_test",i,void 0)}}catch{N(!1)}finally{N(!1)}},d=W(()=>{const a=l=="DataTable"?b:D;return{label:"\u52A8\u6001\u8868\u5355\u793A\u4F8B",defaultActiveId:a.id,model:null,views:[{label:"\u7528\u6237\u6CE8\u518C\u8868\u5355",id:a.id,type:"form",size:"md",formWidth:a.formWidth,formConfig:{layout:a.layout,showReset:!1,showSubmit:!1,formWidth:a.formWidth,getFormData:()=>({...e,timestamp:new Date().toISOString(),formId:a.id}),onFieldChange:(i,M)=>{C("form_field_change",{fieldId:i,value:M},void 0)},onValidationError:i=>{C("form_validation_error",i,void 0)}}}],dataSource:[{id:a.id,fields:a.fields,defaultValues:{...c}}],eventsEmit:C}},[l,b,D,v,c]),j=W(()=>l=="DirectDB"?c?r&&!B:!B:!1,[l,B,r,v]);return L(ee,{title:m,width:620,onCancel:()=>{g(),u(!1)},open:v,destroyOnHidden:!0,footer:L("div",{className:"flex justify-end gap-3",style:{justifyContent:"end"},children:[n(J,{mode:"default",label:"\u53D6\u6D88",onClick:()=>{g(),u(!1)}}),n(J,{mode:"primary",label:"\u786E\u8BA4",loading:Q,disabled:j,onClick:h})]}),children:[n(K,{...d},"example-form"),l==="DirectDB"&&n(De,{children:m=="\u7F16\u8F91\u6570\u636E\u5E93"&&!r?n(J,{mode:"primary",className:"mt-[10px]",label:"\u4FEE\u6539\u5BC6\u7801",onClick:()=>{u(!0),E.current.setValues({dbPassword:void 0})}}):n(Ie,{title:"\u9700\u901A\u8FC7\u6D4B\u8BD5\u624D\u53EF\u521B\u5EFA\u6210\u529F",children:n(J,{mode:"primary",className:"mt-[10px]",label:"\u8FDE\u63A5\u6D4B\u8BD5",loading:G,onClick:w})})})]})},we=""+new URL("assets/empty.png",import.meta.url).href,{confirm:je}=ee,ke=ge.div`
2
2
  width: 282px;
3
3
  height: 81px;
4
4
  display: flex;
@@ -17,4 +17,4 @@ import{jsxs as Z,jsx as l,Fragment as De}from"react/jsx-runtime";import{useState
17
17
  background-color: #F1F5FF;
18
18
  };
19
19
  border: 1px solid #EBEBEB
20
- `,Se=[{key:"add_file_db",label:"\u4E0A\u4F20\u6570\u636E\u5E93",dsc:"\u901A\u8FC7\u4E0A\u4F20Excel\u3001csv\u7B49\u683C\u5F0F\u6570\u636E\u8868\u521B\u5EFA\u6570\u636E\u5E93\u3002",icon:Ie},{key:"add_direct_db",label:"\u76F4\u8FDE\u6570\u636E\u5E93",dsc:"\u901A\u8FC7\u4E0E\u5DF2\u6709\u4E1A\u52A1\u5EFA\u7ACB\u8FDE\u63A5\u521B\u5EFA\u6570\u636E\u5E93\u3002",icon:fe}],Re=m=>{const{url:z,token:B,role:F,CustomComponents:c,getBtnDisabled:n}=m,[f,G]=y("my-db"),[W,R]=y({app:"ready",container:"ready",content:"ready"}),[w,e]=y(!1),[t,r]=y([{id:"my-db",data:[]},{id:"shared-db",data:[]}]),u=K(null),[g,D]=y(!1),[p,A]=y(""),[h,N]=y("DataTable"),[d,v]=y(),[a,i]=y(!1),{getDatabaseList:I,delDatabaseById:x,saveDatabase:ue,testConnection:te,getShareDatabaseList:ae,syncSchema:se}=pe({url:z,token:B,role:F,eventsEmit:m.eventsEmit}),J=T(()=>[{label:"\u6211\u7684\u6570\u636E\u5E93",id:"my-db",type:"card",cardType:"database",rowHeight:220,viewPageSize:12,viewBehavior:"pagination",actions:[{label:"\u7F16\u8F91",key:"edit"},{label:"\u5220\u9664",key:"delete"}],toolbar:[{type:"customized",key:"add",render:()=>l(ge,{mode:"primary",label:"\u521B\u5EFA\u6570\u636E\u5E93",actions:Se.map(o=>({key:o.key,component:l(xe,{children:Z("div",{className:"flex flex-grow",children:[l("div",{className:"mr-[6px]",children:l("img",{src:o.icon})}),Z("div",{children:[l("div",{className:"text-base font-bold mb-1 text-[14px]",children:o.label}),l("div",{className:"text-[#888] text-[10px]",children:o.dsc})]})]})},o.key)})),eventEmit:_})},{type:"fuzzy_search",key:"search",label:"\u8F93\u5165\u540D\u79F0\u641C\u7D22",searchKeys:["name","description"],position:"right"}]},{label:"\u5171\u4EAB\u6570\u636E\u5E93",id:"shared-db",type:"card",cardType:"database",rowHeight:240,toolbar:[{type:"fuzzy_search",key:"search",label:"\u641C\u7D22",position:"right"}],actions:[{label:"\u7F16\u8F91",key:"edit"},{label:"\u5220\u9664",key:"delete"}]}],[t]);me(()=>{R(o=>({...o,content:"loading"})),re()},[]);const re=async()=>{var o,s,M,b;try{const[C,j]=await Promise.allSettled([I({pageNo:1,pageSize:999}),ae({pageNo:1,pageSize:999})]);let L=[];if(C.status==="fulfilled"&&C.value&&(o=C.value)!=null&&o.records){const S=Y((s=C.value)==null?void 0:s.records);L.push({id:"my-db",data:S||[]})}if(j.status==="fulfilled"&&j.value&&(M=j.value)!=null&&M.records){const S=Y((b=j.value)==null?void 0:b.records);L.push({id:"shared-db",data:S||[]})}r(L),R(S=>({...S,content:"ready"}))}catch(C){console.log("[DatabaseApiError] getDatabaseList:",C)}},Y=o=>(o||[]).map(s=>{const M=U("shared-db").map((b,C)=>({...b,key:b.type==="divider"?`${b.key}_${s.id}`:b.key,disabled:n&&n(b.key=="edit"?7:4,s.permission)}));return s.datasourceType=="DirectDB"&&M.push({label:"\u540C\u6B65\u8868\u7ED3\u6784",key:"sync_schema",disabled:n&&n(7,s.permission)}),console.log("[DatabaseViewAdopter] actions:",M),{...s,actions:M||[]}}),ie="admin",oe=()=>Z("div",{className:"flex flex-col items-center justify-center h-full",children:[l("div",{className:"text-xl font-semibold mb-3",style:{color:"#374151"},children:l("img",{src:Ne,width:120})}),l("div",{className:"text-base mb-6",style:{color:"#6b7280"},children:"\u6682\u65E0\u6570\u636E\uFF0C\u8BF7\u5148\u6DFB\u52A0\u6570\u636E\u5E93"})]}),U=o=>{const s=J.find(b=>b.id===o);return(s==null?void 0:s.actions)||[]},ce=T(()=>{var s;const o=((s=t==null?void 0:t.find(M=>M.id===f))==null?void 0:s.data)||[];return w?[]:o},[f,t,w]),X=()=>{D(!1),i(!1),v(void 0)},le=async o=>{console.log("[DatabaseViewAdopter] \u6D4B\u8BD5\u8FDE\u63A5:",o);const s=await te(o);return s&&(i(!0),H.success("\u8FDE\u63A5\u6D4B\u8BD5\u6210\u529F\uFF01")),s};async function _(o,s,M){var b,C,j,L,S;switch(console.log("[DatabaseViewAdopter] mergedEventsEmit",o,s),o){case"card_delete":ve({title:"\u786E\u8BA4\u5220\u9664\u6570\u636E\u5E93\uFF1F",content:"\u5220\u9664\u540E\uFF0C\u8BE5\u6570\u636E\u5E93\u5C06\u65E0\u6CD5\u6062\u590D",okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",async onOk(){await x(s.id,s.datasourceType)&&(u!=null&&u.current)&&(u==null||u.current.appFn.removeItem(s.id))},onCancel(){console.log("Cancel")}});break;case"card_edit":A("\u7F16\u8F91\u6570\u636E\u5E93"),D(!0),N(s.datasourceType),delete s.render,v(s);break;case"select":G(s.id);break;case"filesDir_clicked":G(s.id);break;case"dropdown_action":A("\u521B\u5EFA\u6570\u636E\u5E93"),D(!0),s.key=="add_file_db"?N("DataTable"):N("DirectDB");break;case"form_submitted":try{const k=s.fields.reduce((P,E)=>(P[E.name]=E.value,P),{}),ne=d?{id:d==null?void 0:d.id,...k}:k,V=await ue(ne,h);if(V){if(d){const P={...d,...k,datasourceType:h,actions:U("my-db").map((E,de)=>({...E,key:E.type==="divider"?`${E.key}_${V}`:E.key,allow:!0}))};(C=(b=u==null?void 0:u.current)==null?void 0:b.appFn)==null||C.updateItem(P,d==null?void 0:d.id),H.success("\u6570\u636E\u5E93\u7F16\u8F91\u6210\u529F\uFF01")}else{const P={...k,...V,createBy:ie,datasourceType:h,actions:U("my-db").map((E,de)=>({...E,key:E.type==="divider"?`${E.key}_${V}`:E.key,allow:!0}))};(L=(j=u==null?void 0:u.current)==null?void 0:j.appFn)==null||L.addItem(P,{animate:!0,position:"start"}),H.success("\u6570\u636E\u5E93\u521B\u5EFA\u6210\u529F\uFF01")}return V}}catch(k){console.error("\u4FDD\u5B58\u5931\u8D25\uFF01",k)}finally{X()}break;case"form:connect_test":return await le(s);case"toolbar_test_empty":console.log("[DatabaseViewAdopter] toolbar_test_empty \u4E8B\u4EF6\u89E6\u53D1"),e(!w);break;case"card_sync_schema":await se(s.id)&&(i(!0),H.success("\u540C\u6B65\u8868\u7ED3\u6784\u6210\u529F\uFF01"));break;default:(S=m.eventsEmit)==null||S.call(m,o,s);break}}return Z(be,{title:"\u6570\u636E\u5E93\u7BA1\u7406",children:[l($,{ref:u,label:"",model:"tabs",defaultActiveId:f,views:J,dataSource:ce,eventsEmit:_,status:W,CustomComponents:{EmptyData:oe,...c},styles:{theme:{...O,colors:{...O.colors,listBackground:"#ffffff"}},mode:"light"}},"db"),l(we,{drawerTitle:p,drawerVisible:g,isConnectSuccess:a,dbType:h,dbInfo:d,handleDrawerClose:X,eventsEmit:_})]})};export{Re as default};
20
+ `,xe=[{key:"add_file_db",label:"\u4E0A\u4F20\u6570\u636E\u5E93",dsc:"\u901A\u8FC7\u4E0A\u4F20Excel\u3001csv\u7B49\u683C\u5F0F\u6570\u636E\u8868\u521B\u5EFA\u6570\u636E\u5E93\u3002",icon:Me},{key:"add_direct_db",label:"\u76F4\u8FDE\u6570\u636E\u5E93",dsc:"\u901A\u8FC7\u4E0E\u5DF2\u6709\u4E1A\u52A1\u5EFA\u7ACB\u8FDE\u63A5\u521B\u5EFA\u6570\u636E\u5E93\u3002",icon:pe}],Ge=m=>{const{url:v,token:B,role:g,CustomComponents:c,getBtnDisabled:l}=m,[p,Q]=F("my-db"),[V,G]=F({app:"ready",container:"ready",content:"ready"}),[N,e]=F(!1),[t,r]=F([{id:"my-db",data:[]},{id:"shared-db",data:[]}]),u=$(null),[b,D]=F(!1),[E,C]=F(""),[h,w]=F("DataTable"),[d,j]=F(),[a,i]=F(!1),{getDatabaseList:M,delDatabaseById:k,saveDatabase:ue,testConnection:te,getShareDatabaseList:ae,syncSchema:se}=Ee({url:v,token:B,role:g,eventsEmit:m.eventsEmit}),H=W(()=>[{label:"\u6211\u7684\u6570\u636E\u5E93",id:"my-db",type:"card",cardType:"database",rowHeight:220,viewPageSize:12,viewBehavior:"pagination",actions:[{label:"\u7F16\u8F91",key:"edit"},{label:"\u5220\u9664",key:"delete"}],toolbar:[{type:"customized",key:"add",render:()=>n(be,{mode:"primary",label:"\u521B\u5EFA\u6570\u636E\u5E93",actions:xe.map(o=>({key:o.key,component:n(ke,{children:L("div",{className:"flex flex-grow",children:[n("div",{className:"mr-[6px]",children:n("img",{src:o.icon})}),L("div",{children:[n("div",{className:"text-base font-bold mb-1 text-[14px]",children:o.label}),n("div",{className:"text-[#888] text-[10px]",children:o.dsc})]})]})},o.key)})),eventEmit:Y})},{type:"fuzzy_search",key:"search",label:"\u8F93\u5165\u540D\u79F0\u641C\u7D22",searchKeys:["name","description"],position:"right"}]},{label:"\u5171\u4EAB\u6570\u636E\u5E93",id:"shared-db",type:"card",cardType:"database",rowHeight:240,toolbar:[{type:"fuzzy_search",key:"search",label:"\u641C\u7D22",position:"right"}],actions:[{label:"\u7F16\u8F91",key:"edit"},{label:"\u5220\u9664",key:"delete"}]}],[t]);me(()=>{G(o=>({...o,content:"loading"})),re()},[]);const re=async()=>{var o,s,f,y;try{const[A,z]=await Promise.allSettled([M({pageNo:1,pageSize:999}),ae({pageNo:1,pageSize:999})]);let T=[];if(A.status==="fulfilled"&&A.value&&(o=A.value)!=null&&o.records){const x=X((s=A.value)==null?void 0:s.records);T.push({id:"my-db",data:x||[]})}if(z.status==="fulfilled"&&z.value&&(f=z.value)!=null&&f.records){const x=X((y=z.value)==null?void 0:y.records);T.push({id:"shared-db",data:x||[]})}r(T),G(x=>({...x,content:"ready"}))}catch(A){console.log("[DatabaseApiError] getDatabaseList:",A)}},X=o=>(o||[]).map(s=>{const f=U("shared-db").map((y,A)=>({...y,key:y.type==="divider"?`${y.key}_${s.id}`:y.key,disabled:l&&l(y.key=="edit"?7:4,s.permission)}));return s.datasourceType=="DirectDB"&&f.push({label:"\u540C\u6B65\u8868\u7ED3\u6784",key:"sync_schema",disabled:l&&l(7,s.permission)}),console.log("[DatabaseViewAdopter] actions:",f),{...s,actions:f||[]}}),ie="admin",oe=()=>L("div",{className:"flex flex-col items-center justify-center h-full",children:[n("div",{className:"text-xl font-semibold mb-3",style:{color:"#374151"},children:n("img",{src:we,width:120})}),n("div",{className:"text-base mb-6",style:{color:"#6b7280"},children:"\u6682\u65E0\u6570\u636E\uFF0C\u8BF7\u5148\u6DFB\u52A0\u6570\u636E\u5E93"})]}),U=o=>{const s=H.find(y=>y.id===o);return(s==null?void 0:s.actions)||[]},ce=W(()=>{var s;const o=((s=t==null?void 0:t.find(f=>f.id===p))==null?void 0:s.data)||[];return N?[]:o},[p,t,N]),_=()=>{D(!1),i(!1),j(void 0)},ne=async o=>{console.log("[DatabaseViewAdopter] \u6D4B\u8BD5\u8FDE\u63A5:",o);const s=await te(o);return s&&(i(!0),R.success("\u8FDE\u63A5\u6D4B\u8BD5\u6210\u529F\uFF01")),s};async function Y(o,s,f){var y,A,z,T,x;switch(console.log("[DatabaseViewAdopter] mergedEventsEmit",o,s),o){case"card_delete":je({title:"\u786E\u8BA4\u5220\u9664\u6570\u636E\u5E93\uFF1F",content:"\u5220\u9664\u540E\uFF0C\u8BE5\u6570\u636E\u5E93\u5C06\u65E0\u6CD5\u6062\u590D",okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",async onOk(){await k(s.id,s.datasourceType)&&(u!=null&&u.current)&&(u==null||u.current.appFn.removeItem(s.id))},onCancel(){console.log("Cancel")}});break;case"card_edit":C("\u7F16\u8F91\u6570\u636E\u5E93"),D(!0),w(s.datasourceType),delete s.render,j(s);break;case"select":Q(s.id);break;case"filesDir_clicked":Q(s.id);break;case"dropdown_action":C("\u521B\u5EFA\u6570\u636E\u5E93"),D(!0),s.key=="add_file_db"?w("DataTable"):w("DirectDB");break;case"form_submitted":try{const S=s.fields.reduce((Z,I)=>(Z[I.name]=I.value,Z),{}),le=d?{id:d==null?void 0:d.id,...S}:S,P=await ue(le,h);if(P){if(d){const Z={...d,...S,datasourceType:h,actions:U("my-db").map((I,de)=>({...I,key:I.type==="divider"?`${I.key}_${P}`:I.key,allow:!0}))};(A=(y=u==null?void 0:u.current)==null?void 0:y.appFn)==null||A.updateItem(Z,d==null?void 0:d.id),R.success("\u6570\u636E\u5E93\u7F16\u8F91\u6210\u529F\uFF01")}else{const Z={...S,...P,createBy:ie,datasourceType:h,actions:U("my-db").map((I,de)=>({...I,key:I.type==="divider"?`${I.key}_${P}`:I.key,allow:!0}))};(T=(z=u==null?void 0:u.current)==null?void 0:z.appFn)==null||T.addItem(Z,{animate:!0,position:"start"}),R.success("\u6570\u636E\u5E93\u521B\u5EFA\u6210\u529F\uFF01")}return P}}catch(S){console.error("\u4FDD\u5B58\u5931\u8D25\uFF01",S)}finally{_()}break;case"form:connect_test":return await ne(s);case"toolbar_test_empty":console.log("[DatabaseViewAdopter] toolbar_test_empty \u4E8B\u4EF6\u89E6\u53D1"),e(!N);break;case"card_sync_schema":await se(s.id)&&(i(!0),R.success("\u540C\u6B65\u8868\u7ED3\u6784\u6210\u529F\uFF01"));break;default:(x=m.eventsEmit)==null||x.call(m,o,s);break}}return L(ye,{title:"\u6570\u636E\u5E93\u7BA1\u7406",children:[n(K,{ref:u,label:"",model:"tabs",defaultActiveId:p,views:H,dataSource:ce,eventsEmit:Y,status:V,CustomComponents:{EmptyData:oe,...c},styles:{theme:{...O,colors:{...O.colors,listBackground:"#ffffff"}},mode:"light"}},"db"),n(Ne,{drawerTitle:E,drawerVisible:b,isConnectSuccess:a,dbType:h,dbInfo:d,handleDrawerClose:_,eventsEmit:Y})]})};export{Ge as default};
package/databaseId.js CHANGED
@@ -1 +1 @@
1
- import"react/jsx-runtime";import"react";import"./assets/index-CpW6Dhpp.js";import"./assets/index-x8IlxRuv.js";import"./assets/index-g-SUxfJH.js";import"./assets/index-DwoTKC3G.js";/* empty css */import"./assets/style-CGmZ5osp.js";import{D as g}from"./assets/index-CIwaLPGb.js";import"./assets/index-DdVFXD_y.js";import"react-dom";import"./assets/index-BO-w4FPz.js";import"./assets/index-BKe5FgcC.js";import"./assets/index-j0kQJd0a.js";import"./assets/index-D72cKELw.js";import"./assets/x-CnaaLGJF.js";export{g as default};
1
+ import"react/jsx-runtime";import"react";import"./assets/index-CpW6Dhpp.js";import"./assets/index-x8IlxRuv.js";import"./assets/index-g-SUxfJH.js";import"./assets/index-DwoTKC3G.js";/* empty css */import"./assets/style-CGmZ5osp.js";import{D as g}from"./assets/index-CF21Mbsz.js";import"./assets/index-DdVFXD_y.js";import"react-dom";import"./assets/index-h59-yboB.js";import"./assets/index-BKe5FgcC.js";import"./assets/index-j0kQJd0a.js";import"./assets/index-D72cKELw.js";import"./assets/x-CnaaLGJF.js";export{g as default};
package/index.js CHANGED
@@ -1 +1 @@
1
- import{DrawerType as y}from"./chat.js";import"./database.js";import"./assets/index-CIwaLPGb.js";import"./databaseTable.js";import"react/jsx-runtime";import"react";import"./modelManage.js";import"./sensitive.js";import{G as F,B as P}from"./assets/GientechStreamReader-DqJjNXCO.js";import"./assets/index-JwQuPQqQ.js";import{i as S}from"./assets/index-g-SUxfJH.js";import"./assets/index-x8IlxRuv.js";import"react-dom";import"./assets/index-BO-w4FPz.js";import"./assets/index-BKe5FgcC.js";import"./assets/index-j0kQJd0a.js";import"./assets/index-CpW6Dhpp.js";/* empty css */import"./assets/style-CGmZ5osp.js";import"./assets/plus-V9zUoSq6.js";import"./assets/x-CnaaLGJF.js";import"./assets/index-D72cKELw.js";import"./assets/index-DwoTKC3G.js";import"./assets/index-DdVFXD_y.js";export{y as DrawerType,F as GientechStreamReader,S as defaultTheme,P as registerPDFWorker};
1
+ import{DrawerType as y}from"./chat.js";import"./database.js";import"./assets/index-CF21Mbsz.js";import"./databaseTable.js";import"react/jsx-runtime";import"react";import"./modelManage.js";import"./sensitive.js";import{G as F,B as P}from"./assets/GientechStreamReader-9YdiPc7N.js";import"./assets/index-JwQuPQqQ.js";import{i as S}from"./assets/index-g-SUxfJH.js";import"./assets/index-x8IlxRuv.js";import"react-dom";import"./assets/index-h59-yboB.js";import"./assets/index-BKe5FgcC.js";import"./assets/index-j0kQJd0a.js";import"./assets/index-CpW6Dhpp.js";/* empty css */import"./assets/style-CGmZ5osp.js";import"./assets/plus-V9zUoSq6.js";import"./assets/x-CnaaLGJF.js";import"./assets/index-D72cKELw.js";import"./assets/index-DwoTKC3G.js";import"./assets/index-DdVFXD_y.js";export{y as DrawerType,F as GientechStreamReader,S as defaultTheme,P as registerPDFWorker};
package/package.json CHANGED
@@ -3,15 +3,11 @@
3
3
  "license": "MIT",
4
4
  "style": "assets/style.css",
5
5
  "private": false,
6
- "version": "1.9.1",
6
+ "version": "1.9.2",
7
7
  "author": "hanfeng_Zhang",
8
8
  "type": "module",
9
9
  "main": "index.js",
10
10
  "types": "index.d.ts",
11
- "scripts": {
12
- "test": "yarn link",
13
- "disconnect": "yarn unlink"
14
- },
15
11
  "peerDependencies": {
16
12
  "react": ">=18",
17
13
  "react-dom": ">=18"
@@ -64,5 +60,9 @@
64
60
  },
65
61
  "./style.css": "./assets/style.css",
66
62
  "./assets/style.css": "./assets/style.css"
63
+ },
64
+ "scripts": {
65
+ "test": "yarn link",
66
+ "disconnect": "yarn unlink"
67
67
  }
68
- }
68
+ }
@@ -1 +1 @@
1
- import{G as d,B as f}from"./assets/GientechStreamReader-DqJjNXCO.js";import"react/jsx-runtime";import"react";import"./assets/index-g-SUxfJH.js";import"react-dom";import"./assets/index-BO-w4FPz.js";import"./assets/index-x8IlxRuv.js";import"./assets/index-BKe5FgcC.js";import"./assets/index-j0kQJd0a.js";import"./assets/x-CnaaLGJF.js";export{d as GientechStreamReader,f as registerPDFWorker};
1
+ import{G as d,B as f}from"./assets/GientechStreamReader-9YdiPc7N.js";import"react/jsx-runtime";import"react";import"./assets/index-g-SUxfJH.js";import"react-dom";import"./assets/index-h59-yboB.js";import"./assets/index-x8IlxRuv.js";import"./assets/index-BKe5FgcC.js";import"./assets/index-j0kQJd0a.js";import"./assets/x-CnaaLGJF.js";export{d as GientechStreamReader,f as registerPDFWorker};