Spaces:
Running
Running
(this.webpackJsonpchatchan=this.webpackJsonpchatchan||[]).push([[0],{1262:function(e,t){},1264:function(e,t){},1274:function(e,t){},1276:function(e,t){},1303:function(e,t){},1304:function(e,t){},1309:function(e,t){},1311:function(e,t){},1318:function(e,t){},1337:function(e,t){},1651:function(e,t,a){"use strict";a.r(t);var s,r,o,n,i,_,c,l,p,A,T,h,u,E,P,m,d,O,b,C,y,N,I,f=a(0),S=a.n(f),v=a(56),g=a.n(v),R=(a(724),a(16)),k=a(21),j=a(24),B=a(26),U=a(40),w=a(50),L=a(7),x=Object(L.b)("store")(s=Object(L.c)(s=function(e){Object(j.a)(a,e);var t=Object(B.a)(a);function a(){return Object(R.a)(this,a),t.apply(this,arguments)}return Object(k.a)(a,[{key:"render",value:function(){return S.a.createElement("div",{className:"title"},S.a.createElement("h1",null,"Hello\uff0c",this.props.store.appname))}}]),a}(f.Component))||s)||s,D=a(17),G=(r=Object(L.b)("store"),Object(w.f)(o=r(o=function(e){Object(j.a)(a,e);var t=Object(B.a)(a);function a(){return Object(R.a)(this,a),t.apply(this,arguments)}return Object(k.a)(a,[{key:"render",value:function(){var e=this;return S.a.createElement("div",null,S.a.createElement("h1",null,S.a.createElement(x,null)),S.a.createElement("div",null,S.a.createElement(D.b,{onClick:function(){return e.props.store.appname+="\ud83c\udf88"}},"change")),S.a.createElement("div",null,S.a.createElement("span",{onClick:function(){return e.props.history.push("/login")}},"Login")))}}]),a}(f.Component))||o)||o),q=a(73),K=a(235),W=(n=Object(L.b)("store"),Object(w.f)(i=n(i=Object(L.c)(i=function(e){Object(j.a)(a,e);var t=Object(B.a)(a);function a(){return Object(R.a)(this,a),t.apply(this,arguments)}return Object(k.a)(a,[{key:"render",value:function(){var e=S.a.createElement("div",{className:"p-32 "},"FrontPage");return S.a.createElement(q.a,{title:this.props.store.appname,main:e})}}]),a}(f.Component))||i)||i),a(15)),H=a.n(W),F=a(44),V=a(31),X=(_=Object(L.b)("store"),Object(w.f)(c=_(c=Object(L.c)(c=function(e){Object(j.a)(a,e);var t=Object(B.a)(a);function a(){return Object(R.a)(this,a),t.apply(this,arguments)}return Object(k.a)(a,[{key:"componentDidMount",value:function(){var e=Object(F.a)(H.a.mark((function e(){var t,a,s,r;return H.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new URLSearchParams(this.props.location.search),a=t.get("code"),s=t.get("session"),e.next=5,this.props.store.get_token_by_code(a,s);case 5:(null===(r=e.sent)||void 0===r?void 0:r.token)&&this.props.store.set_user(r.user),Object(V.a)()?this.props.history.push("/after/login"):this.props.history.push("/home");case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){return S.a.createElement("div",{className:"flex flex-row pt-20 items-center justify-center"},S.a.createElement(D.q,null))}}]),a}(f.Component))||c)||c)||c),z=a(74),M=a(111),Y=a(299),J=(l=Object(L.b)("store"),Object(w.f)(p=l(p=Object(L.c)(p=function(e){Object(j.a)(a,e);var t=Object(B.a)(a);function a(){var e;Object(R.a)(this,a);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return(e=t.call.apply(t,[this].concat(r))).state={qrcode_url:!1},e}return Object(k.a)(a,[{key:"go",value:function(){if(Object(V.a)())this.props.onClick&&this.props.onClick();else{var e=window.location.origin+"/login/auto/"+this.props.store.token+"?redirect="+encodeURIComponent(window.location.pathname+"?amount="+this.props.amount||100);this.setState({qrcode_url:e})}}},{key:"render",value:function(){var e=this,t=this.props,a=(t.staticContext,t.onClick,Object(M.a)(t,["staticContext","onClick"]));return S.a.createElement(S.a.Fragment,null,S.a.createElement(D.b,Object.assign({onClick:function(){return e.go()}},a)),this.state.qrcode_url&&S.a.createElement(D.l,{isOpen:this.state.qrcode_url,onClose:function(){return e.setState({qrcode_url:!1})}},S.a.createElement("div",{className:"center-box bg-white p-10 rounded"},S.a.createElement(Y.a,{value:this.state.qrcode_url}),S.a.createElement("div",{className:"mt-2"},"\u8bf7\u7528\u5fae\u4fe1\u626b\u7801\u652f\u4ed8"))))}}]),a}(f.Component))||p)||p)||p),$=(A=Object(L.b)("store"),Object(w.f)(T=A(T=Object(L.c)(T=function(e){Object(j.a)(a,e);var t=Object(B.a)(a);function a(){var e;Object(R.a)(this,a);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return(e=t.call.apply(t,[this].concat(r))).state={jsinfo:!1},e}return Object(k.a)(a,[{key:"componentDidMount",value:function(){var e=parseInt(new URLSearchParams(this.props.location.search).get("amount"));function t(){}this.props.store.recharge_input_coin||(this.props.store.recharge_input_coin=e),"undefined"==typeof WeixinJSBridge&&(document.addEventListener?document.addEventListener("WeixinJSBridgeReady",t,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",t),document.attachEvent("onWeixinJSBridgeReady",t)))}},{key:"launch",value:function(){var e=this;WeixinJSBridge.invoke("getBrandWCPayRequest",{appId:this.state.jsinfo.appId,timeStamp:this.state.jsinfo.timestamp,nonceStr:this.state.jsinfo.nonceStr,package:this.state.jsinfo.package,signType:this.state.jsinfo.signType,paySign:this.state.jsinfo.paySign},(function(t){"get_brand_wcpay_request:ok"==t.err_msg&&(Object(V.b)("\u652f\u4ed8\u6570\u636e\u5904\u7406\u4e2d..."),e.props.history.push("/profile"))})),console.log("launch")}},{key:"recharge",value:function(){var e=Object(F.a)(H.a.mark((function e(){var t,a=this;return H.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.props.store.preorder(this.props.store.recharge_input_coin);case 2:(t=e.sent)&&(t.result&&(this.setState({jsinfo:t.result}),window.setTimeout((function(){return a.launch()}),600)),t.error&&Object(V.b)(t.error.err_code_des));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this,t=S.a.createElement("div",{className:"p-2 recharge-page"},S.a.createElement("div",{className:"price"},(this.props.store.recharge_input_coin/100).toFixed(2)),S.a.createElement(z.a,{field:"recharge_input_coin",type:"number",placeholder:"\u8bf7\u8f93\u5165\u8981\u8d2d\u4e70\u7684"+this.props.store.coin_name+"\u6570\u91cf"}),S.a.createElement(J,{amount:this.props.store.recharge_input_coin,large:!0,onClick:function(){return e.recharge()}},"\u5145\u503c"));return S.a.createElement(q.a,{title:this.props.store.appname,main:t})}}]),a}(f.Component))||T)||T)||T),Z=(h=Object(L.b)("store"),Object(w.f)(u=h(u=Object(L.c)(u=function(e){Object(j.a)(a,e);var t=Object(B.a)(a);function a(){return Object(R.a)(this,a),t.apply(this,arguments)}return Object(k.a)(a,[{key:"componentDidMount",value:function(){var e=Object(F.a)(H.a.mark((function e(){return H.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.props.store.logout();case 2:this.props.history.replace("/");case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=S.a.createElement("div",{className:"flex flex-row pt-20 items-center justify-center"},S.a.createElement(D.q,null));return S.a.createElement(q.a,{title:this.props.store.appname,main:e})}}]),a}(f.Component))||u)||u)||u),Q=(E=Object(L.b)("store"),Object(w.f)(P=E(P=Object(L.c)(P=function(e){Object(j.a)(a,e);var t=Object(B.a)(a);function a(){var e;Object(R.a)(this,a);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return(e=t.call.apply(t,[this].concat(r))).state={user:!1},e}return Object(k.a)(a,[{key:"componentDidMount",value:function(){var e=Object(F.a)(H.a.mark((function e(){var t;return H.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.props.store.get_user_profile();case 2:(t=e.sent)&&t.user&&(this.setState({user:t.user}),this.props.store.set_user(t.user));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this.state.user;if(!e)return null;var t=S.a.createElement("div",{className:"p-2 flex flex-col profile-page"},S.a.createElement("div",{className:"profile"},S.a.createElement("div",{className:"avatar"},S.a.createElement("img",{src:e.avatar_url,alt:""}),S.a.createElement("div",{className:"explain"},e.name))),S.a.createElement("div",{className:"detail"},S.a.createElement("div",{className:"row"},S.a.createElement("div",{className:"left"},"Level"),S.a.createElement("div",{className:"right"},e.level)),S.a.createElement("div",{className:"row"},S.a.createElement("div",{className:"left"},"Coin"),S.a.createElement("div",{className:"right"},e.coin))));return S.a.createElement(q.a,{title:this.props.store.appname,main:t})}}]),a}(f.Component))||P)||P)||P),ee=(m=Object(L.b)("store"),Object(w.f)(d=m(d=Object(L.c)(d=function(e){Object(j.a)(a,e);var t=Object(B.a)(a);function a(){return Object(R.a)(this,a),t.apply(this,arguments)}return Object(k.a)(a,[{key:"componentDidMount",value:function(){document.querySelector("#wechat-login-btn").click()}},{key:"render",value:function(){var e=S.a.createElement("div",{className:"flex flex-row pt-12 items-center justify-center"},S.a.createElement(K.a,{large:!0}));return S.a.createElement(q.a,{title:this.props.store.appname,main:e})}}]),a}(f.Component))||d)||d)||d),te=(O=Object(L.b)("store"),Object(w.f)(b=O(b=Object(L.c)(b=function(e){Object(j.a)(a,e);var t=Object(B.a)(a);function a(){return Object(R.a)(this,a),t.apply(this,arguments)}return Object(k.a)(a,[{key:"render",value:function(){var e=S.a.createElement("div",{className:"py-5 px-5 md:px-0 text-xl"},"\u767b\u5165\u6210\u529f\uff0c\u8bf7\u56de\u5230\u7535\u8111\u70b9\u51fb\u6309\u94ae\u7ee7\u7eed\u3002\u6216\u8005\u70b9\u51fb\u53f3\u4e0a\u89d2\u83dc\u5355\u8fdb\u884c\u64cd\u4f5c\u3002");return S.a.createElement(q.a,{title:this.props.store.appname,main:e})}}]),a}(f.Component))||b)||b)||b),ae=(C=Object(L.b)("store"),Object(w.f)(y=C(y=Object(L.c)(y=function(e){Object(j.a)(a,e);var t=Object(B.a)(a);function a(){return Object(R.a)(this,a),t.apply(this,arguments)}return Object(k.a)(a,[{key:"componentDidMount",value:function(){var e=Object(F.a)(H.a.mark((function e(){var t,a,s,r;return H.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.props.match.params.token,e.next=3,this.props.store.check_user_info(t);case 3:a=e.sent,console.log(a),a&&a.user&&(this.props.store.set_user(a.user),s=new URLSearchParams(this.props.location.search),(r=s.get("redirect"))||(r="/recharge"),this.props.history.push(r));case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=S.a.createElement("div",{className:"py-5 px-5 md:px-0"},S.a.createElement("div",{className:"p-5 flex justify-center"},S.a.createElement(D.q,null)));return S.a.createElement(q.a,{title:this.props.store.appname,main:e})}}]),a}(f.Component))||y)||y)||y),se=a(407),re=a(663),oe=a(205),ne=(N=Object(L.b)("store"),Object(w.f)(I=N(I=Object(L.c)(I=function(e){Object(j.a)(a,e);var t=Object(B.a)(a);function a(){return Object(R.a)(this,a),t.apply(this,arguments)}return Object(k.a)(a,[{key:"submit",value:function(){var e=Object(F.a)(H.a.mark((function e(){var t,a,s,r,o,n;return H.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=this.props.store._donate_keys.trim().split("\n"),a=[],Object(V.b)("\u6b63\u5728\u9a8c\u8bc1KEY\uff0c\u8bf7\u7a0d\u5019"),s=Object(re.a)(t),e.prev=4,s.s();case 6:if((r=s.n()).done){e.next=14;break}return o=r.value,e.next=10,this.props.store.api.rawPost("".concat(this.props.store.local_apibase,"/chat/verify"),{key:o});case 10:(n=e.sent)&&"done"==n.message&&a.push(o);case 12:e.next=6;break;case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(4),s.e(e.t0);case 19:return e.prev=19,s.f(),e.finish(19);case 22:if(!(a.length<1)){e.next=27;break}return Object(V.b)("\u6ca1\u6709\u662f\u6709\u6548\u7684KEY"),e.abrupt("return");case 27:Object(V.b)("".concat(a.length,"\u4e2aKEY\u901a\u8fc7\u6821\u9a8c\uff0c\u6b63\u5728\u63d0\u4ea4\u6570\u636e"));case 28:case"end":return e.stop()}}),e,this,[[4,16,19,22]])})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this,t=S.a.createElement("div",{className:"p-12"},S.a.createElement("div",{className:"text-center text-2xl"},"\u8d5e\u52a9OpenAI KEY"),S.a.createElement(z.a,{type:"textarea",fill:!0,label:"OpenAI KEY",field:"_donate_keys",placeholder:"\u4e00\u884c\u4e00\u4e2aKey\uff0c\u5f62\u5982 sk... "}),S.a.createElement(z.a,{label:"\u6587\u5b57\u5e7f\u544a\u6587\u6848",field:"_donate_title",placeholder:"30\u5b57\u7b26\u5185\uff0c\u4f1a\u4eba\u5de5\u5ba1\u6838\uff0c\u8fdd\u53cd\u5185\u5730\u6cd5\u5f8b\u6cd5\u89c4\u548c\u4e0d\u771f\u5b9e\u5185\u5bb9\u5c06\u4e0d\u4f1a\u901a\u8fc7"}),S.a.createElement(z.a,{label:"\u6587\u5b57\u5e7f\u544a\u94fe\u63a5",field:"_donate_link",placeholder:"https://... \u53ef\u586b\u5165\u4e2a\u4eba\u7f51\u7ad9\u3001\u7f51\u5e97\u3001\u535a\u5ba2\u4e4b\u7c7b"}),S.a.createElement(oe.a,{label:"\u63d0\u4ea4",onSubmit:function(){return e.submit()}}),S.a.createElement("div",{className:"text-lg mt-8"},"\u6548\u679c\u9884\u89c8"),S.a.createElement("div",{className:"preview border rounded p-5 mt-5"},S.a.createElement("div",{className:"line-1"},"\u60a8\u4f7f\u7528\u7684 Key \u7531 ",S.a.createElement("span",{className:"text-blue-500"},this.props.store.user.name)," \u53cb\u60c5\u63d0\u4f9b"),S.a.createElement("div",{className:"line-2 mt-3 flex flex-row item-center"},S.a.createElement("span",{className:"text-white bg-gray-300 rounded px-1 mr-2"},"\u5e7f\u544a"),S.a.createElement("a",{href:this.props.store._donate_link||"https://stack.ftqq.com/subscribe",target:"_blank"},this.props.store._donate_title||"\u65b9\u7cd6\u8d85\u7ea7\u4f1a\u5458\xb7\u52a9\u529b\u4ece\u87ba\u4e1d\u9489\u5230\u4e00\u4eba\u4f01\u4e1a"))));return S.a.createElement(q.a,{title:this.props.store.appname,main:t})}}]),a}(f.Component))||I)||I)||I),ie=a(664),_e=function(e){Object(j.a)(a,e);var t=Object(B.a)(a);function a(){return Object(R.a)(this,a),t.apply(this,arguments)}return Object(k.a)(a,[{key:"render",value:function(){return S.a.createElement(U.a,null,S.a.createElement(w.c,null,S.a.createElement(w.a,{path:"/donate",component:ne}),S.a.createElement(w.a,{path:"/chat",component:se.a}),S.a.createElement(w.a,{path:"/login/auto/:token",component:ae}),S.a.createElement(w.a,{path:"/after/login",component:te}),S.a.createElement(w.a,{path:"/profile",component:Q}),S.a.createElement(w.a,{path:"/recharge",component:$}),S.a.createElement(w.a,{path:"/logout",component:Z}),S.a.createElement(w.a,{path:"/logback",component:X}),S.a.createElement(w.a,{path:"/login",component:ee}),S.a.createElement(w.a,{path:"/index",component:G}),S.a.createElement(w.a,{path:"/share/:info",component:ie.a}),S.a.createElement(w.a,{path:"/",component:se.a})))}}]),a}(f.Component);Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));var ce=a(311);console.log("Welcome to ".concat(ce.a.appname)),console.log2=console.log,console.log=function(){},g.a.render(S.a.createElement(L.a,{store:ce.a},S.a.createElement(_e,null)),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()}))},172:function(e,t,a){"use strict";a.d(t,"a",(function(){return h}));var s,r,o=a(16),n=a(21),i=a(24),_=a(26),c=a(0),l=a.n(c),p=a(7),A=a(50),T=a(17),h=(s=Object(p.b)("store"),Object(A.f)(r=s(r=Object(p.c)(r=function(e){Object(i.a)(a,e);var t=Object(_.a)(a);function a(){return Object(o.a)(this,a),t.apply(this,arguments)}return Object(n.a)(a,[{key:"change",value:function(e){this.props.store[this.props.field]=e.target.checked?"yes":"no",this.props.onUpdate&&this.props.onUpdate(this.props.store[this.props.field])}},{key:"render",value:function(){var e=this,t=1,a=Date.now(),s=this.props.field;return l.a.createElement("div",{className:"my-2 "+this.props.className||!1},l.a.createElement(T.d,{key:a+t++,checked:"yes"==this.props.store[s],label:this.props.label,onChange:function(t){return e.change(t)},inline:!0}))}}]),a}(c.Component))||r)||r)||r)},205:function(e,t,a){"use strict";a.d(t,"a",(function(){return u}));var s,r,o=a(16),n=a(21),i=a(24),_=a(26),c=a(0),l=a.n(c),p=a(7),A=a(50),T=a(17),h=a(136),u=(s=Object(p.b)("store"),Object(A.f)(r=s(r=Object(p.c)(r=function(e){Object(i.a)(a,e);var t=Object(_.a)(a);function a(){return Object(o.a)(this,a),t.apply(this,arguments)}return Object(n.a)(a,[{key:"render",value:function(){var e=this;return l.a.createElement(l.a.Fragment,null,l.a.createElement("div",{className:"std-hr form-div"}),l.a.createElement(T.g,null,l.a.createElement("div",{className:"flex flex-row justify-between"},l.a.createElement("div",{className:"left"},l.a.createElement(T.b,{large:"true",intent:h.a.PRIMARY,onClick:function(){return e.props.onSubmit()}},"\u63d0\u4ea4")),l.a.createElement("div",{className:"right"},this.props.cancel||l.a.createElement(T.b,{large:"true",onClick:function(){return e.props.history.goBack()},className:"right-20"},"\u53d6\u6d88")))))}}]),a}(c.Component))||r)||r)||r)},235:function(e,t,a){"use strict";a.d(t,"a",(function(){return C}));var s,r,o=a(111),n=a(15),i=a.n(n),_=a(44),c=a(16),l=a(21),p=a(24),A=a(26),T=a(0),h=a.n(T),u=a(7),E=a(50),P=a(17),m=a(31),d=a(299),O=a(651),b=a.n(O),C=(s=Object(u.b)("store"),Object(E.f)(r=s(r=Object(u.c)(r=function(e){Object(p.a)(a,e);var t=Object(A.a)(a);function a(){var e;Object(c.a)(this,a);for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return(e=t.call.apply(t,[this].concat(r))).state={qrcode_url:!1},e}return Object(l.a)(a,[{key:"go",value:function(){var e=Object(_.a)(i.a.mark((function e(){var t;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.props.store.session=b()({length:32}),e.next=3,this.props.store.get_wechat_login_url();case 3:(t=e.sent)&&t.url&&(Object(m.a)()?window.location=t.url:(this.setState({qrcode_url:t.url}),console.log(t.url)));case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"check",value:function(){var e=Object(_.a)(i.a.mark((function e(){var t,a;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.props.store.session,e.next=3,this.props.store.check_user_info(t);case 3:(a=e.sent)&&a.code>0?Object(m.b)("\u8bf7\u626b\u7801\u540e\u518d\u70b9\u51fb\u6b64\u6309\u94ae"):a&&a.user&&(this.props.store.set_user(a.user),this.setState({qrcode_url:!1}),Object(m.a)()?this.props.history.push("/after/login"):this.props.history.push("/home"));case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this,t=this.props,a=(t.staticContext,t.onClick,Object(o.a)(t,["staticContext","onClick"]));return h.a.createElement(h.a.Fragment,null,h.a.createElement(P.b,Object.assign({id:"wechat-login-btn",text:"\u5fae\u4fe1\u767b\u5165",onClick:function(){return e.go()}},a)),this.state.qrcode_url&&h.a.createElement(P.l,{isOpen:this.state.qrcode_url,canOutsideClickClose:!1,onClose:function(){return e.setState({qrcode_url:!1})}},h.a.createElement("div",{className:"center-box bg-white p-10 rounded"},h.a.createElement(d.a,{value:this.state.qrcode_url}),h.a.createElement("div",{className:"mt-2"},h.a.createElement(P.b,{large:!0,onClick:function(){return e.check()}},"\u5fae\u4fe1\u626b\u7801\u540e\u70b9\u6b64\u7ee7\u7eed")))))}}]),a}(T.Component))||r)||r)||r)},299:function(e,t,a){"use strict";a.d(t,"a",(function(){return h}));var s,r=a(300),o=a(16),n=a(21),i=a(24),_=a(26),c=a(0),l=a.n(c),p=a(50),A=a(650),T=a.n(A),h=Object(p.f)(s=function(e){Object(i.a)(a,e);var t=Object(_.a)(a);function a(){var e;Object(o.a)(this,a);for(var s=arguments.length,r=new Array(s),n=0;n<s;n++)r[n]=arguments[n];return(e=t.call.apply(t,[this].concat(r))).state={value:e.props.value,img_url:""},e}return Object(n.a)(a,[{key:"componentDidMount",value:function(){var e=this;this.ck=setInterval((function(){return e.check()}),500)}},{key:"componentWillUnmount",value:function(){this.ck&&clearInterval(this.ck)}},{key:"check",value:function(){var e=document.getElementById("theqr__inbox");e&&(this.setState({img_url:e.toDataURL("image/png")}),clearInterval(this.ck))}},{key:"render",value:function(){return l.a.createElement("div",{className:this.props.className},this.state.img_url.length>0?l.a.createElement("img",{style:{maxWidth:200},src:this.state.img_url}):l.a.createElement(T.a,Object(r.a)({size:200,value:this.state.value,includeMargin:!0,id:"theqr__inbox"},"includeMargin",!0)))}}]),a}(c.Component))||s},31:function(e,t,a){"use strict";a(311);var s=a(17),r=a(69),o=s.u.create({className:"lm-toaster",position:r.a.TOP});a(777),a(778);function n(){return"micromessenger"==navigator.userAgent.toLowerCase().match(/MicroMessenger/i)}function i(e){o.show({message:e})}a.d(t,"a",(function(){return n})),a.d(t,"b",(function(){return i}))},311:function(e,t,a){"use strict";var s,r,o,n,i,_,c,l,p,A,T,h,u,E,P,m,d,O,b,C,y,N,I,f,S,v,g,R,k,j,B,U,w,L,x,D,G,q,K,W,H,F,V=a(42),X=a(37),z=(a(758),a(11)),M=a(31),Y=a(15),J=a.n(Y),$=a(44),Z=a(16),Q=a(21),ee=a(314),te=a.n(ee),ae=function(){function e(t){Object(Z.a)(this,e),this.store=t}return Object(Q.a)(e,[{key:"get",value:function(){var e=Object($.a)(J.a.mark((function e(t){var a,s,r=arguments;return J.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=r.length>1&&void 0!==r[1]?r[1]:null,s=null==a?this.store.apibase+t:this.store.apibase+t+ds+new URLSearchParams(a).toString(),e.abrupt("return",this.rawGet(s));case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"rawGet",value:function(){var e=Object($.a)(J.a.mark((function e(t){return J.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=this,e.next=3,te.a.get(t);case 3:return e.t1=e.sent,e.abrupt("return",e.t0.return_data.call(e.t0,e.t1));case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"post",value:function(){var e=Object($.a)(J.a.mark((function e(t){var a,s,r,o,n=arguments;return J.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.length>1&&void 0!==n[1]?n[1]:null,s=!(n.length>2&&void 0!==n[2])||n[2],r=!(n.length>3&&void 0!==n[3])||n[3],o=this.store.apibase+t,e.abrupt("return",this.rawPost(o,a,s,r));case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"rawPost",value:function(){var e=Object($.a)(J.a.mark((function e(t){var a,s,r,o,n=arguments;return J.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.length>1&&void 0!==n[1]?n[1]:null,s=!(n.length>2&&void 0!==n[2])||n[2],r=!(n.length>3&&void 0!==n[3])||n[3],e.prev=3,o=new URLSearchParams,a&&Object.keys(a).forEach((function(e){return o.append(e,a[e])})),s&&this.store.token&&o.append("token",this.store.token),e.t0=this,e.next=10,te.a.post(t,o);case 10:return e.t1=e.sent,e.t2=r,e.abrupt("return",e.t0.return_data.call(e.t0,e.t1,e.t2));case 15:return e.prev=15,e.t3=e.catch(3),console.log(e.t3),e.abrupt("return",!1);case 19:case"end":return e.stop()}}),e,this,[[3,15]])})));return function(t){return e.apply(this,arguments)}}()},{key:"upload",value:function(){var e=Object($.a)(J.a.mark((function e(t){var a,s,r,o,n=arguments;return J.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.length>1&&void 0!==n[1]?n[1]:null,s=!(n.length>2&&void 0!==n[2])||n[2],r=!(n.length>3&&void 0!==n[3])||n[3],o=new FormData,a&&Object.keys(a).forEach((function(e){return o.append(e,a[e])})),s&&this.store.token&&o.append("token",this.store.token),e.t0=this,e.next=9,te.a.post(this.store.apibase+t,o);case 9:return e.t1=e.sent,e.t2=r,e.next=13,e.t0.return_data.call(e.t0,e.t1,e.t2);case 13:return e.abrupt("return",e.sent);case 14:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"return_data",value:function(){var e=Object($.a)(J.a.mark((function e(t){var a=arguments;return J.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(a.length>1&&void 0!==a[1])||a[1],200!=parseInt(t.status)){e.next=8;break}if(!t.data){e.next=5;break}return 80403==t.data.code&&(Object(M.b)("\u8bf7\u767b\u5165\u540e\u7ee7\u7eed"),window.location="/login"),e.abrupt("return",t.data);case 5:return e.abrupt("return",!1);case 8:console.log(t);case 9:return e.abrupt("return",!1);case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}]),e}();let se=(s=class{constructor(){Object(V.a)(this,"appname",r,this),Object(V.a)(this,"apibase",o,this),Object(V.a)(this,"local_apibase",n,this),Object(V.a)(this,"session",i,this),Object(V.a)(this,"token",_,this),Object(V.a)(this,"user",c,this),Object(V.a)(this,"api_endpoints",l,this),this.version=Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_VERSION||"1.0.30",this.endpoint_count=0,this.default_model_options=[{label:"GPT3.5+",value:"gpt-3.5-turbo"},{label:"GPT4om",value:"gpt-4o-mini"},{label:"GPT4o",value:"gpt-4o"},{label:"GPT4",value:"gpt-4"},{label:"GPT4+",value:"gpt-4-turbo"}],Object(V.a)(this,"_chat_model_options",p,this),this.ftopenapp_id="26",this.to_save_vars=["user","token","_chat_saved_list","_chat_model","_chat_key","_chat_api_url","_chat_avatar_url","_chat_max_tokens","_chat_temperature","_chat_timeout","_chat_char_opacity","_chat_system_prompt","_chat_user_prompt","_chat_last","_chat_history_count","_chat_auto_save","_chat_summarize_content","_chat_auto_audio","_chat_bg_url","_chat_pin_window","_preset_saved_list","_chat_stream","_chat_change_model","_chat_image_url","_chat_model_options"],Object(V.a)(this,"menu",A,this),Object(V.a)(this,"coin_name",T,this),Object(V.a)(this,"recharge_input_coin",h,this),Object(V.a)(this,"_donate_keys",u,this),Object(V.a)(this,"_donate_title",E,this),Object(V.a)(this,"_donate_link",P,this),Object(V.a)(this,"_chat_model",m,this),Object(V.a)(this,"_chat_saved_list",d,this),Object(V.a)(this,"_preset_saved_list",O,this),Object(V.a)(this,"_chat_key",b,this),Object(V.a)(this,"_chat_api_url",C,this),Object(V.a)(this,"_chat_avatar_url",y,this),Object(V.a)(this,"_chat_bg_url",N,this),Object(V.a)(this,"_chat_max_tokens",I,this),Object(V.a)(this,"_chat_temperature",f,this),Object(V.a)(this,"_chat_timeout",S,this),Object(V.a)(this,"_chat_system_prompt",v,this),Object(V.a)(this,"_chat_user_prompt",g,this),Object(V.a)(this,"_chat_char_opacity",R,this),Object(V.a)(this,"_chat_history_count",k,this),Object(V.a)(this,"_chat_last",j,this),Object(V.a)(this,"_chat_auto_save",B,this),Object(V.a)(this,"_chat_summarize_content",U,this),Object(V.a)(this,"_chat_auto_audio",w,this),Object(V.a)(this,"_chat_pin_window",L,this),Object(V.a)(this,"_preset_system_prompt",x,this),Object(V.a)(this,"_preset_user_prompt",D,this),Object(V.a)(this,"_preset_prompt_title",G,this),Object(V.a)(this,"_preset_prompt_id",q,this),Object(V.a)(this,"_chat_moderation_on",K,this),Object(V.a)(this,"_chat_stream",W,this),Object(V.a)(this,"_chat_change_model",H,this),Object(V.a)(this,"_chat_image_url",F,this),this.api=new ae(this),this.load_vars(),this.load_api_endpoints()}async load_api_endpoints(){try{const e=await fetch("https://domain.api2d.org/"),t=await e.json();t&&t.length>0&&(this.api_endpoints=t)}catch(e){console.log(e)}}async load_default(){try{const e=await fetch("default.json"),t=await e.json();t.app_name&&(this.appname=t.app_name),t.api_key&&(this._chat_key=t.api_key),t.api_url&&(this._chat_api_url=t.api_url),t.chat_model&&(this._chat_model=t.chat_model),t.chat_max_tokens&&(this._chat_max_tokens=t.chat_max_tokens),t.chat_temperature&&(this._chat_temperature=t.chat_temperature),t.chat_timeout&&(this._chat_timeout=t.chat_timeout),t.chat_system_prompt&&(this._chat_system_prompt=t.chat_system_prompt),t.chat_user_prompt&&(this._chat_user_prompt=t.chat_user_prompt),t.chat_character_url&&(this._chat_avatar_url=t.chat_character_url),t.chat_character_opacity&&(this._chat_opacity=t.chat_character_opacity),t.chat_moderation&&(this._chat_moderation_on="on"==t.chat_moderation),t.chat_model_options&&(this._chat_model_options=t.chat_model_options)}catch(e){}}async load_vars(){await this.load_default(),this.to_save_vars.forEach(e=>{const t=window.localStorage.getItem("FT_CHATCHAN_VAR_"+e);t&&(this[e]=JSON.parse(t))})}save_vars(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;(null===e?this.to_save_vars:[e]).forEach(e=>{window.localStorage.setItem("FT_CHATCHAN_VAR_"+e,JSON.stringify(this[e]))})}async get_wechat_login_url(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.ftopenapp_id,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.session;return await this.api.get("global/user/get_wx_sns_login_url?id="+e+"&session="+t)}async get_token_by_code(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return await this.api.post("global/user/get_token_by_wx_code",{code:e,session:t})}async preorder(e){return await this.api.post("global/pay/order",{amount_cent:e})}logout(){this.user=null,this.token=null,window.localStorage.clear()}set_user(e){this.user=e,this.token=e.session_id,this.save_vars()}async check_user_info(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(e){return await this.api.post("global/user/get_user_session",{token:e},!1)}return await this.api.post("global/user/get_user_session")}async get_user_profile(){return await this.api.post("global/user/profile")}},r=Object(X.a)(s.prototype,"appname",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_NAME||"BioinfoArk"}}),o=Object(X.a)(s.prototype,"apibase",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"https://openapi.ftqq.com/"}}),n=Object(X.a)(s.prototype,"local_apibase",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),i=Object(X.a)(s.prototype,"session",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),_=Object(X.a)(s.prototype,"token",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),c=Object(X.a)(s.prototype,"user",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),l=Object(X.a)(s.prototype,"api_endpoints",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),p=Object(X.a)(s.prototype,"_chat_model_options",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return this.default_model_options}}),A=Object(X.a)(s.prototype,"menu",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[{id:8001,text:"\u9996\u9875",link:"/home",member_only:!1}]}}),Object(X.a)(s.prototype,"logout",[z.f],Object.getOwnPropertyDescriptor(s.prototype,"logout"),s.prototype),Object(X.a)(s.prototype,"set_user",[z.f],Object.getOwnPropertyDescriptor(s.prototype,"set_user"),s.prototype),T=Object(X.a)(s.prototype,"coin_name",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"\u91d1\u5e01"}}),h=Object(X.a)(s.prototype,"recharge_input_coin",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),u=Object(X.a)(s.prototype,"_donate_keys",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),E=Object(X.a)(s.prototype,"_donate_title",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),P=Object(X.a)(s.prototype,"_donate_link",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),m=Object(X.a)(s.prototype,"_chat_model",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"gpt-3.5-turbo"}}),d=Object(X.a)(s.prototype,"_chat_saved_list",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),O=Object(X.a)(s.prototype,"_preset_saved_list",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),b=Object(X.a)(s.prototype,"_chat_key",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_KEY_DEFAULT_VALUE||""}}),C=Object(X.a)(s.prototype,"_chat_api_url",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_API_URL||"https://api.openai.com"}}),y=Object(X.a)(s.prototype,"_chat_avatar_url",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),N=Object(X.a)(s.prototype,"_chat_bg_url",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),I=Object(X.a)(s.prototype,"_chat_max_tokens",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1e3}}),f=Object(X.a)(s.prototype,"_chat_temperature",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return.1}}),S=Object(X.a)(s.prototype,"_chat_timeout",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 60}}),v=Object(X.a)(s.prototype,"_chat_system_prompt",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),g=Object(X.a)(s.prototype,"_chat_user_prompt",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),R=Object(X.a)(s.prototype,"_chat_char_opacity",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 80}}),k=Object(X.a)(s.prototype,"_chat_history_count",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 6}}),j=Object(X.a)(s.prototype,"_chat_last",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),B=Object(X.a)(s.prototype,"_chat_auto_save",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"yes"}}),U=Object(X.a)(s.prototype,"_chat_summarize_content",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"yes"}}),w=Object(X.a)(s.prototype,"_chat_auto_audio",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"no"}}),L=Object(X.a)(s.prototype,"_chat_pin_window",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"no"}}),x=Object(X.a)(s.prototype,"_preset_system_prompt",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),D=Object(X.a)(s.prototype,"_preset_user_prompt",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),G=Object(X.a)(s.prototype,"_preset_prompt_title",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),q=Object(X.a)(s.prototype,"_preset_prompt_id",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),K=Object(X.a)(s.prototype,"_chat_moderation_on",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),W=Object(X.a)(s.prototype,"_chat_stream",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"yes"}}),H=Object(X.a)(s.prototype,"_chat_change_model",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"yes"}}),F=Object(X.a)(s.prototype,"_chat_image_url",[z.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),s);t.a=new se},407:function(e,t,a){"use strict";(function(e){a.d(t,"a",(function(){return S}));var s,r,o=a(0),n=a.n(o),i=a(7),_=a(50),c=a(73),l=a(17),p=a(31),A=(a(1354),a(668)),T=a(653),h=a(74),u=a(205),E=a(408),P=a(660),m=a(172),d=a(240),O=a(661),b=a.n(O),C=a(315),y=a(665),N=a(305),I=a(662),f=a.n(I);let S=(s=Object(i.b)("store"),Object(_.f)(r=s(r=Object(i.c)(r=class extends o.Component{constructor(e){super(e),this.handleFile=e=>{const t=e.target.files[0];if("application/json"!==t.type)return void alert("Please select a JSON file");const a=new FileReader;a.onload=e=>{const t=JSON.parse(e.target.result);if(t&&t.chat_list){const e=this.props.store._chat_saved_list,a=t.chat_list,s=[];for(let t=0;t<a.length;t++){let r=!1;for(let s=0;s<e.length;s++)if(e[s].id==a[t].id){r=!0;break}r||s.push(a[t])}this.props.store._chat_saved_list=e.concat(s),this.props.store.save_vars("_chat_saved_list")}if(t&&t.preset_list){const e=this.props.store._preset_saved_list,a=t.preset_list,s=[];for(let t=0;t<a.length;t++){let r=!1;for(let s=0;s<e.length;s++)if(e[s].id==a[t].id){r=!0;break}r||s.push(a[t])}this.props.store._preset_saved_list=e.concat(s),this.props.store.save_vars("_preset_saved_list")}},a.readAsText(t)},this.inputRef=n.a.createRef(),this.state={actions:{},list:[],text:"",last:!1,loading:!1,typing:"",force_cn:!1,connect:!1,show_tips:!1,in:!1,saved_list:{},settings_open:!1,avatar_open:!1,show_undo:!1,point:"-",show_extend_settings:!1,snap:!1,tab_selected:"history",prompt_box:!1}}componentDidMount(){this.init(),this.audio_to_play=[],window.location.hostname.match(/ftqq.com$/)&&this.setState({in:!0}),document.addEventListener("keydown",e=>{var t;13===e.keyCode&&(e.metaKey||e.ctrlKey)&&this.send(null===(t=this.state.text)||void 0===t?void 0:t.trim())}),document.querySelector(".chat-list").scrollTop=document.querySelector(".chat-list").scrollHeight,window.setTimeout(()=>{var e;(this.props.store._chat_key&&this.props.store._chat_key.length>10&&this.refresh_point(),this.state.list.length<1&&this.props.store._chat_last&&this.props.store._chat_last.length>0&&this.setState({list:this.props.store._chat_last}),"yes"==this.props.store._chat_pin_window)&&(window&&window.electronAPI&&(null===(e=window.electronAPI)||void 0===e?void 0:e.pinWindow)&&(window.electronAPI.pinWindow(!0),console.log("set window float")));this.check_bottom_effect()},1e3),document.addEventListener("visibilitychange",e=>{e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault()}),window.addEventListener("load",e=>{this.check_bottom_icon()},!0);const e=document.querySelector(".chat-list"),t=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;console.log("MutationObserver",t);new t(e=>{document.querySelector(".chat-list").querySelectorAll("img").forEach(e=>{e.onerror||(e.onerror=e=>{e.target.onerror=null;const t=window.devicePixelRatio>1?"/exp@2x.png":"/exp.png";e.target.src=t,e.target.style.width="100px"})})}).observe(e,{childList:!0}),e.addEventListener("scroll",e=>{this.check_bottom_icon()})}check_bottom_icon(){const e=document.querySelector(".chat-list");e.scrollHeight-e.scrollTop>e.clientHeight+100?document.querySelector("#bottom-icon").classList.remove("hidden"):document.querySelector("#bottom-icon").classList.contains("hidden")||document.querySelector("#bottom-icon").classList.add("hidden")}async init(){try{this.tiktoken=await a.e(3).then(a.bind(null,1655))}catch(e){console.log("wasm\u8f7d\u5165\u9519\u8bef",e),console.log2("wasm\u8f7d\u5165\u5931\u8d25\uff0c\u8fdb\u5165\u517c\u5bb9\u6a21\u5f0f\uff0c\u5982\u9047400\u9519\u8bef\uff0c\u8bf7\u6e05\u7406\u5bf9\u8bdd\u8bb0\u5f55")}}onChange(e,t){this.setState({[t]:e.target.value})}async save_key(){if(this.props.store._chat_key.length<10)return Object(p.b)("\u8bf7\u8f93\u5165\u6b63\u786e\u7684OpenAPI/API2D Key"),!1;this.props.store.save_vars(),this.api2d_instance=null,Object(p.b)("\u4fdd\u5b58\u6210\u529f")}async clean_conversation(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];"yes"==this.props.store._chat_auto_save&&e&&await this.save_conversation(),this.old_list=this.state.list.slice(),this.setState({last:!1,list:[],loading:!1,show_undo:!0}),this.props.store._chat_last=[],this.props.store.save_vars("_chat_last"),Object(p.b)("\u5bf9\u8bdd\u5df2\u6e05\u9664\uff0c\u53ef\u70b9\u6062\u590d\u6309\u94ae\u64a4\u9500"),console.log("this.props.store._chat_change_model",this.props.store._chat_change_model,"this.props.store._chat_model",this.props.store._chat_model),"gpt-3.5-turbo-16k"===this.props.store._chat_model&&"yes"===this.props.store._chat_change_model&&(this.props.store._chat_model="gpt-3.5-turbo")}async undo_conversation(){this.old_list&&(this.setState({last:!1,list:this.old_list,loading:!1,show_undo:!1}),window.setTimeout(()=>{document.querySelector(".chat-list").scrollTop=document.querySelector(".chat-list").scrollHeight},300))}async remove_list(e){this.props.store._chat_saved_list=this.props.store._chat_saved_list.filter(t=>t.id!=e),this.props.store.save_vars(),this.check_bottom_effect()}async rename_conversation(e,t){const a=this.getApiInstance();try{t=t.replace(/@[\s\S]*?\s/g,"").replace(/#[\s\S]*?\s/g,"").substring(0,800);const r=await a.completion({messages:[{role:"system",content:"\u4f60\u662f\u4e00\u4e2a\u7ecf\u9a8c\u4e30\u5bcc\u7684\u8bb0\u5f55\u5458\uff0c\u64c5\u957f\u4ece\u5bf9\u8bdd\u4e2d\u63d0\u53d6\u5173\u952e\u4fe1\u606f\uff0c\u5e76\u4e3a\u5bf9\u8bdd\u547d\u540d\u3002"},{role:"user",content:"\u8bf7\u4e3a\u4ee5\u4e0b\u5bf9\u8bdd\u547d\u540d\uff0c\u4f18\u5148\u4f7f\u7528\u4e2d\u6587\uff0c\u76f4\u63a5\u8fd4\u56de\u540d\u79f0\uff0c\u957f\u5ea6\u5c3d\u91cf\u572830\u4e2a\u5b57\u4ee5\u5185\u3002\u5bf9\u8bdd\u5185\u5bb9\uff1a"+t+"\n\u5bf9\u8bdd\u547d\u540d\uff1a"}],temperature:0,max_tokens:50,model:"gpt-3.5-turbo-0125",stream:!1});if(console.log(r),r&&r.choices&&r.choices.length>0){var s;let t=null===(s=r.choices[0].message)||void 0===s?void 0:s.content;t.length>30&&(t=t.substring(0,30)),this.props.store._chat_saved_list=this.props.store._chat_saved_list.map(a=>(a.id==e&&(a.name=t),a)),this.props.store.save_vars("_chat_saved_list")}}catch(r){console.log(r)}}async save_conversation(){if(this.state.list.length<1)return!1;let e=this.state.list[0].text.substring(0,10)+"-"+(new Date).getTime();const t=(new Date).getTime();console.log("conversation_id",t);const a=this.state.list.map(e=>e.text).join("\n");this.props.store._chat_saved_list.length>100&&this.props.store._chat_saved_list.shift(),this.props.store._chat_saved_list.push({name:e,list:this.state.list,id:t}),this.props.store.save_vars(),Object(p.b)("\u5bf9\u8bdd\u5df2\u4fdd\u5b58\uff0c\u53ef\u5728\u300c\u5bf9\u8bdd\u8bb0\u5f55\u300d\u4e2d\u67e5\u770b"),this.check_bottom_effect(),"yes"==this.props.store._chat_summarize_content&&this.rename_conversation(t,a.substring(0,800))}getApiInstance(){return this.api2d_instance||(this.api2d_instance=new A.a(this.props.store._chat_key,this.props.store._chat_api_url)),this.api2d_instance}async regen_conversation(){this.setState({list:this.state.list.slice(0,-1)});let e=[],t=0;for(let c=this.state.list.length-2;c>=0&&(e.unshift(this.state.list[c]),t++,!(t>=this.props.store._chat_history_count));c--);console.log("new_list",JSON.stringify(e));let a=[];for(let c=0;c<e.length&&!(0+e[c].text.length>this.props.store._chat_max_tokens);c++){let t=e[c].role;"me"==t&&(t="user"),"robot"==t&&(t="assistant");let s={role:t,content:e[c].text};a.push(s)}console.log("history",JSON.stringify(a));try{var s,r;const e=this.getApiInstance(),t=await e.completion({messages:a,temperature:null!==(s=parseFloat(this.props.store._chat_temperature))&&void 0!==s?s:0,max_tokens:null!==(r=parseInt(this.props.store._chat_max_tokens))&&void 0!==r?r:1e3,model:this.props.store._chat_model||"gpt-3.5-turbo-0125",stream:"yes"==this.props.store._chat_stream,moderation:this.props.store._chat_key.startsWith("fk")&&this.props.store._chat_moderation,moderation_stop:!0,noCache:this.props.store._chat_key.startsWith("fk"),onMessage:e=>{console.log("onMessage",e),this.setState({typing:e}),document.querySelector(".chat-list").scrollTop=document.querySelector(".chat-list").scrollHeight},onEnd:e=>{this.setState({typing:""}),document.querySelector(".chat-list").scrollTop=document.querySelector(".chat-list").scrollHeight}});var o,n;if(console.log("ret",t),t)this.setState({list:this.state.list.concat({text:"yes"==this.props.store._chat_stream?t.trim():null===(o=t.choices[0])||void 0===o||null===(n=o.message)||void 0===n?void 0:n.content.trim(),role:"robot"}),text:"",loading:!1}),this.props.store._chat_last=this.state.list,this.props.store.save_vars("_chat_last")}catch(_){var i;let e=_.message;const t=null===(i=e.match(/\[(\d+)\]/))||void 0===i?void 0:i[1],a=Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_KEY_NAME||"KEY";switch(t){case"400":e="\u8bf7\u6c42\u53c2\u6570\u9519\u8bef\uff0c\u5386\u53f2\u8bb0\u5f55\u53ef\u80fd\u8fc7\u957f\uff0c\u8bf7\u6e05\u7406\u540e\u518d\u8bd5";break;case"401":e="".concat(a,"\u9519\u8bef\u6216\u8005\u8d26\u6237\u72b6\u6001\u9519\u8bef\uff0c\u8bf7\u68c0\u67e5\uff1a").concat(a,"\u662f\u5426\u6b63\u786e\u3001").concat(a,"\u662f\u5426\u88ab\u7981\u7528");break;case"402":e=Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_NO_MORE_POINT_TEXT||"\u8d26\u6237\u70b9\u6570\u4e0d\u8db3\uff0c\u8bf7\u5145\u503c\u3002Api2d \u6309\u8bbe\u7f6e\u4e2d\u7684 Max token \u8fdb\u884c\u9884\u6263\uff0c\u56e0\u6b64\u5e76\u4e0d\u662f\u70b9\u6570\u5927\u4e8e\u96f6\u5c31\u53ef\u4ee5\u4f7f\u7528\u3002";break;case"403":e="\u8bf7\u6c42\u7684\u6a21\u578b\u6216\u8005\u8def\u5f84\u4e0d\u53ef\u7528\u6216\u672a\u5f00\u653e\uff0c\u8bf7\u68c0\u67e5\uff1a\u6a21\u578b\u662f\u5426\u5b58\u5728\u3001\u6a21\u578b\u662f\u5426\u88ab\u7981\u7528";break;case"408":e="\u8bf7\u6c42\u8d85\u65f6\uff0c\u53ef\u8c03\u6574\u5ba2\u6237\u7aef\u8bbe\u7f6e\uff1b\u670d\u52a1\u5668\u7aef\u6700\u957f\u54cd\u5e94\u65f6\u95f4\u4e3a180\u79d2";break;case"429":e="\u8bf7\u6c42\u8fc7\u4e8e\u9891\u7e41\uff0c\u6216\u8005\u670d\u52a1\u5668\u8fde\u63a5\u8fc7\u591a\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5"}Object(p.b)("\u9519\u8bef\uff1a"+e),this.setState({loading:!1,typing:""})}this.refresh_point()}async send(e){if(this.props.store._chat_key.length<10)return Object(p.b)("\u8bf7\u5148\u70b9\u51fb\u53f3\u4e0a\u89d2\u6309\u94ae\u8bbe\u7f6e".concat(Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_KEY_NAME||"KEY","\u4ee5\u540e\u518d\u4f7f\u7528")),!1;if(Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_KEY_CK_ID){const e=Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_KEY_CK_ID.split("|");let t=!1;for(let a=0;a<e.length;a++)if(this.props.store._chat_key.indexOf("|".concat(e[a].toLowerCase()))>0){t=!0;break}if(!t)return Object(p.b)("\u60a8\u7684Key\u4e0d\u80fd\u5728\u6b64\u4f7f\u7528\uff0c\u8bf7\u54a8\u8be2Key\u7684\u4f9b\u5e94\u5546"),!1}if(console.log("on send"),e.length<1)return!1;if(this.state.loading)return!1;document.querySelector(".input-box").style.height="100px";const t={text:e,role:"me"};("gpt-4-vision-preview"==this.props.store._chat_model||"gpt-4-turbo"==this.props.store._chat_model)&&this.props.store._chat_image_url&&this.props.store._chat_image_url.length>5&&(t.image_url=this.props.store._chat_image_url);const a=this.state.list.concat(t);if(e.match(/@DALLE(\s|$|[^\w])/i)){this.setState({loading:!0,typing:"\u6b63\u5728\u7ed8\u56fe\uff0c\u53ef\u80fd\u9700\u8981\u4e00\u5230\u4e24\u5206\u949f...",list:a,show_undo:!1}),document.querySelector(".chat-list").scrollTop=document.querySelector(".chat-list").scrollHeight;try{const t=this.getApiInstance();parseInt(this.props.store._chat_timeout)>0&&(t.timeout=1e3*parseInt(this.props.store._chat_timeout));const a=await t.imageGenerate({prompt:e.replace(/@DALLE(\s|$|[^\w])/i,""),model:"dall-e-3"});if(console.log("ret image",a),a&&a.data&&Array.isArray(a.data)&&a.data.length>0){const{revised_prompt:e,url:t}=a.data[0];if(t){const a="![".concat(e,"](").concat(t,")\n\n\u26a0\ufe0f \u6b64\u94fe\u63a5\u4f1a\u8fc7\u671f\uff0c\u8bf7\u53ca\u65f6\u4fdd\u5b58\u56fe\u7247");let s=[];s.push({role:"robot",text:a}),this.setState({list:[...this.state.list,...s],text:"",typing:"",loading:!1}),this.props.store._chat_last=this.state.list,this.props.store.save_vars("_chat_last"),window.setTimeout(()=>{document.querySelector(".chat-list").scrollTop=document.querySelector(".chat-list").scrollHeight},1e3)}}else Object(p.b)("\u9519\u8bef\uff1a"+message),this.setState({loading:!1,typing:""})}catch(_){console.log(_),Object(p.b)("\u63a5\u53e3\u8c03\u7528\u5931\u8d25"),this.setState({loading:!1,typing:""})}}else{this.setState({loading:!0,typing:"\u6b63\u5728\u601d\u8003\u4e2d...",list:a,show_undo:!1}),document.querySelector(".chat-list").scrollTop=document.querySelector(".chat-list").scrollHeight;try{const e=this.getApiInstance();parseInt(this.props.store._chat_timeout)>0&&(e.timeout=1e3*parseInt(this.props.store._chat_timeout));const t=-2-parseInt(this.props.store._chat_history_count||6);let c=t<0?a.slice(t):[];console.log("old",c);let l=[];this.props.store._chat_system_prompt&&l.push({role:"system",content:this.props.store._chat_system_prompt}),this.props.store._chat_user_prompt&&l.push({role:"user",content:this.props.store._chat_user_prompt});for(let a=0;a<c.length;a++)"me"==c[a].role?"gpt-4-vision-preview"!==this.props.store._chat_model&&"gpt-4-turbo"!==this.props.store._chat_model||!c[a].image_url?l.push({role:"user",content:c[a].text}):(l.push({role:"user",content:[{type:"text",text:c[a].text},{type:"image_url",image_url:{url:c[a].image_url}}]}),this.props.store._chat_image_url=""):l.push({role:"assistant",content:c[a].text});if(0==l.length)return Object(p.b)("\u8bb0\u5f55\u4e3a\u7a7a"),!1;if(this.tiktoken){const{encoding_for_model:e}=this.tiktoken;if(e&&"object"===typeof WebAssembly&&"function"===typeof WebAssembly.instantiate){console.log("encoding_for_model & wasm enabled");let t="gpt-3.5-turbo";String(this.props.store._chat_model).toLowerCase().startsWith("gpt-4")&&(t="gpt-4");const a=e(t),s=l;for(let e=0;e<s.length;e++)if(!s[e]||"object"!==typeof s[e]||!s[e].content||s[e].content.length<1||!s[e].role||s[e].role.length<1)return Object(p.b)("\u8bb0\u5f55\u683c\u5f0f\u9519\u8bef"),!1;let r=s.map(e=>"<|im_start|>".concat(e.role," \n").concat(e.content,"<|im_end|>\n")).join("")+"<|im_start|>assistant \n";console.log("wrapped",r),r=r.replaceAll("<|im_start|>"," , ").replaceAll("<|im_end|>"," , ").trim();const o=a.encode(r).length;console.log("message_tokens",o);let n=4096;switch(this.props.store._chat_model){case"gpt-3.5-turbo":n=4096;break;case"gpt-4":n=8192;break;case"gpt-4":case"gpt-4o":case"gpt-4o-mini":case"gpt-4-1106-preview":case"gpt-4-0125-preview":case"gpt-4-vision-preview":n=128e3;break;case"gpt-3.5-turbo-16k":case"gpt-3.5-turbo-0125":n=16384}if(o+parseInt(this.props.store._chat_max_tokens)>=n){if("yes"!=this.props.store._chat_change_model)return Object(p.b)("\u8f93\u5165\u5185\u5bb9\u8fc7\u957f\uff0c\u8bf7\u6e05\u7406\u5bf9\u8bdd\u5386\u53f2\u6216\u8005\u51cf\u5c11\u6700\u5927token"),this.setState({loading:!1,typing:""}),!1;"gpt-3.5-turbo"==this.props.store._chat_model&&(this.props.store._chat_model="gpt-3.5-turbo-16k",n=16384,Object(p.b)("\u5185\u5bb9\u8fc7\u957f\uff0c\u81ea\u52a8\u8c03\u6574\u4e3a gpt-3.5-16k \u6a21\u578b"))}}else console.log("load encoding fail")}try{var s,r;let t="";const a=await e.completion({messages:l,temperature:null!==(s=parseFloat(this.props.store._chat_temperature))&&void 0!==s?s:0,max_tokens:null!==(r=parseInt(this.props.store._chat_max_tokens))&&void 0!==r?r:1e3,model:this.props.store._chat_model||"gpt-3.5-turbo",stream:"yes"==this.props.store._chat_stream,moderation:this.props.store._chat_key.startsWith("fk")&&this.props.store._chat_moderation_on,moderation_stop:!0,onMessage:(e,a)=>{if(console.log("text",e,"last",a),e.length<1)return!1;if(a&&(t+=a,"\u3002"===a||"\uff01"===a||"\uff1f"===a)){const e=t;t="","yes"==this.props.store._chat_auto_audio&&e.length>1&&this.audio(e)}this.setState({typing:e}),document.querySelector(".chat-list").scrollTop=document.querySelector(".chat-list").scrollHeight},onEnd:e=>{this.setState({typing:""}),document.querySelector(".chat-list").scrollTop=document.querySelector(".chat-list").scrollHeight,"yes"==this.props.store._chat_auto_audio&&t.length>1&&this.audio(t)}});var o,n;if(a)console.log("send ret",a),this.setState({list:this.state.list.concat({text:"yes"==this.props.store._chat_stream?a.trim():null===(o=a.choices[0])||void 0===o||null===(n=o.message)||void 0===n?void 0:n.content.trim(),role:"robot"}),text:"",typing:"",loading:!1}),this.props.store._chat_last=this.state.list,this.props.store.save_vars("_chat_last")}catch(_){var i;let e=_.message;const t=null===(i=e.match(/\[(\d+)\]/))||void 0===i?void 0:i[1],a=Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_KEY_NAME||"KEY";switch(t){case"400":e="\u8bf7\u6c42\u53c2\u6570\u9519\u8bef\uff0c\u5386\u53f2\u8bb0\u5f55\u53ef\u80fd\u8fc7\u957f\uff0c\u8bf7\u6e05\u7406\u540e\u518d\u8bd5";break;case"401":e="".concat(a,"\u9519\u8bef\u6216\u8005\u8d26\u6237\u72b6\u6001\u9519\u8bef\uff0c\u8bf7\u68c0\u67e5\uff1a").concat(a,"\u662f\u5426\u6b63\u786e\u3001").concat(a,"\u662f\u5426\u88ab\u7981\u7528");break;case"402":e=Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_NO_MORE_POINT_TEXT||"\u8d26\u6237\u70b9\u6570\u4e0d\u8db3\uff0c\u8bf7\u5145\u503c\u3002Api2d \u6309\u8bbe\u7f6e\u4e2d\u7684 Max token \u8fdb\u884c\u9884\u6263\uff0c\u56e0\u6b64\u5e76\u4e0d\u662f\u70b9\u6570\u5927\u4e8e\u96f6\u5c31\u53ef\u4ee5\u4f7f\u7528\u3002";break;case"403":e="\u8bf7\u6c42\u7684\u6a21\u578b\u6216\u8005\u8def\u5f84\u4e0d\u53ef\u7528\u6216\u672a\u5f00\u653e\uff0c\u8bf7\u68c0\u67e5\uff1a\u6a21\u578b\u662f\u5426\u5b58\u5728\u3001\u6a21\u578b\u662f\u5426\u88ab\u7981\u7528";break;case"408":e="\u8bf7\u6c42\u8d85\u65f6\uff0c\u53ef\u8c03\u6574\u5ba2\u6237\u7aef\u8bbe\u7f6e\uff1b\u670d\u52a1\u5668\u7aef\u6700\u957f\u54cd\u5e94\u65f6\u95f4\u4e3a180\u79d2";break;case"429":e="\u8bf7\u6c42\u8fc7\u4e8e\u9891\u7e41\uff0c\u6216\u8005\u670d\u52a1\u5668\u8fde\u63a5\u8fc7\u591a\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5"}Object(p.b)("\u9519\u8bef\uff1a"+e),this.setState({loading:!1,typing:""})}document.querySelector(".input-box").focus(),document.querySelector(".chat-list").scrollTop=document.querySelector(".chat-list").scrollHeight,window.setTimeout(()=>{this.refresh_point()},1e3)}catch(_){console.log("error",_),Object(p.b)("\u53d1\u9001\u8bf7\u6c42\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5".concat(Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_KEY_NAME||"KEY","\u548cAPI\u8bf7\u6c42\u5730\u5740\u662f\u5426\u6b63\u786e\u6216\u91cd\u8bd5\u3002")+JSON.stringify(_)),this.setState({loading:!1})}}}warning(e){"gpt-4"==e&&Object(p.b)("4\u6a21\u578b\u4ef7\u683c\u662f3.5\u768415~30\u500d\uff0c\u4e14\u8fd4\u56de\u8f83\u6162\u5bb9\u6613\u8d85\u65f6\uff0c\u8bf7\u8c28\u614e\u4f7f\u7528\u3002"),this.props.store.save_vars("_chat_model")}async select_action(e){this.state.actions[e.target.value]&&this.send(this.state.actions[e.target.value])}async export(){if("history"==(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"history")){const e=JSON.stringify({chat_list:this.props.store._chat_saved_list}),t=new Blob([e],{type:"application/json"});Object(C.saveAs)(t,"".concat(Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_NAME||"BioinfoArk",".\u5bf9\u8bdd\u8bb0\u5f55.json"))}else{const e=JSON.stringify({preset_list:this.props.store._preset_saved_list}),t=new Blob([e],{type:"application/json"});Object(C.saveAs)(t,"".concat(Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_NAME||"BioinfoArk",".\u5e38\u7528\u63d0\u793a\u8bcd.json"))}}check_bottom_effect(){if(!document.querySelector(".history-list"))return!1;console.log("check_bottom_effect"),document.querySelector(".history-list").scrollHeight>document.querySelector(".history-list").clientHeight?(console.log("\u6709\u6eda\u52a8\u6761"),document.querySelector(".bottom-effect").style.display="block",document.querySelector(".bottom-effect").style.bottom="0"):(document.querySelector(".bottom-effect").style.display="none",console.log("\u6ca1\u6709\u6eda\u52a8\u6761"))}async set_text(e){this.setState({text:this.state.text+" "+e})}async donate(){this.props.history.push("/donate")}async load_list(e){this.old_list=this.state.list;const t=JSON.parse(e);this.setState({list:t,show_undo:!0}),this.props.store.save_vars("_chat_last"),Object(p.b)("\u5df2\u8f7d\u5165\u5386\u53f2\u4f1a\u8bdd\u8bb0\u5f55\uff0c\u53ef\u70b9\u51fb\u5bf9\u8bdd\u6700\u4e0a\u65b9\u7684\u64a4\u9500\u6309\u94ae\u6062\u590d\u539f\u6709\u5bf9\u8bdd")}async refresh_point(){if(!this.props.store._chat_api_url||!this.props.store._chat_key||!this.props.store._chat_key.startsWith("fk"))return!1;try{const e=this.getApiInstance();e.setApiBaseUrl(this.props.store._chat_api_url);const t=await e.billing();if(t&&(t.object&&"error"==t.object&&Object(p.b)("\u83b7\u53d6\u70b9\u6570\u5931\u8d25\uff1a"+t.message),t.total_available)){let e=t.total_available*(parseFloat(Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_POINT_SCALE)||1);Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_POINT_DECIMAL&&(e=e.toFixed(parseInt(Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_POINT_DECIMAL)||0)),this.setState({point:e})}}catch(e){console.log("error",e),this.api2d_instance=null,Object(p.b)("\u83b7\u53d6\u70b9\u6570\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8bf7\u6c42\u5730\u5740\u548cKey\uff1a"+e.message)}}async save(){this.props.store._chat_key=this.props.store._chat_key.trim(),this.props.store._chat_api_url=this.props.store._chat_api_url.trim(),(!this.props.store._chat_api_url||this.props.store._chat_key.startsWith("fk")&&this.props.store._chat_api_url.startsWith("https://api.openai.com"))&&(this.props.store._chat_api_url="https://oa.api2d.net",Object(p.b)("\u68c0\u6d4b\u5230\u60a8\u4f7f\u7528\u7684\u662fForward Key\uff0c\u5df2\u81ea\u52a8\u5207\u6362API\u5730\u5740"));let e=4096;switch(this.props.store._chat_model){case"gpt-3.5-turbo":e=4096;break;case"gpt-4":e=8192;break;case"gpt-4-turbo":case"gpt-4-0125-preview":case"gpt-4-1106-preview":case"gpt-4-vision-preview":e=128e3;break;case"gpt-3.5-turbo-16k":case"gpt-3.5-turbo-0125":e=16384}if(this.props.store._chat_max_tokens>e-10)return Object(p.b)("\u5f53\u524d\u6a21\u578b\u6700\u5927tokens\u4e3a"+e+"\uff0c\u60a8\u8bbe\u7f6e\u7684max tokens\u592a\u5927\uff0c\u65e0\u6cd5\u6b63\u5e38\u804a\u5929\uff0c\u8bf7\u91cd\u65b0\u8bbe\u7f6e"),!1;this.props.store._chat_model_options.map(e=>e.value).includes(this.props.store._chat_model)||this.props.store._chat_model_options.push({label:String(this.props.store._chat_model).toUpperCase(),value:this.props.store._chat_model}),this.props.store.save_vars(),this.api2d_instance=null,await this.refresh_point(),this.setState({settings_open:!1})}async avatar_save(){this.props.store.save_vars(),this.setState({avatar_open:!1})}async abort(){this.getApiInstance().abort(),this.api2d_instance=null;const e=this.state.typing;this.setState({loading:!1,typing:"",list:this.state.list.concat({text:e+"...",role:"robot"})})}async export_conversation(){this.setState({snap:!0});let e=document.querySelector("#snap_tmp");if(!e){e=document.createElement("div");const t=document.querySelector(".chat-list").offsetWidth||720;e.style.width="".concat(t,"px"),e.style.padding="20px",e.setAttribute("id","snap_tmp"),e.classList.add("snap-chat-list"),document.body.appendChild(e)}window.setTimeout(async()=>{e.innerHTML=document.querySelector(".chat-list").innerHTML;const t=e.querySelectorAll(".bp3-button.code-copy");for(let e=0;e<t.length;e++)t[e].style.display="none";const a=await b()(document.querySelector("#snap_tmp"),{scale:2});this.setState({snap:!1});const s=Date.now();Object(C.saveAs)(a.toDataURL(),"".concat(this.props.store.appname||"BioinfoArk","-")+s+".png"),document.querySelector("#snap_tmp").remove()},500)}async prompt_add(){this.setState({prompt_box:!0})}async prompt_save(){if(!this.props.store._preset_prompt_title)return Object(p.b)("\u6807\u9898\u4e0d\u80fd\u4e3a\u7a7a"),!1;if(!this.props.store._preset_system_prompt&&!this.props.store._preset_user_prompt)return Object(p.b)("\u63d0\u793a\u8bcd\u4e0d\u80fd\u90fd\u4e3a\u7a7a"),!1;if(this.props.store._preset_prompt_id){const e=this.props.store._preset_saved_list.find(e=>e.id==this.props.store._preset_prompt_id);e.title=this.props.store._preset_prompt_title,e.system=this.props.store._preset_system_prompt,e.user=this.props.store._preset_user_prompt,this.props.store.save_vars("_preset_saved_list"),this.prompt_box_clean(!0)}else{const e={id:Date.now(),title:this.props.store._preset_prompt_title,system:this.props.store._preset_system_prompt,user:this.props.store._preset_user_prompt};this.props.store._preset_saved_list.push(e),this.props.store.save_vars("_preset_saved_list"),this.prompt_box_clean(!0)}}prompt_box_clean(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.props.store._preset_prompt_title="",this.props.store._preset_system_prompt="",this.props.store._preset_user_prompt="",this.props.store._preset_prompt_id="",e&&this.setState({prompt_box:!1})}load_prompt(e){const t=this.props.store._preset_saved_list.find(t=>t.id==e),a=this.inputRef.current,s=a.selectionStart,r=a.selectionEnd,o=this.state.text.substring(0,s)+t.user+this.state.text.substring(r);this.setState({text:o}),setTimeout(()=>{a.selectionStart=s+t.user.length,a.selectionEnd=s+t.user.length,a.focus()},0)}edit_prompt(e){const t=this.props.store._preset_saved_list.find(t=>t.id==e);this.props.store._preset_prompt_id=e,this.props.store._preset_prompt_title=t.title,this.props.store._preset_system_prompt=t.system,this.props.store._preset_user_prompt=t.user,this.setState({prompt_box:!0})}remove_prompt(e){const t=this.props.store._preset_saved_list.findIndex(t=>t.id==e);this.props.store._preset_saved_list.splice(t,1),this.props.store.save_vars("_preset_saved_list")}remove_chat_line(e){this.old_list=this.state.list;const t=this.state.list.filter((t,a)=>a!=e);this.setState({list:t,show_undo:!0}),window.setTimeout(()=>{this.props.store._chat_last=this.state.list,this.props.store.save_vars("_chat_last")},1e3)}async audio_play(){if(this.playing)return!1;if(!this.audio_to_play.length)return!1;this.playing=!0;const{text:e}=this.audio_to_play.shift(),t=this.getApiInstance(),a=await t.textToSpeech({text:e,voiceName:"zh-CN-XiaoxiaoNeural",responseType:"blob-url",speed:1.2});console.log("shift",a,e),this.audio_dom||(this.audio_dom=new Audio),this.audio_dom.src=a,this.audio_dom.play(),this.audio_dom.addEventListener("ended",()=>{URL.revokeObjectURL(a),this.playing=!1,this.audio_play()},{once:!0})}async audio(e){if(0!=this.props.store._chat_key.indexOf("fk"))return Object(p.b)("\u53ea\u6709API2D\u7684Key\u53ef\u652f\u6301\u8bed\u97f3"),!1;const t=String(await Object(y.a)().process(e)),a=document.createElement("div");a.innerHTML=t;const s=a.innerText;a.remove(),console.log("markdown to text",e,s),s.length>1&&(this.audio_to_play.push({text:s}),this.audio_play())}async toggle_version(){let e="gpt-3.5-turbo";"gpt-3.5-turbo"==this.props.store._chat_model&&(e="gpt-4o-mini"),"gpt-4o-mini"==this.props.store._chat_model&&(e="gpt-4o"),"gpt-4o"==this.props.store._chat_model&&(e="gpt-4"),"gpt-4"==this.props.store._chat_model&&(e="gpt-4-turbo"),"gpt-4-turbo"==this.props.store._chat_model&&(e="gpt-3.5-turbo"),this.props.store._chat_model=e,this.props.store.save_vars("_chat_model")}async changeApiEndpoint(){if(this.props.store.api_endpoints&&this.props.store.api_endpoints.length>0){this.props.store.endpoint_count++;const e=this.props.store.endpoint_count%this.props.store.api_endpoints.length;let t=this.props.store.api_endpoints[e];t="https://"+t,console.log("next_endpoint",t),this.props.store._chat_api_url=t}}async setFiles(e){const t=e[0],a=new FileReader;a.onload=e=>{const t=e.target.result;this.props.store._chat_image_url=t},a.readAsDataURL(t)}render(){var t,a,s,r,o;const i=n.a.createElement("div",{className:"right-box"},n.a.createElement("div",{className:"row flex md:flex-row flex-col"},n.a.createElement("div",{className:"left flex-1"}),n.a.createElement("div",{className:"right"},n.a.createElement(l.e,{vertical:window.innerWidth<600},window.innerWidth>=600&&window.electronAPI&&(null===(t=window.electronAPI)||void 0===t?void 0:t.pinWindow)&&n.a.createElement(l.b,{active:"yes"==this.props.store._chat_pin_window,icon:"pin",onClick:()=>{var e;this.props.store._chat_pin_window="yes"==this.props.store._chat_pin_window?"no":"yes";const t="yes"==this.props.store._chat_pin_window;null===(e=window.electronAPI)||void 0===e||e.pinWindow(t),this.props.store.save_vars("_chat_pin_window"),t&&Object(p.b)("\u5df2\u5c06\u7a97\u53e3\u7f6e\u4e8e\u6700\u4e0a\u65b9")},large:!0}),this.props.store._chat_key&&this.props.store._chat_key.startsWith("fk")&&n.a.createElement(l.h,{className:"md:w-40 w-full",large:!0,rightElement:n.a.createElement(l.b,{icon:"refresh",minimal:!0,onClick:()=>this.refresh_point(),large:!0}),value:this.state.point+(Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_POINT_NAME||"P"),title:"\u4f59\u989d",readOnly:!0}),n.a.createElement(l.b,{icon:"key",onClick:()=>this.setState({settings_open:!0}),large:!0},"Key\u548c\u5176\u4ed6\u8bbe\u7f6e"),window.innerWidth>=600&&(Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_SHOW_DATA_BUTTON&&"no"==Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_SHOW_DATA_BUTTON?null:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528".startsWith("http")?n.a.createElement(l.a,{href:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528".replaceAll("{{key}}",encodeURIComponent(e.from(this.props.store._chat_key).toString("base64"))),icon:Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_DATA_BTN_ICON||"info-sign",target:"_blank"},Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_DATA_BTN_TEXT||"\u6570\u636e\u5b89\u5168"):n.a.createElement(l.b,{className:"hidden",icon:Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_DATA_BTN_ICON||"info-sign",onClick:()=>Object(p.b)("\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528"),large:!0},Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_DATA_BTN_TEXT||"\u6570\u636e\u5b89\u5168"))))),n.a.createElement("div",{className:"chat-list relative"},this.state.show_undo?n.a.createElement("div",{className:"text-center gray-btn gray-text"},n.a.createElement(l.c,null,n.a.createElement(l.b,{icon:"undo",minimal:!0,onClick:()=>this.undo_conversation()},"\u64a4\u9500"))):null,this.state.list&&this.state.list.map((e,t)=>{var a,s;return n.a.createElement("div",{className:"chat-item ".concat(e.role),key:t},n.a.createElement("div",{className:"chat-text content"},n.a.createElement(E.a,{markdown:null===(a=e.text)||void 0===a?void 0:a.trim()}),n.a.createElement("div",{className:"flex flex-row float-icons"},n.a.createElement("span",{className:"remove"},n.a.createElement(l.b,{icon:"trash",small:!0,minimal:!0,title:"\u5220\u9664",onClick:()=>this.remove_chat_line(t)})),n.a.createElement("span",{className:"copy"},n.a.createElement(d.CopyToClipboard,{text:null===(s=e.text)||void 0===s?void 0:s.trim(),onCopy:()=>Object(p.b)("Markdown\u5df2\u590d\u5236\u5230\u526a\u8d34\u677f")},n.a.createElement(l.b,{icon:"duplicate",small:!0,minimal:!0,title:"\u590d\u5236markdown"}))),Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_SHOW_TTS&&"no"==Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_SHOW_TTS?null:n.a.createElement("span",{className:"audio"},n.a.createElement(l.b,{icon:"volume-up",onClick:()=>this.audio(e.text),small:!0,minimal:!0,title:"\u8bed\u97f3"}))),e.image_url&&n.a.createElement(l.m,{position:"bottom",interactionKind:"click",minimal:!0,content:n.a.createElement("img",{src:e.image_url})},n.a.createElement(l.b,{icon:"media",minimal:!0}))))}),this.state.typing&&n.a.createElement("div",{className:"chat-item robot"},n.a.createElement("div",{className:"chat-text content"},n.a.createElement(l.q,{size:12,className:"mr-2"}),n.a.createElement(E.a,{markdown:null===(a=this.state.typing)||void 0===a?void 0:a.trim()}),n.a.createElement(l.b,{icon:"cross",minimal:!0,onClick:()=>this.abort()}))),this.state.list&&this.state.list.length>0&&n.a.createElement("div",{className:"text-center gray-btn xs-btn gray-text"},!this.state.snap||Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_SHOW_SNAP_WATERMARK&&"no"==Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_SHOW_SNAP_WATERMARK?n.a.createElement(l.c,null,n.a.createElement(l.b,{icon:"refresh",small:!0,minimal:!0,onClick:()=>this.regen_conversation()},"\u91cd\u65b0\u751f\u6210"),n.a.createElement(l.b,{icon:"eraser",small:!0,minimal:!0,onClick:()=>this.clean_conversation(!1)},"\u6e05\u7a7a\u8bb0\u5f55"),n.a.createElement(l.b,{icon:"download",small:!0,minimal:!0,onClick:()=>this.export_conversation()},"\u5bfc\u51fa\u622a\u56fe")):n.a.createElement("div",{className:"text-center mt-2"},n.a.createElement("span",{className:"text-gray-400 p-2 px-3 "},Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_NAME?"- By ".concat(Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_NAME).concat(Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_WEBSITE?" \xb7 "+Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_WEBSITE:""," -"):"- By BioinfoArk www.bioinfoark.com -"))),n.a.createElement("div",{className:"sticky bottom-5 margin-auto text-center w-full z-90 hidden opacity-50 hover:opacity-100 ",id:"bottom-icon"},n.a.createElement(l.b,{icon:"circle-arrow-down",large:!0,onClick:()=>{document.querySelector(".chat-list").scrollTop=document.querySelector(".chat-list").scrollHeight}}))),n.a.createElement("div",{className:"chat-box"},n.a.createElement("form",{action:"post",id:"chat-form",className:"flex flex-col",onSubmit:e=>{var t;e.preventDefault(),this.send(null===(t=this.state.text)||void 0===t?void 0:t.trim())}},n.a.createElement(l.t,{growVertically:!0,large:!0,rows:4,inputRef:this.inputRef,disabled:this.state.loading,placeholder:"\u8f93\u5165\u4f60\u7684\u95ee\u9898\uff0c\u6216\u8005\uff0c\u8f93\u5165\u8981\u6c42\u7136\u540e@DALLE\u753b\u56fe",autoFocus:!0,className:"input-box",onChange:e=>this.onChange(e,"text"),value:this.state.text}),n.a.createElement("div",{className:"flex md:flex-row md:justify-between flex-col items-center mb-2"},n.a.createElement("div",{className:"left flex flex-row items-center"},n.a.createElement(T.a,{onCreateOption:e=>{this.props.store._chat_model_options.push({label:String(e).toUpperCase(),value:e}),this.props.store.save_vars("_chat_model_options")},onUpdate:e=>this.warning(e),className:"mt-2 mb-2 md:mb-0 md:block hidden",field:"_chat_model",options:Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_SHOW_GPT_NAME&&"no"==Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_SHOW_GPT_NAME?this.props.store._chat_model_options.map(e=>({...e,label:e.label.replace("GPT","")})):this.props.store._chat_model_options}),n.a.createElement("div",{className:"mt-2 md:hidden block mr-1"},n.a.createElement(l.b,{onClick:()=>this.toggle_version(),large:!0},"gpt-3.5-turbo"==this.props.store._chat_model&&"3.5+","gpt-4o-mini"==this.props.store._chat_model&&"4om","gpt-4o"==this.props.store._chat_model&&"4o","gpt-4"==this.props.store._chat_model&&"4","gpt-4-turbo"==this.props.store._chat_model&&"4+")),n.a.createElement(l.c,{className:"mt-2 md:mt-0"},n.a.createElement(l.b,{large:!0,className:"md:mt-2 md:ml-1",icon:this.state.loading?n.a.createElement(l.q,{size:12}):"send-message",type:"submit",disabled:this.state.loading},this.state.loading?"\u8bf7\u7a0d\u5019":"\u53d1\u9001(cmd/ctrl+enter)"),"gpt-4-turbo"===this.props.store._chat_model&&n.a.createElement(f.a,{handleFiles:e=>this.setFiles(e)},n.a.createElement(l.b,{large:!0,className:"md:mt-2 mx-1 w-12",icon:"media",active:this.props.store._chat_image_url.length>5})),n.a.createElement(l.b,{large:!0,className:"md:mt-2 ",icon:"clean",onClick:()=>this.clean_conversation()},"\u65b0\u5bf9\u8bdd"))),n.a.createElement("div",{className:"right hidden md:block flex flex-row items-center justify-center"},"yes"!=this.props.store._chat_auto_save?n.a.createElement(l.b,{large:!0,className:"mt-2 ml-2",icon:"floppy-disk",onClick:()=>this.save_conversation()},"\u4fdd\u5b58\u5bf9\u8bdd"):n.a.createElement(m.a,{onUpdate:()=>this.props.store.save_vars(),field:"_chat_auto_save",label:"\u81ea\u52a8\u4fdd\u5b58\u4f1a\u8bdd",className:"no-margin",options:[{label:"\u662f",value:"yes"},{label:"\u5426",value:"no"}]}))))));(this.state.actions?Object.keys(this.state.actions).map(e=>{if(e.trim().length>0)return{label:e,value:e}}):[]).unshift({label:"\u8bf7\u9009\u62e9",value:""});const _=n.a.createElement("div",{className:"prompt-tab"},n.a.createElement("div",{className:"prompt-list"},this.props.store._preset_saved_list&&(null===(s=this.props.store._preset_saved_list)||void 0===s?void 0:s.slice().reverse().map((e,t)=>n.a.createElement("div",{key:t,className:"prompt-item mb-2 border rounded mb-2 p-2 text-sm text-gray-400 hover:text-blue-400 flex flex-row justify-between cursor-pointer",onClick:()=>this.load_prompt(e.id)},n.a.createElement("div",{className:"left flex flex-row items-center"},e.title.substring(0,30)),n.a.createElement("div",{className:"right action-icon ml-2 gray-btn"},n.a.createElement(l.b,{small:!0,minimal:!0,icon:"edit",title:"\u7f16\u8f91",onClick:t=>{this.edit_prompt(e.id),t.preventDefault(),t.stopPropagation()}}),n.a.createElement(l.b,{small:!0,minimal:!0,icon:"cross",title:"\u5220\u9664",onClick:t=>{this.remove_prompt(e.id),t.preventDefault(),t.stopPropagation()}}))))),n.a.createElement("div",{className:"bottom-effect"}))),A=n.a.createElement("div",{className:"history-tab"},n.a.createElement("div",{className:"history-list"},this.props.store._chat_saved_list&&(null===(r=this.props.store._chat_saved_list)||void 0===r?void 0:r.slice().reverse().map((e,t)=>n.a.createElement("div",{key:t,className:"history-item mb-2 border rounded mb-2 p-2 text-sm text-gray-400 hover:text-blue-400 flex flex-row justify-between"},n.a.createElement("div",{className:"left flex flex-row items-center"},e.name.substring(0,30)),n.a.createElement("div",{className:"right action-icon ml-2 gray-btn"},n.a.createElement(l.b,{small:!0,minimal:!0,icon:"history",title:"\u8f7d\u5165",onClick:()=>this.load_list(JSON.stringify(e.list))}),n.a.createElement(l.b,{small:!0,minimal:!0,icon:"cross",title:"\u5220\u9664",onClick:()=>this.remove_list(e.id)}))))),n.a.createElement("div",{className:"bottom-effect"}))),O=n.a.createElement("div",{className:"left-box flex-1"},n.a.createElement("div",null,n.a.createElement("div",{className:"text-lg mb-2 text-gray-300 mt-6 mr-2 flex flex-row w-48"},n.a.createElement(l.s,{id:"left-tab",onChange:e=>{this.setState({tab_selected:e})},selectedTabId:this.state.tab_selected,className:"w-full"},n.a.createElement(l.r,{id:"prompt",title:"\u63d0\u793a\u8bcd",panel:_}),n.a.createElement(l.r,{id:"history",title:"\u5bf9\u8bdd\u8bb0\u5f55",panel:A}),n.a.createElement(l.s.Expander,null),n.a.createElement(l.c,null,"prompt"==this.state.tab_selected&&n.a.createElement(l.b,{onClick:()=>this.prompt_add(),icon:"plus",className:"gray-btn",minimal:!0,title:"\u6dfb\u52a0\u9884\u7f6e\u63d0\u793a\u8bcd"}),n.a.createElement(l.b,{onClick:()=>this.fileInput.click(),icon:"circle-arrow-up",className:"gray-btn",minimal:!0,title:"\u5bfc\u5165"}),n.a.createElement("input",{type:"file",accept:".json",ref:e=>{this.fileInput=e},style:{display:"none"},onChange:this.handleFile}),n.a.createElement(l.b,{icon:"circle-arrow-down",className:"gray-btn",minimal:!0,onClick:()=>this.export(this.state.tab_selected),title:"\u5bfc\u51fa"}))))),Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_SHOW_LOGO&&"no"==Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_SHOW_LOGO?null:n.a.createElement("div",{className:null!==(o="char-box opacity-"+this.props.store._chat_char_opacity)&&void 0!==o?o:80},n.a.createElement("img",{src:this.props.store._chat_avatar_url||Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_LOGO||"char.png",onError:()=>{this.props.store._chat_avatar_url&&(this.props.store._chat_avatar_url=null)},className:"char",onClick:()=>this.setState({avatar_open:!0}),style:Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_LOGO_STYLE?Object(N.a)(Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_LOGO_STYLE):null}),n.a.createElement(P.a,{className:"slider",field:"_chat_char_opacity",min:10,stepSize:10,labelStepSize:10,onUpdate:()=>this.props.store.save_vars()}))),b=window.origin+"/#share/"+encodeURIComponent(e.from(JSON.stringify({_chat_key:this.props.store._chat_key,_chat_api_url:this.props.store._chat_api_url})).toString("base64")),C=Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_SHOW_KEY_BUTTON&&"no"==Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_SHOW_KEY_BUTTON?null:Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_KEY_LINK?n.a.createElement(l.a,{large:!0,icon:"key",href:Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_KEY_LINK.replaceAll("{{key}}",encodeURIComponent(e.from(this.props.store._chat_key).toString("base64"))),target:"_blank"},Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_KEY_TEXT||"\u70b9\u6b64\u7533\u8bf7Key"):n.a.createElement(l.a,{large:!0,icon:"key",href:"https://www.bioinfoark.com/?page_id=902",target:"_blank"},"\u7533\u8bf7Forward Key \xb7 \u53ef\u5fae\u4fe1\u5145\u503c"),y="c.level06.com"==window.location.hostname||"dd.ftqq.com"==window.location.hostname?n.a.createElement(l.a,{large:!0,icon:"cog",className:"ml-2",href:"https://a.ftqq.com/2023/04/24/chatyou-custom-platform",target:"_blank"},""):null,I=n.a.createElement("div",{className:"flex flex-row chat-page"},O,i,n.a.createElement(l.f,{isOpen:this.state.settings_open,title:"\u8bbe\u7f6e",icon:"info-sign",onClose:()=>this.setState({settings_open:!1})},n.a.createElement("div",{className:"p-5 mt-2"},(!Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_SHOW_KEY||"yes"==Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_SHOW_KEY)&&n.a.createElement(n.a.Fragment,null,n.a.createElement(h.a,{field:"_chat_key",label:Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_KEY_NAME||"KEY",placeholder:Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_KEY_PLACEHOLDER||"\u8bf7\u8f93\u5165OpenAI/Forward KEY: sk-xxx/fkxxx"})),Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_SHOW_API_URL&&"no"==Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_SHOW_API_URL?null:n.a.createElement(h.a,{field:"_chat_api_url",label:"API\u5730\u5740",placeholder:"\u8bf7\u8f93\u5165API\u5730\u5740\uff0c\u7559\u7a7a\u8bbf\u95eeOpenAI\u5b98\u65b9",disabled:Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_MODIFY_API_URL&&"no"==Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_MODIFY_API_URL,rightElement:Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_API2D_ENDPOINT_BTN&&"no"==Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_API2D_ENDPOINT_BTN?null:n.a.createElement(l.b,{icon:"random",onClick:()=>this.changeApiEndpoint()},"\u5207\u6362\u5730\u5740")}),n.a.createElement("div",{className:"flex flex-row mb-5 items-center"},Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_SHOW_ADVANCED_SETTINGS_BUTTON&&"no"==Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_SHOW_ADVANCED_SETTINGS_BUTTON?null:n.a.createElement(l.b,{icon:this.state.show_extend_settings?"chevron-up":"chevron-down",className:"mr-2",large:!0,onClick:()=>this.setState({show_extend_settings:!this.state.show_extend_settings})},"\u9ad8\u7ea7\u8bbe\u7f6e"),Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_SHOW_SHARE_BUTTON&&"no"==Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_SHOW_SHARE_BUTTON?null:n.a.createElement(n.a.Fragment,null,!window.electronAPI&&n.a.createElement(d.CopyToClipboard,{text:b,onCopy:()=>Object(p.b)("\u5206\u4eab\u94fe\u63a5\u5df2\u7ecf\u590d\u5236\u5230\u526a\u8d34\u677f\uff0c\u8bf7\u6ce8\u610f\u4fdd\u5bc6\uff0c\u77e5\u9053\u6b64\u94fe\u63a5\u7684\u4eba\u4f1a\u6d88\u8017\u4f60\u7684\u4f59\u989d")},n.a.createElement(l.b,{icon:"share",large:!0},"\u5206\u4eab\u5e26\u8d26\u53f7\u94fe\u63a5"))),y),this.state.show_extend_settings?n.a.createElement(n.a.Fragment,null,n.a.createElement("div",{className:"flex flex-row"},n.a.createElement(h.a,{field:"_chat_max_tokens",label:"Max Tokens",placeholder:"\u6700\u5927 token \u6570\u91cf\uff0c\u4e00\u822c\u804a\u59291000\u5373\u53ef\uff0c3.5\u6700\u5927\u4e3a4000,4\u4e3a8000\uff0c\u5426\u5219\u5bb9\u6613\u51fa\u9519",className:"mr-2 flex-1"}),n.a.createElement(h.a,{field:"_chat_temperature",label:"\u53d1\u6563\u5ea6",placeholder:"Temperature\uff0c\u53d1\u6563\u7a0b\u5ea6\uff0c0~2\u4e4b\u95f4\uff0c\u8d8a\u5927\u8d8a\u53d1\u6563",className:"flex-1 mr-2"}),n.a.createElement(h.a,{field:"_chat_timeout",label:"\u8d85\u65f6\u65f6\u95f4\xb7\u79d2",placeholder:"\u8d85\u65f6\u4f1a\u81ea\u52a8\u7ec8\u6b62\u8bf7\u6c42",className:"mr-2 flex-1"}),n.a.createElement(h.a,{field:"_chat_history_count",label:"\u5386\u53f2\u4e0a\u4e0b\u6587\u6570\u91cf",placeholder:"\u6bcf\u6b21\u9644\u5e26\u7684\u4e0a\u4e0b\u6587\u6761\u6570\uff0c\u4f1a\u53d7 Max tokens\u9650\u5236",className:"flex-1"})),n.a.createElement("div",{className:"flex flex-row"},n.a.createElement(m.a,{field:"_chat_auto_save",label:"\u81ea\u52a8\u4fdd\u5b58\u4f1a\u8bdd",className:"mr-2",options:[{label:"\u662f",value:"yes"},{label:"\u5426",value:"no"}]}),n.a.createElement(m.a,{field:"_chat_summarize_content",label:"\u4f7f\u7528GPT\u751f\u6210\u4f1a\u8bdd\u6807\u9898"}),this.props.store._chat_key.startsWith("fk")?Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_SHOW_TTS&&"no"==Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_SHOW_TTS?null:n.a.createElement(m.a,{field:"_chat_auto_audio",label:"\u81ea\u52a8\u6717\u8bfb\u56de\u7b54"}):null),n.a.createElement(h.a,{field:"_chat_system_prompt",label:"\u7cfb\u7edf\u63d0\u793a\u8bcd",placeholder:"system prompt"}),n.a.createElement(h.a,{field:"_chat_user_prompt",label:"\u7528\u6237\u63d0\u793a\u8bcd",placeholder:"user prompt"}),n.a.createElement(h.a,{field:"_chat_model",label:"CHAT\u6a21\u578b",placeholder:"\u53ef\u8be6\u7ec6\u6307\u5b9a\u81ea\u5df1\u60f3\u8981\u7684\u6a21\u578b\uff0c\u6ce8\u610f\u5982\u679c\u63a5\u53e3\u4e0d\u652f\u6301\u53ef\u80fd\u62a5\u9519",rightElement:n.a.createElement(l.b,{onClick:()=>{this.props.store._chat_model_options=this.props.store.default_model_options,this.props.store._chat_model="gpt-3.5-turbo",this.props.store.save_vars()}},"\u6e05\u9664\u81ea\u5b9a\u4e49\u6a21\u578b")}),n.a.createElement("div",{className:"flex flex-row"},n.a.createElement(m.a,{field:"_chat_stream",label:"\u6d41\u5f0f\u4f20\u8f93",className:"mr-2",options:[{label:"\u662f",value:"yes"},{label:"\u5426",value:"no"}]}),n.a.createElement(m.a,{field:"_chat_change_model",label:"\u6839\u636e\u957f\u5ea6\u81ea\u52a8\u5207\u63623.5-16K",className:"mr-2",options:[{label:"\u662f",value:"yes"},{label:"\u5426",value:"no"}]}))):null,n.a.createElement(u.a,{onSubmit:()=>this.save(),cancel:n.a.createElement("div",{className:"flex flex-row"},C)}),n.a.createElement("div",{className:"text-center box-footer text-gray-400"},"- ",(Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_NAME?Object({NODE_ENV:"production",PUBLIC_URL:".",REACT_APP_API_BASE:"https://openapi.ftqq.com/",REACT_APP_LOCAL_API_BASE:"",REACT_APP_FT_APPID:"26",REACT_APP_DATA_NOTICE:"\u60a8\u7684key\u4fdd\u5b58\u5728\u5ba2\u6237\u7aef\u4e2d\uff0c\u76f4\u63a5\u548cOpenAI/API2d\u901a\u4fe1\uff0cKey\u548c\u6570\u636e\u5747\u4e0d\u901a\u8fc7\u6211\u4eec\u7684\u670d\u52a1\u5668\uff0c\u8bf7\u653e\u5fc3\u4f7f\u7528",REACT_APP_SHOW_SETTINGS_BUTTON:"yes",REACT_APP_SETTINGS_BUTTON_TEXT:"Key\u548c\u5176\u4ed6\u8bbe\u7f6e",REACT_APP_SETTINGS_BUTTON_ICON:"key"}).REACT_APP_NAME+" ":"Bioinfoark \u8363\u8a89\u51fa\u54c1 \xb7 BioinfoArk v")+"".concat(this.props.store.version)," -"))),n.a.createElement(l.f,{isOpen:this.state.avatar_open,title:"\u8bbe\u7f6e\u804a\u5929\u52a9\u7406\u548c\u80cc\u666f",icon:"info-sign",onClose:()=>this.setState({avatar_open:!1})},n.a.createElement("div",{className:"p-5 mt-2"},n.a.createElement(h.a,{field:"_chat_avatar_url",placeholder:"\u8bf7\u7c98\u8d34\u4e00\u4e2a\u53ef\u4ee5\u8bbf\u95ee\u7684\u56fe\u7247URL\uff0c\u6700\u597d\u80cc\u666f\u900f\u660e\uff0c\u5982https://..."}),n.a.createElement(h.a,{field:"_chat_bg_url",placeholder:"\u80cc\u666f\u56fe\u7247URL\uff0c\u5982https://..."}),n.a.createElement(u.a,{onSubmit:()=>this.avatar_save(),cancel:n.a.createElement(l.b,{onClick:()=>this.setState({avatar_open:!1}),large:!0},"\u5173\u95ed")}))),n.a.createElement(l.f,{isOpen:this.state.prompt_box,title:"\u5e38\u7528\u63d0\u793a\u8bcd",icon:"info-sign",onClose:()=>this.prompt_box_clean(!0)},n.a.createElement("div",{className:"p-5 mt-2"},n.a.createElement(h.a,{field:"_preset_prompt_title",placeholder:"\u63d0\u793a\u8bcd\u6807\u9898"}),n.a.createElement(h.a,{type:"textarea",field:"_preset_user_prompt",placeholder:"user prompt",fill:!0}),n.a.createElement(u.a,{onSubmit:()=>this.prompt_save(),cancel:n.a.createElement(l.b,{onClick:()=>this.prompt_box_clean(!0),large:!0},"\u5173\u95ed")}))));return n.a.createElement(c.a,{title:this.props.store.appname,main:I})}})||r)||r)||r)}).call(this,a(79).Buffer)},408:function(e,t,a){"use strict";a.d(t,"a",(function(){return P}));var s,r,o=a(0),n=a.n(o),i=a(7),_=a(50),c=a(1653),l=a(667),p=a(1654),A=a(1652),T=a(666),h=a(240),u=a(17),E=a(31);let P=(s=Object(i.b)("store"),Object(_.f)(r=s(r=Object(i.c)(r=class extends o.Component{render(){return n.a.createElement(c.a,{remarkPlugins:[T.a],className:"markdown-text toastui-editor-contents",children:this.props.markdown,linkTarget:"_blank",components:{code(e){let{node:t,inline:a,className:s,children:r,...o}=e;if(s&&s.indexOf("hljs")>-1)return n.a.createElement("code",Object.assign({},o,{className:s}),r);const i=/language-(\w+)/.exec(s||"");return a?n.a.createElement("code",Object.assign({className:s},o),r):n.a.createElement("div",{className:"code-box my-2"},n.a.createElement(p.a,Object.assign({children:String(r).replace(/\n$/,""),style:A.a,language:i&&i[1]?i[1]:"bash",PreTag:"div"},o)),n.a.createElement(h.CopyToClipboard,{className:"code-copy",text:String(r),onCopy:()=>Object(E.b)("\u4ee3\u7801\u5df2\u590d\u5236")},n.a.createElement(u.b,{icon:"code"},"\u590d\u5236\u4ee3\u7801")))},img(e){let{src:t,alt:a}=e;return n.a.createElement(l.a,{showDownload:!0,showRotation:!0,showZoom:!0,small:t,large:t,alt:a,onError:e=>{e.target.src="https://via.placeholder.com/450x300?text=\u56fe\u7247\u52a0\u8f7d\u5931\u8d25"}})}}})}})||r)||r)||r)},653:function(e,t,a){"use strict";a.d(t,"a",(function(){return p}));var s,r,o=a(0),n=a.n(o),i=a(7),_=a(50),c=a(654),l=a(669);let p=(s=Object(i.b)("store"),Object(_.f)(r=s(r=Object(i.c)(r=class extends o.Component{render(){let e=this.props.store[this.props.field]||"",t=this.props.options.filter(t=>e==t.value);Date.now();return n.a.createElement("div",{className:"lossline "+this.props.className||!1},n.a.createElement("div",{className:"lossline"},this.props.label),this.props.onCreateOption?n.a.createElement(l.a,{menuPlacement:this.props.menuPosition||"auto",placeholder:this.props.placeholder||"\u8bf7\u9009\u62e9",value:t,onCreateOption:e=>this.props.onCreateOption(e),isMulti:!1,onChange:e=>{this.props.store[this.props.field]=e?e.value:"",this.props.onUpdate&&this.props.onUpdate(e.value)},options:this.props.options||[]}):n.a.createElement(c.a,{menuPlacement:this.props.menuPosition||"auto",placeholder:this.props.placeholder||"\u8bf7\u9009\u62e9",value:t,isMulti:!1,onChange:e=>{this.props.store[this.props.field]=e?e.value:"",this.props.onUpdate&&this.props.onUpdate(e.value)},options:this.props.options||[]}))}})||r)||r)||r)},660:function(e,t,a){"use strict";a.d(t,"a",(function(){return h}));var s,r,o=a(16),n=a(21),i=a(24),_=a(26),c=a(0),l=a.n(c),p=a(7),A=a(50),T=a(17),h=(s=Object(p.b)("store"),Object(A.f)(r=s(r=Object(p.c)(r=function(e){Object(i.a)(a,e);var t=Object(_.a)(a);function a(){return Object(o.a)(this,a),t.apply(this,arguments)}return Object(n.a)(a,[{key:"render",value:function(){var e,t,a,s,r,o=this,n=null!==(e=this.props.store[this.props.field])&&void 0!==e?e:0;return l.a.createElement(T.p,{className:this.props.className||"",stepSize:null!==(t=this.props.stepSize)&&void 0!==t?t:10,labelStepSize:null!==(a=this.props.labelStepSize)&&void 0!==a?a:10,min:null!==(s=this.props.min)&&void 0!==s?s:0,max:null!==(r=this.props.max)&&void 0!==r?r:100,value:n,onChange:function(e){o.props.store[o.props.field]=e,o.props.onUpdate&&o.props.onUpdate(e)}})}}]),a}(c.Component))||r)||r)||r)},664:function(e,t,a){"use strict";(function(e){a.d(t,"a",(function(){return u}));var s,r,o=a(16),n=a(21),i=a(24),_=a(26),c=a(0),l=a.n(c),p=a(7),A=a(50),T=a(73),h=a(17),u=(s=Object(p.b)("store"),Object(A.f)(r=s(r=Object(p.c)(r=function(t){Object(i.a)(s,t);var a=Object(_.a)(s);function s(){return Object(o.a)(this,s),a.apply(this,arguments)}return Object(n.a)(s,[{key:"componentDidMount",value:function(){var t=decodeURIComponent(this.props.match.params.info),a=e.from(t,"base64").toString();this.props.store.share_info=a;var s=JSON.parse(a);for(var r in s)this.props.store.hasOwnProperty(r)&&(this.props.store[r]=s[r]);this.props.store.save_vars(),this.props.history.push("/")}},{key:"render",value:function(){var e=l.a.createElement("div",{className:"flex justify-center items-center h-screen"},l.a.createElement("div",{className:"text-center"},l.a.createElement(h.q,null)));return l.a.createElement(T.a,{title:this.props.store.appname,main:e})}}]),s}(c.Component))||r)||r)||r)}).call(this,a(79).Buffer)},719:function(e,t,a){e.exports=a(1651)},724:function(e,t,a){},73:function(e,t,a){"use strict";var s,r,o,n,i,_,c,l,p,A,T,h,u=a(16),E=a(21),P=a(24),m=a(26),d=a(0),O=a.n(d),b=a(7),C=a(50),y=a(649),N=a.n(y),I=a(40),f=(s=Object(b.b)("store"),Object(C.f)(r=s(r=Object(b.c)(r=function(e){Object(P.a)(a,e);var t=Object(m.a)(a);function a(){return Object(u.a)(this,a),t.apply(this,arguments)}return Object(E.a)(a,[{key:"render",value:function(){var e=this.props.data;return e?O.a.createElement("div",{className:"user-span"},O.a.createElement("img",{src:e.avatar_url,className:"avatar"}),e.name,e.coin>=0&&O.a.createElement("span",{className:"coin bg-blue-500 text-white font-mono text-xs"},e.coin)):null}}]),a}(d.Component))||r)||r),a(111)),S=a(17),v=a(69),g=a(1689),R=a(235),k=(o=Object(b.b)("store"),Object(C.f)(n=o(n=Object(b.c)(n=function(e){Object(P.a)(a,e);var t=Object(m.a)(a);function a(){return Object(u.a)(this,a),t.apply(this,arguments)}return Object(E.a)(a,[{key:"render",value:function(){var e=this,t=O.a.createElement(S.i,{className:"border"},O.a.createElement(S.k,{icon:"person",text:"\u6211\u7684",onClick:function(){return e.props.history.push("/profile")}}),O.a.createElement(S.k,{icon:"dollar",text:"\u5145\u503c",onClick:function(){return e.props.history.push("/recharge")}}),O.a.createElement(S.j,null),O.a.createElement(S.k,{icon:"log-out",text:"\u9000\u51fa",onClick:function(){return e.props.history.push("/logout")}})),a=this.props,s=(a.staticContext,Object(f.a)(a,["staticContext"]));return O.a.createElement("div",s,this.props.store.user?O.a.createElement(g.a,{autoFocus:!1,content:t,position:v.a.BOTTOM_RIGHT},O.a.createElement(S.b,{rightIcon:"caret-down",minimal:!0})):O.a.createElement(R.a,{minimal:!0}))}}]),a}(d.Component))||n)||n),i=Object(b.b)("store"),Object(C.f)(_=i(_=Object(b.c)(_=function(e){Object(P.a)(a,e);var t=Object(m.a)(a);function a(){return Object(u.a)(this,a),t.apply(this,arguments)}return Object(E.a)(a,[{key:"render",value:function(){var e=this,t=this.props,a=(t.staticContext,Object(f.a)(t,["staticContext"]));return O.a.createElement("div",a,O.a.createElement("div",{className:"flex flex-row items-center"},this.props.store.menu&&O.a.createElement(O.a.Fragment,null," ",O.a.createElement("svg",{className:"w-3 h-3 mr-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},O.a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 5l7 7-7 7"}))," "),this.props.store.menu&&this.props.store.menu.map((function(t){var a,s=!0;(t.member_only&&(e.props.store.token||(s=!1)),t.admin_only)&&((null===(a=e.props.store.user)||void 0===a?void 0:a.level)<9&&(s=!1));return s?O.a.createElement(I.c,{className:"nav-menu text-black text-lg hover:text-gray-500 hover:no-underline ",key:t.id,to:t.link},t.text):null}))))}}]),a}(d.Component))||_)||_)||_);c=Object(b.b)("store"),Object(C.f)(l=c(l=Object(b.c)(l=function(e){Object(P.a)(a,e);var t=Object(m.a)(a);function a(){return Object(u.a)(this,a),t.apply(this,arguments)}return Object(E.a)(a,[{key:"render",value:function(){this.props.store.user;return O.a.createElement("div",{className:(this.props.className||"")+" header"},O.a.createElement("div",{className:"container mx-auto"},O.a.createElement("div",{className:"left flex flex-row items-center"},O.a.createElement(I.b,{to:"/"},this.props.store.appname),O.a.createElement(k,{className:"ml-5 hidden md:block"})),O.a.createElement("div",{className:"right"})))}}]),a}(d.Component))||l)||l),p=Object(b.b)("store"),Object(C.f)(A=p(A=Object(b.c)(A=function(e){Object(P.a)(a,e);var t=Object(m.a)(a);function a(){return Object(u.a)(this,a),t.apply(this,arguments)}return Object(E.a)(a,[{key:"render",value:function(){return O.a.createElement("div",{className:(this.props.className||"")+" footer"},"\u751f\u4fe1\u65b9\u821f www.bininfoark.com")}}]),a}(d.Component))||A)||A);a.d(t,"a",(function(){return j}));var j=(T=Object(b.b)("store"),Object(C.f)(h=T(h=Object(b.c)(h=function(e){Object(P.a)(a,e);var t=Object(m.a)(a);function a(){return Object(u.a)(this,a),t.apply(this,arguments)}return Object(E.a)(a,[{key:"render",value:function(){return O.a.createElement(N.a,{title:this.props.title||this.props.store.appname},O.a.createElement(O.a.Fragment,null,this.props.store._chat_bg_url?O.a.createElement("div",{className:"chat-bg"}," ",O.a.createElement("img",{src:this.props.store._chat_bg_url,onError:function(e){return e.target.style.display="none"},referrerPolicy:"no-referrer"})):null,O.a.createElement("div",{className:""},O.a.createElement("div",{className:"body container mx-auto"},this.props.main)),O.a.createElement("div",{className:"drag-handle w-full h-5 fixed top-0 "})))}}]),a}(d.Component))||h)||h)||h)},74:function(e,t,a){"use strict";a.d(t,"a",(function(){return h}));var s,r,o=a(16),n=a(21),i=a(24),_=a(26),c=a(0),l=a.n(c),p=a(7),A=a(50),T=a(17),h=(s=Object(p.b)("store"),Object(A.f)(r=s(r=Object(p.c)(r=function(e){Object(i.a)(a,e);var t=Object(_.a)(a);function a(){return Object(o.a)(this,a),t.apply(this,arguments)}return Object(n.a)(a,[{key:"render",value:function(){var e=this,t=this.props.store[this.props.field]||"";return l.a.createElement(T.g,{label:this.props.label,className:this.props.lineClass||""},"textarea"==this.props.type?l.a.createElement(T.t,{fill:this.props.fill||!1,growVertically:!0,large:!0,placeholder:this.props.placeholder,onChange:function(t){return e.props.store[e.props.field]=t.target.value},value:t,className:this.props.className||""}):l.a.createElement(T.h,{type:this.props.type,large:"true",placeholder:this.props.placeholder,onChange:function(t){return e.props.store[e.props.field]=t.target.value},rightElement:this.props.rightElement||null,value:t,className:this.props.className||"",disabled:this.props.disabled||null}),parseInt(this.props.max_count)>0&&l.a.createElement("div",{className:"text-count"},t.length,"/",this.props.max_count))}}]),a}(c.Component))||r)||r)||r)}},[[719,1,2]]]); |