@gientech/modual 2.2.3-fix.10 → 2.2.3-fix.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,196 @@
1
+ import{jsx as S,jsxs as Y,Fragment as ot}from"react/jsx-runtime";import*as E0 from"react";import Pe,{createElement as mr,PureComponent as Wa,useState as oe,useMemo as De,createContext as Jn,Children as ja,cloneElement as Va,Component as Ka,useRef as Ge,useEffect as _e,useCallback as Et}from"react";import{c as ut,bq as Ga,_ as Xa,aV as Xr,br as ea,H as ta,f as qr,w as l0,J as st,bs as ra,aH as dr,F as Qr,bp as Qa,T as pt,x as Ya,bt as yr}from"./index-DHK_n74G.js";import{f as Za,r as Ja,c as ei,B as ti,z as ri,d as na,g as aa,a as ia,b as Sr,e as Lr,h as kr,D as ni,T as cr,i as ai,j as Cr,k as ii,l as oi,m as si,G as ui,n as ci,W as li,o as oa,p as di,v as fi,q as xi,u as pi,F as hi,s as Yr,t as Fr,w as Er,x as vi,y as gi,A as mi,E as yi,H as Ci,I as Fi,J as Ei}from"./index-vmRMPTny.js";import{b as Bi,F as Ai,n as Zr}from"./index-BDSKWteb.js";import{u as k0}from"./index-CpW6Dhpp.js";import{b as sa,h as Jr,a as bi,e as Di}from"./index-DPA1HCWQ.js";import{D as _i}from"./index-BIEKgWu0.js";import{P as wi}from"./plus-BICgMvz9.js";import{S as Ir}from"./search-CD5YKija.js";import{X as ua}from"./x-DWGzNb9c.js";import{s as Re,S as Bt,M as ca}from"./index-iOuQJ8vu.js";import{P as Si}from"./index-usBlUHOb.js";import{C as ki,G as la,c as Ii,r as Ri}from"./GientechStreamReader-HkZu015m.js";import{P as Ni}from"./index-B4k3tK0f.js";/* empty css *//* empty css */import{D as da}from"./index-CzZQWA2P.js";import"../database.js";import"../databaseId.js";import"../databaseTable.js";import"../modelManage.js";import"../sensitive.js";import"../assistantConfig.js";/**
2
+ * @license lucide-react v0.456.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const Pi=ut("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
7
+ * @license lucide-react v0.456.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const Ti=ut("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
12
+ * @license lucide-react v0.456.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const zi=ut("OctagonX",[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
17
+ * @license lucide-react v0.456.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const qi=ut("Pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);/**
22
+ * @license lucide-react v0.456.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */const fa=ut("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
27
+ * @license lucide-react v0.456.0 - ISC
28
+ *
29
+ * This source code is licensed under the ISC license.
30
+ * See the LICENSE file in the root directory of this source tree.
31
+ */const Li=ut("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"}]]),Oi=r=>E0.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r},E0.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 14.6666C11.6819 14.6666 14.6667 11.6819 14.6667 7.99998C14.6667 4.31808 11.6819 1.33331 8 1.33331C4.3181 1.33331 1.33334 4.31808 1.33334 7.99998C1.33334 11.6819 4.3181 14.6666 8 14.6666Z",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),E0.createElement("path",{d:"M1.33334 8H14.6667",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),E0.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 14.6666C9.47277 14.6666 10.6667 11.6819 10.6667 7.99998C10.6667 4.31808 9.47277 1.33331 8 1.33331C6.52724 1.33331 5.33334 4.31808 5.33334 7.99998C5.33334 11.6819 6.52724 14.6666 8 14.6666Z",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),E0.createElement("path",{d:"M3.28597 3.38068C4.4924 4.58711 6.15907 5.33331 8 5.33331C9.84097 5.33331 11.5076 4.58711 12.7141 3.38068",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),E0.createElement("path",{d:"M12.7141 12.6193C11.5076 11.4129 9.84097 10.6667 8 10.6667C6.15907 10.6667 4.4924 11.4129 3.28597 12.6193",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"})),Mi=r=>E0.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r},E0.createElement("path",{d:"M1.73633 1.57642C2.53848 0.774265 3.74473 0.714862 4.87207 1.03052C6.02182 1.35245 7.24885 2.09683 8.3125 3.1604C9.37624 4.22414 10.1204 5.45195 10.4424 6.60181C10.758 7.72909 10.6986 8.93446 9.89648 9.73657C9.09439 10.5387 7.88901 10.5981 6.76172 10.2825C5.61186 9.96051 4.38405 9.21632 3.32031 8.15259C2.25674 7.08894 1.51236 5.86191 1.19043 4.71216C0.874775 3.58481 0.934176 2.37857 1.73633 1.57642Z",stroke:"#4E6EF2",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"}),E0.createElement("path",{d:"M6.76172 5.41479C7.88883 5.09929 9.09442 5.15888 9.89648 5.96069C10.6986 6.76284 10.758 7.96909 10.4424 9.09644C10.1204 10.2462 9.37617 11.4732 8.3125 12.5369C7.24882 13.6005 6.02187 14.3448 4.87207 14.6667C3.74472 14.9824 2.53848 14.923 1.73633 14.1208C0.934528 13.3188 0.874922 12.1132 1.19043 10.9861C1.51239 9.83623 2.25659 8.60841 3.32031 7.54468C4.38405 6.48096 5.61186 5.73675 6.76172 5.41479Z",stroke:"#4E6EF2",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"}),E0.createElement("path",{d:"M11.1282 1.03052C12.2553 0.715012 13.4609 0.774612 14.263 1.57642C15.0651 2.37857 15.1246 3.58481 14.8089 4.71216C14.4869 5.86196 13.7427 7.08892 12.679 8.15259C11.6153 9.21627 10.3884 9.96048 9.23859 10.2825C8.11124 10.5981 6.90499 10.5387 6.10284 9.73657C5.30106 8.9345 5.24144 7.72892 5.55695 6.60181C5.8789 5.45195 6.62311 4.22414 7.68683 3.1604C8.75056 2.09668 9.97838 1.35248 11.1282 1.03052Z",stroke:"#4E6EF2",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"}),E0.createElement("path",{d:"M6.10284 5.96069C6.90499 5.15855 8.11124 5.09914 9.23859 5.41479C10.3883 5.73673 11.6154 6.48111 12.679 7.54468C13.7427 8.60841 14.4869 9.83623 14.8089 10.9861C15.1245 12.1134 15.0651 13.3188 14.263 14.1208C13.4609 14.9229 12.2555 14.9823 11.1282 14.6667C9.97838 14.3448 8.75055 13.6006 7.68683 12.5369C6.62325 11.4732 5.87888 10.2462 5.55695 9.09644C5.24129 7.96909 5.3007 6.76284 6.10284 5.96069Z",stroke:"#4E6EF2",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"})),et={actions:[{name:"upload",icon:S(sa,{type:"wenda/shangchuanwenjian",color:"#000",size:20}),tip:"\u6587\u4EF6\u4E0A\u4F20"}],switchs:[{label:"\u8054\u7F51\u641C\u7D22",name:"netSearch",type:"switch",defaultValue:!1,enabled:!0,icon:S(Oi,{width:16,height:16,className:"aichat-netsearch-icon",style:{color:"#4B8CF7"}})},{label:"\u6DF1\u5EA6\u601D\u8003",name:"reasoning",type:"switch",defaultValue:!0,enabled:!0,icon:S(Mi,{width:16,height:16})}]},Or={sidebar:{newChat:"\u65B0\u5EFA\u5BF9\u8BDD",newConversation:"\u65B0\u5EFA\u4F1A\u8BDD",unnamedSession:"\u672A\u547D\u540D\u4F1A\u8BDD",noAssistant:"\u672A\u9009\u62E9\u52A9\u624B",searchPlaceholder:"\u641C\u7D22\u5386\u53F2\u8BB0\u5F55",search:"\u641C\u7D22",rename:"\u91CD\u547D\u540D",delete:"\u5220\u9664"},welcome:{defaultPrologue:"\u60A8\u597D\uFF0C\u6B22\u8FCE\u4F7F\u7528\u5C0F\u9CB8\u667A\u80FD\u95EE\u7B54",selectAssistant:"\u8BF7\u9009\u62E9\u4E00\u4E2A\u667A\u80FD\u52A9\u624B",searchAssistant:"\u641C\u7D22\u52A9\u624B\u540D\u79F0"},sender:{netSearch:"\u8054\u7F51\u641C\u7D22",deepThinking:"\u6DF1\u5EA6\u601D\u8003",fileUpload:"\u6587\u4EF6\u4E0A\u4F20"},chatHeader:{newConversation:"\u65B0\u5BF9\u8BDD"},disclaimer:"\u5185\u5BB9\u7531AI\u751F\u6210\uFF0C\u4EC5\u4F9B\u53C2\u8003\uFF0C\u4E0D\u4EE3\u8868\u672C\u516C\u53F8\u89C2\u70B9\u3002"},Ui={sidebar:{newChat:"New chat",newConversation:"New conversation",unnamedSession:"Unnamed",noAssistant:"No assistant",searchPlaceholder:"Search history",search:"Search",rename:"Rename",delete:"Delete"},welcome:{defaultPrologue:"Hello, welcome to Smart Q&A",selectAssistant:"Please select an assistant",searchAssistant:"Search assistants"},sender:{netSearch:"Web search",deepThinking:"Deep thinking",fileUpload:"Upload file"},chatHeader:{newConversation:"New conversation"},disclaimer:"Content is AI-generated and for reference only."},Hi={sidebar:{newChat:"\u65B0\u898F\u4F1A\u8A71",newConversation:"\u65B0\u898F\u4F1A\u8A71",unnamedSession:"\u540D\u524D\u306A\u3057",noAssistant:"\u30A2\u30B7\u30B9\u30BF\u30F3\u30C8\u672A\u9078\u629E",searchPlaceholder:"\u5C65\u6B74\u3092\u691C\u7D22",search:"\u691C\u7D22",rename:"\u540D\u524D\u3092\u5909\u66F4",delete:"\u524A\u9664"},welcome:{defaultPrologue:"\u3053\u3093\u306B\u3061\u306F\u3001\u30B9\u30DE\u30FC\u30C8Q&A\u3078\u3088\u3046\u3053\u305D",selectAssistant:"\u30A2\u30B7\u30B9\u30BF\u30F3\u30C8\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",searchAssistant:"\u30A2\u30B7\u30B9\u30BF\u30F3\u30C8\u3092\u691C\u7D22"},sender:{netSearch:"\u30CD\u30C3\u30C8\u691C\u7D22",deepThinking:"\u6DF1\u304F\u8003\u3048\u308B",fileUpload:"\u30D5\u30A1\u30A4\u30EB\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9"},chatHeader:{newConversation:"\u65B0\u898F\u4F1A\u8A71"},disclaimer:"AI\u306B\u3088\u308A\u751F\u6210\u3055\u308C\u305F\u5185\u5BB9\u3067\u3059\u3002\u53C2\u8003\u3068\u3057\u3066\u3054\u5229\u7528\u304F\u3060\u3055\u3044\u3002"},$i={zh:Or,en:Ui,ja:Hi};function xa(r){return $i[r]??Or}const pa=Pe.createContext({locale:"zh",messages:Or});function fr(){return Pe.useContext(pa)}function Wi({locale:r,children:u}){const t=Pe.useMemo(()=>({locale:r,messages:xa(r)}),[r]);return Pe.createElement(pa.Provider,{value:t},u)}function ji(r,u){r.prototype=Object.create(u.prototype),r.prototype.constructor=r,Ga(r,u)}var en=Number.isNaN||function(u){return typeof u=="number"&&u!==u};function Vi(r,u){return!!(r===u||en(r)&&en(u))}function Ki(r,u){if(r.length!==u.length)return!1;for(var t=0;t<r.length;t++)if(!Vi(r[t],u[t]))return!1;return!0}function Br(r,u){u===void 0&&(u=Ki);var t,e=[],h,c=!1;function d(){for(var s=[],p=0;p<arguments.length;p++)s[p]=arguments[p];return c&&t===this&&u(s,e)||(h=r.apply(this,s),c=!0,t=this,e=s),h}return d}var Gi=typeof performance=="object"&&typeof performance.now=="function",tn=Gi?function(){return performance.now()}:function(){return Date.now()};function rn(r){cancelAnimationFrame(r.id)}function Xi(r,u){var t=tn();function e(){tn()-t>=u?r.call(null):h.id=requestAnimationFrame(e)}var h={id:requestAnimationFrame(e)};return h}var Ar=-1;function nn(r){if(r===void 0&&(r=!1),Ar===-1||r){var u=document.createElement("div"),t=u.style;t.width="50px",t.height="50px",t.overflow="scroll",document.body.appendChild(u),Ar=u.offsetWidth-u.clientWidth,document.body.removeChild(u)}return Ar}var tt=null;function an(r){if(r===void 0&&(r=!1),tt===null||r){var u=document.createElement("div"),t=u.style;t.width="50px",t.height="50px",t.overflow="scroll",t.direction="rtl";var e=document.createElement("div"),h=e.style;return h.width="100px",h.height="100px",u.appendChild(e),document.body.appendChild(u),u.scrollLeft>0?tt="positive-descending":(u.scrollLeft=1,u.scrollLeft===0?tt="negative":tt="positive-ascending"),document.body.removeChild(u),tt}return tt}var Qi=150,Yi=function(u,t){return u};function Zi(r){var u,t=r.getItemOffset,e=r.getEstimatedTotalSize,h=r.getItemSize,c=r.getOffsetForIndexAndAlignment,d=r.getStartIndexForOffset,s=r.getStopIndexForStartIndex,p=r.initInstanceProps,n=r.shouldResetStyleCacheOnItemSizeChange,o=r.validateProps;return u=(function(E){ji(l,E);function l(y){var i;return i=E.call(this,y)||this,i._instanceProps=p(i.props,Xr(i)),i._outerRef=void 0,i._resetIsScrollingTimeoutId=null,i.state={instance:Xr(i),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof i.props.initialScrollOffset=="number"?i.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},i._callOnItemsRendered=void 0,i._callOnItemsRendered=Br(function(a,v,f,x){return i.props.onItemsRendered({overscanStartIndex:a,overscanStopIndex:v,visibleStartIndex:f,visibleStopIndex:x})}),i._callOnScroll=void 0,i._callOnScroll=Br(function(a,v,f){return i.props.onScroll({scrollDirection:a,scrollOffset:v,scrollUpdateWasRequested:f})}),i._getItemStyle=void 0,i._getItemStyle=function(a){var v=i.props,f=v.direction,x=v.itemSize,F=v.layout,_=i._getItemStyleCache(n&&x,n&&F,n&&f),b;if(_.hasOwnProperty(a))b=_[a];else{var k=t(i.props,a,i._instanceProps),N=h(i.props,a,i._instanceProps),T=f==="horizontal"||F==="horizontal",w=f==="rtl",A=T?k:0;_[a]=b={position:"absolute",left:w?void 0:A,right:w?A:void 0,top:T?0:k,height:T?"100%":N,width:T?N:"100%"}}return b},i._getItemStyleCache=void 0,i._getItemStyleCache=Br(function(a,v,f){return{}}),i._onScrollHorizontal=function(a){var v=a.currentTarget,f=v.clientWidth,x=v.scrollLeft,F=v.scrollWidth;i.setState(function(_){if(_.scrollOffset===x)return null;var b=i.props.direction,k=x;if(b==="rtl")switch(an()){case"negative":k=-x;break;case"positive-descending":k=F-f-x;break}return k=Math.max(0,Math.min(k,F-f)),{isScrolling:!0,scrollDirection:_.scrollOffset<k?"forward":"backward",scrollOffset:k,scrollUpdateWasRequested:!1}},i._resetIsScrollingDebounced)},i._onScrollVertical=function(a){var v=a.currentTarget,f=v.clientHeight,x=v.scrollHeight,F=v.scrollTop;i.setState(function(_){if(_.scrollOffset===F)return null;var b=Math.max(0,Math.min(F,x-f));return{isScrolling:!0,scrollDirection:_.scrollOffset<b?"forward":"backward",scrollOffset:b,scrollUpdateWasRequested:!1}},i._resetIsScrollingDebounced)},i._outerRefSetter=function(a){var v=i.props.outerRef;i._outerRef=a,typeof v=="function"?v(a):v!=null&&typeof v=="object"&&v.hasOwnProperty("current")&&(v.current=a)},i._resetIsScrollingDebounced=function(){i._resetIsScrollingTimeoutId!==null&&rn(i._resetIsScrollingTimeoutId),i._resetIsScrollingTimeoutId=Xi(i._resetIsScrolling,Qi)},i._resetIsScrolling=function(){i._resetIsScrollingTimeoutId=null,i.setState({isScrolling:!1},function(){i._getItemStyleCache(-1,null)})},i}l.getDerivedStateFromProps=function(i,a){return Ji(i,a),o(i),null};var m=l.prototype;return m.scrollTo=function(i){i=Math.max(0,i),this.setState(function(a){return a.scrollOffset===i?null:{scrollDirection:a.scrollOffset<i?"forward":"backward",scrollOffset:i,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},m.scrollToItem=function(i,a){a===void 0&&(a="auto");var v=this.props,f=v.itemCount,x=v.layout,F=this.state.scrollOffset;i=Math.max(0,Math.min(i,f-1));var _=0;if(this._outerRef){var b=this._outerRef;x==="vertical"?_=b.scrollWidth>b.clientWidth?nn():0:_=b.scrollHeight>b.clientHeight?nn():0}this.scrollTo(c(this.props,i,a,F,this._instanceProps,_))},m.componentDidMount=function(){var i=this.props,a=i.direction,v=i.initialScrollOffset,f=i.layout;if(typeof v=="number"&&this._outerRef!=null){var x=this._outerRef;a==="horizontal"||f==="horizontal"?x.scrollLeft=v:x.scrollTop=v}this._callPropsCallbacks()},m.componentDidUpdate=function(){var i=this.props,a=i.direction,v=i.layout,f=this.state,x=f.scrollOffset,F=f.scrollUpdateWasRequested;if(F&&this._outerRef!=null){var _=this._outerRef;if(a==="horizontal"||v==="horizontal")if(a==="rtl")switch(an()){case"negative":_.scrollLeft=-x;break;case"positive-ascending":_.scrollLeft=x;break;default:var b=_.clientWidth,k=_.scrollWidth;_.scrollLeft=k-b-x;break}else _.scrollLeft=x;else _.scrollTop=x}this._callPropsCallbacks()},m.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&rn(this._resetIsScrollingTimeoutId)},m.render=function(){var i=this.props,a=i.children,v=i.className,f=i.direction,x=i.height,F=i.innerRef,_=i.innerElementType,b=i.innerTagName,k=i.itemCount,N=i.itemData,T=i.itemKey,w=T===void 0?Yi:T,A=i.layout,D=i.outerElementType,g=i.outerTagName,q=i.style,M=i.useIsScrolling,G=i.width,Z=this.state.isScrolling,U=f==="horizontal"||A==="horizontal",$=U?this._onScrollHorizontal:this._onScrollVertical,Q=this._getRangeToRender(),z=Q[0],P=Q[1],I=[];if(k>0)for(var R=z;R<=P;R++)I.push(mr(a,{data:N,key:w(R,N),index:R,isScrolling:M?Z:void 0,style:this._getItemStyle(R)}));var H=e(this.props,this._instanceProps);return mr(D||g||"div",{className:v,onScroll:$,ref:this._outerRefSetter,style:Xa({position:"relative",height:x,width:G,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:f},q)},mr(_||b||"div",{children:I,ref:F,style:{height:U?"100%":H,pointerEvents:Z?"none":void 0,width:U?H:"100%"}}))},m._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var i=this.props.itemCount;if(i>0){var a=this._getRangeToRender(),v=a[0],f=a[1],x=a[2],F=a[3];this._callOnItemsRendered(v,f,x,F)}}if(typeof this.props.onScroll=="function"){var _=this.state,b=_.scrollDirection,k=_.scrollOffset,N=_.scrollUpdateWasRequested;this._callOnScroll(b,k,N)}},m._getRangeToRender=function(){var i=this.props,a=i.itemCount,v=i.overscanCount,f=this.state,x=f.isScrolling,F=f.scrollDirection,_=f.scrollOffset;if(a===0)return[0,0,0,0];var b=d(this.props,_,this._instanceProps),k=s(this.props,b,_,this._instanceProps),N=!x||F==="backward"?Math.max(1,v):1,T=!x||F==="forward"?Math.max(1,v):1;return[Math.max(0,b-N),Math.max(0,Math.min(a-1,k+T)),b,k]},l})(Wa),u.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},u}var Ji=function(u,t){u.children,u.direction,u.height,u.layout,u.innerTagName,u.outerTagName,u.width,t.instance},eo=50,at=function(u,t,e){var h=u,c=h.itemSize,d=e.itemMetadataMap,s=e.lastMeasuredIndex;if(t>s){var p=0;if(s>=0){var n=d[s];p=n.offset+n.size}for(var o=s+1;o<=t;o++){var E=c(o);d[o]={offset:p,size:E},p+=E}e.lastMeasuredIndex=t}return d[t]},to=function(u,t,e){var h=t.itemMetadataMap,c=t.lastMeasuredIndex,d=c>0?h[c].offset:0;return d>=e?ha(u,t,c,0,e):ro(u,t,Math.max(0,c),e)},ha=function(u,t,e,h,c){for(;h<=e;){var d=h+Math.floor((e-h)/2),s=at(u,d,t).offset;if(s===c)return d;s<c?h=d+1:s>c&&(e=d-1)}return h>0?h-1:0},ro=function(u,t,e,h){for(var c=u.itemCount,d=1;e<c&&at(u,e,t).offset<h;)e+=d,d*=2;return ha(u,t,Math.min(e,c-1),Math.floor(e/2),h)},on=function(u,t){var e=u.itemCount,h=t.itemMetadataMap,c=t.estimatedItemSize,d=t.lastMeasuredIndex,s=0;if(d>=e&&(d=e-1),d>=0){var p=h[d];s=p.offset+p.size}var n=e-d-1,o=n*c;return s+o},no=Zi({getItemOffset:function(u,t,e){return at(u,t,e).offset},getItemSize:function(u,t,e){return e.itemMetadataMap[t].size},getEstimatedTotalSize:on,getOffsetForIndexAndAlignment:function(u,t,e,h,c,d){var s=u.direction,p=u.height,n=u.layout,o=u.width,E=s==="horizontal"||n==="horizontal",l=E?o:p,m=at(u,t,c),y=on(u,c),i=Math.max(0,Math.min(y-l,m.offset)),a=Math.max(0,m.offset-l+m.size+d);switch(e==="smart"&&(h>=a-l&&h<=i+l?e="auto":e="center"),e){case"start":return i;case"end":return a;case"center":return Math.round(a+(i-a)/2);case"auto":default:return h>=a&&h<=i?h:h<a?a:i}},getStartIndexForOffset:function(u,t,e){return to(u,e,t)},getStopIndexForStartIndex:function(u,t,e,h){for(var c=u.direction,d=u.height,s=u.itemCount,p=u.layout,n=u.width,o=c==="horizontal"||p==="horizontal",E=o?n:d,l=at(u,t,h),m=e+E,y=l.offset+l.size,i=t;i<s-1&&y<m;)i++,y+=at(u,i,h).size;return i},initInstanceProps:function(u,t){var e=u,h=e.estimatedItemSize,c={itemMetadataMap:{},estimatedItemSize:h||eo,lastMeasuredIndex:-1};return t.resetAfterIndex=function(d,s){s===void 0&&(s=!0),c.lastMeasuredIndex=Math.min(c.lastMeasuredIndex,d-1),t._getItemStyleCache(-1),s&&t.forceUpdate()},c},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(u){u.itemSize}});function ao({isActive:r,isNew:u,isDisabled:t,data:e,eventsEmit:h,styles:c={},assistantList:d=[]}){const{messages:s}=fr(),[p,n]=oe(!1),o=(c==null?void 0:c.colors)||{},E=De(()=>{const v=e==null?void 0:e.configId;if(!v||!d||d.length===0)return s.sidebar.noAssistant;const f=d.find(x=>String(x==null?void 0:x.id)===String(v));if(!f)return s.sidebar.noAssistant;if(f!=null&&f.name)return f.name;try{const x=typeof f.configJson=="string"?JSON.parse(f.configJson):f.configJson;return(x==null?void 0:x.config_name)||s.sidebar.noAssistant}catch{return s.sidebar.noAssistant}},[d,e==null?void 0:e.configId,s.sidebar.noAssistant]),l=[{key:"rename",icon:S(qi,{size:12}),label:s.sidebar.rename,onClick:v=>{v.domEvent.stopPropagation(),h&&h("conversations:rename_icon_clicked",e)}},{key:"delete",icon:S(Li,{size:12}),label:s.sidebar.delete,danger:!0,onClick:v=>{v.domEvent.stopPropagation(),h&&h("conversations:delete_icon_clicked",e)}}],m=r?o.activeItemBg||"#f0f4ff":p?o.itemHoverBg||"#f5f7fa":o.itemBg||"transparent",y=r?o.activeItemText||o.primary||"#0122ff":o.itemText||"#333",i=r?o.activeItemBorder||o.primary||"#0122ff":"transparent",a=v=>{const f=Jr(),x=Jr(v);return f.isSame(x,"day")?x.format("HH:mm"):x.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&&h&&h("conversation:item_click",e),onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),style:{minHeight:48,background:m,color:y,border:`1px solid ${i}`,...c.item,opacity:t?.5:1},children:[Y("div",{className:"flex flex-col gap-y-2 flex-1 min-w-0",children:[S("span",{className:"truncate text-sm max-w-[160px] font-medium",title:e.label||s.sidebar.unnamedSession,style:{color:y,fontSize:"14px",lineHeight:"1.4"},children:e.label||s.sidebar.unnamedSession}),Y("div",{className:"flex items-center justify-between gap-2",children:[S("span",{className:"text-xs truncate flex-1",style:{color:r?o.activeItemTextSecondary||"#666":o.itemTextSecondary||"#666",fontSize:"12px",lineHeight:"1.3"},children:E}),e.gmtModified&&S("span",{className:"text-xs flex-shrink-0",style:{color:r?o.activeItemTextSecondary||"#999":o.itemTextSecondary||"#999",fontSize:"12px",lineHeight:"1.3"},children:a(e.gmtModified)})]})]}),!t&&p&&!u&&S("div",{className:"absolute top-2 right-3",children:S(_i,{menu:{items:l},trigger:["click"],placement:"bottomRight",children:S(Pi,{size:16,className:"text-gray-600 hover:text-gray-800",style:{cursor:"pointer",color:r?o.activeItemTextSecondary||"#999":o.itemTextSecondary||"#999"},onClick:v=>v.stopPropagation()})})})]})}function io(r,u=[{label:"\u5F53\u5929",dayPeriod:1}]){const t=new Date,e={other:[]};return r.forEach(h=>{const c=new Date(h.gmtModified),d=Math.floor((+t-+c)/(1e3*60*60*24));let s=!1;for(const p of u)if(d<=p.dayPeriod){e[p.label]||(e[p.label]=[]),e[p.label].push(h),s=!0;break}s||e.other.push(h)}),e}/*! @license Rematrix v0.2.2
32
+
33
+ Copyright 2018 Fisssion LLC.
34
+
35
+ Permission is hereby granted, free of charge, to any person obtaining a copy
36
+ of this software and associated documentation files (the "Software"), to deal
37
+ in the Software without restriction, including without limitation the rights
38
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
39
+ copies of the Software, and to permit persons to whom the Software is
40
+ furnished to do so, subject to the following conditions:
41
+
42
+ The above copyright notice and this permission notice shall be included in
43
+ all copies or substantial portions of the Software.
44
+
45
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
46
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
47
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
48
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
49
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
50
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
51
+ THE SOFTWARE.
52
+ */function Rr(r){if(r.constructor!==Array)throw new TypeError("Expected array.");if(r.length===16)return r;if(r.length===6){var u=ct();return u[0]=r[0],u[1]=r[1],u[4]=r[2],u[5]=r[3],u[12]=r[4],u[13]=r[5],u}throw new RangeError("Expected array with either 6 or 16 values.")}function ct(){for(var r=[],u=0;u<16;u++)u%5==0?r.push(1):r.push(0);return r}function oo(r,u){for(var t=Rr(r),e=Rr(u),h=[],c=0;c<4;c++)for(var d=[t[c],t[c+4],t[c+8],t[c+12]],s=0;s<4;s++){var p=s*4,n=[e[p],e[p+1],e[p+2],e[p+3]],o=d[0]*n[0]+d[1]*n[1]+d[2]*n[2]+d[3]*n[3];h[c+p]=o}return h}function so(r){if(typeof r=="string"){var u=r.match(/matrix(3d)?\(([^)]+)\)/);if(u){var t=u[2].split(", ").map(parseFloat);return Rr(t)}}return ct()}function uo(r){var u=ct();return u[0]=r,u}function co(r){var u=ct();return u[5]=r,u}function lo(r){var u=ct();return u[12]=r,u}function fo(r){var u=ct();return u[13]=r,u}var bt=function(r){return typeof r=="number"},va=function(r){return typeof r=="function"},ga=function(r){return Object.prototype.toString.call(r)==="[object Object]"},it=function(r){return Array.prototype.slice.apply(r)},ma=function(r){var u=r.reduce(function(t,e){return t[e]=(t[e]||0)+1,t},{});return Object.keys(u).filter(function(t){return u[t]>1})};function P0(r){return[].slice.call(arguments,1).forEach(function(u){if(u)for(var t in u)Object.prototype.hasOwnProperty.call(u,t)&&(r[t]=u[t])}),r}var Nr,Pr=function(r,u,t){return r+(u-r)*t},ya={__proto__:null,isNumber:bt,isFunction:va,isObject:ga,toArray:it,getDuplicateValsAsStrings:ma,assign:P0,tweenProp:Pr},Mr="data-flip-id",Ur="data-inverse-flip-id",Hr="data-portal-key",xo="data-exit-container",At={__proto__:null,DATA_FLIP_ID:Mr,DATA_INVERSE_FLIP_ID:Ur,DATA_FLIP_CONFIG:"data-flip-config",DATA_PORTAL_KEY:Hr},Tr={noWobble:{stiffness:200,damping:26},gentle:{stiffness:120,damping:14},veryGentle:{stiffness:130,damping:17},wobbly:{stiffness:180,damping:12},stiff:{stiffness:260,damping:26}},sn=function(r){return ga(r)?r:Object.keys(Tr).indexOf(r)>-1?Tr[r]:{}};typeof window<"u"&&(Nr=window.requestAnimationFrame);var po=Nr=Nr||function(r){window.setTimeout(r,1e3/60)},ho=Date.now(),vo=typeof performance=="object"&&typeof performance.now=="function"?function(){return performance.now()}:function(){return Date.now()-ho};function Ca(r,u){var t=r.indexOf(u);t!==-1&&r.splice(t,1)}var go=(function(){function r(){}return r.prototype.run=function(){var u=this;po(function(){u.springSystem.loop(vo())})},r})(),br=function(){this.position=0,this.velocity=0},mo=0,g0=.001,yo=(function(){function r(t){this._id="s"+mo++,this._springSystem=t,this.listeners=[],this._startValue=0,this._currentState=new br,this._displacementFromRestThreshold=.001,this._endValue=0,this._overshootClampingEnabled=!1,this._previousState=new br,this._restSpeedThreshold=.001,this._tempState=new br,this._timeAccumulator=0,this._wasAtRest=!0,this._cachedSpringConfig={}}var u=r.prototype;return u.getId=function(){return this._id},u.destroy=function(){this.listeners=[],this._springSystem.deregisterSpring(this)},u.setSpringConfig=function(t){return this._springConfig=t,this},u.getCurrentValue=function(){return this._currentState.position},u.getDisplacementDistanceForState=function(t){return Math.abs(this._endValue-t.position)},u.setEndValue=function(t){if(t===this._endValue)return this;if(this.prevEndValue=t,this._endValue===t&&this.isAtRest())return this;this._startValue=this.getCurrentValue(),this._endValue=t,this._springSystem.activateSpring(this.getId());for(var e=0,h=this.listeners.length;e<h;e++){var c=this.listeners[e].onSpringEndStateChange;c&&c(this)}return this},u.setVelocity=function(t){return t===this._currentState.velocity||(this._currentState.velocity=t,this._springSystem.activateSpring(this.getId())),this},u.setCurrentValue=function(t){this._startValue=t,this._currentState.position=t;for(var e=0,h=this.listeners.length;e<h;e++){var c=this.listeners[e];c.onSpringUpdate&&c.onSpringUpdate(this)}return this},u.setAtRest=function(){return this._endValue=this._currentState.position,this._tempState.position=this._currentState.position,this._currentState.velocity=0,this},u.setOvershootClampingEnabled=function(t){return this._overshootClampingEnabled=t,this},u.isOvershooting=function(){var t=this._startValue,e=this._endValue;return this._springConfig.tension>0&&(t<e&&this.getCurrentValue()>e||t>e&&this.getCurrentValue()<e)},u.advance=function(t,e){var h=this.isAtRest();if(!h||!this._wasAtRest){var c=e;e>.064&&(c=.064),this._timeAccumulator+=c;for(var d,s,p,n,o,E,l=this._springConfig.tension,m=this._springConfig.friction,y=this._currentState.position,i=this._currentState.velocity,a=this._tempState.position,v=this._tempState.velocity;this._timeAccumulator>=g0;)this._timeAccumulator-=g0,this._timeAccumulator<g0&&(this._previousState.position=y,this._previousState.velocity=i),s=l*(this._endValue-a)-m*i,n=l*(this._endValue-(a=y+(d=i)*g0*.5))-m*(v=i+s*g0*.5),E=l*(this._endValue-(a=y+(p=v)*g0*.5))-m*(v=i+n*g0*.5),a=y+(o=v)*g0,y+=1/6*(d+2*(p+o)+(v=i+E*g0))*g0,i+=1/6*(s+2*(n+E)+(l*(this._endValue-a)-m*v))*g0;this._tempState.position=a,this._tempState.velocity=v,this._currentState.position=y,this._currentState.velocity=i,this._timeAccumulator>0&&this._interpolate(this._timeAccumulator/g0),(this.isAtRest()||this._overshootClampingEnabled&&this.isOvershooting())&&(this._springConfig.tension>0?(this._startValue=this._endValue,this._currentState.position=this._endValue):(this._endValue=this._currentState.position,this._startValue=this._endValue),this.setVelocity(0),h=!0);var f=!1;this._wasAtRest&&(this._wasAtRest=!1,f=!0);var x=!1;h&&(this._wasAtRest=!0,x=!0),this.notifyPositionUpdated(f,x)}},u.notifyPositionUpdated=function(t,e){var h=this;this.listeners.filter(Boolean).forEach(function(c){t&&c.onSpringActivate&&!h._onActivateCalled&&(c.onSpringActivate(h),h._onActivateCalled=!0),c.onSpringUpdate&&c.onSpringUpdate(h),e&&c.onSpringAtRest&&c.onSpringAtRest(h)})},u.systemShouldAdvance=function(){return!this.isAtRest()||!this.wasAtRest()},u.wasAtRest=function(){return this._wasAtRest},u.isAtRest=function(){return Math.abs(this._currentState.velocity)<this._restSpeedThreshold&&(this.getDisplacementDistanceForState(this._currentState)<=this._displacementFromRestThreshold||this._springConfig.tension===0)},u._interpolate=function(t){this._currentState.position=this._currentState.position*t+this._previousState.position*(1-t),this._currentState.velocity=this._currentState.velocity*t+this._previousState.velocity*(1-t)},u.addListener=function(t){return this.listeners.push(t),this},u.addOneTimeListener=function(t){var e=this;return Object.keys(t).forEach(function(h){var c;t[h]=(c=t[h],function(){c.apply(void 0,[].slice.call(arguments)),e.removeListener(t)})}),this.listeners.push(t),this},u.removeListener=function(t){return Ca(this.listeners,t),this},r})(),Fa=(function(){function r(t){this.looper=t||new go,this.looper.springSystem=this,this.listeners=[],this._activeSprings=[],this._idleSpringIndices=[],this._isIdle=!0,this._lastTimeMillis=-1,this._springRegistry={}}var u=r.prototype;return u.createSpring=function(t,e){return this.createSpringWithConfig({tension:t,friction:e})},u.createSpringWithConfig=function(t){var e=new yo(this);return this.registerSpring(e),e.setSpringConfig(t),e},u.getIsIdle=function(){return this._isIdle},u.registerSpring=function(t){this._springRegistry[t.getId()]=t},u.deregisterSpring=function(t){Ca(this._activeSprings,t),delete this._springRegistry[t.getId()]},u.advance=function(t,e){for(var h=this;this._idleSpringIndices.length>0;)this._idleSpringIndices.pop();for(this._activeSprings.filter(Boolean).forEach(function(d){d.systemShouldAdvance()?d.advance(t/1e3,e/1e3):h._idleSpringIndices.push(h._activeSprings.indexOf(d))});this._idleSpringIndices.length>0;){var c=this._idleSpringIndices.pop();c>=0&&this._activeSprings.splice(c,1)}},u.loop=function(t){var e;this._lastTimeMillis===-1&&(this._lastTimeMillis=t-1);var h=t-this._lastTimeMillis;this._lastTimeMillis=t;var c=0,d=this.listeners.length;for(c=0;c<d;c++)(e=this.listeners[c]).onBeforeIntegrate&&e.onBeforeIntegrate(this);for(this.advance(t,h),this._activeSprings.length===0&&(this._isIdle=!0,this._lastTimeMillis=-1),c=0;c<d;c++)(e=this.listeners[c]).onAfterIntegrate&&e.onAfterIntegrate(this);this._isIdle||this.looper.run()},u.activateSpring=function(t){var e=this._springRegistry[t];this._activeSprings.indexOf(e)===-1&&this._activeSprings.push(e),this.getIsIdle()&&(this._isIdle=!1,this.looper.run())},r})(),Co=new Fa,Ea=function(r){var u=r.springConfig,t=u.overshootClamping,e=r.getOnUpdateFunc,h=r.onAnimationEnd,c=r.onSpringActivate,d=Co.createSpring(u.stiffness,u.damping);d.setOvershootClampingEnabled(!!t);var s={onSpringActivate:c,onSpringAtRest:function(){d.destroy(),h()},onSpringUpdate:e({spring:d,onAnimationEnd:h})};return d.addListener(s),d},un=function(r){var u=Ea(r);return u.setEndValue(1),u},cn=function(r,u){if(u===void 0&&(u={}),r&&r.length){u.reverse&&r.reverse();var t,e=typeof(t=u.speed)!="number"?1.1:1+Math.min(Math.max(5*t,0),5),h=1/Math.max(Math.min(r.length,100),10),c=r.map(function(d,s){var p=d.getOnUpdateFunc;return d.getOnUpdateFunc=function(n){var o=p(n);return function(E){var l=E.getCurrentValue();(l=l<.01?0:l>.99?1:l)>=h&&c[s+1]&&c[s+1](Math.max(Math.min(l*e,1),0)),o(E)}},d}).map(function(d){var s=Ea(d);if(s)return s.setEndValue.bind(s)}).filter(Boolean);c[0]&&c[0](1)}},ln=function(r){return[0,1,4,5,12,13].map(function(u){return r[u]})},dn=function(r){return r.top<window.innerHeight&&r.bottom>0&&r.left<window.innerWidth&&r.right>0};function fn(r){return JSON.parse(r.dataset.flipConfig||"{}")}var Ba=function(r,u){var t;return P0(r,((t={})[u[0]]=u[1],t))},Aa=function(r,u){return it(u?document.querySelectorAll("["+Hr+'="'+u+'"]'):r.querySelectorAll("["+Mr+"]"))},ba=function(r){return r.map(function(u){return[u,u.getBoundingClientRect()]})},Fo=function(r){var u=r.cachedOrderedFlipIds,t=u===void 0?[]:u,e=r.inProgressAnimations,h=e===void 0?{}:e,c=r.flippedElementPositionsBeforeUpdate,d=c===void 0?{}:c,s=r.flipCallbacks,p=s===void 0?{}:s,n=r.containerEl,o=r.applyTransformOrigin,E=r.spring,l=r.debug,m=r.portalKey,y=r.staggerConfig,i=y===void 0?{}:y,a=r.decisionData,v=a===void 0?{}:a,f=r.handleEnterUpdateDelete,x=r.onComplete,F=r.onStart;if(!window.matchMedia("(prefers-reduced-motion: reduce)").matches){var _,b=ba(Aa((_={element:n,portalKey:m}).element,_.portalKey)).map(function(U){var $=U[0],Q=U[1],z=window.getComputedStyle($);return[$.dataset.flipId,{element:$,rect:Q,opacity:parseFloat(z.opacity),transform:z.transform}]}).reduce(Ba,{}),k=(function(U){var $=U.containerEl,Q=U.portalKey;return Q?(function(z){return function(P){return it(document.querySelectorAll("["+Hr+'="'+z+'"]'+P))}})(Q):$?(function(z){var P=Math.random().toFixed(5);return z.dataset.flipperId=P,function(I){return it(z.querySelectorAll('[data-flipper-id="'+P+'"] '+I))}})($):function(){return[]}})({containerEl:n,portalKey:m}),N=(function(U){return function($){return U("["+Mr+'="'+$+'"]')[0]}})(k),T=function(U){return d[U]&&b[U]},w=Object.keys(d).concat(Object.keys(b)).filter(function(U){return!T(U)}),A={flipCallbacks:p,getElement:N,flippedElementPositionsBeforeUpdate:d,flippedElementPositionsAfterUpdate:b,inProgressAnimations:h,decisionData:v},D=(function(U){var $,Q=U.unflippedIds,z=U.flipCallbacks,P=U.getElement,I=U.flippedElementPositionsBeforeUpdate,R=U.flippedElementPositionsAfterUpdate,H=U.inProgressAnimations,V=U.decisionData,X=Q.filter(function(se){return R[se]}).filter(function(se){return z[se]&&z[se].onAppear}),j=Q.filter(function(se){return I[se]&&z[se]&&z[se].onExit}),ue=new Promise(function(se){$=se}),ne=[],je=0,we=j.map(function(se,Ee){var Be=I[se].domDataForExitAnimations,Le=Be.element,a0=Be.parent,i0=Be.childPosition,o0=i0.top,h0=i0.left,Oe=i0.width,Te=i0.height;getComputedStyle(a0).position==="static"&&(a0.style.position="relative"),Le.style.transform="matrix(1, 0, 0, 1, 0, 0)",Le.style.position="absolute",Le.style.top=o0+"px",Le.style.left=h0+"px",Le.style.height=Te+"px",Le.style.width=Oe+"px";var Ne=ne.filter(function(m0){return m0[0]===a0})[0];Ne||(Ne=[a0,document.createDocumentFragment()],ne.push(Ne)),Ne[1].appendChild(Le),je+=1;var e0=function(){try{a0.removeChild(Le)}catch{}finally{(je-=1)==0&&$()}};return H[se]={stop:e0},function(){return z[se].onExit(Le,Ee,e0,V)}});return ne.forEach(function(se){se[0].appendChild(se[1])}),we.length||$(),{hideEnteringElements:function(){X.forEach(function(se){var Ee=P(se);Ee&&(Ee.style.opacity="0")})},animateEnteringElements:function(){X.forEach(function(se,Ee){var Be=P(se);Be&&z[se].onAppear(Be,Ee,V)})},animateExitingElements:function(){return we.forEach(function(se){return se()}),ue}}})(P0({},A,{unflippedIds:w})),g=D.hideEnteringElements,q=D.animateEnteringElements,M=D.animateExitingElements,G=P0({},A,{containerEl:n,flippedIds:t.filter(T),applyTransformOrigin:o,spring:E,debug:l,staggerConfig:i,scopedSelector:k,onComplete:x});F&&F(n,v);var Z=(function(U){var $,Q=U.flippedIds,z=U.flipCallbacks,P=U.inProgressAnimations,I=U.flippedElementPositionsBeforeUpdate,R=U.flippedElementPositionsAfterUpdate,H=U.applyTransformOrigin,V=U.spring,X=U.getElement,j=U.debug,ue=U.staggerConfig,ne=ue===void 0?{}:ue,je=U.decisionData,we=je===void 0?{}:je,se=U.onComplete,Ee=U.containerEl,Be=new Promise(function(W){$=W});if(se&&Be.then(function(){return se(Ee,we)}),!Q.length)return function(){return $([]),Be};var Le=[],a0=X(Q[0]),i0=a0?a0.ownerDocument.querySelector("body"):document.querySelector("body");ma(Q);var o0=Q.map(function(W){var he=I[W].rect,ke=R[W].rect,t0=I[W].opacity,z0=R[W].opacity,Qe=ke.width<1||ke.height<1,me=R[W].element;if(!dn(he)&&!dn(ke)||!me)return!1;var q0,G0,L0,u0=fn(me),O0=(L0=(G0=(q0={flipperSpring:V,flippedSpring:u0.spring})===void 0?{}:q0).flippedSpring,P0({},Tr.noWobble,sn(G0.flipperSpring),sn(L0))),M0=u0.stagger===!0?"default":u0.stagger,U0={element:me,id:W,stagger:M0,springConfig:O0};if(z[W]&&z[W].shouldFlip&&!z[W].shouldFlip(we.previous,we.current))return!1;var X0=Math.abs(he.left-ke.left)+Math.abs(he.top-ke.top),lt=Math.abs(he.width-ke.width)+Math.abs(he.height-ke.height),dt=Math.abs(z0-t0);if(he.height===0&&ke.height===0||he.width===0&&ke.width===0||X0<.5&&lt<.5&&dt<.01)return!1;var Q0=so(R[W].transform),d0={matrix:Q0},v0={matrix:[]},B0=[Q0];u0.translate&&(B0.push(lo(he.left-ke.left)),B0.push(fo(he.top-ke.top))),u0.scale&&(B0.push(uo(Math.max(he.width,1)/Math.max(ke.width,1))),B0.push(co(Math.max(he.height,1)/Math.max(ke.height,1)))),u0.opacity&&(v0.opacity=t0,d0.opacity=z0);var A0=[];if(!z[W]||!z[W].shouldInvert||z[W].shouldInvert(we.previous,we.current)){var ft=(function(Ie,Ve){return it(Ie.querySelectorAll("["+Ur+'="'+Ve+'"]'))})(me,W);A0=ft.map(function(Ie){return[Ie,fn(Ie)]})}v0.matrix=ln(B0.reduce(oo)),d0.matrix=ln(d0.matrix);var Ue,ie=(function(Ie){var Ve=Ie.element,f0=Ie.invertedChildren,w0=Ie.body;return function(I0){var y0=I0.matrix,H0=I0.opacity,Y0=I0.forceMinVals;if(bt(H0)&&(Ve.style.opacity=H0+""),Y0&&(Ve.style.minHeight="1px",Ve.style.minWidth="1px"),y0){var Z0=(function($0){return"matrix("+$0.join(", ")+")"})(y0);Ve.style.transform=Z0,f0&&(function($0){var J0=$0.matrix,hr=$0.body;$0.invertedChildren.forEach(function(ht){var vt=ht[0],gt=ht[1];if(hr.contains(vt)){var mt=J0[0],yt=J0[3],vr=J0[5],x0={translateX:0,translateY:0,scaleX:1,scaleY:1},xt="";gt.translate&&(x0.translateX=-J0[4]/mt,x0.translateY=-vr/yt,xt+="translate("+x0.translateX+"px, "+x0.translateY+"px)"),gt.scale&&(x0.scaleX=1/mt,x0.scaleY=1/yt,xt+=" scale("+x0.scaleX+", "+x0.scaleY+")"),vt.style.transform=xt}})})({invertedChildren:f0,matrix:y0,body:w0})}}})({element:me,invertedChildren:A0,body:i0});if(z[W]&&z[W].onComplete){var _0=z[W].onComplete;Ue=function(){return _0(me,we)}}var He=bt(v0.opacity)&&bt(d0.opacity)&&v0.opacity!==d0.opacity,Ye=!1;return P0({},U0,{stagger:M0,springConfig:O0,getOnUpdateFunc:function(Ie){var Ve=Ie.spring,f0=Ie.onAnimationEnd;return P[W]={destroy:Ve.destroy.bind(Ve),onAnimationEnd:f0},function(w0){z[W]&&z[W].onSpringUpdate&&z[W].onSpringUpdate(w0.getCurrentValue()),Ye||(Ye=!0,z[W]&&z[W].onStart&&z[W].onStart(me,we));var I0=w0.getCurrentValue();if(i0.contains(me)){var y0={matrix:[]};y0.matrix=v0.matrix.map(function(H0,Y0){return Pr(H0,d0.matrix[Y0],I0)}),He&&(y0.opacity=Pr(v0.opacity,d0.opacity,I0)),ie(y0)}else w0.destroy()}},initializeFlip:function(){ie({matrix:v0.matrix,opacity:He?v0.opacity:void 0,forceMinVals:Qe}),z[W]&&z[W].onStartImmediate&&z[W].onStartImmediate(me,we),u0.transformOrigin?me.style.transformOrigin=u0.transformOrigin:H&&(me.style.transformOrigin="0 0"),A0.forEach(function(Ie){var Ve=Ie[0],f0=Ie[1];f0.transformOrigin?Ve.style.transformOrigin=f0.transformOrigin:H&&(Ve.style.transformOrigin="0 0")})},onAnimationEnd:function(Ie){delete P[W],va(Ue)&&Ue(),me.style.transform="",A0.forEach(function(Ve){Ve[0].style.transform=""}),Qe&&me&&(me.style.minHeight="",me.style.minWidth=""),Ie||(Le.push(W),Le.length>=o0.length&&$(Le))},delayUntil:u0.delayUntil})}).filter(Boolean);if(o0.forEach(function(W){return(0,W.initializeFlip)()}),j)return function(){};var h0=o0.filter(function(W){return W.delayUntil&&(he=W.delayUntil,o0.filter(function(ke){return ke.id===he}).length);var he}),Oe={},Te={},Ne={};h0.forEach(function(W){W.stagger?(Ne[W.stagger]=!0,Te[W.delayUntil]?Te[W.delayUntil].push(W.stagger):Te[W.delayUntil]=[W.stagger]):Oe[W.delayUntil]?Oe[W.delayUntil].push(W):Oe[W.delayUntil]=[W]});var e0=o0.filter(function(W){return W.stagger}).reduce(function(W,he){return W[he.stagger]?W[he.stagger].push(he):W[he.stagger]=[he],W},{}),m0=o0.filter(function(W){return h0.indexOf(W)===-1});return m0.forEach(function(W){W.onSpringActivate=function(){Oe[W.id]&&Oe[W.id].forEach(un),Te[W.id]&&Object.keys(Te[W.id].reduce(function(he,ke){var t0;return P0(he,((t0={})[ke]=!0,t0))},{})).forEach(function(he){cn(e0[he],ne[he])})}}),function(){return o0.length||$([]),m0.filter(function(W){return!W.stagger}).forEach(un),Object.keys(e0).forEach(function(W){Ne[W]||cn(e0[W],ne[W])}),Be}})(G);f?f({hideEnteringElements:g,animateEnteringElements:q,animateExitingElements:M,animateFlippedElements:Z}):(g(),M().then(q),Z())}},Eo=function(r){var u=r.element,t=r.flipCallbacks,e=t===void 0?{}:t,h=r.inProgressAnimations,c=h===void 0?{}:h,d=Aa(u,r.portalKey),s=it(u.querySelectorAll("["+Ur+"]")),p={},n=[],o={};d.filter(function(m){return e&&e[m.dataset.flipId]&&e[m.dataset.flipId].onExit}).forEach(function(m){var y=m.parentNode;if(m.closest){var i=m.closest("["+xo+"]");i&&(y=i)}var a=n.findIndex(function(v){return v[0]===y});a===-1&&(n.push([y,y.getBoundingClientRect()]),a=n.length-1),p[m.dataset.flipId]=n[a][1],o[m.dataset.flipId]=y});var E=ba(d),l=E.map(function(m){var y=m[0],i=m[1],a={};if(e&&e[y.dataset.flipId]&&e[y.dataset.flipId].onExit){var v=p[y.dataset.flipId];P0(a,{element:y,parent:o[y.dataset.flipId],childPosition:{top:i.top-v.top,left:i.left-v.left,width:i.width,height:i.height}})}return[y.dataset.flipId,{rect:i,opacity:parseFloat(window.getComputedStyle(y).opacity||"1"),domDataForExitAnimations:a}]}).reduce(Ba,{});return(function(m,y){Object.keys(m).forEach(function(i){m[i].destroy&&m[i].destroy(),m[i].onAnimationEnd&&m[i].onAnimationEnd(!0),delete m[i]}),y.forEach(function(i){i.style.transform="",i.style.opacity=""})})(c,d.concat(s)),{flippedElementPositions:l,cachedOrderedFlipIds:E.map(function(m){return m[0].dataset.flipId})}};new Fa;function lr(){return lr=Object.assign?Object.assign.bind():function(r){for(var u=1;u<arguments.length;u++){var t=arguments[u];for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=t[e])}return r},lr.apply(this,arguments)}function zr(r,u){return zr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},zr(r,u)}function Da(r,u){if(r==null)return{};var t,e,h={},c=Object.keys(r);for(e=0;e<c.length;e++)u.indexOf(t=c[e])>=0||(h[t]=r[t]);return h}var _a=Jn({}),wa=Jn("portal"),Sa=(function(r){var u,t;function e(){for(var c,d=arguments.length,s=new Array(d),p=0;p<d;p++)s[p]=arguments[p];return(c=r.call.apply(r,[this].concat(s))||this).inProgressAnimations={},c.flipCallbacks={},c.el=void 0,c}t=r,(u=e).prototype=Object.create(t.prototype),u.prototype.constructor=u,zr(u,t);var h=e.prototype;return h.getSnapshotBeforeUpdate=function(c){return c.flipKey!==this.props.flipKey&&this.el?Eo({element:this.el,flipCallbacks:this.flipCallbacks,inProgressAnimations:this.inProgressAnimations,portalKey:this.props.portalKey}):null},h.componentDidUpdate=function(c,d,s){this.props.flipKey!==c.flipKey&&this.el&&Fo({flippedElementPositionsBeforeUpdate:s.flippedElementPositions,cachedOrderedFlipIds:s.cachedOrderedFlipIds,containerEl:this.el,inProgressAnimations:this.inProgressAnimations,flipCallbacks:this.flipCallbacks,applyTransformOrigin:this.props.applyTransformOrigin,spring:this.props.spring,debug:this.props.debug,portalKey:this.props.portalKey,staggerConfig:this.props.staggerConfig,handleEnterUpdateDelete:this.props.handleEnterUpdateDelete,decisionData:{previous:c.decisionData,current:this.props.decisionData},onComplete:this.props.onComplete,onStart:this.props.onStart})},h.render=function(){var c=this,d=this.props,s=d.portalKey,p=Pe.createElement(_a.Provider,{value:this.flipCallbacks},Pe.createElement(d.element,{className:d.className,ref:function(n){return c.el=n}},this.props.children));return s&&(p=Pe.createElement(wa.Provider,{value:s},p)),p},e})(Ka);Sa.defaultProps={applyTransformOrigin:!0,element:"div"};var Bo=["children","flipId","inverseFlipId","portalKey"],Ao=["children","flipId","shouldFlip","shouldInvert","onAppear","onStart","onStartImmediate","onComplete","onExit","onSpringUpdate"],xn=function(r){var u,t=r.children,e=r.flipId,h=r.inverseFlipId,c=r.portalKey,d=Da(r,Bo),s=t,p=(function(o){return typeof o=="function"})(s);if(!p)try{s=ja.only(t)}catch{throw new Error("Each Flipped component must wrap a single child")}d.scale||d.translate||d.opacity||ya.assign(d,{translate:!0,scale:!0,opacity:!0});var n=((u={})[At.DATA_FLIP_CONFIG]=JSON.stringify(d),u);return e!==void 0?n[At.DATA_FLIP_ID]=String(e):h&&(n[At.DATA_INVERSE_FLIP_ID]=String(h)),c!==void 0&&(n[At.DATA_PORTAL_KEY]=c),p?s(n):Va(s,n)},ka=function(r){var u=r.children,t=r.flipId,e=r.shouldFlip,h=r.shouldInvert,c=r.onAppear,d=r.onStart,s=r.onStartImmediate,p=r.onComplete,n=r.onExit,o=r.onSpringUpdate,E=Da(r,Ao);return u?E.inverseFlipId?Pe.createElement(xn,lr({},E),u):Pe.createElement(wa.Consumer,null,function(l){return Pe.createElement(_a.Consumer,null,function(m){return ya.isObject(m)&&t&&(m[t]={shouldFlip:e,shouldInvert:h,onAppear:c,onStart:d,onStartImmediate:s,onComplete:p,onExit:n,onSpringUpdate:o}),Pe.createElement(xn,lr({flipId:t},E,{portalKey:l}),u)})}):null};ka.displayName="Flipped";function bo(r){const{data:u,activedItem:t,onChange:e,onDelete:h,sortRules:c=[{label:"\u5F53\u5929",dayPeriod:1}],eventsEmit:d,assistantList:s,height:p=400,styles:n={},hasMore:o=!1,loadingMore:E=!1}=r,l=u.map(T=>T.sessionId+"-"+T.gmtModified).join(","),m=De(()=>{const T=c.length>0?c:[{label:"\u5F53\u5929",dayPeriod:1}],w=io(u,T),A=T.every(g=>!w[g.label]||w[g.label].length===0),D=[];return T.forEach(g=>{w[g.label]&&w[g.label].length>0&&(D.push({type:"group",label:g.label}),w[g.label].forEach(q=>D.push({type:"item",data:q})))}),w.other.length>0&&!A&&(D.push({type:"group",label:"\u5176\u4ED6"}),w.other.forEach(g=>D.push({type:"item",data:g}))),A&&w.other.length>0&&w.other.forEach(g=>D.push({type:"item",data:g})),D},[u,c,l]),y=De(()=>m.map(T=>T.type==="group"?`g:${T.label}`:`i:${T.data.sessionId}`).join("|"),[m]),i=56,a=14,v=36,f=T=>T===m.length?v:m[T].type==="group"?32:i+a,x=Ge(null),F=De(()=>m.findIndex(T=>{var w;return T.type==="item"&&((w=T.data)==null?void 0:w.sessionId)===t}),[m,t]),_=De(()=>m.findIndex(T=>T.type==="item"),[m]),b=Ge(void 0);_e(()=>{const T=b.current;t!==T&&F>-1&&F===_&&x.current&&x.current.scrollToItem(F,"start"),b.current=t},[t,F,_]);const k=Ge(0);if(_e(()=>{if(x.current){const T=k.current,w=m.length;if(k.current=w,w!==T){const D=(T>0?Math.abs(w-T)/T:1)>.5||T<10&&w>20;x.current.resetAfterIndex(0,D)}}},[m.length]),_e(()=>{x.current&&x.current.resetAfterIndex(0,!0)},[y]),m.length===0)return S("div",{className:"text-center text-zinc-400 py-8",children:"\u6682\u65E0\u4F1A\u8BDD"});const N=(n==null?void 0:n.colors)||{};return S(Sa,{flipKey:l,spring:{stiffness:180,damping:18},children:S(no,{ref:x,height:p,width:"100%",itemCount:m.length+1,itemSize:f,itemKey:T=>{if(T===m.length)return"footer";const w=m[T];return w.type==="item"?w.data.sessionId:`group-${w.label}`},onItemsRendered:({visibleStopIndex:T})=>{o&&!E&&T>=m.length-1-3&&typeof d=="function"&&d("conversations:load_more")},style:{overflowX:"hidden"},children:({index:T,style:w})=>{if(T===m.length){const D=(n==null?void 0:n.colors)||{};return S("div",{style:{...w,height:v,lineHeight:`${v}px`,textAlign:"center",fontSize:"10px",color:D.textMuted||"#9ca3af",background:D.groupBg||"white"},children:E?"\u52A0\u8F7D\u4E2D...":o?"":"\u6CA1\u6709\u66F4\u591A\u4E86"})}const A=m[T];return A.type==="group"?S("div",{style:{...w,background:N.groupBg||"white",zIndex:1},className:"pt-2 pb-1 px-[28px] py-[2px] text-xs text-gray-400",children:A.label}):S(ka,{flipId:A.data.sessionId,children:S("div",{style:w,className:"px-[12px] py-[2px]",children:S(ao,{isActive:t===A.data.sessionId,isDisabled:!1,isNew:A.data.isNew,data:A.data,eventsEmit:d,assistantList:s,styles:n})})},A.data.sessionId)}})})}const Do=({value:r,eventsEmit:u,setSearch:t,style:e,styles:h={}})=>{const{messages:c}=fr(),d=h.colors||{},s=h.radius||"12px",p=d.border||"#e5e7eb",n=d.primary||"#2563eb",o=h.headerBg||d.sidebarBg||d.background||"#fff",[E,l]=Pe.useState(!1),m=Pe.useRef(null);Pe.useEffect(()=>{E&&m.current&&m.current.focus()},[E]);const y=()=>{l(!1),t("")};return Y("div",{className:"flex items-center gap-2 px-4 py-3 sticky top-0 z-10 min-w-0",style:{...e,background:o,borderTopLeftRadius:s,borderTopRightRadius:s},children:[S("button",{className:"border-none flex items-center justify-center",onClick:()=>{l(!1),u&&u("conversation:create")},title:c.sidebar.newConversation,style:{height:42,borderRadius:"90px",background:n,color:d.buttonText||"#fff",fontWeight:600,boxShadow:h.shadow||"0 2px 8px 0 rgba(0,0,0,0.04)",padding:E?"0 0":"0 14px",minWidth:E?0:180,width:E?0:void 0,opacity:E?0:1,overflow:"hidden",flexShrink:0,transition:"width .22s ease, min-width .22s ease, padding .22s ease, opacity .18s ease",pointerEvents:E?"none":"auto"},children:Y("div",{className:"flex items-center gap-2",children:[S(wi,{size:18}),S("span",{className:"text-sm",children:c.sidebar.newChat})]})}),E?Y("div",{className:"flex-1 min-w-0 relative",children:[S("input",{ref:m,className:"w-full px-3 py-2 pr-10 text-sm transition-all",placeholder:c.sidebar.searchPlaceholder,value:r,onChange:i=>t(i.target.value),onKeyDown:i=>{i.key==="Escape"&&y()},style:{minWidth:0,width:"100%",borderRadius:s,background:d.inputBg||"#f4f4f5",border:`1px solid ${p}`,color:d.text||"#222",outline:"none",paddingRight:40}}),S("button",{className:"absolute right-3 flex items-center justify-center transition-colors hover:bg-gray-200 rounded-full",style:{width:20,height:20,color:d.text||"#666",flexShrink:0,position:"absolute",right:"12px",top:"9px"},onClick:y,title:"\u5173\u95ED\u641C\u7D22",onMouseDown:i=>i.preventDefault(),children:S(ua,{size:16})})]}):S("button",{className:"ml-auto flex items-center justify-center transition-colors hover:bg-gray-50",style:{width:36,height:36,borderRadius:"90px",border:`1px solid ${p}`,color:n,flexShrink:0},onClick:()=>l(!0),title:c.sidebar.search,children:S(Ir,{size:18})})]})};function _o(r){const{data:u,sortRules:t,activedItem:e,eventsEmit:h,assistantList:c,styles:d={},hasMore:s=!1,loadingMore:p=!1}=r,{messages:n}=fr(),[o,E]=oe(""),l=De(()=>o?u.filter(b=>(b.label||n.sidebar.unnamedSession).toLowerCase().includes(o.toLowerCase())):u,[u,o,n.sidebar.unnamedSession]),m=De(()=>[...l].sort((b,k)=>new Date(k.gmtModified).getTime()-new Date(b.gmtModified).getTime()),[l]),y=Ge(null),[i,a]=oe(400);_e(()=>{function b(){y.current&&a(y.current.clientHeight)}return b(),window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[]);const v=(d==null?void 0:d.colors)||{};d!=null&&d.radius;const f=(d==null?void 0:d.shadow)||"0 4px 24px 0 rgba(0,0,0,0.06)",x=v.border||"#e5e7eb",F=v.sidebarBg||v.background||"#EAEEFF",_=v.text||"#222";return Y("div",{className:"h-full flex flex-col overflow-y-hidden",style:{background:F,color:_,boxShadow:f,border:`1px solid ${x}`,...d.container},children:[S(Do,{value:o,setSearch:E,eventsEmit:h,style:d.header,styles:d}),Y("div",{className:"flex-1 min-h-0 relative",ref:y,style:d.list,children:[S(bo,{eventsEmit:h,data:m,assistantList:c,activedItem:e,sortRules:t,height:i,styles:d,hasMore:s,loadingMore:p}),S("div",{className:"pointer-events-none absolute left-0 right-0 top-0 h-3 z-20",style:{background:`linear-gradient(to bottom, ${F}cc, transparent)`}})]})]})}var Dt={exports:{}};/*!
53
+ * clipboard.js v2.0.11
54
+ * https://clipboardjs.com/
55
+ *
56
+ * Licensed MIT © Zeno Rocha
57
+ */var wo=Dt.exports,pn;function So(){return pn||(pn=1,(function(r,u){(function(e,h){r.exports=h()})(wo,function(){return(function(){var t={686:(function(c,d,s){s.d(d,{default:function(){return z}});var p=s(279),n=s.n(p),o=s(370),E=s.n(o),l=s(817),m=s.n(l);function y(P){try{return document.execCommand(P)}catch{return!1}}var i=function(I){var R=m()(I);return y("cut"),R},a=i;function v(P){var I=document.documentElement.getAttribute("dir")==="rtl",R=document.createElement("textarea");R.style.fontSize="12pt",R.style.border="0",R.style.padding="0",R.style.margin="0",R.style.position="absolute",R.style[I?"right":"left"]="-9999px";var H=window.pageYOffset||document.documentElement.scrollTop;return R.style.top="".concat(H,"px"),R.setAttribute("readonly",""),R.value=P,R}var f=function(I,R){var H=v(I);R.container.appendChild(H);var V=m()(H);return y("copy"),H.remove(),V},x=function(I){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},H="";return typeof I=="string"?H=f(I,R):I instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(I==null?void 0:I.type)?H=f(I.value,R):(H=m()(I),y("copy")),H},F=x;function _(P){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_=function(R){return typeof R}:_=function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},_(P)}var b=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},R=I.action,H=R===void 0?"copy":R,V=I.container,X=I.target,j=I.text;if(H!=="copy"&&H!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(X!==void 0)if(X&&_(X)==="object"&&X.nodeType===1){if(H==="copy"&&X.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(H==="cut"&&(X.hasAttribute("readonly")||X.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(j)return F(j,{container:V});if(X)return H==="cut"?a(X):F(X,{container:V})},k=b;function N(P){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?N=function(R){return typeof R}:N=function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},N(P)}function T(P,I){if(!(P instanceof I))throw new TypeError("Cannot call a class as a function")}function w(P,I){for(var R=0;R<I.length;R++){var H=I[R];H.enumerable=H.enumerable||!1,H.configurable=!0,"value"in H&&(H.writable=!0),Object.defineProperty(P,H.key,H)}}function A(P,I,R){return I&&w(P.prototype,I),R&&w(P,R),P}function D(P,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function");P.prototype=Object.create(I&&I.prototype,{constructor:{value:P,writable:!0,configurable:!0}}),I&&g(P,I)}function g(P,I){return g=Object.setPrototypeOf||function(H,V){return H.__proto__=V,H},g(P,I)}function q(P){var I=Z();return function(){var H=U(P),V;if(I){var X=U(this).constructor;V=Reflect.construct(H,arguments,X)}else V=H.apply(this,arguments);return M(this,V)}}function M(P,I){return I&&(N(I)==="object"||typeof I=="function")?I:G(P)}function G(P){if(P===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P}function Z(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function U(P){return U=Object.setPrototypeOf?Object.getPrototypeOf:function(R){return R.__proto__||Object.getPrototypeOf(R)},U(P)}function $(P,I){var R="data-clipboard-".concat(P);if(I.hasAttribute(R))return I.getAttribute(R)}var Q=(function(P){D(R,P);var I=q(R);function R(H,V){var X;return T(this,R),X=I.call(this),X.resolveOptions(V),X.listenClick(H),X}return A(R,[{key:"resolveOptions",value:function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof V.action=="function"?V.action:this.defaultAction,this.target=typeof V.target=="function"?V.target:this.defaultTarget,this.text=typeof V.text=="function"?V.text:this.defaultText,this.container=N(V.container)==="object"?V.container:document.body}},{key:"listenClick",value:function(V){var X=this;this.listener=E()(V,"click",function(j){return X.onClick(j)})}},{key:"onClick",value:function(V){var X=V.delegateTarget||V.currentTarget,j=this.action(X)||"copy",ue=k({action:j,container:this.container,target:this.target(X),text:this.text(X)});this.emit(ue?"success":"error",{action:j,text:ue,trigger:X,clearSelection:function(){X&&X.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(V){return $("action",V)}},{key:"defaultTarget",value:function(V){var X=$("target",V);if(X)return document.querySelector(X)}},{key:"defaultText",value:function(V){return $("text",V)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(V){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return F(V,X)}},{key:"cut",value:function(V){return a(V)}},{key:"isSupported",value:function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],X=typeof V=="string"?[V]:V,j=!!document.queryCommandSupported;return X.forEach(function(ue){j=j&&!!document.queryCommandSupported(ue)}),j}}]),R})(n()),z=Q}),828:(function(c){var d=9;if(typeof Element<"u"&&!Element.prototype.matches){var s=Element.prototype;s.matches=s.matchesSelector||s.mozMatchesSelector||s.msMatchesSelector||s.oMatchesSelector||s.webkitMatchesSelector}function p(n,o){for(;n&&n.nodeType!==d;){if(typeof n.matches=="function"&&n.matches(o))return n;n=n.parentNode}}c.exports=p}),438:(function(c,d,s){var p=s(828);function n(l,m,y,i,a){var v=E.apply(this,arguments);return l.addEventListener(y,v,a),{destroy:function(){l.removeEventListener(y,v,a)}}}function o(l,m,y,i,a){return typeof l.addEventListener=="function"?n.apply(null,arguments):typeof y=="function"?n.bind(null,document).apply(null,arguments):(typeof l=="string"&&(l=document.querySelectorAll(l)),Array.prototype.map.call(l,function(v){return n(v,m,y,i,a)}))}function E(l,m,y,i){return function(a){a.delegateTarget=p(a.target,m),a.delegateTarget&&i.call(l,a)}}c.exports=o}),879:(function(c,d){d.node=function(s){return s!==void 0&&s instanceof HTMLElement&&s.nodeType===1},d.nodeList=function(s){var p=Object.prototype.toString.call(s);return s!==void 0&&(p==="[object NodeList]"||p==="[object HTMLCollection]")&&"length"in s&&(s.length===0||d.node(s[0]))},d.string=function(s){return typeof s=="string"||s instanceof String},d.fn=function(s){var p=Object.prototype.toString.call(s);return p==="[object Function]"}}),370:(function(c,d,s){var p=s(879),n=s(438);function o(y,i,a){if(!y&&!i&&!a)throw new Error("Missing required arguments");if(!p.string(i))throw new TypeError("Second argument must be a String");if(!p.fn(a))throw new TypeError("Third argument must be a Function");if(p.node(y))return E(y,i,a);if(p.nodeList(y))return l(y,i,a);if(p.string(y))return m(y,i,a);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function E(y,i,a){return y.addEventListener(i,a),{destroy:function(){y.removeEventListener(i,a)}}}function l(y,i,a){return Array.prototype.forEach.call(y,function(v){v.addEventListener(i,a)}),{destroy:function(){Array.prototype.forEach.call(y,function(v){v.removeEventListener(i,a)})}}}function m(y,i,a){return n(document.body,y,i,a)}c.exports=o}),817:(function(c){function d(s){var p;if(s.nodeName==="SELECT")s.focus(),p=s.value;else if(s.nodeName==="INPUT"||s.nodeName==="TEXTAREA"){var n=s.hasAttribute("readonly");n||s.setAttribute("readonly",""),s.select(),s.setSelectionRange(0,s.value.length),n||s.removeAttribute("readonly"),p=s.value}else{s.hasAttribute("contenteditable")&&s.focus();var o=window.getSelection(),E=document.createRange();E.selectNodeContents(s),o.removeAllRanges(),o.addRange(E),p=o.toString()}return p}c.exports=d}),279:(function(c){function d(){}d.prototype={on:function(s,p,n){var o=this.e||(this.e={});return(o[s]||(o[s]=[])).push({fn:p,ctx:n}),this},once:function(s,p,n){var o=this;function E(){o.off(s,E),p.apply(n,arguments)}return E._=p,this.on(s,E,n)},emit:function(s){var p=[].slice.call(arguments,1),n=((this.e||(this.e={}))[s]||[]).slice(),o=0,E=n.length;for(o;o<E;o++)n[o].fn.apply(n[o].ctx,p);return this},off:function(s,p){var n=this.e||(this.e={}),o=n[s],E=[];if(o&&p)for(var l=0,m=o.length;l<m;l++)o[l].fn!==p&&o[l].fn._!==p&&E.push(o[l]);return E.length?n[s]=E:delete n[s],this}},c.exports=d,c.exports.TinyEmitter=d})},e={};function h(c){if(e[c])return e[c].exports;var d=e[c]={exports:{}};return t[c](d,d.exports,h),d.exports}return(function(){h.n=function(c){var d=c&&c.__esModule?function(){return c.default}:function(){return c};return h.d(d,{a:d}),d}})(),(function(){h.d=function(c,d){for(var s in d)h.o(d,s)&&!h.o(c,s)&&Object.defineProperty(c,s,{enumerable:!0,get:d[s]})}})(),(function(){h.o=function(c,d){return Object.prototype.hasOwnProperty.call(c,d)}})(),h(686)})().default})})(Dt)),Dt.exports}var ko=So();const Io=ea(ko),Ro=(r,u)=>{let t=r&&r.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 e=new Io(u.currentTarget||u.target,{text:()=>t});try{e.on("success",()=>{Re.success("\u6587\u672C\u590D\u5236\u6210\u529F",2),e.destroy()}),e.on("error",h=>{Re.error("\u590D\u5236\u5931\u8D25",2),e.destroy()}),e.onClick(u)}catch(h){e.destroy(),Re.error("\u590D\u5236\u5931\u8D25: "+h,2)}};function No(r){const u=[];for(const t of r){if(t.query){const e=t.query.queryId||t.query.id||t.queryId||t.id||k0(32);u.push({istype:"user",content:t.query.content,time:t.query.gmtCreate,queryId:e,clientSideId:e+"-user",...t.query})}if(t.reply){const e=t.reply.queryId||t.reply.id||t.queryId||t.id||k0(32);u.push({istype:"ai",content:t.reply.content,isDefault:t.reply.isDefault,time:t.time||t.gmtCreate||Date.now(),queryId:e,clientSideId:e+"-ai",...t.reply})}}return u}const Po=""+new URL("defaultWeLogo.svg",import.meta.url).href,To="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==",zo=(r,u)=>{const t={...qr.colors,...r};return`
58
+ .g-welcome-${u} .g-welcome-title {
59
+ background-image: linear-gradient(90deg, #3262FA 0%, #6C18FF 100%);
60
+ -webkit-background-clip: text;
61
+ background-clip: text;
62
+ color: transparent;
63
+ -webkit-text-fill-color: transparent;
64
+ }
65
+ .g-welcome-${u} .g-welcome-subtitle {
66
+ color: ${t.disabled};
67
+ }
68
+ .g-welcome-${u} .g-welcome-btn {
69
+ background-color: #ffffff;
70
+ border-color: ${t.border};
71
+ color: ${t.text};
72
+ height: 36px;
73
+ border-width: 1px;
74
+ box-shadow: 0 1px 2px rgba(31,35,41,0.04);
75
+ }
76
+ .g-welcome-${u} .g-welcome-btn:hover {
77
+ border-color: ${t.primary};
78
+ color: ${t.primary};
79
+ background-color: #ffffff;
80
+ box-shadow: 0 2px 6px rgba(31,35,41,0.08);
81
+ }
82
+ .g-welcome-${u} .g-welcome-btn.active {
83
+ background-image: linear-gradient(90deg, #F1F8FF 0%, #F9F4FF 100%);
84
+ border-color: ${t.primary};
85
+ box-shadow: 0 4px 10px rgba(24, 144, 255, 0.25);
86
+ }
87
+ .g-welcome-${u} .g-welcome-btn .icon-badge {
88
+ width: 24px;
89
+ height: 24px;
90
+ border-radius: 9999px;
91
+ display: inline-flex;
92
+ align-items: center;
93
+ justify-content: center;
94
+ background: radial-gradient(100% 100% at 50% 0%, #F2F3F5 0%, #FFFFFF 100%);
95
+ box-shadow: inset 0 0 0 1px ${t.border};
96
+ }
97
+ .g-welcome-${u} .g-welcome-pagination-btn {
98
+ background: transparent;
99
+ border: none;
100
+ color: ${t.disabled};
101
+ padding: 6px 10px;
102
+ border-radius: 9999px;
103
+ transition: all 0.2s;
104
+ font-size: 14px;
105
+ line-height: 1;
106
+ min-width: 32px;
107
+ height: 32px;
108
+ display: inline-flex;
109
+ align-items: center;
110
+ justify-content: center;
111
+ }
112
+ .g-welcome-${u} .g-welcome-pagination-btn:hover:not(:disabled) {
113
+ color: ${t.text};
114
+ background-color: ${t.border}33;
115
+ }
116
+ .g-welcome-${u} .g-welcome-pagination-btn.active {
117
+ color: ${t.primary};
118
+ background: radial-gradient(100% 100% at 50% 50%, ${t.primary}10 0%, ${t.primary}08 100%);
119
+ box-shadow: 0 2px 10px ${t.primary}12, inset 0 0 0 1px ${t.primary}1A;
120
+ }
121
+ .g-welcome-${u} .g-welcome-pagination-btn:disabled {
122
+ color: ${t.disabled};
123
+ cursor: not-allowed;
124
+ background: transparent;
125
+ }
126
+ .g-welcome-${u} .g-welcome-pagination-text {
127
+ color: ${t.disabled};
128
+ font-size: 14px;
129
+ padding: 0 8px;
130
+ }
131
+ .g-welcome-${u} .g-welcome-pagination-dot {
132
+ width: 6px;
133
+ height: 6px;
134
+ border-radius: 50%;
135
+ background-color: ${t.border};
136
+ transition: all 0.2s;
137
+ }
138
+ .g-welcome-${u} .g-welcome-pagination-dot.active {
139
+ background-color: ${t.primary};
140
+ width: 20px;
141
+ border-radius: 3px;
142
+ }
143
+ .g-welcome-${u} .g-welcome-search-btn {
144
+ background-color: #ffffff;
145
+ border: 1px solid ${t.border};
146
+ color: ${t.text};
147
+ padding: 8px 8px;
148
+ border-radius: 100%;
149
+ cursor: pointer;
150
+ transition: all 0.2s;
151
+ display: flex;
152
+ align-items: center;
153
+ gap: 6px;
154
+ font-size: 14px;
155
+ box-shadow: 0 1px 2px rgba(31,35,41,0.04);
156
+ }
157
+ .g-welcome-${u} .g-welcome-search-btn:hover {
158
+ border-color: ${t.primary};
159
+ color: ${t.primary};
160
+ box-shadow: 0 2px 6px rgba(31,35,41,0.08);
161
+ }
162
+ .g-welcome-${u} .g-welcome-search-input {
163
+ border: 1px solid ${t.border};
164
+ border-radius: 9999px;
165
+ transition: all 0.2s;
166
+ height: 40px;
167
+ padding: 0 14px;
168
+ }
169
+ .g-welcome-${u} .g-welcome-search-input:focus,
170
+ .g-welcome-${u} .g-welcome-search-input:hover {
171
+ border-color: ${t.primary};
172
+ box-shadow: 0 0 0 2px ${t.primary}1A;
173
+ }
174
+ `};function qo({config:r,styles:u}){if(!r)return null;const t=JSON.parse(r.configJson),e=De(()=>{var h;return{...qr.colors,...(h=u==null?void 0:u.theme)==null?void 0:h.colors}},[u]);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:[S("span",{className:"text-md font-bold truncate mr-2",style:{color:e.primary},children:t.config_name||"\u52A9\u624B\u914D\u7F6E"}),S("span",{className:"text-xs truncate rounded px-2 py-0.5",style:{backgroundColor:`${e.primary}1A`,color:e.disabled},children:t.model_name})]}),S("div",{className:"border-b my-2",style:{borderColor:e.border}}),Y("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs text-gray-700 mb-2",style:{color:e.text},children:[Y("div",{children:["\u4E0A\u4E0B\u6587\u6700\u5927\u8F6E\u6570\uFF1A",S("span",{className:"font-semibold",children:t.max_round})]}),Y("div",{children:["\u6700\u5927\u4EE4\u724C\u6570\uFF1A",S("span",{className:"font-semibold",children:t.max_tokens})]}),Y("div",{children:["\u6E29\u5EA6\uFF1A",S("span",{className:"font-semibold",children:t.temperature})]}),Y("div",{children:["\u53EC\u56DE\u6570\uFF1A",S("span",{className:"font-semibold",children:t.top_k})]}),Y("div",{children:["\u591A\u6837\u6027\uFF1A",S("span",{className:"font-semibold",children:t.top_p})]}),Y("div",{children:["\u76F8\u4F3C\u5EA6\u9608\u503C\uFF1A",S("span",{className:"font-semibold",children:t.score_threshold})]})]}),Y("div",{className:"mb-2",children:[S("div",{className:"text-xs text-gray-400 mb-1",style:{color:e.disabled},children:"\u5173\u8054\u77E5\u8BC6\u5E93\uFF1A"}),S("div",{className:"flex flex-wrap gap-1",children:t.knowledge_base_name?t.knowledge_base_name.split(";").map((h,c)=>S("span",{className:"px-2 py-0.5 rounded-full text-xs",style:{backgroundColor:`${e.primary}1A`,color:e.primary},children:h},c)):S("span",{className:"text-gray-300",style:{color:e.disabled},children:"\u65E0"})})]}),Y("div",{className:"mb-2",children:[S("div",{className:"text-xs text-gray-400 mb-1",style:{color:e.disabled},children:"\u5F00\u542F\u529F\u80FD:"}),Y("div",{className:"flex flex-wrap gap-2 text-xs mt-2",children:[!!t.enabled_faq&&S("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${e.success}1A`,color:e.success},children:"FAQ"}),!!t.enabled_graph&&S("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${e.success}1A`,color:e.success},children:"\u56FE\u8C31"}),!!t.dependOnKb&&S("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${e.success}1A`,color:e.success},children:"\u5F3A\u77E5\u8BC6\u4F9D\u8D56"}),!!t.enabled_table_select&&S("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${e.success}1A`,color:e.success},children:"\u8868\u683C\u7B5B\u9009"}),!!t.enabled_rerank&&S("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${e.success}1A`,color:e.success},children:"\u7CBE\u6392\u6A21\u5F0F"}),!!t.need_trace_source&&S("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${e.success}1A`,color:e.success},children:"\u6EAF\u6E90"}),!!t.is_download&&S("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${e.success}1A`,color:e.success},children:"\u4E0B\u8F7D\u6EAF\u6E90"})]})]})]})}function Lo(r,u=[],t=60){const[e,h]=oe("");return _e(()=>{if(h(""),!r)return;let c=0;const d=setInterval(()=>{h(s=>c>=r.length?(clearInterval(d),s):(c++,r.slice(0,c)))},t);return()=>clearInterval(d)},[r,...u]),e}function Oo(r){const{assistantList:u,eventsEmit:t,styles:e,selectedId:h,onSelectAssistant:c,productLogo:d}=r,{messages:s}=fr(),[p,n]=oe(1),[o,E]=oe(!1),[l,m]=oe(""),y=o||l.trim()?6:12,i=Ge(),a=Ge(!1),v=Ge(null),f=Ge(null),x=Ge("");_e(()=>{h&&i.current!==h&&(t==null||t("conversation:new_assistant_change",{assistantId:h}),i.current=h)},[h,t]);const F=De(()=>k0(),[]);_e(()=>{var D;if((D=e==null?void 0:e.theme)!=null&&D.colors){const g=document.createElement("style");return g.innerHTML=zo(e.theme.colors,F),g.id=`g-welcome-styles-${F}`,document.head.appendChild(g),()=>{const q=document.getElementById(g.id);q&&q.remove()}}},[e,F]);const _=De(()=>u.find(D=>D.id===h),[u,h]),b=De(()=>JSON.parse((_==null?void 0:_.configJson)||"{}"),[_]),k=De(()=>{if(!l.trim())return u||[];const D=l.toLowerCase().trim();return(u||[]).filter(g=>{var M,G;const q=((M=g.name)==null?void 0:M.toLowerCase())||"";try{const U=((G=JSON.parse(g.configJson||"{}").config_name)==null?void 0:G.toLowerCase())||"";return q.includes(D)||U.includes(D)}catch{return q.includes(D)}})},[u,l]),N=Math.ceil(((k==null?void 0:k.length)||0)/y),T=(k==null?void 0:k.slice((p-1)*y,p*y))||[];_e(()=>{if(h&&h!==f.current){if(a.current&&v.current!==null){f.current=h;return}const D=l.trim()?k:u;if(D&&D.length>0){const g=D.findIndex(q=>q.id===h);if(g!==-1){const q=Math.floor(g/y)+1;n(q),f.current=h}}}},[h,u,k,y,l]),_e(()=>{if(l!==x.current){if(a.current&&v.current!==null){n(v.current),a.current=!1,v.current=null,x.current=l;return}if(f.current===h){x.current=l;return}a.current||(l.trim()&&(f.current=null),n(1)),x.current=l}},[l,h]),_e(()=>{N>0&&p>N&&n(N)},[N,p]);const w=b.prologue||s.welcome.defaultPrologue,A=Lo(w,[h],30);return Y("div",{className:`flex flex-col relative items-center justify-center h-full w-full g-welcome-${F}`,children:[S("img",{src:d||Po,alt:"logo",className:"mb-4",style:{width:68,height:68}}),S("div",{className:"text-3xl font-bold mb-2 g-welcome-title",children:A}),!h&&S("div",{className:"flex mb-2 g-welcome-subtitle",children:s.welcome.selectAssistant}),Y("div",{style:{maxWidth:"1200px"},className:`flex mt-8 flex-wrap gap-3\r
175
+ max-w-[1200px] px-8 w-full mx-auto justify-center mb-4`,children:[o?S("div",{className:"flex items-center gap-2 px-5 w-full",style:{flexBasis:"100%"},children:S(ta,{className:"g-welcome-search-input w-full",placeholder:s.welcome.searchAssistant,prefix:S(Ir,{size:16}),suffix:S("button",{type:"button",onClick:()=>{E(!1),m("")},style:{background:"transparent",border:"none",cursor:"pointer"},children:S(ua,{size:14})}),value:l,onChange:D=>m(D.target.value),autoFocus:!0})}):S("button",{type:"button",className:"g-welcome-search-btn",onClick:()=>E(!0),children:S(Ir,{size:16})}),T&&T.length>0?S(ot,{children:T.map(D=>{const g=h===D.id;let q=D.icon;try{const M=JSON.parse(D.configJson||"{}");q=q||M.icon||M.avatar||M.logo}catch{}return q=q||To,S(Si,{content:()=>S(qo,{config:u.find(M=>M.id===D.id),styles:e}),trigger:"hover",placement:"bottom",children:Y("button",{type:"button",className:`g-welcome-btn px-3 cursor-pointer rounded-full border font-medium min-w-[160px] text-sm transition-all flex items-center gap-2 ${g?"active":""}`,onClick:()=>{c==null||c(D.id);const M=o||l.trim(),Z=(M?u:l.trim()?k:u).findIndex(U=>U.id===D.id);if(Z!==-1){const $=Math.floor(Z/(M?12:y))+1;n($),f.current=D.id,M&&(v.current=$,a.current=!0,setTimeout(()=>{m(""),E(!1)},100))}},title:D.name,children:[S("span",{className:"icon-badge",children:S("img",{src:q,alt:"icon",style:{width:16,height:16,borderRadius:4}})}),S("span",{className:"truncate max-w-[180px]",children:D.name})]})},D.id)})}):S("div",{className:"g-welcome-subtitle",children:"\u6682\u65E0\u53EF\u7528\u52A9\u624B"})]}),N>1&&Y("div",{className:"flex items-center gap-2",children:[S("button",{type:"button",className:"g-welcome-pagination-btn",onClick:()=>n(D=>Math.max(1,D-1)),disabled:p===1,children:S(ki,{size:16})}),S("div",{className:"flex items-center gap-1",children:(()=>{const D=[];if(N<=7)for(let q=1;q<=N;q++)D.push(q);else if(D.push(1),p<=4){for(let q=2;q<=5;q++)D.push(q);D.push("..."),D.push(N)}else if(p>=N-3){D.push("...");for(let q=N-4;q<=N;q++)D.push(q)}else{D.push("...");for(let q=p-1;q<=p+1;q++)D.push(q);D.push("..."),D.push(N)}return D.map((q,M)=>{if(q==="...")return S("span",{className:"g-welcome-pagination-text px-1",children:"..."},`ellipsis-${M}`);const G=q;return S("button",{type:"button",className:`g-welcome-pagination-btn ${p===G?"active":""}`,onClick:()=>n(G),children:G},G)})})()}),S("button",{type:"button",className:"g-welcome-pagination-btn",onClick:()=>n(D=>Math.min(N,D+1)),disabled:p===N,children:S(bi,{size:16})})]})]})}class Dr extends Error{}let D0=null,S0=null,F0=null,Fe=[],rt,nt,_r=new Map;const Mo=({baseUrl:r,token:u,CSRFToken:t,setChatData:e,activeSessionId:h,setAppStatus:c,setConversationList:d})=>{const s=a=>{if(!a)return!1;if(typeof a=="string"){const v=a.trim();return v!==""&&v!=="[]"&&v!=="null"}return!0},p=({content:a,status:v,respTime:f,filePaths:x,reference:F,webReference:_,knowledgeBases:b,graphReference:k,databaseReference:N,faqReference:T,llmType:w,resultType:A,queryId:D,tokens:g,chain:q,thoughtChainNodes:M,enableCot:G,chainRespTime:Z})=>{e(U=>{var ne;if(!U[0])return U;const $=U[0],Q=$.messages||[],z=Q.length-1;if(z<0)return U;const P=Q[z];if(P.istype!=="ai")return U;let I=Q.slice();if(x!=null&&x.length){const je=Q.length-2;if(je>=0&&((ne=Q[je])==null?void 0:ne.istype)==="user"){const we={...Q[je],filePaths:x};I[je]=we}}const R=D&&D!==P.queryId,H=v===1&&P.status===2,V=R||H?s(k)?k:null:k!==void 0&&s(k)?k:P.graphReference;v===2&&k!==void 0&&console.log("[AichatUseController] reset_chat status=2 \u65F6\u7684 graphReference:",{graphReference:k,isValid:s(k),lastMessageGraphReference:P.graphReference,finalGraphReference:V,isNewQuery:R,isRestart:H});let X;R?X=a:H?X="":v===4||v===2&&!a?X=P.content||"":X=(P.content||"")+a;const j={...P,content:X,status:v,respTime:f,filePaths:x,reference:R||H?F||"[]":F,webReference:R||H?_||"[]":_,knowledgeBases:R||H?b||"[]":b,graphReference:V,databaseReference:R||H?N!==void 0?N:null:N!==void 0?N:P.databaseReference,resultType:A,llmType:w,tokens:g,queryId:D||P.queryId||k0(32),chain:R||H?q!==void 0?q:void 0:q!==void 0?q:P.chain,thoughtChainNodes:R||H?M!==void 0?M:void 0:M!==void 0?M:P.thoughtChainNodes,enableCot:G!==void 0?G:P.enableCot,chainRespTime:Z!==void 0?Z:P.chainRespTime,faqReference:R||H?T!==void 0?T:null:T!==void 0?T:P.faqReference};return j.clientSideId=j.clientSideId||j.queryId+"-ai",I[z]=j,[{...$,isNew:!1,messages:I},...U.slice(1)]})},n=a=>{if(a instanceof Dr)throw c(v=>({...v,display:"error",sender:"ready"})),D0&&(D0.abort(),D0=null),S0=null,F0=null,a};return{updateUserFilesMessage:({currentFiles:a})=>{e(v=>{if(!v[0])return v;const f=v[0],x=f.messages||[];if(!x.length)return v;const F=x.length-2;if(F<0||x[F].istype!=="user")return v;const b=x.slice();return b[F]={...x[F],currentFiles:a},[{...f,messages:b},...v.slice(1)]})},api_startChat_re:(a,v)=>{D0&&D0.abort(),D0=new AbortController,S0=a.sessionId,F0=a.queryId,Fe=[],rt=void 0,nt=void 0,_r=new Map;const f=`${r}/qa/ai/question_re`;console.log("data",a);const x={...a};Za(f,{method:"post",signal:D0.signal,headers:{"Content-Type":"application/json",Accept:"text/event-stream",Authorization:u||"","X-CSRF-TOKEN-IN":t||""},openWhenHidden:!0,body:JSON.stringify(x),onopen:async F=>{if(F.status===500)throw new Dr("Internal Server Error");if(!F.ok)throw new Dr(`HTTP error: ${F.status}`)},onmessage:F=>{var H,V,X,j;const _=JSON.parse(F.data);if(S0!==_.sessionId){console.log("[AichatUseController] \u6D41\u5F0F\u8BF7\u6C42\u7684 sessionId \u5DF2\u4E0D\u5339\u914D\uFF0C\u5FFD\u7565\u6570\u636E",{currentStreamSessionId:S0,receivedSessionId:_.sessionId,activeSessionId:h});return}if(h!==_.sessionId)return;const{reply:b,resultType:k,respTime:N,reference:T,webReference:w,faqReference:A,graphReference:D,knowledgeBases:g,filePaths:q,status:M,docs:G,llmType:Z,databaseReference:U,businessType:$,nodeStatus:Q,enableCot:z,chainRespTime:P}=_;if(M===4&&$){Q===2&&typeof P=="number"&&P>0&&_r.set($,P);const ue=Q===2&&typeof P=="number"&&P>0?P:void 0;Fe=Bi(Fe,{businessType:$,nodeStatus:Q,reply:b,respTime:ue,chainRespTime:ue}),console.log("[AichatUseController] status=4 \u805A\u5408\u601D\u7EF4\u94FE\u6570\u636E:",{businessType:$,nodeStatus:Q,content:(H=b==null?void 0:b.content)==null?void 0:H.substring(0,50),currentThoughtNodesCount:Fe.length,chainRespTime:Q===2?P:void 0})}else M===1&&$&&console.log("[AichatUseController] status=1 \u8DF3\u8FC7\u601D\u7EF4\u94FE\u805A\u5408:",{businessType:$,content:(V=b==null?void 0:b.content)==null?void 0:V.substring(0,50),note:"status=1 \u7684\u5185\u5BB9\u5E94\u8BE5\u53BB\u6B63\u6587\uFF0C\u4E0D\u662F\u601D\u7EF4\u94FE"});if(typeof z=="number"&&(rt=z),M===1||M===2){const ue=Array.from(_r.values()).reduce((ne,je)=>ne+je,0);ue>0&&(nt=ue)}const I=q?JSON.parse(q):[];M===2&&b&&b.content&&(b.content.includes("\u6A21\u578B\u6682\u65E0\u6CD5\u8FD4\u56DE")||b.content.includes("\u5931\u8D25")||b.content.includes("\u9519\u8BEF")||b.content.includes("\u8BF7\u7A0D\u540E\u518D\u8BD5"))&&c(ue=>({...ue,display:"ready",sender:"ready"}));const R=s(D)?D:void 0;if(M===2&&console.log("[AichatUseController] status=2 \u65F6\u7684 graphReference:",{graphReference:D,type:typeof D,isValid:s(D),finalGraphReference:R}),M===4){const ue=Fe.length>0?Fe.map(ne=>({businessType:ne.businessType,nodeStatus:ne.nodeStatus,content:ne.content})):void 0;console.log("[AichatUseController] status=4 \u66F4\u65B0\u601D\u7EF4\u94FE:",{businessType:$,chainLength:(ue==null?void 0:ue.length)||0,replyContentLength:((X=b==null?void 0:b.content)==null?void 0:X.length)||0,note:"status=4 \u65F6\uFF0Creply.content \u5E94\u8BE5\u805A\u5408\u5230\u601D\u7EF4\u94FE\uFF0C\u4E0D\u66F4\u65B0\u6B63\u6587"}),p({content:"",status:M,respTime:N,filePaths:I,reference:T||G||"",webReference:w||"",knowledgeBases:g||"",graphReference:R,databaseReference:U,faqReference:A,llmType:Z,resultType:k,queryId:_.queryId,tokens:_.tokens,chain:ue,thoughtChainNodes:Fe.length>0?[...Fe]:void 0,enableCot:rt,chainRespTime:nt})}else if(M===1){Fe.length>0&&(Fe=Fe.map(ne=>({...ne,nodeStatus:2}))),console.log("[AichatUseController] status=1 \u66F4\u65B0\u6B63\u6587:",{businessType:$,content:(j=b==null?void 0:b.content)==null?void 0:j.substring(0,50),thoughtNodesCount:Fe.length,note:"status=1 \u65F6\uFF0Creply.content \u5E94\u8BE5\u53BB\u6B63\u6587\uFF0C\u601D\u7EF4\u94FE\u8282\u70B9\u72B6\u6001\u66F4\u65B0\u4E3A\u5B8C\u6210"});const ue=Fe.length>0?Fe.map(ne=>({businessType:ne.businessType,nodeStatus:ne.nodeStatus,content:ne.content})):void 0;p({content:b.content||"",status:M,respTime:N,filePaths:I,reference:T||G||"",webReference:w||"",graphReference:R,knowledgeBases:g||"",databaseReference:U??null,faqReference:A,llmType:Z,resultType:k,queryId:_.queryId,tokens:_.tokens,chain:ue??void 0,thoughtChainNodes:Fe.length>0?[...Fe]:void 0,enableCot:rt,chainRespTime:nt})}else if(M===2){Fe.length>0&&(Fe=Fe.map(ne=>({...ne,nodeStatus:2})));const ue=Fe.length>0?Fe.map(ne=>({businessType:ne.businessType,nodeStatus:ne.nodeStatus,content:ne.content})):void 0;if(p({content:b.content||"",status:2,respTime:N,filePaths:I,reference:T||G||"",webReference:w||"",knowledgeBases:g||"",graphReference:R,databaseReference:U,faqReference:A,llmType:Z,resultType:k,queryId:_.queryId,tokens:_.tokens,chain:ue,thoughtChainNodes:Fe.length>0?[...Fe]:void 0,enableCot:rt,chainRespTime:nt}),Fe=[],c(ne=>({...ne,display:"ready",sender:"ready"})),v){const ne=N||Date.now();console.log("[AichatUseController] \u6D88\u606F\u53D1\u9001\u6210\u529F\uFF0CgmtModified:",ne),v(ne)}}else{const ue=Fe.length>0?Fe.map(ne=>({businessType:ne.businessType,nodeStatus:ne.nodeStatus,content:ne.content,respTime:ne.respTime,chainRespTime:ne.respTime})):void 0;p({content:b.content||"",status:M,respTime:N,filePaths:I,reference:T||G||"",knowledgeBases:g||"",webReference:w||"",graphReference:R,databaseReference:U,faqReference:A,llmType:Z,resultType:k,queryId:_.queryId,tokens:_.tokens,chain:ue,thoughtChainNodes:Fe.length>0?[...Fe]:void 0,enableCot:rt,chainRespTime:nt})}},onerror:n,onclose:()=>{S0===a.sessionId&&(S0=null,F0=null)}})},addEmptyMessage:({queryId:a,content:v,filePaths:f,currentFiles:x})=>{e(F=>{const _=new Date().toISOString(),b=a||k0(32),k={istype:"user",content:v,time:_,queryId:b,clientSideId:b+"-user",filePaths:f||"",currentFiles:x||[]},N={istype:"ai",content:"",time:new Date(Date.now()+1).toISOString(),streaming:!0,status:0,queryId:b,clientSideId:b+"-ai"},T=F.find(w=>w.id===h);return T?T.messages.push(k,N):console.warn("addEmptyMessage called without an active session."),[...F]})},setLastEmptyMessage:({now:a})=>{e(v=>{if(!v[0])return v;const f=v[0],x=f.messages||[];if(!x.length)return v;const F=x.length-1;if(F<0)return v;const _=x[F];if(_.istype!=="ai")return v;const b=x.slice();return b[F]={..._,istype:"ai",content:"",time:a,streaming:!0,status:0},[{...f,messages:b},...v.slice(1)]})},stopStream:async()=>{if(F0)try{await l0.delete(`${r}/qa/ai/abortStream?queryId=${F0}`,{headers:{Authorization:u||"","X-CSRF-TOKEN-IN":t||""}}),console.log("[AichatUseController] \u5DF2\u8C03\u7528\u540E\u7AEF\u63A5\u53E3\u505C\u6B62\u6D41\u5F0F\u8BF7\u6C42",F0)}catch(a){console.error("[AichatUseController] \u8C03\u7528\u505C\u6B62\u63A5\u53E3\u5931\u8D25",a)}else console.warn("[AichatUseController] \u505C\u6B62\u6D41\u5F0F\u8BF7\u6C42\u65F6\u672A\u627E\u5230 queryId");D0=null,S0=null,F0=null,c(a=>({...a,display:"ready",sender:"ready"}))},cancelStreamBySessionId:async a=>{if(D0&&S0===a){if(console.log("[AichatUseController] \u5207\u6362\u4F1A\u8BDD\uFF0C\u53D6\u6D88\u6B63\u5728\u8FDB\u884C\u7684\u6D41\u5F0F\u8BF7\u6C42",a),F0)try{await l0.delete(`${r}/qa/ai/abortStream?queryId=${F0}`,{headers:{Authorization:u||"","X-CSRF-TOKEN-IN":t||""}}),console.log("[AichatUseController] \u5207\u6362\u4F1A\u8BDD\u65F6\u5DF2\u8C03\u7528\u540E\u7AEF\u63A5\u53E3\u505C\u6B62\u6D41\u5F0F\u8BF7\u6C42",F0)}catch(v){console.error("[AichatUseController] \u5207\u6362\u4F1A\u8BDD\u65F6\u8C03\u7528\u505C\u6B62\u63A5\u53E3\u5931\u8D25",v)}else console.warn("[AichatUseController] \u5207\u6362\u4F1A\u8BDD\u65F6\u672A\u627E\u5230 queryId");return D0=null,S0=null,F0=null,c(v=>({...v,display:"ready",sender:"ready"})),!0}return!1}}},Uo=1e3,Ho=3e3;function $o({url:r,token:u,CSRFToken:t,onError:e,activeSessionId:h}){const[c,d]=oe([]),[s,p]=oe(()=>({uploadedFiles:[]})),n=Ge(!1),o=async i=>{var a,v;if(!i)return null;try{const f=await l0.get(`${r}/index/knowledgeBase/file/getFilesBysessionId?sessionId=${i}`,{headers:{Authorization:u}});console.log("[DEBUG] \u83B7\u53D6\u4E34\u65F6\u6587\u4EF6\u5217\u8868 res:",(a=f==null?void 0:f.data)==null?void 0:a.data),p({uploadedFiles:((v=f==null?void 0:f.data)==null?void 0:v.data)||[]})}catch(f){throw console.error("\u83B7\u53D6\u4E34\u65F6\u6587\u4EF6\u5217\u8868\u5931\u8D25:",f),f}},E=Et((i,a)=>{const v=i.join(",");let f=0,x=null;x=()=>{n.current=!0};const F=async()=>{if(!n.current){if(f>=Uo){n.current||a.onFail("\u6587\u4EF6\u89E3\u6790\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");return}f++;try{const _=await l0.get(`${r}/index/knowledgeBase/file/getFileStatusByUids?uids=${v}`,{headers:{Authorization:u}});if(n.current)return;if(_.data.success){const b=_.data.data;n.current||a.onStatusUpdate(b),b.every(N=>{const T=N.fileParseStatus??N.status;return T===3||T===4})?n.current||a.onComplete():n.current||setTimeout(F,Ho)}else n.current||a.onFail(_.data.errorMsg||"\u67E5\u8BE2\u6587\u4EF6\u72B6\u6001\u5931\u8D25")}catch(_){if(e==null||e(_),n.current)return;a.onFail("\u67E5\u8BE2\u6587\u4EF6\u72B6\u6001\u65F6\u53D1\u751F\u7F51\u7EDC\u9519\u8BEF")}}};return F(),x},[r,u,e]),l=Et(async(i,a)=>{if(!i){console.warn("[DEBUG] \u7F3A\u5C11uid\uFF0C\u65E0\u6CD5\u5220\u9664\u4E34\u65F6\u6587\u4EF6");return}Ja({url:r,token:u,CSRFToken:t},{uid:i,queryId:a},(v,f)=>{v?(Re.success("\u6587\u4EF6\u5DF2\u4ECE\u4E34\u65F6\u77E5\u8BC6\u5E93\u79FB\u9664"),o(h)):(console.log("[DEBUG] removeFilefromTempUpload \u56DE\u8C03 false\uFF0Cres:",f),Re.error("\u6587\u4EF6\u79FB\u9664\u5931\u8D25"))})},[r,u,t,h]),m=Et(()=>{n.current=!1},[]),y=Et(()=>{n.current=!0},[]);return{fileManagerData:s,fileStatuses:c,setFileManagerData:p,setFileStatuses:d,pollFileStatus:E,handleRemoveFromTemp:l,resetStopFlag:m,setStopFlag:y,stoppedRef:n,getTempFileList:o}}function Wo({title:r,subtitle:u}){const[t,e]=oe(0);return _e(()=>{let h;return t<98?h=setTimeout(()=>{e(c=>c+Math.random()*6+1)},80):t<100&&(h=setTimeout(()=>e(100),400)),()=>clearTimeout(h)},[t]),Y("div",{className:"flex flex-col justify-center items-center min-h-screen bg-gradient-to-br from-[#EEF4FF] via-white to-[#F5F8FF]",children:[Y("div",{className:"mb-8 flex flex-col items-center",children:[S("div",{className:"mt-6 text-2xl font-semibold text-[#222222] tracking-wide",children:r||"\u5C0F\u9CB8\u667A\u80FD\u4F1A\u8BDD\u52A9\u624B"}),S("div",{className:"mt-2 text-sm text-[#555555]",children:u||"\u8BA9\u667A\u80FD\u5BF9\u8BDD\u66F4\u7B80\u5355"})]}),Y("div",{className:"relative w-80 max-w-sm",children:[S("div",{className:"w-full h-2 bg-[#EEF4FF] rounded-full overflow-hidden shadow-inner",children:S("div",{className:"h-full bg-gradient-to-r from-[#2B69FF] to-[#8F91FF] transition-all duration-300 ease-out",style:{width:`${Math.min(t,100)}%`}})}),Y("div",{className:"absolute -right-2 top-5 text-sm text-[#555555]",children:[Math.min(Math.round(t),100),"%"]})]}),Y("div",{className:"mt-8 flex flex-col items-center gap-2",children:[S("div",{className:"text-sm text-[#555555] animate-pulse",children:"\u6B63\u5728\u521D\u59CB\u5316\u5E94\u7528"}),S("div",{className:"text-xs text-[#888888]",children:"\u9996\u6B21\u52A0\u8F7D\u53EF\u80FD\u9700\u8981\u4E00\u4E9B\u65F6\u95F4\uFF0C\u8BF7\u8010\u5FC3\u7B49\u5F85"})]})]})}const Ia=document.createElement("style");Ia.textContent=`
176
+ .animate-bounce-slow {
177
+ animation: bounce 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
178
+ }
179
+ @keyframes bounce {
180
+ 0%, 100% { transform: translateY(0); }
181
+ 50% { transform: translateY(-12px); }
182
+ }
183
+ `;document.head.appendChild(Ia);function jo(){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:[S("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),S("div",{className:"flex-1",children:S(Bt,{active:!0,paragraph:{rows:1}})})]}),Y("div",{className:"flex items-start gap-4",children:[S("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),S("div",{className:"flex-1",children:S(Bt,{active:!0,paragraph:{rows:3}})})]}),Y("div",{className:"flex items-start gap-4",children:[S("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),S("div",{className:"flex-1",children:S(Bt,{active:!0,paragraph:{rows:1}})})]}),Y("div",{className:"flex items-start gap-4",children:[S("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),S("div",{className:"flex-1",children:S(Bt,{active:!0,paragraph:{rows:2}})})]})]})}function Vo({msg:r,subMsg:u}){return Y("div",{className:"flex flex-col items-center justify-center h-full p-8 text-center bg-white/80 backdrop-blur-sm",children:[S("div",{className:"mb-6 animate-bounce",children:S(zi,{size:64,className:"text-[#d70016]"})}),S("h2",{className:"text-[20px] font-medium text-[#222222] mb-3",children:r||"\u5E94\u7528\u521D\u59CB\u5316\u5931\u8D25"}),S("p",{className:"text-[14px] text-[#555555] mb-8 max-w-[400px]",children:u||"\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"}),S(st,{type:"primary",icon:S(fa,{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 Ko(){return Y("div",{className:"flex flex-col items-center justify-center h-full p-8 text-center bg-transparent! backdrop-blur-sm",children:[S("div",{className:"mb-6 animate-bounce",children:S(Di,{size:64,className:"text-[#d70016]"})}),S("h2",{className:"text-[20px] font-medium text-[#222222] mb-3",children:"\u62B1\u6B49\uFF0C\u9047\u5230\u4E86\u4E00\u4E9B\u95EE\u9898"}),S("p",{className:"text-[14px] text-[#555555] mb-8 max-w-[400px]",children:"\u8BF7\u6C42\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"}),S(st,{type:"primary",icon:S(fa,{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 Go=({isModalOpen:r,handleOk:u,handleCancel:t,data:e})=>{const h={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}},[c]=ra();return _e(()=>{if(!r){c.resetFields();return}c.setFieldValue("new_name",e==null?void 0:e.label)},[e,r]),S(dr,{modal:{styles:h},children:S(ca,{title:S("div",{className:"text-[16px]",children:"\u7F16\u8F91\u4F1A\u8BDD\u540D\u79F0"}),closeIcon:null,open:r,width:520,centered:!0,className:"[&:[.ant-modal-content]]:bg-red",footer:Y("div",{className:"mt-[16px] flex justify-end",children:[S(st,{children:"\u53D6\u6D88",onClick:t,className:"mr-[8px]"}),S(st,{children:"\u786E\u8BA4",onClick:async()=>{try{const d=await c.validateFields();u("ok_rename",d)}catch(d){console.log(d);return}},type:"primary",className:"border-none"})]}),children:S(Qr,{form:c,children:S(Qr.Item,{name:"new_name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165"},{max:100,message:"\u6700\u5927\u5B57\u6570\u9650\u5236100"}],children:S(ta,{})})})})})},Xo=({isModalOpen:r,handleOk:u,handleCancel:t,data:e})=>{const h={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}},[c]=ra();return _e(()=>{if(!r){c.resetFields();return}c.setFieldValue("new_name",e==null?void 0:e.label)},[e,r]),S(dr,{modal:{styles:h},children:S(ca,{title:S("div",{className:"text-[16px]",children:"\u5220\u9664\u4F1A\u8BDD"}),closeIcon:null,open:r,width:520,centered:!0,className:"[&:[.ant-modal-content]]:bg-red",footer:Y("div",{className:"mt-[16px] flex justify-end",children:[S(st,{children:"\u53D6\u6D88",onClick:t,className:"mr-[8px]"}),S(st,{children:"\u786E\u8BA4",onClick:async()=>{try{const d=await c.validateFields();u("ok_remove",d)}catch(d){console.log(d);return}},type:"primary",className:"border-none"})]}),children:S("div",{children:`\u786E\u5B9A\u8981\u5220\u9664\u4F1A\u8BDD\u300C${e.label}\u300D\u5417\uFF1F\u5220\u9664\u540E\u65E0\u6CD5\u6062\u590D\u3002`})})})},Qo="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFQSURBVHgBpVMxTsNQDLWTiIYBFG7Q3iCcgLIxQJWxZSpbOxFO0HICOhE2shGxEFCGbvQGcAPCCahgIJHoN/5RaEOUBAJPsmTZ3/aT/T4Co23ZxoYeWVACEjj/UOhx6l2E+RzudQfNNcR79ptQjfD1vbE98yfzbFDTEE1ZrBC1/IIJEhYPEYhPKUs3m1OQyJBOWfFPOQX+CQ1qQu6sATBaCLwNrh2/NgOdjQC2FBVu5PW+MTjoDvrccSdfJNILqQCzdB9WpzckudQlg87hYISIl7I7G2YNAZ75SrtFy1wxIBwLwtPAc8ZQA5qq676II5MAw8A7n+z3hpLW2d2V0/pVA99NlGV/BRJdIDbltqcV91++zwesvm2IOH6AEmkTkfsW6Seb6/EL+0dY9EhKl1mYi1Slq3HCQFCP2WHWZJY2qEL6L5LPJ/gy8BfIJmxt6X8C+32HILvaN+0AAAAASUVORK5CYII=",xr=({title:r,setOpen:u})=>Y("div",{style:{width:"100%",height:"60px",borderBottom:"1px solid #EBEBEB",padding:"20px",display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"16px",fontWeight:600},children:[S("div",{children:r}),S("img",{src:ei,style:{width:"16px",height:"16px",cursor:"pointer"},onClick:()=>u(!1)})]});ti();const Yo=({curFileInfo:r,onClose:u,token:t})=>{var s;const e={title:"",subtitle:"",backgroundColor:"#f8f9fa",showGrid:!1,showLegend:!1,showTooltip:!1,showFullscreen:!1,showMinimap:!1},[h,c]=oe({nodeList:[],edgeList:[]});_e(()=>{console.log("curFileInfo",r)},[r]);const d=async p=>{if(!(!(p!=null&&p.id)||!(p!=null&&p.cyphers)||!(p!=null&&p.fetchUrl)))try{const{cyphers:n,fetchUrl:o,id:E}=p||{};console.log("getGraphData params",n,o,E);const l=await l0.post(o,{cyphers:n,ontologyId:E},{headers:{Authorization:t}});console.log("getGraphData res",l),c((l==null?void 0:l.data)||{})}catch(n){console.log("error",n)}};return _e(()=>{d(r)},[r]),Y("div",{children:[S(xr,{title:r==null?void 0:r.graphName,setOpen:u}),S("div",{style:{width:"100%",height:"calc(100vh - 60px)"},children:S(ri,{centerNode:{vid:(s=r==null?void 0:r.traceNode)==null?void 0:s.vid},data:h,layout:{type:"force",linkDistance:190},title:e.title,subtitle:e.subtitle,backgroundColor:e.backgroundColor,showGrid:e.showGrid,showLegend:e.showLegend,showTooltip:e.showTooltip,showFullscreen:e.showFullscreen,showMinimap:e.showMinimap,customPlugins:{},onReady:p=>{console.log("KnowledgeGraphPreview ready:",p)}})})]})},Zo=({content:r,onClose:u,token:t})=>{const e=d=>{if(!(d!=null&&d.metadata))return;const s=Sr(d,""),{page_number:p,page_size:n,position:o,offset:E,chunk_type:l}=d.metadata;if(s==="markdown_table")return E!=null&&E.length?{annotations:[{id:k0(),offsets:E}],initialPage:1}:{};{if(!n||!o)return console.log("%c\u7F3A\u5C11\u6587\u4EF6size\u6216\u8005\u6587\u4EF6\u5750\u6807","color: red"),{};const m=Array.isArray(n)?n:JSON.parse(n);if(!m.length)return console.log("%c\u7F3A\u5C11\u6587\u4EF6size","color: red"),{};const y=Array.isArray(o)?o:JSON.parse(o);return!y.length||!p?(console.log("%c\u7F3A\u5C11\u6587\u4EF6\u5750\u6807\u6216\u8005\u6587\u4EF6\u9875\u6570","color: red"),{}):{annotations:y.map((a,v)=>({id:k0(),pageNumber:p[v],x:+(a[0][0]/m[0][0]).toFixed(4),y:+(a[0][1]/m[0][1]).toFixed(4),width:+((a[1][0]-a[0][0])/m[0][0]).toFixed(4),height:+((a[2][1]-a[0][1])/m[0][1]).toFixed(4),content:"",color:l==="image"?"#60f74f":"#4FC3F7"})),initialPage:p[0]}}},h=De(()=>{var d,s;if(console.log("content88888888888",r),r&&t){console.log("content999",r);const{annotations:p,initialPage:n}=e(r),o={...r,metadata:{source:((d=r==null?void 0:r.metadata)==null?void 0:d.source)||r.parse_url||r.url,page_size:(s=r==null?void 0:r.metadata)==null?void 0:s.page_size}},E=na(aa(o));return{filePath:E,fileName:Lr(o),fileType:Sr(o,E),totalPages:o.pdfPages||0,token:t,annotations:p,initialPage:n,initialZoom:ia(598,o)}}else return{}},[r]),c=De(()=>h.filePath?(console.log("curData",h),S(la,{initialZoom:h.initialZoom||100,convertedFilePath:h.filePath,fileName:h.fileName,fileType:h.fileType,initialPage:h.initialPage,totalPages:h.totalPages,authorization:h.token,annotations:h.annotations,streamApiUrl:"/proxy/index/knowledgeBase/file/stream",eventsEmit:d=>{switch(d){case"viewer:close":u();break}},tools:{close:!0}})):S(ot,{}),[h]);return S("div",{style:{fontFamily:"Source Han Sans CN",fontSize:"12px"},className:"h-full w-full",children:c})},Ra=({curFileInfo:r,onClose:u,token:t})=>{const e=De(()=>{var c,d,s;if(r&&t){console.log("content999",r);const p={file_source:r.parse_url||r.parsedFilePath||r.url,file_type:r.file_type,metadata:{source:r.filePath||r.url||((c=r==null?void 0:r.metadata)==null?void 0:c.source)||"",page_size:(d=r==null?void 0:r.metadata)==null?void 0:d.page_size},pdfPages:r.pdfPages},n=na(aa(p));return{filePath:n,fileName:Lr(p),fileType:Sr(p,n),totalPages:p.pdfPages||0,token:t,initialZoom:ia(((s=document.getElementById("pdfBox"))==null?void 0:s.clientWidth)||0,p)}}else return{}},[r]),h=De(()=>(console.log("curData",e),e.filePath?S(la,{initialZoom:e.initialZoom||100,convertedFilePath:e.filePath,fileName:e.fileName,fileType:e.fileType,initialPage:1,totalPages:e.totalPages,authorization:e.token,streamApiUrl:"/proxy/index/knowledgeBase/file/stream",eventsEmit:c=>{switch(c){case"viewer:close":u();break}},tools:{close:!0}}):S(ot,{})),[e]);return S("div",{id:"pdfBox",className:"h-full overflow-y-auto",children:h})},Jo=({curFileInfo:r,token:u,onClose:t})=>{const[e,h]=oe(1),[c,d]=oe(10),[s,p]=oe([]),[n,o]=oe([]),[E,l]=oe(0);_e(()=>{var v;const a=((v=r==null?void 0:r.metadata)==null?void 0:v.fetchUrl)||(r==null?void 0:r.fetchUrl);a&&y(a)},[r,e,c]);const m=async({url:a,params:v})=>{var f;try{const x=await l0.get(`${kr()}${a}?${new URLSearchParams(v).toString()}`,{headers:{Authorization:u}}),F=(f=x==null?void 0:x.data)==null?void 0:f.data;if(F){const{columns:_,dataList:b,totalData:k}=F;p(((_==null?void 0:_.slice(1))||[]).map(N=>({title:N.businessName,dataIndex:N.physicalName,key:N.physicalName}))),o(b||[]),l(k||[])}}catch(x){console.log("error",x)}},y=async a=>{m({url:`${a}`,params:{pageNo:e,pageSize:c}})},i=De(()=>{const{databaseName:a,businessTableName:v,tableName:f}=r;return`${a} - ${f||v}`},[r]);return Y("div",{children:[S(xr,{title:i,setOpen:t}),(s==null?void 0:s.length)>0?Y("div",{children:[S("div",{className:"p-4 overflow-auto h-[calc(100vh-120px)]",children:S(Ai,{columns:s,dataSource:n,pagination:!1,scroll:{x:"max-content"},rowKey:"id"})}),S("div",{className:"flex justify-end px-[18px]",children:S(Ni,{current:e,pageSize:c,responsive:!0,simple:!0,total:E,showSizeChanger:!0,showQuickJumper:!0,onChange:(a,v)=>{h(a),d(v||10)},onShowSizeChange:(a,v)=>{h(1),d(v)}})})]}):S(Qa,{})]})},wr=({i:r,item:u,j:t,clickTag:e})=>(console.log("j in tag",t),console.log("i in tag",r),console.log("item in tag",u),S("div",{style:{minWidth:"16px",height:"16px",backgroundColor:ts[u.key],margin:"0 4px",color:rs[u.key],display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"2px",fontSize:"12px",cursor:"pointer"},onClick:()=>e&&e(r,t,u),children:t.index},t.id));function es(r){if(typeof r=="string"){const u=r.trim();if(!u)return"";const t=u.match(/\d{4}-\d{2}-\d{2}/);if(t!=null&&t[0])return t[0];const e=new Date(u);return Number.isNaN(e.getTime())?"":e.toISOString().slice(0,10)}if(r instanceof Date&&!Number.isNaN(r.getTime()))return r.toISOString().slice(0,10);if(typeof r=="number"&&Number.isFinite(r)){const u=new Date(r);if(!Number.isNaN(u.getTime()))return u.toISOString().slice(0,10)}return""}const ts={knowledgeList:"#EAF4FD",searchList:"#E8F7F0",databaseList:"#FFF4E5",graphList:"#E7F8FB"},rs={knowledgeList:"#2072F0",searchList:"#39B83F",databaseList:"#F48C14",graphList:"#10BBD9"},hn=[{key:"knowledgeList",name:"\u77E5\u8BC6\u5E93\u6587\u6863"},{key:"searchList",name:"\u8054\u7F51\u641C\u7D22",hideBtns:!0},{key:"databaseList",name:"\u6570\u636E\u5E93",hideBtns:!0},{key:"graphList",name:"\u77E5\u8BC6\u56FE\u8C31",hideBtns:!0}],vn=({type:r,data:u,token:t,eventsEmit:e,is_download:h})=>{const[c,d]=oe(hn),[s,p]=oe("mark"),[n,o]=oe(!1),[E,l]=oe({}),[m,y]=oe("knowledgeList"),[i,a]=oe(null),[v,f]=oe({knowledgeList:[],searchList:[],databaseList:[],graphList:[]}),x=De(()=>{const A=4-c.length,D=Array(A).fill(null).map((q,M)=>({name:"",key:100+M})),g=[...c,...D];return console.log("rrrrrr",g),g},[c]),F=A=>{const D=typeof A=="number"?A:Number(String(A).trim());return Number.isFinite(D)?(Math.trunc(D*100)/100).toFixed(2):""},_=A=>{switch(A){case"searchList":return li;case"databaseList":return ci;case"graphList":return ui;default:return""}},b=A=>{const D=(A||"").toLowerCase();return["pdf"].includes(D)?"rag/pdf":["doc","docx"].includes(D)?"rag/word":["csv"].includes(D)?"rag/csv":["xls","xlsx"].includes(D)?"rag/excel":["ppt","pptx","pub"].includes(D)?"rag/ppt":["png","jpg","jpeg","jpge"].includes(D)?"rag/pic":["txt"].includes(D)?"rag/txt":["ofd"].includes(D)?"rag/ofd":["mp4","flv","avi","mkv","video"].includes(D)?"rag/video":"rag/txt"},k=(A,D)=>{if(A==="knowledgeList"){let q=((D==null?void 0:D.file_type)||"").toLowerCase();if(!q||q==="faq"){const M=(D==null?void 0:D.metadata)||{},G=M.folder_path||(D==null?void 0:D.folder_path)||M.file_path||M.source||(D==null?void 0:D.source)||(D==null?void 0:D.file_name)||"",Z=String(G).match(/\.([a-z0-9]+)$/i);Z&&(q=Z[1].toLowerCase())}return S(sa,{type:b(q),size:22,style:{flexShrink:0}})}const g=_(A);return g?S("img",{src:g,style:{width:"22px",height:"22px",flexShrink:0}}):null},N=A=>{if(String((A==null?void 0:A.file_type)||"").toLowerCase()==="video")return!0;const g=String((A==null?void 0:A.file_name)||(A==null?void 0:A.name)||""),q=g.includes(".")?g.split(".").pop():"";return["mp4","flv","avi","mkv"].includes(String(q).toLowerCase())},T=(A,D)=>A==="graphList"?D:A==="knowledgeList"?(console.log("++++++",D),D.map(g=>{const q=g.metadata||{},M=g.score;if(g.type==="faq"){const Z=q.folder_path||g.folder_path||q.knowledge_base_name||g.file_name||q.source||g.source||"",U=String(Z).match(/\.([a-z0-9]+)$/i),$=U?U[1].toLowerCase():"faq";return{...g,file_type:$,name:Z,score:M}}const G=g.sourceFileName||ii(g.source)||g.file_name;return{...g,file_type:oi(g.source)||g.file_type,name:G,score:M}}).sort((g,q)=>(q.score||0)-(g.score||0))):A==="searchList"?D.map(g=>({...g,name:g.sourceFileName||g.file_name})).sort((g,q)=>(q.score||0)-(g.score||0)):A==="databaseList"?D.map(g=>{const q=g.tableName?`${g.databaseName||"\u6570\u636E\u5E93"} - ${g.tableName}`:g.databaseName||g.name||"\u6570\u636E\u5E93";return{...g,name:q,file_name:q,file_type:"database"}}).sort((g,q)=>(q.score||0)-(g.score||0)):D,w=(A,D,g)=>{var q,M;switch(g.key){case"knowledgeList":const{pdfPages:G,parsedFilePath:Z,order_num:U,tags:$}=A||{},Q=D.id||U||"Unknown ID",z=($||[]).find(j=>j.id===Q);if(A.type==="faq"){l(A),p("faq"),o(!0),e==null||e("retrive_tag:click",{tagInfo:{id:D.id,index:D.index,image_urls:D.image_urls||[]},fromtype:"10",leaf:{id:D.id,fromtype:"10"},referenceDoc:A});return}if(A.type==="video")return console.log("sdgasdgag",{file:{...A,...z}}),e==null?void 0:e("retrive_tag:click",{file:{...A,...z}});if(console.log("click knowledge tag",A,D),!A||!z)return;const{metadata:P}=z,I=P.source.split("/"),R=I[I.length-1]||"",H=R.split("."),V=H.slice(0,-1).join(".")||"Unknown Label",X=H[H.length-1]||"Unknown Type";l({id:Q,title:V,file_name:R,file_type:X,file_source:si(X)?`${cr}${P.source}`:Z,metadata:P,pdfPages:G}),p("mark"),o(!0);break;case"searchList":console.log("click search tag",A,D);break;case"databaseList":console.log("click database tag",A,D),p("database"),l({...A,metadata:A.metadata||{},fetchUrl:A.fetchUrl||((q=A.metadata)==null?void 0:q.fetchUrl)||""}),o(!0);break;case"graphList":console.log("click graph tag",A,D),p("graphPreview"),l({...D,traceNode:(M=(D==null?void 0:D.traceNodes)||[])==null?void 0:M[0]}),o(!0);break}};return _e(()=>{if(r!==Na.REFERENCELIST||(console.log("data in reference drawer",u),!u))return;const{graphRefs:A,knowledgeRefs:D,webRefs:g,databaseRefs:q}=u;A!=null&&A.length&&(v.graphList=T("graphList",A)),D!=null&&D.length&&(v.knowledgeList=T("knowledgeList",D)),g!=null&&g.length&&(v.searchList=T("searchList",g)),q!=null&&q.length&&(v.databaseList=T("databaseList",q));const M=hn.filter(G=>{var Z;return(Z=v[G.key])==null?void 0:Z.length}).sort((G,Z)=>{var U,$;return(((U=v[Z.key])==null?void 0:U.length)||0)-((($=v[G.key])==null?void 0:$.length)||0)});d(M),M!=null&&M.length&&y(M[0].key),f({...v})},[u]),Y(ot,{children:[Y("div",{className:"listWrap w-full h-full",children:[S(xr,{title:"\u77E5\u8BC6\u6EAF\u6E90",setOpen:()=>{const A=new CustomEvent("aichat:right_set",{detail:{collapsed:!0}});window.dispatchEvent(A)}}),Y("div",{style:{height:"calc(100% - 60px)"},children:[S("div",{className:"tabs",style:{display:"flex",justifyContent:"space-between",padding:"12px 20px"},children:x.map(A=>S("div",{className:"tab-item",style:{padding:"5.5px 12px",backgroundColor:A.name?m===A.key?"#4E6EF2":"#F5F6F9":"transparent",cursor:"pointer",borderRadius:"4px",color:m===A.key?"#FFFFFF":"#4E5969",fontSize:"14px",minWidth:"80px",display:"flex",justifyContent:"center"},onClick:()=>{A.name&&y(A.key)},children:A.name},A.key))}),S("div",{className:"listBox",style:{height:"calc(100% - 66px)",overflowY:"auto",display:"flex",flexDirection:"column",alignItems:"center",willChange:"scroll-position",transform:"translateZ(0)"},children:c.map(A=>{let D=v[A.key]||[];return m!==A.key?null:S("div",{children:D.map(g=>{var q,M,G,Z,U,$,Q,z,P;return Y("div",{style:{width:"360px",padding:"4px 8px",borderRadius:"4px",margin:"6px 0",cursor:A.key==="knowledgeList"&&g.type==="faq"?"default":"pointer"},className:"listItemBox",onClick:()=>{A.key==="searchList"&&window.open(g.link,"_blank")},children:[Y("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"8px"},children:[Y("div",{style:{flex:1,minWidth:0,fontSize:"14px",color:"#1D2129",fontWeight:"700",display:"flex",alignItems:"center"},children:[S("div",{style:{width:22,height:22,marginRight:2,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"},children:k(A.key,g)}),S(pt,{placement:"topLeft",title:((q=g==null?void 0:g.name)==null?void 0:q.length)>17?g.name:"",children:S("div",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",lineHeight:1.4,wordBreak:"break-all"},onClick:()=>{var I;A.key==="knowledgeList"&&g.type==="faq"||(A.key==="knowledgeList"?e==null||e("knowledge_referenceFile_title:click",{data:{...g,file_type:g.file_type,file_name:g.file_name,metadata:g.metadata,parsedFilePath:g.parsedFilePath}}):A.key==="databaseList"&&(p("database"),l({...g,metadata:g.metadata||{},fetchUrl:g.fetchUrl||((I=g.metadata)==null?void 0:I.fetchUrl)||""}),o(!0)))},children:g.name})})]}),!!((M=g==null?void 0:g.tags)!=null&&M.length&&g.tags.length>0&&g.tags.length<=10&&g.type!=="faq")&&S("div",{style:{display:"flex",alignItems:"center",flexShrink:0,gap:"2px"},children:(g.tags||[]).map(I=>S(wr,{i:g,item:A,j:I,clickTag:w},I.id))}),Y("div",{style:{width:"52px",justifyContent:N(g)?"flex-end":"space-between",alignItems:"center",marginRight:"8px",display:A.hideBtns||g.type==="faq"||g.faq_question||g.faq_answer?"none":"flex"},children:[!N(g)&&Y(ot,{children:[S("img",{src:Qo,style:{width:"16px",height:"16px",cursor:"pointer"},onClick:()=>{e==null||e("referenceFile_filechat",{data:{...g,file_type:g.file_type,file_name:g.file_name,metadata:g.metadata,parsedFilePath:g.parsedFilePath}})}}),S("div",{style:{borderRight:"1px solid #E5E6EB",height:"14px"}})]}),S("img",{src:ni,style:{width:"16px",height:"16px",cursor:h?i?"wait":"pointer":"not-allowed",opacity:i?.7:1},onClick:async()=>{var j;if(!h||i)return;const I=((j=((g==null?void 0:g.tags)||[])[0])==null?void 0:j.metadata)||(g==null?void 0:g.metadata)||{},R=(g==null?void 0:g.path)||(I==null?void 0:I.source)||(g==null?void 0:g.source)||(g==null?void 0:g.convertedFilePath)||(g==null?void 0:g.file_source)||(g==null?void 0:g.parsedFilePath)||(g==null?void 0:g.url)||(g==null?void 0:g.filePath)||"",H=Lr({metadata:I,file_name:g==null?void 0:g.file_name})||String(R).split("/").pop()||(g==null?void 0:g.file_name)||"file";if(g.type!=="video"){e==null||e("referenceFile_download",{data:g,filePath:R,fileName:H});return}if(!R)return;const V=String(R).includes("http")?String(R):`${cr}${R}`,X=`reference-download-${H}`;a(X),Re.loading({key:X,content:`\u6B63\u5728\u51C6\u5907\u4E0B\u8F7D\uFF1A${H}`,duration:0});try{await ai({filePath:V,fileName:H,token:t}),Re.success({key:X,content:`\u4E0B\u8F7D\u5DF2\u5F00\u59CB\uFF1A${H}`})}catch{Re.error({key:X,content:`\u4E0B\u8F7D\u5931\u8D25\uFF1A${H}`})}finally{a(null)}}})]})]}),A.key==="knowledgeList"&&g.type==="faq"&&(((G=g.metadata)==null?void 0:G.update_time)||g.score!==void 0||((Z=g==null?void 0:g.tags)==null?void 0:Z.length)&&g.tags.length>0)&&Y("div",{style:{marginTop:"4px",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",fontSize:"12px",color:"#4E5969"},children:[Y("span",{style:{flexShrink:0,display:"flex",alignItems:"center",gap:8},children:[g.score!==void 0&&Y("span",{children:["\u5206\u6570: ",F(g.score)]}),((U=g.metadata)==null?void 0:U.update_time)&&S("span",{children:es(g.metadata.update_time)})]}),(($=g==null?void 0:g.tags)==null?void 0:$.length)&&g.tags.length>0&&g.tags.length<=10&&S("span",{style:{display:"flex",alignItems:"center",flexShrink:0,gap:"2px"},children:(g.tags||[]).map(I=>S(wr,{i:g,item:A,j:I,clickTag:g.type==="faq"?void 0:w},I.id))})]}),g.score!==void 0&&!(g.type==="faq"||g.faq_question||g.faq_answer)&&S("div",{style:{display:"flex",alignItems:"center",height:"18px",marginTop:"4px"},children:Y("div",{style:{backgroundColor:"#F2F2FB",borderRadius:"4px",padding:"2px 3px",display:"flex",justifyContent:"center",alignItems:"center",fontSize:"12px"},children:[S("span",{style:{color:"#4E5969",marginRight:"6px"},children:"\u5206\u6570:"}),S("span",{style:{color:"#1D2129"},children:F(g.score)})]})}),S("div",{style:{flex:1,display:"flex",justifyContent:"flex-start",marginTop:"4px"},children:((Q=g==null?void 0:g.tags)!=null&&Q.length&&g.tags.length>10?g.tags:[]).map(I=>S(wr,{i:g,item:A,j:I,clickTag:g.type==="faq"?void 0:w},I.id))}),g.type==="faq"&&(g.faq_question||g.faq_answer)&&Y("div",{style:{marginTop:"8px",padding:"8px 10px",background:"#EAF4FD",borderRadius:"4px",fontSize:"12px",color:"#1D2129",lineHeight:1.5},children:[g.faq_question!=null&&String(g.faq_question).trim()!==""&&Y("div",{style:{marginBottom:"4px",display:"flex"},children:[S("span",{style:{color:"#4E5969",flexShrink:0},children:"Q: "}),S("span",{style:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},children:String(g.faq_question).trim()})]}),g.faq_answer!=null&&String(g.faq_answer).trim()!==""&&Y("div",{style:{display:"flex"},children:[S("span",{style:{color:"#4E5969",flexShrink:0},children:"A: "}),S("span",{style:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},children:String(g.faq_answer).replace(/\s*--+[A-Za-z0-9]*\s*$/,"").trim()||String(g.faq_answer).trim()})]})]}),!!((z=g==null?void 0:g.main_source)!=null&&z.length)&&Y("div",{style:{flex:1,display:"flex",alignItems:"flex-start",marginTop:"4px"},children:[S("div",{style:{fontSize:"12px",color:"#4E5969",width:"60px"},children:"\u5173\u8054\u6587\u6863:"}),S(pt,{placement:"topLeft",title:((P=Cr(g.main_source[0]))==null?void 0:P.length)>22?Cr(g.main_source[0]):"",children:S("div",{style:{fontSize:"12px",color:"#4E5969",width:"289px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Cr(g.main_source[0])})})]})]},g.id)})},A.key)})})]})]}),S(dr,{drawer:{styles:{body:{padding:0},header:{display:"none"}}},children:Y(da,{autoFocus:!1,onClose:()=>o(!1),open:n,width:m==="graphList"?"100%":720,className:"overflow-x-hidden",destroyOnClose:!0,afterOpenChange:A=>{A||l(null)},children:[s==="graphPreview"&&S(Yo,{curFileInfo:E,onClose:o,token:t}),s==="mark"&&S(Zo,{content:E,onClose:o,token:t}),s==="preview"&&S(Ra,{curFileInfo:E,onClose:o,token:t}),s==="database"&&S(Jo,{curFileInfo:E,onClose:o,token:t}),s==="faq"&&E&&Y("div",{className:"p-4",style:{fontSize:"14px",color:"#1D2129",lineHeight:1.6},children:[E.faq_question!=null&&String(E.faq_question).trim()!==""&&Y("div",{style:{marginBottom:"12px"},children:[S("span",{style:{color:"#4E5969",marginRight:"4px"},children:"Q:"}),S("span",{children:String(E.faq_question).trim()})]}),E.faq_answer!=null&&String(E.faq_answer).trim()!==""&&Y("div",{children:[S("span",{style:{color:"#4E5969",marginRight:"4px"},children:"A:"}),S("span",{children:String(E.faq_answer).replace(/\s*--+[A-Za-z0-9]*\s*$/,"").trim()||String(E.faq_answer).trim()})]})]})]})})]})},ns=({fileData:r,token:u})=>{const[t,e]=oe([]);_e(()=>{var p;const d=r==null?void 0:r.knowledgeBases;if(!(d!=null&&d.length))return;const s=((p=d[0])==null?void 0:p.treeData)||[];s!=null&&s.length&&e(s)},[r]);const h=Ge(new Map),c=async(d,s)=>{var p,n;if(!h.current.get(d==null?void 0:d.fetchUrl))try{const o=t[s];o.loading=!0;const E=[...t];e(E);const l=await l0.get(`${di()}/${d.fetchUrl}`,{headers:{Authorization:u}}),m=(n=(p=l==null?void 0:l.data)==null?void 0:p.data)==null?void 0:n.records;if(m){const y=t[s];y.loading=!1,y.children=m;const i=[...t];i[s]=y,e(i),h.current.set(d==null?void 0:d.fetchUrl,!0)}else{const y=t[s];y.loading=!1;const i=[...t];e(i)}}catch{const E=t[s];E.loading=!1;const l=[...t];e(l)}};return Y(ot,{children:[S(xr,{title:"\u77E5\u8BC6\u5E93\u6587\u6863\u76EE\u5F55",setOpen:()=>{const d=new CustomEvent("aichat:right_set",{detail:{collapsed:!0}});window.dispatchEvent(d)}}),S("div",{style:{height:"calc(100% - 60px)",overflowY:"auto",padding:"16px"},children:t.map((d,s)=>{var p;return d.type==="file"?Y("div",{className:"flex",style:{marginTop:"8px"},children:[oa(d),S(pt,{placement:"top",title:((p=d.name)==null?void 0:p.length)>23?d.name:"",children:S("div",{style:{paddingLeft:"6px",width:"346px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"default",fontSize:"14px"},children:d.name})})]}):S(as,{item:d,index:s,clickFileItem:c},s)})})]})},as=({item:r,index:u,clickFileItem:t})=>{var c;const[e,h]=oe(!1);return Y("div",{style:{marginTop:"8px"},children:[Y("div",{className:"flex cursor-pointer",onClick:()=>{h(!e),!e&&t(r,u)},children:[oa(r),S(pt,{placement:"top",title:((c=r.name)==null?void 0:c.length)>23?r.name:"",children:Y("div",{style:{paddingLeft:"6px",width:"346px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"14px"},children:[r.name," (",r.fileCount||0,")"]})})]},u),S("div",{style:{padding:"2px 0 2px 14px",margin:"8px 0 0 7px",borderLeft:"2px solid #E5E6EB",display:e?"block":"none"},children:(r.children||[]).map((d,s)=>{var p;return Y("div",{className:"flex items-center",children:[S("div",{style:{width:"4px",height:"4px",borderRadius:"2px",background:"black"}}),S(pt,{placement:"top",title:((p=d.name)==null?void 0:p.length)>26?d.name:"",children:S("div",{style:{paddingLeft:"6px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"12px",width:"336px"},children:d.fileName})})]},s)})})]})};var Na=(r=>(r.REFERENCELIST="referencelist",r.ALLFILELIST="allFileList",r))(Na||{});function ju(r=fi){return function({token:t,url:e="http://localhost:8888",styles:h,CSRFToken:c,eventsEmit:d,scrollOld:s,locale:p="zh",messages:n,...o}){const E=De(()=>Ya({theme:qr,mode:"light"},h),[h]),[l,m]=oe(!1),[y,i]=oe(!1),[a,v]=oe(null),[f,x]=oe(!1),[F,_]=oe("mark"),[b,k]=oe({url:"",parse_url:"",file_type:"",file_name:""}),[N,T]=oe([]),[w,A]=oe(1),[D]=oe(16),[g,q]=oe(0),[M,G]=oe(!1),[Z,U]=oe([]),[$,Q]=oe(void 0),[z,P]=oe([]),[I,R]=oe([]),[H,V]=oe(void 0),[X,j]=oe({display:"ready",sender:"ready",app:"initializing"});function ue(B,C){if(!C)return B;const L=Array.isArray(B)?[...B]:{...B};for(const O in C)if(C[O]!==void 0&&C[O]!==null&&Object.prototype.hasOwnProperty.call(C,O))if(O==="actions"&&Array.isArray(B[O])&&Array.isArray(C[O])){const K=new Map;B[O].forEach(J=>{J.name&&K.set(J.name,J)}),C[O].forEach(J=>{J.name&&K.set(J.name,J)}),L[O]=Array.from(K.values())}else typeof B[O]=="object"&&B[O]!==null&&!Array.isArray(B[O])&&typeof C[O]=="object"&&C[O]!==null&&!Array.isArray(C[O])?L[O]=ue(B[O],C[O]):L[O]=C[O];return L}const ne=De(()=>xa(p),[p]),je=De(()=>{const B=ne;return{...et,switchs:(et.switchs??[]).map(L=>({...L,label:L.name==="netSearch"?B.sender.netSearch:B.sender.deepThinking})),actions:(et.actions??[]).map(L=>({...L,tip:L.name==="upload"?B.sender.fileUpload:L.tip}))}},[p,ne]),[we,se]=oe(()=>ue(je,o.senderConfig));_e(()=>{const B=ne,C={...et,switchs:(et.switchs??[]).map(L=>({...L,label:L.name==="netSearch"?B.sender.netSearch:B.sender.deepThinking})),actions:(et.actions??[]).map(L=>({...L,tip:L.name==="upload"?B.sender.fileUpload:L.tip}))};se(L=>{const O=ue(C,o.senderConfig);return Array.isArray(L.actions)&&Array.isArray(O.actions)&&(O.actions=O.actions.map((K,J)=>{var ee;const ae=(ee=L.actions)==null?void 0:ee[J];return ae&&ae.name===K.name&&ae.badgeCount!==void 0?{...K,badgeCount:ae.badgeCount}:K})),O})},[p,o.senderConfig,ne]);const{fileStatuses:Ee,setFileStatuses:Be,pollFileStatus:Le,handleRemoveFromTemp:a0,resetStopFlag:i0,setStopFlag:o0,stoppedRef:h0,getTempFileList:Oe,setFileManagerData:Te,fileManagerData:Ne}=$o({url:e,token:t,CSRFToken:c,activeSessionId:$}),[e0,m0]=Pe.useState(()=>{var C;if(!I||I.length===0)return;const B=I.find(L=>L.isDefault);return B?B.id:(C=I[0])==null?void 0:C.id});Pe.useEffect(()=>{if(!I||I.length===0)return;const B=I.some(C=>C.id===e0);if(!e0||!B){const C=I.find(L=>L.isDefault);m0(C?C.id:I[0].id)}},[I]);const[W,he]=oe({}),ke=Ge(void 0),t0=Ge(void 0),z0=Ge(void 0),Qe=Ge(null),me=Ge(void 0),q0=Ge([]),[G0,L0]=oe([]),[u0,O0]=oe({}),[M0,U0]=oe(!1),[X0,lt]=oe([]),[dt,Q0]=oe(!1),{api_startChat_re:d0,addEmptyMessage:v0,setLastEmptyMessage:B0,stopStream:A0,cancelStreamBySessionId:ft}=Mo({baseUrl:e,CSRFToken:c,token:t,setChatData:U,activeSessionId:$,setAppStatus:j,setConversationList:T}),Ue=De(()=>{const B={};return(I||[]).forEach(C=>{B[C.id]=C}),B},[I]),ie=De(()=>{const B=Z.find(L=>L.id===$)||{id:$,messages:[]},C=B.configId?Ue[B.configId]:null;return{...B,assistantInfo:C}},[Z,$,Ue]);_e(()=>{console.log("currentChatData",ie)},[ie]);const _0=De(()=>{if(ie.configId&&Ue){const B=Ue[ie.configId];return B!=null&&B.configJson?JSON.parse(B.configJson).is_download:!1}else return!1},[ie.configId,Ue]);De(()=>{if((ie.configId||H)&&Ue){const B=Ue[ie.configId];if(B!=null&&B.configJson){const C=JSON.parse(B.configJson);return console.log("is_enableThinking",ie.configId,Ue,H),!!C.thinking}else if(H){const C=Ue[H];if(C!=null&&C.configJson)return!!JSON.parse(C.configJson).thinking}}return!1},[ie.configId,Ue,H]),_e(()=>{if(ke.current&&ke.current!==$){const C=ke.current,L=N.find(J=>J.sessionId===C&&J.isNew),O=Z.find(J=>J.id===C&&J.isNew),K=O&&O.messages&&O.messages.length>0;L&&!K&&(T(J=>J.filter(ae=>ae.sessionId!==C)),U(J=>J.filter(ae=>ae.id!==C)))}ke.current=$;const B=ie.messages&&ie.messages.length>0?ie.messages[ie.messages.length-1].recommendQuestion:[];P(B)},[$,N,Z,ie.messages]);const He=async B=>{var C,L,O,K;if(!M){G(!0);try{const J=await l0.get(`${e}/qa/dialogue/list?pageNo=${B}&pageSize=${D}&sysType=INT_SESSION`,{headers:{Authorization:t}}),ae=((L=(C=J==null?void 0:J.data)==null?void 0:C.data)==null?void 0:L.records)||[],ee=((K=(O=J==null?void 0:J.data)==null?void 0:O.data)==null?void 0:K.total)||0;q(ee),T(be=>{const Ae=new Map;return[...be,...ae].forEach(Me=>{Ae.set(Me.sessionId,Me)}),Array.from(Ae.values())}),A(B)}catch{}finally{G(!1)}}};_e(()=>{j(B=>({...B,app:"initializing"})),l0.get(`${e}/qa/search/config/helper/list?pageNo=1&pageSize=3000`,{headers:{Authorization:t}}).then(B=>{R(B.data.data||[])}).catch(()=>{}),He(1).then(()=>{$||Z0(),j(B=>({...B,app:"ready"}))}).catch(()=>{j(B=>({...B,app:"error"}))})},[]),_e(()=>{$&&(j(B=>({...B,display:"loading"})),Oe($),l0.get(`${e}/qa/dialogue/getDialogBySessionId?sessionId=${$}`,{headers:{Authorization:t}}).then(B=>{var qe;if(!B.data.data){j(te=>({...te,display:"ready"}));return}const C=((qe=B.data.data)==null?void 0:qe.queryReplyPairList)||[],L=No(C),{sessionId:O,searchConfigDTO:K,filePath:J,configId:ae,reference:ee,webReference:be,uploadedFiles:Ae,fileList:Me,currentFiles:ze}=B.data.data;if(L.length>0){const te=L.length-1-[...L].reverse().findIndex(ve=>ve.istype==="ai");te>=0&&te<L.length&&L[te].istype==="ai"&&(ee&&(L[te].reference=ee),be&&(L[te].webReference=be))}const re=ze||Me||Ae;if(re&&L.length>0){const te=[...L].reverse().findIndex(ve=>ve.istype==="user");te!==-1&&(console.log(L[L.length-1-te].currentFiles,"filesData"),L[L.length-1-te].currentFiles=re)}N.find(te=>te.sessionId===O)&&T(te=>te.map(ve=>ve.sessionId===O?{...ve,searchConfigDTO:K,filePath:J,configId:ae}:ve));const xe={configId:B.data.data.configId,filePath:B.data.data.filePath,searchConfigDTO:B.data.data.searchConfigDTO||{},sessionId:B.data.data.sessionId,label:B.data.data.label,kbId:B.data.data.kbId};U(te=>{const ve=te.filter(Ze=>Ze.id!==$);return[{id:$,messages:L,...xe},...ve]}),j(te=>({...te,display:"ready"}))}).catch(B=>{console.error("\u83B7\u53D6\u804A\u5929\u6570\u636E\u5931\u8D25:",B),B.response&&B.response.status===404&&Z0(),j(C=>({...C,display:"error"}))}))},[$,e,t]),_e(()=>{const B=Ne.uploadedFiles.length;se(C=>{const L=Array.isArray(C.actions)?C.actions:[];return{...C,actions:L.map(K=>K.name==="history"?{...K,badgeCount:B}:K)}})},[Ne.uploadedFiles]),_e(()=>{xi({url:e,token:t},B=>{lt(B)})},[]),Pe.useEffect(()=>{Ee.length&&U(B=>{if(!B[0])return B;const{messages:C}=B[0];for(let L=C.length-1;L>=0;L--)if(C[L].istype==="user"){const O=C[L].currentFiles||[];C[L].currentFiles=Ee.map(K=>{var ae,ee,be;const J=O.find(Ae=>Ae.uid===K.uid);return{name:((ae=K.file)==null?void 0:ae.name)||K.name,size:((ee=K.file)==null?void 0:ee.size)||K.size,type:((be=K.file)==null?void 0:be.type)||K.type,status:K.status,uid:K.uid,url:K.url||(J==null?void 0:J.url)||""}});break}return[...B]})},[Ee]);let Ye=null,Ie=null;const Ve=(B,C,L,O)=>{Ie=Le(B,{onStatusUpdate:C,onComplete:L,onFail:O})},f0=(B,C)=>{U(L=>{const O=[...L];return O[0]&&(O[0]={...O[0],messages:O[0].messages.map(K=>K.queryId===B?{...K,feedbackResult:C}:K)}),O})},w0=async B=>{var C,L;if(B)try{const O=(ie==null?void 0:ie.configId)||((C=Ue==null?void 0:Ue[(ie==null?void 0:ie.configId)||""])==null?void 0:C.id)||"",K=await l0.get(`${e}/qa/ai/recommendQuestion?queryId=${B}&configId=${O||""}`.replace(/\?&/,"?"),{headers:{Authorization:t}});P(((L=K.data)==null?void 0:L.data)||[])}catch{P([])}};function I0(B){const{content:C,audioUrl:L,filePaths:O,queryId:K}=B;if(!$||!K)return;const J=(ie==null?void 0:ie.messages)||[],ae=J.findIndex(re=>(re==null?void 0:re.queryId)===K&&((re==null?void 0:re.istype)==="ai"||(re==null?void 0:re.isUser)===!1));let ee;if(ae>0)for(let re=ae-1;re>=0;re-=1){const ce=J[re];if((ce==null?void 0:ce.istype)==="user"||(ce==null?void 0:ce.isUser)===!0){ee=ce;break}}const be=(ee==null?void 0:ee.content)??C;if(!be)return;const Ae=(ee==null?void 0:ee.filePaths)??O,Me=(typeof Ae=="string"&&Ae?JSON.parse(Ae):Ae||[]).map(re=>re.uid),ze=Date.now();B0({now:ze}),j(re=>({...re,display:"processing",sender:"processing"})),ae>=0&&J[ae]&&U(re=>{if(!re[0])return re;const ce=re[0],xe=ce.messages||[];if(ae>=xe.length)return re;const qe=xe.slice();return qe[ae]={...qe[ae],content:qe[ae].content,reference:"[]",webReference:"[]",graphReference:null,databaseReference:null,status:2,chain:void 0},[{...ce,messages:qe},...re.slice(1)]}),B.clearFn&&B.clearFn(),T(re=>re.map(ce=>ce.sessionId===$?{...ce,gmtModified:ze}:ce)),d0({configId:ie.configId,content:be,fileUids:Me,lastDate:ze,name:ie.label||"",queryId:K,sessionId:String($||""),type:(ee==null?void 0:ee.audioUrl)??L?"audioUrl":"text",audioUrl:((ee==null?void 0:ee.audioUrl)??L)||"",enableThinking:!!W.reasoning,enableWebsearch:!!W.netSearch,qaChannel:W.qaChannel,tempKnowledgeBaseCheck:Ct.current},re=>{w0(K)})}async function y0(B,C){if(X.sender!=="ready"){Re.warning("\u5F53\u524D\u5BF9\u8BDD\u6B63\u5728\u5904\u7406\u4E2D\uFF0C\u8BF7\u7A0D\u5019\u518D\u53D1\u9001\u65B0\u7684\u95EE\u9898");return}if(!$)return;const L=new CustomEvent("aichat:right_set",{detail:{collapsed:!0}});window.dispatchEvent(L);const O=N.find(K=>K.sessionId===$);if(O&&O.isNew){let K=!1;const J=H||O.configId,ae=B&&B.content?B.content.slice(0,20):O.label||"\u672A\u547D\u540D\u4F1A\u8BDD";if(await new Promise((ee,be)=>{yi({url:e,token:t,CSRFToken:c},{label:ae,sessionId:O.sessionId,sysType:"INT_SESSION",configId:J},Ae=>{Ae&&Ae.data&&Ae.data.sessionId?(T(Me=>Me.map(ze=>ze.sessionId===O.sessionId?{...ze,isNew:!1,configId:J,label:ae}:ze)),U(Me=>Me.map(ze=>ze.id===O.sessionId?{...ze,isNew:!1,configId:J,label:ae}:ze)),K=!0,ee()):(Re.error("\u521B\u5EFA\u4F1A\u8BDD\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),be())})}),!K)return;H0($,B,C,J);return}H0($,B,C)}function H0(B,C,L,O){const K="query-"+k0(32),J=N.find(re=>re.sessionId===B),ae=O||(J==null?void 0:J.configId)||ie.configId;console.log("\u52A9\u624B\u914D\u7F6E\u8BE6\u60C5",ae);const ee=C.content||C.text||"",be=typeof ee=="string"?ee:String(ee),Ae=be?be.slice(0,20):"\u672A\u547D\u540D\u4F1A\u8BDD";let Me;if(C.files&&C.files.length>0&&(Me=C.files.map(re=>({name:re.file.name,size:re.file.size,type:re.file.type,filePath:re.filePath||"",convertedFilePath:re.convertedFilePath||"",uid:re.uid||""}))),console.log("\u672C\u5730\u6587\u4EF6\u4E0A\u4F20",C.files),v0({content:be,queryId:K,currentFiles:Me,filePaths:Me?JSON.stringify(Me):void 0}),T(re=>re.map(ce=>ce.sessionId===B&&ce.label==="\u672A\u547D\u540D\u4F1A\u8BDD"&&ce.isNew?{...ce,label:Ae,gmtModified:Date.now(),isNew:!1}:ce)),U(re=>re.map(ce=>ce.id===B&&ce.label==="\u672A\u547D\u540D\u4F1A\u8BDD"&&ce.isNew?{...ce,label:Ae,isNew:!1}:ce)),C.files&&C.files.length>0){j(te=>({...te,sender:"uploading",display:"uploading"})),Ye=new AbortController,i0();const re=C.files.map(()=>`rc-upload-${Date.now()}-${Math.random().toString(36).slice(2)}`),ce=C.files.map((te,ve)=>({...te,uid:re[ve],status:"uploading"}));Be(ce);const xe=new FormData;C.files.forEach(te=>{xe.append("files",te.file)});const qe=String(B||"");xe.append("sessionId",qe),xe.append("uids",re.join(",")),l0.post(`${e}/index/knowledgeBase/file/uploadFiles`,xe,{headers:{Authorization:t,"Content-Type":"multipart/form-data"},signal:Ye.signal}).then(te=>{var s0,Se,N0,c0,W0,le,Je,n0,ge,$e;if(console.log("\u6587\u4EF6\u4E0A\u4F20\u7684\u6253\u5370\u7ED3\u679C",te),console.log("\u6587\u4EF6\u4E0A\u4F20\u54CD\u5E94\u8BE6\u60C5:",{status:te.status,success:(s0=te.data)==null?void 0:s0.success,dataType:Array.isArray((Se=te.data)==null?void 0:Se.data)?"array":typeof((N0=te.data)==null?void 0:N0.data),dataLength:Array.isArray((c0=te.data)==null?void 0:c0.data)?te.data.data.length:"N/A",errorMsg:(W0=te.data)==null?void 0:W0.errorMsg,errorCode:(le=te.data)==null?void 0:le.errorCode,fullResponse:te.data}),h0.current)return;const ve=(Je=te.data)==null?void 0:Je.data,r0=((n0=te.data)==null?void 0:n0.success)===!0,Ze=Array.isArray(ve)&&ve.length>0;if(r0&&Ze){const We=ve,b0=We.map(ye=>ye.uid);Be(ye=>ye.map(pe=>{const Ce=ve.find(de=>de.uid===pe.uid);return Ce?{...pe,...Ce}:pe})),j(ye=>({...ye,sender:"processing",display:"analyzing"})),Be(ye=>ye.map(pe=>({...pe,status:"parsing"}))),Ve(b0,ye=>{if(!ye||!Array.isArray(ye)){console.warn("pollFileStatus \u56DE\u8C03\u8FD4\u56DE\u7684 serverStatuses \u65E0\u6548:",ye);return}if(Be(Ce=>Ce.map(de=>{const C0=ye.find(p0=>p0&&p0.uid===de.uid);if(C0)switch(C0.fileParseStatus??C0.status){case 3:return{...de,status:"done"};case 4:return{...de,status:"error"};case 1:case 2:default:return{...de,status:"parsing"}}return de})),Array.isArray(ye)&&ye.length>0&&ye.every(Ce=>{if(!Ce)return!1;const de=Ce.fileParseStatus??Ce.status;return de===3||de===4})){Be([]);const Ce=new Map;(ye||[]).forEach(de=>{Ce.set(de.id,de)}),Te(de=>({uploadedFiles:Ei(de.uploadedFiles,We).map(p0=>{var j0;return{...p0,pdfPages:((j0=Ce.get(p0.id))==null?void 0:j0.pdfPages)||0}})}))}},()=>{L==null||L(),j(pe=>({...pe,sender:"processing",display:"processing"})),Be(pe=>pe.map(Ce=>{const de=We.find(C0=>C0.uid===Ce.uid);return de?{...Ce,...de,url:de.filePath,filePath:de.filePath,name:de.fileName||Ce.name,convertedFilePath:de.convertedFilePath||Ce.convertedFilePath}:Ce})),U(pe=>{if(!pe[0])return pe;const{messages:Ce}=pe[0];for(let de=Ce.length-1;de>=0;de--)if(Ce[de].istype==="user"){const C0=Ce[de].currentFiles||[];Ce[de].currentFiles=C0.map(p0=>{const j0=We.find(gr=>gr.uid===p0.uid);return j0?{...p0,...j0}:p0});break}return[...pe]});const ye=Date.now();d0({configId:ae,content:be,fileUids:b0,lastDate:ye,name:Ae,queryId:K,sessionId:String(B||""),type:"text",audioUrl:"",enableThinking:!!W.reasoning,enableWebsearch:!!W.netSearch,qaChannel:W.qaChannel,tempKnowledgeBaseCheck:Ct.current},pe=>{w0(K)})},ye=>{j(pe=>({...pe,display:"ready",sender:"ready"})),Be(pe=>pe.map(Ce=>({...Ce,status:"error",message:ye})))})}else{let We="\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25";(ge=te.data)!=null&&ge.errorMsg?We=te.data.errorMsg:r0?Ze||(Array.isArray(ve)?ve.length===0&&(We="\u4E0A\u4F20\u5931\u8D25: \u8FD4\u56DE\u6570\u636E\u4E3A\u7A7A"):We=`\u4E0A\u4F20\u5931\u8D25: \u8FD4\u56DE\u6570\u636E\u683C\u5F0F\u9519\u8BEF\uFF0C\u671F\u671B\u6570\u7EC4\uFF0C\u5B9E\u9645\u4E3A ${typeof ve}`):We=`\u4E0A\u4F20\u5931\u8D25: success=${($e=te.data)==null?void 0:$e.success}`,console.error("\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25\u8BE6\u60C5:",{errorMsg:We,response:te.data,isSuccess:r0,isValidData:Ze}),Re.error(We),j(b0=>({...b0,display:"error",sender:"ready"})),Be(b0=>b0.map(ye=>({...ye,status:"error",message:We})))}}).catch(te=>{var ve,r0;((ve=te==null?void 0:te.response)==null?void 0:ve.status)===413?(r0=te==null?void 0:te.response)!=null&&r0.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"),j(Ze=>({...Ze,display:"error",sender:"ready"})),Be(Ze=>Ze.map(s0=>({...s0,status:"error",message:"\u7F51\u7EDC\u9519\u8BEF"})))});return}j(re=>({...re,display:"processing",sender:"processing"}));const ze=Date.now();T(re=>re.map(ce=>ce.sessionId===B?{...ce,gmtModified:ze}:ce)),L==null||L(),d0({configId:ae,content:be,fileUids:[],lastDate:ze,name:Ae,queryId:K,sessionId:String(B||""),type:"text",audioUrl:"",enableThinking:!!W.reasoning,enableWebsearch:!!W.netSearch,qaChannel:W.qaChannel,tempKnowledgeBaseCheck:Ct.current},re=>{w0(K)})}function Y0(B){B.restult==1?Fr({url:e,token:t,CSRFToken:c},{queryId:B.queryId},()=>{f0(B.queryId,null)}):Yr({url:e,token:t,CSRFToken:c},{restult:1,queryId:B.queryId},()=>{f0(B.queryId,1)})}function Z0(B){const C=k0(32),L={sessionId:C,label:"\u672A\u547D\u540D\u4F1A\u8BDD",gmtModified:Date.now(),searchConfigDTO:{},filePath:"",configId:"",isNew:!0};T(O=>[{...L,messages:[]},...O]),U(O=>[{id:C,messages:[],...L},...O]),Q(C)}function $0(B){if(B!=null&&B.sessionId&&B.sessionId!==$){$&&ft($),Q(B.sessionId),j(L=>({...L,sender:"ready"}));const C=Z.find(L=>L.id===B.sessionId);if(C&&C.messages&&C.messages.length>0){const L=[...C.messages].reverse().find(O=>O.istype==="ai");L&&L.recommendQuestion?P(L.recommendQuestion):P([])}else P([])}}const J0=async B=>new Promise((C,L)=>{Ci({url:e,token:t,CSRFToken:c},{sessionId:B},O=>{O?(Re.success("\u5220\u9664\u6210\u529F!"),C(O)):(Re.error("\u5220\u9664\u5931\u8D25!"),L(O))})}),hr=async()=>{try{return T([]),q(0),await He(1),[]}catch(B){throw Re.error("\u5237\u65B0\u4F1A\u8BDD\u5217\u8868\u5931\u8D25"),B}},ht=async(B,C)=>new Promise((L,O)=>{Fi({url:e,token:t,CSRFToken:c},{label:C,sessionId:B},K=>{if(K){const J=Date.now();T(ae=>ae.map(ee=>ee.sessionId===B?{...ee,label:C,gmtModified:J}:ee)),U(ae=>ae.map(ee=>ee.id===B?{...ee,label:C}:ee)),Re.success("\u91CD\u547D\u540D\u6210\u529F!"),L(K)}else Re.error("\u91CD\u547D\u540D\u5931\u8D25"),O(K)})}),vt=B=>{T(C=>{const L=C.filter(O=>O.sessionId!==B);return $===B&&(L.length>0?Q(L[0].sessionId):Z0()),L})},gt=(B,C)=>{const L=Date.now();T(O=>O.map(K=>K.sessionId===B?{...K,label:C,gmtModified:L}:K)),U(O=>O.map(K=>K.id===B?{...K,label:C}:K))},mt=B=>{Yr({url:e,token:t,CSRFToken:c},{...B,...u0,restult:0},()=>{f0(u0.queryId,0)})},yt=B=>{const C=B.new_name,L=a.data.label;C&&C!==L?a.async_renameConversation(C).then(()=>{a.fn_renameItemInList(C),m(!1)}).catch(()=>{}):m(!1)},vr=B=>{a.async_deleteConversation().then(()=>{a.fn_removeItemFromList(),i(!1)}).catch(()=>{})},x0=(B,C)=>{switch(console.log(B,C),B){case"close_remove":i(!1);break;case"close_rename":m(!1);break;case"ok_rename":yt(C);break;case"ok_remove":vr();break}},xt=async({url:B,params:C,replacePredataFunction:L})=>{var O,K;try{const J=await l0.post(B,C,{headers:{Authorization:t}}),ae=(K=(O=J==null?void 0:J.data)==null?void 0:O.data)==null?void 0:K.data;ae&&L(ae)}catch(J){console.log("error",J)}},La=async B=>{var C;try{const L=await l0.get(`${kr()}/index/knowledgeBase/file/getFileStatusByUids?uids=${B.data.uids}`,{headers:{Authorization:t}});return console.log("resslkdjgalsg",L),(C=L==null?void 0:L.data)==null?void 0:C.data}catch{}},Vr=async B=>{try{const C=await La({data:{uids:B.uid},config:{url:kr(),token:t,enableMock:!1}});if(C!=null&&C.length){const L=C[0];if(Er(L.convertedFilePath)==="pdf"&&!L.pdfPages)return Re.warning("\u6587\u4EF6\u8FD8\u672A\u89E3\u6790\u5B8C\u6210,\u8BF7\u7A0D\u540E\u9884\u89C8");if(L.convertedFilePath)k({...B,parse_url:L.convertedFilePath,pdfPages:L.pdfPages}),_("preview"),x(!0);else return Re.warning("\u6587\u4EF6\u89E3\u6790\u5931\u8D25")}}catch{}},Ct=Ge(!1),R0=(B,C)=>{var L,O,K,J,ae,ee,be,Ae,Me,ze,re,ce,xe;switch(console.log(`[Event] ${B}`,C),B){case"TempKnowledgeBase":Ct.current=C;break;case"reference_file:click":if(C.file_type==="image")return;const qe=le=>{k({...C,file_type:C.type,file_name:C.file,...le}),_("preview"),x(!0)},te=Er((C==null?void 0:C.parse_url)||""),ve=(L=C.metadata)!=null&&L.source?`${cr}${C.metadata.source}`:C.filePath||C.url||C.convertedFilePath||"",r0=Er(ve),Ze=()=>{if(C.uid)Vr(C);else return C.references?void 0:Re.warning("\u6587\u4EF6\u8FD8\u672A\u89E3\u6790\u5B8C\u6210,\u8BF7\u7A0D\u540E\u9884\u89C8")};if(vi.includes(r0)){const le=(O=C.metadata)!=null&&O.source?`${cr}${C.metadata.source}`:C.url||C.convertedFilePath||C.filePath;r0==="pdf"?C.pdfPages?qe({parse_url:le}):Ze():qe({parse_url:le})}else te==="pdf"?C.pdfPages?qe():Ze():C.parse_url?qe():Ze();break;case"conversations:load_more":{N.length<g&&!M&&He(w+1);break}case"retrieve-sql-data:pagingation_click":const{page:s0,pageSize:Se,fetchUrl:N0,source:c0,replacePredataFunction:W0}=C;xt({url:`${e}${N0}`,replacePredataFunction:W0,params:{pageNo:s0,pageSize:Se,convertedFilePath:c0,stream:!1}});break;case"web_referenceFile_title:click":if(!((K=C==null?void 0:C.data)!=null&&K.link))return console.error("\u6CA1\u6709\u7F51\u9875\u5730\u5740");window.open(C.data.link,"_blank");break;case"conversation:item_click":$0(C);break;case"files:finished_animation_complete":Be([]);break;case"conversation:create":Z0();break;case"conversation:new_assistant_change":V(C.assistantId);break;case"conversations:rename_icon_clicked":v({data:C,async_renameConversation:le=>ht(C.sessionId,le),fn_renameItemInList:le=>gt(C.sessionId,le)}),m(!0);break;case"conversations:delete_icon_clicked":v({data:C,async_deleteConversation:()=>J0(C.sessionId),async_refreshConversationList:hr,fn_removeItemFromList:()=>vt(C.sessionId)}),i(!0);break;case"sender:send":y0(C,C.clearFn);break;case"sender:send_recommandQuestion":{const le=((C==null?void 0:C.content)??"").toString();if(!le)break;y0({content:le},()=>{});break}case"chatbox:follow_up_question_click":{const le=((C==null?void 0:C.question)??(C==null?void 0:C.content)??"").toString();if(!le)break;y0({content:le},()=>{});break}case"sender:stop":o0(),Ye&&(Ye.abort(),Ye=null),Ie&&(Ie(),Ie=null),j(le=>({...le,display:"ready",sender:"ready"})),Be([]),A0==null||A0();break;case"sender:clear":(J=C.clearFn)==null||J.call(C);break;case"sender:configChange":C&&C.all&&he(C.all);break;case"sender:action_upload":Qe.current&&Qe.current.click();break;case"sender:action_history":Q0(!0);break;case"uploaded_file:item_click":break;case"action_copy:click":C&&Ro(C.content,C.event);break;case"chatbox:copy":{let le=(C==null?void 0:C.content)||"";if(!le)break;le=le.replace(/\[retrive-tag[^\]]*\][\s\S]*?\[\/retrive-tag\]/g,"");const Je=async ge=>{try{return await navigator.clipboard.writeText(ge),Re.success("\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F"),!0}catch{return!1}},n0=ge=>{const $e=document.createElement("textarea");$e.value=ge,$e.style.position="fixed",$e.style.opacity="0",document.body.appendChild($e),$e.focus(),$e.select();try{document.execCommand("copy"),Re.success("\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F")}catch{Re.error("\u590D\u5236\u5931\u8D25")}document.body.removeChild($e)};Je(le).then(ge=>{ge||n0(le)});break}case"chatbox:repeat":console.log(C,"sdkflskdjflksdjfklsdjlfkjsdklfjsdklfjlks"),I0(C);break;case"action_thumbsup":Y0(C);break;case"chatbox:like":Y0({queryId:C==null?void 0:C.queryId,restult:C==null?void 0:C.result});break;case"action_thumbsdown":C.restult===0?Fr({url:e,token:t,CSRFToken:c},{queryId:C.queryId},()=>{f0(C.queryId,null)}):(O0(C),U0(!0));break;case"chatbox:dislike":(C==null?void 0:C.result)===0?Fr({url:e,token:t,CSRFToken:c},{queryId:C.queryId},()=>{f0(C.queryId,null)}):(O0({queryId:C==null?void 0:C.queryId}),U0(!0));break;case"retrive_tag:click":{let le=(C==null?void 0:C.referencesPayloadSingle)||((C==null?void 0:C.fromtype)==="10"&&(C!=null&&C.referenceDoc)?{knowledgeRefs:[C.referenceDoc],webRefs:[],graphRefs:[],databaseRefs:[],images:[],raw:{}}:null);if((C==null?void 0:C.fromtype)==="10"&&!le&&((ae=C==null?void 0:C.leaf)==null?void 0:ae.id)!=null&&((ee=ie==null?void 0:ie.messages)!=null&&ee.length)){const Je=ie.messages;for(let n0=Je.length-1;n0>=0;n0--){const ge=Je[n0];if((ge==null?void 0:ge.istype)!=="ai")continue;const $e=(ge==null?void 0:ge.faqReference)??((be=ge==null?void 0:ge.reply)==null?void 0:be.faqReference)??(ge==null?void 0:ge.reference);if(!$e)continue;let We=[];try{const Ke=typeof $e=="string"?(()=>{const $a=$e.replace(/"pk":\s*(\d+)/g,'"pk":"$1"').replace(/"order_num":\s*(\d+)/g,'"order_num":"$1"').replace(/"related_pk":\s*(\d+)/g,'"related_pk":"$1"');return JSON.parse($a)})():$e;We=Array.isArray(Ke)?Ke:[Ke]}catch{continue}if(We.length===0)continue;const b0=String(C.leaf.id);let ye=We.findIndex(Ke=>String((Ke==null?void 0:Ke.pk)??(Ke==null?void 0:Ke.order_num)??(Ke==null?void 0:Ke.id))===b0);if(ye<0){const Ke=Number(b0);Number.isInteger(Ke)&&Ke>=1&&Ke<=We.length&&(ye=Ke-1)}if(ye<0)continue;const pe=We[ye],Ce=ye+1,de=pe.metadata||{},C0=pe.faq_question||de.sourceFileName||de.source&&String(de.source).split("/").pop()||"FAQ",p0=pe.folder_path||de.folder_path||de.knowledge_base_name||"",j0=p0?`${p0} - ${C0}`:C0,gr=`\u77E5\u8BC6\u5E93${Ce}\u540D\uFF1A${j0}`,Ft=String(pe.pk??pe.order_num??pe.id??""),Gr=typeof pe.score=="number"?pe.score:typeof de.score=="number"?de.score:0;le={knowledgeRefs:[{id:Ft,file_id:Ft,file_name:gr,file_type:"faq",type:"faq",path:"",score:Gr,rrf_score:Gr,tags:[{id:b0,index:Ce,image_urls:((Ae=C==null?void 0:C.tagInfo)==null?void 0:Ae.image_urls)||[],metadata:de}],source:pe.folder_path||"",order_num:Ft,pk:Ft,faq_question:pe.faq_question,faq_answer:pe.faq_answer,folder_path:pe.folder_path,metadata:de,faqIndex:Ce,...pe}],webRefs:[],graphRefs:[],databaseRefs:[],images:[],raw:{}};break}}if((C==null?void 0:C.fromtype)==="10"&&le){const Je=new CustomEvent("aichat:right_set_content",{detail:{content:S(vn,{type:"referencelist",data:le,token:t,eventsEmit:d,is_download:_0})}});window.dispatchEvent(Je);const n0=new CustomEvent("aichat:right_set",{detail:{collapsed:!1}});window.dispatchEvent(n0)}d==null||d("retrive_tag:click",C);break}case"referenceFile_view":d==null||d("referenceFile_view",C);break;case"referenceFile_question":console.log(C,"zhezhhzhzh"),Vr(C.data||C),d==null||d("referenceFile_question",C);break;case"referenceFile_download":d==null||d("referenceFile_download",C);break;case"references:click":case"knowledge_base_view_all:click":{const le=()=>B==="references:click"?S(vn,{type:"referencelist",data:C,token:t,eventsEmit:d,is_download:_0}):S(ns,{fileData:C,token:t}),Je=new CustomEvent("aichat:right_set_content",{detail:{content:S(le,{})}});window.dispatchEvent(Je);const n0=new CustomEvent("aichat:right_set",{detail:{collapsed:!1}});window.dispatchEvent(n0);break}case"retrive_tag:click":d==null||d("retrive_tag:click",C);break;case"fileManager:change":{typeof(C==null?void 0:C.setUploadedFiles)=="function"&&(t0.current=C.setUploadedFiles,z0.current=C.removeFile,me.current=C==null?void 0:C.senderConfig,q0.current=Array.isArray(C==null?void 0:C.uploadedFiles)?C.uploadedFiles:[],Array.isArray(C==null?void 0:C.uploadedFiles)&&L0(C.uploadedFiles),console.log("[DEBUG] fileManager:change \u4E8B\u4EF6\u89E6\u53D1\uFF0CsetUploadedFilesRef \u5DF2\u8BBE\u7F6E",{hasSetUploadedFiles:!!t0.current,uploadedFilesCount:((Me=C==null?void 0:C.uploadedFiles)==null?void 0:Me.length)||0,pendingFilesCount:((ze=C==null?void 0:C.uploadedFiles)==null?void 0:ze.length)||0,hasSenderConfig:!!(C!=null&&C.senderConfig),senderConfig:C==null?void 0:C.senderConfig,upload_number_limit:(re=C==null?void 0:C.senderConfig)==null?void 0:re.upload_number_limit,upload_size_limit:(ce=C==null?void 0:C.senderConfig)==null?void 0:ce.upload_size_limit}));break}case"uploaded_file:removeFromTemp":{console.log("[DEBUG] mergedEventsEmit uploaded_file:removeFromTemp \u4E8B\u4EF6",C);const le=(xe=C==null?void 0:C.file)==null?void 0:xe.uid;if(!le){console.warn("[DEBUG] \u7F3A\u5C11uid\uFF0C\u65E0\u6CD5\u5220\u9664\u4E34\u65F6\u6587\u4EF6",C);break}const Je=[...(ie==null?void 0:ie.messages)||[]].reverse().find(ge=>ge.istype==="user"),n0=Je==null?void 0:Je.queryId;a0(le,n0);break}case"uploaded_file:remove_batch":break;default:d==null||d(B,C)}},Oa=[{key:"conversations",type:"custom",label:"\u5BF9\u8BDD\u5386\u53F2",icon:S(Ti,{size:16}),enabled:!0,component:S(_o,{data:N,assistantList:I,activedItem:$||"",hasMore:N.length<g,loadingMore:M,sortRules:[{label:"\u5F53\u5929",dayPeriod:1},{label:"3\u5929",dayPeriod:3},{label:"7\u5929",dayPeriod:7},{label:"30\u5929",dayPeriod:30}],eventsEmit:R0,styles:E.theme})}],Kr=Pe.useCallback(()=>S(Oo,{eventsEmit:R0,assistantList:I,styles:E,selectedId:e0,onSelectAssistant:m0,productLogo:o==null?void 0:o.productLogo}),[R0,I,E,e0,o==null?void 0:o.productLogo]),Ma={...Pe.useMemo(()=>({AiChatBox:(B,C)=>{var Me,ze,re,ce;const L=C===(((Me=ie==null?void 0:ie.messages)==null?void 0:Me.length)||0)-1;let O="ready";if(L)if(B.status!==void 0)switch(B.status){case 0:O="thinking";break;case 1:O="processing";break;case 2:O="ready";break;case 3:O="error";break;case 4:O="thinking";break;default:O=X.display}else O=X.display;let K=[];if(Array.isArray(z))K=z;else if(typeof z=="string")try{K=JSON.parse(z)||[]}catch{K=[]}const J=(()=>{var te;const xe=B==null?void 0:B.reference;if(xe){if(typeof xe=="string")try{return JSON.parse(xe),xe}catch{return"[]"}try{return JSON.stringify(xe)}catch{return"[]"}}const qe=(B==null?void 0:B.faqReference)??((te=B==null?void 0:B.reply)==null?void 0:te.faqReference)??void 0;if(!qe)return"[]";try{const ve=typeof qe=="string"?(()=>{const Se=qe.replace(/"pk":\s*(\d+)/g,'"pk":"$1"').replace(/"order_num":\s*(\d+)/g,'"order_num":"$1"').replace(/"related_pk":\s*(\d+)/g,'"related_pk":"$1"');return JSON.parse(Se)})():qe,r0=Array.isArray(ve)?ve:[ve];if(!r0.length)return"[]";const s0={knowledgeRefs:r0.map((Se,N0)=>{const c0=Se.metadata||{},W0=Se.faq_question||c0.sourceFileName||c0.source&&String(c0.source).split("/").pop()||"FAQ",le=Se.folder_path||c0.folder_path||c0.knowledge_base_name||"",Je=le?`${le} - ${W0}`:W0,n0=`\u77E5\u8BC6\u5E93${N0+1}\u540D\uFF1A${Je}`,ge=String(Se.pk??Se.order_num??Se.id??""),$e=typeof Se.score=="number"?Se.score:typeof c0.score=="number"?c0.score:0;return{id:ge,file_id:ge,file_name:n0,file_type:"faq",type:"faq",path:"",score:$e,rrf_score:$e,tags:[{id:ge,index:N0+1,image_urls:[],metadata:c0}],source:Se.folder_path||"",order_num:ge,pk:ge,faq_question:Se.faq_question,faq_answer:Se.faq_answer,folder_path:Se.folder_path,metadata:c0,faqIndex:N0+1,...Se}}),webRefs:[],graphRefs:[],databaseRefs:[],images:[],raw:{}};return JSON.stringify(s0)}catch{return"[]"}})(),ae=(()=>{const xe=B==null?void 0:B.webReference;if(!xe)return"[]";if(typeof xe=="string")try{return JSON.parse(xe),xe}catch{return"[]"}try{return JSON.stringify(xe)}catch{return"[]"}})(),ee=(()=>{const xe=B==null?void 0:B.graphReference;if(!xe)return"[]";if(typeof xe=="string")try{return JSON.parse(xe),xe}catch{return"[]"}try{return JSON.stringify(xe)}catch{return"[]"}})(),be=B==null?void 0:B.databaseReference,Ae=(()=>{var qe,te,ve;if(B!=null&&B.chainRespTime||(qe=B==null?void 0:B.reply)!=null&&qe.chainRespTime)return(B==null?void 0:B.chainRespTime)??((te=B==null?void 0:B.reply)==null?void 0:te.chainRespTime);const xe=(B==null?void 0:B.chain)||((ve=B==null?void 0:B.reply)==null?void 0:ve.chain);if(Array.isArray(xe)&&xe.length>0){const r0=xe.reduce((Ze,s0)=>{const Se=(s0==null?void 0:s0.chainRespTime)??(s0==null?void 0:s0.respTime);return Se!=null&&Se>0?Ze+Se:Ze},0);return r0>0?r0:void 0}})();return S(Zr,{...B,token:t,streamUrl:"/proxy/index/knowledgeBase/file/stream",referenceMode:"button",reference:J,webReference:ae,faqReference:(B==null?void 0:B.faqReference)??((ze=B==null?void 0:B.reply)==null?void 0:ze.faqReference),graphReference:ee,databaseReference:be,contentType:"stream",displayStatus:O,eventsEmit:R0,isLast:L&&(B==null?void 0:B.istype)==="ai",followUpQuestions:L&&(B==null?void 0:B.istype)==="ai"?K:[],defaultAnswer:((re=ie==null?void 0:ie.searchConfigDTO)==null?void 0:re.defaultAnswer)||"\u4E0D\u77E5\u9053\u4EC0\u4E48\u539F\u56E0\u6211\u4EEC\u6CA1\u80FD\u67E5\u5230\u4F60\u8981\u7684\u95EE\u9898*-*",is_download:_0,styles:E,enableThoughtChain:!0,chain:B==null?void 0:B.chain,thoughtChainNodes:B==null?void 0:B.thoughtChainNodes,thoughtChainStatus:B==null?void 0:B.status,enableCot:(B==null?void 0:B.enableCot)??((ce=B==null?void 0:B.reply)==null?void 0:ce.enableCot),chainRespTime:Ae},`${(B==null?void 0:B.queryId)||(B==null?void 0:B.id)||C}-${(B==null?void 0:B.istype)||"unknown"}`)},LogoBox:B=>B&&B.LogoBox===null?null:B&&typeof B.LogoBox=="function"?S(B.LogoBox,{}):S("div",{className:"text-2xl w-full text-center font-bold",children:"\u5C0F\u9CB8\u667A\u80FD\u52A9\u624B"}),DisplayLoading:()=>S(jo,{}),DisplayError:()=>S(Ko,{}),AppError:()=>S(Vo,{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 B,C;return S(Wo,{title:(B=o==null?void 0:o.appLoadingConfig)==null?void 0:B.title,subtitle:((C=o==null?void 0:o.appLoadingConfig)==null?void 0:C.subtitle)||""})},UserChatBox:(B,C)=>S(Zr,{token:t,streamUrl:"/proxy/index/knowledgeBase/file/stream",...B,referenceMode:"button",contentType:"plainText",isUser:!0,displayStatus:"ready",eventsEmit:R0,styles:E,fileManagerData:Ne,currentFiles:B==null?void 0:B.currentFiles},`${(B==null?void 0:B.queryId)||(B==null?void 0:B.id)||C}-user`),WelcomeComponent:Kr}),[Kr,ie,X.display,R0,E,_0,Ne]),...o.CustomComponents||{}};_e(()=>{se(B=>{const C=Array.isArray(B.switchs)?B.switchs.map(L=>L.name==="reasoning"?{...L,enabled:!0}:L):[];return{...B,switchs:C}})},[]);const Ua=De(()=>Ne.uploadedFiles||[],[Ne]),{FileDisplayTools:Ha}=pi({fileManagerData:{uploadedFiles:Ua},styles:E,eventsEmit:R0});return S(Wi,{locale:p,children:Y("div",{style:{height:"100%",minWidth:"1116px",overflow:"hidden"},children:[S("input",{ref:Qe,type:"file",multiple:!0,accept:"image/*,.pdf,.doc,.docx,.ppt,.pptx,.xls,.xlsx,.txt,.md,.json,.csv,.zip,.rar,.7z",style:{display:"none"},onChange:B=>{const C=B.target.files;if(C&&C.length>0){console.log("[DEBUG] handleFileSelect \u89E6\u53D1",{filesCount:C.length,hasSetUploadedFilesRef:!!t0.current,hasSenderConfig:!!me.current,dynamicSenderConfig:we,dynamicSenderConfigKeys:we?Object.keys(we):[],senderConfigRef:me.current,senderConfigRefKeys:me.current?Object.keys(me.current):[]});const L=Array.from(C);let O=me.current;(!O||O.upload_size_limit===void 0&&O.upload_number_limit===void 0&&(!O.upload_file_type_limit||O.upload_file_type_limit.length===0))&&(O=we);const K=q0.current||[];console.log("[DEBUG] \u9A8C\u8BC1\u914D\u7F6E\u68C0\u67E5",{configSource:O,upload_number_limit:O==null?void 0:O.upload_number_limit,upload_size_limit:O==null?void 0:O.upload_size_limit,existingFilesCount:K.length,newFilesCount:L.length});const J=O&&(O.upload_size_limit!==void 0||O.upload_number_limit!==void 0&&O.upload_number_limit>0||O.upload_file_type_limit&&O.upload_file_type_limit.length>0);if(console.log("[DEBUG] \u914D\u7F6E\u68C0\u67E5\u7ED3\u679C",{hasUploadLimitConfig:J,upload_number_limit:O==null?void 0:O.upload_number_limit,upload_size_limit:O==null?void 0:O.upload_size_limit,upload_file_type_limit:O==null?void 0:O.upload_file_type_limit}),J){const ae={upload_size_limit:O.upload_size_limit,upload_number_limit:O.upload_number_limit,upload_file_type_limit:O.upload_file_type_limit,upload_limit_message:O.upload_limit_message};console.log("[DEBUG] \u6267\u884C\u6587\u4EF6\u9A8C\u8BC1",{uploadConfig:ae,existingFilesCount:K.length,newFilesCount:L.length,totalCount:K.length+L.length});const ee=gi(L,K,ae);if(console.log("[DEBUG] \u9A8C\u8BC1\u7ED3\u679C",{valid:ee.valid,errors:ee.errors,rejectedFilesCount:ee.rejectedFiles.length}),!ee.valid){mi(ee);const be=L.filter(Ae=>!ee.rejectedFiles.includes(Ae));if(be.length===0){Qe.current&&(Qe.current.value="");return}L.splice(0,L.length,...be)}}if(t0.current){const ae=L.map(ee=>({file:ee,type:ee.type.startsWith("image/")?"image":"document",status:"pending",name:ee.name}));console.log("[DEBUG] \u901A\u8FC7 setUploadedFilesRef \u8BBE\u7F6E\u6587\u4EF6",ae),t0.current(ae)}else console.warn("[DEBUG] setUploadedFilesRef \u672A\u8BBE\u7F6E\uFF0C\u5EF6\u8FDF\u91CD\u8BD5"),setTimeout(()=>{if(t0.current){const ae=L.map(ee=>({file:ee,type:ee.type.startsWith("image/")?"image":"document",status:"pending",name:ee.name}));console.log("[DEBUG] \u5EF6\u8FDF\u540E\u901A\u8FC7 setUploadedFilesRef \u8BBE\u7F6E\u6587\u4EF6",ae),t0.current(ae)}else console.error("[DEBUG] \u5EF6\u8FDF\u540E setUploadedFilesRef \u4ECD\u672A\u8BBE\u7F6E")},100)}Qe.current&&(Qe.current.value="")}}),S(r,{...o,status:X,chatData:ie,sidebar:Oa,recommandQuestions:[],eventsEmit:R0,styles:E,senderConfig:we,fileUploadStatus:Ee,CustomComponents:Ma,activeSessionId:$,scrollOld:s,rightbarWidth:"400px",locale:p,messages:n,disclaimer:o.disclaimer??ne.disclaimer,chatHeader:{title:(ie==null?void 0:ie.label)||ne.chatHeader.newConversation,tools:Ha}}),S(hi,{open:M0,feedBackList:X0,setOpen:U0,handleConfirm:mt}),S(Go,{isModalOpen:l,handleOk:x0,handleCancel:()=>x0("close_rename"),data:(a==null?void 0:a.data)||{}}),S(Xo,{isModalOpen:y,handleOk:x0,handleCancel:()=>x0("close_remove"),data:(a==null?void 0:a.data)||{}}),S(dr,{drawer:{styles:{body:{padding:0},header:{display:"none"}}},children:S(da,{autoFocus:!1,onClose:()=>x(!1),open:f,width:F==="graphPreview"?"100%":720,className:"overflow-x-hidden",destroyOnClose:!0,children:F==="preview"&&S(Ra,{curFileInfo:b,onClose:x,token:t})})})]})})}}var _t={exports:{}},wt={exports:{}},is=wt.exports,gn;function fe(){return gn||(gn=1,(function(r,u){(function(t,e){r.exports=e()})(is,function(){var t=t||(function(e,h){var c;if(typeof window<"u"&&window.crypto&&(c=window.crypto),typeof self<"u"&&self.crypto&&(c=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(c=globalThis.crypto),!c&&typeof window<"u"&&window.msCrypto&&(c=window.msCrypto),!c&&typeof yr<"u"&&yr.crypto&&(c=yr.crypto),!c&&typeof Ii=="function")try{c=Ri}catch{}var d=function(){if(c){if(typeof c.getRandomValues=="function")try{return c.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof c.randomBytes=="function")try{return c.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},s=Object.create||(function(){function f(){}return function(x){var F;return f.prototype=x,F=new f,f.prototype=null,F}})(),p={},n=p.lib={},o=n.Base=(function(){return{extend:function(f){var x=s(this);return f&&x.mixIn(f),(!x.hasOwnProperty("init")||this.init===x.init)&&(x.init=function(){x.$super.init.apply(this,arguments)}),x.init.prototype=x,x.$super=this,x},create:function(){var f=this.extend();return f.init.apply(f,arguments),f},init:function(){},mixIn:function(f){for(var x in f)f.hasOwnProperty(x)&&(this[x]=f[x]);f.hasOwnProperty("toString")&&(this.toString=f.toString)},clone:function(){return this.init.prototype.extend(this)}}})(),E=n.WordArray=o.extend({init:function(f,x){f=this.words=f||[],x!=h?this.sigBytes=x:this.sigBytes=f.length*4},toString:function(f){return(f||m).stringify(this)},concat:function(f){var x=this.words,F=f.words,_=this.sigBytes,b=f.sigBytes;if(this.clamp(),_%4)for(var k=0;k<b;k++){var N=F[k>>>2]>>>24-k%4*8&255;x[_+k>>>2]|=N<<24-(_+k)%4*8}else for(var T=0;T<b;T+=4)x[_+T>>>2]=F[T>>>2];return this.sigBytes+=b,this},clamp:function(){var f=this.words,x=this.sigBytes;f[x>>>2]&=4294967295<<32-x%4*8,f.length=e.ceil(x/4)},clone:function(){var f=o.clone.call(this);return f.words=this.words.slice(0),f},random:function(f){for(var x=[],F=0;F<f;F+=4)x.push(d());return new E.init(x,f)}}),l=p.enc={},m=l.Hex={stringify:function(f){for(var x=f.words,F=f.sigBytes,_=[],b=0;b<F;b++){var k=x[b>>>2]>>>24-b%4*8&255;_.push((k>>>4).toString(16)),_.push((k&15).toString(16))}return _.join("")},parse:function(f){for(var x=f.length,F=[],_=0;_<x;_+=2)F[_>>>3]|=parseInt(f.substr(_,2),16)<<24-_%8*4;return new E.init(F,x/2)}},y=l.Latin1={stringify:function(f){for(var x=f.words,F=f.sigBytes,_=[],b=0;b<F;b++){var k=x[b>>>2]>>>24-b%4*8&255;_.push(String.fromCharCode(k))}return _.join("")},parse:function(f){for(var x=f.length,F=[],_=0;_<x;_++)F[_>>>2]|=(f.charCodeAt(_)&255)<<24-_%4*8;return new E.init(F,x)}},i=l.Utf8={stringify:function(f){try{return decodeURIComponent(escape(y.stringify(f)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(f){return y.parse(unescape(encodeURIComponent(f)))}},a=n.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new E.init,this._nDataBytes=0},_append:function(f){typeof f=="string"&&(f=i.parse(f)),this._data.concat(f),this._nDataBytes+=f.sigBytes},_process:function(f){var x,F=this._data,_=F.words,b=F.sigBytes,k=this.blockSize,N=k*4,T=b/N;f?T=e.ceil(T):T=e.max((T|0)-this._minBufferSize,0);var w=T*k,A=e.min(w*4,b);if(w){for(var D=0;D<w;D+=k)this._doProcessBlock(_,D);x=_.splice(0,w),F.sigBytes-=A}return new E.init(x,A)},clone:function(){var f=o.clone.call(this);return f._data=this._data.clone(),f},_minBufferSize:0});n.Hasher=a.extend({cfg:o.extend(),init:function(f){this.cfg=this.cfg.extend(f),this.reset()},reset:function(){a.reset.call(this),this._doReset()},update:function(f){return this._append(f),this._process(),this},finalize:function(f){f&&this._append(f);var x=this._doFinalize();return x},blockSize:16,_createHelper:function(f){return function(x,F){return new f.init(F).finalize(x)}},_createHmacHelper:function(f){return function(x,F){return new v.HMAC.init(f,F).finalize(x)}}});var v=p.algo={};return p})(Math);return t})})(wt)),wt.exports}var St={exports:{}},os=St.exports,mn;function pr(){return mn||(mn=1,(function(r,u){(function(t,e){r.exports=e(fe())})(os,function(t){return(function(e){var h=t,c=h.lib,d=c.Base,s=c.WordArray,p=h.x64={};p.Word=d.extend({init:function(n,o){this.high=n,this.low=o}}),p.WordArray=d.extend({init:function(n,o){n=this.words=n||[],o!=e?this.sigBytes=o:this.sigBytes=n.length*8},toX32:function(){for(var n=this.words,o=n.length,E=[],l=0;l<o;l++){var m=n[l];E.push(m.high),E.push(m.low)}return s.create(E,this.sigBytes)},clone:function(){for(var n=d.clone.call(this),o=n.words=this.words.slice(0),E=o.length,l=0;l<E;l++)o[l]=o[l].clone();return n}})})(),t})})(St)),St.exports}var kt={exports:{}},ss=kt.exports,yn;function us(){return yn||(yn=1,(function(r,u){(function(t,e){r.exports=e(fe())})(ss,function(t){return(function(){if(typeof ArrayBuffer=="function"){var e=t,h=e.lib,c=h.WordArray,d=c.init,s=c.init=function(p){if(p instanceof ArrayBuffer&&(p=new Uint8Array(p)),(p instanceof Int8Array||typeof Uint8ClampedArray<"u"&&p instanceof Uint8ClampedArray||p instanceof Int16Array||p instanceof Uint16Array||p instanceof Int32Array||p instanceof Uint32Array||p instanceof Float32Array||p instanceof Float64Array)&&(p=new Uint8Array(p.buffer,p.byteOffset,p.byteLength)),p instanceof Uint8Array){for(var n=p.byteLength,o=[],E=0;E<n;E++)o[E>>>2]|=p[E]<<24-E%4*8;d.call(this,o,n)}else d.apply(this,arguments)};s.prototype=c}})(),t.lib.WordArray})})(kt)),kt.exports}var It={exports:{}},cs=It.exports,Cn;function ls(){return Cn||(Cn=1,(function(r,u){(function(t,e){r.exports=e(fe())})(cs,function(t){return(function(){var e=t,h=e.lib,c=h.WordArray,d=e.enc;d.Utf16=d.Utf16BE={stringify:function(p){for(var n=p.words,o=p.sigBytes,E=[],l=0;l<o;l+=2){var m=n[l>>>2]>>>16-l%4*8&65535;E.push(String.fromCharCode(m))}return E.join("")},parse:function(p){for(var n=p.length,o=[],E=0;E<n;E++)o[E>>>1]|=p.charCodeAt(E)<<16-E%2*16;return c.create(o,n*2)}},d.Utf16LE={stringify:function(p){for(var n=p.words,o=p.sigBytes,E=[],l=0;l<o;l+=2){var m=s(n[l>>>2]>>>16-l%4*8&65535);E.push(String.fromCharCode(m))}return E.join("")},parse:function(p){for(var n=p.length,o=[],E=0;E<n;E++)o[E>>>1]|=s(p.charCodeAt(E)<<16-E%2*16);return c.create(o,n*2)}};function s(p){return p<<8&4278255360|p>>>8&16711935}})(),t.enc.Utf16})})(It)),It.exports}var Rt={exports:{}},ds=Rt.exports,Fn;function V0(){return Fn||(Fn=1,(function(r,u){(function(t,e){r.exports=e(fe())})(ds,function(t){return(function(){var e=t,h=e.lib,c=h.WordArray,d=e.enc;d.Base64={stringify:function(p){var n=p.words,o=p.sigBytes,E=this._map;p.clamp();for(var l=[],m=0;m<o;m+=3)for(var y=n[m>>>2]>>>24-m%4*8&255,i=n[m+1>>>2]>>>24-(m+1)%4*8&255,a=n[m+2>>>2]>>>24-(m+2)%4*8&255,v=y<<16|i<<8|a,f=0;f<4&&m+f*.75<o;f++)l.push(E.charAt(v>>>6*(3-f)&63));var x=E.charAt(64);if(x)for(;l.length%4;)l.push(x);return l.join("")},parse:function(p){var n=p.length,o=this._map,E=this._reverseMap;if(!E){E=this._reverseMap=[];for(var l=0;l<o.length;l++)E[o.charCodeAt(l)]=l}var m=o.charAt(64);if(m){var y=p.indexOf(m);y!==-1&&(n=y)}return s(p,n,E)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function s(p,n,o){for(var E=[],l=0,m=0;m<n;m++)if(m%4){var y=o[p.charCodeAt(m-1)]<<m%4*2,i=o[p.charCodeAt(m)]>>>6-m%4*2,a=y|i;E[l>>>2]|=a<<24-l%4*8,l++}return c.create(E,l)}})(),t.enc.Base64})})(Rt)),Rt.exports}var Nt={exports:{}},fs=Nt.exports,En;function xs(){return En||(En=1,(function(r,u){(function(t,e){r.exports=e(fe())})(fs,function(t){return(function(){var e=t,h=e.lib,c=h.WordArray,d=e.enc;d.Base64url={stringify:function(p,n){n===void 0&&(n=!0);var o=p.words,E=p.sigBytes,l=n?this._safe_map:this._map;p.clamp();for(var m=[],y=0;y<E;y+=3)for(var i=o[y>>>2]>>>24-y%4*8&255,a=o[y+1>>>2]>>>24-(y+1)%4*8&255,v=o[y+2>>>2]>>>24-(y+2)%4*8&255,f=i<<16|a<<8|v,x=0;x<4&&y+x*.75<E;x++)m.push(l.charAt(f>>>6*(3-x)&63));var F=l.charAt(64);if(F)for(;m.length%4;)m.push(F);return m.join("")},parse:function(p,n){n===void 0&&(n=!0);var o=p.length,E=n?this._safe_map:this._map,l=this._reverseMap;if(!l){l=this._reverseMap=[];for(var m=0;m<E.length;m++)l[E.charCodeAt(m)]=m}var y=E.charAt(64);if(y){var i=p.indexOf(y);i!==-1&&(o=i)}return s(p,o,l)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function s(p,n,o){for(var E=[],l=0,m=0;m<n;m++)if(m%4){var y=o[p.charCodeAt(m-1)]<<m%4*2,i=o[p.charCodeAt(m)]>>>6-m%4*2,a=y|i;E[l>>>2]|=a<<24-l%4*8,l++}return c.create(E,l)}})(),t.enc.Base64url})})(Nt)),Nt.exports}var Pt={exports:{}},ps=Pt.exports,Bn;function K0(){return Bn||(Bn=1,(function(r,u){(function(t,e){r.exports=e(fe())})(ps,function(t){return(function(e){var h=t,c=h.lib,d=c.WordArray,s=c.Hasher,p=h.algo,n=[];(function(){for(var i=0;i<64;i++)n[i]=e.abs(e.sin(i+1))*4294967296|0})();var o=p.MD5=s.extend({_doReset:function(){this._hash=new d.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(i,a){for(var v=0;v<16;v++){var f=a+v,x=i[f];i[f]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360}var F=this._hash.words,_=i[a+0],b=i[a+1],k=i[a+2],N=i[a+3],T=i[a+4],w=i[a+5],A=i[a+6],D=i[a+7],g=i[a+8],q=i[a+9],M=i[a+10],G=i[a+11],Z=i[a+12],U=i[a+13],$=i[a+14],Q=i[a+15],z=F[0],P=F[1],I=F[2],R=F[3];z=E(z,P,I,R,_,7,n[0]),R=E(R,z,P,I,b,12,n[1]),I=E(I,R,z,P,k,17,n[2]),P=E(P,I,R,z,N,22,n[3]),z=E(z,P,I,R,T,7,n[4]),R=E(R,z,P,I,w,12,n[5]),I=E(I,R,z,P,A,17,n[6]),P=E(P,I,R,z,D,22,n[7]),z=E(z,P,I,R,g,7,n[8]),R=E(R,z,P,I,q,12,n[9]),I=E(I,R,z,P,M,17,n[10]),P=E(P,I,R,z,G,22,n[11]),z=E(z,P,I,R,Z,7,n[12]),R=E(R,z,P,I,U,12,n[13]),I=E(I,R,z,P,$,17,n[14]),P=E(P,I,R,z,Q,22,n[15]),z=l(z,P,I,R,b,5,n[16]),R=l(R,z,P,I,A,9,n[17]),I=l(I,R,z,P,G,14,n[18]),P=l(P,I,R,z,_,20,n[19]),z=l(z,P,I,R,w,5,n[20]),R=l(R,z,P,I,M,9,n[21]),I=l(I,R,z,P,Q,14,n[22]),P=l(P,I,R,z,T,20,n[23]),z=l(z,P,I,R,q,5,n[24]),R=l(R,z,P,I,$,9,n[25]),I=l(I,R,z,P,N,14,n[26]),P=l(P,I,R,z,g,20,n[27]),z=l(z,P,I,R,U,5,n[28]),R=l(R,z,P,I,k,9,n[29]),I=l(I,R,z,P,D,14,n[30]),P=l(P,I,R,z,Z,20,n[31]),z=m(z,P,I,R,w,4,n[32]),R=m(R,z,P,I,g,11,n[33]),I=m(I,R,z,P,G,16,n[34]),P=m(P,I,R,z,$,23,n[35]),z=m(z,P,I,R,b,4,n[36]),R=m(R,z,P,I,T,11,n[37]),I=m(I,R,z,P,D,16,n[38]),P=m(P,I,R,z,M,23,n[39]),z=m(z,P,I,R,U,4,n[40]),R=m(R,z,P,I,_,11,n[41]),I=m(I,R,z,P,N,16,n[42]),P=m(P,I,R,z,A,23,n[43]),z=m(z,P,I,R,q,4,n[44]),R=m(R,z,P,I,Z,11,n[45]),I=m(I,R,z,P,Q,16,n[46]),P=m(P,I,R,z,k,23,n[47]),z=y(z,P,I,R,_,6,n[48]),R=y(R,z,P,I,D,10,n[49]),I=y(I,R,z,P,$,15,n[50]),P=y(P,I,R,z,w,21,n[51]),z=y(z,P,I,R,Z,6,n[52]),R=y(R,z,P,I,N,10,n[53]),I=y(I,R,z,P,M,15,n[54]),P=y(P,I,R,z,b,21,n[55]),z=y(z,P,I,R,g,6,n[56]),R=y(R,z,P,I,Q,10,n[57]),I=y(I,R,z,P,A,15,n[58]),P=y(P,I,R,z,U,21,n[59]),z=y(z,P,I,R,T,6,n[60]),R=y(R,z,P,I,G,10,n[61]),I=y(I,R,z,P,k,15,n[62]),P=y(P,I,R,z,q,21,n[63]),F[0]=F[0]+z|0,F[1]=F[1]+P|0,F[2]=F[2]+I|0,F[3]=F[3]+R|0},_doFinalize:function(){var i=this._data,a=i.words,v=this._nDataBytes*8,f=i.sigBytes*8;a[f>>>5]|=128<<24-f%32;var x=e.floor(v/4294967296),F=v;a[(f+64>>>9<<4)+15]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,a[(f+64>>>9<<4)+14]=(F<<8|F>>>24)&16711935|(F<<24|F>>>8)&4278255360,i.sigBytes=(a.length+1)*4,this._process();for(var _=this._hash,b=_.words,k=0;k<4;k++){var N=b[k];b[k]=(N<<8|N>>>24)&16711935|(N<<24|N>>>8)&4278255360}return _},clone:function(){var i=s.clone.call(this);return i._hash=this._hash.clone(),i}});function E(i,a,v,f,x,F,_){var b=i+(a&v|~a&f)+x+_;return(b<<F|b>>>32-F)+a}function l(i,a,v,f,x,F,_){var b=i+(a&f|v&~f)+x+_;return(b<<F|b>>>32-F)+a}function m(i,a,v,f,x,F,_){var b=i+(a^v^f)+x+_;return(b<<F|b>>>32-F)+a}function y(i,a,v,f,x,F,_){var b=i+(v^(a|~f))+x+_;return(b<<F|b>>>32-F)+a}h.MD5=s._createHelper(o),h.HmacMD5=s._createHmacHelper(o)})(Math),t.MD5})})(Pt)),Pt.exports}var Tt={exports:{}},hs=Tt.exports,An;function Pa(){return An||(An=1,(function(r,u){(function(t,e){r.exports=e(fe())})(hs,function(t){return(function(){var e=t,h=e.lib,c=h.WordArray,d=h.Hasher,s=e.algo,p=[],n=s.SHA1=d.extend({_doReset:function(){this._hash=new c.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(o,E){for(var l=this._hash.words,m=l[0],y=l[1],i=l[2],a=l[3],v=l[4],f=0;f<80;f++){if(f<16)p[f]=o[E+f]|0;else{var x=p[f-3]^p[f-8]^p[f-14]^p[f-16];p[f]=x<<1|x>>>31}var F=(m<<5|m>>>27)+v+p[f];f<20?F+=(y&i|~y&a)+1518500249:f<40?F+=(y^i^a)+1859775393:f<60?F+=(y&i|y&a|i&a)-1894007588:F+=(y^i^a)-899497514,v=a,a=i,i=y<<30|y>>>2,y=m,m=F}l[0]=l[0]+m|0,l[1]=l[1]+y|0,l[2]=l[2]+i|0,l[3]=l[3]+a|0,l[4]=l[4]+v|0},_doFinalize:function(){var o=this._data,E=o.words,l=this._nDataBytes*8,m=o.sigBytes*8;return E[m>>>5]|=128<<24-m%32,E[(m+64>>>9<<4)+14]=Math.floor(l/4294967296),E[(m+64>>>9<<4)+15]=l,o.sigBytes=E.length*4,this._process(),this._hash},clone:function(){var o=d.clone.call(this);return o._hash=this._hash.clone(),o}});e.SHA1=d._createHelper(n),e.HmacSHA1=d._createHmacHelper(n)})(),t.SHA1})})(Tt)),Tt.exports}var zt={exports:{}},vs=zt.exports,bn;function $r(){return bn||(bn=1,(function(r,u){(function(t,e){r.exports=e(fe())})(vs,function(t){return(function(e){var h=t,c=h.lib,d=c.WordArray,s=c.Hasher,p=h.algo,n=[],o=[];(function(){function m(v){for(var f=e.sqrt(v),x=2;x<=f;x++)if(!(v%x))return!1;return!0}function y(v){return(v-(v|0))*4294967296|0}for(var i=2,a=0;a<64;)m(i)&&(a<8&&(n[a]=y(e.pow(i,1/2))),o[a]=y(e.pow(i,1/3)),a++),i++})();var E=[],l=p.SHA256=s.extend({_doReset:function(){this._hash=new d.init(n.slice(0))},_doProcessBlock:function(m,y){for(var i=this._hash.words,a=i[0],v=i[1],f=i[2],x=i[3],F=i[4],_=i[5],b=i[6],k=i[7],N=0;N<64;N++){if(N<16)E[N]=m[y+N]|0;else{var T=E[N-15],w=(T<<25|T>>>7)^(T<<14|T>>>18)^T>>>3,A=E[N-2],D=(A<<15|A>>>17)^(A<<13|A>>>19)^A>>>10;E[N]=w+E[N-7]+D+E[N-16]}var g=F&_^~F&b,q=a&v^a&f^v&f,M=(a<<30|a>>>2)^(a<<19|a>>>13)^(a<<10|a>>>22),G=(F<<26|F>>>6)^(F<<21|F>>>11)^(F<<7|F>>>25),Z=k+G+g+o[N]+E[N],U=M+q;k=b,b=_,_=F,F=x+Z|0,x=f,f=v,v=a,a=Z+U|0}i[0]=i[0]+a|0,i[1]=i[1]+v|0,i[2]=i[2]+f|0,i[3]=i[3]+x|0,i[4]=i[4]+F|0,i[5]=i[5]+_|0,i[6]=i[6]+b|0,i[7]=i[7]+k|0},_doFinalize:function(){var m=this._data,y=m.words,i=this._nDataBytes*8,a=m.sigBytes*8;return y[a>>>5]|=128<<24-a%32,y[(a+64>>>9<<4)+14]=e.floor(i/4294967296),y[(a+64>>>9<<4)+15]=i,m.sigBytes=y.length*4,this._process(),this._hash},clone:function(){var m=s.clone.call(this);return m._hash=this._hash.clone(),m}});h.SHA256=s._createHelper(l),h.HmacSHA256=s._createHmacHelper(l)})(Math),t.SHA256})})(zt)),zt.exports}var qt={exports:{}},gs=qt.exports,Dn;function ms(){return Dn||(Dn=1,(function(r,u){(function(t,e,h){r.exports=e(fe(),$r())})(gs,function(t){return(function(){var e=t,h=e.lib,c=h.WordArray,d=e.algo,s=d.SHA256,p=d.SHA224=s.extend({_doReset:function(){this._hash=new c.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var n=s._doFinalize.call(this);return n.sigBytes-=4,n}});e.SHA224=s._createHelper(p),e.HmacSHA224=s._createHmacHelper(p)})(),t.SHA224})})(qt)),qt.exports}var Lt={exports:{}},ys=Lt.exports,_n;function Ta(){return _n||(_n=1,(function(r,u){(function(t,e,h){r.exports=e(fe(),pr())})(ys,function(t){return(function(){var e=t,h=e.lib,c=h.Hasher,d=e.x64,s=d.Word,p=d.WordArray,n=e.algo;function o(){return s.create.apply(s,arguments)}var E=[o(1116352408,3609767458),o(1899447441,602891725),o(3049323471,3964484399),o(3921009573,2173295548),o(961987163,4081628472),o(1508970993,3053834265),o(2453635748,2937671579),o(2870763221,3664609560),o(3624381080,2734883394),o(310598401,1164996542),o(607225278,1323610764),o(1426881987,3590304994),o(1925078388,4068182383),o(2162078206,991336113),o(2614888103,633803317),o(3248222580,3479774868),o(3835390401,2666613458),o(4022224774,944711139),o(264347078,2341262773),o(604807628,2007800933),o(770255983,1495990901),o(1249150122,1856431235),o(1555081692,3175218132),o(1996064986,2198950837),o(2554220882,3999719339),o(2821834349,766784016),o(2952996808,2566594879),o(3210313671,3203337956),o(3336571891,1034457026),o(3584528711,2466948901),o(113926993,3758326383),o(338241895,168717936),o(666307205,1188179964),o(773529912,1546045734),o(1294757372,1522805485),o(1396182291,2643833823),o(1695183700,2343527390),o(1986661051,1014477480),o(2177026350,1206759142),o(2456956037,344077627),o(2730485921,1290863460),o(2820302411,3158454273),o(3259730800,3505952657),o(3345764771,106217008),o(3516065817,3606008344),o(3600352804,1432725776),o(4094571909,1467031594),o(275423344,851169720),o(430227734,3100823752),o(506948616,1363258195),o(659060556,3750685593),o(883997877,3785050280),o(958139571,3318307427),o(1322822218,3812723403),o(1537002063,2003034995),o(1747873779,3602036899),o(1955562222,1575990012),o(2024104815,1125592928),o(2227730452,2716904306),o(2361852424,442776044),o(2428436474,593698344),o(2756734187,3733110249),o(3204031479,2999351573),o(3329325298,3815920427),o(3391569614,3928383900),o(3515267271,566280711),o(3940187606,3454069534),o(4118630271,4000239992),o(116418474,1914138554),o(174292421,2731055270),o(289380356,3203993006),o(460393269,320620315),o(685471733,587496836),o(852142971,1086792851),o(1017036298,365543100),o(1126000580,2618297676),o(1288033470,3409855158),o(1501505948,4234509866),o(1607167915,987167468),o(1816402316,1246189591)],l=[];(function(){for(var y=0;y<80;y++)l[y]=o()})();var m=n.SHA512=c.extend({_doReset:function(){this._hash=new p.init([new s.init(1779033703,4089235720),new s.init(3144134277,2227873595),new s.init(1013904242,4271175723),new s.init(2773480762,1595750129),new s.init(1359893119,2917565137),new s.init(2600822924,725511199),new s.init(528734635,4215389547),new s.init(1541459225,327033209)])},_doProcessBlock:function(y,i){for(var a=this._hash.words,v=a[0],f=a[1],x=a[2],F=a[3],_=a[4],b=a[5],k=a[6],N=a[7],T=v.high,w=v.low,A=f.high,D=f.low,g=x.high,q=x.low,M=F.high,G=F.low,Z=_.high,U=_.low,$=b.high,Q=b.low,z=k.high,P=k.low,I=N.high,R=N.low,H=T,V=w,X=A,j=D,ue=g,ne=q,je=M,we=G,se=Z,Ee=U,Be=$,Le=Q,a0=z,i0=P,o0=I,h0=R,Oe=0;Oe<80;Oe++){var Te,Ne,e0=l[Oe];if(Oe<16)Ne=e0.high=y[i+Oe*2]|0,Te=e0.low=y[i+Oe*2+1]|0;else{var m0=l[Oe-15],W=m0.high,he=m0.low,ke=(W>>>1|he<<31)^(W>>>8|he<<24)^W>>>7,t0=(he>>>1|W<<31)^(he>>>8|W<<24)^(he>>>7|W<<25),z0=l[Oe-2],Qe=z0.high,me=z0.low,q0=(Qe>>>19|me<<13)^(Qe<<3|me>>>29)^Qe>>>6,G0=(me>>>19|Qe<<13)^(me<<3|Qe>>>29)^(me>>>6|Qe<<26),L0=l[Oe-7],u0=L0.high,O0=L0.low,M0=l[Oe-16],U0=M0.high,X0=M0.low;Te=t0+O0,Ne=ke+u0+(Te>>>0<t0>>>0?1:0),Te=Te+G0,Ne=Ne+q0+(Te>>>0<G0>>>0?1:0),Te=Te+X0,Ne=Ne+U0+(Te>>>0<X0>>>0?1:0),e0.high=Ne,e0.low=Te}var lt=se&Be^~se&a0,dt=Ee&Le^~Ee&i0,Q0=H&X^H&ue^X&ue,d0=V&j^V&ne^j&ne,v0=(H>>>28|V<<4)^(H<<30|V>>>2)^(H<<25|V>>>7),B0=(V>>>28|H<<4)^(V<<30|H>>>2)^(V<<25|H>>>7),A0=(se>>>14|Ee<<18)^(se>>>18|Ee<<14)^(se<<23|Ee>>>9),ft=(Ee>>>14|se<<18)^(Ee>>>18|se<<14)^(Ee<<23|se>>>9),Ue=E[Oe],ie=Ue.high,_0=Ue.low,He=h0+ft,Ye=o0+A0+(He>>>0<h0>>>0?1:0),He=He+dt,Ye=Ye+lt+(He>>>0<dt>>>0?1:0),He=He+_0,Ye=Ye+ie+(He>>>0<_0>>>0?1:0),He=He+Te,Ye=Ye+Ne+(He>>>0<Te>>>0?1:0),Ie=B0+d0,Ve=v0+Q0+(Ie>>>0<B0>>>0?1:0);o0=a0,h0=i0,a0=Be,i0=Le,Be=se,Le=Ee,Ee=we+He|0,se=je+Ye+(Ee>>>0<we>>>0?1:0)|0,je=ue,we=ne,ue=X,ne=j,X=H,j=V,V=He+Ie|0,H=Ye+Ve+(V>>>0<He>>>0?1:0)|0}w=v.low=w+V,v.high=T+H+(w>>>0<V>>>0?1:0),D=f.low=D+j,f.high=A+X+(D>>>0<j>>>0?1:0),q=x.low=q+ne,x.high=g+ue+(q>>>0<ne>>>0?1:0),G=F.low=G+we,F.high=M+je+(G>>>0<we>>>0?1:0),U=_.low=U+Ee,_.high=Z+se+(U>>>0<Ee>>>0?1:0),Q=b.low=Q+Le,b.high=$+Be+(Q>>>0<Le>>>0?1:0),P=k.low=P+i0,k.high=z+a0+(P>>>0<i0>>>0?1:0),R=N.low=R+h0,N.high=I+o0+(R>>>0<h0>>>0?1:0)},_doFinalize:function(){var y=this._data,i=y.words,a=this._nDataBytes*8,v=y.sigBytes*8;i[v>>>5]|=128<<24-v%32,i[(v+128>>>10<<5)+30]=Math.floor(a/4294967296),i[(v+128>>>10<<5)+31]=a,y.sigBytes=i.length*4,this._process();var f=this._hash.toX32();return f},clone:function(){var y=c.clone.call(this);return y._hash=this._hash.clone(),y},blockSize:1024/32});e.SHA512=c._createHelper(m),e.HmacSHA512=c._createHmacHelper(m)})(),t.SHA512})})(Lt)),Lt.exports}var Ot={exports:{}},Cs=Ot.exports,wn;function Fs(){return wn||(wn=1,(function(r,u){(function(t,e,h){r.exports=e(fe(),pr(),Ta())})(Cs,function(t){return(function(){var e=t,h=e.x64,c=h.Word,d=h.WordArray,s=e.algo,p=s.SHA512,n=s.SHA384=p.extend({_doReset:function(){this._hash=new d.init([new c.init(3418070365,3238371032),new c.init(1654270250,914150663),new c.init(2438529370,812702999),new c.init(355462360,4144912697),new c.init(1731405415,4290775857),new c.init(2394180231,1750603025),new c.init(3675008525,1694076839),new c.init(1203062813,3204075428)])},_doFinalize:function(){var o=p._doFinalize.call(this);return o.sigBytes-=16,o}});e.SHA384=p._createHelper(n),e.HmacSHA384=p._createHmacHelper(n)})(),t.SHA384})})(Ot)),Ot.exports}var Mt={exports:{}},Es=Mt.exports,Sn;function Bs(){return Sn||(Sn=1,(function(r,u){(function(t,e,h){r.exports=e(fe(),pr())})(Es,function(t){return(function(e){var h=t,c=h.lib,d=c.WordArray,s=c.Hasher,p=h.x64,n=p.Word,o=h.algo,E=[],l=[],m=[];(function(){for(var a=1,v=0,f=0;f<24;f++){E[a+5*v]=(f+1)*(f+2)/2%64;var x=v%5,F=(2*a+3*v)%5;a=x,v=F}for(var a=0;a<5;a++)for(var v=0;v<5;v++)l[a+5*v]=v+(2*a+3*v)%5*5;for(var _=1,b=0;b<24;b++){for(var k=0,N=0,T=0;T<7;T++){if(_&1){var w=(1<<T)-1;w<32?N^=1<<w:k^=1<<w-32}_&128?_=_<<1^113:_<<=1}m[b]=n.create(k,N)}})();var y=[];(function(){for(var a=0;a<25;a++)y[a]=n.create()})();var i=o.SHA3=s.extend({cfg:s.cfg.extend({outputLength:512}),_doReset:function(){for(var a=this._state=[],v=0;v<25;v++)a[v]=new n.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(a,v){for(var f=this._state,x=this.blockSize/2,F=0;F<x;F++){var _=a[v+2*F],b=a[v+2*F+1];_=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,b=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360;var k=f[F];k.high^=b,k.low^=_}for(var N=0;N<24;N++){for(var T=0;T<5;T++){for(var w=0,A=0,D=0;D<5;D++){var k=f[T+5*D];w^=k.high,A^=k.low}var g=y[T];g.high=w,g.low=A}for(var T=0;T<5;T++)for(var q=y[(T+4)%5],M=y[(T+1)%5],G=M.high,Z=M.low,w=q.high^(G<<1|Z>>>31),A=q.low^(Z<<1|G>>>31),D=0;D<5;D++){var k=f[T+5*D];k.high^=w,k.low^=A}for(var U=1;U<25;U++){var w,A,k=f[U],$=k.high,Q=k.low,z=E[U];z<32?(w=$<<z|Q>>>32-z,A=Q<<z|$>>>32-z):(w=Q<<z-32|$>>>64-z,A=$<<z-32|Q>>>64-z);var P=y[l[U]];P.high=w,P.low=A}var I=y[0],R=f[0];I.high=R.high,I.low=R.low;for(var T=0;T<5;T++)for(var D=0;D<5;D++){var U=T+5*D,k=f[U],H=y[U],V=y[(T+1)%5+5*D],X=y[(T+2)%5+5*D];k.high=H.high^~V.high&X.high,k.low=H.low^~V.low&X.low}var k=f[0],j=m[N];k.high^=j.high,k.low^=j.low}},_doFinalize:function(){var a=this._data,v=a.words;this._nDataBytes*8;var f=a.sigBytes*8,x=this.blockSize*32;v[f>>>5]|=1<<24-f%32,v[(e.ceil((f+1)/x)*x>>>5)-1]|=128,a.sigBytes=v.length*4,this._process();for(var F=this._state,_=this.cfg.outputLength/8,b=_/8,k=[],N=0;N<b;N++){var T=F[N],w=T.high,A=T.low;w=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,A=(A<<8|A>>>24)&16711935|(A<<24|A>>>8)&4278255360,k.push(A),k.push(w)}return new d.init(k,_)},clone:function(){for(var a=s.clone.call(this),v=a._state=this._state.slice(0),f=0;f<25;f++)v[f]=v[f].clone();return a}});h.SHA3=s._createHelper(i),h.HmacSHA3=s._createHmacHelper(i)})(Math),t.SHA3})})(Mt)),Mt.exports}var Ut={exports:{}},As=Ut.exports,kn;function bs(){return kn||(kn=1,(function(r,u){(function(t,e){r.exports=e(fe())})(As,function(t){/** @preserve
184
+ (c) 2012 by Cédric Mesnil. All rights reserved.
185
+
186
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
187
+
188
+ - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
189
+ - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
190
+
191
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
192
+ */return(function(e){var h=t,c=h.lib,d=c.WordArray,s=c.Hasher,p=h.algo,n=d.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),o=d.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),E=d.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),l=d.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),m=d.create([0,1518500249,1859775393,2400959708,2840853838]),y=d.create([1352829926,1548603684,1836072691,2053994217,0]),i=p.RIPEMD160=s.extend({_doReset:function(){this._hash=d.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(b,k){for(var N=0;N<16;N++){var T=k+N,w=b[T];b[T]=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360}var A=this._hash.words,D=m.words,g=y.words,q=n.words,M=o.words,G=E.words,Z=l.words,U,$,Q,z,P,I,R,H,V,X;I=U=A[0],R=$=A[1],H=Q=A[2],V=z=A[3],X=P=A[4];for(var j,N=0;N<80;N+=1)j=U+b[k+q[N]]|0,N<16?j+=a($,Q,z)+D[0]:N<32?j+=v($,Q,z)+D[1]:N<48?j+=f($,Q,z)+D[2]:N<64?j+=x($,Q,z)+D[3]:j+=F($,Q,z)+D[4],j=j|0,j=_(j,G[N]),j=j+P|0,U=P,P=z,z=_(Q,10),Q=$,$=j,j=I+b[k+M[N]]|0,N<16?j+=F(R,H,V)+g[0]:N<32?j+=x(R,H,V)+g[1]:N<48?j+=f(R,H,V)+g[2]:N<64?j+=v(R,H,V)+g[3]:j+=a(R,H,V)+g[4],j=j|0,j=_(j,Z[N]),j=j+X|0,I=X,X=V,V=_(H,10),H=R,R=j;j=A[1]+Q+V|0,A[1]=A[2]+z+X|0,A[2]=A[3]+P+I|0,A[3]=A[4]+U+R|0,A[4]=A[0]+$+H|0,A[0]=j},_doFinalize:function(){var b=this._data,k=b.words,N=this._nDataBytes*8,T=b.sigBytes*8;k[T>>>5]|=128<<24-T%32,k[(T+64>>>9<<4)+14]=(N<<8|N>>>24)&16711935|(N<<24|N>>>8)&4278255360,b.sigBytes=(k.length+1)*4,this._process();for(var w=this._hash,A=w.words,D=0;D<5;D++){var g=A[D];A[D]=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360}return w},clone:function(){var b=s.clone.call(this);return b._hash=this._hash.clone(),b}});function a(b,k,N){return b^k^N}function v(b,k,N){return b&k|~b&N}function f(b,k,N){return(b|~k)^N}function x(b,k,N){return b&N|k&~N}function F(b,k,N){return b^(k|~N)}function _(b,k){return b<<k|b>>>32-k}h.RIPEMD160=s._createHelper(i),h.HmacRIPEMD160=s._createHmacHelper(i)})(),t.RIPEMD160})})(Ut)),Ut.exports}var Ht={exports:{}},Ds=Ht.exports,In;function Wr(){return In||(In=1,(function(r,u){(function(t,e){r.exports=e(fe())})(Ds,function(t){(function(){var e=t,h=e.lib,c=h.Base,d=e.enc,s=d.Utf8,p=e.algo;p.HMAC=c.extend({init:function(n,o){n=this._hasher=new n.init,typeof o=="string"&&(o=s.parse(o));var E=n.blockSize,l=E*4;o.sigBytes>l&&(o=n.finalize(o)),o.clamp();for(var m=this._oKey=o.clone(),y=this._iKey=o.clone(),i=m.words,a=y.words,v=0;v<E;v++)i[v]^=1549556828,a[v]^=909522486;m.sigBytes=y.sigBytes=l,this.reset()},reset:function(){var n=this._hasher;n.reset(),n.update(this._iKey)},update:function(n){return this._hasher.update(n),this},finalize:function(n){var o=this._hasher,E=o.finalize(n);o.reset();var l=o.finalize(this._oKey.clone().concat(E));return l}})})()})})(Ht)),Ht.exports}var $t={exports:{}},_s=$t.exports,Rn;function ws(){return Rn||(Rn=1,(function(r,u){(function(t,e,h){r.exports=e(fe(),$r(),Wr())})(_s,function(t){return(function(){var e=t,h=e.lib,c=h.Base,d=h.WordArray,s=e.algo,p=s.SHA256,n=s.HMAC,o=s.PBKDF2=c.extend({cfg:c.extend({keySize:128/32,hasher:p,iterations:25e4}),init:function(E){this.cfg=this.cfg.extend(E)},compute:function(E,l){for(var m=this.cfg,y=n.create(m.hasher,E),i=d.create(),a=d.create([1]),v=i.words,f=a.words,x=m.keySize,F=m.iterations;v.length<x;){var _=y.update(l).finalize(a);y.reset();for(var b=_.words,k=b.length,N=_,T=1;T<F;T++){N=y.finalize(N),y.reset();for(var w=N.words,A=0;A<k;A++)b[A]^=w[A]}i.concat(_),f[0]++}return i.sigBytes=x*4,i}});e.PBKDF2=function(E,l,m){return o.create(m).compute(E,l)}})(),t.PBKDF2})})($t)),$t.exports}var Wt={exports:{}},Ss=Wt.exports,Nn;function T0(){return Nn||(Nn=1,(function(r,u){(function(t,e,h){r.exports=e(fe(),Pa(),Wr())})(Ss,function(t){return(function(){var e=t,h=e.lib,c=h.Base,d=h.WordArray,s=e.algo,p=s.MD5,n=s.EvpKDF=c.extend({cfg:c.extend({keySize:128/32,hasher:p,iterations:1}),init:function(o){this.cfg=this.cfg.extend(o)},compute:function(o,E){for(var l,m=this.cfg,y=m.hasher.create(),i=d.create(),a=i.words,v=m.keySize,f=m.iterations;a.length<v;){l&&y.update(l),l=y.update(o).finalize(E),y.reset();for(var x=1;x<f;x++)l=y.finalize(l),y.reset();i.concat(l)}return i.sigBytes=v*4,i}});e.EvpKDF=function(o,E,l){return n.create(l).compute(o,E)}})(),t.EvpKDF})})(Wt)),Wt.exports}var jt={exports:{}},ks=jt.exports,Pn;function Xe(){return Pn||(Pn=1,(function(r,u){(function(t,e,h){r.exports=e(fe(),T0())})(ks,function(t){t.lib.Cipher||(function(e){var h=t,c=h.lib,d=c.Base,s=c.WordArray,p=c.BufferedBlockAlgorithm,n=h.enc;n.Utf8;var o=n.Base64,E=h.algo,l=E.EvpKDF,m=c.Cipher=p.extend({cfg:d.extend(),createEncryptor:function(w,A){return this.create(this._ENC_XFORM_MODE,w,A)},createDecryptor:function(w,A){return this.create(this._DEC_XFORM_MODE,w,A)},init:function(w,A,D){this.cfg=this.cfg.extend(D),this._xformMode=w,this._key=A,this.reset()},reset:function(){p.reset.call(this),this._doReset()},process:function(w){return this._append(w),this._process()},finalize:function(w){w&&this._append(w);var A=this._doFinalize();return A},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:(function(){function w(A){return typeof A=="string"?T:b}return function(A){return{encrypt:function(D,g,q){return w(g).encrypt(A,D,g,q)},decrypt:function(D,g,q){return w(g).decrypt(A,D,g,q)}}}})()});c.StreamCipher=m.extend({_doFinalize:function(){var w=this._process(!0);return w},blockSize:1});var y=h.mode={},i=c.BlockCipherMode=d.extend({createEncryptor:function(w,A){return this.Encryptor.create(w,A)},createDecryptor:function(w,A){return this.Decryptor.create(w,A)},init:function(w,A){this._cipher=w,this._iv=A}}),a=y.CBC=(function(){var w=i.extend();w.Encryptor=w.extend({processBlock:function(D,g){var q=this._cipher,M=q.blockSize;A.call(this,D,g,M),q.encryptBlock(D,g),this._prevBlock=D.slice(g,g+M)}}),w.Decryptor=w.extend({processBlock:function(D,g){var q=this._cipher,M=q.blockSize,G=D.slice(g,g+M);q.decryptBlock(D,g),A.call(this,D,g,M),this._prevBlock=G}});function A(D,g,q){var M,G=this._iv;G?(M=G,this._iv=e):M=this._prevBlock;for(var Z=0;Z<q;Z++)D[g+Z]^=M[Z]}return w})(),v=h.pad={},f=v.Pkcs7={pad:function(w,A){for(var D=A*4,g=D-w.sigBytes%D,q=g<<24|g<<16|g<<8|g,M=[],G=0;G<g;G+=4)M.push(q);var Z=s.create(M,g);w.concat(Z)},unpad:function(w){var A=w.words[w.sigBytes-1>>>2]&255;w.sigBytes-=A}};c.BlockCipher=m.extend({cfg:m.cfg.extend({mode:a,padding:f}),reset:function(){var w;m.reset.call(this);var A=this.cfg,D=A.iv,g=A.mode;this._xformMode==this._ENC_XFORM_MODE?w=g.createEncryptor:(w=g.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==w?this._mode.init(this,D&&D.words):(this._mode=w.call(g,this,D&&D.words),this._mode.__creator=w)},_doProcessBlock:function(w,A){this._mode.processBlock(w,A)},_doFinalize:function(){var w,A=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(A.pad(this._data,this.blockSize),w=this._process(!0)):(w=this._process(!0),A.unpad(w)),w},blockSize:128/32});var x=c.CipherParams=d.extend({init:function(w){this.mixIn(w)},toString:function(w){return(w||this.formatter).stringify(this)}}),F=h.format={},_=F.OpenSSL={stringify:function(w){var A,D=w.ciphertext,g=w.salt;return g?A=s.create([1398893684,1701076831]).concat(g).concat(D):A=D,A.toString(o)},parse:function(w){var A,D=o.parse(w),g=D.words;return g[0]==1398893684&&g[1]==1701076831&&(A=s.create(g.slice(2,4)),g.splice(0,4),D.sigBytes-=16),x.create({ciphertext:D,salt:A})}},b=c.SerializableCipher=d.extend({cfg:d.extend({format:_}),encrypt:function(w,A,D,g){g=this.cfg.extend(g);var q=w.createEncryptor(D,g),M=q.finalize(A),G=q.cfg;return x.create({ciphertext:M,key:D,iv:G.iv,algorithm:w,mode:G.mode,padding:G.padding,blockSize:w.blockSize,formatter:g.format})},decrypt:function(w,A,D,g){g=this.cfg.extend(g),A=this._parse(A,g.format);var q=w.createDecryptor(D,g).finalize(A.ciphertext);return q},_parse:function(w,A){return typeof w=="string"?A.parse(w,this):w}}),k=h.kdf={},N=k.OpenSSL={execute:function(w,A,D,g,q){if(g||(g=s.random(64/8)),q)var M=l.create({keySize:A+D,hasher:q}).compute(w,g);else var M=l.create({keySize:A+D}).compute(w,g);var G=s.create(M.words.slice(A),D*4);return M.sigBytes=A*4,x.create({key:M,iv:G,salt:g})}},T=c.PasswordBasedCipher=b.extend({cfg:b.cfg.extend({kdf:N}),encrypt:function(w,A,D,g){g=this.cfg.extend(g);var q=g.kdf.execute(D,w.keySize,w.ivSize,g.salt,g.hasher);g.iv=q.iv;var M=b.encrypt.call(this,w,A,q.key,g);return M.mixIn(q),M},decrypt:function(w,A,D,g){g=this.cfg.extend(g),A=this._parse(A,g.format);var q=g.kdf.execute(D,w.keySize,w.ivSize,A.salt,g.hasher);g.iv=q.iv;var M=b.decrypt.call(this,w,A,q.key,g);return M}})})()})})(jt)),jt.exports}var Vt={exports:{}},Is=Vt.exports,Tn;function Rs(){return Tn||(Tn=1,(function(r,u){(function(t,e,h){r.exports=e(fe(),Xe())})(Is,function(t){return t.mode.CFB=(function(){var e=t.lib.BlockCipherMode.extend();e.Encryptor=e.extend({processBlock:function(c,d){var s=this._cipher,p=s.blockSize;h.call(this,c,d,p,s),this._prevBlock=c.slice(d,d+p)}}),e.Decryptor=e.extend({processBlock:function(c,d){var s=this._cipher,p=s.blockSize,n=c.slice(d,d+p);h.call(this,c,d,p,s),this._prevBlock=n}});function h(c,d,s,p){var n,o=this._iv;o?(n=o.slice(0),this._iv=void 0):n=this._prevBlock,p.encryptBlock(n,0);for(var E=0;E<s;E++)c[d+E]^=n[E]}return e})(),t.mode.CFB})})(Vt)),Vt.exports}var Kt={exports:{}},Ns=Kt.exports,zn;function Ps(){return zn||(zn=1,(function(r,u){(function(t,e,h){r.exports=e(fe(),Xe())})(Ns,function(t){return t.mode.CTR=(function(){var e=t.lib.BlockCipherMode.extend(),h=e.Encryptor=e.extend({processBlock:function(c,d){var s=this._cipher,p=s.blockSize,n=this._iv,o=this._counter;n&&(o=this._counter=n.slice(0),this._iv=void 0);var E=o.slice(0);s.encryptBlock(E,0),o[p-1]=o[p-1]+1|0;for(var l=0;l<p;l++)c[d+l]^=E[l]}});return e.Decryptor=h,e})(),t.mode.CTR})})(Kt)),Kt.exports}var Gt={exports:{}},Ts=Gt.exports,qn;function zs(){return qn||(qn=1,(function(r,u){(function(t,e,h){r.exports=e(fe(),Xe())})(Ts,function(t){/** @preserve
193
+ * Counter block mode compatible with Dr Brian Gladman fileenc.c
194
+ * derived from CryptoJS.mode.CTR
195
+ * Jan Hruby jhruby.web@gmail.com
196
+ */return t.mode.CTRGladman=(function(){var e=t.lib.BlockCipherMode.extend();function h(s){if((s>>24&255)===255){var p=s>>16&255,n=s>>8&255,o=s&255;p===255?(p=0,n===255?(n=0,o===255?o=0:++o):++n):++p,s=0,s+=p<<16,s+=n<<8,s+=o}else s+=1<<24;return s}function c(s){return(s[0]=h(s[0]))===0&&(s[1]=h(s[1])),s}var d=e.Encryptor=e.extend({processBlock:function(s,p){var n=this._cipher,o=n.blockSize,E=this._iv,l=this._counter;E&&(l=this._counter=E.slice(0),this._iv=void 0),c(l);var m=l.slice(0);n.encryptBlock(m,0);for(var y=0;y<o;y++)s[p+y]^=m[y]}});return e.Decryptor=d,e})(),t.mode.CTRGladman})})(Gt)),Gt.exports}var Xt={exports:{}},qs=Xt.exports,Ln;function Ls(){return Ln||(Ln=1,(function(r,u){(function(t,e,h){r.exports=e(fe(),Xe())})(qs,function(t){return t.mode.OFB=(function(){var e=t.lib.BlockCipherMode.extend(),h=e.Encryptor=e.extend({processBlock:function(c,d){var s=this._cipher,p=s.blockSize,n=this._iv,o=this._keystream;n&&(o=this._keystream=n.slice(0),this._iv=void 0),s.encryptBlock(o,0);for(var E=0;E<p;E++)c[d+E]^=o[E]}});return e.Decryptor=h,e})(),t.mode.OFB})})(Xt)),Xt.exports}var Qt={exports:{}},Os=Qt.exports,On;function Ms(){return On||(On=1,(function(r,u){(function(t,e,h){r.exports=e(fe(),Xe())})(Os,function(t){return t.mode.ECB=(function(){var e=t.lib.BlockCipherMode.extend();return e.Encryptor=e.extend({processBlock:function(h,c){this._cipher.encryptBlock(h,c)}}),e.Decryptor=e.extend({processBlock:function(h,c){this._cipher.decryptBlock(h,c)}}),e})(),t.mode.ECB})})(Qt)),Qt.exports}var Yt={exports:{}},Us=Yt.exports,Mn;function Hs(){return Mn||(Mn=1,(function(r,u){(function(t,e,h){r.exports=e(fe(),Xe())})(Us,function(t){return t.pad.AnsiX923={pad:function(e,h){var c=e.sigBytes,d=h*4,s=d-c%d,p=c+s-1;e.clamp(),e.words[p>>>2]|=s<<24-p%4*8,e.sigBytes+=s},unpad:function(e){var h=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=h}},t.pad.Ansix923})})(Yt)),Yt.exports}var Zt={exports:{}},$s=Zt.exports,Un;function Ws(){return Un||(Un=1,(function(r,u){(function(t,e,h){r.exports=e(fe(),Xe())})($s,function(t){return t.pad.Iso10126={pad:function(e,h){var c=h*4,d=c-e.sigBytes%c;e.concat(t.lib.WordArray.random(d-1)).concat(t.lib.WordArray.create([d<<24],1))},unpad:function(e){var h=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=h}},t.pad.Iso10126})})(Zt)),Zt.exports}var Jt={exports:{}},js=Jt.exports,Hn;function Vs(){return Hn||(Hn=1,(function(r,u){(function(t,e,h){r.exports=e(fe(),Xe())})(js,function(t){return t.pad.Iso97971={pad:function(e,h){e.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(e,h)},unpad:function(e){t.pad.ZeroPadding.unpad(e),e.sigBytes--}},t.pad.Iso97971})})(Jt)),Jt.exports}var er={exports:{}},Ks=er.exports,$n;function Gs(){return $n||($n=1,(function(r,u){(function(t,e,h){r.exports=e(fe(),Xe())})(Ks,function(t){return t.pad.ZeroPadding={pad:function(e,h){var c=h*4;e.clamp(),e.sigBytes+=c-(e.sigBytes%c||c)},unpad:function(e){for(var h=e.words,c=e.sigBytes-1,c=e.sigBytes-1;c>=0;c--)if(h[c>>>2]>>>24-c%4*8&255){e.sigBytes=c+1;break}}},t.pad.ZeroPadding})})(er)),er.exports}var tr={exports:{}},Xs=tr.exports,Wn;function Qs(){return Wn||(Wn=1,(function(r,u){(function(t,e,h){r.exports=e(fe(),Xe())})(Xs,function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding})})(tr)),tr.exports}var rr={exports:{}},Ys=rr.exports,jn;function Zs(){return jn||(jn=1,(function(r,u){(function(t,e,h){r.exports=e(fe(),Xe())})(Ys,function(t){return(function(e){var h=t,c=h.lib,d=c.CipherParams,s=h.enc,p=s.Hex,n=h.format;n.Hex={stringify:function(o){return o.ciphertext.toString(p)},parse:function(o){var E=p.parse(o);return d.create({ciphertext:E})}}})(),t.format.Hex})})(rr)),rr.exports}var nr={exports:{}},Js=nr.exports,Vn;function eu(){return Vn||(Vn=1,(function(r,u){(function(t,e,h){r.exports=e(fe(),V0(),K0(),T0(),Xe())})(Js,function(t){return(function(){var e=t,h=e.lib,c=h.BlockCipher,d=e.algo,s=[],p=[],n=[],o=[],E=[],l=[],m=[],y=[],i=[],a=[];(function(){for(var x=[],F=0;F<256;F++)F<128?x[F]=F<<1:x[F]=F<<1^283;for(var _=0,b=0,F=0;F<256;F++){var k=b^b<<1^b<<2^b<<3^b<<4;k=k>>>8^k&255^99,s[_]=k,p[k]=_;var N=x[_],T=x[N],w=x[T],A=x[k]*257^k*16843008;n[_]=A<<24|A>>>8,o[_]=A<<16|A>>>16,E[_]=A<<8|A>>>24,l[_]=A;var A=w*16843009^T*65537^N*257^_*16843008;m[k]=A<<24|A>>>8,y[k]=A<<16|A>>>16,i[k]=A<<8|A>>>24,a[k]=A,_?(_=N^x[x[x[w^N]]],b^=x[x[b]]):_=b=1}})();var v=[0,1,2,4,8,16,32,64,128,27,54],f=d.AES=c.extend({_doReset:function(){var x;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var F=this._keyPriorReset=this._key,_=F.words,b=F.sigBytes/4,k=this._nRounds=b+6,N=(k+1)*4,T=this._keySchedule=[],w=0;w<N;w++)w<b?T[w]=_[w]:(x=T[w-1],w%b?b>6&&w%b==4&&(x=s[x>>>24]<<24|s[x>>>16&255]<<16|s[x>>>8&255]<<8|s[x&255]):(x=x<<8|x>>>24,x=s[x>>>24]<<24|s[x>>>16&255]<<16|s[x>>>8&255]<<8|s[x&255],x^=v[w/b|0]<<24),T[w]=T[w-b]^x);for(var A=this._invKeySchedule=[],D=0;D<N;D++){var w=N-D;if(D%4)var x=T[w];else var x=T[w-4];D<4||w<=4?A[D]=x:A[D]=m[s[x>>>24]]^y[s[x>>>16&255]]^i[s[x>>>8&255]]^a[s[x&255]]}}},encryptBlock:function(x,F){this._doCryptBlock(x,F,this._keySchedule,n,o,E,l,s)},decryptBlock:function(x,F){var _=x[F+1];x[F+1]=x[F+3],x[F+3]=_,this._doCryptBlock(x,F,this._invKeySchedule,m,y,i,a,p);var _=x[F+1];x[F+1]=x[F+3],x[F+3]=_},_doCryptBlock:function(x,F,_,b,k,N,T,w){for(var A=this._nRounds,D=x[F]^_[0],g=x[F+1]^_[1],q=x[F+2]^_[2],M=x[F+3]^_[3],G=4,Z=1;Z<A;Z++){var U=b[D>>>24]^k[g>>>16&255]^N[q>>>8&255]^T[M&255]^_[G++],$=b[g>>>24]^k[q>>>16&255]^N[M>>>8&255]^T[D&255]^_[G++],Q=b[q>>>24]^k[M>>>16&255]^N[D>>>8&255]^T[g&255]^_[G++],z=b[M>>>24]^k[D>>>16&255]^N[g>>>8&255]^T[q&255]^_[G++];D=U,g=$,q=Q,M=z}var U=(w[D>>>24]<<24|w[g>>>16&255]<<16|w[q>>>8&255]<<8|w[M&255])^_[G++],$=(w[g>>>24]<<24|w[q>>>16&255]<<16|w[M>>>8&255]<<8|w[D&255])^_[G++],Q=(w[q>>>24]<<24|w[M>>>16&255]<<16|w[D>>>8&255]<<8|w[g&255])^_[G++],z=(w[M>>>24]<<24|w[D>>>16&255]<<16|w[g>>>8&255]<<8|w[q&255])^_[G++];x[F]=U,x[F+1]=$,x[F+2]=Q,x[F+3]=z},keySize:256/32});e.AES=c._createHelper(f)})(),t.AES})})(nr)),nr.exports}var ar={exports:{}},tu=ar.exports,Kn;function ru(){return Kn||(Kn=1,(function(r,u){(function(t,e,h){r.exports=e(fe(),V0(),K0(),T0(),Xe())})(tu,function(t){return(function(){var e=t,h=e.lib,c=h.WordArray,d=h.BlockCipher,s=e.algo,p=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],n=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],o=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],E=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],m=s.DES=d.extend({_doReset:function(){for(var v=this._key,f=v.words,x=[],F=0;F<56;F++){var _=p[F]-1;x[F]=f[_>>>5]>>>31-_%32&1}for(var b=this._subKeys=[],k=0;k<16;k++){for(var N=b[k]=[],T=o[k],F=0;F<24;F++)N[F/6|0]|=x[(n[F]-1+T)%28]<<31-F%6,N[4+(F/6|0)]|=x[28+(n[F+24]-1+T)%28]<<31-F%6;N[0]=N[0]<<1|N[0]>>>31;for(var F=1;F<7;F++)N[F]=N[F]>>>(F-1)*4+3;N[7]=N[7]<<5|N[7]>>>27}for(var w=this._invSubKeys=[],F=0;F<16;F++)w[F]=b[15-F]},encryptBlock:function(v,f){this._doCryptBlock(v,f,this._subKeys)},decryptBlock:function(v,f){this._doCryptBlock(v,f,this._invSubKeys)},_doCryptBlock:function(v,f,x){this._lBlock=v[f],this._rBlock=v[f+1],y.call(this,4,252645135),y.call(this,16,65535),i.call(this,2,858993459),i.call(this,8,16711935),y.call(this,1,1431655765);for(var F=0;F<16;F++){for(var _=x[F],b=this._lBlock,k=this._rBlock,N=0,T=0;T<8;T++)N|=E[T][((k^_[T])&l[T])>>>0];this._lBlock=k,this._rBlock=b^N}var w=this._lBlock;this._lBlock=this._rBlock,this._rBlock=w,y.call(this,1,1431655765),i.call(this,8,16711935),i.call(this,2,858993459),y.call(this,16,65535),y.call(this,4,252645135),v[f]=this._lBlock,v[f+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function y(v,f){var x=(this._lBlock>>>v^this._rBlock)&f;this._rBlock^=x,this._lBlock^=x<<v}function i(v,f){var x=(this._rBlock>>>v^this._lBlock)&f;this._lBlock^=x,this._rBlock^=x<<v}e.DES=d._createHelper(m);var a=s.TripleDES=d.extend({_doReset:function(){var v=this._key,f=v.words;if(f.length!==2&&f.length!==4&&f.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var x=f.slice(0,2),F=f.length<4?f.slice(0,2):f.slice(2,4),_=f.length<6?f.slice(0,2):f.slice(4,6);this._des1=m.createEncryptor(c.create(x)),this._des2=m.createEncryptor(c.create(F)),this._des3=m.createEncryptor(c.create(_))},encryptBlock:function(v,f){this._des1.encryptBlock(v,f),this._des2.decryptBlock(v,f),this._des3.encryptBlock(v,f)},decryptBlock:function(v,f){this._des3.decryptBlock(v,f),this._des2.encryptBlock(v,f),this._des1.decryptBlock(v,f)},keySize:192/32,ivSize:64/32,blockSize:64/32});e.TripleDES=d._createHelper(a)})(),t.TripleDES})})(ar)),ar.exports}var ir={exports:{}},nu=ir.exports,Gn;function au(){return Gn||(Gn=1,(function(r,u){(function(t,e,h){r.exports=e(fe(),V0(),K0(),T0(),Xe())})(nu,function(t){return(function(){var e=t,h=e.lib,c=h.StreamCipher,d=e.algo,s=d.RC4=c.extend({_doReset:function(){for(var o=this._key,E=o.words,l=o.sigBytes,m=this._S=[],y=0;y<256;y++)m[y]=y;for(var y=0,i=0;y<256;y++){var a=y%l,v=E[a>>>2]>>>24-a%4*8&255;i=(i+m[y]+v)%256;var f=m[y];m[y]=m[i],m[i]=f}this._i=this._j=0},_doProcessBlock:function(o,E){o[E]^=p.call(this)},keySize:256/32,ivSize:0});function p(){for(var o=this._S,E=this._i,l=this._j,m=0,y=0;y<4;y++){E=(E+1)%256,l=(l+o[E])%256;var i=o[E];o[E]=o[l],o[l]=i,m|=o[(o[E]+o[l])%256]<<24-y*8}return this._i=E,this._j=l,m}e.RC4=c._createHelper(s);var n=d.RC4Drop=s.extend({cfg:s.cfg.extend({drop:192}),_doReset:function(){s._doReset.call(this);for(var o=this.cfg.drop;o>0;o--)p.call(this)}});e.RC4Drop=c._createHelper(n)})(),t.RC4})})(ir)),ir.exports}var or={exports:{}},iu=or.exports,Xn;function ou(){return Xn||(Xn=1,(function(r,u){(function(t,e,h){r.exports=e(fe(),V0(),K0(),T0(),Xe())})(iu,function(t){return(function(){var e=t,h=e.lib,c=h.StreamCipher,d=e.algo,s=[],p=[],n=[],o=d.Rabbit=c.extend({_doReset:function(){for(var l=this._key.words,m=this.cfg.iv,y=0;y<4;y++)l[y]=(l[y]<<8|l[y]>>>24)&16711935|(l[y]<<24|l[y]>>>8)&4278255360;var i=this._X=[l[0],l[3]<<16|l[2]>>>16,l[1],l[0]<<16|l[3]>>>16,l[2],l[1]<<16|l[0]>>>16,l[3],l[2]<<16|l[1]>>>16],a=this._C=[l[2]<<16|l[2]>>>16,l[0]&4294901760|l[1]&65535,l[3]<<16|l[3]>>>16,l[1]&4294901760|l[2]&65535,l[0]<<16|l[0]>>>16,l[2]&4294901760|l[3]&65535,l[1]<<16|l[1]>>>16,l[3]&4294901760|l[0]&65535];this._b=0;for(var y=0;y<4;y++)E.call(this);for(var y=0;y<8;y++)a[y]^=i[y+4&7];if(m){var v=m.words,f=v[0],x=v[1],F=(f<<8|f>>>24)&16711935|(f<<24|f>>>8)&4278255360,_=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,b=F>>>16|_&4294901760,k=_<<16|F&65535;a[0]^=F,a[1]^=b,a[2]^=_,a[3]^=k,a[4]^=F,a[5]^=b,a[6]^=_,a[7]^=k;for(var y=0;y<4;y++)E.call(this)}},_doProcessBlock:function(l,m){var y=this._X;E.call(this),s[0]=y[0]^y[5]>>>16^y[3]<<16,s[1]=y[2]^y[7]>>>16^y[5]<<16,s[2]=y[4]^y[1]>>>16^y[7]<<16,s[3]=y[6]^y[3]>>>16^y[1]<<16;for(var i=0;i<4;i++)s[i]=(s[i]<<8|s[i]>>>24)&16711935|(s[i]<<24|s[i]>>>8)&4278255360,l[m+i]^=s[i]},blockSize:128/32,ivSize:64/32});function E(){for(var l=this._X,m=this._C,y=0;y<8;y++)p[y]=m[y];m[0]=m[0]+1295307597+this._b|0,m[1]=m[1]+3545052371+(m[0]>>>0<p[0]>>>0?1:0)|0,m[2]=m[2]+886263092+(m[1]>>>0<p[1]>>>0?1:0)|0,m[3]=m[3]+1295307597+(m[2]>>>0<p[2]>>>0?1:0)|0,m[4]=m[4]+3545052371+(m[3]>>>0<p[3]>>>0?1:0)|0,m[5]=m[5]+886263092+(m[4]>>>0<p[4]>>>0?1:0)|0,m[6]=m[6]+1295307597+(m[5]>>>0<p[5]>>>0?1:0)|0,m[7]=m[7]+3545052371+(m[6]>>>0<p[6]>>>0?1:0)|0,this._b=m[7]>>>0<p[7]>>>0?1:0;for(var y=0;y<8;y++){var i=l[y]+m[y],a=i&65535,v=i>>>16,f=((a*a>>>17)+a*v>>>15)+v*v,x=((i&4294901760)*i|0)+((i&65535)*i|0);n[y]=f^x}l[0]=n[0]+(n[7]<<16|n[7]>>>16)+(n[6]<<16|n[6]>>>16)|0,l[1]=n[1]+(n[0]<<8|n[0]>>>24)+n[7]|0,l[2]=n[2]+(n[1]<<16|n[1]>>>16)+(n[0]<<16|n[0]>>>16)|0,l[3]=n[3]+(n[2]<<8|n[2]>>>24)+n[1]|0,l[4]=n[4]+(n[3]<<16|n[3]>>>16)+(n[2]<<16|n[2]>>>16)|0,l[5]=n[5]+(n[4]<<8|n[4]>>>24)+n[3]|0,l[6]=n[6]+(n[5]<<16|n[5]>>>16)+(n[4]<<16|n[4]>>>16)|0,l[7]=n[7]+(n[6]<<8|n[6]>>>24)+n[5]|0}e.Rabbit=c._createHelper(o)})(),t.Rabbit})})(or)),or.exports}var sr={exports:{}},su=sr.exports,Qn;function uu(){return Qn||(Qn=1,(function(r,u){(function(t,e,h){r.exports=e(fe(),V0(),K0(),T0(),Xe())})(su,function(t){return(function(){var e=t,h=e.lib,c=h.StreamCipher,d=e.algo,s=[],p=[],n=[],o=d.RabbitLegacy=c.extend({_doReset:function(){var l=this._key.words,m=this.cfg.iv,y=this._X=[l[0],l[3]<<16|l[2]>>>16,l[1],l[0]<<16|l[3]>>>16,l[2],l[1]<<16|l[0]>>>16,l[3],l[2]<<16|l[1]>>>16],i=this._C=[l[2]<<16|l[2]>>>16,l[0]&4294901760|l[1]&65535,l[3]<<16|l[3]>>>16,l[1]&4294901760|l[2]&65535,l[0]<<16|l[0]>>>16,l[2]&4294901760|l[3]&65535,l[1]<<16|l[1]>>>16,l[3]&4294901760|l[0]&65535];this._b=0;for(var a=0;a<4;a++)E.call(this);for(var a=0;a<8;a++)i[a]^=y[a+4&7];if(m){var v=m.words,f=v[0],x=v[1],F=(f<<8|f>>>24)&16711935|(f<<24|f>>>8)&4278255360,_=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,b=F>>>16|_&4294901760,k=_<<16|F&65535;i[0]^=F,i[1]^=b,i[2]^=_,i[3]^=k,i[4]^=F,i[5]^=b,i[6]^=_,i[7]^=k;for(var a=0;a<4;a++)E.call(this)}},_doProcessBlock:function(l,m){var y=this._X;E.call(this),s[0]=y[0]^y[5]>>>16^y[3]<<16,s[1]=y[2]^y[7]>>>16^y[5]<<16,s[2]=y[4]^y[1]>>>16^y[7]<<16,s[3]=y[6]^y[3]>>>16^y[1]<<16;for(var i=0;i<4;i++)s[i]=(s[i]<<8|s[i]>>>24)&16711935|(s[i]<<24|s[i]>>>8)&4278255360,l[m+i]^=s[i]},blockSize:128/32,ivSize:64/32});function E(){for(var l=this._X,m=this._C,y=0;y<8;y++)p[y]=m[y];m[0]=m[0]+1295307597+this._b|0,m[1]=m[1]+3545052371+(m[0]>>>0<p[0]>>>0?1:0)|0,m[2]=m[2]+886263092+(m[1]>>>0<p[1]>>>0?1:0)|0,m[3]=m[3]+1295307597+(m[2]>>>0<p[2]>>>0?1:0)|0,m[4]=m[4]+3545052371+(m[3]>>>0<p[3]>>>0?1:0)|0,m[5]=m[5]+886263092+(m[4]>>>0<p[4]>>>0?1:0)|0,m[6]=m[6]+1295307597+(m[5]>>>0<p[5]>>>0?1:0)|0,m[7]=m[7]+3545052371+(m[6]>>>0<p[6]>>>0?1:0)|0,this._b=m[7]>>>0<p[7]>>>0?1:0;for(var y=0;y<8;y++){var i=l[y]+m[y],a=i&65535,v=i>>>16,f=((a*a>>>17)+a*v>>>15)+v*v,x=((i&4294901760)*i|0)+((i&65535)*i|0);n[y]=f^x}l[0]=n[0]+(n[7]<<16|n[7]>>>16)+(n[6]<<16|n[6]>>>16)|0,l[1]=n[1]+(n[0]<<8|n[0]>>>24)+n[7]|0,l[2]=n[2]+(n[1]<<16|n[1]>>>16)+(n[0]<<16|n[0]>>>16)|0,l[3]=n[3]+(n[2]<<8|n[2]>>>24)+n[1]|0,l[4]=n[4]+(n[3]<<16|n[3]>>>16)+(n[2]<<16|n[2]>>>16)|0,l[5]=n[5]+(n[4]<<8|n[4]>>>24)+n[3]|0,l[6]=n[6]+(n[5]<<16|n[5]>>>16)+(n[4]<<16|n[4]>>>16)|0,l[7]=n[7]+(n[6]<<8|n[6]>>>24)+n[5]|0}e.RabbitLegacy=c._createHelper(o)})(),t.RabbitLegacy})})(sr)),sr.exports}var ur={exports:{}},cu=ur.exports,Yn;function lu(){return Yn||(Yn=1,(function(r,u){(function(t,e,h){r.exports=e(fe(),V0(),K0(),T0(),Xe())})(cu,function(t){return(function(){var e=t,h=e.lib,c=h.BlockCipher,d=e.algo;const s=16,p=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],n=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var o={pbox:[],sbox:[]};function E(a,v){let f=v>>24&255,x=v>>16&255,F=v>>8&255,_=v&255,b=a.sbox[0][f]+a.sbox[1][x];return b=b^a.sbox[2][F],b=b+a.sbox[3][_],b}function l(a,v,f){let x=v,F=f,_;for(let b=0;b<s;++b)x=x^a.pbox[b],F=E(a,x)^F,_=x,x=F,F=_;return _=x,x=F,F=_,F=F^a.pbox[s],x=x^a.pbox[s+1],{left:x,right:F}}function m(a,v,f){let x=v,F=f,_;for(let b=s+1;b>1;--b)x=x^a.pbox[b],F=E(a,x)^F,_=x,x=F,F=_;return _=x,x=F,F=_,F=F^a.pbox[1],x=x^a.pbox[0],{left:x,right:F}}function y(a,v,f){for(let k=0;k<4;k++){a.sbox[k]=[];for(let N=0;N<256;N++)a.sbox[k][N]=n[k][N]}let x=0;for(let k=0;k<s+2;k++)a.pbox[k]=p[k]^v[x],x++,x>=f&&(x=0);let F=0,_=0,b=0;for(let k=0;k<s+2;k+=2)b=l(a,F,_),F=b.left,_=b.right,a.pbox[k]=F,a.pbox[k+1]=_;for(let k=0;k<4;k++)for(let N=0;N<256;N+=2)b=l(a,F,_),F=b.left,_=b.right,a.sbox[k][N]=F,a.sbox[k][N+1]=_;return!0}var i=d.Blowfish=c.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var a=this._keyPriorReset=this._key,v=a.words,f=a.sigBytes/4;y(o,v,f)}},encryptBlock:function(a,v){var f=l(o,a[v],a[v+1]);a[v]=f.left,a[v+1]=f.right},decryptBlock:function(a,v){var f=m(o,a[v],a[v+1]);a[v]=f.left,a[v+1]=f.right},blockSize:64/32,keySize:128/32,ivSize:64/32});e.Blowfish=c._createHelper(i)})(),t.Blowfish})})(ur)),ur.exports}var du=_t.exports,Zn;function fu(){return Zn||(Zn=1,(function(r,u){(function(t,e,h){r.exports=e(fe(),pr(),us(),ls(),V0(),xs(),K0(),Pa(),$r(),ms(),Ta(),Fs(),Bs(),bs(),Wr(),ws(),T0(),Xe(),Rs(),Ps(),zs(),Ls(),Ms(),Hs(),Ws(),Vs(),Gs(),Qs(),Zs(),eu(),ru(),au(),ou(),uu(),lu())})(du,function(t){return t})})(_t)),_t.exports}var xu=fu();const za=ea(xu);za.enc.Utf8.parse("1234567890123456");za.enc.Utf8.parse("1234567890123456");const jr={login:{usernamePlaceholder:"\u8F93\u5165\u7528\u6237\u540D\u5B57",passwordPlaceholder:"\u8F93\u5165\u5BC6\u7801",verifyCodePlaceholder:"\u8F93\u5165\u9A8C\u8BC1\u7801",usernameRequired:"\u8BF7\u8F93\u5165\u7528\u6237\u540D\u5B57",passwordRequired:"\u8BF7\u8F93\u5165\u5BC6\u7801",verifyCodeRequired:"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801",submit:"\u767B\u5F55",errorFallback:"\u767B\u5F55\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5"},register:{labels:{username:"\u7528\u6237\u540D",phone:"\u624B\u673A\u53F7",email:"\u90AE\u7BB1",password:"\u5BC6\u7801",confirmPassword:"\u786E\u8BA4\u5BC6\u7801",verifyCode:"\u9A8C\u8BC1\u7801"},placeholders:{username:"\u8F93\u5165\u7528\u6237\u540D\u5B57",phone:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7",email:"\u8F93\u5165\u90AE\u7BB1",password:"\u8BF7\u8F93\u5165\u5BC6\u7801",confirmPassword:"\u8BF7\u786E\u8BA4\u65B0\u5BC6\u7801",verifyCode:"\u8F93\u5165\u9A8C\u8BC1\u7801"},required:{username:"\u8BF7\u8F93\u5165\u540D\u79F0",phone:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7",email:"\u8BF7\u8F93\u5165\u90AE\u7BB1",password:"\u8BF7\u8F93\u5165\u5BC6\u7801",confirmPassword:"\u8BF7\u786E\u8BA4\u65B0\u5BC6\u7801",verifyCode:"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801"},cancel:"\u53D6\u6D88",submit:"\u6CE8\u518C",passwordConfirmMismatch:"\u4E24\u6B21\u5BC6\u7801\u4E0D\u4E00\u81F4!"}},pu={login:{usernamePlaceholder:"Enter username",passwordPlaceholder:"Enter password",verifyCodePlaceholder:"Enter verification code",usernameRequired:"Please enter username",passwordRequired:"Please enter password",verifyCodeRequired:"Please enter verification code",submit:"Sign in",errorFallback:"Login failed, please try again later."},register:{labels:{username:"Username",phone:"Phone",email:"Email",password:"Password",confirmPassword:"Confirm password",verifyCode:"Verification code"},placeholders:{username:"Enter username",phone:"Enter phone number",email:"Enter email",password:"Enter password",confirmPassword:"Confirm password",verifyCode:"Enter verification code"},required:{username:"Please enter username",phone:"Please enter phone number",email:"Please enter email",password:"Please enter password",confirmPassword:"Please confirm password",verifyCode:"Please enter verification code"},cancel:"Cancel",submit:"Register",passwordConfirmMismatch:"Passwords do not match."}},hu={login:{usernamePlaceholder:"\u30E6\u30FC\u30B6\u30FC\u540D\u3092\u5165\u529B",passwordPlaceholder:"\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B",verifyCodePlaceholder:"\u8A8D\u8A3C\u30B3\u30FC\u30C9\u3092\u5165\u529B",usernameRequired:"\u30E6\u30FC\u30B6\u30FC\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",passwordRequired:"\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",verifyCodeRequired:"\u8A8D\u8A3C\u30B3\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",submit:"\u30ED\u30B0\u30A4\u30F3",errorFallback:"\u30ED\u30B0\u30A4\u30F3\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u3057\u3070\u3089\u304F\u3057\u3066\u304B\u3089\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002"},register:{labels:{username:"\u30E6\u30FC\u30B6\u30FC\u540D",phone:"\u96FB\u8A71\u756A\u53F7",email:"\u30E1\u30FC\u30EB",password:"\u30D1\u30B9\u30EF\u30FC\u30C9",confirmPassword:"\u30D1\u30B9\u30EF\u30FC\u30C9\u78BA\u8A8D",verifyCode:"\u8A8D\u8A3C\u30B3\u30FC\u30C9"},placeholders:{username:"\u30E6\u30FC\u30B6\u30FC\u540D\u3092\u5165\u529B",phone:"\u96FB\u8A71\u756A\u53F7\u3092\u5165\u529B",email:"\u30E1\u30FC\u30EB\u3092\u5165\u529B",password:"\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B",confirmPassword:"\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u78BA\u8A8D",verifyCode:"\u8A8D\u8A3C\u30B3\u30FC\u30C9\u3092\u5165\u529B"},required:{username:"\u30E6\u30FC\u30B6\u30FC\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",phone:"\u96FB\u8A71\u756A\u53F7\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",email:"\u30E1\u30FC\u30EB\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",password:"\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",confirmPassword:"\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044",verifyCode:"\u8A8D\u8A3C\u30B3\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",submit:"\u767B\u9332",passwordConfirmMismatch:"\u30D1\u30B9\u30EF\u30FC\u30C9\u304C\u4E00\u81F4\u3057\u307E\u305B\u3093\u3002"}},vu={zh:jr,en:pu,ja:hu};function gu(r,u){const t=vu[r]??jr;return u?{...t,...u}:t}const qa=Pe.createContext({locale:"zh",messages:jr});function Vu(){return Pe.useContext(qa)}function Ku({locale:r,messages:u,children:t}){const e=Pe.useMemo(()=>({locale:r,messages:gu(r,u)}),[r,u]);return Pe.createElement(qa.Provider,{value:e},t)}export{Na as D,Ku as L,qa as a,gu as g,Vu as u,ju as w};