@acedatacloud/nexior 2.20.1 → 2.20.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/assets/{Auth.18d3dbd5.js → Auth.6cca0fab.js} +1 -1
  2. package/dist/assets/{Callback.b89dfb68.js → Callback.14695fed.js} +1 -1
  3. package/dist/assets/{Chatdoc.63a6a5c8.js → Chatdoc.ad673737.js} +1 -1
  4. package/dist/assets/{Console.7aaee105.js → Console.8af9e37e.js} +1 -1
  5. package/dist/assets/{Conversation.8c058528.js → Conversation.788f9175.js} +1 -1
  6. package/dist/assets/Conversation.deb2cf30.js +1 -0
  7. package/dist/assets/{Conversation.4a7dd645.css → Conversation.e721b0e3.css} +1 -1
  8. package/dist/assets/{CopyToClipboard.6e4cac07.js → CopyToClipboard.52cd5f15.js} +1 -1
  9. package/dist/assets/{Detail.31de63ae.js → Detail.da5709c8.js} +1 -1
  10. package/dist/assets/{EditArray.08567600.js → EditArray.0b1a73f5.js} +1 -1
  11. package/dist/assets/{Extra.00254e05.js → Extra.11fc923a.js} +1 -1
  12. package/dist/assets/{History.cc982078.js → History.5d5f9ba8.js} +1 -1
  13. package/dist/assets/{ImageNavigator.7fe0f2bc.js → ImageNavigator.21f9d870.js} +1 -1
  14. package/dist/assets/{Index.bb3c0047.js → Index.0703c443.js} +1 -1
  15. package/dist/assets/{Index.68e84490.js → Index.0db094dc.js} +1 -1
  16. package/dist/assets/{Index.da3788da.js → Index.2076f6c2.js} +1 -1
  17. package/dist/assets/{Index.cbb50d9d.js → Index.2c9ed623.js} +1 -1
  18. package/dist/assets/{Index.b56d15c8.js → Index.2f005d12.js} +1 -1
  19. package/dist/assets/{Index.2c1dcf22.js → Index.3caa8f61.js} +1 -1
  20. package/dist/assets/{Index.352d4874.js → Index.3e584b7e.js} +1 -1
  21. package/dist/assets/{Index.e9a66783.js → Index.7964ac96.js} +1 -1
  22. package/dist/assets/{Index.7c686768.js → Index.918b8fcd.js} +1 -1
  23. package/dist/assets/{Index.493dc291.js → Index.a1992c96.js} +1 -1
  24. package/dist/assets/{Index.1095b265.js → Index.c6cb1e50.js} +1 -1
  25. package/dist/assets/{Index.cd660277.js → Index.c9762e65.js} +1 -1
  26. package/dist/assets/{Index.5a74ff3b.js → Index.cc623c8c.js} +1 -1
  27. package/dist/assets/{Index.0c212684.js → Index.d075cd68.js} +1 -1
  28. package/dist/assets/{Index.9e8b4725.js → Index.ef23f2c2.js} +1 -1
  29. package/dist/assets/{InfoIcon.0718f348.js → InfoIcon.225370af.js} +1 -1
  30. package/dist/assets/{Invitees.6b5b327c.js → Invitees.94613c97.js} +1 -1
  31. package/dist/assets/{List.09132375.js → List.1668d8a8.js} +1 -1
  32. package/dist/assets/{List.341e4858.js → List.c9b56df2.js} +1 -1
  33. package/dist/assets/{List.73ea2bd7.js → List.f3e655ed.js} +1 -1
  34. package/dist/assets/{Login.7793d6d2.js → Login.f8af00b7.js} +1 -1
  35. package/dist/assets/{Main.695c88ad.js → Main.9d06d035.js} +1 -1
  36. package/dist/assets/{Manage.eead0b8e.js → Manage.ca0b9d17.js} +1 -1
  37. package/dist/assets/{MarkdownRenderer.4ef5808c.js → MarkdownRenderer.5ea5feeb.js} +1 -1
  38. package/dist/assets/{Navigator.4b986b5a.js → Navigator.5cc4e1f4.js} +1 -1
  39. package/dist/assets/{Pagination.ba076c41.js → Pagination.76f292a1.js} +1 -1
  40. package/dist/assets/{Setting.566798d1.js → Setting.c27e8802.js} +1 -1
  41. package/dist/assets/{Status.dd04dd16.js → Status.9b29934c.js} +1 -1
  42. package/dist/assets/{Subscribe.da97f0fe.js → Subscribe.33bb3a1e.js} +1 -1
  43. package/dist/assets/{VideoNavigator.6d07cfaa.js → VideoNavigator.834a1651.js} +1 -1
  44. package/dist/assets/{distribution.6dfc77cd.js → distribution.51fc0fc3.js} +1 -1
  45. package/dist/assets/{index.a3bc0f28.js → index.65a34a3c.js} +1 -1
  46. package/dist/assets/index.8f0a4606.css +1 -0
  47. package/dist/assets/{order.cbc3bdd0.js → order.8abe108a.js} +1 -1
  48. package/dist/assets/{price.662dc55d.js → price.5e7bcedb.js} +1 -1
  49. package/dist/index.html +2 -2
  50. package/package.json +1 -1
  51. package/dist/assets/Conversation.ed4ff65e.js +0 -1
  52. package/dist/assets/index.ca27ae74.css +0 -1
@@ -1 +1 @@
1
- var i=Object.defineProperty;var n=(r,t,e)=>t in r?i(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var s=(r,t,e)=>(n(r,typeof t!="symbol"?t+"":t,e),e);import{B as a}from"./index.a3bc0f28.js";class y{constructor(){s(this,"key","orders")}async getAll(t){return await a.get(`/${this.key}/`,{params:t})}async get(t){return await a.get(`/${this.key}/${t}`)}async create(t){return await a.post(`/${this.key}/`,t)}async update(t,e){return await a.put(`/${this.key}/${t}`,e)}async refresh(t){return await a.post(`/${this.key}/${t}/refresh/`)}async pay(t,e){return await a.post(`/${this.key}/${t}/pay/`,e)}async updatePrice(t,e){return await a.post(`/${this.key}/${t}/update-price/`,e)}async finish(t){return await a.post(`/${this.key}/${t}/finish/`)}async delete(t){return await a.delete(`/${this.key}/${t}`)}}const c=new y;export{c as o};
1
+ var i=Object.defineProperty;var n=(r,t,e)=>t in r?i(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var s=(r,t,e)=>(n(r,typeof t!="symbol"?t+"":t,e),e);import{B as a}from"./index.65a34a3c.js";class y{constructor(){s(this,"key","orders")}async getAll(t){return await a.get(`/${this.key}/`,{params:t})}async get(t){return await a.get(`/${this.key}/${t}`)}async create(t){return await a.post(`/${this.key}/`,t)}async update(t,e){return await a.put(`/${this.key}/${t}`,e)}async refresh(t){return await a.post(`/${this.key}/${t}/refresh/`)}async pay(t,e){return await a.post(`/${this.key}/${t}/pay/`,e)}async updatePrice(t,e){return await a.post(`/${this.key}/${t}/update-price/`,e)}async finish(t){return await a.post(`/${this.key}/${t}/finish/`)}async delete(t){return await a.delete(`/${this.key}/${t}`)}}const c=new y;export{c as o};
@@ -1 +1 @@
1
- import{C as a,D as i}from"./index.a3bc0f28.js";const l=o=>{const e=a.state.exchange;let{value:t,currency:r=a.state.currency||"usd"}=o;const c=i[r];if(!e)return{value:t,currency:r,label:c};const n=`usd-${r}`,s=e[n];return s&&(t=t*s),console.log("new price",{value:t,currency:r}),{value:t,currency:r,label:c}},g=o=>{var n;let{value:e,defaultValue:t,fractionDigits:r=2}=o;if(e===void 0&&(e=t),e===void 0)return"";const c=l({value:e});return`${c.label}${(n=c.value)==null?void 0:n.toFixed(r)}`};export{g};
1
+ import{C as a,D as i}from"./index.65a34a3c.js";const l=o=>{const e=a.state.exchange;let{value:t,currency:r=a.state.currency||"usd"}=o;const c=i[r];if(!e)return{value:t,currency:r,label:c};const n=`usd-${r}`,s=e[n];return s&&(t=t*s),console.log("new price",{value:t,currency:r}),{value:t,currency:r,label:c}},g=o=>{var n;let{value:e,defaultValue:t,fractionDigits:r=2}=o;if(e===void 0&&(e=t),e===void 0)return"";const c=l({value:e});return`${c.label}${(n=c.value)==null?void 0:n.toFixed(r)}`};export{g};
package/dist/index.html CHANGED
@@ -16,7 +16,7 @@
16
16
  s.parentNode.insertBefore(hm, s);
17
17
  })();
18
18
  </script>
19
- <script type="module" crossorigin src="/assets/index.a3bc0f28.js"></script>
19
+ <script type="module" crossorigin src="/assets/index.65a34a3c.js"></script>
20
20
  <link rel="modulepreload" href="/assets/vendor-@vue.66ea933c.js">
21
21
  <link rel="modulepreload" href="/assets/vendor-element-plus.6158e0fe.js">
