(this.webpackJsonpchatchan=this.webpackJsonpchatchan||[]).push([[0],{1053:function(e,t){},1055:function(e,t){},1065:function(e,t){},1067:function(e,t){},1094:function(e,t){},1095:function(e,t){},1100:function(e,t){},1102:function(e,t){},1109:function(e,t){},1128:function(e,t){},124:function(e,t,a){"use strict";a.d(t,"a",(function(){return T}));var r,n,s=a(11),o=a(12),i=a(16),c=a(17),_=a(0),p=a.n(_),l=a(8),u=a(41),A=a(15),T=(r=Object(l.b)("store"),Object(u.f)(n=r(n=Object(l.c)(n=function(e){Object(i.a)(a,e);var t=Object(c.a)(a);function a(){return Object(s.a)(this,a),t.apply(this,arguments)}return Object(o.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(),r=this.props.field;return p.a.createElement("div",{className:"my-2 "+this.props.className||!1},p.a.createElement(A.d,{key:a+t++,checked:"yes"==this.props.store[r],label:this.props.label,onChange:function(t){return e.change(t)},inline:!0}))}}]),a}(_.Component))||n)||n)||n)},145:function(e,t,a){"use strict";a.d(t,"a",(function(){return h}));var r,n,s=a(11),o=a(12),i=a(16),c=a(17),_=a(0),p=a.n(_),l=a(8),u=a(41),A=a(15),T=a(100),h=(r=Object(l.b)("store"),Object(u.f)(n=r(n=Object(l.c)(n=function(e){Object(i.a)(a,e);var t=Object(c.a)(a);function a(){return Object(s.a)(this,a),t.apply(this,arguments)}return Object(o.a)(a,[{key:"render",value:function(){var e=this;return p.a.createElement(p.a.Fragment,null,p.a.createElement("div",{className:"std-hr form-div"}),p.a.createElement(A.g,null,p.a.createElement("div",{className:"flex flex-row justify-between"},p.a.createElement("div",{className:"left"},p.a.createElement(A.b,{large:"true",intent:T.a.PRIMARY,onClick:function(){return e.props.onSubmit()}},"\u63d0\u4ea4")),p.a.createElement("div",{className:"right"},this.props.cancel||p.a.createElement(A.b,{large:"true",onClick:function(){return e.props.history.goBack()},className:"right-20"},"\u53d6\u6d88")))))}}]),a}(_.Component))||n)||n)||n)},1468:function(e,t,a){"use strict";a.r(t);var r,n,s,o,i,c,_,p,l,u,A,T,h,E,P,m,O,d,b,f,C,y,N,v=a(0),I=a.n(v),S=a(38),g=a.n(S),R=(a(607),a(11)),k=a(12),j=a(16),B=a(17),x=a(30),w=a(41),U=a(8),L=Object(U.b)("store")(r=Object(U.c)(r=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 I.a.createElement("div",{className:"title"},I.a.createElement("h1",null,"Hello\uff0c",this.props.store.appname))}}]),a}(v.Component))||r)||r,D=a(15),G=(n=Object(U.b)("store"),Object(w.f)(s=n(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(){var e=this;return I.a.createElement("div",null,I.a.createElement("h1",null,I.a.createElement(L,null)),I.a.createElement("div",null,I.a.createElement(D.b,{onClick:function(){return e.props.store.appname+="\ud83c\udf88"}},"change")),I.a.createElement("div",null,I.a.createElement("span",{onClick:function(){return e.props.history.push("/login")}},"Login")))}}]),a}(v.Component))||s)||s),q=a(52),K=a(170),W=(o=Object(U.b)("store"),Object(w.f)(i=o(i=Object(U.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=I.a.createElement("div",{className:"p-32 "},"FrontPage");return I.a.createElement(q.a,{title:this.props.store.appname,main:e})}}]),a}(v.Component))||i)||i),a(3)),H=a.n(W),F=a(6),V=a(24),X=(c=Object(U.b)("store"),Object(w.f)(_=c(_=Object(U.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,r,n;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"),r=t.get("session"),e.next=5,this.props.store.get_token_by_code(a,r);case 5:(null===(n=e.sent)||void 0===n?void 0:n.token)&&this.props.store.set_user(n.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 I.a.createElement("div",{className:"flex flex-row pt-20 items-center justify-center"},I.a.createElement(D.o,null))}}]),a}(v.Component))||_)||_)||_),z=a(60),M=a(53),Y=a(220),J=(p=Object(U.b)("store"),Object(w.f)(l=p(l=Object(U.c)(l=function(e){Object(j.a)(a,e);var t=Object(B.a)(a);function a(){var e;Object(R.a)(this,a);for(var r=arguments.length,n=new Array(r),s=0;s0?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(s.a)(t,["staticContext","onClick"]));return T.a.createElement(T.a.Fragment,null,T.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&&T.a.createElement(P.l,{isOpen:this.state.qrcode_url,canOutsideClickClose:!1,onClose:function(){return e.setState({qrcode_url:!1})}},T.a.createElement("div",{className:"center-box bg-white p-10 rounded"},T.a.createElement(O.a,{value:this.state.qrcode_url}),T.a.createElement("div",{className:"mt-2"},T.a.createElement(P.b,{large:!0,onClick:function(){return e.check()}},"\u5fae\u4fe1\u626b\u7801\u540e\u70b9\u6b64\u7ee7\u7eed")))))}}]),a}(A.Component))||n)||n)||n)},220:function(e,t,a){"use strict";a.d(t,"a",(function(){return T}));var r,n=a(14),s=a(11),o=a(12),i=a(16),c=a(17),_=a(0),p=a.n(_),l=a(41),u=a(467),A=a.n(u),T=Object(l.f)(r=function(e){Object(i.a)(a,e);var t=Object(c.a)(a);function a(){var e;Object(s.a)(this,a);for(var r=arguments.length,n=new Array(r),o=0;o0?p.a.createElement("img",{style:{maxWidth:200},src:this.state.img_url}):p.a.createElement(A.a,Object(n.a)({size:200,value:this.state.value,includeMargin:!0,id:"theqr__inbox"},"includeMargin",!0)))}}]),a}(_.Component))||r},232:function(e,t,a){"use strict";var r,n,s,o,i,c,_,p,l,u,A,T,h,E,P,m,O,d,b,f,C,y,N,v,I,S,g,R,k,j,B,x,w,U,L,D,G,q,K,W,H,F=a(3),V=a.n(F),X=a(6),z=a(31),M=a(11),Y=a(12),J=a(29),$=(a(636),a(10)),Z=a(24),Q=a(234),ee=a.n(Q),te=function(){function e(t){Object(M.a)(this,e),this.store=t}return Object(Y.a)(e,[{key:"get",value:function(){var e=Object(X.a)(V.a.mark((function e(t){var a,r,n=arguments;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.length>1&&void 0!==n[1]?n[1]:null,r=null==a?this.store.apibase+t:this.store.apibase+t+ds+new URLSearchParams(a).toString(),e.abrupt("return",this.rawGet(r));case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"rawGet",value:function(){var e=Object(X.a)(V.a.mark((function e(t){return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=this,e.next=3,ee.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(X.a)(V.a.mark((function e(t){var a,r,n,s,o=arguments;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=o.length>1&&void 0!==o[1]?o[1]:null,r=!(o.length>2&&void 0!==o[2])||o[2],n=!(o.length>3&&void 0!==o[3])||o[3],s=this.store.apibase+t,e.abrupt("return",this.rawPost(s,a,r,n));case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"rawPost",value:function(){var e=Object(X.a)(V.a.mark((function e(t){var a,r,n,s,o=arguments;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=o.length>1&&void 0!==o[1]?o[1]:null,r=!(o.length>2&&void 0!==o[2])||o[2],n=!(o.length>3&&void 0!==o[3])||o[3],e.prev=3,s=new URLSearchParams,a&&Object.keys(a).forEach((function(e){return s.append(e,a[e])})),r&&this.store.token&&s.append("token",this.store.token),e.t0=this,e.next=10,ee.a.post(t,s);case 10:return e.t1=e.sent,e.t2=n,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(X.a)(V.a.mark((function e(t){var a,r,n,s,o=arguments;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=o.length>1&&void 0!==o[1]?o[1]:null,r=!(o.length>2&&void 0!==o[2])||o[2],n=!(o.length>3&&void 0!==o[3])||o[3],s=new FormData,a&&Object.keys(a).forEach((function(e){return s.append(e,a[e])})),r&&this.store.token&&s.append("token",this.store.token),e.t0=this,e.next=9,ee.a.post(this.store.apibase+t,s);case 9:return e.t1=e.sent,e.t2=n,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(X.a)(V.a.mark((function e(t){var a=arguments;return V.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(Z.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}(),ae=(r=function(){function e(){Object(M.a)(this,e),Object(z.a)(this,"appname",n,this),Object(z.a)(this,"apibase",s,this),Object(z.a)(this,"local_apibase",o,this),Object(z.a)(this,"session",i,this),Object(z.a)(this,"token",c,this),Object(z.a)(this,"user",_,this),Object(z.a)(this,"api_endpoints",p,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.24",this.endpoint_count=0,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"],Object(z.a)(this,"menu",l,this),Object(z.a)(this,"coin_name",u,this),Object(z.a)(this,"recharge_input_coin",A,this),Object(z.a)(this,"_donate_keys",T,this),Object(z.a)(this,"_donate_title",h,this),Object(z.a)(this,"_donate_link",E,this),Object(z.a)(this,"_chat_model",P,this),Object(z.a)(this,"_chat_saved_list",m,this),Object(z.a)(this,"_preset_saved_list",O,this),Object(z.a)(this,"_chat_key",d,this),Object(z.a)(this,"_chat_api_url",b,this),Object(z.a)(this,"_chat_avatar_url",f,this),Object(z.a)(this,"_chat_bg_url",C,this),Object(z.a)(this,"_chat_max_tokens",y,this),Object(z.a)(this,"_chat_temperature",N,this),Object(z.a)(this,"_chat_timeout",v,this),Object(z.a)(this,"_chat_system_prompt",I,this),Object(z.a)(this,"_chat_user_prompt",S,this),Object(z.a)(this,"_chat_char_opacity",g,this),Object(z.a)(this,"_chat_history_count",R,this),Object(z.a)(this,"_chat_last",k,this),Object(z.a)(this,"_chat_auto_save",j,this),Object(z.a)(this,"_chat_summarize_content",B,this),Object(z.a)(this,"_chat_auto_audio",x,this),Object(z.a)(this,"_chat_pin_window",w,this),Object(z.a)(this,"_preset_system_prompt",U,this),Object(z.a)(this,"_preset_user_prompt",L,this),Object(z.a)(this,"_preset_prompt_title",D,this),Object(z.a)(this,"_preset_prompt_id",G,this),Object(z.a)(this,"_chat_moderation_on",q,this),Object(z.a)(this,"_chat_stream",K,this),Object(z.a)(this,"_chat_change_model",W,this),Object(z.a)(this,"_chat_image_url",H,this),this.api=new te(this),this.load_vars(),this.load_api_endpoints()}return Object(Y.a)(e,[{key:"load_api_endpoints",value:function(){var e=Object(X.a)(V.a.mark((function e(){var t,a;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch("https://domain.api2d.org/");case 3:return t=e.sent,e.next=6,t.json();case 6:(a=e.sent)&&a.length>0&&(this.api_endpoints=a),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log(e.t0);case 13:case"end":return e.stop()}}),e,this,[[0,10]])})));return function(){return e.apply(this,arguments)}}()},{key:"load_default",value:function(){var e=Object(X.a)(V.a.mark((function e(){var t,a;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch("default.json");case 3:return t=e.sent,e.next=6,t.json();case 6:(a=e.sent).app_name&&(this.appname=a.app_name),a.api_key&&(this._chat_key=a.api_key),a.api_url&&(this._chat_api_url=a.api_url),a.chat_model&&(this._chat_model=a.chat_model),a.chat_max_tokens&&(this._chat_max_tokens=a.chat_max_tokens),a.chat_temperature&&(this._chat_temperature=a.chat_temperature),a.chat_timeout&&(this._chat_timeout=a.chat_timeout),a.chat_system_prompt&&(this._chat_system_prompt=a.chat_system_prompt),a.chat_user_prompt&&(this._chat_user_prompt=a.chat_user_prompt),a.chat_character_url&&(this._chat_avatar_url=a.chat_character_url),a.chat_character_opacity&&(this._chat_opacity=a.chat_character_opacity),a.chat_moderation&&(this._chat_moderation_on="on"==a.chat_moderation),e.next=23;break;case 21:e.prev=21,e.t0=e.catch(0);case 23:case"end":return e.stop()}}),e,this,[[0,21]])})));return function(){return e.apply(this,arguments)}}()},{key:"load_vars",value:function(){var e=Object(X.a)(V.a.mark((function e(){var t=this;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.load_default();case 2:this.to_save_vars.forEach((function(e){var a=window.localStorage.getItem("FT_CHATCHAN_VAR_"+e);a&&(t[e]=JSON.parse(a))}));case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"save_vars",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,a=null===t?this.to_save_vars:[t];a.forEach((function(t){window.localStorage.setItem("FT_CHATCHAN_VAR_"+t,JSON.stringify(e[t]))}))}},{key:"get_wechat_login_url",value:function(){var e=Object(X.a)(V.a.mark((function e(){var t,a,r,n=arguments;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:this.ftopenapp_id,a=n.length>1&&void 0!==n[1]?n[1]:this.session,e.next=4,this.api.get("global/user/get_wx_sns_login_url?id="+t+"&session="+a);case 4:return r=e.sent,e.abrupt("return",r);case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"get_token_by_code",value:function(){var e=Object(X.a)(V.a.mark((function e(t){var a,r,n=arguments;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.length>1&&void 0!==n[1]?n[1]:"",e.next=3,this.api.post("global/user/get_token_by_wx_code",{code:t,session:a});case 3:return r=e.sent,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"preorder",value:function(){var e=Object(X.a)(V.a.mark((function e(t){var a;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.api.post("global/pay/order",{amount_cent:t});case 2:return a=e.sent,e.abrupt("return",a);case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"logout",value:function(){this.user=null,this.token=null,window.localStorage.clear()}},{key:"set_user",value:function(e){this.user=e,this.token=e.session_id,this.save_vars()}},{key:"check_user_info",value:function(){var e=Object(X.a)(V.a.mark((function e(){var t,a,r,n=arguments;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=n.length>0&&void 0!==n[0]?n[0]:null)){e.next=8;break}return e.next=4,this.api.post("global/user/get_user_session",{token:t},!1);case 4:return a=e.sent,e.abrupt("return",a);case 8:return e.next=10,this.api.post("global/user/get_user_session");case 10:return r=e.sent,e.abrupt("return",r);case 12:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"get_user_profile",value:function(){var e=Object(X.a)(V.a.mark((function e(){var t;return V.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.api.post("global/user/profile");case 2:return t=e.sent,e.abrupt("return",t);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),e}(),n=Object(J.a)(r.prototype,"appname",[$.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||"Chat\u9171"}}),s=Object(J.a)(r.prototype,"apibase",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"https://openapi.ftqq.com/"}}),o=Object(J.a)(r.prototype,"local_apibase",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),i=Object(J.a)(r.prototype,"session",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),c=Object(J.a)(r.prototype,"token",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),_=Object(J.a)(r.prototype,"user",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),p=Object(J.a)(r.prototype,"api_endpoints",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),l=Object(J.a)(r.prototype,"menu",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[{id:8001,text:"\u9996\u9875",link:"/home",member_only:!1}]}}),Object(J.a)(r.prototype,"logout",[$.f],Object.getOwnPropertyDescriptor(r.prototype,"logout"),r.prototype),Object(J.a)(r.prototype,"set_user",[$.f],Object.getOwnPropertyDescriptor(r.prototype,"set_user"),r.prototype),u=Object(J.a)(r.prototype,"coin_name",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"\u91d1\u5e01"}}),A=Object(J.a)(r.prototype,"recharge_input_coin",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),T=Object(J.a)(r.prototype,"_donate_keys",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),h=Object(J.a)(r.prototype,"_donate_title",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),E=Object(J.a)(r.prototype,"_donate_link",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),P=Object(J.a)(r.prototype,"_chat_model",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"gpt-3.5-turbo"}}),m=Object(J.a)(r.prototype,"_chat_saved_list",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),O=Object(J.a)(r.prototype,"_preset_saved_list",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),d=Object(J.a)(r.prototype,"_chat_key",[$.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||""}}),b=Object(J.a)(r.prototype,"_chat_api_url",[$.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"}}),f=Object(J.a)(r.prototype,"_chat_avatar_url",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),C=Object(J.a)(r.prototype,"_chat_bg_url",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),y=Object(J.a)(r.prototype,"_chat_max_tokens",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1e3}}),N=Object(J.a)(r.prototype,"_chat_temperature",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return.1}}),v=Object(J.a)(r.prototype,"_chat_timeout",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 60}}),I=Object(J.a)(r.prototype,"_chat_system_prompt",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),S=Object(J.a)(r.prototype,"_chat_user_prompt",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),g=Object(J.a)(r.prototype,"_chat_char_opacity",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 80}}),R=Object(J.a)(r.prototype,"_chat_history_count",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 6}}),k=Object(J.a)(r.prototype,"_chat_last",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),j=Object(J.a)(r.prototype,"_chat_auto_save",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"yes"}}),B=Object(J.a)(r.prototype,"_chat_summarize_content",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"yes"}}),x=Object(J.a)(r.prototype,"_chat_auto_audio",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"no"}}),w=Object(J.a)(r.prototype,"_chat_pin_window",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"no"}}),U=Object(J.a)(r.prototype,"_preset_system_prompt",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),L=Object(J.a)(r.prototype,"_preset_user_prompt",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),D=Object(J.a)(r.prototype,"_preset_prompt_title",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),G=Object(J.a)(r.prototype,"_preset_prompt_id",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),q=Object(J.a)(r.prototype,"_chat_moderation_on",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),K=Object(J.a)(r.prototype,"_chat_stream",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"yes"}}),W=Object(J.a)(r.prototype,"_chat_change_model",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"yes"}}),H=Object(J.a)(r.prototype,"_chat_image_url",[$.m],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),r);t.a=new ae},24:function(e,t,a){"use strict";a(232);var r=a(15),n=a(54),s=r.s.create({className:"lm-toaster",position:n.a.TOP});a(654),a(655);function o(){return"micromessenger"==navigator.userAgent.toLowerCase().match(/MicroMessenger/i)}function i(e){s.show({message:e})}a.d(t,"a",(function(){return o})),a.d(t,"b",(function(){return i}))},304:function(e,t,a){"use strict";(function(e){a.d(t,"a",(function(){return U}));var r,n,s=a(23),o=a(14),i=a(3),c=a.n(i),_=a(6),p=a(11),l=a(12),u=a(16),A=a(17),T=a(0),h=a.n(T),E=a(8),P=a(41),m=a(52),O=a(15),d=a(24),b=(a(1145),a(489)),f=a(471),C=a(60),y=a(145),N=a(305),v=a(480),I=a(124),S=a(174),g=a(481),R=a.n(g),k=a(235),j=a(486),B=a(224),x=a(482),w=a.n(x),U=(r=Object(E.b)("store"),Object(P.f)(n=r(n=Object(E.c)(n=function(t){Object(u.a)(n,t);var r=Object(A.a)(n);function n(e){var t;return Object(p.a)(this,n),(t=r.call(this,e)).handleFile=function(e){var a=e.target.files[0];if("application/json"===a.type){var r=new FileReader;r.onload=function(e){var a=JSON.parse(e.target.result);if(a&&a.chat_list){for(var r=t.props.store._chat_saved_list,n=a.chat_list,s=[],o=0;o10&&e.refresh_point(),e.state.list.length<1&&e.props.store._chat_last&&e.props.store._chat_last.length>0&&e.setState({list:e.props.store._chat_last}),"yes"==e.props.store._chat_pin_window)&&(window&&window.electronAPI&&(null===(t=window.electronAPI)||void 0===t?void 0:t.pinWindow)&&(window.electronAPI.pinWindow(!0),console.log("set window float")));e.check_bottom_effect()}),1e3),document.addEventListener("visibilitychange",(function(e){e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault()}))}},{key:"init",value:function(){var e=Object(_.a)(c.a.mark((function e(){return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,a.e(3).then(a.bind(null,1472));case 3:this.tiktoken=e.sent,e.next=10;break;case 6:e.prev=6,e.t0=e.catch(0),console.log("wasm\u8f7d\u5165\u9519\u8bef",e.t0),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");case 10:case"end":return e.stop()}}),e,this,[[0,6]])})));return function(){return e.apply(this,arguments)}}()},{key:"onChange",value:function(e,t){this.setState(Object(o.a)({},t,e.target.value))}},{key:"save_key",value:function(){var e=Object(_.a)(c.a.mark((function e(){return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(this.props.store._chat_key.length<10)){e.next=3;break}return Object(d.b)("\u8bf7\u8f93\u5165\u6b63\u786e\u7684OpenAPI/API2D Key"),e.abrupt("return",!1);case 3:this.props.store.save_vars(),this.api2d_instance=null,Object(d.b)("\u4fdd\u5b58\u6210\u529f");case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"clean_conversation",value:function(){var e=Object(_.a)(c.a.mark((function e(){var t,a=arguments;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=!(a.length>0&&void 0!==a[0])||a[0],"yes"!=this.props.store._chat_auto_save||!t){e.next=4;break}return e.next=4,this.save_conversation();case 4: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(d.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");case 11:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"undo_conversation",value:function(){var e=Object(_.a)(c.a.mark((function e(){return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.old_list&&(this.setState({last:!1,list:this.old_list,loading:!1,show_undo:!1}),window.setTimeout((function(){document.querySelector(".chat-list").scrollTop=document.querySelector(".chat-list").scrollHeight}),300));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"remove_list",value:function(){var e=Object(_.a)(c.a.mark((function e(t){return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.props.store._chat_saved_list=this.props.store._chat_saved_list.filter((function(e){return e.id!=t})),this.props.store.save_vars(),this.check_bottom_effect();case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"rename_conversation",value:function(){var e=Object(_.a)(c.a.mark((function e(t,a){var r,n,s,o;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.getApiInstance(),e.prev=1,a=a.replace(/@[\s\S]*?\s/g,"").replace(/#[\s\S]*?\s/g,"").substring(0,800),e.next=5,r.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"+a+"\n\u5bf9\u8bdd\u547d\u540d\uff1a"}],temperature:0,max_tokens:50,model:"gpt-3.5-turbo",stream:!1});case 5:n=e.sent,console.log(n),n&&n.choices&&n.choices.length>0&&((o=null===(s=n.choices[0].message)||void 0===s?void 0:s.content).length>30&&(o=o.substring(0,30)),this.props.store._chat_saved_list=this.props.store._chat_saved_list.map((function(e){return e.id==t&&(e.name=o),e})),this.props.store.save_vars("_chat_saved_list")),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(1),console.log(e.t0);case 13:case"end":return e.stop()}}),e,this,[[1,10]])})));return function(t,a){return e.apply(this,arguments)}}()},{key:"save_conversation",value:function(){var e=Object(_.a)(c.a.mark((function e(){var t,a,r;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(this.state.list.length<1)){e.next=2;break}return e.abrupt("return",!1);case 2:t=this.state.list[0].text.substring(0,10)+"-"+(new Date).getTime(),a=(new Date).getTime(),console.log("conversation_id",a),r=this.state.list.map((function(e){return 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:t,list:this.state.list,id:a}),this.props.store.save_vars(),Object(d.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(a,r.substring(0,800));case 12:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getApiInstance",value:function(){return this.api2d_instance||(this.api2d_instance=new b.a(this.props.store._chat_key,this.props.store._chat_api_url)),this.api2d_instance}},{key:"regen_conversation",value:function(){var e=Object(_.a)(c.a.mark((function e(){var t,a,r,n,s,o,i,_,p,l,u,A,T,h,E,P,m,O,b=this;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.setState({list:this.state.list.slice(0,-1)}),t=[],a=0,r=this.state.list.length-2;case 4:if(!(r>=0)){e.next=12;break}if(t.unshift(this.state.list[r]),!(++a>=this.props.store._chat_history_count)){e.next=9;break}return e.abrupt("break",12);case 9:r--,e.next=4;break;case 12:console.log("new_list",JSON.stringify(t)),n=[],s=0,o=0;case 16:if(!(othis.props.store._chat_max_tokens)){e.next=19;break}return e.abrupt("break",27);case 19:"me"==(i=t[o].role)&&(i="user"),"robot"==i&&(i="assistant"),_={role:i,content:t[o].text},n.push(_);case 24:o++,e.next=16;break;case 27:return console.log("history",JSON.stringify(n)),e.prev=28,u=this.getApiInstance(),e.next=32,u.completion({messages:n,temperature:null!==(p=parseFloat(this.props.store._chat_temperature))&&void 0!==p?p:0,max_tokens:null!==(l=parseInt(this.props.store._chat_max_tokens))&&void 0!==l?l: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,moderation_stop:!0,noCache:this.props.store._chat_key.startsWith("fk"),onMessage:function(e){console.log("onMessage",e),b.setState({typing:e}),document.querySelector(".chat-list").scrollTop=document.querySelector(".chat-list").scrollHeight},onEnd:function(e){b.setState({typing:""}),document.querySelector(".chat-list").scrollTop=document.querySelector(".chat-list").scrollHeight}});case 32:A=e.sent,console.log("ret",A),A&&(this.setState({list:this.state.list.concat({text:"yes"==this.props.store._chat_stream?A.trim():null===(T=A.choices[0])||void 0===T||null===(h=T.message)||void 0===h?void 0:h.content.trim(),role:"robot"}),text:"",loading:!1}),this.props.store._chat_last=this.state.list,this.props.store.save_vars("_chat_last")),e.next=59;break;case 37:e.prev=37,e.t0=e.catch(28),P=e.t0.message,m=null===(E=P.match(/\[(\d+)\]/))||void 0===E?void 0:E[1],O=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",e.t1=m,e.next="400"===e.t1?45:"401"===e.t1?47:"402"===e.t1?49:"403"===e.t1?51:"408"===e.t1?53:"429"===e.t1?55:57;break;case 45:return P="\u8bf7\u6c42\u53c2\u6570\u9519\u8bef\uff0c\u5386\u53f2\u8bb0\u5f55\u53ef\u80fd\u8fc7\u957f\uff0c\u8bf7\u6e05\u7406\u540e\u518d\u8bd5",e.abrupt("break",57);case 47:return P="".concat(O,"\u9519\u8bef\u6216\u8005\u8d26\u6237\u72b6\u6001\u9519\u8bef\uff0c\u8bf7\u68c0\u67e5\uff1a").concat(O,"\u662f\u5426\u6b63\u786e\u3001").concat(O,"\u662f\u5426\u88ab\u7981\u7528"),e.abrupt("break",57);case 49:return P=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",e.abrupt("break",57);case 51:return P="\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",e.abrupt("break",57);case 53:return P="\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",e.abrupt("break",57);case 55:return P="\u8bf7\u6c42\u8fc7\u4e8e\u9891\u7e41\uff0c\u6216\u8005\u670d\u52a1\u5668\u8fde\u63a5\u8fc7\u591a\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5",e.abrupt("break",57);case 57:Object(d.b)("\u9519\u8bef\uff1a"+P),this.setState({loading:!1,typing:""});case 59:this.refresh_point();case 60:case"end":return e.stop()}}),e,this,[[28,37]])})));return function(){return e.apply(this,arguments)}}()},{key:"send",value:function(){var e=Object(_.a)(c.a.mark((function e(t){var a,r,n,o,i,_,p,l,u,A,T,h,E,P,m,O,b,f,C,y,N,v,I,S,g,R,k,j,B,x,w,U,L,D,G,q=this;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(this.props.store._chat_key.length<10)){e.next=3;break}return Object(d.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")),e.abrupt("return",!1);case 3: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){e.next=17;break}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_CK_ID.split("|"),r=!1,n=0;case 7:if(!(n0)){e.next=11;break}return r=!0,e.abrupt("break",14);case 11:n++,e.next=7;break;case 14:if(r){e.next=17;break}return Object(d.b)("\u60a8\u7684Key\u4e0d\u80fd\u5728\u6b64\u4f7f\u7528\uff0c\u8bf7\u54a8\u8be2Key\u7684\u4f9b\u5e94\u5546"),e.abrupt("return",!1);case 17:if(console.log("on send"),!(t.length<1)){e.next=20;break}return e.abrupt("return",!1);case 20:if(!this.state.loading){e.next=22;break}return e.abrupt("return",!1);case 22:if(document.querySelector(".input-box").style.height="100px",o={text:t,role:"me"},"gpt-4-vision-preview"==this.props.store._chat_model&&this.props.store._chat_image_url&&this.props.store._chat_image_url.length>5&&(o.image_url=this.props.store._chat_image_url),i=this.state.list.concat(o),!t.match(/@DALLE(\s|$|[^\w])/i)){e.next=47;break}return this.setState({loading:!0,typing:"\u6b63\u5728\u7ed8\u56fe\uff0c\u53ef\u80fd\u9700\u8981\u4e00\u5230\u4e24\u5206\u949f...",list:i,show_undo:!1}),document.querySelector(".chat-list").scrollTop=document.querySelector(".chat-list").scrollHeight,e.prev=29,(_=this.getApiInstance()).setApiBaseUrl(this.props.store._chat_api_url),parseInt(this.props.store._chat_timeout)>0&&(_.timeout=1e3*parseInt(this.props.store._chat_timeout)),e.next=35,_.imageGenerate({prompt:t.replace(/@DALLE(\s|$|[^\w])/i,""),model:"dall-e-3"});case 35:p=e.sent,console.log("ret image",p),p&&p.data&&Array.isArray(p.data)&&p.data.length>0?(l=p.data[0],u=l.revised_prompt,(A=l.url)&&(T="![".concat(u,"](").concat(A,")"),(h=[]).push({role:"robot",text:T}),this.setState({list:[].concat(Object(s.a)(this.state.list),h),text:"",typing:"",loading:!1}),this.props.store._chat_last=this.state.list,this.props.store.save_vars("_chat_last"),window.setTimeout((function(){document.querySelector(".chat-list").scrollTop=document.querySelector(".chat-list").scrollHeight}),1e3))):(Object(d.b)("\u9519\u8bef\uff1a"+message),this.setState({loading:!1,typing:""})),e.next=45;break;case 40:e.prev=40,e.t0=e.catch(29),console.log(e.t0),Object(d.b)("\u63a5\u53e3\u8c03\u7528\u5931\u8d25"),this.setState({loading:!1,typing:""});case 45:e.next=154;break;case 47:for(this.setState({loading:!0,typing:"\u6b63\u5728\u601d\u8003\u4e2d...",list:i,show_undo:!1}),document.querySelector(".chat-list").scrollTop=document.querySelector(".chat-list").scrollHeight,e.prev=49,(E=this.getApiInstance()).setApiBaseUrl(this.props.store._chat_api_url),parseInt(this.props.store._chat_timeout)>0&&(E.timeout=1e3*parseInt(this.props.store._chat_timeout)),P=-2-parseInt(this.props.store._chat_history_count||6),m=P<0?i.slice(P):[],console.log("old",m),O=[],this.props.store._chat_system_prompt&&O.push({role:"system",content:this.props.store._chat_system_prompt}),this.props.store._chat_user_prompt&&O.push({role:"user",content:this.props.store._chat_user_prompt}),b=0;b".concat(e.role," \n").concat(e.content,"<|im_end|>\n")})).join("")+"<|im_start|>assistant \n",console.log("wrapped",I),I=I.replaceAll("<|im_start|>"," , ").replaceAll("<|im_end|>"," , ").trim(),S=y.encode(I).length,console.log("message_tokens",S),g=4096,e.t2=this.props.store._chat_model,e.next="gpt-3.5-turbo"===e.t2?95:"gpt-4"===e.t2?97:"gpt-4-1106-preview"===e.t2||"gpt-4-0125-preview"===e.t2||"gpt-4-vision-preview"===e.t2?99:"gpt-3.5-turbo-16k"===e.t2?101:103;break;case 95:return g=4096,e.abrupt("break",103);case 97:return g=8192,e.abrupt("break",103);case 99:return g=128e3,e.abrupt("break",103);case 101:return g=16384,e.abrupt("break",103);case 103:if(!(S+parseInt(this.props.store._chat_max_tokens)>=g)){e.next=111;break}if("yes"!=this.props.store._chat_change_model){e.next=108;break}"gpt-3.5-turbo"==this.props.store._chat_model&&(this.props.store._chat_model="gpt-3.5-turbo-16k",g=16384,Object(d.b)("\u5185\u5bb9\u8fc7\u957f\uff0c\u81ea\u52a8\u8c03\u6574\u4e3a gpt-3.5-16k \u6a21\u578b")),e.next=111;break;case 108:return Object(d.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:""}),e.abrupt("return",!1);case 111:e.next=114;break;case 113:console.log("load encoding fail");case 114:return e.prev=114,j="",e.next=118,E.completion({messages:O,temperature:null!==(R=parseFloat(this.props.store._chat_temperature))&&void 0!==R?R:0,max_tokens:null!==(k=parseInt(this.props.store._chat_max_tokens))&&void 0!==k?k: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:function(e,t){if(console.log("text",e,"last",t),e.length<1)return!1;if(t&&(j+=t,"\u3002"===t||"\uff01"===t||"\uff1f"===t)){var a=j;j="","yes"==q.props.store._chat_auto_audio&&a.length>1&&q.audio(a)}q.setState({typing:e}),document.querySelector(".chat-list").scrollTop=document.querySelector(".chat-list").scrollHeight},onEnd:function(e){q.setState({typing:""}),document.querySelector(".chat-list").scrollTop=document.querySelector(".chat-list").scrollHeight,"yes"==q.props.store._chat_auto_audio&&j.length>1&&q.audio(j)}});case 118:(B=e.sent)&&(console.log("send ret",B),this.setState({list:this.state.list.concat({text:"yes"==this.props.store._chat_stream?B.trim():null===(x=B.choices[0])||void 0===x||null===(w=x.message)||void 0===w?void 0:w.content.trim(),role:"robot"}),text:"",typing:"",loading:!1}),this.props.store._chat_last=this.state.list,this.props.store.save_vars("_chat_last")),e.next=144;break;case 122:e.prev=122,e.t3=e.catch(114),L=e.t3.message,D=null===(U=L.match(/\[(\d+)\]/))||void 0===U?void 0:U[1],G=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",e.t4=D,e.next="400"===e.t4?130:"401"===e.t4?132:"402"===e.t4?134:"403"===e.t4?136:"408"===e.t4?138:"429"===e.t4?140:142;break;case 130:return L="\u8bf7\u6c42\u53c2\u6570\u9519\u8bef\uff0c\u5386\u53f2\u8bb0\u5f55\u53ef\u80fd\u8fc7\u957f\uff0c\u8bf7\u6e05\u7406\u540e\u518d\u8bd5",e.abrupt("break",142);case 132:return L="".concat(G,"\u9519\u8bef\u6216\u8005\u8d26\u6237\u72b6\u6001\u9519\u8bef\uff0c\u8bf7\u68c0\u67e5\uff1a").concat(G,"\u662f\u5426\u6b63\u786e\u3001").concat(G,"\u662f\u5426\u88ab\u7981\u7528"),e.abrupt("break",142);case 134:return L=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",e.abrupt("break",142);case 136:return L="\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",e.abrupt("break",142);case 138:return L="\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",e.abrupt("break",142);case 140:return L="\u8bf7\u6c42\u8fc7\u4e8e\u9891\u7e41\uff0c\u6216\u8005\u670d\u52a1\u5668\u8fde\u63a5\u8fc7\u591a\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5",e.abrupt("break",142);case 142:Object(d.b)("\u9519\u8bef\uff1a"+L),this.setState({loading:!1,typing:""});case 144:document.querySelector(".input-box").focus(),document.querySelector(".chat-list").scrollTop=document.querySelector(".chat-list").scrollHeight,window.setTimeout((function(){q.refresh_point()}),1e3),e.next=154;break;case 149:e.prev=149,e.t5=e.catch(49),console.log("error",e.t5),Object(d.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(e.t5)),this.setState({loading:!1});case 154:case"end":return e.stop()}}),e,this,[[29,40],[49,149],[114,122]])})));return function(t){return e.apply(this,arguments)}}()},{key:"warning",value:function(e){"gpt-4"==e&&Object(d.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")}},{key:"select_action",value:function(){var e=Object(_.a)(c.a.mark((function e(t){return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.state.actions[t.target.value]&&this.send(this.state.actions[t.target.value]);case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"export",value:function(){var e=Object(_.a)(c.a.mark((function e(){var t,a,r,n,s=arguments;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:"history"==(s.length>0&&void 0!==s[0]?s[0]:"history")?(t=JSON.stringify({chat_list:this.props.store._chat_saved_list}),a=new Blob([t],{type:"application/json"}),Object(k.saveAs)(a,"".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||"Chat\u9171",".\u5bf9\u8bdd\u8bb0\u5f55.json"))):(r=JSON.stringify({preset_list:this.props.store._preset_saved_list}),n=new Blob([r],{type:"application/json"}),Object(k.saveAs)(n,"".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||"Chat\u9171",".\u5e38\u7528\u63d0\u793a\u8bcd.json")));case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"check_bottom_effect",value:function(){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"))}},{key:"set_text",value:function(){var e=Object(_.a)(c.a.mark((function e(t){return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.setState({text:this.state.text+" "+t});case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"donate",value:function(){var e=Object(_.a)(c.a.mark((function e(){return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.props.history.push("/donate");case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"load_list",value:function(){var e=Object(_.a)(c.a.mark((function e(t){var a;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.old_list=this.state.list,a=JSON.parse(t),this.setState({list:a,show_undo:!0}),this.props.store.save_vars("_chat_last"),Object(d.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");case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"refresh_point",value:function(){var e=Object(_.a)(c.a.mark((function e(){var t,a,r;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.props.store._chat_api_url&&this.props.store._chat_key&&this.props.store._chat_key.startsWith("fk")){e.next=2;break}return e.abrupt("return",!1);case 2:return e.prev=2,(t=this.getApiInstance()).setApiBaseUrl(this.props.store._chat_api_url),e.next=7,t.billing();case 7:(a=e.sent)&&(a.object&&"error"==a.object&&Object(d.b)("\u83b7\u53d6\u70b9\u6570\u5931\u8d25\uff1a"+a.message),a.total_available&&(r=a.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&&(r=r.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:r}))),e.next=16;break;case 11:e.prev=11,e.t0=e.catch(2),console.log("error",e.t0),this.api2d_instance=null,Object(d.b)("\u83b7\u53d6\u70b9\u6570\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8bf7\u6c42\u5730\u5740\u548cKey\uff1a"+e.t0.message);case 16:case"end":return e.stop()}}),e,this,[[2,11]])})));return function(){return e.apply(this,arguments)}}()},{key:"save",value:function(){var e=Object(_.a)(c.a.mark((function e(){var t;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0: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(d.b)("\u68c0\u6d4b\u5230\u60a8\u4f7f\u7528\u7684\u662fForward Key\uff0c\u5df2\u81ea\u52a8\u5207\u6362API\u5730\u5740")),t=4096,e.t0=this.props.store._chat_model,e.next="gpt-3.5-turbo"===e.t0?7:"gpt-4"===e.t0?9:"gpt-4-0125-preview"===e.t0||"gpt-4-1106-preview"===e.t0||"gpt-4-vision-preview"===e.t0?11:"gpt-3.5-turbo-16k"===e.t0?13:15;break;case 7:return t=4096,e.abrupt("break",15);case 9:return t=8192,e.abrupt("break",15);case 11:return t=128e3,e.abrupt("break",15);case 13:return t=16384,e.abrupt("break",15);case 15:if(!(this.props.store._chat_max_tokens>t-10)){e.next=18;break}return Object(d.b)("\u5f53\u524d\u6a21\u578b\u6700\u5927tokens\u4e3a"+t+"\uff0c\u60a8\u8bbe\u7f6e\u7684max tokens\u592a\u5927\uff0c\u65e0\u6cd5\u6b63\u5e38\u804a\u5929\uff0c\u8bf7\u91cd\u65b0\u8bbe\u7f6e"),e.abrupt("return",!1);case 18:return this.props.store.save_vars(),this.api2d_instance=null,e.next=22,this.refresh_point();case 22:this.setState({settings_open:!1});case 23:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"avatar_save",value:function(){var e=Object(_.a)(c.a.mark((function e(){return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.props.store.save_vars(),this.setState({avatar_open:!1});case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"abort",value:function(){var e=Object(_.a)(c.a.mark((function e(){var t;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.getApiInstance().abort(),this.api2d_instance=null,t=this.state.typing,this.setState({loading:!1,typing:"",list:this.state.list.concat({text:t+"...",role:"robot"})});case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"export_conversation",value:function(){var e=Object(_.a)(c.a.mark((function e(){var t,a,r,n=this;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.setState({snap:!0}),(t=document.querySelector("#snap_tmp"))||(t=document.createElement("div"),a=document.querySelector(".chat-list"),r=a.offsetWidth||720,t.style.width="".concat(r,"px"),t.style.padding="20px",t.setAttribute("id","snap_tmp"),t.classList.add("snap-chat-list"),document.body.appendChild(t)),window.setTimeout(Object(_.a)(c.a.mark((function e(){var a,r,s,o;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t.innerHTML=document.querySelector(".chat-list").innerHTML,a=t.querySelectorAll(".bp3-button.code-copy"),r=0;r0&&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})}},{key:"load_prompt",value:function(e){var t=this.props.store._preset_saved_list.find((function(t){return t.id==e})),a=this.inputRef.current,r=a.selectionStart,n=a.selectionEnd,s=this.state.text.substring(0,r)+t.user+this.state.text.substring(n);this.setState({text:s}),setTimeout((function(){a.selectionStart=r+t.user.length,a.selectionEnd=r+t.user.length,a.focus()}),0)}},{key:"edit_prompt",value:function(e){var t=this.props.store._preset_saved_list.find((function(t){return 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})}},{key:"remove_prompt",value:function(e){var t=this.props.store._preset_saved_list.findIndex((function(t){return t.id==e}));this.props.store._preset_saved_list.splice(t,1),this.props.store.save_vars("_preset_saved_list")}},{key:"remove_chat_line",value:function(e){var t=this;this.old_list=this.state.list;var a=this.state.list.filter((function(t,a){return a!=e}));this.setState({list:a,show_undo:!0}),window.setTimeout((function(){t.props.store._chat_last=t.state.list,t.props.store.save_vars("_chat_last")}),1e3)}},{key:"audio_play",value:function(){var e=Object(_.a)(c.a.mark((function e(){var t,a,r,n,s,o=this;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.playing){e.next=2;break}return e.abrupt("return",!1);case 2:if(this.audio_to_play.length){e.next=4;break}return e.abrupt("return",!1);case 4:return this.playing=!0,t=this.audio_to_play.shift(),a=t.text,r=this.getApiInstance(),e.next=9,r.textToSpeech({text:a,voiceName:"zh-CN-XiaoxiaoNeural",responseType:"blob-url",speed:1.2});case 9:n=e.sent,s=n,console.log("shift",s,a),this.audio_dom||(this.audio_dom=new Audio),this.audio_dom.src=s,this.audio_dom.play(),this.audio_dom.addEventListener("ended",(function(){URL.revokeObjectURL(s),o.playing=!1,o.audio_play()}),{once:!0});case 16:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"audio",value:function(){var e=Object(_.a)(c.a.mark((function e(t){var a,r,n;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0==this.props.store._chat_key.indexOf("fk")){e.next=3;break}return Object(d.b)("\u53ea\u6709API2D\u7684Key\u53ef\u652f\u6301\u8bed\u97f3"),e.abrupt("return",!1);case 3:return e.t0=String,e.next=6,Object(j.a)().process(t);case 6:e.t1=e.sent,a=(0,e.t0)(e.t1),(r=document.createElement("div")).innerHTML=a,n=r.innerText,r.remove(),console.log("markdown to text",t,n),n.length>1&&(this.audio_to_play.push({text:n}),this.audio_play());case 14:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"toggle_version",value:function(){var e=Object(_.a)(c.a.mark((function e(){var t;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t="gpt-3.5-turbo","gpt-3.5-turbo"==this.props.store._chat_model&&(t="gpt-3.5-turbo-16k"),"gpt-3.5-turbo-16k"==this.props.store._chat_model&&(t="gpt-4"),"gpt-4"==this.props.store._chat_model&&(t="gpt-4-0125-preview"),"gpt-4-0125-preview"==this.props.store._chat_model&&(t="gpt-4-vision-preview"),"gpt-4-vision-preview"==this.props.store._chat_model&&(t="gpt-3.5-turbo"),this.props.store._chat_model=t,this.props.store.save_vars("_chat_model");case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"changeApiEndpoint",value:function(){var e=Object(_.a)(c.a.mark((function e(){var t,a;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.props.store.api_endpoints&&this.props.store.api_endpoints.length>0&&(this.props.store.endpoint_count++,t=this.props.store.endpoint_count%this.props.store.api_endpoints.length,a="https://"+(a=this.props.store.api_endpoints[t]),console.log("next_endpoint",a),this.props.store._chat_api_url=a);case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setFiles",value:function(){var e=Object(_.a)(c.a.mark((function e(t){var a,r,n=this;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=t[0],(r=new FileReader).onload=function(e){var t=e.target.result;n.props.store._chat_image_url=t},r.readAsDataURL(a);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"render",value:function(){var t,a,r,n,s,o=this,i=h.a.createElement("div",{className:"right-box"},h.a.createElement("div",{className:"row flex md:flex-row flex-col"},h.a.createElement("div",{className:"left flex-1"}),h.a.createElement("div",{className:"right"},h.a.createElement(O.e,{vertical:window.innerWidth<600},window.innerWidth>=600&&window.electronAPI&&(null===(t=window.electronAPI)||void 0===t?void 0:t.pinWindow)&&h.a.createElement(O.b,{active:"yes"==this.props.store._chat_pin_window,icon:"pin",onClick:function(){var e;o.props.store._chat_pin_window="yes"==o.props.store._chat_pin_window?"no":"yes";var t="yes"==o.props.store._chat_pin_window;null===(e=window.electronAPI)||void 0===e||e.pinWindow(t),o.props.store.save_vars("_chat_pin_window"),t&&Object(d.b)("\u5df2\u5c06\u7a97\u53e3\u7f6e\u4e8e\u6700\u4e0a\u65b9")},large:!0}),this.props.store._chat_key&&this.props.store._chat_key.startsWith("fk")&&h.a.createElement(O.h,{className:"md:w-40 w-full",large:!0,rightElement:h.a.createElement(O.b,{icon:"refresh",minimal:!0,onClick:function(){return o.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}),h.a.createElement(O.b,{icon:"key",onClick:function(){return o.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")?h.a.createElement(O.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"):h.a.createElement(O.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:function(){return Object(d.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"))))),h.a.createElement("div",{className:"chat-list"},this.state.show_undo?h.a.createElement("div",{className:"text-center gray-btn gray-text"},h.a.createElement(O.c,null,h.a.createElement(O.b,{icon:"undo",minimal:!0,onClick:function(){return o.undo_conversation()}},"\u64a4\u9500"))):null,this.state.list&&this.state.list.map((function(e,t){var a,r;return h.a.createElement("div",{className:"chat-item ".concat(e.role),key:t},h.a.createElement("div",{className:"chat-text content"},h.a.createElement(N.a,{markdown:null===(a=e.text)||void 0===a?void 0:a.trim()}),h.a.createElement("div",{className:"flex flex-row float-icons"},h.a.createElement("span",{className:"remove"},h.a.createElement(O.b,{icon:"trash",small:!0,minimal:!0,title:"\u5220\u9664",onClick:function(){return o.remove_chat_line(t)}})),h.a.createElement("span",{className:"copy"},h.a.createElement(S.CopyToClipboard,{text:null===(r=e.text)||void 0===r?void 0:r.trim(),onCopy:function(){return Object(d.b)("Markdown\u5df2\u590d\u5236\u5230\u526a\u8d34\u677f")}},h.a.createElement(O.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:h.a.createElement("span",{className:"audio"},h.a.createElement(O.b,{icon:"volume-up",onClick:function(){return o.audio(e.text)},small:!0,minimal:!0,title:"\u8bed\u97f3"}))),e.image_url&&h.a.createElement(O.m,{position:"bottom",interactionKind:"click",minimal:!0,content:h.a.createElement("img",{src:e.image_url})},h.a.createElement(O.b,{icon:"media",minimal:!0}))))})),this.state.typing&&h.a.createElement("div",{className:"chat-item robot"},h.a.createElement("div",{className:"chat-text content"},h.a.createElement(O.o,{size:12,className:"mr-2"}),h.a.createElement(N.a,{markdown:null===(a=this.state.typing)||void 0===a?void 0:a.trim()}),h.a.createElement(O.b,{icon:"cross",minimal:!0,onClick:function(){return o.abort()}}))),this.state.list&&this.state.list.length>0&&h.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?h.a.createElement(O.c,null,h.a.createElement(O.b,{icon:"refresh",small:!0,minimal:!0,onClick:function(){return o.regen_conversation()}},"\u91cd\u65b0\u751f\u6210"),h.a.createElement(O.b,{icon:"eraser",small:!0,minimal:!0,onClick:function(){return o.clean_conversation(!1)}},"\u6e05\u7a7a\u8bb0\u5f55"),h.a.createElement(O.b,{icon:"download",small:!0,minimal:!0,onClick:function(){return o.export_conversation()}},"\u5bfc\u51fa\u622a\u56fe")):h.a.createElement("div",{className:"text-center mt-2"},h.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 Chat\u9171 c3.level06.com -")))),h.a.createElement("div",{className:"chat-box"},h.a.createElement("form",{action:"post",id:"chat-form",className:"flex flex-col",onSubmit:function(e){var t;e.preventDefault(),o.send(null===(t=o.state.text)||void 0===t?void 0:t.trim())}},h.a.createElement(O.r,{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:function(e){return o.onChange(e,"text")},value:this.state.text}),h.a.createElement("div",{className:"flex md:flex-row md:justify-between flex-col items-center mb-2"},h.a.createElement("div",{className:"left flex flex-row items-center"},h.a.createElement(f.a,{onUpdate:function(e){return o.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?[{label:"3.5",value:"gpt-3.5-turbo"},{label:"3.5-16K",value:"gpt-3.5-turbo-16k"},{label:"4",value:"gpt-4"},{label:"4+",value:"gpt-4-0125-preview"},{label:"4+v",value:"gpt-4-vision-preview"}]:[{label:"GPT3.5",value:"gpt-3.5-turbo"},{label:"GPT3.5-16K",value:"gpt-3.5-turbo-16k"},{label:"GPT4",value:"gpt-4"},{label:"GPT4+",value:"gpt-4-0125-preview"},{label:"GPT4+v",value:"gpt-4-vision-preview"}]}),h.a.createElement("div",{className:"mt-2 md:hidden block mr-1"},h.a.createElement(O.b,{onClick:function(){return o.toggle_version()},large:!0},"gpt-3.5-turbo"==this.props.store._chat_model&&"3.5","gpt-3.5-turbo-16k"==this.props.store._chat_model&&"3.5+","gpt-4"==this.props.store._chat_model&&"4","gpt-4-0125-preview"==this.props.store._chat_model&&"4+","gpt-4-vision-preview"==this.props.store._chat_model&&"4+v")),h.a.createElement(O.c,{className:"mt-2 md:mt-0"},h.a.createElement(O.b,{large:!0,className:"md:mt-2 md:ml-1",icon:this.state.loading?h.a.createElement(O.o,{size:12}):"send-message",type:"submit",disabled:this.state.loading},this.state.loading?"\u8bf7\u7a0d\u5019":"\u53d1\u9001(cmd/ctrl+enter)"),"gpt-4-vision-preview"===this.props.store._chat_model&&h.a.createElement(w.a,{handleFiles:function(e){return o.setFiles(e)}},h.a.createElement(O.b,{large:!0,className:"md:mt-2 mx-1 w-12",icon:"media",active:this.props.store._chat_image_url.length>5})),h.a.createElement(O.b,{large:!0,className:"md:mt-2 ",icon:"clean",onClick:function(){return o.clean_conversation()}},"\u65b0\u5bf9\u8bdd"))),h.a.createElement("div",{className:"right hidden md:block flex flex-row items-center justify-center"},"yes"!=this.props.store._chat_auto_save?h.a.createElement(O.b,{large:!0,className:"mt-2 ml-2",icon:"floppy-disk",onClick:function(){return o.save_conversation()}},"\u4fdd\u5b58\u5bf9\u8bdd"):h.a.createElement(I.a,{onUpdate:function(){return o.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((function(e){if(e.trim().length>0)return{label:e,value:e}})):[]).unshift({label:"\u8bf7\u9009\u62e9",value:""});var c=h.a.createElement("div",{className:"prompt-tab"},h.a.createElement("div",{className:"prompt-list"},this.props.store._preset_saved_list&&(null===(r=this.props.store._preset_saved_list)||void 0===r?void 0:r.slice().reverse().map((function(e,t){return h.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:function(){return o.load_prompt(e.id)}},h.a.createElement("div",{className:"left flex flex-row items-center"},e.title.substring(0,30)),h.a.createElement("div",{className:"right action-icon ml-2 gray-btn"},h.a.createElement(O.b,{small:!0,minimal:!0,icon:"edit",title:"\u7f16\u8f91",onClick:function(t){o.edit_prompt(e.id),t.preventDefault(),t.stopPropagation()}}),h.a.createElement(O.b,{small:!0,minimal:!0,icon:"cross",title:"\u5220\u9664",onClick:function(t){o.remove_prompt(e.id),t.preventDefault(),t.stopPropagation()}})))}))),h.a.createElement("div",{className:"bottom-effect"}))),_=h.a.createElement("div",{className:"history-tab"},h.a.createElement("div",{className:"history-list"},this.props.store._chat_saved_list&&(null===(n=this.props.store._chat_saved_list)||void 0===n?void 0:n.slice().reverse().map((function(e,t){return h.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"},h.a.createElement("div",{className:"left flex flex-row items-center"},e.name.substring(0,30)),h.a.createElement("div",{className:"right action-icon ml-2 gray-btn"},h.a.createElement(O.b,{small:!0,minimal:!0,icon:"history",title:"\u8f7d\u5165",onClick:function(){return o.load_list(JSON.stringify(e.list))}}),h.a.createElement(O.b,{small:!0,minimal:!0,icon:"cross",title:"\u5220\u9664",onClick:function(){return o.remove_list(e.id)}})))}))),h.a.createElement("div",{className:"bottom-effect"}))),p=h.a.createElement("div",{className:"left-box flex-1"},h.a.createElement("div",null,h.a.createElement("div",{className:"text-lg mb-2 text-gray-300 mt-6 mr-2 flex flex-row w-48"},h.a.createElement(O.q,{id:"left-tab",onChange:function(e){o.setState({tab_selected:e})},selectedTabId:this.state.tab_selected,className:"w-full"},h.a.createElement(O.p,{id:"prompt",title:"\u63d0\u793a\u8bcd",panel:c}),h.a.createElement(O.p,{id:"history",title:"\u5bf9\u8bdd\u8bb0\u5f55",panel:_}),h.a.createElement(O.q.Expander,null),h.a.createElement(O.c,null,"prompt"==this.state.tab_selected&&h.a.createElement(O.b,{onClick:function(){return o.prompt_add()},icon:"plus",className:"gray-btn",minimal:!0,title:"\u6dfb\u52a0\u9884\u7f6e\u63d0\u793a\u8bcd"}),h.a.createElement(O.b,{onClick:function(){return o.fileInput.click()},icon:"circle-arrow-up",className:"gray-btn",minimal:!0,title:"\u5bfc\u5165"}),h.a.createElement("input",{type:"file",accept:".json",ref:function(e){o.fileInput=e},style:{display:"none"},onChange:this.handleFile}),h.a.createElement(O.b,{icon:"circle-arrow-down",className:"gray-btn",minimal:!0,onClick:function(){return o.export(o.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:h.a.createElement("div",{className:null!==(s="char-box opacity-"+this.props.store._chat_char_opacity)&&void 0!==s?s:80},h.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:function(){o.props.store._chat_avatar_url&&(o.props.store._chat_avatar_url=null)},className:"char",onClick:function(){return o.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(B.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}),h.a.createElement(v.a,{className:"slider",field:"_chat_char_opacity",min:10,stepSize:10,labelStepSize:10,onUpdate:function(){return o.props.store.save_vars()}}))),l=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")),u=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?h.a.createElement(O.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"):h.a.createElement(O.a,{large:!0,icon:"key",href:"https://api2d.com/r/186008",target:"_blank"},"\u7533\u8bf7Forward Key \xb7 \u53ef\u5fae\u4fe1\u5145\u503c"),A="c.level06.com"==window.location.hostname||"dd.ftqq.com"==window.location.hostname?h.a.createElement(O.a,{large:!0,icon:"cog",className:"ml-2",href:"https://a.ftqq.com/2023/04/24/chatyou-custom-platform",target:"_blank"},"\u5b9a\u5236Chat\u9171"):null,T=h.a.createElement("div",{className:"flex flex-row chat-page"},p,i,h.a.createElement(O.f,{isOpen:this.state.settings_open,title:"\u8bbe\u7f6e",icon:"info-sign",onClose:function(){return o.setState({settings_open:!1})}},h.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)&&h.a.createElement(h.a.Fragment,null,h.a.createElement(C.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:h.a.createElement(C.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:h.a.createElement(O.b,{icon:"random",onClick:function(){return o.changeApiEndpoint()}},"\u5207\u6362api2d\u5730\u5740")}),h.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:h.a.createElement(O.b,{icon:this.state.show_extend_settings?"chevron-up":"chevron-down",className:"mr-2",large:!0,onClick:function(){return o.setState({show_extend_settings:!o.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:h.a.createElement(h.a.Fragment,null,!window.electronAPI&&h.a.createElement(S.CopyToClipboard,{text:l,onCopy:function(){return Object(d.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")}},h.a.createElement(O.b,{icon:"share",large:!0},"\u5206\u4eab\u5e26\u8d26\u53f7\u94fe\u63a5"))),A),this.state.show_extend_settings?h.a.createElement(h.a.Fragment,null,h.a.createElement("div",{className:"flex flex-row"},h.a.createElement(C.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"}),h.a.createElement(C.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"}),h.a.createElement(C.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"}),h.a.createElement(C.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"})),h.a.createElement("div",{className:"flex flex-row"},h.a.createElement(I.a,{field:"_chat_auto_save",label:"\u81ea\u52a8\u4fdd\u5b58\u4f1a\u8bdd",className:"mr-2",options:[{label:"\u662f",value:"yes"},{label:"\u5426",value:"no"}]}),h.a.createElement(I.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:h.a.createElement(I.a,{field:"_chat_auto_audio",label:"\u81ea\u52a8\u6717\u8bfb\u56de\u7b54"}):null),h.a.createElement(C.a,{field:"_chat_system_prompt",label:"\u7cfb\u7edf\u63d0\u793a\u8bcd",placeholder:"system prompt"}),h.a.createElement(C.a,{field:"_chat_user_prompt",label:"\u7528\u6237\u63d0\u793a\u8bcd",placeholder:"user prompt"}),h.a.createElement("div",{className:"flex flex-row"},h.a.createElement(I.a,{field:"_chat_stream",label:"\u6d41\u5f0f\u4f20\u8f93",className:"mr-2",options:[{label:"\u662f",value:"yes"},{label:"\u5426",value:"no"}]}),h.a.createElement(I.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,h.a.createElement(y.a,{onSubmit:function(){return o.save()},cancel:h.a.createElement("div",{className:"flex flex-row"},u)}),h.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+" ":"\u65b9\u7cd6\u6c14\u7403 \ud83c\udf88 \u8363\u8a89\u51fa\u54c1 \xb7 Chat\u9171 v")+"".concat(this.props.store.version)," -"))),h.a.createElement(O.f,{isOpen:this.state.avatar_open,title:"\u8bbe\u7f6e\u804a\u5929\u52a9\u7406\u548c\u80cc\u666f",icon:"info-sign",onClose:function(){return o.setState({avatar_open:!1})}},h.a.createElement("div",{className:"p-5 mt-2"},h.a.createElement(C.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://..."}),h.a.createElement(C.a,{field:"_chat_bg_url",placeholder:"\u80cc\u666f\u56fe\u7247URL\uff0c\u5982https://..."}),h.a.createElement(y.a,{onSubmit:function(){return o.avatar_save()},cancel:h.a.createElement(O.b,{onClick:function(){return o.setState({avatar_open:!1})},large:!0},"\u5173\u95ed")}))),h.a.createElement(O.f,{isOpen:this.state.prompt_box,title:"\u5e38\u7528\u63d0\u793a\u8bcd",icon:"info-sign",onClose:function(){return o.prompt_box_clean(!0)}},h.a.createElement("div",{className:"p-5 mt-2"},h.a.createElement(C.a,{field:"_preset_prompt_title",placeholder:"\u63d0\u793a\u8bcd\u6807\u9898"}),h.a.createElement(C.a,{type:"textarea",field:"_preset_user_prompt",placeholder:"user prompt",fill:!0}),h.a.createElement(y.a,{onSubmit:function(){return o.prompt_save()},cancel:h.a.createElement(O.b,{onClick:function(){return o.prompt_box_clean(!0)},large:!0},"\u5173\u95ed")}))));return h.a.createElement(m.a,{title:this.props.store.appname,main:T})}}]),n}(T.Component))||n)||n)||n)}).call(this,a(57).Buffer)},305:function(e,t,a){"use strict";a.d(t,"a",(function(){return f}));var r,n,s=a(53),o=a(11),i=a(12),c=a(16),_=a(17),p=a(0),l=a.n(p),u=a(8),A=a(41),T=a(1470),h=a(488),E=a(1471),P=a(1469),m=a(487),O=a(174),d=a(15),b=a(24),f=(r=Object(u.b)("store"),Object(A.f)(n=r(n=Object(u.c)(n=function(e){Object(c.a)(a,e);var t=Object(_.a)(a);function a(){return Object(o.a)(this,a),t.apply(this,arguments)}return Object(i.a)(a,[{key:"render",value:function(){return l.a.createElement(T.a,{remarkPlugins:[m.a],className:"markdown-text toastui-editor-contents",children:this.props.markdown,linkTarget:"_blank",components:{code:function(e){e.node;var t=e.inline,a=e.className,r=e.children,n=Object(s.a)(e,["node","inline","className","children"]);if(a&&a.indexOf("hljs")>-1)return l.a.createElement("code",Object.assign({},n,{className:a}),r);var o=/language-(\w+)/.exec(a||"");return t?l.a.createElement("code",Object.assign({className:a},n),r):l.a.createElement("div",{className:"code-box my-2"},l.a.createElement(E.a,Object.assign({children:String(r).replace(/\n$/,""),style:P.a,language:o&&o[1]?o[1]:"bash",PreTag:"div"},n)),l.a.createElement(O.CopyToClipboard,{className:"code-copy",text:String(r),onCopy:function(){return Object(b.b)("\u4ee3\u7801\u5df2\u590d\u5236")}},l.a.createElement(d.b,{icon:"code"},"\u590d\u5236\u4ee3\u7801")))},img:function(e){var t=e.src,a=e.alt;return l.a.createElement(h.a,{showDownload:!0,showRotation:!0,showZoom:!0,small:t,large:t,alt:a})}}})}}]),a}(p.Component))||n)||n)||n)},471:function(e,t,a){"use strict";a.d(t,"a",(function(){return T}));var r,n,s=a(11),o=a(12),i=a(16),c=a(17),_=a(0),p=a.n(_),l=a(8),u=a(41),A=a(485),T=(r=Object(l.b)("store"),Object(u.f)(n=r(n=Object(l.c)(n=function(e){Object(i.a)(a,e);var t=Object(c.a)(a);function a(){return Object(s.a)(this,a),t.apply(this,arguments)}return Object(o.a)(a,[{key:"render",value:function(){var e=this,t=this.props.store[this.props.field]||"",a=this.props.options.filter((function(e){return t==e.value}));Date.now();return p.a.createElement("div",{className:"lossline "+this.props.className||!1},p.a.createElement("div",{className:"lossline"},this.props.label),p.a.createElement(A.a,{menuPlacement:this.props.menuPosition||"auto",placeholder:this.props.placeholder||"\u8bf7\u9009\u62e9",value:a,isMulti:!1,onChange:function(t){e.props.store[e.props.field]=t?t.value:"",e.props.onUpdate&&e.props.onUpdate(t.value)},options:this.props.options||[]}))}}]),a}(_.Component))||n)||n)||n)},480:function(e,t,a){"use strict";a.d(t,"a",(function(){return T}));var r,n,s=a(11),o=a(12),i=a(16),c=a(17),_=a(0),p=a.n(_),l=a(8),u=a(41),A=a(15),T=(r=Object(l.b)("store"),Object(u.f)(n=r(n=Object(l.c)(n=function(e){Object(i.a)(a,e);var t=Object(c.a)(a);function a(){return Object(s.a)(this,a),t.apply(this,arguments)}return Object(o.a)(a,[{key:"render",value:function(){var e,t,a,r,n,s=this,o=null!==(e=this.props.store[this.props.field])&&void 0!==e?e:0;return p.a.createElement(A.n,{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!==(r=this.props.min)&&void 0!==r?r:0,max:null!==(n=this.props.max)&&void 0!==n?n:100,value:o,onChange:function(e){s.props.store[s.props.field]=e,s.props.onUpdate&&s.props.onUpdate(e)}})}}]),a}(_.Component))||n)||n)||n)},484:function(e,t,a){"use strict";(function(e){a.d(t,"a",(function(){return h}));var r,n,s=a(11),o=a(12),i=a(16),c=a(17),_=a(0),p=a.n(_),l=a(8),u=a(41),A=a(52),T=a(15),h=(r=Object(l.b)("store"),Object(u.f)(n=r(n=Object(l.c)(n=function(t){Object(i.a)(r,t);var a=Object(c.a)(r);function r(){return Object(s.a)(this,r),a.apply(this,arguments)}return Object(o.a)(r,[{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 r=JSON.parse(a);for(var n in r)this.props.store.hasOwnProperty(n)&&(this.props.store[n]=r[n]);this.props.store.save_vars(),this.props.history.push("/")}},{key:"render",value:function(){var e=p.a.createElement("div",{className:"flex justify-center items-center h-screen"},p.a.createElement("div",{className:"text-center"},p.a.createElement(T.o,null)));return p.a.createElement(A.a,{title:this.props.store.appname,main:e})}}]),r}(_.Component))||n)||n)||n)}).call(this,a(57).Buffer)},52:function(e,t,a){"use strict";var r,n,s,o,i,c,_,p,l,u,A,T,h=a(11),E=a(12),P=a(16),m=a(17),O=a(0),d=a.n(O),b=a(8),f=a(41),C=a(466),y=a.n(C),N=a(30),v=(r=Object(b.b)("store"),Object(f.f)(n=r(n=Object(b.c)(n=function(e){Object(P.a)(a,e);var t=Object(m.a)(a);function a(){return Object(h.a)(this,a),t.apply(this,arguments)}return Object(E.a)(a,[{key:"render",value:function(){var e=this.props.data;return e?d.a.createElement("div",{className:"user-span"},d.a.createElement("img",{src:e.avatar_url,className:"avatar"}),e.name,e.coin>=0&&d.a.createElement("span",{className:"coin bg-blue-500 text-white font-mono text-xs"},e.coin)):null}}]),a}(O.Component))||n)||n),a(53)),I=a(15),S=a(54),g=a(1509),R=a(170),k=(s=Object(b.b)("store"),Object(f.f)(o=s(o=Object(b.c)(o=function(e){Object(P.a)(a,e);var t=Object(m.a)(a);function a(){return Object(h.a)(this,a),t.apply(this,arguments)}return Object(E.a)(a,[{key:"render",value:function(){var e=this,t=d.a.createElement(I.i,{className:"border"},d.a.createElement(I.k,{icon:"person",text:"\u6211\u7684",onClick:function(){return e.props.history.push("/profile")}}),d.a.createElement(I.k,{icon:"dollar",text:"\u5145\u503c",onClick:function(){return e.props.history.push("/recharge")}}),d.a.createElement(I.j,null),d.a.createElement(I.k,{icon:"log-out",text:"\u9000\u51fa",onClick:function(){return e.props.history.push("/logout")}})),a=this.props,r=(a.staticContext,Object(v.a)(a,["staticContext"]));return d.a.createElement("div",r,this.props.store.user?d.a.createElement(g.a,{autoFocus:!1,content:t,position:S.a.BOTTOM_RIGHT},d.a.createElement(I.b,{rightIcon:"caret-down",minimal:!0})):d.a.createElement(R.a,{minimal:!0}))}}]),a}(O.Component))||o)||o),i=Object(b.b)("store"),Object(f.f)(c=i(c=Object(b.c)(c=function(e){Object(P.a)(a,e);var t=Object(m.a)(a);function a(){return Object(h.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(v.a)(t,["staticContext"]));return d.a.createElement("div",a,d.a.createElement("div",{className:"flex flex-row items-center"},this.props.store.menu&&d.a.createElement(d.a.Fragment,null," ",d.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"},d.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,r=!0;(t.member_only&&(e.props.store.token||(r=!1)),t.admin_only)&&((null===(a=e.props.store.user)||void 0===a?void 0:a.level)<9&&(r=!1));return r?d.a.createElement(N.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}(O.Component))||c)||c)||c);_=Object(b.b)("store"),Object(f.f)(p=_(p=Object(b.c)(p=function(e){Object(P.a)(a,e);var t=Object(m.a)(a);function a(){return Object(h.a)(this,a),t.apply(this,arguments)}return Object(E.a)(a,[{key:"render",value:function(){this.props.store.user;return d.a.createElement("div",{className:(this.props.className||"")+" header"},d.a.createElement("div",{className:"container mx-auto"},d.a.createElement("div",{className:"left flex flex-row items-center"},d.a.createElement(N.b,{to:"/"},this.props.store.appname),d.a.createElement(k,{className:"ml-5 hidden md:block"})),d.a.createElement("div",{className:"right"})))}}]),a}(O.Component))||p)||p),l=Object(b.b)("store"),Object(f.f)(u=l(u=Object(b.c)(u=function(e){Object(P.a)(a,e);var t=Object(m.a)(a);function a(){return Object(h.a)(this,a),t.apply(this,arguments)}return Object(E.a)(a,[{key:"render",value:function(){return d.a.createElement("div",{className:(this.props.className||"")+" footer"},"\u65b9\u7cd6\u6c14\u7403 \ud83c\udf88 ftqq.com")}}]),a}(O.Component))||u)||u);a.d(t,"a",(function(){return j}));var j=(A=Object(b.b)("store"),Object(f.f)(T=A(T=Object(b.c)(T=function(e){Object(P.a)(a,e);var t=Object(m.a)(a);function a(){return Object(h.a)(this,a),t.apply(this,arguments)}return Object(E.a)(a,[{key:"render",value:function(){return d.a.createElement(y.a,{title:this.props.title||this.props.store.appname},d.a.createElement(d.a.Fragment,null,this.props.store._chat_bg_url?d.a.createElement("div",{className:"chat-bg"}," ",d.a.createElement("img",{src:this.props.store._chat_bg_url,onError:function(e){return e.target.style.display="none"},referrerPolicy:"no-referrer"})):null,d.a.createElement("div",{className:""},d.a.createElement("div",{className:"body container mx-auto"},this.props.main)),d.a.createElement("div",{className:"drag-handle w-full h-5 fixed top-0 "})))}}]),a}(O.Component))||T)||T)||T)},60:function(e,t,a){"use strict";a.d(t,"a",(function(){return T}));var r,n,s=a(11),o=a(12),i=a(16),c=a(17),_=a(0),p=a.n(_),l=a(8),u=a(41),A=a(15),T=(r=Object(l.b)("store"),Object(u.f)(n=r(n=Object(l.c)(n=function(e){Object(i.a)(a,e);var t=Object(c.a)(a);function a(){return Object(s.a)(this,a),t.apply(this,arguments)}return Object(o.a)(a,[{key:"render",value:function(){var e=this,t=this.props.store[this.props.field]||"";return p.a.createElement(A.g,{label:this.props.label,className:this.props.lineClass||""},"textarea"==this.props.type?p.a.createElement(A.r,{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||""}):p.a.createElement(A.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&&p.a.createElement("div",{className:"text-count"},t.length,"/",this.props.max_count))}}]),a}(_.Component))||n)||n)||n)},602:function(e,t,a){e.exports=a(1468)},607:function(e,t,a){}},[[602,1,2]]]);