@gientech/modual 1.4.2 → 1.4.4
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/assets/{AppLoading-BCu9TPs5.js → AppLoading-BpA2wf4Z.js} +1 -1
- package/chat.d.ts +4 -0
- package/chat.js +11 -11
- package/database.js +2 -2
- package/index.js +1 -1
- package/package.json +1 -1
- /package/assets/{mysql.svg → MySQL.svg} +0 -0
package/chat.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as $,jsxs as Y,Fragment as Ea}from"react/jsx-runtime";import*as l from"react";import Be,{forwardRef as br,useMemo as Ge,useRef as Xe,useCallback as qt,useImperativeHandle as Po,createContext as Fa,useEffect as je,Component as Ao,createElement as Vn,PureComponent as Na,useState as Ie}from"react";import{c as Pt,b5 as Xt,K as vt,V as ko,b6 as yr,b7 as Mo,A as ot,L as Ke,k as Z,b8 as Ro,_ as De,N as re,b9 as Oa,ba as Bo,M as ze,ao as Ye,bb as Da,o as Lt,H as Cr,D as To,at as xt,aw as xr,ax as wr,ay as $r,aA as Ir,bc as an,au as Sr,z as Er,a7 as jt,t as Jt,C as wt,q as Gt,T as Fr,bd as Pa,X as Aa,x as ne,a9 as ka,be as Nr,g as cn,e as sn,aC as _o,bf as wn,i as zo,a_ as $n,r as On,bg as or,bh as Ma,W as jo,aJ as ar,aL as Lo,aF as Ho,bi as Ra,bj as Ba,bk as Ta,bl as _a,f as za,bm as qr,U as Ur,j as ja,h as La,aP as Ha,ah as qa,bn as Ua,Y as Wa,bo as Va,u as Or,bp as Ka,bq as Xa,br as Ga,as as pt,aM as qo,aj as Uo,b1 as Wo,aT as Ja,aW as Ya,bs as ir,w as sr,aN as Qa,aQ as Za,aO as ei,bt as ti,bu as Bt,bv as Qe,az as Ve,G as ni,bw as Wr,bx as ri,by as oi,aI as ai,aD as Vr,aE as ii,I as lt,bz as si,bA as Kr,b as rt,b4 as Dr,bB as li,bC as Vo,aH as Ko,F as Xr,d as ci,bD as ui}from"./assets/index-DiQ4Me9J.js";import{h as di,v as pi,C as mi,H as fi,A as gi,F as hi}from"./assets/AppLoading-
|
|
1
|
+
import{jsx as $,jsxs as Y,Fragment as Ea}from"react/jsx-runtime";import*as l from"react";import Be,{forwardRef as br,useMemo as Ge,useRef as Xe,useCallback as qt,useImperativeHandle as Po,createContext as Fa,useEffect as je,Component as Ao,createElement as Vn,PureComponent as Na,useState as Ie}from"react";import{c as Pt,b5 as Xt,K as vt,V as ko,b6 as yr,b7 as Mo,A as ot,L as Ke,k as Z,b8 as Ro,_ as De,N as re,b9 as Oa,ba as Bo,M as ze,ao as Ye,bb as Da,o as Lt,H as Cr,D as To,at as xt,aw as xr,ax as wr,ay as $r,aA as Ir,bc as an,au as Sr,z as Er,a7 as jt,t as Jt,C as wt,q as Gt,T as Fr,bd as Pa,X as Aa,x as ne,a9 as ka,be as Nr,g as cn,e as sn,aC as _o,bf as wn,i as zo,a_ as $n,r as On,bg as or,bh as Ma,W as jo,aJ as ar,aL as Lo,aF as Ho,bi as Ra,bj as Ba,bk as Ta,bl as _a,f as za,bm as qr,U as Ur,j as ja,h as La,aP as Ha,ah as qa,bn as Ua,Y as Wa,bo as Va,u as Or,bp as Ka,bq as Xa,br as Ga,as as pt,aM as qo,aj as Uo,b1 as Wo,aT as Ja,aW as Ya,bs as ir,w as sr,aN as Qa,aQ as Za,aO as ei,bt as ti,bu as Bt,bv as Qe,az as Ve,G as ni,bw as Wr,bx as ri,by as oi,aI as ai,aD as Vr,aE as ii,I as lt,bz as si,bA as Kr,b as rt,b4 as Dr,bB as li,bC as Vo,aH as Ko,F as Xr,d as ci,bD as ui}from"./assets/index-DiQ4Me9J.js";import{h as di,v as pi,C as mi,H as fi,A as gi,F as hi}from"./assets/AppLoading-BpA2wf4Z.js";import{A as Gr}from"./assets/index-DfSHCQcq.js";import{u as Ht}from"./assets/index-CpW6Dhpp.js";/* empty css */import{R as vi,a as bi}from"./assets/LeftOutlined-BdBZ6FSD.js";import{flushSync as lr}from"react-dom";import{P as Xo}from"./assets/plus-ufD39rmY.js";import{X as Pr}from"./assets/x-_1-UpSBt.js";import{A as yi,i as Ci,s as Re,M as Ar,S as vn}from"./assets/index-rydP_SDR.js";import{g as Jr,a as xi,P as Go}from"./assets/index-EcdpegTC.js";/**
|
|
2
2
|
* @license lucide-react v0.456.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -43,19 +43,19 @@ import{jsx as $,jsxs as Y,Fragment as Ea}from"react/jsx-runtime";import*as l fro
|
|
|
43
43
|
*
|
|
44
44
|
* This source code is licensed under the ISC license.
|
|
45
45
|
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
-
*/const Ni=Pt("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);var Oi=vt.ESC,Di=vt.TAB;function Pi(e){var n=e.visible,t=e.triggerRef,r=e.onVisibleChange,o=e.autoFocus,a=e.overlayRef,i=l.useRef(!1),s=function(){if(n){var m,h;(m=t.current)===null||m===void 0||(h=m.focus)===null||h===void 0||h.call(m),r==null||r(!1)}},u=function(){var m;return(m=a.current)!==null&&m!==void 0&&m.focus?(a.current.focus(),i.current=!0,!0):!1},d=function(m){switch(m.keyCode){case Oi:s();break;case Di:{var h=!1;i.current||(h=u()),h?m.preventDefault():s();break}}};l.useEffect(function(){return n?(window.addEventListener("keydown",d),o&&Xt(u,3),function(){window.removeEventListener("keydown",d),i.current=!1}):function(){i.current=!1}},[n])}var Ai=br(function(e,n){var t=e.overlay,r=e.arrow,o=e.prefixCls,a=Ge(function(){var s;return typeof t=="function"?s=t():s=t,s},[t]),i=ko(n,yr(a));return Be.createElement(Be.Fragment,null,r&&Be.createElement("div",{className:"".concat(o,"-arrow")}),Be.cloneElement(a,{ref:Mo(a)?i:void 0}))}),Ut={adjustX:1,adjustY:1},Wt=[0,0],ki={topLeft:{points:["bl","tl"],overflow:Ut,offset:[0,-4],targetOffset:Wt},top:{points:["bc","tc"],overflow:Ut,offset:[0,-4],targetOffset:Wt},topRight:{points:["br","tr"],overflow:Ut,offset:[0,-4],targetOffset:Wt},bottomLeft:{points:["tl","bl"],overflow:Ut,offset:[0,4],targetOffset:Wt},bottom:{points:["tc","bc"],overflow:Ut,offset:[0,4],targetOffset:Wt},bottomRight:{points:["tr","br"],overflow:Ut,offset:[0,4],targetOffset:Wt}},Mi=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function Ri(e,n){var t,r=e.arrow,o=r===void 0?!1:r,a=e.prefixCls,i=a===void 0?"rc-dropdown":a,s=e.transitionName,u=e.animation,d=e.align,f=e.placement,m=f===void 0?"bottomLeft":f,h=e.placements,x=h===void 0?ki:h,w=e.getPopupContainer,c=e.showAction,p=e.hideAction,C=e.overlayClassName,b=e.overlayStyle,I=e.visible,S=e.trigger,y=S===void 0?["hover"]:S,F=e.autoFocus,D=e.overlay,O=e.children,N=e.onVisibleChange,E=ot(e,Mi),_=Be.useState(),T=Ke(_,2),k=T[0],M=T[1],B="visible"in e?I:k,V=Be.useRef(null),j=Be.useRef(null),U=Be.useRef(null);Be.useImperativeHandle(n,function(){return V.current});var K=function(Q){M(Q),N==null||N(Q)};Pi({visible:B,triggerRef:U,onVisibleChange:K,autoFocus:F,overlayRef:j});var L=function(Q){var ie=e.onOverlayClick;M(!1),ie&&ie(Q)},q=function(){return Be.createElement(Ai,{ref:j,overlay:D,prefixCls:i,arrow:o})},ee=function(){return typeof D=="function"?q:q()},R=function(){var Q=e.minOverlayWidthMatchTrigger,ie=e.alignPoint;return"minOverlayWidthMatchTrigger"in e?Q:!ie},W=function(){var Q=e.openClassName;return Q!==void 0?Q:"".concat(i,"-open")},J=Be.cloneElement(O,{className:Z((t=O.props)===null||t===void 0?void 0:t.className,B&&W()),ref:Mo(O)?ko(U,yr(O)):void 0}),oe=p;return!oe&&y.indexOf("contextMenu")!==-1&&(oe=["click"]),Be.createElement(Ro,De({builtinPlacements:x},E,{prefixCls:i,ref:V,popupClassName:Z(C,re({},"".concat(i,"-show-arrow"),o)),popupStyle:b,action:y,showAction:c,hideAction:oe,popupPlacement:m,popupAlign:d,popupTransitionName:s,popupAnimation:u,popupVisible:B,stretch:R()?"minWidth":"",popup:ee(),onPopupVisibleChange:K,onPopupClick:L,getPopupContainer:w}),J)}const Bi=Be.forwardRef(Ri),Ti=e=>typeof e!="object"&&typeof e!="function"||e===null;var Yo=l.createContext(null);function Qo(e,n){return e===void 0?null:"".concat(e,"-").concat(n)}function Zo(e){var n=l.useContext(Yo);return Qo(n,e)}var _i=["children","locked"],ht=l.createContext(null);function zi(e,n){var t=ze({},e);return Object.keys(n).forEach(function(r){var o=n[r];o!==void 0&&(t[r]=o)}),t}function ln(e){var n=e.children,t=e.locked,r=ot(e,_i),o=l.useContext(ht),a=Oa(function(){return zi(o,r)},[o,r],function(i,s){return!t&&(i[0]!==s[0]||!Bo(i[1],s[1],!0))});return l.createElement(ht.Provider,{value:a},n)}var ji=[],ea=l.createContext(null);function Dn(){return l.useContext(ea)}var ta=l.createContext(ji);function Yt(e){var n=l.useContext(ta);return l.useMemo(function(){return e!==void 0?[].concat(Ye(n),[e]):n},[n,e])}var na=l.createContext(null),kr=l.createContext({});function Yr(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(Da(e)){var t=e.nodeName.toLowerCase(),r=["input","select","textarea","button"].includes(t)||e.isContentEditable||t==="a"&&!!e.getAttribute("href"),o=e.getAttribute("tabindex"),a=Number(o),i=null;return o&&!Number.isNaN(a)?i=a:r&&i===null&&(i=0),r&&e.disabled&&(i=null),i!==null&&(i>=0||n&&i<0)}return!1}function Li(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=Ye(e.querySelectorAll("*")).filter(function(r){return Yr(r,n)});return Yr(e,n)&&t.unshift(e),t}var cr=vt.LEFT,ur=vt.RIGHT,dr=vt.UP,Cn=vt.DOWN,xn=vt.ENTER,ra=vt.ESC,en=vt.HOME,tn=vt.END,Qr=[dr,Cn,cr,ur];function Hi(e,n,t,r){var o,a="prev",i="next",s="children",u="parent";if(e==="inline"&&r===xn)return{inlineTrigger:!0};var d=re(re({},dr,a),Cn,i),f=re(re(re(re({},cr,t?i:a),ur,t?a:i),Cn,s),xn,s),m=re(re(re(re(re(re({},dr,a),Cn,i),xn,s),ra,u),cr,t?s:u),ur,t?u:s),h={inline:d,horizontal:f,vertical:m,inlineSub:d,horizontalSub:m,verticalSub:m},x=(o=h["".concat(e).concat(n?"":"Sub")])===null||o===void 0?void 0:o[r];switch(x){case a:return{offset:-1,sibling:!0};case i:return{offset:1,sibling:!0};case u:return{offset:-1,sibling:!1};case s:return{offset:1,sibling:!1};default:return null}}function qi(e){for(var n=e;n;){if(n.getAttribute("data-menu-list"))return n;n=n.parentElement}return null}function Ui(e,n){for(var t=e||document.activeElement;t;){if(n.has(t))return t;t=t.parentElement}return null}function Mr(e,n){var t=Li(e,!0);return t.filter(function(r){return n.has(r)})}function Zr(e,n,t){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!e)return null;var o=Mr(e,n),a=o.length,i=o.findIndex(function(s){return t===s});return r<0?i===-1?i=a-1:i-=1:r>0&&(i+=1),i=(i+a)%a,o[i]}var pr=function(n,t){var r=new Set,o=new Map,a=new Map;return n.forEach(function(i){var s=document.querySelector("[data-menu-id='".concat(Qo(t,i),"']"));s&&(r.add(s),a.set(s,i),o.set(i,s))}),{elements:r,key2element:o,element2key:a}};function Wi(e,n,t,r,o,a,i,s,u,d){var f=l.useRef(),m=l.useRef();m.current=n;var h=function(){Xt.cancel(f.current)};return l.useEffect(function(){return function(){h()}},[]),function(x){var w=x.which;if([].concat(Qr,[xn,ra,en,tn]).includes(w)){var c=a(),p=pr(c,r),C=p,b=C.elements,I=C.key2element,S=C.element2key,y=I.get(n),F=Ui(y,b),D=S.get(F),O=Hi(e,i(D,!0).length===1,t,w);if(!O&&w!==en&&w!==tn)return;(Qr.includes(w)||[en,tn].includes(w))&&x.preventDefault();var N=function(j){if(j){var U=j,K=j.querySelector("a");K!=null&&K.getAttribute("href")&&(U=K);var L=S.get(j);s(L),h(),f.current=Xt(function(){m.current===L&&U.focus()})}};if([en,tn].includes(w)||O.sibling||!F){var E;!F||e==="inline"?E=o.current:E=qi(F);var _,T=Mr(E,b);w===en?_=T[0]:w===tn?_=T[T.length-1]:_=Zr(E,b,F,O.offset),N(_)}else if(O.inlineTrigger)u(D);else if(O.offset>0)u(D,!0),h(),f.current=Xt(function(){p=pr(c,r);var V=F.getAttribute("aria-controls"),j=document.getElementById(V),U=Zr(j,p.elements);N(U)},5);else if(O.offset<0){var k=i(D,!0),M=k[k.length-2],B=I.get(M);u(M,!1),N(B)}}d==null||d(x)}}function Vi(e){Promise.resolve().then(e)}var Rr="__RC_UTIL_PATH_SPLIT__",eo=function(n){return n.join(Rr)},Ki=function(n){return n.split(Rr)},mr="rc-menu-more";function Xi(){var e=l.useState({}),n=Ke(e,2),t=n[1],r=Xe(new Map),o=Xe(new Map),a=l.useState([]),i=Ke(a,2),s=i[0],u=i[1],d=Xe(0),f=Xe(!1),m=function(){f.current||t({})},h=qt(function(I,S){var y=eo(S);o.current.set(y,I),r.current.set(I,y),d.current+=1;var F=d.current;Vi(function(){F===d.current&&m()})},[]),x=qt(function(I,S){var y=eo(S);o.current.delete(y),r.current.delete(I)},[]),w=qt(function(I){u(I)},[]),c=qt(function(I,S){var y=r.current.get(I)||"",F=Ki(y);return S&&s.includes(F[0])&&F.unshift(mr),F},[s]),p=qt(function(I,S){return I.filter(function(y){return y!==void 0}).some(function(y){var F=c(y,!0);return F.includes(S)})},[c]),C=function(){var S=Ye(r.current.keys());return s.length&&S.push(mr),S},b=qt(function(I){var S="".concat(r.current.get(I)).concat(Rr),y=new Set;return Ye(o.current.keys()).forEach(function(F){F.startsWith(S)&&y.add(o.current.get(F))}),y},[]);return l.useEffect(function(){return function(){f.current=!0}},[]),{registerPath:h,unregisterPath:x,refreshOverflowKeys:w,isSubPathKey:p,getKeyPath:c,getKeys:C,getSubPathKeys:b}}function nn(e){var n=l.useRef(e);n.current=e;var t=l.useCallback(function(){for(var r,o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return(r=n.current)===null||r===void 0?void 0:r.call.apply(r,[n].concat(a))},[]);return e?t:void 0}var Gi=Math.random().toFixed(5).toString().slice(2),to=0;function Ji(e){var n=Lt(e,{value:e}),t=Ke(n,2),r=t[0],o=t[1];return l.useEffect(function(){to+=1;var a="".concat(Gi,"-").concat(to);o("rc-menu-uuid-".concat(a))},[]),r}function oa(e,n,t,r){var o=l.useContext(ht),a=o.activeKey,i=o.onActive,s=o.onInactive,u={active:a===e};return n||(u.onMouseEnter=function(d){t==null||t({key:e,domEvent:d}),i(e)},u.onMouseLeave=function(d){r==null||r({key:e,domEvent:d}),s(e)}),u}function aa(e){var n=l.useContext(ht),t=n.mode,r=n.rtl,o=n.inlineIndent;if(t!=="inline")return null;var a=e;return r?{paddingRight:a*o}:{paddingLeft:a*o}}function ia(e){var n=e.icon,t=e.props,r=e.children,o;return n===null||n===!1?null:(typeof n=="function"?o=l.createElement(n,ze({},t)):typeof n!="boolean"&&(o=n),o||r||null)}var Yi=["item"];function In(e){var n=e.item,t=ot(e,Yi);return Object.defineProperty(t,"item",{get:function(){return Cr(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),n}}),t}var Qi=["title","attribute","elementRef"],Zi=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],es=["active"],ts=(function(e){xr(t,e);var n=wr(t);function t(){return $r(this,t),n.apply(this,arguments)}return Ir(t,[{key:"render",value:function(){var o=this.props,a=o.title,i=o.attribute,s=o.elementRef,u=ot(o,Qi),d=xt(u,["eventKey","popupClassName","popupOffset","onTitleClick"]);return Cr(!i,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),l.createElement(an.Item,De({},i,{title:typeof a=="string"?a:void 0},d,{ref:s}))}}]),t})(l.Component),ns=l.forwardRef(function(e,n){var t=e.style,r=e.className,o=e.eventKey;e.warnKey;var a=e.disabled,i=e.itemIcon,s=e.children,u=e.role,d=e.onMouseEnter,f=e.onMouseLeave,m=e.onClick,h=e.onKeyDown,x=e.onFocus,w=ot(e,Zi),c=Zo(o),p=l.useContext(ht),C=p.prefixCls,b=p.onItemClick,I=p.disabled,S=p.overflowDisabled,y=p.itemIcon,F=p.selectedKeys,D=p.onActive,O=l.useContext(kr),N=O._internalRenderMenuItem,E="".concat(C,"-item"),_=l.useRef(),T=l.useRef(),k=I||a,M=To(n,T),B=Yt(o),V=function(ie){return{key:o,keyPath:Ye(B).reverse(),item:_.current,domEvent:ie}},j=i||y,U=oa(o,k,d,f),K=U.active,L=ot(U,es),q=F.includes(o),ee=aa(B.length),R=function(ie){if(!k){var Ce=V(ie);m==null||m(In(Ce)),b(Ce)}},W=function(ie){if(h==null||h(ie),ie.which===vt.ENTER){var Ce=V(ie);m==null||m(In(Ce)),b(Ce)}},J=function(ie){D(o),x==null||x(ie)},oe={};e.role==="option"&&(oe["aria-selected"]=q);var ae=l.createElement(ts,De({ref:_,elementRef:M,role:u===null?"none":u||"menuitem",tabIndex:a?null:-1,"data-menu-id":S&&c?null:c},xt(w,["extra"]),L,oe,{component:"li","aria-disabled":a,style:ze(ze({},ee),t),className:Z(E,re(re(re({},"".concat(E,"-active"),K),"".concat(E,"-selected"),q),"".concat(E,"-disabled"),k),r),onClick:R,onKeyDown:W,onFocus:J}),s,l.createElement(ia,{props:ze(ze({},e),{},{isSelected:q}),icon:j}));return N&&(ae=N(ae,e,{selected:q})),ae});function rs(e,n){var t=e.eventKey,r=Dn(),o=Yt(t);return l.useEffect(function(){if(r)return r.registerPath(t,o),function(){r.unregisterPath(t,o)}},[o]),r?null:l.createElement(ns,De({},e,{ref:n}))}const Pn=l.forwardRef(rs);var os=["className","children"],as=function(n,t){var r=n.className,o=n.children,a=ot(n,os),i=l.useContext(ht),s=i.prefixCls,u=i.mode,d=i.rtl;return l.createElement("ul",De({className:Z(s,d&&"".concat(s,"-rtl"),"".concat(s,"-sub"),"".concat(s,"-").concat(u==="inline"?"inline":"vertical"),r),role:"menu"},a,{"data-menu-list":!0,ref:t}),o)},Br=l.forwardRef(as);Br.displayName="SubMenuList";function Tr(e,n){return Sr(e).map(function(t,r){if(l.isValidElement(t)){var o,a,i=t.key,s=(o=(a=t.props)===null||a===void 0?void 0:a.eventKey)!==null&&o!==void 0?o:i,u=s==null;u&&(s="tmp_key-".concat([].concat(Ye(n),[r]).join("-")));var d={key:s,eventKey:s};return l.cloneElement(t,d)}return t})}var Ze={adjustX:1,adjustY:1},is={topLeft:{points:["bl","tl"],overflow:Ze},topRight:{points:["br","tr"],overflow:Ze},bottomLeft:{points:["tl","bl"],overflow:Ze},bottomRight:{points:["tr","br"],overflow:Ze},leftTop:{points:["tr","tl"],overflow:Ze},leftBottom:{points:["br","bl"],overflow:Ze},rightTop:{points:["tl","tr"],overflow:Ze},rightBottom:{points:["bl","br"],overflow:Ze}},ss={topLeft:{points:["bl","tl"],overflow:Ze},topRight:{points:["br","tr"],overflow:Ze},bottomLeft:{points:["tl","bl"],overflow:Ze},bottomRight:{points:["tr","br"],overflow:Ze},rightTop:{points:["tr","tl"],overflow:Ze},rightBottom:{points:["br","bl"],overflow:Ze},leftTop:{points:["tl","tr"],overflow:Ze},leftBottom:{points:["bl","br"],overflow:Ze}};function sa(e,n,t){if(n)return n;if(t)return t[e]||t.other}var ls={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function cs(e){var n=e.prefixCls,t=e.visible,r=e.children,o=e.popup,a=e.popupStyle,i=e.popupClassName,s=e.popupOffset,u=e.disabled,d=e.mode,f=e.onVisibleChange,m=l.useContext(ht),h=m.getPopupContainer,x=m.rtl,w=m.subMenuOpenDelay,c=m.subMenuCloseDelay,p=m.builtinPlacements,C=m.triggerSubMenuAction,b=m.forceSubMenuRender,I=m.rootClassName,S=m.motion,y=m.defaultMotions,F=l.useState(!1),D=Ke(F,2),O=D[0],N=D[1],E=x?ze(ze({},ss),p):ze(ze({},is),p),_=ls[d],T=sa(d,S,y),k=l.useRef(T);d!=="inline"&&(k.current=T);var M=ze(ze({},k.current),{},{leavedClassName:"".concat(n,"-hidden"),removeOnLeave:!1,motionAppear:!0}),B=l.useRef();return l.useEffect(function(){return B.current=Xt(function(){N(t)}),function(){Xt.cancel(B.current)}},[t]),l.createElement(Ro,{prefixCls:n,popupClassName:Z("".concat(n,"-popup"),re({},"".concat(n,"-rtl"),x),i,I),stretch:d==="horizontal"?"minWidth":null,getPopupContainer:h,builtinPlacements:E,popupPlacement:_,popupVisible:O,popup:o,popupStyle:a,popupAlign:s&&{offset:s},action:u?[]:[C],mouseEnterDelay:w,mouseLeaveDelay:c,onPopupVisibleChange:f,forceRender:b,popupMotion:M,fresh:!0},r)}function us(e){var n=e.id,t=e.open,r=e.keyPath,o=e.children,a="inline",i=l.useContext(ht),s=i.prefixCls,u=i.forceSubMenuRender,d=i.motion,f=i.defaultMotions,m=i.mode,h=l.useRef(!1);h.current=m===a;var x=l.useState(!h.current),w=Ke(x,2),c=w[0],p=w[1],C=h.current?t:!1;l.useEffect(function(){h.current&&p(!1)},[m]);var b=ze({},sa(a,d,f));r.length>1&&(b.motionAppear=!1);var I=b.onVisibleChanged;return b.onVisibleChanged=function(S){return!h.current&&!S&&p(!0),I==null?void 0:I(S)},c?null:l.createElement(ln,{mode:a,locked:!h.current},l.createElement(Er,De({visible:C},b,{forceRender:u,removeOnLeave:!1,leavedClassName:"".concat(s,"-hidden")}),function(S){var y=S.className,F=S.style;return l.createElement(Br,{id:n,className:y,style:F},o)}))}var ds=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],ps=["active"],ms=l.forwardRef(function(e,n){var t=e.style,r=e.className,o=e.title,a=e.eventKey;e.warnKey;var i=e.disabled,s=e.internalPopupClose,u=e.children,d=e.itemIcon,f=e.expandIcon,m=e.popupClassName,h=e.popupOffset,x=e.popupStyle,w=e.onClick,c=e.onMouseEnter,p=e.onMouseLeave,C=e.onTitleClick,b=e.onTitleMouseEnter,I=e.onTitleMouseLeave,S=ot(e,ds),y=Zo(a),F=l.useContext(ht),D=F.prefixCls,O=F.mode,N=F.openKeys,E=F.disabled,_=F.overflowDisabled,T=F.activeKey,k=F.selectedKeys,M=F.itemIcon,B=F.expandIcon,V=F.onItemClick,j=F.onOpenChange,U=F.onActive,K=l.useContext(kr),L=K._internalRenderSubMenuItem,q=l.useContext(na),ee=q.isSubPathKey,R=Yt(),W="".concat(D,"-submenu"),J=E||i,oe=l.useRef(),ae=l.useRef(),Q=d??M,ie=f??B,Ce=N.includes(a),xe=!_&&Ce,we=ee(k,a),Te=oa(a,J,b,I),Je=Te.active,Le=ot(Te,ps),ve=l.useState(!1),me=Ke(ve,2),ct=me[0],mt=me[1],$t=function(G){J||mt(G)},It=function(G){$t(!0),c==null||c({key:a,domEvent:G})},At=function(G){$t(!1),p==null||p({key:a,domEvent:G})},et=l.useMemo(function(){return Je||(O!=="inline"?ct||ee([T],a):!1)},[O,Je,T,ct,a,ee]),qe=aa(R.length),St=function(G){J||(C==null||C({key:a,domEvent:G}),O==="inline"&&j(a,!Ce))},kt=nn(function(We){w==null||w(In(We)),V(We)}),Mt=function(G){O!=="inline"&&j(a,G)},Et=function(){U(a)},Ae=y&&"".concat(y,"-popup"),ce=l.useMemo(function(){return l.createElement(ia,{icon:O!=="horizontal"?ie:void 0,props:ze(ze({},e),{},{isOpen:xe,isSubMenu:!0})},l.createElement("i",{className:"".concat(W,"-arrow")}))},[O,ie,e,xe,W]),nt=l.createElement("div",De({role:"menuitem",style:qe,className:"".concat(W,"-title"),tabIndex:J?null:-1,ref:oe,title:typeof o=="string"?o:null,"data-menu-id":_&&y?null:y,"aria-expanded":xe,"aria-haspopup":!0,"aria-controls":Ae,"aria-disabled":J,onClick:St,onFocus:Et},Le),o,ce),ut=l.useRef(O);if(O!=="inline"&&R.length>1?ut.current="vertical":ut.current=O,!_){var ft=ut.current;nt=l.createElement(cs,{mode:ft,prefixCls:W,visible:!s&&xe&&O!=="inline",popupClassName:m,popupOffset:h,popupStyle:x,popup:l.createElement(ln,{mode:ft==="horizontal"?"vertical":ft},l.createElement(Br,{id:Ae,ref:ae},u)),disabled:J,onVisibleChange:Mt},nt)}var Ue=l.createElement(an.Item,De({ref:n,role:"none"},S,{component:"li",style:t,className:Z(W,"".concat(W,"-").concat(O),r,re(re(re(re({},"".concat(W,"-open"),xe),"".concat(W,"-active"),et),"".concat(W,"-selected"),we),"".concat(W,"-disabled"),J)),onMouseEnter:It,onMouseLeave:At}),nt,!_&&l.createElement(us,{id:Ae,open:xe,keyPath:R},u));return L&&(Ue=L(Ue,e,{selected:we,active:et,open:xe,disabled:J})),l.createElement(ln,{onItemClick:kt,mode:O==="horizontal"?"vertical":O,itemIcon:Q,expandIcon:ie},Ue)}),An=l.forwardRef(function(e,n){var t=e.eventKey,r=e.children,o=Yt(t),a=Tr(r,o),i=Dn();l.useEffect(function(){if(i)return i.registerPath(t,o),function(){i.unregisterPath(t,o)}},[o]);var s;return i?s=a:s=l.createElement(ms,De({ref:n},e),a),l.createElement(ta.Provider,{value:o},s)});function _r(e){var n=e.className,t=e.style,r=l.useContext(ht),o=r.prefixCls,a=Dn();return a?null:l.createElement("li",{role:"separator",className:Z("".concat(o,"-item-divider"),n),style:t})}var fs=["className","title","eventKey","children"],gs=l.forwardRef(function(e,n){var t=e.className,r=e.title;e.eventKey;var o=e.children,a=ot(e,fs),i=l.useContext(ht),s=i.prefixCls,u="".concat(s,"-item-group");return l.createElement("li",De({ref:n,role:"presentation"},a,{onClick:function(f){return f.stopPropagation()},className:Z(u,t)}),l.createElement("div",{role:"presentation",className:"".concat(u,"-title"),title:typeof r=="string"?r:void 0},r),l.createElement("ul",{role:"group",className:"".concat(u,"-list")},o))}),zr=l.forwardRef(function(e,n){var t=e.eventKey,r=e.children,o=Yt(t),a=Tr(r,o),i=Dn();return i?a:l.createElement(gs,De({ref:n},xt(e,["warnKey"])),a)}),hs=["label","children","key","type","extra"];function fr(e,n,t){var r=n.item,o=n.group,a=n.submenu,i=n.divider;return(e||[]).map(function(s,u){if(s&&jt(s)==="object"){var d=s,f=d.label,m=d.children,h=d.key,x=d.type,w=d.extra,c=ot(d,hs),p=h??"tmp-".concat(u);return m||x==="group"?x==="group"?l.createElement(o,De({key:p},c,{title:f}),fr(m,n,t)):l.createElement(a,De({key:p},c,{title:f}),fr(m,n,t)):x==="divider"?l.createElement(i,De({key:p},c)):l.createElement(r,De({key:p},c,{extra:w}),f,(!!w||w===0)&&l.createElement("span",{className:"".concat(t,"-item-extra")},w))}return null}).filter(function(s){return s})}function no(e,n,t,r,o){var a=e,i=ze({divider:_r,item:Pn,group:zr,submenu:An},r);return n&&(a=fr(n,i,o)),Tr(a,t)}var vs=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem","_internalComponents"],zt=[],bs=l.forwardRef(function(e,n){var t,r=e,o=r.prefixCls,a=o===void 0?"rc-menu":o,i=r.rootClassName,s=r.style,u=r.className,d=r.tabIndex,f=d===void 0?0:d,m=r.items,h=r.children,x=r.direction,w=r.id,c=r.mode,p=c===void 0?"vertical":c,C=r.inlineCollapsed,b=r.disabled,I=r.disabledOverflow,S=r.subMenuOpenDelay,y=S===void 0?.1:S,F=r.subMenuCloseDelay,D=F===void 0?.1:F,O=r.forceSubMenuRender,N=r.defaultOpenKeys,E=r.openKeys,_=r.activeKey,T=r.defaultActiveFirst,k=r.selectable,M=k===void 0?!0:k,B=r.multiple,V=B===void 0?!1:B,j=r.defaultSelectedKeys,U=r.selectedKeys,K=r.onSelect,L=r.onDeselect,q=r.inlineIndent,ee=q===void 0?24:q,R=r.motion,W=r.defaultMotions,J=r.triggerSubMenuAction,oe=J===void 0?"hover":J,ae=r.builtinPlacements,Q=r.itemIcon,ie=r.expandIcon,Ce=r.overflowedIndicator,xe=Ce===void 0?"...":Ce,we=r.overflowedIndicatorPopupClassName,Te=r.getPopupContainer,Je=r.onClick,Le=r.onOpenChange,ve=r.onKeyDown;r.openAnimation,r.openTransitionName;var me=r._internalRenderMenuItem,ct=r._internalRenderSubMenuItem,mt=r._internalComponents,$t=ot(r,vs),It=l.useMemo(function(){return[no(h,m,zt,mt,a),no(h,m,zt,{},a)]},[h,m,mt]),At=Ke(It,2),et=At[0],qe=At[1],St=l.useState(!1),kt=Ke(St,2),Mt=kt[0],Et=kt[1],Ae=l.useRef(),ce=Ji(w),nt=x==="rtl",ut=Lt(N,{value:E,postState:function(Ee){return Ee||zt}}),ft=Ke(ut,2),Ue=ft[0],We=ft[1],G=function(Ee){var Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function it(){We(Ee),Le==null||Le(Ee)}Me?lr(it):it()},pe=l.useState(Ue),Fe=Ke(pe,2),se=Fe[0],be=Fe[1],_e=l.useRef(!1),at=l.useMemo(function(){return(p==="inline"||p==="vertical")&&C?["vertical",C]:[p,!1]},[p,C]),dt=Ke(at,2),tt=dt[0],Ft=dt[1],pn=tt==="inline",Rn=l.useState(tt),mn=Ke(Rn,2),bt=mn[0],Bn=mn[1],Tn=l.useState(Ft),fn=Ke(Tn,2),_n=fn[0],zn=fn[1];l.useEffect(function(){Bn(tt),zn(Ft),_e.current&&(pn?We(se):G(zt))},[tt,Ft]);var jn=l.useState(0),gn=Ke(jn,2),Nt=gn[0],Ln=gn[1],gt=Nt>=et.length-1||bt!=="horizontal"||I;l.useEffect(function(){pn&&be(Ue)},[Ue]),l.useEffect(function(){return _e.current=!0,function(){_e.current=!1}},[]);var Ot=Xi(),Qt=Ot.registerPath,Hn=Ot.unregisterPath,qn=Ot.refreshOverflowKeys,v=Ot.isSubPathKey,g=Ot.getKeyPath,P=Ot.getKeys,A=Ot.getSubPathKeys,H=l.useMemo(function(){return{registerPath:Qt,unregisterPath:Hn}},[Qt,Hn]),X=l.useMemo(function(){return{isSubPathKey:v}},[v]);l.useEffect(function(){qn(gt?zt:et.slice(Nt+1).map(function(ke){return ke.key}))},[Nt,gt]);var ge=Lt(_||T&&((t=et[0])===null||t===void 0?void 0:t.key),{value:_}),te=Ke(ge,2),he=te[0],Se=te[1],z=nn(function(ke){Se(ke)}),ye=nn(function(){Se(void 0)});Po(n,function(){return{list:Ae.current,focus:function(Ee){var Me,it=P(),st=pr(it,ce),hn=st.elements,Un=st.key2element,Ia=st.element2key,Lr=Mr(Ae.current,hn),Hr=he??(Lr[0]?Ia.get(Lr[0]):(Me=et.find(function(Sa){return!Sa.props.disabled}))===null||Me===void 0?void 0:Me.key),Zt=Un.get(Hr);if(Hr&&Zt){var Wn;Zt==null||(Wn=Zt.focus)===null||Wn===void 0||Wn.call(Zt,Ee)}}}});var fe=Lt(j||[],{value:U,postState:function(Ee){return Array.isArray(Ee)?Ee:Ee==null?zt:[Ee]}}),Ne=Ke(fe,2),le=Ne[0],He=Ne[1],ue=function(Ee){if(M){var Me=Ee.key,it=le.includes(Me),st;V?it?st=le.filter(function(Un){return Un!==Me}):st=[].concat(Ye(le),[Me]):st=[Me],He(st);var hn=ze(ze({},Ee),{},{selectedKeys:st});it?L==null||L(hn):K==null||K(hn)}!V&&Ue.length&&bt!=="inline"&&G(zt)},de=nn(function(ke){Je==null||Je(In(ke)),ue(ke)}),$e=nn(function(ke,Ee){var Me=Ue.filter(function(st){return st!==ke});if(Ee)Me.push(ke);else if(bt!=="inline"){var it=A(ke);Me=Me.filter(function(st){return!it.has(st)})}Bo(Ue,Me,!0)||G(Me,!0)}),Pe=function(Ee,Me){var it=Me??!Ue.includes(Ee);$e(Ee,it)},Oe=Wi(bt,he,nt,ce,Ae,P,g,Se,Pe,ve);l.useEffect(function(){Et(!0)},[]);var Dt=l.useMemo(function(){return{_internalRenderMenuItem:me,_internalRenderSubMenuItem:ct}},[me,ct]),yt=bt!=="horizontal"||I?et:et.map(function(ke,Ee){return l.createElement(ln,{key:ke.key,overflowDisabled:Ee>Nt},ke)}),_t=l.createElement(an,De({id:w,ref:Ae,prefixCls:"".concat(a,"-overflow"),component:"ul",itemComponent:Pn,className:Z(a,"".concat(a,"-root"),"".concat(a,"-").concat(bt),u,re(re({},"".concat(a,"-inline-collapsed"),_n),"".concat(a,"-rtl"),nt),i),dir:x,style:s,role:"menu",tabIndex:f,data:yt,renderRawItem:function(Ee){return Ee},renderRawRest:function(Ee){var Me=Ee.length,it=Me?et.slice(-Me):null;return l.createElement(An,{eventKey:mr,title:xe,disabled:gt,internalPopupClose:Me===0,popupClassName:we},it)},maxCount:bt!=="horizontal"||I?an.INVALIDATE:an.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(Ee){Ln(Ee)},onKeyDown:Oe},$t));return l.createElement(kr.Provider,{value:Dt},l.createElement(Yo.Provider,{value:ce},l.createElement(ln,{prefixCls:a,rootClassName:i,mode:bt,openKeys:Ue,rtl:nt,disabled:b,motion:Mt?R:null,defaultMotions:Mt?W:null,activeKey:he,onActive:z,onInactive:ye,selectedKeys:le,inlineIndent:ee,subMenuOpenDelay:y,subMenuCloseDelay:D,forceSubMenuRender:O,builtinPlacements:ae,triggerSubMenuAction:oe,getPopupContainer:Te,itemIcon:Q,expandIcon:ie,onItemClick:de,onOpenChange:$e},l.createElement(na.Provider,{value:X},_t),l.createElement("div",{style:{display:"none"},"aria-hidden":!0},l.createElement(ea.Provider,{value:H},qe)))))}),un=bs;un.Item=Pn;un.SubMenu=An;un.ItemGroup=zr;un.Divider=_r;const la=l.createContext({});var ys={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},Cs=function(n,t){return l.createElement(Jt,De({},n,{ref:t,icon:ys}))},ca=l.forwardRef(Cs);const Sn=Fa({prefixCls:"",firstLevel:!0,inlineCollapsed:!1});var xs=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t};const ua=e=>{const{prefixCls:n,className:t,dashed:r}=e,o=xs(e,["prefixCls","className","dashed"]),{getPrefixCls:a}=l.useContext(wt),i=a("menu",n),s=Z({[`${i}-item-divider-dashed`]:!!r},t);return l.createElement(_r,Object.assign({className:s},o))},da=e=>{var n;const{className:t,children:r,icon:o,title:a,danger:i,extra:s}=e,{prefixCls:u,firstLevel:d,direction:f,disableMenuItemTitleTooltip:m,inlineCollapsed:h}=l.useContext(Sn),x=I=>{const S=r==null?void 0:r[0],y=l.createElement("span",{className:Z(`${u}-title-content`,{[`${u}-title-content-with-extra`]:!!s||s===0})},r);return(!o||l.isValidElement(r)&&r.type==="span")&&r&&I&&d&&typeof S=="string"?l.createElement("div",{className:`${u}-inline-collapsed-noicon`},S.charAt(0)):y},{siderCollapsed:w}=l.useContext(la);let c=a;typeof a>"u"?c=d?r:"":a===!1&&(c="");const p={title:c};!w&&!h&&(p.title=null,p.open=!1);const C=Sr(r).length;let b=l.createElement(Pn,Object.assign({},xt(e,["title","icon","danger"]),{className:Z({[`${u}-item-danger`]:i,[`${u}-item-only-child`]:(o?C+1:C)===1},t),title:typeof a=="string"?a:void 0}),Gt(o,{className:Z(l.isValidElement(o)?(n=o.props)===null||n===void 0?void 0:n.className:void 0,`${u}-item-icon`)}),x(h));return m||(b=l.createElement(Fr,Object.assign({},p,{placement:f==="rtl"?"left":"right",classNames:{root:`${u}-inline-collapsed-tooltip`}}),b)),b};var ws=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t};const En=l.createContext(null),$s=l.forwardRef((e,n)=>{const{children:t}=e,r=ws(e,["children"]),o=l.useContext(En),a=l.useMemo(()=>Object.assign(Object.assign({},o),r),[o,r.prefixCls,r.mode,r.selectable,r.rootClassName]),i=Pa(t),s=To(n,i?yr(t):null);return l.createElement(En.Provider,{value:a},l.createElement(Aa,{space:!0},i?l.cloneElement(t,{ref:s}):t))}),Is=e=>{const{componentCls:n,motionDurationSlow:t,horizontalLineHeight:r,colorSplit:o,lineWidth:a,lineType:i,itemPaddingInline:s}=e;return{[`${n}-horizontal`]:{lineHeight:r,border:0,borderBottom:`${ne(a)} ${i} ${o}`,boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},[`${n}-item, ${n}-submenu`]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:s},[`> ${n}-item:hover,
|
|
46
|
+
*/const Ni=Pt("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);var Oi=vt.ESC,Di=vt.TAB;function Pi(e){var n=e.visible,t=e.triggerRef,r=e.onVisibleChange,o=e.autoFocus,a=e.overlayRef,i=l.useRef(!1),s=function(){if(n){var m,v;(m=t.current)===null||m===void 0||(v=m.focus)===null||v===void 0||v.call(m),r==null||r(!1)}},u=function(){var m;return(m=a.current)!==null&&m!==void 0&&m.focus?(a.current.focus(),i.current=!0,!0):!1},d=function(m){switch(m.keyCode){case Oi:s();break;case Di:{var v=!1;i.current||(v=u()),v?m.preventDefault():s();break}}};l.useEffect(function(){return n?(window.addEventListener("keydown",d),o&&Xt(u,3),function(){window.removeEventListener("keydown",d),i.current=!1}):function(){i.current=!1}},[n])}var Ai=br(function(e,n){var t=e.overlay,r=e.arrow,o=e.prefixCls,a=Ge(function(){var s;return typeof t=="function"?s=t():s=t,s},[t]),i=ko(n,yr(a));return Be.createElement(Be.Fragment,null,r&&Be.createElement("div",{className:"".concat(o,"-arrow")}),Be.cloneElement(a,{ref:Mo(a)?i:void 0}))}),Ut={adjustX:1,adjustY:1},Wt=[0,0],ki={topLeft:{points:["bl","tl"],overflow:Ut,offset:[0,-4],targetOffset:Wt},top:{points:["bc","tc"],overflow:Ut,offset:[0,-4],targetOffset:Wt},topRight:{points:["br","tr"],overflow:Ut,offset:[0,-4],targetOffset:Wt},bottomLeft:{points:["tl","bl"],overflow:Ut,offset:[0,4],targetOffset:Wt},bottom:{points:["tc","bc"],overflow:Ut,offset:[0,4],targetOffset:Wt},bottomRight:{points:["tr","br"],overflow:Ut,offset:[0,4],targetOffset:Wt}},Mi=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function Ri(e,n){var t,r=e.arrow,o=r===void 0?!1:r,a=e.prefixCls,i=a===void 0?"rc-dropdown":a,s=e.transitionName,u=e.animation,d=e.align,f=e.placement,m=f===void 0?"bottomLeft":f,v=e.placements,x=v===void 0?ki:v,w=e.getPopupContainer,c=e.showAction,p=e.hideAction,C=e.overlayClassName,b=e.overlayStyle,I=e.visible,S=e.trigger,y=S===void 0?["hover"]:S,F=e.autoFocus,D=e.overlay,O=e.children,N=e.onVisibleChange,E=ot(e,Mi),_=Be.useState(),T=Ke(_,2),k=T[0],M=T[1],B="visible"in e?I:k,V=Be.useRef(null),j=Be.useRef(null),U=Be.useRef(null);Be.useImperativeHandle(n,function(){return V.current});var K=function(Q){M(Q),N==null||N(Q)};Pi({visible:B,triggerRef:U,onVisibleChange:K,autoFocus:F,overlayRef:j});var L=function(Q){var ie=e.onOverlayClick;M(!1),ie&&ie(Q)},q=function(){return Be.createElement(Ai,{ref:j,overlay:D,prefixCls:i,arrow:o})},ee=function(){return typeof D=="function"?q:q()},R=function(){var Q=e.minOverlayWidthMatchTrigger,ie=e.alignPoint;return"minOverlayWidthMatchTrigger"in e?Q:!ie},W=function(){var Q=e.openClassName;return Q!==void 0?Q:"".concat(i,"-open")},J=Be.cloneElement(O,{className:Z((t=O.props)===null||t===void 0?void 0:t.className,B&&W()),ref:Mo(O)?ko(U,yr(O)):void 0}),oe=p;return!oe&&y.indexOf("contextMenu")!==-1&&(oe=["click"]),Be.createElement(Ro,De({builtinPlacements:x},E,{prefixCls:i,ref:V,popupClassName:Z(C,re({},"".concat(i,"-show-arrow"),o)),popupStyle:b,action:y,showAction:c,hideAction:oe,popupPlacement:m,popupAlign:d,popupTransitionName:s,popupAnimation:u,popupVisible:B,stretch:R()?"minWidth":"",popup:ee(),onPopupVisibleChange:K,onPopupClick:L,getPopupContainer:w}),J)}const Bi=Be.forwardRef(Ri),Ti=e=>typeof e!="object"&&typeof e!="function"||e===null;var Yo=l.createContext(null);function Qo(e,n){return e===void 0?null:"".concat(e,"-").concat(n)}function Zo(e){var n=l.useContext(Yo);return Qo(n,e)}var _i=["children","locked"],ht=l.createContext(null);function zi(e,n){var t=ze({},e);return Object.keys(n).forEach(function(r){var o=n[r];o!==void 0&&(t[r]=o)}),t}function ln(e){var n=e.children,t=e.locked,r=ot(e,_i),o=l.useContext(ht),a=Oa(function(){return zi(o,r)},[o,r],function(i,s){return!t&&(i[0]!==s[0]||!Bo(i[1],s[1],!0))});return l.createElement(ht.Provider,{value:a},n)}var ji=[],ea=l.createContext(null);function Dn(){return l.useContext(ea)}var ta=l.createContext(ji);function Yt(e){var n=l.useContext(ta);return l.useMemo(function(){return e!==void 0?[].concat(Ye(n),[e]):n},[n,e])}var na=l.createContext(null),kr=l.createContext({});function Yr(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(Da(e)){var t=e.nodeName.toLowerCase(),r=["input","select","textarea","button"].includes(t)||e.isContentEditable||t==="a"&&!!e.getAttribute("href"),o=e.getAttribute("tabindex"),a=Number(o),i=null;return o&&!Number.isNaN(a)?i=a:r&&i===null&&(i=0),r&&e.disabled&&(i=null),i!==null&&(i>=0||n&&i<0)}return!1}function Li(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=Ye(e.querySelectorAll("*")).filter(function(r){return Yr(r,n)});return Yr(e,n)&&t.unshift(e),t}var cr=vt.LEFT,ur=vt.RIGHT,dr=vt.UP,Cn=vt.DOWN,xn=vt.ENTER,ra=vt.ESC,en=vt.HOME,tn=vt.END,Qr=[dr,Cn,cr,ur];function Hi(e,n,t,r){var o,a="prev",i="next",s="children",u="parent";if(e==="inline"&&r===xn)return{inlineTrigger:!0};var d=re(re({},dr,a),Cn,i),f=re(re(re(re({},cr,t?i:a),ur,t?a:i),Cn,s),xn,s),m=re(re(re(re(re(re({},dr,a),Cn,i),xn,s),ra,u),cr,t?s:u),ur,t?u:s),v={inline:d,horizontal:f,vertical:m,inlineSub:d,horizontalSub:m,verticalSub:m},x=(o=v["".concat(e).concat(n?"":"Sub")])===null||o===void 0?void 0:o[r];switch(x){case a:return{offset:-1,sibling:!0};case i:return{offset:1,sibling:!0};case u:return{offset:-1,sibling:!1};case s:return{offset:1,sibling:!1};default:return null}}function qi(e){for(var n=e;n;){if(n.getAttribute("data-menu-list"))return n;n=n.parentElement}return null}function Ui(e,n){for(var t=e||document.activeElement;t;){if(n.has(t))return t;t=t.parentElement}return null}function Mr(e,n){var t=Li(e,!0);return t.filter(function(r){return n.has(r)})}function Zr(e,n,t){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!e)return null;var o=Mr(e,n),a=o.length,i=o.findIndex(function(s){return t===s});return r<0?i===-1?i=a-1:i-=1:r>0&&(i+=1),i=(i+a)%a,o[i]}var pr=function(n,t){var r=new Set,o=new Map,a=new Map;return n.forEach(function(i){var s=document.querySelector("[data-menu-id='".concat(Qo(t,i),"']"));s&&(r.add(s),a.set(s,i),o.set(i,s))}),{elements:r,key2element:o,element2key:a}};function Wi(e,n,t,r,o,a,i,s,u,d){var f=l.useRef(),m=l.useRef();m.current=n;var v=function(){Xt.cancel(f.current)};return l.useEffect(function(){return function(){v()}},[]),function(x){var w=x.which;if([].concat(Qr,[xn,ra,en,tn]).includes(w)){var c=a(),p=pr(c,r),C=p,b=C.elements,I=C.key2element,S=C.element2key,y=I.get(n),F=Ui(y,b),D=S.get(F),O=Hi(e,i(D,!0).length===1,t,w);if(!O&&w!==en&&w!==tn)return;(Qr.includes(w)||[en,tn].includes(w))&&x.preventDefault();var N=function(j){if(j){var U=j,K=j.querySelector("a");K!=null&&K.getAttribute("href")&&(U=K);var L=S.get(j);s(L),v(),f.current=Xt(function(){m.current===L&&U.focus()})}};if([en,tn].includes(w)||O.sibling||!F){var E;!F||e==="inline"?E=o.current:E=qi(F);var _,T=Mr(E,b);w===en?_=T[0]:w===tn?_=T[T.length-1]:_=Zr(E,b,F,O.offset),N(_)}else if(O.inlineTrigger)u(D);else if(O.offset>0)u(D,!0),v(),f.current=Xt(function(){p=pr(c,r);var V=F.getAttribute("aria-controls"),j=document.getElementById(V),U=Zr(j,p.elements);N(U)},5);else if(O.offset<0){var k=i(D,!0),M=k[k.length-2],B=I.get(M);u(M,!1),N(B)}}d==null||d(x)}}function Vi(e){Promise.resolve().then(e)}var Rr="__RC_UTIL_PATH_SPLIT__",eo=function(n){return n.join(Rr)},Ki=function(n){return n.split(Rr)},mr="rc-menu-more";function Xi(){var e=l.useState({}),n=Ke(e,2),t=n[1],r=Xe(new Map),o=Xe(new Map),a=l.useState([]),i=Ke(a,2),s=i[0],u=i[1],d=Xe(0),f=Xe(!1),m=function(){f.current||t({})},v=qt(function(I,S){var y=eo(S);o.current.set(y,I),r.current.set(I,y),d.current+=1;var F=d.current;Vi(function(){F===d.current&&m()})},[]),x=qt(function(I,S){var y=eo(S);o.current.delete(y),r.current.delete(I)},[]),w=qt(function(I){u(I)},[]),c=qt(function(I,S){var y=r.current.get(I)||"",F=Ki(y);return S&&s.includes(F[0])&&F.unshift(mr),F},[s]),p=qt(function(I,S){return I.filter(function(y){return y!==void 0}).some(function(y){var F=c(y,!0);return F.includes(S)})},[c]),C=function(){var S=Ye(r.current.keys());return s.length&&S.push(mr),S},b=qt(function(I){var S="".concat(r.current.get(I)).concat(Rr),y=new Set;return Ye(o.current.keys()).forEach(function(F){F.startsWith(S)&&y.add(o.current.get(F))}),y},[]);return l.useEffect(function(){return function(){f.current=!0}},[]),{registerPath:v,unregisterPath:x,refreshOverflowKeys:w,isSubPathKey:p,getKeyPath:c,getKeys:C,getSubPathKeys:b}}function nn(e){var n=l.useRef(e);n.current=e;var t=l.useCallback(function(){for(var r,o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return(r=n.current)===null||r===void 0?void 0:r.call.apply(r,[n].concat(a))},[]);return e?t:void 0}var Gi=Math.random().toFixed(5).toString().slice(2),to=0;function Ji(e){var n=Lt(e,{value:e}),t=Ke(n,2),r=t[0],o=t[1];return l.useEffect(function(){to+=1;var a="".concat(Gi,"-").concat(to);o("rc-menu-uuid-".concat(a))},[]),r}function oa(e,n,t,r){var o=l.useContext(ht),a=o.activeKey,i=o.onActive,s=o.onInactive,u={active:a===e};return n||(u.onMouseEnter=function(d){t==null||t({key:e,domEvent:d}),i(e)},u.onMouseLeave=function(d){r==null||r({key:e,domEvent:d}),s(e)}),u}function aa(e){var n=l.useContext(ht),t=n.mode,r=n.rtl,o=n.inlineIndent;if(t!=="inline")return null;var a=e;return r?{paddingRight:a*o}:{paddingLeft:a*o}}function ia(e){var n=e.icon,t=e.props,r=e.children,o;return n===null||n===!1?null:(typeof n=="function"?o=l.createElement(n,ze({},t)):typeof n!="boolean"&&(o=n),o||r||null)}var Yi=["item"];function In(e){var n=e.item,t=ot(e,Yi);return Object.defineProperty(t,"item",{get:function(){return Cr(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),n}}),t}var Qi=["title","attribute","elementRef"],Zi=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],es=["active"],ts=(function(e){xr(t,e);var n=wr(t);function t(){return $r(this,t),n.apply(this,arguments)}return Ir(t,[{key:"render",value:function(){var o=this.props,a=o.title,i=o.attribute,s=o.elementRef,u=ot(o,Qi),d=xt(u,["eventKey","popupClassName","popupOffset","onTitleClick"]);return Cr(!i,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),l.createElement(an.Item,De({},i,{title:typeof a=="string"?a:void 0},d,{ref:s}))}}]),t})(l.Component),ns=l.forwardRef(function(e,n){var t=e.style,r=e.className,o=e.eventKey;e.warnKey;var a=e.disabled,i=e.itemIcon,s=e.children,u=e.role,d=e.onMouseEnter,f=e.onMouseLeave,m=e.onClick,v=e.onKeyDown,x=e.onFocus,w=ot(e,Zi),c=Zo(o),p=l.useContext(ht),C=p.prefixCls,b=p.onItemClick,I=p.disabled,S=p.overflowDisabled,y=p.itemIcon,F=p.selectedKeys,D=p.onActive,O=l.useContext(kr),N=O._internalRenderMenuItem,E="".concat(C,"-item"),_=l.useRef(),T=l.useRef(),k=I||a,M=To(n,T),B=Yt(o),V=function(ie){return{key:o,keyPath:Ye(B).reverse(),item:_.current,domEvent:ie}},j=i||y,U=oa(o,k,d,f),K=U.active,L=ot(U,es),q=F.includes(o),ee=aa(B.length),R=function(ie){if(!k){var Ce=V(ie);m==null||m(In(Ce)),b(Ce)}},W=function(ie){if(v==null||v(ie),ie.which===vt.ENTER){var Ce=V(ie);m==null||m(In(Ce)),b(Ce)}},J=function(ie){D(o),x==null||x(ie)},oe={};e.role==="option"&&(oe["aria-selected"]=q);var ae=l.createElement(ts,De({ref:_,elementRef:M,role:u===null?"none":u||"menuitem",tabIndex:a?null:-1,"data-menu-id":S&&c?null:c},xt(w,["extra"]),L,oe,{component:"li","aria-disabled":a,style:ze(ze({},ee),t),className:Z(E,re(re(re({},"".concat(E,"-active"),K),"".concat(E,"-selected"),q),"".concat(E,"-disabled"),k),r),onClick:R,onKeyDown:W,onFocus:J}),s,l.createElement(ia,{props:ze(ze({},e),{},{isSelected:q}),icon:j}));return N&&(ae=N(ae,e,{selected:q})),ae});function rs(e,n){var t=e.eventKey,r=Dn(),o=Yt(t);return l.useEffect(function(){if(r)return r.registerPath(t,o),function(){r.unregisterPath(t,o)}},[o]),r?null:l.createElement(ns,De({},e,{ref:n}))}const Pn=l.forwardRef(rs);var os=["className","children"],as=function(n,t){var r=n.className,o=n.children,a=ot(n,os),i=l.useContext(ht),s=i.prefixCls,u=i.mode,d=i.rtl;return l.createElement("ul",De({className:Z(s,d&&"".concat(s,"-rtl"),"".concat(s,"-sub"),"".concat(s,"-").concat(u==="inline"?"inline":"vertical"),r),role:"menu"},a,{"data-menu-list":!0,ref:t}),o)},Br=l.forwardRef(as);Br.displayName="SubMenuList";function Tr(e,n){return Sr(e).map(function(t,r){if(l.isValidElement(t)){var o,a,i=t.key,s=(o=(a=t.props)===null||a===void 0?void 0:a.eventKey)!==null&&o!==void 0?o:i,u=s==null;u&&(s="tmp_key-".concat([].concat(Ye(n),[r]).join("-")));var d={key:s,eventKey:s};return l.cloneElement(t,d)}return t})}var Ze={adjustX:1,adjustY:1},is={topLeft:{points:["bl","tl"],overflow:Ze},topRight:{points:["br","tr"],overflow:Ze},bottomLeft:{points:["tl","bl"],overflow:Ze},bottomRight:{points:["tr","br"],overflow:Ze},leftTop:{points:["tr","tl"],overflow:Ze},leftBottom:{points:["br","bl"],overflow:Ze},rightTop:{points:["tl","tr"],overflow:Ze},rightBottom:{points:["bl","br"],overflow:Ze}},ss={topLeft:{points:["bl","tl"],overflow:Ze},topRight:{points:["br","tr"],overflow:Ze},bottomLeft:{points:["tl","bl"],overflow:Ze},bottomRight:{points:["tr","br"],overflow:Ze},rightTop:{points:["tr","tl"],overflow:Ze},rightBottom:{points:["br","bl"],overflow:Ze},leftTop:{points:["tl","tr"],overflow:Ze},leftBottom:{points:["bl","br"],overflow:Ze}};function sa(e,n,t){if(n)return n;if(t)return t[e]||t.other}var ls={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function cs(e){var n=e.prefixCls,t=e.visible,r=e.children,o=e.popup,a=e.popupStyle,i=e.popupClassName,s=e.popupOffset,u=e.disabled,d=e.mode,f=e.onVisibleChange,m=l.useContext(ht),v=m.getPopupContainer,x=m.rtl,w=m.subMenuOpenDelay,c=m.subMenuCloseDelay,p=m.builtinPlacements,C=m.triggerSubMenuAction,b=m.forceSubMenuRender,I=m.rootClassName,S=m.motion,y=m.defaultMotions,F=l.useState(!1),D=Ke(F,2),O=D[0],N=D[1],E=x?ze(ze({},ss),p):ze(ze({},is),p),_=ls[d],T=sa(d,S,y),k=l.useRef(T);d!=="inline"&&(k.current=T);var M=ze(ze({},k.current),{},{leavedClassName:"".concat(n,"-hidden"),removeOnLeave:!1,motionAppear:!0}),B=l.useRef();return l.useEffect(function(){return B.current=Xt(function(){N(t)}),function(){Xt.cancel(B.current)}},[t]),l.createElement(Ro,{prefixCls:n,popupClassName:Z("".concat(n,"-popup"),re({},"".concat(n,"-rtl"),x),i,I),stretch:d==="horizontal"?"minWidth":null,getPopupContainer:v,builtinPlacements:E,popupPlacement:_,popupVisible:O,popup:o,popupStyle:a,popupAlign:s&&{offset:s},action:u?[]:[C],mouseEnterDelay:w,mouseLeaveDelay:c,onPopupVisibleChange:f,forceRender:b,popupMotion:M,fresh:!0},r)}function us(e){var n=e.id,t=e.open,r=e.keyPath,o=e.children,a="inline",i=l.useContext(ht),s=i.prefixCls,u=i.forceSubMenuRender,d=i.motion,f=i.defaultMotions,m=i.mode,v=l.useRef(!1);v.current=m===a;var x=l.useState(!v.current),w=Ke(x,2),c=w[0],p=w[1],C=v.current?t:!1;l.useEffect(function(){v.current&&p(!1)},[m]);var b=ze({},sa(a,d,f));r.length>1&&(b.motionAppear=!1);var I=b.onVisibleChanged;return b.onVisibleChanged=function(S){return!v.current&&!S&&p(!0),I==null?void 0:I(S)},c?null:l.createElement(ln,{mode:a,locked:!v.current},l.createElement(Er,De({visible:C},b,{forceRender:u,removeOnLeave:!1,leavedClassName:"".concat(s,"-hidden")}),function(S){var y=S.className,F=S.style;return l.createElement(Br,{id:n,className:y,style:F},o)}))}var ds=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],ps=["active"],ms=l.forwardRef(function(e,n){var t=e.style,r=e.className,o=e.title,a=e.eventKey;e.warnKey;var i=e.disabled,s=e.internalPopupClose,u=e.children,d=e.itemIcon,f=e.expandIcon,m=e.popupClassName,v=e.popupOffset,x=e.popupStyle,w=e.onClick,c=e.onMouseEnter,p=e.onMouseLeave,C=e.onTitleClick,b=e.onTitleMouseEnter,I=e.onTitleMouseLeave,S=ot(e,ds),y=Zo(a),F=l.useContext(ht),D=F.prefixCls,O=F.mode,N=F.openKeys,E=F.disabled,_=F.overflowDisabled,T=F.activeKey,k=F.selectedKeys,M=F.itemIcon,B=F.expandIcon,V=F.onItemClick,j=F.onOpenChange,U=F.onActive,K=l.useContext(kr),L=K._internalRenderSubMenuItem,q=l.useContext(na),ee=q.isSubPathKey,R=Yt(),W="".concat(D,"-submenu"),J=E||i,oe=l.useRef(),ae=l.useRef(),Q=d??M,ie=f??B,Ce=N.includes(a),xe=!_&&Ce,we=ee(k,a),Te=oa(a,J,b,I),Je=Te.active,Le=ot(Te,ps),ve=l.useState(!1),me=Ke(ve,2),ct=me[0],mt=me[1],$t=function(G){J||mt(G)},It=function(G){$t(!0),c==null||c({key:a,domEvent:G})},At=function(G){$t(!1),p==null||p({key:a,domEvent:G})},et=l.useMemo(function(){return Je||(O!=="inline"?ct||ee([T],a):!1)},[O,Je,T,ct,a,ee]),qe=aa(R.length),St=function(G){J||(C==null||C({key:a,domEvent:G}),O==="inline"&&j(a,!Ce))},kt=nn(function(We){w==null||w(In(We)),V(We)}),Mt=function(G){O!=="inline"&&j(a,G)},Et=function(){U(a)},Ae=y&&"".concat(y,"-popup"),ce=l.useMemo(function(){return l.createElement(ia,{icon:O!=="horizontal"?ie:void 0,props:ze(ze({},e),{},{isOpen:xe,isSubMenu:!0})},l.createElement("i",{className:"".concat(W,"-arrow")}))},[O,ie,e,xe,W]),nt=l.createElement("div",De({role:"menuitem",style:qe,className:"".concat(W,"-title"),tabIndex:J?null:-1,ref:oe,title:typeof o=="string"?o:null,"data-menu-id":_&&y?null:y,"aria-expanded":xe,"aria-haspopup":!0,"aria-controls":Ae,"aria-disabled":J,onClick:St,onFocus:Et},Le),o,ce),ut=l.useRef(O);if(O!=="inline"&&R.length>1?ut.current="vertical":ut.current=O,!_){var ft=ut.current;nt=l.createElement(cs,{mode:ft,prefixCls:W,visible:!s&&xe&&O!=="inline",popupClassName:m,popupOffset:v,popupStyle:x,popup:l.createElement(ln,{mode:ft==="horizontal"?"vertical":ft},l.createElement(Br,{id:Ae,ref:ae},u)),disabled:J,onVisibleChange:Mt},nt)}var Ue=l.createElement(an.Item,De({ref:n,role:"none"},S,{component:"li",style:t,className:Z(W,"".concat(W,"-").concat(O),r,re(re(re(re({},"".concat(W,"-open"),xe),"".concat(W,"-active"),et),"".concat(W,"-selected"),we),"".concat(W,"-disabled"),J)),onMouseEnter:It,onMouseLeave:At}),nt,!_&&l.createElement(us,{id:Ae,open:xe,keyPath:R},u));return L&&(Ue=L(Ue,e,{selected:we,active:et,open:xe,disabled:J})),l.createElement(ln,{onItemClick:kt,mode:O==="horizontal"?"vertical":O,itemIcon:Q,expandIcon:ie},Ue)}),An=l.forwardRef(function(e,n){var t=e.eventKey,r=e.children,o=Yt(t),a=Tr(r,o),i=Dn();l.useEffect(function(){if(i)return i.registerPath(t,o),function(){i.unregisterPath(t,o)}},[o]);var s;return i?s=a:s=l.createElement(ms,De({ref:n},e),a),l.createElement(ta.Provider,{value:o},s)});function _r(e){var n=e.className,t=e.style,r=l.useContext(ht),o=r.prefixCls,a=Dn();return a?null:l.createElement("li",{role:"separator",className:Z("".concat(o,"-item-divider"),n),style:t})}var fs=["className","title","eventKey","children"],gs=l.forwardRef(function(e,n){var t=e.className,r=e.title;e.eventKey;var o=e.children,a=ot(e,fs),i=l.useContext(ht),s=i.prefixCls,u="".concat(s,"-item-group");return l.createElement("li",De({ref:n,role:"presentation"},a,{onClick:function(f){return f.stopPropagation()},className:Z(u,t)}),l.createElement("div",{role:"presentation",className:"".concat(u,"-title"),title:typeof r=="string"?r:void 0},r),l.createElement("ul",{role:"group",className:"".concat(u,"-list")},o))}),zr=l.forwardRef(function(e,n){var t=e.eventKey,r=e.children,o=Yt(t),a=Tr(r,o),i=Dn();return i?a:l.createElement(gs,De({ref:n},xt(e,["warnKey"])),a)}),hs=["label","children","key","type","extra"];function fr(e,n,t){var r=n.item,o=n.group,a=n.submenu,i=n.divider;return(e||[]).map(function(s,u){if(s&&jt(s)==="object"){var d=s,f=d.label,m=d.children,v=d.key,x=d.type,w=d.extra,c=ot(d,hs),p=v??"tmp-".concat(u);return m||x==="group"?x==="group"?l.createElement(o,De({key:p},c,{title:f}),fr(m,n,t)):l.createElement(a,De({key:p},c,{title:f}),fr(m,n,t)):x==="divider"?l.createElement(i,De({key:p},c)):l.createElement(r,De({key:p},c,{extra:w}),f,(!!w||w===0)&&l.createElement("span",{className:"".concat(t,"-item-extra")},w))}return null}).filter(function(s){return s})}function no(e,n,t,r,o){var a=e,i=ze({divider:_r,item:Pn,group:zr,submenu:An},r);return n&&(a=fr(n,i,o)),Tr(a,t)}var vs=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem","_internalComponents"],zt=[],bs=l.forwardRef(function(e,n){var t,r=e,o=r.prefixCls,a=o===void 0?"rc-menu":o,i=r.rootClassName,s=r.style,u=r.className,d=r.tabIndex,f=d===void 0?0:d,m=r.items,v=r.children,x=r.direction,w=r.id,c=r.mode,p=c===void 0?"vertical":c,C=r.inlineCollapsed,b=r.disabled,I=r.disabledOverflow,S=r.subMenuOpenDelay,y=S===void 0?.1:S,F=r.subMenuCloseDelay,D=F===void 0?.1:F,O=r.forceSubMenuRender,N=r.defaultOpenKeys,E=r.openKeys,_=r.activeKey,T=r.defaultActiveFirst,k=r.selectable,M=k===void 0?!0:k,B=r.multiple,V=B===void 0?!1:B,j=r.defaultSelectedKeys,U=r.selectedKeys,K=r.onSelect,L=r.onDeselect,q=r.inlineIndent,ee=q===void 0?24:q,R=r.motion,W=r.defaultMotions,J=r.triggerSubMenuAction,oe=J===void 0?"hover":J,ae=r.builtinPlacements,Q=r.itemIcon,ie=r.expandIcon,Ce=r.overflowedIndicator,xe=Ce===void 0?"...":Ce,we=r.overflowedIndicatorPopupClassName,Te=r.getPopupContainer,Je=r.onClick,Le=r.onOpenChange,ve=r.onKeyDown;r.openAnimation,r.openTransitionName;var me=r._internalRenderMenuItem,ct=r._internalRenderSubMenuItem,mt=r._internalComponents,$t=ot(r,vs),It=l.useMemo(function(){return[no(v,m,zt,mt,a),no(v,m,zt,{},a)]},[v,m,mt]),At=Ke(It,2),et=At[0],qe=At[1],St=l.useState(!1),kt=Ke(St,2),Mt=kt[0],Et=kt[1],Ae=l.useRef(),ce=Ji(w),nt=x==="rtl",ut=Lt(N,{value:E,postState:function(Ee){return Ee||zt}}),ft=Ke(ut,2),Ue=ft[0],We=ft[1],G=function(Ee){var Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function it(){We(Ee),Le==null||Le(Ee)}Me?lr(it):it()},pe=l.useState(Ue),Fe=Ke(pe,2),se=Fe[0],be=Fe[1],_e=l.useRef(!1),at=l.useMemo(function(){return(p==="inline"||p==="vertical")&&C?["vertical",C]:[p,!1]},[p,C]),dt=Ke(at,2),tt=dt[0],Ft=dt[1],pn=tt==="inline",Rn=l.useState(tt),mn=Ke(Rn,2),bt=mn[0],Bn=mn[1],Tn=l.useState(Ft),fn=Ke(Tn,2),_n=fn[0],zn=fn[1];l.useEffect(function(){Bn(tt),zn(Ft),_e.current&&(pn?We(se):G(zt))},[tt,Ft]);var jn=l.useState(0),gn=Ke(jn,2),Nt=gn[0],Ln=gn[1],gt=Nt>=et.length-1||bt!=="horizontal"||I;l.useEffect(function(){pn&&be(Ue)},[Ue]),l.useEffect(function(){return _e.current=!0,function(){_e.current=!1}},[]);var Ot=Xi(),Qt=Ot.registerPath,Hn=Ot.unregisterPath,qn=Ot.refreshOverflowKeys,h=Ot.isSubPathKey,g=Ot.getKeyPath,P=Ot.getKeys,A=Ot.getSubPathKeys,H=l.useMemo(function(){return{registerPath:Qt,unregisterPath:Hn}},[Qt,Hn]),X=l.useMemo(function(){return{isSubPathKey:h}},[h]);l.useEffect(function(){qn(gt?zt:et.slice(Nt+1).map(function(ke){return ke.key}))},[Nt,gt]);var ge=Lt(_||T&&((t=et[0])===null||t===void 0?void 0:t.key),{value:_}),te=Ke(ge,2),he=te[0],Se=te[1],z=nn(function(ke){Se(ke)}),ye=nn(function(){Se(void 0)});Po(n,function(){return{list:Ae.current,focus:function(Ee){var Me,it=P(),st=pr(it,ce),hn=st.elements,Un=st.key2element,Ia=st.element2key,Lr=Mr(Ae.current,hn),Hr=he??(Lr[0]?Ia.get(Lr[0]):(Me=et.find(function(Sa){return!Sa.props.disabled}))===null||Me===void 0?void 0:Me.key),Zt=Un.get(Hr);if(Hr&&Zt){var Wn;Zt==null||(Wn=Zt.focus)===null||Wn===void 0||Wn.call(Zt,Ee)}}}});var fe=Lt(j||[],{value:U,postState:function(Ee){return Array.isArray(Ee)?Ee:Ee==null?zt:[Ee]}}),Ne=Ke(fe,2),le=Ne[0],He=Ne[1],ue=function(Ee){if(M){var Me=Ee.key,it=le.includes(Me),st;V?it?st=le.filter(function(Un){return Un!==Me}):st=[].concat(Ye(le),[Me]):st=[Me],He(st);var hn=ze(ze({},Ee),{},{selectedKeys:st});it?L==null||L(hn):K==null||K(hn)}!V&&Ue.length&&bt!=="inline"&&G(zt)},de=nn(function(ke){Je==null||Je(In(ke)),ue(ke)}),$e=nn(function(ke,Ee){var Me=Ue.filter(function(st){return st!==ke});if(Ee)Me.push(ke);else if(bt!=="inline"){var it=A(ke);Me=Me.filter(function(st){return!it.has(st)})}Bo(Ue,Me,!0)||G(Me,!0)}),Pe=function(Ee,Me){var it=Me??!Ue.includes(Ee);$e(Ee,it)},Oe=Wi(bt,he,nt,ce,Ae,P,g,Se,Pe,ve);l.useEffect(function(){Et(!0)},[]);var Dt=l.useMemo(function(){return{_internalRenderMenuItem:me,_internalRenderSubMenuItem:ct}},[me,ct]),yt=bt!=="horizontal"||I?et:et.map(function(ke,Ee){return l.createElement(ln,{key:ke.key,overflowDisabled:Ee>Nt},ke)}),_t=l.createElement(an,De({id:w,ref:Ae,prefixCls:"".concat(a,"-overflow"),component:"ul",itemComponent:Pn,className:Z(a,"".concat(a,"-root"),"".concat(a,"-").concat(bt),u,re(re({},"".concat(a,"-inline-collapsed"),_n),"".concat(a,"-rtl"),nt),i),dir:x,style:s,role:"menu",tabIndex:f,data:yt,renderRawItem:function(Ee){return Ee},renderRawRest:function(Ee){var Me=Ee.length,it=Me?et.slice(-Me):null;return l.createElement(An,{eventKey:mr,title:xe,disabled:gt,internalPopupClose:Me===0,popupClassName:we},it)},maxCount:bt!=="horizontal"||I?an.INVALIDATE:an.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(Ee){Ln(Ee)},onKeyDown:Oe},$t));return l.createElement(kr.Provider,{value:Dt},l.createElement(Yo.Provider,{value:ce},l.createElement(ln,{prefixCls:a,rootClassName:i,mode:bt,openKeys:Ue,rtl:nt,disabled:b,motion:Mt?R:null,defaultMotions:Mt?W:null,activeKey:he,onActive:z,onInactive:ye,selectedKeys:le,inlineIndent:ee,subMenuOpenDelay:y,subMenuCloseDelay:D,forceSubMenuRender:O,builtinPlacements:ae,triggerSubMenuAction:oe,getPopupContainer:Te,itemIcon:Q,expandIcon:ie,onItemClick:de,onOpenChange:$e},l.createElement(na.Provider,{value:X},_t),l.createElement("div",{style:{display:"none"},"aria-hidden":!0},l.createElement(ea.Provider,{value:H},qe)))))}),un=bs;un.Item=Pn;un.SubMenu=An;un.ItemGroup=zr;un.Divider=_r;const la=l.createContext({});var ys={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},Cs=function(n,t){return l.createElement(Jt,De({},n,{ref:t,icon:ys}))},ca=l.forwardRef(Cs);const Sn=Fa({prefixCls:"",firstLevel:!0,inlineCollapsed:!1});var xs=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t};const ua=e=>{const{prefixCls:n,className:t,dashed:r}=e,o=xs(e,["prefixCls","className","dashed"]),{getPrefixCls:a}=l.useContext(wt),i=a("menu",n),s=Z({[`${i}-item-divider-dashed`]:!!r},t);return l.createElement(_r,Object.assign({className:s},o))},da=e=>{var n;const{className:t,children:r,icon:o,title:a,danger:i,extra:s}=e,{prefixCls:u,firstLevel:d,direction:f,disableMenuItemTitleTooltip:m,inlineCollapsed:v}=l.useContext(Sn),x=I=>{const S=r==null?void 0:r[0],y=l.createElement("span",{className:Z(`${u}-title-content`,{[`${u}-title-content-with-extra`]:!!s||s===0})},r);return(!o||l.isValidElement(r)&&r.type==="span")&&r&&I&&d&&typeof S=="string"?l.createElement("div",{className:`${u}-inline-collapsed-noicon`},S.charAt(0)):y},{siderCollapsed:w}=l.useContext(la);let c=a;typeof a>"u"?c=d?r:"":a===!1&&(c="");const p={title:c};!w&&!v&&(p.title=null,p.open=!1);const C=Sr(r).length;let b=l.createElement(Pn,Object.assign({},xt(e,["title","icon","danger"]),{className:Z({[`${u}-item-danger`]:i,[`${u}-item-only-child`]:(o?C+1:C)===1},t),title:typeof a=="string"?a:void 0}),Gt(o,{className:Z(l.isValidElement(o)?(n=o.props)===null||n===void 0?void 0:n.className:void 0,`${u}-item-icon`)}),x(v));return m||(b=l.createElement(Fr,Object.assign({},p,{placement:f==="rtl"?"left":"right",classNames:{root:`${u}-inline-collapsed-tooltip`}}),b)),b};var ws=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t};const En=l.createContext(null),$s=l.forwardRef((e,n)=>{const{children:t}=e,r=ws(e,["children"]),o=l.useContext(En),a=l.useMemo(()=>Object.assign(Object.assign({},o),r),[o,r.prefixCls,r.mode,r.selectable,r.rootClassName]),i=Pa(t),s=To(n,i?yr(t):null);return l.createElement(En.Provider,{value:a},l.createElement(Aa,{space:!0},i?l.cloneElement(t,{ref:s}):t))}),Is=e=>{const{componentCls:n,motionDurationSlow:t,horizontalLineHeight:r,colorSplit:o,lineWidth:a,lineType:i,itemPaddingInline:s}=e;return{[`${n}-horizontal`]:{lineHeight:r,border:0,borderBottom:`${ne(a)} ${i} ${o}`,boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},[`${n}-item, ${n}-submenu`]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:s},[`> ${n}-item:hover,
|
|
47
47
|
> ${n}-item-active,
|
|
48
48
|
> ${n}-submenu ${n}-submenu-title:hover`]:{backgroundColor:"transparent"},[`${n}-item, ${n}-submenu-title`]:{transition:[`border-color ${t}`,`background ${t}`].join(",")},[`${n}-submenu-arrow`]:{display:"none"}}}},Ss=({componentCls:e,menuArrowOffset:n,calc:t})=>({[`${e}-rtl`]:{direction:"rtl"},[`${e}-submenu-rtl`]:{transformOrigin:"100% 0"},[`${e}-rtl${e}-vertical,
|
|
49
|
-
${e}-submenu-rtl ${e}-vertical`]:{[`${e}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateY(${ne(t(n).mul(-1).equal())})`},"&::after":{transform:`rotate(45deg) translateY(${ne(n)})`}}}}),ro=e=>ka(e),oo=(e,n)=>{const{componentCls:t,itemColor:r,itemSelectedColor:o,subMenuItemSelectedColor:a,groupTitleColor:i,itemBg:s,subMenuItemBg:u,itemSelectedBg:d,activeBarHeight:f,activeBarWidth:m,activeBarBorderWidth:
|
|
49
|
+
${e}-submenu-rtl ${e}-vertical`]:{[`${e}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateY(${ne(t(n).mul(-1).equal())})`},"&::after":{transform:`rotate(45deg) translateY(${ne(n)})`}}}}),ro=e=>ka(e),oo=(e,n)=>{const{componentCls:t,itemColor:r,itemSelectedColor:o,subMenuItemSelectedColor:a,groupTitleColor:i,itemBg:s,subMenuItemBg:u,itemSelectedBg:d,activeBarHeight:f,activeBarWidth:m,activeBarBorderWidth:v,motionDurationSlow:x,motionEaseInOut:w,motionEaseOut:c,itemPaddingInline:p,motionDurationMid:C,itemHoverColor:b,lineType:I,colorSplit:S,itemDisabledColor:y,dangerItemColor:F,dangerItemHoverColor:D,dangerItemSelectedColor:O,dangerItemActiveBg:N,dangerItemSelectedBg:E,popupBg:_,itemHoverBg:T,itemActiveBg:k,menuSubMenuBg:M,horizontalItemSelectedColor:B,horizontalItemSelectedBg:V,horizontalItemBorderRadius:j,horizontalItemHoverBg:U}=e;return{[`${t}-${n}, ${t}-${n} > ${t}`]:{color:r,background:s,[`&${t}-root:focus-visible`]:Object.assign({},ro(e)),[`${t}-item`]:{"&-group-title, &-extra":{color:i}},[`${t}-submenu-selected > ${t}-submenu-title`]:{color:a},[`${t}-item, ${t}-submenu-title`]:{color:r,[`&:not(${t}-item-disabled):focus-visible`]:Object.assign({},ro(e))},[`${t}-item-disabled, ${t}-submenu-disabled`]:{color:`${y} !important`},[`${t}-item:not(${t}-item-selected):not(${t}-submenu-selected)`]:{[`&:hover, > ${t}-submenu-title:hover`]:{color:b}},[`&:not(${t}-horizontal)`]:{[`${t}-item:not(${t}-item-selected)`]:{"&:hover":{backgroundColor:T},"&:active":{backgroundColor:k}},[`${t}-submenu-title`]:{"&:hover":{backgroundColor:T},"&:active":{backgroundColor:k}}},[`${t}-item-danger`]:{color:F,[`&${t}-item:hover`]:{[`&:not(${t}-item-selected):not(${t}-submenu-selected)`]:{color:D}},[`&${t}-item:active`]:{background:N}},[`${t}-item a`]:{"&, &:hover":{color:"inherit"}},[`${t}-item-selected`]:{color:o,[`&${t}-item-danger`]:{color:O},"a, a:hover":{color:"inherit"}},[`& ${t}-item-selected`]:{backgroundColor:d,[`&${t}-item-danger`]:{backgroundColor:E}},[`&${t}-submenu > ${t}`]:{backgroundColor:M},[`&${t}-popup > ${t}`]:{backgroundColor:_},[`&${t}-submenu-popup > ${t}`]:{backgroundColor:_},[`&${t}-horizontal`]:Object.assign(Object.assign({},n==="dark"?{borderBottom:0}:{}),{[`> ${t}-item, > ${t}-submenu`]:{top:v,marginTop:e.calc(v).mul(-1).equal(),marginBottom:0,borderRadius:j,"&::after":{position:"absolute",insetInline:p,bottom:0,borderBottom:`${ne(f)} solid transparent`,transition:`border-color ${x} ${w}`,content:'""'},"&:hover, &-active, &-open":{background:U,"&::after":{borderBottomWidth:f,borderBottomColor:B}},"&-selected":{color:B,backgroundColor:V,"&:hover":{backgroundColor:V},"&::after":{borderBottomWidth:f,borderBottomColor:B}}}}),[`&${t}-root`]:{[`&${t}-inline, &${t}-vertical`]:{borderInlineEnd:`${ne(v)} ${I} ${S}`}},[`&${t}-inline`]:{[`${t}-sub${t}-inline`]:{background:u},[`${t}-item`]:{position:"relative","&::after":{position:"absolute",insetBlock:0,insetInlineEnd:0,borderInlineEnd:`${ne(m)} solid ${o}`,transform:"scaleY(0.0001)",opacity:0,transition:[`transform ${C} ${c}`,`opacity ${C} ${c}`].join(","),content:'""'},[`&${t}-item-danger`]:{"&::after":{borderInlineEndColor:O}}},[`${t}-selected, ${t}-item-selected`]:{"&::after":{transform:"scaleY(1)",opacity:1,transition:[`transform ${C} ${w}`,`opacity ${C} ${w}`].join(",")}}}}}},ao=e=>{const{componentCls:n,itemHeight:t,itemMarginInline:r,padding:o,menuArrowSize:a,marginXS:i,itemMarginBlock:s,itemWidth:u,itemPaddingInline:d}=e,f=e.calc(a).add(o).add(i).equal();return{[`${n}-item`]:{position:"relative",overflow:"hidden"},[`${n}-item, ${n}-submenu-title`]:{height:t,lineHeight:ne(t),paddingInline:d,overflow:"hidden",textOverflow:"ellipsis",marginInline:r,marginBlock:s,width:u},[`> ${n}-item,
|
|
50
50
|
> ${n}-submenu > ${n}-submenu-title`]:{height:t,lineHeight:ne(t)},[`${n}-item-group-list ${n}-submenu-title,
|
|
51
|
-
${n}-submenu-title`]:{paddingInlineEnd:f}}},Es=e=>{const{componentCls:n,iconCls:t,itemHeight:r,colorTextLightSolid:o,dropdownWidth:a,controlHeightLG:i,motionEaseOut:s,paddingXL:u,itemMarginInline:d,fontSizeLG:f,motionDurationFast:m,motionDurationSlow:
|
|
51
|
+
${n}-submenu-title`]:{paddingInlineEnd:f}}},Es=e=>{const{componentCls:n,iconCls:t,itemHeight:r,colorTextLightSolid:o,dropdownWidth:a,controlHeightLG:i,motionEaseOut:s,paddingXL:u,itemMarginInline:d,fontSizeLG:f,motionDurationFast:m,motionDurationSlow:v,paddingXS:x,boxShadowSecondary:w,collapsedWidth:c,collapsedIconSize:p}=e,C={height:r,lineHeight:ne(r),listStylePosition:"inside",listStyleType:"disc"};return[{[n]:{"&-inline, &-vertical":Object.assign({[`&${n}-root`]:{boxShadow:"none"}},ao(e))},[`${n}-submenu-popup`]:{[`${n}-vertical`]:Object.assign(Object.assign({},ao(e)),{boxShadow:w})}},{[`${n}-submenu-popup ${n}-vertical${n}-sub`]:{minWidth:a,maxHeight:`calc(100vh - ${ne(e.calc(i).mul(2.5).equal())})`,padding:"0",overflow:"hidden",borderInlineEnd:0,"&:not([class*='-active'])":{overflowX:"hidden",overflowY:"auto"}}},{[`${n}-inline`]:{width:"100%",[`&${n}-root`]:{[`${n}-item, ${n}-submenu-title`]:{display:"flex",alignItems:"center",transition:[`border-color ${v}`,`background ${v}`,`padding ${m} ${s}`].join(","),[`> ${n}-title-content`]:{flex:"auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},"> *":{flex:"none"}}},[`${n}-sub${n}-inline`]:{padding:0,border:0,borderRadius:0,boxShadow:"none",[`& > ${n}-submenu > ${n}-submenu-title`]:C,[`& ${n}-item-group-title`]:{paddingInlineStart:u}},[`${n}-item`]:C}},{[`${n}-inline-collapsed`]:{width:c,[`&${n}-root`]:{[`${n}-item, ${n}-submenu ${n}-submenu-title`]:{[`> ${n}-inline-collapsed-noicon`]:{fontSize:f,textAlign:"center"}}},[`> ${n}-item,
|
|
52
52
|
> ${n}-item-group > ${n}-item-group-list > ${n}-item,
|
|
53
53
|
> ${n}-item-group > ${n}-item-group-list > ${n}-submenu > ${n}-submenu-title,
|
|
54
54
|
> ${n}-submenu > ${n}-submenu-title`]:{insetInlineStart:0,paddingInline:`calc(50% - ${ne(e.calc(p).div(2).equal())} - ${ne(d)})`,textOverflow:"clip",[`
|
|
55
55
|
${n}-submenu-arrow,
|
|
56
56
|
${n}-submenu-expand-icon
|
|
57
|
-
`]:{opacity:0},[`${n}-item-icon, ${t}`]:{margin:0,fontSize:p,lineHeight:ne(r),"+ span":{display:"inline-block",opacity:0}}},[`${n}-item-icon, ${t}`]:{display:"inline-block"},"&-tooltip":{pointerEvents:"none",[`${n}-item-icon, ${t}`]:{display:"none"},"a, a:hover":{color:o}},[`${n}-item-group-title`]:Object.assign(Object.assign({},Nr),{paddingInline:x})}}]},io=e=>{const{componentCls:n,motionDurationSlow:t,motionDurationMid:r,motionEaseInOut:o,motionEaseOut:a,iconCls:i,iconSize:s,iconMarginInlineEnd:u}=e;return{[`${n}-item, ${n}-submenu-title`]:{position:"relative",display:"block",margin:0,whiteSpace:"nowrap",cursor:"pointer",transition:[`border-color ${t}`,`background ${t}`,`padding calc(${t} + 0.1s) ${o}`].join(","),[`${n}-item-icon, ${i}`]:{minWidth:s,fontSize:s,transition:[`font-size ${r} ${a}`,`margin ${t} ${o}`,`color ${t}`].join(","),"+ span":{marginInlineStart:u,opacity:1,transition:[`opacity ${t} ${o}`,`margin ${t}`,`color ${t}`].join(",")}},[`${n}-item-icon`]:Object.assign({},Ma()),[`&${n}-item-only-child`]:{[`> ${i}, > ${n}-item-icon`]:{marginInlineEnd:0}}},[`${n}-item-disabled, ${n}-submenu-disabled`]:{background:"none !important",cursor:"not-allowed","&::after":{borderColor:"transparent !important"},a:{color:"inherit !important",cursor:"not-allowed",pointerEvents:"none"},[`> ${n}-submenu-title`]:{color:"inherit !important",cursor:"not-allowed"}}}},so=e=>{const{componentCls:n,motionDurationSlow:t,motionEaseInOut:r,borderRadius:o,menuArrowSize:a,menuArrowOffset:i}=e;return{[`${n}-submenu`]:{"&-expand-icon, &-arrow":{position:"absolute",top:"50%",insetInlineEnd:e.margin,width:a,color:"currentcolor",transform:"translateY(-50%)",transition:`transform ${t} ${r}, opacity ${t}`},"&-arrow":{"&::before, &::after":{position:"absolute",width:e.calc(a).mul(.6).equal(),height:e.calc(a).mul(.15).equal(),backgroundColor:"currentcolor",borderRadius:o,transition:[`background ${t} ${r}`,`transform ${t} ${r}`,`top ${t} ${r}`,`color ${t} ${r}`].join(","),content:'""'},"&::before":{transform:`rotate(45deg) translateY(${ne(e.calc(i).mul(-1).equal())})`},"&::after":{transform:`rotate(-45deg) translateY(${ne(i)})`}}}}},Fs=e=>{const{antCls:n,componentCls:t,fontSize:r,motionDurationSlow:o,motionDurationMid:a,motionEaseInOut:i,paddingXS:s,padding:u,colorSplit:d,lineWidth:f,zIndexPopup:m,borderRadiusLG:
|
|
58
|
-
&-inline ${t}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateX(${ne(c)})`},"&::after":{transform:`rotate(45deg) translateX(${ne(e.calc(c).mul(-1).equal())})`}},[`${t}-submenu-open${t}-submenu-inline > ${t}-submenu-title > ${t}-submenu-arrow`]:{transform:`translateY(${ne(e.calc(w).mul(.2).mul(-1).equal())})`,"&::after":{transform:`rotate(-45deg) translateX(${ne(e.calc(c).mul(-1).equal())})`},"&::before":{transform:`rotate(45deg) translateX(${ne(c)})`}}})},{[`${n}-layout-header`]:{[t]:{lineHeight:"inherit"}}}]},Ns=e=>{var n,t,r;const{colorPrimary:o,colorError:a,colorTextDisabled:i,colorErrorBg:s,colorText:u,colorTextDescription:d,colorBgContainer:f,colorFillAlter:m,colorFillContent:h,lineWidth:x,lineWidthBold:w,controlItemBgActive:c,colorBgTextHover:p,controlHeightLG:C,lineHeight:b,colorBgElevated:I,marginXXS:S,padding:y,fontSize:F,controlHeightSM:D,fontSizeLG:O,colorTextLightSolid:N,colorErrorHover:E}=e,_=(n=e.activeBarWidth)!==null&&n!==void 0?n:0,T=(t=e.activeBarBorderWidth)!==null&&t!==void 0?t:x,k=(r=e.itemMarginInline)!==null&&r!==void 0?r:e.marginXXS,M=new or(N).setA(.65).toRgbString();return{dropdownWidth:160,zIndexPopup:e.zIndexPopupBase+50,radiusItem:e.borderRadiusLG,itemBorderRadius:e.borderRadiusLG,radiusSubMenuItem:e.borderRadiusSM,subMenuItemBorderRadius:e.borderRadiusSM,colorItemText:u,itemColor:u,colorItemTextHover:u,itemHoverColor:u,colorItemTextHoverHorizontal:o,horizontalItemHoverColor:o,colorGroupTitle:d,groupTitleColor:d,colorItemTextSelected:o,itemSelectedColor:o,subMenuItemSelectedColor:o,colorItemTextSelectedHorizontal:o,horizontalItemSelectedColor:o,colorItemBg:f,itemBg:f,colorItemBgHover:p,itemHoverBg:p,colorItemBgActive:h,itemActiveBg:c,colorSubItemBg:m,subMenuItemBg:m,colorItemBgSelected:c,itemSelectedBg:c,colorItemBgSelectedHorizontal:"transparent",horizontalItemSelectedBg:"transparent",colorActiveBarWidth:0,activeBarWidth:_,colorActiveBarHeight:w,activeBarHeight:w,colorActiveBarBorderSize:x,activeBarBorderWidth:T,colorItemTextDisabled:i,itemDisabledColor:i,colorDangerItemText:a,dangerItemColor:a,colorDangerItemTextHover:a,dangerItemHoverColor:a,colorDangerItemTextSelected:a,dangerItemSelectedColor:a,colorDangerItemBgActive:s,dangerItemActiveBg:s,colorDangerItemBgSelected:s,dangerItemSelectedBg:s,itemMarginInline:k,horizontalItemBorderRadius:0,horizontalItemHoverBg:"transparent",itemHeight:C,groupTitleLineHeight:b,collapsedWidth:C*2,popupBg:I,itemMarginBlock:S,itemPaddingInline:y,horizontalLineHeight:`${C*1.15}px`,iconSize:F,iconMarginInlineEnd:D-F,collapsedIconSize:O,groupTitleFontSize:F,darkItemDisabledColor:new or(N).setA(.25).toRgbString(),darkItemColor:M,darkDangerItemColor:a,darkItemBg:"#001529",darkPopupBg:"#001529",darkSubMenuItemBg:"#000c17",darkItemSelectedColor:N,darkItemSelectedBg:o,darkDangerItemSelectedBg:a,darkItemHoverBg:"transparent",darkGroupTitleColor:M,darkItemHoverColor:N,darkDangerItemHoverColor:E,darkDangerItemSelectedColor:N,darkDangerItemActiveBg:a,itemWidth:_?`calc(100% + ${T}px)`:`calc(100% - ${k*2}px)`}},Os=(e,n=e,t=!0)=>cn("Menu",o=>{const{colorBgElevated:a,controlHeightLG:i,fontSize:s,darkItemColor:u,darkDangerItemColor:d,darkItemBg:f,darkSubMenuItemBg:m,darkItemSelectedColor:h,darkItemSelectedBg:x,darkDangerItemSelectedBg:w,darkItemHoverBg:c,darkGroupTitleColor:p,darkItemHoverColor:C,darkItemDisabledColor:b,darkDangerItemHoverColor:I,darkDangerItemSelectedColor:S,darkDangerItemActiveBg:y,popupBg:F,darkPopupBg:D}=o,O=o.calc(s).div(7).mul(5).equal(),N=sn(o,{menuArrowSize:O,menuHorizontalHeight:o.calc(i).mul(1.15).equal(),menuArrowOffset:o.calc(O).mul(.25).equal(),menuSubMenuBg:a,calc:o.calc,popupBg:F}),E=sn(N,{itemColor:u,itemHoverColor:C,groupTitleColor:p,itemSelectedColor:h,subMenuItemSelectedColor:h,itemBg:f,popupBg:D,subMenuItemBg:m,itemActiveBg:"transparent",itemSelectedBg:x,activeBarHeight:0,activeBarBorderWidth:0,itemHoverBg:c,itemDisabledColor:b,dangerItemColor:d,dangerItemHoverColor:I,dangerItemSelectedColor:S,dangerItemActiveBg:y,dangerItemSelectedBg:w,menuSubMenuBg:m,horizontalItemSelectedColor:h,horizontalItemSelectedBg:x});return[Fs(N),Is(N),Es(N),oo(N,"light"),oo(E,"dark"),Ss(N),_o(N),wn(N,"slide-up"),wn(N,"slide-down"),zo(N,"zoom-big")]},Ns,{deprecatedTokens:[["colorGroupTitle","groupTitleColor"],["radiusItem","itemBorderRadius"],["radiusSubMenuItem","subMenuItemBorderRadius"],["colorItemText","itemColor"],["colorItemTextHover","itemHoverColor"],["colorItemTextHoverHorizontal","horizontalItemHoverColor"],["colorItemTextSelected","itemSelectedColor"],["colorItemTextSelectedHorizontal","horizontalItemSelectedColor"],["colorItemTextDisabled","itemDisabledColor"],["colorDangerItemText","dangerItemColor"],["colorDangerItemTextHover","dangerItemHoverColor"],["colorDangerItemTextSelected","dangerItemSelectedColor"],["colorDangerItemBgActive","dangerItemActiveBg"],["colorDangerItemBgSelected","dangerItemSelectedBg"],["colorItemBg","itemBg"],["colorItemBgHover","itemHoverBg"],["colorSubItemBg","subMenuItemBg"],["colorItemBgActive","itemActiveBg"],["colorItemBgSelectedHorizontal","horizontalItemSelectedBg"],["colorActiveBarWidth","activeBarWidth"],["colorActiveBarHeight","activeBarHeight"],["colorActiveBarBorderSize","activeBarBorderWidth"],["colorItemBgSelected","itemSelectedBg"]],injectStyle:t,unitless:{groupTitleLineHeight:!0}})(e,n),pa=e=>{var n;const{popupClassName:t,icon:r,title:o,theme:a}=e,i=l.useContext(Sn),{prefixCls:s,inlineCollapsed:u,theme:d}=i,f=Yt();let m;if(!r)m=u&&!f.length&&o&&typeof o=="string"?l.createElement("div",{className:`${s}-inline-collapsed-noicon`},o.charAt(0)):l.createElement("span",{className:`${s}-title-content`},o);else{const w=l.isValidElement(o)&&o.type==="span";m=l.createElement(l.Fragment,null,Gt(r,{className:Z(l.isValidElement(r)?(n=r.props)===null||n===void 0?void 0:n.className:void 0,`${s}-item-icon`)}),w?o:l.createElement("span",{className:`${s}-title-content`},o))}const h=l.useMemo(()=>Object.assign(Object.assign({},i),{firstLevel:!1}),[i]),[x]=jo("Menu");return l.createElement(Sn.Provider,{value:h},l.createElement(An,Object.assign({},xt(e,["icon"]),{title:m,popupClassName:Z(s,t,`${s}-${a||d}`),popupStyle:Object.assign({zIndex:x},e.popupStyle)})))};var Ds=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t};function Xn(e){return e===null||e===!1}const Ps={item:da,submenu:pa,divider:ua},As=br((e,n)=>{var t;const r=l.useContext(En),o=r||{},{getPrefixCls:a,getPopupContainer:i,direction:s,menu:u}=l.useContext(wt),d=a(),{prefixCls:f,className:m,style:h,theme:x="light",expandIcon:w,_internalDisableMenuItemTitleTooltip:c,inlineCollapsed:p,siderCollapsed:C,rootClassName:b,mode:I,selectable:S,onClick:y,overflowedIndicatorPopupClassName:F}=e,D=Ds(e,["prefixCls","className","style","theme","expandIcon","_internalDisableMenuItemTitleTooltip","inlineCollapsed","siderCollapsed","rootClassName","mode","selectable","onClick","overflowedIndicatorPopupClassName"]),O=xt(D,["collapsedWidth"]);(t=o.validator)===null||t===void 0||t.call(o,{mode:I});const N=ar((...ee)=>{var R;y==null||y.apply(void 0,ee),(R=o.onClick)===null||R===void 0||R.call(o)}),E=o.mode||I,_=S??o.selectable,T=p??C,k={horizontal:{motionName:`${d}-slide-up`},inline:Ho(d),other:{motionName:`${d}-zoom-big`}},M=a("menu",f||o.prefixCls),B=Lo(M),[V,j,U]=Os(M,B,!r),K=Z(`${M}-${x}`,u==null?void 0:u.className,m),L=l.useMemo(()=>{var ee,R;if(typeof w=="function"||Xn(w))return w||null;if(typeof o.expandIcon=="function"||Xn(o.expandIcon))return o.expandIcon||null;if(typeof(u==null?void 0:u.expandIcon)=="function"||Xn(u==null?void 0:u.expandIcon))return(u==null?void 0:u.expandIcon)||null;const W=(ee=w??(o==null?void 0:o.expandIcon))!==null&&ee!==void 0?ee:u==null?void 0:u.expandIcon;return Gt(W,{className:Z(`${M}-submenu-expand-icon`,l.isValidElement(W)?(R=W.props)===null||R===void 0?void 0:R.className:void 0)})},[w,o==null?void 0:o.expandIcon,u==null?void 0:u.expandIcon,M]),q=l.useMemo(()=>({prefixCls:M,inlineCollapsed:T||!1,direction:s,firstLevel:!0,theme:x,mode:E,disableMenuItemTitleTooltip:c}),[M,T,s,c,x]);return V(l.createElement(En.Provider,{value:null},l.createElement(Sn.Provider,{value:q},l.createElement(un,Object.assign({getPopupContainer:i,overflowedIndicator:l.createElement(ca,null),overflowedIndicatorPopupClassName:Z(M,`${M}-${x}`,F),mode:E,selectable:_,onClick:N},O,{inlineCollapsed:T,style:Object.assign(Object.assign({},u==null?void 0:u.style),h),className:K,prefixCls:M,direction:s,defaultMotions:k,expandIcon:L,ref:n,rootClassName:Z(b,j,o.rootClassName,U,B),_internalComponents:Ps})))))}),dn=br((e,n)=>{const t=Xe(null),r=l.useContext(la);return Po(n,()=>({menu:t.current,focus:o=>{var a;(a=t.current)===null||a===void 0||a.focus(o)}})),l.createElement(As,Object.assign({ref:t},e,r))});dn.Item=da;dn.SubMenu=pa;dn.Divider=ua;dn.ItemGroup=zr;const ks=e=>{const{componentCls:n,menuCls:t,colorError:r,colorTextLightSolid:o}=e,a=`${t}-item`;return{[`${n}, ${n}-menu-submenu`]:{[`${t} ${a}`]:{[`&${a}-danger:not(${a}-disabled)`]:{color:r,"&:hover":{color:o,backgroundColor:r}}}}}},Ms=e=>{const{componentCls:n,menuCls:t,zIndexPopup:r,dropdownArrowDistance:o,sizePopupArrow:a,antCls:i,iconCls:s,motionDurationMid:u,paddingBlock:d,fontSize:f,dropdownEdgeChildPadding:m,colorTextDisabled:h,fontSizeIcon:x,controlPaddingHorizontal:w,colorBgElevated:c}=e;return[{[n]:{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:r,display:"block","&::before":{position:"absolute",insetBlock:e.calc(a).div(2).sub(o).equal(),zIndex:-9999,opacity:1e-4,content:'""'},"&-menu-vertical":{maxHeight:"100vh",overflowY:"auto"},[`&-trigger${i}-btn`]:{[`& > ${s}-down, & > ${i}-btn-icon > ${s}-down`]:{fontSize:x}},[`${n}-wrap`]:{position:"relative",[`${i}-btn > ${s}-down`]:{fontSize:x},[`${s}-down::before`]:{transition:`transform ${u}`}},[`${n}-wrap-open`]:{[`${s}-down::before`]:{transform:"rotate(180deg)"}},"\n &-hidden,\n &-menu-hidden,\n &-menu-submenu-hidden\n ":{display:"none"},[`&${i}-slide-down-enter${i}-slide-down-enter-active${n}-placement-bottomLeft,
|
|
57
|
+
`]:{opacity:0},[`${n}-item-icon, ${t}`]:{margin:0,fontSize:p,lineHeight:ne(r),"+ span":{display:"inline-block",opacity:0}}},[`${n}-item-icon, ${t}`]:{display:"inline-block"},"&-tooltip":{pointerEvents:"none",[`${n}-item-icon, ${t}`]:{display:"none"},"a, a:hover":{color:o}},[`${n}-item-group-title`]:Object.assign(Object.assign({},Nr),{paddingInline:x})}}]},io=e=>{const{componentCls:n,motionDurationSlow:t,motionDurationMid:r,motionEaseInOut:o,motionEaseOut:a,iconCls:i,iconSize:s,iconMarginInlineEnd:u}=e;return{[`${n}-item, ${n}-submenu-title`]:{position:"relative",display:"block",margin:0,whiteSpace:"nowrap",cursor:"pointer",transition:[`border-color ${t}`,`background ${t}`,`padding calc(${t} + 0.1s) ${o}`].join(","),[`${n}-item-icon, ${i}`]:{minWidth:s,fontSize:s,transition:[`font-size ${r} ${a}`,`margin ${t} ${o}`,`color ${t}`].join(","),"+ span":{marginInlineStart:u,opacity:1,transition:[`opacity ${t} ${o}`,`margin ${t}`,`color ${t}`].join(",")}},[`${n}-item-icon`]:Object.assign({},Ma()),[`&${n}-item-only-child`]:{[`> ${i}, > ${n}-item-icon`]:{marginInlineEnd:0}}},[`${n}-item-disabled, ${n}-submenu-disabled`]:{background:"none !important",cursor:"not-allowed","&::after":{borderColor:"transparent !important"},a:{color:"inherit !important",cursor:"not-allowed",pointerEvents:"none"},[`> ${n}-submenu-title`]:{color:"inherit !important",cursor:"not-allowed"}}}},so=e=>{const{componentCls:n,motionDurationSlow:t,motionEaseInOut:r,borderRadius:o,menuArrowSize:a,menuArrowOffset:i}=e;return{[`${n}-submenu`]:{"&-expand-icon, &-arrow":{position:"absolute",top:"50%",insetInlineEnd:e.margin,width:a,color:"currentcolor",transform:"translateY(-50%)",transition:`transform ${t} ${r}, opacity ${t}`},"&-arrow":{"&::before, &::after":{position:"absolute",width:e.calc(a).mul(.6).equal(),height:e.calc(a).mul(.15).equal(),backgroundColor:"currentcolor",borderRadius:o,transition:[`background ${t} ${r}`,`transform ${t} ${r}`,`top ${t} ${r}`,`color ${t} ${r}`].join(","),content:'""'},"&::before":{transform:`rotate(45deg) translateY(${ne(e.calc(i).mul(-1).equal())})`},"&::after":{transform:`rotate(-45deg) translateY(${ne(i)})`}}}}},Fs=e=>{const{antCls:n,componentCls:t,fontSize:r,motionDurationSlow:o,motionDurationMid:a,motionEaseInOut:i,paddingXS:s,padding:u,colorSplit:d,lineWidth:f,zIndexPopup:m,borderRadiusLG:v,subMenuItemBorderRadius:x,menuArrowSize:w,menuArrowOffset:c,lineType:p,groupTitleLineHeight:C,groupTitleFontSize:b}=e;return[{"":{[t]:Object.assign(Object.assign({},$n()),{"&-hidden":{display:"none"}})},[`${t}-submenu-hidden`]:{display:"none"}},{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},On(e)),$n()),{marginBottom:0,paddingInlineStart:0,fontSize:r,lineHeight:0,listStyle:"none",outline:"none",transition:`width ${o} cubic-bezier(0.2, 0, 0, 1) 0s`,"ul, ol":{margin:0,padding:0,listStyle:"none"},"&-overflow":{display:"flex",[`${t}-item`]:{flex:"none"}},[`${t}-item, ${t}-submenu, ${t}-submenu-title`]:{borderRadius:e.itemBorderRadius},[`${t}-item-group-title`]:{padding:`${ne(s)} ${ne(u)}`,fontSize:b,lineHeight:C,transition:`all ${o}`},[`&-horizontal ${t}-submenu`]:{transition:[`border-color ${o} ${i}`,`background ${o} ${i}`].join(",")},[`${t}-submenu, ${t}-submenu-inline`]:{transition:[`border-color ${o} ${i}`,`background ${o} ${i}`,`padding ${a} ${i}`].join(",")},[`${t}-submenu ${t}-sub`]:{cursor:"initial",transition:[`background ${o} ${i}`,`padding ${o} ${i}`].join(",")},[`${t}-title-content`]:{transition:`color ${o}`,"&-with-extra":{display:"inline-flex",alignItems:"center",width:"100%"},[`> ${n}-typography-ellipsis-single-line`]:{display:"inline",verticalAlign:"unset"},[`${t}-item-extra`]:{marginInlineStart:"auto",paddingInlineStart:e.padding}},[`${t}-item a`]:{"&::before":{position:"absolute",inset:0,backgroundColor:"transparent",content:'""'}},[`${t}-item-divider`]:{overflow:"hidden",lineHeight:0,borderColor:d,borderStyle:p,borderWidth:0,borderTopWidth:f,marginBlock:f,padding:0,"&-dashed":{borderStyle:"dashed"}}}),io(e)),{[`${t}-item-group`]:{[`${t}-item-group-list`]:{margin:0,padding:0,[`${t}-item, ${t}-submenu-title`]:{paddingInline:`${ne(e.calc(r).mul(2).equal())} ${ne(u)}`}}},"&-submenu":{"&-popup":{position:"absolute",zIndex:m,borderRadius:v,boxShadow:"none",transformOrigin:"0 0",[`&${t}-submenu`]:{background:"transparent"},"&::before":{position:"absolute",inset:0,zIndex:-1,width:"100%",height:"100%",opacity:0,content:'""'},[`> ${t}`]:Object.assign(Object.assign(Object.assign({borderRadius:v},io(e)),so(e)),{[`${t}-item, ${t}-submenu > ${t}-submenu-title`]:{borderRadius:x},[`${t}-submenu-title::after`]:{transition:`transform ${o} ${i}`}})},"\n &-placement-leftTop,\n &-placement-bottomRight,\n ":{transformOrigin:"100% 0"},"\n &-placement-leftBottom,\n &-placement-topRight,\n ":{transformOrigin:"100% 100%"},"\n &-placement-rightBottom,\n &-placement-topLeft,\n ":{transformOrigin:"0 100%"},"\n &-placement-bottomLeft,\n &-placement-rightTop,\n ":{transformOrigin:"0 0"},"\n &-placement-leftTop,\n &-placement-leftBottom\n ":{paddingInlineEnd:e.paddingXS},"\n &-placement-rightTop,\n &-placement-rightBottom\n ":{paddingInlineStart:e.paddingXS},"\n &-placement-topRight,\n &-placement-topLeft\n ":{paddingBottom:e.paddingXS},"\n &-placement-bottomRight,\n &-placement-bottomLeft\n ":{paddingTop:e.paddingXS}}}),so(e)),{[`&-inline-collapsed ${t}-submenu-arrow,
|
|
58
|
+
&-inline ${t}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateX(${ne(c)})`},"&::after":{transform:`rotate(45deg) translateX(${ne(e.calc(c).mul(-1).equal())})`}},[`${t}-submenu-open${t}-submenu-inline > ${t}-submenu-title > ${t}-submenu-arrow`]:{transform:`translateY(${ne(e.calc(w).mul(.2).mul(-1).equal())})`,"&::after":{transform:`rotate(-45deg) translateX(${ne(e.calc(c).mul(-1).equal())})`},"&::before":{transform:`rotate(45deg) translateX(${ne(c)})`}}})},{[`${n}-layout-header`]:{[t]:{lineHeight:"inherit"}}}]},Ns=e=>{var n,t,r;const{colorPrimary:o,colorError:a,colorTextDisabled:i,colorErrorBg:s,colorText:u,colorTextDescription:d,colorBgContainer:f,colorFillAlter:m,colorFillContent:v,lineWidth:x,lineWidthBold:w,controlItemBgActive:c,colorBgTextHover:p,controlHeightLG:C,lineHeight:b,colorBgElevated:I,marginXXS:S,padding:y,fontSize:F,controlHeightSM:D,fontSizeLG:O,colorTextLightSolid:N,colorErrorHover:E}=e,_=(n=e.activeBarWidth)!==null&&n!==void 0?n:0,T=(t=e.activeBarBorderWidth)!==null&&t!==void 0?t:x,k=(r=e.itemMarginInline)!==null&&r!==void 0?r:e.marginXXS,M=new or(N).setA(.65).toRgbString();return{dropdownWidth:160,zIndexPopup:e.zIndexPopupBase+50,radiusItem:e.borderRadiusLG,itemBorderRadius:e.borderRadiusLG,radiusSubMenuItem:e.borderRadiusSM,subMenuItemBorderRadius:e.borderRadiusSM,colorItemText:u,itemColor:u,colorItemTextHover:u,itemHoverColor:u,colorItemTextHoverHorizontal:o,horizontalItemHoverColor:o,colorGroupTitle:d,groupTitleColor:d,colorItemTextSelected:o,itemSelectedColor:o,subMenuItemSelectedColor:o,colorItemTextSelectedHorizontal:o,horizontalItemSelectedColor:o,colorItemBg:f,itemBg:f,colorItemBgHover:p,itemHoverBg:p,colorItemBgActive:v,itemActiveBg:c,colorSubItemBg:m,subMenuItemBg:m,colorItemBgSelected:c,itemSelectedBg:c,colorItemBgSelectedHorizontal:"transparent",horizontalItemSelectedBg:"transparent",colorActiveBarWidth:0,activeBarWidth:_,colorActiveBarHeight:w,activeBarHeight:w,colorActiveBarBorderSize:x,activeBarBorderWidth:T,colorItemTextDisabled:i,itemDisabledColor:i,colorDangerItemText:a,dangerItemColor:a,colorDangerItemTextHover:a,dangerItemHoverColor:a,colorDangerItemTextSelected:a,dangerItemSelectedColor:a,colorDangerItemBgActive:s,dangerItemActiveBg:s,colorDangerItemBgSelected:s,dangerItemSelectedBg:s,itemMarginInline:k,horizontalItemBorderRadius:0,horizontalItemHoverBg:"transparent",itemHeight:C,groupTitleLineHeight:b,collapsedWidth:C*2,popupBg:I,itemMarginBlock:S,itemPaddingInline:y,horizontalLineHeight:`${C*1.15}px`,iconSize:F,iconMarginInlineEnd:D-F,collapsedIconSize:O,groupTitleFontSize:F,darkItemDisabledColor:new or(N).setA(.25).toRgbString(),darkItemColor:M,darkDangerItemColor:a,darkItemBg:"#001529",darkPopupBg:"#001529",darkSubMenuItemBg:"#000c17",darkItemSelectedColor:N,darkItemSelectedBg:o,darkDangerItemSelectedBg:a,darkItemHoverBg:"transparent",darkGroupTitleColor:M,darkItemHoverColor:N,darkDangerItemHoverColor:E,darkDangerItemSelectedColor:N,darkDangerItemActiveBg:a,itemWidth:_?`calc(100% + ${T}px)`:`calc(100% - ${k*2}px)`}},Os=(e,n=e,t=!0)=>cn("Menu",o=>{const{colorBgElevated:a,controlHeightLG:i,fontSize:s,darkItemColor:u,darkDangerItemColor:d,darkItemBg:f,darkSubMenuItemBg:m,darkItemSelectedColor:v,darkItemSelectedBg:x,darkDangerItemSelectedBg:w,darkItemHoverBg:c,darkGroupTitleColor:p,darkItemHoverColor:C,darkItemDisabledColor:b,darkDangerItemHoverColor:I,darkDangerItemSelectedColor:S,darkDangerItemActiveBg:y,popupBg:F,darkPopupBg:D}=o,O=o.calc(s).div(7).mul(5).equal(),N=sn(o,{menuArrowSize:O,menuHorizontalHeight:o.calc(i).mul(1.15).equal(),menuArrowOffset:o.calc(O).mul(.25).equal(),menuSubMenuBg:a,calc:o.calc,popupBg:F}),E=sn(N,{itemColor:u,itemHoverColor:C,groupTitleColor:p,itemSelectedColor:v,subMenuItemSelectedColor:v,itemBg:f,popupBg:D,subMenuItemBg:m,itemActiveBg:"transparent",itemSelectedBg:x,activeBarHeight:0,activeBarBorderWidth:0,itemHoverBg:c,itemDisabledColor:b,dangerItemColor:d,dangerItemHoverColor:I,dangerItemSelectedColor:S,dangerItemActiveBg:y,dangerItemSelectedBg:w,menuSubMenuBg:m,horizontalItemSelectedColor:v,horizontalItemSelectedBg:x});return[Fs(N),Is(N),Es(N),oo(N,"light"),oo(E,"dark"),Ss(N),_o(N),wn(N,"slide-up"),wn(N,"slide-down"),zo(N,"zoom-big")]},Ns,{deprecatedTokens:[["colorGroupTitle","groupTitleColor"],["radiusItem","itemBorderRadius"],["radiusSubMenuItem","subMenuItemBorderRadius"],["colorItemText","itemColor"],["colorItemTextHover","itemHoverColor"],["colorItemTextHoverHorizontal","horizontalItemHoverColor"],["colorItemTextSelected","itemSelectedColor"],["colorItemTextSelectedHorizontal","horizontalItemSelectedColor"],["colorItemTextDisabled","itemDisabledColor"],["colorDangerItemText","dangerItemColor"],["colorDangerItemTextHover","dangerItemHoverColor"],["colorDangerItemTextSelected","dangerItemSelectedColor"],["colorDangerItemBgActive","dangerItemActiveBg"],["colorDangerItemBgSelected","dangerItemSelectedBg"],["colorItemBg","itemBg"],["colorItemBgHover","itemHoverBg"],["colorSubItemBg","subMenuItemBg"],["colorItemBgActive","itemActiveBg"],["colorItemBgSelectedHorizontal","horizontalItemSelectedBg"],["colorActiveBarWidth","activeBarWidth"],["colorActiveBarHeight","activeBarHeight"],["colorActiveBarBorderSize","activeBarBorderWidth"],["colorItemBgSelected","itemSelectedBg"]],injectStyle:t,unitless:{groupTitleLineHeight:!0}})(e,n),pa=e=>{var n;const{popupClassName:t,icon:r,title:o,theme:a}=e,i=l.useContext(Sn),{prefixCls:s,inlineCollapsed:u,theme:d}=i,f=Yt();let m;if(!r)m=u&&!f.length&&o&&typeof o=="string"?l.createElement("div",{className:`${s}-inline-collapsed-noicon`},o.charAt(0)):l.createElement("span",{className:`${s}-title-content`},o);else{const w=l.isValidElement(o)&&o.type==="span";m=l.createElement(l.Fragment,null,Gt(r,{className:Z(l.isValidElement(r)?(n=r.props)===null||n===void 0?void 0:n.className:void 0,`${s}-item-icon`)}),w?o:l.createElement("span",{className:`${s}-title-content`},o))}const v=l.useMemo(()=>Object.assign(Object.assign({},i),{firstLevel:!1}),[i]),[x]=jo("Menu");return l.createElement(Sn.Provider,{value:v},l.createElement(An,Object.assign({},xt(e,["icon"]),{title:m,popupClassName:Z(s,t,`${s}-${a||d}`),popupStyle:Object.assign({zIndex:x},e.popupStyle)})))};var Ds=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t};function Xn(e){return e===null||e===!1}const Ps={item:da,submenu:pa,divider:ua},As=br((e,n)=>{var t;const r=l.useContext(En),o=r||{},{getPrefixCls:a,getPopupContainer:i,direction:s,menu:u}=l.useContext(wt),d=a(),{prefixCls:f,className:m,style:v,theme:x="light",expandIcon:w,_internalDisableMenuItemTitleTooltip:c,inlineCollapsed:p,siderCollapsed:C,rootClassName:b,mode:I,selectable:S,onClick:y,overflowedIndicatorPopupClassName:F}=e,D=Ds(e,["prefixCls","className","style","theme","expandIcon","_internalDisableMenuItemTitleTooltip","inlineCollapsed","siderCollapsed","rootClassName","mode","selectable","onClick","overflowedIndicatorPopupClassName"]),O=xt(D,["collapsedWidth"]);(t=o.validator)===null||t===void 0||t.call(o,{mode:I});const N=ar((...ee)=>{var R;y==null||y.apply(void 0,ee),(R=o.onClick)===null||R===void 0||R.call(o)}),E=o.mode||I,_=S??o.selectable,T=p??C,k={horizontal:{motionName:`${d}-slide-up`},inline:Ho(d),other:{motionName:`${d}-zoom-big`}},M=a("menu",f||o.prefixCls),B=Lo(M),[V,j,U]=Os(M,B,!r),K=Z(`${M}-${x}`,u==null?void 0:u.className,m),L=l.useMemo(()=>{var ee,R;if(typeof w=="function"||Xn(w))return w||null;if(typeof o.expandIcon=="function"||Xn(o.expandIcon))return o.expandIcon||null;if(typeof(u==null?void 0:u.expandIcon)=="function"||Xn(u==null?void 0:u.expandIcon))return(u==null?void 0:u.expandIcon)||null;const W=(ee=w??(o==null?void 0:o.expandIcon))!==null&&ee!==void 0?ee:u==null?void 0:u.expandIcon;return Gt(W,{className:Z(`${M}-submenu-expand-icon`,l.isValidElement(W)?(R=W.props)===null||R===void 0?void 0:R.className:void 0)})},[w,o==null?void 0:o.expandIcon,u==null?void 0:u.expandIcon,M]),q=l.useMemo(()=>({prefixCls:M,inlineCollapsed:T||!1,direction:s,firstLevel:!0,theme:x,mode:E,disableMenuItemTitleTooltip:c}),[M,T,s,c,x]);return V(l.createElement(En.Provider,{value:null},l.createElement(Sn.Provider,{value:q},l.createElement(un,Object.assign({getPopupContainer:i,overflowedIndicator:l.createElement(ca,null),overflowedIndicatorPopupClassName:Z(M,`${M}-${x}`,F),mode:E,selectable:_,onClick:N},O,{inlineCollapsed:T,style:Object.assign(Object.assign({},u==null?void 0:u.style),v),className:K,prefixCls:M,direction:s,defaultMotions:k,expandIcon:L,ref:n,rootClassName:Z(b,j,o.rootClassName,U,B),_internalComponents:Ps})))))}),dn=br((e,n)=>{const t=Xe(null),r=l.useContext(la);return Po(n,()=>({menu:t.current,focus:o=>{var a;(a=t.current)===null||a===void 0||a.focus(o)}})),l.createElement(As,Object.assign({ref:t},e,r))});dn.Item=da;dn.SubMenu=pa;dn.Divider=ua;dn.ItemGroup=zr;const ks=e=>{const{componentCls:n,menuCls:t,colorError:r,colorTextLightSolid:o}=e,a=`${t}-item`;return{[`${n}, ${n}-menu-submenu`]:{[`${t} ${a}`]:{[`&${a}-danger:not(${a}-disabled)`]:{color:r,"&:hover":{color:o,backgroundColor:r}}}}}},Ms=e=>{const{componentCls:n,menuCls:t,zIndexPopup:r,dropdownArrowDistance:o,sizePopupArrow:a,antCls:i,iconCls:s,motionDurationMid:u,paddingBlock:d,fontSize:f,dropdownEdgeChildPadding:m,colorTextDisabled:v,fontSizeIcon:x,controlPaddingHorizontal:w,colorBgElevated:c}=e;return[{[n]:{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:r,display:"block","&::before":{position:"absolute",insetBlock:e.calc(a).div(2).sub(o).equal(),zIndex:-9999,opacity:1e-4,content:'""'},"&-menu-vertical":{maxHeight:"100vh",overflowY:"auto"},[`&-trigger${i}-btn`]:{[`& > ${s}-down, & > ${i}-btn-icon > ${s}-down`]:{fontSize:x}},[`${n}-wrap`]:{position:"relative",[`${i}-btn > ${s}-down`]:{fontSize:x},[`${s}-down::before`]:{transition:`transform ${u}`}},[`${n}-wrap-open`]:{[`${s}-down::before`]:{transform:"rotate(180deg)"}},"\n &-hidden,\n &-menu-hidden,\n &-menu-submenu-hidden\n ":{display:"none"},[`&${i}-slide-down-enter${i}-slide-down-enter-active${n}-placement-bottomLeft,
|
|
59
59
|
&${i}-slide-down-appear${i}-slide-down-appear-active${n}-placement-bottomLeft,
|
|
60
60
|
&${i}-slide-down-enter${i}-slide-down-enter-active${n}-placement-bottom,
|
|
61
61
|
&${i}-slide-down-appear${i}-slide-down-appear-active${n}-placement-bottom,
|
|
@@ -69,7 +69,7 @@ import{jsx as $,jsxs as Y,Fragment as Ea}from"react/jsx-runtime";import*as l fro
|
|
|
69
69
|
&${i}-slide-down-leave${i}-slide-down-leave-active${n}-placement-bottom,
|
|
70
70
|
&${i}-slide-down-leave${i}-slide-down-leave-active${n}-placement-bottomRight`]:{animationName:Ba},[`&${i}-slide-up-leave${i}-slide-up-leave-active${n}-placement-topLeft,
|
|
71
71
|
&${i}-slide-up-leave${i}-slide-up-leave-active${n}-placement-top,
|
|
72
|
-
&${i}-slide-up-leave${i}-slide-up-leave-active${n}-placement-topRight`]:{animationName:Ra}}},za(e,c,{arrowPlacement:{top:!0,bottom:!0}}),{[`${n} ${t}`]:{position:"relative",margin:0},[`${t}-submenu-popup`]:{position:"absolute",zIndex:r,background:"transparent",boxShadow:"none",transformOrigin:"0 0","ul, li":{listStyle:"none",margin:0}},[`${n}, ${n}-menu-submenu`]:Object.assign(Object.assign({},On(e)),{[t]:Object.assign(Object.assign({padding:m,listStyleType:"none",backgroundColor:c,backgroundClip:"padding-box",borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary},Ur(e)),{"&:empty":{padding:0,boxShadow:"none"},[`${t}-item-group-title`]:{padding:`${ne(d)} ${ne(w)}`,color:e.colorTextDescription,transition:`all ${u}`},[`${t}-item`]:{position:"relative",display:"flex",alignItems:"center"},[`${t}-item-icon`]:{minWidth:f,marginInlineEnd:e.marginXS,fontSize:e.fontSizeSM},[`${t}-title-content`]:{flex:"auto","&-with-extra":{display:"inline-flex",alignItems:"center",width:"100%"},"> a":{color:"inherit",transition:`all ${u}`,"&:hover":{color:"inherit"},"&::after":{position:"absolute",inset:0,content:'""'}},[`${t}-item-extra`]:{paddingInlineStart:e.padding,marginInlineStart:"auto",fontSize:e.fontSizeSM,color:e.colorTextDescription}},[`${t}-item, ${t}-submenu-title`]:Object.assign(Object.assign({display:"flex",margin:0,padding:`${ne(d)} ${ne(w)}`,color:e.colorText,fontWeight:"normal",fontSize:f,lineHeight:e.lineHeight,cursor:"pointer",transition:`all ${u}`,borderRadius:e.borderRadiusSM,"&:hover, &-active":{backgroundColor:e.controlItemBgHover}},Ur(e)),{"&-selected":{color:e.colorPrimary,backgroundColor:e.controlItemBgActive,"&:hover, &-active":{backgroundColor:e.controlItemBgActiveHover}},"&-disabled":{color:h,cursor:"not-allowed","&:hover":{color:h,backgroundColor:c,cursor:"not-allowed"},a:{pointerEvents:"none"}},"&-divider":{height:1,margin:`${ne(e.marginXXS)} 0`,overflow:"hidden",lineHeight:0,backgroundColor:e.colorSplit},[`${n}-menu-submenu-expand-icon`]:{position:"absolute",insetInlineEnd:e.paddingXS,[`${n}-menu-submenu-arrow-icon`]:{marginInlineEnd:"0 !important",color:e.colorIcon,fontSize:x,fontStyle:"normal"}}}),[`${t}-item-group-list`]:{margin:`0 ${ne(e.marginXS)}`,padding:0,listStyle:"none"},[`${t}-submenu-title`]:{paddingInlineEnd:e.calc(w).add(e.fontSizeSM).equal()},[`${t}-submenu-vertical`]:{position:"relative"},[`${t}-submenu${t}-submenu-disabled ${n}-menu-submenu-title`]:{[`&, ${n}-menu-submenu-arrow-icon`]:{color:h,backgroundColor:c,cursor:"not-allowed"}},[`${t}-submenu-selected ${n}-menu-submenu-title`]:{color:e.colorPrimary}})})},[wn(e,"slide-up"),wn(e,"slide-down"),qr(e,"move-up"),qr(e,"move-down"),zo(e,"zoom-big")]]},Rs=e=>Object.assign(Object.assign({zIndexPopup:e.zIndexPopupBase+50,paddingBlock:(e.controlHeight-e.fontSize*e.lineHeight)/2},ja({contentRadius:e.borderRadiusLG,limitVerticalRadius:!0})),La(e)),Bs=cn("Dropdown",e=>{const{marginXXS:n,sizePopupArrow:t,paddingXXS:r,componentCls:o}=e,a=sn(e,{menuCls:`${o}-menu`,dropdownArrowDistance:e.calc(t).div(2).add(n).equal(),dropdownEdgeChildPadding:r});return[Ms(a),ks(a)]},Rs,{resetStyle:!1}),kn=e=>{var n;const{menu:t,arrow:r,prefixCls:o,children:a,trigger:i,disabled:s,dropdownRender:u,popupRender:d,getPopupContainer:f,overlayClassName:m,rootClassName:h,overlayStyle:x,open:w,onOpenChange:c,visible:p,onVisibleChange:C,mouseEnterDelay:b=.15,mouseLeaveDelay:I=.1,autoAdjustOverflow:S=!0,placement:y="",overlay:F,transitionName:D,destroyOnHidden:O,destroyPopupOnHide:N}=e,{getPopupContainer:E,getPrefixCls:_,direction:T,dropdown:k}=l.useContext(wt),M=d||u;Ha();const B=l.useMemo(()=>{const me=_();return D!==void 0?D:y.includes("top")?`${me}-slide-down`:`${me}-slide-up`},[_,y,D]),V=l.useMemo(()=>y?y.includes("Center")?y.slice(0,y.indexOf("Center")):y:T==="rtl"?"bottomRight":"bottomLeft",[y,T]),j=_("dropdown",o),U=Lo(j),[K,L,q]=Bs(j,U),[,ee]=qa(),R=l.Children.only(Ti(a)?l.createElement("span",null,a):a),W=Gt(R,{className:Z(`${j}-trigger`,{[`${j}-rtl`]:T==="rtl"},R.props.className),disabled:(n=R.props.disabled)!==null&&n!==void 0?n:s}),J=s?[]:i,oe=!!(J!=null&&J.includes("contextMenu")),[ae,Q]=Lt(!1,{value:w??p}),ie=ar(me=>{c==null||c(me,{source:"trigger"}),C==null||C(me),Q(me)}),Ce=Z(m,h,L,q,U,k==null?void 0:k.className,{[`${j}-rtl`]:T==="rtl"}),xe=Ua({arrowPointAtCenter:typeof r=="object"&&r.pointAtCenter,autoAdjustOverflow:S,offset:ee.marginXXS,arrowWidth:r?ee.sizePopupArrow:0,borderRadius:ee.borderRadius}),we=ar(()=>{t!=null&&t.selectable&&(t!=null&&t.multiple)||(c==null||c(!1,{source:"menu"}),Q(!1))}),Te=()=>{let me;return t!=null&&t.items?me=l.createElement(dn,Object.assign({},t)):typeof F=="function"?me=F():me=F,M&&(me=M(me)),me=l.Children.only(typeof me=="string"?l.createElement("span",null,me):me),l.createElement($s,{prefixCls:`${j}-menu`,rootClassName:Z(q,U),expandIcon:l.createElement("span",{className:`${j}-menu-submenu-arrow`},T==="rtl"?l.createElement(vi,{className:`${j}-menu-submenu-arrow-icon`}):l.createElement(bi,{className:`${j}-menu-submenu-arrow-icon`})),mode:"vertical",selectable:!1,onClick:we,validator:({mode:ct})=>{}},me)},[Je,Le]=jo("Dropdown",x==null?void 0:x.zIndex);let ve=l.createElement(Bi,Object.assign({alignPoint:oe},xt(e,["rootClassName"]),{mouseEnterDelay:b,mouseLeaveDelay:I,visible:ae,builtinPlacements:xe,arrow:!!r,overlayClassName:Ce,prefixCls:j,getPopupContainer:f||E,transitionName:B,trigger:J,overlay:Te,placement:V,onVisibleChange:ie,overlayStyle:Object.assign(Object.assign(Object.assign({},k==null?void 0:k.style),x),{zIndex:Je}),autoDestroy:O??N}),W);return Je&&(ve=l.createElement(Wa.Provider,{value:Le},ve)),K(ve)},Ts=Va(kn,"align",void 0,"dropdown",e=>e),_s=e=>l.createElement(Ts,Object.assign({},e),l.createElement("span",null));kn._InternalPanelDoNotUseOrYouWillBeFired=_s;function lo(e){return["small","middle","large"].includes(e)}function co(e){return e?typeof e=="number"&&!Number.isNaN(e):!1}const ma=Be.createContext({latestIndex:0}),zs=ma.Provider,js=({className:e,index:n,children:t,split:r,style:o})=>{const{latestIndex:a}=l.useContext(ma);return t==null?null:l.createElement(l.Fragment,null,l.createElement("div",{className:e,style:o},t),n<a&&r&&l.createElement("span",{className:`${e}-split`},r))};var Ls=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t};const Hs=l.forwardRef((e,n)=>{var t;const{getPrefixCls:r,direction:o,size:a,className:i,style:s,classNames:u,styles:d}=Or("space"),{size:f=a??"small",align:m,className:h,rootClassName:x,children:w,direction:c="horizontal",prefixCls:p,split:C,style:b,wrap:I=!1,classNames:S,styles:y}=e,F=Ls(e,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[D,O]=Array.isArray(f)?f:[f,f],N=lo(O),E=lo(D),_=co(O),T=co(D),k=Sr(w,{keepEmpty:!0}),M=m===void 0&&c==="horizontal"?"center":m,B=r("space",p),[V,j,U]=Ka(B),K=Z(B,i,j,`${B}-${c}`,{[`${B}-rtl`]:o==="rtl",[`${B}-align-${M}`]:M,[`${B}-gap-row-${O}`]:N,[`${B}-gap-col-${D}`]:E},h,x,U),L=Z(`${B}-item`,(t=S==null?void 0:S.item)!==null&&t!==void 0?t:u.item),q=Object.assign(Object.assign({},d.item),y==null?void 0:y.item),ee=k.map((J,oe)=>{const ae=(J==null?void 0:J.key)||`${L}-${oe}`;return l.createElement(js,{className:L,key:ae,index:oe,split:C,style:q},J)}),R=l.useMemo(()=>({latestIndex:k.reduce((oe,ae,Q)=>ae!=null?Q:oe,0)}),[k]);if(k.length===0)return null;const W={};return I&&(W.flexWrap="wrap"),!E&&T&&(W.columnGap=D),!N&&_&&(W.rowGap=O),V(l.createElement("div",Object.assign({ref:n,className:K,style:Object.assign(Object.assign(Object.assign({},W),s),b)},F),l.createElement(zs,{value:R},ee)))}),fa=Hs;fa.Compact=Xa;var qs=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t};const ga=e=>{const{getPopupContainer:n,getPrefixCls:t,direction:r}=l.useContext(wt),{prefixCls:o,type:a="default",danger:i,disabled:s,loading:u,onClick:d,htmlType:f,children:m,className:h,menu:x,arrow:w,autoFocus:c,overlay:p,trigger:C,align:b,open:I,onOpenChange:S,placement:y,getPopupContainer:F,href:D,icon:O=l.createElement(ca,null),title:N,buttonsRender:E=xe=>xe,mouseEnterDelay:_,mouseLeaveDelay:T,overlayClassName:k,overlayStyle:M,destroyOnHidden:B,destroyPopupOnHide:V,dropdownRender:j,popupRender:U}=e,K=qs(e,["prefixCls","type","danger","disabled","loading","onClick","htmlType","children","className","menu","arrow","autoFocus","overlay","trigger","align","open","onOpenChange","placement","getPopupContainer","href","icon","title","buttonsRender","mouseEnterDelay","mouseLeaveDelay","overlayClassName","overlayStyle","destroyOnHidden","destroyPopupOnHide","dropdownRender","popupRender"]),L=t("dropdown",o),q=`${L}-button`,R={menu:x,arrow:w,autoFocus:c,align:b,disabled:s,trigger:s?[]:C,onOpenChange:S,getPopupContainer:F||n,mouseEnterDelay:_,mouseLeaveDelay:T,overlayClassName:k,overlayStyle:M,destroyOnHidden:B,popupRender:U||j},{compactSize:W,compactItemClassnames:J}=Ga(L,r),oe=Z(q,J,h);"destroyPopupOnHide"in e&&(R.destroyPopupOnHide=V),"overlay"in e&&(R.overlay=p),"open"in e&&(R.open=I),"placement"in e?R.placement=y:R.placement=r==="rtl"?"bottomLeft":"bottomRight";const ae=l.createElement(pt,{type:a,danger:i,disabled:s,loading:u,onClick:d,htmlType:f,href:D,title:N},m),Q=l.createElement(pt,{type:a,danger:i,icon:O}),[ie,Ce]=E([ae,Q]);return l.createElement(fa.Compact,Object.assign({className:oe,size:W,block:!0},K),ie,l.createElement(kn,Object.assign({},R),Ce))};ga.__ANT_BUTTON=!0;const ha=kn;ha.Button=ga;const Us=e=>{const{componentCls:n,iconCls:t,antCls:r,zIndexPopup:o,colorText:a,colorWarning:i,marginXXS:s,marginXS:u,fontSize:d,fontWeightStrong:f,colorTextHeading:m}=e;return{[n]:{zIndex:o,[`&${r}-popover`]:{fontSize:d},[`${n}-message`]:{marginBottom:u,display:"flex",flexWrap:"nowrap",alignItems:"start",[`> ${n}-message-icon ${t}`]:{color:i,fontSize:d,lineHeight:1,marginInlineEnd:u},[`${n}-title`]:{fontWeight:f,color:m,"&:only-child":{fontWeight:"normal"}},[`${n}-description`]:{marginTop:s,color:a}},[`${n}-buttons`]:{textAlign:"end",whiteSpace:"nowrap",button:{marginInlineStart:u}}}}},Ws=e=>{const{zIndexPopupBase:n}=e;return{zIndexPopup:n+60}},va=cn("Popconfirm",e=>Us(e),Ws,{resetStyle:!1});var Vs=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t};const ba=e=>{const{prefixCls:n,okButtonProps:t,cancelButtonProps:r,title:o,description:a,cancelText:i,okText:s,okType:u="primary",icon:d=l.createElement(qo,null),showCancel:f=!0,close:m,onConfirm:h,onCancel:x,onPopupClick:w}=e,{getPrefixCls:c}=l.useContext(wt),[p]=Uo("Popconfirm",Wo.Popconfirm),C=Jr(o),b=Jr(a);return l.createElement("div",{className:`${n}-inner-content`,onClick:w},l.createElement("div",{className:`${n}-message`},d&&l.createElement("span",{className:`${n}-message-icon`},d),l.createElement("div",{className:`${n}-message-text`},C&&l.createElement("div",{className:`${n}-title`},C),b&&l.createElement("div",{className:`${n}-description`},b))),l.createElement("div",{className:`${n}-buttons`},f&&l.createElement(pt,Object.assign({onClick:x,size:"small"},r),i||(p==null?void 0:p.cancelText)),l.createElement(yi,{buttonProps:Object.assign(Object.assign({size:"small"},Ja(u)),t),actionFn:h,close:m,prefixCls:c("btn"),quitOnNullishReturnValue:!0,emitEvent:!0},s||(p==null?void 0:p.okText))))},Ks=e=>{const{prefixCls:n,placement:t,className:r,style:o}=e,a=Vs(e,["prefixCls","placement","className","style"]),{getPrefixCls:i}=l.useContext(wt),s=i("popconfirm",n),[u]=va(s);return u(l.createElement(xi,{placement:t,className:Z(s,r),style:o,content:l.createElement(ba,Object.assign({prefixCls:s},a))}))};var Xs=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t};const Gs=l.forwardRef((e,n)=>{var t,r;const{prefixCls:o,placement:a="top",trigger:i="click",okType:s="primary",icon:u=l.createElement(qo,null),children:d,overlayClassName:f,onOpenChange:m,onVisibleChange:h,overlayStyle:x,styles:w,classNames:c}=e,p=Xs(e,["prefixCls","placement","trigger","okType","icon","children","overlayClassName","onOpenChange","onVisibleChange","overlayStyle","styles","classNames"]),{getPrefixCls:C,className:b,style:I,classNames:S,styles:y}=Or("popconfirm"),[F,D]=Lt(!1,{value:(t=e.open)!==null&&t!==void 0?t:e.visible,defaultValue:(r=e.defaultOpen)!==null&&r!==void 0?r:e.defaultVisible}),O=(j,U)=>{D(j,!0),h==null||h(j),m==null||m(j,U)},N=j=>{O(!1,j)},E=j=>{var U;return(U=e.onConfirm)===null||U===void 0?void 0:U.call(void 0,j)},_=j=>{var U;O(!1,j),(U=e.onCancel)===null||U===void 0||U.call(void 0,j)},T=(j,U)=>{const{disabled:K=!1}=e;K||O(j,U)},k=C("popconfirm",o),M=Z(k,b,f,S.root,c==null?void 0:c.root),B=Z(S.body,c==null?void 0:c.body),[V]=va(k);return V(l.createElement(Go,Object.assign({},xt(p,["title"]),{trigger:i,placement:a,onOpenChange:T,open:F,ref:n,classNames:{root:M,body:B},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},y.root),I),x),w==null?void 0:w.root),body:Object.assign(Object.assign({},y.body),w==null?void 0:w.body)},content:l.createElement(ba,Object.assign({okType:s,icon:u},e,{prefixCls:k,close:N,onConfirm:E,onCancel:_})),"data-popover-inject":!0}),d))}),ya=Gs;ya._InternalPanelDoNotUseOrYouWillBeFired=Ks;var Js={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},Ys=function(){var n=Xe([]),t=Xe(null);return je(function(){var r=Date.now(),o=!1;n.current.forEach(function(a){if(a){o=!0;var i=a.style;i.transitionDuration=".3s, .3s, .3s, .06s",t.current&&r-t.current<100&&(i.transitionDuration="0s, 0s")}}),o&&(t.current=Date.now())}),n.current},uo=0,Qs=Ya();function Zs(){var e;return Qs?(e=uo,uo+=1):e="TEST_OR_SSR",e}const el=(function(e){var n=l.useState(),t=Ke(n,2),r=t[0],o=t[1];return l.useEffect(function(){o("rc_progress_".concat(Zs()))},[]),e||r});var po=function(n){var t=n.bg,r=n.children;return l.createElement("div",{style:{width:"100%",height:"100%",background:t}},r)};function mo(e,n){return Object.keys(e).map(function(t){var r=parseFloat(t),o="".concat(Math.floor(r*n),"%");return"".concat(e[t]," ").concat(o)})}var tl=l.forwardRef(function(e,n){var t=e.prefixCls,r=e.color,o=e.gradientId,a=e.radius,i=e.style,s=e.ptg,u=e.strokeLinecap,d=e.strokeWidth,f=e.size,m=e.gapDegree,h=r&&jt(r)==="object",x=h?"#FFF":void 0,w=f/2,c=l.createElement("circle",{className:"".concat(t,"-circle-path"),r:a,cx:w,cy:w,stroke:x,strokeLinecap:u,strokeWidth:d,opacity:s===0?0:1,style:i,ref:n});if(!h)return c;var p="".concat(o,"-conic"),C=m?"".concat(180+m/2,"deg"):"0deg",b=mo(r,(360-m)/360),I=mo(r,1),S="conic-gradient(from ".concat(C,", ").concat(b.join(", "),")"),y="linear-gradient(to ".concat(m?"bottom":"top",", ").concat(I.join(", "),")");return l.createElement(l.Fragment,null,l.createElement("mask",{id:p},c),l.createElement("foreignObject",{x:0,y:0,width:f,height:f,mask:"url(#".concat(p,")")},l.createElement(po,{bg:y},l.createElement(po,{bg:S}))))}),rn=100,Gn=function(n,t,r,o,a,i,s,u,d,f){var m=arguments.length>10&&arguments[10]!==void 0?arguments[10]:0,h=r/100*360*((360-i)/360),x=i===0?0:{bottom:0,top:180,left:90,right:-90}[s],w=(100-o)/100*t;d==="round"&&o!==100&&(w+=f/2,w>=t&&(w=t-.01));var c=rn/2;return{stroke:typeof u=="string"?u:void 0,strokeDasharray:"".concat(t,"px ").concat(n),strokeDashoffset:w+m,transform:"rotate(".concat(a+h+x,"deg)"),transformOrigin:"".concat(c,"px ").concat(c,"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},nl=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function fo(e){var n=e??[];return Array.isArray(n)?n:[n]}var rl=function(n){var t=ze(ze({},Js),n),r=t.id,o=t.prefixCls,a=t.steps,i=t.strokeWidth,s=t.trailWidth,u=t.gapDegree,d=u===void 0?0:u,f=t.gapPosition,m=t.trailColor,h=t.strokeLinecap,x=t.style,w=t.className,c=t.strokeColor,p=t.percent,C=ot(t,nl),b=rn/2,I=el(r),S="".concat(I,"-gradient"),y=b-i/2,F=Math.PI*2*y,D=d>0?90+d/2:-90,O=F*((360-d)/360),N=jt(a)==="object"?a:{count:a,gap:2},E=N.count,_=N.gap,T=fo(p),k=fo(c),M=k.find(function(q){return q&&jt(q)==="object"}),B=M&&jt(M)==="object",V=B?"butt":h,j=Gn(F,O,0,100,D,d,f,m,V,i),U=Ys(),K=function(){var ee=0;return T.map(function(R,W){var J=k[W]||k[k.length-1],oe=Gn(F,O,ee,R,D,d,f,J,V,i);return ee+=R,l.createElement(tl,{key:W,color:J,ptg:R,radius:y,prefixCls:o,gradientId:S,style:oe,strokeLinecap:V,strokeWidth:i,gapDegree:d,ref:function(Q){U[W]=Q},size:rn})}).reverse()},L=function(){var ee=Math.round(E*(T[0]/100)),R=100/E,W=0;return new Array(E).fill(null).map(function(J,oe){var ae=oe<=ee-1?k[0]:m,Q=ae&&jt(ae)==="object"?"url(#".concat(S,")"):void 0,ie=Gn(F,O,W,R,D,d,f,ae,"butt",i,_);return W+=(O-ie.strokeDashoffset+_)*100/O,l.createElement("circle",{key:oe,className:"".concat(o,"-circle-path"),r:y,cx:b,cy:b,stroke:Q,strokeWidth:i,opacity:1,style:ie,ref:function(xe){U[oe]=xe}})})};return l.createElement("svg",De({className:Z("".concat(o,"-circle"),w),viewBox:"0 0 ".concat(rn," ").concat(rn),style:x,id:r,role:"presentation"},C),!E&&l.createElement("circle",{className:"".concat(o,"-circle-trail"),r:y,cx:b,cy:b,stroke:m,strokeLinecap:V,strokeWidth:s||i,style:j}),E?L():K())};function Tt(e){return!e||e<0?0:e>100?100:e}function Fn({success:e,successPercent:n}){let t=n;return e&&"progress"in e&&(t=e.progress),e&&"percent"in e&&(t=e.percent),t}const ol=({percent:e,success:n,successPercent:t})=>{const r=Tt(Fn({success:n,successPercent:t}));return[r,Tt(Tt(e)-r)]},al=({success:e={},strokeColor:n})=>{const{strokeColor:t}=e;return[t||ir.green,n||null]},Mn=(e,n,t)=>{var r,o,a,i;let s=-1,u=-1;if(n==="step"){const d=t.steps,f=t.strokeWidth;typeof e=="string"||typeof e>"u"?(s=e==="small"?2:14,u=f??8):typeof e=="number"?[s,u]=[e,e]:[s=14,u=8]=Array.isArray(e)?e:[e.width,e.height],s*=d}else if(n==="line"){const d=t==null?void 0:t.strokeWidth;typeof e=="string"||typeof e>"u"?u=d||(e==="small"?6:8):typeof e=="number"?[s,u]=[e,e]:[s=-1,u=8]=Array.isArray(e)?e:[e.width,e.height]}else(n==="circle"||n==="dashboard")&&(typeof e=="string"||typeof e>"u"?[s,u]=e==="small"?[60,60]:[120,120]:typeof e=="number"?[s,u]=[e,e]:Array.isArray(e)&&(s=(o=(r=e[0])!==null&&r!==void 0?r:e[1])!==null&&o!==void 0?o:120,u=(i=(a=e[0])!==null&&a!==void 0?a:e[1])!==null&&i!==void 0?i:120));return[s,u]},il=3,sl=e=>il/e*100,ll=e=>{const{prefixCls:n,trailColor:t=null,strokeLinecap:r="round",gapPosition:o,gapDegree:a,width:i=120,type:s,children:u,success:d,size:f=i,steps:m}=e,[h,x]=Mn(f,"circle");let{strokeWidth:w}=e;w===void 0&&(w=Math.max(sl(h),6));const c={width:h,height:x,fontSize:h*.15+6},p=l.useMemo(()=>{if(a||a===0)return a;if(s==="dashboard")return 75},[a,s]),C=ol(e),b=o||s==="dashboard"&&"bottom"||void 0,I=Object.prototype.toString.call(e.strokeColor)==="[object Object]",S=al({success:d,strokeColor:e.strokeColor}),y=Z(`${n}-inner`,{[`${n}-circle-gradient`]:I}),F=l.createElement(rl,{steps:m,percent:m?C[1]:C,strokeWidth:w,trailWidth:w,strokeColor:m?S[1]:S,strokeLinecap:r,trailColor:t,prefixCls:n,gapDegree:p,gapPosition:b}),D=h<=20,O=l.createElement("div",{className:y,style:c},F,!D&&u);return D?l.createElement(Fr,{title:u},O):O},Nn="--progress-line-stroke-color",Ca="--progress-percent",go=e=>{const n=e?"100%":"-100%";return new sr(`antProgress${e?"RTL":"LTR"}Active`,{"0%":{transform:`translateX(${n}) scaleX(0)`,opacity:.1},"20%":{transform:`translateX(${n}) scaleX(0)`,opacity:.5},to:{transform:"translateX(0) scaleX(1)",opacity:0}})},cl=e=>{const{componentCls:n,iconCls:t}=e;return{[n]:Object.assign(Object.assign({},On(e)),{display:"inline-block","&-rtl":{direction:"rtl"},"&-line":{position:"relative",width:"100%",fontSize:e.fontSize},[`${n}-outer`]:{display:"inline-flex",alignItems:"center",width:"100%"},[`${n}-inner`]:{position:"relative",display:"inline-block",width:"100%",flex:1,overflow:"hidden",verticalAlign:"middle",backgroundColor:e.remainingColor,borderRadius:e.lineBorderRadius},[`${n}-inner:not(${n}-circle-gradient)`]:{[`${n}-circle-path`]:{stroke:e.defaultColor}},[`${n}-success-bg, ${n}-bg`]:{position:"relative",background:e.defaultColor,borderRadius:e.lineBorderRadius,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`},[`${n}-layout-bottom`]:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",[`${n}-text`]:{width:"max-content",marginInlineStart:0,marginTop:e.marginXXS}},[`${n}-bg`]:{overflow:"hidden","&::after":{content:'""',background:{_multi_value_:!0,value:["inherit",`var(${Nn})`]},height:"100%",width:`calc(1 / var(${Ca}) * 100%)`,display:"block"},[`&${n}-bg-inner`]:{minWidth:"max-content","&::after":{content:"none"},[`${n}-text-inner`]:{color:e.colorWhite,[`&${n}-text-bright`]:{color:"rgba(0, 0, 0, 0.45)"}}}},[`${n}-success-bg`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,backgroundColor:e.colorSuccess},[`${n}-text`]:{display:"inline-block",marginInlineStart:e.marginXS,color:e.colorText,lineHeight:1,width:"2em",whiteSpace:"nowrap",textAlign:"start",verticalAlign:"middle",wordBreak:"normal",[t]:{fontSize:e.fontSize},[`&${n}-text-outer`]:{width:"max-content"},[`&${n}-text-outer${n}-text-start`]:{width:"max-content",marginInlineStart:0,marginInlineEnd:e.marginXS}},[`${n}-text-inner`]:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%",marginInlineStart:0,padding:`0 ${ne(e.paddingXXS)}`,[`&${n}-text-start`]:{justifyContent:"start"},[`&${n}-text-end`]:{justifyContent:"end"}},[`&${n}-status-active`]:{[`${n}-bg::before`]:{position:"absolute",inset:0,backgroundColor:e.colorBgContainer,borderRadius:e.lineBorderRadius,opacity:0,animationName:go(),animationDuration:e.progressActiveMotionDuration,animationTimingFunction:e.motionEaseOutQuint,animationIterationCount:"infinite",content:'""'}},[`&${n}-rtl${n}-status-active`]:{[`${n}-bg::before`]:{animationName:go(!0)}},[`&${n}-status-exception`]:{[`${n}-bg`]:{backgroundColor:e.colorError},[`${n}-text`]:{color:e.colorError}},[`&${n}-status-exception ${n}-inner:not(${n}-circle-gradient)`]:{[`${n}-circle-path`]:{stroke:e.colorError}},[`&${n}-status-success`]:{[`${n}-bg`]:{backgroundColor:e.colorSuccess},[`${n}-text`]:{color:e.colorSuccess}},[`&${n}-status-success ${n}-inner:not(${n}-circle-gradient)`]:{[`${n}-circle-path`]:{stroke:e.colorSuccess}}})}},ul=e=>{const{componentCls:n,iconCls:t}=e;return{[n]:{[`${n}-circle-trail`]:{stroke:e.remainingColor},[`&${n}-circle ${n}-inner`]:{position:"relative",lineHeight:1,backgroundColor:"transparent"},[`&${n}-circle ${n}-text`]:{position:"absolute",insetBlockStart:"50%",insetInlineStart:0,width:"100%",margin:0,padding:0,color:e.circleTextColor,fontSize:e.circleTextFontSize,lineHeight:1,whiteSpace:"normal",textAlign:"center",transform:"translateY(-50%)",[t]:{fontSize:e.circleIconFontSize}},[`${n}-circle&-status-exception`]:{[`${n}-text`]:{color:e.colorError}},[`${n}-circle&-status-success`]:{[`${n}-text`]:{color:e.colorSuccess}}},[`${n}-inline-circle`]:{lineHeight:1,[`${n}-inner`]:{verticalAlign:"bottom"}}}},dl=e=>{const{componentCls:n}=e;return{[n]:{[`${n}-steps`]:{display:"inline-block","&-outer":{display:"flex",flexDirection:"row",alignItems:"center"},"&-item":{flexShrink:0,minWidth:e.progressStepMinWidth,marginInlineEnd:e.progressStepMarginInlineEnd,backgroundColor:e.remainingColor,transition:`all ${e.motionDurationSlow}`,"&-active":{backgroundColor:e.defaultColor}}}}}},pl=e=>{const{componentCls:n,iconCls:t}=e;return{[n]:{[`${n}-small&-line, ${n}-small&-line ${n}-text ${t}`]:{fontSize:e.fontSizeSM}}}},ml=e=>({circleTextColor:e.colorText,defaultColor:e.colorInfo,remainingColor:e.colorFillSecondary,lineBorderRadius:100,circleTextFontSize:"1em",circleIconFontSize:`${e.fontSize/e.fontSizeSM}em`}),fl=cn("Progress",e=>{const n=e.calc(e.marginXXS).div(2).equal(),t=sn(e,{progressStepMarginInlineEnd:n,progressStepMinWidth:n,progressActiveMotionDuration:"2.4s"});return[cl(t),ul(t),dl(t),pl(t)]},ml);var gl=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t};const hl=e=>{let n=[];return Object.keys(e).forEach(t=>{const r=Number.parseFloat(t.replace(/%/g,""));Number.isNaN(r)||n.push({key:r,value:e[t]})}),n=n.sort((t,r)=>t.key-r.key),n.map(({key:t,value:r})=>`${r} ${t}%`).join(", ")},vl=(e,n)=>{const{from:t=ir.blue,to:r=ir.blue,direction:o=n==="rtl"?"to left":"to right"}=e,a=gl(e,["from","to","direction"]);if(Object.keys(a).length!==0){const s=hl(a),u=`linear-gradient(${o}, ${s})`;return{background:u,[Nn]:u}}const i=`linear-gradient(${o}, ${t}, ${r})`;return{background:i,[Nn]:i}},bl=e=>{const{prefixCls:n,direction:t,percent:r,size:o,strokeWidth:a,strokeColor:i,strokeLinecap:s="round",children:u,trailColor:d=null,percentPosition:f,success:m}=e,{align:h,type:x}=f,w=i&&typeof i!="string"?vl(i,t):{[Nn]:i,background:i},c=s==="square"||s==="butt"?0:void 0,p=o??[-1,a||(o==="small"?6:8)],[C,b]=Mn(p,"line",{strokeWidth:a}),I={backgroundColor:d||void 0,borderRadius:c},S=Object.assign(Object.assign({width:`${Tt(r)}%`,height:b,borderRadius:c},w),{[Ca]:Tt(r)/100}),y=Fn(e),F={width:`${Tt(y)}%`,height:b,borderRadius:c,backgroundColor:m==null?void 0:m.strokeColor},D={width:C<0?"100%":C},O=l.createElement("div",{className:`${n}-inner`,style:I},l.createElement("div",{className:Z(`${n}-bg`,`${n}-bg-${x}`),style:S},x==="inner"&&u),y!==void 0&&l.createElement("div",{className:`${n}-success-bg`,style:F})),N=x==="outer"&&h==="start",E=x==="outer"&&h==="end";return x==="outer"&&h==="center"?l.createElement("div",{className:`${n}-layout-bottom`},O,u):l.createElement("div",{className:`${n}-outer`,style:D},N&&u,O,E&&u)},yl=e=>{const{size:n,steps:t,rounding:r=Math.round,percent:o=0,strokeWidth:a=8,strokeColor:i,trailColor:s=null,prefixCls:u,children:d}=e,f=r(t*(o/100)),h=n??[n==="small"?2:14,a],[x,w]=Mn(h,"step",{steps:t,strokeWidth:a}),c=x/t,p=Array.from({length:t});for(let C=0;C<t;C++){const b=Array.isArray(i)?i[C]:i;p[C]=l.createElement("div",{key:C,className:Z(`${u}-steps-item`,{[`${u}-steps-item-active`]:C<=f-1}),style:{backgroundColor:C<=f-1?b:s,width:c,height:w}})}return l.createElement("div",{className:`${u}-steps-outer`},p,d)};var Cl=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t};const xl=["normal","exception","active","success"],wl=l.forwardRef((e,n)=>{const{prefixCls:t,className:r,rootClassName:o,steps:a,strokeColor:i,percent:s=0,size:u="default",showInfo:d=!0,type:f="line",status:m,format:h,style:x,percentPosition:w={}}=e,c=Cl(e,["prefixCls","className","rootClassName","steps","strokeColor","percent","size","showInfo","type","status","format","style","percentPosition"]),{align:p="end",type:C="outer"}=w,b=Array.isArray(i)?i[0]:i,I=typeof i=="string"||Array.isArray(i)?i:void 0,S=l.useMemo(()=>{if(b){const K=typeof b=="string"?b:Object.values(b)[0];return new or(K).isLight()}return!1},[i]),y=l.useMemo(()=>{var K,L;const q=Fn(e);return Number.parseInt(q!==void 0?(K=q??0)===null||K===void 0?void 0:K.toString():(L=s??0)===null||L===void 0?void 0:L.toString(),10)},[s,e.success,e.successPercent]),F=l.useMemo(()=>!xl.includes(m)&&y>=100?"success":m||"normal",[m,y]),{getPrefixCls:D,direction:O,progress:N}=l.useContext(wt),E=D("progress",t),[_,T,k]=fl(E),M=f==="line",B=M&&!a,V=l.useMemo(()=>{if(!d)return null;const K=Fn(e);let L;const q=h||(R=>`${R}%`),ee=M&&S&&C==="inner";return C==="inner"||h||F!=="exception"&&F!=="success"?L=q(Tt(s),Tt(K)):F==="exception"?L=M?l.createElement(Qa,null):l.createElement(Za,null):F==="success"&&(L=M?l.createElement(ei,null):l.createElement(ti,null)),l.createElement("span",{className:Z(`${E}-text`,{[`${E}-text-bright`]:ee,[`${E}-text-${p}`]:B,[`${E}-text-${C}`]:B}),title:typeof L=="string"?L:void 0},L)},[d,s,y,F,f,E,h]);let j;f==="line"?j=a?l.createElement(yl,Object.assign({},e,{strokeColor:I,prefixCls:E,steps:typeof a=="object"?a.count:a}),V):l.createElement(bl,Object.assign({},e,{strokeColor:b,prefixCls:E,direction:O,percentPosition:{align:p,type:C}}),V):(f==="circle"||f==="dashboard")&&(j=l.createElement(ll,Object.assign({},e,{strokeColor:b,prefixCls:E,progressStatus:F}),V));const U=Z(E,`${E}-status-${F}`,{[`${E}-${f==="dashboard"&&"circle"||f}`]:f!=="line",[`${E}-inline-circle`]:f==="circle"&&Mn(u,"circle")[0]<=20,[`${E}-line`]:B,[`${E}-line-align-${p}`]:B,[`${E}-line-position-${C}`]:B,[`${E}-steps`]:a,[`${E}-show-info`]:d,[`${E}-${u}`]:typeof u=="string",[`${E}-rtl`]:O==="rtl"},N==null?void 0:N.className,r,o,T,k);return _(l.createElement("div",Object.assign({ref:n,style:Object.assign(Object.assign({},N==null?void 0:N.style),x),className:U,role:"progressbar","aria-valuenow":y,"aria-valuemin":0,"aria-valuemax":100},xt(c,["trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","success","successPercent"])),j))});var $l={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},Il=function(n,t){return l.createElement(Jt,De({},n,{ref:t,icon:$l}))},Sl=l.forwardRef(Il);const Jn=(function(e,n){if(e&&n){var t=Array.isArray(n)?n:n.split(","),r=e.name||"",o=e.type||"",a=o.replace(/\/.*$/,"");return t.some(function(i){var s=i.trim();if(/^\*(\/\*)?$/.test(i))return!0;if(s.charAt(0)==="."){var u=r.toLowerCase(),d=s.toLowerCase(),f=[d];return(d===".jpg"||d===".jpeg")&&(f=[".jpg",".jpeg"]),f.some(function(m){return u.endsWith(m)})}return/\/\*$/.test(s)?a===s.replace(/\/.*$/,""):o===s?!0:/^\w+$/.test(s)?(Cr(!1,"Upload takes an invalidate 'accept' type '".concat(s,"'.Skip for check.")),!0):!1})}return!0});function El(e,n){var t="cannot ".concat(e.method," ").concat(e.action," ").concat(n.status,"'"),r=new Error(t);return r.status=n.status,r.method=e.method,r.url=e.action,r}function ho(e){var n=e.responseText||e.response;if(!n)return n;try{return JSON.parse(n)}catch{return n}}function vo(e){var n=new XMLHttpRequest;e.onProgress&&n.upload&&(n.upload.onprogress=function(a){a.total>0&&(a.percent=a.loaded/a.total*100),e.onProgress(a)});var t=new FormData;e.data&&Object.keys(e.data).forEach(function(o){var a=e.data[o];if(Array.isArray(a)){a.forEach(function(i){t.append("".concat(o,"[]"),i)});return}t.append(o,a)}),e.file instanceof Blob?t.append(e.filename,e.file,e.file.name):t.append(e.filename,e.file),n.onerror=function(a){e.onError(a)},n.onload=function(){return n.status<200||n.status>=300?e.onError(El(e,n),ho(n)):e.onSuccess(ho(n),n)},n.open(e.method,e.action,!0),e.withCredentials&&"withCredentials"in n&&(n.withCredentials=!0);var r=e.headers||{};return r["X-Requested-With"]!==null&&n.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(r).forEach(function(o){r[o]!==null&&n.setRequestHeader(o,r[o])}),n.send(t),{abort:function(){n.abort()}}}var Fl=(function(){var e=Bt(Qe().mark(function n(t,r){var o,a,i,s,u,d,f,m;return Qe().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:d=function(){return d=Bt(Qe().mark(function c(p){return Qe().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return b.abrupt("return",new Promise(function(I){p.file(function(S){r(S)?(p.fullPath&&!S.webkitRelativePath&&(Object.defineProperties(S,{webkitRelativePath:{writable:!0}}),S.webkitRelativePath=p.fullPath.replace(/^\//,""),Object.defineProperties(S,{webkitRelativePath:{writable:!1}})),I(S)):I(null)})}));case 1:case"end":return b.stop()}},c)})),d.apply(this,arguments)},u=function(c){return d.apply(this,arguments)},s=function(){return s=Bt(Qe().mark(function c(p){var C,b,I,S,y;return Qe().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:C=p.createReader(),b=[];case 2:return D.next=5,new Promise(function(O){C.readEntries(O,function(){return O([])})});case 5:if(I=D.sent,S=I.length,S){D.next=9;break}return D.abrupt("break",12);case 9:for(y=0;y<S;y++)b.push(I[y]);D.next=2;break;case 12:return D.abrupt("return",b);case 13:case"end":return D.stop()}},c)})),s.apply(this,arguments)},i=function(c){return s.apply(this,arguments)},o=[],a=[],t.forEach(function(w){return a.push(w.webkitGetAsEntry())}),f=(function(){var w=Bt(Qe().mark(function c(p,C){var b,I;return Qe().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(p){y.next=2;break}return y.abrupt("return");case 2:if(p.path=C||"",!p.isFile){y.next=10;break}return y.next=6,u(p);case 6:b=y.sent,b&&o.push(b),y.next=15;break;case 10:if(!p.isDirectory){y.next=15;break}return y.next=13,i(p);case 13:I=y.sent,a.push.apply(a,Ye(I));case 15:case"end":return y.stop()}},c)}));return function(p,C){return w.apply(this,arguments)}})(),m=0;case 9:if(!(m<a.length)){x.next=15;break}return x.next=12,f(a[m]);case 12:m++,x.next=9;break;case 15:return x.abrupt("return",o);case 16:case"end":return x.stop()}},n)}));return function(t,r){return e.apply(this,arguments)}})(),Nl=+new Date,Ol=0;function Yn(){return"rc-upload-".concat(Nl,"-").concat(++Ol)}var Dl=["component","prefixCls","className","classNames","disabled","id","name","style","styles","multiple","accept","capture","children","directory","folder","openFileDialogOnClick","onMouseEnter","onMouseLeave","hasControlInside"],Pl=(function(e){xr(t,e);var n=wr(t);function t(){var r;$r(this,t);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=n.call.apply(n,[this].concat(a)),re(Ve(r),"state",{uid:Yn()}),re(Ve(r),"reqs",{}),re(Ve(r),"fileInput",void 0),re(Ve(r),"_isMounted",void 0),re(Ve(r),"onChange",function(s){var u=r.props,d=u.accept,f=u.directory,m=s.target.files,h=Ye(m).filter(function(x){return!f||Jn(x,d)});r.uploadFiles(h),r.reset()}),re(Ve(r),"onClick",function(s){var u=r.fileInput;if(u){var d=s.target,f=r.props.onClick;if(d&&d.tagName==="BUTTON"){var m=u.parentNode;m.focus(),d.blur()}u.click(),f&&f(s)}}),re(Ve(r),"onKeyDown",function(s){s.key==="Enter"&&r.onClick(s)}),re(Ve(r),"onDataTransferFiles",(function(){var s=Bt(Qe().mark(function u(d,f){var m,h,x,w,c,p,C;return Qe().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:if(m=r.props,h=m.multiple,x=m.accept,w=m.directory,c=Ye(d.items||[]),p=Ye(d.files||[]),(p.length>0||c.some(function(S){return S.kind==="file"}))&&(f==null||f()),!w){I.next=11;break}return I.next=7,Fl(Array.prototype.slice.call(c),function(S){return Jn(S,r.props.accept)});case 7:p=I.sent,r.uploadFiles(p),I.next=14;break;case 11:C=Ye(p).filter(function(S){return Jn(S,x)}),h===!1&&(C=p.slice(0,1)),r.uploadFiles(C);case 14:case"end":return I.stop()}},u)}));return function(u,d){return s.apply(this,arguments)}})()),re(Ve(r),"onFilePaste",(function(){var s=Bt(Qe().mark(function u(d){var f,m;return Qe().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(f=r.props.pastable,f){x.next=3;break}return x.abrupt("return");case 3:if(d.type!=="paste"){x.next=6;break}return m=d.clipboardData,x.abrupt("return",r.onDataTransferFiles(m,function(){d.preventDefault()}));case 6:case"end":return x.stop()}},u)}));return function(u){return s.apply(this,arguments)}})()),re(Ve(r),"onFileDragOver",function(s){s.preventDefault()}),re(Ve(r),"onFileDrop",(function(){var s=Bt(Qe().mark(function u(d){var f;return Qe().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(d.preventDefault(),d.type!=="drop"){h.next=4;break}return f=d.dataTransfer,h.abrupt("return",r.onDataTransferFiles(f));case 4:case"end":return h.stop()}},u)}));return function(u){return s.apply(this,arguments)}})()),re(Ve(r),"uploadFiles",function(s){var u=Ye(s),d=u.map(function(f){return f.uid=Yn(),r.processFile(f,u)});Promise.all(d).then(function(f){var m=r.props.onBatchStart;m==null||m(f.map(function(h){var x=h.origin,w=h.parsedFile;return{file:x,parsedFile:w}})),f.filter(function(h){return h.parsedFile!==null}).forEach(function(h){r.post(h)})})}),re(Ve(r),"processFile",(function(){var s=Bt(Qe().mark(function u(d,f){var m,h,x,w,c,p,C,b,I;return Qe().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(m=r.props.beforeUpload,h=d,!m){y.next=14;break}return y.prev=3,y.next=6,m(d,f);case 6:h=y.sent,y.next=12;break;case 9:y.prev=9,y.t0=y.catch(3),h=!1;case 12:if(h!==!1){y.next=14;break}return y.abrupt("return",{origin:d,parsedFile:null,action:null,data:null});case 14:if(x=r.props.action,typeof x!="function"){y.next=21;break}return y.next=18,x(d);case 18:w=y.sent,y.next=22;break;case 21:w=x;case 22:if(c=r.props.data,typeof c!="function"){y.next=29;break}return y.next=26,c(d);case 26:p=y.sent,y.next=30;break;case 29:p=c;case 30:return C=(jt(h)==="object"||typeof h=="string")&&h?h:d,C instanceof File?b=C:b=new File([C],d.name,{type:d.type}),I=b,I.uid=d.uid,y.abrupt("return",{origin:d,data:p,parsedFile:I,action:w});case 35:case"end":return y.stop()}},u,null,[[3,9]])}));return function(u,d){return s.apply(this,arguments)}})()),re(Ve(r),"saveFileInput",function(s){r.fileInput=s}),r}return Ir(t,[{key:"componentDidMount",value:function(){this._isMounted=!0;var o=this.props.pastable;o&&document.addEventListener("paste",this.onFilePaste)}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort(),document.removeEventListener("paste",this.onFilePaste)}},{key:"componentDidUpdate",value:function(o){var a=this.props.pastable;a&&!o.pastable?document.addEventListener("paste",this.onFilePaste):!a&&o.pastable&&document.removeEventListener("paste",this.onFilePaste)}},{key:"post",value:function(o){var a=this,i=o.data,s=o.origin,u=o.action,d=o.parsedFile;if(this._isMounted){var f=this.props,m=f.onStart,h=f.customRequest,x=f.name,w=f.headers,c=f.withCredentials,p=f.method,C=s.uid,b=h||vo,I={action:u,filename:x,data:i,file:d,headers:w,withCredentials:c,method:p||"post",onProgress:function(y){var F=a.props.onProgress;F==null||F(y,d)},onSuccess:function(y,F){var D=a.props.onSuccess;D==null||D(y,d,F),delete a.reqs[C]},onError:function(y,F){var D=a.props.onError;D==null||D(y,F,d),delete a.reqs[C]}};m(s),this.reqs[C]=b(I,{defaultRequest:vo})}}},{key:"reset",value:function(){this.setState({uid:Yn()})}},{key:"abort",value:function(o){var a=this.reqs;if(o){var i=o.uid?o.uid:o;a[i]&&a[i].abort&&a[i].abort(),delete a[i]}else Object.keys(a).forEach(function(s){a[s]&&a[s].abort&&a[s].abort(),delete a[s]})}},{key:"render",value:function(){var o=this.props,a=o.component,i=o.prefixCls,s=o.className,u=o.classNames,d=u===void 0?{}:u,f=o.disabled,m=o.id,h=o.name,x=o.style,w=o.styles,c=w===void 0?{}:w,p=o.multiple,C=o.accept,b=o.capture,I=o.children,S=o.directory,y=o.folder,F=o.openFileDialogOnClick,D=o.onMouseEnter,O=o.onMouseLeave,N=o.hasControlInside,E=ot(o,Dl),_=Z(re(re(re({},i,!0),"".concat(i,"-disabled"),f),s,s)),T=S||y?{directory:"directory",webkitdirectory:"webkitdirectory"}:{},k=f?{}:{onClick:F?this.onClick:function(){},onKeyDown:F?this.onKeyDown:function(){},onMouseEnter:D,onMouseLeave:O,onDrop:this.onFileDrop,onDragOver:this.onFileDragOver,tabIndex:N?void 0:"0"};return Be.createElement(a,De({},k,{className:_,role:N?void 0:"button",style:x}),Be.createElement("input",De({},ni(E,{aria:!0,data:!0}),{id:m,name:h,disabled:f,type:"file",ref:this.saveFileInput,onClick:function(B){return B.stopPropagation()},key:this.state.uid,style:ze({display:"none"},c.input),className:d.input,accept:C},T,{multiple:p,onChange:this.onChange},b!=null?{capture:b}:{})),I)}}]),t})(Ao);function Qn(){}var gr=(function(e){xr(t,e);var n=wr(t);function t(){var r;$r(this,t);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=n.call.apply(n,[this].concat(a)),re(Ve(r),"uploader",void 0),re(Ve(r),"saveUploader",function(s){r.uploader=s}),r}return Ir(t,[{key:"abort",value:function(o){this.uploader.abort(o)}},{key:"render",value:function(){return Be.createElement(Pl,De({},this.props,{ref:this.saveUploader}))}}]),t})(Ao);re(gr,"defaultProps",{component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:Qn,onError:Qn,onSuccess:Qn,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0,hasControlInside:!1});const Al=e=>{const{componentCls:n,iconCls:t}=e;return{[`${n}-wrapper`]:{[`${n}-drag`]:{position:"relative",width:"100%",height:"100%",textAlign:"center",background:e.colorFillAlter,border:`${ne(e.lineWidth)} dashed ${e.colorBorder}`,borderRadius:e.borderRadiusLG,cursor:"pointer",transition:`border-color ${e.motionDurationSlow}`,[n]:{padding:e.padding},[`${n}-btn`]:{display:"table",width:"100%",height:"100%",outline:"none",borderRadius:e.borderRadiusLG,"&:focus-visible":{outline:`${ne(e.lineWidthFocus)} solid ${e.colorPrimaryBorder}`}},[`${n}-drag-container`]:{display:"table-cell",verticalAlign:"middle"},[`
|
|
72
|
+
&${i}-slide-up-leave${i}-slide-up-leave-active${n}-placement-topRight`]:{animationName:Ra}}},za(e,c,{arrowPlacement:{top:!0,bottom:!0}}),{[`${n} ${t}`]:{position:"relative",margin:0},[`${t}-submenu-popup`]:{position:"absolute",zIndex:r,background:"transparent",boxShadow:"none",transformOrigin:"0 0","ul, li":{listStyle:"none",margin:0}},[`${n}, ${n}-menu-submenu`]:Object.assign(Object.assign({},On(e)),{[t]:Object.assign(Object.assign({padding:m,listStyleType:"none",backgroundColor:c,backgroundClip:"padding-box",borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary},Ur(e)),{"&:empty":{padding:0,boxShadow:"none"},[`${t}-item-group-title`]:{padding:`${ne(d)} ${ne(w)}`,color:e.colorTextDescription,transition:`all ${u}`},[`${t}-item`]:{position:"relative",display:"flex",alignItems:"center"},[`${t}-item-icon`]:{minWidth:f,marginInlineEnd:e.marginXS,fontSize:e.fontSizeSM},[`${t}-title-content`]:{flex:"auto","&-with-extra":{display:"inline-flex",alignItems:"center",width:"100%"},"> a":{color:"inherit",transition:`all ${u}`,"&:hover":{color:"inherit"},"&::after":{position:"absolute",inset:0,content:'""'}},[`${t}-item-extra`]:{paddingInlineStart:e.padding,marginInlineStart:"auto",fontSize:e.fontSizeSM,color:e.colorTextDescription}},[`${t}-item, ${t}-submenu-title`]:Object.assign(Object.assign({display:"flex",margin:0,padding:`${ne(d)} ${ne(w)}`,color:e.colorText,fontWeight:"normal",fontSize:f,lineHeight:e.lineHeight,cursor:"pointer",transition:`all ${u}`,borderRadius:e.borderRadiusSM,"&:hover, &-active":{backgroundColor:e.controlItemBgHover}},Ur(e)),{"&-selected":{color:e.colorPrimary,backgroundColor:e.controlItemBgActive,"&:hover, &-active":{backgroundColor:e.controlItemBgActiveHover}},"&-disabled":{color:v,cursor:"not-allowed","&:hover":{color:v,backgroundColor:c,cursor:"not-allowed"},a:{pointerEvents:"none"}},"&-divider":{height:1,margin:`${ne(e.marginXXS)} 0`,overflow:"hidden",lineHeight:0,backgroundColor:e.colorSplit},[`${n}-menu-submenu-expand-icon`]:{position:"absolute",insetInlineEnd:e.paddingXS,[`${n}-menu-submenu-arrow-icon`]:{marginInlineEnd:"0 !important",color:e.colorIcon,fontSize:x,fontStyle:"normal"}}}),[`${t}-item-group-list`]:{margin:`0 ${ne(e.marginXS)}`,padding:0,listStyle:"none"},[`${t}-submenu-title`]:{paddingInlineEnd:e.calc(w).add(e.fontSizeSM).equal()},[`${t}-submenu-vertical`]:{position:"relative"},[`${t}-submenu${t}-submenu-disabled ${n}-menu-submenu-title`]:{[`&, ${n}-menu-submenu-arrow-icon`]:{color:v,backgroundColor:c,cursor:"not-allowed"}},[`${t}-submenu-selected ${n}-menu-submenu-title`]:{color:e.colorPrimary}})})},[wn(e,"slide-up"),wn(e,"slide-down"),qr(e,"move-up"),qr(e,"move-down"),zo(e,"zoom-big")]]},Rs=e=>Object.assign(Object.assign({zIndexPopup:e.zIndexPopupBase+50,paddingBlock:(e.controlHeight-e.fontSize*e.lineHeight)/2},ja({contentRadius:e.borderRadiusLG,limitVerticalRadius:!0})),La(e)),Bs=cn("Dropdown",e=>{const{marginXXS:n,sizePopupArrow:t,paddingXXS:r,componentCls:o}=e,a=sn(e,{menuCls:`${o}-menu`,dropdownArrowDistance:e.calc(t).div(2).add(n).equal(),dropdownEdgeChildPadding:r});return[Ms(a),ks(a)]},Rs,{resetStyle:!1}),kn=e=>{var n;const{menu:t,arrow:r,prefixCls:o,children:a,trigger:i,disabled:s,dropdownRender:u,popupRender:d,getPopupContainer:f,overlayClassName:m,rootClassName:v,overlayStyle:x,open:w,onOpenChange:c,visible:p,onVisibleChange:C,mouseEnterDelay:b=.15,mouseLeaveDelay:I=.1,autoAdjustOverflow:S=!0,placement:y="",overlay:F,transitionName:D,destroyOnHidden:O,destroyPopupOnHide:N}=e,{getPopupContainer:E,getPrefixCls:_,direction:T,dropdown:k}=l.useContext(wt),M=d||u;Ha();const B=l.useMemo(()=>{const me=_();return D!==void 0?D:y.includes("top")?`${me}-slide-down`:`${me}-slide-up`},[_,y,D]),V=l.useMemo(()=>y?y.includes("Center")?y.slice(0,y.indexOf("Center")):y:T==="rtl"?"bottomRight":"bottomLeft",[y,T]),j=_("dropdown",o),U=Lo(j),[K,L,q]=Bs(j,U),[,ee]=qa(),R=l.Children.only(Ti(a)?l.createElement("span",null,a):a),W=Gt(R,{className:Z(`${j}-trigger`,{[`${j}-rtl`]:T==="rtl"},R.props.className),disabled:(n=R.props.disabled)!==null&&n!==void 0?n:s}),J=s?[]:i,oe=!!(J!=null&&J.includes("contextMenu")),[ae,Q]=Lt(!1,{value:w??p}),ie=ar(me=>{c==null||c(me,{source:"trigger"}),C==null||C(me),Q(me)}),Ce=Z(m,v,L,q,U,k==null?void 0:k.className,{[`${j}-rtl`]:T==="rtl"}),xe=Ua({arrowPointAtCenter:typeof r=="object"&&r.pointAtCenter,autoAdjustOverflow:S,offset:ee.marginXXS,arrowWidth:r?ee.sizePopupArrow:0,borderRadius:ee.borderRadius}),we=ar(()=>{t!=null&&t.selectable&&(t!=null&&t.multiple)||(c==null||c(!1,{source:"menu"}),Q(!1))}),Te=()=>{let me;return t!=null&&t.items?me=l.createElement(dn,Object.assign({},t)):typeof F=="function"?me=F():me=F,M&&(me=M(me)),me=l.Children.only(typeof me=="string"?l.createElement("span",null,me):me),l.createElement($s,{prefixCls:`${j}-menu`,rootClassName:Z(q,U),expandIcon:l.createElement("span",{className:`${j}-menu-submenu-arrow`},T==="rtl"?l.createElement(vi,{className:`${j}-menu-submenu-arrow-icon`}):l.createElement(bi,{className:`${j}-menu-submenu-arrow-icon`})),mode:"vertical",selectable:!1,onClick:we,validator:({mode:ct})=>{}},me)},[Je,Le]=jo("Dropdown",x==null?void 0:x.zIndex);let ve=l.createElement(Bi,Object.assign({alignPoint:oe},xt(e,["rootClassName"]),{mouseEnterDelay:b,mouseLeaveDelay:I,visible:ae,builtinPlacements:xe,arrow:!!r,overlayClassName:Ce,prefixCls:j,getPopupContainer:f||E,transitionName:B,trigger:J,overlay:Te,placement:V,onVisibleChange:ie,overlayStyle:Object.assign(Object.assign(Object.assign({},k==null?void 0:k.style),x),{zIndex:Je}),autoDestroy:O??N}),W);return Je&&(ve=l.createElement(Wa.Provider,{value:Le},ve)),K(ve)},Ts=Va(kn,"align",void 0,"dropdown",e=>e),_s=e=>l.createElement(Ts,Object.assign({},e),l.createElement("span",null));kn._InternalPanelDoNotUseOrYouWillBeFired=_s;function lo(e){return["small","middle","large"].includes(e)}function co(e){return e?typeof e=="number"&&!Number.isNaN(e):!1}const ma=Be.createContext({latestIndex:0}),zs=ma.Provider,js=({className:e,index:n,children:t,split:r,style:o})=>{const{latestIndex:a}=l.useContext(ma);return t==null?null:l.createElement(l.Fragment,null,l.createElement("div",{className:e,style:o},t),n<a&&r&&l.createElement("span",{className:`${e}-split`},r))};var Ls=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t};const Hs=l.forwardRef((e,n)=>{var t;const{getPrefixCls:r,direction:o,size:a,className:i,style:s,classNames:u,styles:d}=Or("space"),{size:f=a??"small",align:m,className:v,rootClassName:x,children:w,direction:c="horizontal",prefixCls:p,split:C,style:b,wrap:I=!1,classNames:S,styles:y}=e,F=Ls(e,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[D,O]=Array.isArray(f)?f:[f,f],N=lo(O),E=lo(D),_=co(O),T=co(D),k=Sr(w,{keepEmpty:!0}),M=m===void 0&&c==="horizontal"?"center":m,B=r("space",p),[V,j,U]=Ka(B),K=Z(B,i,j,`${B}-${c}`,{[`${B}-rtl`]:o==="rtl",[`${B}-align-${M}`]:M,[`${B}-gap-row-${O}`]:N,[`${B}-gap-col-${D}`]:E},v,x,U),L=Z(`${B}-item`,(t=S==null?void 0:S.item)!==null&&t!==void 0?t:u.item),q=Object.assign(Object.assign({},d.item),y==null?void 0:y.item),ee=k.map((J,oe)=>{const ae=(J==null?void 0:J.key)||`${L}-${oe}`;return l.createElement(js,{className:L,key:ae,index:oe,split:C,style:q},J)}),R=l.useMemo(()=>({latestIndex:k.reduce((oe,ae,Q)=>ae!=null?Q:oe,0)}),[k]);if(k.length===0)return null;const W={};return I&&(W.flexWrap="wrap"),!E&&T&&(W.columnGap=D),!N&&_&&(W.rowGap=O),V(l.createElement("div",Object.assign({ref:n,className:K,style:Object.assign(Object.assign(Object.assign({},W),s),b)},F),l.createElement(zs,{value:R},ee)))}),fa=Hs;fa.Compact=Xa;var qs=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t};const ga=e=>{const{getPopupContainer:n,getPrefixCls:t,direction:r}=l.useContext(wt),{prefixCls:o,type:a="default",danger:i,disabled:s,loading:u,onClick:d,htmlType:f,children:m,className:v,menu:x,arrow:w,autoFocus:c,overlay:p,trigger:C,align:b,open:I,onOpenChange:S,placement:y,getPopupContainer:F,href:D,icon:O=l.createElement(ca,null),title:N,buttonsRender:E=xe=>xe,mouseEnterDelay:_,mouseLeaveDelay:T,overlayClassName:k,overlayStyle:M,destroyOnHidden:B,destroyPopupOnHide:V,dropdownRender:j,popupRender:U}=e,K=qs(e,["prefixCls","type","danger","disabled","loading","onClick","htmlType","children","className","menu","arrow","autoFocus","overlay","trigger","align","open","onOpenChange","placement","getPopupContainer","href","icon","title","buttonsRender","mouseEnterDelay","mouseLeaveDelay","overlayClassName","overlayStyle","destroyOnHidden","destroyPopupOnHide","dropdownRender","popupRender"]),L=t("dropdown",o),q=`${L}-button`,R={menu:x,arrow:w,autoFocus:c,align:b,disabled:s,trigger:s?[]:C,onOpenChange:S,getPopupContainer:F||n,mouseEnterDelay:_,mouseLeaveDelay:T,overlayClassName:k,overlayStyle:M,destroyOnHidden:B,popupRender:U||j},{compactSize:W,compactItemClassnames:J}=Ga(L,r),oe=Z(q,J,v);"destroyPopupOnHide"in e&&(R.destroyPopupOnHide=V),"overlay"in e&&(R.overlay=p),"open"in e&&(R.open=I),"placement"in e?R.placement=y:R.placement=r==="rtl"?"bottomLeft":"bottomRight";const ae=l.createElement(pt,{type:a,danger:i,disabled:s,loading:u,onClick:d,htmlType:f,href:D,title:N},m),Q=l.createElement(pt,{type:a,danger:i,icon:O}),[ie,Ce]=E([ae,Q]);return l.createElement(fa.Compact,Object.assign({className:oe,size:W,block:!0},K),ie,l.createElement(kn,Object.assign({},R),Ce))};ga.__ANT_BUTTON=!0;const ha=kn;ha.Button=ga;const Us=e=>{const{componentCls:n,iconCls:t,antCls:r,zIndexPopup:o,colorText:a,colorWarning:i,marginXXS:s,marginXS:u,fontSize:d,fontWeightStrong:f,colorTextHeading:m}=e;return{[n]:{zIndex:o,[`&${r}-popover`]:{fontSize:d},[`${n}-message`]:{marginBottom:u,display:"flex",flexWrap:"nowrap",alignItems:"start",[`> ${n}-message-icon ${t}`]:{color:i,fontSize:d,lineHeight:1,marginInlineEnd:u},[`${n}-title`]:{fontWeight:f,color:m,"&:only-child":{fontWeight:"normal"}},[`${n}-description`]:{marginTop:s,color:a}},[`${n}-buttons`]:{textAlign:"end",whiteSpace:"nowrap",button:{marginInlineStart:u}}}}},Ws=e=>{const{zIndexPopupBase:n}=e;return{zIndexPopup:n+60}},va=cn("Popconfirm",e=>Us(e),Ws,{resetStyle:!1});var Vs=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t};const ba=e=>{const{prefixCls:n,okButtonProps:t,cancelButtonProps:r,title:o,description:a,cancelText:i,okText:s,okType:u="primary",icon:d=l.createElement(qo,null),showCancel:f=!0,close:m,onConfirm:v,onCancel:x,onPopupClick:w}=e,{getPrefixCls:c}=l.useContext(wt),[p]=Uo("Popconfirm",Wo.Popconfirm),C=Jr(o),b=Jr(a);return l.createElement("div",{className:`${n}-inner-content`,onClick:w},l.createElement("div",{className:`${n}-message`},d&&l.createElement("span",{className:`${n}-message-icon`},d),l.createElement("div",{className:`${n}-message-text`},C&&l.createElement("div",{className:`${n}-title`},C),b&&l.createElement("div",{className:`${n}-description`},b))),l.createElement("div",{className:`${n}-buttons`},f&&l.createElement(pt,Object.assign({onClick:x,size:"small"},r),i||(p==null?void 0:p.cancelText)),l.createElement(yi,{buttonProps:Object.assign(Object.assign({size:"small"},Ja(u)),t),actionFn:v,close:m,prefixCls:c("btn"),quitOnNullishReturnValue:!0,emitEvent:!0},s||(p==null?void 0:p.okText))))},Ks=e=>{const{prefixCls:n,placement:t,className:r,style:o}=e,a=Vs(e,["prefixCls","placement","className","style"]),{getPrefixCls:i}=l.useContext(wt),s=i("popconfirm",n),[u]=va(s);return u(l.createElement(xi,{placement:t,className:Z(s,r),style:o,content:l.createElement(ba,Object.assign({prefixCls:s},a))}))};var Xs=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t};const Gs=l.forwardRef((e,n)=>{var t,r;const{prefixCls:o,placement:a="top",trigger:i="click",okType:s="primary",icon:u=l.createElement(qo,null),children:d,overlayClassName:f,onOpenChange:m,onVisibleChange:v,overlayStyle:x,styles:w,classNames:c}=e,p=Xs(e,["prefixCls","placement","trigger","okType","icon","children","overlayClassName","onOpenChange","onVisibleChange","overlayStyle","styles","classNames"]),{getPrefixCls:C,className:b,style:I,classNames:S,styles:y}=Or("popconfirm"),[F,D]=Lt(!1,{value:(t=e.open)!==null&&t!==void 0?t:e.visible,defaultValue:(r=e.defaultOpen)!==null&&r!==void 0?r:e.defaultVisible}),O=(j,U)=>{D(j,!0),v==null||v(j),m==null||m(j,U)},N=j=>{O(!1,j)},E=j=>{var U;return(U=e.onConfirm)===null||U===void 0?void 0:U.call(void 0,j)},_=j=>{var U;O(!1,j),(U=e.onCancel)===null||U===void 0||U.call(void 0,j)},T=(j,U)=>{const{disabled:K=!1}=e;K||O(j,U)},k=C("popconfirm",o),M=Z(k,b,f,S.root,c==null?void 0:c.root),B=Z(S.body,c==null?void 0:c.body),[V]=va(k);return V(l.createElement(Go,Object.assign({},xt(p,["title"]),{trigger:i,placement:a,onOpenChange:T,open:F,ref:n,classNames:{root:M,body:B},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},y.root),I),x),w==null?void 0:w.root),body:Object.assign(Object.assign({},y.body),w==null?void 0:w.body)},content:l.createElement(ba,Object.assign({okType:s,icon:u},e,{prefixCls:k,close:N,onConfirm:E,onCancel:_})),"data-popover-inject":!0}),d))}),ya=Gs;ya._InternalPanelDoNotUseOrYouWillBeFired=Ks;var Js={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},Ys=function(){var n=Xe([]),t=Xe(null);return je(function(){var r=Date.now(),o=!1;n.current.forEach(function(a){if(a){o=!0;var i=a.style;i.transitionDuration=".3s, .3s, .3s, .06s",t.current&&r-t.current<100&&(i.transitionDuration="0s, 0s")}}),o&&(t.current=Date.now())}),n.current},uo=0,Qs=Ya();function Zs(){var e;return Qs?(e=uo,uo+=1):e="TEST_OR_SSR",e}const el=(function(e){var n=l.useState(),t=Ke(n,2),r=t[0],o=t[1];return l.useEffect(function(){o("rc_progress_".concat(Zs()))},[]),e||r});var po=function(n){var t=n.bg,r=n.children;return l.createElement("div",{style:{width:"100%",height:"100%",background:t}},r)};function mo(e,n){return Object.keys(e).map(function(t){var r=parseFloat(t),o="".concat(Math.floor(r*n),"%");return"".concat(e[t]," ").concat(o)})}var tl=l.forwardRef(function(e,n){var t=e.prefixCls,r=e.color,o=e.gradientId,a=e.radius,i=e.style,s=e.ptg,u=e.strokeLinecap,d=e.strokeWidth,f=e.size,m=e.gapDegree,v=r&&jt(r)==="object",x=v?"#FFF":void 0,w=f/2,c=l.createElement("circle",{className:"".concat(t,"-circle-path"),r:a,cx:w,cy:w,stroke:x,strokeLinecap:u,strokeWidth:d,opacity:s===0?0:1,style:i,ref:n});if(!v)return c;var p="".concat(o,"-conic"),C=m?"".concat(180+m/2,"deg"):"0deg",b=mo(r,(360-m)/360),I=mo(r,1),S="conic-gradient(from ".concat(C,", ").concat(b.join(", "),")"),y="linear-gradient(to ".concat(m?"bottom":"top",", ").concat(I.join(", "),")");return l.createElement(l.Fragment,null,l.createElement("mask",{id:p},c),l.createElement("foreignObject",{x:0,y:0,width:f,height:f,mask:"url(#".concat(p,")")},l.createElement(po,{bg:y},l.createElement(po,{bg:S}))))}),rn=100,Gn=function(n,t,r,o,a,i,s,u,d,f){var m=arguments.length>10&&arguments[10]!==void 0?arguments[10]:0,v=r/100*360*((360-i)/360),x=i===0?0:{bottom:0,top:180,left:90,right:-90}[s],w=(100-o)/100*t;d==="round"&&o!==100&&(w+=f/2,w>=t&&(w=t-.01));var c=rn/2;return{stroke:typeof u=="string"?u:void 0,strokeDasharray:"".concat(t,"px ").concat(n),strokeDashoffset:w+m,transform:"rotate(".concat(a+v+x,"deg)"),transformOrigin:"".concat(c,"px ").concat(c,"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},nl=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function fo(e){var n=e??[];return Array.isArray(n)?n:[n]}var rl=function(n){var t=ze(ze({},Js),n),r=t.id,o=t.prefixCls,a=t.steps,i=t.strokeWidth,s=t.trailWidth,u=t.gapDegree,d=u===void 0?0:u,f=t.gapPosition,m=t.trailColor,v=t.strokeLinecap,x=t.style,w=t.className,c=t.strokeColor,p=t.percent,C=ot(t,nl),b=rn/2,I=el(r),S="".concat(I,"-gradient"),y=b-i/2,F=Math.PI*2*y,D=d>0?90+d/2:-90,O=F*((360-d)/360),N=jt(a)==="object"?a:{count:a,gap:2},E=N.count,_=N.gap,T=fo(p),k=fo(c),M=k.find(function(q){return q&&jt(q)==="object"}),B=M&&jt(M)==="object",V=B?"butt":v,j=Gn(F,O,0,100,D,d,f,m,V,i),U=Ys(),K=function(){var ee=0;return T.map(function(R,W){var J=k[W]||k[k.length-1],oe=Gn(F,O,ee,R,D,d,f,J,V,i);return ee+=R,l.createElement(tl,{key:W,color:J,ptg:R,radius:y,prefixCls:o,gradientId:S,style:oe,strokeLinecap:V,strokeWidth:i,gapDegree:d,ref:function(Q){U[W]=Q},size:rn})}).reverse()},L=function(){var ee=Math.round(E*(T[0]/100)),R=100/E,W=0;return new Array(E).fill(null).map(function(J,oe){var ae=oe<=ee-1?k[0]:m,Q=ae&&jt(ae)==="object"?"url(#".concat(S,")"):void 0,ie=Gn(F,O,W,R,D,d,f,ae,"butt",i,_);return W+=(O-ie.strokeDashoffset+_)*100/O,l.createElement("circle",{key:oe,className:"".concat(o,"-circle-path"),r:y,cx:b,cy:b,stroke:Q,strokeWidth:i,opacity:1,style:ie,ref:function(xe){U[oe]=xe}})})};return l.createElement("svg",De({className:Z("".concat(o,"-circle"),w),viewBox:"0 0 ".concat(rn," ").concat(rn),style:x,id:r,role:"presentation"},C),!E&&l.createElement("circle",{className:"".concat(o,"-circle-trail"),r:y,cx:b,cy:b,stroke:m,strokeLinecap:V,strokeWidth:s||i,style:j}),E?L():K())};function Tt(e){return!e||e<0?0:e>100?100:e}function Fn({success:e,successPercent:n}){let t=n;return e&&"progress"in e&&(t=e.progress),e&&"percent"in e&&(t=e.percent),t}const ol=({percent:e,success:n,successPercent:t})=>{const r=Tt(Fn({success:n,successPercent:t}));return[r,Tt(Tt(e)-r)]},al=({success:e={},strokeColor:n})=>{const{strokeColor:t}=e;return[t||ir.green,n||null]},Mn=(e,n,t)=>{var r,o,a,i;let s=-1,u=-1;if(n==="step"){const d=t.steps,f=t.strokeWidth;typeof e=="string"||typeof e>"u"?(s=e==="small"?2:14,u=f??8):typeof e=="number"?[s,u]=[e,e]:[s=14,u=8]=Array.isArray(e)?e:[e.width,e.height],s*=d}else if(n==="line"){const d=t==null?void 0:t.strokeWidth;typeof e=="string"||typeof e>"u"?u=d||(e==="small"?6:8):typeof e=="number"?[s,u]=[e,e]:[s=-1,u=8]=Array.isArray(e)?e:[e.width,e.height]}else(n==="circle"||n==="dashboard")&&(typeof e=="string"||typeof e>"u"?[s,u]=e==="small"?[60,60]:[120,120]:typeof e=="number"?[s,u]=[e,e]:Array.isArray(e)&&(s=(o=(r=e[0])!==null&&r!==void 0?r:e[1])!==null&&o!==void 0?o:120,u=(i=(a=e[0])!==null&&a!==void 0?a:e[1])!==null&&i!==void 0?i:120));return[s,u]},il=3,sl=e=>il/e*100,ll=e=>{const{prefixCls:n,trailColor:t=null,strokeLinecap:r="round",gapPosition:o,gapDegree:a,width:i=120,type:s,children:u,success:d,size:f=i,steps:m}=e,[v,x]=Mn(f,"circle");let{strokeWidth:w}=e;w===void 0&&(w=Math.max(sl(v),6));const c={width:v,height:x,fontSize:v*.15+6},p=l.useMemo(()=>{if(a||a===0)return a;if(s==="dashboard")return 75},[a,s]),C=ol(e),b=o||s==="dashboard"&&"bottom"||void 0,I=Object.prototype.toString.call(e.strokeColor)==="[object Object]",S=al({success:d,strokeColor:e.strokeColor}),y=Z(`${n}-inner`,{[`${n}-circle-gradient`]:I}),F=l.createElement(rl,{steps:m,percent:m?C[1]:C,strokeWidth:w,trailWidth:w,strokeColor:m?S[1]:S,strokeLinecap:r,trailColor:t,prefixCls:n,gapDegree:p,gapPosition:b}),D=v<=20,O=l.createElement("div",{className:y,style:c},F,!D&&u);return D?l.createElement(Fr,{title:u},O):O},Nn="--progress-line-stroke-color",Ca="--progress-percent",go=e=>{const n=e?"100%":"-100%";return new sr(`antProgress${e?"RTL":"LTR"}Active`,{"0%":{transform:`translateX(${n}) scaleX(0)`,opacity:.1},"20%":{transform:`translateX(${n}) scaleX(0)`,opacity:.5},to:{transform:"translateX(0) scaleX(1)",opacity:0}})},cl=e=>{const{componentCls:n,iconCls:t}=e;return{[n]:Object.assign(Object.assign({},On(e)),{display:"inline-block","&-rtl":{direction:"rtl"},"&-line":{position:"relative",width:"100%",fontSize:e.fontSize},[`${n}-outer`]:{display:"inline-flex",alignItems:"center",width:"100%"},[`${n}-inner`]:{position:"relative",display:"inline-block",width:"100%",flex:1,overflow:"hidden",verticalAlign:"middle",backgroundColor:e.remainingColor,borderRadius:e.lineBorderRadius},[`${n}-inner:not(${n}-circle-gradient)`]:{[`${n}-circle-path`]:{stroke:e.defaultColor}},[`${n}-success-bg, ${n}-bg`]:{position:"relative",background:e.defaultColor,borderRadius:e.lineBorderRadius,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`},[`${n}-layout-bottom`]:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",[`${n}-text`]:{width:"max-content",marginInlineStart:0,marginTop:e.marginXXS}},[`${n}-bg`]:{overflow:"hidden","&::after":{content:'""',background:{_multi_value_:!0,value:["inherit",`var(${Nn})`]},height:"100%",width:`calc(1 / var(${Ca}) * 100%)`,display:"block"},[`&${n}-bg-inner`]:{minWidth:"max-content","&::after":{content:"none"},[`${n}-text-inner`]:{color:e.colorWhite,[`&${n}-text-bright`]:{color:"rgba(0, 0, 0, 0.45)"}}}},[`${n}-success-bg`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,backgroundColor:e.colorSuccess},[`${n}-text`]:{display:"inline-block",marginInlineStart:e.marginXS,color:e.colorText,lineHeight:1,width:"2em",whiteSpace:"nowrap",textAlign:"start",verticalAlign:"middle",wordBreak:"normal",[t]:{fontSize:e.fontSize},[`&${n}-text-outer`]:{width:"max-content"},[`&${n}-text-outer${n}-text-start`]:{width:"max-content",marginInlineStart:0,marginInlineEnd:e.marginXS}},[`${n}-text-inner`]:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%",marginInlineStart:0,padding:`0 ${ne(e.paddingXXS)}`,[`&${n}-text-start`]:{justifyContent:"start"},[`&${n}-text-end`]:{justifyContent:"end"}},[`&${n}-status-active`]:{[`${n}-bg::before`]:{position:"absolute",inset:0,backgroundColor:e.colorBgContainer,borderRadius:e.lineBorderRadius,opacity:0,animationName:go(),animationDuration:e.progressActiveMotionDuration,animationTimingFunction:e.motionEaseOutQuint,animationIterationCount:"infinite",content:'""'}},[`&${n}-rtl${n}-status-active`]:{[`${n}-bg::before`]:{animationName:go(!0)}},[`&${n}-status-exception`]:{[`${n}-bg`]:{backgroundColor:e.colorError},[`${n}-text`]:{color:e.colorError}},[`&${n}-status-exception ${n}-inner:not(${n}-circle-gradient)`]:{[`${n}-circle-path`]:{stroke:e.colorError}},[`&${n}-status-success`]:{[`${n}-bg`]:{backgroundColor:e.colorSuccess},[`${n}-text`]:{color:e.colorSuccess}},[`&${n}-status-success ${n}-inner:not(${n}-circle-gradient)`]:{[`${n}-circle-path`]:{stroke:e.colorSuccess}}})}},ul=e=>{const{componentCls:n,iconCls:t}=e;return{[n]:{[`${n}-circle-trail`]:{stroke:e.remainingColor},[`&${n}-circle ${n}-inner`]:{position:"relative",lineHeight:1,backgroundColor:"transparent"},[`&${n}-circle ${n}-text`]:{position:"absolute",insetBlockStart:"50%",insetInlineStart:0,width:"100%",margin:0,padding:0,color:e.circleTextColor,fontSize:e.circleTextFontSize,lineHeight:1,whiteSpace:"normal",textAlign:"center",transform:"translateY(-50%)",[t]:{fontSize:e.circleIconFontSize}},[`${n}-circle&-status-exception`]:{[`${n}-text`]:{color:e.colorError}},[`${n}-circle&-status-success`]:{[`${n}-text`]:{color:e.colorSuccess}}},[`${n}-inline-circle`]:{lineHeight:1,[`${n}-inner`]:{verticalAlign:"bottom"}}}},dl=e=>{const{componentCls:n}=e;return{[n]:{[`${n}-steps`]:{display:"inline-block","&-outer":{display:"flex",flexDirection:"row",alignItems:"center"},"&-item":{flexShrink:0,minWidth:e.progressStepMinWidth,marginInlineEnd:e.progressStepMarginInlineEnd,backgroundColor:e.remainingColor,transition:`all ${e.motionDurationSlow}`,"&-active":{backgroundColor:e.defaultColor}}}}}},pl=e=>{const{componentCls:n,iconCls:t}=e;return{[n]:{[`${n}-small&-line, ${n}-small&-line ${n}-text ${t}`]:{fontSize:e.fontSizeSM}}}},ml=e=>({circleTextColor:e.colorText,defaultColor:e.colorInfo,remainingColor:e.colorFillSecondary,lineBorderRadius:100,circleTextFontSize:"1em",circleIconFontSize:`${e.fontSize/e.fontSizeSM}em`}),fl=cn("Progress",e=>{const n=e.calc(e.marginXXS).div(2).equal(),t=sn(e,{progressStepMarginInlineEnd:n,progressStepMinWidth:n,progressActiveMotionDuration:"2.4s"});return[cl(t),ul(t),dl(t),pl(t)]},ml);var gl=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t};const hl=e=>{let n=[];return Object.keys(e).forEach(t=>{const r=Number.parseFloat(t.replace(/%/g,""));Number.isNaN(r)||n.push({key:r,value:e[t]})}),n=n.sort((t,r)=>t.key-r.key),n.map(({key:t,value:r})=>`${r} ${t}%`).join(", ")},vl=(e,n)=>{const{from:t=ir.blue,to:r=ir.blue,direction:o=n==="rtl"?"to left":"to right"}=e,a=gl(e,["from","to","direction"]);if(Object.keys(a).length!==0){const s=hl(a),u=`linear-gradient(${o}, ${s})`;return{background:u,[Nn]:u}}const i=`linear-gradient(${o}, ${t}, ${r})`;return{background:i,[Nn]:i}},bl=e=>{const{prefixCls:n,direction:t,percent:r,size:o,strokeWidth:a,strokeColor:i,strokeLinecap:s="round",children:u,trailColor:d=null,percentPosition:f,success:m}=e,{align:v,type:x}=f,w=i&&typeof i!="string"?vl(i,t):{[Nn]:i,background:i},c=s==="square"||s==="butt"?0:void 0,p=o??[-1,a||(o==="small"?6:8)],[C,b]=Mn(p,"line",{strokeWidth:a}),I={backgroundColor:d||void 0,borderRadius:c},S=Object.assign(Object.assign({width:`${Tt(r)}%`,height:b,borderRadius:c},w),{[Ca]:Tt(r)/100}),y=Fn(e),F={width:`${Tt(y)}%`,height:b,borderRadius:c,backgroundColor:m==null?void 0:m.strokeColor},D={width:C<0?"100%":C},O=l.createElement("div",{className:`${n}-inner`,style:I},l.createElement("div",{className:Z(`${n}-bg`,`${n}-bg-${x}`),style:S},x==="inner"&&u),y!==void 0&&l.createElement("div",{className:`${n}-success-bg`,style:F})),N=x==="outer"&&v==="start",E=x==="outer"&&v==="end";return x==="outer"&&v==="center"?l.createElement("div",{className:`${n}-layout-bottom`},O,u):l.createElement("div",{className:`${n}-outer`,style:D},N&&u,O,E&&u)},yl=e=>{const{size:n,steps:t,rounding:r=Math.round,percent:o=0,strokeWidth:a=8,strokeColor:i,trailColor:s=null,prefixCls:u,children:d}=e,f=r(t*(o/100)),v=n??[n==="small"?2:14,a],[x,w]=Mn(v,"step",{steps:t,strokeWidth:a}),c=x/t,p=Array.from({length:t});for(let C=0;C<t;C++){const b=Array.isArray(i)?i[C]:i;p[C]=l.createElement("div",{key:C,className:Z(`${u}-steps-item`,{[`${u}-steps-item-active`]:C<=f-1}),style:{backgroundColor:C<=f-1?b:s,width:c,height:w}})}return l.createElement("div",{className:`${u}-steps-outer`},p,d)};var Cl=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t};const xl=["normal","exception","active","success"],wl=l.forwardRef((e,n)=>{const{prefixCls:t,className:r,rootClassName:o,steps:a,strokeColor:i,percent:s=0,size:u="default",showInfo:d=!0,type:f="line",status:m,format:v,style:x,percentPosition:w={}}=e,c=Cl(e,["prefixCls","className","rootClassName","steps","strokeColor","percent","size","showInfo","type","status","format","style","percentPosition"]),{align:p="end",type:C="outer"}=w,b=Array.isArray(i)?i[0]:i,I=typeof i=="string"||Array.isArray(i)?i:void 0,S=l.useMemo(()=>{if(b){const K=typeof b=="string"?b:Object.values(b)[0];return new or(K).isLight()}return!1},[i]),y=l.useMemo(()=>{var K,L;const q=Fn(e);return Number.parseInt(q!==void 0?(K=q??0)===null||K===void 0?void 0:K.toString():(L=s??0)===null||L===void 0?void 0:L.toString(),10)},[s,e.success,e.successPercent]),F=l.useMemo(()=>!xl.includes(m)&&y>=100?"success":m||"normal",[m,y]),{getPrefixCls:D,direction:O,progress:N}=l.useContext(wt),E=D("progress",t),[_,T,k]=fl(E),M=f==="line",B=M&&!a,V=l.useMemo(()=>{if(!d)return null;const K=Fn(e);let L;const q=v||(R=>`${R}%`),ee=M&&S&&C==="inner";return C==="inner"||v||F!=="exception"&&F!=="success"?L=q(Tt(s),Tt(K)):F==="exception"?L=M?l.createElement(Qa,null):l.createElement(Za,null):F==="success"&&(L=M?l.createElement(ei,null):l.createElement(ti,null)),l.createElement("span",{className:Z(`${E}-text`,{[`${E}-text-bright`]:ee,[`${E}-text-${p}`]:B,[`${E}-text-${C}`]:B}),title:typeof L=="string"?L:void 0},L)},[d,s,y,F,f,E,v]);let j;f==="line"?j=a?l.createElement(yl,Object.assign({},e,{strokeColor:I,prefixCls:E,steps:typeof a=="object"?a.count:a}),V):l.createElement(bl,Object.assign({},e,{strokeColor:b,prefixCls:E,direction:O,percentPosition:{align:p,type:C}}),V):(f==="circle"||f==="dashboard")&&(j=l.createElement(ll,Object.assign({},e,{strokeColor:b,prefixCls:E,progressStatus:F}),V));const U=Z(E,`${E}-status-${F}`,{[`${E}-${f==="dashboard"&&"circle"||f}`]:f!=="line",[`${E}-inline-circle`]:f==="circle"&&Mn(u,"circle")[0]<=20,[`${E}-line`]:B,[`${E}-line-align-${p}`]:B,[`${E}-line-position-${C}`]:B,[`${E}-steps`]:a,[`${E}-show-info`]:d,[`${E}-${u}`]:typeof u=="string",[`${E}-rtl`]:O==="rtl"},N==null?void 0:N.className,r,o,T,k);return _(l.createElement("div",Object.assign({ref:n,style:Object.assign(Object.assign({},N==null?void 0:N.style),x),className:U,role:"progressbar","aria-valuenow":y,"aria-valuemin":0,"aria-valuemax":100},xt(c,["trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","success","successPercent"])),j))});var $l={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},Il=function(n,t){return l.createElement(Jt,De({},n,{ref:t,icon:$l}))},Sl=l.forwardRef(Il);const Jn=(function(e,n){if(e&&n){var t=Array.isArray(n)?n:n.split(","),r=e.name||"",o=e.type||"",a=o.replace(/\/.*$/,"");return t.some(function(i){var s=i.trim();if(/^\*(\/\*)?$/.test(i))return!0;if(s.charAt(0)==="."){var u=r.toLowerCase(),d=s.toLowerCase(),f=[d];return(d===".jpg"||d===".jpeg")&&(f=[".jpg",".jpeg"]),f.some(function(m){return u.endsWith(m)})}return/\/\*$/.test(s)?a===s.replace(/\/.*$/,""):o===s?!0:/^\w+$/.test(s)?(Cr(!1,"Upload takes an invalidate 'accept' type '".concat(s,"'.Skip for check.")),!0):!1})}return!0});function El(e,n){var t="cannot ".concat(e.method," ").concat(e.action," ").concat(n.status,"'"),r=new Error(t);return r.status=n.status,r.method=e.method,r.url=e.action,r}function ho(e){var n=e.responseText||e.response;if(!n)return n;try{return JSON.parse(n)}catch{return n}}function vo(e){var n=new XMLHttpRequest;e.onProgress&&n.upload&&(n.upload.onprogress=function(a){a.total>0&&(a.percent=a.loaded/a.total*100),e.onProgress(a)});var t=new FormData;e.data&&Object.keys(e.data).forEach(function(o){var a=e.data[o];if(Array.isArray(a)){a.forEach(function(i){t.append("".concat(o,"[]"),i)});return}t.append(o,a)}),e.file instanceof Blob?t.append(e.filename,e.file,e.file.name):t.append(e.filename,e.file),n.onerror=function(a){e.onError(a)},n.onload=function(){return n.status<200||n.status>=300?e.onError(El(e,n),ho(n)):e.onSuccess(ho(n),n)},n.open(e.method,e.action,!0),e.withCredentials&&"withCredentials"in n&&(n.withCredentials=!0);var r=e.headers||{};return r["X-Requested-With"]!==null&&n.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(r).forEach(function(o){r[o]!==null&&n.setRequestHeader(o,r[o])}),n.send(t),{abort:function(){n.abort()}}}var Fl=(function(){var e=Bt(Qe().mark(function n(t,r){var o,a,i,s,u,d,f,m;return Qe().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:d=function(){return d=Bt(Qe().mark(function c(p){return Qe().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return b.abrupt("return",new Promise(function(I){p.file(function(S){r(S)?(p.fullPath&&!S.webkitRelativePath&&(Object.defineProperties(S,{webkitRelativePath:{writable:!0}}),S.webkitRelativePath=p.fullPath.replace(/^\//,""),Object.defineProperties(S,{webkitRelativePath:{writable:!1}})),I(S)):I(null)})}));case 1:case"end":return b.stop()}},c)})),d.apply(this,arguments)},u=function(c){return d.apply(this,arguments)},s=function(){return s=Bt(Qe().mark(function c(p){var C,b,I,S,y;return Qe().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:C=p.createReader(),b=[];case 2:return D.next=5,new Promise(function(O){C.readEntries(O,function(){return O([])})});case 5:if(I=D.sent,S=I.length,S){D.next=9;break}return D.abrupt("break",12);case 9:for(y=0;y<S;y++)b.push(I[y]);D.next=2;break;case 12:return D.abrupt("return",b);case 13:case"end":return D.stop()}},c)})),s.apply(this,arguments)},i=function(c){return s.apply(this,arguments)},o=[],a=[],t.forEach(function(w){return a.push(w.webkitGetAsEntry())}),f=(function(){var w=Bt(Qe().mark(function c(p,C){var b,I;return Qe().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(p){y.next=2;break}return y.abrupt("return");case 2:if(p.path=C||"",!p.isFile){y.next=10;break}return y.next=6,u(p);case 6:b=y.sent,b&&o.push(b),y.next=15;break;case 10:if(!p.isDirectory){y.next=15;break}return y.next=13,i(p);case 13:I=y.sent,a.push.apply(a,Ye(I));case 15:case"end":return y.stop()}},c)}));return function(p,C){return w.apply(this,arguments)}})(),m=0;case 9:if(!(m<a.length)){x.next=15;break}return x.next=12,f(a[m]);case 12:m++,x.next=9;break;case 15:return x.abrupt("return",o);case 16:case"end":return x.stop()}},n)}));return function(t,r){return e.apply(this,arguments)}})(),Nl=+new Date,Ol=0;function Yn(){return"rc-upload-".concat(Nl,"-").concat(++Ol)}var Dl=["component","prefixCls","className","classNames","disabled","id","name","style","styles","multiple","accept","capture","children","directory","folder","openFileDialogOnClick","onMouseEnter","onMouseLeave","hasControlInside"],Pl=(function(e){xr(t,e);var n=wr(t);function t(){var r;$r(this,t);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=n.call.apply(n,[this].concat(a)),re(Ve(r),"state",{uid:Yn()}),re(Ve(r),"reqs",{}),re(Ve(r),"fileInput",void 0),re(Ve(r),"_isMounted",void 0),re(Ve(r),"onChange",function(s){var u=r.props,d=u.accept,f=u.directory,m=s.target.files,v=Ye(m).filter(function(x){return!f||Jn(x,d)});r.uploadFiles(v),r.reset()}),re(Ve(r),"onClick",function(s){var u=r.fileInput;if(u){var d=s.target,f=r.props.onClick;if(d&&d.tagName==="BUTTON"){var m=u.parentNode;m.focus(),d.blur()}u.click(),f&&f(s)}}),re(Ve(r),"onKeyDown",function(s){s.key==="Enter"&&r.onClick(s)}),re(Ve(r),"onDataTransferFiles",(function(){var s=Bt(Qe().mark(function u(d,f){var m,v,x,w,c,p,C;return Qe().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:if(m=r.props,v=m.multiple,x=m.accept,w=m.directory,c=Ye(d.items||[]),p=Ye(d.files||[]),(p.length>0||c.some(function(S){return S.kind==="file"}))&&(f==null||f()),!w){I.next=11;break}return I.next=7,Fl(Array.prototype.slice.call(c),function(S){return Jn(S,r.props.accept)});case 7:p=I.sent,r.uploadFiles(p),I.next=14;break;case 11:C=Ye(p).filter(function(S){return Jn(S,x)}),v===!1&&(C=p.slice(0,1)),r.uploadFiles(C);case 14:case"end":return I.stop()}},u)}));return function(u,d){return s.apply(this,arguments)}})()),re(Ve(r),"onFilePaste",(function(){var s=Bt(Qe().mark(function u(d){var f,m;return Qe().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(f=r.props.pastable,f){x.next=3;break}return x.abrupt("return");case 3:if(d.type!=="paste"){x.next=6;break}return m=d.clipboardData,x.abrupt("return",r.onDataTransferFiles(m,function(){d.preventDefault()}));case 6:case"end":return x.stop()}},u)}));return function(u){return s.apply(this,arguments)}})()),re(Ve(r),"onFileDragOver",function(s){s.preventDefault()}),re(Ve(r),"onFileDrop",(function(){var s=Bt(Qe().mark(function u(d){var f;return Qe().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(d.preventDefault(),d.type!=="drop"){v.next=4;break}return f=d.dataTransfer,v.abrupt("return",r.onDataTransferFiles(f));case 4:case"end":return v.stop()}},u)}));return function(u){return s.apply(this,arguments)}})()),re(Ve(r),"uploadFiles",function(s){var u=Ye(s),d=u.map(function(f){return f.uid=Yn(),r.processFile(f,u)});Promise.all(d).then(function(f){var m=r.props.onBatchStart;m==null||m(f.map(function(v){var x=v.origin,w=v.parsedFile;return{file:x,parsedFile:w}})),f.filter(function(v){return v.parsedFile!==null}).forEach(function(v){r.post(v)})})}),re(Ve(r),"processFile",(function(){var s=Bt(Qe().mark(function u(d,f){var m,v,x,w,c,p,C,b,I;return Qe().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(m=r.props.beforeUpload,v=d,!m){y.next=14;break}return y.prev=3,y.next=6,m(d,f);case 6:v=y.sent,y.next=12;break;case 9:y.prev=9,y.t0=y.catch(3),v=!1;case 12:if(v!==!1){y.next=14;break}return y.abrupt("return",{origin:d,parsedFile:null,action:null,data:null});case 14:if(x=r.props.action,typeof x!="function"){y.next=21;break}return y.next=18,x(d);case 18:w=y.sent,y.next=22;break;case 21:w=x;case 22:if(c=r.props.data,typeof c!="function"){y.next=29;break}return y.next=26,c(d);case 26:p=y.sent,y.next=30;break;case 29:p=c;case 30:return C=(jt(v)==="object"||typeof v=="string")&&v?v:d,C instanceof File?b=C:b=new File([C],d.name,{type:d.type}),I=b,I.uid=d.uid,y.abrupt("return",{origin:d,data:p,parsedFile:I,action:w});case 35:case"end":return y.stop()}},u,null,[[3,9]])}));return function(u,d){return s.apply(this,arguments)}})()),re(Ve(r),"saveFileInput",function(s){r.fileInput=s}),r}return Ir(t,[{key:"componentDidMount",value:function(){this._isMounted=!0;var o=this.props.pastable;o&&document.addEventListener("paste",this.onFilePaste)}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort(),document.removeEventListener("paste",this.onFilePaste)}},{key:"componentDidUpdate",value:function(o){var a=this.props.pastable;a&&!o.pastable?document.addEventListener("paste",this.onFilePaste):!a&&o.pastable&&document.removeEventListener("paste",this.onFilePaste)}},{key:"post",value:function(o){var a=this,i=o.data,s=o.origin,u=o.action,d=o.parsedFile;if(this._isMounted){var f=this.props,m=f.onStart,v=f.customRequest,x=f.name,w=f.headers,c=f.withCredentials,p=f.method,C=s.uid,b=v||vo,I={action:u,filename:x,data:i,file:d,headers:w,withCredentials:c,method:p||"post",onProgress:function(y){var F=a.props.onProgress;F==null||F(y,d)},onSuccess:function(y,F){var D=a.props.onSuccess;D==null||D(y,d,F),delete a.reqs[C]},onError:function(y,F){var D=a.props.onError;D==null||D(y,F,d),delete a.reqs[C]}};m(s),this.reqs[C]=b(I,{defaultRequest:vo})}}},{key:"reset",value:function(){this.setState({uid:Yn()})}},{key:"abort",value:function(o){var a=this.reqs;if(o){var i=o.uid?o.uid:o;a[i]&&a[i].abort&&a[i].abort(),delete a[i]}else Object.keys(a).forEach(function(s){a[s]&&a[s].abort&&a[s].abort(),delete a[s]})}},{key:"render",value:function(){var o=this.props,a=o.component,i=o.prefixCls,s=o.className,u=o.classNames,d=u===void 0?{}:u,f=o.disabled,m=o.id,v=o.name,x=o.style,w=o.styles,c=w===void 0?{}:w,p=o.multiple,C=o.accept,b=o.capture,I=o.children,S=o.directory,y=o.folder,F=o.openFileDialogOnClick,D=o.onMouseEnter,O=o.onMouseLeave,N=o.hasControlInside,E=ot(o,Dl),_=Z(re(re(re({},i,!0),"".concat(i,"-disabled"),f),s,s)),T=S||y?{directory:"directory",webkitdirectory:"webkitdirectory"}:{},k=f?{}:{onClick:F?this.onClick:function(){},onKeyDown:F?this.onKeyDown:function(){},onMouseEnter:D,onMouseLeave:O,onDrop:this.onFileDrop,onDragOver:this.onFileDragOver,tabIndex:N?void 0:"0"};return Be.createElement(a,De({},k,{className:_,role:N?void 0:"button",style:x}),Be.createElement("input",De({},ni(E,{aria:!0,data:!0}),{id:m,name:v,disabled:f,type:"file",ref:this.saveFileInput,onClick:function(B){return B.stopPropagation()},key:this.state.uid,style:ze({display:"none"},c.input),className:d.input,accept:C},T,{multiple:p,onChange:this.onChange},b!=null?{capture:b}:{})),I)}}]),t})(Ao);function Qn(){}var gr=(function(e){xr(t,e);var n=wr(t);function t(){var r;$r(this,t);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=n.call.apply(n,[this].concat(a)),re(Ve(r),"uploader",void 0),re(Ve(r),"saveUploader",function(s){r.uploader=s}),r}return Ir(t,[{key:"abort",value:function(o){this.uploader.abort(o)}},{key:"render",value:function(){return Be.createElement(Pl,De({},this.props,{ref:this.saveUploader}))}}]),t})(Ao);re(gr,"defaultProps",{component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:Qn,onError:Qn,onSuccess:Qn,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0,hasControlInside:!1});const Al=e=>{const{componentCls:n,iconCls:t}=e;return{[`${n}-wrapper`]:{[`${n}-drag`]:{position:"relative",width:"100%",height:"100%",textAlign:"center",background:e.colorFillAlter,border:`${ne(e.lineWidth)} dashed ${e.colorBorder}`,borderRadius:e.borderRadiusLG,cursor:"pointer",transition:`border-color ${e.motionDurationSlow}`,[n]:{padding:e.padding},[`${n}-btn`]:{display:"table",width:"100%",height:"100%",outline:"none",borderRadius:e.borderRadiusLG,"&:focus-visible":{outline:`${ne(e.lineWidthFocus)} solid ${e.colorPrimaryBorder}`}},[`${n}-drag-container`]:{display:"table-cell",verticalAlign:"middle"},[`
|
|
73
73
|
&:not(${n}-disabled):hover,
|
|
74
74
|
&-hover:not(${n}-disabled)
|
|
75
75
|
`]:{borderColor:e.colorPrimaryHover},[`p${n}-drag-icon`]:{marginBottom:e.margin,[t]:{color:e.colorPrimary,fontSize:e.uploadThumbnailSize}},[`p${n}-text`]:{margin:`0 0 ${ne(e.marginXXS)}`,color:e.colorTextHeading,fontSize:e.fontSizeLG},[`p${n}-hint`]:{color:e.colorTextDescription,fontSize:e.fontSize},[`&${n}-disabled`]:{[`p${n}-drag-icon ${t},
|
|
@@ -89,7 +89,7 @@ import{jsx as $,jsxs as Y,Fragment as Ea}from"react/jsx-runtime";import*as l fro
|
|
|
89
89
|
${t}-eye,
|
|
90
90
|
${t}-download,
|
|
91
91
|
${t}-delete
|
|
92
|
-
`]:{zIndex:10,width:r,margin:`0 ${ne(e.marginXXS)}`,fontSize:r,cursor:"pointer",transition:`all ${e.motionDurationSlow}`,color:o,"&:hover":{color:o},svg:{verticalAlign:"baseline"}}},[`${s}-thumbnail, ${s}-thumbnail img`]:{position:"static",display:"block",width:"100%",height:"100%",objectFit:"contain"},[`${s}-name`]:{display:"none",textAlign:"center"},[`${s}-file + ${s}-name`]:{position:"absolute",bottom:e.margin,display:"block",width:`calc(100% - ${ne(a(e.paddingXS).mul(2).equal())})`},[`${s}-uploading`]:{[`&${s}`]:{backgroundColor:e.colorFillAlter},[`&::before, ${t}-eye, ${t}-download, ${t}-delete`]:{display:"none"}},[`${s}-progress`]:{bottom:e.marginXL,width:`calc(100% - ${ne(a(e.paddingXS).mul(2).equal())})`,paddingInlineStart:0}}}),[`${n}-wrapper${n}-picture-circle-wrapper`]:{[`${n}${n}-select`]:{borderRadius:"50%"}}}},Tl=e=>{const{componentCls:n}=e;return{[`${n}-rtl`]:{direction:"rtl"}}},_l=e=>{const{componentCls:n,colorTextDisabled:t}=e;return{[`${n}-wrapper`]:Object.assign(Object.assign({},On(e)),{[n]:{outline:0,"input[type='file']":{cursor:"pointer"}},[`${n}-select`]:{display:"inline-block"},[`${n}-hidden`]:{display:"none"},[`${n}-disabled`]:{color:t,cursor:"not-allowed"}})}},zl=e=>({actionsColor:e.colorIcon,pictureCardSize:e.controlHeightLG*2.55}),jl=cn("Upload",e=>{const{fontSizeHeading3:n,fontHeight:t,lineWidth:r,pictureCardSize:o,calc:a}=e,i=sn(e,{uploadThumbnailSize:a(n).mul(2).equal(),uploadProgressOffset:a(a(t).div(2)).add(r).equal(),uploadPicCardSize:o});return[_l(i),Al(i),Rl(i),Bl(i),kl(i),Ml(i),Tl(i),_o(i)]},zl);var Ll={icon:function(n,t){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M534 352V136H232v752h560V394H576a42 42 0 01-42-42z",fill:t}},{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM602 137.8L790.2 326H602V137.8zM792 888H232V136h302v216a42 42 0 0042 42h216v494z",fill:n}}]}},name:"file",theme:"twotone"},Hl=function(n,t){return l.createElement(Jt,De({},n,{ref:t,icon:Ll}))},ql=l.forwardRef(Hl),Ul={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"}}]},name:"paper-clip",theme:"outlined"},Wl=function(n,t){return l.createElement(Jt,De({},n,{ref:t,icon:Ul}))},Vl=l.forwardRef(Wl),Kl={icon:function(n,t){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2z",fill:n}},{tag:"path",attrs:{d:"M424.6 765.8l-150.1-178L136 752.1V792h752v-30.4L658.1 489z",fill:t}},{tag:"path",attrs:{d:"M136 652.7l132.4-157c3.2-3.8 9-3.8 12.2 0l144 170.7L652 396.8c3.2-3.8 9-3.8 12.2 0L888 662.2V232H136v420.7zM304 280a88 88 0 110 176 88 88 0 010-176z",fill:t}},{tag:"path",attrs:{d:"M276 368a28 28 0 1056 0 28 28 0 10-56 0z",fill:t}},{tag:"path",attrs:{d:"M304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z",fill:n}}]}},name:"picture",theme:"twotone"},Xl=function(n,t){return l.createElement(Jt,De({},n,{ref:t,icon:Kl}))},Gl=l.forwardRef(Xl);function bn(e){return Object.assign(Object.assign({},e),{lastModified:e.lastModified,lastModifiedDate:e.lastModifiedDate,name:e.name,size:e.size,type:e.type,uid:e.uid,percent:0,originFileObj:e})}function yn(e,n){const t=Ye(n),r=t.findIndex(({uid:o})=>o===e.uid);return r===-1?t.push(e):t[r]=e,t}function Zn(e,n){const t=e.uid!==void 0?"uid":"name";return n.filter(r=>r[t]===e[t])[0]}function Jl(e,n){const t=e.uid!==void 0?"uid":"name",r=n.filter(o=>o[t]!==e[t]);return r.length===n.length?null:r}const Yl=(e="")=>{const n=e.split("/"),r=n[n.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(r)||[""])[0]},xa=e=>e.indexOf("image/")===0,Ql=e=>{if(e.type&&!e.thumbUrl)return xa(e.type);const n=e.thumbUrl||e.url||"",t=Yl(n);return/^data:image\//.test(n)||/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(t)?!0:!(/^data:/.test(n)||t)},Rt=200;function Zl(e){return new Promise(n=>{if(!e.type||!xa(e.type)){n("");return}const t=document.createElement("canvas");t.width=Rt,t.height=Rt,t.style.cssText=`position: fixed; left: 0; top: 0; width: ${Rt}px; height: ${Rt}px; z-index: 9999; display: none;`,document.body.appendChild(t);const r=t.getContext("2d"),o=new Image;if(o.onload=()=>{const{width:a,height:i}=o;let s=Rt,u=Rt,d=0,f=0;a>i?(u=i*(Rt/a),f=-(u-s)/2):(s=a*(Rt/i),d=-(s-u)/2),r.drawImage(o,d,f,s,u);const m=t.toDataURL();document.body.removeChild(t),window.URL.revokeObjectURL(o.src),n(m)},o.crossOrigin="anonymous",e.type.startsWith("image/svg+xml")){const a=new FileReader;a.onload=()=>{a.result&&typeof a.result=="string"&&(o.src=a.result)},a.readAsDataURL(e)}else if(e.type.startsWith("image/gif")){const a=new FileReader;a.onload=()=>{a.result&&n(a.result)},a.readAsDataURL(e)}else o.src=window.URL.createObjectURL(e)})}var ec={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"},tc=function(n,t){return l.createElement(Jt,De({},n,{ref:t,icon:ec}))},nc=l.forwardRef(tc);const rc=l.forwardRef(({prefixCls:e,className:n,style:t,locale:r,listType:o,file:a,items:i,progress:s,iconRender:u,actionIconRender:d,itemRender:f,isImgUrl:m,showPreviewIcon:h,showRemoveIcon:x,showDownloadIcon:w,previewIcon:c,removeIcon:p,downloadIcon:C,extra:b,onPreview:I,onDownload:S,onClose:y},F)=>{var D,O;const{status:N}=a,[E,_]=l.useState(N);l.useEffect(()=>{N!=="removed"&&_(N)},[N]);const[T,k]=l.useState(!1);l.useEffect(()=>{const we=setTimeout(()=>{k(!0)},300);return()=>{clearTimeout(we)}},[]);const M=u(a);let B=l.createElement("div",{className:`${e}-icon`},M);if(o==="picture"||o==="picture-card"||o==="picture-circle")if(E==="uploading"||!a.thumbUrl&&!a.url){const we=Z(`${e}-list-item-thumbnail`,{[`${e}-list-item-file`]:E!=="uploading"});B=l.createElement("div",{className:we},M)}else{const we=m!=null&&m(a)?l.createElement("img",{src:a.thumbUrl||a.url,alt:a.name,className:`${e}-list-item-image`,crossOrigin:a.crossOrigin}):M,Te=Z(`${e}-list-item-thumbnail`,{[`${e}-list-item-file`]:m&&!m(a)});B=l.createElement("a",{className:Te,onClick:Je=>I(a,Je),href:a.url||a.thumbUrl,target:"_blank",rel:"noopener noreferrer"},we)}const V=Z(`${e}-list-item`,`${e}-list-item-${E}`),j=typeof a.linkProps=="string"?JSON.parse(a.linkProps):a.linkProps,U=(typeof x=="function"?x(a):x)?d((typeof p=="function"?p(a):p)||l.createElement(Sl,null),()=>y(a),e,r.removeFile,!0):null,K=(typeof w=="function"?w(a):w)&&E==="done"?d((typeof C=="function"?C(a):C)||l.createElement(nc,null),()=>S(a),e,r.downloadFile):null,L=o!=="picture-card"&&o!=="picture-circle"&&l.createElement("span",{key:"download-delete",className:Z(`${e}-list-item-actions`,{picture:o==="picture"})},K,U),q=typeof b=="function"?b(a):b,ee=q&&l.createElement("span",{className:`${e}-list-item-extra`},q),R=Z(`${e}-list-item-name`),W=a.url?l.createElement("a",Object.assign({key:"view",target:"_blank",rel:"noopener noreferrer",className:R,title:a.name},j,{href:a.url,onClick:we=>I(a,we)}),a.name,ee):l.createElement("span",{key:"view",className:R,onClick:we=>I(a,we),title:a.name},a.name,ee),J=(typeof h=="function"?h(a):h)&&(a.url||a.thumbUrl)?l.createElement("a",{href:a.url||a.thumbUrl,target:"_blank",rel:"noopener noreferrer",onClick:we=>I(a,we),title:r.previewFile},typeof c=="function"?c(a):c||l.createElement(ri,null)):null,oe=(o==="picture-card"||o==="picture-circle")&&E!=="uploading"&&l.createElement("span",{className:`${e}-list-item-actions`},J,E==="done"&&K,U),{getPrefixCls:ae}=l.useContext(wt),Q=ae(),ie=l.createElement("div",{className:V},B,W,L,oe,T&&l.createElement(Er,{motionName:`${Q}-fade`,visible:E==="uploading",motionDeadline:2e3},({className:we})=>{const Te="percent"in a?l.createElement(wl,Object.assign({type:"line",percent:a.percent,"aria-label":a["aria-label"],"aria-labelledby":a["aria-labelledby"]},s)):null;return l.createElement("div",{className:Z(`${e}-list-item-progress`,we)},Te)})),Ce=a.response&&typeof a.response=="string"?a.response:((D=a.error)===null||D===void 0?void 0:D.statusText)||((O=a.error)===null||O===void 0?void 0:O.message)||r.uploadError,xe=E==="error"?l.createElement(Fr,{title:Ce,getPopupContainer:we=>we.parentNode},ie):ie;return l.createElement("div",{className:Z(`${e}-list-item-container`,n),style:t,ref:F},f?f(xe,a,i,{download:S.bind(null,a),preview:I.bind(null,a),remove:y.bind(null,a)}):xe)}),oc=(e,n)=>{const{listType:t="text",previewFile:r=Zl,onPreview:o,onDownload:a,onRemove:i,locale:s,iconRender:u,isImageUrl:d=Ql,prefixCls:f,items:m=[],showPreviewIcon:h=!0,showRemoveIcon:x=!0,showDownloadIcon:w=!1,removeIcon:c,previewIcon:p,downloadIcon:C,extra:b,progress:I={size:[-1,2],showInfo:!1},appendAction:S,appendActionVisible:y=!0,itemRender:F,disabled:D}=e,[,O]=oi(),[N,E]=l.useState(!1),_=["picture-card","picture-circle"].includes(t);l.useEffect(()=>{t.startsWith("picture")&&(m||[]).forEach(R=>{!(R.originFileObj instanceof File||R.originFileObj instanceof Blob)||R.thumbUrl!==void 0||(R.thumbUrl="",r==null||r(R.originFileObj).then(W=>{R.thumbUrl=W||"",O()}))})},[t,m,r]),l.useEffect(()=>{E(!0)},[]);const T=(R,W)=>{if(o)return W==null||W.preventDefault(),o(R)},k=R=>{typeof a=="function"?a(R):R.url&&window.open(R.url)},M=R=>{i==null||i(R)},B=R=>{if(u)return u(R,t);const W=R.status==="uploading";if(t.startsWith("picture")){const J=t==="picture"?l.createElement(Vr,null):s.uploading,oe=d!=null&&d(R)?l.createElement(Gl,null):l.createElement(ql,null);return W?J:oe}return W?l.createElement(Vr,null):l.createElement(Vl,null)},V=(R,W,J,oe,ae)=>{const Q={type:"text",size:"small",title:oe,onClick:ie=>{var Ce,xe;W(),l.isValidElement(R)&&((xe=(Ce=R.props).onClick)===null||xe===void 0||xe.call(Ce,ie))},className:`${J}-list-item-action`,disabled:ae?D:!1};return l.isValidElement(R)?l.createElement(pt,Object.assign({},Q,{icon:Gt(R,Object.assign(Object.assign({},R.props),{onClick:()=>{}}))})):l.createElement(pt,Object.assign({},Q),l.createElement("span",null,R))};l.useImperativeHandle(n,()=>({handlePreview:T,handleDownload:k}));const{getPrefixCls:j}=l.useContext(wt),U=j("upload",f),K=j(),L=Z(`${U}-list`,`${U}-list-${t}`),q=l.useMemo(()=>xt(Ho(K),["onAppearEnd","onEnterEnd","onLeaveEnd"]),[K]),ee=Object.assign(Object.assign({},_?{}:q),{motionDeadline:2e3,motionName:`${U}-${_?"animate-inline":"animate"}`,keys:Ye(m.map(R=>({key:R.uid,file:R}))),motionAppear:N});return l.createElement("div",{className:L},l.createElement(ai,Object.assign({},ee,{component:!1}),({key:R,file:W,className:J,style:oe})=>l.createElement(rc,{key:R,locale:s,prefixCls:U,className:J,style:oe,file:W,items:m,progress:I,listType:t,isImgUrl:d,showPreviewIcon:h,showRemoveIcon:x,showDownloadIcon:w,removeIcon:c,previewIcon:p,downloadIcon:C,extra:b,iconRender:B,actionIconRender:V,itemRender:F,onPreview:T,onDownload:k,onClose:M})),S&&l.createElement(Er,Object.assign({},ee,{visible:y,forceRender:!0}),({className:R,style:W})=>Gt(S,J=>({className:Z(J.className,R),style:Object.assign(Object.assign(Object.assign({},W),{pointerEvents:R?"none":void 0}),J.style)}))))},ac=l.forwardRef(oc);var ic=function(e,n,t,r){function o(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function s(f){try{d(r.next(f))}catch(m){i(m)}}function u(f){try{d(r.throw(f))}catch(m){i(m)}}function d(f){f.done?a(f.value):o(f.value).then(s,u)}d((r=r.apply(e,[])).next())})};const on=`__LIST_IGNORE_${Date.now()}__`,sc=(e,n)=>{const t=Or("upload"),{fileList:r,defaultFileList:o,onRemove:a,showUploadList:i=!0,listType:s="text",onPreview:u,onDownload:d,onChange:f,onDrop:m,previewFile:h,disabled:x,locale:w,iconRender:c,isImageUrl:p,progress:C,prefixCls:b,className:I,type:S="select",children:y,style:F,itemRender:D,maxCount:O,data:N={},multiple:E=!1,hasControlInside:_=!0,action:T="",accept:k="",supportServerRender:M=!0,rootClassName:B}=e,V=l.useContext(ii),j=x??V,U=e.customRequest||t.customRequest,[K,L]=Lt(o||[],{value:r,postState:G=>G??[]}),[q,ee]=l.useState("drop"),R=l.useRef(null),W=l.useRef(null);l.useMemo(()=>{const G=Date.now();(r||[]).forEach((pe,Fe)=>{!pe.uid&&!Object.isFrozen(pe)&&(pe.uid=`__AUTO__${G}_${Fe}__`)})},[r]);const J=(G,pe,Fe)=>{let se=Ye(pe),be=!1;O===1?se=se.slice(-1):O&&(be=se.length>O,se=se.slice(0,O)),lr(()=>{L(se)});const _e={file:G,fileList:se};Fe&&(_e.event=Fe),(!be||G.status==="removed"||se.some(at=>at.uid===G.uid))&&lr(()=>{f==null||f(_e)})},oe=(G,pe)=>ic(void 0,void 0,void 0,function*(){const{beforeUpload:Fe,transformFile:se}=e;let be=G;if(Fe){const _e=yield Fe(G,pe);if(_e===!1)return!1;if(delete G[on],_e===on)return Object.defineProperty(G,on,{value:!0,configurable:!0}),!1;typeof _e=="object"&&_e&&(be=_e)}return se&&(be=yield se(be)),be}),ae=G=>{const pe=G.filter(be=>!be.file[on]);if(!pe.length)return;const Fe=pe.map(be=>bn(be.file));let se=Ye(K);Fe.forEach(be=>{se=yn(be,se)}),Fe.forEach((be,_e)=>{let at=be;if(pe[_e].parsedFile)be.status="uploading";else{const{originFileObj:dt}=be;let tt;try{tt=new File([dt],dt.name,{type:dt.type})}catch{tt=new Blob([dt],{type:dt.type}),tt.name=dt.name,tt.lastModifiedDate=new Date,tt.lastModified=new Date().getTime()}tt.uid=be.uid,at=tt}J(at,se)})},Q=(G,pe,Fe)=>{try{typeof G=="string"&&(G=JSON.parse(G))}catch{}if(!Zn(pe,K))return;const se=bn(pe);se.status="done",se.percent=100,se.response=G,se.xhr=Fe;const be=yn(se,K);J(se,be)},ie=(G,pe)=>{if(!Zn(pe,K))return;const Fe=bn(pe);Fe.status="uploading",Fe.percent=G.percent;const se=yn(Fe,K);J(Fe,se,G)},Ce=(G,pe,Fe)=>{if(!Zn(Fe,K))return;const se=bn(Fe);se.error=G,se.response=pe,se.status="error";const be=yn(se,K);J(se,be)},xe=G=>{let pe;Promise.resolve(typeof a=="function"?a(G):a).then(Fe=>{var se;if(Fe===!1)return;const be=Jl(G,K);be&&(pe=Object.assign(Object.assign({},G),{status:"removed"}),K==null||K.forEach(_e=>{const at=pe.uid!==void 0?"uid":"name";_e[at]===pe[at]&&!Object.isFrozen(_e)&&(_e.status="removed")}),(se=R.current)===null||se===void 0||se.abort(pe),J(pe,be))})},we=G=>{ee(G.type),G.type==="drop"&&(m==null||m(G))};l.useImperativeHandle(n,()=>({onBatchStart:ae,onSuccess:Q,onProgress:ie,onError:Ce,fileList:K,upload:R.current,nativeElement:W.current}));const{getPrefixCls:Te,direction:Je,upload:Le}=l.useContext(wt),ve=Te("upload",b),me=Object.assign(Object.assign({onBatchStart:ae,onError:Ce,onProgress:ie,onSuccess:Q},e),{customRequest:U,data:N,multiple:E,action:T,accept:k,supportServerRender:M,prefixCls:ve,disabled:j,beforeUpload:oe,onChange:void 0,hasControlInside:_});delete me.className,delete me.style,(!y||j)&&delete me.id;const ct=`${ve}-wrapper`,[mt,$t,It]=jl(ve,ct),[At]=Uo("Upload",Wo.Upload),{showRemoveIcon:et,showPreviewIcon:qe,showDownloadIcon:St,removeIcon:kt,previewIcon:Mt,downloadIcon:Et,extra:Ae}=typeof i=="boolean"?{}:i,ce=typeof et>"u"?!j:et,nt=(G,pe)=>i?l.createElement(ac,{prefixCls:ve,listType:s,items:K,previewFile:h,onPreview:u,onDownload:d,onRemove:xe,showRemoveIcon:ce,showPreviewIcon:qe,showDownloadIcon:St,removeIcon:kt,previewIcon:Mt,downloadIcon:Et,iconRender:c,extra:Ae,locale:Object.assign(Object.assign({},At),w),isImageUrl:p,progress:C,appendAction:G,appendActionVisible:pe,itemRender:D,disabled:j}):G,ut=Z(ct,I,B,$t,It,Le==null?void 0:Le.className,{[`${ve}-rtl`]:Je==="rtl",[`${ve}-picture-card-wrapper`]:s==="picture-card",[`${ve}-picture-circle-wrapper`]:s==="picture-circle"}),ft=Object.assign(Object.assign({},Le==null?void 0:Le.style),F);if(S==="drag"){const G=Z($t,ve,`${ve}-drag`,{[`${ve}-drag-uploading`]:K.some(pe=>pe.status==="uploading"),[`${ve}-drag-hover`]:q==="dragover",[`${ve}-disabled`]:j,[`${ve}-rtl`]:Je==="rtl"});return mt(l.createElement("span",{className:ut,ref:W},l.createElement("div",{className:G,style:ft,onDrop:we,onDragOver:we,onDragLeave:we},l.createElement(gr,Object.assign({},me,{ref:R,className:`${ve}-btn`}),l.createElement("div",{className:`${ve}-drag-container`},y))),nt()))}const Ue=Z(ve,`${ve}-select`,{[`${ve}-disabled`]:j,[`${ve}-hidden`]:!y}),We=l.createElement("div",{className:Ue,style:ft},l.createElement(gr,Object.assign({},me,{ref:R})));return mt(s==="picture-card"||s==="picture-circle"?l.createElement("span",{className:ut,ref:W},nt(We,!!y)):l.createElement("span",{className:ut,ref:W},We,nt()))},wa=l.forwardRef(sc);var lc=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t};const cc=l.forwardRef((e,n)=>{const{style:t,height:r,hasControlInside:o=!1,children:a}=e,i=lc(e,["style","height","hasControlInside","children"]),s=Object.assign(Object.assign({},t),{height:r});return l.createElement(wa,Object.assign({ref:n,hasControlInside:o},i,{style:s,type:"drag"}),a)}),jr=wa;jr.Dragger=cc;jr.LIST_IGNORE=on;const bo={actions:[{icon:$(lt,{type:"rag/folder",size:18}),name:"history",badgeCount:0}],switchs:[{label:"\u8054\u7F51\u641C\u7D22",name:"netSearch",type:"checkbox",defaultValue:!1,enabled:!0,icon:$(lt,{type:"rag/url",size:12})},{label:"\u63A8\u7406\u601D\u8003",name:"reasoning",type:"checkbox",defaultValue:!1,enabled:!0,icon:$(lt,{type:"rag/think",size:12})}]};function uc(e,n){e.prototype=Object.create(n.prototype),e.prototype.constructor=e,si(e,n)}var yo=Number.isNaN||function(n){return typeof n=="number"&&n!==n};function dc(e,n){return!!(e===n||yo(e)&&yo(n))}function pc(e,n){if(e.length!==n.length)return!1;for(var t=0;t<e.length;t++)if(!dc(e[t],n[t]))return!1;return!0}function er(e,n){n===void 0&&(n=pc);var t,r=[],o,a=!1;function i(){for(var s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];return a&&t===this&&n(s,r)||(o=e.apply(this,s),a=!0,t=this,r=s),o}return i}var mc=typeof performance=="object"&&typeof performance.now=="function",Co=mc?function(){return performance.now()}:function(){return Date.now()};function xo(e){cancelAnimationFrame(e.id)}function fc(e,n){var t=Co();function r(){Co()-t>=n?e.call(null):o.id=requestAnimationFrame(r)}var o={id:requestAnimationFrame(r)};return o}var tr=-1;function wo(e){if(e===void 0&&(e=!1),tr===-1||e){var n=document.createElement("div"),t=n.style;t.width="50px",t.height="50px",t.overflow="scroll",document.body.appendChild(n),tr=n.offsetWidth-n.clientWidth,document.body.removeChild(n)}return tr}var Vt=null;function $o(e){if(e===void 0&&(e=!1),Vt===null||e){var n=document.createElement("div"),t=n.style;t.width="50px",t.height="50px",t.overflow="scroll",t.direction="rtl";var r=document.createElement("div"),o=r.style;return o.width="100px",o.height="100px",n.appendChild(r),document.body.appendChild(n),n.scrollLeft>0?Vt="positive-descending":(n.scrollLeft=1,n.scrollLeft===0?Vt="negative":Vt="positive-ascending"),document.body.removeChild(n),Vt}return Vt}var gc=150,hc=function(n,t){return n};function vc(e){var n,t=e.getItemOffset,r=e.getEstimatedTotalSize,o=e.getItemSize,a=e.getOffsetForIndexAndAlignment,i=e.getStartIndexForOffset,s=e.getStopIndexForStartIndex,u=e.initInstanceProps,d=e.shouldResetStyleCacheOnItemSizeChange,f=e.validateProps;return n=(function(m){uc(h,m);function h(w){var c;return c=m.call(this,w)||this,c._instanceProps=u(c.props,Ve(c)),c._outerRef=void 0,c._resetIsScrollingTimeoutId=null,c.state={instance:Ve(c),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof c.props.initialScrollOffset=="number"?c.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},c._callOnItemsRendered=void 0,c._callOnItemsRendered=er(function(p,C,b,I){return c.props.onItemsRendered({overscanStartIndex:p,overscanStopIndex:C,visibleStartIndex:b,visibleStopIndex:I})}),c._callOnScroll=void 0,c._callOnScroll=er(function(p,C,b){return c.props.onScroll({scrollDirection:p,scrollOffset:C,scrollUpdateWasRequested:b})}),c._getItemStyle=void 0,c._getItemStyle=function(p){var C=c.props,b=C.direction,I=C.itemSize,S=C.layout,y=c._getItemStyleCache(d&&I,d&&S,d&&b),F;if(y.hasOwnProperty(p))F=y[p];else{var D=t(c.props,p,c._instanceProps),O=o(c.props,p,c._instanceProps),N=b==="horizontal"||S==="horizontal",E=b==="rtl",_=N?D:0;y[p]=F={position:"absolute",left:E?void 0:_,right:E?_:void 0,top:N?0:D,height:N?"100%":O,width:N?O:"100%"}}return F},c._getItemStyleCache=void 0,c._getItemStyleCache=er(function(p,C,b){return{}}),c._onScrollHorizontal=function(p){var C=p.currentTarget,b=C.clientWidth,I=C.scrollLeft,S=C.scrollWidth;c.setState(function(y){if(y.scrollOffset===I)return null;var F=c.props.direction,D=I;if(F==="rtl")switch($o()){case"negative":D=-I;break;case"positive-descending":D=S-b-I;break}return D=Math.max(0,Math.min(D,S-b)),{isScrolling:!0,scrollDirection:y.scrollOffset<D?"forward":"backward",scrollOffset:D,scrollUpdateWasRequested:!1}},c._resetIsScrollingDebounced)},c._onScrollVertical=function(p){var C=p.currentTarget,b=C.clientHeight,I=C.scrollHeight,S=C.scrollTop;c.setState(function(y){if(y.scrollOffset===S)return null;var F=Math.max(0,Math.min(S,I-b));return{isScrolling:!0,scrollDirection:y.scrollOffset<F?"forward":"backward",scrollOffset:F,scrollUpdateWasRequested:!1}},c._resetIsScrollingDebounced)},c._outerRefSetter=function(p){var C=c.props.outerRef;c._outerRef=p,typeof C=="function"?C(p):C!=null&&typeof C=="object"&&C.hasOwnProperty("current")&&(C.current=p)},c._resetIsScrollingDebounced=function(){c._resetIsScrollingTimeoutId!==null&&xo(c._resetIsScrollingTimeoutId),c._resetIsScrollingTimeoutId=fc(c._resetIsScrolling,gc)},c._resetIsScrolling=function(){c._resetIsScrollingTimeoutId=null,c.setState({isScrolling:!1},function(){c._getItemStyleCache(-1,null)})},c}h.getDerivedStateFromProps=function(c,p){return bc(c,p),f(c),null};var x=h.prototype;return x.scrollTo=function(c){c=Math.max(0,c),this.setState(function(p){return p.scrollOffset===c?null:{scrollDirection:p.scrollOffset<c?"forward":"backward",scrollOffset:c,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},x.scrollToItem=function(c,p){p===void 0&&(p="auto");var C=this.props,b=C.itemCount,I=C.layout,S=this.state.scrollOffset;c=Math.max(0,Math.min(c,b-1));var y=0;if(this._outerRef){var F=this._outerRef;I==="vertical"?y=F.scrollWidth>F.clientWidth?wo():0:y=F.scrollHeight>F.clientHeight?wo():0}this.scrollTo(a(this.props,c,p,S,this._instanceProps,y))},x.componentDidMount=function(){var c=this.props,p=c.direction,C=c.initialScrollOffset,b=c.layout;if(typeof C=="number"&&this._outerRef!=null){var I=this._outerRef;p==="horizontal"||b==="horizontal"?I.scrollLeft=C:I.scrollTop=C}this._callPropsCallbacks()},x.componentDidUpdate=function(){var c=this.props,p=c.direction,C=c.layout,b=this.state,I=b.scrollOffset,S=b.scrollUpdateWasRequested;if(S&&this._outerRef!=null){var y=this._outerRef;if(p==="horizontal"||C==="horizontal")if(p==="rtl")switch($o()){case"negative":y.scrollLeft=-I;break;case"positive-ascending":y.scrollLeft=I;break;default:var F=y.clientWidth,D=y.scrollWidth;y.scrollLeft=D-F-I;break}else y.scrollLeft=I;else y.scrollTop=I}this._callPropsCallbacks()},x.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&xo(this._resetIsScrollingTimeoutId)},x.render=function(){var c=this.props,p=c.children,C=c.className,b=c.direction,I=c.height,S=c.innerRef,y=c.innerElementType,F=c.innerTagName,D=c.itemCount,O=c.itemData,N=c.itemKey,E=N===void 0?hc:N,_=c.layout,T=c.outerElementType,k=c.outerTagName,M=c.style,B=c.useIsScrolling,V=c.width,j=this.state.isScrolling,U=b==="horizontal"||_==="horizontal",K=U?this._onScrollHorizontal:this._onScrollVertical,L=this._getRangeToRender(),q=L[0],ee=L[1],R=[];if(D>0)for(var W=q;W<=ee;W++)R.push(Vn(p,{data:O,key:E(W,O),index:W,isScrolling:B?j:void 0,style:this._getItemStyle(W)}));var J=r(this.props,this._instanceProps);return Vn(T||k||"div",{className:C,onScroll:K,ref:this._outerRefSetter,style:De({position:"relative",height:I,width:V,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:b},M)},Vn(y||F||"div",{children:R,ref:S,style:{height:U?"100%":J,pointerEvents:j?"none":void 0,width:U?J:"100%"}}))},x._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var c=this.props.itemCount;if(c>0){var p=this._getRangeToRender(),C=p[0],b=p[1],I=p[2],S=p[3];this._callOnItemsRendered(C,b,I,S)}}if(typeof this.props.onScroll=="function"){var y=this.state,F=y.scrollDirection,D=y.scrollOffset,O=y.scrollUpdateWasRequested;this._callOnScroll(F,D,O)}},x._getRangeToRender=function(){var c=this.props,p=c.itemCount,C=c.overscanCount,b=this.state,I=b.isScrolling,S=b.scrollDirection,y=b.scrollOffset;if(p===0)return[0,0,0,0];var F=i(this.props,y,this._instanceProps),D=s(this.props,F,y,this._instanceProps),O=!I||S==="backward"?Math.max(1,C):1,N=!I||S==="forward"?Math.max(1,C):1;return[Math.max(0,F-O),Math.max(0,Math.min(p-1,D+N)),F,D]},h})(Na),n.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},n}var bc=function(n,t){n.children,n.direction,n.height,n.layout,n.innerTagName,n.outerTagName,n.width,t.instance},yc=50,Kt=function(n,t,r){var o=n,a=o.itemSize,i=r.itemMetadataMap,s=r.lastMeasuredIndex;if(t>s){var u=0;if(s>=0){var d=i[s];u=d.offset+d.size}for(var f=s+1;f<=t;f++){var m=a(f);i[f]={offset:u,size:m},u+=m}r.lastMeasuredIndex=t}return i[t]},Cc=function(n,t,r){var o=t.itemMetadataMap,a=t.lastMeasuredIndex,i=a>0?o[a].offset:0;return i>=r?$a(n,t,a,0,r):xc(n,t,Math.max(0,a),r)},$a=function(n,t,r,o,a){for(;o<=r;){var i=o+Math.floor((r-o)/2),s=Kt(n,i,t).offset;if(s===a)return i;s<a?o=i+1:s>a&&(r=i-1)}return o>0?o-1:0},xc=function(n,t,r,o){for(var a=n.itemCount,i=1;r<a&&Kt(n,r,t).offset<o;)r+=i,i*=2;return $a(n,t,Math.min(r,a-1),Math.floor(r/2),o)},Io=function(n,t){var r=n.itemCount,o=t.itemMetadataMap,a=t.estimatedItemSize,i=t.lastMeasuredIndex,s=0;if(i>=r&&(i=r-1),i>=0){var u=o[i];s=u.offset+u.size}var d=r-i-1,f=d*a;return s+f},wc=vc({getItemOffset:function(n,t,r){return Kt(n,t,r).offset},getItemSize:function(n,t,r){return r.itemMetadataMap[t].size},getEstimatedTotalSize:Io,getOffsetForIndexAndAlignment:function(n,t,r,o,a,i){var s=n.direction,u=n.height,d=n.layout,f=n.width,m=s==="horizontal"||d==="horizontal",h=m?f:u,x=Kt(n,t,a),w=Io(n,a),c=Math.max(0,Math.min(w-h,x.offset)),p=Math.max(0,x.offset-h+x.size+i);switch(r==="smart"&&(o>=p-h&&o<=c+h?r="auto":r="center"),r){case"start":return c;case"end":return p;case"center":return Math.round(p+(c-p)/2);case"auto":default:return o>=p&&o<=c?o:o<p?p:c}},getStartIndexForOffset:function(n,t,r){return Cc(n,r,t)},getStopIndexForStartIndex:function(n,t,r,o){for(var a=n.direction,i=n.height,s=n.itemCount,u=n.layout,d=n.width,f=a==="horizontal"||u==="horizontal",m=f?d:i,h=Kt(n,t,o),x=r+m,w=h.offset+h.size,c=t;c<s-1&&w<x;)c++,w+=Kt(n,c,o).size;return c},initInstanceProps:function(n,t){var r=n,o=r.estimatedItemSize,a={itemMetadataMap:{},estimatedItemSize:o||yc,lastMeasuredIndex:-1};return t.resetAfterIndex=function(i,s){s===void 0&&(s=!0),a.lastMeasuredIndex=Math.min(a.lastMeasuredIndex,i-1),t._getItemStyleCache(-1),s&&t.forceUpdate()},a},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(n){n.itemSize}});function $c({isActive:e,isNew:n,isDisabled:t,data:r,eventsEmit:o,styles:a={},assistantList:i=[]}){const[s,u]=Ie(!1),d=(a==null?void 0:a.colors)||{},f=Ge(()=>{const p=r==null?void 0:r.configId;if(!p||!i||i.length===0)return"\u672A\u9009\u62E9\u52A9\u624B";const C=i.find(b=>String(b==null?void 0:b.id)===String(p));if(!C)return"\u672A\u9009\u62E9\u52A9\u624B";if(C!=null&&C.name)return C.name;try{const b=typeof C.configJson=="string"?JSON.parse(C.configJson):C.configJson;return(b==null?void 0:b.config_name)||"\u672A\u9009\u62E9\u52A9\u624B"}catch{return"\u672A\u9009\u62E9\u52A9\u624B"}},[i,r==null?void 0:r.configId]),m=[{key:"rename",icon:$(Ei,{size:12}),label:"\u91CD\u547D\u540D",onClick:p=>{p.domEvent.stopPropagation(),o&&o("conversations:rename_icon_clicked",r)}},{key:"delete",icon:$(Ni,{size:12}),label:"\u5220\u9664",danger:!0,onClick:p=>{p.domEvent.stopPropagation(),o&&o("conversations:delete_icon_clicked",r)}}],h=e?d.activeItemBg||"#f0f4ff":s?d.itemHoverBg||"#f5f7fa":d.itemBg||"transparent",x=e?d.activeItemText||d.primary||"#0122ff":d.itemText||"#333",w=e?d.activeItemBorder||d.primary||"#0122ff":"transparent",c=p=>{const C=Kr(),b=Kr(p);return C.isSame(b,"day")?b.format("HH:mm"):b.format("MM-DD HH:mm")};return Y("div",{className:"flex relative items-center justify-between mb-2 px-4 py-3 rounded-md transition-colors cursor-pointer select-none",onClick:()=>!t&&o&&o("conversation:item_click",r),onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),style:{minHeight:48,background:h,color:x,border:`1px solid ${w}`,...a.item,opacity:t?.5:1},children:[Y("div",{className:"flex flex-col gap-y-2 flex-1 min-w-0",children:[$("span",{className:"truncate text-sm max-w-[160px] font-medium",title:r.label||"\u672A\u547D\u540D\u4F1A\u8BDD",style:{color:x,fontSize:"14px",lineHeight:"1.4"},children:r.label||"\u672A\u547D\u540D\u4F1A\u8BDD"}),Y("div",{className:"flex items-center justify-between gap-2",children:[$("span",{className:"text-xs truncate flex-1",style:{color:e?d.activeItemTextSecondary||"#666":d.itemTextSecondary||"#666",fontSize:"12px",lineHeight:"1.3"},children:f}),r.gmtModified&&$("span",{className:"text-xs flex-shrink-0",style:{color:e?d.activeItemTextSecondary||"#999":d.itemTextSecondary||"#999",fontSize:"12px",lineHeight:"1.3"},children:c(r.gmtModified)})]})]}),!t&&s&&!n&&$("div",{className:"absolute top-2 right-3",children:$(ha,{menu:{items:m},trigger:["click"],placement:"bottomRight",children:$(wi,{size:16,className:"text-gray-600 hover:text-gray-800",style:{cursor:"pointer",color:e?d.activeItemTextSecondary||"#999":d.itemTextSecondary||"#999"},onClick:p=>p.stopPropagation()})})})]})}function Ic(e,n=[{label:"\u5F53\u5929",dayPeriod:1}]){const t=new Date,r={other:[]};return e.forEach(o=>{const a=new Date(o.gmtModified),i=Math.floor((+t-+a)/(1e3*60*60*24));let s=!1;for(const u of n)if(i<=u.dayPeriod){r[u.label]||(r[u.label]=[]),r[u.label].push(o),s=!0;break}s||r.other.push(o)}),r}function Sc(e){const{data:n,activedItem:t,onChange:r,onDelete:o,sortRules:a=[{label:"\u5F53\u5929",dayPeriod:1}],eventsEmit:i,assistantList:s,height:u=400,styles:d={},hasMore:f=!1,loadingMore:m=!1}=e,h=n.map(N=>N.sessionId+"-"+N.gmtModified).join(","),x=Ge(()=>{const N=a.length>0?a:[{label:"\u5F53\u5929",dayPeriod:1}],E=Ic(n,N),_=N.every(k=>!E[k.label]||E[k.label].length===0),T=[];return N.forEach(k=>{E[k.label]&&E[k.label].length>0&&(T.push({type:"group",label:k.label}),E[k.label].forEach(M=>T.push({type:"item",data:M})))}),E.other.length>0&&!_&&(T.push({type:"group",label:"\u5176\u4ED6"}),E.other.forEach(k=>T.push({type:"item",data:k}))),_&&E.other.length>0&&E.other.forEach(k=>T.push({type:"item",data:k})),T},[n,a,h]),w=Ge(()=>x.map(N=>N.type==="group"?`g:${N.label}`:`i:${N.data.sessionId}`).join("|"),[x]),c=56,p=14,C=36,b=N=>N===x.length?C:x[N].type==="group"?32:c+p,I=Xe(null),S=Ge(()=>x.findIndex(N=>{var E;return N.type==="item"&&((E=N.data)==null?void 0:E.sessionId)===t}),[x,t]),y=Ge(()=>x.findIndex(N=>N.type==="item"),[x]),F=Xe(void 0);je(()=>{const N=F.current;t!==N&&S>-1&&S===y&&I.current&&I.current.scrollToItem(S,"start"),F.current=t},[t,S,y]);const D=Xe(0);if(je(()=>{if(I.current){const N=D.current,E=x.length;D.current=E,E!==N&&I.current.resetAfterIndex(Math.max(0,Math.min(N,E)-1),!1)}},[x.length]),je(()=>{I.current&&I.current.resetAfterIndex(0,!1)},[w]),x.length===0)return $("div",{className:"text-center text-zinc-400 py-8",children:"\u6682\u65E0\u4F1A\u8BDD"});const O=(d==null?void 0:d.colors)||{};return $(di,{flipKey:h,spring:{stiffness:180,damping:18},children:$(wc,{ref:I,height:u,width:"100%",itemCount:x.length+1,itemSize:b,itemKey:N=>{if(N===x.length)return"footer";const E=x[N];return E.type==="item"?E.data.sessionId:`group-${E.label}`},onItemsRendered:({visibleStopIndex:N})=>{f&&!m&&N>=x.length-1-3&&typeof i=="function"&&i("conversations:load_more")},style:{overflowX:"hidden"},children:({index:N,style:E})=>{if(N===x.length){const T=(d==null?void 0:d.colors)||{};return $("div",{style:{...E,height:C,lineHeight:`${C}px`,textAlign:"center",fontSize:"10px",color:T.textMuted||"#9ca3af",background:T.groupBg||"white"},children:m?"\u52A0\u8F7D\u4E2D...":f?"":"\u6CA1\u6709\u66F4\u591A\u4E86"})}const _=x[N];return _.type==="group"?$("div",{style:{...E,background:O.groupBg||"white",zIndex:1},className:"pt-2 pb-1 px-[28px] py-[2px] text-xs text-gray-400",children:_.label}):$(pi,{flipId:_.data.sessionId,children:$("div",{style:E,className:"px-[12px] py-[2px]",children:$($c,{isActive:t===_.data.sessionId,isDisabled:!1,isNew:_.data.isNew,data:_.data,eventsEmit:i,assistantList:s,styles:d})})},_.data.sessionId)}})})}const Ec=({value:e,eventsEmit:n,setSearch:t,style:r,styles:o={}})=>{const a=o.colors||{},i=o.radius||"12px",s=a.border||"#e5e7eb",u=a.primary||"#2563eb",d=o.headerBg||a.sidebarBg||a.background||"#fff",[f,m]=Be.useState(!1);return Y("div",{className:"flex items-center gap-2 px-4 py-3 sticky top-0 z-10 min-w-0",style:{...r,background:d,borderTopLeftRadius:i,borderTopRightRadius:i},children:[$("button",{className:"border-none flex items-center justify-center",onClick:()=>{m(!1),n&&n("conversation:create")},title:"\u65B0\u5EFA\u4F1A\u8BDD",style:{height:42,borderRadius:"90px",background:u,color:a.buttonText||"#fff",fontWeight:600,boxShadow:o.shadow||"0 2px 8px 0 rgba(0,0,0,0.04)",padding:f?"0 0":"0 14px",minWidth:f?0:180,width:f?0:void 0,opacity:f?0:1,overflow:"hidden",flexShrink:0,transition:"width .22s ease, min-width .22s ease, padding .22s ease, opacity .18s ease"},children:Y("div",{className:"flex items-center gap-2",children:[$(Xo,{size:18}),$("span",{className:"text-sm",children:"\u65B0\u5EFA\u5BF9\u8BDD"})]})}),f?Y("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[$("input",{className:"flex-1 px-3 py-2 text-sm transition-all",placeholder:"\u641C\u7D22\u4F1A\u8BDD...",value:e,onChange:h=>t(h.target.value),onBlur:()=>m(!1),onKeyDown:h=>{h.key==="Enter"&&m(!1)},style:{minWidth:0,width:"100%",maxWidth:"100%",borderRadius:i,background:a.inputBg||"#f4f4f5",border:`1px solid ${s}`,color:a.text||"#222",outline:"none"}}),$("button",{className:"flex items-center justify-center transition-colors",style:{width:36,height:36,borderRadius:"90px",border:`1px solid ${s}`,color:a.text||"#222",flexShrink:0},onClick:()=>m(!1),title:"\u6536\u8D77\u641C\u7D22",children:$(Pr,{size:16})})]}):$("button",{className:"ml-auto flex items-center justify-center transition-colors",style:{width:36,height:36,borderRadius:"90px",border:`1px solid ${s}`,color:u,flexShrink:0},onClick:()=>m(!0),title:"\u641C\u7D22",children:$(Fi,{size:18})})]})};function Fc(e){const{data:n,sortRules:t,activedItem:r,eventsEmit:o,assistantList:a,styles:i={},hasMore:s=!1,loadingMore:u=!1}=e,[d,f]=Ie(""),m=Ge(()=>d?n.filter(y=>(y.label||"\u672A\u547D\u540D\u4F1A\u8BDD").toLowerCase().includes(d.toLowerCase())):n,[n,d]),h=Ge(()=>[...m].sort((y,F)=>new Date(F.gmtModified).getTime()-new Date(y.gmtModified).getTime()),[m]),x=Xe(null),[w,c]=Ie(400);je(()=>{function y(){x.current&&c(x.current.clientHeight)}return y(),window.addEventListener("resize",y),()=>window.removeEventListener("resize",y)},[]);const p=(i==null?void 0:i.colors)||{};i!=null&&i.radius;const C=(i==null?void 0:i.shadow)||"0 4px 24px 0 rgba(0,0,0,0.06)",b=p.border||"#e5e7eb",I=p.sidebarBg||p.background||"#EAEEFF",S=p.text||"#222";return Y("div",{className:"h-full flex flex-col overflow-y-hidden",style:{background:I,color:S,boxShadow:C,border:`1px solid ${b}`,...i.container},children:[$(Ec,{value:d,setSearch:f,eventsEmit:o,style:i.header,styles:i}),Y("div",{className:"flex-1 min-h-0 relative",ref:x,style:i.list,children:[$(Sc,{eventsEmit:o,data:h,assistantList:a,activedItem:r,sortRules:t,height:w,styles:i,hasMore:s,loadingMore:u}),$("div",{className:"pointer-events-none absolute left-0 right-0 top-0 h-3 z-20",style:{background:`linear-gradient(to bottom, ${I}cc, transparent)`}})]})]})}const Nc=(e,n)=>{let t=e&&e.replace(/<think>[\s\S]*?<\/think>/g,"");t=t.replace(/\[retrive-tag[^\]]*\][\s\S]*?\[\/retrive-tag\]/g,""),t=t.replace(/<a\s+[^>]*>(.*?)<\/a>/g,""),console.log("_content",t);const r=new mi(n.currentTarget||n.target,{text:()=>t});try{r.on("success",()=>{Re.success("\u6587\u672C\u590D\u5236\u6210\u529F",2),r.destroy()}),r.on("error",o=>{Re.error("\u590D\u5236\u5931\u8D25",2),r.destroy()}),r.onClick(n)}catch(o){r.destroy(),Re.error("\u590D\u5236\u5931\u8D25: "+o,2)}},So=e=>{const n=e.toLowerCase().split(".").pop()||"";return/^(jpg|jpeg|png|gif|bmp|webp)$/.test(n)?"image":/^(doc|docx)$/.test(n)?"word":/^(xls|xlsx|csv)$/.test(n)?"excel":/^(ppt|pptx)$/.test(n)?"ppt":n==="pdf"?"pdf":/^(txt|json|md|markdown)$/.test(n)?"text":/^(zip|rar|7z)$/.test(n)?"archive":"file"};function Oc(e){const n=[];for(const t of e){if(t.query){const r=t.query.queryId||t.query.id||t.queryId||t.id||Ht(32);n.push({istype:"user",content:t.query.content,time:t.query.gmtCreate,queryId:r,clientSideId:r+"-user",...t.query})}if(t.reply){const r=t.reply.queryId||t.reply.id||t.queryId||t.id||Ht(32);n.push({istype:"ai",content:t.reply.content,isDefault:t.reply.isDefault,time:t.time||t.gmtCreate||Date.now(),queryId:r,clientSideId:r+"-ai",...t.reply})}}return n}const Eo=async(e,n,t)=>{try{rt.post(`${e.url}/qa/feedback`,n,{headers:{Authorization:e.token,"X-CSRF-TOKEN-IN":e.CSRFToken||""}}).then(r=>{r.data.success&&t&&t()})}catch(r){console.log("error",r)}},nr=async(e,n,t)=>{try{rt.delete(`${e.url}/qa/feedback/cancel?queryId=${n.queryId}`,{headers:{Authorization:e.token,"X-CSRF-TOKEN-IN":e.CSRFToken||""}}).then(r=>{r.data.success&&t&&t()})}catch(r){console.log("error",r)}},Dc=(e,n)=>{try{rt.get(`${e.url}/qa/feedback/que/list`,{headers:{Authorization:e.token}}).then(t=>{t.data.success&&n&&n(t.data.data)})}catch(t){console.log("error",t)}},Pc=async(e,n,t)=>{try{rt.post(`${e.url}/qa/dialogue/reName`,n,{headers:{Authorization:e.token,"X-CSRF-TOKEN-IN":e.CSRFToken||""}}).then(r=>{r.data.success?t&&t(r):Re.error("\u7F16\u8F91\u540D\u5B57\u5931\u8D25")}).catch(r=>{var o,a;(a=(o=r==null?void 0:r.response)==null?void 0:o.data)!=null&&a.errorMsg&&Re.error(r.response.data.errorMsg)})}catch(r){console.log("error",r)}},Ac=async(e,n,t)=>{try{rt.delete(`${e.url}/qa/dialogue/delete?sessionId=${n.sessionId}`,{headers:{Authorization:e.token,"X-CSRF-TOKEN-IN":e.CSRFToken||""}}).then(r=>{r.data.success&&t&&t(r.data)})}catch(r){console.log("error",r)}},kc=async(e,n,t)=>{console.log("[DEBUG] handleCreateConversation \u8BF7\u6C42",{url:e.url,token:e.token,data:n});try{rt.post(`${e.url}/qa/dialogue/create`,n,{headers:{Authorization:e.token,"X-CSRF-TOKEN-IN":e.CSRFToken||""}}).then(r=>{r.data.success?t&&t(r.data):Re.error(r.data.errorMsg||"\u521B\u5EFA\u4F1A\u8BDD\u5931\u8D25")}).catch(r=>{var o,a;(a=(o=r==null?void 0:r.response)==null?void 0:o.data)!=null&&a.errorMsg&&Re.error(r.response.data.errorMsg)})}catch(r){console.log("error",r)}},Mc=async(e,n,t)=>{try{const{uid:r,queryId:o}=n;let a=`${e.url}/index/knowledgeBase/file/deleteByUid?uid=${r}`;o&&(a+=`&queryId=${o}`),rt.delete(a,{headers:{Authorization:e.token,"X-CSRF-TOKEN-IN":e.CSRFToken||""}}).then(i=>{i.data.success?t&&t(!0,i):t&&t(!1,i)}).catch(i=>{t&&t(!1,i)})}catch(r){t&&t(!1,r)}},Rc=""+new URL("assets/defaultWeLogo.svg",import.meta.url).href,Bc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAOkSURBVHgBxZRbTBxlFMd/c2EvXBbZLbsCVhcKaAyh2BKTWrX12RhNmxa1IVp98FEJVGNMY2KItSZtqGjaROMlaDSVxiZeqiRa0FBpIlSkhgK15WoLu7AL3V1md25+7CpUojzYB7/km5OZc+Z35pzz/wb+l3X7PotNL9tvd1yIc8OrYp9pWXZ6JXXdfLOtbdNa4fJazoZdu9xVNUE5petIVS9h/npRfkDKefg/A+OaJuUGvIz3DzD14R6uHv/WCmzbcuNlj7S+3z7+5Xepno7TLeJWWiv2n5zyTcEaT/TJlrfwljxCTm42lgHRmIHDqaIqIsTE43NS7FHCBXKkIzw4eGKkYcdnwmGvBspSy+DpxlrffXtqC6WeqM3+CZ3wnAZLOyXAlsXfOjU7D6EYHLw7zVKvgykcG+r98YmKjdG5BK3nw7w7YQuATdAJWR4IJ2UiswKoiC39+S0+4QjNL0NWgDU7y57ZVlLd2n+FO/Kd7BxxcPOpMKGrCSxNTNm2kVUZ2e1g+5YCxh4q4IW+cAactYTZLi6dxgqw4dUjj+UgfXpSJRAaY9Lt4dZAkoW5YWSXyKwo6ZYbhsFCciPe9hgHtDiB+kqe6huF6jknv2As9/Dj3mv2se4Yh5RhEr4SbD2FpMjomkZ0eoaunl5yxXwqKsspKwsiOVzYqST143k8Xe7gvaN17tHOTi0D/D6U3DqhO7oNNxOlU6heD0cOH2frg/dSU1ywMgRhRmMpvvjoG55t3I0RWWDvuST9iy5q64qtr2/LV9Ill/aNOsb9fnC48a+zGYzF6R/opefsGU59sl88d6V5tpagqekNFg2LgeHN3F/pJS9rET2l4v15Ruav1PHLEdsUJYpXcNjXKA54iCd11gf9ONUkLqeVtu4ciQUjwcCF3wjc4sUlJbhouyjOVek6O2kvT3kGV3e9P/uetlmhi4VpCsU0Wz5o5i6/kIehY8UjyHlLpVt8daKZc1d0qt3zaV2ex09LjYvnhsx3rj8pEq90N1QU+Q+9WJVgbzBPpFIzIrZNsYWVlYyVhJXVtFys6UHWf76O36NDu3nt0fbVJ0Wm6Sedomx5hzPCwYpJygvdkOMVQhbKFjrEFG2JRQjPTHH4Uh4HoptFfy2T5+9clt/qo6fS9MMYilqEL1dCyCQtQsnKhC51yUyCkBLz4qeT77Np3KCme/EvwJVndUcfl0qr6uzKwAb8biemqTCjmYS0RUKhM1zuep2TzZfIpFlefwDISXe8s31UTQAAAABJRU5ErkJggg==",Tc=(e,n)=>{const t={...Dr.colors,...e};return`
|
|
92
|
+
`]:{zIndex:10,width:r,margin:`0 ${ne(e.marginXXS)}`,fontSize:r,cursor:"pointer",transition:`all ${e.motionDurationSlow}`,color:o,"&:hover":{color:o},svg:{verticalAlign:"baseline"}}},[`${s}-thumbnail, ${s}-thumbnail img`]:{position:"static",display:"block",width:"100%",height:"100%",objectFit:"contain"},[`${s}-name`]:{display:"none",textAlign:"center"},[`${s}-file + ${s}-name`]:{position:"absolute",bottom:e.margin,display:"block",width:`calc(100% - ${ne(a(e.paddingXS).mul(2).equal())})`},[`${s}-uploading`]:{[`&${s}`]:{backgroundColor:e.colorFillAlter},[`&::before, ${t}-eye, ${t}-download, ${t}-delete`]:{display:"none"}},[`${s}-progress`]:{bottom:e.marginXL,width:`calc(100% - ${ne(a(e.paddingXS).mul(2).equal())})`,paddingInlineStart:0}}}),[`${n}-wrapper${n}-picture-circle-wrapper`]:{[`${n}${n}-select`]:{borderRadius:"50%"}}}},Tl=e=>{const{componentCls:n}=e;return{[`${n}-rtl`]:{direction:"rtl"}}},_l=e=>{const{componentCls:n,colorTextDisabled:t}=e;return{[`${n}-wrapper`]:Object.assign(Object.assign({},On(e)),{[n]:{outline:0,"input[type='file']":{cursor:"pointer"}},[`${n}-select`]:{display:"inline-block"},[`${n}-hidden`]:{display:"none"},[`${n}-disabled`]:{color:t,cursor:"not-allowed"}})}},zl=e=>({actionsColor:e.colorIcon,pictureCardSize:e.controlHeightLG*2.55}),jl=cn("Upload",e=>{const{fontSizeHeading3:n,fontHeight:t,lineWidth:r,pictureCardSize:o,calc:a}=e,i=sn(e,{uploadThumbnailSize:a(n).mul(2).equal(),uploadProgressOffset:a(a(t).div(2)).add(r).equal(),uploadPicCardSize:o});return[_l(i),Al(i),Rl(i),Bl(i),kl(i),Ml(i),Tl(i),_o(i)]},zl);var Ll={icon:function(n,t){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M534 352V136H232v752h560V394H576a42 42 0 01-42-42z",fill:t}},{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM602 137.8L790.2 326H602V137.8zM792 888H232V136h302v216a42 42 0 0042 42h216v494z",fill:n}}]}},name:"file",theme:"twotone"},Hl=function(n,t){return l.createElement(Jt,De({},n,{ref:t,icon:Ll}))},ql=l.forwardRef(Hl),Ul={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"}}]},name:"paper-clip",theme:"outlined"},Wl=function(n,t){return l.createElement(Jt,De({},n,{ref:t,icon:Ul}))},Vl=l.forwardRef(Wl),Kl={icon:function(n,t){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2z",fill:n}},{tag:"path",attrs:{d:"M424.6 765.8l-150.1-178L136 752.1V792h752v-30.4L658.1 489z",fill:t}},{tag:"path",attrs:{d:"M136 652.7l132.4-157c3.2-3.8 9-3.8 12.2 0l144 170.7L652 396.8c3.2-3.8 9-3.8 12.2 0L888 662.2V232H136v420.7zM304 280a88 88 0 110 176 88 88 0 010-176z",fill:t}},{tag:"path",attrs:{d:"M276 368a28 28 0 1056 0 28 28 0 10-56 0z",fill:t}},{tag:"path",attrs:{d:"M304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z",fill:n}}]}},name:"picture",theme:"twotone"},Xl=function(n,t){return l.createElement(Jt,De({},n,{ref:t,icon:Kl}))},Gl=l.forwardRef(Xl);function bn(e){return Object.assign(Object.assign({},e),{lastModified:e.lastModified,lastModifiedDate:e.lastModifiedDate,name:e.name,size:e.size,type:e.type,uid:e.uid,percent:0,originFileObj:e})}function yn(e,n){const t=Ye(n),r=t.findIndex(({uid:o})=>o===e.uid);return r===-1?t.push(e):t[r]=e,t}function Zn(e,n){const t=e.uid!==void 0?"uid":"name";return n.filter(r=>r[t]===e[t])[0]}function Jl(e,n){const t=e.uid!==void 0?"uid":"name",r=n.filter(o=>o[t]!==e[t]);return r.length===n.length?null:r}const Yl=(e="")=>{const n=e.split("/"),r=n[n.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(r)||[""])[0]},xa=e=>e.indexOf("image/")===0,Ql=e=>{if(e.type&&!e.thumbUrl)return xa(e.type);const n=e.thumbUrl||e.url||"",t=Yl(n);return/^data:image\//.test(n)||/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(t)?!0:!(/^data:/.test(n)||t)},Rt=200;function Zl(e){return new Promise(n=>{if(!e.type||!xa(e.type)){n("");return}const t=document.createElement("canvas");t.width=Rt,t.height=Rt,t.style.cssText=`position: fixed; left: 0; top: 0; width: ${Rt}px; height: ${Rt}px; z-index: 9999; display: none;`,document.body.appendChild(t);const r=t.getContext("2d"),o=new Image;if(o.onload=()=>{const{width:a,height:i}=o;let s=Rt,u=Rt,d=0,f=0;a>i?(u=i*(Rt/a),f=-(u-s)/2):(s=a*(Rt/i),d=-(s-u)/2),r.drawImage(o,d,f,s,u);const m=t.toDataURL();document.body.removeChild(t),window.URL.revokeObjectURL(o.src),n(m)},o.crossOrigin="anonymous",e.type.startsWith("image/svg+xml")){const a=new FileReader;a.onload=()=>{a.result&&typeof a.result=="string"&&(o.src=a.result)},a.readAsDataURL(e)}else if(e.type.startsWith("image/gif")){const a=new FileReader;a.onload=()=>{a.result&&n(a.result)},a.readAsDataURL(e)}else o.src=window.URL.createObjectURL(e)})}var ec={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"},tc=function(n,t){return l.createElement(Jt,De({},n,{ref:t,icon:ec}))},nc=l.forwardRef(tc);const rc=l.forwardRef(({prefixCls:e,className:n,style:t,locale:r,listType:o,file:a,items:i,progress:s,iconRender:u,actionIconRender:d,itemRender:f,isImgUrl:m,showPreviewIcon:v,showRemoveIcon:x,showDownloadIcon:w,previewIcon:c,removeIcon:p,downloadIcon:C,extra:b,onPreview:I,onDownload:S,onClose:y},F)=>{var D,O;const{status:N}=a,[E,_]=l.useState(N);l.useEffect(()=>{N!=="removed"&&_(N)},[N]);const[T,k]=l.useState(!1);l.useEffect(()=>{const we=setTimeout(()=>{k(!0)},300);return()=>{clearTimeout(we)}},[]);const M=u(a);let B=l.createElement("div",{className:`${e}-icon`},M);if(o==="picture"||o==="picture-card"||o==="picture-circle")if(E==="uploading"||!a.thumbUrl&&!a.url){const we=Z(`${e}-list-item-thumbnail`,{[`${e}-list-item-file`]:E!=="uploading"});B=l.createElement("div",{className:we},M)}else{const we=m!=null&&m(a)?l.createElement("img",{src:a.thumbUrl||a.url,alt:a.name,className:`${e}-list-item-image`,crossOrigin:a.crossOrigin}):M,Te=Z(`${e}-list-item-thumbnail`,{[`${e}-list-item-file`]:m&&!m(a)});B=l.createElement("a",{className:Te,onClick:Je=>I(a,Je),href:a.url||a.thumbUrl,target:"_blank",rel:"noopener noreferrer"},we)}const V=Z(`${e}-list-item`,`${e}-list-item-${E}`),j=typeof a.linkProps=="string"?JSON.parse(a.linkProps):a.linkProps,U=(typeof x=="function"?x(a):x)?d((typeof p=="function"?p(a):p)||l.createElement(Sl,null),()=>y(a),e,r.removeFile,!0):null,K=(typeof w=="function"?w(a):w)&&E==="done"?d((typeof C=="function"?C(a):C)||l.createElement(nc,null),()=>S(a),e,r.downloadFile):null,L=o!=="picture-card"&&o!=="picture-circle"&&l.createElement("span",{key:"download-delete",className:Z(`${e}-list-item-actions`,{picture:o==="picture"})},K,U),q=typeof b=="function"?b(a):b,ee=q&&l.createElement("span",{className:`${e}-list-item-extra`},q),R=Z(`${e}-list-item-name`),W=a.url?l.createElement("a",Object.assign({key:"view",target:"_blank",rel:"noopener noreferrer",className:R,title:a.name},j,{href:a.url,onClick:we=>I(a,we)}),a.name,ee):l.createElement("span",{key:"view",className:R,onClick:we=>I(a,we),title:a.name},a.name,ee),J=(typeof v=="function"?v(a):v)&&(a.url||a.thumbUrl)?l.createElement("a",{href:a.url||a.thumbUrl,target:"_blank",rel:"noopener noreferrer",onClick:we=>I(a,we),title:r.previewFile},typeof c=="function"?c(a):c||l.createElement(ri,null)):null,oe=(o==="picture-card"||o==="picture-circle")&&E!=="uploading"&&l.createElement("span",{className:`${e}-list-item-actions`},J,E==="done"&&K,U),{getPrefixCls:ae}=l.useContext(wt),Q=ae(),ie=l.createElement("div",{className:V},B,W,L,oe,T&&l.createElement(Er,{motionName:`${Q}-fade`,visible:E==="uploading",motionDeadline:2e3},({className:we})=>{const Te="percent"in a?l.createElement(wl,Object.assign({type:"line",percent:a.percent,"aria-label":a["aria-label"],"aria-labelledby":a["aria-labelledby"]},s)):null;return l.createElement("div",{className:Z(`${e}-list-item-progress`,we)},Te)})),Ce=a.response&&typeof a.response=="string"?a.response:((D=a.error)===null||D===void 0?void 0:D.statusText)||((O=a.error)===null||O===void 0?void 0:O.message)||r.uploadError,xe=E==="error"?l.createElement(Fr,{title:Ce,getPopupContainer:we=>we.parentNode},ie):ie;return l.createElement("div",{className:Z(`${e}-list-item-container`,n),style:t,ref:F},f?f(xe,a,i,{download:S.bind(null,a),preview:I.bind(null,a),remove:y.bind(null,a)}):xe)}),oc=(e,n)=>{const{listType:t="text",previewFile:r=Zl,onPreview:o,onDownload:a,onRemove:i,locale:s,iconRender:u,isImageUrl:d=Ql,prefixCls:f,items:m=[],showPreviewIcon:v=!0,showRemoveIcon:x=!0,showDownloadIcon:w=!1,removeIcon:c,previewIcon:p,downloadIcon:C,extra:b,progress:I={size:[-1,2],showInfo:!1},appendAction:S,appendActionVisible:y=!0,itemRender:F,disabled:D}=e,[,O]=oi(),[N,E]=l.useState(!1),_=["picture-card","picture-circle"].includes(t);l.useEffect(()=>{t.startsWith("picture")&&(m||[]).forEach(R=>{!(R.originFileObj instanceof File||R.originFileObj instanceof Blob)||R.thumbUrl!==void 0||(R.thumbUrl="",r==null||r(R.originFileObj).then(W=>{R.thumbUrl=W||"",O()}))})},[t,m,r]),l.useEffect(()=>{E(!0)},[]);const T=(R,W)=>{if(o)return W==null||W.preventDefault(),o(R)},k=R=>{typeof a=="function"?a(R):R.url&&window.open(R.url)},M=R=>{i==null||i(R)},B=R=>{if(u)return u(R,t);const W=R.status==="uploading";if(t.startsWith("picture")){const J=t==="picture"?l.createElement(Vr,null):s.uploading,oe=d!=null&&d(R)?l.createElement(Gl,null):l.createElement(ql,null);return W?J:oe}return W?l.createElement(Vr,null):l.createElement(Vl,null)},V=(R,W,J,oe,ae)=>{const Q={type:"text",size:"small",title:oe,onClick:ie=>{var Ce,xe;W(),l.isValidElement(R)&&((xe=(Ce=R.props).onClick)===null||xe===void 0||xe.call(Ce,ie))},className:`${J}-list-item-action`,disabled:ae?D:!1};return l.isValidElement(R)?l.createElement(pt,Object.assign({},Q,{icon:Gt(R,Object.assign(Object.assign({},R.props),{onClick:()=>{}}))})):l.createElement(pt,Object.assign({},Q),l.createElement("span",null,R))};l.useImperativeHandle(n,()=>({handlePreview:T,handleDownload:k}));const{getPrefixCls:j}=l.useContext(wt),U=j("upload",f),K=j(),L=Z(`${U}-list`,`${U}-list-${t}`),q=l.useMemo(()=>xt(Ho(K),["onAppearEnd","onEnterEnd","onLeaveEnd"]),[K]),ee=Object.assign(Object.assign({},_?{}:q),{motionDeadline:2e3,motionName:`${U}-${_?"animate-inline":"animate"}`,keys:Ye(m.map(R=>({key:R.uid,file:R}))),motionAppear:N});return l.createElement("div",{className:L},l.createElement(ai,Object.assign({},ee,{component:!1}),({key:R,file:W,className:J,style:oe})=>l.createElement(rc,{key:R,locale:s,prefixCls:U,className:J,style:oe,file:W,items:m,progress:I,listType:t,isImgUrl:d,showPreviewIcon:v,showRemoveIcon:x,showDownloadIcon:w,removeIcon:c,previewIcon:p,downloadIcon:C,extra:b,iconRender:B,actionIconRender:V,itemRender:F,onPreview:T,onDownload:k,onClose:M})),S&&l.createElement(Er,Object.assign({},ee,{visible:y,forceRender:!0}),({className:R,style:W})=>Gt(S,J=>({className:Z(J.className,R),style:Object.assign(Object.assign(Object.assign({},W),{pointerEvents:R?"none":void 0}),J.style)}))))},ac=l.forwardRef(oc);var ic=function(e,n,t,r){function o(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function s(f){try{d(r.next(f))}catch(m){i(m)}}function u(f){try{d(r.throw(f))}catch(m){i(m)}}function d(f){f.done?a(f.value):o(f.value).then(s,u)}d((r=r.apply(e,[])).next())})};const on=`__LIST_IGNORE_${Date.now()}__`,sc=(e,n)=>{const t=Or("upload"),{fileList:r,defaultFileList:o,onRemove:a,showUploadList:i=!0,listType:s="text",onPreview:u,onDownload:d,onChange:f,onDrop:m,previewFile:v,disabled:x,locale:w,iconRender:c,isImageUrl:p,progress:C,prefixCls:b,className:I,type:S="select",children:y,style:F,itemRender:D,maxCount:O,data:N={},multiple:E=!1,hasControlInside:_=!0,action:T="",accept:k="",supportServerRender:M=!0,rootClassName:B}=e,V=l.useContext(ii),j=x??V,U=e.customRequest||t.customRequest,[K,L]=Lt(o||[],{value:r,postState:G=>G??[]}),[q,ee]=l.useState("drop"),R=l.useRef(null),W=l.useRef(null);l.useMemo(()=>{const G=Date.now();(r||[]).forEach((pe,Fe)=>{!pe.uid&&!Object.isFrozen(pe)&&(pe.uid=`__AUTO__${G}_${Fe}__`)})},[r]);const J=(G,pe,Fe)=>{let se=Ye(pe),be=!1;O===1?se=se.slice(-1):O&&(be=se.length>O,se=se.slice(0,O)),lr(()=>{L(se)});const _e={file:G,fileList:se};Fe&&(_e.event=Fe),(!be||G.status==="removed"||se.some(at=>at.uid===G.uid))&&lr(()=>{f==null||f(_e)})},oe=(G,pe)=>ic(void 0,void 0,void 0,function*(){const{beforeUpload:Fe,transformFile:se}=e;let be=G;if(Fe){const _e=yield Fe(G,pe);if(_e===!1)return!1;if(delete G[on],_e===on)return Object.defineProperty(G,on,{value:!0,configurable:!0}),!1;typeof _e=="object"&&_e&&(be=_e)}return se&&(be=yield se(be)),be}),ae=G=>{const pe=G.filter(be=>!be.file[on]);if(!pe.length)return;const Fe=pe.map(be=>bn(be.file));let se=Ye(K);Fe.forEach(be=>{se=yn(be,se)}),Fe.forEach((be,_e)=>{let at=be;if(pe[_e].parsedFile)be.status="uploading";else{const{originFileObj:dt}=be;let tt;try{tt=new File([dt],dt.name,{type:dt.type})}catch{tt=new Blob([dt],{type:dt.type}),tt.name=dt.name,tt.lastModifiedDate=new Date,tt.lastModified=new Date().getTime()}tt.uid=be.uid,at=tt}J(at,se)})},Q=(G,pe,Fe)=>{try{typeof G=="string"&&(G=JSON.parse(G))}catch{}if(!Zn(pe,K))return;const se=bn(pe);se.status="done",se.percent=100,se.response=G,se.xhr=Fe;const be=yn(se,K);J(se,be)},ie=(G,pe)=>{if(!Zn(pe,K))return;const Fe=bn(pe);Fe.status="uploading",Fe.percent=G.percent;const se=yn(Fe,K);J(Fe,se,G)},Ce=(G,pe,Fe)=>{if(!Zn(Fe,K))return;const se=bn(Fe);se.error=G,se.response=pe,se.status="error";const be=yn(se,K);J(se,be)},xe=G=>{let pe;Promise.resolve(typeof a=="function"?a(G):a).then(Fe=>{var se;if(Fe===!1)return;const be=Jl(G,K);be&&(pe=Object.assign(Object.assign({},G),{status:"removed"}),K==null||K.forEach(_e=>{const at=pe.uid!==void 0?"uid":"name";_e[at]===pe[at]&&!Object.isFrozen(_e)&&(_e.status="removed")}),(se=R.current)===null||se===void 0||se.abort(pe),J(pe,be))})},we=G=>{ee(G.type),G.type==="drop"&&(m==null||m(G))};l.useImperativeHandle(n,()=>({onBatchStart:ae,onSuccess:Q,onProgress:ie,onError:Ce,fileList:K,upload:R.current,nativeElement:W.current}));const{getPrefixCls:Te,direction:Je,upload:Le}=l.useContext(wt),ve=Te("upload",b),me=Object.assign(Object.assign({onBatchStart:ae,onError:Ce,onProgress:ie,onSuccess:Q},e),{customRequest:U,data:N,multiple:E,action:T,accept:k,supportServerRender:M,prefixCls:ve,disabled:j,beforeUpload:oe,onChange:void 0,hasControlInside:_});delete me.className,delete me.style,(!y||j)&&delete me.id;const ct=`${ve}-wrapper`,[mt,$t,It]=jl(ve,ct),[At]=Uo("Upload",Wo.Upload),{showRemoveIcon:et,showPreviewIcon:qe,showDownloadIcon:St,removeIcon:kt,previewIcon:Mt,downloadIcon:Et,extra:Ae}=typeof i=="boolean"?{}:i,ce=typeof et>"u"?!j:et,nt=(G,pe)=>i?l.createElement(ac,{prefixCls:ve,listType:s,items:K,previewFile:v,onPreview:u,onDownload:d,onRemove:xe,showRemoveIcon:ce,showPreviewIcon:qe,showDownloadIcon:St,removeIcon:kt,previewIcon:Mt,downloadIcon:Et,iconRender:c,extra:Ae,locale:Object.assign(Object.assign({},At),w),isImageUrl:p,progress:C,appendAction:G,appendActionVisible:pe,itemRender:D,disabled:j}):G,ut=Z(ct,I,B,$t,It,Le==null?void 0:Le.className,{[`${ve}-rtl`]:Je==="rtl",[`${ve}-picture-card-wrapper`]:s==="picture-card",[`${ve}-picture-circle-wrapper`]:s==="picture-circle"}),ft=Object.assign(Object.assign({},Le==null?void 0:Le.style),F);if(S==="drag"){const G=Z($t,ve,`${ve}-drag`,{[`${ve}-drag-uploading`]:K.some(pe=>pe.status==="uploading"),[`${ve}-drag-hover`]:q==="dragover",[`${ve}-disabled`]:j,[`${ve}-rtl`]:Je==="rtl"});return mt(l.createElement("span",{className:ut,ref:W},l.createElement("div",{className:G,style:ft,onDrop:we,onDragOver:we,onDragLeave:we},l.createElement(gr,Object.assign({},me,{ref:R,className:`${ve}-btn`}),l.createElement("div",{className:`${ve}-drag-container`},y))),nt()))}const Ue=Z(ve,`${ve}-select`,{[`${ve}-disabled`]:j,[`${ve}-hidden`]:!y}),We=l.createElement("div",{className:Ue,style:ft},l.createElement(gr,Object.assign({},me,{ref:R})));return mt(s==="picture-card"||s==="picture-circle"?l.createElement("span",{className:ut,ref:W},nt(We,!!y)):l.createElement("span",{className:ut,ref:W},We,nt()))},wa=l.forwardRef(sc);var lc=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t};const cc=l.forwardRef((e,n)=>{const{style:t,height:r,hasControlInside:o=!1,children:a}=e,i=lc(e,["style","height","hasControlInside","children"]),s=Object.assign(Object.assign({},t),{height:r});return l.createElement(wa,Object.assign({ref:n,hasControlInside:o},i,{style:s,type:"drag"}),a)}),jr=wa;jr.Dragger=cc;jr.LIST_IGNORE=on;const bo={actions:[{icon:$(lt,{type:"rag/folder",size:18}),name:"history",badgeCount:0}],switchs:[{label:"\u8054\u7F51\u641C\u7D22",name:"netSearch",type:"checkbox",defaultValue:!1,enabled:!0,icon:$(lt,{type:"rag/url",size:12})},{label:"\u63A8\u7406\u601D\u8003",name:"reasoning",type:"checkbox",defaultValue:!1,enabled:!0,icon:$(lt,{type:"rag/think",size:12})}]};function uc(e,n){e.prototype=Object.create(n.prototype),e.prototype.constructor=e,si(e,n)}var yo=Number.isNaN||function(n){return typeof n=="number"&&n!==n};function dc(e,n){return!!(e===n||yo(e)&&yo(n))}function pc(e,n){if(e.length!==n.length)return!1;for(var t=0;t<e.length;t++)if(!dc(e[t],n[t]))return!1;return!0}function er(e,n){n===void 0&&(n=pc);var t,r=[],o,a=!1;function i(){for(var s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];return a&&t===this&&n(s,r)||(o=e.apply(this,s),a=!0,t=this,r=s),o}return i}var mc=typeof performance=="object"&&typeof performance.now=="function",Co=mc?function(){return performance.now()}:function(){return Date.now()};function xo(e){cancelAnimationFrame(e.id)}function fc(e,n){var t=Co();function r(){Co()-t>=n?e.call(null):o.id=requestAnimationFrame(r)}var o={id:requestAnimationFrame(r)};return o}var tr=-1;function wo(e){if(e===void 0&&(e=!1),tr===-1||e){var n=document.createElement("div"),t=n.style;t.width="50px",t.height="50px",t.overflow="scroll",document.body.appendChild(n),tr=n.offsetWidth-n.clientWidth,document.body.removeChild(n)}return tr}var Vt=null;function $o(e){if(e===void 0&&(e=!1),Vt===null||e){var n=document.createElement("div"),t=n.style;t.width="50px",t.height="50px",t.overflow="scroll",t.direction="rtl";var r=document.createElement("div"),o=r.style;return o.width="100px",o.height="100px",n.appendChild(r),document.body.appendChild(n),n.scrollLeft>0?Vt="positive-descending":(n.scrollLeft=1,n.scrollLeft===0?Vt="negative":Vt="positive-ascending"),document.body.removeChild(n),Vt}return Vt}var gc=150,hc=function(n,t){return n};function vc(e){var n,t=e.getItemOffset,r=e.getEstimatedTotalSize,o=e.getItemSize,a=e.getOffsetForIndexAndAlignment,i=e.getStartIndexForOffset,s=e.getStopIndexForStartIndex,u=e.initInstanceProps,d=e.shouldResetStyleCacheOnItemSizeChange,f=e.validateProps;return n=(function(m){uc(v,m);function v(w){var c;return c=m.call(this,w)||this,c._instanceProps=u(c.props,Ve(c)),c._outerRef=void 0,c._resetIsScrollingTimeoutId=null,c.state={instance:Ve(c),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof c.props.initialScrollOffset=="number"?c.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},c._callOnItemsRendered=void 0,c._callOnItemsRendered=er(function(p,C,b,I){return c.props.onItemsRendered({overscanStartIndex:p,overscanStopIndex:C,visibleStartIndex:b,visibleStopIndex:I})}),c._callOnScroll=void 0,c._callOnScroll=er(function(p,C,b){return c.props.onScroll({scrollDirection:p,scrollOffset:C,scrollUpdateWasRequested:b})}),c._getItemStyle=void 0,c._getItemStyle=function(p){var C=c.props,b=C.direction,I=C.itemSize,S=C.layout,y=c._getItemStyleCache(d&&I,d&&S,d&&b),F;if(y.hasOwnProperty(p))F=y[p];else{var D=t(c.props,p,c._instanceProps),O=o(c.props,p,c._instanceProps),N=b==="horizontal"||S==="horizontal",E=b==="rtl",_=N?D:0;y[p]=F={position:"absolute",left:E?void 0:_,right:E?_:void 0,top:N?0:D,height:N?"100%":O,width:N?O:"100%"}}return F},c._getItemStyleCache=void 0,c._getItemStyleCache=er(function(p,C,b){return{}}),c._onScrollHorizontal=function(p){var C=p.currentTarget,b=C.clientWidth,I=C.scrollLeft,S=C.scrollWidth;c.setState(function(y){if(y.scrollOffset===I)return null;var F=c.props.direction,D=I;if(F==="rtl")switch($o()){case"negative":D=-I;break;case"positive-descending":D=S-b-I;break}return D=Math.max(0,Math.min(D,S-b)),{isScrolling:!0,scrollDirection:y.scrollOffset<D?"forward":"backward",scrollOffset:D,scrollUpdateWasRequested:!1}},c._resetIsScrollingDebounced)},c._onScrollVertical=function(p){var C=p.currentTarget,b=C.clientHeight,I=C.scrollHeight,S=C.scrollTop;c.setState(function(y){if(y.scrollOffset===S)return null;var F=Math.max(0,Math.min(S,I-b));return{isScrolling:!0,scrollDirection:y.scrollOffset<F?"forward":"backward",scrollOffset:F,scrollUpdateWasRequested:!1}},c._resetIsScrollingDebounced)},c._outerRefSetter=function(p){var C=c.props.outerRef;c._outerRef=p,typeof C=="function"?C(p):C!=null&&typeof C=="object"&&C.hasOwnProperty("current")&&(C.current=p)},c._resetIsScrollingDebounced=function(){c._resetIsScrollingTimeoutId!==null&&xo(c._resetIsScrollingTimeoutId),c._resetIsScrollingTimeoutId=fc(c._resetIsScrolling,gc)},c._resetIsScrolling=function(){c._resetIsScrollingTimeoutId=null,c.setState({isScrolling:!1},function(){c._getItemStyleCache(-1,null)})},c}v.getDerivedStateFromProps=function(c,p){return bc(c,p),f(c),null};var x=v.prototype;return x.scrollTo=function(c){c=Math.max(0,c),this.setState(function(p){return p.scrollOffset===c?null:{scrollDirection:p.scrollOffset<c?"forward":"backward",scrollOffset:c,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},x.scrollToItem=function(c,p){p===void 0&&(p="auto");var C=this.props,b=C.itemCount,I=C.layout,S=this.state.scrollOffset;c=Math.max(0,Math.min(c,b-1));var y=0;if(this._outerRef){var F=this._outerRef;I==="vertical"?y=F.scrollWidth>F.clientWidth?wo():0:y=F.scrollHeight>F.clientHeight?wo():0}this.scrollTo(a(this.props,c,p,S,this._instanceProps,y))},x.componentDidMount=function(){var c=this.props,p=c.direction,C=c.initialScrollOffset,b=c.layout;if(typeof C=="number"&&this._outerRef!=null){var I=this._outerRef;p==="horizontal"||b==="horizontal"?I.scrollLeft=C:I.scrollTop=C}this._callPropsCallbacks()},x.componentDidUpdate=function(){var c=this.props,p=c.direction,C=c.layout,b=this.state,I=b.scrollOffset,S=b.scrollUpdateWasRequested;if(S&&this._outerRef!=null){var y=this._outerRef;if(p==="horizontal"||C==="horizontal")if(p==="rtl")switch($o()){case"negative":y.scrollLeft=-I;break;case"positive-ascending":y.scrollLeft=I;break;default:var F=y.clientWidth,D=y.scrollWidth;y.scrollLeft=D-F-I;break}else y.scrollLeft=I;else y.scrollTop=I}this._callPropsCallbacks()},x.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&xo(this._resetIsScrollingTimeoutId)},x.render=function(){var c=this.props,p=c.children,C=c.className,b=c.direction,I=c.height,S=c.innerRef,y=c.innerElementType,F=c.innerTagName,D=c.itemCount,O=c.itemData,N=c.itemKey,E=N===void 0?hc:N,_=c.layout,T=c.outerElementType,k=c.outerTagName,M=c.style,B=c.useIsScrolling,V=c.width,j=this.state.isScrolling,U=b==="horizontal"||_==="horizontal",K=U?this._onScrollHorizontal:this._onScrollVertical,L=this._getRangeToRender(),q=L[0],ee=L[1],R=[];if(D>0)for(var W=q;W<=ee;W++)R.push(Vn(p,{data:O,key:E(W,O),index:W,isScrolling:B?j:void 0,style:this._getItemStyle(W)}));var J=r(this.props,this._instanceProps);return Vn(T||k||"div",{className:C,onScroll:K,ref:this._outerRefSetter,style:De({position:"relative",height:I,width:V,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:b},M)},Vn(y||F||"div",{children:R,ref:S,style:{height:U?"100%":J,pointerEvents:j?"none":void 0,width:U?J:"100%"}}))},x._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var c=this.props.itemCount;if(c>0){var p=this._getRangeToRender(),C=p[0],b=p[1],I=p[2],S=p[3];this._callOnItemsRendered(C,b,I,S)}}if(typeof this.props.onScroll=="function"){var y=this.state,F=y.scrollDirection,D=y.scrollOffset,O=y.scrollUpdateWasRequested;this._callOnScroll(F,D,O)}},x._getRangeToRender=function(){var c=this.props,p=c.itemCount,C=c.overscanCount,b=this.state,I=b.isScrolling,S=b.scrollDirection,y=b.scrollOffset;if(p===0)return[0,0,0,0];var F=i(this.props,y,this._instanceProps),D=s(this.props,F,y,this._instanceProps),O=!I||S==="backward"?Math.max(1,C):1,N=!I||S==="forward"?Math.max(1,C):1;return[Math.max(0,F-O),Math.max(0,Math.min(p-1,D+N)),F,D]},v})(Na),n.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},n}var bc=function(n,t){n.children,n.direction,n.height,n.layout,n.innerTagName,n.outerTagName,n.width,t.instance},yc=50,Kt=function(n,t,r){var o=n,a=o.itemSize,i=r.itemMetadataMap,s=r.lastMeasuredIndex;if(t>s){var u=0;if(s>=0){var d=i[s];u=d.offset+d.size}for(var f=s+1;f<=t;f++){var m=a(f);i[f]={offset:u,size:m},u+=m}r.lastMeasuredIndex=t}return i[t]},Cc=function(n,t,r){var o=t.itemMetadataMap,a=t.lastMeasuredIndex,i=a>0?o[a].offset:0;return i>=r?$a(n,t,a,0,r):xc(n,t,Math.max(0,a),r)},$a=function(n,t,r,o,a){for(;o<=r;){var i=o+Math.floor((r-o)/2),s=Kt(n,i,t).offset;if(s===a)return i;s<a?o=i+1:s>a&&(r=i-1)}return o>0?o-1:0},xc=function(n,t,r,o){for(var a=n.itemCount,i=1;r<a&&Kt(n,r,t).offset<o;)r+=i,i*=2;return $a(n,t,Math.min(r,a-1),Math.floor(r/2),o)},Io=function(n,t){var r=n.itemCount,o=t.itemMetadataMap,a=t.estimatedItemSize,i=t.lastMeasuredIndex,s=0;if(i>=r&&(i=r-1),i>=0){var u=o[i];s=u.offset+u.size}var d=r-i-1,f=d*a;return s+f},wc=vc({getItemOffset:function(n,t,r){return Kt(n,t,r).offset},getItemSize:function(n,t,r){return r.itemMetadataMap[t].size},getEstimatedTotalSize:Io,getOffsetForIndexAndAlignment:function(n,t,r,o,a,i){var s=n.direction,u=n.height,d=n.layout,f=n.width,m=s==="horizontal"||d==="horizontal",v=m?f:u,x=Kt(n,t,a),w=Io(n,a),c=Math.max(0,Math.min(w-v,x.offset)),p=Math.max(0,x.offset-v+x.size+i);switch(r==="smart"&&(o>=p-v&&o<=c+v?r="auto":r="center"),r){case"start":return c;case"end":return p;case"center":return Math.round(p+(c-p)/2);case"auto":default:return o>=p&&o<=c?o:o<p?p:c}},getStartIndexForOffset:function(n,t,r){return Cc(n,r,t)},getStopIndexForStartIndex:function(n,t,r,o){for(var a=n.direction,i=n.height,s=n.itemCount,u=n.layout,d=n.width,f=a==="horizontal"||u==="horizontal",m=f?d:i,v=Kt(n,t,o),x=r+m,w=v.offset+v.size,c=t;c<s-1&&w<x;)c++,w+=Kt(n,c,o).size;return c},initInstanceProps:function(n,t){var r=n,o=r.estimatedItemSize,a={itemMetadataMap:{},estimatedItemSize:o||yc,lastMeasuredIndex:-1};return t.resetAfterIndex=function(i,s){s===void 0&&(s=!0),a.lastMeasuredIndex=Math.min(a.lastMeasuredIndex,i-1),t._getItemStyleCache(-1),s&&t.forceUpdate()},a},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(n){n.itemSize}});function $c({isActive:e,isNew:n,isDisabled:t,data:r,eventsEmit:o,styles:a={},assistantList:i=[]}){const[s,u]=Ie(!1),d=(a==null?void 0:a.colors)||{},f=Ge(()=>{const p=r==null?void 0:r.configId;if(!p||!i||i.length===0)return"\u672A\u9009\u62E9\u52A9\u624B";const C=i.find(b=>String(b==null?void 0:b.id)===String(p));if(!C)return"\u672A\u9009\u62E9\u52A9\u624B";if(C!=null&&C.name)return C.name;try{const b=typeof C.configJson=="string"?JSON.parse(C.configJson):C.configJson;return(b==null?void 0:b.config_name)||"\u672A\u9009\u62E9\u52A9\u624B"}catch{return"\u672A\u9009\u62E9\u52A9\u624B"}},[i,r==null?void 0:r.configId]),m=[{key:"rename",icon:$(Ei,{size:12}),label:"\u91CD\u547D\u540D",onClick:p=>{p.domEvent.stopPropagation(),o&&o("conversations:rename_icon_clicked",r)}},{key:"delete",icon:$(Ni,{size:12}),label:"\u5220\u9664",danger:!0,onClick:p=>{p.domEvent.stopPropagation(),o&&o("conversations:delete_icon_clicked",r)}}],v=e?d.activeItemBg||"#f0f4ff":s?d.itemHoverBg||"#f5f7fa":d.itemBg||"transparent",x=e?d.activeItemText||d.primary||"#0122ff":d.itemText||"#333",w=e?d.activeItemBorder||d.primary||"#0122ff":"transparent",c=p=>{const C=Kr(),b=Kr(p);return C.isSame(b,"day")?b.format("HH:mm"):b.format("MM-DD HH:mm")};return Y("div",{className:"flex relative items-center justify-between mb-2 px-4 py-3 rounded-md transition-colors cursor-pointer select-none",onClick:()=>!t&&o&&o("conversation:item_click",r),onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),style:{minHeight:48,background:v,color:x,border:`1px solid ${w}`,...a.item,opacity:t?.5:1},children:[Y("div",{className:"flex flex-col gap-y-2 flex-1 min-w-0",children:[$("span",{className:"truncate text-sm max-w-[160px] font-medium",title:r.label||"\u672A\u547D\u540D\u4F1A\u8BDD",style:{color:x,fontSize:"14px",lineHeight:"1.4"},children:r.label||"\u672A\u547D\u540D\u4F1A\u8BDD"}),Y("div",{className:"flex items-center justify-between gap-2",children:[$("span",{className:"text-xs truncate flex-1",style:{color:e?d.activeItemTextSecondary||"#666":d.itemTextSecondary||"#666",fontSize:"12px",lineHeight:"1.3"},children:f}),r.gmtModified&&$("span",{className:"text-xs flex-shrink-0",style:{color:e?d.activeItemTextSecondary||"#999":d.itemTextSecondary||"#999",fontSize:"12px",lineHeight:"1.3"},children:c(r.gmtModified)})]})]}),!t&&s&&!n&&$("div",{className:"absolute top-2 right-3",children:$(ha,{menu:{items:m},trigger:["click"],placement:"bottomRight",children:$(wi,{size:16,className:"text-gray-600 hover:text-gray-800",style:{cursor:"pointer",color:e?d.activeItemTextSecondary||"#999":d.itemTextSecondary||"#999"},onClick:p=>p.stopPropagation()})})})]})}function Ic(e,n=[{label:"\u5F53\u5929",dayPeriod:1}]){const t=new Date,r={other:[]};return e.forEach(o=>{const a=new Date(o.gmtModified),i=Math.floor((+t-+a)/(1e3*60*60*24));let s=!1;for(const u of n)if(i<=u.dayPeriod){r[u.label]||(r[u.label]=[]),r[u.label].push(o),s=!0;break}s||r.other.push(o)}),r}function Sc(e){const{data:n,activedItem:t,onChange:r,onDelete:o,sortRules:a=[{label:"\u5F53\u5929",dayPeriod:1}],eventsEmit:i,assistantList:s,height:u=400,styles:d={},hasMore:f=!1,loadingMore:m=!1}=e,v=n.map(N=>N.sessionId+"-"+N.gmtModified).join(","),x=Ge(()=>{const N=a.length>0?a:[{label:"\u5F53\u5929",dayPeriod:1}],E=Ic(n,N),_=N.every(k=>!E[k.label]||E[k.label].length===0),T=[];return N.forEach(k=>{E[k.label]&&E[k.label].length>0&&(T.push({type:"group",label:k.label}),E[k.label].forEach(M=>T.push({type:"item",data:M})))}),E.other.length>0&&!_&&(T.push({type:"group",label:"\u5176\u4ED6"}),E.other.forEach(k=>T.push({type:"item",data:k}))),_&&E.other.length>0&&E.other.forEach(k=>T.push({type:"item",data:k})),T},[n,a,v]),w=Ge(()=>x.map(N=>N.type==="group"?`g:${N.label}`:`i:${N.data.sessionId}`).join("|"),[x]),c=56,p=14,C=36,b=N=>N===x.length?C:x[N].type==="group"?32:c+p,I=Xe(null),S=Ge(()=>x.findIndex(N=>{var E;return N.type==="item"&&((E=N.data)==null?void 0:E.sessionId)===t}),[x,t]),y=Ge(()=>x.findIndex(N=>N.type==="item"),[x]),F=Xe(void 0);je(()=>{const N=F.current;t!==N&&S>-1&&S===y&&I.current&&I.current.scrollToItem(S,"start"),F.current=t},[t,S,y]);const D=Xe(0);if(je(()=>{if(I.current){const N=D.current,E=x.length;D.current=E,E!==N&&I.current.resetAfterIndex(Math.max(0,Math.min(N,E)-1),!1)}},[x.length]),je(()=>{I.current&&I.current.resetAfterIndex(0,!1)},[w]),x.length===0)return $("div",{className:"text-center text-zinc-400 py-8",children:"\u6682\u65E0\u4F1A\u8BDD"});const O=(d==null?void 0:d.colors)||{};return $(di,{flipKey:v,spring:{stiffness:180,damping:18},children:$(wc,{ref:I,height:u,width:"100%",itemCount:x.length+1,itemSize:b,itemKey:N=>{if(N===x.length)return"footer";const E=x[N];return E.type==="item"?E.data.sessionId:`group-${E.label}`},onItemsRendered:({visibleStopIndex:N})=>{f&&!m&&N>=x.length-1-3&&typeof i=="function"&&i("conversations:load_more")},style:{overflowX:"hidden"},children:({index:N,style:E})=>{if(N===x.length){const T=(d==null?void 0:d.colors)||{};return $("div",{style:{...E,height:C,lineHeight:`${C}px`,textAlign:"center",fontSize:"10px",color:T.textMuted||"#9ca3af",background:T.groupBg||"white"},children:m?"\u52A0\u8F7D\u4E2D...":f?"":"\u6CA1\u6709\u66F4\u591A\u4E86"})}const _=x[N];return _.type==="group"?$("div",{style:{...E,background:O.groupBg||"white",zIndex:1},className:"pt-2 pb-1 px-[28px] py-[2px] text-xs text-gray-400",children:_.label}):$(pi,{flipId:_.data.sessionId,children:$("div",{style:E,className:"px-[12px] py-[2px]",children:$($c,{isActive:t===_.data.sessionId,isDisabled:!1,isNew:_.data.isNew,data:_.data,eventsEmit:i,assistantList:s,styles:d})})},_.data.sessionId)}})})}const Ec=({value:e,eventsEmit:n,setSearch:t,style:r,styles:o={}})=>{const a=o.colors||{},i=o.radius||"12px",s=a.border||"#e5e7eb",u=a.primary||"#2563eb",d=o.headerBg||a.sidebarBg||a.background||"#fff",[f,m]=Be.useState(!1);return Y("div",{className:"flex items-center gap-2 px-4 py-3 sticky top-0 z-10 min-w-0",style:{...r,background:d,borderTopLeftRadius:i,borderTopRightRadius:i},children:[$("button",{className:"border-none flex items-center justify-center",onClick:()=>{m(!1),n&&n("conversation:create")},title:"\u65B0\u5EFA\u4F1A\u8BDD",style:{height:42,borderRadius:"90px",background:u,color:a.buttonText||"#fff",fontWeight:600,boxShadow:o.shadow||"0 2px 8px 0 rgba(0,0,0,0.04)",padding:f?"0 0":"0 14px",minWidth:f?0:180,width:f?0:void 0,opacity:f?0:1,overflow:"hidden",flexShrink:0,transition:"width .22s ease, min-width .22s ease, padding .22s ease, opacity .18s ease"},children:Y("div",{className:"flex items-center gap-2",children:[$(Xo,{size:18}),$("span",{className:"text-sm",children:"\u65B0\u5EFA\u5BF9\u8BDD"})]})}),f?Y("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[$("input",{className:"flex-1 px-3 py-2 text-sm transition-all",placeholder:"\u641C\u7D22\u4F1A\u8BDD...",value:e,onChange:v=>t(v.target.value),onBlur:()=>m(!1),onKeyDown:v=>{v.key==="Enter"&&m(!1)},style:{minWidth:0,width:"100%",maxWidth:"100%",borderRadius:i,background:a.inputBg||"#f4f4f5",border:`1px solid ${s}`,color:a.text||"#222",outline:"none"}}),$("button",{className:"flex items-center justify-center transition-colors",style:{width:36,height:36,borderRadius:"90px",border:`1px solid ${s}`,color:a.text||"#222",flexShrink:0},onClick:()=>m(!1),title:"\u6536\u8D77\u641C\u7D22",children:$(Pr,{size:16})})]}):$("button",{className:"ml-auto flex items-center justify-center transition-colors",style:{width:36,height:36,borderRadius:"90px",border:`1px solid ${s}`,color:u,flexShrink:0},onClick:()=>m(!0),title:"\u641C\u7D22",children:$(Fi,{size:18})})]})};function Fc(e){const{data:n,sortRules:t,activedItem:r,eventsEmit:o,assistantList:a,styles:i={},hasMore:s=!1,loadingMore:u=!1}=e,[d,f]=Ie(""),m=Ge(()=>d?n.filter(y=>(y.label||"\u672A\u547D\u540D\u4F1A\u8BDD").toLowerCase().includes(d.toLowerCase())):n,[n,d]),v=Ge(()=>[...m].sort((y,F)=>new Date(F.gmtModified).getTime()-new Date(y.gmtModified).getTime()),[m]),x=Xe(null),[w,c]=Ie(400);je(()=>{function y(){x.current&&c(x.current.clientHeight)}return y(),window.addEventListener("resize",y),()=>window.removeEventListener("resize",y)},[]);const p=(i==null?void 0:i.colors)||{};i!=null&&i.radius;const C=(i==null?void 0:i.shadow)||"0 4px 24px 0 rgba(0,0,0,0.06)",b=p.border||"#e5e7eb",I=p.sidebarBg||p.background||"#EAEEFF",S=p.text||"#222";return Y("div",{className:"h-full flex flex-col overflow-y-hidden",style:{background:I,color:S,boxShadow:C,border:`1px solid ${b}`,...i.container},children:[$(Ec,{value:d,setSearch:f,eventsEmit:o,style:i.header,styles:i}),Y("div",{className:"flex-1 min-h-0 relative",ref:x,style:i.list,children:[$(Sc,{eventsEmit:o,data:v,assistantList:a,activedItem:r,sortRules:t,height:w,styles:i,hasMore:s,loadingMore:u}),$("div",{className:"pointer-events-none absolute left-0 right-0 top-0 h-3 z-20",style:{background:`linear-gradient(to bottom, ${I}cc, transparent)`}})]})]})}const Nc=(e,n)=>{let t=e&&e.replace(/<think>[\s\S]*?<\/think>/g,"");t=t.replace(/\[retrive-tag[^\]]*\][\s\S]*?\[\/retrive-tag\]/g,""),t=t.replace(/<a\s+[^>]*>(.*?)<\/a>/g,""),console.log("_content",t);const r=new mi(n.currentTarget||n.target,{text:()=>t});try{r.on("success",()=>{Re.success("\u6587\u672C\u590D\u5236\u6210\u529F",2),r.destroy()}),r.on("error",o=>{Re.error("\u590D\u5236\u5931\u8D25",2),r.destroy()}),r.onClick(n)}catch(o){r.destroy(),Re.error("\u590D\u5236\u5931\u8D25: "+o,2)}},So=e=>{const n=e.toLowerCase().split(".").pop()||"";return/^(jpg|jpeg|png|gif|bmp|webp)$/.test(n)?"image":/^(doc|docx)$/.test(n)?"word":/^(xls|xlsx|csv)$/.test(n)?"excel":/^(ppt|pptx)$/.test(n)?"ppt":n==="pdf"?"pdf":/^(txt|json|md|markdown)$/.test(n)?"text":/^(zip|rar|7z)$/.test(n)?"archive":"file"};function Oc(e){const n=[];for(const t of e){if(t.query){const r=t.query.queryId||t.query.id||t.queryId||t.id||Ht(32);n.push({istype:"user",content:t.query.content,time:t.query.gmtCreate,queryId:r,clientSideId:r+"-user",...t.query})}if(t.reply){const r=t.reply.queryId||t.reply.id||t.queryId||t.id||Ht(32);n.push({istype:"ai",content:t.reply.content,isDefault:t.reply.isDefault,time:t.time||t.gmtCreate||Date.now(),queryId:r,clientSideId:r+"-ai",...t.reply})}}return n}const Eo=async(e,n,t)=>{try{rt.post(`${e.url}/qa/feedback`,n,{headers:{Authorization:e.token,"X-CSRF-TOKEN-IN":e.CSRFToken||""}}).then(r=>{r.data.success&&t&&t()})}catch(r){console.log("error",r)}},nr=async(e,n,t)=>{try{rt.delete(`${e.url}/qa/feedback/cancel?queryId=${n.queryId}`,{headers:{Authorization:e.token,"X-CSRF-TOKEN-IN":e.CSRFToken||""}}).then(r=>{r.data.success&&t&&t()})}catch(r){console.log("error",r)}},Dc=(e,n)=>{try{rt.get(`${e.url}/qa/feedback/que/list`,{headers:{Authorization:e.token}}).then(t=>{t.data.success&&n&&n(t.data.data)})}catch(t){console.log("error",t)}},Pc=async(e,n,t)=>{try{rt.post(`${e.url}/qa/dialogue/reName`,n,{headers:{Authorization:e.token,"X-CSRF-TOKEN-IN":e.CSRFToken||""}}).then(r=>{r.data.success?t&&t(r):Re.error("\u7F16\u8F91\u540D\u5B57\u5931\u8D25")}).catch(r=>{var o,a;(a=(o=r==null?void 0:r.response)==null?void 0:o.data)!=null&&a.errorMsg&&Re.error(r.response.data.errorMsg)})}catch(r){console.log("error",r)}},Ac=async(e,n,t)=>{try{rt.delete(`${e.url}/qa/dialogue/delete?sessionId=${n.sessionId}`,{headers:{Authorization:e.token,"X-CSRF-TOKEN-IN":e.CSRFToken||""}}).then(r=>{r.data.success&&t&&t(r.data)})}catch(r){console.log("error",r)}},kc=async(e,n,t)=>{console.log("[DEBUG] handleCreateConversation \u8BF7\u6C42",{url:e.url,token:e.token,data:n});try{rt.post(`${e.url}/qa/dialogue/create`,n,{headers:{Authorization:e.token,"X-CSRF-TOKEN-IN":e.CSRFToken||""}}).then(r=>{r.data.success?t&&t(r.data):Re.error(r.data.errorMsg||"\u521B\u5EFA\u4F1A\u8BDD\u5931\u8D25")}).catch(r=>{var o,a;(a=(o=r==null?void 0:r.response)==null?void 0:o.data)!=null&&a.errorMsg&&Re.error(r.response.data.errorMsg)})}catch(r){console.log("error",r)}},Mc=async(e,n,t)=>{try{const{uid:r,queryId:o}=n;let a=`${e.url}/index/knowledgeBase/file/deleteByUid?uid=${r}`;o&&(a+=`&queryId=${o}`),rt.delete(a,{headers:{Authorization:e.token,"X-CSRF-TOKEN-IN":e.CSRFToken||""}}).then(i=>{i.data.success?t&&t(!0,i):t&&t(!1,i)}).catch(i=>{t&&t(!1,i)})}catch(r){t&&t(!1,r)}},Rc=""+new URL("assets/defaultWeLogo.svg",import.meta.url).href,Bc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAOkSURBVHgBxZRbTBxlFMd/c2EvXBbZLbsCVhcKaAyh2BKTWrX12RhNmxa1IVp98FEJVGNMY2KItSZtqGjaROMlaDSVxiZeqiRa0FBpIlSkhgK15WoLu7AL3V1md25+7CpUojzYB7/km5OZc+Z35pzz/wb+l3X7PotNL9tvd1yIc8OrYp9pWXZ6JXXdfLOtbdNa4fJazoZdu9xVNUE5petIVS9h/npRfkDKefg/A+OaJuUGvIz3DzD14R6uHv/WCmzbcuNlj7S+3z7+5Xepno7TLeJWWiv2n5zyTcEaT/TJlrfwljxCTm42lgHRmIHDqaIqIsTE43NS7FHCBXKkIzw4eGKkYcdnwmGvBspSy+DpxlrffXtqC6WeqM3+CZ3wnAZLOyXAlsXfOjU7D6EYHLw7zVKvgykcG+r98YmKjdG5BK3nw7w7YQuATdAJWR4IJ2UiswKoiC39+S0+4QjNL0NWgDU7y57ZVlLd2n+FO/Kd7BxxcPOpMKGrCSxNTNm2kVUZ2e1g+5YCxh4q4IW+cAactYTZLi6dxgqw4dUjj+UgfXpSJRAaY9Lt4dZAkoW5YWSXyKwo6ZYbhsFCciPe9hgHtDiB+kqe6huF6jknv2As9/Dj3mv2se4Yh5RhEr4SbD2FpMjomkZ0eoaunl5yxXwqKsspKwsiOVzYqST143k8Xe7gvaN17tHOTi0D/D6U3DqhO7oNNxOlU6heD0cOH2frg/dSU1ywMgRhRmMpvvjoG55t3I0RWWDvuST9iy5q64qtr2/LV9Ill/aNOsb9fnC48a+zGYzF6R/opefsGU59sl88d6V5tpagqekNFg2LgeHN3F/pJS9rET2l4v15Ruav1PHLEdsUJYpXcNjXKA54iCd11gf9ONUkLqeVtu4ciQUjwcCF3wjc4sUlJbhouyjOVek6O2kvT3kGV3e9P/uetlmhi4VpCsU0Wz5o5i6/kIehY8UjyHlLpVt8daKZc1d0qt3zaV2ex09LjYvnhsx3rj8pEq90N1QU+Q+9WJVgbzBPpFIzIrZNsYWVlYyVhJXVtFys6UHWf76O36NDu3nt0fbVJ0Wm6Sedomx5hzPCwYpJygvdkOMVQhbKFjrEFG2JRQjPTHH4Uh4HoptFfy2T5+9clt/qo6fS9MMYilqEL1dCyCQtQsnKhC51yUyCkBLz4qeT77Np3KCme/EvwJVndUcfl0qr6uzKwAb8biemqTCjmYS0RUKhM1zuep2TzZfIpFlefwDISXe8s31UTQAAAABJRU5ErkJggg==",Tc=(e,n)=>{const t={...Dr.colors,...e};return`
|
|
93
93
|
.g-welcome-${n} .g-welcome-title {
|
|
94
94
|
background-image: linear-gradient(90deg, #3262FA 0%, #6C18FF 100%);
|
|
95
95
|
-webkit-background-clip: text;
|
|
@@ -139,8 +139,8 @@ import{jsx as $,jsxs as Y,Fragment as Ea}from"react/jsx-runtime";import*as l fro
|
|
|
139
139
|
.g-welcome-${n} .g-welcome-pagination-text {
|
|
140
140
|
color: ${t.text};
|
|
141
141
|
}
|
|
142
|
-
`};function _c({config:e,styles:n}){if(!e)return null;const t=JSON.parse(e.configJson),r=Ge(()=>{var o;return{...Dr.colors,...(o=n==null?void 0:n.theme)==null?void 0:o.colors}},[n]);return Y("div",{className:"w-[340px] rounded-xl p-4 animate-fade-in bg-white",children:[Y("div",{className:"flex items-center mb-2",children:[$("span",{className:"text-md font-bold truncate mr-2",style:{color:r.primary},children:t.config_name||"\u52A9\u624B\u914D\u7F6E"}),$("span",{className:"text-xs truncate rounded px-2 py-0.5",style:{backgroundColor:`${r.primary}1A`,color:r.disabled},children:t.model_name})]}),$("div",{className:"border-b my-2",style:{borderColor:r.border}}),Y("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs text-gray-700 mb-2",style:{color:r.text},children:[Y("div",{children:["\u4E0A\u4E0B\u6587\u6700\u5927\u8F6E\u6570\uFF1A",$("span",{className:"font-semibold",children:t.max_round})]}),Y("div",{children:["\u6700\u5927\u4EE4\u724C\u6570\uFF1A",$("span",{className:"font-semibold",children:t.max_tokens})]}),Y("div",{children:["\u6E29\u5EA6\uFF1A",$("span",{className:"font-semibold",children:t.temperature})]}),Y("div",{children:["\u53EC\u56DE\u6570\uFF1A",$("span",{className:"font-semibold",children:t.top_k})]}),Y("div",{children:["\u591A\u6837\u6027\uFF1A",$("span",{className:"font-semibold",children:t.top_p})]}),Y("div",{children:["\u76F8\u4F3C\u5EA6\u9608\u503C\uFF1A",$("span",{className:"font-semibold",children:t.score_threshold})]})]}),Y("div",{className:"mb-2",children:[$("div",{className:"text-xs text-gray-400 mb-1",style:{color:r.disabled},children:"\u5173\u8054\u77E5\u8BC6\u5E93\uFF1A"}),$("div",{className:"flex flex-wrap gap-1",children:t.knowledge_base_name?t.knowledge_base_name.split(";").map((o,a)=>$("span",{className:"px-2 py-0.5 rounded-full text-xs",style:{backgroundColor:`${r.primary}1A`,color:r.primary},children:o},a)):$("span",{className:"text-gray-300",style:{color:r.disabled},children:"\u65E0"})})]}),Y("div",{className:"mb-2",children:[$("div",{className:"text-xs text-gray-400 mb-1",style:{color:r.disabled},children:"\u5F00\u542F\u529F\u80FD:"}),Y("div",{className:"flex flex-wrap gap-2 text-xs mt-2",children:[!!t.enabled_faq&&$("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"FAQ"}),!!t.enabled_graph&&$("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u56FE\u8C31"}),!!t.dependOnKb&&$("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u5F3A\u77E5\u8BC6\u4F9D\u8D56"}),!!t.enabled_table_select&&$("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u8868\u683C\u7B5B\u9009"}),!!t.enabled_rerank&&$("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u7CBE\u6392\u6A21\u5F0F"}),!!t.need_trace_source&&$("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u6EAF\u6E90"}),!!t.is_download&&$("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u4E0B\u8F7D\u6EAF\u6E90"})]})]})]})}function zc(e,n=[],t=60){const[r,o]=Ie("");return je(()=>{o("");let a=0;const i=setInterval(()=>{o(s=>a>=e.length?(clearInterval(i),s):(a++,e.slice(0,a)))},t);return()=>clearInterval(i)},[e,...n]),r}function jc(e){const{assistantList:n,eventsEmit:t,styles:r,selectedId:o,onSelectAssistant:a,productLogo:i}=e,[s,u]=Ie(1),d=12,f=Xe();je(()=>{o&&f.current!==o&&(t==null||t("conversation:new_assistant_change",{assistantId:o}),f.current=o)},[o,t]);const m=Ge(()=>Ht(),[]);je(()=>{var b;if((b=r==null?void 0:r.theme)!=null&&b.colors){const I=document.createElement("style");return I.innerHTML=Tc(r.theme.colors,m),I.id=`g-welcome-styles-${m}`,document.head.appendChild(I),()=>{const S=document.getElementById(I.id);S&&S.remove()}}},[r,m]);const
|
|
143
|
-
`+f:f;break;case"event":r.event=f;break;case"id":e(r.id=f);break;case"retry":const m=parseInt(f,10);isNaN(m)||n(r.retry=m);break}}}}function Uc(e,n){const t=new Uint8Array(e.length+n.length);return t.set(e),t.set(n,e.length),t}function Fo(){return{data:"",event:"",id:"",retry:void 0}}var Wc=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t};const hr="text/event-stream",Vc=1e3,No="last-event-id";function Kc(e,n){var{signal:t,headers:r,onopen:o,onmessage:a,onclose:i,onerror:s,openWhenHidden:u,fetch:d}=n,f=Wc(n,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((m,h)=>{const x=Object.assign({},r);x.accept||(x.accept=hr);let w;function c(){w.abort(),document.hidden||y()}u||document.addEventListener("visibilitychange",c);let p=Vc,C=0;function b(){document.removeEventListener("visibilitychange",c),window.clearTimeout(C),w.abort()}t==null||t.addEventListener("abort",()=>{b(),m()});const I=d??window.fetch,S=o??Xc;async function y(){var F;w=new AbortController;try{const D=await I(e,Object.assign(Object.assign({},f),{headers:x,signal:w.signal}));await S(D),await Lc(D.body,Hc(qc(O=>{O?x[No]=O:delete x[No]},O=>{p=O},a))),i==null||i(),b(),m()}catch(D){if(!w.signal.aborted)try{const O=(F=s==null?void 0:s(D))!==null&&F!==void 0?F:p;window.clearTimeout(C),C=window.setTimeout(y,O)}catch(O){b(),h(O)}}}y()})}function Xc(e){const n=e.headers.get("content-type");if(!(n!=null&&n.startsWith(hr)))throw new Error(`Expected content-type to be ${hr}, Actual: ${n}`)}class rr extends Error{}let Ct=null;const Gc=({baseUrl:e,token:n,CSRFToken:t,setChatData:r,activeSessionId:o,setAppStatus:a,setConversationList:i})=>{const s=({content:w,status:c,respTime:p,filePaths:C,reference:b,webReference:I,graphReference:S,databaseReference:y,llmType:F,resultType:D,queryId:O,tokens:N})=>{r(E=>{var U;if(!E[0])return E;const _=E[0],T=_.messages||[],k=T.length-1;if(k<0)return E;const M=T[k];if(M.istype!=="ai")return E;let B=T.slice();if(C!=null&&C.length){const K=T.length-2;if(K>=0&&((U=T[K])==null?void 0:U.istype)==="user"){const L={...T[K],filePaths:C};B[K]=L}}const V={...M,content:(M.content||"")+w,status:c,respTime:p,filePaths:C,reference:b,webReference:I,graphReference:S??M.graphReference,databaseReference:y??M.databaseReference,resultType:D,llmType:F,tokens:N,queryId:O||M.queryId||Ht(32)};return V.clientSideId=V.clientSideId||V.queryId+"-ai",B[k]=V,[{..._,isNew:!1,messages:B},...E.slice(1)]})},u=w=>{if(w instanceof rr)throw a(c=>({...c,display:"error",sender:"ready"})),Ct&&(Ct.abort(),Ct=null),w};return{updateUserFilesMessage:({currentFiles:w})=>{r(c=>{if(!c[0])return c;const p=c[0],C=p.messages||[];if(!C.length)return c;const b=C.length-2;if(b<0||C[b].istype!=="user")return c;const S=C.slice();return S[b]={...C[b],currentFiles:w},[{...p,messages:S},...c.slice(1)]})},api_startChat_re:(w,c)=>{Ct&&Ct.abort(),Ct=new AbortController;const p=`${e}/qa/ai/question_re`;console.log("data",w);const C={...w};Kc(p,{method:"post",signal:Ct.signal,headers:{"Content-Type":"application/json",Accept:"text/event-stream",Authorization:n||"","X-CSRF-TOKEN-IN":t||""},openWhenHidden:!0,body:JSON.stringify(C),onopen:async b=>{if(b.status===500)throw new rr("Internal Server Error");if(!b.ok)throw new rr(`HTTP error: ${b.status}`)},onmessage:b=>{const I=JSON.parse(b.data);if(o!==I.sessionId)return;const{reply:S,resultType:y,respTime:F,reference:D,webReference:O,graphReference:N,filePaths:E,status:_,docs:T,llmType:k,databaseReference:M}=I,B=E?JSON.parse(E):[];if(_===2&&S&&S.content&&(S.content.includes("\u6A21\u578B\u6682\u65E0\u6CD5\u8FD4\u56DE")||S.content.includes("\u5931\u8D25")||S.content.includes("\u9519\u8BEF")||S.content.includes("\u8BF7\u7A0D\u540E\u518D\u8BD5"))&&a(V=>({...V,display:"ready",sender:"ready"})),_===2){if(s({content:S.content||"",status:2,respTime:F,filePaths:B,reference:D||T||"",webReference:O||"",graphReference:N||null,databaseReference:M,llmType:k,resultType:y,queryId:I.queryId,tokens:I.tokens}),a(V=>({...V,display:"ready",sender:"ready"})),c){const V=F||Date.now();console.log("[AichatUseController] \u6D88\u606F\u53D1\u9001\u6210\u529F\uFF0CgmtModified:",V),c(V)}}else s({content:S.content||"",status:_,respTime:F,filePaths:B,reference:D||T||"",webReference:O||"",graphReference:N||null,databaseReference:M,llmType:k,resultType:y,queryId:I.queryId,tokens:I.tokens})},onerror:u})},addEmptyMessage:({queryId:w,content:c,filePaths:p,currentFiles:C})=>{r(b=>{const I=new Date().toISOString(),S=w||Ht(32),y={istype:"user",content:c,time:I,queryId:S,clientSideId:S+"-user",filePaths:p||"",currentFiles:C||[]},F={istype:"ai",content:"",time:new Date(Date.now()+1).toISOString(),streaming:!0,status:0,queryId:S,clientSideId:S+"-ai"},D=b.find(O=>O.id===o);return D?D.messages.push(y,F):console.warn("addEmptyMessage called without an active session."),[...b]})},setLastEmptyMessage:({now:w})=>{r(c=>{if(!c[0])return c;const p=c[0],C=p.messages||[];if(!C.length)return c;const b=C.length-1;if(b<0)return c;const I=C[b];if(I.istype!=="ai")return c;const S=C.slice();return S[b]={...I,istype:"ai",content:"",time:w,streaming:!0,status:0},[{...p,messages:S},...c.slice(1)]})},stopStream:()=>{Ct&&(Ct.abort(),Ct=null),a(w=>({...w,display:"ready",sender:"ready"}))}}},Oo=e=>e?Array.isArray(e)?e.map(r=>"/minio/"+r.split("/").slice(3).join("/")):"/minio/"+e.split("/").slice(3).join("/"):"",Do="http://10.15.12.13:9000/",Jc=e=>{if(typeof e=="string"){const n=e.split(".");return n.length?n[n.length-1]:""}else return""},Yc=e=>{var y,F,D,O,N,E,_,T;const{file_type:n,file_name:t,url:r,parse_url:o,retrieve_tags:a,file_id:i,parsed_file_type:s,onlyDownloadTypes:u,references:d,eventsEmit:f,styles:m,isUploadFile:h,type:x,collectionItems:w,pdfPages:c=0,fileManagerData:p}=e;if(x==="collection"&&Array.isArray(w)){const B=`calc(90% - ${.5}px)`,V=w.slice(0,4),j=w.length>4,U="\u6253\u5F00\u5408\u96C6",K=()=>{if(p&&n==="pdf"&&!e.pdfPages){const L=((p==null?void 0:p.uploadedFiles)||[]).find(q=>{var ee;return((q==null?void 0:q.name)||((ee=q==null?void 0:q.file)==null?void 0:ee.name))===t});if(!(L!=null&&L.pdfPages)){Re.warning("\u8BE5PDF\u6587\u4EF6\u672A\u89E3\u6790\u5B8C\u6210\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}f==null||f("reference_file:click",{...e,pdfPages:(L==null?void 0:L.pdfPages)||0})}else f==null||f("reference_file:click",e)};return Y("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:(F=(y=m==null?void 0:m.theme)==null?void 0:y.colors)==null?void 0:F.border},onClick:K,children:[$("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:V.map((L,q)=>{var W,J,oe,ae;if(j&&q===3)return $("div",{className:"flex items-center justify-center bg-gray-100 rounded",style:{width:B,height:B},children:$("span",{className:"text-xl text-gray-300 font-bold scale-75",children:"..."})},"ellipsis");if(L.file_type==="image"||L.file_type==="jpg"||L.file_type==="jpeg"||L.file_type==="png"||L.file_type==="gif"||L.file_type==="bmp"||L.file_type==="webp")return $("div",{className:"relative flex items-center justify-center bg-white rounded-lg border overflow-hidden",style:{width:B,height:B,borderColor:(J=(W=m==null?void 0:m.theme)==null?void 0:W.colors)==null?void 0:J.border},children:$("div",{className:"flex items-center justify-center w-full h-full scale-75",children:$("img",{src:String(L.url||L.file_path||""),alt:L.file_name||"",className:"object-contain max-w-full max-h-full"})})},L.file_name||q);const R=vr(String(L.file_type||""),m);return $("div",{className:"user-file flex flex-col items-center justify-center rounded-lg border bg-gray-50 p-1 text-sm",title:L.file_name,style:{width:B,height:B,borderColor:(ae=(oe=m==null?void 0:m.theme)==null?void 0:oe.colors)==null?void 0:ae.border},children:$("div",{className:"flex items-center justify-center w-full h-full scale-75",children:R})},L.file_name||q)})}),$("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:Y("div",{className:"flex flex-col items-center text-xs justify-center text-white opacity-0 group-hover:opacity-100 transition-opacity",children:[$(Kn,{size:20,className:"mb-1 text-white"}),$("span",{className:"text-white text-center",style:{fontSize:12},children:U})]})})]})}const C=()=>{if(console.log(o,"parse_url",r,"url"),p&&n==="pdf"&&!c){const k=((p==null?void 0:p.uploadedFiles)||[]).find(M=>{var B;return((M==null?void 0:M.name)||((B=M==null?void 0:M.file)==null?void 0:B.name))===(t||"").replace(/\s+/g,"")});if(!(k!=null&&k.pdfPages)){Re.warning("\u8BE5PDF\u6587\u4EF6\u672A\u89E3\u6790\u5B8C\u6210\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}f==null||f("reference_file:click",{file:t,file_type:n,url:r,parse_url:o,retrieve_tags:a,file_id:i,parsed_file_type:s,references:d,type:b,isUploadFile:h,pdfPages:k.pdfPages||0})}else f==null||f("reference_file:click",{file:t,file_type:n,url:r,parse_url:o,retrieve_tags:a,file_id:i,parsed_file_type:s,references:d,type:b,isUploadFile:h,pdfPages:c})},b=Ge(()=>(t||"").split(".").pop()||"",[t]),I=vr(b,m),S=async()=>{if(r){const k=Oo(r.indexOf("http")>-1?r:`${Do}/${r}`);if(b.toLowerCase()==="json"){try{const V=await fetch(k);if(!V.ok)throw new Error("\u4E0B\u8F7D\u5931\u8D25");const j=await V.blob(),U=document.createElement("a");U.href=URL.createObjectURL(j),U.download=t||"",document.body.appendChild(U),U.click(),document.body.removeChild(U),setTimeout(()=>URL.revokeObjectURL(U.href),1e3)}catch{alert("\u6587\u4EF6\u4E0B\u8F7D\u5931\u8D25")}return}const B=document.createElement("a");B.href=k,B.download=t||"",document.body.appendChild(B),B.click(),document.body.removeChild(B)}};return u&&u.includes(b.toLowerCase())?Y("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:t,onClick:S,style:{borderColor:(O=(D=m==null?void 0:m.theme)==null?void 0:D.colors)==null?void 0:O.border},children:[I,$("span",{className:"file-name font-medium truncate text-center px-2 pt-1",style:{fontSize:10,maxWidth:"5.5rem"},children:t}),$("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:Y("div",{className:"flex flex-col items-center text-xs justify-center text-white opacity-0 group-hover:opacity-100 transition-opacity",children:[$(Kn,{className:"text-white opacity-0 group-hover:opacity-100 transition-opacity mx-auto"}),$("div",{className:"text-white text-center",style:{fontSize:10},children:"\u4E0B\u8F7D\u6587\u4EF6"})]})})]},t):b==="image"||b==="jpg"||b==="jpeg"||b==="png"||b==="gif"||b==="bmp"||b==="webp"?Y("div",{className:"relative group w-24 h-24 cursor-pointer flex items-center justify-center",onClick:()=>C(),children:[r?$("img",{src:String(Oo(r&&r.indexOf("http")>-1?r:`${Do}/${r}`)||""),alt:t||"",className:"w-full h-full object-cover rounded-md border",style:{borderColor:(E=(N=m==null?void 0:m.theme)==null?void 0:N.colors)==null?void 0:E.border}}):$("div",{className:"w-full h-full flex items-center justify-center",children:$("span",{className:"animate-spin rounded-full border-2 border-gray-300 border-t-blue-500 w-8 h-8 inline-block"})}),$("div",{className:"absolute inset-0 bg-transparent group-hover:bg-black/40 transition-all duration-300 flex items-center justify-center rounded-md",children:Y("div",{className:"flex flex-col items-center text-xs justify-center text-white opacity-0 group-hover:opacity-100 transition-opacity",children:[$($i,{className:"text-white opacity-0 group-hover:opacity-100 transition-opacity mx-auto"}),$("div",{className:"text-white text-center",children:"\u67E5\u770B\u56FE\u7247"})]})})]},t):Y("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:t,onClick:C,style:{borderColor:(T=(_=m==null?void 0:m.theme)==null?void 0:_.colors)==null?void 0:T.border},children:[I,$("span",{className:"file-name font-medium truncate text-center px-2 pt-1",style:{fontSize:10,maxWidth:"5.5rem"},children:t}),$("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:Y("div",{className:"flex flex-col items-center text-xs justify-center text-white opacity-0 group-hover:opacity-100 transition-opacity",children:[$(Kn,{className:"text-white opacity-0 group-hover:opacity-100 transition-opacity mx-auto"}),$("div",{className:"text-white text-center",style:{fontSize:10},children:"\u6253\u5F00\u6587\u4EF6"})]})})]},t)},Qc=e=>e?e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/1024/1024).toFixed(1)}MB`:"",Zc=({fileName:e,fileSize:n,icon:t,statusText:r,statusColor:o="text-gray-400",statusIcon:a,onRemove:i,themeColors:s={},cardId:u,showRemove:d=!0,disabledRemove:f=!1,onRemoveWithAnim:m,extra:h,style:x})=>Y("div",{id:u,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:x,children:[$("div",{className:"pt-1",children:t}),Y("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[Y("div",{className:"flex items-center justify-between gap-1",children:[$("span",{className:"text-[12px] font-medium truncate max-w-[120px]",title:e,children:e}),$("span",{className:"ml-1 text-[11px] text-gray-400",children:Qc(n)})]}),Y("div",{className:`text-[10px] mt-0.5 flex items-center gap-3 ${o}`,children:[a,$("span",{children:r})]})]}),h,d&&!f&&$("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:()=>{m&&u?m(u):i&&i()},title:"\u79FB\u9664",style:{lineHeight:0,color:s.error||"#FF0000"},children:$(Pr,{className:"w-3.5 h-3.5"})})]});function vr(e,n){var r;const t=((r=n==null?void 0:n.theme)==null?void 0:r.icons)||{};switch(e.toLowerCase()){case"docx":case"doc":return t.docx?$("img",{src:t.docx,alt:"docx",style:{width:20,height:20}}):$(lt,{type:"rag/word",size:18});case"image":case"jpg":case"jpeg":case"png":case"gif":case"bmp":case"webp":case"svg":case"ico":return t.image?$("img",{src:t.image,alt:"image",style:{width:20,height:20}}):$(lt,{type:"rag/pic",size:18});case"pptx":case"ppt":return t.pptx?$("img",{src:t.pptx,alt:"pptx",style:{width:20,height:20}}):$(lt,{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 t.sheets?$("img",{src:t.sheets,alt:"sheets",style:{width:20,height:20}}):$(lt,{type:"rag/excel",size:18});case"pdf":return t.pdf?$("img",{src:t.pdf,alt:"pdf",style:{width:20,height:20}}):$(lt,{type:"rag/pdf",size:18});case"txt":return t.txt?$("img",{src:t.txt,alt:"txt",style:{width:20,height:20}}):$(lt,{type:"rag/txt",size:18});case"md":return t.md?$("img",{src:t.md,alt:"txt",style:{width:20,height:20}}):$(lt,{type:"rag/document",size:18});case"json":return t.json?$("img",{src:t.json,alt:"json",style:{width:20,height:20}}):$(lt,{type:"rag/json",size:18});case"html":case"htm":return t.html?$("img",{src:t.html,alt:"html",style:{width:20,height:20}}):$(lt,{type:"rag/url",size:18});case"xml":default:return $(lt,{type:"rag/file",size:18})}}const eu=[{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 tu({open:e,onCancel:n,files:t=eu,currentFiles:r=[],onUpload:o,onRemoveFile:a,styles:i,eventsEmit:s}){const u={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"},[d,f]=Ie([]),m=(c,p)=>{s&&s("uploaded_file:removeFromTemp",{file:c,idx:p})},h=i&&i.theme&&i.theme.colors?i.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"},x=t.map((c,p)=>Y("div",{className:"relative flex flex-col gap-2.5 items-center justify-center",children:[$("div",{className:"absolute right-1 top-1 z-10",children:$(ya,{title:"\u786E\u8BA4\u4ECE\u4E34\u65F6\u5BF9\u8BDD\u77E5\u8BC6\u5E93\u79FB\u9664\u8BE5\u6587\u4EF6\uFF1F",onConfirm:()=>m(c,p),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",children:$("button",{className:"bg-white cursor-pointer rounded-full p-0.5",style:{lineHeight:0,color:h&&h.text?h.text:"#FF0000",transition:"background 0.2s, color 0.2s"},onMouseOver:C=>{C.currentTarget.style.color=h&&h.error?h.error:"#FF0000"},onMouseOut:C=>{C.currentTarget.style.color=h.text},title:"\u79FB\u9664",children:$(Pr,{className:"w-3 h-3"})})})}),$(Yc,{file_type:Jc(c.file.name||c.name),file_name:c.name||c.file.name,url:c.url,retrieve_tags:[],styles:i,isUploadFile:!0,eventsEmit:s,parse_url:c.convertedFilePath,pdfPages:c.pdfPages||0})]},c.file.name+p)),w=r.map((c,p)=>{const C=c.file.name.split(".").pop()||"",b=vr(C,i);return $(Zc,{cardId:`pending-file-card-${p}`,fileName:c.file.name,fileSize:c.file.size,icon:b,statusText:u[c.status||"pending"],statusColor:"text-gray-400",showRemove:!0,onRemove:()=>a&&a(c,p,"pending"),themeColors:h,style:{boxShadow:"none",height:55,background:"#f8fafc"}},c.file.name+p)});return d.length>0?(h&&h.error&&h.error,h&&h.error&&h.error+"",h&&h.error&&h.error):(h&&h.disabledText&&h.disabledText,h&&h.disabledBackground&&h.disabledBackground,h&&h.disabledText&&h.disabledText),Y(Ar,{open:e,onCancel:n,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:[Y("div",{className:"file-manager-modal space-y-6 px-4 py-4",children:[Y("div",{className:"",children:[$("div",{className:"flex items-center mb-2 justify-between",children:Y("div",{className:"flex items-center",children:[$("span",{className:"text-xs font-semibold text-gray-700",children:"\u5DF2\u4E0A\u4F20\u6587\u4EF6"}),Y("span",{className:"ml-2 text-xs text-gray-400",children:[t.length," \u4E2A"]})]})}),$("div",{className:"w-full relative min-h-[200px] max-h-[260px] p-2 overflow-y-auto",style:{overflowX:"hidden"},children:$("div",{className:"flex flex-wrap gap-1",children:x.length>0?x:$("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"})})})]}),Y("div",{children:[Y("div",{className:"flex items-center mb-2",children:[$("span",{className:"text-xs font-semibold text-gray-700",children:"\u5F85\u4E0A\u4F20\u6587\u4EF6"}),Y("span",{className:"ml-2 text-xs text-gray-400",children:[r.length," \u4E2A"]})]}),Y("div",{className:"flex gap-2 overflow-x-auto pb-2",children:[w,$(jr.Dragger,{multiple:!0,showUploadList:!1,beforeUpload:(c,p)=>(c===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:Y("div",{className:"flex flex-row items-center pb-8 justify-center",children:[$(Xo,{size:20,className:"text-blue-400 mr-2"}),$("div",{className:"text-xs text-gray-500",children:"\u4E0A\u4F20\u6587\u4EF6"})]})})]})]}),$("div",{className:"flex justify-end gap-2",children:$(pt,{type:"primary",onClick:n,children:"\u786E\u8BA4"})})]}),$("style",{children:`
|
|
142
|
+
`};function _c({config:e,styles:n}){if(!e)return null;const t=JSON.parse(e.configJson),r=Ge(()=>{var o;return{...Dr.colors,...(o=n==null?void 0:n.theme)==null?void 0:o.colors}},[n]);return Y("div",{className:"w-[340px] rounded-xl p-4 animate-fade-in bg-white",children:[Y("div",{className:"flex items-center mb-2",children:[$("span",{className:"text-md font-bold truncate mr-2",style:{color:r.primary},children:t.config_name||"\u52A9\u624B\u914D\u7F6E"}),$("span",{className:"text-xs truncate rounded px-2 py-0.5",style:{backgroundColor:`${r.primary}1A`,color:r.disabled},children:t.model_name})]}),$("div",{className:"border-b my-2",style:{borderColor:r.border}}),Y("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs text-gray-700 mb-2",style:{color:r.text},children:[Y("div",{children:["\u4E0A\u4E0B\u6587\u6700\u5927\u8F6E\u6570\uFF1A",$("span",{className:"font-semibold",children:t.max_round})]}),Y("div",{children:["\u6700\u5927\u4EE4\u724C\u6570\uFF1A",$("span",{className:"font-semibold",children:t.max_tokens})]}),Y("div",{children:["\u6E29\u5EA6\uFF1A",$("span",{className:"font-semibold",children:t.temperature})]}),Y("div",{children:["\u53EC\u56DE\u6570\uFF1A",$("span",{className:"font-semibold",children:t.top_k})]}),Y("div",{children:["\u591A\u6837\u6027\uFF1A",$("span",{className:"font-semibold",children:t.top_p})]}),Y("div",{children:["\u76F8\u4F3C\u5EA6\u9608\u503C\uFF1A",$("span",{className:"font-semibold",children:t.score_threshold})]})]}),Y("div",{className:"mb-2",children:[$("div",{className:"text-xs text-gray-400 mb-1",style:{color:r.disabled},children:"\u5173\u8054\u77E5\u8BC6\u5E93\uFF1A"}),$("div",{className:"flex flex-wrap gap-1",children:t.knowledge_base_name?t.knowledge_base_name.split(";").map((o,a)=>$("span",{className:"px-2 py-0.5 rounded-full text-xs",style:{backgroundColor:`${r.primary}1A`,color:r.primary},children:o},a)):$("span",{className:"text-gray-300",style:{color:r.disabled},children:"\u65E0"})})]}),Y("div",{className:"mb-2",children:[$("div",{className:"text-xs text-gray-400 mb-1",style:{color:r.disabled},children:"\u5F00\u542F\u529F\u80FD:"}),Y("div",{className:"flex flex-wrap gap-2 text-xs mt-2",children:[!!t.enabled_faq&&$("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"FAQ"}),!!t.enabled_graph&&$("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u56FE\u8C31"}),!!t.dependOnKb&&$("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u5F3A\u77E5\u8BC6\u4F9D\u8D56"}),!!t.enabled_table_select&&$("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u8868\u683C\u7B5B\u9009"}),!!t.enabled_rerank&&$("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u7CBE\u6392\u6A21\u5F0F"}),!!t.need_trace_source&&$("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u6EAF\u6E90"}),!!t.is_download&&$("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u4E0B\u8F7D\u6EAF\u6E90"})]})]})]})}function zc(e,n=[],t=60){const[r,o]=Ie("");return je(()=>{o("");let a=0;const i=setInterval(()=>{o(s=>a>=e.length?(clearInterval(i),s):(a++,e.slice(0,a)))},t);return()=>clearInterval(i)},[e,...n]),r}function jc(e){const{assistantList:n,eventsEmit:t,styles:r,selectedId:o,onSelectAssistant:a,productLogo:i}=e,[s,u]=Ie(1),d=12,f=Xe();je(()=>{o&&f.current!==o&&(t==null||t("conversation:new_assistant_change",{assistantId:o}),f.current=o)},[o,t]);const m=Ge(()=>Ht(),[]);je(()=>{var b;if((b=r==null?void 0:r.theme)!=null&&b.colors){const I=document.createElement("style");return I.innerHTML=Tc(r.theme.colors,m),I.id=`g-welcome-styles-${m}`,document.head.appendChild(I),()=>{const S=document.getElementById(I.id);S&&S.remove()}}},[r,m]);const v=Ge(()=>n.find(b=>b.id===o),[n,o]),x=Ge(()=>JSON.parse((v==null?void 0:v.configJson)||"{}"),[v]),w=Math.ceil(((n==null?void 0:n.length)||0)/d),c=(n==null?void 0:n.slice((s-1)*d,s*d))||[];je(()=>{if(o&&n){const b=n.findIndex(I=>I.id===o);if(b!==-1){const I=Math.floor(b/d)+1;u(I)}}},[o,n,d]);const p=x.prologue||"\u60A8\u597D\uFF0C\u6B22\u8FCE\u4F7F\u7528\u5C0F\u9CB8\u667A\u80FD\u95EE\u7B54",C=zc(p,[o],30);return Y("div",{className:`flex flex-col items-center justify-center h-full w-full g-welcome-${m}`,children:[$("img",{src:i||Rc,alt:"logo",className:"mb-4",style:{width:100,height:100}}),$("div",{className:"text-3xl font-bold mb-2 g-welcome-title",children:C}),$("div",{className:"text-sm text-gray-500 mb-20",children:"\u8BF7\u9009\u62E9\u4E00\u4E2A\u667A\u80FD\u52A9\u624B\uFF0C\u5F00\u59CB\u4F60\u7684\u667A\u80FD\u95EE\u7B54\u4E4B\u65C5"}),!o&&$("div",{className:"flex mb-2 g-welcome-subtitle",children:"\u8BF7\u9009\u62E9\u4E00\u4E2A\u667A\u80FD\u52A9\u624B"}),$("div",{className:"flex flex-wrap gap-3 px-5 justify-center mb-4",children:c&&c.length>0?c.map(b=>{const I=o===b.id;let S=b.icon;try{const y=JSON.parse(b.configJson||"{}");S=S||y.icon||y.avatar||y.logo}catch{}return S=S||Bc,$(Go,{content:()=>$(_c,{config:n.find(y=>y.id===b.id),styles:r}),trigger:"hover",placement:"bottom",children:Y("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 ${I?"active":""}`,onClick:()=>a==null?void 0:a(b.id),title:b.name,children:[$("span",{className:"icon-badge",children:$("img",{src:S,alt:"icon",style:{width:16,height:16,borderRadius:4}})}),$("span",{className:"truncate max-w-[180px]",children:b.name})]})},b.id)}):$("div",{className:"g-welcome-subtitle",children:"\u6682\u65E0\u53EF\u7528\u52A9\u624B"})}),w>1&&Y("div",{className:"flex items-center gap-3 text-sm",children:[$("button",{className:"g-welcome-pagination-btn px-3 py-1 rounded transition-colors",onClick:()=>u(b=>Math.max(1,b-1)),disabled:s===1,children:"\u4E0A\u4E00\u9875"}),Y("span",{className:"g-welcome-pagination-text",children:[s," / ",w]}),$("button",{className:"g-welcome-pagination-btn px-3 py-1 rounded transition-colors",onClick:()=>u(b=>Math.min(w,b+1)),disabled:s===w,children:"\u4E0B\u4E00\u9875"})]})]})}async function Lc(e,n){const t=e.getReader();let r;for(;!(r=await t.read()).done;)n(r.value)}function Hc(e){let n,t,r,o=!1;return function(i){n===void 0?(n=i,t=0,r=-1):n=Uc(n,i);const s=n.length;let u=0;for(;t<s;){o&&(n[t]===10&&(u=++t),o=!1);let d=-1;for(;t<s&&d===-1;++t)switch(n[t]){case 58:r===-1&&(r=t-u);break;case 13:o=!0;case 10:d=t;break}if(d===-1)break;e(n.subarray(u,d),r),u=t,r=-1}u===s?n=void 0:u!==0&&(n=n.subarray(u),t-=u)}}function qc(e,n,t){let r=Fo();const o=new TextDecoder;return function(i,s){if(i.length===0)t==null||t(r),r=Fo();else if(s>0){const u=o.decode(i.subarray(0,s)),d=s+(i[s+1]===32?2:1),f=o.decode(i.subarray(d));switch(u){case"data":r.data=r.data?r.data+`
|
|
143
|
+
`+f:f;break;case"event":r.event=f;break;case"id":e(r.id=f);break;case"retry":const m=parseInt(f,10);isNaN(m)||n(r.retry=m);break}}}}function Uc(e,n){const t=new Uint8Array(e.length+n.length);return t.set(e),t.set(n,e.length),t}function Fo(){return{data:"",event:"",id:"",retry:void 0}}var Wc=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t};const hr="text/event-stream",Vc=1e3,No="last-event-id";function Kc(e,n){var{signal:t,headers:r,onopen:o,onmessage:a,onclose:i,onerror:s,openWhenHidden:u,fetch:d}=n,f=Wc(n,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((m,v)=>{const x=Object.assign({},r);x.accept||(x.accept=hr);let w;function c(){w.abort(),document.hidden||y()}u||document.addEventListener("visibilitychange",c);let p=Vc,C=0;function b(){document.removeEventListener("visibilitychange",c),window.clearTimeout(C),w.abort()}t==null||t.addEventListener("abort",()=>{b(),m()});const I=d??window.fetch,S=o??Xc;async function y(){var F;w=new AbortController;try{const D=await I(e,Object.assign(Object.assign({},f),{headers:x,signal:w.signal}));await S(D),await Lc(D.body,Hc(qc(O=>{O?x[No]=O:delete x[No]},O=>{p=O},a))),i==null||i(),b(),m()}catch(D){if(!w.signal.aborted)try{const O=(F=s==null?void 0:s(D))!==null&&F!==void 0?F:p;window.clearTimeout(C),C=window.setTimeout(y,O)}catch(O){b(),v(O)}}}y()})}function Xc(e){const n=e.headers.get("content-type");if(!(n!=null&&n.startsWith(hr)))throw new Error(`Expected content-type to be ${hr}, Actual: ${n}`)}class rr extends Error{}let Ct=null;const Gc=({baseUrl:e,token:n,CSRFToken:t,setChatData:r,activeSessionId:o,setAppStatus:a,setConversationList:i})=>{const s=({content:w,status:c,respTime:p,filePaths:C,reference:b,webReference:I,graphReference:S,databaseReference:y,llmType:F,resultType:D,queryId:O,tokens:N})=>{r(E=>{var U;if(!E[0])return E;const _=E[0],T=_.messages||[],k=T.length-1;if(k<0)return E;const M=T[k];if(M.istype!=="ai")return E;let B=T.slice();if(C!=null&&C.length){const K=T.length-2;if(K>=0&&((U=T[K])==null?void 0:U.istype)==="user"){const L={...T[K],filePaths:C};B[K]=L}}const V={...M,content:(M.content||"")+w,status:c,respTime:p,filePaths:C,reference:b,webReference:I,graphReference:S??M.graphReference,databaseReference:y??M.databaseReference,resultType:D,llmType:F,tokens:N,queryId:O||M.queryId||Ht(32)};return V.clientSideId=V.clientSideId||V.queryId+"-ai",B[k]=V,[{..._,isNew:!1,messages:B},...E.slice(1)]})},u=w=>{if(w instanceof rr)throw a(c=>({...c,display:"error",sender:"ready"})),Ct&&(Ct.abort(),Ct=null),w};return{updateUserFilesMessage:({currentFiles:w})=>{r(c=>{if(!c[0])return c;const p=c[0],C=p.messages||[];if(!C.length)return c;const b=C.length-2;if(b<0||C[b].istype!=="user")return c;const S=C.slice();return S[b]={...C[b],currentFiles:w},[{...p,messages:S},...c.slice(1)]})},api_startChat_re:(w,c)=>{Ct&&Ct.abort(),Ct=new AbortController;const p=`${e}/qa/ai/question_re`;console.log("data",w);const C={...w};Kc(p,{method:"post",signal:Ct.signal,headers:{"Content-Type":"application/json",Accept:"text/event-stream",Authorization:n||"","X-CSRF-TOKEN-IN":t||""},openWhenHidden:!0,body:JSON.stringify(C),onopen:async b=>{if(b.status===500)throw new rr("Internal Server Error");if(!b.ok)throw new rr(`HTTP error: ${b.status}`)},onmessage:b=>{const I=JSON.parse(b.data);if(o!==I.sessionId)return;const{reply:S,resultType:y,respTime:F,reference:D,webReference:O,graphReference:N,filePaths:E,status:_,docs:T,llmType:k,databaseReference:M}=I,B=E?JSON.parse(E):[];if(_===2&&S&&S.content&&(S.content.includes("\u6A21\u578B\u6682\u65E0\u6CD5\u8FD4\u56DE")||S.content.includes("\u5931\u8D25")||S.content.includes("\u9519\u8BEF")||S.content.includes("\u8BF7\u7A0D\u540E\u518D\u8BD5"))&&a(V=>({...V,display:"ready",sender:"ready"})),_===2){if(s({content:S.content||"",status:2,respTime:F,filePaths:B,reference:D||T||"",webReference:O||"",graphReference:N||null,databaseReference:M,llmType:k,resultType:y,queryId:I.queryId,tokens:I.tokens}),a(V=>({...V,display:"ready",sender:"ready"})),c){const V=F||Date.now();console.log("[AichatUseController] \u6D88\u606F\u53D1\u9001\u6210\u529F\uFF0CgmtModified:",V),c(V)}}else s({content:S.content||"",status:_,respTime:F,filePaths:B,reference:D||T||"",webReference:O||"",graphReference:N||null,databaseReference:M,llmType:k,resultType:y,queryId:I.queryId,tokens:I.tokens})},onerror:u})},addEmptyMessage:({queryId:w,content:c,filePaths:p,currentFiles:C})=>{r(b=>{const I=new Date().toISOString(),S=w||Ht(32),y={istype:"user",content:c,time:I,queryId:S,clientSideId:S+"-user",filePaths:p||"",currentFiles:C||[]},F={istype:"ai",content:"",time:new Date(Date.now()+1).toISOString(),streaming:!0,status:0,queryId:S,clientSideId:S+"-ai"},D=b.find(O=>O.id===o);return D?D.messages.push(y,F):console.warn("addEmptyMessage called without an active session."),[...b]})},setLastEmptyMessage:({now:w})=>{r(c=>{if(!c[0])return c;const p=c[0],C=p.messages||[];if(!C.length)return c;const b=C.length-1;if(b<0)return c;const I=C[b];if(I.istype!=="ai")return c;const S=C.slice();return S[b]={...I,istype:"ai",content:"",time:w,streaming:!0,status:0},[{...p,messages:S},...c.slice(1)]})},stopStream:()=>{Ct&&(Ct.abort(),Ct=null),a(w=>({...w,display:"ready",sender:"ready"}))}}},Oo=e=>e?Array.isArray(e)?e.map(r=>"/minio/"+r.split("/").slice(3).join("/")):"/minio/"+e.split("/").slice(3).join("/"):"",Do="http://10.15.12.13:9000/",Jc=e=>{if(typeof e=="string"){const n=e.split(".");return n.length?n[n.length-1]:""}else return""},Yc=e=>{var y,F,D,O,N,E,_,T;const{file_type:n,file_name:t,url:r,parse_url:o,retrieve_tags:a,file_id:i,parsed_file_type:s,onlyDownloadTypes:u,references:d,eventsEmit:f,styles:m,isUploadFile:v,type:x,collectionItems:w,pdfPages:c=0,fileManagerData:p}=e;if(x==="collection"&&Array.isArray(w)){const B=`calc(90% - ${.5}px)`,V=w.slice(0,4),j=w.length>4,U="\u6253\u5F00\u5408\u96C6",K=()=>{if(p&&n==="pdf"&&!e.pdfPages){const L=((p==null?void 0:p.uploadedFiles)||[]).find(q=>{var ee;return((q==null?void 0:q.name)||((ee=q==null?void 0:q.file)==null?void 0:ee.name))===t});if(!(L!=null&&L.pdfPages)){Re.warning("\u8BE5PDF\u6587\u4EF6\u672A\u89E3\u6790\u5B8C\u6210\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}f==null||f("reference_file:click",{...e,pdfPages:(L==null?void 0:L.pdfPages)||0})}else f==null||f("reference_file:click",e)};return Y("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:(F=(y=m==null?void 0:m.theme)==null?void 0:y.colors)==null?void 0:F.border},onClick:K,children:[$("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:V.map((L,q)=>{var W,J,oe,ae;if(j&&q===3)return $("div",{className:"flex items-center justify-center bg-gray-100 rounded",style:{width:B,height:B},children:$("span",{className:"text-xl text-gray-300 font-bold scale-75",children:"..."})},"ellipsis");if(L.file_type==="image"||L.file_type==="jpg"||L.file_type==="jpeg"||L.file_type==="png"||L.file_type==="gif"||L.file_type==="bmp"||L.file_type==="webp")return $("div",{className:"relative flex items-center justify-center bg-white rounded-lg border overflow-hidden",style:{width:B,height:B,borderColor:(J=(W=m==null?void 0:m.theme)==null?void 0:W.colors)==null?void 0:J.border},children:$("div",{className:"flex items-center justify-center w-full h-full scale-75",children:$("img",{src:String(L.url||L.file_path||""),alt:L.file_name||"",className:"object-contain max-w-full max-h-full"})})},L.file_name||q);const R=vr(String(L.file_type||""),m);return $("div",{className:"user-file flex flex-col items-center justify-center rounded-lg border bg-gray-50 p-1 text-sm",title:L.file_name,style:{width:B,height:B,borderColor:(ae=(oe=m==null?void 0:m.theme)==null?void 0:oe.colors)==null?void 0:ae.border},children:$("div",{className:"flex items-center justify-center w-full h-full scale-75",children:R})},L.file_name||q)})}),$("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:Y("div",{className:"flex flex-col items-center text-xs justify-center text-white opacity-0 group-hover:opacity-100 transition-opacity",children:[$(Kn,{size:20,className:"mb-1 text-white"}),$("span",{className:"text-white text-center",style:{fontSize:12},children:U})]})})]})}const C=()=>{if(console.log(o,"parse_url",r,"url"),p&&n==="pdf"&&!c){const k=((p==null?void 0:p.uploadedFiles)||[]).find(M=>{var B;return((M==null?void 0:M.name)||((B=M==null?void 0:M.file)==null?void 0:B.name))===(t||"").replace(/\s+/g,"")});if(!(k!=null&&k.pdfPages)){Re.warning("\u8BE5PDF\u6587\u4EF6\u672A\u89E3\u6790\u5B8C\u6210\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}f==null||f("reference_file:click",{file:t,file_type:n,url:r,parse_url:o,retrieve_tags:a,file_id:i,parsed_file_type:s,references:d,type:b,isUploadFile:v,pdfPages:k.pdfPages||0})}else f==null||f("reference_file:click",{file:t,file_type:n,url:r,parse_url:o,retrieve_tags:a,file_id:i,parsed_file_type:s,references:d,type:b,isUploadFile:v,pdfPages:c})},b=Ge(()=>(t||"").split(".").pop()||"",[t]),I=vr(b,m),S=async()=>{if(r){const k=Oo(r.indexOf("http")>-1?r:`${Do}/${r}`);if(b.toLowerCase()==="json"){try{const V=await fetch(k);if(!V.ok)throw new Error("\u4E0B\u8F7D\u5931\u8D25");const j=await V.blob(),U=document.createElement("a");U.href=URL.createObjectURL(j),U.download=t||"",document.body.appendChild(U),U.click(),document.body.removeChild(U),setTimeout(()=>URL.revokeObjectURL(U.href),1e3)}catch{alert("\u6587\u4EF6\u4E0B\u8F7D\u5931\u8D25")}return}const B=document.createElement("a");B.href=k,B.download=t||"",document.body.appendChild(B),B.click(),document.body.removeChild(B)}};return u&&u.includes(b.toLowerCase())?Y("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:t,onClick:S,style:{borderColor:(O=(D=m==null?void 0:m.theme)==null?void 0:D.colors)==null?void 0:O.border},children:[I,$("span",{className:"file-name font-medium truncate text-center px-2 pt-1",style:{fontSize:10,maxWidth:"5.5rem"},children:t}),$("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:Y("div",{className:"flex flex-col items-center text-xs justify-center text-white opacity-0 group-hover:opacity-100 transition-opacity",children:[$(Kn,{className:"text-white opacity-0 group-hover:opacity-100 transition-opacity mx-auto"}),$("div",{className:"text-white text-center",style:{fontSize:10},children:"\u4E0B\u8F7D\u6587\u4EF6"})]})})]},t):b==="image"||b==="jpg"||b==="jpeg"||b==="png"||b==="gif"||b==="bmp"||b==="webp"?Y("div",{className:"relative group w-24 h-24 cursor-pointer flex items-center justify-center",onClick:()=>C(),children:[r?$("img",{src:String(Oo(r&&r.indexOf("http")>-1?r:`${Do}/${r}`)||""),alt:t||"",className:"w-full h-full object-cover rounded-md border",style:{borderColor:(E=(N=m==null?void 0:m.theme)==null?void 0:N.colors)==null?void 0:E.border}}):$("div",{className:"w-full h-full flex items-center justify-center",children:$("span",{className:"animate-spin rounded-full border-2 border-gray-300 border-t-blue-500 w-8 h-8 inline-block"})}),$("div",{className:"absolute inset-0 bg-transparent group-hover:bg-black/40 transition-all duration-300 flex items-center justify-center rounded-md",children:Y("div",{className:"flex flex-col items-center text-xs justify-center text-white opacity-0 group-hover:opacity-100 transition-opacity",children:[$($i,{className:"text-white opacity-0 group-hover:opacity-100 transition-opacity mx-auto"}),$("div",{className:"text-white text-center",children:"\u67E5\u770B\u56FE\u7247"})]})})]},t):Y("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:t,onClick:C,style:{borderColor:(T=(_=m==null?void 0:m.theme)==null?void 0:_.colors)==null?void 0:T.border},children:[I,$("span",{className:"file-name font-medium truncate text-center px-2 pt-1",style:{fontSize:10,maxWidth:"5.5rem"},children:t}),$("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:Y("div",{className:"flex flex-col items-center text-xs justify-center text-white opacity-0 group-hover:opacity-100 transition-opacity",children:[$(Kn,{className:"text-white opacity-0 group-hover:opacity-100 transition-opacity mx-auto"}),$("div",{className:"text-white text-center",style:{fontSize:10},children:"\u6253\u5F00\u6587\u4EF6"})]})})]},t)},Qc=e=>e?e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/1024/1024).toFixed(1)}MB`:"",Zc=({fileName:e,fileSize:n,icon:t,statusText:r,statusColor:o="text-gray-400",statusIcon:a,onRemove:i,themeColors:s={},cardId:u,showRemove:d=!0,disabledRemove:f=!1,onRemoveWithAnim:m,extra:v,style:x})=>Y("div",{id:u,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:x,children:[$("div",{className:"pt-1",children:t}),Y("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[Y("div",{className:"flex items-center justify-between gap-1",children:[$("span",{className:"text-[12px] font-medium truncate max-w-[120px]",title:e,children:e}),$("span",{className:"ml-1 text-[11px] text-gray-400",children:Qc(n)})]}),Y("div",{className:`text-[10px] mt-0.5 flex items-center gap-3 ${o}`,children:[a,$("span",{children:r})]})]}),v,d&&!f&&$("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:()=>{m&&u?m(u):i&&i()},title:"\u79FB\u9664",style:{lineHeight:0,color:s.error||"#FF0000"},children:$(Pr,{className:"w-3.5 h-3.5"})})]});function vr(e,n){var r;const t=((r=n==null?void 0:n.theme)==null?void 0:r.icons)||{};switch(e.toLowerCase()){case"docx":case"doc":return t.docx?$("img",{src:t.docx,alt:"docx",style:{width:20,height:20}}):$(lt,{type:"rag/word",size:18});case"image":case"jpg":case"jpeg":case"png":case"gif":case"bmp":case"webp":case"svg":case"ico":return t.image?$("img",{src:t.image,alt:"image",style:{width:20,height:20}}):$(lt,{type:"rag/pic",size:18});case"pptx":case"ppt":return t.pptx?$("img",{src:t.pptx,alt:"pptx",style:{width:20,height:20}}):$(lt,{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 t.sheets?$("img",{src:t.sheets,alt:"sheets",style:{width:20,height:20}}):$(lt,{type:"rag/excel",size:18});case"pdf":return t.pdf?$("img",{src:t.pdf,alt:"pdf",style:{width:20,height:20}}):$(lt,{type:"rag/pdf",size:18});case"txt":return t.txt?$("img",{src:t.txt,alt:"txt",style:{width:20,height:20}}):$(lt,{type:"rag/txt",size:18});case"md":return t.md?$("img",{src:t.md,alt:"txt",style:{width:20,height:20}}):$(lt,{type:"rag/document",size:18});case"json":return t.json?$("img",{src:t.json,alt:"json",style:{width:20,height:20}}):$(lt,{type:"rag/json",size:18});case"html":case"htm":return t.html?$("img",{src:t.html,alt:"html",style:{width:20,height:20}}):$(lt,{type:"rag/url",size:18});case"xml":default:return $(lt,{type:"rag/file",size:18})}}const eu=[{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 tu({open:e,onCancel:n,files:t=eu,currentFiles:r=[],onUpload:o,onRemoveFile:a,styles:i,eventsEmit:s}){const u={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"},[d,f]=Ie([]),m=(c,p)=>{s&&s("uploaded_file:removeFromTemp",{file:c,idx:p})},v=i&&i.theme&&i.theme.colors?i.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"},x=t.map((c,p)=>Y("div",{className:"relative flex flex-col gap-2.5 items-center justify-center",children:[$("div",{className:"absolute right-1 top-1 z-10",children:$(ya,{title:"\u786E\u8BA4\u4ECE\u4E34\u65F6\u5BF9\u8BDD\u77E5\u8BC6\u5E93\u79FB\u9664\u8BE5\u6587\u4EF6\uFF1F",onConfirm:()=>m(c,p),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",children:$("button",{className:"bg-white cursor-pointer rounded-full p-0.5",style:{lineHeight:0,color:v&&v.text?v.text:"#FF0000",transition:"background 0.2s, color 0.2s"},onMouseOver:C=>{C.currentTarget.style.color=v&&v.error?v.error:"#FF0000"},onMouseOut:C=>{C.currentTarget.style.color=v.text},title:"\u79FB\u9664",children:$(Pr,{className:"w-3 h-3"})})})}),$(Yc,{file_type:Jc(c.file.name||c.name),file_name:c.name||c.file.name,url:c.url,retrieve_tags:[],styles:i,isUploadFile:!0,eventsEmit:s,parse_url:c.convertedFilePath,pdfPages:c.pdfPages||0})]},c.file.name+p)),w=r.map((c,p)=>{const C=c.file.name.split(".").pop()||"",b=vr(C,i);return $(Zc,{cardId:`pending-file-card-${p}`,fileName:c.file.name,fileSize:c.file.size,icon:b,statusText:u[c.status||"pending"],statusColor:"text-gray-400",showRemove:!0,onRemove:()=>a&&a(c,p,"pending"),themeColors:v,style:{boxShadow:"none",height:55,background:"#f8fafc"}},c.file.name+p)});return d.length>0?(v&&v.error&&v.error,v&&v.error&&v.error+"",v&&v.error&&v.error):(v&&v.disabledText&&v.disabledText,v&&v.disabledBackground&&v.disabledBackground,v&&v.disabledText&&v.disabledText),Y(Ar,{open:e,onCancel:n,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:[Y("div",{className:"file-manager-modal space-y-6 px-4 py-4",children:[Y("div",{className:"",children:[$("div",{className:"flex items-center mb-2 justify-between",children:Y("div",{className:"flex items-center",children:[$("span",{className:"text-xs font-semibold text-gray-700",children:"\u5DF2\u4E0A\u4F20\u6587\u4EF6"}),Y("span",{className:"ml-2 text-xs text-gray-400",children:[t.length," \u4E2A"]})]})}),$("div",{className:"w-full relative min-h-[200px] max-h-[260px] p-2 overflow-y-auto",style:{overflowX:"hidden"},children:$("div",{className:"flex flex-wrap gap-1",children:x.length>0?x:$("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"})})})]}),Y("div",{children:[Y("div",{className:"flex items-center mb-2",children:[$("span",{className:"text-xs font-semibold text-gray-700",children:"\u5F85\u4E0A\u4F20\u6587\u4EF6"}),Y("span",{className:"ml-2 text-xs text-gray-400",children:[r.length," \u4E2A"]})]}),Y("div",{className:"flex gap-2 overflow-x-auto pb-2",children:[w,$(jr.Dragger,{multiple:!0,showUploadList:!1,beforeUpload:(c,p)=>(c===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:Y("div",{className:"flex flex-row items-center pb-8 justify-center",children:[$(Xo,{size:20,className:"text-blue-400 mr-2"}),$("div",{className:"text-xs text-gray-500",children:"\u4E0A\u4F20\u6587\u4EF6"})]})})]})]}),$("div",{className:"flex justify-end gap-2",children:$(pt,{type:"primary",onClick:n,children:"\u786E\u8BA4"})})]}),$("style",{children:`
|
|
144
144
|
.file-manager-modal .ant-upload-wrapper,
|
|
145
145
|
.file-manager-modal .ant-upload-drag,
|
|
146
146
|
.file-manager-modal .ant-upload-drag-container {
|
|
@@ -148,4 +148,4 @@ import{jsx as $,jsxs as Y,Fragment as Ea}from"react/jsx-runtime";import*as l fro
|
|
|
148
148
|
height: 55px !important;
|
|
149
149
|
padding: 0 !important;
|
|
150
150
|
}
|
|
151
|
-
`})]})}function nu(){return Y("div",{className:"flex flex-col gap-8 p-4 w-full mx-auto",children:[Y("div",{className:"flex items-start gap-4",children:[$("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),$("div",{className:"flex-1",children:$(vn,{active:!0,paragraph:{rows:1}})})]}),Y("div",{className:"flex items-start gap-4",children:[$("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),$("div",{className:"flex-1",children:$(vn,{active:!0,paragraph:{rows:3}})})]}),Y("div",{className:"flex items-start gap-4",children:[$("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),$("div",{className:"flex-1",children:$(vn,{active:!0,paragraph:{rows:1}})})]}),Y("div",{className:"flex items-start gap-4",children:[$("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),$("div",{className:"flex-1",children:$(vn,{active:!0,paragraph:{rows:2}})})]})]})}function ru({msg:e,subMsg:n}){return Y("div",{className:"flex flex-col items-center justify-center h-full p-8 text-center bg-white/80 backdrop-blur-sm",children:[$("div",{className:"mb-6 animate-bounce",children:$(Si,{size:64,className:"text-[#d70016]"})}),$("h2",{className:"text-[20px] font-medium text-[#222222] mb-3",children:e||"\u5E94\u7528\u521D\u59CB\u5316\u5931\u8D25"}),$("p",{className:"text-[14px] text-[#555555] mb-8 max-w-[400px]",children:n||"\u65E0\u6CD5\u5B8C\u6210\u5E94\u7528\u521D\u59CB\u5316\uFF0C\u8FD9\u53EF\u80FD\u662F\u7531\u4E8E\u7F51\u7EDC\u8FDE\u63A5\u95EE\u9898\u6216\u670D\u52A1\u914D\u7F6E\u9519\u8BEF\u5BFC\u81F4\u7684\u3002\u8BF7\u68C0\u67E5\u60A8\u7684\u7F51\u7EDC\u8FDE\u63A5\u5E76\u91CD\u8BD5\u3002"}),$(pt,{type:"primary",icon:$(Jo,{className:"w-4 h-4"}),onClick:()=>window.location.reload(),className:"flex items-center gap-2 bg-gradient-to-r from-[#2B69FF] to-[#8F91FF] border-none hover:opacity-90",children:"\u91CD\u65B0\u52A0\u8F7D"})]})}function ou(){return Y("div",{className:"flex flex-col items-center justify-center h-full p-8 text-center bg-transparent! backdrop-blur-sm",children:[$("div",{className:"mb-6 animate-bounce",children:$(li,{size:64,className:"text-[#d70016]"})}),$("h2",{className:"text-[20px] font-medium text-[#222222] mb-3",children:"\u62B1\u6B49\uFF0C\u9047\u5230\u4E86\u4E00\u4E9B\u95EE\u9898"}),$("p",{className:"text-[14px] text-[#555555] mb-8 max-w-[400px]",children:"\u8BF7\u6C42\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"}),$(pt,{type:"primary",icon:$(Jo,{className:"w-4 h-4"}),onClick:()=>window.location.reload(),className:"flex items-center gap-2 bg-gradient-to-r from-[#2B69FF] to-[#8F91FF] border-none hover:opacity-90",children:"\u91CD\u65B0\u52A0\u8F7D"})]})}const au=1e3,iu=3e3,su=({isModalOpen:e,handleOk:n,handleCancel:t,data:r})=>{const o={header:{height:"60px",borderBottom:"1px solid #F0F0F0",display:"flex",paddingLeft:"24px",alignItems:"center",marginBottom:"16px"},title:{fontSize:"16px"},body:{padding:"0 24px"},mask:{},footer:{marginTop:"0px",padding:"0 24px 16px 24px"},content:{padding:0}},[a]=Vo();return je(()=>{if(!e){a.resetFields();return}a.setFieldValue("new_name",r==null?void 0:r.label)},[r,e]),$(Ko,{modal:{styles:o},children:$(Ar,{title:$("div",{className:"text-[16px]",children:"\u7F16\u8F91\u4F1A\u8BDD\u540D\u79F0"}),closeIcon:null,open:e,width:520,centered:!0,className:"[&:[.ant-modal-content]]:bg-red",footer:Y("div",{className:"mt-[16px] flex justify-end",children:[$(pt,{children:"\u53D6\u6D88",onClick:t,className:"mr-[8px]"}),$(pt,{children:"\u786E\u8BA4",onClick:async()=>{try{const i=await a.validateFields();n("ok_rename",i)}catch(i){console.log(i);return}},type:"primary",className:"border-none"})]}),children:$(Xr,{form:a,children:$(Xr.Item,{name:"new_name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165"},{max:100,message:"\u6700\u5927\u5B57\u6570\u9650\u5236100"}],children:$(ci,{})})})})})},lu=({isModalOpen:e,handleOk:n,handleCancel:t,data:r})=>{const o={header:{height:"60px",borderBottom:"1px solid #F0F0F0",display:"flex",paddingLeft:"24px",alignItems:"center",marginBottom:"16px"},title:{fontSize:"16px"},body:{padding:"0 24px"},mask:{},footer:{marginTop:"0px",padding:"0 24px 16px 24px"},content:{padding:0}},[a]=Vo();return je(()=>{if(!e){a.resetFields();return}a.setFieldValue("new_name",r==null?void 0:r.label)},[r,e]),$(Ko,{modal:{styles:o},children:$(Ar,{title:$("div",{className:"text-[16px]",children:"\u5220\u9664\u4F1A\u8BDD"}),closeIcon:null,open:e,width:520,centered:!0,className:"[&:[.ant-modal-content]]:bg-red",footer:Y("div",{className:"mt-[16px] flex justify-end",children:[$(pt,{children:"\u53D6\u6D88",onClick:t,className:"mr-[8px]"}),$(pt,{children:"\u786E\u8BA4",onClick:async()=>{try{const i=await a.validateFields();n("ok_remove",i)}catch(i){console.log(i);return}},type:"primary",className:"border-none"})]}),children:$("div",{children:`\u786E\u5B9A\u8981\u5220\u9664\u4F1A\u8BDD\u300C${r.label}\u300D\u5417\uFF1F\u5220\u9664\u540E\u65E0\u6CD5\u6062\u590D\u3002`})})})};function wu(e=fi){return function({token:t,url:r="http://localhost:8888",styles:o,CSRFToken:a,eventsEmit:i,...s}){const u=Ge(()=>ui({theme:Dr,mode:"light"},o),[o]),[d,f]=Ie(!1),[m,h]=Ie(!1),[x,w]=Ie(null),[c,p]=Ie([]),[C,b]=Ie(1),[I]=Ie(16),[S,y]=Ie(0),[F,D]=Ie(!1),[O,N]=Ie([]),[E,_]=Ie(void 0),[T,k]=Ie([]),[M,B]=Ie([]),[V,j]=Ie(void 0),[U,K]=Ie(!1),[L,q]=Ie({display:"ready",sender:"ready",app:"initializing"}),[ee,R]=Ie([]);function W(v,g){if(!g)return v;const P=Array.isArray(v)?[...v]:{...v};for(const A in g)g[A]!==void 0&&g[A]!==null&&Object.prototype.hasOwnProperty.call(g,A)&&(typeof v[A]=="object"&&v[A]!==null&&!Array.isArray(v[A])&&typeof g[A]=="object"&&g[A]!==null&&!Array.isArray(g[A])?P[A]=W(v[A],g[A]):P[A]=g[A]);return P}const[J,oe]=Ie(()=>W(bo,s.senderConfig));je(()=>{s.senderConfig&&oe(W(bo,s.senderConfig))},[s.senderConfig]);const[ae,Q]=Ie([]),[ie,Ce]=Ie(()=>({uploadedFiles:[]}));je(()=>{if(!E)return;const v=O.find(A=>A.id===E);let g=[],P=!1;if(v&&v.messages){const A=[...v.messages||[]].reverse().find(H=>H.istype==="ai");if(A!=null&&A.reference&&A.resultType===5){P=!0;try{g=JSON.parse(A.reference).map(X=>Ue(X))}catch{}}}P&&Ce({uploadedFiles:g})},[O]),je(()=>{Ce({uploadedFiles:[]})},[E]);const[xe,we]=Be.useState(()=>{var g;if(!M||M.length===0)return;const v=M.find(P=>P.isDefault);return v?v.id:(g=M[0])==null?void 0:g.id});Be.useEffect(()=>{if(!M||M.length===0)return;const v=M.some(g=>g.id===xe);if(!xe||!v){const g=M.find(P=>P.isDefault);we(g?g.id:M[0].id)}},[M]);const[Te,Je]=Ie({}),Le=Xe(void 0),ve=Xe(void 0),me=Xe(void 0);Xe({sessionId:""}),Xe(null);const[ct,mt]=Ie({}),[$t,It]=Ie(!1),[At,et]=Ie([]),qe=Xe(!1),{api_startChat_re:St,addEmptyMessage:kt,setLastEmptyMessage:Mt,stopStream:Et}=Gc({baseUrl:r,CSRFToken:a,token:t,setChatData:N,activeSessionId:E,setAppStatus:q,setConversationList:p}),Ae=Ge(()=>{const v={};return(M||[]).forEach(g=>{v[g.id]=g}),v},[M]),ce=Ge(()=>{const v=O.find(P=>P.id===E)||{id:E,messages:[]},g=v.configId?Ae[v.configId]:null;return{...v,assistantInfo:g}},[O,E,Ae]),nt=Ge(()=>{if(ce.configId&&Ae){const v=Ae[ce.configId];return v!=null&&v.configJson?JSON.parse(v.configJson).is_download:!1}else return!1},[ce.configId,Ae]),ut=Ge(()=>{if((ce.configId||V)&&Ae){const v=Ae[ce.configId];if(v!=null&&v.configJson){const g=JSON.parse(v.configJson);return console.log("is_enableThinking",ce.configId,Ae,V),!!g.thinking}else if(V){const g=Ae[V];if(g!=null&&g.configJson)return!!JSON.parse(g.configJson).thinking}}return!1},[ce.configId,Ae,V]);function ft(v,g){const P=new Map;return v.forEach(A=>P.set(A.uid,Ue(A))),g.forEach(A=>P.set(A.uid,Ue(A))),Array.from(P.values())}function Ue(v){if(!v||v.file&&v.file.name)return v;const g=v.name||v.fileName||"";return{...v,url:v.filePath||"",uid:v.uid||"",file:{name:g,size:typeof v.size=="string"&&v.size.endsWith("MB")?Number(v.size.replace("MB",""))*1024*1024:v.size||0,type:v.type||""},name:g}}je(()=>{if(Le.current&&Le.current!==E){const g=Le.current,P=c.find(X=>X.sessionId===g&&X.isNew),A=O.find(X=>X.id===g&&X.isNew),H=A&&A.messages&&A.messages.length>0;P&&!H&&(p(X=>X.filter(ge=>ge.sessionId!==g)),N(X=>X.filter(ge=>ge.id!==g)))}Le.current=E;const v=ce.messages&&ce.messages.length>0?ce.messages[ce.messages.length-1].recommendQuestion:[];k(v)},[E,c,O,ce.messages]);const We=async v=>{var g,P,A,H;if(!F){D(!0);try{const X=await rt.get(`${r}/qa/dialogue/list?pageNo=${v}&pageSize=${I}&sysType=INT_SESSION`,{headers:{Authorization:t}}),ge=((P=(g=X==null?void 0:X.data)==null?void 0:g.data)==null?void 0:P.records)||[],te=((H=(A=X==null?void 0:X.data)==null?void 0:A.data)==null?void 0:H.total)||0;y(te),p(he=>{const Se=new Map;return[...he,...ge].forEach(z=>{Se.set(z.sessionId,z)}),Array.from(Se.values())}),b(v)}catch{}finally{D(!1)}}};je(()=>{q(v=>({...v,app:"initializing"})),rt.get(`${r}/qa/search/config/helper/list?pageNo=1&pageSize=3000`,{headers:{Authorization:t}}).then(v=>{B(v.data.data||[])}).catch(()=>{}),We(1).then(()=>{E||Ft(),q(v=>({...v,app:"ready"}))}).catch(()=>{q(v=>({...v,app:"error"}))})},[r,t]),je(()=>{E&&(q(v=>({...v,display:"loading"})),rt.get(`${r}/qa/dialogue/getDialogBySessionId?sessionId=${E}`,{headers:{Authorization:t}}).then(v=>{var He;if(!v.data.data){q(ue=>({...ue,display:"ready"}));return}const g=((He=v.data.data)==null?void 0:He.queryReplyPairList)||[],P=Oc(g),{sessionId:A,searchConfigDTO:H,filePath:X,configId:ge,reference:te,webReference:he,uploadedFiles:Se,fileList:z,currentFiles:ye}=v.data.data;if(P.length>0){const ue=P.length-1-[...P].reverse().findIndex(de=>de.istype==="ai");ue>=0&&ue<P.length&&P[ue].istype==="ai"&&(te&&(P[ue].reference=te),he&&(P[ue].webReference=he))}const fe=ye||z||Se;if(fe&&P.length>0){const ue=[...P].reverse().findIndex(de=>de.istype==="user");ue!==-1&&(console.log(P[P.length-1-ue].currentFiles,"filesData"),P[P.length-1-ue].currentFiles=fe)}c.find(ue=>ue.sessionId===A)&&p(ue=>ue.map(de=>de.sessionId===A?{...de,searchConfigDTO:H,filePath:X,configId:ge}:de));const le={configId:v.data.data.configId,filePath:v.data.data.filePath,searchConfigDTO:v.data.data.searchConfigDTO||{},sessionId:v.data.data.sessionId,label:v.data.data.label,kbId:v.data.data.kbId};N(ue=>{const de=ue.filter(Pe=>Pe.id!==E);return[{id:E,messages:P,...le},...de]}),q(ue=>({...ue,display:"ready"}))}).catch(v=>{console.error("\u83B7\u53D6\u804A\u5929\u6570\u636E\u5931\u8D25:",v),v.response&&v.response.status===404&&Ft(),q(g=>({...g,display:"error"}))}))},[E,r,t]),je(()=>{const v=ie.uploadedFiles.length;oe(g=>{const P=Array.isArray(g.actions)?g.actions:[];return{...g,actions:P.map(H=>H.name==="history"?{...H,badgeCount:v}:H)}})},[ie.uploadedFiles]),je(()=>{Dc({url:r,token:t},v=>{et(v)})},[]),Be.useEffect(()=>{ae.length&&N(v=>{if(!v[0])return v;const{messages:g}=v[0];for(let P=g.length-1;P>=0;P--)if(g[P].istype==="user"){const A=g[P].currentFiles||[];g[P].currentFiles=ae.map(H=>{var ge,te,he;const X=A.find(Se=>Se.uid===H.uid);return{name:((ge=H.file)==null?void 0:ge.name)||H.name,size:((te=H.file)==null?void 0:te.size)||H.size,type:((he=H.file)==null?void 0:he.type)||H.type,status:H.status,uid:H.uid,url:H.url||(X==null?void 0:X.url)||""}});break}return[...v]})},[ae]);let G=null,pe=null;const Fe=(v,g,P,A)=>{const H=v.join(",");let X=0;pe=()=>{qe.current=!0};const ge=async()=>{if(!qe.current){if(X>=au){qe.current||A("\u6587\u4EF6\u89E3\u6790\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");return}X++;try{const te=await rt.get(`${r}/index/knowledgeBase/file/getFileStatusByUids?uids=${H}`,{headers:{Authorization:t}});if(qe.current)return;if(te.data.success){const he=te.data.data;qe.current||g(he),he.every(z=>z.status===3)?qe.current||P():qe.current||setTimeout(ge,iu)}else qe.current||A(te.data.errorMsg||"\u67E5\u8BE2\u6587\u4EF6\u72B6\u6001\u5931\u8D25")}catch{if(qe.current)return;A("\u67E5\u8BE2\u6587\u4EF6\u72B6\u6001\u65F6\u53D1\u751F\u7F51\u7EDC\u9519\u8BEF")}}};ge()},se=(v,g)=>{N(P=>{const A=[...P];return A[0]&&(A[0]={...A[0],messages:A[0].messages.map(H=>H.queryId===v?{...H,feedbackResult:g}:H)}),A})},be=async v=>{var g,P;if(v)try{const A=(ce==null?void 0:ce.configId)||((g=Ae==null?void 0:Ae[(ce==null?void 0:ce.configId)||""])==null?void 0:g.id)||"",H=await rt.get(`${r}/qa/ai/recommendQuestion?queryId=${v}&configId=${A||""}`.replace(/\?&/,"?"),{headers:{Authorization:t}});k(((P=H.data)==null?void 0:P.data)||[])}catch{k([])}};function _e(v){const{content:g,audioUrl:P,filePaths:A,queryId:H}=v;if(!E||!H)return;const X=(ce==null?void 0:ce.messages)||[],ge=X.findIndex(fe=>(fe==null?void 0:fe.queryId)===H&&((fe==null?void 0:fe.istype)==="ai"||(fe==null?void 0:fe.isUser)===!1));let te;if(ge>0)for(let fe=ge-1;fe>=0;fe-=1){const Ne=X[fe];if((Ne==null?void 0:Ne.istype)==="user"||(Ne==null?void 0:Ne.isUser)===!0){te=Ne;break}}const he=(te==null?void 0:te.content)??g;if(!he)return;const Se=(te==null?void 0:te.filePaths)??A,z=(typeof Se=="string"&&Se?JSON.parse(Se):Se||[]).map(fe=>fe.uid),ye=Date.now();Mt({now:ye}),q(fe=>({...fe,display:"processing",sender:"processing"})),v.clearFn&&v.clearFn(),p(fe=>fe.map(Ne=>Ne.sessionId===E?{...Ne,gmtModified:ye}:Ne)),St({configId:ce.configId,content:he,fileUids:z,lastDate:ye,name:ce.label||"",queryId:H,sessionId:String(E||""),type:(te==null?void 0:te.audioUrl)??P?"audioUrl":"text",audioUrl:((te==null?void 0:te.audioUrl)??P)||"",enableThinking:!!Te.reasoning,enableWebsearch:!!Te.netSearch,qaChannel:Te.qaChannel},fe=>{be(H)})}async function at(v,g){if(!E)return;const P=c.find(A=>A.sessionId===E);if(P&&P.isNew){let A=!1;const H=V||P.configId,X=v&&v.content?v.content.slice(0,20):P.label||"\u672A\u547D\u540D\u4F1A\u8BDD";if(await new Promise((ge,te)=>{kc({url:r,token:t,CSRFToken:a},{label:X,sessionId:P.sessionId,sysType:"INT_SESSION",configId:H},he=>{he&&he.data&&he.data.sessionId?(p(Se=>Se.map(z=>z.sessionId===P.sessionId?{...z,isNew:!1,configId:H,label:X}:z)),N(Se=>Se.map(z=>z.id===P.sessionId?{...z,isNew:!1,configId:H,label:X}:z)),A=!0,ge()):(Re.error("\u521B\u5EFA\u4F1A\u8BDD\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),te())})}),!A)return;dt(E,v,g,H);return}dt(E,v,g)}function dt(v,g,P,A){const H="query-"+Ht(32),X=c.find(z=>z.sessionId===v),ge=A||(X==null?void 0:X.configId)||ce.configId;console.log("\u52A9\u624B\u914D\u7F6E\u8BE6\u60C5",ge);const te=g&&g.content?g.content.slice(0,20):"\u672A\u547D\u540D\u4F1A\u8BDD";let he;if(g.files&&g.files.length>0&&(he=g.files.map(z=>({name:z.file.name,size:z.file.size,type:z.file.type,filePath:z.filePath||"",convertedFilePath:z.convertedFilePath||"",uid:z.uid||""}))),console.log("\u672C\u5730\u6587\u4EF6\u4E0A\u4F20",g.files),kt({content:g.content||g.text||"",queryId:H,currentFiles:he,filePaths:he?JSON.stringify(he):void 0}),p(z=>z.map(ye=>ye.sessionId===v&&ye.label==="\u672A\u547D\u540D\u4F1A\u8BDD"&&ye.isNew?{...ye,label:te,gmtModified:Date.now(),isNew:!1}:ye)),N(z=>z.map(ye=>ye.id===v&&ye.label==="\u672A\u547D\u540D\u4F1A\u8BDD"&&ye.isNew?{...ye,label:te,isNew:!1}:ye)),g.files&&g.files.length>0){q(le=>({...le,sender:"uploading",display:"uploading"})),G=new AbortController,qe.current=!1;const z=g.files.map(()=>`rc-upload-${Date.now()}-${Math.random().toString(36).slice(2)}`),ye=g.files.map((le,He)=>({...le,uid:z[He],status:"uploading"}));Q(ye);const fe=new FormData;g.files.forEach(le=>{fe.append("files",le.file)});const Ne=String(v||"");fe.append("sessionId",Ne),fe.append("uids",z.join(",")),rt.post(`${r}/index/knowledgeBase/file/uploadFiles`,fe,{headers:{Authorization:t,"Content-Type":"multipart/form-data"},signal:G.signal}).then(le=>{if(console.log("\u6587\u4EF6\u4E0A\u4F20\u7684\u6253\u5370\u7ED3\u679C",le),!qe.current)if(le.data.success&&Array.isArray(le.data.data)&&le.data.data.length>0){Q(de=>de.map($e=>{const Pe=le.data.data.find(Oe=>Oe.uid===$e.uid);return Pe?{...$e,...Pe}:$e})),q(de=>({...de,sender:"processing",display:"analyzing"})),Q(de=>de.map($e=>({...$e,status:"parsing"})));const He=le.data.data,ue=He.map(de=>de.uid);Fe(ue,de=>{if(Q(Pe=>Pe.map(Oe=>{const Dt=de.find(yt=>yt.uid===Oe.uid);if(Dt)switch(Dt.status){case 3:return{...Oe,status:"done"};case 4:return{...Oe,status:"error"};case 1:case 2:default:return{...Oe,status:"parsing"}}return Oe})),de.length>0&&de.every(Pe=>Pe.status===3)){Q([]);const Pe=new Map;(de||[]).forEach(Oe=>{Pe.set(Oe.id,Oe)}),Ce(Oe=>({uploadedFiles:ft(Oe.uploadedFiles,He).map(yt=>{var _t;return{...yt,pdfPages:((_t=Pe.get(yt.id))==null?void 0:_t.pdfPages)||0}})}))}},()=>{P==null||P(),q($e=>({...$e,sender:"processing",display:"processing"})),Q($e=>$e.map(Pe=>{const Oe=He.find(Dt=>Dt.uid===Pe.uid);return Oe?{...Pe,...Oe,url:Oe.filePath,filePath:Oe.filePath,name:Oe.fileName||Pe.name,convertedFilePath:Oe.convertedFilePath||Pe.convertedFilePath}:Pe})),N($e=>{if(!$e[0])return $e;const{messages:Pe}=$e[0];for(let Oe=Pe.length-1;Oe>=0;Oe--)if(Pe[Oe].istype==="user"){const Dt=Pe[Oe].currentFiles||[];Pe[Oe].currentFiles=Dt.map(yt=>{const _t=He.find(ke=>ke.uid===yt.uid);return _t?{...yt,..._t}:yt});break}return[...$e]});const de=Date.now();St({configId:ge,content:g.content||g.text||"",fileUids:ue,lastDate:de,name:te,queryId:H,sessionId:String(v||""),type:"text",audioUrl:"",enableThinking:!!Te.reasoning,enableWebsearch:!!Te.netSearch,qaChannel:Te.qaChannel},$e=>{be(H)})},de=>{q($e=>({...$e,display:"ready",sender:"ready"})),Q($e=>$e.map(Pe=>({...Pe,status:"error",message:de})))})}else{const He=le.data.errorMsg||"\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25";q(ue=>({...ue,display:"error",sender:"ready"})),Q(ue=>ue.map(de=>({...de,status:"error",message:He})))}}).catch(le=>{var He,ue;((He=le==null?void 0:le.response)==null?void 0:He.status)===413?(ue=le==null?void 0:le.response)!=null&&ue.statusText.includes("Request Entity Too Large")&&Re.error("\u6587\u4EF6\u8D85\u8FC7\u6700\u5927\u53EF\u4E0A\u4F20\u9650\u5236"):Re.error("\u7F51\u7EDC\u9519\u8BEF"),q(de=>({...de,display:"error",sender:"ready"})),Q(de=>de.map($e=>({...$e,status:"error",message:"\u7F51\u7EDC\u9519\u8BEF"})))});return}q(z=>({...z,display:"processing",sender:"processing"}));const Se=Date.now();p(z=>z.map(ye=>ye.sessionId===v?{...ye,gmtModified:Se}:ye)),P==null||P(),St({configId:ge,content:g.content||g.text||"",fileUids:[],lastDate:Se,name:te,queryId:H,sessionId:String(v||""),type:"text",audioUrl:"",enableThinking:!!Te.reasoning,enableWebsearch:!!Te.netSearch,qaChannel:Te.qaChannel},z=>{be(H)})}function tt(v){v.restult==1?nr({url:r,token:t,CSRFToken:a},{queryId:v.queryId},()=>{se(v.queryId,null)}):Eo({url:r,token:t,CSRFToken:a},{restult:1,queryId:v.queryId},()=>{se(v.queryId,1)})}function Ft(v){const g=Ht(32),P={sessionId:g,label:"\u672A\u547D\u540D\u4F1A\u8BDD",gmtModified:Date.now(),searchConfigDTO:{},filePath:"",configId:"",isNew:!0};p(A=>[{...P,messages:[]},...A]),N(A=>[{id:g,messages:[],...P},...A]),_(g)}const pn=v=>{var H;const g=new Set([...ie.uploadedFiles.map(X=>X.file.name),...ee.map(X=>X.file.name)]),P=[],A=new Set;Array.from(v).forEach(X=>{g.has(X.name)?A.add(X.name):(P.push({file:X,type:So(X.name),status:"pending",preview:X.type.startsWith("image")?URL.createObjectURL(X):void 0}),g.add(X.name))}),A.size>0&&Re.warning(`\u4E0D\u80FD\u4E0A\u4F20\u540C\u540D\u6587\u4EF6: ${Array.from(A).join(", ")}`),P.length>0&&(R(X=>[...X,...P]),(H=ve.current)==null||H.call(ve,P))},Rn=(v,g,P)=>{var A;(A=me.current)==null||A.call(me,v,g,P)};function mn(v){if(v!=null&&v.sessionId&&v.sessionId!==E){_(v.sessionId),q(P=>({...P,sender:"ready"}));const g=O.find(P=>P.id===v.sessionId);if(g&&g.messages&&g.messages.length>0){const P=[...g.messages].reverse().find(A=>A.istype==="ai");P&&P.recommendQuestion?k(P.recommendQuestion):k([])}else k([])}}const bt=async v=>new Promise((g,P)=>{Ac({url:r,token:t,CSRFToken:a},{sessionId:v},A=>{A?(Re.success("\u5220\u9664\u6210\u529F!"),g(A)):(Re.error("\u5220\u9664\u5931\u8D25!"),P(A))})}),Bn=async()=>{try{return p([]),y(0),await We(1),[]}catch(v){throw Re.error("\u5237\u65B0\u4F1A\u8BDD\u5217\u8868\u5931\u8D25"),v}},Tn=async(v,g)=>new Promise((P,A)=>{Pc({url:r,token:t,CSRFToken:a},{label:g,sessionId:v},H=>{if(H){const X=Date.now();p(ge=>ge.map(te=>te.sessionId===v?{...te,label:g,gmtModified:X}:te)),Re.success("\u91CD\u547D\u540D\u6210\u529F!"),P(H)}else Re.error("\u91CD\u547D\u540D\u5931\u8D25"),A(H)})}),fn=v=>{p(g=>{const P=g.filter(A=>A.sessionId!==v);return E===v&&(P.length>0?_(P[0].sessionId):Ft()),P})},_n=(v,g)=>{const P=Date.now();p(A=>A.map(H=>H.sessionId===v?{...H,label:g,gmtModified:P}:H))},zn=v=>{Eo({url:r,token:t,CSRFToken:a},{...v,...ct,restult:0},()=>{se(ct.queryId,0)})},jn=v=>{const g=v.new_name,P=x.data.label;g&&g!==P?x.async_renameConversation(g).then(()=>{x.fn_renameItemInList(g),f(!1)}).catch(()=>{}):f(!1)},gn=v=>{x.async_deleteConversation().then(()=>{x.fn_removeItemFromList(),h(!1)}).catch(()=>{})},Nt=(v,g)=>{switch(console.log(v,g),v){case"close_remove":h(!1);break;case"close_rename":f(!1);break;case"ok_rename":jn(g);break;case"ok_remove":gn();break}},Ln=async({url:v,params:g,replacePredataFunction:P})=>{var A,H;try{const X=await rt.post(v,g,{headers:{Authorization:t}}),ge=(H=(A=X==null?void 0:X.data)==null?void 0:A.data)==null?void 0:H.data;ge&&P(ge)}catch(X){console.log("error",X)}},gt=(v,g)=>{var P,A,H;switch(console.log(`[Event] ${v}`,g),v){case"conversations:load_more":{c.length<S&&!F&&We(C+1);break}case"retrieve-sql-data:pagingation_click":const{page:X,pageSize:ge,fetchUrl:te,source:he,replacePredataFunction:Se}=g;Ln({url:`${r}${te}`,replacePredataFunction:Se,params:{pageNo:X,pageSize:ge,convertedFilePath:he,stream:!1}});break;case"web_referenceFile_title:click":if(!((P=g==null?void 0:g.data)!=null&&P.link))return console.error("\u6CA1\u6709\u7F51\u9875\u5730\u5740");window.open(g.data.link,"_blank");break;case"conversation:item_click":mn(g);break;case"files:finished_animation_complete":Q([]);break;case"conversation:create":Ft();break;case"conversation:new_assistant_change":j(g.assistantId);break;case"conversations:rename_icon_clicked":w({data:g,async_renameConversation:z=>Tn(g.sessionId,z),fn_renameItemInList:z=>_n(g.sessionId,z)}),f(!0);break;case"conversations:delete_icon_clicked":w({data:g,async_deleteConversation:()=>bt(g.sessionId),async_refreshConversationList:Bn,fn_removeItemFromList:()=>fn(g.sessionId)}),h(!0);break;case"sender:send":at(g,g.clearFn);break;case"sender:send_recommandQuestion":{const z=((g==null?void 0:g.content)??"").toString();if(!z)break;at({content:z},()=>{});break}case"chatbox:follow_up_question_click":{const z=((g==null?void 0:g.question)??(g==null?void 0:g.content)??"").toString();if(!z)break;at({content:z},()=>{});break}case"sender:action_history":K(!0);break;case"sender:stop":qe.current=!0,G&&(G.abort(),G=null),pe&&(pe(),pe=null),q(z=>({...z,display:"ready",sender:"ready"})),Q([]),Et==null||Et();break;case"sender:clear":(A=g.clearFn)==null||A.call(g);break;case"sender:configChange":g&&g.all&&Je(g.all);break;case"action_copy:click":g&&Nc(g.content,g.event);break;case"chatbox:copy":{const z=(g==null?void 0:g.content)||"";if(!z)break;const ye=async Ne=>{try{return await navigator.clipboard.writeText(Ne),Re.success("\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F"),!0}catch{return!1}},fe=Ne=>{const le=document.createElement("textarea");le.value=Ne,le.style.position="fixed",le.style.opacity="0",document.body.appendChild(le),le.focus(),le.select();try{document.execCommand("copy"),Re.success("\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F")}catch{Re.error("\u590D\u5236\u5931\u8D25")}document.body.removeChild(le)};ye(z).then(Ne=>{Ne||fe(z)});break}case"chatbox:repeat":console.log(g,"sdkflskdjflksdjfklsdjlfkjsdklfjsdklfjlks"),_e(g);break;case"action_thumbsup":tt(g);break;case"chatbox:like":tt({queryId:g==null?void 0:g.queryId,restult:g==null?void 0:g.result});break;case"action_thumbsdown":g.restult===0?nr({url:r,token:t,CSRFToken:a},{queryId:g.queryId},()=>{se(g.queryId,null)}):(mt(g),It(!0));break;case"chatbox:dislike":(g==null?void 0:g.result)===0?nr({url:r,token:t,CSRFToken:a},{queryId:g.queryId},()=>{se(g.queryId,null)}):(mt({queryId:g==null?void 0:g.queryId}),It(!0));break;case"action_retrive_tag":i==null||i("action_retrive_tag",g);break;case"referenceFile_view":i==null||i("referenceFile_view",g);break;case"referenceFile_question":console.log(g,"zhezhhzhzh"),i==null||i("referenceFile_question",g);break;case"referenceFile_download":i==null||i("referenceFile_download",g);break;case"retrive_tag:click":i==null||i("retrive_tag:click",g);break;case"fileManager:change":{const z=Array.isArray(g==null?void 0:g.uploadedFiles)?g.uploadedFiles:[];R(z),typeof(g==null?void 0:g.setUploadedFiles)=="function"&&(ve.current=g.setUploadedFiles,me.current=g.removeFile);break}case"uploaded_file:removeFromTemp":{console.log("[DEBUG] mergedEventsEmit uploaded_file:removeFromTemp \u4E8B\u4EF6",g);const z=(H=g==null?void 0:g.file)==null?void 0:H.uid;if(!z){console.warn("[DEBUG] \u7F3A\u5C11uid\uFF0C\u65E0\u6CD5\u5220\u9664\u4E34\u65F6\u6587\u4EF6",g);break}const ye=[...ce.messages||[]].reverse().find(Ne=>Ne.istype==="user"),fe=ye==null?void 0:ye.queryId;Mc({url:r,token:t,CSRFToken:a},{uid:z,queryId:fe},(Ne,le)=>{if(Ne){if(Re.success("\u6587\u4EF6\u5DF2\u4ECE\u4E34\u65F6\u77E5\u8BC6\u5E93\u79FB\u9664"),le&&Array.isArray(le.data&&le.data.data)){const He=le.data.data.map(ue=>{var $e;const de=ue.name||ue.fileName||"";return{file:{name:de,size:Number(($e=ue.size)==null?void 0:$e.replace("MB",""))*1024*1024||0,type:ue.type},type:So(de),status:"uploaded",url:ue.filePath,convertedFilePath:ue.convertedFilePath,uid:ue.uid,preview:ue.type==="image"?ue.filePath:void 0}});Ce({uploadedFiles:He})}}else console.log("[DEBUG] removeFilefromTempUpload \u56DE\u8C03 false\uFF0Cres:",le),Re.error("\u6587\u4EF6\u79FB\u9664\u5931\u8D25")});break}case"uploaded_file:remove_batch":break;default:i==null||i(v,g)}},Ot=[{key:"conversations",type:"custom",label:"\u5BF9\u8BDD\u5386\u53F2",icon:$(Ii,{size:16}),enabled:!0,component:$(Fc,{data:c,assistantList:M,activedItem:E||"",hasMore:c.length<S,loadingMore:F,sortRules:[{label:"\u5F53\u5929",dayPeriod:1},{label:"3\u5929",dayPeriod:3},{label:"7\u5929",dayPeriod:7},{label:"30\u5929",dayPeriod:30}],eventsEmit:gt,styles:u.theme})}],Qt=Be.useMemo(()=>()=>$(jc,{eventsEmit:gt,assistantList:M,styles:u,selectedId:xe,onSelectAssistant:we}),[xe]),qn={...Be.useMemo(()=>({AiChatBox:(v,g)=>{var he,Se;const P=g===(((he=ce==null?void 0:ce.messages)==null?void 0:he.length)||0)-1;let A="ready";if(P)if(v.status!==void 0)switch(v.status){case 0:A="thinking";break;case 1:A="processing";break;case 2:A="ready";break;case 3:A="error";break;default:A=L.display}else A=L.display;let H=[];if(Array.isArray(T))H=T;else if(typeof T=="string")try{H=JSON.parse(T)||[]}catch{H=[]}const X=(()=>{const z=v==null?void 0:v.reference;if(!z)return"[]";if(typeof z=="string")try{return JSON.parse(z),z}catch{return"[]"}try{return JSON.stringify(z)}catch{return"[]"}})(),ge=(()=>{const z=v==null?void 0:v.webReference;if(!z)return"[]";if(typeof z=="string")try{return JSON.parse(z),z}catch{return"[]"}try{return JSON.stringify(z)}catch{return"[]"}})(),te=(()=>{const z=v==null?void 0:v.graphReference;if(!z)return"[]";if(typeof z=="string")try{return JSON.parse(z),z}catch{return"[]"}try{return JSON.stringify(z)}catch{return"[]"}})();return $(Gr,{...v,reference:X,webReference:ge,graphReference:te,contentType:"stream",displayStatus:A,eventsEmit:gt,isLast:P&&(v==null?void 0:v.istype)==="ai",followUpQuestions:P&&(v==null?void 0:v.istype)==="ai"?H:[],defaultAnswer:((Se=ce==null?void 0:ce.searchConfigDTO)==null?void 0:Se.defaultAnswer)||"\u4E0D\u77E5\u9053\u4EC0\u4E48\u539F\u56E0\u6211\u4EEC\u6CA1\u80FD\u67E5\u5230\u4F60\u8981\u7684\u95EE\u9898*-*",is_download:nt,styles:u},`${(v==null?void 0:v.queryId)||(v==null?void 0:v.id)||g}-${(v==null?void 0:v.istype)||"unknown"}`)},LogoBox:v=>v&&v.LogoBox===null?null:v&&typeof v.LogoBox=="function"?$(v.LogoBox,{}):$("div",{className:"text-2xl w-full text-center font-bold",children:"\u5C0F\u9CB8\u667A\u80FD\u52A9\u624B"}),DisplayLoading:()=>$(nu,{}),DisplayError:()=>$(ou,{}),AppError:()=>$(ru,{msg:"\u5E94\u7528\u521D\u59CB\u5316\u5931\u8D25",subMsg:"\u65E0\u6CD5\u5B8C\u6210\u5E94\u7528\u521D\u59CB\u5316\uFF0C\u8FD9\u53EF\u80FD\u662F\u7531\u4E8E\u7F51\u7EDC\u8FDE\u63A5\u95EE\u9898\u6216\u670D\u52A1\u914D\u7F6E\u9519\u8BEF\u5BFC\u81F4\u7684\u3002\u8BF7\u68C0\u67E5\u60A8\u7684\u7F51\u7EDC\u8FDE\u63A5\u5E76\u91CD\u8BD5\u3002"}),AppLoading:()=>$(gi,{}),UserChatBox:(v,g)=>$(Gr,{...v,contentType:"plainText",isUser:!0,displayStatus:"ready",eventsEmit:gt,styles:u,fileManagerData:ie},`${(v==null?void 0:v.queryId)||(v==null?void 0:v.id)||g}-user`),WelcomeComponent:Qt}),[Qt,ce,L.display,gt,u,nt,ie]),...s.CustomComponents||{}};return je(()=>{oe(v=>{const g=Array.isArray(v.switchs)?v.switchs.map(P=>P.name==="reasoning"?{...P,enabled:ut}:P):[];return{...v,switchs:g}})},[ut]),Y(Ea,{children:[$(tu,{open:U,onCancel:()=>K(!1),files:ie.uploadedFiles,currentFiles:ee,onUpload:pn,onRemoveFile:Rn,styles:u,eventsEmit:gt}),$(e,{...s,status:L,chatData:ce,sidebar:Ot,recommandQuestions:[],eventsEmit:gt,styles:u,senderConfig:J,fileUploadStatus:ae,CustomComponents:qn,activeSessionId:E}),$(hi,{open:$t,feedBackList:At,setOpen:It,handleConfirm:zn}),$(su,{isModalOpen:d,handleOk:Nt,handleCancel:()=>Nt("close_rename"),data:(x==null?void 0:x.data)||{}}),$(lu,{isModalOpen:m,handleOk:Nt,handleCancel:()=>Nt("close_remove"),data:(x==null?void 0:x.data)||{}})]})}}export{wu as default};
|
|
151
|
+
`})]})}function nu(){return Y("div",{className:"flex flex-col gap-8 p-4 w-full mx-auto",children:[Y("div",{className:"flex items-start gap-4",children:[$("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),$("div",{className:"flex-1",children:$(vn,{active:!0,paragraph:{rows:1}})})]}),Y("div",{className:"flex items-start gap-4",children:[$("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),$("div",{className:"flex-1",children:$(vn,{active:!0,paragraph:{rows:3}})})]}),Y("div",{className:"flex items-start gap-4",children:[$("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),$("div",{className:"flex-1",children:$(vn,{active:!0,paragraph:{rows:1}})})]}),Y("div",{className:"flex items-start gap-4",children:[$("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),$("div",{className:"flex-1",children:$(vn,{active:!0,paragraph:{rows:2}})})]})]})}function ru({msg:e,subMsg:n}){return Y("div",{className:"flex flex-col items-center justify-center h-full p-8 text-center bg-white/80 backdrop-blur-sm",children:[$("div",{className:"mb-6 animate-bounce",children:$(Si,{size:64,className:"text-[#d70016]"})}),$("h2",{className:"text-[20px] font-medium text-[#222222] mb-3",children:e||"\u5E94\u7528\u521D\u59CB\u5316\u5931\u8D25"}),$("p",{className:"text-[14px] text-[#555555] mb-8 max-w-[400px]",children:n||"\u65E0\u6CD5\u5B8C\u6210\u5E94\u7528\u521D\u59CB\u5316\uFF0C\u8FD9\u53EF\u80FD\u662F\u7531\u4E8E\u7F51\u7EDC\u8FDE\u63A5\u95EE\u9898\u6216\u670D\u52A1\u914D\u7F6E\u9519\u8BEF\u5BFC\u81F4\u7684\u3002\u8BF7\u68C0\u67E5\u60A8\u7684\u7F51\u7EDC\u8FDE\u63A5\u5E76\u91CD\u8BD5\u3002"}),$(pt,{type:"primary",icon:$(Jo,{className:"w-4 h-4"}),onClick:()=>window.location.reload(),className:"flex items-center gap-2 bg-gradient-to-r from-[#2B69FF] to-[#8F91FF] border-none hover:opacity-90",children:"\u91CD\u65B0\u52A0\u8F7D"})]})}function ou(){return Y("div",{className:"flex flex-col items-center justify-center h-full p-8 text-center bg-transparent! backdrop-blur-sm",children:[$("div",{className:"mb-6 animate-bounce",children:$(li,{size:64,className:"text-[#d70016]"})}),$("h2",{className:"text-[20px] font-medium text-[#222222] mb-3",children:"\u62B1\u6B49\uFF0C\u9047\u5230\u4E86\u4E00\u4E9B\u95EE\u9898"}),$("p",{className:"text-[14px] text-[#555555] mb-8 max-w-[400px]",children:"\u8BF7\u6C42\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"}),$(pt,{type:"primary",icon:$(Jo,{className:"w-4 h-4"}),onClick:()=>window.location.reload(),className:"flex items-center gap-2 bg-gradient-to-r from-[#2B69FF] to-[#8F91FF] border-none hover:opacity-90",children:"\u91CD\u65B0\u52A0\u8F7D"})]})}const au=1e3,iu=3e3,su=({isModalOpen:e,handleOk:n,handleCancel:t,data:r})=>{const o={header:{height:"60px",borderBottom:"1px solid #F0F0F0",display:"flex",paddingLeft:"24px",alignItems:"center",marginBottom:"16px"},title:{fontSize:"16px"},body:{padding:"0 24px"},mask:{},footer:{marginTop:"0px",padding:"0 24px 16px 24px"},content:{padding:0}},[a]=Vo();return je(()=>{if(!e){a.resetFields();return}a.setFieldValue("new_name",r==null?void 0:r.label)},[r,e]),$(Ko,{modal:{styles:o},children:$(Ar,{title:$("div",{className:"text-[16px]",children:"\u7F16\u8F91\u4F1A\u8BDD\u540D\u79F0"}),closeIcon:null,open:e,width:520,centered:!0,className:"[&:[.ant-modal-content]]:bg-red",footer:Y("div",{className:"mt-[16px] flex justify-end",children:[$(pt,{children:"\u53D6\u6D88",onClick:t,className:"mr-[8px]"}),$(pt,{children:"\u786E\u8BA4",onClick:async()=>{try{const i=await a.validateFields();n("ok_rename",i)}catch(i){console.log(i);return}},type:"primary",className:"border-none"})]}),children:$(Xr,{form:a,children:$(Xr.Item,{name:"new_name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165"},{max:100,message:"\u6700\u5927\u5B57\u6570\u9650\u5236100"}],children:$(ci,{})})})})})},lu=({isModalOpen:e,handleOk:n,handleCancel:t,data:r})=>{const o={header:{height:"60px",borderBottom:"1px solid #F0F0F0",display:"flex",paddingLeft:"24px",alignItems:"center",marginBottom:"16px"},title:{fontSize:"16px"},body:{padding:"0 24px"},mask:{},footer:{marginTop:"0px",padding:"0 24px 16px 24px"},content:{padding:0}},[a]=Vo();return je(()=>{if(!e){a.resetFields();return}a.setFieldValue("new_name",r==null?void 0:r.label)},[r,e]),$(Ko,{modal:{styles:o},children:$(Ar,{title:$("div",{className:"text-[16px]",children:"\u5220\u9664\u4F1A\u8BDD"}),closeIcon:null,open:e,width:520,centered:!0,className:"[&:[.ant-modal-content]]:bg-red",footer:Y("div",{className:"mt-[16px] flex justify-end",children:[$(pt,{children:"\u53D6\u6D88",onClick:t,className:"mr-[8px]"}),$(pt,{children:"\u786E\u8BA4",onClick:async()=>{try{const i=await a.validateFields();n("ok_remove",i)}catch(i){console.log(i);return}},type:"primary",className:"border-none"})]}),children:$("div",{children:`\u786E\u5B9A\u8981\u5220\u9664\u4F1A\u8BDD\u300C${r.label}\u300D\u5417\uFF1F\u5220\u9664\u540E\u65E0\u6CD5\u6062\u590D\u3002`})})})};function wu(e=fi){return function({token:t,url:r="http://localhost:8888",styles:o,CSRFToken:a,eventsEmit:i,...s}){const u=Ge(()=>ui({theme:Dr,mode:"light"},o),[o]),[d,f]=Ie(!1),[m,v]=Ie(!1),[x,w]=Ie(null),[c,p]=Ie([]),[C,b]=Ie(1),[I]=Ie(16),[S,y]=Ie(0),[F,D]=Ie(!1),[O,N]=Ie([]),[E,_]=Ie(void 0),[T,k]=Ie([]),[M,B]=Ie([]),[V,j]=Ie(void 0),[U,K]=Ie(!1),[L,q]=Ie({display:"ready",sender:"ready",app:"initializing"}),[ee,R]=Ie([]);function W(h,g){if(!g)return h;const P=Array.isArray(h)?[...h]:{...h};for(const A in g)g[A]!==void 0&&g[A]!==null&&Object.prototype.hasOwnProperty.call(g,A)&&(typeof h[A]=="object"&&h[A]!==null&&!Array.isArray(h[A])&&typeof g[A]=="object"&&g[A]!==null&&!Array.isArray(g[A])?P[A]=W(h[A],g[A]):P[A]=g[A]);return P}const[J,oe]=Ie(()=>W(bo,s.senderConfig));je(()=>{s.senderConfig&&oe(W(bo,s.senderConfig))},[s.senderConfig]);const[ae,Q]=Ie([]),[ie,Ce]=Ie(()=>({uploadedFiles:[]}));je(()=>{if(!E)return;const h=O.find(A=>A.id===E);let g=[],P=!1;if(h&&h.messages){const A=[...h.messages||[]].reverse().find(H=>H.istype==="ai");if(A!=null&&A.reference&&A.resultType===5){P=!0;try{g=JSON.parse(A.reference).map(X=>Ue(X))}catch{}}}P&&Ce({uploadedFiles:g})},[O]),je(()=>{Ce({uploadedFiles:[]})},[E]);const[xe,we]=Be.useState(()=>{var g;if(!M||M.length===0)return;const h=M.find(P=>P.isDefault);return h?h.id:(g=M[0])==null?void 0:g.id});Be.useEffect(()=>{if(!M||M.length===0)return;const h=M.some(g=>g.id===xe);if(!xe||!h){const g=M.find(P=>P.isDefault);we(g?g.id:M[0].id)}},[M]);const[Te,Je]=Ie({}),Le=Xe(void 0),ve=Xe(void 0),me=Xe(void 0);Xe({sessionId:""}),Xe(null);const[ct,mt]=Ie({}),[$t,It]=Ie(!1),[At,et]=Ie([]),qe=Xe(!1),{api_startChat_re:St,addEmptyMessage:kt,setLastEmptyMessage:Mt,stopStream:Et}=Gc({baseUrl:r,CSRFToken:a,token:t,setChatData:N,activeSessionId:E,setAppStatus:q,setConversationList:p}),Ae=Ge(()=>{const h={};return(M||[]).forEach(g=>{h[g.id]=g}),h},[M]),ce=Ge(()=>{const h=O.find(P=>P.id===E)||{id:E,messages:[]},g=h.configId?Ae[h.configId]:null;return{...h,assistantInfo:g}},[O,E,Ae]),nt=Ge(()=>{if(ce.configId&&Ae){const h=Ae[ce.configId];return h!=null&&h.configJson?JSON.parse(h.configJson).is_download:!1}else return!1},[ce.configId,Ae]),ut=Ge(()=>{if((ce.configId||V)&&Ae){const h=Ae[ce.configId];if(h!=null&&h.configJson){const g=JSON.parse(h.configJson);return console.log("is_enableThinking",ce.configId,Ae,V),!!g.thinking}else if(V){const g=Ae[V];if(g!=null&&g.configJson)return!!JSON.parse(g.configJson).thinking}}return!1},[ce.configId,Ae,V]);function ft(h,g){const P=new Map;return h.forEach(A=>P.set(A.uid,Ue(A))),g.forEach(A=>P.set(A.uid,Ue(A))),Array.from(P.values())}function Ue(h){if(!h||h.file&&h.file.name)return h;const g=h.name||h.fileName||"";return{...h,url:h.filePath||"",uid:h.uid||"",file:{name:g,size:typeof h.size=="string"&&h.size.endsWith("MB")?Number(h.size.replace("MB",""))*1024*1024:h.size||0,type:h.type||""},name:g}}je(()=>{if(Le.current&&Le.current!==E){const g=Le.current,P=c.find(X=>X.sessionId===g&&X.isNew),A=O.find(X=>X.id===g&&X.isNew),H=A&&A.messages&&A.messages.length>0;P&&!H&&(p(X=>X.filter(ge=>ge.sessionId!==g)),N(X=>X.filter(ge=>ge.id!==g)))}Le.current=E;const h=ce.messages&&ce.messages.length>0?ce.messages[ce.messages.length-1].recommendQuestion:[];k(h)},[E,c,O,ce.messages]);const We=async h=>{var g,P,A,H;if(!F){D(!0);try{const X=await rt.get(`${r}/qa/dialogue/list?pageNo=${h}&pageSize=${I}&sysType=INT_SESSION`,{headers:{Authorization:t}}),ge=((P=(g=X==null?void 0:X.data)==null?void 0:g.data)==null?void 0:P.records)||[],te=((H=(A=X==null?void 0:X.data)==null?void 0:A.data)==null?void 0:H.total)||0;y(te),p(he=>{const Se=new Map;return[...he,...ge].forEach(z=>{Se.set(z.sessionId,z)}),Array.from(Se.values())}),b(h)}catch{}finally{D(!1)}}};je(()=>{q(h=>({...h,app:"initializing"})),rt.get(`${r}/qa/search/config/helper/list?pageNo=1&pageSize=3000`,{headers:{Authorization:t}}).then(h=>{B(h.data.data||[])}).catch(()=>{}),We(1).then(()=>{E||Ft(),q(h=>({...h,app:"ready"}))}).catch(()=>{q(h=>({...h,app:"error"}))})},[r,t]),je(()=>{E&&(q(h=>({...h,display:"loading"})),rt.get(`${r}/qa/dialogue/getDialogBySessionId?sessionId=${E}`,{headers:{Authorization:t}}).then(h=>{var He;if(!h.data.data){q(ue=>({...ue,display:"ready"}));return}const g=((He=h.data.data)==null?void 0:He.queryReplyPairList)||[],P=Oc(g),{sessionId:A,searchConfigDTO:H,filePath:X,configId:ge,reference:te,webReference:he,uploadedFiles:Se,fileList:z,currentFiles:ye}=h.data.data;if(P.length>0){const ue=P.length-1-[...P].reverse().findIndex(de=>de.istype==="ai");ue>=0&&ue<P.length&&P[ue].istype==="ai"&&(te&&(P[ue].reference=te),he&&(P[ue].webReference=he))}const fe=ye||z||Se;if(fe&&P.length>0){const ue=[...P].reverse().findIndex(de=>de.istype==="user");ue!==-1&&(console.log(P[P.length-1-ue].currentFiles,"filesData"),P[P.length-1-ue].currentFiles=fe)}c.find(ue=>ue.sessionId===A)&&p(ue=>ue.map(de=>de.sessionId===A?{...de,searchConfigDTO:H,filePath:X,configId:ge}:de));const le={configId:h.data.data.configId,filePath:h.data.data.filePath,searchConfigDTO:h.data.data.searchConfigDTO||{},sessionId:h.data.data.sessionId,label:h.data.data.label,kbId:h.data.data.kbId};N(ue=>{const de=ue.filter(Pe=>Pe.id!==E);return[{id:E,messages:P,...le},...de]}),q(ue=>({...ue,display:"ready"}))}).catch(h=>{console.error("\u83B7\u53D6\u804A\u5929\u6570\u636E\u5931\u8D25:",h),h.response&&h.response.status===404&&Ft(),q(g=>({...g,display:"error"}))}))},[E,r,t]),je(()=>{const h=ie.uploadedFiles.length;oe(g=>{const P=Array.isArray(g.actions)?g.actions:[];return{...g,actions:P.map(H=>H.name==="history"?{...H,badgeCount:h}:H)}})},[ie.uploadedFiles]),je(()=>{Dc({url:r,token:t},h=>{et(h)})},[]),Be.useEffect(()=>{ae.length&&N(h=>{if(!h[0])return h;const{messages:g}=h[0];for(let P=g.length-1;P>=0;P--)if(g[P].istype==="user"){const A=g[P].currentFiles||[];g[P].currentFiles=ae.map(H=>{var ge,te,he;const X=A.find(Se=>Se.uid===H.uid);return{name:((ge=H.file)==null?void 0:ge.name)||H.name,size:((te=H.file)==null?void 0:te.size)||H.size,type:((he=H.file)==null?void 0:he.type)||H.type,status:H.status,uid:H.uid,url:H.url||(X==null?void 0:X.url)||""}});break}return[...h]})},[ae]);let G=null,pe=null;const Fe=(h,g,P,A)=>{const H=h.join(",");let X=0;pe=()=>{qe.current=!0};const ge=async()=>{if(!qe.current){if(X>=au){qe.current||A("\u6587\u4EF6\u89E3\u6790\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");return}X++;try{const te=await rt.get(`${r}/index/knowledgeBase/file/getFileStatusByUids?uids=${H}`,{headers:{Authorization:t}});if(qe.current)return;if(te.data.success){const he=te.data.data;qe.current||g(he),he.every(z=>z.status===3)?qe.current||P():qe.current||setTimeout(ge,iu)}else qe.current||A(te.data.errorMsg||"\u67E5\u8BE2\u6587\u4EF6\u72B6\u6001\u5931\u8D25")}catch{if(qe.current)return;A("\u67E5\u8BE2\u6587\u4EF6\u72B6\u6001\u65F6\u53D1\u751F\u7F51\u7EDC\u9519\u8BEF")}}};ge()},se=(h,g)=>{N(P=>{const A=[...P];return A[0]&&(A[0]={...A[0],messages:A[0].messages.map(H=>H.queryId===h?{...H,feedbackResult:g}:H)}),A})},be=async h=>{var g,P;if(h)try{const A=(ce==null?void 0:ce.configId)||((g=Ae==null?void 0:Ae[(ce==null?void 0:ce.configId)||""])==null?void 0:g.id)||"",H=await rt.get(`${r}/qa/ai/recommendQuestion?queryId=${h}&configId=${A||""}`.replace(/\?&/,"?"),{headers:{Authorization:t}});k(((P=H.data)==null?void 0:P.data)||[])}catch{k([])}};function _e(h){const{content:g,audioUrl:P,filePaths:A,queryId:H}=h;if(!E||!H)return;const X=(ce==null?void 0:ce.messages)||[],ge=X.findIndex(fe=>(fe==null?void 0:fe.queryId)===H&&((fe==null?void 0:fe.istype)==="ai"||(fe==null?void 0:fe.isUser)===!1));let te;if(ge>0)for(let fe=ge-1;fe>=0;fe-=1){const Ne=X[fe];if((Ne==null?void 0:Ne.istype)==="user"||(Ne==null?void 0:Ne.isUser)===!0){te=Ne;break}}const he=(te==null?void 0:te.content)??g;if(!he)return;const Se=(te==null?void 0:te.filePaths)??A,z=(typeof Se=="string"&&Se?JSON.parse(Se):Se||[]).map(fe=>fe.uid),ye=Date.now();Mt({now:ye}),q(fe=>({...fe,display:"processing",sender:"processing"})),h.clearFn&&h.clearFn(),p(fe=>fe.map(Ne=>Ne.sessionId===E?{...Ne,gmtModified:ye}:Ne)),St({configId:ce.configId,content:he,fileUids:z,lastDate:ye,name:ce.label||"",queryId:H,sessionId:String(E||""),type:(te==null?void 0:te.audioUrl)??P?"audioUrl":"text",audioUrl:((te==null?void 0:te.audioUrl)??P)||"",enableThinking:!!Te.reasoning,enableWebsearch:!!Te.netSearch,qaChannel:Te.qaChannel},fe=>{be(H)})}async function at(h,g){if(!E)return;const P=c.find(A=>A.sessionId===E);if(P&&P.isNew){let A=!1;const H=V||P.configId,X=h&&h.content?h.content.slice(0,20):P.label||"\u672A\u547D\u540D\u4F1A\u8BDD";if(await new Promise((ge,te)=>{kc({url:r,token:t,CSRFToken:a},{label:X,sessionId:P.sessionId,sysType:"INT_SESSION",configId:H},he=>{he&&he.data&&he.data.sessionId?(p(Se=>Se.map(z=>z.sessionId===P.sessionId?{...z,isNew:!1,configId:H,label:X}:z)),N(Se=>Se.map(z=>z.id===P.sessionId?{...z,isNew:!1,configId:H,label:X}:z)),A=!0,ge()):(Re.error("\u521B\u5EFA\u4F1A\u8BDD\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),te())})}),!A)return;dt(E,h,g,H);return}dt(E,h,g)}function dt(h,g,P,A){const H="query-"+Ht(32),X=c.find(z=>z.sessionId===h),ge=A||(X==null?void 0:X.configId)||ce.configId;console.log("\u52A9\u624B\u914D\u7F6E\u8BE6\u60C5",ge);const te=g&&g.content?g.content.slice(0,20):"\u672A\u547D\u540D\u4F1A\u8BDD";let he;if(g.files&&g.files.length>0&&(he=g.files.map(z=>({name:z.file.name,size:z.file.size,type:z.file.type,filePath:z.filePath||"",convertedFilePath:z.convertedFilePath||"",uid:z.uid||""}))),console.log("\u672C\u5730\u6587\u4EF6\u4E0A\u4F20",g.files),kt({content:g.content||g.text||"",queryId:H,currentFiles:he,filePaths:he?JSON.stringify(he):void 0}),p(z=>z.map(ye=>ye.sessionId===h&&ye.label==="\u672A\u547D\u540D\u4F1A\u8BDD"&&ye.isNew?{...ye,label:te,gmtModified:Date.now(),isNew:!1}:ye)),N(z=>z.map(ye=>ye.id===h&&ye.label==="\u672A\u547D\u540D\u4F1A\u8BDD"&&ye.isNew?{...ye,label:te,isNew:!1}:ye)),g.files&&g.files.length>0){q(le=>({...le,sender:"uploading",display:"uploading"})),G=new AbortController,qe.current=!1;const z=g.files.map(()=>`rc-upload-${Date.now()}-${Math.random().toString(36).slice(2)}`),ye=g.files.map((le,He)=>({...le,uid:z[He],status:"uploading"}));Q(ye);const fe=new FormData;g.files.forEach(le=>{fe.append("files",le.file)});const Ne=String(h||"");fe.append("sessionId",Ne),fe.append("uids",z.join(",")),rt.post(`${r}/index/knowledgeBase/file/uploadFiles`,fe,{headers:{Authorization:t,"Content-Type":"multipart/form-data"},signal:G.signal}).then(le=>{if(console.log("\u6587\u4EF6\u4E0A\u4F20\u7684\u6253\u5370\u7ED3\u679C",le),!qe.current)if(le.data.success&&Array.isArray(le.data.data)&&le.data.data.length>0){Q(de=>de.map($e=>{const Pe=le.data.data.find(Oe=>Oe.uid===$e.uid);return Pe?{...$e,...Pe}:$e})),q(de=>({...de,sender:"processing",display:"analyzing"})),Q(de=>de.map($e=>({...$e,status:"parsing"})));const He=le.data.data,ue=He.map(de=>de.uid);Fe(ue,de=>{if(Q(Pe=>Pe.map(Oe=>{const Dt=de.find(yt=>yt.uid===Oe.uid);if(Dt)switch(Dt.status){case 3:return{...Oe,status:"done"};case 4:return{...Oe,status:"error"};case 1:case 2:default:return{...Oe,status:"parsing"}}return Oe})),de.length>0&&de.every(Pe=>Pe.status===3)){Q([]);const Pe=new Map;(de||[]).forEach(Oe=>{Pe.set(Oe.id,Oe)}),Ce(Oe=>({uploadedFiles:ft(Oe.uploadedFiles,He).map(yt=>{var _t;return{...yt,pdfPages:((_t=Pe.get(yt.id))==null?void 0:_t.pdfPages)||0}})}))}},()=>{P==null||P(),q($e=>({...$e,sender:"processing",display:"processing"})),Q($e=>$e.map(Pe=>{const Oe=He.find(Dt=>Dt.uid===Pe.uid);return Oe?{...Pe,...Oe,url:Oe.filePath,filePath:Oe.filePath,name:Oe.fileName||Pe.name,convertedFilePath:Oe.convertedFilePath||Pe.convertedFilePath}:Pe})),N($e=>{if(!$e[0])return $e;const{messages:Pe}=$e[0];for(let Oe=Pe.length-1;Oe>=0;Oe--)if(Pe[Oe].istype==="user"){const Dt=Pe[Oe].currentFiles||[];Pe[Oe].currentFiles=Dt.map(yt=>{const _t=He.find(ke=>ke.uid===yt.uid);return _t?{...yt,..._t}:yt});break}return[...$e]});const de=Date.now();St({configId:ge,content:g.content||g.text||"",fileUids:ue,lastDate:de,name:te,queryId:H,sessionId:String(h||""),type:"text",audioUrl:"",enableThinking:!!Te.reasoning,enableWebsearch:!!Te.netSearch,qaChannel:Te.qaChannel},$e=>{be(H)})},de=>{q($e=>({...$e,display:"ready",sender:"ready"})),Q($e=>$e.map(Pe=>({...Pe,status:"error",message:de})))})}else{const He=le.data.errorMsg||"\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25";q(ue=>({...ue,display:"error",sender:"ready"})),Q(ue=>ue.map(de=>({...de,status:"error",message:He})))}}).catch(le=>{var He,ue;((He=le==null?void 0:le.response)==null?void 0:He.status)===413?(ue=le==null?void 0:le.response)!=null&&ue.statusText.includes("Request Entity Too Large")&&Re.error("\u6587\u4EF6\u8D85\u8FC7\u6700\u5927\u53EF\u4E0A\u4F20\u9650\u5236"):Re.error("\u7F51\u7EDC\u9519\u8BEF"),q(de=>({...de,display:"error",sender:"ready"})),Q(de=>de.map($e=>({...$e,status:"error",message:"\u7F51\u7EDC\u9519\u8BEF"})))});return}q(z=>({...z,display:"processing",sender:"processing"}));const Se=Date.now();p(z=>z.map(ye=>ye.sessionId===h?{...ye,gmtModified:Se}:ye)),P==null||P(),St({configId:ge,content:g.content||g.text||"",fileUids:[],lastDate:Se,name:te,queryId:H,sessionId:String(h||""),type:"text",audioUrl:"",enableThinking:!!Te.reasoning,enableWebsearch:!!Te.netSearch,qaChannel:Te.qaChannel},z=>{be(H)})}function tt(h){h.restult==1?nr({url:r,token:t,CSRFToken:a},{queryId:h.queryId},()=>{se(h.queryId,null)}):Eo({url:r,token:t,CSRFToken:a},{restult:1,queryId:h.queryId},()=>{se(h.queryId,1)})}function Ft(h){const g=Ht(32),P={sessionId:g,label:"\u672A\u547D\u540D\u4F1A\u8BDD",gmtModified:Date.now(),searchConfigDTO:{},filePath:"",configId:"",isNew:!0};p(A=>[{...P,messages:[]},...A]),N(A=>[{id:g,messages:[],...P},...A]),_(g)}const pn=h=>{var H;const g=new Set([...ie.uploadedFiles.map(X=>X.file.name),...ee.map(X=>X.file.name)]),P=[],A=new Set;Array.from(h).forEach(X=>{g.has(X.name)?A.add(X.name):(P.push({file:X,type:So(X.name),status:"pending",preview:X.type.startsWith("image")?URL.createObjectURL(X):void 0}),g.add(X.name))}),A.size>0&&Re.warning(`\u4E0D\u80FD\u4E0A\u4F20\u540C\u540D\u6587\u4EF6: ${Array.from(A).join(", ")}`),P.length>0&&(R(X=>[...X,...P]),(H=ve.current)==null||H.call(ve,P))},Rn=(h,g,P)=>{var A;(A=me.current)==null||A.call(me,h,g,P)};function mn(h){if(h!=null&&h.sessionId&&h.sessionId!==E){_(h.sessionId),q(P=>({...P,sender:"ready"}));const g=O.find(P=>P.id===h.sessionId);if(g&&g.messages&&g.messages.length>0){const P=[...g.messages].reverse().find(A=>A.istype==="ai");P&&P.recommendQuestion?k(P.recommendQuestion):k([])}else k([])}}const bt=async h=>new Promise((g,P)=>{Ac({url:r,token:t,CSRFToken:a},{sessionId:h},A=>{A?(Re.success("\u5220\u9664\u6210\u529F!"),g(A)):(Re.error("\u5220\u9664\u5931\u8D25!"),P(A))})}),Bn=async()=>{try{return p([]),y(0),await We(1),[]}catch(h){throw Re.error("\u5237\u65B0\u4F1A\u8BDD\u5217\u8868\u5931\u8D25"),h}},Tn=async(h,g)=>new Promise((P,A)=>{Pc({url:r,token:t,CSRFToken:a},{label:g,sessionId:h},H=>{if(H){const X=Date.now();p(ge=>ge.map(te=>te.sessionId===h?{...te,label:g,gmtModified:X}:te)),Re.success("\u91CD\u547D\u540D\u6210\u529F!"),P(H)}else Re.error("\u91CD\u547D\u540D\u5931\u8D25"),A(H)})}),fn=h=>{p(g=>{const P=g.filter(A=>A.sessionId!==h);return E===h&&(P.length>0?_(P[0].sessionId):Ft()),P})},_n=(h,g)=>{const P=Date.now();p(A=>A.map(H=>H.sessionId===h?{...H,label:g,gmtModified:P}:H))},zn=h=>{Eo({url:r,token:t,CSRFToken:a},{...h,...ct,restult:0},()=>{se(ct.queryId,0)})},jn=h=>{const g=h.new_name,P=x.data.label;g&&g!==P?x.async_renameConversation(g).then(()=>{x.fn_renameItemInList(g),f(!1)}).catch(()=>{}):f(!1)},gn=h=>{x.async_deleteConversation().then(()=>{x.fn_removeItemFromList(),v(!1)}).catch(()=>{})},Nt=(h,g)=>{switch(console.log(h,g),h){case"close_remove":v(!1);break;case"close_rename":f(!1);break;case"ok_rename":jn(g);break;case"ok_remove":gn();break}},Ln=async({url:h,params:g,replacePredataFunction:P})=>{var A,H;try{const X=await rt.post(h,g,{headers:{Authorization:t}}),ge=(H=(A=X==null?void 0:X.data)==null?void 0:A.data)==null?void 0:H.data;ge&&P(ge)}catch(X){console.log("error",X)}},gt=(h,g)=>{var P,A,H;switch(console.log(`[Event] ${h}`,g),h){case"conversations:load_more":{c.length<S&&!F&&We(C+1);break}case"retrieve-sql-data:pagingation_click":const{page:X,pageSize:ge,fetchUrl:te,source:he,replacePredataFunction:Se}=g;Ln({url:`${r}${te}`,replacePredataFunction:Se,params:{pageNo:X,pageSize:ge,convertedFilePath:he,stream:!1}});break;case"web_referenceFile_title:click":if(!((P=g==null?void 0:g.data)!=null&&P.link))return console.error("\u6CA1\u6709\u7F51\u9875\u5730\u5740");window.open(g.data.link,"_blank");break;case"conversation:item_click":mn(g);break;case"files:finished_animation_complete":Q([]);break;case"conversation:create":Ft();break;case"conversation:new_assistant_change":j(g.assistantId);break;case"conversations:rename_icon_clicked":w({data:g,async_renameConversation:z=>Tn(g.sessionId,z),fn_renameItemInList:z=>_n(g.sessionId,z)}),f(!0);break;case"conversations:delete_icon_clicked":w({data:g,async_deleteConversation:()=>bt(g.sessionId),async_refreshConversationList:Bn,fn_removeItemFromList:()=>fn(g.sessionId)}),v(!0);break;case"sender:send":at(g,g.clearFn);break;case"sender:send_recommandQuestion":{const z=((g==null?void 0:g.content)??"").toString();if(!z)break;at({content:z},()=>{});break}case"chatbox:follow_up_question_click":{const z=((g==null?void 0:g.question)??(g==null?void 0:g.content)??"").toString();if(!z)break;at({content:z},()=>{});break}case"sender:action_history":K(!0);break;case"sender:stop":qe.current=!0,G&&(G.abort(),G=null),pe&&(pe(),pe=null),q(z=>({...z,display:"ready",sender:"ready"})),Q([]),Et==null||Et();break;case"sender:clear":(A=g.clearFn)==null||A.call(g);break;case"sender:configChange":g&&g.all&&Je(g.all);break;case"action_copy:click":g&&Nc(g.content,g.event);break;case"chatbox:copy":{const z=(g==null?void 0:g.content)||"";if(!z)break;const ye=async Ne=>{try{return await navigator.clipboard.writeText(Ne),Re.success("\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F"),!0}catch{return!1}},fe=Ne=>{const le=document.createElement("textarea");le.value=Ne,le.style.position="fixed",le.style.opacity="0",document.body.appendChild(le),le.focus(),le.select();try{document.execCommand("copy"),Re.success("\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F")}catch{Re.error("\u590D\u5236\u5931\u8D25")}document.body.removeChild(le)};ye(z).then(Ne=>{Ne||fe(z)});break}case"chatbox:repeat":console.log(g,"sdkflskdjflksdjfklsdjlfkjsdklfjsdklfjlks"),_e(g);break;case"action_thumbsup":tt(g);break;case"chatbox:like":tt({queryId:g==null?void 0:g.queryId,restult:g==null?void 0:g.result});break;case"action_thumbsdown":g.restult===0?nr({url:r,token:t,CSRFToken:a},{queryId:g.queryId},()=>{se(g.queryId,null)}):(mt(g),It(!0));break;case"chatbox:dislike":(g==null?void 0:g.result)===0?nr({url:r,token:t,CSRFToken:a},{queryId:g.queryId},()=>{se(g.queryId,null)}):(mt({queryId:g==null?void 0:g.queryId}),It(!0));break;case"action_retrive_tag":i==null||i("action_retrive_tag",g);break;case"referenceFile_view":i==null||i("referenceFile_view",g);break;case"referenceFile_question":console.log(g,"zhezhhzhzh"),i==null||i("referenceFile_question",g);break;case"referenceFile_download":i==null||i("referenceFile_download",g);break;case"retrive_tag:click":i==null||i("retrive_tag:click",g);break;case"fileManager:change":{const z=Array.isArray(g==null?void 0:g.uploadedFiles)?g.uploadedFiles:[];R(z),typeof(g==null?void 0:g.setUploadedFiles)=="function"&&(ve.current=g.setUploadedFiles,me.current=g.removeFile);break}case"uploaded_file:removeFromTemp":{console.log("[DEBUG] mergedEventsEmit uploaded_file:removeFromTemp \u4E8B\u4EF6",g);const z=(H=g==null?void 0:g.file)==null?void 0:H.uid;if(!z){console.warn("[DEBUG] \u7F3A\u5C11uid\uFF0C\u65E0\u6CD5\u5220\u9664\u4E34\u65F6\u6587\u4EF6",g);break}const ye=[...ce.messages||[]].reverse().find(Ne=>Ne.istype==="user"),fe=ye==null?void 0:ye.queryId;Mc({url:r,token:t,CSRFToken:a},{uid:z,queryId:fe},(Ne,le)=>{if(Ne){if(Re.success("\u6587\u4EF6\u5DF2\u4ECE\u4E34\u65F6\u77E5\u8BC6\u5E93\u79FB\u9664"),le&&Array.isArray(le.data&&le.data.data)){const He=le.data.data.map(ue=>{var $e;const de=ue.name||ue.fileName||"";return{file:{name:de,size:Number(($e=ue.size)==null?void 0:$e.replace("MB",""))*1024*1024||0,type:ue.type},type:So(de),status:"uploaded",url:ue.filePath,convertedFilePath:ue.convertedFilePath,uid:ue.uid,preview:ue.type==="image"?ue.filePath:void 0}});Ce({uploadedFiles:He})}}else console.log("[DEBUG] removeFilefromTempUpload \u56DE\u8C03 false\uFF0Cres:",le),Re.error("\u6587\u4EF6\u79FB\u9664\u5931\u8D25")});break}case"uploaded_file:remove_batch":break;default:i==null||i(h,g)}},Ot=[{key:"conversations",type:"custom",label:"\u5BF9\u8BDD\u5386\u53F2",icon:$(Ii,{size:16}),enabled:!0,component:$(Fc,{data:c,assistantList:M,activedItem:E||"",hasMore:c.length<S,loadingMore:F,sortRules:[{label:"\u5F53\u5929",dayPeriod:1},{label:"3\u5929",dayPeriod:3},{label:"7\u5929",dayPeriod:7},{label:"30\u5929",dayPeriod:30}],eventsEmit:gt,styles:u.theme})}],Qt=Be.useMemo(()=>()=>$(jc,{eventsEmit:gt,assistantList:M,styles:u,selectedId:xe,onSelectAssistant:we,productLogo:s==null?void 0:s.productLogo}),[xe]),qn={...Be.useMemo(()=>({AiChatBox:(h,g)=>{var he,Se;const P=g===(((he=ce==null?void 0:ce.messages)==null?void 0:he.length)||0)-1;let A="ready";if(P)if(h.status!==void 0)switch(h.status){case 0:A="thinking";break;case 1:A="processing";break;case 2:A="ready";break;case 3:A="error";break;default:A=L.display}else A=L.display;let H=[];if(Array.isArray(T))H=T;else if(typeof T=="string")try{H=JSON.parse(T)||[]}catch{H=[]}const X=(()=>{const z=h==null?void 0:h.reference;if(!z)return"[]";if(typeof z=="string")try{return JSON.parse(z),z}catch{return"[]"}try{return JSON.stringify(z)}catch{return"[]"}})(),ge=(()=>{const z=h==null?void 0:h.webReference;if(!z)return"[]";if(typeof z=="string")try{return JSON.parse(z),z}catch{return"[]"}try{return JSON.stringify(z)}catch{return"[]"}})(),te=(()=>{const z=h==null?void 0:h.graphReference;if(!z)return"[]";if(typeof z=="string")try{return JSON.parse(z),z}catch{return"[]"}try{return JSON.stringify(z)}catch{return"[]"}})();return $(Gr,{...h,reference:X,webReference:ge,graphReference:te,contentType:"stream",displayStatus:A,eventsEmit:gt,isLast:P&&(h==null?void 0:h.istype)==="ai",followUpQuestions:P&&(h==null?void 0:h.istype)==="ai"?H:[],defaultAnswer:((Se=ce==null?void 0:ce.searchConfigDTO)==null?void 0:Se.defaultAnswer)||"\u4E0D\u77E5\u9053\u4EC0\u4E48\u539F\u56E0\u6211\u4EEC\u6CA1\u80FD\u67E5\u5230\u4F60\u8981\u7684\u95EE\u9898*-*",is_download:nt,styles:u},`${(h==null?void 0:h.queryId)||(h==null?void 0:h.id)||g}-${(h==null?void 0:h.istype)||"unknown"}`)},LogoBox:h=>h&&h.LogoBox===null?null:h&&typeof h.LogoBox=="function"?$(h.LogoBox,{}):$("div",{className:"text-2xl w-full text-center font-bold",children:"\u5C0F\u9CB8\u667A\u80FD\u52A9\u624B"}),DisplayLoading:()=>$(nu,{}),DisplayError:()=>$(ou,{}),AppError:()=>$(ru,{msg:"\u5E94\u7528\u521D\u59CB\u5316\u5931\u8D25",subMsg:"\u65E0\u6CD5\u5B8C\u6210\u5E94\u7528\u521D\u59CB\u5316\uFF0C\u8FD9\u53EF\u80FD\u662F\u7531\u4E8E\u7F51\u7EDC\u8FDE\u63A5\u95EE\u9898\u6216\u670D\u52A1\u914D\u7F6E\u9519\u8BEF\u5BFC\u81F4\u7684\u3002\u8BF7\u68C0\u67E5\u60A8\u7684\u7F51\u7EDC\u8FDE\u63A5\u5E76\u91CD\u8BD5\u3002"}),AppLoading:()=>{var h,g;return $(gi,{title:(h=s==null?void 0:s.appLoadingConfig)==null?void 0:h.title,subtitle:((g=s==null?void 0:s.appLoadingConfig)==null?void 0:g.subtitle)||""})},UserChatBox:(h,g)=>$(Gr,{...h,contentType:"plainText",isUser:!0,displayStatus:"ready",eventsEmit:gt,styles:u,fileManagerData:ie},`${(h==null?void 0:h.queryId)||(h==null?void 0:h.id)||g}-user`),WelcomeComponent:Qt}),[Qt,ce,L.display,gt,u,nt,ie]),...s.CustomComponents||{}};return je(()=>{oe(h=>{const g=Array.isArray(h.switchs)?h.switchs.map(P=>P.name==="reasoning"?{...P,enabled:ut}:P):[];return{...h,switchs:g}})},[ut]),Y(Ea,{children:[$(tu,{open:U,onCancel:()=>K(!1),files:ie.uploadedFiles,currentFiles:ee,onUpload:pn,onRemoveFile:Rn,styles:u,eventsEmit:gt}),$(e,{...s,status:L,chatData:ce,sidebar:Ot,recommandQuestions:[],eventsEmit:gt,styles:u,senderConfig:J,fileUploadStatus:ae,CustomComponents:qn,activeSessionId:E}),$(hi,{open:$t,feedBackList:At,setOpen:It,handleConfirm:zn}),$(su,{isModalOpen:d,handleOk:Nt,handleCancel:()=>Nt("close_rename"),data:(x==null?void 0:x.data)||{}}),$(lu,{isModalOpen:m,handleOk:Nt,handleCancel:()=>Nt("close_remove"),data:(x==null?void 0:x.data)||{}})]})}}export{wu as default};
|