@acedatacloud/nexior 2.14.5 → 2.14.7
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.
- package/dist/assets/{Auth.9d209ffb.js → Auth.b99a2fc5.js} +1 -1
- package/dist/assets/{Buy.16d334fd.js → Buy.442738e8.js} +1 -1
- package/dist/assets/{Buy.ecf0b41e.js → Buy.952500f3.js} +1 -1
- package/dist/assets/{Callback.519e528e.js → Callback.4dbae2f2.js} +1 -1
- package/dist/assets/{Chatdoc.92b9df41.js → Chatdoc.527cbb49.js} +1 -1
- package/dist/assets/{Console.d58c59fd.js → Console.19588ea6.js} +1 -1
- package/dist/assets/{Conversation.abde74f3.css → Conversation.499bd9c5.css} +1 -1
- package/dist/assets/{Conversation.b6002fd3.js → Conversation.7fc85c0a.js} +1 -1
- package/dist/assets/{Conversation.27a7f32f.js → Conversation.8dbad2d5.js} +1 -1
- package/dist/assets/{CopyToClipboard.49c25aa1.js → CopyToClipboard.da42bd6a.js} +1 -1
- package/dist/assets/{DarkSelector.0020d592.js → DarkSelector.d4ce65b4.js} +1 -1
- package/dist/assets/{Detail.035c2f27.js → Detail.d6556cea.js} +1 -1
- package/dist/assets/{History.a47031b2.js → History.8b92a5ec.js} +1 -1
- package/dist/assets/{Index.4c54f382.js → Index.10d06737.js} +1 -1
- package/dist/assets/{Index.439d2636.js → Index.3bbdba8d.js} +1 -1
- package/dist/assets/{Index.23b0fdaa.js → Index.67b8774a.js} +1 -1
- package/dist/assets/{Index.6aac3364.js → Index.6905093f.js} +1 -1
- package/dist/assets/{Index.ce8797cd.js → Index.6fe966e4.js} +1 -1
- package/dist/assets/{Index.d85fa482.js → Index.769cfaa7.js} +1 -1
- package/dist/assets/{Index.fed17efb.js → Index.7f7898cc.js} +1 -1
- package/dist/assets/{Index.677b8d8a.js → Index.8f5c788c.js} +1 -1
- package/dist/assets/{Index.68d4db93.js → Index.90dc1fff.js} +1 -1
- package/dist/assets/{Index.c7071555.js → Index.a19b964c.js} +1 -1
- package/dist/assets/{Index.977e8f7d.js → Index.b98934ed.js} +1 -1
- package/dist/assets/{Index.ca1e236a.js → Index.d873b013.js} +1 -1
- package/dist/assets/Index.eb8f3362.js +1 -0
- package/dist/assets/{InfoIcon.79530078.js → InfoIcon.cab8777c.js} +1 -1
- package/dist/assets/{Invitees.d2ec63d2.js → Invitees.d1772922.js} +1 -1
- package/dist/assets/{List.a7410e8a.js → List.6bde1fe8.js} +1 -1
- package/dist/assets/{List.abb01214.js → List.8ab4c14e.js} +1 -1
- package/dist/assets/{List.5250332a.js → List.f1521cdb.js} +1 -1
- package/dist/assets/{Login.abe1b2d4.js → Login.834b478f.js} +1 -1
- package/dist/assets/{Main.f632cb1e.js → Main.bbec1309.js} +1 -1
- package/dist/assets/{Manage.060074e5.js → Manage.a7697182.js} +1 -1
- package/dist/assets/{MarkdownRenderer.8f35e0c1.js → MarkdownRenderer.e84733d8.js} +1 -1
- package/dist/assets/{Navigator.621791f9.js → Navigator.9c3c8ae0.js} +1 -1
- package/dist/assets/{Pagination.4cf2c8a6.js → Pagination.ec011e25.js} +1 -1
- package/dist/assets/{Setting.790811a9.js → Setting.35cec66a.js} +1 -1
- package/dist/assets/{Status.80964f7e.js → Status.9e8c29ef.js} +1 -1
- package/dist/assets/{distribution.bdaf1394.js → distribution.1cefa2a9.js} +1 -1
- package/dist/assets/{index.d8c35250.js → index.f12167ac.js} +1 -1
- package/dist/assets/{order.602bb27f.js → order.4d777989.js} +1 -1
- package/dist/assets/{price.f32a5455.js → price.14c8385e.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/Index.75abfb77.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./vendor-others.56d45bbc.js";import{P as w}from"./Pagination.
|
|
1
|
+
import"./vendor-others.56d45bbc.js";import{P as w}from"./Pagination.ec011e25.js";import{C as y}from"./CopyToClipboard.da42bd6a.js";import{b as v}from"./distribution.1cefa2a9.js";import{_ as $}from"./index.f12167ac.js";import{g as C}from"./price.14c8385e.js";import{i as H,h as D,y as P,A as S,r as k}from"./vendor-element-plus.0a44791e.js";import{H as E,al as s,av as F,L as _,M as o,o as h,V as e,f as a,U as n,O as N}from"./vendor-@vue.01066951.js";import"./vendor-fortawesome.ea56e829.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.3f236d35.js";const q=E({name:"ConsoleDistributionList",components:{Pagination:w,CopyToClipboard:y,ElRow:H,ElCol:D,ElTable:P,ElTableColumn:S,ElCard:k},data(){return{distributionHistories:[],distributionStatus:void 0,loading:!1,total:void 0,limit:10}},computed:{redirect(){return this.$route.query.redirect},page(){var t;return parseInt(((t=this.$route.query.page)==null?void 0:t.toString())||"1")}},watch:{page:{handler(){this.onFetchData()}}},mounted(){this.onFetchData()},methods:{getPriceString:C,onPageChange(t){var p;this.$router.push({name:(p=this.$route.name)==null?void 0:p.toString(),query:{page:t}})},onFetchData(){this.loading=!0,Promise.all([this.onFetchDistributionHistory()]).finally(()=>{this.loading=!1})},async onFetchDistributionHistory(){const{data:t}=await v.getAll({user_id:this.$store.getters.user.id,ordering:"-created_at",limit:this.limit,offset:(this.page-1)*this.limit});this.distributionHistories=t.items,this.total=t.count}}}),A={class:"title"},B={class:"key"},I={class:"copy"},T={class:"key"},V={class:"copy"},z={class:"price"},L={class:"description"},O={class:"description"},j={class:"created-at"},M={class:"pagination m-v-lg"};function R(t,p,U,G,J,K){const d=s("el-col"),c=s("el-row"),u=s("copy-to-clipboard"),r=s("el-table-column"),m=s("el-table"),f=s("el-card"),g=s("pagination"),b=F("loading");return h(),_(c,{class:"panel"},{default:o(()=>[e(d,{span:24},{default:o(()=>[e(c,null,{default:o(()=>[e(d,{span:24},{default:o(()=>[a("h2",A,n(t.$t("common.title.distributionHistory")),1)]),_:1})]),_:1}),e(c,null,{default:o(()=>[e(d,{span:24},{default:o(()=>[e(f,{shadow:"hover"},{default:o(()=>[N((h(),_(m,{data:t.distributionHistories,stripe:""},{default:o(()=>[e(r,{prop:"id",label:t.$t("distribution.field.id"),"class-name":"text-center",width:"350px"},{default:o(i=>[a("span",B,n(i.row.id),1),a("span",I,[e(u,{content:i.row.id},null,8,["content"])])]),_:1},8,["label"]),e(r,{prop:"id",label:t.$t("distribution.field.userId"),"class-name":"text-center",width:"350px"},{default:o(i=>[a("span",T,n(i.row.user_id),1),a("span",V,[e(u,{content:i.row.user_id},null,8,["content"])])]),_:1},8,["label"]),e(r,{label:t.$t("distribution.field.price"),width:"100px"},{default:o(i=>{var l;return[a("span",z,n(t.getPriceString({value:(l=i.row)==null?void 0:l.price})),1)]}),_:1},8,["label"]),e(r,{label:t.$t("distribution.field.reward"),width:"100px"},{default:o(i=>{var l;return[a("span",L,n(t.getPriceString({value:(l=i.row)==null?void 0:l.reward})),1)]}),_:1},8,["label"]),e(r,{label:t.$t("distribution.field.percentage"),width:"120px"},{default:o(i=>[a("span",O,n(i.row.percentage)+"%",1)]),_:1},8,["label"]),e(r,{label:t.$t("distribution.field.createdAt"),width:"200px"},{default:o(i=>[a("span",j,n(t.$dayjs.format(i.row.created_at)),1)]),_:1},8,["label"])]),_:1},8,["data"])),[[b,t.loading]])]),_:1})]),_:1})]),_:1}),e(c,null,{default:o(()=>[e(d,{span:10,offset:14},{default:o(()=>[a("div",M,[e(g,{"current-page":t.page,"page-size":t.limit,total:t.total,onChange:t.onPageChange},null,8,["current-page","page-size","total","onChange"])])]),_:1})]),_:1})]),_:1})]),_:1})}var st=$(q,[["render",R],["__scopeId","data-v-63f0e9ed"],["__file","/home/runner/work/Nexior/Nexior/src/pages/distribution/History.vue"]]);export{st as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var ce=Object.defineProperty,de=Object.defineProperties;var pe=Object.getOwnPropertyDescriptors;var ie=Object.getOwnPropertySymbols;var me=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable;var le=(e,s,t)=>s in e?ce(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,w=(e,s)=>{for(var t in s||(s={}))me.call(s,t)&&le(e,t,s[t]);if(ie)for(var t of ie(s))ue.call(s,t)&&le(e,t,s[t]);return e},I=(e,s)=>de(e,pe(s));import"./vendor-others.56d45bbc.js";import{aq as z}from"./vendor-fortawesome.ea56e829.js";import{_ as S,U as he,X as O,G as _e,aN as ge}from"./index.d8c35250.js";import{P as fe,l as B,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 Se}from"./vendor-element-plus.0a44791e.js";import{H as T,al as r,o as n,e as c,f as d,I as j,V as a,M as u,U as l,T as f,W as P,ai as U,L as M,S as v,Q as D,m as Te}from"./vendor-@vue.01066951.js";import{I as Ve}from"./InfoIcon.79530078.js";import{A as Ce,i as Ee,h as Ge}from"./Status.80964f7e.js";import{C as Pe}from"./CopyToClipboard.49c25aa1.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.3f236d35.js";const Ue=T({name:"LayoutHeadshots",components:{ElDrawer:fe,ElButton:B,FontAwesomeIcon:z},data(){return{drawer:!1}}}),Ae={class:"main"},Ne={class:"config"},Re={class:"result"};function De(e,s,t,o,_,g){const p=r("font-awesome-icon"),h=r("el-button"),i=r("el-drawer");return n(),c("div",Ae,[d("div",Ne,[j(e.$slots,"config",{},void 0,!0)]),d("div",Re,[j(e.$slots,"result",{},void 0,!0)]),a(h,{round:"",class:"menu",onClick:s[0]||(s[0]=m=>e.drawer=!0)},{default:u(()=>[a(p,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),a(i,{modelValue:e.drawer,"onUpdate:modelValue":s[1]||(s[1]=m=>e.drawer=m),"with-header":!1,size:"340px",class:"drawer"},{default:u(()=>[j(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var Le=S(Ue,[["render",De],["__scopeId","data-v-3e896eaa"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Headshots.vue"]]);const Me=T({name:"ImageUrlsInput",components:{ElUpload:ve,ElButton:B,InfoIcon:Ve},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 s;return(s=e==null?void 0:e.response)==null?void 0:s.file_url})},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 t;const s=this.urls;this.$store.commit("headshots/setConfig",I(w({},(t=this.$store.state.headshots)==null?void 0:t.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()}}}),Oe={class:"field"},je={class:"title"},ze={class:"upload-wrapper"};function Be(e,s,t,o,_,g){const p=r("el-button"),h=r("el-upload"),i=r("info-icon");return n(),c("div",Oe,[d("h2",je,l(e.$t("headshots.name.endImageUrls")),1),d("div",ze,[a(h,{"file-list":e.fileList,"onUpdate:file-list":s[0]||(s[0]=m=>e.fileList=m),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:u(()=>[a(p,{size:"small",type:"primary",round:""},{default:u(()=>[f(l(e.$t("headshots.button.uploadImageUrls")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])]),a(i,{content:e.$t("headshots.description.endImageUrls"),class:"info"},null,8,["content"])])}var qe=S(Me,[["render",Be],["__scopeId","data-v-69ae8722"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/config/ImageUrlsInput.vue"]]);const He="fast",Fe=T({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=He)}}),Ke={class:"field"},Qe={class:"title"};function We(e,s,t,o,_,g){const p=r("el-radio-button"),h=r("el-radio-group");return n(),c("div",Ke,[d("h2",Qe,l(e.$t("headshots.name.mode")),1),a(h,{modelValue:e.value,"onUpdate:modelValue":s[0]||(s[0]=i=>e.value=i),size:"small",class:"mode"},{default:u(()=>[(n(!0),c(P,null,U(e.options,i=>(n(),M(p,{key:i.value,label:i.value},{default:u(()=>[f(l(i.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])])}var Xe=S(Fe,[["render",We],["__scopeId","data-v-5ec8e3d9"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/config/ModeSelector.vue"]]);const Je=T({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,t,o,_,g){const p=r("el-image"),h=r("el-tab-pane"),i=r("el-tabs");return n(),c("div",Ye,[v(` <h2 class="title">{{ $t('headshots.field.elements') }}</h2> `),a(i,{modelValue:e.tab,"onUpdate:modelValue":s[0]||(s[0]=m=>e.tab=m)},{default:u(()=>[(n(!0),c(P,null,U(e.elements,(m,$)=>(n(),M(h,{key:$,label:m.displayName,name:$,class:"pane"},{default:u(()=>[(n(!0),c(P,null,U(m.items,(k,E)=>(n(),c("div",{key:E,class:D({item:!0,active:e.value===k.value}),onClick:G=>e.onToggle(k.value)},[a(p,{src:k.image,fit:"fill",class:"preview"},null,8,["src"]),d("span",xe,l(k.label),1)],10,Ze))),128))]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])])}var ss=S(Je,[["render",es],["__scopeId","data-v-7e0125ad"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/config/ElementsSelector.vue"]]);const ts=T({name:"PresetPanel",components:{ModeSelector:Xe,ImageUrlsInput:qe,ElButton:B,FontAwesomeIcon:z,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,t,o,_,g){const p=r("elements-selector"),h=r("mode-selector"),i=r("image-urls-input"),m=r("font-awesome-icon"),$=r("el-button");return n(),c("div",as,[d("div",os,[a(p,{class:"mb-4"}),a(h,{class:"mb-4"}),a(i,{class:"mb-4"}),d("div",ns,[a($,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:u(()=>[a(m,{icon:"fa-solid fa-magic",class:"mr-2"}),f(" "+l(e.$t("headshots.button.generate")),1)]),_:1},8,["onClick"])])])])}var ls=S(ts,[["render",is],["__scopeId","data-v-6a264fac"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/ConfigPanel.vue"]]);const rs=T({name:"ImageGallery",props:{modelValue:{type:Object,required:!0}},setup(e){return{images:Te(()=>{var o,_,g;return((g=(_=(o=e.modelValue)==null?void 0:o.response)==null?void 0:_.data)==null?void 0:g.slice(0,2))||[]}),viewImage:o=>{window.open(o,"_blank")}}}}),cs={class:"image-gallery"},ds=["src"],ps=["onClick"];function ms(e,s,t,o,_,g){return n(),c("div",cs,[(n(!0),c(P,null,U(e.images,(p,h)=>(n(),c("div",{key:h,class:"image-container"},[d("img",{src:p.image_url,alt:"Image"},null,8,ds),d("button",{class:"view-button",onClick:i=>e.viewImage(p.image_url)},l(e.$t("headshots.button.viewImage")),9,ps)]))),128))])}var us=S(rs,[["render",ms],["__scopeId","data-v-0187109d"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/ImageGallery.vue"]]);const hs=T({name:"TaskPreview",components:{ElImage:re,CopyToClipboard:Pe,FontAwesomeIcon:z,ElAlert:we,ImageGallery:us},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,t=new URL(s.src),o=t.searchParams.get("retry");if(!o)t.searchParams.set("retry","1");else if(parseInt(o)<2)t.searchParams.set("retry",(parseInt(o)+1).toString());else return;s.src=t.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})},Ss={class:"image-wrapper"},Ts={class:"description"},Vs={key:1,class:D({content:!0})},Cs={class:"description"},Es={class:"description"},Gs={class:"description"},Ps={key:2,class:D({content:!0})},Us={class:"description"},As={key:3,class:D({content:!0})},Ns={class:"description"};function Rs(e,s,t,o,_,g){var k,E,G,A,N,R,V,L,q,H,F,K,Q,W,X;const p=r("el-image"),h=r("image-gallery"),i=r("font-awesome-icon"),m=r("copy-to-clipboard"),$=r("el-alert");return n(),c("div",_s,[d("div",gs,[a(p,{src:"https://cdn.acedata.cloud/isxyfw.png",class:"avatar"})]),d("div",fs,[d("div",vs,[f(l(e.$t("headshots.name.headshotsBot"))+" ",1),d("span",$s,l(e.$dayjs.format(""+new Date(parseFloat(((k=e.modelValue)==null?void 0:k.created_at)||"")*1e3))),1)]),d("div",ys,[(G=(E=e.modelValue)==null?void 0:E.request)!=null&&G.template?(n(),c("p",bs,[f(l((N=(A=e.modelValue)==null?void 0:A.request)==null?void 0:N.template)+" ",1),(R=e.modelValue)!=null&&R.response?v("v-if",!0):(n(),c("span",ks," - ("+l(e.$t("headshots.status.pending"))+") ",1)),((L=(V=e.modelValue)==null?void 0:V.response)==null?void 0:L.status)==="unknown"?(n(),c("span",ws," - ("+l(e.$t("headshots.status.processing"))+") ",1)):v("v-if",!0)])):v("v-if",!0)]),v(" Display success message "),((H=(q=e.modelValue)==null?void 0:q.response)==null?void 0:H.success)===!0?(n(),c("div",Is,[d("div",Ss,[a(h,{"model-value":e.modelValue},null,8,["model-value"])]),a($,{closable:!1,class:"mt-2 success"},{default:u(()=>{var y,b;return[d("p",Ts,[a(i,{icon:"fa-solid fa-magic",class:"mr-1"}),f(" "+l(e.$t("headshots.name.taskId"))+": "+l((y=e.modelValue)==null?void 0:y.id)+" ",1),a(m,{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=(F=e.modelValue)==null?void 0:F.response)==null?void 0:K.success)===!1?(n(),c("div",Vs,[a($,{closable:!1,class:"failure"},{template:u(()=>[a(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),f(" "+l(e.$t("headshots.name.failure")),1)]),default:u(()=>{var y,b,J,Y,Z,x,ee,se,te,ae,oe,ne;return[d("p",Cs,[a(i,{icon:"fa-solid fa-magic",class:"mr-1"}),f(" "+l(e.$t("headshots.name.taskId"))+": "+l((y=e.modelValue)==null?void 0:y.id)+" ",1),a(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])]),d("p",Es,[a(i,{icon:"fa-solid fa-circle-info",class:"mr-1"}),f(" "+l(e.$t("headshots.name.failureReason"))+": "+l((Z=(Y=(J=e.modelValue)==null?void 0:J.response)==null?void 0:Y.error)==null?void 0:Z.message)+" ",1),a(m,{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"])]),d("p",Gs,[a(i,{icon:"fa-solid fa-hashtag",class:"mr-1"}),f(" "+l(e.$t("headshots.name.traceId"))+": "+l((ae=(te=e.modelValue)==null?void 0:te.response)==null?void 0:ae.trace_id)+" ",1),a(m,{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):(n(),c("div",Ps,[a($,{closable:!1,class:"info"},{template:u(()=>[a(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),f(" "+l(e.$t("headshots.name.failure")),1)]),default:u(()=>{var y,b;return[d("p",Us,[a(i,{icon:"fa-solid fa-magic",class:"mr-1"}),f(" "+l(e.$t("headshots.name.taskId"))+": "+l((y=e.modelValue)==null?void 0:y.id)+" ",1),a(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])),((X=(W=e.modelValue)==null?void 0:W.response)==null?void 0:X.status)==="unknown"?(n(),c("div",As,[a($,{closable:!1,class:"info"},{template:u(()=>[a(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),f(" "+l(e.$t("headshots.name.failure")),1)]),default:u(()=>{var y,b;return[d("p",Ns,[a(i,{icon:"fa-solid fa-magic",class:"mr-1"}),f(" "+l(e.$t("headshots.name.taskId"))+": "+l((y=e.modelValue)==null?void 0:y.id)+" ",1),a(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):v("v-if",!0)])])}var Ds=S(hs,[["render",Rs],["__scopeId","data-v-43e1feb8"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/task/Preview.vue"]]);const Ls=T({name:"RecentPanel",components:{TaskPreview:Ds,ElSkeleton:Ie,ElSkeletonItem:Se},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){var e,s,t,o;return I(w({},(e=this.$store.state.headshots)==null?void 0:e.tasks),{items:(o=(t=(s=this.$store.state.headshots)==null?void 0:s.tasks)==null?void 0:t.items)==null?void 0:o.slice()})}},methods:{onHandleScroll(){const e=this.$refs.panel;console.log("reach-top reach-top reach-top"),e.scrollTop===0&&this.$emit("reach-top")}}}),Ms={key:0,class:"tasks"},Os={class:"left"},js={class:"main"},zs={key:1,class:"tasks"},Bs={key:2,class:"description"};function qs(e,s,t,o,_,g){var m,$,k,E,G,A,N,R;const p=r("el-skeleton-item"),h=r("el-skeleton"),i=r("task-preview");return n(),c("div",{ref:"panel",class:"panel recent",onScroll:s[0]||(s[0]=(...V)=>e.onHandleScroll&&e.onHandleScroll(...V))},[((m=e.tasks)==null?void 0:m.items)===void 0?(n(),c("div",Ms,[(n(),c(P,null,U(3,V=>d("div",{key:V,class:"task placeholder"},[d("div",Os,[a(h,{animated:""},{template:u(()=>[a(p,{variant:"image",class:"avatar"})]),_:1})]),d("div",js,[a(h,{animated:""},{template:u(()=>[a(p,{variant:"p",class:"title"}),a(p,{variant:"image",class:"icon"})]),_:1})])])),64))])):((k=($=e.tasks)==null?void 0:$.items)==null?void 0:k.length)&&((G=(E=e.tasks)==null?void 0:E.items)==null?void 0:G.length)>0?(n(),c("div",zs,[(n(!0),c(P,null,U((A=e.tasks)==null?void 0:A.items,(V,L)=>(n(),M(i,{key:L,"model-value":V,class:"preview"},null,8,["model-value"]))),128))])):v("v-if",!0),((R=(N=e.tasks)==null?void 0:N.items)==null?void 0:R.length)===0?(n(),c("p",Bs,l(e.$t("headshots.message.noTasks")),1)):v("v-if",!0)],544)}var Hs=S(Ls,[["render",qs],["__scopeId","data-v-37920e9a"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/RecentPanel.vue"]]);const Fs="https://webhook.acedata.cloud/headshots",Ks=T({name:"HeadshotsIndex",components:{ConfigPanel:ls,Layout:Le,ApplicationStatus:Ce,RecentPanel:Hs},data(){return{task:void 0,job:0,timer:void 0}},computed:{loading(){var e,s;return((s=(e=this.$store.state.headshots)==null?void 0:e.status)==null?void 0:s.getApplications)===O.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===O.Request},needApply(){return this.$store.state.headshots.status.getApplications===O.Success&&!this.application},application(){return this.$store.state.headshots.application},tasks(){return this.$store.state.headshots.tasks}},watch:{tasks:{handler(e,s){var t,o;((t=e==null?void 0:e.items)==null?void 0:t.length)>((o=s==null?void 0:s.items)==null?void 0:o.length)&&console.debug("new tasks detected")},deep:!0}},async mounted(){await this.onGetService(),await this.onGetApplication(),await this.onScrollDown(),await this.onGetTasks(),this.job=setInterval(()=>{this.onGetTasks()},5e3)},async unmounted(){clearInterval(this.job),clearInterval(this.timer)},methods:{async onReachTop(){var e,s,t;console.debug("reached top"),await this.onGetTasks({createdAtMax:(t=(s=(e=this.tasks)==null?void 0:e.items)==null?void 0:s[0])==null?void 0:t.created_at})},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,t;((t=(s=e==null?void 0:e.response)==null?void 0:s.data)==null?void 0:t.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(e){if(this.loading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:s=5,createdAtMin:t,createdAtMax:o}=e||{};console.debug("limit",s,"createdAtMin",t,"createdAtMax",o),await this.$store.dispatch("headshots/getTasks",{limit:s,createdAtMin:t,createdAtMax:o})},async onGeneratePicture(){var t;const e=I(w({},this.config),{callback_url:Fs}),s=(t=this.credential)==null?void 0:t.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(o=>{var g,p;const _=(g=o==null?void 0:o.response)==null?void 0:g.data;((p=_==null?void 0:_.error)==null?void 0:p.code)===Ge?C.error(this.$t("headshots.message.usedUp")):C.error(this.$t("headshots.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}});function Qs(e,s,t,o,_,g){const p=r("config-panel"),h=r("application-status"),i=r("recent-panel"),m=r("layout");return n(),M(m,null,{config:u(()=>[a(p,{onGenerate:e.onGeneratePicture},null,8,["onGenerate"])]),result:u(()=>[a(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"]),a(i,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"]),v(' <operation-panel class="panel operation" @generate="onGenerate" /> ')]),_:1})}var nt=S(Ks,[["render",Qs],["__scopeId","data-v-62da1b28"],["__file","/home/runner/work/Nexior/Nexior/src/pages/headshots/Index.vue"]]);export{nt as default};
|
|
1
|
+
var ce=Object.defineProperty,de=Object.defineProperties;var pe=Object.getOwnPropertyDescriptors;var ie=Object.getOwnPropertySymbols;var me=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable;var le=(e,s,t)=>s in e?ce(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,w=(e,s)=>{for(var t in s||(s={}))me.call(s,t)&&le(e,t,s[t]);if(ie)for(var t of ie(s))ue.call(s,t)&&le(e,t,s[t]);return e},I=(e,s)=>de(e,pe(s));import"./vendor-others.56d45bbc.js";import{aq as z}from"./vendor-fortawesome.ea56e829.js";import{_ as S,U as he,X as O,G as _e,aN as ge}from"./index.f12167ac.js";import{P as fe,l as B,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 Se}from"./vendor-element-plus.0a44791e.js";import{H as T,al as r,o as n,e as c,f as d,I as j,V as a,M as u,U as l,T as f,W as P,ai as U,L as M,S as v,Q as D,m as Te}from"./vendor-@vue.01066951.js";import{I as Ve}from"./InfoIcon.cab8777c.js";import{A as Ce,i as Ee,h as Ge}from"./Status.9e8c29ef.js";import{C as Pe}from"./CopyToClipboard.da42bd6a.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.3f236d35.js";const Ue=T({name:"LayoutHeadshots",components:{ElDrawer:fe,ElButton:B,FontAwesomeIcon:z},data(){return{drawer:!1}}}),Ae={class:"main"},Ne={class:"config"},Re={class:"result"};function De(e,s,t,o,_,g){const p=r("font-awesome-icon"),h=r("el-button"),i=r("el-drawer");return n(),c("div",Ae,[d("div",Ne,[j(e.$slots,"config",{},void 0,!0)]),d("div",Re,[j(e.$slots,"result",{},void 0,!0)]),a(h,{round:"",class:"menu",onClick:s[0]||(s[0]=m=>e.drawer=!0)},{default:u(()=>[a(p,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),a(i,{modelValue:e.drawer,"onUpdate:modelValue":s[1]||(s[1]=m=>e.drawer=m),"with-header":!1,size:"340px",class:"drawer"},{default:u(()=>[j(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var Le=S(Ue,[["render",De],["__scopeId","data-v-3e896eaa"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Headshots.vue"]]);const Me=T({name:"ImageUrlsInput",components:{ElUpload:ve,ElButton:B,InfoIcon:Ve},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 s;return(s=e==null?void 0:e.response)==null?void 0:s.file_url})},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 t;const s=this.urls;this.$store.commit("headshots/setConfig",I(w({},(t=this.$store.state.headshots)==null?void 0:t.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()}}}),Oe={class:"field"},je={class:"title"},ze={class:"upload-wrapper"};function Be(e,s,t,o,_,g){const p=r("el-button"),h=r("el-upload"),i=r("info-icon");return n(),c("div",Oe,[d("h2",je,l(e.$t("headshots.name.endImageUrls")),1),d("div",ze,[a(h,{"file-list":e.fileList,"onUpdate:file-list":s[0]||(s[0]=m=>e.fileList=m),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:u(()=>[a(p,{size:"small",type:"primary",round:""},{default:u(()=>[f(l(e.$t("headshots.button.uploadImageUrls")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])]),a(i,{content:e.$t("headshots.description.endImageUrls"),class:"info"},null,8,["content"])])}var qe=S(Me,[["render",Be],["__scopeId","data-v-69ae8722"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/config/ImageUrlsInput.vue"]]);const He="fast",Fe=T({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=He)}}),Ke={class:"field"},Qe={class:"title"};function We(e,s,t,o,_,g){const p=r("el-radio-button"),h=r("el-radio-group");return n(),c("div",Ke,[d("h2",Qe,l(e.$t("headshots.name.mode")),1),a(h,{modelValue:e.value,"onUpdate:modelValue":s[0]||(s[0]=i=>e.value=i),size:"small",class:"mode"},{default:u(()=>[(n(!0),c(P,null,U(e.options,i=>(n(),M(p,{key:i.value,label:i.value},{default:u(()=>[f(l(i.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])])}var Xe=S(Fe,[["render",We],["__scopeId","data-v-5ec8e3d9"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/config/ModeSelector.vue"]]);const Je=T({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,t,o,_,g){const p=r("el-image"),h=r("el-tab-pane"),i=r("el-tabs");return n(),c("div",Ye,[v(` <h2 class="title">{{ $t('headshots.field.elements') }}</h2> `),a(i,{modelValue:e.tab,"onUpdate:modelValue":s[0]||(s[0]=m=>e.tab=m)},{default:u(()=>[(n(!0),c(P,null,U(e.elements,(m,$)=>(n(),M(h,{key:$,label:m.displayName,name:$,class:"pane"},{default:u(()=>[(n(!0),c(P,null,U(m.items,(k,E)=>(n(),c("div",{key:E,class:D({item:!0,active:e.value===k.value}),onClick:G=>e.onToggle(k.value)},[a(p,{src:k.image,fit:"fill",class:"preview"},null,8,["src"]),d("span",xe,l(k.label),1)],10,Ze))),128))]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])])}var ss=S(Je,[["render",es],["__scopeId","data-v-7e0125ad"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/config/ElementsSelector.vue"]]);const ts=T({name:"PresetPanel",components:{ModeSelector:Xe,ImageUrlsInput:qe,ElButton:B,FontAwesomeIcon:z,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,t,o,_,g){const p=r("elements-selector"),h=r("mode-selector"),i=r("image-urls-input"),m=r("font-awesome-icon"),$=r("el-button");return n(),c("div",as,[d("div",os,[a(p,{class:"mb-4"}),a(h,{class:"mb-4"}),a(i,{class:"mb-4"}),d("div",ns,[a($,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:u(()=>[a(m,{icon:"fa-solid fa-magic",class:"mr-2"}),f(" "+l(e.$t("headshots.button.generate")),1)]),_:1},8,["onClick"])])])])}var ls=S(ts,[["render",is],["__scopeId","data-v-6a264fac"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/ConfigPanel.vue"]]);const rs=T({name:"ImageGallery",props:{modelValue:{type:Object,required:!0}},setup(e){return{images:Te(()=>{var o,_,g;return((g=(_=(o=e.modelValue)==null?void 0:o.response)==null?void 0:_.data)==null?void 0:g.slice(0,2))||[]}),viewImage:o=>{window.open(o,"_blank")}}}}),cs={class:"image-gallery"},ds=["src"],ps=["onClick"];function ms(e,s,t,o,_,g){return n(),c("div",cs,[(n(!0),c(P,null,U(e.images,(p,h)=>(n(),c("div",{key:h,class:"image-container"},[d("img",{src:p.image_url,alt:"Image"},null,8,ds),d("button",{class:"view-button",onClick:i=>e.viewImage(p.image_url)},l(e.$t("headshots.button.viewImage")),9,ps)]))),128))])}var us=S(rs,[["render",ms],["__scopeId","data-v-0187109d"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/ImageGallery.vue"]]);const hs=T({name:"TaskPreview",components:{ElImage:re,CopyToClipboard:Pe,FontAwesomeIcon:z,ElAlert:we,ImageGallery:us},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,t=new URL(s.src),o=t.searchParams.get("retry");if(!o)t.searchParams.set("retry","1");else if(parseInt(o)<2)t.searchParams.set("retry",(parseInt(o)+1).toString());else return;s.src=t.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})},Ss={class:"image-wrapper"},Ts={class:"description"},Vs={key:1,class:D({content:!0})},Cs={class:"description"},Es={class:"description"},Gs={class:"description"},Ps={key:2,class:D({content:!0})},Us={class:"description"},As={key:3,class:D({content:!0})},Ns={class:"description"};function Rs(e,s,t,o,_,g){var k,E,G,A,N,R,V,L,q,H,F,K,Q,W,X;const p=r("el-image"),h=r("image-gallery"),i=r("font-awesome-icon"),m=r("copy-to-clipboard"),$=r("el-alert");return n(),c("div",_s,[d("div",gs,[a(p,{src:"https://cdn.acedata.cloud/isxyfw.png",class:"avatar"})]),d("div",fs,[d("div",vs,[f(l(e.$t("headshots.name.headshotsBot"))+" ",1),d("span",$s,l(e.$dayjs.format(""+new Date(parseFloat(((k=e.modelValue)==null?void 0:k.created_at)||"")*1e3))),1)]),d("div",ys,[(G=(E=e.modelValue)==null?void 0:E.request)!=null&&G.template?(n(),c("p",bs,[f(l((N=(A=e.modelValue)==null?void 0:A.request)==null?void 0:N.template)+" ",1),(R=e.modelValue)!=null&&R.response?v("v-if",!0):(n(),c("span",ks," - ("+l(e.$t("headshots.status.pending"))+") ",1)),((L=(V=e.modelValue)==null?void 0:V.response)==null?void 0:L.status)==="unknown"?(n(),c("span",ws," - ("+l(e.$t("headshots.status.processing"))+") ",1)):v("v-if",!0)])):v("v-if",!0)]),v(" Display success message "),((H=(q=e.modelValue)==null?void 0:q.response)==null?void 0:H.success)===!0?(n(),c("div",Is,[d("div",Ss,[a(h,{"model-value":e.modelValue},null,8,["model-value"])]),a($,{closable:!1,class:"mt-2 success"},{default:u(()=>{var y,b;return[d("p",Ts,[a(i,{icon:"fa-solid fa-magic",class:"mr-1"}),f(" "+l(e.$t("headshots.name.taskId"))+": "+l((y=e.modelValue)==null?void 0:y.id)+" ",1),a(m,{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=(F=e.modelValue)==null?void 0:F.response)==null?void 0:K.success)===!1?(n(),c("div",Vs,[a($,{closable:!1,class:"failure"},{template:u(()=>[a(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),f(" "+l(e.$t("headshots.name.failure")),1)]),default:u(()=>{var y,b,J,Y,Z,x,ee,se,te,ae,oe,ne;return[d("p",Cs,[a(i,{icon:"fa-solid fa-magic",class:"mr-1"}),f(" "+l(e.$t("headshots.name.taskId"))+": "+l((y=e.modelValue)==null?void 0:y.id)+" ",1),a(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])]),d("p",Es,[a(i,{icon:"fa-solid fa-circle-info",class:"mr-1"}),f(" "+l(e.$t("headshots.name.failureReason"))+": "+l((Z=(Y=(J=e.modelValue)==null?void 0:J.response)==null?void 0:Y.error)==null?void 0:Z.message)+" ",1),a(m,{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"])]),d("p",Gs,[a(i,{icon:"fa-solid fa-hashtag",class:"mr-1"}),f(" "+l(e.$t("headshots.name.traceId"))+": "+l((ae=(te=e.modelValue)==null?void 0:te.response)==null?void 0:ae.trace_id)+" ",1),a(m,{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):(n(),c("div",Ps,[a($,{closable:!1,class:"info"},{template:u(()=>[a(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),f(" "+l(e.$t("headshots.name.failure")),1)]),default:u(()=>{var y,b;return[d("p",Us,[a(i,{icon:"fa-solid fa-magic",class:"mr-1"}),f(" "+l(e.$t("headshots.name.taskId"))+": "+l((y=e.modelValue)==null?void 0:y.id)+" ",1),a(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])),((X=(W=e.modelValue)==null?void 0:W.response)==null?void 0:X.status)==="unknown"?(n(),c("div",As,[a($,{closable:!1,class:"info"},{template:u(()=>[a(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),f(" "+l(e.$t("headshots.name.failure")),1)]),default:u(()=>{var y,b;return[d("p",Ns,[a(i,{icon:"fa-solid fa-magic",class:"mr-1"}),f(" "+l(e.$t("headshots.name.taskId"))+": "+l((y=e.modelValue)==null?void 0:y.id)+" ",1),a(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):v("v-if",!0)])])}var Ds=S(hs,[["render",Rs],["__scopeId","data-v-43e1feb8"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/task/Preview.vue"]]);const Ls=T({name:"RecentPanel",components:{TaskPreview:Ds,ElSkeleton:Ie,ElSkeletonItem:Se},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){var e,s,t,o;return I(w({},(e=this.$store.state.headshots)==null?void 0:e.tasks),{items:(o=(t=(s=this.$store.state.headshots)==null?void 0:s.tasks)==null?void 0:t.items)==null?void 0:o.slice()})}},methods:{onHandleScroll(){const e=this.$refs.panel;console.log("reach-top reach-top reach-top"),e.scrollTop===0&&this.$emit("reach-top")}}}),Ms={key:0,class:"tasks"},Os={class:"left"},js={class:"main"},zs={key:1,class:"tasks"},Bs={key:2,class:"description"};function qs(e,s,t,o,_,g){var m,$,k,E,G,A,N,R;const p=r("el-skeleton-item"),h=r("el-skeleton"),i=r("task-preview");return n(),c("div",{ref:"panel",class:"panel recent",onScroll:s[0]||(s[0]=(...V)=>e.onHandleScroll&&e.onHandleScroll(...V))},[((m=e.tasks)==null?void 0:m.items)===void 0?(n(),c("div",Ms,[(n(),c(P,null,U(3,V=>d("div",{key:V,class:"task placeholder"},[d("div",Os,[a(h,{animated:""},{template:u(()=>[a(p,{variant:"image",class:"avatar"})]),_:1})]),d("div",js,[a(h,{animated:""},{template:u(()=>[a(p,{variant:"p",class:"title"}),a(p,{variant:"image",class:"icon"})]),_:1})])])),64))])):((k=($=e.tasks)==null?void 0:$.items)==null?void 0:k.length)&&((G=(E=e.tasks)==null?void 0:E.items)==null?void 0:G.length)>0?(n(),c("div",zs,[(n(!0),c(P,null,U((A=e.tasks)==null?void 0:A.items,(V,L)=>(n(),M(i,{key:L,"model-value":V,class:"preview"},null,8,["model-value"]))),128))])):v("v-if",!0),((R=(N=e.tasks)==null?void 0:N.items)==null?void 0:R.length)===0?(n(),c("p",Bs,l(e.$t("headshots.message.noTasks")),1)):v("v-if",!0)],544)}var Hs=S(Ls,[["render",qs],["__scopeId","data-v-37920e9a"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/RecentPanel.vue"]]);const Fs="https://webhook.acedata.cloud/headshots",Ks=T({name:"HeadshotsIndex",components:{ConfigPanel:ls,Layout:Le,ApplicationStatus:Ce,RecentPanel:Hs},data(){return{task:void 0,job:0,timer:void 0}},computed:{loading(){var e,s;return((s=(e=this.$store.state.headshots)==null?void 0:e.status)==null?void 0:s.getApplications)===O.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===O.Request},needApply(){return this.$store.state.headshots.status.getApplications===O.Success&&!this.application},application(){return this.$store.state.headshots.application},tasks(){return this.$store.state.headshots.tasks}},watch:{tasks:{handler(e,s){var t,o;((t=e==null?void 0:e.items)==null?void 0:t.length)>((o=s==null?void 0:s.items)==null?void 0:o.length)&&console.debug("new tasks detected")},deep:!0}},async mounted(){await this.onGetService(),await this.onGetApplication(),await this.onScrollDown(),await this.onGetTasks(),this.job=setInterval(()=>{this.onGetTasks()},5e3)},async unmounted(){clearInterval(this.job),clearInterval(this.timer)},methods:{async onReachTop(){var e,s,t;console.debug("reached top"),await this.onGetTasks({createdAtMax:(t=(s=(e=this.tasks)==null?void 0:e.items)==null?void 0:s[0])==null?void 0:t.created_at})},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,t;((t=(s=e==null?void 0:e.response)==null?void 0:s.data)==null?void 0:t.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(e){if(this.loading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:s=5,createdAtMin:t,createdAtMax:o}=e||{};console.debug("limit",s,"createdAtMin",t,"createdAtMax",o),await this.$store.dispatch("headshots/getTasks",{limit:s,createdAtMin:t,createdAtMax:o})},async onGeneratePicture(){var t;const e=I(w({},this.config),{callback_url:Fs}),s=(t=this.credential)==null?void 0:t.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(o=>{var g,p;const _=(g=o==null?void 0:o.response)==null?void 0:g.data;((p=_==null?void 0:_.error)==null?void 0:p.code)===Ge?C.error(this.$t("headshots.message.usedUp")):C.error(this.$t("headshots.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}});function Qs(e,s,t,o,_,g){const p=r("config-panel"),h=r("application-status"),i=r("recent-panel"),m=r("layout");return n(),M(m,null,{config:u(()=>[a(p,{onGenerate:e.onGeneratePicture},null,8,["onGenerate"])]),result:u(()=>[a(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"]),a(i,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"]),v(' <operation-panel class="panel operation" @generate="onGenerate" /> ')]),_:1})}var nt=S(Ks,[["render",Qs],["__scopeId","data-v-62da1b28"],["__file","/home/runner/work/Nexior/Nexior/src/pages/headshots/Index.vue"]]);export{nt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var ce=Object.defineProperty,ue=Object.defineProperties;var pe=Object.getOwnPropertyDescriptors;var ie=Object.getOwnPropertySymbols;var de=Object.prototype.hasOwnProperty,me=Object.prototype.propertyIsEnumerable;var le=(e,t,o)=>t in e?ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,C=(e,t)=>{for(var o in t||(t={}))de.call(t,o)&&le(e,o,t[o]);if(ie)for(var o of ie(t))me.call(t,o)&&le(e,o,t[o]);return e},E=(e,t)=>ue(e,pe(t));import{K as _e}from"./vendor-others.56d45bbc.js";import{aq as H}from"./vendor-fortawesome.ea56e829.js";import{_ as S,aL as he,U as fe,X as q,G as ge,aM as $e}from"./index.d8c35250.js";import{P as ve,l as M,w as ye,x as ke,O as we,M as I,N as be,s as Ie,F as Se,u as Ve,C as Pe,R as Ae}from"./vendor-element-plus.0a44791e.js";import{H as V,al as n,o as l,e as m,f as u,I as z,V as s,M as _,U as c,W as D,ai as L,L as T,T as y,S as v,Q as O}from"./vendor-@vue.01066951.js";import{I as re}from"./InfoIcon.79530078.js";import{A as Ce,i as Ee,h as Te}from"./Status.80964f7e.js";import{C as Ue}from"./CopyToClipboard.49c25aa1.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.3f236d35.js";const Re=V({name:"LayoutHailuo",components:{ElDrawer:ve,ElButton:M,FontAwesomeIcon:H},data(){return{drawer:!1}}}),Ge={class:"main"},Ne={class:"config"},De={class:"result"};function Le(e,t,o,a,g,$){const p=n("font-awesome-icon"),d=n("el-button"),r=n("el-drawer");return l(),m("div",Ge,[u("div",Ne,[z(e.$slots,"config",{},void 0,!0)]),u("div",De,[z(e.$slots,"result",{},void 0,!0)]),s(d,{round:"",class:"menu",onClick:t[0]||(t[0]=h=>e.drawer=!0)},{default:_(()=>[s(p,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),s(r,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=h=>e.drawer=h),"with-header":!1,size:"340px",class:"drawer"},{default:_(()=>[z(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var Me=S(Re,[["render",Le],["__scopeId","data-v-3c8363f5"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Hailuo.vue"]]);const Oe=V({name:"ModelSelector",components:{ElSelect:ye,ElOption:ke},data(){return{}},computed:{options(){return[{value:"minimax-t2v",label:this.$t("hailuo.button.model1")},{value:"minimax-i2v",label:this.$t("hailuo.button.model2")}]},value:{get(){var e,t;return(t=(e=this.$store.state.hailuo)==null?void 0:e.config)==null?void 0:t.model},set(e){var t;this.$store.commit("hailuo/setConfig",E(C({},(t=this.$store.state.hailuo)==null?void 0:t.config),{model:e}))}}},mounted(){this.value||(this.value=he)}}),qe={class:"field"},ze={class:"title"},He={class:"float-left"};function je(e,t,o,a,g,$){const p=n("el-option"),d=n("el-select");return l(),m("div",qe,[u("h2",ze,c(e.$t("hailuo.name.model")),1),s(d,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=r=>e.value=r),class:"value",placeholder:e.$t("hailuo.placeholder.select"),clearable:""},{default:_(()=>[(l(!0),m(D,null,L(e.options,r=>(l(),T(p,{key:r.value,label:r.label,value:r.value},{default:_(()=>[u("span",He,c(r.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}var Be=S(Oe,[["render",je],["__scopeId","data-v-62190314"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/config/ModelSelector.vue"]]);const Fe=V({name:"StartImageUrlInput",components:{ElUpload:we,ElButton:M,InfoIcon:re},data(){return{fileList:[],uploadUrl:fe()+"/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})},value:{get(){var e,t;return(t=(e=this.$store.state.hailuo)==null?void 0:e.config)==null?void 0:t.first_image_url},set(e){var o,a;const t=(o=this.urls)==null?void 0:o[0];this.$store.commit("hailuo/setConfig",E(C({},(a=this.$store.state.hailuo)==null?void 0:a.config),{first_image_url:t}))}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){I.warning(this.$t("hailuo.message.uploadStartImageExceed"))},onError(){I.error(this.$t("hailuo.message.uploadStartImageError"))},async onRemove(){I.error(this.$t("hailuo.message.uploadStartImageError"))},onSetStartImageUrl(){var t,o;const e=(t=this.urls)==null?void 0:t[0];this.$store.commit("hailuo/setConfig",E(C({},(o=this.$store.state.hailuo)==null?void 0:o.config),{first_image_url:e}))},async onSuccess(){this.onSetStartImageUrl()}}}),Ke={class:"field"},Qe={class:"title"},We={class:"upload-wrapper"};function Xe(e,t,o,a,g,$){const p=n("el-button"),d=n("el-upload"),r=n("info-icon");return l(),m("div",Ke,[u("h2",Qe,c(e.$t("hailuo.name.startImageUrl")),1),u("div",We,[s(d,{"file-list":e.fileList,"onUpdate:file-list":t[0]||(t[0]=h=>e.fileList=h),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-remove":e.onRemove,"on-success":e.onSuccess,headers:e.headers},{default:_(()=>[s(p,{size:"small",type:"primary",round:""},{default:_(()=>[y(c(e.$t("hailuo.button.uploadStartImageUrl")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-remove","on-success","headers"])]),s(r,{content:e.$t("hailuo.description.startImageUrl"),class:"info"},null,8,["content"])])}var Je=S(Fe,[["render",Xe],["__scopeId","data-v-6c6b80d0"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/config/StartImageUrlInput.vue"]]);const Ye="",Ze=V({name:"PromptInput",components:{ElInput:be,InfoIcon:re},computed:{prompt:{get(){var e,t;return(t=(e=this.$store.state.hailuo)==null?void 0:e.config)==null?void 0:t.prompt},set(e){var t;console.debug("set prompt",e),this.$store.commit("hailuo/setConfig",E(C({},(t=this.$store.state.hailuo)==null?void 0:t.config),{prompt:e}))}}},mounted(){this.value||(this.value=Ye)}}),xe={class:"field"},et={class:"box"},tt={class:"title"};function ot(e,t,o,a,g,$){const p=n("info-icon"),d=n("el-input");return l(),m("div",xe,[u("div",et,[u("h2",tt,c(e.$t("hailuo.name.prompt")),1),s(p,{content:e.$t("hailuo.description.prompt"),class:"info"},null,8,["content"])]),s(d,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=r=>e.prompt=r),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("hailuo.placeholder.prompt"),maxlength:300,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var st=S(Ze,[["render",ot],["__scopeId","data-v-d785889c"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/config/PromptInput.vue"]]);const at=V({name:"PresetPanel",components:{ElButton:M,FontAwesomeIcon:H,PromptInput:st,StartImageUrlInput:Je,ModelSelector:Be},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.hailuo)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),nt={class:"panel"},it={class:"config"},lt={class:"actions"};function rt(e,t,o,a,g,$){var k,b,i;const p=n("prompt-input"),d=n("model-selector"),r=n("start-image-url-input"),h=n("font-awesome-icon"),f=n("el-button");return l(),m("div",nt,[u("div",it,[s(p,{class:"mb-4"}),s(d,{class:"mb-4"}),((k=e.config)==null?void 0:k.model)==="minimax-i2v"?(l(),T(r,{key:0,class:"mb-4"})):v("v-if",!0),u("div",lt,[((b=e.config)==null?void 0:b.video_url)!==void 0||((i=e.config)==null?void 0:i.custom)?(l(),T(f,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:_(()=>[s(h,{icon:"fa-solid fa-magic",class:"mr-2"}),y(" "+c(e.$t("hailuo.button.extend")),1)]),_:1},8,["onClick"])):(l(),T(f,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:_(()=>[s(h,{icon:"fa-solid fa-magic",class:"mr-2"}),y(" "+c(e.$t("hailuo.button.generate")),1)]),_:1},8,["onClick"]))])])])}var ct=S(at,[["render",rt],["__scopeId","data-v-01eef439"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/ConfigPanel.vue"]]);const ut=V({name:"VideoPlayer",components:{VuePlyr:_e},props:{modelValue:{type:Object,required:!0}},data(){return{options:{quality:{default:"1080p"}}}}}),pt=["data-poster"],dt=["src"];function mt(e,t,o,a,g,$){const p=n("vue-plyr");return l(),m("div",null,[s(p,{options:e.options,class:"video"},{default:_(()=>{var d,r;return[u("video",{controls:"",crossorigin:"",playsinline:"","data-poster":(d=e.modelValue)==null?void 0:d.image_url},[u("source",{size:"1080",src:(r=e.modelValue)==null?void 0:r.video_url,type:"video/mp4"},null,8,dt)],8,pt)]}),_:1},8,["options"])])}var _t=S(ut,[["render",mt],["__scopeId","data-v-11ad7a93"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/VideoPlayer.vue"]]);const ht=V({name:"TaskPreview",components:{ElImage:Ie,CopyToClipboard:Ue,FontAwesomeIcon:H,ElAlert:Se,VideoPlayer:_t,ElTooltip:Ve,ElButton:M},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){var e;return(e=this.$store.state.hailuo)==null?void 0:e.application},config(){var e;return(e=this.$store.state.hailuo)==null?void 0:e.config},videos(){var o,a,g,$,p,d,r;let e=[];const t=(a=(o=this.modelValue)==null?void 0:o.request)==null?void 0:a.action;return Array.isArray(($=(g=this.modelValue)==null?void 0:g.response)==null?void 0:$.data)&&((r=(d=(p=this.modelValue)==null?void 0:p.response)==null?void 0:d.data)==null||r.forEach(h=>{let f=h;t&&(f.action=t),e.push(f)})),e}},methods:{onExtend(e,t){var o;e.stopPropagation(),console.debug("set config",t),this.$store.commit("hailuo/setConfig",E(C({},(o=this.$store.state.hailuo)==null?void 0:o.config),{video_id:t.video_id,prompt:t.prompt,action:"extend",thumbnail_url:t.thumbnail_url,video_url:t.video_url}))},onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onReload(e){const t=e.target,o=new URL(t.src),a=o.searchParams.get("retry");if(!a)o.searchParams.set("retry","1");else if(parseInt(a)<2)o.searchParams.set("retry",(parseInt(a)+1).toString());else return;t.src=o.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),ft={class:"left"},gt={class:"main"},$t={class:"bot"},vt={class:"datetime"},yt={class:"info"},kt={key:0,class:"prompt mt-2"},wt={key:0},bt={key:1},It={key:0,class:O({content:!0,failed:!0})},St={class:"image-wrapper"},Vt={key:0,class:O({operations:!0,"mt-2":!0})},Pt={class:"description"},At={key:1,class:O({content:!0})},Ct={class:"description"},Et={class:"description"},Tt={class:"description"},Ut={key:2,class:O({content:!0})},Rt={class:"description"};function Gt(e,t,o,a,g,$){const p=n("el-image"),d=n("VideoPlayer"),r=n("el-button"),h=n("el-tooltip"),f=n("font-awesome-icon"),k=n("copy-to-clipboard"),b=n("el-alert");return l(!0),m(D,null,L(e.videos,(i,G)=>{var U,R,P,N,j,B,F,K,Q,W,X;return l(),m("div",{key:G,class:"preview"},[u("div",ft,[s(p,{src:"https://cdn.acedata.cloud/4tfwwz.png",class:"avatar"})]),u("div",gt,[u("div",$t,[y(c(e.$t("hailuo.name.hailuoBot"))+" ",1),u("span",vt,c(e.$dayjs.format(""+new Date(parseFloat(((U=e.modelValue)==null?void 0:U.created_at)||"")*1e3))),1)]),u("div",yt,[(P=(R=e.modelValue)==null?void 0:R.request)!=null&&P.prompt?(l(),m("p",kt,[y(c((j=(N=e.modelValue)==null?void 0:N.request)==null?void 0:j.prompt)+" ",1),(B=e.modelValue)!=null&&B.response?v("v-if",!0):(l(),m("span",wt," - ("+c(e.$t("hailuo.status.pending"))+") ",1)),(i==null?void 0:i.state)==="processing"||(i==null?void 0:i.state)==="pending"||(i==null?void 0:i.state)==="running"?(l(),m("span",bt," - ("+c(e.$t("hailuo.status.processing"))+") ",1)):v("v-if",!0)])):v("v-if",!0)]),v(" Display success message "),((K=(F=e.modelValue)==null?void 0:F.response)==null?void 0:K.success)===!0?(l(),m("div",It,[u("div",St,[s(d,{"model-value":i},null,8,["model-value"])]),i?(l(),m("div",Vt,[s(h,{class:"box-item",effect:"dark",content:e.$t("hailuo.message.downloadVideo"),placement:"top-start"},{default:_(()=>[s(r,{type:"info",size:"small",class:"btn-action",onClick:w=>e.onDownload(w,i==null?void 0:i.video_url)},{default:_(()=>[y(c(e.$t("hailuo.button.download")),1)]),_:2},1032,["onClick"])]),_:2},1032,["content"])])):v("v-if",!0),s(b,{closable:!1,class:"mt-2 success"},{default:_(()=>{var w,A;return[u("p",Pt,[s(f,{icon:"fa-solid fa-magic",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.taskId"))+": "+c((w=e.modelValue)==null?void 0:w.id)+" ",1),s(k,{content:(A=e.modelValue)==null?void 0:A.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):v("v-if",!0),v(" Display error message "),((W=(Q=e.modelValue)==null?void 0:Q.response)==null?void 0:W.success)===!1?(l(),m("div",At,[s(b,{closable:!1,class:"failure"},{template:_(()=>[s(f,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.failure")),1)]),default:_(()=>{var w,A,J,Y,Z,x,ee,te,oe,se,ae,ne;return[u("p",Ct,[s(f,{icon:"fa-solid fa-magic",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.taskId"))+": "+c((w=e.modelValue)==null?void 0:w.id)+" ",1),s(k,{content:(A=e.modelValue)==null?void 0:A.id,class:"btn-copy"},null,8,["content"])]),u("p",Et,[s(f,{icon:"fa-solid fa-circle-info",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.failureReason"))+": "+c((Z=(Y=(J=e.modelValue)==null?void 0:J.response)==null?void 0:Y.error)==null?void 0:Z.message)+" ",1),s(k,{content:(te=(ee=(x=e.modelValue)==null?void 0:x.response)==null?void 0:ee.error)==null?void 0:te.message,class:"btn-copy"},null,8,["content"])]),u("p",Tt,[s(f,{icon:"fa-solid fa-hashtag",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.traceId"))+": "+c((se=(oe=e.modelValue)==null?void 0:oe.response)==null?void 0:se.trace_id)+" ",1),s(k,{content:(ne=(ae=e.modelValue)==null?void 0:ae.response)==null?void 0:ne.trace_id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):v("v-if",!0),v(" Display error message "),!((X=e.modelValue)!=null&&X.response)||(i==null?void 0:i.state)==="processing"||(i==null?void 0:i.state)==="pending"||(i==null?void 0:i.state)==="running"?(l(),m("div",Ut,[s(b,{closable:!1,class:"info"},{template:_(()=>[s(f,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.failure")),1)]),default:_(()=>{var w,A;return[u("p",Rt,[s(f,{icon:"fa-solid fa-magic",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.taskId"))+": "+c((w=e.modelValue)==null?void 0:w.id)+" ",1),s(k,{content:(A=e.modelValue)==null?void 0:A.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):v("v-if",!0)])])}),128)}var Nt=S(ht,[["render",Gt],["__scopeId","data-v-3f5aedb7"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/task/Preview.vue"]]);const Dt=V({name:"RecentPanel",components:{TaskPreview:Nt,ElSkeleton:Pe,ElSkeletonItem:Ae},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){var e,t,o,a;return E(C({},(e=this.$store.state.hailuo)==null?void 0:e.tasks),{items:(a=(o=(t=this.$store.state.hailuo)==null?void 0:t.tasks)==null?void 0:o.items)==null?void 0:a.slice()})}},methods:{onHandleScroll(){const e=this.$refs.panel;console.log("reach-top reach-top reach-top"),e.scrollTop===0&&this.$emit("reach-top")}}}),Lt={key:0,class:"tasks"},Mt={class:"left"},Ot={class:"main"},qt={key:1,class:"tasks"},zt={key:2,class:"description"};function Ht(e,t,o,a,g,$){var h,f,k,b,i,G,U,R;const p=n("el-skeleton-item"),d=n("el-skeleton"),r=n("task-preview");return l(),m("div",{ref:"panel",class:"panel recent",onScroll:t[0]||(t[0]=(...P)=>e.onHandleScroll&&e.onHandleScroll(...P))},[((h=e.tasks)==null?void 0:h.items)===void 0?(l(),m("div",Lt,[(l(),m(D,null,L(3,P=>u("div",{key:P,class:"task placeholder"},[u("div",Mt,[s(d,{animated:""},{template:_(()=>[s(p,{variant:"image",class:"avatar"})]),_:1})]),u("div",Ot,[s(d,{animated:""},{template:_(()=>[s(p,{variant:"p",class:"title"}),s(p,{variant:"image",class:"icon"})]),_:1})])])),64))])):((k=(f=e.tasks)==null?void 0:f.items)==null?void 0:k.length)&&((i=(b=e.tasks)==null?void 0:b.items)==null?void 0:i.length)>0?(l(),m("div",qt,[(l(!0),m(D,null,L((G=e.tasks)==null?void 0:G.items,(P,N)=>(l(),T(r,{key:N,"model-value":P,class:"preview"},null,8,["model-value"]))),128))])):v("v-if",!0),((R=(U=e.tasks)==null?void 0:U.items)==null?void 0:R.length)===0?(l(),m("p",zt,c(e.$t("hailuo.message.noTasks")),1)):v("v-if",!0)],544)}var jt=S(Dt,[["render",Ht],["__scopeId","data-v-7bff9d40"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/RecentPanel.vue"]]);const Bt="https://webhook.acedata.cloud/hailuo",Ft=V({name:"HailuoIndex",components:{ConfigPanel:ct,Layout:Me,ApplicationStatus:Ce,RecentPanel:jt},data(){return{task:void 0,job:0,timer:void 0}},computed:{loading(){var e,t;return((t=(e=this.$store.state.hailuo)==null?void 0:e.status)==null?void 0:t.getApplications)===q.Request},service(){return this.$store.state.hailuo.service},credential(){return this.$store.state.hailuo.credential},config(){return this.$store.state.hailuo.config},initializing(){return this.$store.state.hailuo.status.getApplications===q.Request},needApply(){return this.$store.state.hailuo.status.getApplications===q.Success&&!this.application},application(){return this.$store.state.hailuo.application},tasks(){return this.$store.state.hailuo.tasks}},watch:{tasks:{handler(e,t){var o,a;((o=e==null?void 0:e.items)==null?void 0:o.length)>((a=t==null?void 0:t.items)==null?void 0:a.length)&&console.debug("new tasks detected")},deep:!0}},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),clearInterval(this.timer)},methods:{async onReachTop(){var e,t,o;console.debug("reached top"),await this.onGetTasks({createdAtMax:(o=(t=(e=this.tasks)==null?void 0:e.items)==null?void 0:t[0])==null?void 0:o.created_at})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("hailuo/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("hailuo/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},onApply(){ge.create({application:this.application}).then(({data:e})=>{this.application=e,I.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{var t,o;((o=(t=e==null?void 0:e.response)==null?void 0:t.data)==null?void 0:o.code)===Ee&&I.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".recent");e&&(e.scrollTop=e.scrollHeight)},500)},async onGetTasks(e){if(this.loading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:o,createdAtMax:a}=e||{};console.debug("limit",t,"createdAtMin",o,"createdAtMax",a),await this.$store.dispatch("hailuo/getTasks",{limit:t,createdAtMin:o,createdAtMax:a})},async onGenerateVideo(){var o;const e=E(C({},this.config),{callback_url:Bt}),t=(o=this.credential)==null?void 0:o.token;if(!t){console.error("no token specified");return}I.info(this.$t("hailuo.message.startingTask")),$e.generate(e,{token:t}).then(()=>{I.success(this.$t("hailuo.message.startTaskSuccess")),this.$store.commit("hailuo/setConfig",{config:void 0})}).catch(a=>{var $,p;const g=($=a==null?void 0:a.response)==null?void 0:$.data;((p=g==null?void 0:g.error)==null?void 0:p.code)===Te?I.error(this.$t("hailuo.message.usedUp")):I.error(this.$t("hailuo.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}});function Kt(e,t,o,a,g,$){const p=n("config-panel"),d=n("application-status"),r=n("recent-panel"),h=n("layout");return l(),T(h,null,{config:_(()=>[s(p,{onGenerate:e.onGenerateVideo},null,8,["onGenerate"])]),result:_(()=>[s(d,{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"]),s(r,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"]),v(' <operation-panel class="panel operation" @generate="onGenerate" /> ')]),_:1})}var ao=S(Ft,[["render",Kt],["__scopeId","data-v-1f8aa246"],["__file","/home/runner/work/Nexior/Nexior/src/pages/hailuo/Index.vue"]]);export{ao as default};
|
|
1
|
+
var ce=Object.defineProperty,ue=Object.defineProperties;var pe=Object.getOwnPropertyDescriptors;var ie=Object.getOwnPropertySymbols;var de=Object.prototype.hasOwnProperty,me=Object.prototype.propertyIsEnumerable;var le=(e,t,o)=>t in e?ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,C=(e,t)=>{for(var o in t||(t={}))de.call(t,o)&&le(e,o,t[o]);if(ie)for(var o of ie(t))me.call(t,o)&&le(e,o,t[o]);return e},E=(e,t)=>ue(e,pe(t));import{K as _e}from"./vendor-others.56d45bbc.js";import{aq as H}from"./vendor-fortawesome.ea56e829.js";import{_ as S,aL as he,U as fe,X as q,G as ge,aM as $e}from"./index.f12167ac.js";import{P as ve,l as M,w as ye,x as ke,O as we,M as I,N as be,s as Ie,F as Se,u as Ve,C as Pe,R as Ae}from"./vendor-element-plus.0a44791e.js";import{H as V,al as n,o as l,e as m,f as u,I as z,V as s,M as _,U as c,W as D,ai as L,L as T,T as y,S as v,Q as O}from"./vendor-@vue.01066951.js";import{I as re}from"./InfoIcon.cab8777c.js";import{A as Ce,i as Ee,h as Te}from"./Status.9e8c29ef.js";import{C as Ue}from"./CopyToClipboard.da42bd6a.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.3f236d35.js";const Re=V({name:"LayoutHailuo",components:{ElDrawer:ve,ElButton:M,FontAwesomeIcon:H},data(){return{drawer:!1}}}),Ge={class:"main"},Ne={class:"config"},De={class:"result"};function Le(e,t,o,a,g,$){const p=n("font-awesome-icon"),d=n("el-button"),r=n("el-drawer");return l(),m("div",Ge,[u("div",Ne,[z(e.$slots,"config",{},void 0,!0)]),u("div",De,[z(e.$slots,"result",{},void 0,!0)]),s(d,{round:"",class:"menu",onClick:t[0]||(t[0]=h=>e.drawer=!0)},{default:_(()=>[s(p,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),s(r,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=h=>e.drawer=h),"with-header":!1,size:"340px",class:"drawer"},{default:_(()=>[z(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var Me=S(Re,[["render",Le],["__scopeId","data-v-3c8363f5"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Hailuo.vue"]]);const Oe=V({name:"ModelSelector",components:{ElSelect:ye,ElOption:ke},data(){return{}},computed:{options(){return[{value:"minimax-t2v",label:this.$t("hailuo.button.model1")},{value:"minimax-i2v",label:this.$t("hailuo.button.model2")}]},value:{get(){var e,t;return(t=(e=this.$store.state.hailuo)==null?void 0:e.config)==null?void 0:t.model},set(e){var t;this.$store.commit("hailuo/setConfig",E(C({},(t=this.$store.state.hailuo)==null?void 0:t.config),{model:e}))}}},mounted(){this.value||(this.value=he)}}),qe={class:"field"},ze={class:"title"},He={class:"float-left"};function je(e,t,o,a,g,$){const p=n("el-option"),d=n("el-select");return l(),m("div",qe,[u("h2",ze,c(e.$t("hailuo.name.model")),1),s(d,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=r=>e.value=r),class:"value",placeholder:e.$t("hailuo.placeholder.select"),clearable:""},{default:_(()=>[(l(!0),m(D,null,L(e.options,r=>(l(),T(p,{key:r.value,label:r.label,value:r.value},{default:_(()=>[u("span",He,c(r.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}var Be=S(Oe,[["render",je],["__scopeId","data-v-62190314"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/config/ModelSelector.vue"]]);const Fe=V({name:"StartImageUrlInput",components:{ElUpload:we,ElButton:M,InfoIcon:re},data(){return{fileList:[],uploadUrl:fe()+"/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})},value:{get(){var e,t;return(t=(e=this.$store.state.hailuo)==null?void 0:e.config)==null?void 0:t.first_image_url},set(e){var o,a;const t=(o=this.urls)==null?void 0:o[0];this.$store.commit("hailuo/setConfig",E(C({},(a=this.$store.state.hailuo)==null?void 0:a.config),{first_image_url:t}))}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){I.warning(this.$t("hailuo.message.uploadStartImageExceed"))},onError(){I.error(this.$t("hailuo.message.uploadStartImageError"))},async onRemove(){I.error(this.$t("hailuo.message.uploadStartImageError"))},onSetStartImageUrl(){var t,o;const e=(t=this.urls)==null?void 0:t[0];this.$store.commit("hailuo/setConfig",E(C({},(o=this.$store.state.hailuo)==null?void 0:o.config),{first_image_url:e}))},async onSuccess(){this.onSetStartImageUrl()}}}),Ke={class:"field"},Qe={class:"title"},We={class:"upload-wrapper"};function Xe(e,t,o,a,g,$){const p=n("el-button"),d=n("el-upload"),r=n("info-icon");return l(),m("div",Ke,[u("h2",Qe,c(e.$t("hailuo.name.startImageUrl")),1),u("div",We,[s(d,{"file-list":e.fileList,"onUpdate:file-list":t[0]||(t[0]=h=>e.fileList=h),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-remove":e.onRemove,"on-success":e.onSuccess,headers:e.headers},{default:_(()=>[s(p,{size:"small",type:"primary",round:""},{default:_(()=>[y(c(e.$t("hailuo.button.uploadStartImageUrl")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-remove","on-success","headers"])]),s(r,{content:e.$t("hailuo.description.startImageUrl"),class:"info"},null,8,["content"])])}var Je=S(Fe,[["render",Xe],["__scopeId","data-v-6c6b80d0"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/config/StartImageUrlInput.vue"]]);const Ye="",Ze=V({name:"PromptInput",components:{ElInput:be,InfoIcon:re},computed:{prompt:{get(){var e,t;return(t=(e=this.$store.state.hailuo)==null?void 0:e.config)==null?void 0:t.prompt},set(e){var t;console.debug("set prompt",e),this.$store.commit("hailuo/setConfig",E(C({},(t=this.$store.state.hailuo)==null?void 0:t.config),{prompt:e}))}}},mounted(){this.value||(this.value=Ye)}}),xe={class:"field"},et={class:"box"},tt={class:"title"};function ot(e,t,o,a,g,$){const p=n("info-icon"),d=n("el-input");return l(),m("div",xe,[u("div",et,[u("h2",tt,c(e.$t("hailuo.name.prompt")),1),s(p,{content:e.$t("hailuo.description.prompt"),class:"info"},null,8,["content"])]),s(d,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=r=>e.prompt=r),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("hailuo.placeholder.prompt"),maxlength:300,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var st=S(Ze,[["render",ot],["__scopeId","data-v-d785889c"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/config/PromptInput.vue"]]);const at=V({name:"PresetPanel",components:{ElButton:M,FontAwesomeIcon:H,PromptInput:st,StartImageUrlInput:Je,ModelSelector:Be},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.hailuo)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),nt={class:"panel"},it={class:"config"},lt={class:"actions"};function rt(e,t,o,a,g,$){var k,b,i;const p=n("prompt-input"),d=n("model-selector"),r=n("start-image-url-input"),h=n("font-awesome-icon"),f=n("el-button");return l(),m("div",nt,[u("div",it,[s(p,{class:"mb-4"}),s(d,{class:"mb-4"}),((k=e.config)==null?void 0:k.model)==="minimax-i2v"?(l(),T(r,{key:0,class:"mb-4"})):v("v-if",!0),u("div",lt,[((b=e.config)==null?void 0:b.video_url)!==void 0||((i=e.config)==null?void 0:i.custom)?(l(),T(f,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:_(()=>[s(h,{icon:"fa-solid fa-magic",class:"mr-2"}),y(" "+c(e.$t("hailuo.button.extend")),1)]),_:1},8,["onClick"])):(l(),T(f,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:_(()=>[s(h,{icon:"fa-solid fa-magic",class:"mr-2"}),y(" "+c(e.$t("hailuo.button.generate")),1)]),_:1},8,["onClick"]))])])])}var ct=S(at,[["render",rt],["__scopeId","data-v-01eef439"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/ConfigPanel.vue"]]);const ut=V({name:"VideoPlayer",components:{VuePlyr:_e},props:{modelValue:{type:Object,required:!0}},data(){return{options:{quality:{default:"1080p"}}}}}),pt=["data-poster"],dt=["src"];function mt(e,t,o,a,g,$){const p=n("vue-plyr");return l(),m("div",null,[s(p,{options:e.options,class:"video"},{default:_(()=>{var d,r;return[u("video",{controls:"",crossorigin:"",playsinline:"","data-poster":(d=e.modelValue)==null?void 0:d.image_url},[u("source",{size:"1080",src:(r=e.modelValue)==null?void 0:r.video_url,type:"video/mp4"},null,8,dt)],8,pt)]}),_:1},8,["options"])])}var _t=S(ut,[["render",mt],["__scopeId","data-v-11ad7a93"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/VideoPlayer.vue"]]);const ht=V({name:"TaskPreview",components:{ElImage:Ie,CopyToClipboard:Ue,FontAwesomeIcon:H,ElAlert:Se,VideoPlayer:_t,ElTooltip:Ve,ElButton:M},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){var e;return(e=this.$store.state.hailuo)==null?void 0:e.application},config(){var e;return(e=this.$store.state.hailuo)==null?void 0:e.config},videos(){var o,a,g,$,p,d,r;let e=[];const t=(a=(o=this.modelValue)==null?void 0:o.request)==null?void 0:a.action;return Array.isArray(($=(g=this.modelValue)==null?void 0:g.response)==null?void 0:$.data)&&((r=(d=(p=this.modelValue)==null?void 0:p.response)==null?void 0:d.data)==null||r.forEach(h=>{let f=h;t&&(f.action=t),e.push(f)})),e}},methods:{onExtend(e,t){var o;e.stopPropagation(),console.debug("set config",t),this.$store.commit("hailuo/setConfig",E(C({},(o=this.$store.state.hailuo)==null?void 0:o.config),{video_id:t.video_id,prompt:t.prompt,action:"extend",thumbnail_url:t.thumbnail_url,video_url:t.video_url}))},onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onReload(e){const t=e.target,o=new URL(t.src),a=o.searchParams.get("retry");if(!a)o.searchParams.set("retry","1");else if(parseInt(a)<2)o.searchParams.set("retry",(parseInt(a)+1).toString());else return;t.src=o.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),ft={class:"left"},gt={class:"main"},$t={class:"bot"},vt={class:"datetime"},yt={class:"info"},kt={key:0,class:"prompt mt-2"},wt={key:0},bt={key:1},It={key:0,class:O({content:!0,failed:!0})},St={class:"image-wrapper"},Vt={key:0,class:O({operations:!0,"mt-2":!0})},Pt={class:"description"},At={key:1,class:O({content:!0})},Ct={class:"description"},Et={class:"description"},Tt={class:"description"},Ut={key:2,class:O({content:!0})},Rt={class:"description"};function Gt(e,t,o,a,g,$){const p=n("el-image"),d=n("VideoPlayer"),r=n("el-button"),h=n("el-tooltip"),f=n("font-awesome-icon"),k=n("copy-to-clipboard"),b=n("el-alert");return l(!0),m(D,null,L(e.videos,(i,G)=>{var U,R,P,N,j,B,F,K,Q,W,X;return l(),m("div",{key:G,class:"preview"},[u("div",ft,[s(p,{src:"https://cdn.acedata.cloud/4tfwwz.png",class:"avatar"})]),u("div",gt,[u("div",$t,[y(c(e.$t("hailuo.name.hailuoBot"))+" ",1),u("span",vt,c(e.$dayjs.format(""+new Date(parseFloat(((U=e.modelValue)==null?void 0:U.created_at)||"")*1e3))),1)]),u("div",yt,[(P=(R=e.modelValue)==null?void 0:R.request)!=null&&P.prompt?(l(),m("p",kt,[y(c((j=(N=e.modelValue)==null?void 0:N.request)==null?void 0:j.prompt)+" ",1),(B=e.modelValue)!=null&&B.response?v("v-if",!0):(l(),m("span",wt," - ("+c(e.$t("hailuo.status.pending"))+") ",1)),(i==null?void 0:i.state)==="processing"||(i==null?void 0:i.state)==="pending"||(i==null?void 0:i.state)==="running"?(l(),m("span",bt," - ("+c(e.$t("hailuo.status.processing"))+") ",1)):v("v-if",!0)])):v("v-if",!0)]),v(" Display success message "),((K=(F=e.modelValue)==null?void 0:F.response)==null?void 0:K.success)===!0?(l(),m("div",It,[u("div",St,[s(d,{"model-value":i},null,8,["model-value"])]),i?(l(),m("div",Vt,[s(h,{class:"box-item",effect:"dark",content:e.$t("hailuo.message.downloadVideo"),placement:"top-start"},{default:_(()=>[s(r,{type:"info",size:"small",class:"btn-action",onClick:w=>e.onDownload(w,i==null?void 0:i.video_url)},{default:_(()=>[y(c(e.$t("hailuo.button.download")),1)]),_:2},1032,["onClick"])]),_:2},1032,["content"])])):v("v-if",!0),s(b,{closable:!1,class:"mt-2 success"},{default:_(()=>{var w,A;return[u("p",Pt,[s(f,{icon:"fa-solid fa-magic",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.taskId"))+": "+c((w=e.modelValue)==null?void 0:w.id)+" ",1),s(k,{content:(A=e.modelValue)==null?void 0:A.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):v("v-if",!0),v(" Display error message "),((W=(Q=e.modelValue)==null?void 0:Q.response)==null?void 0:W.success)===!1?(l(),m("div",At,[s(b,{closable:!1,class:"failure"},{template:_(()=>[s(f,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.failure")),1)]),default:_(()=>{var w,A,J,Y,Z,x,ee,te,oe,se,ae,ne;return[u("p",Ct,[s(f,{icon:"fa-solid fa-magic",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.taskId"))+": "+c((w=e.modelValue)==null?void 0:w.id)+" ",1),s(k,{content:(A=e.modelValue)==null?void 0:A.id,class:"btn-copy"},null,8,["content"])]),u("p",Et,[s(f,{icon:"fa-solid fa-circle-info",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.failureReason"))+": "+c((Z=(Y=(J=e.modelValue)==null?void 0:J.response)==null?void 0:Y.error)==null?void 0:Z.message)+" ",1),s(k,{content:(te=(ee=(x=e.modelValue)==null?void 0:x.response)==null?void 0:ee.error)==null?void 0:te.message,class:"btn-copy"},null,8,["content"])]),u("p",Tt,[s(f,{icon:"fa-solid fa-hashtag",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.traceId"))+": "+c((se=(oe=e.modelValue)==null?void 0:oe.response)==null?void 0:se.trace_id)+" ",1),s(k,{content:(ne=(ae=e.modelValue)==null?void 0:ae.response)==null?void 0:ne.trace_id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):v("v-if",!0),v(" Display error message "),!((X=e.modelValue)!=null&&X.response)||(i==null?void 0:i.state)==="processing"||(i==null?void 0:i.state)==="pending"||(i==null?void 0:i.state)==="running"?(l(),m("div",Ut,[s(b,{closable:!1,class:"info"},{template:_(()=>[s(f,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.failure")),1)]),default:_(()=>{var w,A;return[u("p",Rt,[s(f,{icon:"fa-solid fa-magic",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.taskId"))+": "+c((w=e.modelValue)==null?void 0:w.id)+" ",1),s(k,{content:(A=e.modelValue)==null?void 0:A.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):v("v-if",!0)])])}),128)}var Nt=S(ht,[["render",Gt],["__scopeId","data-v-3f5aedb7"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/task/Preview.vue"]]);const Dt=V({name:"RecentPanel",components:{TaskPreview:Nt,ElSkeleton:Pe,ElSkeletonItem:Ae},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){var e,t,o,a;return E(C({},(e=this.$store.state.hailuo)==null?void 0:e.tasks),{items:(a=(o=(t=this.$store.state.hailuo)==null?void 0:t.tasks)==null?void 0:o.items)==null?void 0:a.slice()})}},methods:{onHandleScroll(){const e=this.$refs.panel;console.log("reach-top reach-top reach-top"),e.scrollTop===0&&this.$emit("reach-top")}}}),Lt={key:0,class:"tasks"},Mt={class:"left"},Ot={class:"main"},qt={key:1,class:"tasks"},zt={key:2,class:"description"};function Ht(e,t,o,a,g,$){var h,f,k,b,i,G,U,R;const p=n("el-skeleton-item"),d=n("el-skeleton"),r=n("task-preview");return l(),m("div",{ref:"panel",class:"panel recent",onScroll:t[0]||(t[0]=(...P)=>e.onHandleScroll&&e.onHandleScroll(...P))},[((h=e.tasks)==null?void 0:h.items)===void 0?(l(),m("div",Lt,[(l(),m(D,null,L(3,P=>u("div",{key:P,class:"task placeholder"},[u("div",Mt,[s(d,{animated:""},{template:_(()=>[s(p,{variant:"image",class:"avatar"})]),_:1})]),u("div",Ot,[s(d,{animated:""},{template:_(()=>[s(p,{variant:"p",class:"title"}),s(p,{variant:"image",class:"icon"})]),_:1})])])),64))])):((k=(f=e.tasks)==null?void 0:f.items)==null?void 0:k.length)&&((i=(b=e.tasks)==null?void 0:b.items)==null?void 0:i.length)>0?(l(),m("div",qt,[(l(!0),m(D,null,L((G=e.tasks)==null?void 0:G.items,(P,N)=>(l(),T(r,{key:N,"model-value":P,class:"preview"},null,8,["model-value"]))),128))])):v("v-if",!0),((R=(U=e.tasks)==null?void 0:U.items)==null?void 0:R.length)===0?(l(),m("p",zt,c(e.$t("hailuo.message.noTasks")),1)):v("v-if",!0)],544)}var jt=S(Dt,[["render",Ht],["__scopeId","data-v-7bff9d40"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/RecentPanel.vue"]]);const Bt="https://webhook.acedata.cloud/hailuo",Ft=V({name:"HailuoIndex",components:{ConfigPanel:ct,Layout:Me,ApplicationStatus:Ce,RecentPanel:jt},data(){return{task:void 0,job:0,timer:void 0}},computed:{loading(){var e,t;return((t=(e=this.$store.state.hailuo)==null?void 0:e.status)==null?void 0:t.getApplications)===q.Request},service(){return this.$store.state.hailuo.service},credential(){return this.$store.state.hailuo.credential},config(){return this.$store.state.hailuo.config},initializing(){return this.$store.state.hailuo.status.getApplications===q.Request},needApply(){return this.$store.state.hailuo.status.getApplications===q.Success&&!this.application},application(){return this.$store.state.hailuo.application},tasks(){return this.$store.state.hailuo.tasks}},watch:{tasks:{handler(e,t){var o,a;((o=e==null?void 0:e.items)==null?void 0:o.length)>((a=t==null?void 0:t.items)==null?void 0:a.length)&&console.debug("new tasks detected")},deep:!0}},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),clearInterval(this.timer)},methods:{async onReachTop(){var e,t,o;console.debug("reached top"),await this.onGetTasks({createdAtMax:(o=(t=(e=this.tasks)==null?void 0:e.items)==null?void 0:t[0])==null?void 0:o.created_at})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("hailuo/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("hailuo/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},onApply(){ge.create({application:this.application}).then(({data:e})=>{this.application=e,I.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{var t,o;((o=(t=e==null?void 0:e.response)==null?void 0:t.data)==null?void 0:o.code)===Ee&&I.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".recent");e&&(e.scrollTop=e.scrollHeight)},500)},async onGetTasks(e){if(this.loading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:o,createdAtMax:a}=e||{};console.debug("limit",t,"createdAtMin",o,"createdAtMax",a),await this.$store.dispatch("hailuo/getTasks",{limit:t,createdAtMin:o,createdAtMax:a})},async onGenerateVideo(){var o;const e=E(C({},this.config),{callback_url:Bt}),t=(o=this.credential)==null?void 0:o.token;if(!t){console.error("no token specified");return}I.info(this.$t("hailuo.message.startingTask")),$e.generate(e,{token:t}).then(()=>{I.success(this.$t("hailuo.message.startTaskSuccess")),this.$store.commit("hailuo/setConfig",{config:void 0})}).catch(a=>{var $,p;const g=($=a==null?void 0:a.response)==null?void 0:$.data;((p=g==null?void 0:g.error)==null?void 0:p.code)===Te?I.error(this.$t("hailuo.message.usedUp")):I.error(this.$t("hailuo.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}});function Kt(e,t,o,a,g,$){const p=n("config-panel"),d=n("application-status"),r=n("recent-panel"),h=n("layout");return l(),T(h,null,{config:_(()=>[s(p,{onGenerate:e.onGenerateVideo},null,8,["onGenerate"])]),result:_(()=>[s(d,{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"]),s(r,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"]),v(' <operation-panel class="panel operation" @generate="onGenerate" /> ')]),_:1})}var ao=S(Ft,[["render",Kt],["__scopeId","data-v-1f8aa246"],["__file","/home/runner/work/Nexior/Nexior/src/pages/hailuo/Index.vue"]]);export{ao as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./vendor-others.56d45bbc.js";import{L as N}from"./Chatdoc.
|
|
1
|
+
import"./vendor-others.56d45bbc.js";import{L as N}from"./Chatdoc.527cbb49.js";import{_ as y,X as g,ak as D}from"./index.f12167ac.js";import{aq as v}from"./vendor-fortawesome.ea56e829.js";import{l as S,E as F,I as B,J as M,N as U,M as u,r as z,i as L,h as T,d as q,e as H,f as O}from"./vendor-element-plus.0a44791e.js";import{H as w,al as o,o as _,e as C,V as t,M as s,T as R,U as r,f as i,W as b,L as $,ai as G,S as J}from"./vendor-@vue.01066951.js";import{A as K}from"./Status.9e8c29ef.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.3f236d35.js";const W=w({name:"CreateRepository",components:{ElButton:S,ElDialog:F,ElForm:B,ElFormItem:M,ElInput:U,FontAwesomeIcon:v},data(){return{dialogVisible:!1,creating:!1,form:{name:"",description:""}}},computed:{},methods:{async onSubmit(){if(!this.form.name){u.error(this.$t("chatdoc.message.nameRequired"));return}this.creating=!0,this.$store.dispatch("chatdoc/createRepository",{name:this.form.name,description:this.form.description}).then(()=>{this.creating=!1,u.success(this.$t("chatdoc.message.createRepositorySuccess")),this.dialogVisible=!1,this.$store.dispatch("chatdoc/getRepositories")}).catch(()=>{this.creating=!1,u.error(this.$t("chatdoc.message.createRepositoryFailed"))})}}});function X(e,a,V,k,E,I){const p=o("el-input"),l=o("el-form-item"),d=o("el-button"),m=o("el-form"),h=o("el-dialog"),f=o("font-awesome-icon");return _(),C(b,null,[t(h,{modelValue:e.dialogVisible,"onUpdate:modelValue":a[2]||(a[2]=n=>e.dialogVisible=n),width:"400px"},{default:s(()=>[t(m,{ref:"form","label-width":"60px"},{default:s(()=>[t(l,{label:e.$t("chatdoc.field.name"),prop:e.form.name},{default:s(()=>[t(p,{modelValue:e.form.name,"onUpdate:modelValue":a[0]||(a[0]=n=>e.form.name=n),placeholder:e.$t("chatdoc.message.inputRepositoryName")},null,8,["modelValue","placeholder"])]),_:1},8,["label","prop"]),t(l,{label:e.$t("chatdoc.field.description"),prop:e.form.description},{default:s(()=>[t(p,{modelValue:e.form.description,"onUpdate:modelValue":a[1]||(a[1]=n=>e.form.description=n),placeholder:e.$t("chatdoc.message.inputRepositoryDescription")},null,8,["modelValue","placeholder"])]),_:1},8,["label","prop"]),t(l,null,{default:s(()=>[t(d,{type:"primary",round:"",onClick:e.onSubmit},{default:s(()=>[R(r(e.$t("common.button.create")),1)]),_:1},8,["onClick"])]),_:1})]),_:1},512)]),_:1},8,["modelValue"]),i("button",{class:"btn btn-create",onClick:a[3]||(a[3]=n=>e.dialogVisible=!0)},[t(f,{icon:["fas","plus"]})])],64)}var j=y(W,[["render",X],["__scopeId","data-v-41eec665"],["__file","/home/runner/work/Nexior/Nexior/src/components/chatdoc/CreateRepository.vue"]]);const P=w({name:"ChatdocKnowledge",components:{Layout:N,ElCard:z,ElRow:L,ElCol:T,CreateRepository:j,FontAwesomeIcon:v,ElDropdown:q,ElDropdownItem:H,ElDropdownMenu:O,ApplicationStatus:K},data(){return{}},computed:{repositories(){return this.$store.state.chatdoc.repositories},needApply(){return this.$store.state.chatdoc.status.getApplications===g.Success&&!this.application},application(){return this.$store.state.chatdoc.application},service(){return this.$store.state.chatdoc.service},initializing(){return this.$store.state.chatdoc.status.getApplications===g.Request}},async mounted(){},methods:{onClick(e){this.$router.push({name:D,params:{repositoryId:e.id}})},onDelete(e){this.$store.dispatch("chatdoc/deleteRepository",{id:e}).then(()=>{u.success(this.$t("chatdoc.message.deleteRepositorySuccess")),this.$store.dispatch("chatdoc/getRepositories")})}}}),Q={class:"wrapper"},Y={class:"title"},Z={class:"introduction"},x={class:"status"},ee={class:"operation"},oe={class:"name"},te={class:"id"},se={class:"description"};function ae(e,a,V,k,E,I){const p=o("application-status"),l=o("create-repository"),d=o("el-card"),m=o("el-col"),h=o("font-awesome-icon");o("el-dropdown-item"),o("el-dropdown-menu"),o("el-dropdown");const f=o("el-row"),n=o("layout");return _(),$(n,null,{chatdoc:s(()=>[i("div",Q,[i("div",Y,r(e.$t("chatdoc.title.repositories")),1),i("div",Z,r(e.$t("chatdoc.message.introductionForRepository")),1),i("div",x,[t(p,{"show-price":!1,initializing:e.initializing,application:e.application,"need-apply":e.needApply,service:e.service,onRefresh:a[0]||(a[0]=c=>e.$store.dispatch("chatdoc/getApplications"))},null,8,["initializing","application","need-apply","service"])]),t(f,{class:"repositories",gutter:15},{default:s(()=>[t(m,{xl:4,md:6,sm:12,xs:24},{default:s(()=>[t(d,{class:"repository text-center",shadow:"hover",onClick:e.onCreate},{default:s(()=>[t(l),i("p",ee,r(e.$t("chatdoc.title.createRepository")),1)]),_:1},8,["onClick"])]),_:1}),(_(!0),C(b,null,G(e.repositories,(c,A)=>(_(),$(m,{key:A,xl:4,md:6,sm:12,xs:24},{default:s(()=>[t(d,{class:"repository",shadow:"hover",onClick:ie=>e.onClick(c)},{default:s(()=>[J("v-if",!0),i("h2",oe,r(c.name),1),i("p",te,[t(h,{icon:["fas","book"]}),R(" ID: "+r(c.id),1)]),i("p",se,r(c.description),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1})])]),_:1})}var he=y(P,[["render",ae],["__scopeId","data-v-52a67922"],["__file","/home/runner/work/Nexior/Nexior/src/pages/chatdoc/Index.vue"]]);export{he as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var Ue=Object.defineProperty,Ce=Object.defineProperties;var Pe=Object.getOwnPropertyDescriptors;var ke=Object.getOwnPropertySymbols;var Le=Object.prototype.hasOwnProperty,Ne=Object.prototype.propertyIsEnumerable;var Ie=(e,t,o)=>t in e?Ue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,w=(e,t)=>{for(var o in t||(t={}))Le.call(t,o)&&Ie(e,o,t[o]);if(ke)for(var o of ke(t))Ne.call(t,o)&&Ie(e,o,t[o]);return e},k=(e,t)=>Ce(e,Pe(t));import{K as Se}from"./vendor-others.56d45bbc.js";import{aq as W}from"./vendor-fortawesome.ea56e829.js";import{_ as I,aD as Ae,aE as Te,aF as Ge,U as X,X as K,G as Re,aG as De}from"./index.d8c35250.js";import{P as ze,l as D,_ as J,O as Y,M as y,N as Oe,s as Fe,F as je,u as qe,C as Be,R as Me}from"./vendor-element-plus.0a44791e.js";import{H as V,al as n,o as r,e as p,f as a,I as Q,V as s,M as m,U as i,T as g,L as A,S as h,Q as H,W as Ve,ai as Ee}from"./vendor-@vue.01066951.js";import{I as R}from"./InfoIcon.79530078.js";import{A as He,i as Ke,h as Qe}from"./Status.80964f7e.js";import{C as We}from"./CopyToClipboard.49c25aa1.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.3f236d35.js";const Xe=V({name:"LayoutLuma",components:{ElDrawer:ze,ElButton:D,FontAwesomeIcon:W},data(){return{drawer:!1}}}),Je={class:"main"},Ye={class:"config"},Ze={class:"result"};function xe(e,t,o,l,f,v){const c=n("font-awesome-icon"),u=n("el-button"),d=n("el-drawer");return r(),p("div",Je,[a("div",Ye,[Q(e.$slots,"config",{},void 0,!0)]),a("div",Ze,[Q(e.$slots,"result",{},void 0,!0)]),s(u,{round:"",class:"menu",onClick:t[0]||(t[0]=_=>e.drawer=!0)},{default:m(()=>[s(c,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),s(d,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=_=>e.drawer=_),"with-header":!1,size:"340px",class:"drawer"},{default:m(()=>[Q(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var et=I(Xe,[["render",xe],["__scopeId","data-v-234cfb9c"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Luma.vue"]]);const tt=V({name:"EnhancementSelector",components:{ElSwitch:J,InfoIcon:R},computed:{value:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.enhancement},set(e){var t;console.debug("set enhancement",e),this.$store.commit("luma/setConfig",k(w({},(t=this.$store.state.luma)==null?void 0:t.config),{enhancement:e}))}}},mounted(){this.value===void 0&&(this.value=Ae)}}),ot={class:"field"},st={class:"title"};function nt(e,t,o,l,f,v){const c=n("el-switch"),u=n("info-icon");return r(),p("div",ot,[a("h2",st,i(e.$t("luma.name.enhancement")),1),s(c,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),class:"value"},null,8,["modelValue"]),s(u,{content:e.$t("luma.description.enhancement"),class:"info"},null,8,["content"])])}var at=I(tt,[["render",nt],["__scopeId","data-v-175365a0"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/EnhancementSelector.vue"]]);const lt=V({name:"CustomSelector",components:{ElSwitch:J,InfoIcon:R},computed:{value:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.custom},set(e){var t;console.debug("set custom",e),this.$store.commit("luma/setConfig",k(w({},(t=this.$store.state.luma)==null?void 0:t.config),{custom:e}))}}},mounted(){this.value===void 0&&(this.value=Te)}}),it={class:"field"},rt={class:"title"};function ct(e,t,o,l,f,v){const c=n("el-switch"),u=n("info-icon");return r(),p("div",it,[a("h2",rt,i(e.$t("luma.name.custom")),1),s(c,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),class:"value"},null,8,["modelValue"]),s(u,{content:e.$t("luma.description.custom"),class:"info"},null,8,["content"])])}var ut=I(lt,[["render",ct],["__scopeId","data-v-5ac2addb"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/CustomSelector.vue"]]);const dt=V({name:"LoopSelector",components:{ElSwitch:J,InfoIcon:R},computed:{value:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.loop},set(e){var t;console.debug("set loop",e),this.$store.commit("luma/setConfig",k(w({},(t=this.$store.state.luma)==null?void 0:t.config),{loop:e}))}}},mounted(){this.value===void 0&&(this.value=Ge)}}),mt={class:"field"},pt={class:"title"};function _t(e,t,o,l,f,v){const c=n("el-switch"),u=n("info-icon");return r(),p("div",mt,[a("h2",pt,i(e.$t("luma.name.loop")),1),s(c,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),class:"value"},null,8,["modelValue"]),s(u,{content:e.$t("luma.description.loop"),class:"info"},null,8,["content"])])}var ft=I(dt,[["render",_t],["__scopeId","data-v-69cccd4e"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/LoopSelector.vue"]]);const ht=V({name:"ContentInput",components:{ElUpload:Y,ElButton:D,InfoIcon:R},data(){return{fileList:[],uploadUrl:X()+"/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})},value:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.end_image_url},set(e){var o,l;const t=(o=this.urls)==null?void 0:o[0];this.$store.commit("luma/setConfig",k(w({},(l=this.$store.state.luma)==null?void 0:l.config),{end_image_url:t}))}}},mounted(){this.value||(this.value=void 0),this.onSetEndImageUrl()},methods:{onExceed(){y.warning(this.$t("luma.message.uploadEndImageExceed"))},onError(){y.error(this.$t("luma.message.uploadEndImageError"))},onSetEndImageUrl(){var t,o;const e=(t=this.urls)==null?void 0:t[0];this.$store.commit("luma/setConfig",k(w({},(o=this.$store.state.luma)==null?void 0:o.config),{end_image_url:e}))},async onSuccess(){this.onSetEndImageUrl()}}}),vt={class:"field"},gt={class:"title"},$t={class:"upload-wrapper"};function yt(e,t,o,l,f,v){const c=n("el-button"),u=n("el-upload"),d=n("info-icon");return r(),p("div",vt,[a("h2",gt,i(e.$t("luma.name.endImageUrl")),1),a("div",$t,[s(u,{"file-list":e.fileList,"onUpdate:file-list":t[0]||(t[0]=_=>e.fileList=_),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{default:m(()=>[s(c,{size:"small",type:"primary",round:""},{default:m(()=>[g(i(e.$t("luma.button.uploadEndImageUrl")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])]),s(d,{content:e.$t("luma.description.endImageUrl"),class:"info"},null,8,["content"])])}var bt=I(ht,[["render",yt],["__scopeId","data-v-97900bb4"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/EndImageUrlInput.vue"]]);const wt=V({name:"StartImageUrlInput",components:{ElUpload:Y,ElButton:D,InfoIcon:R},data(){return{fileList:[],uploadUrl:X()+"/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})},value:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.start_image_url},set(e){var o,l;const t=(o=this.urls)==null?void 0:o[0];this.$store.commit("luma/setConfig",k(w({},(l=this.$store.state.luma)==null?void 0:l.config),{start_image_url:t}))}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){y.warning(this.$t("luma.message.uploadStartImageExceed"))},onError(){y.error(this.$t("luma.message.uploadStartImageError"))},async onRemove(){y.error(this.$t("luma.message.uploadStartImageError"))},onSetStartImageUrl(){var t,o;const e=(t=this.urls)==null?void 0:t[0];this.$store.commit("luma/setConfig",k(w({},(o=this.$store.state.luma)==null?void 0:o.config),{start_image_url:e}))},async onSuccess(){this.onSetStartImageUrl()}}}),kt={class:"field"},It={class:"title"},Vt={class:"upload-wrapper"};function Et(e,t,o,l,f,v){const c=n("el-button"),u=n("el-upload"),d=n("info-icon");return r(),p("div",kt,[a("h2",It,i(e.$t("luma.name.startImageUrl")),1),a("div",Vt,[s(u,{"file-list":e.fileList,"onUpdate:file-list":t[0]||(t[0]=_=>e.fileList=_),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-remove":e.onRemove,"on-success":e.onSuccess,headers:e.headers},{default:m(()=>[s(c,{size:"small",type:"primary",round:""},{default:m(()=>[g(i(e.$t("luma.button.uploadStartImageUrl")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-remove","on-success","headers"])]),s(d,{content:e.$t("luma.description.startImageUrl"),class:"info"},null,8,["content"])])}var St=I(wt,[["render",Et],["__scopeId","data-v-5440a4bf"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/StartImageUrlInput.vue"]]);const Ut=V({name:"UploadVideo",components:{ElUpload:Y,ElButton:D,InfoIcon:R},data(){return{fileList:[],uploadUrl:X()+"/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})},value:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.video_url},set(e){var o,l;const t=(o=this.urls)==null?void 0:o[0];this.$store.commit("luma/setConfig",k(w({},(l=this.$store.state.luma)==null?void 0:l.config),{video_url:t}))}}},mounted(){this.value||(this.value=void 0)},methods:{onExceed(){y.warning(this.$t("luma.message.uploadVideoExceed"))},onError(){y.error(this.$t("luma.message.uploadVideoError"))},beforeUpload(e){const t=e.type==="video/mp4",o=e.size/1024/1024<10;return t?o?!0:(y.error(this.$t("luma.message.uploadVideoSizeExceed")),!1):(y.error(this.$t("luma.message.uploadVideoTypeFailed")),!1)},onSetVideoUrl(){var t,o;const e=(t=this.urls)==null?void 0:t[0];this.$store.commit("luma/setConfig",k(w({},(o=this.$store.state.luma)==null?void 0:o.config),{video_url:e,action:"extend"}))},async onSuccess(){this.onSetVideoUrl()}}}),Ct={class:"field"},Pt={class:"title"},Lt={class:"upload-wrapper"};function Nt(e,t,o,l,f,v){const c=n("el-button"),u=n("el-upload"),d=n("info-icon");return r(),p("div",Ct,[a("h2",Pt,i(e.$t("luma.name.videoUrl")),1),a("div",Lt,[s(u,{"file-list":e.fileList,"onUpdate:file-list":t[0]||(t[0]=_=>e.fileList=_),accept:".mp4",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"before-upload":e.beforeUpload,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{default:m(()=>[s(c,{size:"small",type:"primary",round:""},{default:m(()=>[g(i(e.$t("luma.button.uploadVideoUrl")),1)]),_:1})]),_:1},8,["file-list","action","before-upload","on-exceed","on-error","on-success","headers"])]),s(d,{content:e.$t("luma.description.videoUrl"),class:"info"},null,8,["content"])])}var At=I(Ut,[["render",Nt],["__scopeId","data-v-46c66c9f"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/UploadVideo.vue"]]);const Tt="",Gt=V({name:"PromptInput",components:{ElInput:Oe,InfoIcon:R},computed:{prompt:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.prompt},set(e){var t;console.debug("set prompt",e),this.$store.commit("luma/setConfig",k(w({},(t=this.$store.state.luma)==null?void 0:t.config),{prompt:e}))}}},mounted(){this.value||(this.value=Tt)}}),Rt={class:"field"},Dt={class:"box"},zt={class:"title"};function Ot(e,t,o,l,f,v){const c=n("info-icon"),u=n("el-input");return r(),p("div",Rt,[a("div",Dt,[a("h2",zt,i(e.$t("luma.name.prompt")),1),s(c,{content:e.$t("luma.description.prompt"),class:"info"},null,8,["content"])]),s(u,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=d=>e.prompt=d),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("luma.placeholder.prompt"),maxlength:300,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var Ft=I(Gt,[["render",Ot],["__scopeId","data-v-19a7446b"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/PromptInput.vue"]]);const jt=V({name:"ExtendFromInput",components:{VuePlyr:Se},props:{modelValue:{type:Object,required:!0}},data(){return{options:{quality:{default:"1080p"}}}},computed:{config(){var e;return(e=this.$store.state.luma)==null?void 0:e.config}}}),qt={class:"field"},Bt={class:"box"},Mt={class:"title"},Ht={class:"task"},Kt=["data-poster"],Qt=["src"];function Wt(e,t,o,l,f,v){const c=n("vue-plyr");return r(),p("div",qt,[a("div",Bt,[a("h2",Mt,i(e.$t("luma.name.extend")),1)]),a("div",Ht,[a("div",null,[s(c,{options:e.options,class:"video"},{default:m(()=>{var u,d;return[a("video",{controls:"",crossorigin:"",playsinline:"","data-poster":(u=e.config)==null?void 0:u.thumbnail_url},[a("source",{size:"1080",src:(d=e.config)==null?void 0:d.video_url,type:"video/mp4"},null,8,Qt)],8,Kt)]}),_:1},8,["options"])])])])}var Xt=I(jt,[["render",Wt],["__scopeId","data-v-1cefb16b"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/ExtendFromInput.vue"]]);const Jt=V({name:"PresetPanel",components:{LoopSelector:ft,StartImageUrlInput:St,EndImageUrlInput:bt,EnhancementSelector:at,ElButton:D,FontAwesomeIcon:W,PromptInput:Ft,ExtendFromInput:Xt,CustomSelector:ut,UploadVideo:At},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.luma)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),Yt={class:"panel"},Zt={class:"config"},xt={class:"actions"};function eo(e,t,o,l,f,v){var N,U,G,z,O,F,j,q,B;const c=n("extend-from-input"),u=n("prompt-input"),d=n("custom-selector"),_=n("upload-video"),$=n("start-image-url-input"),S=n("end-image-url-input"),C=n("enhancement-selector"),T=n("loop-selector"),P=n("font-awesome-icon"),L=n("el-button");return r(),p("div",Yt,[a("div",Zt,[((N=e.config)==null?void 0:N.video_id)||((U=e.config)==null?void 0:U.video_url)?(r(),A(c,{key:0,class:"mb-4"})):h("v-if",!0),s(u,{class:"mb-4"}),(G=e.config)!=null&&G.video_id?h("v-if",!0):(r(),A(d,{key:1,class:"mb-4"})),(z=e.config)!=null&&z.custom?(r(),A(_,{key:2,class:"mb-4"})):h("v-if",!0),!(((O=e.config)==null?void 0:O.video_id)||((F=e.config)==null?void 0:F.video_url))&&!((j=e.config)!=null&&j.custom)?(r(),A($,{key:3,class:"mb-4"})):h("v-if",!0),s(S,{class:"mb-4"}),s(C,{class:"mb-4"}),s(T,{class:"mb-4"}),a("div",xt,[((q=e.config)==null?void 0:q.video_url)!==void 0||((B=e.config)==null?void 0:B.custom)?(r(),A(L,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:m(()=>[s(P,{icon:"fa-solid fa-magic",class:"mr-2"}),g(" "+i(e.$t("luma.button.extend")),1)]),_:1},8,["onClick"])):(r(),A(L,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:m(()=>[s(P,{icon:"fa-solid fa-magic",class:"mr-2"}),g(" "+i(e.$t("luma.button.generate")),1)]),_:1},8,["onClick"]))])])])}var to=I(Jt,[["render",eo],["__scopeId","data-v-951b4cc0"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/ConfigPanel.vue"]]);const oo=V({name:"VideoPlayer",components:{VuePlyr:Se},props:{modelValue:{type:Object,required:!0}},data(){return{options:{quality:{default:"1080p"}}}}}),so=["data-poster"],no=["src"];function ao(e,t,o,l,f,v){const c=n("vue-plyr");return r(),p("div",null,[s(c,{options:e.options,class:"video"},{default:m(()=>{var u,d,_,$;return[a("video",{controls:"",crossorigin:"",playsinline:"","data-poster":(d=(u=e.modelValue)==null?void 0:u.response)==null?void 0:d.thumbnail_url},[a("source",{size:"1080",src:($=(_=e.modelValue)==null?void 0:_.response)==null?void 0:$.video_url,type:"video/mp4"},null,8,no)],8,so)]}),_:1},8,["options"])])}var lo=I(oo,[["render",ao],["__scopeId","data-v-759e400c"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/VideoPlayer.vue"]]);const io=V({name:"TaskPreview",components:{ElImage:Fe,CopyToClipboard:We,FontAwesomeIcon:W,ElAlert:je,VideoPlayer:lo,ElTooltip:qe,ElButton:D},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){var e;return(e=this.$store.state.luma)==null?void 0:e.application},config(){var e;return(e=this.$store.state.luma)==null?void 0:e.config}},methods:{onExtend(e,t){var o;e.stopPropagation(),console.debug("set config",t),this.$store.commit("luma/setConfig",k(w({},(o=this.$store.state.luma)==null?void 0:o.config),{video_id:t.video_id,prompt:t.prompt,action:"extend",thumbnail_url:t.thumbnail_url,video_url:t.video_url}))},onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onReload(e){const t=e.target,o=new URL(t.src),l=o.searchParams.get("retry");if(!l)o.searchParams.set("retry","1");else if(parseInt(l)<2)o.searchParams.set("retry",(parseInt(l)+1).toString());else return;t.src=o.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),ro={class:"preview"},co={class:"left"},uo={class:"main"},mo={class:"bot"},po={class:"datetime"},_o={class:"info"},fo={key:0,class:"prompt mt-2"},ho={key:0},vo={key:1},go={key:0,class:H({content:!0,failed:!0})},$o={class:"image-wrapper"},yo={key:0,class:H({operations:!0,"mt-2":!0})},bo={class:"description"},wo={key:1,class:H({content:!0})},ko={class:"description"},Io={class:"description"},Vo={class:"description"},Eo={key:2,class:H({content:!0})},So={class:"description"};function Uo(e,t,o,l,f,v){var T,P,L,N,U,G,z,O,F,j,q,B,Z,x,ee,te,oe,se,ne,ae,le,ie,re,ce,ue,de,me,pe;const c=n("el-image"),u=n("VideoPlayer"),d=n("el-button"),_=n("el-tooltip"),$=n("font-awesome-icon"),S=n("copy-to-clipboard"),C=n("el-alert");return r(),p("div",ro,[a("div",co,[s(c,{src:"https://cdn.acedata.cloud/ahjfwi.png",class:"avatar"})]),a("div",uo,[a("div",mo,[g(i(e.$t("luma.name.lumaBot"))+" ",1),a("span",po,i(e.$dayjs.format(""+new Date(parseFloat(((T=e.modelValue)==null?void 0:T.created_at)||"")*1e3))),1)]),a("div",_o,[(L=(P=e.modelValue)==null?void 0:P.request)!=null&&L.prompt?(r(),p("p",fo,[g(i((U=(N=e.modelValue)==null?void 0:N.request)==null?void 0:U.prompt)+" ",1),(G=e.modelValue)!=null&&G.response?h("v-if",!0):(r(),p("span",ho," - ("+i(e.$t("luma.status.pending"))+") ",1)),((F=(O=(z=e.modelValue)==null?void 0:z.response)==null?void 0:O.data)==null?void 0:F.state)==="processing"||((B=(q=(j=e.modelValue)==null?void 0:j.response)==null?void 0:q.data)==null?void 0:B.state)==="pending"||((ee=(x=(Z=e.modelValue)==null?void 0:Z.response)==null?void 0:x.data)==null?void 0:ee.state)==="completed"?(r(),p("span",vo," - ("+i(e.$t("luma.status.processing"))+") ",1)):h("v-if",!0)])):h("v-if",!0)]),h(" Display success message "),((oe=(te=e.modelValue)==null?void 0:te.response)==null?void 0:oe.success)===!0?(r(),p("div",go,[a("div",$o,[s(u,{"model-value":e.modelValue},null,8,["model-value"])]),((se=e.modelValue)==null?void 0:se.response)&&!((ne=e.config)!=null&&ne.custom)?(r(),p("div",yo,[s(_,{class:"box-item",effect:"dark",content:e.$t("luma.message.extendVideo"),placement:"top-start"},{default:m(()=>[s(d,{type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=E=>{var b;return e.onExtend(E,(b=e.modelValue)==null?void 0:b.response)})},{default:m(()=>[g(i(e.$t("luma.button.extend")),1)]),_:1})]),_:1},8,["content"]),s(_,{class:"box-item",effect:"dark",content:e.$t("luma.message.downloadVideo"),placement:"top-start"},{default:m(()=>[s(d,{type:"info",size:"small",class:"btn-action",onClick:t[1]||(t[1]=E=>{var b,M;return e.onDownload(E,(M=(b=e.modelValue)==null?void 0:b.response)==null?void 0:M.video_url)})},{default:m(()=>[g(i(e.$t("luma.button.download")),1)]),_:1})]),_:1},8,["content"])])):h("v-if",!0),s(C,{closable:!1,class:"mt-2 success"},{default:m(()=>{var E,b;return[a("p",bo,[s($,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+i(e.$t("luma.name.taskId"))+": "+i((E=e.modelValue)==null?void 0:E.id)+" ",1),s(S,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):h("v-if",!0),h(" Display error message "),((le=(ae=e.modelValue)==null?void 0:ae.response)==null?void 0:le.success)===!1?(r(),p("div",wo,[s(C,{closable:!1,class:"failure"},{template:m(()=>[s($,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),g(" "+i(e.$t("luma.name.failure")),1)]),default:m(()=>{var E,b,M,_e,fe,he,ve,ge,$e,ye,be,we;return[a("p",ko,[s($,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+i(e.$t("luma.name.taskId"))+": "+i((E=e.modelValue)==null?void 0:E.id)+" ",1),s(S,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])]),a("p",Io,[s($,{icon:"fa-solid fa-circle-info",class:"mr-1"}),g(" "+i(e.$t("luma.name.failureReason"))+": "+i((fe=(_e=(M=e.modelValue)==null?void 0:M.response)==null?void 0:_e.error)==null?void 0:fe.message)+" ",1),s(S,{content:(ge=(ve=(he=e.modelValue)==null?void 0:he.response)==null?void 0:ve.error)==null?void 0:ge.message,class:"btn-copy"},null,8,["content"])]),a("p",Vo,[s($,{icon:"fa-solid fa-hashtag",class:"mr-1"}),g(" "+i(e.$t("luma.name.traceId"))+": "+i((ye=($e=e.modelValue)==null?void 0:$e.response)==null?void 0:ye.trace_id)+" ",1),s(S,{content:(we=(be=e.modelValue)==null?void 0:be.response)==null?void 0:we.trace_id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):h("v-if",!0),h(" Display error message "),!((ie=e.modelValue)!=null&&ie.response)||((ue=(ce=(re=e.modelValue)==null?void 0:re.response)==null?void 0:ce.data)==null?void 0:ue.state)==="processing"||((pe=(me=(de=e.modelValue)==null?void 0:de.response)==null?void 0:me.data)==null?void 0:pe.state)==="pending"?(r(),p("div",Eo,[s(C,{closable:!1,class:"info"},{template:m(()=>[s($,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),g(" "+i(e.$t("luma.name.failure")),1)]),default:m(()=>{var E,b;return[a("p",So,[s($,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+i(e.$t("luma.name.taskId"))+": "+i((E=e.modelValue)==null?void 0:E.id)+" ",1),s(S,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):h("v-if",!0)])])}var Co=I(io,[["render",Uo],["__scopeId","data-v-077795a0"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/task/Preview.vue"]]);const Po=V({name:"RecentPanel",components:{TaskPreview:Co,ElSkeleton:Be,ElSkeletonItem:Me},data(){return{job:0}},computed:{tasks(){var e,t,o,l;return k(w({},(e=this.$store.state.luma)==null?void 0:e.tasks),{items:(l=(o=(t=this.$store.state.luma)==null?void 0:t.tasks)==null?void 0:o.items)==null?void 0:l.slice().reverse()})}}}),Lo={class:"panel recent"},No={key:0,class:"tasks"},Ao={class:"left"},To={class:"main"},Go={key:1,class:"tasks"},Ro={key:2,class:"description"};function Do(e,t,o,l,f,v){var _,$,S,C,T,P,L,N;const c=n("el-skeleton-item"),u=n("el-skeleton"),d=n("task-preview");return r(),p("div",Lo,[((_=e.tasks)==null?void 0:_.items)===void 0?(r(),p("div",No,[(r(),p(Ve,null,Ee(3,U=>a("div",{key:U,class:"task placeholder"},[a("div",Ao,[s(u,{animated:""},{template:m(()=>[s(c,{variant:"image",class:"avatar"})]),_:1})]),a("div",To,[s(u,{animated:""},{template:m(()=>[s(c,{variant:"p",class:"title"}),s(c,{variant:"image",class:"icon"})]),_:1})])])),64))])):((S=($=e.tasks)==null?void 0:$.items)==null?void 0:S.length)&&((T=(C=e.tasks)==null?void 0:C.items)==null?void 0:T.length)>0?(r(),p("div",Go,[(r(!0),p(Ve,null,Ee((P=e.tasks)==null?void 0:P.items,(U,G)=>(r(),A(d,{key:G,"model-value":U,class:"preview"},null,8,["model-value"]))),128))])):h("v-if",!0),((N=(L=e.tasks)==null?void 0:L.items)==null?void 0:N.length)===0?(r(),p("p",Ro,i(e.$t("luma.message.noTasks")),1)):h("v-if",!0)])}var zo=I(Po,[["render",Do],["__scopeId","data-v-2f8302a7"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/RecentPanel.vue"]]);const Oo="https://webhook.acedata.cloud/luma",Fo=V({name:"LumaIndex",components:{ConfigPanel:to,Layout:et,ApplicationStatus:He,RecentPanel:zo},data(){return{task:void 0,job:0}},computed:{loading(){var e,t;return((t=(e=this.$store.state.luma)==null?void 0:e.status)==null?void 0:t.getApplications)===K.Request},service(){return this.$store.state.luma.service},credential(){return this.$store.state.luma.credential},config(){return this.$store.state.luma.config},initializing(){return this.$store.state.luma.status.getApplications===K.Request},needApply(){return this.$store.state.luma.status.getApplications===K.Success&&!this.application},application(){return this.$store.state.luma.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("luma/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("luma/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},onApply(){Re.create({application:this.application}).then(({data:e})=>{this.application=e,y.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{var t,o;((o=(t=e==null?void 0:e.response)==null?void 0:t.data)==null?void 0:o.code)===Ke&&y.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("luma/getTasks",{limit:30,offset:0})},async onGenerateVideo(){var o;const e=k(w({},this.config),{callback_url:Oo}),t=(o=this.credential)==null?void 0:o.token;if(!t){console.error("no token specified");return}y.info(this.$t("luma.message.startingTask")),De.generate(e,{token:t}).then(()=>{y.success(this.$t("luma.message.startTaskSuccess")),this.$store.commit("luma/setConfig",{config:void 0})}).catch(l=>{var v,c;const f=(v=l==null?void 0:l.response)==null?void 0:v.data;((c=f==null?void 0:f.error)==null?void 0:c.code)===Qe?y.error(this.$t("luma.message.usedUp")):y.error(this.$t("luma.message.startTaskFailed"))}).finally(async()=>{await this.onGetTasks(),await this.onScrollDown()})}}});function jo(e,t,o,l,f,v){const c=n("config-panel"),u=n("application-status"),d=n("recent-panel"),_=n("layout");return r(),A(_,null,{config:m(()=>[s(c,{onGenerate:e.onGenerateVideo},null,8,["onGenerate"])]),result:m(()=>[s(u,{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"]),s(d,{class:"panel recent"}),h(' <operation-panel class="panel operation" @generate="onGenerate" /> ')]),_:1})}var xo=I(Fo,[["render",jo],["__scopeId","data-v-c45e0af8"],["__file","/home/runner/work/Nexior/Nexior/src/pages/luma/Index.vue"]]);export{xo as default};
|
|
1
|
+
var Ue=Object.defineProperty,Ce=Object.defineProperties;var Pe=Object.getOwnPropertyDescriptors;var ke=Object.getOwnPropertySymbols;var Le=Object.prototype.hasOwnProperty,Ne=Object.prototype.propertyIsEnumerable;var Ie=(e,t,o)=>t in e?Ue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,w=(e,t)=>{for(var o in t||(t={}))Le.call(t,o)&&Ie(e,o,t[o]);if(ke)for(var o of ke(t))Ne.call(t,o)&&Ie(e,o,t[o]);return e},k=(e,t)=>Ce(e,Pe(t));import{K as Se}from"./vendor-others.56d45bbc.js";import{aq as W}from"./vendor-fortawesome.ea56e829.js";import{_ as I,aD as Ae,aE as Te,aF as Ge,U as X,X as K,G as Re,aG as De}from"./index.f12167ac.js";import{P as ze,l as D,_ as J,O as Y,M as y,N as Oe,s as Fe,F as je,u as qe,C as Be,R as Me}from"./vendor-element-plus.0a44791e.js";import{H as V,al as n,o as r,e as p,f as a,I as Q,V as s,M as m,U as i,T as g,L as A,S as h,Q as H,W as Ve,ai as Ee}from"./vendor-@vue.01066951.js";import{I as R}from"./InfoIcon.cab8777c.js";import{A as He,i as Ke,h as Qe}from"./Status.9e8c29ef.js";import{C as We}from"./CopyToClipboard.da42bd6a.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.3f236d35.js";const Xe=V({name:"LayoutLuma",components:{ElDrawer:ze,ElButton:D,FontAwesomeIcon:W},data(){return{drawer:!1}}}),Je={class:"main"},Ye={class:"config"},Ze={class:"result"};function xe(e,t,o,l,f,v){const c=n("font-awesome-icon"),u=n("el-button"),d=n("el-drawer");return r(),p("div",Je,[a("div",Ye,[Q(e.$slots,"config",{},void 0,!0)]),a("div",Ze,[Q(e.$slots,"result",{},void 0,!0)]),s(u,{round:"",class:"menu",onClick:t[0]||(t[0]=_=>e.drawer=!0)},{default:m(()=>[s(c,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),s(d,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=_=>e.drawer=_),"with-header":!1,size:"340px",class:"drawer"},{default:m(()=>[Q(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var et=I(Xe,[["render",xe],["__scopeId","data-v-234cfb9c"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Luma.vue"]]);const tt=V({name:"EnhancementSelector",components:{ElSwitch:J,InfoIcon:R},computed:{value:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.enhancement},set(e){var t;console.debug("set enhancement",e),this.$store.commit("luma/setConfig",k(w({},(t=this.$store.state.luma)==null?void 0:t.config),{enhancement:e}))}}},mounted(){this.value===void 0&&(this.value=Ae)}}),ot={class:"field"},st={class:"title"};function nt(e,t,o,l,f,v){const c=n("el-switch"),u=n("info-icon");return r(),p("div",ot,[a("h2",st,i(e.$t("luma.name.enhancement")),1),s(c,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),class:"value"},null,8,["modelValue"]),s(u,{content:e.$t("luma.description.enhancement"),class:"info"},null,8,["content"])])}var at=I(tt,[["render",nt],["__scopeId","data-v-175365a0"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/EnhancementSelector.vue"]]);const lt=V({name:"CustomSelector",components:{ElSwitch:J,InfoIcon:R},computed:{value:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.custom},set(e){var t;console.debug("set custom",e),this.$store.commit("luma/setConfig",k(w({},(t=this.$store.state.luma)==null?void 0:t.config),{custom:e}))}}},mounted(){this.value===void 0&&(this.value=Te)}}),it={class:"field"},rt={class:"title"};function ct(e,t,o,l,f,v){const c=n("el-switch"),u=n("info-icon");return r(),p("div",it,[a("h2",rt,i(e.$t("luma.name.custom")),1),s(c,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),class:"value"},null,8,["modelValue"]),s(u,{content:e.$t("luma.description.custom"),class:"info"},null,8,["content"])])}var ut=I(lt,[["render",ct],["__scopeId","data-v-5ac2addb"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/CustomSelector.vue"]]);const dt=V({name:"LoopSelector",components:{ElSwitch:J,InfoIcon:R},computed:{value:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.loop},set(e){var t;console.debug("set loop",e),this.$store.commit("luma/setConfig",k(w({},(t=this.$store.state.luma)==null?void 0:t.config),{loop:e}))}}},mounted(){this.value===void 0&&(this.value=Ge)}}),mt={class:"field"},pt={class:"title"};function _t(e,t,o,l,f,v){const c=n("el-switch"),u=n("info-icon");return r(),p("div",mt,[a("h2",pt,i(e.$t("luma.name.loop")),1),s(c,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),class:"value"},null,8,["modelValue"]),s(u,{content:e.$t("luma.description.loop"),class:"info"},null,8,["content"])])}var ft=I(dt,[["render",_t],["__scopeId","data-v-69cccd4e"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/LoopSelector.vue"]]);const ht=V({name:"ContentInput",components:{ElUpload:Y,ElButton:D,InfoIcon:R},data(){return{fileList:[],uploadUrl:X()+"/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})},value:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.end_image_url},set(e){var o,l;const t=(o=this.urls)==null?void 0:o[0];this.$store.commit("luma/setConfig",k(w({},(l=this.$store.state.luma)==null?void 0:l.config),{end_image_url:t}))}}},mounted(){this.value||(this.value=void 0),this.onSetEndImageUrl()},methods:{onExceed(){y.warning(this.$t("luma.message.uploadEndImageExceed"))},onError(){y.error(this.$t("luma.message.uploadEndImageError"))},onSetEndImageUrl(){var t,o;const e=(t=this.urls)==null?void 0:t[0];this.$store.commit("luma/setConfig",k(w({},(o=this.$store.state.luma)==null?void 0:o.config),{end_image_url:e}))},async onSuccess(){this.onSetEndImageUrl()}}}),vt={class:"field"},gt={class:"title"},$t={class:"upload-wrapper"};function yt(e,t,o,l,f,v){const c=n("el-button"),u=n("el-upload"),d=n("info-icon");return r(),p("div",vt,[a("h2",gt,i(e.$t("luma.name.endImageUrl")),1),a("div",$t,[s(u,{"file-list":e.fileList,"onUpdate:file-list":t[0]||(t[0]=_=>e.fileList=_),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{default:m(()=>[s(c,{size:"small",type:"primary",round:""},{default:m(()=>[g(i(e.$t("luma.button.uploadEndImageUrl")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])]),s(d,{content:e.$t("luma.description.endImageUrl"),class:"info"},null,8,["content"])])}var bt=I(ht,[["render",yt],["__scopeId","data-v-97900bb4"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/EndImageUrlInput.vue"]]);const wt=V({name:"StartImageUrlInput",components:{ElUpload:Y,ElButton:D,InfoIcon:R},data(){return{fileList:[],uploadUrl:X()+"/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})},value:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.start_image_url},set(e){var o,l;const t=(o=this.urls)==null?void 0:o[0];this.$store.commit("luma/setConfig",k(w({},(l=this.$store.state.luma)==null?void 0:l.config),{start_image_url:t}))}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){y.warning(this.$t("luma.message.uploadStartImageExceed"))},onError(){y.error(this.$t("luma.message.uploadStartImageError"))},async onRemove(){y.error(this.$t("luma.message.uploadStartImageError"))},onSetStartImageUrl(){var t,o;const e=(t=this.urls)==null?void 0:t[0];this.$store.commit("luma/setConfig",k(w({},(o=this.$store.state.luma)==null?void 0:o.config),{start_image_url:e}))},async onSuccess(){this.onSetStartImageUrl()}}}),kt={class:"field"},It={class:"title"},Vt={class:"upload-wrapper"};function Et(e,t,o,l,f,v){const c=n("el-button"),u=n("el-upload"),d=n("info-icon");return r(),p("div",kt,[a("h2",It,i(e.$t("luma.name.startImageUrl")),1),a("div",Vt,[s(u,{"file-list":e.fileList,"onUpdate:file-list":t[0]||(t[0]=_=>e.fileList=_),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-remove":e.onRemove,"on-success":e.onSuccess,headers:e.headers},{default:m(()=>[s(c,{size:"small",type:"primary",round:""},{default:m(()=>[g(i(e.$t("luma.button.uploadStartImageUrl")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-remove","on-success","headers"])]),s(d,{content:e.$t("luma.description.startImageUrl"),class:"info"},null,8,["content"])])}var St=I(wt,[["render",Et],["__scopeId","data-v-5440a4bf"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/StartImageUrlInput.vue"]]);const Ut=V({name:"UploadVideo",components:{ElUpload:Y,ElButton:D,InfoIcon:R},data(){return{fileList:[],uploadUrl:X()+"/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})},value:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.video_url},set(e){var o,l;const t=(o=this.urls)==null?void 0:o[0];this.$store.commit("luma/setConfig",k(w({},(l=this.$store.state.luma)==null?void 0:l.config),{video_url:t}))}}},mounted(){this.value||(this.value=void 0)},methods:{onExceed(){y.warning(this.$t("luma.message.uploadVideoExceed"))},onError(){y.error(this.$t("luma.message.uploadVideoError"))},beforeUpload(e){const t=e.type==="video/mp4",o=e.size/1024/1024<10;return t?o?!0:(y.error(this.$t("luma.message.uploadVideoSizeExceed")),!1):(y.error(this.$t("luma.message.uploadVideoTypeFailed")),!1)},onSetVideoUrl(){var t,o;const e=(t=this.urls)==null?void 0:t[0];this.$store.commit("luma/setConfig",k(w({},(o=this.$store.state.luma)==null?void 0:o.config),{video_url:e,action:"extend"}))},async onSuccess(){this.onSetVideoUrl()}}}),Ct={class:"field"},Pt={class:"title"},Lt={class:"upload-wrapper"};function Nt(e,t,o,l,f,v){const c=n("el-button"),u=n("el-upload"),d=n("info-icon");return r(),p("div",Ct,[a("h2",Pt,i(e.$t("luma.name.videoUrl")),1),a("div",Lt,[s(u,{"file-list":e.fileList,"onUpdate:file-list":t[0]||(t[0]=_=>e.fileList=_),accept:".mp4",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"before-upload":e.beforeUpload,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{default:m(()=>[s(c,{size:"small",type:"primary",round:""},{default:m(()=>[g(i(e.$t("luma.button.uploadVideoUrl")),1)]),_:1})]),_:1},8,["file-list","action","before-upload","on-exceed","on-error","on-success","headers"])]),s(d,{content:e.$t("luma.description.videoUrl"),class:"info"},null,8,["content"])])}var At=I(Ut,[["render",Nt],["__scopeId","data-v-46c66c9f"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/UploadVideo.vue"]]);const Tt="",Gt=V({name:"PromptInput",components:{ElInput:Oe,InfoIcon:R},computed:{prompt:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.prompt},set(e){var t;console.debug("set prompt",e),this.$store.commit("luma/setConfig",k(w({},(t=this.$store.state.luma)==null?void 0:t.config),{prompt:e}))}}},mounted(){this.value||(this.value=Tt)}}),Rt={class:"field"},Dt={class:"box"},zt={class:"title"};function Ot(e,t,o,l,f,v){const c=n("info-icon"),u=n("el-input");return r(),p("div",Rt,[a("div",Dt,[a("h2",zt,i(e.$t("luma.name.prompt")),1),s(c,{content:e.$t("luma.description.prompt"),class:"info"},null,8,["content"])]),s(u,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=d=>e.prompt=d),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("luma.placeholder.prompt"),maxlength:300,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var Ft=I(Gt,[["render",Ot],["__scopeId","data-v-19a7446b"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/PromptInput.vue"]]);const jt=V({name:"ExtendFromInput",components:{VuePlyr:Se},props:{modelValue:{type:Object,required:!0}},data(){return{options:{quality:{default:"1080p"}}}},computed:{config(){var e;return(e=this.$store.state.luma)==null?void 0:e.config}}}),qt={class:"field"},Bt={class:"box"},Mt={class:"title"},Ht={class:"task"},Kt=["data-poster"],Qt=["src"];function Wt(e,t,o,l,f,v){const c=n("vue-plyr");return r(),p("div",qt,[a("div",Bt,[a("h2",Mt,i(e.$t("luma.name.extend")),1)]),a("div",Ht,[a("div",null,[s(c,{options:e.options,class:"video"},{default:m(()=>{var u,d;return[a("video",{controls:"",crossorigin:"",playsinline:"","data-poster":(u=e.config)==null?void 0:u.thumbnail_url},[a("source",{size:"1080",src:(d=e.config)==null?void 0:d.video_url,type:"video/mp4"},null,8,Qt)],8,Kt)]}),_:1},8,["options"])])])])}var Xt=I(jt,[["render",Wt],["__scopeId","data-v-1cefb16b"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/ExtendFromInput.vue"]]);const Jt=V({name:"PresetPanel",components:{LoopSelector:ft,StartImageUrlInput:St,EndImageUrlInput:bt,EnhancementSelector:at,ElButton:D,FontAwesomeIcon:W,PromptInput:Ft,ExtendFromInput:Xt,CustomSelector:ut,UploadVideo:At},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.luma)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),Yt={class:"panel"},Zt={class:"config"},xt={class:"actions"};function eo(e,t,o,l,f,v){var N,U,G,z,O,F,j,q,B;const c=n("extend-from-input"),u=n("prompt-input"),d=n("custom-selector"),_=n("upload-video"),$=n("start-image-url-input"),S=n("end-image-url-input"),C=n("enhancement-selector"),T=n("loop-selector"),P=n("font-awesome-icon"),L=n("el-button");return r(),p("div",Yt,[a("div",Zt,[((N=e.config)==null?void 0:N.video_id)||((U=e.config)==null?void 0:U.video_url)?(r(),A(c,{key:0,class:"mb-4"})):h("v-if",!0),s(u,{class:"mb-4"}),(G=e.config)!=null&&G.video_id?h("v-if",!0):(r(),A(d,{key:1,class:"mb-4"})),(z=e.config)!=null&&z.custom?(r(),A(_,{key:2,class:"mb-4"})):h("v-if",!0),!(((O=e.config)==null?void 0:O.video_id)||((F=e.config)==null?void 0:F.video_url))&&!((j=e.config)!=null&&j.custom)?(r(),A($,{key:3,class:"mb-4"})):h("v-if",!0),s(S,{class:"mb-4"}),s(C,{class:"mb-4"}),s(T,{class:"mb-4"}),a("div",xt,[((q=e.config)==null?void 0:q.video_url)!==void 0||((B=e.config)==null?void 0:B.custom)?(r(),A(L,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:m(()=>[s(P,{icon:"fa-solid fa-magic",class:"mr-2"}),g(" "+i(e.$t("luma.button.extend")),1)]),_:1},8,["onClick"])):(r(),A(L,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:m(()=>[s(P,{icon:"fa-solid fa-magic",class:"mr-2"}),g(" "+i(e.$t("luma.button.generate")),1)]),_:1},8,["onClick"]))])])])}var to=I(Jt,[["render",eo],["__scopeId","data-v-951b4cc0"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/ConfigPanel.vue"]]);const oo=V({name:"VideoPlayer",components:{VuePlyr:Se},props:{modelValue:{type:Object,required:!0}},data(){return{options:{quality:{default:"1080p"}}}}}),so=["data-poster"],no=["src"];function ao(e,t,o,l,f,v){const c=n("vue-plyr");return r(),p("div",null,[s(c,{options:e.options,class:"video"},{default:m(()=>{var u,d,_,$;return[a("video",{controls:"",crossorigin:"",playsinline:"","data-poster":(d=(u=e.modelValue)==null?void 0:u.response)==null?void 0:d.thumbnail_url},[a("source",{size:"1080",src:($=(_=e.modelValue)==null?void 0:_.response)==null?void 0:$.video_url,type:"video/mp4"},null,8,no)],8,so)]}),_:1},8,["options"])])}var lo=I(oo,[["render",ao],["__scopeId","data-v-759e400c"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/VideoPlayer.vue"]]);const io=V({name:"TaskPreview",components:{ElImage:Fe,CopyToClipboard:We,FontAwesomeIcon:W,ElAlert:je,VideoPlayer:lo,ElTooltip:qe,ElButton:D},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){var e;return(e=this.$store.state.luma)==null?void 0:e.application},config(){var e;return(e=this.$store.state.luma)==null?void 0:e.config}},methods:{onExtend(e,t){var o;e.stopPropagation(),console.debug("set config",t),this.$store.commit("luma/setConfig",k(w({},(o=this.$store.state.luma)==null?void 0:o.config),{video_id:t.video_id,prompt:t.prompt,action:"extend",thumbnail_url:t.thumbnail_url,video_url:t.video_url}))},onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onReload(e){const t=e.target,o=new URL(t.src),l=o.searchParams.get("retry");if(!l)o.searchParams.set("retry","1");else if(parseInt(l)<2)o.searchParams.set("retry",(parseInt(l)+1).toString());else return;t.src=o.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),ro={class:"preview"},co={class:"left"},uo={class:"main"},mo={class:"bot"},po={class:"datetime"},_o={class:"info"},fo={key:0,class:"prompt mt-2"},ho={key:0},vo={key:1},go={key:0,class:H({content:!0,failed:!0})},$o={class:"image-wrapper"},yo={key:0,class:H({operations:!0,"mt-2":!0})},bo={class:"description"},wo={key:1,class:H({content:!0})},ko={class:"description"},Io={class:"description"},Vo={class:"description"},Eo={key:2,class:H({content:!0})},So={class:"description"};function Uo(e,t,o,l,f,v){var T,P,L,N,U,G,z,O,F,j,q,B,Z,x,ee,te,oe,se,ne,ae,le,ie,re,ce,ue,de,me,pe;const c=n("el-image"),u=n("VideoPlayer"),d=n("el-button"),_=n("el-tooltip"),$=n("font-awesome-icon"),S=n("copy-to-clipboard"),C=n("el-alert");return r(),p("div",ro,[a("div",co,[s(c,{src:"https://cdn.acedata.cloud/ahjfwi.png",class:"avatar"})]),a("div",uo,[a("div",mo,[g(i(e.$t("luma.name.lumaBot"))+" ",1),a("span",po,i(e.$dayjs.format(""+new Date(parseFloat(((T=e.modelValue)==null?void 0:T.created_at)||"")*1e3))),1)]),a("div",_o,[(L=(P=e.modelValue)==null?void 0:P.request)!=null&&L.prompt?(r(),p("p",fo,[g(i((U=(N=e.modelValue)==null?void 0:N.request)==null?void 0:U.prompt)+" ",1),(G=e.modelValue)!=null&&G.response?h("v-if",!0):(r(),p("span",ho," - ("+i(e.$t("luma.status.pending"))+") ",1)),((F=(O=(z=e.modelValue)==null?void 0:z.response)==null?void 0:O.data)==null?void 0:F.state)==="processing"||((B=(q=(j=e.modelValue)==null?void 0:j.response)==null?void 0:q.data)==null?void 0:B.state)==="pending"||((ee=(x=(Z=e.modelValue)==null?void 0:Z.response)==null?void 0:x.data)==null?void 0:ee.state)==="completed"?(r(),p("span",vo," - ("+i(e.$t("luma.status.processing"))+") ",1)):h("v-if",!0)])):h("v-if",!0)]),h(" Display success message "),((oe=(te=e.modelValue)==null?void 0:te.response)==null?void 0:oe.success)===!0?(r(),p("div",go,[a("div",$o,[s(u,{"model-value":e.modelValue},null,8,["model-value"])]),((se=e.modelValue)==null?void 0:se.response)&&!((ne=e.config)!=null&&ne.custom)?(r(),p("div",yo,[s(_,{class:"box-item",effect:"dark",content:e.$t("luma.message.extendVideo"),placement:"top-start"},{default:m(()=>[s(d,{type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=E=>{var b;return e.onExtend(E,(b=e.modelValue)==null?void 0:b.response)})},{default:m(()=>[g(i(e.$t("luma.button.extend")),1)]),_:1})]),_:1},8,["content"]),s(_,{class:"box-item",effect:"dark",content:e.$t("luma.message.downloadVideo"),placement:"top-start"},{default:m(()=>[s(d,{type:"info",size:"small",class:"btn-action",onClick:t[1]||(t[1]=E=>{var b,M;return e.onDownload(E,(M=(b=e.modelValue)==null?void 0:b.response)==null?void 0:M.video_url)})},{default:m(()=>[g(i(e.$t("luma.button.download")),1)]),_:1})]),_:1},8,["content"])])):h("v-if",!0),s(C,{closable:!1,class:"mt-2 success"},{default:m(()=>{var E,b;return[a("p",bo,[s($,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+i(e.$t("luma.name.taskId"))+": "+i((E=e.modelValue)==null?void 0:E.id)+" ",1),s(S,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):h("v-if",!0),h(" Display error message "),((le=(ae=e.modelValue)==null?void 0:ae.response)==null?void 0:le.success)===!1?(r(),p("div",wo,[s(C,{closable:!1,class:"failure"},{template:m(()=>[s($,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),g(" "+i(e.$t("luma.name.failure")),1)]),default:m(()=>{var E,b,M,_e,fe,he,ve,ge,$e,ye,be,we;return[a("p",ko,[s($,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+i(e.$t("luma.name.taskId"))+": "+i((E=e.modelValue)==null?void 0:E.id)+" ",1),s(S,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])]),a("p",Io,[s($,{icon:"fa-solid fa-circle-info",class:"mr-1"}),g(" "+i(e.$t("luma.name.failureReason"))+": "+i((fe=(_e=(M=e.modelValue)==null?void 0:M.response)==null?void 0:_e.error)==null?void 0:fe.message)+" ",1),s(S,{content:(ge=(ve=(he=e.modelValue)==null?void 0:he.response)==null?void 0:ve.error)==null?void 0:ge.message,class:"btn-copy"},null,8,["content"])]),a("p",Vo,[s($,{icon:"fa-solid fa-hashtag",class:"mr-1"}),g(" "+i(e.$t("luma.name.traceId"))+": "+i((ye=($e=e.modelValue)==null?void 0:$e.response)==null?void 0:ye.trace_id)+" ",1),s(S,{content:(we=(be=e.modelValue)==null?void 0:be.response)==null?void 0:we.trace_id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):h("v-if",!0),h(" Display error message "),!((ie=e.modelValue)!=null&&ie.response)||((ue=(ce=(re=e.modelValue)==null?void 0:re.response)==null?void 0:ce.data)==null?void 0:ue.state)==="processing"||((pe=(me=(de=e.modelValue)==null?void 0:de.response)==null?void 0:me.data)==null?void 0:pe.state)==="pending"?(r(),p("div",Eo,[s(C,{closable:!1,class:"info"},{template:m(()=>[s($,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),g(" "+i(e.$t("luma.name.failure")),1)]),default:m(()=>{var E,b;return[a("p",So,[s($,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+i(e.$t("luma.name.taskId"))+": "+i((E=e.modelValue)==null?void 0:E.id)+" ",1),s(S,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):h("v-if",!0)])])}var Co=I(io,[["render",Uo],["__scopeId","data-v-077795a0"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/task/Preview.vue"]]);const Po=V({name:"RecentPanel",components:{TaskPreview:Co,ElSkeleton:Be,ElSkeletonItem:Me},data(){return{job:0}},computed:{tasks(){var e,t,o,l;return k(w({},(e=this.$store.state.luma)==null?void 0:e.tasks),{items:(l=(o=(t=this.$store.state.luma)==null?void 0:t.tasks)==null?void 0:o.items)==null?void 0:l.slice().reverse()})}}}),Lo={class:"panel recent"},No={key:0,class:"tasks"},Ao={class:"left"},To={class:"main"},Go={key:1,class:"tasks"},Ro={key:2,class:"description"};function Do(e,t,o,l,f,v){var _,$,S,C,T,P,L,N;const c=n("el-skeleton-item"),u=n("el-skeleton"),d=n("task-preview");return r(),p("div",Lo,[((_=e.tasks)==null?void 0:_.items)===void 0?(r(),p("div",No,[(r(),p(Ve,null,Ee(3,U=>a("div",{key:U,class:"task placeholder"},[a("div",Ao,[s(u,{animated:""},{template:m(()=>[s(c,{variant:"image",class:"avatar"})]),_:1})]),a("div",To,[s(u,{animated:""},{template:m(()=>[s(c,{variant:"p",class:"title"}),s(c,{variant:"image",class:"icon"})]),_:1})])])),64))])):((S=($=e.tasks)==null?void 0:$.items)==null?void 0:S.length)&&((T=(C=e.tasks)==null?void 0:C.items)==null?void 0:T.length)>0?(r(),p("div",Go,[(r(!0),p(Ve,null,Ee((P=e.tasks)==null?void 0:P.items,(U,G)=>(r(),A(d,{key:G,"model-value":U,class:"preview"},null,8,["model-value"]))),128))])):h("v-if",!0),((N=(L=e.tasks)==null?void 0:L.items)==null?void 0:N.length)===0?(r(),p("p",Ro,i(e.$t("luma.message.noTasks")),1)):h("v-if",!0)])}var zo=I(Po,[["render",Do],["__scopeId","data-v-2f8302a7"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/RecentPanel.vue"]]);const Oo="https://webhook.acedata.cloud/luma",Fo=V({name:"LumaIndex",components:{ConfigPanel:to,Layout:et,ApplicationStatus:He,RecentPanel:zo},data(){return{task:void 0,job:0}},computed:{loading(){var e,t;return((t=(e=this.$store.state.luma)==null?void 0:e.status)==null?void 0:t.getApplications)===K.Request},service(){return this.$store.state.luma.service},credential(){return this.$store.state.luma.credential},config(){return this.$store.state.luma.config},initializing(){return this.$store.state.luma.status.getApplications===K.Request},needApply(){return this.$store.state.luma.status.getApplications===K.Success&&!this.application},application(){return this.$store.state.luma.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("luma/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("luma/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},onApply(){Re.create({application:this.application}).then(({data:e})=>{this.application=e,y.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{var t,o;((o=(t=e==null?void 0:e.response)==null?void 0:t.data)==null?void 0:o.code)===Ke&&y.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("luma/getTasks",{limit:30,offset:0})},async onGenerateVideo(){var o;const e=k(w({},this.config),{callback_url:Oo}),t=(o=this.credential)==null?void 0:o.token;if(!t){console.error("no token specified");return}y.info(this.$t("luma.message.startingTask")),De.generate(e,{token:t}).then(()=>{y.success(this.$t("luma.message.startTaskSuccess")),this.$store.commit("luma/setConfig",{config:void 0})}).catch(l=>{var v,c;const f=(v=l==null?void 0:l.response)==null?void 0:v.data;((c=f==null?void 0:f.error)==null?void 0:c.code)===Qe?y.error(this.$t("luma.message.usedUp")):y.error(this.$t("luma.message.startTaskFailed"))}).finally(async()=>{await this.onGetTasks(),await this.onScrollDown()})}}});function jo(e,t,o,l,f,v){const c=n("config-panel"),u=n("application-status"),d=n("recent-panel"),_=n("layout");return r(),A(_,null,{config:m(()=>[s(c,{onGenerate:e.onGenerateVideo},null,8,["onGenerate"])]),result:m(()=>[s(u,{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"]),s(d,{class:"panel recent"}),h(' <operation-panel class="panel operation" @generate="onGenerate" /> ')]),_:1})}var xo=I(Fo,[["render",jo],["__scopeId","data-v-c45e0af8"],["__file","/home/runner/work/Nexior/Nexior/src/pages/luma/Index.vue"]]);export{xo as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./vendor-others.56d45bbc.js";import{h as O,_ as T,c as A,d as R,e as P,f as B,A as H,U as V,R as q}from"./index.
|
|
1
|
+
import"./vendor-others.56d45bbc.js";import{h as O,_ as T,c as A,d as R,e as P,f as B,A as H,U as V,R as q}from"./index.f12167ac.js";import{aq as L}from"./vendor-fortawesome.ea56e829.js";import{L as M,D as j}from"./DarkSelector.d4ce65b4.js";import{s as D,E as X,t as z,j as F,k as J}from"./vendor-element-plus.0a44791e.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 Q,Q as K}from"./vendor-@vue.01066951.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.3f236d35.js";import"./vendor-vue-dark-switch.dc692e95.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,b,w,y;return[(y=(w=(b=(d=e.site)==null?void 0:d.features)==null?void 0:b.support)==null?void 0:w.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,b,w,y;return[r("div",Z,[r("div",ee,[a(f,{src:(y=(w=(b=(d=e.site)==null?void 0:d.features)==null?void 0:b.support)==null?void 0:w.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:M,DarkSelector:j},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:q})},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,Q(e.links,(o,c)=>(g(),C("a",{key:c,class:K({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 be=T(se,[["render",pe],["__scopeId","data-v-0a2212f8"],["__file","/home/runner/work/Nexior/Nexior/src/pages/profile/Index.vue"]]);export{be as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./vendor-others.56d45bbc.js";import{aq as W}from"./vendor-fortawesome.ea56e829.js";import{_ as G}from"./index.
|
|
1
|
+
import"./vendor-others.56d45bbc.js";import{aq as W}from"./vendor-fortawesome.ea56e829.js";import{_ as G}from"./index.f12167ac.js";import{l as J,i as O,h as P,r as Q,s as X}from"./vendor-element-plus.0a44791e.js";import{H as Y,al as _,e as h,f as t,V as e,M as i,S as p,o as r,U as a,T as m,W as M,ai as R,L as U,aK as Z,aL as tt}from"./vendor-@vue.01066951.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.3f236d35.js";const st=Y({name:"Index",components:{ElButton:J,ElRow:O,ElCol:P,ElCard:Q,ElImage:X,FontAwesomeIcon:W},data(){return{comments:[{avatar:"https://cdn.acedata.cloud/avatar1.png",name:this.$t("index.customers.name1"),job:this.$t("index.customers.job1"),content:this.$t("index.customers.comment1")},{avatar:"https://cdn.acedata.cloud/avatar2.png",name:this.$t("index.customers.name2"),job:this.$t("index.customers.job2"),content:this.$t("index.customers.comment2")},{avatar:"https://cdn.acedata.cloud/avatar3.png",name:this.$t("index.customers.name3"),job:this.$t("index.customers.job3"),content:this.$t("index.customers.comment3")}]}},computed:{site(){return this.$store.state.site},capabilities(){var s,n,C,q,I,E,u,o,f,d,w,b,v,$,g,y,k,x;return[...(C=(n=(s=this.site)==null?void 0:s.features)==null?void 0:n.chat)!=null&&C.enabled?[{title:this.$t("index.title.chat"),subtitle:this.$t("index.subtitle.chat"),icon:"fa-regular fa-comment"}]:[],...(E=(I=(q=this.site)==null?void 0:q.features)==null?void 0:I.midjourney)!=null&&E.enabled?[{title:this.$t("index.title.midjourney"),subtitle:this.$t("index.subtitle.midjourney"),icon:"fa-solid fa-palette"}]:[],...(f=(o=(u=this.site)==null?void 0:u.features)==null?void 0:o.qrart)!=null&&f.enabled?[{title:this.$t("index.title.qrart"),subtitle:this.$t("index.subtitle.qrart"),icon:"fa-solid fa-qrcode"}]:[],...(b=(w=(d=this.site)==null?void 0:d.features)==null?void 0:w.suno)!=null&&b.enabled?[{title:this.$t("index.title.suno"),subtitle:this.$t("index.subtitle.suno"),icon:"fa-solid fa-music"}]:[],...(g=($=(v=this.site)==null?void 0:v.features)==null?void 0:$.luma)!=null&&g.enabled?[{title:this.$t("index.title.luma"),subtitle:this.$t("index.subtitle.luma"),icon:"fa-solid fa-film"}]:[],...(x=(k=(y=this.site)==null?void 0:y.features)==null?void 0:k.headshots)!=null&&x.enabled?[{title:this.$t("index.title.headshots"),subtitle:this.$t("index.subtitle.headshots"),icon:"fa-solid fa-id-card"}]:[]]}},mounted(){},methods:{}}),c=s=>(Z("data-v-d9c0303e"),s=s(),tt(),s),et={class:"wrapper"},it={id:"banner"},at={class:"container"},ot={class:"info"},nt={class:"title"},lt={class:"subtitle"},dt={class:"operations"},ct={id:"introduction"},rt={class:"container"},ut={class:"title"},ht={class:"subtitle"},mt={class:"icon-wrapper"},_t={class:"title"},pt={class:"subtitle"},ft={key:0,id:"chat",class:"block"},bt={class:"container"},vt=c(()=>t("img",{src:"https://cdn.acedata.cloud/axynds.png",class:"image desktop"},null,-1)),$t=c(()=>t("img",{src:"https://cdn.acedata.cloud/vds4i3.png",class:"image mobile"},null,-1)),gt={class:"title"},yt={class:"subtitle"},kt={key:1,id:"midjourney",class:"block"},xt={class:"container"},wt={class:"title"},jt={class:"subtitle"},Ct=c(()=>t("img",{src:"https://cdn.acedata.cloud/uk86mz.png",class:"image desktop"},null,-1)),qt=c(()=>t("img",{src:"https://cdn.acedata.cloud/rvelwm.png",class:"image mobile"},null,-1)),It={key:2,id:"qrart",class:"block"},Et={class:"container"},Nt=c(()=>t("img",{src:"https://cdn.acedata.cloud/gyogar.png",class:"image desktop"},null,-1)),Bt=c(()=>t("img",{src:"https://cdn.acedata.cloud/5kunm0.png",class:"image mobile"},null,-1)),St={class:"title"},Vt={class:"subtitle"},Ft={key:3,id:"suno",class:"block"},Lt={class:"container"},zt={class:"title"},Tt={class:"subtitle"},At=c(()=>t("img",{src:"https://cdn.acedata.cloud/2m8fn.png",class:"image desktop"},null,-1)),Dt=c(()=>t("img",{src:"https://cdn.acedata.cloud/23knvs.png",class:"image mobile"},null,-1)),Ht={key:4,id:"luma",class:"block"},Kt={class:"container"},Mt=c(()=>t("img",{src:"https://cdn.acedata.cloud/6kop1g.png",class:"image desktop"},null,-1)),Rt=c(()=>t("img",{src:"https://cdn.acedata.cloud/3kcjny.png",class:"image mobile"},null,-1)),Ut={class:"title"},Wt={class:"subtitle"},Gt={key:5,id:"headshots",class:"block"},Jt={class:"container"},Ot={class:"title"},Pt={class:"subtitle"},Qt=c(()=>t("img",{src:"https://cdn.acedata.cloud/zlyshj.png",class:"image desktop"},null,-1)),Xt=c(()=>t("img",{src:"https://cdn.acedata.cloud/8as0cx.png",class:"image mobile"},null,-1)),Yt={id:"comments"},Zt={class:"container"},ts={class:"title"},ss={class:"subtitle"},es={class:"content"},is={class:"info"},as={class:"left"},os={class:"right"},ns={class:"name"},ls={class:"job"};function ds(s,n,C,q,I,E){var v,$,g,y,k,x,N,B,S,V,F,L,z,T,A,D,H,K;const u=_("el-button"),o=_("el-col"),f=_("el-image"),d=_("el-row"),w=_("font-awesome-icon"),b=_("el-card");return r(),h("div",et,[t("div",it,[t("div",at,[e(d,null,{default:i(()=>[e(o,{md:12,xs:24,class:"left"},{default:i(()=>{var l;return[t("div",ot,[t("h1",nt,a((l=s.site)==null?void 0:l.title),1),t("h3",lt,a(s.$t("index.subtitle.banner")),1),t("div",dt,[e(u,{type:"primary",round:"",class:"btn-apply",onClick:n[0]||(n[0]=j=>s.$router.push({path:"/chat"}))},{default:i(()=>[m(a(s.$t("common.button.startForFree")),1)]),_:1})])])]}),_:1}),e(o,{md:12,xs:24,class:"right"},{default:i(()=>[e(f,{src:"https://cdn.acedata.cloud/illustration1.png",class:"brand"})]),_:1})]),_:1})])]),t("div",ct,[t("div",rt,[e(d,{class:"mb-6"},{default:i(()=>[e(o,{span:24},{default:i(()=>[t("h2",ut,a(s.$t("index.title.introduction")),1),t("h5",ht,a(s.$t("index.subtitle.introduction")),1)]),_:1})]),_:1}),e(d,{gutter:15},{default:i(()=>[(r(!0),h(M,null,R(s.capabilities,(l,j)=>(r(),U(o,{key:j,md:6,xs:24,class:"mb-4"},{default:i(()=>[e(b,{class:"info text-center",shadow:"hover"},{default:i(()=>[t("div",mt,[e(w,{icon:l.icon,class:"icon"},null,8,["icon"])]),t("h2",_t,a(l.title),1),t("p",pt,a(l.subtitle),1)]),_:2},1024)]),_:2},1024))),128))]),_:1})])]),(g=($=(v=s.site)==null?void 0:v.features)==null?void 0:$.chat)!=null&&g.enabled?(r(),h("div",ft,[t("div",bt,[e(d,null,{default:i(()=>[e(o,{md:16,xs:24,class:"preview"},{default:i(()=>[vt,$t]),_:1}),e(o,{md:8,xs:24,class:"info"},{default:i(()=>[t("h2",gt,a(s.$t("index.title.chat")),1),t("p",yt,a(s.$t("index.subtitle.chat")),1),e(u,{type:"primary",round:"",class:"btn-try",onClick:n[1]||(n[1]=l=>s.$router.push({path:"/chat"}))},{default:i(()=>[m(a(s.$t("index.button.try")),1)]),_:1})]),_:1})]),_:1})])])):p("v-if",!0),(x=(k=(y=s.site)==null?void 0:y.features)==null?void 0:k.midjourney)!=null&&x.enabled?(r(),h("div",kt,[t("div",xt,[e(d,null,{default:i(()=>[e(o,{md:8,xs:24,class:"info"},{default:i(()=>[t("h2",wt,a(s.$t("index.title.midjourney")),1),t("p",jt,a(s.$t("index.subtitle.midjourney")),1),e(u,{type:"primary",round:"",class:"btn-try",onClick:n[2]||(n[2]=l=>s.$router.push({path:"/midjourney"}))},{default:i(()=>[m(a(s.$t("index.button.try")),1)]),_:1})]),_:1}),e(o,{md:16,xs:24,class:"preview"},{default:i(()=>[Ct,qt]),_:1})]),_:1})])])):p("v-if",!0),(S=(B=(N=s.site)==null?void 0:N.features)==null?void 0:B.qrart)!=null&&S.enabled?(r(),h("div",It,[t("div",Et,[e(d,null,{default:i(()=>[e(o,{md:16,xs:24,class:"preview"},{default:i(()=>[Nt,Bt]),_:1}),e(o,{md:8,xs:24,class:"info"},{default:i(()=>[t("h2",St,a(s.$t("index.title.qrart")),1),t("p",Vt,a(s.$t("index.subtitle.qrart")),1),e(u,{type:"primary",round:"",class:"btn-try",onClick:n[3]||(n[3]=l=>s.$router.push({path:"/qrart"}))},{default:i(()=>[m(a(s.$t("index.button.try")),1)]),_:1})]),_:1})]),_:1})])])):p("v-if",!0),(L=(F=(V=s.site)==null?void 0:V.features)==null?void 0:F.suno)!=null&&L.enabled?(r(),h("div",Ft,[t("div",Lt,[e(d,null,{default:i(()=>[e(o,{md:8,xs:24,class:"info"},{default:i(()=>[t("h2",zt,a(s.$t("index.title.suno")),1),t("p",Tt,a(s.$t("index.subtitle.suno")),1),e(u,{type:"primary",round:"",class:"btn-try",onClick:n[4]||(n[4]=l=>s.$router.push({path:"/suno"}))},{default:i(()=>[m(a(s.$t("index.button.try")),1)]),_:1})]),_:1}),e(o,{md:16,xs:24,class:"preview"},{default:i(()=>[At,Dt]),_:1})]),_:1})])])):p("v-if",!0),(A=(T=(z=s.site)==null?void 0:z.features)==null?void 0:T.luma)!=null&&A.enabled?(r(),h("div",Ht,[t("div",Kt,[e(d,null,{default:i(()=>[e(o,{md:16,xs:24,class:"preview"},{default:i(()=>[Mt,Rt]),_:1}),e(o,{md:8,xs:24,class:"info"},{default:i(()=>[t("h2",Ut,a(s.$t("index.title.luma")),1),t("p",Wt,a(s.$t("index.subtitle.luma")),1),e(u,{type:"primary",round:"",class:"btn-try",onClick:n[5]||(n[5]=l=>s.$router.push({path:"/luma"}))},{default:i(()=>[m(a(s.$t("index.button.try")),1)]),_:1})]),_:1})]),_:1})])])):p("v-if",!0),(K=(H=(D=s.site)==null?void 0:D.features)==null?void 0:H.headshots)!=null&&K.enabled?(r(),h("div",Gt,[t("div",Jt,[e(d,null,{default:i(()=>[e(o,{md:8,xs:24,class:"info"},{default:i(()=>[t("h2",Ot,a(s.$t("index.title.headshots")),1),t("p",Pt,a(s.$t("index.subtitle.headshots")),1),e(u,{type:"primary",round:"",class:"btn-try",onClick:n[6]||(n[6]=l=>s.$router.push({path:"/headshots"}))},{default:i(()=>[m(a(s.$t("index.button.try")),1)]),_:1})]),_:1}),e(o,{md:16,xs:24,class:"preview"},{default:i(()=>[Qt,Xt]),_:1})]),_:1})])])):p("v-if",!0),t("div",Yt,[t("div",Zt,[e(d,{class:"mb-6"},{default:i(()=>[e(o,{span:24},{default:i(()=>[t("h2",ts,a(s.$t("index.title.comments")),1),t("h5",ss,a(s.$t("index.subtitle.comments")),1)]),_:1})]),_:1}),e(d,{gutter:20,class:"main"},{default:i(()=>[(r(!0),h(M,null,R(s.comments,(l,j)=>(r(),U(o,{key:j,md:8,xs:24},{default:i(()=>[e(b,{shadow:"hover",class:"service","body-style":{padding:0}},{default:i(()=>[t("p",es,a(l.content),1),t("div",is,[t("div",as,[e(f,{class:"avatar",src:l.avatar},null,8,["src"])]),t("div",os,[t("div",ns,a(l.name),1),t("div",ls,a(l.job),1)])])]),_:2},1024)]),_:2},1024))),128))]),_:1})])])])}var fs=G(st,[["render",ds],["__scopeId","data-v-d9c0303e"],["__file","/home/runner/work/Nexior/Nexior/src/pages/index/Index.vue"]]);export{fs as default};
|