@acedatacloud/nexior 2.11.34 → 2.11.36

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 (49) hide show
  1. package/dist/assets/{Auth.1fc4d2d8.js → Auth.d8385e18.js} +1 -1
  2. package/dist/assets/Buy.9b215fc2.js +1 -0
  3. package/dist/assets/{Buy.be1cab96.js → Buy.bfda9410.js} +1 -1
  4. package/dist/assets/{Callback.9d24aeef.js → Callback.f8378f88.js} +1 -1
  5. package/dist/assets/{Chatdoc.34c39226.js → Chatdoc.2e8b823b.js} +1 -1
  6. package/dist/assets/{Console.f4ebfe8d.js → Console.39d2e06f.js} +1 -1
  7. package/dist/assets/{Conversation.27cf2fde.js → Conversation.46c10345.js} +1 -1
  8. package/dist/assets/Conversation.a1c9b2a6.js +1 -0
  9. package/dist/assets/{CopyToClipboard.2ced8506.js → CopyToClipboard.e4f6841d.js} +1 -1
  10. package/dist/assets/{DarkSelector.d3227e0f.js → DarkSelector.a09e4eba.js} +1 -1
  11. package/dist/assets/{Detail.cf8dd32c.js → Detail.9b6cc986.js} +1 -1
  12. package/dist/assets/{History.dd02aeda.js → History.eb383e9e.js} +1 -1
  13. package/dist/assets/Index.392d538d.js +1 -0
  14. package/dist/assets/{Index.ea8f4d55.js → Index.48345f2d.js} +1 -1
  15. package/dist/assets/Index.50894ed5.css +1 -0
  16. package/dist/assets/{Index.8bb7dbcc.js → Index.6019bd48.js} +1 -1
  17. package/dist/assets/{Index.771ddec0.js → Index.7442bb74.js} +1 -1
  18. package/dist/assets/Index.746e9c6b.js +1 -0
  19. package/dist/assets/{Index.bb135cf7.js → Index.84e67781.js} +1 -1
  20. package/dist/assets/{Index.bb24fb3a.js → Index.84f723d1.js} +1 -1
  21. package/dist/assets/{Index.d5b0bb80.js → Index.92975394.js} +1 -1
  22. package/dist/assets/{Index.787532a5.js → Index.c0791aca.js} +2 -2
  23. package/dist/assets/{Index.66a2ecf1.js → Index.d6e112ad.js} +1 -1
  24. package/dist/assets/{Index.c4d1391e.js → Index.f866353f.js} +1 -1
  25. package/dist/assets/{InfoIcon.4dce1fd2.js → InfoIcon.64141973.js} +1 -1
  26. package/dist/assets/{Invitees.c865a79e.js → Invitees.b7fb9708.js} +1 -1
  27. package/dist/assets/{List.3b353764.js → List.0add6b6d.js} +1 -1
  28. package/dist/assets/{List.6cb22028.js → List.69fc6373.js} +1 -1
  29. package/dist/assets/{List.c719a6b4.js → List.71b0f42f.js} +1 -1
  30. package/dist/assets/{Login.6fd4e3c6.js → Login.3dae42ba.js} +1 -1
  31. package/dist/assets/{Main.c3b48d58.js → Main.805ef59c.js} +1 -1
  32. package/dist/assets/{Manage.3623bd2d.js → Manage.2deee5e8.js} +1 -1
  33. package/dist/assets/MarkdownRenderer.a98963ce.js +1 -0
  34. package/dist/assets/{Navigator.ba83236d.js → Navigator.1f42e989.js} +1 -1
  35. package/dist/assets/{Pagination.2414434f.js → Pagination.beab317b.js} +1 -1
  36. package/dist/assets/{Setting.a501eb2e.js → Setting.2ded51a8.js} +1 -1
  37. package/dist/assets/{Status.a000ce7d.js → Status.0aa77ef9.js} +1 -1
  38. package/dist/assets/{distribution.84ea7cf1.js → distribution.cbc14e25.js} +1 -1
  39. package/dist/assets/{index.dca36e76.js → index.a1269a78.js} +1 -1
  40. package/dist/assets/{order.9f4c832a.js → order.2b641272.js} +1 -1
  41. package/dist/assets/{price.2b75e068.js → price.3731f66d.js} +1 -1
  42. package/dist/index.html +1 -1
  43. package/package.json +1 -1
  44. package/dist/assets/Buy.bf3cbf85.js +0 -1
  45. package/dist/assets/Conversation.3f201195.js +0 -1
  46. package/dist/assets/Index.5ca9676f.css +0 -1
  47. package/dist/assets/Index.70fe5136.js +0 -1
  48. package/dist/assets/Index.bda25bd3.js +0 -1
  49. package/dist/assets/MarkdownRenderer.9cd0eb95.js +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{x as a}from"./index.dca36e76.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{x as a}from"./index.a1269a78.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{y as a,C as i}from"./index.dca36e76.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{y as a,C as i}from"./index.a1269a78.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
@@ -7,7 +7,7 @@
7
7
  <meta http-eguiv="Pragma" content="no-cache" />
8
8
  <meta http-equiv="Expires" content="0" />
9
9
  <title>Ace Data Cloud</title>
10
- <script type="module" crossorigin src="/assets/index.dca36e76.js"></script>
10
+ <script type="module" crossorigin src="/assets/index.a1269a78.js"></script>
11
11
  <link rel="modulepreload" href="/assets/vendor-@vue.34786d41.js">
12
12
  <link rel="modulepreload" href="/assets/vendor-element-plus.efc1b383.js">
13
13
  <link rel="modulepreload" href="/assets/vendor-others.de6317ed.js">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acedatacloud/nexior",
3
- "version": "2.11.34",
3
+ "version": "2.11.36",
4
4
  "author": "Germey Technology <dev@germey.tech>",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1 +0,0 @@