22
22
  <link rel="modulepreload" href="/assets/vendor-others.2105a885.js">
@@ -24,7 +24,7 @@
24
24
  <link rel="modulepreload" href="/assets/vendor-qrcode.46bc4fb1.js">
25
25
  <link rel="modulepreload" href="/assets/vendor-fortawesome.fe21f86d.js">
26
26
  <link rel="stylesheet" href="/assets/vendor-others.fbff9a31.css">
27
- <link rel="stylesheet" href="/assets/index.ca27ae74.css">
27
+ <link rel="stylesheet" href="/assets/index.8f0a4606.css">
28
28
  </head>
29
29
  <body>
30
30
  <div id="app">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acedatacloud/nexior",
3
- "version": "2.20.1",
3
+ "version": "2.20.2",
4
4
  "author": "Ace Data Cloud <office@acedata.cloud>",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1 +0,0 @@
1
- import{a as Ne}from"./vendor-axios.168e6950.js";import{ad as Te,a9 as _e,a3 as Re}from"./vendor-others.2105a885.js";import{_ as I,K as se,L as U,M as ge,N as fe,O as z,P as De,Q as Ae,T as qe,U as Oe,V as Ge,W as de,X as j,H as Le,Y as Ue,Z as x,$ as ce,a0 as ue,g as $e,S as Me,s as Fe,a1 as Q,b as Ve,A as Pe,a2 as te,a3 as K,a4 as ee,h as He,j as me,a5 as Be,a6 as je,a7 as We}from"./index.a3bc0f28.js";import{H as N,o as a,e as _,al as i,L as y,M as h,V as n,f as r,O as M,W as B,T as g,R as S,av as Ke,U as G,ai as F,as as oe,$ as H,S as T,P,aw as ze,a0 as Qe,X as Xe,I as pe}from"./vendor-@vue.66ea933c.js";import{M as Je}from"./MarkdownRenderer.4ef5808c.js";import{C as Ye}from"./CopyToClipboard.6e4cac07.js";import{ar as L,as as Ze,at as xe,au as et,av as tt,ac as st}from"./vendor-fortawesome.fe21f86d.js";import{t as ne,M as ve,B as ot,l as ye,s as ie,N as be,O as nt,J as he,d as ae,f as re,e as le,P as we,Q as ke,A as Ce,F as X,G as J,R as it,E as at,r as rt,y as lt,S as dt}from"./vendor-element-plus.6158e0fe.js";import{d as ct}from"./avatar.34ead943.js";import{E as Y,a as Se,b as Ee}from"./EditArray.08567600.js";import"./vendor-qrcode.46bc4fb1.js";import"./vendor-markdown.b22db477.js";import"./vendor-highlight.js.6ee9ffbc.js";const ut=N({name:"AnsweringMark",data(){return{}},computed:{conversationId(){var e,t;return(t=(e=this.$route.params)==null?void 0:e.id)==null?void 0:t.toString()}}}),mt={class:"mark"};function pt(e,t,o,u,v,c){return a(),_("div",mt)}var ht=I(ut,[["render",pt],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/AnsweringMark.vue"]]);const _t=N({name:"CopyToClipboard",components:{FontAwesomeIcon:L,ElTooltip:ne},props:{messages:{type:Array,required:!1,default:()=>[]}},emits:["restart"],data(){return{copied:!1}},methods:{onRestart(){this.$emit("restart")}}});function gt(e,t,o,u,v,c){const l=i("font-awesome-icon"),p=i("el-tooltip");return a(),y(p,{effect:"dark",content:e.$t("common.button.restart"),placement:"bottom"},{default:h(()=>[n(l,{icon:"fa-solid fa-sync",class:"icon-sync",onClick:e.onRestart},null,8,["onClick"])]),_:1},8,["content"])}var ft=I(_t,[["render",gt],["__scopeId","data-v-18116778"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/RestartToGenerate.vue"]]);const $t=N({name:"EditMessage",components:{FontAwesomeIcon:L,ElTooltip:ne},props:{messages:{type:Array,required:!1,default:()=>[]}},emits:["click"],data(){return{copied:!1}},methods:{onEdit(){this.$emit("click")}}});function vt(e,t,o,u,v,c){const l=i("font-awesome-icon"),p=i("el-tooltip");return a(),_("span",null,[n(p,{effect:"dark",content:e.$t("common.button.restart"),placement:"bottom"},{default:h(()=>[n(l,{icon:"fa-solid fa-edit",class:"icon icon-edit",onClick:e.onEdit},null,8,["onClick"])]),_:1},8,["content"])])}var yt=I($t,[["render",vt],["__scopeId","data-v-5c26bf56"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/EditMessage.vue"]]);const bt=N({name:"FilePreview",components:{FontAwesomeIcon:L,ElProgress:ve},props:{name:{type:String,required:!0},percentage:{type:Number,required:!0},closable:{type:Boolean,required:!1,default:!0}},emits:["remove"],methods:{isImageUrl:se}}),wt={class:"file"},kt={class:"left"},Ct={class:"wrapper"},St={class:"right"},Et={class:"text-xs font-bold truncate"},It={key:0,class:"close"};function Nt(e,t,o,u,v,c){const l=i("font-awesome-icon"),p=i("el-progress");return a(),_("div",wt,[r("div",kt,[r("div",Ct,[n(l,{icon:"fa-regular fa-file-alt"}),M(n(p,{type:"circle","stroke-width":3,percentage:e.percentage,width:25},null,8,["percentage"]),[[B,e.percentage&&e.percentage<100]])])]),r("div",St,[r("span",Et,g(e.name),1)]),e.closable?(a(),_("div",It,[n(l,{icon:"fa-solid fa-xmark",class:"icon icon-close",onClick:t[0]||(t[0]=f=>e.$emit("remove"))})])):S("v-if",!0)])}var Ie=I(bt,[["render",Nt],["__scopeId","data-v-5e8b97e5"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/FilePreview.vue"]]);const Tt=N({name:"Message",components:{EditMessage:yt,CopyToClipboard:Ye,RestartToGenerate:ft,AnsweringMark:ht,MarkdownRenderer:Je,ElAlert:ot,FilePreview:Ie,ElButton:ye,ElImage:ie,ElInput:be},props:{messages:{type:Array,required:!1,default:()=>[]},message:{type:Object,required:!0},application:{type:Object,required:!0}},emits:["stop","edit","restart"],data(){return{copied:!1,isEditing:!1,questionValue:this.message.content,messageState:U}},computed:{modelGroup(){return this.$store.state.chat.modelGroup},errorText(){var e,t,o;if(console.debug("error",this.message.error),!(!this.message.error||!((e=this.message.error)!=null&&e.code))){if((t=this.message.error)!=null&&t.message)return this.message.error.message;switch((o=this.message.error)==null?void 0:o.code){case de:return this.$t("chat.message.errorUsedUp");case Ge:return this.$t("chat.message.errorApiError");case Oe:return this.$t("chat.message.errorBadRequest");case qe:return this.$t("chat.message.errorTimeout");case Ae:return this.$t("chat.message.errorTooManyRequests");case De:return this.$t("chat.message.errorContentTooLarge");case z:return this.$t("chat.message.errorNotApplied");case fe:return;case ge:default:return this.$t("chat.message.errorUnknown")}}},showBuyMore(){var e;return this.message.role===j&&((e=this.message.error)==null?void 0:e.code)===de}},watch:{},methods:{startEditing(){this.isEditing=!0,this.questionValue=this.message.content,console.debug("start to get answer",this.message)},cancelEdit(){this.isEditing=!1},onRestart(){this.$emit("restart",this.message)},onEdit(){this.isEditing=!1,this.onSubmit()},onSubmit(){this.$emit("edit",this.message,this.questionValue)},onCopy(){Te(this.message.content.toString(),{debug:!0}),this.copied=!0,setTimeout(()=>{this.copied=!1},3e3)},onBuyMore(){var e;this.$router.push({name:Le,params:{id:(e=this.application)==null?void 0:e.id}})}}}),Rt=["role"],Dt={class:"author"},At={key:0,class:"main"},qt={initial:{opacity:0,y:5},enter:{opacity:1,y:0,scale:1},delay:200,duration:300,layout:!0,transition:{enter:{delay:.2,duration:.5},layout:{duration:.3,easing:"ease-in-out"}},class:"content"},Ot={key:0,class:"message-content"},Gt={key:1},Lt=["src"],Ut={key:1,class:"edits"},Mt={class:"flex justify-end"},Ft={class:"operations"};function Vt(e,t,o,u,v,c){var A;const l=i("el-image"),p=i("markdown-renderer"),f=i("file-preview"),$=i("el-input"),m=i("el-button"),s=i("answering-mark"),d=i("edit-message"),b=i("copy-to-clipboard"),w=i("restart-to-generate"),k=i("el-alert"),q=Ke("motion");return a(),_("div",{class:P({message:!0,[e.message.role]:!0}),role:e.message.role},[r("div",Dt,[e.message.role==="assistant"?(a(),y(l,{key:0,src:e.modelGroup.icon,fit:"cover",class:"avatar"},null,8,["src"])):S("v-if",!0)]),e.errorText?(a(),y(k,{key:1,class:"error",title:e.errorText,type:"error",closable:!1},null,8,["title"])):(a(),_("div",At,[M((a(),_("div",qt,[e.isEditing?(a(),_("div",Ut,[n($,{modelValue:e.questionValue,"onUpdate:modelValue":t[0]||(t[0]=E=>e.questionValue=E),type:"textarea",class:"mb-2",onKeydown:oe(H(e.onEdit,["exact","prevent"]),["enter"])},null,8,["modelValue","onKeydown"]),r("div",Mt,[n(m,{round:"",onClick:e.cancelEdit},{default:h(()=>[T(g(e.$t("common.button.cancel")),1)]),_:1},8,["onClick"]),n(m,{type:"primary",class:"btn-confirm",round:"",onClick:e.onEdit},{default:h(()=>[T(g(e.$t("common.button.confirm")),1)]),_:1},8,["onClick"])])])):(a(),_("div",Ot,[Array.isArray(e.message.content)?(a(),_("div",Gt,[(a(!0),_(G,null,F(e.message.content,(E,V)=>{var R,D;return a(),_("div",{key:V},[E.type==="image_url"?(a(),_("img",{key:0,src:typeof(E==null?void 0:E.image_url)=="string"?E.image_url:(R=E.image_url)==null?void 0:R.url,fit:"cover",class:"image"},null,8,Lt)):S("v-if",!0),E.file_url?(a(),y(f,{key:1,name:typeof(E==null?void 0:E.file_url)=="string"?E.file_url:(D=E.file_url)==null?void 0:D.url,percentage:0,closable:!1,class:"mt-2"},null,8,["name"])):S("v-if",!0),E.type==="text"?(a(),y(p,{key:V,content:E.text},null,8,["content"])):S("v-if",!0)])}),128))])):(a(),y(p,{key:0,content:(A=e.message)==null?void 0:A.content},null,8,["content"]))])),e.message.state===e.messageState.PENDING?(a(),y(s,{key:2})):S("v-if",!0)])),[[q]]),r("div",Ft,[e.message.role==="user"&&!e.isEditing&&!Array.isArray(e.message.content)?(a(),y(d,{key:0,class:"btn-edit",onClick:e.startEditing},null,8,["onClick"])):S("v-if",!0),!Array.isArray(e.message.content)&&(e.message.state===e.messageState.FINISHED||e.message.state===e.messageState.FAILED)?(a(),y(b,{key:1,content:e.message.content,class:"btn-copy"},null,8,["content"])):S("v-if",!0),!Array.isArray(e.message.content)&&(e.message.state===e.messageState.FINISHED||e.message.state===e.messageState.FAILED)&&e.message.role==="assistant"&&e.message===e.messages[e.messages.length-1]?(a(),y(w,{key:2,class:"btn-restart",messages:e.messages,onRestart:e.onRestart},null,8,["messages","onRestart"])):S("v-if",!0)])])),e.showBuyMore?(a(),y(m,{key:2,round:"",type:"primary",class:"btn btn-buy",size:"small",onClick:e.onBuyMore},{default:h(()=>[T(g(e.$t("common.button.buyMore")),1)]),_:1},8,["onClick"])):S("v-if",!0)],10,Rt)}var Pt=I(Tt,[["render",Vt],["__scopeId","data-v-f0476f80"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/Message.vue"]]);const Ht=N({name:"ImagePreview",components:{FontAwesomeIcon:L,ElProgress:ve},props:{url:{type:String,required:!0},name:{type:String,required:!0},percentage:{type:Number,required:!0},closable:{type:Boolean,required:!1,default:!0}},emits:["remove"]}),Bt={class:"image"},jt=["src","alt"],Wt={key:0,class:"close"};function Kt(e,t,o,u,v,c){const l=i("el-progress"),p=i("font-awesome-icon");return a(),_("div",Bt,[r("img",{class:"size-10",src:e.url,alt:e.name},null,8,jt),M(n(l,{type:"circle","stroke-width":3,percentage:e.percentage,width:30},null,8,["percentage"]),[[B,e.percentage&&e.percentage<100]]),e.closable?(a(),_("div",Wt,[n(p,{icon:"fa-solid fa-xmark",class:"icon icon-close",onClick:t[0]||(t[0]=H(f=>e.$emit("remove"),["stop"]))})])):S("v-if",!0)])}var zt=I(Ht,[["render",Kt],["__scopeId","data-v-11203584"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/ImagePreview.vue"]]);const Qt=N({name:"Composer",components:{FilePreview:Ie,ImagePreview:zt,ElTooltip:ne,FontAwesomeIcon:L,ElUpload:nt},props:{disabled:{type:Boolean,required:!1,default:!1},references:{type:Array,required:!1,default:()=>[]},question:{type:String,required:!0}},emits:["update:question","update:references","submit","stop"],data(){return{inputHeight:"35px",questionValue:this.question,fileList:[],uploadUrl:Ue()+"/api/v1/files/"}},computed:{model(){return this.$store.state.chat.model},modelGroup(){return this.$store.state.chat.modelGroup},headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>{var t;return(t=e==null?void 0:e.response)==null?void 0:t.file_url})}},watch:{urls(e){console.debug("File URLs:",e),e.length>0&&this.$emit("update:references",e)},questionValue(e){this.$emit("update:question",e)},question(e){e!==this.questionValue&&(this.questionValue=e)},references(e){console.debug("References updated:",e),e.length===0&&(this.fileList=[])}},methods:{isImageUrl:se,adjustTextareaHeight(){this.$nextTick(()=>{const e=this.$refs.textarea;e&&(e.style.height="35px",e.style.height=e.scrollHeight+"px")})},onSubmit(){!this.question||this.$emit("submit")},onStop(){this.$emit("stop")},onProgress(e,t,o){console.debug("File upload progress:",t.name,e.loaded,e.total)},onExceed(){he.warning(this.$t("chat.message.uploadReferencesExceed"))},onError(){he.error(this.$t("chat.message.uploadReferencesError"))}}}),Xt={class:"composer"},Jt={class:"tools"},Yt=["disabled","placeholder"];function Zt(e,t,o,u,v,c){const l=i("image-preview"),p=i("file-preview"),f=i("font-awesome-icon"),$=i("el-tooltip"),m=i("el-upload");return a(),_("div",Xt,[r("div",Jt,[n(m,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=s=>e.fileList=s),class:P({upload:!0,disabled:!e.model.isFileSupported||e.disabled}),disabled:!e.model.isFileSupported||e.disabled,name:"file",limit:10,multiple:!0,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-progress":e.onProgress,headers:e.headers},{file:h(({file:s})=>{var d;return[e.isImageUrl(s.name)?(a(),y(l,{key:0,url:s.url||((d=s.response)==null?void 0:d.file_url),name:s.name,percentage:s.percentage,onRemove:b=>e.fileList.splice(e.fileList.indexOf(s),1)},null,8,["url","name","percentage","onRemove"])):(a(),y(p,{key:1,name:s.name,percentage:s.percentage,onRemove:b=>e.fileList.splice(e.fileList.indexOf(s),1)},null,8,["name","percentage","onRemove"]))]}),default:h(()=>[n($,{class:"box-item",effect:"dark",content:e.$t("chat.message.uploadFile"),placement:"bottom"},{default:h(()=>[r("span",{class:P({btn:!0,"btn-upload":!0,disabled:!e.model.isFileSupported||e.disabled})},[n(f,{icon:"fa-solid fa-plus",class:"icon icon-attachment"})],2)]),_:1},8,["content"])]),_:1},8,["file-list","class","disabled","action","on-exceed","on-error","on-progress","headers"])]),M(r("span",{class:P({btn:!0,"btn-send":!0,disabled:!e.questionValue}),onClick:t[1]||(t[1]=(...s)=>e.onSubmit&&e.onSubmit(...s))},[n(f,{icon:"fa-solid fa-location-arrow",class:"icon icon-send"})],2),[[B,!e.disabled]]),M(r("span",{class:P({btn:!0,"btn-stop":!0,disabled:!e.disabled}),onClick:t[2]||(t[2]=(...s)=>e.onStop&&e.onStop(...s))},[n(f,{icon:"fa-solid fa-stop",class:"icon icon-stop"})],2),[[B,e.disabled]]),M(r("textarea",{ref:"textarea","onUpdate:modelValue":t[3]||(t[3]=s=>e.questionValue=s),disabled:e.disabled,class:"input",placeholder:e.$t("chat.message.newMessagePlaceholder"),style:Qe({height:e.inputHeight}),onKeydown:t[4]||(t[4]=oe(H((...s)=>e.onSubmit&&e.onSubmit(...s),["exact","prevent"]),["enter"])),onInput:t[5]||(t[5]=(...s)=>e.adjustTextareaHeight&&e.adjustTextareaHeight(...s))},null,44,Yt),[[ze,e.questionValue]])])}var xt=I(Qt,[["render",Zt],["__scopeId","data-v-a443d292"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/Composer.vue"]]);const es=N({name:"ModelSelector",components:{ElDropdown:ae,ElDropdownMenu:re,ElDropdownItem:le,FontAwesomeIcon:L},emits:["update:modelValue","select","model-group-changed","model-changed"],data(){return{options:[x,ce,ue]}},computed:{modelGroup(){return console.log("modelGroup",this.$store.state.chat.modelGroup),this.$store.state.chat.modelGroup},model(){return console.log("model",this.$store.state.chat.model),this.$store.state.chat.model}},watch:{modelGroup(e){console.debug("ModelSelector modelGroup changed",e),this.$store.dispatch("chat/setModel",e.models[0])}},mounted(){if(!this.modelGroup)console.debug("ModelSelector mounted, setting default model group"),this.$store.dispatch("chat/setModelGroup",x);else{console.debug("ModelSelector mounted, checking model group");const t=[x,ce,ue].find(o=>o.name===this.modelGroup.name);t&&this.$store.dispatch("chat/setModelGroup",t)}},methods:{onModelGroupChange(e){this.$store.dispatch("chat/setModelGroup",e),this.$emit("model-group-changed",e)},onModelChange(e){this.$store.dispatch("chat/setModel",e),this.$emit("model-changed",e)}}}),ts={class:"selector"},ss={class:"flex justify-center mr-1"},os={class:"icon"},ns=["src"],is={class:"name"},as={class:"angle"},rs={class:"item"},ls={class:"icon"},ds=["src"],cs={class:"info"},us={class:"name"},ms={class:"description"},ps={class:"flex justify-center"},hs={class:"name"},_s={class:"angle"},gs={class:"item"},fs={class:"info"},$s={key:0,class:"name"},vs={key:1,class:"description"};function ys(e,t,o,u,v,c){const l=i("font-awesome-icon"),p=i("el-dropdown-item"),f=i("el-dropdown-menu"),$=i("el-dropdown");return a(),_("div",ts,[n($,{trigger:"click","popper-class":"popper"},{dropdown:h(()=>[n(f,null,{default:h(()=>[(a(!0),_(G,null,F(e.options,(m,s)=>(a(),y(p,{key:s,onClick:d=>e.onModelGroupChange(m)},{default:h(()=>[r("div",rs,[r("div",ls,[r("img",{src:m.icon},null,8,ds)]),r("div",cs,[r("p",us,g(m.getDisplayName()),1),r("p",ms,g(m.getDescription()),1)])])]),_:2},1032,["onClick"]))),128))]),_:1})]),default:h(()=>{var m;return[r("div",ss,[r("span",os,[r("img",{src:e.modelGroup.icon},null,8,ns)]),r("span",is,g((m=e.modelGroup)==null?void 0:m.getDisplayName()),1),r("span",as,[n(l,{icon:"fa-solid fa-angle-down"})])])]}),_:1}),n($,{trigger:"click","popper-class":"popper"},{dropdown:h(()=>[e.modelGroup&&e.modelGroup.models?(a(),y(f,{key:0},{default:h(()=>[(a(!0),_(G,null,F(e.modelGroup.models,(m,s)=>(a(),y(p,{key:s,onClick:d=>e.onModelChange(m)},{default:h(()=>[r("div",gs,[r("div",fs,[m.getDisplayName?(a(),_("p",$s,g(m.getDisplayName()),1)):S("v-if",!0),m.getDescription?(a(),_("p",vs,g(m.getDescription()),1)):S("v-if",!0)])])]),_:2},1032,["onClick"]))),128))]),_:1})):S("v-if",!0)]),default:h(()=>{var m;return[r("div",ps,[r("span",hs,g((m=e.model)==null?void 0:m.getDisplayName()),1),r("span",_s,[n(l,{icon:"fa-solid fa-angle-down"})])])]}),_:1})])}var bs=I(es,[["render",ys],["__scopeId","data-v-358d65be"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/ModelSelector.vue"]]);const ws={},ks={class:"disclaimer"};function Cs(e,t){return a(),_("p",ks,g(e.$t("chat.message.howToUse")),1)}var Ss=I(ws,[["render",Cs],["__scopeId","data-v-42e751f2"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/Disclaimer.vue"]]);const Es=N({name:"UserAvatar",data(){return{defaultAvatar:ct}},computed:{user(){var e;return(e=this.$store.getters)==null?void 0:e.user}}}),Is=["src"];function Ns(e,t,o,u,v,c){var l;return a(),_("img",{src:((l=e.user)==null?void 0:l.avatar)||e.defaultAvatar,class:"avatar"},null,8,Is)}var Ts=I(Es,[["render",Ns],["__scopeId","data-v-1dac1046"],["__file","/home/runner/work/Nexior/Nexior/src/components/user/Avatar.vue"]]);const Rs=N({name:"ThemeSelector",components:{ArrowDown:we,ElDropdown:ae,ElDropdownMenu:re,ElDropdownItem:le,ElIcon:ke},data(){return{theme:"light"}},computed:{currentLabel(){return this.theme==="dark"?this.$t("common.theme.dark"):this.$t("common.theme.light")}},mounted(){this.theme=this.loadFromCookie(),this.applyTheme()},methods:{onSelect(e){this.theme=e,this.applyTheme()},applyTheme(){_e("THEME",this.theme,{path:"/",domain:$e()}),this.theme==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},loadFromCookie(){return Re("THEME")==="dark"?"dark":"light"}}}),Ds={class:"el-dropdown-link"};function As(e,t,o,u,v,c){const l=i("arrow-down"),p=i("el-icon"),f=i("el-dropdown-item"),$=i("el-dropdown-menu"),m=i("el-dropdown");return a(),y(m,{trigger:"click",onCommand:e.onSelect},{dropdown:h(()=>[n($,null,{default:h(()=>[n(f,{command:"light"},{default:h(()=>[T(g(e.$t("common.theme.light")),1)]),_:1}),n(f,{command:"dark"},{default:h(()=>[T(g(e.$t("common.theme.dark")),1)]),_:1})]),_:1})]),default:h(()=>[r("span",Ds,[T(g(e.currentLabel)+" ",1),n(p,{class:"el-icon--right"},{default:h(()=>[n(l)]),_:1})])]),_:1},8,["onCommand"])}var qs=I(Rs,[["render",As],["__scopeId","data-v-0dfaf416"],["__file","/home/runner/work/Nexior/Nexior/src/components/user/Theme.vue"]]);const Os=N({name:"LocaleSelector",components:{ElDropdown:ae,ElDropdownMenu:re,ElDropdownItem:le,ElIcon:ke,ArrowDown:we},data(){return{locales:Me}},computed:{value(){return this.$i18n.locale},currentLabel(){const e=this.locales.find(t=>t.value===this.value);return e?e.label:this.value}},methods:{async onSelectLocale(e){this.$router.push({query:{...this.$route.query,locale:void 0}}),await Fe(e),_e("LOCALE",e,{path:"/",domain:$e()})}}}),Gs={class:"el-dropdown-link"};function Ls(e,t,o,u,v,c){const l=i("arrow-down"),p=i("el-icon"),f=i("el-dropdown-item"),$=i("el-dropdown-menu"),m=i("el-dropdown");return a(),y(m,{trigger:"click",onCommand:e.onSelectLocale},{dropdown:h(()=>[n($,null,{default:h(()=>[(a(!0),_(G,null,F(e.locales,(s,d)=>(a(),y(f,{key:d,command:s.value},{default:h(()=>[T(g(s.label),1)]),_:2},1032,["command"]))),128))]),_:1})]),default:h(()=>[r("span",Gs,[T(g(e.currentLabel)+" ",1),n(p,{class:"el-icon--right"},{default:h(()=>[n(l)]),_:1})])]),_:1},8,["onCommand"])}var Us=I(Os,[["render",Ls],["__scopeId","data-v-572cdc5e"],["__file","/home/runner/work/Nexior/Nexior/src/components/user/Locale.vue"]]);const Ms=N({name:"GeneralSettings",components:{ThemeSwitcher:qs,LocaleSwitcher:Us}}),Fs={class:"flex justify-between items-center mb-4"},Vs={class:"block mb-2 text-sm font-medium"},Ps={class:"flex justify-between items-center mb-4"},Hs={class:"block mb-2 text-sm font-medium"};function Bs(e,t,o,u,v,c){const l=i("theme-switcher"),p=i("locale-switcher");return a(),_(G,null,[r("div",Fs,[r("label",Vs,g(e.$t("common.settings.theme")),1),n(l)]),r("div",Ps,[r("label",Hs,g(e.$t("common.settings.language")),1),n(p)])],64)}var js=I(Ms,[["render",Bs],["__file","/home/runner/work/Nexior/Nexior/src/components/setting/General.vue"]]);const Ws=N({name:"SiteIndex",components:{EditText:Y,EditImage:Se,EditArray:Ee,ElDivider:Ce,ElImage:ie,ElForm:X,ElFormItem:J},data(){return{editing:{title:!1}}},computed:{site(){return this.$store.getters.site}},methods:{onSave(e){var o;const t={...this.site,...e};Q.update((o=this.site)==null?void 0:o.id,t).then(()=>{var u;console.debug("getSite for id",(u=this.site)==null?void 0:u.id),this.$store.dispatch("getSite")})}}}),Ks={class:"block w-full"},zs={class:"block tip"},Qs={class:"block w-full"},Xs={class:"block tip"},Js={class:"block w-full"},Ys={class:"block tip"},Zs={class:"block w-full"},xs={class:"block tip"},eo={class:"block w-full"},to={class:"block tip"};function so(e,t,o,u,v,c){const l=i("el-form-item"),p=i("edit-text"),f=i("el-image"),$=i("edit-image"),m=i("el-divider"),s=i("edit-array"),d=i("el-form");return a(),y(d,{model:e.site,class:"form","label-width":"auto",style:{"max-width":"600px"}},{default:h(()=>[n(l,{label:e.$t("site.field.origin")},{default:h(()=>[r("span",Ks,g(e.site.origin),1),r("span",zs,g(e.$t("site.message.originTip")),1)]),_:1},8,["label"]),n(l,{label:e.$t("site.field.title")},{default:h(()=>[r("span",Qs,[T(g(e.site.title)+" ",1),n(p,{"model-value":e.site.title,title:e.$t("site.title.editTitle"),placeholder:e.$t("site.placeholder.title"),onConfirm:t[0]||(t[0]=b=>e.onSave({title:b}))},null,8,["model-value","title","placeholder"])]),r("span",Xs,g(e.$t("site.message.titleTip")),1)]),_:1},8,["label"]),n(l,{label:e.$t("site.field.logo")},{default:h(()=>[r("span",Js,[n(f,{src:e.site.logo,class:"logo"},null,8,["src"]),n($,{"model-value":e.site.logo,title:e.$t("site.title.editLogo"),tip:e.$t("site.message.editLogoTip"),onConfirm:t[1]||(t[1]=b=>e.onSave({logo:b}))},null,8,["model-value","title","tip"])]),r("span",Ys,g(e.$t("site.message.logoTip")),1)]),_:1},8,["label"]),n(l,{label:e.$t("site.field.favicon")},{default:h(()=>[r("span",Zs,[n(f,{src:e.site.favicon,class:"favicon"},null,8,["src"]),n($,{"model-value":e.site.favicon,title:e.$t("site.title.editFavicon"),tip:e.$t("site.message.editFaviconTip"),onConfirm:t[2]||(t[2]=b=>e.onSave({favicon:b}))},null,8,["model-value","title","tip"])]),r("span",xs,g(e.$t("site.message.faviconTip")),1)]),_:1},8,["label"]),n(m,{"border-style":"dashed"}),n(l,{label:e.$t("site.field.admins")},{default:h(()=>{var b,w;return[r("span",eo,[T(g((b=e.site.admins)==null?void 0:b.join(", "))+" ",1),n(s,{"model-value":((w=e.site)==null?void 0:w.admins)||[],title:e.$t("site.title.editAdmins"),placeholder:e.$t("site.placeholder.admins"),tip:e.$t("site.message.adminsTip2"),min:1,"min-error-message":e.$t("site.message.atLeastOneAdmin"),onConfirm:t[3]||(t[3]=k=>e.onSave({admins:k}))},null,8,["model-value","title","placeholder","tip","min-error-message"])]),r("span",to,g(e.$t("site.message.adminsTip")),1)]}),_:1},8,["label"])]),_:1},8,["model"])}var oo=I(Ws,[["render",so],["__scopeId","data-v-e38df654"],["__file","/home/runner/work/Nexior/Nexior/src/components/setting/Site.vue"]]);const no=N({name:"SettingSeo",components:{EditText:Y,EditArray:Ee,ElForm:X,ElFormItem:J},data(){return{editing:{title:!1}}},computed:{site(){return this.$store.getters.site}},methods:{onSave(e){var o;const t={...this.site,...e};Q.update((o=this.site)==null?void 0:o.id,t).then(()=>{var u;console.debug("getSite for id",(u=this.site)==null?void 0:u.id),this.$store.dispatch("getSite")})}}}),io={class:"block w-full"},ao={class:"block tip"},ro={class:"block w-full"},lo={class:"block tip"};function co(e,t,o,u,v,c){const l=i("edit-text"),p=i("el-form-item"),f=i("edit-array"),$=i("el-form");return a(),y($,{model:e.site,class:"form","label-width":"auto",style:{"max-width":"600px"}},{default:h(()=>[n(p,{label:e.$t("site.field.description")},{default:h(()=>[r("span",io,[T(g(e.site.description)+" ",1),n(l,{"model-value":e.site.description,title:e.$t("site.title.editDescription"),placeholder:e.$t("site.placeholder.description"),onConfirm:t[0]||(t[0]=m=>e.onSave({description:m}))},null,8,["model-value","title","placeholder"])]),r("span",ao,g(e.$t("site.message.descriptionTip")),1)]),_:1},8,["label"]),n(p,{label:e.$t("site.field.keywords")},{default:h(()=>{var m,s;return[r("span",ro,[T(g((m=e.site.keywords)==null?void 0:m.join(", "))+" ",1),n(f,{"model-value":((s=e.site)==null?void 0:s.keywords)||[],title:e.$t("site.title.editKeywords"),placeholder:e.$t("site.placeholder.keywords"),tip:e.$t("site.message.keywordsTip2"),onConfirm:t[1]||(t[1]=d=>e.onSave({keywords:d}))},null,8,["model-value","title","placeholder","tip"])]),r("span",lo,g(e.$t("site.message.keywordsTip")),1)]}),_:1},8,["label"])]),_:1},8,["model"])}var uo=I(no,[["render",co],["__scopeId","data-v-57cb41c4"],["__file","/home/runner/work/Nexior/Nexior/src/components/setting/Seo.vue"]]);const mo=N({name:"SiteIndex",components:{EditText:Y,ElForm:X,ElFormItem:J},data(){return{editing:{title:!1}}},computed:{site(){return this.$store.getters.site}},methods:{onSave(e){var o;const t={...this.site,...e};Q.update((o=this.site)==null?void 0:o.id,t).then(()=>{var u;console.debug("getSite for id",(u=this.site)==null?void 0:u.id),this.$store.dispatch("getSite")})}}}),po={class:"block tip"},ho={class:"block tip"};function _o(e,t,o,u,v,c){const l=i("edit-text"),p=i("el-form-item"),f=i("el-form");return a(),y(f,{model:e.site,class:"form","label-width":"auto",style:{"max-width":"600px"}},{default:h(()=>[n(p,{label:e.$t("site.field.distributionDefaultInviterId")},{default:h(()=>{var $,m;return[T(g(($=e.site.distribution)==null?void 0:$.default_inviter_id)+" ",1),n(l,{"model-value":(m=e.site.distribution)==null?void 0:m.default_inviter_id,title:e.$t("site.title.editDistributionDefaultInviterId"),placeholder:e.$t("site.placeholder.editDistributionDefaultInviterId"),onConfirm:t[0]||(t[0]=s=>e.onSave({distribution:{...e.site.distribution,default_inviter_id:s}}))},null,8,["model-value","title","placeholder"]),r("span",po,g(e.$t("site.message.distributionDefaultInviterIdTip")),1)]}),_:1},8,["label"]),n(p,{label:e.$t("site.field.distributionForceInviterId")},{default:h(()=>{var $,m;return[T(g(($=e.site.distribution)==null?void 0:$.force_inviter_id)+" ",1),n(l,{"model-value":(m=e.site.distribution)==null?void 0:m.force_inviter_id,title:e.$t("site.title.editDistributionForceInviterId"),placeholder:e.$t("site.placeholder.editDistributionForceInviterId"),onConfirm:t[1]||(t[1]=s=>e.onSave({distribution:{...e.site.distribution,force_inviter_id:s}}))},null,8,["model-value","title","placeholder"]),r("span",ho,g(e.$t("site.message.distributionForceInviterIdTip")),1)]}),_:1},8,["label"])]),_:1},8,["model"])}var go=I(mo,[["render",_o],["__scopeId","data-v-4ed92693"],["__file","/home/runner/work/Nexior/Nexior/src/components/setting/Distribution.vue"]]);const fo=N({name:"SiteIndex",components:{EditText:Y,EditImage:Se,ElImage:ie,ElForm:X,ElSwitch:it,ElFormItem:J},data(){return{editing:{title:!1}}},computed:{site(){return this.$store.getters.site}},methods:{onSave(e){var o;const t={...this.site,...e};Q.update((o=this.site)==null?void 0:o.id,t).then(()=>{var u;console.debug("getSite for id",(u=this.site)==null?void 0:u.id),this.$store.dispatch("getSite")})}}}),$o={class:"w-full"},vo={class:"block tip w-full"},yo={key:0},bo={class:"block w-full"},wo={class:"block w-full"};function ko(e,t,o,u,v,c){const l=i("el-switch"),p=i("el-form-item"),f=i("el-image"),$=i("edit-image"),m=i("edit-text"),s=i("el-form");return a(),y(s,{model:e.site,class:"form","label-width":"auto",style:{"max-width":"600px"}},{default:h(()=>[(a(),_(G,null,F(["chat","midjourney","qrart","suno","luma","pika","kling","flux","hailuo","headshots","support"],(d,b)=>n(p,{key:b,label:e.$t("site.field.features"+d.charAt(0).toUpperCase()+d.slice(1))},{default:h(()=>{var w,k,q,A,E,V;return[r("div",$o,[n(l,{"model-value":((w=e.site.features[d])==null?void 0:w.enabled)||!1,"inline-prompt":"","active-text":e.$t("site.button.enabled"),"inactive-text":e.$t("site.button.disabled"),"onUpdate:modelValue":R=>e.onSave({features:{...e.site.features,[d]:{...e.site.features[d],enabled:R}}})},null,8,["model-value","active-text","inactive-text","onUpdate:modelValue"])]),r("span",vo,g(e.$t("site.message.features"+d.charAt(0).toUpperCase()+d.slice(1))),1),d==="support"?M((a(),_("div",yo,[n(p,{label:"WeChat"},{default:h(()=>{var R,D;return[n(l,{"model-value":((D=(R=e.site.features[d])==null?void 0:R.wechat)==null?void 0:D.enabled)||!1,"inline-prompt":"","active-text":e.$t("site.button.enabled"),"inactive-text":e.$t("site.button.disabled"),"onUpdate:modelValue":C=>{var O;return e.onSave({features:{...e.site.features,[d]:{...e.site.features[d],wechat:{...(O=e.site.features[d])==null?void 0:O.wechat,enabled:C}}}})}},null,8,["model-value","active-text","inactive-text","onUpdate:modelValue"])]}),_:2},1024),M(n(p,{label:e.$t("site.field.qr")},{default:h(()=>{var R,D,C,O;return[r("span",bo,[n(f,{src:(D=(R=e.site.features[d])==null?void 0:R.wechat)==null?void 0:D.qr},null,8,["src"]),n($,{"model-value":(O=(C=e.site.features[d])==null?void 0:C.wechat)==null?void 0:O.qr,title:e.$t("site.title.editQR"),tip:e.$t("site.message.editQRTip"),onConfirm:Z=>{var W;return e.onSave({features:{...e.site.features,[d]:{...e.site.features[d],wechat:{...(W=e.site.features[d])==null?void 0:W.wechat,qr:Z}}}})}},null,8,["model-value","title","tip","onConfirm"])])]}),_:2},1032,["label"]),[[B,(q=(k=e.site.features[d])==null?void 0:k.wechat)==null?void 0:q.enabled]]),n(p,{label:"Discord"},{default:h(()=>{var R,D;return[n(l,{"model-value":((D=(R=e.site.features[d])==null?void 0:R.discord)==null?void 0:D.enabled)||!1,"inline-prompt":"","active-text":e.$t("site.button.enabled"),"inactive-text":e.$t("site.button.disabled"),"onUpdate:modelValue":C=>{var O;return e.onSave({features:{...e.site.features,[d]:{...e.site.features[d],discord:{...(O=e.site.features[d])==null?void 0:O.discord,enabled:C}}}})}},null,8,["model-value","active-text","inactive-text","onUpdate:modelValue"])]}),_:2},1024),M(n(p,{label:e.$t("site.field.url")},{default:h(()=>{var R,D,C,O;return[r("span",wo,[T(g((D=(R=e.site.features[d])==null?void 0:R.discord)==null?void 0:D.url)+" ",1),n(m,{"model-value":(O=(C=e.site.features[d])==null?void 0:C.discord)==null?void 0:O.url,title:e.$t("site.title.editUrl"),placeholder:e.$t("site.placeholder.editUrl"),onConfirm:Z=>{var W;return e.onSave({features:{...e.site.features,[d]:{...e.site.features[d],discord:{...(W=e.site.features[d])==null?void 0:W.discord,url:Z}}}})}},null,8,["model-value","title","placeholder","onConfirm"])])]}),_:2},1032,["label"]),[[B,(E=(A=e.site.features[d])==null?void 0:A.discord)==null?void 0:E.enabled]])],512)),[[B,(V=e.site.features[d])==null?void 0:V.enabled]]):S("v-if",!0)]}),_:2},1032,["label"])),64))]),_:1},8,["model"])}var Co=I(fo,[["render",ko],["__scopeId","data-v-7089d567"],["__file","/home/runner/work/Nexior/Nexior/src/components/setting/Function.vue"]]);const So=N({name:"UserSetting",components:{ElDialog:at,FontAwesomeIcon:L,GeneralSetting:js,SiteSetting:oo,SeoSetting:uo,DistributionSetting:go,FunctionSetting:Co},props:{visible:{type:Boolean,default:!1}},emits:["update:visible"],data(){return{activeTab:"general",showSuggestions:!0,navItems:[{key:"general",label:this.$t("common.settings.general"),icon:Ze},{key:"site",label:this.$t("common.settings.site"),icon:xe},{key:"seo",label:this.$t("common.settings.seo"),icon:et},{key:"distribution",label:this.$t("common.settings.distribution"),icon:tt},{key:"function",label:this.$t("common.settings.function"),icon:st}]}},computed:{currentTabTitle(){const e=this.navItems.find(t=>t.key===this.activeTab);return e?e.label:""},isSiteAdmin(){var e,t,o,u,v;return!!((v=(o=(t=(e=this.$store)==null?void 0:e.state)==null?void 0:t.site)==null?void 0:o.admins)!=null&&v.includes((u=this.$store.getters.user)==null?void 0:u.id))}},methods:{onClose(){this.$emit("update:visible",!1)}}}),Eo={class:"flex settings"},Io={class:"w-56 border-r"},No={class:"flex flex-col p-2 space-y-1"},To=["onClick"],Ro={class:"flex-1 p-6 overflow-y-auto"},Do={key:0},Ao={key:1},qo={key:2},Oo={key:3},Go={key:4};function Lo(e,t,o,u,v,c){const l=i("font-awesome-icon"),p=i("general-setting"),f=i("site-setting"),$=i("seo-setting"),m=i("distribution-setting"),s=i("function-setting"),d=i("el-dialog");return a(),y(d,{"model-value":e.visible,onClose:e.onClose},{default:h(()=>[r("div",Eo,[r("aside",Io,[r("nav",No,[(a(!0),_(G,null,F(e.navItems,(b,w)=>(a(),_("button",{key:w,class:P(["flex items-center px-4 py-2 text-sm rounded-lg cursor-pointer",e.activeTab===b.key?"active":""]),onClick:k=>e.activeTab=b.key},[n(l,{icon:b.icon,class:"mr-2"},null,8,["icon"]),T(" "+g(b.label),1)],10,To))),128))])]),r("main",Ro,[e.activeTab==="general"?(a(),_("div",Do,[n(p)])):e.activeTab==="site"&&e.isSiteAdmin?(a(),_("div",Ao,[n(f)])):e.activeTab==="seo"&&e.isSiteAdmin?(a(),_("div",qo,[n($)])):e.activeTab==="distribution"&&e.isSiteAdmin?(a(),_("div",Oo,[n(m)])):e.activeTab==="function"&&e.isSiteAdmin?(a(),_("div",Go,[n(s)])):S("v-if",!0)])])]),_:1},8,["model-value","onClose"])}var Uo=I(So,[["render",Lo],["__scopeId","data-v-17be4dfc"],["__file","/home/runner/work/Nexior/Nexior/src/components/user/Setting.vue"]]);const Mo=N({name:"UserCenter",components:{UserAvatar:Ts,UserSetting:Uo,FontAwesomeIcon:L,ElDivider:Ce,ElCard:rt},data(){return{showMenu:!1,showSetting:!1}},computed:{user(){var e;return(e=this.$store.getters)==null?void 0:e.user}},mounted(){document.addEventListener("click",this.closeMenu)},unmounted(){document.removeEventListener("click",this.closeMenu)},methods:{toggleMenu(){this.showMenu=!this.showMenu},closeMenu(e){const t=e.target;this.$el.contains(t)||(this.showMenu=!1)},async onLogout(){await this.$store.dispatch("logout")},onConsole(){this.$router.push({name:Ve})},onDistribution(){this.$router.push({name:Pe})},onSettings(){this.showSetting=!0}}}),Fo={class:"center"},Vo={key:0,class:"px-4 py-2 text-sm font-medium"},Po={class:"py-1"};function Ho(e,t,o,u,v,c){const l=i("user-avatar"),p=i("el-divider"),f=i("font-awesome-icon"),$=i("el-card"),m=i("user-setting");return a(),_("div",Fo,[r("div",{onClick:t[0]||(t[0]=(...s)=>e.toggleMenu&&e.toggleMenu(...s))},[n(l,{class:"cursor-pointer"})]),n(Xe,{name:"fade"},{default:h(()=>[e.showMenu?(a(),y($,{key:0,class:"absolute right-0 mt-2 min-w-[220px] z-50 p-0"},{default:h(()=>{var s;return[e.user.email?(a(),_("div",Vo,g((s=e.user)==null?void 0:s.email),1)):S("v-if",!0),e.user.email?(a(),y(p,{key:1,class:"mb-1 mt-1"})):S("v-if",!0),r("div",Po,[r("button",{class:"block w-full px-4 py-2 text-left text-sm rounded-lg",onClick:t[1]||(t[1]=(...d)=>e.onSettings&&e.onSettings(...d))},[n(f,{icon:"fa-solid fa-cog",class:"mr-1"}),T(" "+g(e.$t("common.nav.setting")),1)]),r("button",{class:"block w-full px-4 py-2 text-left text-sm rounded-lg",onClick:t[2]||(t[2]=(...d)=>e.onDistribution&&e.onDistribution(...d))},[n(f,{icon:"fa-solid fa-coins",class:"mr-1"}),T(" "+g(e.$t("common.nav.distribution")),1)]),r("button",{class:"block w-full px-4 py-2 text-left text-sm rounded-lg",onClick:t[3]||(t[3]=(...d)=>e.onConsole&&e.onConsole(...d))},[n(f,{icon:"fa-solid fa-compass",class:"mr-1"}),T(" "+g(e.$t("common.nav.console")),1)]),r("button",{class:"block w-full px-4 py-2 text-left text-sm rounded-lg",onClick:t[4]||(t[4]=(...d)=>e.onLogout&&e.onLogout(...d))},[n(f,{icon:"fa-solid fa-arrow-right-from-bracket",class:"mr-1"}),T(" "+g(e.$t("common.nav.logOut")),1)])])]}),_:1})):S("v-if",!0)]),_:1}),n(m,{visible:e.showSetting,"onUpdate:visible":t[5]||(t[5]=s=>e.showSetting=s)},null,8,["visible"])])}var Bo=I(Mo,[["render",Ho],["__scopeId","data-v-4e7424d9"],["__file","/home/runner/work/Nexior/Nexior/src/components/user/Center.vue"]]);const jo=N({name:"SidePanel",components:{ElInput:be,FontAwesomeIcon:L,ElSkeleton:lt},props:{},emits:["change-conversation"],computed:{conversationId(){var e,t,o;return console.debug("conversationId in side",(e=this.$route.params)==null?void 0:e.id),(o=(t=this.$route.params)==null?void 0:t.id)==null?void 0:o.toString()},conversationGroups(){var l,p,f,$,m,s,d,b;const e=this.$store.state.chat.conversations,t=new Date;t.setHours(0,0,0,0);const o=new Date(t);o.setDate(o.getDate()-1);const u=new Date(t);u.setDate(u.getDate()-t.getDay());const v=new Date(u);v.setDate(v.getDate()-7);const c=e==null?void 0:e.reduce((w,k)=>{const q=new Date(k.updated_at*1e3);return q>=t?w.today.push(k):q>=o?w.yesterday.push(k):q>=u?w.thisWeek.push(k):w.earlier.push(k),w},{today:[],yesterday:[],thisWeek:[],earlier:[]});return{...((l=c==null?void 0:c.today)==null?void 0:l.length)>0?{today:(p=c==null?void 0:c.today)==null?void 0:p.sort((w,k)=>k.updated_at-w.updated_at)}:{},...((f=c==null?void 0:c.yesterday)==null?void 0:f.length)>0?{yesterday:($=c==null?void 0:c.yesterday)==null?void 0:$.sort((w,k)=>k.updated_at-w.updated_at)}:{},...((m=c==null?void 0:c.thisWeek)==null?void 0:m.length)>0?{thisWeek:(s=c==null?void 0:c.thisWeek)==null?void 0:s.sort((w,k)=>k.updated_at-w.updated_at)}:{},...((d=c==null?void 0:c.earlier)==null?void 0:d.length)>0?{earlier:(b=c==null?void 0:c.earlier)==null?void 0:b.sort((w,k)=>k.updated_at-w.updated_at)}:{}}},application(){return this.$store.state.chat.application},loading(){return this.$store.state.chat.status.getConversations===te.Request},token(){var e,t;return(t=(e=this.$store.state.chat)==null?void 0:e.credential)==null?void 0:t.token}},methods:{async onNewConversation(){console.debug("onNewConversation from side panel"),this.$emit("change-conversation",void 0)},async onConfirm(e){const t=this.token;if(!t){console.error("Token is not found");return}(e==null?void 0:e.deleting)&&e.id?(await K.deleteConversation(e.id,{token:t}),await this.$store.dispatch("chat/getConversations")):e!=null&&e.editing?(await K.updateConversation(e,{token:t}),await this.$store.dispatch("chat/getConversations")):e.editing=!0},onClickConversation(e){console.debug("onClickConversation in side panel",e),this.$emit("change-conversation",e)}}}),Wo={class:"panel"},Ko={key:1,class:"conversations"},zo={class:"icons"},Qo={class:"title"},Xo={class:"key"},Jo=["onClick"],Yo={class:"title"},Zo={key:0},xo={key:1},en={key:2},tn={class:"operations"};function sn(e,t,o,u,v,c){const l=i("el-skeleton"),p=i("font-awesome-icon"),f=i("el-input");return a(),_("div",Wo,[e.loading&&e.conversationGroups===void 0?(a(),y(l,{key:0})):(a(),_("div",Ko,[r("div",{class:"conversation",onClick:t[0]||(t[0]=(...$)=>e.onNewConversation&&e.onNewConversation(...$))},[r("div",zo,[n(p,{icon:"fa-solid fa-plus",class:"icon"})]),r("div",Qo,g(e.$t("chat.message.startNewChat")),1)]),(a(!0),_(G,null,F(e.conversationGroups,($,m)=>(a(),_("div",{key:m,class:"group"},[r("div",Xo,g(e.$t(`chat.group.${m}`)),1),(a(!0),_(G,null,F($,(s,d)=>{var b,w,k,q;return a(),_("div",{key:d,class:P({conversation:!0,active:s.id===e.conversationId}),onClick:A=>e.onClickConversation(s.id)},[r("div",Yo,[s!=null&&s.deleting?(a(),_("span",Zo,g(`${e.$t("chat.message.confirmDelete")}?`),1)):s!=null&&s.editing?(a(),_("span",xo,[n(f,{modelValue:s.title,"onUpdate:modelValue":A=>s.title=A,onKeydown:oe(A=>e.onConfirm(s),["enter"])},null,8,["modelValue","onUpdate:modelValue","onKeydown"])])):(s==null?void 0:s.title)||(s==null?void 0:s.messages)?(a(),_("span",en,g((s==null?void 0:s.title)||((w=(b=s==null?void 0:s.messages)==null?void 0:b[(s==null?void 0:s.messages.length)-1])==null?void 0:w.content)||((q=(k=s==null?void 0:s.messages)==null?void 0:k[0])==null?void 0:q.content)),1)):S("v-if",!0)]),r("div",tn,[!(s!=null&&s.editing)&&!s.deleting?(a(),y(p,{key:0,icon:"fa-solid fa-edit",class:"icon icon-edit",onClick:H(A=>s.editing=!0,["stop"])},null,8,["onClick"])):S("v-if",!0),!(s!=null&&s.editing)&&!s.deleting?(a(),y(p,{key:1,icon:"fa-solid fa-trash",class:"icon icon-delete",onClick:H(A=>s.deleting=!0,["stop"])},null,8,["onClick"])):S("v-if",!0),(s==null?void 0:s.editing)||s.deleting?(a(),y(p,{key:2,icon:"fa-solid fa-check",class:"icon icon-confirm",onClick:H(A=>e.onConfirm(s),["stop"])},null,8,["onClick"])):S("v-if",!0),(s==null?void 0:s.editing)||s.deleting?(a(),y(p,{key:3,icon:"fa-solid fa-xmark",class:"icon icon-cancel",onClick:H(A=>{s.editing=!1,s.deleting=!1},["stop"])},null,8,["onClick"])):S("v-if",!0)])],10,Jo)}),128))]))),128))]))])}var on=I(jo,[["render",sn],["__scopeId","data-v-d866c834"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/SidePanel.vue"]]);const nn=N({name:"LayoutChat",components:{SidePanel:on,ElDrawer:dt,UserCenter:Bo,ElButton:ye,FontAwesomeIcon:L},emits:["change-conversation"],data(){return{drawer:!1}},methods:{onChangeConversation(e){console.debug("onChangeConversation in layout",e),this.$emit("change-conversation",e)}}}),an={class:"main"},rn={class:"side"},ln={class:"chat"};function dn(e,t,o,u,v,c){const l=i("side-panel"),p=i("user-center"),f=i("font-awesome-icon"),$=i("el-button"),m=i("el-drawer");return a(),_("div",an,[r("div",rn,[pe(e.$slots,"side",{},()=>[n(l,{onChangeConversation:e.onChangeConversation},null,8,["onChangeConversation"])],!0)]),r("div",ln,[pe(e.$slots,"chat",{},void 0,!0)]),n(p,{class:"absolute right-2 top-2"}),n($,{round:"",class:"menu",onClick:t[0]||(t[0]=s=>e.drawer=!0)},{default:h(()=>[n(f,{icon:"fa-solid fa-bars",class:"icon-menu"})]),_:1}),n(m,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=s=>e.drawer=s),"with-header":!1,size:"290px",class:"drawer"},{default:h(()=>[n(l)]),_:1},8,["modelValue"])])}var cn=I(nn,[["render",dn],["__scopeId","data-v-8d7a06d2"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Chat.vue"]]);const un=N({name:"ChatConversation",components:{Composer:xt,Disclaimer:Ss,ModelSelector:bs,Message:Pt,Layout:cn},data(){var e,t;return{drawer:!1,question:"",references:[],upload:!1,answering:!1,canceler:void 0,messages:((t=(e=this.$store.state.chat.conversations)==null?void 0:e.find(o=>{var u;return o.id===((u=this.$route.params.id)==null?void 0:u.toString())}))==null?void 0:t.messages)||[]}},computed:{modelGroup(){return this.$store.state.chat.modelGroup},model(){return this.$store.state.chat.model},conversationId(){var e;return(e=this.$route.params.id)==null?void 0:e.toString()},conversation(){var e;return(e=this.$store.state.chat.conversations)==null?void 0:e.find(t=>t.id===this.conversationId)},service(){return this.$store.state.chat.service},application(){return this.$store.state.chat.application},applications(){return this.$store.state.chat.applications},credential(){var e;return(e=this.$store.state.chat)==null?void 0:e.credential},needApply(){return this.$store.state.chat.status.getApplications===te.Success&&!this.application},conversations(){return this.$store.state.chat.conversations},initializing(){return this.$store.state.chat.status.getApplications===te.Request}},watch:{async references(e){console.log("references changed",e)},async modelGroup(e){console.debug("modelGroup changed",e)},async conversationId(e){console.debug("conversationId changed",e)}},async mounted(){await this.onGetService(),await this.onGetApplication(),await this.onGetConversations()},methods:{async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("chat/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("chat/getApplications"),console.debug("end onGetApplication")},async onGetConversations(){console.debug("start onGetConversations"),await this.$store.dispatch("chat/getConversations"),console.debug("end onGetConversations")},async onDraft(e){this.question=e,this.onSubmit()},async onStop(){this.canceler&&(this.canceler.abort(),this.answering=!1)},async onRestart(e){var p,f,$,m,s,d,b,w,k,q,A,E,V,R,D;const t=this.messages.findIndex(C=>C===e),o=this.messages[t-1];let u=[];if(t!==-1){if(u=this.messages.slice(0,t-1),this.messages=this.messages.slice(0,t),this.references=[],typeof o.content=="string")this.question=o.content;else if(Array.isArray(o.content))for(let C=0;C<(o==null?void 0:o.content.length);C++)o.content[C].type==="image_url"&&(typeof((f=(p=o==null?void 0:o.content)==null?void 0:p[C])==null?void 0:f.image_url)=="string"?this.references.push((m=($=o==null?void 0:o.content)==null?void 0:$[C])==null?void 0:m.image_url):this.references.push((b=(d=(s=o==null?void 0:o.content)==null?void 0:s[C])==null?void 0:d.image_url)==null?void 0:b.url)),o.content[C].type==="file_url"&&(typeof((k=(w=o==null?void 0:o.content)==null?void 0:w[C])==null?void 0:k.file_url)=="string"?this.references.push((A=(q=o==null?void 0:o.content)==null?void 0:q[C])==null?void 0:A.file_url):this.references.push((R=(V=(E=o==null?void 0:o.content)==null?void 0:E[C])==null?void 0:V.file_url)==null?void 0:R.url)),o.content[C].type==="text"&&(this.question=o.content[C].text)}console.debug("onRestart!",this.question,JSON.stringify(this.references));const v=(D=this.credential)==null?void 0:D.token,c=this.question;if(!v||!c){console.error("no token or endpoint or question"),this.messages.push({error:{code:z},role:j,state:U.FAILED});return}let l=this.conversationId;K.updateConversation({id:this.conversationId,messages:u},{token:v}).then(async()=>{await this.$store.dispatch("chat/setConversation",{id:l,messages:this.messages}),console.debug("finished update conversation",this.messages),console.debug("onRestart",this.question),await this.onRequest()}).catch(C=>{this.handleRequestError(C)})},async onEdit(e,t){var c;const o=this.messages.findIndex(l=>l===e);o!==-1&&(this.messages=this.messages.slice(0,o)),this.question=t;const u=(c=this.credential)==null?void 0:c.token;if(!u){console.error("no token or endpoint or question"),this.messages.push({error:{code:z},role:j,state:U.FAILED});return}let v=this.conversationId;K.updateConversation({id:this.conversationId,messages:this.messages},{token:u}).then(async()=>{await this.$store.dispatch("chat/setConversation",{id:v,messages:this.messages}),console.debug("finished update conversation",this.messages),this.messages.push({content:this.question,role:ee}),console.debug("onEdit",this.question),await this.onRequest()}).catch(l=>{this.handleRequestError(l)})},async onNewConversation(){this.$router.push({name:He}),this.messages=[],this.question="",this.references=[]},async onRestoreConversation(e){var c;this.$router.push({name:me,params:{id:e}});const t=(c=this.conversations)==null?void 0:c.find(l=>l.id===e),o=t==null?void 0:t.model;console.debug("conversation model",o);const u=Be.find(l=>l.name===o);console.debug("target model",u);const v=je.find(l=>l.name===(u==null?void 0:u.modelGroup));console.debug("target model group",v),this.$store.dispatch("chat/setModelGroup",v),this.$store.dispatch("chat/setModel",u),this.messages=(t==null?void 0:t.messages)||[],this.onScrollDown()},async onChangeConversation(e){console.log("onChangeConversation in conversation",e),e?this.onRestoreConversation(e):this.onNewConversation()},async onSubmit(){if(this.references.length>0){let e=[];e.push({type:"text",text:this.question});for(let t=0;t<this.references.length;t++)se(this.references[t])?e.push({type:"image_url",image_url:this.references[t]}):e.push({type:"file_url",file_url:this.references[t]});this.messages.push({content:e,role:ee})}else this.messages.push({content:this.question,role:ee});console.debug("onSubmit",this.question,this.references),await this.onRequest()},async onRequest(){var v;console.debug("start to get answer",this.messages);const e=(v=this.credential)==null?void 0:v.token,t=this.question,o=this.references;if(console.debug("validated",t,o),this.question="",this.references=[],!e||!t){console.error("no token or endpoint or question"),this.messages.push({error:{code:z},role:j,state:U.FAILED});return}let u=this.conversationId;this.messages.push({content:"",role:j,state:U.PENDING}),console.debug("start to get answer",this.messages),this.onScrollDown(),this.answering=!0,this.canceler=new AbortController,K.chatConversation({question:t,model:this.model.name,references:o,id:this.conversationId,stateful:!0},{token:e,stream:c=>{console.debug("stream response",c);const l=this.messages[this.messages.length-1];this.messages[this.messages.length-1]={role:j,content:c.answer,state:(l==null?void 0:l.state)!==U.FINISHED?U.ANSWERING:l==null?void 0:l.state},u=c==null?void 0:c.id},signal:this.canceler.signal}).then(async()=>{console.debug("finished fetch answer",this.messages),this.messages[this.messages.length-1].state=U.FINISHED,console.debug("finished fetch answer",JSON.stringify(this.messages)),await this.$store.dispatch("chat/setConversation",{id:u,messages:this.messages}),this.answering=!1,u&&await this.$router.push({name:me,params:{id:u}}),this.onScrollDown(),await this.$store.dispatch("chat/getConversations"),await this.$store.dispatch("chat/getApplications")}).catch(c=>{this.handleRequestError(c)})},async handleRequestError(e){if(console.error("error happened",e),this.messages&&this.messages.length>0&&(this.messages[this.messages.length-1].state=U.FAILED),e.name==="AbortError"){console.error("aborted");return}else e instanceof We?(console.debug("BaseError",e),this.messages[this.messages.length-1].error={code:e.code,message:e.detail}):Ne.isCancel(e)?this.messages[this.messages.length-1].error={code:fe}:this.messages&&this.messages.length>0&&(this.messages[this.messages.length-1].error={code:ge});this.answering=!1},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".messages");!e||!this.messages||this.messages.length===0||(e.scrollTop=e==null?void 0:e.scrollHeight)},0)}}}),mn={key:0,class:"messages"},pn={class:"starter"};function hn(e,t,o,u,v,c){const l=i("model-selector"),p=i("message"),f=i("composer"),$=i("disclaimer"),m=i("layout");return a(),y(m,{onChangeConversation:t[4]||(t[4]=s=>e.onChangeConversation(s))},{chat:h(()=>[n(l,{class:"selector",onModelGroupChanged:t[0]||(t[0]=s=>e.onChangeConversation(void 0))}),r("div",{class:P({dialogue:!0,empty:e.messages.length===0})},[e.messages.length>0?(a(),_("div",mn,[(a(!0),_(G,null,F(e.messages,(s,d)=>(a(),y(p,{key:d,message:s,messages:e.messages,question:e.question,application:e.application,class:"message","onUpdate:question":t[1]||(t[1]=b=>e.question=b),onEdit:e.onEdit,onRestart:e.onRestart},null,8,["message","messages","question","application","onEdit","onRestart"]))),128))])):S("v-if",!0),r("div",pn,[n(f,{question:e.question,"onUpdate:question":t[2]||(t[2]=s=>e.question=s),disabled:e.answering,references:e.references,"onUpdate:references":t[3]||(t[3]=s=>e.references=s),onSubmit:e.onSubmit,onStop:e.onStop},null,8,["question","disabled","references","onSubmit","onStop"]),n($,{class:"disclaimer"})])],2)]),_:1})}var Nn=I(un,[["render",hn],["__scopeId","data-v-3ab2fb26"],["__file","/home/runner/work/Nexior/Nexior/src/pages/chat/Conversation.vue"]]);export{Nn as default};