1
- var W=Object.defineProperty,z=Object.defineProperties;var K=Object.getOwnPropertyDescriptors;var w=Object.getOwnPropertySymbols;var H=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable;var S=(e,s,t)=>s in e?W(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,A=(e,s)=>{for(var t in s||(s={}))H.call(s,t)&&S(e,t,s[t]);if(w)for(var t of w(s))Q.call(s,t)&&S(e,t,s[t]);return e},R=(e,s)=>z(e,K(s));import"./vendor-others.de6317ed.js";import{I as G}from"./api.f60246f3.js";import{_ as Y,E as J,M as X,F as j,Q as q,z as T,B as P,I as B,G as x,D as Z}from"./index.dca36e76.js";import{o as ee}from"./order.9f4c832a.js";import{g as se}from"./price.2b75e068.js";import{an as te}from"./vendor-fortawesome.1cce8f50.js";import{C as oe,i as ie,b as ae,h as ne,K as re,L as ce,r as le,l as pe,M as de}from"./vendor-element-plus.efc1b383.js";import{H as ue,al as h,L as m,M as o,o as p,V as n,f as _,U as d,O as he,T as f,S as E,e as b,ai as D,Q as _e,W as N,P as me}from"./vendor-@vue.34786d41.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.39cf5eae.js";const fe=ue({name:"ConsoleSubscriptionBuy",components:{ElSkeleton:oe,ElRow:ie,ElTag:ae,ElCol:ne,ElRadioGroup:re,ElRadioButton:ce,ElCard:le,FontAwesomeIcon:te,ElButton:pe},data(){return{applications:[],type:"Period",services:[],loading:!1,creating:!1,subscription:void 0}},computed:{applicationId(){var e,s;return(s=(e=this.$route.params)==null?void 0:e.id)==null?void 0:s.toString()},subscriptions(){var s,t,i,u;const e=[{name:"WEEK",label:this.$t("console.subscription.weekly"),description:this.$t("console.subscription.weekly.description"),duration:604800},{name:"MONTH",label:this.$t("console.subscription.monthly"),description:this.$t("console.subscription.monthly.description"),duration:2592e3},{name:"YEAR",tag:this.$t("console.button.suggested"),label:this.$t("console.subscription.yearly"),description:this.$t("console.subscription.yearly.description"),duration:31536e3}];for(const c of e){const l=this.getPackages(c.duration);l&&(c.price=l.reduce((a,g)=>a+g.price,0));for(const a of l)c.benefits||(c.benefits=[]),c.benefits.push({enabled:!0,content:`${(s=a==null?void 0:a.service)==null?void 0:s.title} - ${a.amount} `+this.$t("service.unit."+((t=a==null?void 0:a.service)==null?void 0:t.unit)+"s")});(i=c.benefits)==null||i.push({enabled:c.name!=="WEEK",content:this.$t("console.message.benefit1")}),(u=c.benefits)==null||u.push({enabled:c.name!=="WEEK",content:this.$t("console.message.benefit2")})}return e},serviceIds(){return[J,X,j,q]},applicationIds(){return this.applications.sort((s,t)=>this.serviceIds.indexOf(s.service_id)-this.serviceIds.indexOf(t.service_id)).map(s=>s.id)}},async mounted(){this.loading=!0,await this.onFetchServices(),await this.onFetchApplications(),await this.onCreateApplications(),this.loading=!1,this.subscription=this.subscriptions[2]},methods:{getPriceString:se,onBuyExtra(){this.$router.push({name:T,params:{id:this.applicationId}})},getPackages(e){let s=[];const t=this.services.sort((i,u)=>this.serviceIds.indexOf(i.id)-this.serviceIds.indexOf(u.id));for(const i of t){const u=i.packages,c=u==null?void 0:u.find(l=>l.type===G.PERIOD&&l.duration===e);c&&s.push(R(A({},c),{service:i}))}return s},async onCreateApplications(){const e=this.applications.map(i=>i.service_id),t=this.serviceIds.filter(i=>!e.includes(i));if(console.log("missingServiceIds",t),t.length>0){for(const i of t)await P.create({service_id:i,type:B.PERIOD});await this.onFetchApplications()}},onChangeType(){console.log("onChangeType",this.type),this.$router.push({name:T,params:this.$route.params})},async onFetchServices(){const{data:e}=await x.getAll({id:this.serviceIds});this.services=e.items},async onFetchApplications(){const{data:e}=await P.getAll({limit:100,offset:0,user_id:this.$store.getters.user.id,ordering:"-created_at",service_id:this.serviceIds,type:B.PERIOD});this.applications=e.items},onCreateOrder(e){var s,t;this.subscription=e,this.creating=!0,ee.create({application_ids:this.applicationIds,package_ids:this.getPackages(e.duration).map(i=>i.id),description:((t=(s=this.$store.state)==null?void 0:s.site)==null?void 0:t.title)+" - "+e.label}).then(({data:i})=>{this.creating=!1,this.$router.push({name:Z,params:{id:i.id}})}).catch(()=>{de.error(this.$t("order.message.createFailed")),this.creating=!1})}}}),ge={class:"title"},be={class:"introduction"},ve={class:"name"},ye={class:"price"},Ee={class:"description"},Ie={class:"benefits"},$e={class:"operations"},Ce={key:2,class:"extra"};function ke(e,s,t,i,u,c){const l=h("el-col"),a=h("el-row"),g=h("el-radio-button"),V=h("el-radio-group"),F=h("el-skeleton"),L=h("el-tag"),I=h("font-awesome-icon"),$=h("el-button"),C=h("el-card");return p(),m(a,{class:"panel"},{default:o(()=>[n(l,{span:24},{default:o(()=>[n(a,null,{default:o(()=>[n(l,{span:24},{default:o(()=>[_("h2",ge,d(e.$t("common.title.buyMore")),1)]),_:1})]),_:1}),n(a,null,{default:o(()=>[n(l,{span:24},{default:o(()=>[n(C,{shadow:"hover",class:"card"},{default:o(()=>[he(n(a,null,{default:o(()=>[n(l,{class:"text-center"},{default:o(()=>[e.applicationId?(p(),m(V,{key:0,modelValue:e.type,"onUpdate:modelValue":s[0]||(s[0]=r=>e.type=r),size:"large",class:"mb-4",onChange:e.onChangeType},{default:o(()=>[n(g,{label:"Period"},{default:o(()=>[f(d(e.$t("application.type.period")),1)]),_:1}),n(g,{label:"Usage"},{default:o(()=>[f(d(e.$t("application.type.usage")),1)]),_:1})]),_:1},8,["modelValue","onChange"])):E("v-if",!0)]),_:1})]),_:1},512),[[me,!1]]),n(a,null,{default:o(()=>[n(l,{span:16,offset:4},{default:o(()=>[_("p",be,d(e.$t("console.subscription.introduction")),1),e.loading?(p(),m(F,{key:0})):(p(),m(a,{key:1,gutter:15,class:"subscriptions"},{default:o(()=>[(p(!0),b(N,null,D(e.subscriptions,(r,M)=>{var k;return p(),m(l,{key:M,xs:24,md:24/(((k=e.subscriptions)==null?void 0:k.length)||4)},{default:o(()=>{var O;return[n(C,{shadow:"hover",class:_e({subscription:!0,active:((O=e.subscription)==null?void 0:O.name)===r.name}),onClick:v=>e.subscription=r},{default:o(()=>{var v;return[_("h4",ve,[f(d(r.label)+" ",1),r.tag?(p(),m(L,{key:0,type:"warning"},{default:o(()=>[f(d(r.tag),1)]),_:2},1024)):E("v-if",!0)]),_("h2",ye,d(e.getPriceString({value:r.price})),1),_("p",Ee,d(r.description),1),_("div",Ie,[(p(!0),b(N,null,D(r.benefits,(y,U)=>(p(),b("div",{key:U,class:"benefit"},[y.enabled?(p(),m(I,{key:0,icon:"fa-solid fa-check",class:"icon icon-check"})):(p(),m(I,{key:1,icon:"fa-solid fa-xmark",class:"icon icon-xmark"})),_("span",null,d(y.content),1)]))),128))]),_("div",$e,[n($,{class:"btn btn-subscribe",type:((v=e.subscription)==null?void 0:v.name)===(r==null?void 0:r.name)?"primary":"",round:"",onClick:y=>e.onCreateOrder(r)},{default:o(()=>[f(d(e.$t("common.button.buy")),1)]),_:2},1032,["type","onClick"])])]}),_:2},1032,["class","onClick"])]}),_:2},1032,["md"])}),128))]),_:1})),e.loading?E("v-if",!0):(p(),b("div",Ce,[_("span",null,d(e.$t("console.message.doNotWantSubscribe")),1),n($,{type:"primary",class:"btn btn-extra",round:"",size:"small",onClick:e.onBuyExtra},{default:o(()=>[f(d(e.$t("console.message.buyExtra")),1)]),_:1},8,["onClick"])]))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}var Fe=Y(fe,[["render",ke],["__scopeId","data-v-88579aa0"],["__file","/home/runner/work/Nexior/Nexior/src/pages/console/subscription/Buy.vue"]]);export{Fe as default};
@@ -1 +0,0 @@
1
- var ve=Object.defineProperty;var re=Object.getOwnPropertySymbols;var ke=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable;var le=(e,t,s)=>t in e?ve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,F=(e,t)=>{for(var s in t||(t={}))ke.call(t,s)&&le(e,s,t[s]);if(re)for(var s of re(t))Ce.call(t,s)&&le(e,s,t[s]);return e};import{a as Z}from"./vendor-axios.168e6950.js";import{I as Ee}from"./vendor-others.de6317ed.js";import{_ as A,H as I,J as T,z as be,K as Se,L as X,N as Y,O as de,P as ce,T as ue,U as he,V as se,j as fe,W,k as $e,X as x,Y as ee}from"./index.dca36e76.js";import{H as N,o as a,e as p,al as l,L as y,M as C,V as _,f as c,S as E,W as D,ai as V,T as j,U as b,as as ne,$ as L,Q as z,O as te,P as me,aw as Ie,a0 as oe,I as pe}from"./vendor-@vue.34786d41.js";import{M as Ae}from"./MarkdownRenderer.9cd0eb95.js";import{an as O}from"./vendor-fortawesome.1cce8f50.js";import{C as Ne}from"./CopyToClipboard.2ced8506.js";import{u as ae,F as Re,l as ye,s as qe,N as we,O as De,M as _e,d as Oe,f as Te,e as Le,i as Ve,h as Ue,C as Ge,P as Me}from"./vendor-element-plus.efc1b383.js";import{E as J,a as K,b as Q,c as Pe,d as He,e as Be,f as Fe,g as We,h as ge,A as ze}from"./Status.a000ce7d.js";import"./vendor-qrcode.39cf5eae.js";import"./vendor-markdown.f1450088.js";import"./vendor-highlight.js.6ee9ffbc.js";const je=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()}}}),Je={class:"mark"};function Ke(e,t,s,u,$,o){return a(),p("div",Je)}var Qe=A(je,[["render",Ke],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/AnsweringMark.vue"]]);const Xe=N({name:"CopyToClipboard",components:{FontAwesomeIcon:O,ElTooltip:ae},props:{messages:{type:Array,required:!1,default:()=>[]}},emits:["restart"],data(){return{copied:!1}},methods:{onRestart(){this.$emit("restart")}}});function Ye(e,t,s,u,$,o){const i=l("font-awesome-icon"),d=l("el-tooltip");return a(),y(d,{effect:"dark",content:e.$t("common.button.restart"),placement:"top-start"},{default:C(()=>[_(i,{icon:"fa-solid fa-sync",class:"icon-sync",onClick:e.onRestart},null,8,["onClick"])]),_:1},8,["content"])}var Ze=A(Xe,[["render",Ye],["__scopeId","data-v-18116778"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/RestartToGenerate.vue"]]);const xe=N({name:"Message",components:{CopyToClipboard:Ne,RestartToGenerate:Ze,AnsweringMark:Qe,MarkdownRenderer:Ae,ElAlert:Re,ElButton:ye,ElImage:qe,ElTooltip:ae,FontAwesomeIcon:O,ElInput:we},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:I}},computed:{errorText(){var e,t;if(!(!this.message.error||!((e=this.message.error)!=null&&e.code)))switch((t=this.message.error)==null?void 0:t.code){case ge:return this.$t("chat.message.errorUsedUp");case We:return this.$t("chat.message.errorApiError");case Fe:return this.$t("chat.message.errorBadRequest");case Be:return this.$t("chat.message.errorTimeout");case He:return this.$t("chat.message.errorTooManyRequests");case Pe:return this.$t("chat.message.errorContentTooLarge");case Q:return this.$t("chat.message.errorNotApplied");case K:return;case J:default:return this.$t("chat.message.errorUnknown")}},showBuyMore(){var e;return this.message.role===T&&((e=this.message.error)==null?void 0:e.code)===ge}},watch:{},methods:{startEditing(){this.isEditing=!0,this.questionValue=this.message.content,console.debug("start to get answer",this.message)},cancelEdit(){this.isEditing=!1},sendRestart(){this.$emit("restart",this.message)},sendEdit(){this.isEditing=!1,this.onSubmit()},onSubmit(){this.$emit("edit",this.message,this.questionValue)},onCopy(){Ee(this.message.content.toString(),{debug:!0}),this.copied=!0,setTimeout(()=>{this.copied=!1},3e3)},onBuyMore(){var e;this.$router.push({name:be,params:{id:(e=this.application)==null?void 0:e.id}})}}}),et=["role"],tt={class:"author"},st={key:0,class:"main"},nt={class:"content"},ot={class:"edit-left"},at={key:0,class:"message-content"},it={key:1},rt=["src"],lt={key:1,class:"file"},dt={key:1,class:"chat-container"},ct={class:"button-group"},ut={class:"operations"};function ht(e,t,s,u,$,o){var R;const i=l("el-image"),d=l("font-awesome-icon"),h=l("el-tooltip"),r=l("markdown-renderer"),g=l("el-input"),n=l("el-button"),k=l("answering-mark"),S=l("copy-to-clipboard"),m=l("restart-to-generate"),v=l("el-alert");return a(),p("div",{class:z({message:!0,[e.message.role]:!0}),role:e.message.role},[c("div",tt,[e.message.role==="assistant"?(a(),y(i,{key:0,src:"https://cdn.acedata.cloud/7dljuv.png",fit:"cover",class:"avatar"})):E("v-if",!0)]),e.errorText?(a(),y(v,{key:1,class:"error",title:e.errorText,type:"error",closable:!1},null,8,["title"])):(a(),p("div",st,[c("div",nt,[c("div",ot,[e.message.role==="user"&&!e.isEditing&&!Array.isArray(e.message.content)?(a(),y(h,{key:0,effect:"dark",content:e.$t("chat.button.edit"),placement:"bottom"},{default:C(()=>[_(d,{icon:"fa-solid fa-edit",class:"icon icon-edit",onClick:e.startEditing},null,8,["onClick"])]),_:1},8,["content"])):E("v-if",!0)]),e.isEditing?(a(),p("div",dt,[_(g,{modelValue:e.questionValue,"onUpdate:modelValue":t[0]||(t[0]=w=>e.questionValue=w),type:"textarea",class:"chat-input",onKeydown:ne(L(e.sendEdit,["exact","prevent"]),["enter"])},null,8,["modelValue","onKeydown"]),c("div",ct,[_(n,{size:"small",round:"",onClick:e.cancelEdit},{default:C(()=>[j(b(e.$t("common.button.cancel")),1)]),_:1},8,["onClick"]),_(n,{type:"primary",size:"small",round:"",onClick:e.sendEdit},{default:C(()=>[j(b(e.$t("common.button.confirm")),1)]),_:1},8,["onClick"])])])):(a(),p("div",at,[Array.isArray(e.message.content)?(a(),p("div",it,[(a(!0),p(D,null,V(e.message.content,(w,U)=>{var G,M,P,f,H,B,q,ie;return a(),p("div",{key:U},[w.type==="image_url"?(a(),p("img",{key:0,src:typeof(w==null?void 0:w.image_url)=="string"?w.image_url:(G=w.image_url)==null?void 0:G.url,fit:"cover",class:"image"},null,8,rt)):E("v-if",!0),w.type==="file_url"?(a(),p("span",lt,[_(d,{icon:"fa-regular fa-file",class:"icon icon-file"}),j(" "+b(typeof(w==null?void 0:w.file_url)=="string"?(f=(P=(M=w.file_url)==null?void 0:M.split("/"))==null?void 0:P.slice(-1))==null?void 0:f[0]:(ie=(q=(B=(H=w.file_url)==null?void 0:H.url)==null?void 0:B.split("/"))==null?void 0:q.slice(-1))==null?void 0:ie[0]),1)])):E("v-if",!0),w.type==="text"?(a(),y(r,{key:U,content:w.text},null,8,["content"])):E("v-if",!0)])}),128))])):(a(),y(r,{key:0,content:(R=e.message)==null?void 0:R.content},null,8,["content"]))])),e.message.state===e.messageState.PENDING?(a(),y(k,{key:2})):E("v-if",!0)]),c("div",ut,[!Array.isArray(e.message.content)&&(e.message.state===e.messageState.FINISHED||e.message.state===e.messageState.FAILED)?(a(),y(S,{key:0,content:e.message.content,class:"btn-copy"},null,8,["content"])):E("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(m,{key:1,class:"btn-restart",messages:e.messages,onRestart:e.sendRestart},null,8,["messages","onRestart"])):E("v-if",!0)])])),e.showBuyMore?(a(),y(n,{key:2,round:"",type:"primary",class:"btn btn-buy",size:"small",onClick:e.onBuyMore},{default:C(()=>[j(b(e.$t("common.button.buyMore")),1)]),_:1},8,["onClick"])):E("v-if",!0)],10,et)}var mt=A(xe,[["render",ht],["__scopeId","data-v-f0476f80"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/Message.vue"]]);const pt=N({name:"InputBox",components:{ElTooltip:ae,FontAwesomeIcon:O,ElUpload:De},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:Se()+"/api/v1/files/"}},computed:{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})},canUpload(){return[X.name,Y.name].includes(this.model.name)},model(){return this.$store.state.chat.model}},watch:{urls(e){this.$emit("update:references",e)},questionValue(e){this.$emit("update:question",e)},question(e){e!==this.questionValue&&(this.questionValue=e)},references(e){e.length===0&&(this.fileList=[])}},methods:{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")},onExceed(){_e.warning(this.$t("chat.message.uploadReferencesExceed"))},onError(){_e.error(this.$t("chat.message.uploadReferencesError"))}}}),_t={class:"input-box"},gt={class:"btn btn-upload"},ft=["disabled","placeholder"],$t={class:"info"};function yt(e,t,s,u,$,o){const i=l("font-awesome-icon"),d=l("el-tooltip"),h=l("el-upload");return a(),p(D,null,[c("div",_t,[_(h,{"file-list":e.fileList,"onUpdate:file-list":t[0]||(t[0]=r=>e.fileList=r),class:z({upload:!0,disabled:!e.canUpload}),disabled:!e.canUpload,name:"file","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,headers:e.headers},{default:C(()=>[_(d,{class:"box-item",effect:"dark",content:e.$t("chat.message.uploadFile"),placement:"top"},{default:C(()=>[c("span",gt,[_(i,{icon:"fa-solid fa-paperclip",class:"icon icon-attachment"})])]),_:1},8,["content"])]),_:1},8,["file-list","class","disabled","action","on-exceed","on-error","headers"]),te(c("span",{class:z({btn:!0,"btn-send":!0,disabled:!e.questionValue}),onClick:t[1]||(t[1]=(...r)=>e.onSubmit&&e.onSubmit(...r))},[_(i,{icon:"fa-solid fa-location-arrow",class:"icon icon-send"})],2),[[me,!e.disabled]]),te(c("span",{class:z({btn:!0,"btn-stop":!0,disabled:!e.disabled}),onClick:t[2]||(t[2]=(...r)=>e.onStop&&e.onStop(...r))},[_(i,{icon:"fa-solid fa-stop-circle",class:"icon icon-stop"})],2),[[me,e.disabled]]),E(" add this textarea "),te(c("textarea",{ref:"textarea","onUpdate:modelValue":t[3]||(t[3]=r=>e.questionValue=r),disabled:e.disabled,class:"input",placeholder:e.$t("chat.message.newMessagePlaceholder"),style:oe({height:e.inputHeight}),onKeydown:t[4]||(t[4]=ne(L((...r)=>e.onSubmit&&e.onSubmit(...r),["exact","prevent"]),["enter"])),onInput:t[5]||(t[5]=(...r)=>e.adjustTextareaHeight&&e.adjustTextareaHeight(...r))},null,44,ft),[[Ie,e.questionValue]])]),c("p",$t,b(e.$t("chat.message.howToUse")),1)],64)}var wt=A(pt,[["render",yt],["__scopeId","data-v-020f4eb8"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/InputBox.vue"]]);const vt=N({name:"ModelSelector",components:{ElDropdown:Oe,ElDropdownMenu:Te,ElDropdownItem:Le,FontAwesomeIcon:O},emits:["update:modelValue","select"],data(){return{options:[{icon:"fa-solid fa-bolt",color:"#ff9900",model:de},{icon:"fa-solid fa-bolt",color:"#ff9900",model:ce},{icon:"fa-solid fa-wand-magic-sparkles",color:"#ce65e6",model:ue},{icon:"fa-solid fa-wand-magic-sparkles",color:"#ce65e6",model:he},{icon:"fa-solid fa-wand-magic-sparkles",color:"#ce65e6",model:X},{icon:"fa-solid fa-wand-magic-sparkles",color:"#ce65e6",model:Y}]}},computed:{model(){const e=this.$store.state.chat.model.name;return[de,ce,ue,he,X,Y].find(s=>s.name===e)}},methods:{onCommandChange(e){this.$emit("select",e),this.$store.dispatch("chat/setModel",e)}}}),kt={class:"selector"},Ct={class:"name"},Et={class:"angle"},bt={class:"item"},St={class:"info"},It={class:"name"},At={class:"description"};function Nt(e,t,s,u,$,o){const i=l("font-awesome-icon"),d=l("el-dropdown-item"),h=l("el-dropdown-menu"),r=l("el-dropdown");return a(),p("div",kt,[_(r,{trigger:"click","popper-class":"popper"},{dropdown:C(()=>[_(h,null,{default:C(()=>[(a(!0),p(D,null,V(e.options,(g,n)=>(a(),y(d,{key:n,onClick:k=>e.onCommandChange(g.model)},{default:C(()=>[c("div",bt,[c("div",{class:"icon",style:oe({color:g.color})},[_(i,{icon:g.icon},null,8,["icon"])],4),c("div",St,[c("p",It,b(g.model.getDisplayName()),1),c("p",At,b(g.model.getDescription()),1)])])]),_:2},1032,["onClick"]))),128))]),_:1})]),default:C(()=>{var g;return[c("div",null,[c("span",Ct,b((g=e.model)==null?void 0:g.getDisplayName()),1),c("span",Et,[_(i,{icon:"fa-solid fa-angle-down"})])])]}),_:1})])}var Rt=A(vt,[["render",Nt],["__scopeId","data-v-358d65be"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/ModelSelector.vue"]]);const qt=N({name:"ConversationIntroductionItem",components:{FontAwesomeIcon:O},props:{content:{type:String,required:!0},icon:{type:String,required:!0},color:{type:String,default:"rgb(0, 0, 0)"}},data(){return{}},computed:{}}),Dt={class:"item"},Ot={class:"icon"},Tt={class:"content"};function Lt(e,t,s,u,$,o){const i=l("font-awesome-icon");return a(),p("div",Dt,[c("div",Ot,[_(i,{icon:e.icon,style:oe({color:e.color})},null,8,["icon","style"])]),c("div",Tt,b(e.content),1)])}var Vt=A(qt,[["render",Lt],["__scopeId","data-v-bc919b38"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/IntroductionItem.vue"]]);const Ut=N({name:"ConversationIntroduction",components:{IntroductionItem:Vt,ElRow:Ve,ElCol:Ue},emits:["draft"],data(){return{items:[{icon:"fa-solid fa-pen-nib",content:this.$t("chat.message.question1"),color:"rgb(226, 197, 65)"},{icon:"fa-solid fa-laptop-code",content:this.$t("chat.message.question2"),color:"rgb(203, 139, 208)"},{icon:"fa-solid fa-fan",content:this.$t("chat.message.question3"),color:"rgb(118, 208, 235)"},{icon:"fa-solid fa-plane-departure",content:this.$t("chat.message.question4"),color:"rgb(237, 98, 98)"}].sort(()=>Math.random()-.5)}},computed:{}}),Gt={class:"introduction"};function Mt(e,t,s,u,$,o){const i=l("introduction-item"),d=l("el-col"),h=l("el-row");return a(),p("div",Gt,[_(h,{class:"items",justify:"center",gutter:15},{default:C(()=>[(a(!0),p(D,null,V(e.items,(r,g)=>(a(),y(d,{key:g,md:6,sm:12,xs:12},{default:C(()=>[_(i,{content:r.content,icon:r.icon,color:r.color,class:"cursor-pointer",onClick:n=>e.$emit("draft",r.content)},null,8,["content","icon","color","onClick"])]),_:2},1024))),128))]),_:1})])}var Pt=A(Ut,[["render",Mt],["__scopeId","data-v-52040931"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/Introduction.vue"]]);const Ht=N({name:"SidePanel",components:{ElInput:we,FontAwesomeIcon:O,ElSkeleton:Ge},props:{},emits:["click"],computed:{conversationId(){var e,t;return(t=(e=this.$route.params)==null?void 0:e.id)==null?void 0:t.toString()},conversationGroups(){var i,d,h,r,g,n,k,S;const e=this.$store.state.chat.conversations,t=new Date;t.setHours(0,0,0,0);const s=new Date(t);s.setDate(s.getDate()-1);const u=new Date(t);u.setDate(u.getDate()-t.getDay());const $=new Date(u);$.setDate($.getDate()-7);const o=e==null?void 0:e.reduce((m,v)=>{const R=new Date(v.updated_at*1e3);return R>=t?m.today.push(v):R>=s?m.yesterday.push(v):R>=u?m.thisWeek.push(v):m.earlier.push(v),m},{today:[],yesterday:[],thisWeek:[],earlier:[]});return F(F(F(F({},((i=o==null?void 0:o.today)==null?void 0:i.length)>0?{today:(d=o==null?void 0:o.today)==null?void 0:d.sort((m,v)=>v.updated_at-m.updated_at)}:{}),((h=o==null?void 0:o.yesterday)==null?void 0:h.length)>0?{yesterday:(r=o==null?void 0:o.yesterday)==null?void 0:r.sort((m,v)=>v.updated_at-m.updated_at)}:{}),((g=o==null?void 0:o.thisWeek)==null?void 0:g.length)>0?{thisWeek:(n=o==null?void 0:o.thisWeek)==null?void 0:n.sort((m,v)=>v.updated_at-m.updated_at)}:{}),((k=o==null?void 0:o.earlier)==null?void 0:k.length)>0?{earlier:(S=o==null?void 0:o.earlier)==null?void 0:S.sort((m,v)=>v.updated_at-m.updated_at)}:{})},application(){return this.$store.state.chat.application},loading(){return this.$store.state.chat.status.getConversations===se.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(){this.$router.push({name:fe})},async onConfirm(e){const t=this.token;if(!t){console.error("Token is not found");return}e!=null&&e.deleting?(await W.deleteConversation(e.id,{token:t}),await this.$store.dispatch("chat/getConversations")):e!=null&&e.editing?(await W.updateConversation(e,{token:t}),await this.$store.dispatch("chat/getConversations")):e.editing=!0},onClick(e){!e||(this.$router.push({name:$e,params:{id:e}}),this.$emit("click",e))}}}),Bt={class:"panel"},Ft={key:1,class:"conversations"},Wt={class:"icons"},zt={class:"title"},jt={class:"key"},Jt=["onClick"],Kt={class:"title"},Qt={key:0},Xt={key:1},Yt={key:2},Zt={class:"operations"};function xt(e,t,s,u,$,o){const i=l("el-skeleton"),d=l("font-awesome-icon"),h=l("el-input");return a(),p("div",Bt,[e.loading&&e.conversationGroups===void 0?(a(),y(i,{key:0})):(a(),p("div",Ft,[c("div",{class:"conversation",onClick:t[0]||(t[0]=(...r)=>e.onNewConversation&&e.onNewConversation(...r))},[c("div",Wt,[_(d,{icon:"fa-solid fa-plus",class:"icon"})]),c("div",zt,b(e.$t("chat.message.startNewChat")),1)]),(a(!0),p(D,null,V(e.conversationGroups,(r,g)=>(a(),p("div",{key:g,class:"group"},[c("div",jt,b(e.$t(`chat.group.${g}`)),1),(a(!0),p(D,null,V(r,(n,k)=>{var S;return a(),p("div",{key:k,class:z({conversation:!0,active:n.id===e.conversationId}),onClick:m=>e.onClick(n.id)},[c("div",Kt,[n!=null&&n.deleting?(a(),p("span",Qt,b(`${e.$t("chat.message.confirmDelete")}?`),1)):n!=null&&n.editing?(a(),p("span",Xt,[_(h,{modelValue:n.title,"onUpdate:modelValue":m=>n.title=m,onKeydown:ne(m=>e.onConfirm(n),["enter"])},null,8,["modelValue","onUpdate:modelValue","onKeydown"])])):(n==null?void 0:n.title)||(n==null?void 0:n.messages)?(a(),p("span",Yt,b((n==null?void 0:n.title)||((S=n==null?void 0:n.messages[(n==null?void 0:n.messages.length)-1])==null?void 0:S.content)),1)):E("v-if",!0)]),c("div",Zt,[!(n!=null&&n.editing)&&!n.deleting?(a(),y(d,{key:0,icon:"fa-solid fa-edit",class:"icon icon-edit",onClick:L(m=>n.editing=!0,["stop"])},null,8,["onClick"])):E("v-if",!0),!(n!=null&&n.editing)&&!n.deleting?(a(),y(d,{key:1,icon:"fa-solid fa-trash",class:"icon icon-delete",onClick:L(m=>n.deleting=!0,["stop"])},null,8,["onClick"])):E("v-if",!0),(n==null?void 0:n.editing)||n.deleting?(a(),y(d,{key:2,icon:"fa-solid fa-check",class:"icon icon-confirm",onClick:L(m=>e.onConfirm(n),["stop"])},null,8,["onClick"])):E("v-if",!0),(n==null?void 0:n.editing)||n.deleting?(a(),y(d,{key:3,icon:"fa-solid fa-xmark",class:"icon icon-cancel",onClick:L(m=>{n.editing=!1,n.deleting=!1},["stop"])},null,8,["onClick"])):E("v-if",!0)])],10,Jt)}),128))]))),128))]))])}var es=A(Ht,[["render",xt],["__scopeId","data-v-d866c834"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/SidePanel.vue"]]);const ts=N({name:"LayoutChat",components:{SidePanel:es,ElDrawer:Me,ElButton:ye,FontAwesomeIcon:O},data(){return{drawer:!1}}}),ss={class:"main"},ns={class:"side"},os={class:"chat"};function as(e,t,s,u,$,o){const i=l("side-panel"),d=l("font-awesome-icon"),h=l("el-button"),r=l("el-drawer");return a(),p("div",ss,[c("div",ns,[pe(e.$slots,"side",{},()=>[_(i)],!0)]),c("div",os,[pe(e.$slots,"chat",{},void 0,!0)]),_(h,{round:"",class:"menu",onClick:t[0]||(t[0]=g=>e.drawer=!0)},{default:C(()=>[_(d,{icon:"fa-solid fa-bars",class:"icon-menu"})]),_:1}),_(r,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=g=>e.drawer=g),"with-header":!1,size:"290px",class:"drawer"},{default:C(()=>[_(i)]),_:1},8,["modelValue"])])}var is=A(ts,[["render",as],["__scopeId","data-v-8d7a06d2"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Chat.vue"]]);const rs=N({name:"ChatConversation",components:{InputBox:wt,Introduction:Pt,ModelSelector:Rt,Message:mt,ApplicationStatus:ze,Layout:is},data(){var e,t;return{drawer:!1,question:"",references:[],answering:!1,canceler:void 0,messages:((t=(e=this.$store.state.chat.conversations)==null?void 0:e.find(s=>{var u;return s.id===((u=this.$route.params.id)==null?void 0:u.toString())}))==null?void 0:t.messages)||[]}},computed:{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},credential(){var e;return(e=this.$store.state.chat)==null?void 0:e.credential},needApply(){return this.$store.state.chat.status.getApplications===se.Success&&!this.application},conversations(){return this.$store.state.chat.conversations},initializing(){return this.$store.state.chat.status.getApplications===se.Request}},watch:{model(e){e&&this.onModelChanged()},conversationId(e){var t,s;e?(this.messages=((s=(t=this.conversations)==null?void 0:t.find(u=>u.id===e))==null?void 0:s.messages)||[],this.onScrollDown()):this.messages=[]}},async mounted(){await this.onGetService(),await this.onGetApplication(),await this.onGetConversations(),await this.onScrollDown()},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 d,h,r,g,n,k,S,m,v,R,w,U,G,M,P;const t=this.messages.findIndex(f=>f===e),s=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 s.content=="string")this.question=s.content;else if(Array.isArray(s.content))for(let f=0;f<(s==null?void 0:s.content.length);f++)s.content[f].type==="image_url"&&(typeof((h=(d=s==null?void 0:s.content)==null?void 0:d[f])==null?void 0:h.image_url)=="string"?this.references.push((g=(r=s==null?void 0:s.content)==null?void 0:r[f])==null?void 0:g.image_url):this.references.push((S=(k=(n=s==null?void 0:s.content)==null?void 0:n[f])==null?void 0:k.image_url)==null?void 0:S.url)),s.content[f].type==="file_url"&&(typeof((v=(m=s==null?void 0:s.content)==null?void 0:m[f])==null?void 0:v.file_url)=="string"?this.references.push((w=(R=s==null?void 0:s.content)==null?void 0:R[f])==null?void 0:w.file_url):this.references.push((M=(G=(U=s==null?void 0:s.content)==null?void 0:U[f])==null?void 0:G.file_url)==null?void 0:M.url)),s.content[f].type==="text"&&(this.question=s.content[f].text)}console.debug("onRestart!",this.question,JSON.stringify(this.references));const $=(P=this.credential)==null?void 0:P.token,o=this.question;if(!$||!o){console.error("no token or endpoint or question"),this.messages.push({error:{code:Q},role:T,state:I.FAILED});return}let i=this.conversationId;W.updateConversation({id:this.conversationId,messages:u},{token:$}).then(async()=>{await this.$store.dispatch("chat/setConversation",{id:i,messages:this.messages}),console.debug("finished update conversation",this.messages),console.debug("onRestart",this.question),await this.onFetchAnswer()}).catch(f=>{var H,B;if(this.messages&&this.messages.length>0&&(this.messages[this.messages.length-1].state=I.FAILED),console.error(f),Z.isCancel(f))this.messages[this.messages.length-1].error={code:K};else if((H=f==null?void 0:f.response)!=null&&H.data){let q=(B=f==null?void 0:f.response)==null?void 0:B.data;x(q)&&(q=JSON.parse(q)),console.debug("error",q),this.messages&&this.messages.length>0&&(this.messages[this.messages.length-1].error=q.error)}else this.messages&&this.messages.length>0&&(this.messages[this.messages.length-1].error={code:J});this.answering=!1})},async onEdit(e,t){var o;const s=this.messages.findIndex(i=>i===e);s!==-1&&(this.messages=this.messages.slice(0,s)),this.question=t;const u=(o=this.credential)==null?void 0:o.token;if(!u){console.error("no token or endpoint or question"),this.messages.push({error:{code:Q},role:T,state:I.FAILED});return}let $=this.conversationId;W.updateConversation({id:this.conversationId,messages:this.messages},{token:u}).then(async()=>{await this.$store.dispatch("chat/setConversation",{id:$,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.onFetchAnswer()}).catch(i=>{var d,h;if(this.messages&&this.messages.length>0&&(this.messages[this.messages.length-1].state=I.FAILED),console.error(i),Z.isCancel(i))this.messages[this.messages.length-1].error={code:K};else if((d=i==null?void 0:i.response)!=null&&d.data){let r=(h=i==null?void 0:i.response)==null?void 0:h.data;x(r)&&(r=JSON.parse(r)),console.debug("error",r),this.messages&&this.messages.length>0&&(this.messages[this.messages.length-1].error=r.error)}else this.messages&&this.messages.length>0&&(this.messages[this.messages.length-1].error={code:J});this.answering=!1})},async onCreateNewConversation(){await this.$router.push({name:fe})},async onModelChanged(){await this.onCreateNewConversation(),await this.$store.dispatch("chat/getApplications")},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++)this.model.name===X.name?e.push({type:"image_url",image_url:this.references[t]}):this.model.name===Y.name&&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.onFetchAnswer()},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".dialogue");!e||!this.messages||this.messages.length===0||(e.scrollTop=e==null?void 0:e.scrollHeight)},0)},async onFetchAnswer(){var $;console.debug("start to get answer",this.messages);const e=($=this.credential)==null?void 0:$.token,t=this.question,s=this.references;if(console.debug("validated",t,s),this.question="",this.references=[],!e||!t){console.error("no token or endpoint or question"),this.messages.push({error:{code:Q},role:T,state:I.FAILED});return}let u=this.conversationId;this.messages.push({content:"",role:T,state:I.PENDING}),console.debug("start to get answer",this.messages),this.onScrollDown(),this.answering=!0,this.canceler=new AbortController,W.chatConversation({question:t,model:this.model.name,references:s,id:this.conversationId,stateful:!0},{token:e,stream:o=>{console.debug("stream response",o);const i=this.messages[this.messages.length-1];this.messages[this.messages.length-1]={role:T,content:o.answer,state:(i==null?void 0:i.state)!==I.FINISHED?I.ANSWERING:i==null?void 0:i.state},u=o==null?void 0:o.id,this.onScrollDown()},signal:this.canceler.signal}).then(async()=>{console.debug("finished fetch answer",this.messages),this.messages[this.messages.length-1].state=I.FINISHED,console.debug("finished fetch answer",JSON.stringify(this.messages)),await this.$store.dispatch("chat/setConversation",{id:u,messages:this.messages}),this.answering=!1,this.conversationId||await this.$router.push({name:$e,params:{id:u}}),this.onScrollDown(),await this.$store.dispatch("chat/getConversations"),await this.$store.dispatch("chat/getApplications")}).catch(o=>{var i,d;if(this.messages&&this.messages.length>0&&(this.messages[this.messages.length-1].state=I.FAILED),console.error(o),Z.isCancel(o))this.messages[this.messages.length-1].error={code:K};else if((i=o==null?void 0:o.response)!=null&&i.data){let h=(d=o==null?void 0:o.response)==null?void 0:d.data;x(h)&&(h=JSON.parse(h)),console.debug("error",h),this.messages&&this.messages.length>0&&(this.messages[this.messages.length-1].error=h.error)}else this.messages&&this.messages.length>0&&(this.messages[this.messages.length-1].error={code:J});this.answering=!1})}}}),ls={class:"dialogue"},ds={key:1,class:"messages"},cs={class:"bottom"};function us(e,t,s,u,$,o){const i=l("model-selector"),d=l("application-status"),h=l("introduction"),r=l("message"),g=l("input-box"),n=l("layout");return a(),y(n,null,{chat:C(()=>[_(i,{class:"selector"}),_(d,{initializing:e.initializing,application:e.application,"need-apply":e.needApply,service:e.service,onRefresh:t[0]||(t[0]=k=>e.$store.dispatch("chat/getApplications"))},null,8,["initializing","application","need-apply","service"]),c("div",ls,[e.messages.length===0?(a(),y(h,{key:0,onDraft:e.onDraft},null,8,["onDraft"])):(a(),p("div",ds,[(a(!0),p(D,null,V(e.messages,(k,S)=>(a(),y(r,{key:S,message:k,messages:e.messages,question:e.question,application:e.application,class:"message","onUpdate:question":t[1]||(t[1]=m=>e.question=m),onEdit:e.onEdit,onRestart:e.onRestart},null,8,["message","messages","question","application","onEdit","onRestart"]))),128))]))]),c("div",cs,[_(g,{disabled:e.answering,question:e.question,references:e.references,"onUpdate:question":t[2]||(t[2]=k=>e.question=k),"onUpdate:references":t[3]||(t[3]=k=>e.references=k),onSubmit:e.onSubmit,onStop:e.onStop},null,8,["disabled","question","references","onSubmit","onStop"])])]),_:1})}var bs=A(rs,[["render",us],["__scopeId","data-v-3ab2fb26"],["__file","/home/runner/work/Nexior/Nexior/src/pages/chat/Conversation.vue"]]);export{bs as default};
@@ -1 +0,0 @@
1
- .main[data-v-3e896eaa]{flex:1;display:flex;flex-direction:row}.main .config[data-v-3e896eaa]{width:300px;height:100%;overflow-y:scroll;border-right:1px solid var(--el-border-color)}.main .result[data-v-3e896eaa]{padding:15px;flex:1;width:calc(100% - 300px);height:100%;display:flex;flex-direction:column}.menu[data-v-3e896eaa]{display:none}@media (max-width: 767px){.config[data-v-3e896eaa]{display:none}.result[data-v-3e896eaa]{width:100%}.menu[data-v-3e896eaa]{display:block;position:fixed;left:15px;top:15px;z-index:2000}}.field[data-v-69ae8722]{display:flex;flex-direction:row;align-items:center;justify-content:space-between}.field .title[data-v-69ae8722]{font-size:14px;margin:0;width:30%}.field .value[data-v-69ae8722]{flex:1;margin-left:60px}.field .upload-wrapper[data-v-69ae8722]{transform:translate(-26px,5px)}.field .info[data-v-69ae8722]{margin-left:auto}.field[data-v-5ec8e3d9]{display:flex;flex-direction:row;align-items:center}.field .title[data-v-5ec8e3d9]{font-size:14px;margin:0;width:30%}.field .value[data-v-5ec8e3d9]{flex:1}.mode .el-radio-button--small .el-radio-button__inner{padding:8px 11px}.title[data-v-7e0125ad]{font-size:14px;margin-bottom:10px}.pane[data-v-7e0125ad]{display:flex;flex-direction:row;justify-content:left;align-items:center;flex-wrap:wrap;height:auto;max-height:220px;overflow-y:scroll}.pane .item[data-v-7e0125ad]{position:relative;width:70px;height:110px;margin-right:8px;margin-bottom:8px;border-width:3px;border-style:solid;border-color:var(--el-border-color);border-radius:5px;overflow:hidden;cursor:pointer}.pane .item.hidden[data-v-7e0125ad]{display:none}.pane .item.active[data-v-7e0125ad]{border-color:var(--el-color-primary)}.pane .item .preview[data-v-7e0125ad]{width:70px;height:110px}.pane .item .name[data-v-7e0125ad]{position:absolute;bottom:0;left:0;right:0;width:100%;background-color:#00000080;color:#fff;font-size:10px;text-align:center;padding:0 5px}.panel[data-v-6a264fac]{height:100%;padding:15px;display:flex;flex-direction:column}.panel .config[data-v-6a264fac]{width:100%;height:calc(100% - 50px);flex:1}.panel .actions[data-v-6a264fac]{height:50px;display:flex;justify-content:center;align-items:center}.panel .actions .btn[data-v-6a264fac]{width:100%}.image-gallery[data-v-0187109d]{display:flex;justify-content:space-between;gap:16px}.image-container[data-v-0187109d]{position:relative;width:48%;overflow:hidden;border:1px solid #ddd;border-radius:8px}.image-container img[data-v-0187109d]{width:100%;height:auto;display:block;transition:transform .3s ease}.image-container:hover img[data-v-0187109d]{transform:scale(1.05)}.image-container .view-button[data-v-0187109d]{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background-color:#0009;color:#fff;border:none;padding:10px 20px;border-radius:4px;cursor:pointer;opacity:0;transition:opacity .3s ease;transition-delay:.1s}.image-container .view-button[data-v-0187109d]:hover{background-color:#000c}.image-container:hover .view-button[data-v-0187109d]{opacity:1}.preview[data-v-43e1feb8]{width:100%;height:-moz-fit-content;height:fit-content;text-align:left;display:flex;flex-direction:row;margin-bottom:15px}.preview .left[data-v-43e1feb8]{width:70px}.preview .left .avatar[data-v-43e1feb8]{background-color:#4077bc;padding:2px;width:50px;height:50px;margin:10px;border-radius:50%}.preview .main[data-v-43e1feb8]{flex:1;width:calc(100% - 70px);padding:10px 10px 0}.preview .main .bot[data-v-43e1feb8]{font-size:16px;font-weight:700;color:#2ecc71;margin-bottom:0;margin-top:0}.preview .main .bot .datetime[data-v-43e1feb8]{font-size:12px;font-weight:400;color:var(--el-text-color-secondary);margin-left:10px}.preview .main .info .prompt[data-v-43e1feb8]{font-size:14px;font-weight:700;color:var(--el-text-color-regular);margin-bottom:10px}.preview .main .content .el-alert[data-v-43e1feb8]{border-left-width:2px;border-left-style:solid}.preview .main .content .el-alert.failure[data-v-43e1feb8]{border-color:var(--el-color-danger)}.preview .main .content .el-alert.success[data-v-43e1feb8]{border-color:var(--el-color-success)}.preview .main .content .el-alert.info[data-v-43e1feb8]{border-color:var(--el-color-info)}.preview .main .image-wrapper[data-v-43e1feb8]{position:relative;width:-moz-fit-content;width:fit-content;min-height:50px;min-width:100px}.preview .main .image-wrapper .image[data-v-43e1feb8]{max-height:400px;max-width:500px;display:block;width:-moz-fit-content;width:fit-content}.preview .main .image-wrapper .btn-raw[data-v-43e1feb8]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:1000;display:none}.preview .main .image-wrapper .play-icon[data-v-43e1feb8]{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:48px;color:#fff;z-index:500;pointer-events:none}.preview .main .image-wrapper:hover .image[data-v-43e1feb8]{filter:brightness(.6)}.preview .main .image-wrapper:hover .btn-raw[data-v-43e1feb8]{display:block}.preview .main .image-wrapper:hover .play-icon[data-v-43e1feb8]{display:none}.preview .main .operations[data-v-43e1feb8]{display:flex;justify-content:left;flex-direction:row;width:100%;align-items:baseline;flex-wrap:wrap;overflow:hidden;text-align:center;color:var(--el-text-color-regular);font-size:14px;overflow-y:scroll}.preview .main .operations.full[data-v-43e1feb8]{height:70px}.preview .main .operations .btn-action[data-v-43e1feb8]{margin-bottom:10px}.preview .image.error{background:var(--el-bg-color-page)}.preview .image.error .image-slot{font-size:14px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.preview .failure{background:var(--el-fill-color-light);width:100%}.panel[data-v-37920e9a]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%}.panel.recent[data-v-37920e9a]{width:100%;height:100%;display:flex;overflow-y:auto;flex-direction:column}.panel.recent .preview[data-v-37920e9a]{margin-right:15px}.panel.recent .description[data-v-37920e9a]{text-align:left;font-size:14px;color:var(--el-text-color-secondary)}.panel.recent .tasks[data-v-37920e9a]{width:100%}.panel.recent .tasks .task[data-v-37920e9a]{margin-bottom:15px;width:100%;height:-moz-fit-content;height:fit-content;text-align:left}.panel.recent .tasks .task.placeholder[data-v-37920e9a]{display:flex;flex-direction:row}.panel.recent .tasks .task.placeholder .left[data-v-37920e9a]{width:70px;padding:10px}.panel.recent .tasks .task.placeholder .left .avatar[data-v-37920e9a]{width:50px;height:50px;border-radius:50%}.panel.recent .tasks .task.placeholder .main[data-v-37920e9a]{width:calc(100% - 70px);flex:1;padding:10px;margin-bottom:10px}.panel.recent .tasks .task.placeholder .main .icon[data-v-37920e9a]{display:flex;height:200px;width:300px}.panel.recent .tasks .task.placeholder .main .title[data-v-37920e9a]{display:block;width:200px;height:20px;margin-bottom:15px}.panel.recent .tasks .task .operations[data-v-37920e9a]{height:-moz-fit-content!important;height:fit-content!important}.status[data-v-62da1b28]{margin-bottom:10px}.panel.detail[data-v-62da1b28]{width:100%;flex:1;overflow-y:scroll}.panel.recent[data-v-62da1b28]{height:100%;width:100%;margin-bottom:10px;position:relative;justify-content:initial}.panel.operation[data-v-62da1b28]{position:relative}
@@ -1 +0,0 @@
1
- var ce=Object.defineProperty,de=Object.defineProperties;var pe=Object.getOwnPropertyDescriptors;var ie=Object.getOwnPropertySymbols;var ue=Object.prototype.hasOwnProperty,me=Object.prototype.propertyIsEnumerable;var le=(e,s,a)=>s in e?ce(e,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[s]=a,w=(e,s)=>{for(var a in s||(s={}))ue.call(s,a)&&le(e,a,s[a]);if(ie)for(var a of ie(s))me.call(s,a)&&le(e,a,s[a]);return e},I=(e,s)=>de(e,pe(s));import"./vendor-others.de6317ed.js";import{an as B}from"./vendor-fortawesome.1cce8f50.js";import{_ as V,K as he,V as j,B as _e,ax as ge}from"./index.dca36e76.js";import{P as fe,l as M,O as ve,M as C,L as $e,K as ye,U as be,V as ke,s as re,F as we,C as Ie,R as Ve}from"./vendor-element-plus.efc1b383.js";import{H as S,al as l,o,e as r,f as c,I as z,V as t,M as m,U as i,T as f,W as U,ai as G,L as O,S as v,Q as D,m as Se}from"./vendor-@vue.34786d41.js";import{I as Ce}from"./InfoIcon.4dce1fd2.js";import{A as Te,i as Ee,h as Pe}from"./Status.a000ce7d.js";import{C as Ue}from"./CopyToClipboard.2ced8506.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.39cf5eae.js";const Ge=S({name:"LayoutHeadshots",components:{ElDrawer:fe,ElButton:M,FontAwesomeIcon:B},data(){return{drawer:!1}}}),Ne={class:"main"},Ae={class:"config"},Re={class:"result"};function De(e,s,a,d,_,g){const p=l("font-awesome-icon"),h=l("el-button"),n=l("el-drawer");return o(),r("div",Ne,[c("div",Ae,[z(e.$slots,"config",{},void 0,!0)]),c("div",Re,[z(e.$slots,"result",{},void 0,!0)]),t(h,{round:"",class:"menu",onClick:s[0]||(s[0]=u=>e.drawer=!0)},{default:m(()=>[t(p,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),t(n,{modelValue:e.drawer,"onUpdate:modelValue":s[1]||(s[1]=u=>e.drawer=u),"with-header":!1,size:"340px",class:"drawer"},{default:m(()=>[z(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var Le=V(Ge,[["render",De],["__scopeId","data-v-3e896eaa"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Headshots.vue"]]);const Oe=S({name:"ImageUrlsInput",components:{ElUpload:ve,ElButton:M,InfoIcon:Ce},data(){return{fileList:[],uploadUrl:he()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>{var a;return((a=e==null?void 0:e.response)==null?void 0:a.file_url).replace("https://cdn.acedata.cloud","https://acedata-cdn.zhishuyun.com")})},value:{get(){var e,s;return(s=(e=this.$store.state.headshots)==null?void 0:e.config)==null?void 0:s.image_urls},set(e){var a;const s=this.urls;this.$store.commit("headshots/setConfig",I(w({},(a=this.$store.state.headshots)==null?void 0:a.config),{image_urls:s}))}}},mounted(){this.value||(this.value=void 0),this.onSetImageUrls()},methods:{onExceed(){C.warning(this.$t("headshots.message.uploadImageExceed"))},onError(){C.error(this.$t("headshots.message.uploadImageError"))},onSetImageUrls(){var s;const e=this.urls;this.$store.commit("headshots/setConfig",I(w({},(s=this.$store.state.headshots)==null?void 0:s.config),{image_urls:e}))},async onSuccess(){this.onSetImageUrls()}}}),je={class:"field"},ze={class:"title"},Be={class:"upload-wrapper"};function Me(e,s,a,d,_,g){const p=l("el-button"),h=l("el-upload"),n=l("info-icon");return o(),r("div",je,[c("h2",ze,i(e.$t("headshots.name.endImageUrls")),1),c("div",Be,[t(h,{"file-list":e.fileList,"onUpdate:file-list":s[0]||(s[0]=u=>e.fileList=u),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",class:"value","show-file-list":!0,limit:2,multiple:!0,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{default:m(()=>[t(p,{size:"small",type:"primary",round:""},{default:m(()=>[f(i(e.$t("headshots.button.uploadImageUrls")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])]),t(n,{content:e.$t("headshots.description.endImageUrls"),class:"info"},null,8,["content"])])}var qe=V(Oe,[["render",Me],["__scopeId","data-v-69ae8722"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/config/ImageUrlsInput.vue"]]);const Fe="fast",He=S({name:"ModeSelector",components:{ElRadioButton:$e,ElRadioGroup:ye},data(){return{options:[{label:this.$t("headshots.button.fast"),value:"fast"},{label:this.$t("headshots.button.relax"),value:"relax"}]}},computed:{value:{get(){var e;return(e=this.$store.state.headshots.config)==null?void 0:e.mode},set(e){console.debug("set mode",e),this.$store.commit("headshots/setConfig",I(w({},this.$store.state.headshots.config),{mode:e}))}}},mounted(){this.value||(this.value=Fe)}}),Ke={class:"field"},Qe={class:"title"};function We(e,s,a,d,_,g){const p=l("el-radio-button"),h=l("el-radio-group");return o(),r("div",Ke,[c("h2",Qe,i(e.$t("headshots.name.mode")),1),t(h,{modelValue:e.value,"onUpdate:modelValue":s[0]||(s[0]=n=>e.value=n),size:"small",class:"mode"},{default:m(()=>[(o(!0),r(U,null,G(e.options,n=>(o(),O(p,{key:n.value,label:n.value},{default:m(()=>[f(i(n.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])])}var Je=V(He,[["render",We],["__scopeId","data-v-5ec8e3d9"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/config/ModeSelector.vue"]]);const Xe=S({name:"StylizeSelector",components:{ElTabs:be,ElTabPane:ke,ElImage:re},data(){return{tab:"styles",value:"",elements:{styles:{displayName:this.$t("headshots.styleCategory.styles"),items:[{image:"https://static.aipedias.com/aicamera/common/20241008/20241008202314260779439.png",label:this.$t("headshots.styleTag.malePportrait"),value:"male_portrait"},{image:"https://static.aipedias.com/aicamera/common/20241008/202410082022241e9755548.png",label:this.$t("headshots.styleTag.malePportrait2"),value:"male_portrait2"},{image:"https://static.aipedias.com/aicamera/common/20241101/20241101170130d78f66521.png",label:this.$t("headshots.styleTag.kindergarten"),value:"kindergarten"},{image:"https://static.aipedias.com/aicamera/common/20240923/20240923123233accf60398.webp",label:this.$t("headshots.styleTag.logoTshirt"),value:"logo_tshirt"},{image:"https://static.aipedias.com/aicamera/common/20241025/202410252012329472d0656.jpg",label:this.$t("headshots.styleTag.wedding"),value:"wedding"},{image:"https://static.aipedias.com/aicamera/common/20240915/20240915145045254931400.webp",label:this.$t("headshots.styleTag.businessPphoto"),value:"business_photo"},{image:"https://static.aipedias.com/aicamera/common/20240810/20240810194526040341795.jpg",label:this.$t("headshots.styleTag.bobSuit"),value:"bob_suit"},{image:"https://static.aipedias.com/aicamera/common/20240717/20240717152654e0b348173.webp",label:this.$t("headshots.styleTag.femalePortrait"),value:"female_portrait"}]}}}},watch:{value(e){var s;console.debug("set template",e),this.$store.commit("headshots/setConfig",I(w({},(s=this.$store.state.headshots)==null?void 0:s.config),{template:e}))}},mounted(){var e;this.value||(this.value=""),console.debug("set template",this.value),this.$store.commit("headshots/setConfig",I(w({},(e=this.$store.state.headshots)==null?void 0:e.config),{template:this.value}))},methods:{onToggle(e){var s;this.value===e?this.value="":this.value=e,console.debug("set template",this.value),this.$store.commit("headshots/setConfig",I(w({},(s=this.$store.state.headshots)==null?void 0:s.config),{template:this.value}))}}}),Ye={class:"field"},Ze=["onClick"],xe={class:"name"};function es(e,s,a,d,_,g){const p=l("el-image"),h=l("el-tab-pane"),n=l("el-tabs");return o(),r("div",Ye,[v(` <h2 class="title">{{ $t('headshots.field.elements') }}</h2> `),t(n,{modelValue:e.tab,"onUpdate:modelValue":s[0]||(s[0]=u=>e.tab=u)},{default:m(()=>[(o(!0),r(U,null,G(e.elements,(u,$)=>(o(),O(h,{key:$,label:u.displayName,name:$,class:"pane"},{default:m(()=>[(o(!0),r(U,null,G(u.items,(k,T)=>(o(),r("div",{key:T,class:D({item:!0,active:e.value===k.value}),onClick:E=>e.onToggle(k.value)},[t(p,{src:k.image,fit:"fill",class:"preview"},null,8,["src"]),c("span",xe,i(k.label),1)],10,Ze))),128))]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])])}var ss=V(Xe,[["render",es],["__scopeId","data-v-7e0125ad"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/config/ElementsSelector.vue"]]);const ts=S({name:"PresetPanel",components:{ModeSelector:Je,ImageUrlsInput:qe,ElButton:M,FontAwesomeIcon:B,ElementsSelector:ss},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.headshots)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),as={class:"panel"},os={class:"config"},ns={class:"actions"};function is(e,s,a,d,_,g){const p=l("elements-selector"),h=l("mode-selector"),n=l("image-urls-input"),u=l("font-awesome-icon"),$=l("el-button");return o(),r("div",as,[c("div",os,[t(p,{class:"mb-4"}),t(h,{class:"mb-4"}),t(n,{class:"mb-4"}),c("div",ns,[t($,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:m(()=>[t(u,{icon:"fa-solid fa-magic",class:"mr-2"}),f(" "+i(e.$t("headshots.button.generate")),1)]),_:1},8,["onClick"])])])])}var ls=V(ts,[["render",is],["__scopeId","data-v-6a264fac"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/ConfigPanel.vue"]]);const rs=S({name:"ImageGallery",props:{modelValue:{type:Object,required:!0}},setup(e){return{images:Se(()=>{var d,_,g;return((g=(_=(d=e.modelValue)==null?void 0:d.response)==null?void 0:_.data)==null?void 0:g.slice(0,2))||[]}),viewImage:d=>{window.open(d,"_blank")}}}}),cs={class:"image-gallery"},ds=["src"],ps=["onClick"];function us(e,s,a,d,_,g){return o(),r("div",cs,[(o(!0),r(U,null,G(e.images,(p,h)=>(o(),r("div",{key:h,class:"image-container"},[c("img",{src:p.image_url,alt:"Image"},null,8,ds),c("button",{class:"view-button",onClick:n=>e.viewImage(p.image_url)},i(e.$t("headshots.button.viewImage")),9,ps)]))),128))])}var ms=V(rs,[["render",us],["__scopeId","data-v-0187109d"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/ImageGallery.vue"]]);const hs=S({name:"TaskPreview",components:{ElImage:re,CopyToClipboard:Ue,FontAwesomeIcon:B,ElAlert:we,ImageGallery:ms},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){var e;return(e=this.$store.state.headshots)==null?void 0:e.application},config(){var e;return(e=this.$store.state.headshots)==null?void 0:e.config}},methods:{onDownload(e,s){e.stopPropagation(),console.log("on download"),window.open(s,"_blank")},onReload(e){const s=e.target,a=new URL(s.src),d=a.searchParams.get("retry");if(!d)a.searchParams.set("retry","1");else if(parseInt(d)<2)a.searchParams.set("retry",(parseInt(d)+1).toString());else return;s.src=a.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),_s={class:"preview"},gs={class:"left"},fs={class:"main"},vs={class:"bot"},$s={class:"datetime"},ys={class:"info"},bs={key:0,class:"prompt mt-2"},ks={key:0},ws={key:1},Is={key:0,class:D({content:!0,failed:!0})},Vs={class:"image-wrapper"},Ss={class:"description"},Cs={key:1,class:D({content:!0})},Ts={class:"description"},Es={class:"description"},Ps={class:"description"},Us={key:2,class:D({content:!0})},Gs={class:"description"},Ns={key:3,class:D({content:!0})},As={class:"description"};function Rs(e,s,a,d,_,g){var k,T,E,N,A,R,P,L,q,F,H,K,Q,W,J;const p=l("el-image"),h=l("image-gallery"),n=l("font-awesome-icon"),u=l("copy-to-clipboard"),$=l("el-alert");return o(),r("div",_s,[c("div",gs,[t(p,{src:"https://cdn.acedata.cloud/isxyfw.png",class:"avatar"})]),c("div",fs,[c("div",vs,[f(i(e.$t("headshots.name.headshotsBot"))+" ",1),c("span",$s,i(e.$dayjs.format(""+new Date(parseFloat(((k=e.modelValue)==null?void 0:k.created_at)||"")*1e3))),1)]),c("div",ys,[(E=(T=e.modelValue)==null?void 0:T.request)!=null&&E.template?(o(),r("p",bs,[f(i((A=(N=e.modelValue)==null?void 0:N.request)==null?void 0:A.template)+" ",1),(R=e.modelValue)!=null&&R.response?v("v-if",!0):(o(),r("span",ks," - ("+i(e.$t("headshots.status.pending"))+") ",1)),((L=(P=e.modelValue)==null?void 0:P.response)==null?void 0:L.status)==="unknown"?(o(),r("span",ws," - ("+i(e.$t("headshots.status.processing"))+") ",1)):v("v-if",!0)])):v("v-if",!0)]),v(" Display success message "),((F=(q=e.modelValue)==null?void 0:q.response)==null?void 0:F.success)===!0?(o(),r("div",Is,[c("div",Vs,[t(h,{"model-value":e.modelValue},null,8,["model-value"])]),t($,{closable:!1,class:"mt-2 success"},{default:m(()=>{var y,b;return[c("p",Ss,[t(n,{icon:"fa-solid fa-magic",class:"mr-1"}),f(" "+i(e.$t("headshots.name.taskId"))+": "+i((y=e.modelValue)==null?void 0:y.id)+" ",1),t(u,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):v("v-if",!0),v(" Display error message "),((K=(H=e.modelValue)==null?void 0:H.response)==null?void 0:K.success)===!1?(o(),r("div",Cs,[t($,{closable:!1,class:"failure"},{template:m(()=>[t(n,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),f(" "+i(e.$t("headshots.name.failure")),1)]),default:m(()=>{var y,b,X,Y,Z,x,ee,se,te,ae,oe,ne;return[c("p",Ts,[t(n,{icon:"fa-solid fa-magic",class:"mr-1"}),f(" "+i(e.$t("headshots.name.taskId"))+": "+i((y=e.modelValue)==null?void 0:y.id)+" ",1),t(u,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])]),c("p",Es,[t(n,{icon:"fa-solid fa-circle-info",class:"mr-1"}),f(" "+i(e.$t("headshots.name.failureReason"))+": "+i((Z=(Y=(X=e.modelValue)==null?void 0:X.response)==null?void 0:Y.error)==null?void 0:Z.message)+" ",1),t(u,{content:(se=(ee=(x=e.modelValue)==null?void 0:x.response)==null?void 0:ee.error)==null?void 0:se.message,class:"btn-copy"},null,8,["content"])]),c("p",Ps,[t(n,{icon:"fa-solid fa-hashtag",class:"mr-1"}),f(" "+i(e.$t("headshots.name.traceId"))+": "+i((ae=(te=e.modelValue)==null?void 0:te.response)==null?void 0:ae.trace_id)+" ",1),t(u,{content:(ne=(oe=e.modelValue)==null?void 0:oe.response)==null?void 0:ne.trace_id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):v("v-if",!0),v(" Display error message "),(Q=e.modelValue)!=null&&Q.response?v("v-if",!0):(o(),r("div",Us,[t($,{closable:!1,class:"info"},{template:m(()=>[t(n,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),f(" "+i(e.$t("headshots.name.failure")),1)]),default:m(()=>{var y,b;return[c("p",Gs,[t(n,{icon:"fa-solid fa-magic",class:"mr-1"}),f(" "+i(e.$t("headshots.name.taskId"))+": "+i((y=e.modelValue)==null?void 0:y.id)+" ",1),t(u,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])),((J=(W=e.modelValue)==null?void 0:W.response)==null?void 0:J.status)==="unknown"?(o(),r("div",Ns,[t($,{closable:!1,class:"info"},{template:m(()=>[t(n,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),f(" "+i(e.$t("headshots.name.failure")),1)]),default:m(()=>{var y,b;return[c("p",As,[t(n,{icon:"fa-solid fa-magic",class:"mr-1"}),f(" "+i(e.$t("headshots.name.taskId"))+": "+i((y=e.modelValue)==null?void 0:y.id)+" ",1),t(u,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):v("v-if",!0)])])}var Ds=V(hs,[["render",Rs],["__scopeId","data-v-43e1feb8"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/task/Preview.vue"]]);const Ls=S({name:"RecentPanel",components:{TaskPreview:Ds,ElSkeleton:Ie,ElSkeletonItem:Ve},data(){return{job:0}},computed:{tasks(){var e,s,a,d;return I(w({},(e=this.$store.state.headshots)==null?void 0:e.tasks),{items:(d=(a=(s=this.$store.state.headshots)==null?void 0:s.tasks)==null?void 0:a.items)==null?void 0:d.slice().reverse()})}}}),Os={class:"panel recent"},js={key:0,class:"tasks"},zs={class:"left"},Bs={class:"main"},Ms={key:1,class:"tasks"},qs={key:2,class:"description"};function Fs(e,s,a,d,_,g){var u,$,k,T,E,N,A,R;const p=l("el-skeleton-item"),h=l("el-skeleton"),n=l("task-preview");return o(),r("div",Os,[((u=e.tasks)==null?void 0:u.items)===void 0?(o(),r("div",js,[(o(),r(U,null,G(3,P=>c("div",{key:P,class:"task placeholder"},[c("div",zs,[t(h,{animated:""},{template:m(()=>[t(p,{variant:"image",class:"avatar"})]),_:1})]),c("div",Bs,[t(h,{animated:""},{template:m(()=>[t(p,{variant:"p",class:"title"}),t(p,{variant:"image",class:"icon"})]),_:1})])])),64))])):((k=($=e.tasks)==null?void 0:$.items)==null?void 0:k.length)&&((E=(T=e.tasks)==null?void 0:T.items)==null?void 0:E.length)>0?(o(),r("div",Ms,[(o(!0),r(U,null,G((N=e.tasks)==null?void 0:N.items,(P,L)=>(o(),O(n,{key:L,"model-value":P,class:"preview"},null,8,["model-value"]))),128))])):v("v-if",!0),((R=(A=e.tasks)==null?void 0:A.items)==null?void 0:R.length)===0?(o(),r("p",qs,i(e.$t("headshots.message.noTasks")),1)):v("v-if",!0)])}var Hs=V(Ls,[["render",Fs],["__scopeId","data-v-37920e9a"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/RecentPanel.vue"]]);const Ks="https://webhook.acedata.cloud/headshots",Qs=S({name:"HeadshotsIndex",components:{ConfigPanel:ls,Layout:Le,ApplicationStatus:Te,RecentPanel:Hs},data(){return{task:void 0,job:0}},computed:{loading(){var e,s;return((s=(e=this.$store.state.headshots)==null?void 0:e.status)==null?void 0:s.getApplications)===j.Request},service(){return this.$store.state.headshots.service},credential(){return this.$store.state.headshots.credential},config(){return this.$store.state.headshots.config},initializing(){return this.$store.state.headshots.status.getApplications===j.Request},needApply(){return this.$store.state.headshots.status.getApplications===j.Success&&!this.application},application(){return this.$store.state.headshots.application}},async mounted(){await this.onGetService(),await this.onGetApplication(),await this.onScrollDown(),await this.onGetTasks(),await this.onScrollDown(),this.job=setInterval(()=>{this.onGetTasks()},5e3)},async unmounted(){clearInterval(this.job)},methods:{async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("headshots/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("headshots/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},onApply(){_e.create({application:this.application}).then(({data:e})=>{this.application=e,C.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{var s,a;((a=(s=e==null?void 0:e.response)==null?void 0:s.data)==null?void 0:a.code)===Ee&&C.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".recent");e&&(e.scrollTop=e.scrollHeight)},500)},async onGetTasks(){if(this.loading){console.debug("loading");return}await this.$store.dispatch("headshots/getTasks",{limit:30,offset:0})},async onGeneratePicture(){var a;const e=I(w({},this.config),{callback_url:Ks}),s=(a=this.credential)==null?void 0:a.token;if(!s){console.error("no token specified");return}C.info(this.$t("headshots.message.startingTask")),ge.generate(e,{token:s}).then(()=>{C.success(this.$t("headshots.message.startTaskSuccess")),this.$store.commit("headshots/setConfig",{config:void 0})}).catch(d=>{var g,p;const _=(g=d==null?void 0:d.response)==null?void 0:g.data;((p=_==null?void 0:_.error)==null?void 0:p.code)===Pe?C.error(this.$t("headshots.message.usedUp")):C.error(this.$t("headshots.message.startTaskFailed"))}).finally(async()=>{await this.onGetTasks(),await this.onScrollDown()})}}});function Ws(e,s,a,d,_,g){const p=l("config-panel"),h=l("application-status"),n=l("recent-panel"),u=l("layout");return o(),O(u,null,{config:m(()=>[t(p,{onGenerate:e.onGeneratePicture},null,8,["onGenerate"])]),result:m(()=>[t(h,{initializing:e.initializing,application:e.application,service:e.service,"need-apply":e.needApply,class:"mb-4",onRefresh:e.onGetApplication},null,8,["initializing","application","service","need-apply","onRefresh"]),t(n,{class:"panel recent"}),v(' <operation-panel class="panel operation" @generate="onGenerate" /> ')]),_:1})}var it=V(Qs,[["render",Ws],["__scopeId","data-v-62da1b28"],["__file","/home/runner/work/Nexior/Nexior/src/pages/headshots/Index.vue"]]);export{it as default};
@@ -1 +0,0 @@
1
- import"./vendor-others.de6317ed.js";import{h as O,_ as T,c as A,d as R,e as P,f as B,w as H,K as V,R as M}from"./index.dca36e76.js";import{an as L}from"./vendor-fortawesome.1cce8f50.js";import{L as j,D as q}from"./DarkSelector.d3227e0f.js";import{s as D,E as X,t as z,j as F,k as J}from"./vendor-element-plus.efc1b383.js";import{H as U,al as s,o as g,L as E,M as p,V as a,T as N,U as I,S,f as r,e as C,a0 as W,W as G,ai as K,Q}from"./vendor-@vue.34786d41.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.39cf5eae.js";import"./vendor-vue-dark-switch.9acc6f91.js";const Y=U({name:"HelpEntry",components:{ElImage:D,ElDialog:X,ElPopover:z,ElMenu:F,ElMenuItem:J,FontAwesomeIcon:L},props:{visible:{type:Boolean,default:!0}},emits:["close"],computed:{site(){return this.$store.state.site}},methods:{onJoin(){var e,t,n,i;window.open((i=(n=(t=(e=this.$store.state.site)==null?void 0:e.features)==null?void 0:t.support)==null?void 0:n.discord)==null?void 0:i.url,"_blank")},onProfit(){this.$router.push({name:O})}}}),Z={class:"flex"},ee={class:"flex-1 text-center"};function te(e,t,n,i,u,x){const m=s("font-awesome-icon"),l=s("el-menu-item"),f=s("el-image"),_=s("el-popover"),h=s("el-menu"),o=s("el-dialog");return g(),E(o,{"model-value":e.visible,width:200,class:"text-center",onClose:t[0]||(t[0]=c=>e.$emit("close"))},{default:p(()=>[a(h,{collapse:!1,class:"menu"},{default:p(()=>{var c,v,$,k;return[(k=($=(v=(c=e.site)==null?void 0:c.features)==null?void 0:v.support)==null?void 0:$.discord)!=null&&k.enabled?(g(),E(l,{key:0,index:"1",onClick:e.onJoin},{title:p(()=>[N(I(e.$t("common.message.joinDiscord")),1)]),default:p(()=>[a(m,{icon:"fa-brands fa-discord",class:"mr-2"})]),_:1},8,["onClick"])):S("v-if",!0),a(_,{width:350,trigger:"hover"},{reference:p(()=>{var d,w,b,y;return[(y=(b=(w=(d=e.site)==null?void 0:d.features)==null?void 0:w.support)==null?void 0:b.wechat)!=null&&y.enabled?(g(),E(l,{key:0,index:"2"},{title:p(()=>[N(I(e.$t("common.message.addWeChat")),1)]),default:p(()=>[a(m,{icon:"fa-brands fa-weixin",class:"mr-2"})]),_:1})):S("v-if",!0)]}),default:p(()=>{var d,w,b,y;return[r("div",Z,[r("div",ee,[a(f,{src:(y=(b=(w=(d=e.site)==null?void 0:d.features)==null?void 0:w.support)==null?void 0:b.wechat)==null?void 0:y.qr},null,8,["src"])])])]}),_:1})]}),_:1})]),_:1},8,["model-value"])}var oe=T(Y,[["render",te],["__scopeId","data-v-2800d84d"],["__file","/home/runner/work/Nexior/Nexior/src/components/common/HelpDialog.vue"]]);const se=U({name:"ProfileIndex",components:{ElImage:D,HelpDialog:oe,FontAwesomeIcon:L,LocaleSelector:j,DarkSelector:q},data(){return{operating:{locale:!1,dark:!1,help:!1}}},computed:{user(){return this.$store.getters.user},showSupport(){var e,t,n,i,u,x,m,l,f,_,h,o,c,v,$,k,d;return((u=(i=(n=(t=(e=this.$store)==null?void 0:e.state)==null?void 0:t.site)==null?void 0:n.features)==null?void 0:i.support)==null?void 0:u.enabled)&&(((h=(_=(f=(l=(m=(x=this.$store)==null?void 0:x.state)==null?void 0:m.site)==null?void 0:l.features)==null?void 0:f.support)==null?void 0:_.discord)==null?void 0:h.enabled)||((d=(k=($=(v=(c=(o=this.$store)==null?void 0:o.state)==null?void 0:c.site)==null?void 0:v.features)==null?void 0:$.support)==null?void 0:k.wechat)==null?void 0:d.enabled))},showSite(){var e,t,n,i,u;return(u=(n=(t=(e=this.$store)==null?void 0:e.state)==null?void 0:t.site)==null?void 0:n.admins)==null?void 0:u.includes((i=this.$store.getters.user)==null?void 0:i.id)},links(){return[{key:"profile",text:this.$t("console.menu.userProfile"),href:`${A()}/user/profile`,icon:"fa-regular fa-user"},{key:"application-list",text:this.$t("console.menu.applicationList"),name:R,icon:"fa-solid fa-cube"},{key:"order-list",text:this.$t("console.menu.orderList"),name:P,icon:"fa-solid fa-store"},{key:"usage-list",text:this.$t("console.menu.usageList"),name:B,icon:"fa-solid fa-rotate-left"},{key:"distribution-index",text:this.$t("console.menu.distributionIndex"),name:O,icon:"fa-solid fa-coins"},...this.showSite?[{key:"site-index",text:this.$t("common.nav.site"),name:H,icon:"fa-solid fa-gear"}]:[],{key:"dark-setting",text:this.$t("common.nav.darkMode"),icon:"fa-solid fa-moon",callback:()=>{this.operating.dark=!0}},{key:"locale-setting",text:this.$t("common.nav.locale"),icon:"fa-solid fa-language",callback:()=>{this.operating.locale=!0}},{key:"developerPlatform",text:this.$t("console.menu.developerPlatform"),href:V(),icon:"fa-solid fa-laptop-code"},...this.showSupport?[{key:"support",text:this.$t("common.nav.support"),callback:()=>{this.operating.help=!0},icon:"fa-solid fa-question"}]:[],{key:"logout",text:this.$t("common.nav.logOut"),icon:"fa-solid fa-arrow-right-from-bracket",callback:async()=>{await this.$store.dispatch("resetAll"),await this.$store.dispatch("chat/resetAll"),await this.$store.dispatch("midjourney/resetAll"),await this.$store.dispatch("chatdoc/resetAll"),await this.$store.dispatch("qrart/resetAll"),await this.$store.dispatch("login")}}]}},methods:{onHome(){this.$router.push({name:M})},onNavigate(e){e.name?this.$router.push({name:e.name}):e.href?window.open(e.href,"_blank"):e.callback&&e.callback()}}}),ae={class:"profile"},ne={class:"info"},ie={class:"links"},re=["onClick"],le={class:"icon"},ce={class:"text"},de={class:"suffix"};function pe(e,t,n,i,u,x){const m=s("el-image"),l=s("font-awesome-icon"),f=s("locale-selector"),_=s("dark-selector"),h=s("help-dialog");return g(),C("div",ae,[r("div",ne,[a(m,{src:e.user.avatar,fit:"cover",class:"avatar"},null,8,["src"]),r("h2",null,I(e.user.username),1),r("div",{style:W({backgroundImage:"url("+e.user.avatar+")"}),class:"background"},null,4)]),r("div",ie,[(g(!0),C(G,null,K(e.links,(o,c)=>(g(),C("a",{key:c,class:Q({link:!0,active:e.$route.name===o.name}),onClick:v=>e.onNavigate(o)},[r("span",le,[a(l,{icon:o.icon,class:"text-sm"},null,8,["icon"])]),r("span",ce,I(o.text),1),r("span",de,[a(l,{icon:"fa-solid fa-chevron-right",class:"text-sm"})])],10,re))),128))]),a(f,{visible:e.operating.locale==!0,onClose:t[0]||(t[0]=o=>e.operating.locale=!1)},null,8,["visible"]),a(_,{visible:e.operating.dark==!0,onClose:t[1]||(t[1]=o=>e.operating.dark=!1)},null,8,["visible"]),a(h,{visible:e.operating.help==!0,onClose:t[2]||(t[2]=o=>e.operating.help=!1)},null,8,["visible"])])}var we=T(se,[["render",pe],["__scopeId","data-v-0a2212f8"],["__file","/home/runner/work/Nexior/Nexior/src/pages/profile/Index.vue"]]);export{we as default};
@@ -1 +0,0 @@
1
- var m=Object.defineProperty,v=Object.defineProperties;var h=Object.getOwnPropertyDescriptors;var c=Object.getOwnPropertySymbols;var f=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable;var i=(o,e,r)=>e in o?m(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,d=(o,e)=>{for(var r in e||(e={}))f.call(e,r)&&i(o,r,e[r]);if(c)for(var r of c(e))g.call(e,r)&&i(o,r,e[r]);return o},_=(o,e)=>v(o,h(e));import{I as w}from"./vendor-others.de6317ed.js";import{m as k}from"./vendor-markdown.f1450088.js";import{Z as y,$ as M,_ as p}from"./index.dca36e76.js";import{H as u,m as x,ah as b,al as E,av as $,O as q,o as L,L as R}from"./vendor-@vue.34786d41.js";import"./vendor-highlight.js.6ee9ffbc.js";const S=async o=>{const e=(await y(()=>import("./vendor-highlight.js.6ee9ffbc.js"),["assets/vendor-highlight.js.6ee9ffbc.js","assets/vendor-highlight.js.4e8df926.css"])).default;console.debug("highlight.js loaded"),o.querySelectorAll("pre code").forEach(n=>{var s,a;const t=document.createElement("button");t.innerHTML=M.global.t("common.button.copy").toString(),t.addEventListener("click",()=>{w(n.innerText)}),(s=n.parentElement)!=null&&s.querySelector("button")||(a=n.parentElement)==null||a.prepend(t),e.highlightBlock(n)})},T=u({name:"VueMarkdown",props:{source:{type:String,required:!0},options:{type:Object,default:()=>({}),required:!1}},setup(o,{attrs:e}){const r=new k(o.options),n=x(()=>{const t=o.source;return r==null?void 0:r.render(t)});return()=>b("div",_(d({},e),{innerHTML:n.value}))}});var C=p(T,[["__file","/home/runner/work/Nexior/Nexior/src/components/common/VueMarkdown.vue"]]);const I=u({name:"ApiCode",directives:{highlight:S},components:{VueMarkdown:C},props:{content:{type:String,required:!1,default:""}},data(){},watch:{}});function N(o,e,r,n,t,s){const a=E("vue-markdown"),l=$("highlight");return q((L(),R(a,{source:o.content,class:"markdown-body"},null,8,["source"])),[[l]])}var j=p(I,[["render",N],["__scopeId","data-v-8173dc94"],["__file","/home/runner/work/Nexior/Nexior/src/components/common/MarkdownRenderer.vue"]]);export{j as M};