@acedatacloud/nexior 3.276.13 → 3.277.0
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/{ApiCodeButton-Bbnpv2we.js → ApiCodeButton-JslKaNUM.js} +1 -1
- package/dist/assets/{AskUserQuestionCard-BVxoetPM.js → AskUserQuestionCard-CcMdElAC.js} +1 -1
- package/dist/assets/{Auth-CNen58mm.js → Auth-PthS_Uhp.js} +1 -1
- package/dist/assets/{Bare-CGAgBPOB.js → Bare-DoctV1-6.js} +1 -1
- package/dist/assets/{BotPlaceholder-DwmD_q7g.js → BotPlaceholder-DNd2OaW9.js} +1 -1
- package/dist/assets/{BottomFooter-CEzUsQct.js → BottomFooter-tHVRdv9h.js} +1 -1
- package/dist/assets/{Callback-iH6gl5RZ.js → Callback-DBoJqURG.js} +1 -1
- package/dist/assets/{Console-D-TGm246.js → Console-CcKwTCT_.js} +1 -1
- package/dist/assets/{Consumption-fBw5c2fv.js → Consumption-Bx30TMJY.js} +1 -1
- package/dist/assets/{Conversation-Db8OI0L6.js → Conversation-D3uwrcNh.js} +1 -1
- package/dist/assets/{CopyToClipboard-Dw5puTqb.js → CopyToClipboard-INstPmp0.js} +1 -1
- package/dist/assets/{Detail-CwyQYM3g.js → Detail-B81Z1Wxb.js} +2 -2
- package/dist/assets/{Extra-BBboONST.js → Extra-7go4HGej.js} +1 -1
- package/dist/assets/{FilePreview-QJNK0WA2.js → FilePreview-CONuDKS7.js} +1 -1
- package/dist/assets/{Hailuo-oOc1n_8n.js → Hailuo-DihR8fhb.js} +1 -1
- package/dist/assets/{History-DUBBRNc_.js → History-Cn4pMdGL.js} +1 -1
- package/dist/assets/{ImagePreview-j8UOiTmY.js → ImagePreview-C0e5HPdV.js} +1 -1
- package/dist/assets/{ImageWrapper-B2i7ZIND.js → ImageWrapper-gfMtBxa-.js} +1 -1
- package/dist/assets/{Index-CDkRF2hQ.js → Index-0TPpJgrL.js} +1 -1
- package/dist/assets/{Index-Craz4iUs.js → Index-AyaXBEAk.js} +1 -1
- package/dist/assets/{Index-bZ2eC93Z.js → Index-BDsm6Tel.js} +1 -1
- package/dist/assets/{Index-DSkkPOuY.js → Index-BEYu6kYg.js} +1 -1
- package/dist/assets/{Index-UHom_TYH.js → Index-BGkRiWX5.js} +1 -1
- package/dist/assets/{Index-tJVQwQxJ.js → Index-BUpZLm5i.js} +1 -1
- package/dist/assets/{Index-eUm2e3Dg.js → Index-BYm7lM8E.js} +1 -1
- package/dist/assets/{Index-Cic686gl.js → Index-Bbjh8jK1.js} +1 -1
- package/dist/assets/{Index-CWc2Xre6.js → Index-BkHiR8u6.js} +1 -1
- package/dist/assets/{Index-DrYXsJXl.js → Index-C2ZGI30Q.js} +1 -1
- package/dist/assets/{Index-DqWmPcIJ.js → Index-CBIvbCwp.js} +1 -1
- package/dist/assets/{Index-CFo7aI_z.js → Index-CHOgpUEs.js} +1 -1
- package/dist/assets/{Index-D21pa7we.js → Index-CHU9qiq2.js} +1 -1
- package/dist/assets/{Index-Cf2TydGq.js → Index-CK7vJq3w.js} +1 -1
- package/dist/assets/{Index-d-cy26fm.js → Index-CKpz7J5e.js} +1 -1
- package/dist/assets/{Index-t6Jgc_Ua.js → Index-CZpDWcCS.js} +1 -1
- package/dist/assets/{Index-PwBzw5zz.js → Index-CevKROvB.js} +1 -1
- package/dist/assets/{Index-Csm8l8XE.js → Index-D1GenG08.js} +1 -1
- package/dist/assets/Index-D3Bo04i1.js +1 -0
- package/dist/assets/{Index-DRkOF5di.js → Index-D3UD4Qpr.js} +1 -1
- package/dist/assets/{Index-DCtMoJPV.js → Index-DpG1wWSM.js} +1 -1
- package/dist/assets/{Index-BuHPy3VQ.js → Index-DpjFAcc-.js} +1 -1
- package/dist/assets/{Index-BTdyPJrt.js → Index-LWd1v-VZ.js} +1 -1
- package/dist/assets/{Index-D-F8ZQNH.css → Index-ehaGrC3m.css} +1 -1
- package/dist/assets/{Index-B4FOwiSY.js → Index-jrRkOkb6.js} +1 -1
- package/dist/assets/{Index-Dt5nN_pF.js → Index-khg5YzAO.js} +1 -1
- package/dist/assets/{Index-CiXvUNJ8.js → Index-x7exlMj0.js} +1 -1
- package/dist/assets/{Invitees-X-GM1iAs.js → Invitees-Dtb1JMDn.js} +1 -1
- package/dist/assets/{List-Dule_pxm.js → List-CGBU6Njz.js} +1 -1
- package/dist/assets/{List-C57rcn3v.js → List-Ct6OFD1r.js} +1 -1
- package/dist/assets/{List-BjzUfDGL.js → List-Ja4BLrXN.js} +1 -1
- package/dist/assets/{Main-0LOwc6E9.js → Main-CWnXP_zj.js} +1 -1
- package/dist/assets/{Model-CzvoV7ym.js → Model-DC_3rb3i.js} +1 -1
- package/dist/assets/{Navigator-D31Vqv1W.js → Navigator-Chx3F58U.js} +1 -1
- package/dist/assets/{NoTasks-vOEmwSFQ.js → NoTasks-CbTGc8HF.js} +1 -1
- package/dist/assets/{NotFound-g-g99Hgd.js → NotFound-BcKEhgLQ.js} +1 -1
- package/dist/assets/{Pagination-BrKhHCVU.js → Pagination-Df0sU4Ck.js} +1 -1
- package/dist/assets/{Pay-CasL-0lk.js → Pay-DpHGJfcX.js} +1 -1
- package/dist/assets/{Player-BeKsc7BW.js → Player-Ba9Hff1B.js} +1 -1
- package/dist/assets/{Seedance-aCh0t58m.js → Seedance-hXaXRqS-.js} +1 -1
- package/dist/assets/{Status-BZbIXVeT.js → Status-N4qERH6G.js} +1 -1
- package/dist/assets/{Subscribe-DFm1FT9k.js → Subscribe-CgI3I7kI.js} +1 -1
- package/dist/assets/{TabSwitcher-ChpsZAHj.js → TabSwitcher-v1VJ0YG0.js} +1 -1
- package/dist/assets/{Tts-DHy0H9vF.js → Tts-p73RSsZg.js} +1 -1
- package/dist/assets/{VideoPlayer-C6O7JCcj.js → VideoPlayer-CYLsmg3y.js} +1 -1
- package/dist/assets/{avatar-CJaAkR4u.js → avatar-B_d4BA4I.js} +1 -1
- package/dist/assets/{basic-fTQpqVx3.js → basic-DEQcMYsH.js} +1 -1
- package/dist/assets/{chat-4c2gdzaU.js → chat-SOwiU-QU.js} +1 -1
- package/dist/assets/codingBridge-CW33hJWo.js +2 -0
- package/dist/assets/{codingBridgeNotify-Cd3sO6PS.js → codingBridgeNotify-Bndgmo03.js} +2 -2
- package/dist/assets/{collapse-6hEfnElE.js → collapse-gdZ6e_Uj.js} +1 -1
- package/dist/assets/{createTaskActions-Bqo-fGQq.js → createTaskActions-CrM4y9g0.js} +1 -1
- package/dist/assets/{date-picker-BULvgRJu.js → date-picker-B_QvuSxE.js} +1 -1
- package/dist/assets/{dropdown-CPemIUgw.js → dropdown-CDgvoM6y.js} +1 -1
- package/dist/assets/{esm-B09dJTiV.js → esm-1WtclWk7.js} +2 -2
- package/dist/assets/{esm-CSszv0A8.js → esm-BV_ajEZR.js} +1 -1
- package/dist/assets/{esm-C_mhJFSi.js → esm-BfaOPseV.js} +2 -2
- package/dist/assets/{esm-dDvPMSAk.js → esm-CqW5JcPc.js} +1 -1
- package/dist/assets/{esm-B-63frdI.js → esm-CuRvmdN1.js} +1 -1
- package/dist/assets/esm-a3SiY5XV.js +1 -0
- package/dist/assets/{esm-BwKgXwfT.js → esm-vJEs-cUS.js} +3 -3
- package/dist/assets/{fish-D0MRHzev.js → fish-BLlURWuH.js} +1 -1
- package/dist/assets/{flux-Q8UP_79t.js → flux-BsBufIm2.js} +1 -1
- package/dist/assets/{grokvideo-BmGuOcoY.js → grokvideo-1atazDOv.js} +1 -1
- package/dist/assets/{hailuo-D4t3b5r0.js → hailuo-C5k225-V.js} +1 -1
- package/dist/assets/{headshots-oed2z6H2.js → headshots-DqX1pQdy.js} +1 -1
- package/dist/assets/{image-DhZ3AYYg.js → image-s5BzYxHs.js} +1 -1
- package/dist/assets/{index-CZaid7Ez.js → index-C8DeSrkP.js} +3 -3
- package/dist/assets/{index.browser.esm-DP3TGf8g.js → index.browser.esm-Djw2r9YD.js} +1 -1
- package/dist/assets/{index.es-SMgxJgUT.js → index.es-CNg3jcG4.js} +1 -1
- package/dist/assets/{input-number-BLiYIcDP.js → input-number-BaYFVx7i.js} +1 -1
- package/dist/assets/{kling-BzClI2Ea.js → kling-CzFhj2qi.js} +1 -1
- package/dist/assets/{luma-DU9G57WM.js → luma-DoKCLeYT.js} +1 -1
- package/dist/assets/{midjourney-Cc0ajBsl.js → midjourney-SBz8Rv4e.js} +1 -1
- package/dist/assets/{nanobanana-BY58gC77.js → nanobanana-DVRzRRfx.js} +1 -1
- package/dist/assets/{openaiimage-tGjAf4lm.js → openaiimage-BXJslsfR.js} +1 -1
- package/dist/assets/{pagination-8ujfpoRu.js → pagination-BzLQVoO2.js} +1 -1
- package/dist/assets/{pika-CgJnavji.js → pika-C0B3w9GE.js} +1 -1
- package/dist/assets/{pixverse-BCJeX-Nw.js → pixverse-BQrC_6H4.js} +1 -1
- package/dist/assets/{popover-l_NEWD77.js → popover-B7llv1ai.js} +1 -1
- package/dist/assets/{producer-D4z9F8wF.js → producer-BDz1Axsi.js} +1 -1
- package/dist/assets/{qrart-BBrOqeL5.js → qrart-Dvzt1pTK.js} +1 -1
- package/dist/assets/{row-UUMjQQpA.js → row-BIHOnour.js} +1 -1
- package/dist/assets/{seedance-dkFENRGb.js → seedance-w8BxsLrh.js} +1 -1
- package/dist/assets/{seedream-pZlfw7_H.js → seedream-OwdQZN66.js} +1 -1
- package/dist/assets/{select-BdxNJvVA.js → select-HUfkzAuQ.js} +1 -1
- package/dist/assets/{serp-FUo1xZRs.js → serp-oK8FUoet.js} +1 -1
- package/dist/assets/{slider-DCyKC0oi.js → slider-SWgsI1lB.js} +1 -1
- package/dist/assets/{solana-wallets-BUDqS69n.js → solana-wallets-GKhlDbjz.js} +2 -2
- package/dist/assets/{solana-wallets-vue-Dpf0qyDD.js → solana-wallets-vue-DiNcXvde.js} +1 -1
- package/dist/assets/{sora-BlVuN_Ii.js → sora-DFMERr05.js} +1 -1
- package/dist/assets/{suno-CMBHVDrg.js → suno-CStTArdP.js} +1 -1
- package/dist/assets/{switch-BLmaNxij.js → switch-BZlJomEZ.js} +1 -1
- package/dist/assets/{tabs-Vpcr2eiv.js → tabs-D-2tTItb.js} +1 -1
- package/dist/assets/{upload-cst9ChUG.js → upload-C64n6FiS.js} +1 -1
- package/dist/assets/{veo-CxUtDftf.js → veo-Dj5gemtN.js} +1 -1
- package/dist/assets/{wan-CWDRGL7F.js → wan-Bb0xxfUy.js} +1 -1
- package/dist/assets/{web-CxcIP-Cm.js → web-Bh3wag1G.js} +1 -1
- package/dist/assets/{web-CVFBwohm.js → web-C9iCm_h9.js} +1 -1
- package/dist/assets/{web-DjicWepk.js → web-CC9BNIME.js} +1 -1
- package/dist/assets/{web-GneIBay4.js → web-DPIR5ZBO.js} +1 -1
- package/dist/assets/{web-c3SDcorL.js → web-DpaXgHLA.js} +1 -1
- package/dist/assets/{webextrator-I0TZD5lE.js → webextrator-Bh2daIlB.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/Index-81Ej0AoN.js +0 -1
- package/dist/assets/codingBridge-Dgq-US77.js +0 -2
- package/dist/assets/esm-DS6UqAt9.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{$ as e,Bt as t,D as n,E as r,M as i,N as a,O as o,P as s,Q as c,Ut as l,X as u,_ as d,et as f,k as p,lt as m,ut as h,x as g,y as _}from"./vendor-chart-mdwpew_o.js";import{t as v}from"./button-DWzbdjZV.js";import{n as y,r as b,t as x}from"./select-BdxNJvVA.js";import{t as S}from"./upload-cst9ChUG.js";import{t as C}from"./tooltip-C3PYfh8V.js";import{t as w}from"./image-DhZ3AYYg.js";import{t as T}from"./alert-BJj7gY4q.js";import{t as E}from"./drawer-BvYPSxXh.js";import{t as D}from"./input-number-BLiYIcDP.js";import{t as O}from"./switch-BLmaNxij.js";import{Cn as k,Sn as A,_n as j,dn as M,fn as N,gn as P,hn as ee,mn as te,pi as ne,pn as re,vn as ie,xn as F,yn as I}from"./constants-C-bSXdJ_.js";import{At as L,E as R,Fn as z,Nt as B,Ot as V,Sr as H,en as U,kr as W,kt as G,yr as K}from"./index-CZaid7Ez.js";import{t as q}from"./index.es-SMgxJgUT.js";import{t as J}from"./CopyToClipboard-Dw5puTqb.js";import{t as Y}from"./ImagePreview-j8UOiTmY.js";import{n as ae}from"./taskDrawerMixin-Cr17Yxqk.js";import{t as oe}from"./BotPlaceholder-DwmD_q7g.js";import{i as X,n as se,t as ce}from"./pagination-8ujfpoRu.js";import{n as le,t as ue}from"./NoTasks-vOEmwSFQ.js";import{t as de}from"./Consumption-fBw5c2fv.js";import{t as fe}from"./ApiCodeButton-Bbnpv2we.js";import{t as pe}from"./ImageWrapper-B2i7ZIND.js";var me=s({name:`LayoutNanobanana`,components:{ElDrawer:E,ElButton:v,FontAwesomeIcon:q},mixins:[ae]}),he={class:`main flex flex-row flex-1`},ge={class:`config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},_e={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function ve(t,n,i,o,s,c){let l=f(`font-awesome-icon`),g=f(`el-button`),_=f(`el-drawer`);return u(),p(`div`,he,[r(`div`,ge,[e(t.$slots,`config`,{},void 0,!0)]),r(`div`,_e,[e(t.$slots,`result`,{},void 0,!0)]),h(a(g,{circle:``,class:`menu`,onClick:n[0]||=e=>t.drawer=!0},{default:m(()=>[a(l,{icon:`fa-solid fa-magic`})]),_:1},512),[[d,!t.tasksEmpty]]),a(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer`},{default:m(()=>[e(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var ye=R(me,[[`render`,ve],[`__scopeId`,`data-v-cca80bbd`]]),be=s({name:`PromptInput`,components:{PromptTextarea:le},computed:{prompt:{get(){return this.$store.state.openaiimage?.config?.prompt},set(e){this.$store.commit(`openaiimage/setConfig`,{...this.$store.state.openaiimage?.config,prompt:e})}}},mounted(){this.prompt||=``}});function xe(e,t,r,i,a,o){let s=f(`prompt-textarea`);return u(),n(s,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`openaiimage.name.prompt`),info:e.$t(`openaiimage.description.prompt`),placeholder:e.$t(`openaiimage.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Se=R(be,[[`render`,xe]]),Ce=s({name:`ImageUrlsInput`,components:{ElUpload:S,ElButton:v,InfoIcon:X,ImagePreview:Y,FontAwesomeIcon:q},mixins:[G],data(){return{fileList:[],uploadUrl:H()+`/api/v1/files/`,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.openaiimage?.config?.image_urls}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){let e=(this.fileList||[]).filter(e=>!e?.response?.file_url);this.fileList=e.length?e:[];return}let t=[];e.forEach(e=>{let n=this.fileList.find(t=>t?.response?.file_url===e||t?.url===e);n?t.push(n):t.push({name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}})}),(this.fileList||[]).filter(e=>!e?.response?.file_url).forEach(e=>{t.some(t=>t===e||t?.url===e?.url||t?.response?.file_url===e?.response?.file_url)||t.push(e)}),this.fileList=t}}},mounted(){},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url==`string`&&e.url.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImageUrls()},onExceed(){W.warning(this.$t(`openaiimage.message.uploadImageExceed`))},onError(){W.error(this.$t(`openaiimage.message.uploadImageError`))},onSetImageUrls(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`openaiimage/setConfig`,{...this.$store.state.openaiimage?.config,image_urls:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImageUrls()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImageUrls()}}}),we={class:`field flex items-center justify-between`},Te={class:`title font-bold text-[14px] mb-[10px]`},Ee={class:`upload-wrapper flex flex-col items-start gap-[8px]`},De={class:`controls flex items-center`},Oe={class:`file-list flex flex-wrap gap-[10px]`};function ke(e,t,o,s,d,h){let _=f(`font-awesome-icon`),v=f(`el-button`),y=f(`el-upload`),b=f(`info-icon`),x=f(`image-preview`);return u(),p(g,null,[r(`div`,we,[r(`h2`,Te,l(e.$t(`openaiimage.name.imageUrls`)),1),r(`div`,Ee,[r(`div`,De,[a(y,{"file-list":e.fileList,"onUpdate:fileList":t[0]||=t=>e.fileList=t,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value`,limit:5,multiple:!0,"show-file-list":!1,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,"on-change":e.onChange,"on-remove":e.onRemove,headers:e.headers},{default:m(()=>[a(v,{size:`small`,type:`primary`,round:``},{default:m(()=>[a(_,{icon:`fa-solid fa-upload`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`]),a(b,{content:e.$t(`openaiimage.description.imageUrls`),class:`ml-2`},null,8,[`content`])])])]),r(`div`,Oe,[(u(!0),p(g,null,c(e.fileList,(t,r)=>(u(),n(x,{key:t.uid||t?.response?.file_url||t.url||r,url:t.url||t?.response?.file_url,name:t.name,percentage:t.percentage,onRemove:n=>e.onRemovePreview(r,t)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])],64)}var Ae=R(Ce,[[`render`,ke]]),je=s({name:`OpenAIImageModelSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:X},data(){return{options:[{value:P,label:this.$t(`openaiimage.model.gptImage1`)},{value:j,label:this.$t(`openaiimage.model.gptImage15`)},{value:ie,label:this.$t(`openaiimage.model.gptImage2`)}]}},computed:{value:{get(){return this.$store.state.openaiimage?.config?.model},set(e){this.$store.commit(`openaiimage/setConfig`,{...this.$store.state.openaiimage?.config,model:e})}},modelDescription(){return this.$t(`openaiimage.description.model`)}},mounted(){this.value||=te}}),Me={class:`field`},Ne={class:`label`},Pe={class:`box`},Fe={class:`title font-bold`};function Ie(e,t,i,o,s,d){let h=f(`info-icon`),_=f(`el-option`),v=f(`el-select`);return u(),p(`div`,Me,[r(`div`,Ne,[r(`div`,Pe,[r(`h2`,Fe,l(e.$t(`openaiimage.name.model`)),1),a(h,{content:e.modelDescription,class:`info`},null,8,[`content`])])]),a(v,{modelValue:e.value,"onUpdate:modelValue":t[0]||=t=>e.value=t,class:`value`,placeholder:e.$t(`openaiimage.placeholder.select`)},{default:m(()=>[(u(!0),p(g,null,c(e.options,e=>(u(),n(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Le=R(je,[[`render`,Ie],[`__scopeId`,`data-v-cec771bd`]]);function Z(e){if(!e)return;let t=/^(\d+)x(\d+)$/.exec(e);if(t)return{w:Number(t[1]),h:Number(t[2])}}var Re=s({name:`OpenAIImageSizeSelector`,components:{ElSelect:b,ElOption:x,ElOptionGroup:y,ElSwitch:O,ElInputNumber:D,InfoIcon:X},data(){return{customMode:!1,customWidth:1024,customHeight:1024}},computed:{model(){return this.$store.state.openaiimage?.config?.model||`gpt-image-2`},storedSize(){return this.$store.state.openaiimage?.config?.size},emptySizeValue(){return``},customSupported(){return re.includes(this.model)},presets(){return I[this.model]??I[`gpt-image-2`]??[]},presetGroups(){return this.model===`gpt-image-2`?[{label:this.$t(`openaiimage.sizeGroup.standard1k`),options:F},{label:this.$t(`openaiimage.sizeGroup.preset2k`),options:A},{label:this.$t(`openaiimage.sizeGroup.preset4k`),options:k}]:[{label:this.$t(`openaiimage.sizeGroup.standard1k`),options:this.presets}]},useCustom:{get(){return this.customSupported&&this.customMode},set(e){if(!(e&&!this.customSupported))if(this.customMode=e,e){if(this.customError)return;this.commitSize(`${this.customWidth}x${this.customHeight}`)}else this.commitSize()}},presetValue:{get(){let e=this.storedSize;return e&&this.presets.includes(e)?e:this.emptySizeValue},set(e){this.customMode=!1,this.commitSize(e||void 0)}},multiple(){return 16},minSide(){return 256},maxSide(){return M},customError(){let e=this.customWidth,t=this.customHeight;return!Number.isFinite(e)||!Number.isFinite(t)||e<=0||t<=0?this.$t(`openaiimage.error.customSizePositive`):e%this.multiple!==0||t%this.multiple!==0?this.$t(`openaiimage.error.customSizeMultiple`,{multiple:this.multiple}):e<this.minSide||t<this.minSide?this.$t(`openaiimage.error.customSizeMin`,{min:this.minSide}):Math.max(e,t)>this.maxSide?this.$t(`openaiimage.error.customSizeMax`,{max:this.maxSide}):e*t>8294400?this.$t(`openaiimage.error.customSizePixels`,{pixels:N.toLocaleString()}):``}},watch:{model:{immediate:!1,handler(){this.customSupported||(this.customMode=!1);let e=this.storedSize;if(!e||this.presets.includes(e))return;let t=Z(e);t&&this.customSupported&&(this.customMode=!0,this.customWidth=t.w,this.customHeight=t.h,!this.customError)||this.commitSize()}},storedSize(e){if(!e){this.customMode=!1;return}if(this.presets.includes(e)){this.customMode=!1;return}let t=Z(e);t&&this.customSupported&&(this.customMode=!0,this.customWidth!==t.w&&(this.customWidth=t.w),this.customHeight!==t.h&&(this.customHeight=t.h))},customWidth(){this.syncCustomToStore()},customHeight(){this.syncCustomToStore()}},mounted(){let e=this.storedSize,t=Z(e);e&&t&&this.customSupported&&!this.presets.includes(e)&&(this.customMode=!0,this.customWidth=t.w,this.customHeight=t.h)},methods:{commitSize(e){let t={...this.$store.state.openaiimage?.config};e?t.size=e:delete t.size,this.$store.commit(`openaiimage/setConfig`,t)},syncCustomToStore(){this.useCustom&&(this.customError||this.commitSize(`${this.customWidth}x${this.customHeight}`))}}}),ze={class:`resolution`},Be={class:`field`},Ve={class:`label`},He={class:`box`},Ue={class:`title font-bold`},We={class:`field custom-toggle`},Ge={class:`label`},Ke={class:`box`},qe={class:`title font-bold`},Je={key:0,class:`custom-inputs`},Ye={class:`row`},Xe={class:`row-label`},Ze={class:`row`},Qe={class:`row-label`},$e={key:0,class:`error`};function et(e,t,i,s,d,h){let _=f(`info-icon`),v=f(`el-option`),y=f(`el-option-group`),b=f(`el-select`),x=f(`el-switch`),S=f(`el-input-number`);return u(),p(`div`,ze,[r(`div`,Be,[r(`div`,Ve,[r(`div`,He,[r(`h2`,Ue,l(e.$t(`openaiimage.name.size`)),1),a(_,{content:e.$t(`openaiimage.description.size`),class:`info`},null,8,[`content`])])]),a(b,{modelValue:e.presetValue,"onUpdate:modelValue":t[0]||=t=>e.presetValue=t,class:`value`,placeholder:e.$t(`openaiimage.placeholder.select`),disabled:e.useCustom},{default:m(()=>[a(v,{label:e.$t(`suno.gender.auto`),value:e.emptySizeValue},null,8,[`label`,`value`]),(u(!0),p(g,null,c(e.presetGroups,e=>(u(),n(y,{key:e.label,label:e.label},{default:m(()=>[(u(!0),p(g,null,c(e.options,e=>(u(),n(v,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128))]),_:2},1032,[`label`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`])]),e.customSupported?(u(),p(g,{key:0},[r(`div`,We,[r(`div`,Ge,[r(`div`,Ke,[r(`h2`,qe,l(e.$t(`openaiimage.name.customSize`)),1),a(_,{content:e.$t(`openaiimage.description.customSize`),class:`info`},null,8,[`content`])])]),a(x,{modelValue:e.useCustom,"onUpdate:modelValue":t[1]||=t=>e.useCustom=t,class:`value-switch`},null,8,[`modelValue`])]),e.useCustom?(u(),p(`div`,Je,[r(`div`,Ye,[r(`span`,Xe,l(e.$t(`openaiimage.name.width`)),1),a(S,{modelValue:e.customWidth,"onUpdate:modelValue":t[2]||=t=>e.customWidth=t,class:`row-input`,min:e.minSide,max:e.maxSide,step:e.multiple,"step-strictly":!0,"controls-position":`right`},null,8,[`modelValue`,`min`,`max`,`step`])]),r(`div`,Ze,[r(`span`,Qe,l(e.$t(`openaiimage.name.height`)),1),a(S,{modelValue:e.customHeight,"onUpdate:modelValue":t[3]||=t=>e.customHeight=t,class:`row-input`,min:e.minSide,max:e.maxSide,step:e.multiple,"step-strictly":!0,"controls-position":`right`},null,8,[`modelValue`,`min`,`max`,`step`])]),e.customError?(u(),p(`div`,$e,l(e.customError),1)):o(``,!0)])):o(``,!0)],64)):o(``,!0)])}var tt=s({name:`ConfigPanel`,components:{ElButton:v,FontAwesomeIcon:q,PromptInput:Se,Consumption:de,ImageUrlsInput:Ae,ModelSelector:Le,ResolutionSelector:R(Re,[[`render`,et],[`__scopeId`,`data-v-d5544d69`]])},emits:[`generate`],computed:{config(){return this.$store.state.openaiimage?.config},consumption(){return B({...this.config||{}},this.service?.cost)},service(){return this.$store.state.openaiimage?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),nt={class:`flex flex-col h-full`},rt={class:`flex-1 overflow-y-auto p-5`},it={class:`flex flex-col items-center justify-center px-5 pb-5`};function at(e,t,n,o,s,c){let d=f(`model-selector`),h=f(`resolution-selector`),g=f(`prompt-input`),_=f(`image-urls-input`),v=f(`consumption`),y=f(`font-awesome-icon`),b=f(`el-button`);return u(),p(`div`,nt,[r(`div`,rt,[a(d,{class:`mb-4`}),a(h,{class:`mb-4`}),a(g,{class:`mb-4`}),a(_,{class:`mb-4`})]),r(`div`,it,[a(v,{value:e.consumption,service:e.service},null,8,[`value`,`service`]),a(b,{type:`primary`,class:`btn w-full`,round:``,onClick:e.onGenerate},{default:m(()=>[a(y,{icon:`fa-solid fa-magic`,class:`mr-2`}),i(` `+l(e.$t(`openaiimage.button.generate`)),1)]),_:1},8,[`onClick`])])])}var ot=R(tt,[[`render`,at]]),st=s({name:`TaskPreview`,components:{ElImage:w,CopyToClipboard:J,FontAwesomeIcon:q,ElAlert:T,ImageWrapper:pe,ElButton:v,ElTooltip:C,ImagePreview:Y,ApiCodeButton:fe},props:{modelValue:{type:Object,required:!0}},setup(){return{OPENAIIMAGE_LOGO:ee}},computed:{isEditRequest(){let e=this.modelValue?.request;return this.modelValue?.type===`images_edits`||e?.action===`edit`||this.referenceImages.length>0},showTaskType(){return!!(this.modelValue?.request?.action||this.modelValue?.type||this.referenceImages.length>0)},taskTypeLabel(){return this.isEditRequest?this.$t(`openaiimage.name.edits`):this.$t(`openaiimage.name.generate`)},openaiimagePath(){return this.isEditRequest?`/openai/images/edits`:`/openai/images/generations`},openaiimageCodeBody(){let e=this.modelValue?.request;if(!e)return;let t={...e};if(delete t.action,delete t.callback_url,this.isEditRequest){delete t.image_urls,delete t.image;let e=this.referenceImages;e.length===1?t.image=e[0]:e.length>1&&(t.image=e)}else delete t.image_urls,delete t.image;return t},images(){let e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{let n=t;if(n?.image_url||n?.url){e.push(n);return}n?.b64_json&&e.push({...n,url:`data:image/png;base64,${n.b64_json}`})}),e},referenceImages(){let e=this.modelValue?.request;if(!e)return[];let t=Array.isArray(e.image_urls)?e.image_urls:[];if(t.length>0)return t.filter(e=>typeof e==`string`&&e.length>0);let n=e.image;return Array.isArray(n)?n.filter(e=>typeof e==`string`&&e.length>0):typeof n==`string`&&n.length>0?[n]:Array.isArray(e.images)?e.images.map(e=>{if(typeof e==`string`)return e;if(e&&typeof e==`object`)return e.image_url}).filter(e=>typeof e==`string`&&e.length>0):[]}},methods:{onEdit(e){if(!e)return;console.debug(`Edit image:`,e);let t={...this.$store.state.openaiimage?.config||{}};t.image_urls=[e],this.$store.commit(`openaiimage/setConfig`,t)}}}),ct={class:`preview`},lt={class:`left`},ut={class:`main`},dt={class:`bot`},ft={class:`datetime`},pt={class:`info`},mt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},ht={key:1,class:`prompt mt-2`},gt={key:0},_t={key:0,class:t({content:!0,failed:!0})},vt={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},yt={class:t({operations:!0,"mt-2":!0,"mb-2":!0})},bt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},xt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},St={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ct={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},wt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Tt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Et={key:1,class:t({content:!0})},Dt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ot={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},kt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},At={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},jt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Mt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Nt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Pt={key:2,class:t({content:!0})},Q={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ft={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},It={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Lt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`};function Rt(e,t,s,d,h,v){let y=f(`el-image`),b=f(`image-preview`),x=f(`image-wrapper`),S=f(`el-button`),C=f(`el-tooltip`),w=f(`api-code-button`),T=f(`font-awesome-icon`),E=f(`copy-to-clipboard`),D=f(`el-alert`);return u(),p(`div`,ct,[r(`div`,lt,[a(y,{src:e.OPENAIIMAGE_LOGO,class:`avatar`},null,8,[`src`])]),r(`div`,ut,[r(`div`,dt,[i(l(e.$t(`openaiimage.name.openaiimageBot`))+` `,1),r(`span`,ft,l(e.$dayjs.format(``+new Date(parseFloat((e.modelValue?.created_at||``).toString())*1e3))),1)]),r(`div`,pt,[e.referenceImages.length>0?(u(),p(`div`,mt,[(u(!0),p(g,null,c(e.referenceImages,(e,t)=>(u(),n(b,{key:t,url:e,name:`image-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),e.modelValue?.request?.prompt?(u(),p(`p`,ht,[i(l(e.modelValue?.request?.prompt)+` `,1),e.modelValue?.response?o(``,!0):(u(),p(`span`,gt,` - (`+l(e.$t(`openaiimage.status.pending`))+`) `,1))])):o(``,!0)]),e.modelValue?.response?.success===!0?(u(),p(`div`,_t,[r(`div`,vt,[(u(!0),p(g,null,c(e.images,(e,t)=>(u(),n(x,{key:t,src:e?.image_url||e?.url||``,"raw-src":e?.image_url||e?.url||``},null,8,[`src`,`raw-src`]))),128))]),r(`div`,yt,[a(C,{class:`box-item`,effect:`dark`,content:e.$t(`common.button.edit`),placement:`top-start`},{default:m(()=>[a(S,{type:`info`,size:`small`,class:`btn-action`,onClick:t[0]||=_(t=>e.onEdit(e.images?.[0]?.image_url||e.images?.[0]?.url),[`stop`])},{default:m(()=>[i(l(e.$t(`common.button.edit`)),1)]),_:1})]),_:1},8,[`content`]),a(w,{path:e.openaiimagePath,body:e.openaiimageCodeBody},null,8,[`path`,`body`])]),a(D,{closable:!1,class:`mt-2 success`},{default:m(()=>[e.modelValue?.request?.model?(u(),p(`p`,bt,[a(T,{icon:`fa-solid fa-cube`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.model`))+`: `+l(e.modelValue?.request?.model),1)])):o(``,!0),e.modelValue?.request?.size?(u(),p(`p`,xt,[a(T,{icon:`fa-solid fa-image`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.size`))+`: `+l(e.modelValue?.request?.size),1)])):o(``,!0),e.showTaskType?(u(),p(`p`,St,[a(T,{icon:`fa-solid fa-bolt`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.task`))+`: `+l(e.taskTypeLabel),1)])):o(``,!0),r(`p`,Ct,[a(T,{icon:`fa-solid fa-magic`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.taskId`))+`: `+l(e.modelValue?.id)+` `,1),a(E,{content:e.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),e.modelValue?.elapsed?(u(),p(`p`,wt,[a(T,{icon:`fa-solid fa-clock`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.elapsed`))+`: `+l(e.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),e.modelValue?.response?.trace_id?(u(),p(`p`,Tt,[a(T,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.traceId`))+`: `+l(e.modelValue?.response?.trace_id)+` `,1),a(E,{content:e.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):e.modelValue?.response?.success===!1?(u(),p(`div`,Et,[a(D,{closable:!1,class:`failure`},{template:m(()=>[a(T,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.failure`)),1)]),default:m(()=>[e.modelValue?.request?.model?(u(),p(`p`,Dt,[a(T,{icon:`fa-solid fa-cube`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.model`))+`: `+l(e.modelValue?.request?.model),1)])):o(``,!0),e.modelValue?.request?.size?(u(),p(`p`,Ot,[a(T,{icon:`fa-solid fa-image`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.size`))+`: `+l(e.modelValue?.request?.size),1)])):o(``,!0),e.showTaskType?(u(),p(`p`,kt,[a(T,{icon:`fa-solid fa-bolt`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.task`))+`: `+l(e.taskTypeLabel),1)])):o(``,!0),r(`p`,At,[a(T,{icon:`fa-solid fa-magic`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.taskId`))+`: `+l(e.modelValue?.id)+` `,1),a(E,{content:e.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),r(`p`,jt,[a(T,{icon:`fa-solid fa-circle-info`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.failureReason`))+`: `+l(e.modelValue?.response?.error?.message)+` `,1),a(E,{content:e.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])]),e.modelValue?.elapsed?(u(),p(`p`,Mt,[a(T,{icon:`fa-solid fa-clock`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.elapsed`))+`: `+l(e.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),e.modelValue?.response?.trace_id?(u(),p(`p`,Nt,[a(T,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.traceId`))+`: `+l(e.modelValue?.response?.trace_id)+` `,1),a(E,{content:e.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(u(),p(`div`,Pt,[a(D,{closable:!1,class:`info`},{template:m(()=>[a(T,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.failure`)),1)]),default:m(()=>[e.modelValue?.request?.model?(u(),p(`p`,Q,[a(T,{icon:`fa-solid fa-cube`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.model`))+`: `+l(e.modelValue?.request?.model),1)])):o(``,!0),e.modelValue?.request?.size?(u(),p(`p`,Ft,[a(T,{icon:`fa-solid fa-image`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.size`))+`: `+l(e.modelValue?.request?.size),1)])):o(``,!0),e.showTaskType?(u(),p(`p`,It,[a(T,{icon:`fa-solid fa-bolt`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.task`))+`: `+l(e.taskTypeLabel),1)])):o(``,!0),r(`p`,Lt,[a(T,{icon:`fa-solid fa-magic`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.taskId`))+`: `+l(e.modelValue?.id)+` `,1),a(E,{content:e.modelValue?.id,class:`btn-copy`},null,8,[`content`])])]),_:1})]))])])}var zt=s({name:`RecentPanel`,components:{TaskPreview:R(st,[[`render`,Rt],[`__scopeId`,`data-v-8ee5fb87`]]),BotPlaceholder:oe,NoTasks:ue,ScrollList:se},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.openaiimage?.tasks,items:this.$store.state.openaiimage?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Bt={key:0},Vt={key:2,class:`w-full h-full flex items-center justify-center`};function Ht(e,t,r,i,s,l){let d=f(`bot-placeholder`),h=f(`task-preview`),_=f(`scroll-list`),v=f(`no-tasks`);return u(),p(g,null,[e.tasks?.items===void 0?(u(),p(`div`,Bt,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(u(),n(_,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:m(()=>[(u(!0),p(g,null,c(e.tasks?.items,e=>(u(),n(h,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(u(),p(`div`,Vt,[a(v)])):o(``,!0)],64)}var Ut=R(zt,[[`render`,Ht]]),$=ne(`openaiimage`),Wt=s({name:`OpenAIImageIndex`,components:{ConfigPanel:ot,Layout:ye,RecentPanel:Ut},mixins:[L],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.openaiimage?.status?.getApplications===K.Request},tasksLoading(){return this.$store.state.openaiimage?.status?.getTasks===K.Request},credential(){return this.$store.state.openaiimage?.credential},config(){return this.$store.state.openaiimage?.config},application(){return this.$store.state.openaiimage?.application},tasks(){return this.$store.state.openaiimage?.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ce({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loading,setLoading:e=>this.loading=e,isBlocked:()=>this.tasksLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`openaiimage/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`openaiimage/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.tasksLoading){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=20,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),await this.$store.dispatch(`openaiimage/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})},async onGenerate(){if(!V(this.uploadTracker,e=>this.$t(e),e=>W.warning(e)))return;let e={...this.config||{}},t=Array.isArray(e?.image_urls)&&e.image_urls.length>0;if(!this.hasText(e.prompt)){W.error(this.$t(`openaiimage.message.promptRequired`));return}e.prompt=e.prompt.trim(),!t&&`image_urls`in e&&delete e.image_urls,e.size||delete e.size;let n={...e,action:`generate`,callback_url:$},r={action:`edit`,model:e?.model,prompt:e?.prompt,size:e?.size,image_urls:e?.image_urls||[],callback_url:$},i=this.credential?.token;if(!i){console.error(`no token specified`);return}W.info(this.$t(`openaiimage.message.startingTask`)),z(`openaiimage`,t?U.edit(r,{token:i}):U.generate(n,{token:i})).then(e=>{console.debug(`task accepted`,e.data?.task_id),W.success(this.$t(`openaiimage.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?W.error(this.$t(`openaiimage.message.usedUp`)):W.error(this.$t(`openaiimage.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},hasText(e){return typeof e==`string`&&e.trim().length>0}}});function Gt(e,t,r,i,o,s){let c=f(`config-panel`),l=f(`recent-panel`),d=f(`layout`);return u(),n(d,null,{config:m(()=>[a(c,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:m(()=>[a(l,{ref:`recentPanel`,loading:e.loading,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Kt=R(Wt,[[`render`,Gt]]);export{Kt as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{$ as e,Bt as t,D as n,E as r,M as i,N as a,O as o,P as s,Q as c,Ut as l,X as u,_ as d,et as f,k as p,lt as m,ut as h,x as g,y as _}from"./vendor-chart-mdwpew_o.js";import{t as v}from"./button-DWzbdjZV.js";import{n as y,r as b,t as x}from"./select-HUfkzAuQ.js";import{t as S}from"./upload-C64n6FiS.js";import{t as C}from"./tooltip-C3PYfh8V.js";import{t as w}from"./image-s5BzYxHs.js";import{t as T}from"./alert-BJj7gY4q.js";import{t as E}from"./drawer-BvYPSxXh.js";import{t as D}from"./input-number-BaYFVx7i.js";import{t as O}from"./switch-BZlJomEZ.js";import{Cn as k,Sn as A,_n as j,dn as M,fn as N,gn as P,hn as ee,mn as te,pi as ne,pn as re,vn as ie,xn as F,yn as I}from"./constants-C-bSXdJ_.js";import{At as L,E as R,Fn as z,Nt as B,Ot as V,Sr as H,en as U,kr as W,kt as G,yr as K}from"./index-C8DeSrkP.js";import{t as q}from"./index.es-CNg3jcG4.js";import{t as J}from"./CopyToClipboard-INstPmp0.js";import{t as Y}from"./ImagePreview-C0e5HPdV.js";import{n as ae}from"./taskDrawerMixin-Cr17Yxqk.js";import{t as oe}from"./BotPlaceholder-DNd2OaW9.js";import{i as X,n as se,t as ce}from"./pagination-BzLQVoO2.js";import{n as le,t as ue}from"./NoTasks-CbTGc8HF.js";import{t as de}from"./Consumption-Bx30TMJY.js";import{t as fe}from"./ApiCodeButton-JslKaNUM.js";import{t as pe}from"./ImageWrapper-gfMtBxa-.js";var me=s({name:`LayoutNanobanana`,components:{ElDrawer:E,ElButton:v,FontAwesomeIcon:q},mixins:[ae]}),he={class:`main flex flex-row flex-1`},ge={class:`config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},_e={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function ve(t,n,i,o,s,c){let l=f(`font-awesome-icon`),g=f(`el-button`),_=f(`el-drawer`);return u(),p(`div`,he,[r(`div`,ge,[e(t.$slots,`config`,{},void 0,!0)]),r(`div`,_e,[e(t.$slots,`result`,{},void 0,!0)]),h(a(g,{circle:``,class:`menu`,onClick:n[0]||=e=>t.drawer=!0},{default:m(()=>[a(l,{icon:`fa-solid fa-magic`})]),_:1},512),[[d,!t.tasksEmpty]]),a(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer`},{default:m(()=>[e(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var ye=R(me,[[`render`,ve],[`__scopeId`,`data-v-cca80bbd`]]),be=s({name:`PromptInput`,components:{PromptTextarea:le},computed:{prompt:{get(){return this.$store.state.openaiimage?.config?.prompt},set(e){this.$store.commit(`openaiimage/setConfig`,{...this.$store.state.openaiimage?.config,prompt:e})}}},mounted(){this.prompt||=``}});function xe(e,t,r,i,a,o){let s=f(`prompt-textarea`);return u(),n(s,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`openaiimage.name.prompt`),info:e.$t(`openaiimage.description.prompt`),placeholder:e.$t(`openaiimage.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Se=R(be,[[`render`,xe]]),Ce=s({name:`ImageUrlsInput`,components:{ElUpload:S,ElButton:v,InfoIcon:X,ImagePreview:Y,FontAwesomeIcon:q},mixins:[G],data(){return{fileList:[],uploadUrl:H()+`/api/v1/files/`,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.openaiimage?.config?.image_urls}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){let e=(this.fileList||[]).filter(e=>!e?.response?.file_url);this.fileList=e.length?e:[];return}let t=[];e.forEach(e=>{let n=this.fileList.find(t=>t?.response?.file_url===e||t?.url===e);n?t.push(n):t.push({name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}})}),(this.fileList||[]).filter(e=>!e?.response?.file_url).forEach(e=>{t.some(t=>t===e||t?.url===e?.url||t?.response?.file_url===e?.response?.file_url)||t.push(e)}),this.fileList=t}}},mounted(){},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url==`string`&&e.url.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImageUrls()},onExceed(){W.warning(this.$t(`openaiimage.message.uploadImageExceed`))},onError(){W.error(this.$t(`openaiimage.message.uploadImageError`))},onSetImageUrls(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`openaiimage/setConfig`,{...this.$store.state.openaiimage?.config,image_urls:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImageUrls()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImageUrls()}}}),we={class:`field flex items-center justify-between`},Te={class:`title font-bold text-[14px] mb-[10px]`},Ee={class:`upload-wrapper flex flex-col items-start gap-[8px]`},De={class:`controls flex items-center`},Oe={class:`file-list flex flex-wrap gap-[10px]`};function ke(e,t,o,s,d,h){let _=f(`font-awesome-icon`),v=f(`el-button`),y=f(`el-upload`),b=f(`info-icon`),x=f(`image-preview`);return u(),p(g,null,[r(`div`,we,[r(`h2`,Te,l(e.$t(`openaiimage.name.imageUrls`)),1),r(`div`,Ee,[r(`div`,De,[a(y,{"file-list":e.fileList,"onUpdate:fileList":t[0]||=t=>e.fileList=t,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value`,limit:5,multiple:!0,"show-file-list":!1,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,"on-change":e.onChange,"on-remove":e.onRemove,headers:e.headers},{default:m(()=>[a(v,{size:`small`,type:`primary`,round:``},{default:m(()=>[a(_,{icon:`fa-solid fa-upload`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`]),a(b,{content:e.$t(`openaiimage.description.imageUrls`),class:`ml-2`},null,8,[`content`])])])]),r(`div`,Oe,[(u(!0),p(g,null,c(e.fileList,(t,r)=>(u(),n(x,{key:t.uid||t?.response?.file_url||t.url||r,url:t.url||t?.response?.file_url,name:t.name,percentage:t.percentage,onRemove:n=>e.onRemovePreview(r,t)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])],64)}var Ae=R(Ce,[[`render`,ke]]),je=s({name:`OpenAIImageModelSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:X},data(){return{options:[{value:P,label:this.$t(`openaiimage.model.gptImage1`)},{value:j,label:this.$t(`openaiimage.model.gptImage15`)},{value:ie,label:this.$t(`openaiimage.model.gptImage2`)}]}},computed:{value:{get(){return this.$store.state.openaiimage?.config?.model},set(e){this.$store.commit(`openaiimage/setConfig`,{...this.$store.state.openaiimage?.config,model:e})}},modelDescription(){return this.$t(`openaiimage.description.model`)}},mounted(){this.value||=te}}),Me={class:`field`},Ne={class:`label`},Pe={class:`box`},Fe={class:`title font-bold`};function Ie(e,t,i,o,s,d){let h=f(`info-icon`),_=f(`el-option`),v=f(`el-select`);return u(),p(`div`,Me,[r(`div`,Ne,[r(`div`,Pe,[r(`h2`,Fe,l(e.$t(`openaiimage.name.model`)),1),a(h,{content:e.modelDescription,class:`info`},null,8,[`content`])])]),a(v,{modelValue:e.value,"onUpdate:modelValue":t[0]||=t=>e.value=t,class:`value`,placeholder:e.$t(`openaiimage.placeholder.select`)},{default:m(()=>[(u(!0),p(g,null,c(e.options,e=>(u(),n(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Le=R(je,[[`render`,Ie],[`__scopeId`,`data-v-cec771bd`]]);function Z(e){if(!e)return;let t=/^(\d+)x(\d+)$/.exec(e);if(t)return{w:Number(t[1]),h:Number(t[2])}}var Re=s({name:`OpenAIImageSizeSelector`,components:{ElSelect:b,ElOption:x,ElOptionGroup:y,ElSwitch:O,ElInputNumber:D,InfoIcon:X},data(){return{customMode:!1,customWidth:1024,customHeight:1024}},computed:{model(){return this.$store.state.openaiimage?.config?.model||`gpt-image-2`},storedSize(){return this.$store.state.openaiimage?.config?.size},emptySizeValue(){return``},customSupported(){return re.includes(this.model)},presets(){return I[this.model]??I[`gpt-image-2`]??[]},presetGroups(){return this.model===`gpt-image-2`?[{label:this.$t(`openaiimage.sizeGroup.standard1k`),options:F},{label:this.$t(`openaiimage.sizeGroup.preset2k`),options:A},{label:this.$t(`openaiimage.sizeGroup.preset4k`),options:k}]:[{label:this.$t(`openaiimage.sizeGroup.standard1k`),options:this.presets}]},useCustom:{get(){return this.customSupported&&this.customMode},set(e){if(!(e&&!this.customSupported))if(this.customMode=e,e){if(this.customError)return;this.commitSize(`${this.customWidth}x${this.customHeight}`)}else this.commitSize()}},presetValue:{get(){let e=this.storedSize;return e&&this.presets.includes(e)?e:this.emptySizeValue},set(e){this.customMode=!1,this.commitSize(e||void 0)}},multiple(){return 16},minSide(){return 256},maxSide(){return M},customError(){let e=this.customWidth,t=this.customHeight;return!Number.isFinite(e)||!Number.isFinite(t)||e<=0||t<=0?this.$t(`openaiimage.error.customSizePositive`):e%this.multiple!==0||t%this.multiple!==0?this.$t(`openaiimage.error.customSizeMultiple`,{multiple:this.multiple}):e<this.minSide||t<this.minSide?this.$t(`openaiimage.error.customSizeMin`,{min:this.minSide}):Math.max(e,t)>this.maxSide?this.$t(`openaiimage.error.customSizeMax`,{max:this.maxSide}):e*t>8294400?this.$t(`openaiimage.error.customSizePixels`,{pixels:N.toLocaleString()}):``}},watch:{model:{immediate:!1,handler(){this.customSupported||(this.customMode=!1);let e=this.storedSize;if(!e||this.presets.includes(e))return;let t=Z(e);t&&this.customSupported&&(this.customMode=!0,this.customWidth=t.w,this.customHeight=t.h,!this.customError)||this.commitSize()}},storedSize(e){if(!e){this.customMode=!1;return}if(this.presets.includes(e)){this.customMode=!1;return}let t=Z(e);t&&this.customSupported&&(this.customMode=!0,this.customWidth!==t.w&&(this.customWidth=t.w),this.customHeight!==t.h&&(this.customHeight=t.h))},customWidth(){this.syncCustomToStore()},customHeight(){this.syncCustomToStore()}},mounted(){let e=this.storedSize,t=Z(e);e&&t&&this.customSupported&&!this.presets.includes(e)&&(this.customMode=!0,this.customWidth=t.w,this.customHeight=t.h)},methods:{commitSize(e){let t={...this.$store.state.openaiimage?.config};e?t.size=e:delete t.size,this.$store.commit(`openaiimage/setConfig`,t)},syncCustomToStore(){this.useCustom&&(this.customError||this.commitSize(`${this.customWidth}x${this.customHeight}`))}}}),ze={class:`resolution`},Be={class:`field`},Ve={class:`label`},He={class:`box`},Ue={class:`title font-bold`},We={class:`field custom-toggle`},Ge={class:`label`},Ke={class:`box`},qe={class:`title font-bold`},Je={key:0,class:`custom-inputs`},Ye={class:`row`},Xe={class:`row-label`},Ze={class:`row`},Qe={class:`row-label`},$e={key:0,class:`error`};function et(e,t,i,s,d,h){let _=f(`info-icon`),v=f(`el-option`),y=f(`el-option-group`),b=f(`el-select`),x=f(`el-switch`),S=f(`el-input-number`);return u(),p(`div`,ze,[r(`div`,Be,[r(`div`,Ve,[r(`div`,He,[r(`h2`,Ue,l(e.$t(`openaiimage.name.size`)),1),a(_,{content:e.$t(`openaiimage.description.size`),class:`info`},null,8,[`content`])])]),a(b,{modelValue:e.presetValue,"onUpdate:modelValue":t[0]||=t=>e.presetValue=t,class:`value`,placeholder:e.$t(`openaiimage.placeholder.select`),disabled:e.useCustom},{default:m(()=>[a(v,{label:e.$t(`suno.gender.auto`),value:e.emptySizeValue},null,8,[`label`,`value`]),(u(!0),p(g,null,c(e.presetGroups,e=>(u(),n(y,{key:e.label,label:e.label},{default:m(()=>[(u(!0),p(g,null,c(e.options,e=>(u(),n(v,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128))]),_:2},1032,[`label`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`])]),e.customSupported?(u(),p(g,{key:0},[r(`div`,We,[r(`div`,Ge,[r(`div`,Ke,[r(`h2`,qe,l(e.$t(`openaiimage.name.customSize`)),1),a(_,{content:e.$t(`openaiimage.description.customSize`),class:`info`},null,8,[`content`])])]),a(x,{modelValue:e.useCustom,"onUpdate:modelValue":t[1]||=t=>e.useCustom=t,class:`value-switch`},null,8,[`modelValue`])]),e.useCustom?(u(),p(`div`,Je,[r(`div`,Ye,[r(`span`,Xe,l(e.$t(`openaiimage.name.width`)),1),a(S,{modelValue:e.customWidth,"onUpdate:modelValue":t[2]||=t=>e.customWidth=t,class:`row-input`,min:e.minSide,max:e.maxSide,step:e.multiple,"step-strictly":!0,"controls-position":`right`},null,8,[`modelValue`,`min`,`max`,`step`])]),r(`div`,Ze,[r(`span`,Qe,l(e.$t(`openaiimage.name.height`)),1),a(S,{modelValue:e.customHeight,"onUpdate:modelValue":t[3]||=t=>e.customHeight=t,class:`row-input`,min:e.minSide,max:e.maxSide,step:e.multiple,"step-strictly":!0,"controls-position":`right`},null,8,[`modelValue`,`min`,`max`,`step`])]),e.customError?(u(),p(`div`,$e,l(e.customError),1)):o(``,!0)])):o(``,!0)],64)):o(``,!0)])}var tt=s({name:`ConfigPanel`,components:{ElButton:v,FontAwesomeIcon:q,PromptInput:Se,Consumption:de,ImageUrlsInput:Ae,ModelSelector:Le,ResolutionSelector:R(Re,[[`render`,et],[`__scopeId`,`data-v-d5544d69`]])},emits:[`generate`],computed:{config(){return this.$store.state.openaiimage?.config},consumption(){return B({...this.config||{}},this.service?.cost)},service(){return this.$store.state.openaiimage?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),nt={class:`flex flex-col h-full`},rt={class:`flex-1 overflow-y-auto p-5`},it={class:`flex flex-col items-center justify-center px-5 pb-5`};function at(e,t,n,o,s,c){let d=f(`model-selector`),h=f(`resolution-selector`),g=f(`prompt-input`),_=f(`image-urls-input`),v=f(`consumption`),y=f(`font-awesome-icon`),b=f(`el-button`);return u(),p(`div`,nt,[r(`div`,rt,[a(d,{class:`mb-4`}),a(h,{class:`mb-4`}),a(g,{class:`mb-4`}),a(_,{class:`mb-4`})]),r(`div`,it,[a(v,{value:e.consumption,service:e.service},null,8,[`value`,`service`]),a(b,{type:`primary`,class:`btn w-full`,round:``,onClick:e.onGenerate},{default:m(()=>[a(y,{icon:`fa-solid fa-magic`,class:`mr-2`}),i(` `+l(e.$t(`openaiimage.button.generate`)),1)]),_:1},8,[`onClick`])])])}var ot=R(tt,[[`render`,at]]),st=s({name:`TaskPreview`,components:{ElImage:w,CopyToClipboard:J,FontAwesomeIcon:q,ElAlert:T,ImageWrapper:pe,ElButton:v,ElTooltip:C,ImagePreview:Y,ApiCodeButton:fe},props:{modelValue:{type:Object,required:!0}},setup(){return{OPENAIIMAGE_LOGO:ee}},computed:{isEditRequest(){let e=this.modelValue?.request;return this.modelValue?.type===`images_edits`||e?.action===`edit`||this.referenceImages.length>0},showTaskType(){return!!(this.modelValue?.request?.action||this.modelValue?.type||this.referenceImages.length>0)},taskTypeLabel(){return this.isEditRequest?this.$t(`openaiimage.name.edits`):this.$t(`openaiimage.name.generate`)},openaiimagePath(){return this.isEditRequest?`/openai/images/edits`:`/openai/images/generations`},openaiimageCodeBody(){let e=this.modelValue?.request;if(!e)return;let t={...e};if(delete t.action,delete t.callback_url,this.isEditRequest){delete t.image_urls,delete t.image;let e=this.referenceImages;e.length===1?t.image=e[0]:e.length>1&&(t.image=e)}else delete t.image_urls,delete t.image;return t},images(){let e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{let n=t;if(n?.image_url||n?.url){e.push(n);return}n?.b64_json&&e.push({...n,url:`data:image/png;base64,${n.b64_json}`})}),e},referenceImages(){let e=this.modelValue?.request;if(!e)return[];let t=Array.isArray(e.image_urls)?e.image_urls:[];if(t.length>0)return t.filter(e=>typeof e==`string`&&e.length>0);let n=e.image;return Array.isArray(n)?n.filter(e=>typeof e==`string`&&e.length>0):typeof n==`string`&&n.length>0?[n]:Array.isArray(e.images)?e.images.map(e=>{if(typeof e==`string`)return e;if(e&&typeof e==`object`)return e.image_url}).filter(e=>typeof e==`string`&&e.length>0):[]}},methods:{onEdit(e){if(!e)return;console.debug(`Edit image:`,e);let t={...this.$store.state.openaiimage?.config||{}};t.image_urls=[e],this.$store.commit(`openaiimage/setConfig`,t)}}}),ct={class:`preview`},lt={class:`left`},ut={class:`main`},dt={class:`bot`},ft={class:`datetime`},pt={class:`info`},mt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},ht={key:1,class:`prompt mt-2`},gt={key:0},_t={key:0,class:t({content:!0,failed:!0})},vt={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},yt={class:t({operations:!0,"mt-2":!0,"mb-2":!0})},bt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},xt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},St={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ct={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},wt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Tt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Et={key:1,class:t({content:!0})},Dt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ot={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},kt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},At={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},jt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Mt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Nt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Pt={key:2,class:t({content:!0})},Q={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ft={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},It={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Lt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`};function Rt(e,t,s,d,h,v){let y=f(`el-image`),b=f(`image-preview`),x=f(`image-wrapper`),S=f(`el-button`),C=f(`el-tooltip`),w=f(`api-code-button`),T=f(`font-awesome-icon`),E=f(`copy-to-clipboard`),D=f(`el-alert`);return u(),p(`div`,ct,[r(`div`,lt,[a(y,{src:e.OPENAIIMAGE_LOGO,class:`avatar`},null,8,[`src`])]),r(`div`,ut,[r(`div`,dt,[i(l(e.$t(`openaiimage.name.openaiimageBot`))+` `,1),r(`span`,ft,l(e.$dayjs.format(``+new Date(parseFloat((e.modelValue?.created_at||``).toString())*1e3))),1)]),r(`div`,pt,[e.referenceImages.length>0?(u(),p(`div`,mt,[(u(!0),p(g,null,c(e.referenceImages,(e,t)=>(u(),n(b,{key:t,url:e,name:`image-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),e.modelValue?.request?.prompt?(u(),p(`p`,ht,[i(l(e.modelValue?.request?.prompt)+` `,1),e.modelValue?.response?o(``,!0):(u(),p(`span`,gt,` - (`+l(e.$t(`openaiimage.status.pending`))+`) `,1))])):o(``,!0)]),e.modelValue?.response?.success===!0?(u(),p(`div`,_t,[r(`div`,vt,[(u(!0),p(g,null,c(e.images,(e,t)=>(u(),n(x,{key:t,src:e?.image_url||e?.url||``,"raw-src":e?.image_url||e?.url||``},null,8,[`src`,`raw-src`]))),128))]),r(`div`,yt,[a(C,{class:`box-item`,effect:`dark`,content:e.$t(`common.button.edit`),placement:`top-start`},{default:m(()=>[a(S,{type:`info`,size:`small`,class:`btn-action`,onClick:t[0]||=_(t=>e.onEdit(e.images?.[0]?.image_url||e.images?.[0]?.url),[`stop`])},{default:m(()=>[i(l(e.$t(`common.button.edit`)),1)]),_:1})]),_:1},8,[`content`]),a(w,{path:e.openaiimagePath,body:e.openaiimageCodeBody},null,8,[`path`,`body`])]),a(D,{closable:!1,class:`mt-2 success`},{default:m(()=>[e.modelValue?.request?.model?(u(),p(`p`,bt,[a(T,{icon:`fa-solid fa-cube`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.model`))+`: `+l(e.modelValue?.request?.model),1)])):o(``,!0),e.modelValue?.request?.size?(u(),p(`p`,xt,[a(T,{icon:`fa-solid fa-image`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.size`))+`: `+l(e.modelValue?.request?.size),1)])):o(``,!0),e.showTaskType?(u(),p(`p`,St,[a(T,{icon:`fa-solid fa-bolt`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.task`))+`: `+l(e.taskTypeLabel),1)])):o(``,!0),r(`p`,Ct,[a(T,{icon:`fa-solid fa-magic`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.taskId`))+`: `+l(e.modelValue?.id)+` `,1),a(E,{content:e.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),e.modelValue?.elapsed?(u(),p(`p`,wt,[a(T,{icon:`fa-solid fa-clock`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.elapsed`))+`: `+l(e.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),e.modelValue?.response?.trace_id?(u(),p(`p`,Tt,[a(T,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.traceId`))+`: `+l(e.modelValue?.response?.trace_id)+` `,1),a(E,{content:e.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):e.modelValue?.response?.success===!1?(u(),p(`div`,Et,[a(D,{closable:!1,class:`failure`},{template:m(()=>[a(T,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.failure`)),1)]),default:m(()=>[e.modelValue?.request?.model?(u(),p(`p`,Dt,[a(T,{icon:`fa-solid fa-cube`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.model`))+`: `+l(e.modelValue?.request?.model),1)])):o(``,!0),e.modelValue?.request?.size?(u(),p(`p`,Ot,[a(T,{icon:`fa-solid fa-image`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.size`))+`: `+l(e.modelValue?.request?.size),1)])):o(``,!0),e.showTaskType?(u(),p(`p`,kt,[a(T,{icon:`fa-solid fa-bolt`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.task`))+`: `+l(e.taskTypeLabel),1)])):o(``,!0),r(`p`,At,[a(T,{icon:`fa-solid fa-magic`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.taskId`))+`: `+l(e.modelValue?.id)+` `,1),a(E,{content:e.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),r(`p`,jt,[a(T,{icon:`fa-solid fa-circle-info`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.failureReason`))+`: `+l(e.modelValue?.response?.error?.message)+` `,1),a(E,{content:e.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])]),e.modelValue?.elapsed?(u(),p(`p`,Mt,[a(T,{icon:`fa-solid fa-clock`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.elapsed`))+`: `+l(e.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),e.modelValue?.response?.trace_id?(u(),p(`p`,Nt,[a(T,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.traceId`))+`: `+l(e.modelValue?.response?.trace_id)+` `,1),a(E,{content:e.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(u(),p(`div`,Pt,[a(D,{closable:!1,class:`info`},{template:m(()=>[a(T,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.failure`)),1)]),default:m(()=>[e.modelValue?.request?.model?(u(),p(`p`,Q,[a(T,{icon:`fa-solid fa-cube`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.model`))+`: `+l(e.modelValue?.request?.model),1)])):o(``,!0),e.modelValue?.request?.size?(u(),p(`p`,Ft,[a(T,{icon:`fa-solid fa-image`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.size`))+`: `+l(e.modelValue?.request?.size),1)])):o(``,!0),e.showTaskType?(u(),p(`p`,It,[a(T,{icon:`fa-solid fa-bolt`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.task`))+`: `+l(e.taskTypeLabel),1)])):o(``,!0),r(`p`,Lt,[a(T,{icon:`fa-solid fa-magic`,class:`mr-1`}),i(` `+l(e.$t(`openaiimage.name.taskId`))+`: `+l(e.modelValue?.id)+` `,1),a(E,{content:e.modelValue?.id,class:`btn-copy`},null,8,[`content`])])]),_:1})]))])])}var zt=s({name:`RecentPanel`,components:{TaskPreview:R(st,[[`render`,Rt],[`__scopeId`,`data-v-8ee5fb87`]]),BotPlaceholder:oe,NoTasks:ue,ScrollList:se},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.openaiimage?.tasks,items:this.$store.state.openaiimage?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Bt={key:0},Vt={key:2,class:`w-full h-full flex items-center justify-center`};function Ht(e,t,r,i,s,l){let d=f(`bot-placeholder`),h=f(`task-preview`),_=f(`scroll-list`),v=f(`no-tasks`);return u(),p(g,null,[e.tasks?.items===void 0?(u(),p(`div`,Bt,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(u(),n(_,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:m(()=>[(u(!0),p(g,null,c(e.tasks?.items,e=>(u(),n(h,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(u(),p(`div`,Vt,[a(v)])):o(``,!0)],64)}var Ut=R(zt,[[`render`,Ht]]),$=ne(`openaiimage`),Wt=s({name:`OpenAIImageIndex`,components:{ConfigPanel:ot,Layout:ye,RecentPanel:Ut},mixins:[L],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.openaiimage?.status?.getApplications===K.Request},tasksLoading(){return this.$store.state.openaiimage?.status?.getTasks===K.Request},credential(){return this.$store.state.openaiimage?.credential},config(){return this.$store.state.openaiimage?.config},application(){return this.$store.state.openaiimage?.application},tasks(){return this.$store.state.openaiimage?.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ce({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loading,setLoading:e=>this.loading=e,isBlocked:()=>this.tasksLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`openaiimage/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`openaiimage/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.tasksLoading){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=20,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),await this.$store.dispatch(`openaiimage/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})},async onGenerate(){if(!V(this.uploadTracker,e=>this.$t(e),e=>W.warning(e)))return;let e={...this.config||{}},t=Array.isArray(e?.image_urls)&&e.image_urls.length>0;if(!this.hasText(e.prompt)){W.error(this.$t(`openaiimage.message.promptRequired`));return}e.prompt=e.prompt.trim(),!t&&`image_urls`in e&&delete e.image_urls,e.size||delete e.size;let n={...e,action:`generate`,callback_url:$},r={action:`edit`,model:e?.model,prompt:e?.prompt,size:e?.size,image_urls:e?.image_urls||[],callback_url:$},i=this.credential?.token;if(!i){console.error(`no token specified`);return}W.info(this.$t(`openaiimage.message.startingTask`)),z(`openaiimage`,t?U.edit(r,{token:i}):U.generate(n,{token:i})).then(e=>{console.debug(`task accepted`,e.data?.task_id),W.success(this.$t(`openaiimage.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?W.error(this.$t(`openaiimage.message.usedUp`)):W.error(this.$t(`openaiimage.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},hasText(e){return typeof e==`string`&&e.trim().length>0}}});function Gt(e,t,r,i,o,s){let c=f(`config-panel`),l=f(`recent-panel`),d=f(`layout`);return u(),n(d,null,{config:m(()=>[a(c,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:m(()=>[a(l,{ref:`recentPanel`,loading:e.loading,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Kt=R(Wt,[[`render`,Gt]]);export{Kt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.markdown-body{--base-size-16:1rem;--base-size-24:1.5rem;--base-size-4:.25rem;--base-size-40:2.5rem;--base-size-8:.5rem;--base-text-weight-medium:500;--base-text-weight-normal:400;--base-text-weight-semibold:600;--fontStack-monospace:ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;--fontStack-sansSerif:-apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";--fgColor-accent:Highlight}@media (prefers-color-scheme:dark){.markdown-body,[data-theme=dark]{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--fgColor-accent:#4493f8;--bgColor-attention-muted:#bb800926;--bgColor-default:#0d1117;--bgColor-muted:#151b23;--bgColor-neutral-muted:#656c7633;--borderColor-accent-emphasis:#1f6feb;--borderColor-attention-emphasis:#9e6a03;--borderColor-danger-emphasis:#da3633;--borderColor-default:#3d444d;--borderColor-done-emphasis:#8957e5;--borderColor-success-emphasis:#238636;--color-prettylights-syntax-brackethighlighter-angle:#9198a1;--color-prettylights-syntax-brackethighlighter-unmatched:#f85149;--color-prettylights-syntax-carriage-return-bg:#b62324;--color-prettylights-syntax-carriage-return-text:#f0f6fc;--color-prettylights-syntax-comment:#9198a1;--color-prettylights-syntax-constant:#79c0ff;--color-prettylights-syntax-constant-other-reference-link:#a5d6ff;--color-prettylights-syntax-entity:#d2a8ff;--color-prettylights-syntax-entity-tag:#7ee787;--color-prettylights-syntax-keyword:#ff7b72;--color-prettylights-syntax-markup-bold:#f0f6fc;--color-prettylights-syntax-markup-changed-bg:#5a1e02;--color-prettylights-syntax-markup-changed-text:#ffdfb6;--color-prettylights-syntax-markup-deleted-bg:#67060c;--color-prettylights-syntax-markup-deleted-text:#ffdcd7;--color-prettylights-syntax-markup-heading:#1f6feb;--color-prettylights-syntax-markup-ignored-bg:#1158c7;--color-prettylights-syntax-markup-ignored-text:#f0f6fc;--color-prettylights-syntax-markup-inserted-bg:#033a16;--color-prettylights-syntax-markup-inserted-text:#aff5b4;--color-prettylights-syntax-markup-italic:#f0f6fc;--color-prettylights-syntax-markup-list:#f2cc60;--color-prettylights-syntax-meta-diff-range:#d2a8ff;--color-prettylights-syntax-storage-modifier-import:#f0f6fc;--color-prettylights-syntax-string:#a5d6ff;--color-prettylights-syntax-string-regexp:#7ee787;--color-prettylights-syntax-sublimelinter-gutter-mark:#3d444d;--color-prettylights-syntax-variable:#ffa657;--fgColor-attention:#d29922;--fgColor-danger:#f85149;--fgColor-default:#f0f6fc;--fgColor-done:#ab7df8;--fgColor-muted:#9198a1;--fgColor-success:#3fb950;--borderColor-muted:#3d444db3;--color-prettylights-syntax-invalid-illegal-bg:var(--bgColor-danger-muted);--color-prettylights-syntax-invalid-illegal-text:var(--fgColor-danger);--focus-outlineColor:var(--borderColor-accent-emphasis);--borderColor-neutral-muted:var(--borderColor-muted)}}@media (prefers-color-scheme:light){.markdown-body,[data-theme=light]{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--fgColor-danger:#d1242f;--bgColor-attention-muted:#fff8c5;--bgColor-muted:#f6f8fa;--bgColor-neutral-muted:#818b981f;--borderColor-accent-emphasis:#0969da;--borderColor-attention-emphasis:#9a6700;--borderColor-danger-emphasis:#cf222e;--borderColor-default:#d1d9e0;--borderColor-done-emphasis:#8250df;--borderColor-success-emphasis:#1a7f37;--color-prettylights-syntax-brackethighlighter-angle:#59636e;--color-prettylights-syntax-brackethighlighter-unmatched:#82071e;--color-prettylights-syntax-carriage-return-bg:#cf222e;--color-prettylights-syntax-carriage-return-text:#f6f8fa;--color-prettylights-syntax-comment:#59636e;--color-prettylights-syntax-constant:#0550ae;--color-prettylights-syntax-constant-other-reference-link:#0a3069;--color-prettylights-syntax-entity:#6639ba;--color-prettylights-syntax-entity-tag:#0550ae;--color-prettylights-syntax-invalid-illegal-text:var(--fgColor-danger);--color-prettylights-syntax-keyword:#cf222e;--color-prettylights-syntax-markup-changed-bg:#ffd8b5;--color-prettylights-syntax-markup-changed-text:#953800;--color-prettylights-syntax-markup-deleted-bg:#ffebe9;--color-prettylights-syntax-markup-deleted-text:#82071e;--color-prettylights-syntax-markup-heading:#0550ae;--color-prettylights-syntax-markup-ignored-bg:#0550ae;--color-prettylights-syntax-markup-ignored-text:#d1d9e0;--color-prettylights-syntax-markup-inserted-bg:#dafbe1;--color-prettylights-syntax-markup-inserted-text:#116329;--color-prettylights-syntax-markup-list:#3b2300;--color-prettylights-syntax-meta-diff-range:#8250df;--color-prettylights-syntax-string:#0a3069;--color-prettylights-syntax-string-regexp:#116329;--color-prettylights-syntax-sublimelinter-gutter-mark:#818b98;--color-prettylights-syntax-variable:#953800;--fgColor-accent:#0969da;--fgColor-attention:#9a6700;--fgColor-done:#8250df;--fgColor-muted:#59636e;--fgColor-success:#1a7f37;--bgColor-default:#fff;--borderColor-muted:#d1d9e0b3;--color-prettylights-syntax-invalid-illegal-bg:var(--bgColor-danger-muted);--color-prettylights-syntax-markup-bold:#1f2328;--color-prettylights-syntax-markup-italic:#1f2328;--color-prettylights-syntax-storage-modifier-import:#1f2328;--fgColor-default:#1f2328;--focus-outlineColor:var(--borderColor-accent-emphasis);--borderColor-neutral-muted:var(--borderColor-muted)}}.markdown-body{-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;font-weight:var(--base-text-weight-normal,400);color:var(--fgColor-default);background-color:var(--bgColor-default);font-family:var(--fontStack-sansSerif,-apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji");word-wrap:break-word;margin:0;font-size:16px;line-height:1.5}.markdown-body a{text-underline-offset:.2rem;text-decoration:underline}.markdown-body .octicon{fill:currentColor;vertical-align:text-bottom;display:inline-block}.markdown-body h1:hover .anchor .octicon-link:before,.markdown-body h2:hover .anchor .octicon-link:before,.markdown-body h3:hover .anchor .octicon-link:before,.markdown-body h4:hover .anchor .octicon-link:before,.markdown-body h5:hover .anchor .octicon-link:before,.markdown-body h6:hover .anchor .octicon-link:before{content:" ";background-color:currentColor;width:16px;height:16px;display:inline-block;-webkit-mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' version='1.1' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg>");mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' version='1.1' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg>")}.markdown-body details,.markdown-body figcaption,.markdown-body figure{display:block}.markdown-body summary{display:list-item}.markdown-body [hidden]{display:none!important}.markdown-body a{color:var(--fgColor-accent);background-color:#0000;text-decoration:none}.markdown-body abbr[title]{border-bottom:none;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.markdown-body b,.markdown-body strong{font-weight:var(--base-text-weight-semibold,600)}.markdown-body dfn{font-style:italic}.markdown-body h1{font-weight:var(--base-text-weight-semibold,600);border-bottom:1px solid var(--borderColor-muted);margin:.67em 0;padding-bottom:.3em;font-size:2em}.markdown-body mark{background-color:var(--bgColor-attention-muted);color:var(--fgColor-default)}.markdown-body small{font-size:90%}.markdown-body sub,.markdown-body sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}.markdown-body sub{bottom:-.25em}.markdown-body sup{top:-.5em}.markdown-body img{box-sizing:content-box;border-style:none;max-width:100%}.markdown-body code,.markdown-body kbd,.markdown-body pre,.markdown-body samp{font-family:monospace;font-size:1em}.markdown-body figure{margin:1em var(--base-size-40)}.markdown-body hr{box-sizing:content-box;border-bottom:1px solid var(--borderColor-muted);height:.25em;margin:var(--base-size-24) 0;background:0 0;background-color:var(--borderColor-default);border:0;padding:0;overflow:hidden}.markdown-body input{font:inherit;font-family:inherit;font-size:inherit;line-height:inherit;margin:0;overflow:visible}.markdown-body [type=button],.markdown-body [type=reset],.markdown-body [type=submit]{appearance:button}.markdown-body [type=checkbox],.markdown-body [type=radio]{box-sizing:border-box;padding:0}.markdown-body [type=number]::-webkit-inner-spin-button{height:auto}.markdown-body [type=number]::-webkit-outer-spin-button{height:auto}.markdown-body [type=search]::-webkit-search-cancel-button{appearance:none}.markdown-body [type=search]::-webkit-search-decoration{appearance:none}.markdown-body ::-webkit-input-placeholder{color:inherit;opacity:.54}.markdown-body ::-webkit-file-upload-button{appearance:button;font:inherit}.markdown-body a:hover{text-decoration:underline}.markdown-body ::placeholder{color:var(--fgColor-muted);opacity:1}.markdown-body hr:before{content:"";display:table}.markdown-body hr:after{clear:both;content:"";display:table}.markdown-body table{border-spacing:0;border-collapse:collapse;font-variant:tabular-nums;width:max-content;max-width:100%;display:block;overflow:auto}.markdown-body td,.markdown-body th{padding:0}.markdown-body details summary{cursor:pointer}.markdown-body a:focus,.markdown-body [role=button]:focus,.markdown-body input[type=radio]:focus,.markdown-body input[type=checkbox]:focus{outline:2px solid var(--focus-outlineColor);outline-offset:-2px;box-shadow:none}.markdown-body a:focus:not(:focus-visible),.markdown-body [role=button]:focus:not(:focus-visible),.markdown-body input[type=radio]:focus:not(:focus-visible),.markdown-body input[type=checkbox]:focus:not(:focus-visible){outline:1px solid #0000}.markdown-body a:focus-visible,.markdown-body [role=button]:focus-visible,.markdown-body input[type=radio]:focus-visible,.markdown-body input[type=checkbox]:focus-visible{outline:2px solid var(--focus-outlineColor);outline-offset:-2px;box-shadow:none}.markdown-body a:not([class]):focus,.markdown-body a:not([class]):focus-visible,.markdown-body input[type=radio]:focus,.markdown-body input[type=radio]:focus-visible,.markdown-body input[type=checkbox]:focus,.markdown-body input[type=checkbox]:focus-visible{outline-offset:0}.markdown-body kbd{padding:var(--base-size-4);font:11px var(--fontStack-monospace,ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);color:var(--fgColor-default);vertical-align:middle;background-color:var(--bgColor-muted);border:solid 1px var(--borderColor-neutral-muted);border-bottom-color:var(--borderColor-neutral-muted);box-shadow:inset 0 -1px 0 var(--borderColor-neutral-muted);border-radius:6px;line-height:10px;display:inline-block}.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6{margin-top:var(--base-size-24);margin-bottom:var(--base-size-16);font-weight:var(--base-text-weight-semibold,600);line-height:1.25}.markdown-body h2{font-weight:var(--base-text-weight-semibold,600);border-bottom:1px solid var(--borderColor-muted);padding-bottom:.3em;font-size:1.5em}.markdown-body h3{font-weight:var(--base-text-weight-semibold,600);font-size:1.25em}.markdown-body h4{font-weight:var(--base-text-weight-semibold,600);font-size:1em}.markdown-body h5{font-weight:var(--base-text-weight-semibold,600);font-size:.875em}.markdown-body h6{font-weight:var(--base-text-weight-semibold,600);color:var(--fgColor-muted);font-size:.85em}.markdown-body p{margin-top:0;margin-bottom:10px}.markdown-body blockquote{color:var(--fgColor-muted);border-left:.25em solid var(--borderColor-default);margin:0;padding:0 1em}.markdown-body ul,.markdown-body ol{margin-top:0;margin-bottom:0;padding-left:2em}.markdown-body ol ol,.markdown-body ul ol{list-style-type:lower-roman}.markdown-body ul ul ol,.markdown-body ul ol ol,.markdown-body ol ul ol,.markdown-body ol ol ol{list-style-type:lower-alpha}.markdown-body dd{margin-left:0}.markdown-body tt,.markdown-body code,.markdown-body samp{font-family:var(--fontStack-monospace,ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);font-size:12px}.markdown-body pre{font-family:var(--fontStack-monospace,ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);word-wrap:normal;margin-top:0;margin-bottom:0;font-size:12px}.markdown-body .octicon{vertical-align:text-bottom;fill:currentColor;display:inline-block;overflow:visible!important}.markdown-body input::-webkit-outer-spin-button{appearance:none;margin:0}.markdown-body input::-webkit-inner-spin-button{appearance:none;margin:0}.markdown-body .mr-2{margin-right:var(--base-size-8,8px)!important}.markdown-body:before{content:"";display:table}.markdown-body:after{clear:both;content:"";display:table}.markdown-body>:first-child{margin-top:0!important}.markdown-body>:last-child{margin-bottom:0!important}.markdown-body a:not([href]){color:inherit;text-decoration:none}.markdown-body .absent{color:var(--fgColor-danger)}.markdown-body .anchor{float:left;padding-right:var(--base-size-4);margin-left:-20px;line-height:1}.markdown-body .anchor:focus{outline:none}.markdown-body p,.markdown-body blockquote,.markdown-body ul,.markdown-body ol,.markdown-body dl,.markdown-body table,.markdown-body pre,.markdown-body details{margin-top:0;margin-bottom:var(--base-size-16)}.markdown-body blockquote>:first-child{margin-top:0}.markdown-body blockquote>:last-child{margin-bottom:0}.markdown-body h1 .octicon-link,.markdown-body h2 .octicon-link,.markdown-body h3 .octicon-link,.markdown-body h4 .octicon-link,.markdown-body h5 .octicon-link,.markdown-body h6 .octicon-link{color:var(--fgColor-default);vertical-align:middle;visibility:hidden}.markdown-body h1:hover .anchor,.markdown-body h2:hover .anchor,.markdown-body h3:hover .anchor,.markdown-body h4:hover .anchor,.markdown-body h5:hover .anchor,.markdown-body h6:hover .anchor{text-decoration:none}.markdown-body h1:hover .anchor .octicon-link,.markdown-body h2:hover .anchor .octicon-link,.markdown-body h3:hover .anchor .octicon-link,.markdown-body h4:hover .anchor .octicon-link,.markdown-body h5:hover .anchor .octicon-link,.markdown-body h6:hover .anchor .octicon-link{visibility:visible}.markdown-body h1 tt,.markdown-body h1 code,.markdown-body h2 tt,.markdown-body h2 code,.markdown-body h3 tt,.markdown-body h3 code,.markdown-body h4 tt,.markdown-body h4 code,.markdown-body h5 tt,.markdown-body h5 code,.markdown-body h6 tt,.markdown-body h6 code{font-size:inherit;padding:0 .2em}.markdown-body summary h1,.markdown-body summary h2,.markdown-body summary h3,.markdown-body summary h4,.markdown-body summary h5,.markdown-body summary h6{display:inline-block}.markdown-body summary h1 .anchor,.markdown-body summary h2 .anchor,.markdown-body summary h3 .anchor,.markdown-body summary h4 .anchor,.markdown-body summary h5 .anchor,.markdown-body summary h6 .anchor{margin-left:-40px}.markdown-body summary h1,.markdown-body summary h2{border-bottom:0;padding-bottom:0}.markdown-body ul.no-list,.markdown-body ol.no-list{padding:0;list-style-type:none}.markdown-body ol[type=a\ s]{list-style-type:lower-alpha}.markdown-body ol[type=A\ s]{list-style-type:upper-alpha}.markdown-body ol[type=i\ s]{list-style-type:lower-roman}.markdown-body ol[type=I\ s]{list-style-type:upper-roman}.markdown-body ol[type="1"],.markdown-body div>ol:not([type]){list-style-type:decimal}.markdown-body ul ul,.markdown-body ul ol,.markdown-body ol ol,.markdown-body ol ul{margin-top:0;margin-bottom:0}.markdown-body li>p{margin-top:var(--base-size-16)}.markdown-body li+li{margin-top:.25em}.markdown-body dl{padding:0}.markdown-body dl dt{margin-top:var(--base-size-16);font-size:1em;font-style:italic;font-weight:var(--base-text-weight-semibold,600);padding:0}.markdown-body dl dd{padding:0 var(--base-size-16);margin-bottom:var(--base-size-16)}.markdown-body table th{font-weight:var(--base-text-weight-semibold,600)}.markdown-body table th,.markdown-body table td{border:1px solid var(--borderColor-default);padding:6px 13px}.markdown-body table td>:last-child{margin-bottom:0}.markdown-body table tr{background-color:var(--bgColor-default);border-top:1px solid var(--borderColor-muted)}.markdown-body table tr:nth-child(2n){background-color:var(--bgColor-muted)}.markdown-body table img{background-color:#0000}.markdown-body img[align=right]{padding-left:20px}.markdown-body img[align=left]{padding-right:20px}.markdown-body .emoji{vertical-align:text-top;background-color:#0000;max-width:none}.markdown-body span.frame{display:block;overflow:hidden}.markdown-body span.frame>span{float:left;border:1px solid var(--borderColor-default);width:auto;margin:13px 0 0;padding:7px;display:block;overflow:hidden}.markdown-body span.frame span img{float:left;display:block}.markdown-body span.frame span span{clear:both;color:var(--fgColor-default);padding:5px 0 0;display:block}.markdown-body span.align-center{clear:both;display:block;overflow:hidden}.markdown-body span.align-center>span{text-align:center;margin:13px auto 0;display:block;overflow:hidden}.markdown-body span.align-center span img{text-align:center;margin:0 auto}.markdown-body span.align-right{clear:both;display:block;overflow:hidden}.markdown-body span.align-right>span{text-align:right;margin:13px 0 0;display:block;overflow:hidden}.markdown-body span.align-right span img{text-align:right;margin:0}.markdown-body span.float-left{float:left;margin-right:13px;display:block;overflow:hidden}.markdown-body span.float-left span{margin:13px 0 0}.markdown-body span.float-right{float:right;margin-left:13px;display:block;overflow:hidden}.markdown-body span.float-right>span{text-align:right;margin:13px auto 0;display:block;overflow:hidden}.markdown-body code,.markdown-body tt{white-space:break-spaces;background-color:var(--bgColor-neutral-muted);border-radius:6px;margin:0;padding:.2em .4em;font-size:85%}.markdown-body code br,.markdown-body tt br{display:none}.markdown-body del code{-webkit-text-decoration:inherit;text-decoration:inherit}.markdown-body samp{font-size:85%}.markdown-body pre code{font-size:100%}.markdown-body pre>code{word-break:normal;white-space:pre;background:0 0;border:0;margin:0;padding:0}.markdown-body .highlight{margin-bottom:var(--base-size-16)}.markdown-body .highlight pre{word-break:normal;margin-bottom:0}.markdown-body .highlight pre,.markdown-body pre{padding:var(--base-size-16);color:var(--fgColor-default);background-color:var(--bgColor-muted);border-radius:6px;font-size:85%;line-height:1.45;overflow:auto}.markdown-body pre code,.markdown-body pre tt{line-height:inherit;word-wrap:normal;background-color:#0000;border:0;margin:0;padding:0;display:inline;overflow:visible}.markdown-body .csv-data td,.markdown-body .csv-data th{text-align:left;white-space:nowrap;padding:5px;font-size:12px;line-height:1;overflow:hidden}.markdown-body .csv-data .blob-num{padding:10px var(--base-size-8) 9px;text-align:right;background:var(--bgColor-default);border:0}.markdown-body .csv-data tr{border-top:0}.markdown-body .csv-data th{font-weight:var(--base-text-weight-semibold,600);background:var(--bgColor-muted);border-top:0}.markdown-body [data-footnote-ref]:before{content:"["}.markdown-body [data-footnote-ref]:after{content:"]"}.markdown-body .footnotes{color:var(--fgColor-muted);border-top:1px solid var(--borderColor-default);font-size:12px}.markdown-body .footnotes ol{padding-left:var(--base-size-16)}.markdown-body .footnotes ol ul{padding-left:var(--base-size-16);margin-top:var(--base-size-16);display:inline-block}.markdown-body .footnotes li{position:relative}.markdown-body .footnotes li:target:before{top:calc(var(--base-size-8)*-1);right:calc(var(--base-size-8)*-1);bottom:calc(var(--base-size-8)*-1);left:calc(var(--base-size-24)*-1);pointer-events:none;content:"";border:2px solid var(--borderColor-accent-emphasis);border-radius:6px;position:absolute}.markdown-body .footnotes li:target{color:var(--fgColor-default)}.markdown-body .footnotes .data-footnote-backref g-emoji{font-family:monospace}.markdown-body .pl-c{color:var(--color-prettylights-syntax-comment)}.markdown-body .pl-c1,.markdown-body .pl-s .pl-v{color:var(--color-prettylights-syntax-constant)}.markdown-body .pl-e,.markdown-body .pl-en{color:var(--color-prettylights-syntax-entity)}.markdown-body .pl-smi,.markdown-body .pl-s .pl-s1{color:var(--color-prettylights-syntax-storage-modifier-import)}.markdown-body .pl-ent{color:var(--color-prettylights-syntax-entity-tag)}.markdown-body .pl-k{color:var(--color-prettylights-syntax-keyword)}.markdown-body .pl-s,.markdown-body .pl-pds,.markdown-body .pl-s .pl-pse .pl-s1,.markdown-body .pl-sr,.markdown-body .pl-sr .pl-cce,.markdown-body .pl-sr .pl-sre,.markdown-body .pl-sr .pl-sra{color:var(--color-prettylights-syntax-string)}.markdown-body .pl-v,.markdown-body .pl-smw{color:var(--color-prettylights-syntax-variable)}.markdown-body .pl-bu{color:var(--color-prettylights-syntax-brackethighlighter-unmatched)}.markdown-body .pl-ii{color:var(--color-prettylights-syntax-invalid-illegal-text);background-color:var(--color-prettylights-syntax-invalid-illegal-bg)}.markdown-body .pl-c2{color:var(--color-prettylights-syntax-carriage-return-text);background-color:var(--color-prettylights-syntax-carriage-return-bg)}.markdown-body .pl-sr .pl-cce{color:var(--color-prettylights-syntax-string-regexp);font-weight:700}.markdown-body .pl-ml{color:var(--color-prettylights-syntax-markup-list)}.markdown-body .pl-mh,.markdown-body .pl-mh .pl-en,.markdown-body .pl-ms{color:var(--color-prettylights-syntax-markup-heading);font-weight:700}.markdown-body .pl-mi{color:var(--color-prettylights-syntax-markup-italic);font-style:italic}.markdown-body .pl-mb{color:var(--color-prettylights-syntax-markup-bold);font-weight:700}.markdown-body .pl-md{color:var(--color-prettylights-syntax-markup-deleted-text);background-color:var(--color-prettylights-syntax-markup-deleted-bg)}.markdown-body .pl-mi1{color:var(--color-prettylights-syntax-markup-inserted-text);background-color:var(--color-prettylights-syntax-markup-inserted-bg)}.markdown-body .pl-mc{color:var(--color-prettylights-syntax-markup-changed-text);background-color:var(--color-prettylights-syntax-markup-changed-bg)}.markdown-body .pl-mi2{color:var(--color-prettylights-syntax-markup-ignored-text);background-color:var(--color-prettylights-syntax-markup-ignored-bg)}.markdown-body .pl-mdr{color:var(--color-prettylights-syntax-meta-diff-range);font-weight:700}.markdown-body .pl-ba{color:var(--color-prettylights-syntax-brackethighlighter-angle)}.markdown-body .pl-sg{color:var(--color-prettylights-syntax-sublimelinter-gutter-mark)}.markdown-body .pl-corl{color:var(--color-prettylights-syntax-constant-other-reference-link);text-decoration:underline}.markdown-body [role=button]:focus:not(:focus-visible),.markdown-body [role=tabpanel][tabindex="0"]:focus:not(:focus-visible),.markdown-body button:focus:not(:focus-visible),.markdown-body summary:focus:not(:focus-visible),.markdown-body a:focus:not(:focus-visible){box-shadow:none;outline:none}.markdown-body [tabindex="0"]:focus:not(:focus-visible),.markdown-body details-dialog:focus:not(:focus-visible){outline:none}.markdown-body g-emoji{min-width:1ch;font-family:Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-size:1em;font-weight:var(--base-text-weight-normal,400);vertical-align:-.075em;line-height:1;display:inline-block;font-style:normal!important}.markdown-body g-emoji img{width:1em;height:1em}.markdown-body a:has(>p,>div,>pre,>blockquote){display:block}.markdown-body a:has(>p,>div,>pre,>blockquote):not(:has(.snippet-clipboard-content,>pre)){width:fit-content}.markdown-body a:has(>p,>div,>pre,>blockquote):has(.snippet-clipboard-content,>pre):focus-visible{outline:2px solid var(--focus-outlineColor);outline-offset:2px}.markdown-body .task-list-item{list-style-type:none}.markdown-body .task-list-item label{font-weight:var(--base-text-weight-normal,400)}.markdown-body .task-list-item.enabled label{cursor:pointer}.markdown-body .task-list-item+.task-list-item{margin-top:var(--base-size-4)}.markdown-body .task-list-item .handle{display:none}.markdown-body .task-list-item-checkbox{vertical-align:middle;margin:0 .2em .25em -1.4em}.markdown-body ul:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)) .task-list-item-checkbox,.markdown-body ol:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)) .task-list-item-checkbox{margin:0 -1.6em .25em .2em}.markdown-body .contains-task-list:hover .task-list-item-convert-container,.markdown-body .contains-task-list:focus-within .task-list-item-convert-container{clip-path:none;width:auto;height:24px;display:block;overflow:visible}.markdown-body ::-webkit-calendar-picker-indicator{filter:invert(50%)}.markdown-body .markdown-alert{padding:var(--base-size-8) var(--base-size-16);margin-bottom:var(--base-size-16);color:inherit;border-left:.25em solid var(--borderColor-default)}.markdown-body .markdown-alert>:first-child{margin-top:0}.markdown-body .markdown-alert>:last-child{margin-bottom:0}.markdown-body .markdown-alert .markdown-alert-title{font-weight:var(--base-text-weight-medium,500);align-items:center;line-height:1;display:flex}.markdown-body .markdown-alert.markdown-alert-note{border-left-color:var(--borderColor-accent-emphasis)}.markdown-body .markdown-alert.markdown-alert-note .markdown-alert-title{color:var(--fgColor-accent)}.markdown-body .markdown-alert.markdown-alert-important{border-left-color:var(--borderColor-done-emphasis)}.markdown-body .markdown-alert.markdown-alert-important .markdown-alert-title{color:var(--fgColor-done)}.markdown-body .markdown-alert.markdown-alert-warning{border-left-color:var(--borderColor-attention-emphasis)}.markdown-body .markdown-alert.markdown-alert-warning .markdown-alert-title{color:var(--fgColor-attention)}.markdown-body .markdown-alert.markdown-alert-tip{border-left-color:var(--borderColor-success-emphasis)}.markdown-body .markdown-alert.markdown-alert-tip .markdown-alert-title{color:var(--fgColor-success)}.markdown-body .markdown-alert.markdown-alert-caution{border-left-color:var(--borderColor-danger-emphasis)}.markdown-body .markdown-alert.markdown-alert-caution .markdown-alert-title{color:var(--fgColor-danger)}.markdown-body>:first-child>.heading-element:first-child{margin-top:0!important}.markdown-body .highlight pre:has(+.zeroclipboard-container){min-height:52px}.cb-edit-btn[data-v-17816a06]{border:1px solid var(--app-border-subtle);background:var(--app-content-bg);width:26px;height:26px;color:var(--app-text-subtle);cursor:pointer;border-radius:9999px;flex:none;justify-content:center;align-items:center;font-size:11px;transition:color .15s,border-color .15s,opacity .15s;display:inline-flex}.cb-edit-btn[data-v-17816a06]:hover{color:var(--el-color-primary);border-color:var(--el-color-primary-light-5)}.transcript-item[data-v-17816a06] .markdown-body{color:inherit;font-size:inherit;line-height:inherit;background:0 0}.transcript-item[data-v-17816a06] .markdown-body>:first-child{margin-top:0}.transcript-item[data-v-17816a06] .markdown-body>:last-child{margin-bottom:0}.transcript-item[data-v-17816a06] .markdown-body ol{list-style:decimal}.transcript-item[data-v-17816a06] .markdown-body ul{list-style:outside}.transcript-item[data-v-17816a06] .markdown-body pre{background:0 0;border-radius:6px;margin:0;padding:0;overflow:hidden}.transcript-item[data-v-17816a06] .markdown-body pre code{color:#fff}.transcript-item[data-v-17816a06] .markdown-body a{color:var(--el-color-primary);text-decoration:underline}.cb-stream-text.is-streaming[data-v-17816a06] .markdown-body>:last-child:after{content:"";vertical-align:text-bottom;background:var(--el-color-primary);border-radius:1px;width:.45em;height:1em;margin-left:2px;animation:1s step-end infinite cb-caret-blink-17816a06;display:inline-block}@keyframes cb-caret-blink-17816a06{0%,50%{opacity:1}50.01%,to{opacity:0}}.cb-thinking__spinner[data-v-6087e9e6]{width:1em;font-family:var(--el-font-family-mono,monospace);display:inline-block}.cb-thinking__caret[data-v-6087e9e6]{margin-left:1px;animation:1s step-end infinite cb-thinking-blink-6087e9e6}@keyframes cb-thinking-blink-6087e9e6{0%,50%{opacity:1}50.01%,to{opacity:0}}.cb-question-dock[data-v-f89ef2a0]{--auq-max-height:min(52dvh, 560px);flex-direction:column;min-height:0;display:flex}.cb-composer[data-v-f89ef2a0]{position:relative}.cb-composer__input[data-v-f89ef2a0] .el-textarea__inner{box-shadow:none;min-height:unset;background:0 0;border:none;padding:6px 4px;font-size:14px;line-height:1.5}@media (width<=767px){.cb-composer__input[data-v-f89ef2a0] .el-textarea__inner{font-size:16px}}.cb-cwd-input[data-v-f89ef2a0] .el-input__wrapper{border-radius:9999px}.cb-cwd-browse[data-v-f89ef2a0]{color:var(--app-text-subtle);cursor:pointer;justify-content:center;align-items:center;transition:color .15s;display:inline-flex}.cb-cwd-browse[data-v-f89ef2a0]:hover,.cb-cwd-browse[data-v-f89ef2a0]:focus-visible{color:var(--el-color-primary);outline:none}.cb-slash-menu[data-v-f89ef2a0]{z-index:20;border:1px solid var(--app-border-subtle);background:var(--app-content-bg);border-radius:12px;max-height:260px;margin:0;padding:4px;list-style:none;position:absolute;bottom:calc(100% + 6px);left:0;right:0;overflow-y:auto;box-shadow:0 8px 24px #0000001f}.cb-slash-menu__item[data-v-f89ef2a0]{cursor:pointer;color:var(--app-text);border-radius:8px;align-items:baseline;gap:8px;padding:6px 10px;font-size:13px;display:flex}.cb-slash-menu__item--active[data-v-f89ef2a0]{background:var(--app-content-hover-bg)}.cb-slash-menu__name[data-v-f89ef2a0]{font-family:var(--el-font-family-mono,monospace);color:var(--el-color-primary);flex:none}.cb-slash-menu__hint[data-v-f89ef2a0]{color:var(--app-text-subtle);flex:none;font-size:11px}.cb-slash-menu__desc[data-v-f89ef2a0]{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--app-text-subtle);flex:1;font-size:12px;overflow:hidden}.cb-edit-cancel[data-v-f89ef2a0]{color:var(--app-text-subtle);cursor:pointer;flex:none;transition:color .15s}.cb-edit-cancel[data-v-f89ef2a0]:hover{color:var(--el-color-primary)}.cb-restore-code[data-v-f89ef2a0]{height:auto}.cb-restore-code[data-v-f89ef2a0] .el-checkbox__label{font-size:12px}.cb-icon-btn[data-v-f89ef2a0]{border:1px solid var(--app-border-subtle);width:30px;height:30px;color:var(--app-text-subtle);cursor:pointer;background:0 0;border-radius:9999px;flex:none;justify-content:center;align-items:center;font-size:13px;transition:color .15s,border-color .15s;display:inline-flex}.cb-icon-btn[data-v-f89ef2a0]:hover{color:var(--el-color-primary);border-color:var(--el-color-primary-light-5)}.cb-pill[data-v-f89ef2a0]{border:1px solid var(--app-border-subtle);max-width:240px;height:28px;color:var(--app-text-subtle);cursor:pointer;background:0 0;border-radius:9999px;align-items:center;gap:6px;padding:0 10px;font-size:12px;line-height:1.2;transition:color .15s,border-color .15s;display:inline-flex}.cb-pill[data-v-f89ef2a0]:hover{color:var(--el-color-primary);border-color:var(--el-color-primary-light-5)}.cb-pill__icon[data-v-f89ef2a0]{flex:none;font-size:12px}.cb-pill__brand[data-v-f89ef2a0]{-o-object-fit:contain;object-fit:contain;vertical-align:middle;flex:none;width:14px;height:14px}.cb-pill__caret[data-v-f89ef2a0]{opacity:.55;flex:none;margin-left:2px;font-size:9px}.cb-pill--static[data-v-f89ef2a0]{cursor:default}.cb-pill--static[data-v-f89ef2a0]:hover{color:var(--app-text-subtle);border-color:var(--app-border-subtle)}html.dark .cb-pill__brand--invert[data-v-f89ef2a0]{filter:invert()}.cb-model-menu[data-v-f89ef2a0]{flex-direction:column;gap:2px;max-height:240px;display:flex;overflow-y:auto}.cb-model-option[data-v-f89ef2a0]{text-align:left;cursor:pointer;width:100%;color:inherit;background:0 0;border:none;border-radius:6px;align-items:center;padding:6px 8px;font-size:13px;display:flex}.cb-model-option__check[data-v-f89ef2a0]{flex:none;margin-right:6px;font-size:11px}.cb-model-option[data-v-f89ef2a0]:hover{background:var(--app-content-hover-bg)}.cb-model-custom[data-v-f89ef2a0]{border-top:1px solid var(--app-border-color,#00000014);margin-top:4px;padding-top:6px}.step-index[data-v-3d1ed01f]{color:#fff;background-color:var(--el-color-primary);border-radius:9999px;flex:none;justify-content:center;align-items:center;width:24px;height:24px;font-size:12px;display:flex}.cmd[data-v-3d1ed01f]{background-color:var(--app-sidebar-bg);border:1px solid var(--app-border-subtle);white-space:nowrap;border-radius:6px;padding:6px 10px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px;display:block;overflow-x:auto}.item[data-v-3414881a]{transition:border-color .15s}.item[data-v-3414881a]:hover{border-color:var(--el-color-primary)}.provider-tag[data-v-3414881a]{color:#fff;background:var(--el-color-primary);border-radius:4px;flex:none;padding:3px 6px;font-size:11px;line-height:1}.provider-tag.codex[data-v-3414881a]{background:var(--el-color-info,#909399)}.menu[data-v-44a88ff4]{display:none}@media (width<=767px){.sidebar[data-v-44a88ff4]{display:none}.menu[data-v-44a88ff4]{left:8px;top:calc(45px + var(--app-safe-area-top));z-index:1000;display:block;position:absolute}}
|
|
1
|
+
.markdown-body{--base-size-16:1rem;--base-size-24:1.5rem;--base-size-4:.25rem;--base-size-40:2.5rem;--base-size-8:.5rem;--base-text-weight-medium:500;--base-text-weight-normal:400;--base-text-weight-semibold:600;--fontStack-monospace:ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;--fontStack-sansSerif:-apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";--fgColor-accent:Highlight}@media (prefers-color-scheme:dark){.markdown-body,[data-theme=dark]{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--fgColor-accent:#4493f8;--bgColor-attention-muted:#bb800926;--bgColor-default:#0d1117;--bgColor-muted:#151b23;--bgColor-neutral-muted:#656c7633;--borderColor-accent-emphasis:#1f6feb;--borderColor-attention-emphasis:#9e6a03;--borderColor-danger-emphasis:#da3633;--borderColor-default:#3d444d;--borderColor-done-emphasis:#8957e5;--borderColor-success-emphasis:#238636;--color-prettylights-syntax-brackethighlighter-angle:#9198a1;--color-prettylights-syntax-brackethighlighter-unmatched:#f85149;--color-prettylights-syntax-carriage-return-bg:#b62324;--color-prettylights-syntax-carriage-return-text:#f0f6fc;--color-prettylights-syntax-comment:#9198a1;--color-prettylights-syntax-constant:#79c0ff;--color-prettylights-syntax-constant-other-reference-link:#a5d6ff;--color-prettylights-syntax-entity:#d2a8ff;--color-prettylights-syntax-entity-tag:#7ee787;--color-prettylights-syntax-keyword:#ff7b72;--color-prettylights-syntax-markup-bold:#f0f6fc;--color-prettylights-syntax-markup-changed-bg:#5a1e02;--color-prettylights-syntax-markup-changed-text:#ffdfb6;--color-prettylights-syntax-markup-deleted-bg:#67060c;--color-prettylights-syntax-markup-deleted-text:#ffdcd7;--color-prettylights-syntax-markup-heading:#1f6feb;--color-prettylights-syntax-markup-ignored-bg:#1158c7;--color-prettylights-syntax-markup-ignored-text:#f0f6fc;--color-prettylights-syntax-markup-inserted-bg:#033a16;--color-prettylights-syntax-markup-inserted-text:#aff5b4;--color-prettylights-syntax-markup-italic:#f0f6fc;--color-prettylights-syntax-markup-list:#f2cc60;--color-prettylights-syntax-meta-diff-range:#d2a8ff;--color-prettylights-syntax-storage-modifier-import:#f0f6fc;--color-prettylights-syntax-string:#a5d6ff;--color-prettylights-syntax-string-regexp:#7ee787;--color-prettylights-syntax-sublimelinter-gutter-mark:#3d444d;--color-prettylights-syntax-variable:#ffa657;--fgColor-attention:#d29922;--fgColor-danger:#f85149;--fgColor-default:#f0f6fc;--fgColor-done:#ab7df8;--fgColor-muted:#9198a1;--fgColor-success:#3fb950;--borderColor-muted:#3d444db3;--color-prettylights-syntax-invalid-illegal-bg:var(--bgColor-danger-muted);--color-prettylights-syntax-invalid-illegal-text:var(--fgColor-danger);--focus-outlineColor:var(--borderColor-accent-emphasis);--borderColor-neutral-muted:var(--borderColor-muted)}}@media (prefers-color-scheme:light){.markdown-body,[data-theme=light]{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--fgColor-danger:#d1242f;--bgColor-attention-muted:#fff8c5;--bgColor-muted:#f6f8fa;--bgColor-neutral-muted:#818b981f;--borderColor-accent-emphasis:#0969da;--borderColor-attention-emphasis:#9a6700;--borderColor-danger-emphasis:#cf222e;--borderColor-default:#d1d9e0;--borderColor-done-emphasis:#8250df;--borderColor-success-emphasis:#1a7f37;--color-prettylights-syntax-brackethighlighter-angle:#59636e;--color-prettylights-syntax-brackethighlighter-unmatched:#82071e;--color-prettylights-syntax-carriage-return-bg:#cf222e;--color-prettylights-syntax-carriage-return-text:#f6f8fa;--color-prettylights-syntax-comment:#59636e;--color-prettylights-syntax-constant:#0550ae;--color-prettylights-syntax-constant-other-reference-link:#0a3069;--color-prettylights-syntax-entity:#6639ba;--color-prettylights-syntax-entity-tag:#0550ae;--color-prettylights-syntax-invalid-illegal-text:var(--fgColor-danger);--color-prettylights-syntax-keyword:#cf222e;--color-prettylights-syntax-markup-changed-bg:#ffd8b5;--color-prettylights-syntax-markup-changed-text:#953800;--color-prettylights-syntax-markup-deleted-bg:#ffebe9;--color-prettylights-syntax-markup-deleted-text:#82071e;--color-prettylights-syntax-markup-heading:#0550ae;--color-prettylights-syntax-markup-ignored-bg:#0550ae;--color-prettylights-syntax-markup-ignored-text:#d1d9e0;--color-prettylights-syntax-markup-inserted-bg:#dafbe1;--color-prettylights-syntax-markup-inserted-text:#116329;--color-prettylights-syntax-markup-list:#3b2300;--color-prettylights-syntax-meta-diff-range:#8250df;--color-prettylights-syntax-string:#0a3069;--color-prettylights-syntax-string-regexp:#116329;--color-prettylights-syntax-sublimelinter-gutter-mark:#818b98;--color-prettylights-syntax-variable:#953800;--fgColor-accent:#0969da;--fgColor-attention:#9a6700;--fgColor-done:#8250df;--fgColor-muted:#59636e;--fgColor-success:#1a7f37;--bgColor-default:#fff;--borderColor-muted:#d1d9e0b3;--color-prettylights-syntax-invalid-illegal-bg:var(--bgColor-danger-muted);--color-prettylights-syntax-markup-bold:#1f2328;--color-prettylights-syntax-markup-italic:#1f2328;--color-prettylights-syntax-storage-modifier-import:#1f2328;--fgColor-default:#1f2328;--focus-outlineColor:var(--borderColor-accent-emphasis);--borderColor-neutral-muted:var(--borderColor-muted)}}.markdown-body{-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;font-weight:var(--base-text-weight-normal,400);color:var(--fgColor-default);background-color:var(--bgColor-default);font-family:var(--fontStack-sansSerif,-apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji");word-wrap:break-word;margin:0;font-size:16px;line-height:1.5}.markdown-body a{text-underline-offset:.2rem;text-decoration:underline}.markdown-body .octicon{fill:currentColor;vertical-align:text-bottom;display:inline-block}.markdown-body h1:hover .anchor .octicon-link:before,.markdown-body h2:hover .anchor .octicon-link:before,.markdown-body h3:hover .anchor .octicon-link:before,.markdown-body h4:hover .anchor .octicon-link:before,.markdown-body h5:hover .anchor .octicon-link:before,.markdown-body h6:hover .anchor .octicon-link:before{content:" ";background-color:currentColor;width:16px;height:16px;display:inline-block;-webkit-mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' version='1.1' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg>");mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' version='1.1' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg>")}.markdown-body details,.markdown-body figcaption,.markdown-body figure{display:block}.markdown-body summary{display:list-item}.markdown-body [hidden]{display:none!important}.markdown-body a{color:var(--fgColor-accent);background-color:#0000;text-decoration:none}.markdown-body abbr[title]{border-bottom:none;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.markdown-body b,.markdown-body strong{font-weight:var(--base-text-weight-semibold,600)}.markdown-body dfn{font-style:italic}.markdown-body h1{font-weight:var(--base-text-weight-semibold,600);border-bottom:1px solid var(--borderColor-muted);margin:.67em 0;padding-bottom:.3em;font-size:2em}.markdown-body mark{background-color:var(--bgColor-attention-muted);color:var(--fgColor-default)}.markdown-body small{font-size:90%}.markdown-body sub,.markdown-body sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}.markdown-body sub{bottom:-.25em}.markdown-body sup{top:-.5em}.markdown-body img{box-sizing:content-box;border-style:none;max-width:100%}.markdown-body code,.markdown-body kbd,.markdown-body pre,.markdown-body samp{font-family:monospace;font-size:1em}.markdown-body figure{margin:1em var(--base-size-40)}.markdown-body hr{box-sizing:content-box;border-bottom:1px solid var(--borderColor-muted);height:.25em;margin:var(--base-size-24) 0;background:0 0;background-color:var(--borderColor-default);border:0;padding:0;overflow:hidden}.markdown-body input{font:inherit;font-family:inherit;font-size:inherit;line-height:inherit;margin:0;overflow:visible}.markdown-body [type=button],.markdown-body [type=reset],.markdown-body [type=submit]{appearance:button}.markdown-body [type=checkbox],.markdown-body [type=radio]{box-sizing:border-box;padding:0}.markdown-body [type=number]::-webkit-inner-spin-button{height:auto}.markdown-body [type=number]::-webkit-outer-spin-button{height:auto}.markdown-body [type=search]::-webkit-search-cancel-button{appearance:none}.markdown-body [type=search]::-webkit-search-decoration{appearance:none}.markdown-body ::-webkit-input-placeholder{color:inherit;opacity:.54}.markdown-body ::-webkit-file-upload-button{appearance:button;font:inherit}.markdown-body a:hover{text-decoration:underline}.markdown-body ::placeholder{color:var(--fgColor-muted);opacity:1}.markdown-body hr:before{content:"";display:table}.markdown-body hr:after{clear:both;content:"";display:table}.markdown-body table{border-spacing:0;border-collapse:collapse;font-variant:tabular-nums;width:max-content;max-width:100%;display:block;overflow:auto}.markdown-body td,.markdown-body th{padding:0}.markdown-body details summary{cursor:pointer}.markdown-body a:focus,.markdown-body [role=button]:focus,.markdown-body input[type=radio]:focus,.markdown-body input[type=checkbox]:focus{outline:2px solid var(--focus-outlineColor);outline-offset:-2px;box-shadow:none}.markdown-body a:focus:not(:focus-visible),.markdown-body [role=button]:focus:not(:focus-visible),.markdown-body input[type=radio]:focus:not(:focus-visible),.markdown-body input[type=checkbox]:focus:not(:focus-visible){outline:1px solid #0000}.markdown-body a:focus-visible,.markdown-body [role=button]:focus-visible,.markdown-body input[type=radio]:focus-visible,.markdown-body input[type=checkbox]:focus-visible{outline:2px solid var(--focus-outlineColor);outline-offset:-2px;box-shadow:none}.markdown-body a:not([class]):focus,.markdown-body a:not([class]):focus-visible,.markdown-body input[type=radio]:focus,.markdown-body input[type=radio]:focus-visible,.markdown-body input[type=checkbox]:focus,.markdown-body input[type=checkbox]:focus-visible{outline-offset:0}.markdown-body kbd{padding:var(--base-size-4);font:11px var(--fontStack-monospace,ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);color:var(--fgColor-default);vertical-align:middle;background-color:var(--bgColor-muted);border:solid 1px var(--borderColor-neutral-muted);border-bottom-color:var(--borderColor-neutral-muted);box-shadow:inset 0 -1px 0 var(--borderColor-neutral-muted);border-radius:6px;line-height:10px;display:inline-block}.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6{margin-top:var(--base-size-24);margin-bottom:var(--base-size-16);font-weight:var(--base-text-weight-semibold,600);line-height:1.25}.markdown-body h2{font-weight:var(--base-text-weight-semibold,600);border-bottom:1px solid var(--borderColor-muted);padding-bottom:.3em;font-size:1.5em}.markdown-body h3{font-weight:var(--base-text-weight-semibold,600);font-size:1.25em}.markdown-body h4{font-weight:var(--base-text-weight-semibold,600);font-size:1em}.markdown-body h5{font-weight:var(--base-text-weight-semibold,600);font-size:.875em}.markdown-body h6{font-weight:var(--base-text-weight-semibold,600);color:var(--fgColor-muted);font-size:.85em}.markdown-body p{margin-top:0;margin-bottom:10px}.markdown-body blockquote{color:var(--fgColor-muted);border-left:.25em solid var(--borderColor-default);margin:0;padding:0 1em}.markdown-body ul,.markdown-body ol{margin-top:0;margin-bottom:0;padding-left:2em}.markdown-body ol ol,.markdown-body ul ol{list-style-type:lower-roman}.markdown-body ul ul ol,.markdown-body ul ol ol,.markdown-body ol ul ol,.markdown-body ol ol ol{list-style-type:lower-alpha}.markdown-body dd{margin-left:0}.markdown-body tt,.markdown-body code,.markdown-body samp{font-family:var(--fontStack-monospace,ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);font-size:12px}.markdown-body pre{font-family:var(--fontStack-monospace,ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);word-wrap:normal;margin-top:0;margin-bottom:0;font-size:12px}.markdown-body .octicon{vertical-align:text-bottom;fill:currentColor;display:inline-block;overflow:visible!important}.markdown-body input::-webkit-outer-spin-button{appearance:none;margin:0}.markdown-body input::-webkit-inner-spin-button{appearance:none;margin:0}.markdown-body .mr-2{margin-right:var(--base-size-8,8px)!important}.markdown-body:before{content:"";display:table}.markdown-body:after{clear:both;content:"";display:table}.markdown-body>:first-child{margin-top:0!important}.markdown-body>:last-child{margin-bottom:0!important}.markdown-body a:not([href]){color:inherit;text-decoration:none}.markdown-body .absent{color:var(--fgColor-danger)}.markdown-body .anchor{float:left;padding-right:var(--base-size-4);margin-left:-20px;line-height:1}.markdown-body .anchor:focus{outline:none}.markdown-body p,.markdown-body blockquote,.markdown-body ul,.markdown-body ol,.markdown-body dl,.markdown-body table,.markdown-body pre,.markdown-body details{margin-top:0;margin-bottom:var(--base-size-16)}.markdown-body blockquote>:first-child{margin-top:0}.markdown-body blockquote>:last-child{margin-bottom:0}.markdown-body h1 .octicon-link,.markdown-body h2 .octicon-link,.markdown-body h3 .octicon-link,.markdown-body h4 .octicon-link,.markdown-body h5 .octicon-link,.markdown-body h6 .octicon-link{color:var(--fgColor-default);vertical-align:middle;visibility:hidden}.markdown-body h1:hover .anchor,.markdown-body h2:hover .anchor,.markdown-body h3:hover .anchor,.markdown-body h4:hover .anchor,.markdown-body h5:hover .anchor,.markdown-body h6:hover .anchor{text-decoration:none}.markdown-body h1:hover .anchor .octicon-link,.markdown-body h2:hover .anchor .octicon-link,.markdown-body h3:hover .anchor .octicon-link,.markdown-body h4:hover .anchor .octicon-link,.markdown-body h5:hover .anchor .octicon-link,.markdown-body h6:hover .anchor .octicon-link{visibility:visible}.markdown-body h1 tt,.markdown-body h1 code,.markdown-body h2 tt,.markdown-body h2 code,.markdown-body h3 tt,.markdown-body h3 code,.markdown-body h4 tt,.markdown-body h4 code,.markdown-body h5 tt,.markdown-body h5 code,.markdown-body h6 tt,.markdown-body h6 code{font-size:inherit;padding:0 .2em}.markdown-body summary h1,.markdown-body summary h2,.markdown-body summary h3,.markdown-body summary h4,.markdown-body summary h5,.markdown-body summary h6{display:inline-block}.markdown-body summary h1 .anchor,.markdown-body summary h2 .anchor,.markdown-body summary h3 .anchor,.markdown-body summary h4 .anchor,.markdown-body summary h5 .anchor,.markdown-body summary h6 .anchor{margin-left:-40px}.markdown-body summary h1,.markdown-body summary h2{border-bottom:0;padding-bottom:0}.markdown-body ul.no-list,.markdown-body ol.no-list{padding:0;list-style-type:none}.markdown-body ol[type=a\ s]{list-style-type:lower-alpha}.markdown-body ol[type=A\ s]{list-style-type:upper-alpha}.markdown-body ol[type=i\ s]{list-style-type:lower-roman}.markdown-body ol[type=I\ s]{list-style-type:upper-roman}.markdown-body ol[type="1"],.markdown-body div>ol:not([type]){list-style-type:decimal}.markdown-body ul ul,.markdown-body ul ol,.markdown-body ol ol,.markdown-body ol ul{margin-top:0;margin-bottom:0}.markdown-body li>p{margin-top:var(--base-size-16)}.markdown-body li+li{margin-top:.25em}.markdown-body dl{padding:0}.markdown-body dl dt{margin-top:var(--base-size-16);font-size:1em;font-style:italic;font-weight:var(--base-text-weight-semibold,600);padding:0}.markdown-body dl dd{padding:0 var(--base-size-16);margin-bottom:var(--base-size-16)}.markdown-body table th{font-weight:var(--base-text-weight-semibold,600)}.markdown-body table th,.markdown-body table td{border:1px solid var(--borderColor-default);padding:6px 13px}.markdown-body table td>:last-child{margin-bottom:0}.markdown-body table tr{background-color:var(--bgColor-default);border-top:1px solid var(--borderColor-muted)}.markdown-body table tr:nth-child(2n){background-color:var(--bgColor-muted)}.markdown-body table img{background-color:#0000}.markdown-body img[align=right]{padding-left:20px}.markdown-body img[align=left]{padding-right:20px}.markdown-body .emoji{vertical-align:text-top;background-color:#0000;max-width:none}.markdown-body span.frame{display:block;overflow:hidden}.markdown-body span.frame>span{float:left;border:1px solid var(--borderColor-default);width:auto;margin:13px 0 0;padding:7px;display:block;overflow:hidden}.markdown-body span.frame span img{float:left;display:block}.markdown-body span.frame span span{clear:both;color:var(--fgColor-default);padding:5px 0 0;display:block}.markdown-body span.align-center{clear:both;display:block;overflow:hidden}.markdown-body span.align-center>span{text-align:center;margin:13px auto 0;display:block;overflow:hidden}.markdown-body span.align-center span img{text-align:center;margin:0 auto}.markdown-body span.align-right{clear:both;display:block;overflow:hidden}.markdown-body span.align-right>span{text-align:right;margin:13px 0 0;display:block;overflow:hidden}.markdown-body span.align-right span img{text-align:right;margin:0}.markdown-body span.float-left{float:left;margin-right:13px;display:block;overflow:hidden}.markdown-body span.float-left span{margin:13px 0 0}.markdown-body span.float-right{float:right;margin-left:13px;display:block;overflow:hidden}.markdown-body span.float-right>span{text-align:right;margin:13px auto 0;display:block;overflow:hidden}.markdown-body code,.markdown-body tt{white-space:break-spaces;background-color:var(--bgColor-neutral-muted);border-radius:6px;margin:0;padding:.2em .4em;font-size:85%}.markdown-body code br,.markdown-body tt br{display:none}.markdown-body del code{-webkit-text-decoration:inherit;text-decoration:inherit}.markdown-body samp{font-size:85%}.markdown-body pre code{font-size:100%}.markdown-body pre>code{word-break:normal;white-space:pre;background:0 0;border:0;margin:0;padding:0}.markdown-body .highlight{margin-bottom:var(--base-size-16)}.markdown-body .highlight pre{word-break:normal;margin-bottom:0}.markdown-body .highlight pre,.markdown-body pre{padding:var(--base-size-16);color:var(--fgColor-default);background-color:var(--bgColor-muted);border-radius:6px;font-size:85%;line-height:1.45;overflow:auto}.markdown-body pre code,.markdown-body pre tt{line-height:inherit;word-wrap:normal;background-color:#0000;border:0;margin:0;padding:0;display:inline;overflow:visible}.markdown-body .csv-data td,.markdown-body .csv-data th{text-align:left;white-space:nowrap;padding:5px;font-size:12px;line-height:1;overflow:hidden}.markdown-body .csv-data .blob-num{padding:10px var(--base-size-8) 9px;text-align:right;background:var(--bgColor-default);border:0}.markdown-body .csv-data tr{border-top:0}.markdown-body .csv-data th{font-weight:var(--base-text-weight-semibold,600);background:var(--bgColor-muted);border-top:0}.markdown-body [data-footnote-ref]:before{content:"["}.markdown-body [data-footnote-ref]:after{content:"]"}.markdown-body .footnotes{color:var(--fgColor-muted);border-top:1px solid var(--borderColor-default);font-size:12px}.markdown-body .footnotes ol{padding-left:var(--base-size-16)}.markdown-body .footnotes ol ul{padding-left:var(--base-size-16);margin-top:var(--base-size-16);display:inline-block}.markdown-body .footnotes li{position:relative}.markdown-body .footnotes li:target:before{top:calc(var(--base-size-8)*-1);right:calc(var(--base-size-8)*-1);bottom:calc(var(--base-size-8)*-1);left:calc(var(--base-size-24)*-1);pointer-events:none;content:"";border:2px solid var(--borderColor-accent-emphasis);border-radius:6px;position:absolute}.markdown-body .footnotes li:target{color:var(--fgColor-default)}.markdown-body .footnotes .data-footnote-backref g-emoji{font-family:monospace}.markdown-body .pl-c{color:var(--color-prettylights-syntax-comment)}.markdown-body .pl-c1,.markdown-body .pl-s .pl-v{color:var(--color-prettylights-syntax-constant)}.markdown-body .pl-e,.markdown-body .pl-en{color:var(--color-prettylights-syntax-entity)}.markdown-body .pl-smi,.markdown-body .pl-s .pl-s1{color:var(--color-prettylights-syntax-storage-modifier-import)}.markdown-body .pl-ent{color:var(--color-prettylights-syntax-entity-tag)}.markdown-body .pl-k{color:var(--color-prettylights-syntax-keyword)}.markdown-body .pl-s,.markdown-body .pl-pds,.markdown-body .pl-s .pl-pse .pl-s1,.markdown-body .pl-sr,.markdown-body .pl-sr .pl-cce,.markdown-body .pl-sr .pl-sre,.markdown-body .pl-sr .pl-sra{color:var(--color-prettylights-syntax-string)}.markdown-body .pl-v,.markdown-body .pl-smw{color:var(--color-prettylights-syntax-variable)}.markdown-body .pl-bu{color:var(--color-prettylights-syntax-brackethighlighter-unmatched)}.markdown-body .pl-ii{color:var(--color-prettylights-syntax-invalid-illegal-text);background-color:var(--color-prettylights-syntax-invalid-illegal-bg)}.markdown-body .pl-c2{color:var(--color-prettylights-syntax-carriage-return-text);background-color:var(--color-prettylights-syntax-carriage-return-bg)}.markdown-body .pl-sr .pl-cce{color:var(--color-prettylights-syntax-string-regexp);font-weight:700}.markdown-body .pl-ml{color:var(--color-prettylights-syntax-markup-list)}.markdown-body .pl-mh,.markdown-body .pl-mh .pl-en,.markdown-body .pl-ms{color:var(--color-prettylights-syntax-markup-heading);font-weight:700}.markdown-body .pl-mi{color:var(--color-prettylights-syntax-markup-italic);font-style:italic}.markdown-body .pl-mb{color:var(--color-prettylights-syntax-markup-bold);font-weight:700}.markdown-body .pl-md{color:var(--color-prettylights-syntax-markup-deleted-text);background-color:var(--color-prettylights-syntax-markup-deleted-bg)}.markdown-body .pl-mi1{color:var(--color-prettylights-syntax-markup-inserted-text);background-color:var(--color-prettylights-syntax-markup-inserted-bg)}.markdown-body .pl-mc{color:var(--color-prettylights-syntax-markup-changed-text);background-color:var(--color-prettylights-syntax-markup-changed-bg)}.markdown-body .pl-mi2{color:var(--color-prettylights-syntax-markup-ignored-text);background-color:var(--color-prettylights-syntax-markup-ignored-bg)}.markdown-body .pl-mdr{color:var(--color-prettylights-syntax-meta-diff-range);font-weight:700}.markdown-body .pl-ba{color:var(--color-prettylights-syntax-brackethighlighter-angle)}.markdown-body .pl-sg{color:var(--color-prettylights-syntax-sublimelinter-gutter-mark)}.markdown-body .pl-corl{color:var(--color-prettylights-syntax-constant-other-reference-link);text-decoration:underline}.markdown-body [role=button]:focus:not(:focus-visible),.markdown-body [role=tabpanel][tabindex="0"]:focus:not(:focus-visible),.markdown-body button:focus:not(:focus-visible),.markdown-body summary:focus:not(:focus-visible),.markdown-body a:focus:not(:focus-visible){box-shadow:none;outline:none}.markdown-body [tabindex="0"]:focus:not(:focus-visible),.markdown-body details-dialog:focus:not(:focus-visible){outline:none}.markdown-body g-emoji{min-width:1ch;font-family:Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-size:1em;font-weight:var(--base-text-weight-normal,400);vertical-align:-.075em;line-height:1;display:inline-block;font-style:normal!important}.markdown-body g-emoji img{width:1em;height:1em}.markdown-body a:has(>p,>div,>pre,>blockquote){display:block}.markdown-body a:has(>p,>div,>pre,>blockquote):not(:has(.snippet-clipboard-content,>pre)){width:fit-content}.markdown-body a:has(>p,>div,>pre,>blockquote):has(.snippet-clipboard-content,>pre):focus-visible{outline:2px solid var(--focus-outlineColor);outline-offset:2px}.markdown-body .task-list-item{list-style-type:none}.markdown-body .task-list-item label{font-weight:var(--base-text-weight-normal,400)}.markdown-body .task-list-item.enabled label{cursor:pointer}.markdown-body .task-list-item+.task-list-item{margin-top:var(--base-size-4)}.markdown-body .task-list-item .handle{display:none}.markdown-body .task-list-item-checkbox{vertical-align:middle;margin:0 .2em .25em -1.4em}.markdown-body ul:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)) .task-list-item-checkbox,.markdown-body ol:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)) .task-list-item-checkbox{margin:0 -1.6em .25em .2em}.markdown-body .contains-task-list:hover .task-list-item-convert-container,.markdown-body .contains-task-list:focus-within .task-list-item-convert-container{clip-path:none;width:auto;height:24px;display:block;overflow:visible}.markdown-body ::-webkit-calendar-picker-indicator{filter:invert(50%)}.markdown-body .markdown-alert{padding:var(--base-size-8) var(--base-size-16);margin-bottom:var(--base-size-16);color:inherit;border-left:.25em solid var(--borderColor-default)}.markdown-body .markdown-alert>:first-child{margin-top:0}.markdown-body .markdown-alert>:last-child{margin-bottom:0}.markdown-body .markdown-alert .markdown-alert-title{font-weight:var(--base-text-weight-medium,500);align-items:center;line-height:1;display:flex}.markdown-body .markdown-alert.markdown-alert-note{border-left-color:var(--borderColor-accent-emphasis)}.markdown-body .markdown-alert.markdown-alert-note .markdown-alert-title{color:var(--fgColor-accent)}.markdown-body .markdown-alert.markdown-alert-important{border-left-color:var(--borderColor-done-emphasis)}.markdown-body .markdown-alert.markdown-alert-important .markdown-alert-title{color:var(--fgColor-done)}.markdown-body .markdown-alert.markdown-alert-warning{border-left-color:var(--borderColor-attention-emphasis)}.markdown-body .markdown-alert.markdown-alert-warning .markdown-alert-title{color:var(--fgColor-attention)}.markdown-body .markdown-alert.markdown-alert-tip{border-left-color:var(--borderColor-success-emphasis)}.markdown-body .markdown-alert.markdown-alert-tip .markdown-alert-title{color:var(--fgColor-success)}.markdown-body .markdown-alert.markdown-alert-caution{border-left-color:var(--borderColor-danger-emphasis)}.markdown-body .markdown-alert.markdown-alert-caution .markdown-alert-title{color:var(--fgColor-danger)}.markdown-body>:first-child>.heading-element:first-child{margin-top:0!important}.markdown-body .highlight pre:has(+.zeroclipboard-container){min-height:52px}.cb-edit-btn[data-v-17816a06]{border:1px solid var(--app-border-subtle);background:var(--app-content-bg);width:26px;height:26px;color:var(--app-text-subtle);cursor:pointer;border-radius:9999px;flex:none;justify-content:center;align-items:center;font-size:11px;transition:color .15s,border-color .15s,opacity .15s;display:inline-flex}.cb-edit-btn[data-v-17816a06]:hover{color:var(--el-color-primary);border-color:var(--el-color-primary-light-5)}.transcript-item[data-v-17816a06] .markdown-body{color:inherit;font-size:inherit;line-height:inherit;background:0 0}.transcript-item[data-v-17816a06] .markdown-body>:first-child{margin-top:0}.transcript-item[data-v-17816a06] .markdown-body>:last-child{margin-bottom:0}.transcript-item[data-v-17816a06] .markdown-body ol{list-style:decimal}.transcript-item[data-v-17816a06] .markdown-body ul{list-style:outside}.transcript-item[data-v-17816a06] .markdown-body pre{background:0 0;border-radius:6px;margin:0;padding:0;overflow:hidden}.transcript-item[data-v-17816a06] .markdown-body pre code{color:#fff}.transcript-item[data-v-17816a06] .markdown-body a{color:var(--el-color-primary);text-decoration:underline}.cb-stream-text.is-streaming[data-v-17816a06] .markdown-body>:last-child:after{content:"";vertical-align:text-bottom;background:var(--el-color-primary);border-radius:1px;width:.45em;height:1em;margin-left:2px;animation:1s step-end infinite cb-caret-blink-17816a06;display:inline-block}@keyframes cb-caret-blink-17816a06{0%,50%{opacity:1}50.01%,to{opacity:0}}.cb-thinking__spinner[data-v-6087e9e6]{width:1em;font-family:var(--el-font-family-mono,monospace);display:inline-block}.cb-thinking__caret[data-v-6087e9e6]{margin-left:1px;animation:1s step-end infinite cb-thinking-blink-6087e9e6}@keyframes cb-thinking-blink-6087e9e6{0%,50%{opacity:1}50.01%,to{opacity:0}}.cb-question-dock[data-v-aa5e6831]{--auq-max-height:min(52dvh, 560px);flex-direction:column;min-height:0;display:flex}.cb-composer[data-v-aa5e6831]{position:relative}.cb-composer__input[data-v-aa5e6831] .el-textarea__inner{box-shadow:none;min-height:unset;background:0 0;border:none;padding:6px 4px;font-size:14px;line-height:1.5}@media (width<=767px){.cb-composer__input[data-v-aa5e6831] .el-textarea__inner{font-size:16px}}.cb-cwd-input[data-v-aa5e6831] .el-input__wrapper{border-radius:9999px}.cb-cwd-browse[data-v-aa5e6831]{color:var(--app-text-subtle);cursor:pointer;justify-content:center;align-items:center;transition:color .15s;display:inline-flex}.cb-cwd-browse[data-v-aa5e6831]:hover,.cb-cwd-browse[data-v-aa5e6831]:focus-visible{color:var(--el-color-primary);outline:none}.cb-slash-menu[data-v-aa5e6831]{z-index:20;border:1px solid var(--app-border-subtle);background:var(--app-content-bg);border-radius:12px;max-height:260px;margin:0;padding:4px;list-style:none;position:absolute;bottom:calc(100% + 6px);left:0;right:0;overflow-y:auto;box-shadow:0 8px 24px #0000001f}.cb-slash-menu__item[data-v-aa5e6831]{cursor:pointer;color:var(--app-text);border-radius:8px;align-items:baseline;gap:8px;padding:6px 10px;font-size:13px;display:flex}.cb-slash-menu__item--active[data-v-aa5e6831]{background:var(--app-content-hover-bg)}.cb-slash-menu__name[data-v-aa5e6831]{font-family:var(--el-font-family-mono,monospace);color:var(--el-color-primary);flex:none}.cb-slash-menu__hint[data-v-aa5e6831]{color:var(--app-text-subtle);flex:none;font-size:11px}.cb-slash-menu__desc[data-v-aa5e6831]{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--app-text-subtle);flex:1;font-size:12px;overflow:hidden}.cb-edit-cancel[data-v-aa5e6831]{color:var(--app-text-subtle);cursor:pointer;flex:none;transition:color .15s}.cb-edit-cancel[data-v-aa5e6831]:hover{color:var(--el-color-primary)}.cb-restore-code[data-v-aa5e6831]{height:auto}.cb-restore-code[data-v-aa5e6831] .el-checkbox__label{font-size:12px}.cb-icon-btn[data-v-aa5e6831]{border:1px solid var(--app-border-subtle);width:30px;height:30px;color:var(--app-text-subtle);cursor:pointer;background:0 0;border-radius:9999px;flex:none;justify-content:center;align-items:center;font-size:13px;transition:color .15s,border-color .15s;display:inline-flex}.cb-icon-btn[data-v-aa5e6831]:hover{color:var(--el-color-primary);border-color:var(--el-color-primary-light-5)}.cb-pill[data-v-aa5e6831]{border:1px solid var(--app-border-subtle);max-width:240px;height:28px;color:var(--app-text-subtle);cursor:pointer;background:0 0;border-radius:9999px;align-items:center;gap:6px;padding:0 10px;font-size:12px;line-height:1.2;transition:color .15s,border-color .15s;display:inline-flex}.cb-pill[data-v-aa5e6831]:hover{color:var(--el-color-primary);border-color:var(--el-color-primary-light-5)}.cb-pill__icon[data-v-aa5e6831]{flex:none;font-size:12px}.cb-pill__brand[data-v-aa5e6831]{-o-object-fit:contain;object-fit:contain;vertical-align:middle;flex:none;width:14px;height:14px}.cb-pill__caret[data-v-aa5e6831]{opacity:.55;flex:none;margin-left:2px;font-size:9px}.cb-pill--static[data-v-aa5e6831]{cursor:default}.cb-pill--static[data-v-aa5e6831]:hover{color:var(--app-text-subtle);border-color:var(--app-border-subtle)}html.dark .cb-pill__brand--invert[data-v-aa5e6831]{filter:invert()}.cb-model-menu[data-v-aa5e6831]{flex-direction:column;gap:2px;max-height:240px;display:flex;overflow-y:auto}.cb-model-option[data-v-aa5e6831]{text-align:left;cursor:pointer;width:100%;color:inherit;background:0 0;border:none;border-radius:6px;align-items:center;padding:6px 8px;font-size:13px;display:flex}.cb-model-option__check[data-v-aa5e6831]{flex:none;margin-right:6px;font-size:11px}.cb-model-option[data-v-aa5e6831]:hover{background:var(--app-content-hover-bg)}.cb-model-custom[data-v-aa5e6831]{border-top:1px solid var(--app-border-color,#00000014);margin-top:4px;padding-top:6px}.step-index[data-v-3d1ed01f]{color:#fff;background-color:var(--el-color-primary);border-radius:9999px;flex:none;justify-content:center;align-items:center;width:24px;height:24px;font-size:12px;display:flex}.cmd[data-v-3d1ed01f]{background-color:var(--app-sidebar-bg);border:1px solid var(--app-border-subtle);white-space:nowrap;border-radius:6px;padding:6px 10px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px;display:block;overflow-x:auto}.item[data-v-3414881a]{transition:border-color .15s}.item[data-v-3414881a]:hover{border-color:var(--el-color-primary)}.provider-tag[data-v-3414881a]{color:#fff;background:var(--el-color-primary);border-radius:4px;flex:none;padding:3px 6px;font-size:11px;line-height:1}.provider-tag.codex[data-v-3414881a]{background:var(--el-color-info,#909399)}.menu[data-v-44a88ff4]{display:none}@media (width<=767px){.sidebar[data-v-44a88ff4]{display:none}.menu[data-v-44a88ff4]{left:8px;top:calc(45px + var(--app-safe-area-top));z-index:1000;display:block;position:absolute}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{$ as e,D as t,E as n,M as r,N as i,O as a,P as o,Q as s,Ut as c,X as l,_ as u,et as d,k as f,lt as p,tt as m,ut as h,x as g,y as _}from"./vendor-chart-mdwpew_o.js";import{t as v}from"./button-DWzbdjZV.js";import{F as y,X as b,Y as x,tt as S,z as C}from"./use-deprecated-CPfQu7wa.js";import{r as w,t as T}from"./select-BdxNJvVA.js";import{n as E,t as D}from"./tabs-Vpcr2eiv.js";import{t as O}from"./upload-cst9ChUG.js";import{t as k}from"./tooltip-C3PYfh8V.js";import{t as A}from"./image-DhZ3AYYg.js";import{t as j}from"./avatar-DJGt2zYX.js";import{n as M,r as N}from"./radio-IJQsW93X.js";import{n as ee,t as P}from"./collapse-6hEfnElE.js";import{t as F}from"./drawer-BvYPSxXh.js";import{n as I,r as te,t as ne}from"./dropdown-CPemIUgw.js";import{t as L}from"./input-number-BLiYIcDP.js";import{n as re,t as ie}from"./skeleton-Cn4UY-T8.js";import{t as ae}from"./slider-DCyKC0oi.js";import{t as oe}from"./switch-BLmaNxij.js";import{An as se,pi as R}from"./constants-C-bSXdJ_.js";import{An as z,At as B,E as V,Fn as H,Ir as U,Nt as W,Ot as G,Sr as K,kr as q,kt as ce,nn as J,yr as Y}from"./index-CZaid7Ez.js";import{t as X}from"./index.es-SMgxJgUT.js";import{n as le}from"./taskDrawerMixin-Cr17Yxqk.js";import{i as Z,n as ue,r as de,t as fe}from"./pagination-8ujfpoRu.js";import{n as pe,t as me}from"./NoTasks-vOEmwSFQ.js";import{t as he}from"./Consumption-fBw5c2fv.js";import{n as ge,r as Q,t as _e}from"./Player-BeKsc7BW.js";var ve=o({name:`LayoutProducer`,components:{ElDrawer:F,ElButton:v,FontAwesomeIcon:X},mixins:[le],data(){return{preview:!1}},computed:{}}),ye={class:`main flex flex-row flex-1`},be={class:`config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},xe={class:`result h-full flex flex-col flex-1 min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`},Se={class:`preview h-full w-[300px] flex flex-col`};function Ce(t,r,a,o,s,c){let m=d(`font-awesome-icon`),g=d(`el-button`),_=d(`el-drawer`);return l(),f(`div`,ye,[n(`div`,be,[e(t.$slots,`config`,{},void 0,!0)]),n(`div`,xe,[e(t.$slots,`result`,{},void 0,!0)]),n(`div`,Se,[e(t.$slots,`preview`,{},void 0,!0)]),h(i(g,{circle:``,class:`menu`,onClick:r[0]||=e=>t.drawer=!0},{default:p(()=>[i(m,{icon:`fa-solid fa-magic`})]),_:1},512),[[u,!t.tasksEmpty]]),i(_,{modelValue:t.drawer,"onUpdate:modelValue":r[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer`},{default:p(()=>[e(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var we=V(ve,[[`render`,Ce],[`__scopeId`,`data-v-cc984c6f`]]),Te=o({name:`TypeSelector`,components:{ElSelect:w,ElOption:T,ElSwitch:oe,InfoIcon:Z},data(){return{options:[{label:`FUZZ-2.0 Pro`,value:`FUZZ-2.0 Pro`,desc:this.$t(`producer.model.fuzz20proDesc`)},{label:`FUZZ-2.0`,value:`FUZZ-2.0`,desc:this.$t(`producer.model.fuzz20desc`)},{label:`FUZZ-2.0 Raw`,value:`FUZZ-2.0 Raw`,desc:this.$t(`producer.model.fuzz20rawDesc`)},{label:`FUZZ-1.1 Pro`,value:`FUZZ-1.1 Pro`,desc:this.$t(`producer.model.fuzz11proDesc`)},{label:`FUZZ-1.1`,value:`FUZZ-1.1`,desc:this.$t(`producer.model.fuzz11desc`)},{label:`FUZZ-1.0 Pro`,value:`FUZZ-1.0 Pro`,desc:this.$t(`producer.model.fuzz10proDesc`)},{label:`FUZZ-1.0`,value:`FUZZ-1.0`,desc:this.$t(`producer.model.fuzz10desc`)},{label:`FUZZ-0.8`,value:`FUZZ-0.8`,desc:this.$t(`producer.model.fuzz08desc`)}]}},computed:{custom:{get(){return this.$store.state.producer?.config?.custom||!1},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,custom:e})}},instrumental:{get(){return this.$store.state.producer?.config?.instrumental||!1},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,instrumental:e})}},model:{get(){return this.$store.state.producer?.config?.model},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,model:e})}}},mounted(){this.model||=se}}),Ee={class:`mb-3`},De={class:`flex items-center mb-1`},Oe={class:`text-sm font-bold`},ke={class:`model-option`},Ae={class:`model-option-name`},je={class:`model-option-desc`},Me={key:0,class:`flex items-center justify-between mb-3`},Ne={class:`flex items-center`},Pe={class:`text-sm font-bold`};function Fe(e,r,o,u,m,h){let _=d(`el-option`),v=d(`el-select`),y=d(`info-icon`),b=d(`el-switch`);return l(),f(`div`,null,[n(`div`,Ee,[n(`div`,De,[n(`span`,Oe,c(e.$t(`producer.name.model`)),1)]),i(v,{modelValue:e.model,"onUpdate:modelValue":r[0]||=t=>e.model=t,class:`w-full model-select`,size:`default`,placeholder:e.$t(`producer.placeholder.select`)},{default:p(()=>[(l(!0),f(g,null,s(e.options,e=>(l(),t(_,{key:e.value,label:e.label,value:e.value},{default:p(()=>[n(`div`,ke,[n(`span`,Ae,c(e.label),1),n(`span`,je,c(e.desc),1)])]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])]),e.custom?(l(),f(`div`,Me,[n(`div`,Ne,[n(`span`,Pe,c(e.$t(`producer.name.instrumental`)),1),i(y,{content:e.$t(`producer.description.instrumental`)},null,8,[`content`])]),i(b,{modelValue:e.instrumental,"onUpdate:modelValue":r[1]||=t=>e.instrumental=t},null,8,[`modelValue`])])):a(``,!0)])}var Ie=V(Te,[[`render`,Fe],[`__scopeId`,`data-v-42496b9a`]]),Le=o({name:`UploadAudio`,components:{ElUpload:O,ElButton:v,ElRadioGroup:N,ElRadioButton:M,InfoIcon:Z,FontAwesomeIcon:X},mixins:[ce],emits:[`change`],data(){return{fileList:[],uploadUrl:K()+`/api/v1/files/`,audioPreviewUrl:null,uploading:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},credential(){return this.$store.state.producer.credential},config(){return this.$store.state.producer.config},urls(){return this.fileList.map(e=>e?.response?.file_url)},hasUploadedAudio(){let e=this.$store.state.producer?.config?.action;return e===`upload_extend`||e===`upload_cover`},uploadAction:{get(){return this.$store.state.producer?.config?.action||`upload_extend`},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,action:e})}}},watch:{urls:{handler(e){this.$emit(`change`,e)}}},methods:{onExceed(){q.warning(this.$t(`producer.message.uploadReferencesExceed`))},onError(){this.uploading=!1,q.error(this.$t(`producer.message.uploadReferencesError`))},async onSuccess(){let e=this.urls?.[0];if(!e){this.uploading=!1;return}this.audioPreviewUrl=e,await this.onGenerateAudioId(e)},async onGenerateAudioId(e){let t={audio_url:e},n=this.credential?.token;if(!n){console.error(`no token specified`),this.uploading=!1;return}this.uploading=!0,q.info(this.$t(`producer.message.startingUploadAudio`));try{let e=(await J.upload(t,{token:n})).data?.data.audio_id;this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,audio_id:e,action:`upload_extend`}),q.success(this.$t(`producer.message.startUploadAudioSuccess`))}catch(e){q.error(e?.response?.data?.error?.message||this.$t(`producer.message.startUploadAudioFailed`))}finally{this.uploading=!1}}}}),Re={class:`relative`},ze={class:`flex justify-between items-center mb-2`},Be={class:`flex justify-start items-center`},Ve={class:`text-sm font-bold`},He={key:0,class:`mb-2`},Ue=[`src`],We={key:1,class:`mt-1`};function Ge(e,t,o,s,u,m){let h=d(`info-icon`),g=d(`font-awesome-icon`),_=d(`el-button`),v=d(`el-upload`),y=d(`el-radio-button`),b=d(`el-radio-group`);return l(),f(`div`,Re,[n(`div`,ze,[n(`div`,Be,[n(`span`,Ve,c(e.$t(`producer.name.referenceAudios`)),1),i(h,{content:e.$t(`producer.description.uploadAudios`)},null,8,[`content`])]),i(v,{"file-list":e.fileList,"onUpdate:fileList":t[0]||=t=>e.fileList=t,name:`file`,limit:1,class:`upload-wrapper inline-upload`,action:e.uploadUrl,accept:`.mp3,.wav,.m4a,audio/*`,"show-file-list":!1,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{default:p(()=>[i(_,{round:``,type:`primary`,size:`small`,loading:e.uploading},{default:p(()=>[i(g,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+c(e.$t(`producer.button.uploadAudios`)),1)]),_:1},8,[`loading`])]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])]),e.audioPreviewUrl?(l(),f(`div`,He,[n(`audio`,{src:e.audioPreviewUrl,controls:``,class:`w-full`},null,8,Ue)])):a(``,!0),e.hasUploadedAudio?(l(),f(`div`,We,[i(b,{modelValue:e.uploadAction,"onUpdate:modelValue":t[1]||=t=>e.uploadAction=t,size:`small`},{default:p(()=>[i(y,{value:`upload_extend`},{default:p(()=>[r(c(e.$t(`producer.button.extend`)),1)]),_:1}),i(y,{value:`upload_cover`},{default:p(()=>[r(c(e.$t(`producer.button.cover_music`)),1)]),_:1})]),_:1},8,[`modelValue`])])):a(``,!0)])}var Ke=V(Le,[[`render`,Ge],[`__scopeId`,`data-v-7fd0580a`]]),qe=o({name:`PromptInput`,components:{PromptTextarea:pe},computed:{prompt:{get(){return this.$store.state.producer?.config?.prompt},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Je(e,n,r,i,a,o){let s=d(`prompt-textarea`);return l(),t(s,{modelValue:e.prompt,"onUpdate:modelValue":n[0]||=t=>e.prompt=t,title:e.$t(`producer.name.songDescription`),info:e.$t(`producer.description.prompt`),placeholder:e.$t(`producer.placeholder.prompt`),"min-rows":5,"max-rows":14},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ye=V(qe,[[`render`,Je]]),Xe=o({name:`LyricInput`,components:{ElInput:U,ElButton:v,FontAwesomeIcon:X,InfoIcon:Z},data(){return{generatingLyrics:!1}},computed:{lyric:{get(){return this.$store.state.producer?.config?.lyric},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,lyric:e})}},config(){return this.$store.state.producer?.config},credential(){return this.$store.state.producer?.credential}},mounted(){this.lyric||=``},methods:{async onGenerateLyrics(){let e=this.credential?.token;if(!e)return;let t=this.config?.style||this.config?.title||`a beautiful song`;this.generatingLyrics=!0,q.info(this.$t(`producer.message.generatingLyrics`));try{let n=(await J.lyric({prompt:t},{token:e})).data?.data;n?.text&&(this.lyric=n.text,n?.title&&!this.config?.title&&this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,lyric:n.text,title:n.title}),q.success(this.$t(`producer.message.generateLyricsSuccess`)))}catch{q.error(this.$t(`producer.message.generateLyricsFailed`))}finally{this.generatingLyrics=!1}}}}),Ze={class:`field`},Qe={class:`flex items-center justify-between mb-1`},$e={class:`flex items-center`},et={class:`text-sm font-bold`};function tt(e,o,s,u,m,h){let g=d(`info-icon`),_=d(`font-awesome-icon`),v=d(`el-button`),y=d(`el-input`);return l(),f(`div`,Ze,[n(`div`,Qe,[n(`div`,$e,[n(`span`,et,c(e.$t(`producer.name.lyrics`)),1),i(g,{content:e.$t(`producer.description.lyrics`)},null,8,[`content`])]),e.config?.action===`extend`?a(``,!0):(l(),t(v,{key:0,size:`small`,loading:e.generatingLyrics,round:``,onClick:e.onGenerateLyrics},{default:p(()=>[e.generatingLyrics?a(``,!0):(l(),t(_,{key:0,icon:`fa-solid fa-wand-magic-sparkles`,class:`mr-1`})),r(` `+c(e.$t(`producer.button.generate_lyrics`)),1)]),_:1},8,[`loading`,`onClick`]))]),e.config?.action===`extend`?(l(),t(y,{key:1,modelValue:e.lyric,"onUpdate:modelValue":o[1]||=t=>e.lyric=t,rows:5,type:`textarea`,class:`lyrics`,placeholder:e.$t(`producer.placeholder.extend.lyrics`)},null,8,[`modelValue`,`placeholder`])):(l(),t(y,{key:0,modelValue:e.lyric,"onUpdate:modelValue":o[0]||=t=>e.lyric=t,rows:5,type:`textarea`,class:`lyrics`,placeholder:e.$t(`producer.placeholder.lyrics`)},null,8,[`modelValue`,`placeholder`]))])}var nt=V(Xe,[[`render`,tt],[`__scopeId`,`data-v-88c6da2b`]]),rt=o({name:`StyleInput`,components:{ElInput:U,InfoIcon:Z},computed:{style:{get(){return this.$store.state.producer?.config?.style},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,style:e})}}}}),it={class:`field`},at={class:`flex items-center justify-between mb-1`},ot={class:`flex items-center`},st={class:`text-sm font-bold`};function ct(e,t,r,a,o,s){let u=d(`info-icon`),p=d(`el-input`);return l(),f(`div`,it,[n(`div`,at,[n(`div`,ot,[n(`span`,st,c(e.$t(`producer.name.style`)),1),i(u,{content:e.$t(`producer.description.style`)},null,8,[`content`])])]),i(p,{modelValue:e.style,"onUpdate:modelValue":t[0]||=t=>e.style=t,rows:2,type:`textarea`,placeholder:e.$t(`producer.placeholder.style`)},null,8,[`modelValue`,`placeholder`])])}var lt=V(rt,[[`render`,ct]]),ut=o({name:`TitleInput`,components:{ElInput:U,InfoIcon:Z},computed:{title:{get(){return this.$store.state.producer?.config?.title},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,title:e})}}}}),dt={class:`field`},ft={class:`flex items-center mb-1`},pt={class:`text-sm font-bold`};function mt(e,t,r,a,o,s){let u=d(`info-icon`),p=d(`el-input`);return l(),f(`div`,dt,[n(`div`,ft,[n(`span`,pt,c(e.$t(`producer.name.title`)),1),i(u,{content:e.$t(`producer.description.title`)},null,8,[`content`])]),i(p,{modelValue:e.title,"onUpdate:modelValue":t[0]||=t=>e.title=t,placeholder:e.$t(`producer.placeholder.title`)},null,8,[`modelValue`,`placeholder`])])}var ht=V(ut,[[`render`,mt]]),gt=o({name:`ExtendFromInput`,components:{ElImage:A,ElIcon:S,ElInputNumber:L,VideoPlay:b,VideoPause:x},data(){return{}},computed:{audio(){return this.$store.state.producer?.config?.audio},value:{get(){return this.$store.state.producer?.config?.continue_at},set(e){console.debug(`set continue_at`,e),this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,continue_at:e?parseInt(e):void 0})}}},mounted(){this.value||=void 0},methods:{handleChange(e){if(e===void 0){this.value=void 0;return}e<0?this.value=0:e>this.audio?.duration?this.value=this.audio?.duration:this.value=e},useFormatDuring:Q,onPlay(e){this.$store.dispatch(`producer/setAudio`,{...this.$store.state.producer.audio,...e,state:`playing`}),console.log(`on play`)},onPause(e){this.$store.dispatch(`producer/setAudio`,{...this.$store.state.producer.audio,...e,state:`paused`}),console.log(`on pause`)},onClick(e){this.$store.state?.producer?.audio?.id!==e.id&&this.onPlay({...e,progress:0})}}}),_t={class:`field`},vt={class:`box`},yt={class:`title font-bold`},bt={class:`input-wrapper`},xt={class:`task`},St={class:`left`},Ct={key:2,class:`duration`},wt={class:`info`},Tt={class:`title`},Et={class:`style`};function Dt(e,t,r,o,s,u){let g=d(`el-input-number`),_=d(`el-image`),v=d(`video-pause`),y=d(`el-icon`),b=d(`video-play`),x=m(`loading`);return l(),f(`div`,_t,[n(`div`,vt,[n(`h2`,yt,c(e.$t(`producer.name.extend`)),1),n(`div`,bt,[i(g,{modelValue:e.value,"onUpdate:modelValue":t[0]||=t=>e.value=t,class:`value`,min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t(`producer.placeholder.extend.continue_at`),onChange:e.handleChange},null,8,[`modelValue`,`max`,`placeholder`,`onChange`])])]),n(`div`,xt,[e.audio?(l(),f(`div`,{key:0,class:`audio`,onClick:t[3]||=t=>e.onClick(e.audio)},[h((l(),f(`div`,St,[i(_,{src:e.audio?.image_url,class:`cover`,fit:`cover`},null,8,[`src`]),e.audio?.audio_url&&e.$store.state?.producer?.audio?.id===e.audio.id&&e.$store.state?.producer?.audio?.state===`playing`?(l(),f(`div`,{key:0,class:`overlay`,onClick:t[1]||=t=>e.onPause(e.audio)},[i(y,null,{default:p(()=>[i(v)]),_:1})])):a(``,!0),e.audio?.audio_url&&(e.$store.state?.producer?.audio?.id!==e.audio.id||e.$store.state?.producer?.audio?.id===e.audio.id&&e.$store.state?.producer?.audio?.state===`paused`)?(l(),f(`div`,{key:1,class:`overlay`,onClick:t[2]||=t=>e.onPlay(e.audio)},[i(y,null,{default:p(()=>[i(b)]),_:1})])):a(``,!0),e.audio?.duration?(l(),f(`div`,Ct,c(e.useFormatDuring(e.audio?.duration)),1)):a(``,!0)])),[[x,!e.audio?.audio_url]]),n(`div`,wt,[n(`h2`,Tt,c(e.audio?.title),1),n(`p`,Et,c(e.audio?.style),1)])])):a(``,!0)])])}var Ot=V(gt,[[`render`,Dt],[`__scopeId`,`data-v-26d43480`]]),kt=o({name:`CoverFromInput`,components:{ElImage:A,ElIcon:S,VideoPlay:b,VideoPause:x},data(){return{}},computed:{audio(){return this.$store.state.producer?.config?.audio},value:{get(){return this.$store.state.producer?.config?.continue_at},set(e){console.debug(`set continue_at`,e),this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,continue_at:e?parseInt(e):void 0})}}},mounted(){this.value||=void 0},methods:{handleChange(e){e<0?this.value=0:e>this.audio?.duration?this.value=this.audio?.duration:this.value=e},useFormatDuring:Q,onPlay(e){this.$store.dispatch(`producer/setAudio`,{...this.$store.state.producer.audio,...e,state:`playing`}),console.log(`on play`)},onPause(e){this.$store.dispatch(`producer/setAudio`,{...this.$store.state.producer.audio,...e,state:`paused`}),console.log(`on pause`)},onClick(e){this.$store.state?.producer?.audio?.id!==e.id&&this.onPlay({...e,progress:0})}}}),At={class:`field`},jt={class:`box`},Mt={class:`title font-bold`},Nt={class:`task`},Pt={class:`left`},Ft={key:2,class:`duration`},It={class:`info`},Lt={class:`title`},Rt={class:`style`};function zt(e,t,r,o,s,u){let g=d(`el-image`),_=d(`video-pause`),v=d(`el-icon`),y=d(`video-play`),b=m(`loading`);return l(),f(`div`,At,[n(`div`,jt,[n(`h2`,Mt,c(e.$t(`producer.name.cover`)),1)]),n(`div`,Nt,[e.audio?(l(),f(`div`,{key:0,class:`audio`,onClick:t[2]||=t=>e.onClick(e.audio)},[h((l(),f(`div`,Pt,[i(g,{src:e.audio?.image_url,class:`cover`,fit:`cover`},null,8,[`src`]),e.audio?.audio_url&&e.$store.state?.producer?.audio?.id===e.audio.id&&e.$store.state?.producer?.audio?.state===`playing`?(l(),f(`div`,{key:0,class:`overlay`,onClick:t[0]||=t=>e.onPause(e.audio)},[i(v,null,{default:p(()=>[i(_)]),_:1})])):a(``,!0),e.audio?.audio_url&&(e.$store.state?.producer?.audio?.id!==e.audio.id||e.$store.state?.producer?.audio?.id===e.audio.id&&e.$store.state?.producer?.audio?.state===`paused`)?(l(),f(`div`,{key:1,class:`overlay`,onClick:t[1]||=t=>e.onPlay(e.audio)},[i(v,null,{default:p(()=>[i(y)]),_:1})])):a(``,!0),e.audio?.duration?(l(),f(`div`,Ft,c(e.useFormatDuring(e.audio?.duration)),1)):a(``,!0)])),[[b,!e.audio?.audio_url]]),n(`div`,It,[n(`h2`,Lt,c(e.audio?.title),1),n(`p`,Rt,c(e.audio?.style),1)])])):a(``,!0)])])}var Bt=V(kt,[[`render`,zt],[`__scopeId`,`data-v-d8a8e583`]]),Vt=o({name:`VocalGenderSelector`,components:{ElRadioGroup:N,ElRadioButton:M,InfoIcon:Z},computed:{vocalGender:{get(){return this.$store.state.producer?.config?.vocal_gender||``},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,vocal_gender:e||void 0})}}}}),Ht={class:`mb-2`},Ut={class:`flex items-center mb-1`},Wt={class:`text-sm font-bold`};function Gt(e,t,a,o,s,u){let m=d(`info-icon`),h=d(`el-radio-button`),g=d(`el-radio-group`);return l(),f(`div`,Ht,[n(`div`,Ut,[n(`span`,Wt,c(e.$t(`producer.name.vocalGender`)),1),i(m,{content:e.$t(`producer.description.vocalGender`)},null,8,[`content`])]),i(g,{modelValue:e.vocalGender,"onUpdate:modelValue":t[0]||=t=>e.vocalGender=t},{default:p(()=>[i(h,{value:``},{default:p(()=>[r(c(e.$t(`producer.gender.auto`)),1)]),_:1}),i(h,{value:`f`},{default:p(()=>[r(c(e.$t(`producer.gender.female`)),1)]),_:1}),i(h,{value:`m`},{default:p(()=>[r(c(e.$t(`producer.gender.male`)),1)]),_:1})]),_:1},8,[`modelValue`])])}var Kt=V(Vt,[[`render`,Gt]]),qt=o({name:`AdvancedParams`,components:{ElCollapse:P,ElCollapseItem:ee,ElInput:U,ElSlider:ae,ElInputNumber:L,InfoIcon:Z},data(){return{activeNames:[]}},computed:{config(){return this.$store.state.producer?.config},styleNegative:{get(){return this.$store.state.producer?.config?.style_negative||``},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,style_negative:e||void 0})}},lyricPrompt:{get(){return this.$store.state.producer?.config?.lyric_prompt||``},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,lyric_prompt:e||void 0})}},weirdness:{get(){return this.$store.state.producer?.config?.weirdness??.5},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,weirdness:e})}},soundStrength:{get(){return this.$store.state.producer?.config?.sound_strength??.7},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,sound_strength:e})}},lyricsStrength:{get(){return this.$store.state.producer?.config?.lyrics_strength??.7},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,lyrics_strength:e})}},seed:{get(){return this.$store.state.producer?.config?.seed},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,seed:e})}}},mounted(){let e=this.$store.state.producer?.config;if(!e)return;let t={};typeof e.weirdness==`number`&&e.weirdness>1&&(t.weirdness=e.weirdness/100),typeof e.sound_strength==`number`&&e.sound_strength>1&&(t.sound_strength=e.sound_strength/100),typeof e.lyrics_strength==`number`&&e.lyrics_strength>1&&(t.lyrics_strength=e.lyrics_strength/100),Object.keys(t).length>0&&this.$store.commit(`producer/setConfig`,{...e,...t})}}),Jt={key:0,class:`mb-3`},Yt={class:`flex items-center mb-1`},Xt={class:`text-xs font-bold`},Zt={key:1,class:`mb-3`},Qt={class:`flex items-center mb-1`},$t={class:`text-xs font-bold`},en={class:`mb-3`},tn={class:`flex items-center justify-between mb-1`},nn={class:`flex items-center`},rn={class:`text-xs font-bold`},an={class:`text-xs text-[var(--el-text-color-secondary)]`},on={class:`mb-3`},sn={class:`flex items-center justify-between mb-1`},cn={class:`flex items-center`},ln={class:`text-xs font-bold`},un={class:`text-xs text-[var(--el-text-color-secondary)]`},dn={key:2,class:`mb-3`},fn={class:`flex items-center justify-between mb-1`},pn={class:`flex items-center`},mn={class:`text-xs font-bold`},hn={class:`text-xs text-[var(--el-text-color-secondary)]`},gn={class:`mb-3`},_n={class:`flex items-center mb-1`},vn={class:`text-xs font-bold`};function yn(e,r,o,s,u,m){let h=d(`info-icon`),g=d(`el-input`),_=d(`el-slider`),v=d(`el-input-number`),y=d(`el-collapse-item`),b=d(`el-collapse`);return l(),t(b,{modelValue:e.activeNames,"onUpdate:modelValue":r[6]||=t=>e.activeNames=t,class:`advanced-collapse`},{default:p(()=>[i(y,{title:e.$t(`producer.name.advancedParams`),name:`advanced`},{default:p(()=>[e.config?.custom?(l(),f(`div`,Jt,[n(`div`,Yt,[n(`span`,Xt,c(e.$t(`producer.name.styleNegative`)),1),i(h,{content:e.$t(`producer.description.styleNegative`)},null,8,[`content`])]),i(g,{modelValue:e.styleNegative,"onUpdate:modelValue":r[0]||=t=>e.styleNegative=t,size:`small`,placeholder:e.$t(`producer.placeholder.styleNegative`)},null,8,[`modelValue`,`placeholder`])])):a(``,!0),e.config?.custom&&!e.config?.instrumental?(l(),f(`div`,Zt,[n(`div`,Qt,[n(`span`,$t,c(e.$t(`producer.name.lyricPrompt`)),1),i(h,{content:e.$t(`producer.description.lyricPrompt`)},null,8,[`content`])]),i(g,{modelValue:e.lyricPrompt,"onUpdate:modelValue":r[1]||=t=>e.lyricPrompt=t,size:`small`,placeholder:e.$t(`producer.placeholder.lyricPrompt`)},null,8,[`modelValue`,`placeholder`])])):a(``,!0),n(`div`,en,[n(`div`,tn,[n(`div`,nn,[n(`span`,rn,c(e.$t(`producer.name.weirdness`)),1),i(h,{content:e.$t(`producer.description.weirdness`)},null,8,[`content`])]),n(`span`,an,c(e.weirdness??.5),1)]),i(_,{modelValue:e.weirdness,"onUpdate:modelValue":r[2]||=t=>e.weirdness=t,min:0,max:1,step:.01},null,8,[`modelValue`])]),n(`div`,on,[n(`div`,sn,[n(`div`,cn,[n(`span`,ln,c(e.$t(`producer.name.soundStrength`)),1),i(h,{content:e.$t(`producer.description.soundStrength`)},null,8,[`content`])]),n(`span`,un,c(e.soundStrength??.7),1)]),i(_,{modelValue:e.soundStrength,"onUpdate:modelValue":r[3]||=t=>e.soundStrength=t,min:.2,max:1,step:.01},null,8,[`modelValue`])]),e.config?.custom&&!e.config?.instrumental?(l(),f(`div`,dn,[n(`div`,fn,[n(`div`,pn,[n(`span`,mn,c(e.$t(`producer.name.lyricsStrength`)),1),i(h,{content:e.$t(`producer.description.lyricsStrength`)},null,8,[`content`])]),n(`span`,hn,c(e.lyricsStrength??.7),1)]),i(_,{modelValue:e.lyricsStrength,"onUpdate:modelValue":r[4]||=t=>e.lyricsStrength=t,min:0,max:1,step:.01},null,8,[`modelValue`])])):a(``,!0),n(`div`,gn,[n(`div`,_n,[n(`span`,vn,c(e.$t(`producer.name.seed`)),1),i(h,{content:e.$t(`producer.description.seed`)},null,8,[`content`])]),i(v,{modelValue:e.seed,"onUpdate:modelValue":r[5]||=t=>e.seed=t,min:0,controls:!1,size:`small`,placeholder:e.$t(`producer.placeholder.seed`),class:`w-full`},null,8,[`modelValue`,`placeholder`])])]),_:1},8,[`title`])]),_:1},8,[`modelValue`])}var bn=V(qt,[[`render`,yn],[`__scopeId`,`data-v-f9296888`]]),xn=o({name:`ReplaceSectionInput`,components:{ElInputNumber:L,ElImage:A,InfoIcon:Z},computed:{audio(){return this.$store.state.producer?.config?.audio},replaceSectionStart:{get(){return this.$store.state.producer?.config?.replace_section_start},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,replace_section_start:e})}},replaceSectionEnd:{get(){return this.$store.state.producer?.config?.replace_section_end},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,replace_section_end:e})}}},methods:{onClick(e){this.$store.dispatch(`producer/setAudio`,{...this.$store.state.producer.audio,...e,state:`playing`})}}}),Sn={class:`field`},Cn={class:`flex items-center mb-2`},wn={class:`text-sm font-bold m-0`},Tn={key:0,class:`task mb-2`},En={class:`left relative w-[50px] h-[50px] mr-3 flex-shrink-0`},Dn={class:`info flex-1 min-w-0`},On={class:`text-sm font-bold m-0 truncate`},kn={class:`text-xs text-[var(--el-text-color-secondary)] m-0 truncate`},An={class:`flex gap-2`};function jn(e,t,r,o,s,u){let p=d(`info-icon`),g=d(`el-image`),_=d(`el-input-number`),v=m(`loading`);return l(),f(`div`,Sn,[n(`div`,Cn,[n(`h2`,wn,c(e.$t(`producer.name.replaceSection`)),1),i(p,{content:e.$t(`producer.description.replaceSection`)},null,8,[`content`])]),e.audio?(l(),f(`div`,Tn,[n(`div`,{class:`audio flex items-center`,onClick:t[0]||=t=>e.onClick(e.audio)},[h((l(),f(`div`,En,[i(g,{src:e.audio?.image_url,class:`w-full h-full rounded`,fit:`cover`},null,8,[`src`])])),[[v,!e.audio?.audio_url]]),n(`div`,Dn,[n(`h2`,On,c(e.audio?.title),1),n(`p`,kn,c(e.audio?.style),1)])])])):a(``,!0),n(`div`,An,[i(_,{modelValue:e.replaceSectionStart,"onUpdate:modelValue":t[1]||=t=>e.replaceSectionStart=t,class:`flex-1`,min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t(`producer.placeholder.replaceSectionStart`)},null,8,[`modelValue`,`max`,`placeholder`]),i(_,{modelValue:e.replaceSectionEnd,"onUpdate:modelValue":t[2]||=t=>e.replaceSectionEnd=t,class:`flex-1`,min:e.replaceSectionStart||0,max:e.audio?.duration,controls:!1,placeholder:e.$t(`producer.placeholder.replaceSectionEnd`)},null,8,[`modelValue`,`min`,`max`,`placeholder`])])])}var Mn=o({name:`PresetPanel`,components:{TypeSelector:Ie,PromptInput:Ye,LyricInput:nt,StyleInput:lt,TitleInput:ht,ExtendFromInput:Ot,CoverFromInput:Bt,UploadAudio:Ke,VocalGenderSelector:Kt,AdvancedParams:bn,ReplaceSectionInput:V(xn,[[`render`,jn]]),FontAwesomeIcon:X,ElButton:v,ElTabs:E,ElTabPane:D,Consumption:he},emits:[`generate`],computed:{config(){return this.$store.state.producer?.config},mode:{get(){return this.$store.state.producer?.config?.custom?`custom`:`simple`},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,custom:e===`custom`})}},consumption(){return W(this.config,this.service?.cost)},service(){return this.$store.state.producer?.service},generateButtonText(){let e=this.config?.action;return e===`extend`||e===`upload_extend`?this.$t(`producer.button.extend`):e===`cover`||e===`upload_cover`?this.$t(`producer.button.cover_music`):e===`variation`?this.$t(`producer.button.variation`):e===`replace_section`?this.$t(`producer.button.replace_section`):e===`stems`?this.$t(`producer.button.get_stems`):e===`swap_vocals`?this.$t(`producer.button.swap_vocals`):e===`swap_instrumentals`?this.$t(`producer.button.swap_instrumentals`):this.$t(`producer.button.generate`)}},methods:{onGenerate(){this.$emit(`generate`)},onClearAll(){this.$store.commit(`producer/setConfig`,{custom:this.$store.state.producer?.config?.custom||!1,instrumental:!1,prompt:``,lyric:``,style:``,title:``,model:this.$store.state.producer?.config?.model})}}}),Nn={class:`flex flex-col h-full`},Pn={class:`flex-1 overflow-y-auto p-5`},Fn={class:`pt-2 px-1`},In={class:`pt-2 px-1`},Ln={class:`flex flex-col items-center justify-center px-5 pb-5 gap-2`},Rn={class:`flex gap-2 w-full`};function zn(e,o,s,u,m,h){let g=d(`type-selector`),_=d(`upload-audio`),v=d(`prompt-input`),y=d(`extend-from-input`),b=d(`cover-from-input`),x=d(`replace-section-input`),S=d(`advanced-params`),C=d(`el-tab-pane`),w=d(`lyric-input`),T=d(`style-input`),E=d(`title-input`),D=d(`vocal-gender-selector`),O=d(`el-tabs`),k=d(`consumption`),A=d(`font-awesome-icon`),j=d(`el-button`);return l(),f(`div`,Nn,[n(`div`,Pn,[i(O,{modelValue:e.mode,"onUpdate:modelValue":o[0]||=t=>e.mode=t,class:`producer-mode-tabs`,stretch:``},{default:p(()=>[i(C,{label:e.$t(`producer.mode.simple`),name:`simple`},{default:p(()=>[n(`div`,Fn,[i(g,{class:`mb-4`}),i(_,{class:`mb-4`}),i(v,{class:`mb-4`}),e.config?.action===`extend`?(l(),t(y,{key:0,class:`mb-4`})):a(``,!0),e.config?.action===`cover`?(l(),t(b,{key:1,class:`mb-4`})):a(``,!0),e.config?.action===`replace_section`?(l(),t(x,{key:2,class:`mb-4`})):a(``,!0),i(S,{class:`mb-4`})])]),_:1},8,[`label`]),i(C,{label:e.$t(`producer.mode.custom`),name:`custom`},{default:p(()=>[n(`div`,In,[i(g,{class:`mb-4`}),i(_,{class:`mb-4`}),e.config?.instrumental?a(``,!0):(l(),t(w,{key:0,class:`mb-4`})),i(T,{class:`mb-4`}),i(E,{class:`mb-4`}),e.config?.instrumental?a(``,!0):(l(),t(D,{key:1,class:`mb-4`})),e.config?.action===`extend`?(l(),t(y,{key:2,class:`mb-4`})):a(``,!0),e.config?.action===`cover`?(l(),t(b,{key:3,class:`mb-4`})):a(``,!0),e.config?.action===`replace_section`?(l(),t(x,{key:4,class:`mb-4`})):a(``,!0),i(S,{class:`mb-4`})])]),_:1},8,[`label`])]),_:1},8,[`modelValue`])]),n(`div`,Ln,[i(k,{value:e.consumption,service:e.service},null,8,[`value`,`service`]),n(`div`,Rn,[i(j,{class:`flex-1`,onClick:e.onClearAll},{default:p(()=>[i(A,{icon:`fa-solid fa-broom`,class:`mr-1`}),r(` `+c(e.$t(`producer.button.clear_all`)),1)]),_:1},8,[`onClick`]),i(j,{type:`primary`,class:`flex-1`,round:``,onClick:e.onGenerate},{default:p(()=>[i(A,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+c(e.generateButtonText),1)]),_:1},8,[`onClick`])])])])}var Bn=V(Mn,[[`render`,zn],[`__scopeId`,`data-v-4a4b209e`]]),Vn=ge(),Hn=R(`producer`),Un=o({name:`TaskPreview`,components:{ElImage:A,ElIcon:S,ElTooltip:k,FontAwesomeIcon:X,VideoPlay:b,VideoPause:x,ElDropdown:ne,ElDropdownMenu:te,ElDropdownItem:I,Loading:y,ApiCodeDialog:de},props:{modelValue:{type:Object,required:!0}},data(){return{isFetchingVideoUrl:!1,isFetchingWav:!1,apiCodeVisible:!1,apiCodePath:`/producer/audios`,apiCodeBody:{}}},computed:{loading(){return this.$store.state.producer?.status?.getApplications===Y.Request},credential(){return this.$store.state.producer.credential},config(){return this.$store.state.producer.config},task(){return this.$store.state.producer?.tasks},audios(){let e=this.modelValue?.response?.data??[],t=this.modelValue?.request?.action;return t?e.map(e=>({...e,action:t})):e},application(){return this.$store.state.producer?.application},active(){return this.$store.state.producer?.tasks?.active}},methods:{useFormatDuring:Q,onViewCode(){let e=this.modelValue?.request||{},t={};Object.entries(e).forEach(([e,n])=>{e===`application_id`||e===`callback_url`||n!=null&&(typeof n==`string`&&n===``||Array.isArray(n)&&n.length===0||(t[e]=n))}),this.apiCodeBody=t,this.apiCodePath=`/producer/audios`,this.apiCodeVisible=!0},onPlay(e){this.$store.dispatch(`producer/setAudio`,{...this.$store.state.producer.audio,...e,state:`playing`}),console.log(`on play`)},onPause(e){this.$store.dispatch(`producer/setAudio`,{...this.$store.state.producer.audio,...e,state:`paused`}),console.log(`on pause`)},onClick(e){this.$store.state?.producer?.audio?.id!==e.id&&this.onPlay({...e,progress:0})},onExtend(e,t){e?.stopPropagation(),console.debug(`set config`,t),this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,model:t.model,custom:!0,instrumental:!1,style:t.style,action:`extend`,audio:t,audio_id:t.id,continue_at:t.duration})},onDownload(e,t){e&&e?.stopPropagation();let n=new URL(t).pathname,r=n.substring(n.lastIndexOf(`/`)+1);fetch(t).then(e=>e.blob()).then(e=>{(0,Vn.saveAs)(e,r)})},async handleVideoDownload(e){if(e.video_url){this.onDownload(null,e.video_url);return}if(!this.isFetchingVideoUrl)try{this.isFetchingVideoUrl=!0;let t=await this.fetchVideoUrlFromApi(e?.id);console.log(`get videoUrl: ${t}`),e.video_url=t,this.onDownload(null,t)}catch(e){console.error(`get videoUrl failed:`,e),q.error(this.$t(`producer.message.getVideoUrlFailed`))}finally{this.isFetchingVideoUrl=!1}},async fetchVideoUrlFromApi(e){return new Promise((t,n)=>{let r={audio_id:e},i=this.credential?.token;if(!i){console.error(`no token specified`),n(Error(`No token specified`));return}J.video(r,{token:i}).then(e=>{let r=e.data?.data?.video_url;r?t(r):n(Error(`Video URL not found in response`))}).catch(e=>{n(e)})})},onPreview(e,t){e?.stopPropagation(),window.open(t,`_blank`)},async onGetStems(e){await this.onGenerateAudioUrl(`stems`,e)},onCover(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,model:e.model,custom:!0,instrumental:!1,style:e.style,action:`cover`,audio:e,audio_id:e.id})},onVariation(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,model:e.model,custom:!0,style:e.style,action:`variation`,audio:e,audio_id:e.id})},async onSwapVocals(e){await this.onGenerateAudioUrl(`swap_vocals`,e)},async onSwapInstrumentals(e){await this.onGenerateAudioUrl(`swap_instrumentals`,e)},async onGetAllStems(e){await this.onGenerateAudioUrl(`all_stems`,e)},onReplaceSection(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,model:e.model,custom:!0,instrumental:!1,style:e.style,action:`replace_section`,audio:e,audio_id:e.id,replace_section_start:0,replace_section_end:Math.min(30,e.duration||30)})},async handleWavDownload(e){if(!e?.id||this.isFetchingWav)return;let t=this.credential?.token;if(t)try{this.isFetchingWav=!0,q.info(this.$t(`producer.message.fetchingWav`));let n=(await J.wav({audio_id:e.id},{token:t})).data?.data,r=Array.isArray(n)?n[0]?.file_url:n?.file_url||n?.audio_url;r?this.onDownload(null,r):q.error(this.$t(`producer.message.fetchWavFailed`))}catch{q.error(this.$t(`producer.message.fetchWavFailed`))}finally{this.isFetchingWav=!1}},async onGenerateAudioUrl(e,t){let n={action:e,audio_id:t,callback_url:Hn},r=this.credential?.token;if(!r){console.error(`no token specified`);return}q.info(this.$t(`producer.message.startingTask`)),J.audio(n,{token:r}).then(()=>{q.success(this.$t(`producer.message.startTaskSuccess`))}).catch(e=>{q.error(e?.response?.data?.error?.message||this.$t(`producer.message.startTaskFailed`))}).finally(async()=>{await this.onGetTasks(),await this.onScrollDown()})},async onScrollDown(){setTimeout(()=>{let e=document.querySelector(`.tasks`);e&&(e.scrollTop=e.scrollHeight)},1e3)},async onGetTasks(){if(this.loading){console.debug(`loading`);return}await this.$store.dispatch(`producer/getTasks`,{limit:30,offset:0})}}}),Wn={class:`task`},Gn=[`onClick`],Kn={class:`left`},qn=[`onClick`],Jn=[`onClick`],Yn={key:2,class:`duration`},Xn={class:`info`},Zn={class:`title`},Qn={class:`style`},$n={class:`right`},er={class:`el-dropdown-link`},tr={class:`flex items-center min-w-[120px]`},nr={class:`flex items-center min-w-[120px]`},rr={class:`el-dropdown-link`};function ir(e,o,u,v,y,b){let x=d(`el-image`),S=d(`video-pause`),C=d(`el-icon`),w=d(`video-play`),T=d(`font-awesome-icon`),E=d(`el-tooltip`),D=d(`Loading`),O=d(`el-dropdown-item`),k=d(`el-dropdown-menu`),A=d(`el-dropdown`),j=d(`api-code-dialog`),M=m(`loading`);return l(),f(`div`,Wn,[(l(!0),f(g,null,s(e.audios,o=>(l(),f(`div`,{key:o.id,class:`audio`,onClick:_(t=>e.onClick(o),[`stop`])},[h((l(),f(`div`,Kn,[i(x,{src:o?.image_url,class:`cover`,fit:`cover`,lazy:``},null,8,[`src`]),o?.audio_url&&e.$store.state?.producer?.audio?.id===o.id&&e.$store.state?.producer?.audio?.state===`playing`?(l(),f(`div`,{key:0,class:`overlay`,onClick:_(t=>e.onPause(o),[`stop`])},[i(C,null,{default:p(()=>[i(S)]),_:1})],8,qn)):a(``,!0),o?.audio_url&&(e.$store.state?.producer?.audio?.id!==o.id||e.$store.state?.producer?.audio?.id===o.id&&e.$store.state?.producer?.audio?.state===`paused`)?(l(),f(`div`,{key:1,class:`overlay`,onClick:_(t=>e.onPlay(o),[`stop`])},[i(C,null,{default:p(()=>[i(w)]),_:1})],8,Jn)):a(``,!0),o?.duration?(l(),f(`div`,Yn,c(e.useFormatDuring(o?.duration)),1)):a(``,!0)])),[[M,!o?.audio_url]]),n(`div`,Xn,[n(`h2`,Zn,c(o?.title),1),n(`p`,Qn,c(o?.style),1)]),n(`div`,$n,[i(A,null,{dropdown:p(()=>[i(k,null,{default:p(()=>[i(O,{disabled:e.isFetchingVideoUrl,onClick:t=>e.handleVideoDownload(o)},{default:p(()=>[n(`div`,tr,[e.isFetchingVideoUrl?(l(),t(C,{key:0,class:`is-loading mr-2`},{default:p(()=>[i(D)]),_:1})):a(``,!0),n(`span`,null,c(e.$t(`producer.button.download_video`)),1)])]),_:1},8,[`disabled`,`onClick`]),o?.audio_url?(l(),t(O,{key:0,onClick:_(t=>e.onDownload(t,o?.audio_url),[`stop`])},{default:p(()=>[r(c(e.$t(`producer.button.download_audio`)),1)]),_:1},8,[`onClick`])):a(``,!0),i(O,{disabled:e.isFetchingWav,onClick:t=>e.handleWavDownload(o)},{default:p(()=>[n(`div`,nr,[e.isFetchingWav?(l(),t(C,{key:0,class:`is-loading mr-2`},{default:p(()=>[i(D)]),_:1})):a(``,!0),n(`span`,null,c(e.$t(`producer.button.download_wav`)),1)])]),_:1},8,[`disabled`,`onClick`])]),_:2},1024)]),default:p(()=>[n(`span`,er,[i(E,{effect:`dark`,content:e.$t(`producer.button.download`),placement:`top`},{default:p(()=>[o?.audio_url||o?.video_url?(l(),t(T,{key:0,icon:`fa-solid fa-download`,class:`icon icon-download`})):a(``,!0)]),_:2},1032,[`content`])])]),_:2},1024),i(A,null,{dropdown:p(()=>[i(k,null,{default:p(()=>[o?.audio_url?(l(),t(O,{key:0,onClick:_(t=>e.onExtend(t,o),[`stop`])},{default:p(()=>[r(c(e.$t(`producer.button.extend`)),1)]),_:1},8,[`onClick`])):a(``,!0),o.id?(l(),t(O,{key:1,onClick:_(t=>e.onGetStems(o.id),[`stop`])},{default:p(()=>[r(c(e.$t(`producer.button.get_stems`)),1)]),_:1},8,[`onClick`])):a(``,!0),o.id?(l(),t(O,{key:2,onClick:_(t=>e.onGetAllStems(o.id),[`stop`])},{default:p(()=>[r(c(e.$t(`producer.button.all_stems`)),1)]),_:1},8,[`onClick`])):a(``,!0),i(O,{onClick:_(t=>e.onCover(o),[`stop`])},{default:p(()=>[r(c(e.$t(`producer.button.cover_music`)),1)]),_:1},8,[`onClick`]),o?.id?(l(),t(O,{key:3,onClick:_(t=>e.onVariation(o),[`stop`])},{default:p(()=>[r(c(e.$t(`producer.button.variation`)),1)]),_:1},8,[`onClick`])):a(``,!0),o?.id?(l(),t(O,{key:4,onClick:_(t=>e.onSwapVocals(o.id),[`stop`])},{default:p(()=>[r(c(e.$t(`producer.button.swap_vocals`)),1)]),_:1},8,[`onClick`])):a(``,!0),o?.id?(l(),t(O,{key:5,onClick:_(t=>e.onSwapInstrumentals(o.id),[`stop`])},{default:p(()=>[r(c(e.$t(`producer.button.swap_instrumentals`)),1)]),_:1},8,[`onClick`])):a(``,!0),o?.id?(l(),t(O,{key:6,onClick:_(t=>e.onReplaceSection(o),[`stop`])},{default:p(()=>[r(c(e.$t(`producer.button.replace_section`)),1)]),_:1},8,[`onClick`])):a(``,!0),i(O,{onClick:_(e.onViewCode,[`stop`])},{default:p(()=>[i(T,{icon:`fa-solid fa-code`,class:`mr-1`}),r(` `+c(e.$t(`common.button.viewCode`)),1)]),_:1},8,[`onClick`])]),_:2},1024)]),default:p(()=>[n(`span`,rr,[i(E,{effect:`dark`,content:e.$t(`producer.button.more`),placement:`top`},{default:p(()=>[o?.audio_url||o?.video_url?(l(),t(T,{key:0,icon:`fa-solid fa-ellipsis`,class:`icon icon-ellipsis`})):a(``,!0)]),_:2},1032,[`content`])])]),_:2},1024)])],8,Gn))),128)),i(j,{visible:e.apiCodeVisible,"onUpdate:visible":o[0]||=t=>e.apiCodeVisible=t,method:`POST`,path:e.apiCodePath,body:e.apiCodeBody,token:e.$store.state.producer?.credential?.token||``},null,8,[`visible`,`path`,`body`,`token`])])}var ar=o({name:`RecentPanel`,components:{ElSkeletonItem:re,ElSkeleton:ie,TaskPreview:V(Un,[[`render`,ir]]),Player:_e,NoTasks:me,ScrollList:ue},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.producer?.tasks,items:this.$store.state.producer?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),or={key:0,class:`tasks`},sr={class:`left w-[70px] p-[10px] flex items-center`},$={class:`main w-[calc(100%-70px)] flex-1 p-[10px]`},cr={key:2,class:`w-full flex-1 flex items-center justify-center`},lr={class:`h-20`};function ur(e,r,o,c,m,_){let v=d(`el-skeleton-item`),y=d(`el-skeleton`),b=d(`task-preview`),x=d(`scroll-list`),S=d(`no-tasks`),C=d(`player`);return l(),f(g,null,[e.tasks?.items===void 0?(l(),f(`div`,or,[(l(),f(g,null,s(3,e=>n(`div`,{key:e,class:`flex`},[n(`div`,sr,[i(y,{animated:``},{template:p(()=>[i(v,{variant:`image`,class:`avatar w-[50px] h-[50px]`})]),_:1})]),n(`div`,$,[i(y,{animated:``},{template:p(()=>[i(v,{variant:`p`,class:`w-[200px] h-[15px] mb-[5px] mt-[10px]`}),i(v,{variant:`text`})]),_:1})])])),64))])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(l(),t(x,{key:1,ref:`scrollList`,class:`flex-1 w-full overflow-y-auto tasks p-2`,loading:e.loading,onReachTop:r[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(l(!0),f(g,null,s(e.tasks?.items,(e,n)=>(l(),t(b,{key:n,"model-value":e,class:`preview`},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):a(``,!0),e.tasks?.items?.length===0?(l(),f(`div`,cr,[i(S)])):a(``,!0),h(n(`div`,lr,[i(C,{namespace:`producer`})],512),[[u,!!e.$store?.state?.producer?.audio?.object]])],64)}var dr=V(ar,[[`render`,ur]]),fr=o({name:`TaskPreview`,components:{IconPicture:C,ElImage:A,ElAvatar:j,ElIcon:S},computed:{audio(){return this.$store.state.producer?.audio}}}),pr={key:0,class:`size-full overflow-hidden`},mr={class:`relative h-[300px]`},hr={class:`flex items-center justify-center size-full bg-[var(--el-bg-color)]`},gr={class:`absolute bottom-0 left-0 right-0 m-0 p-4 text-white z-10 bg-gradient-to-t from-black/70 to-transparent`},_r={class:`p-4`},vr={class:`flex items-center font-bold mb-2`},yr={class:`text-[var(--el-text-color-regular)] mb-2`},br={class:`text-xs text-[var(--el-text-color-regular)]`},xr={class:`mt-4 text-sm leading-[25px] whitespace-pre-wrap`},Sr={key:1,class:`w-full h-full`};function Cr(e,t,r,a,o,s){let u=d(`icon-picture`),m=d(`el-icon`),h=d(`el-image`),g=d(`el-avatar`);return e.audio?.object?(l(),f(`div`,pr,[n(`div`,mr,[i(h,{src:e.audio.image_url,fit:`cover`,class:`size-full`},{error:p(()=>[n(`div`,hr,[i(m,{class:`text-3xl`},{default:p(()=>[i(u)]),_:1})])]),_:1},8,[`src`]),n(`h2`,gr,c(e.audio?.title),1)]),n(`div`,_r,[n(`div`,vr,[i(g,{size:30,src:e.audio?.image_url,class:`mr-2`},null,8,[`src`]),n(`span`,null,c(e.audio?.title),1)]),n(`p`,yr,c(e.audio?.style),1),n(`p`,br,c(e.$dayjs.format(e.audio?.created_at)),1),n(`div`,xr,[n(`p`,null,c(e.audio?.lyric),1)])])])):(l(),f(`div`,Sr))}var wr=V(fr,[[`render`,Cr]]),Tr=R(`producer`),Er=o({name:`ProducerIndex`,components:{Layout:we,ConfigPanel:Bn,RecentPanel:dr,PreviewPanel:wr},mixins:[B],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.producer?.status?.getApplications===Y.Request},tasksLoading(){return this.$store.state.producer?.status?.getTasks===Y.Request||this.fetchingTasks},service(){return this.$store.state.producer.service},credential(){return this.$store.state.producer.credential},config(){return this.$store.state.producer.config},initializing(){return this.$store.state.producer.status.getApplications===Y.Request},needApply(){return this.$store.state.producer.status.getApplications===Y.Success&&!this.application},application(){return this.$store.state.producer.application},tasks(){return this.$store.state.producer.tasks},applications(){return this.$store.state.producer.applications}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await fe({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`producer/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplications`),await this.$store.dispatch(`producer/getApplications`),console.debug(`end onGetApplications`),await this.onGetTasks()},onApply(){z.create({application:this.application}).then(({data:e})=>{this.application=e,q.success(this.$t(`application.message.applySuccessfully`))}).catch(e=>{e?.response?.data?.code===`duplication`&&q.error(this.$t(`application.message.alreadyApplied`))})},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`producer/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerateAudio(){if(!G(this.uploadTracker,e=>this.$t(e),e=>q.warning(e)))return;let e={...this.config,callback_url:Tr},t=this.credential?.token;if(!t){console.error(`no token specified`);return}q.info(this.$t(`producer.message.startingTask`)),H(`producer`,J.audio(e,{token:t})).then(()=>{q.success(this.$t(`producer.message.startTaskSuccess`))}).catch(e=>{q.error(e?.response?.data?.error?.message||this.$t(`producer.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Dr(e,n,r,a,o,s){let c=d(`config-panel`),u=d(`recent-panel`),f=d(`preview-panel`),m=d(`layout`);return l(),t(m,null,{config:p(()=>[i(c,{onGenerate:e.onGenerateAudio},null,8,[`onGenerate`])]),result:p(()=>[i(u,{ref:`recentPanel`,class:`panel recent`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),preview:p(()=>[i(f)]),_:1})}var Or=V(Er,[[`render`,Dr],[`__scopeId`,`data-v-a766e27a`]]);export{Or as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{$ as e,D as t,E as n,M as r,N as i,O as a,P as o,Q as s,Ut as c,X as l,_ as u,et as d,k as f,lt as p,tt as m,ut as h,x as g,y as _}from"./vendor-chart-mdwpew_o.js";import{t as v}from"./button-DWzbdjZV.js";import{F as y,X as b,Y as x,tt as S,z as C}from"./use-deprecated-CPfQu7wa.js";import{r as w,t as T}from"./select-HUfkzAuQ.js";import{n as E,t as D}from"./tabs-D-2tTItb.js";import{t as O}from"./upload-C64n6FiS.js";import{t as k}from"./tooltip-C3PYfh8V.js";import{t as A}from"./image-s5BzYxHs.js";import{t as j}from"./avatar-DJGt2zYX.js";import{n as M,r as N}from"./radio-IJQsW93X.js";import{n as ee,t as P}from"./collapse-gdZ6e_Uj.js";import{t as F}from"./drawer-BvYPSxXh.js";import{n as I,r as te,t as ne}from"./dropdown-CDgvoM6y.js";import{t as L}from"./input-number-BaYFVx7i.js";import{n as re,t as ie}from"./skeleton-Cn4UY-T8.js";import{t as ae}from"./slider-SWgsI1lB.js";import{t as oe}from"./switch-BZlJomEZ.js";import{An as se,pi as R}from"./constants-C-bSXdJ_.js";import{An as z,At as B,E as V,Fn as H,Ir as U,Nt as W,Ot as G,Sr as K,kr as q,kt as ce,nn as J,yr as Y}from"./index-C8DeSrkP.js";import{t as X}from"./index.es-CNg3jcG4.js";import{n as le}from"./taskDrawerMixin-Cr17Yxqk.js";import{i as Z,n as ue,r as de,t as fe}from"./pagination-BzLQVoO2.js";import{n as pe,t as me}from"./NoTasks-CbTGc8HF.js";import{t as he}from"./Consumption-Bx30TMJY.js";import{n as ge,r as Q,t as _e}from"./Player-Ba9Hff1B.js";var ve=o({name:`LayoutProducer`,components:{ElDrawer:F,ElButton:v,FontAwesomeIcon:X},mixins:[le],data(){return{preview:!1}},computed:{}}),ye={class:`main flex flex-row flex-1`},be={class:`config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},xe={class:`result h-full flex flex-col flex-1 min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`},Se={class:`preview h-full w-[300px] flex flex-col`};function Ce(t,r,a,o,s,c){let m=d(`font-awesome-icon`),g=d(`el-button`),_=d(`el-drawer`);return l(),f(`div`,ye,[n(`div`,be,[e(t.$slots,`config`,{},void 0,!0)]),n(`div`,xe,[e(t.$slots,`result`,{},void 0,!0)]),n(`div`,Se,[e(t.$slots,`preview`,{},void 0,!0)]),h(i(g,{circle:``,class:`menu`,onClick:r[0]||=e=>t.drawer=!0},{default:p(()=>[i(m,{icon:`fa-solid fa-magic`})]),_:1},512),[[u,!t.tasksEmpty]]),i(_,{modelValue:t.drawer,"onUpdate:modelValue":r[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer`},{default:p(()=>[e(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var we=V(ve,[[`render`,Ce],[`__scopeId`,`data-v-cc984c6f`]]),Te=o({name:`TypeSelector`,components:{ElSelect:w,ElOption:T,ElSwitch:oe,InfoIcon:Z},data(){return{options:[{label:`FUZZ-2.0 Pro`,value:`FUZZ-2.0 Pro`,desc:this.$t(`producer.model.fuzz20proDesc`)},{label:`FUZZ-2.0`,value:`FUZZ-2.0`,desc:this.$t(`producer.model.fuzz20desc`)},{label:`FUZZ-2.0 Raw`,value:`FUZZ-2.0 Raw`,desc:this.$t(`producer.model.fuzz20rawDesc`)},{label:`FUZZ-1.1 Pro`,value:`FUZZ-1.1 Pro`,desc:this.$t(`producer.model.fuzz11proDesc`)},{label:`FUZZ-1.1`,value:`FUZZ-1.1`,desc:this.$t(`producer.model.fuzz11desc`)},{label:`FUZZ-1.0 Pro`,value:`FUZZ-1.0 Pro`,desc:this.$t(`producer.model.fuzz10proDesc`)},{label:`FUZZ-1.0`,value:`FUZZ-1.0`,desc:this.$t(`producer.model.fuzz10desc`)},{label:`FUZZ-0.8`,value:`FUZZ-0.8`,desc:this.$t(`producer.model.fuzz08desc`)}]}},computed:{custom:{get(){return this.$store.state.producer?.config?.custom||!1},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,custom:e})}},instrumental:{get(){return this.$store.state.producer?.config?.instrumental||!1},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,instrumental:e})}},model:{get(){return this.$store.state.producer?.config?.model},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,model:e})}}},mounted(){this.model||=se}}),Ee={class:`mb-3`},De={class:`flex items-center mb-1`},Oe={class:`text-sm font-bold`},ke={class:`model-option`},Ae={class:`model-option-name`},je={class:`model-option-desc`},Me={key:0,class:`flex items-center justify-between mb-3`},Ne={class:`flex items-center`},Pe={class:`text-sm font-bold`};function Fe(e,r,o,u,m,h){let _=d(`el-option`),v=d(`el-select`),y=d(`info-icon`),b=d(`el-switch`);return l(),f(`div`,null,[n(`div`,Ee,[n(`div`,De,[n(`span`,Oe,c(e.$t(`producer.name.model`)),1)]),i(v,{modelValue:e.model,"onUpdate:modelValue":r[0]||=t=>e.model=t,class:`w-full model-select`,size:`default`,placeholder:e.$t(`producer.placeholder.select`)},{default:p(()=>[(l(!0),f(g,null,s(e.options,e=>(l(),t(_,{key:e.value,label:e.label,value:e.value},{default:p(()=>[n(`div`,ke,[n(`span`,Ae,c(e.label),1),n(`span`,je,c(e.desc),1)])]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])]),e.custom?(l(),f(`div`,Me,[n(`div`,Ne,[n(`span`,Pe,c(e.$t(`producer.name.instrumental`)),1),i(y,{content:e.$t(`producer.description.instrumental`)},null,8,[`content`])]),i(b,{modelValue:e.instrumental,"onUpdate:modelValue":r[1]||=t=>e.instrumental=t},null,8,[`modelValue`])])):a(``,!0)])}var Ie=V(Te,[[`render`,Fe],[`__scopeId`,`data-v-42496b9a`]]),Le=o({name:`UploadAudio`,components:{ElUpload:O,ElButton:v,ElRadioGroup:N,ElRadioButton:M,InfoIcon:Z,FontAwesomeIcon:X},mixins:[ce],emits:[`change`],data(){return{fileList:[],uploadUrl:K()+`/api/v1/files/`,audioPreviewUrl:null,uploading:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},credential(){return this.$store.state.producer.credential},config(){return this.$store.state.producer.config},urls(){return this.fileList.map(e=>e?.response?.file_url)},hasUploadedAudio(){let e=this.$store.state.producer?.config?.action;return e===`upload_extend`||e===`upload_cover`},uploadAction:{get(){return this.$store.state.producer?.config?.action||`upload_extend`},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,action:e})}}},watch:{urls:{handler(e){this.$emit(`change`,e)}}},methods:{onExceed(){q.warning(this.$t(`producer.message.uploadReferencesExceed`))},onError(){this.uploading=!1,q.error(this.$t(`producer.message.uploadReferencesError`))},async onSuccess(){let e=this.urls?.[0];if(!e){this.uploading=!1;return}this.audioPreviewUrl=e,await this.onGenerateAudioId(e)},async onGenerateAudioId(e){let t={audio_url:e},n=this.credential?.token;if(!n){console.error(`no token specified`),this.uploading=!1;return}this.uploading=!0,q.info(this.$t(`producer.message.startingUploadAudio`));try{let e=(await J.upload(t,{token:n})).data?.data.audio_id;this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,audio_id:e,action:`upload_extend`}),q.success(this.$t(`producer.message.startUploadAudioSuccess`))}catch(e){q.error(e?.response?.data?.error?.message||this.$t(`producer.message.startUploadAudioFailed`))}finally{this.uploading=!1}}}}),Re={class:`relative`},ze={class:`flex justify-between items-center mb-2`},Be={class:`flex justify-start items-center`},Ve={class:`text-sm font-bold`},He={key:0,class:`mb-2`},Ue=[`src`],We={key:1,class:`mt-1`};function Ge(e,t,o,s,u,m){let h=d(`info-icon`),g=d(`font-awesome-icon`),_=d(`el-button`),v=d(`el-upload`),y=d(`el-radio-button`),b=d(`el-radio-group`);return l(),f(`div`,Re,[n(`div`,ze,[n(`div`,Be,[n(`span`,Ve,c(e.$t(`producer.name.referenceAudios`)),1),i(h,{content:e.$t(`producer.description.uploadAudios`)},null,8,[`content`])]),i(v,{"file-list":e.fileList,"onUpdate:fileList":t[0]||=t=>e.fileList=t,name:`file`,limit:1,class:`upload-wrapper inline-upload`,action:e.uploadUrl,accept:`.mp3,.wav,.m4a,audio/*`,"show-file-list":!1,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{default:p(()=>[i(_,{round:``,type:`primary`,size:`small`,loading:e.uploading},{default:p(()=>[i(g,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+c(e.$t(`producer.button.uploadAudios`)),1)]),_:1},8,[`loading`])]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])]),e.audioPreviewUrl?(l(),f(`div`,He,[n(`audio`,{src:e.audioPreviewUrl,controls:``,class:`w-full`},null,8,Ue)])):a(``,!0),e.hasUploadedAudio?(l(),f(`div`,We,[i(b,{modelValue:e.uploadAction,"onUpdate:modelValue":t[1]||=t=>e.uploadAction=t,size:`small`},{default:p(()=>[i(y,{value:`upload_extend`},{default:p(()=>[r(c(e.$t(`producer.button.extend`)),1)]),_:1}),i(y,{value:`upload_cover`},{default:p(()=>[r(c(e.$t(`producer.button.cover_music`)),1)]),_:1})]),_:1},8,[`modelValue`])])):a(``,!0)])}var Ke=V(Le,[[`render`,Ge],[`__scopeId`,`data-v-7fd0580a`]]),qe=o({name:`PromptInput`,components:{PromptTextarea:pe},computed:{prompt:{get(){return this.$store.state.producer?.config?.prompt},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Je(e,n,r,i,a,o){let s=d(`prompt-textarea`);return l(),t(s,{modelValue:e.prompt,"onUpdate:modelValue":n[0]||=t=>e.prompt=t,title:e.$t(`producer.name.songDescription`),info:e.$t(`producer.description.prompt`),placeholder:e.$t(`producer.placeholder.prompt`),"min-rows":5,"max-rows":14},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ye=V(qe,[[`render`,Je]]),Xe=o({name:`LyricInput`,components:{ElInput:U,ElButton:v,FontAwesomeIcon:X,InfoIcon:Z},data(){return{generatingLyrics:!1}},computed:{lyric:{get(){return this.$store.state.producer?.config?.lyric},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,lyric:e})}},config(){return this.$store.state.producer?.config},credential(){return this.$store.state.producer?.credential}},mounted(){this.lyric||=``},methods:{async onGenerateLyrics(){let e=this.credential?.token;if(!e)return;let t=this.config?.style||this.config?.title||`a beautiful song`;this.generatingLyrics=!0,q.info(this.$t(`producer.message.generatingLyrics`));try{let n=(await J.lyric({prompt:t},{token:e})).data?.data;n?.text&&(this.lyric=n.text,n?.title&&!this.config?.title&&this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,lyric:n.text,title:n.title}),q.success(this.$t(`producer.message.generateLyricsSuccess`)))}catch{q.error(this.$t(`producer.message.generateLyricsFailed`))}finally{this.generatingLyrics=!1}}}}),Ze={class:`field`},Qe={class:`flex items-center justify-between mb-1`},$e={class:`flex items-center`},et={class:`text-sm font-bold`};function tt(e,o,s,u,m,h){let g=d(`info-icon`),_=d(`font-awesome-icon`),v=d(`el-button`),y=d(`el-input`);return l(),f(`div`,Ze,[n(`div`,Qe,[n(`div`,$e,[n(`span`,et,c(e.$t(`producer.name.lyrics`)),1),i(g,{content:e.$t(`producer.description.lyrics`)},null,8,[`content`])]),e.config?.action===`extend`?a(``,!0):(l(),t(v,{key:0,size:`small`,loading:e.generatingLyrics,round:``,onClick:e.onGenerateLyrics},{default:p(()=>[e.generatingLyrics?a(``,!0):(l(),t(_,{key:0,icon:`fa-solid fa-wand-magic-sparkles`,class:`mr-1`})),r(` `+c(e.$t(`producer.button.generate_lyrics`)),1)]),_:1},8,[`loading`,`onClick`]))]),e.config?.action===`extend`?(l(),t(y,{key:1,modelValue:e.lyric,"onUpdate:modelValue":o[1]||=t=>e.lyric=t,rows:5,type:`textarea`,class:`lyrics`,placeholder:e.$t(`producer.placeholder.extend.lyrics`)},null,8,[`modelValue`,`placeholder`])):(l(),t(y,{key:0,modelValue:e.lyric,"onUpdate:modelValue":o[0]||=t=>e.lyric=t,rows:5,type:`textarea`,class:`lyrics`,placeholder:e.$t(`producer.placeholder.lyrics`)},null,8,[`modelValue`,`placeholder`]))])}var nt=V(Xe,[[`render`,tt],[`__scopeId`,`data-v-88c6da2b`]]),rt=o({name:`StyleInput`,components:{ElInput:U,InfoIcon:Z},computed:{style:{get(){return this.$store.state.producer?.config?.style},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,style:e})}}}}),it={class:`field`},at={class:`flex items-center justify-between mb-1`},ot={class:`flex items-center`},st={class:`text-sm font-bold`};function ct(e,t,r,a,o,s){let u=d(`info-icon`),p=d(`el-input`);return l(),f(`div`,it,[n(`div`,at,[n(`div`,ot,[n(`span`,st,c(e.$t(`producer.name.style`)),1),i(u,{content:e.$t(`producer.description.style`)},null,8,[`content`])])]),i(p,{modelValue:e.style,"onUpdate:modelValue":t[0]||=t=>e.style=t,rows:2,type:`textarea`,placeholder:e.$t(`producer.placeholder.style`)},null,8,[`modelValue`,`placeholder`])])}var lt=V(rt,[[`render`,ct]]),ut=o({name:`TitleInput`,components:{ElInput:U,InfoIcon:Z},computed:{title:{get(){return this.$store.state.producer?.config?.title},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,title:e})}}}}),dt={class:`field`},ft={class:`flex items-center mb-1`},pt={class:`text-sm font-bold`};function mt(e,t,r,a,o,s){let u=d(`info-icon`),p=d(`el-input`);return l(),f(`div`,dt,[n(`div`,ft,[n(`span`,pt,c(e.$t(`producer.name.title`)),1),i(u,{content:e.$t(`producer.description.title`)},null,8,[`content`])]),i(p,{modelValue:e.title,"onUpdate:modelValue":t[0]||=t=>e.title=t,placeholder:e.$t(`producer.placeholder.title`)},null,8,[`modelValue`,`placeholder`])])}var ht=V(ut,[[`render`,mt]]),gt=o({name:`ExtendFromInput`,components:{ElImage:A,ElIcon:S,ElInputNumber:L,VideoPlay:b,VideoPause:x},data(){return{}},computed:{audio(){return this.$store.state.producer?.config?.audio},value:{get(){return this.$store.state.producer?.config?.continue_at},set(e){console.debug(`set continue_at`,e),this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,continue_at:e?parseInt(e):void 0})}}},mounted(){this.value||=void 0},methods:{handleChange(e){if(e===void 0){this.value=void 0;return}e<0?this.value=0:e>this.audio?.duration?this.value=this.audio?.duration:this.value=e},useFormatDuring:Q,onPlay(e){this.$store.dispatch(`producer/setAudio`,{...this.$store.state.producer.audio,...e,state:`playing`}),console.log(`on play`)},onPause(e){this.$store.dispatch(`producer/setAudio`,{...this.$store.state.producer.audio,...e,state:`paused`}),console.log(`on pause`)},onClick(e){this.$store.state?.producer?.audio?.id!==e.id&&this.onPlay({...e,progress:0})}}}),_t={class:`field`},vt={class:`box`},yt={class:`title font-bold`},bt={class:`input-wrapper`},xt={class:`task`},St={class:`left`},Ct={key:2,class:`duration`},wt={class:`info`},Tt={class:`title`},Et={class:`style`};function Dt(e,t,r,o,s,u){let g=d(`el-input-number`),_=d(`el-image`),v=d(`video-pause`),y=d(`el-icon`),b=d(`video-play`),x=m(`loading`);return l(),f(`div`,_t,[n(`div`,vt,[n(`h2`,yt,c(e.$t(`producer.name.extend`)),1),n(`div`,bt,[i(g,{modelValue:e.value,"onUpdate:modelValue":t[0]||=t=>e.value=t,class:`value`,min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t(`producer.placeholder.extend.continue_at`),onChange:e.handleChange},null,8,[`modelValue`,`max`,`placeholder`,`onChange`])])]),n(`div`,xt,[e.audio?(l(),f(`div`,{key:0,class:`audio`,onClick:t[3]||=t=>e.onClick(e.audio)},[h((l(),f(`div`,St,[i(_,{src:e.audio?.image_url,class:`cover`,fit:`cover`},null,8,[`src`]),e.audio?.audio_url&&e.$store.state?.producer?.audio?.id===e.audio.id&&e.$store.state?.producer?.audio?.state===`playing`?(l(),f(`div`,{key:0,class:`overlay`,onClick:t[1]||=t=>e.onPause(e.audio)},[i(y,null,{default:p(()=>[i(v)]),_:1})])):a(``,!0),e.audio?.audio_url&&(e.$store.state?.producer?.audio?.id!==e.audio.id||e.$store.state?.producer?.audio?.id===e.audio.id&&e.$store.state?.producer?.audio?.state===`paused`)?(l(),f(`div`,{key:1,class:`overlay`,onClick:t[2]||=t=>e.onPlay(e.audio)},[i(y,null,{default:p(()=>[i(b)]),_:1})])):a(``,!0),e.audio?.duration?(l(),f(`div`,Ct,c(e.useFormatDuring(e.audio?.duration)),1)):a(``,!0)])),[[x,!e.audio?.audio_url]]),n(`div`,wt,[n(`h2`,Tt,c(e.audio?.title),1),n(`p`,Et,c(e.audio?.style),1)])])):a(``,!0)])])}var Ot=V(gt,[[`render`,Dt],[`__scopeId`,`data-v-26d43480`]]),kt=o({name:`CoverFromInput`,components:{ElImage:A,ElIcon:S,VideoPlay:b,VideoPause:x},data(){return{}},computed:{audio(){return this.$store.state.producer?.config?.audio},value:{get(){return this.$store.state.producer?.config?.continue_at},set(e){console.debug(`set continue_at`,e),this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,continue_at:e?parseInt(e):void 0})}}},mounted(){this.value||=void 0},methods:{handleChange(e){e<0?this.value=0:e>this.audio?.duration?this.value=this.audio?.duration:this.value=e},useFormatDuring:Q,onPlay(e){this.$store.dispatch(`producer/setAudio`,{...this.$store.state.producer.audio,...e,state:`playing`}),console.log(`on play`)},onPause(e){this.$store.dispatch(`producer/setAudio`,{...this.$store.state.producer.audio,...e,state:`paused`}),console.log(`on pause`)},onClick(e){this.$store.state?.producer?.audio?.id!==e.id&&this.onPlay({...e,progress:0})}}}),At={class:`field`},jt={class:`box`},Mt={class:`title font-bold`},Nt={class:`task`},Pt={class:`left`},Ft={key:2,class:`duration`},It={class:`info`},Lt={class:`title`},Rt={class:`style`};function zt(e,t,r,o,s,u){let g=d(`el-image`),_=d(`video-pause`),v=d(`el-icon`),y=d(`video-play`),b=m(`loading`);return l(),f(`div`,At,[n(`div`,jt,[n(`h2`,Mt,c(e.$t(`producer.name.cover`)),1)]),n(`div`,Nt,[e.audio?(l(),f(`div`,{key:0,class:`audio`,onClick:t[2]||=t=>e.onClick(e.audio)},[h((l(),f(`div`,Pt,[i(g,{src:e.audio?.image_url,class:`cover`,fit:`cover`},null,8,[`src`]),e.audio?.audio_url&&e.$store.state?.producer?.audio?.id===e.audio.id&&e.$store.state?.producer?.audio?.state===`playing`?(l(),f(`div`,{key:0,class:`overlay`,onClick:t[0]||=t=>e.onPause(e.audio)},[i(v,null,{default:p(()=>[i(_)]),_:1})])):a(``,!0),e.audio?.audio_url&&(e.$store.state?.producer?.audio?.id!==e.audio.id||e.$store.state?.producer?.audio?.id===e.audio.id&&e.$store.state?.producer?.audio?.state===`paused`)?(l(),f(`div`,{key:1,class:`overlay`,onClick:t[1]||=t=>e.onPlay(e.audio)},[i(v,null,{default:p(()=>[i(y)]),_:1})])):a(``,!0),e.audio?.duration?(l(),f(`div`,Ft,c(e.useFormatDuring(e.audio?.duration)),1)):a(``,!0)])),[[b,!e.audio?.audio_url]]),n(`div`,It,[n(`h2`,Lt,c(e.audio?.title),1),n(`p`,Rt,c(e.audio?.style),1)])])):a(``,!0)])])}var Bt=V(kt,[[`render`,zt],[`__scopeId`,`data-v-d8a8e583`]]),Vt=o({name:`VocalGenderSelector`,components:{ElRadioGroup:N,ElRadioButton:M,InfoIcon:Z},computed:{vocalGender:{get(){return this.$store.state.producer?.config?.vocal_gender||``},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,vocal_gender:e||void 0})}}}}),Ht={class:`mb-2`},Ut={class:`flex items-center mb-1`},Wt={class:`text-sm font-bold`};function Gt(e,t,a,o,s,u){let m=d(`info-icon`),h=d(`el-radio-button`),g=d(`el-radio-group`);return l(),f(`div`,Ht,[n(`div`,Ut,[n(`span`,Wt,c(e.$t(`producer.name.vocalGender`)),1),i(m,{content:e.$t(`producer.description.vocalGender`)},null,8,[`content`])]),i(g,{modelValue:e.vocalGender,"onUpdate:modelValue":t[0]||=t=>e.vocalGender=t},{default:p(()=>[i(h,{value:``},{default:p(()=>[r(c(e.$t(`producer.gender.auto`)),1)]),_:1}),i(h,{value:`f`},{default:p(()=>[r(c(e.$t(`producer.gender.female`)),1)]),_:1}),i(h,{value:`m`},{default:p(()=>[r(c(e.$t(`producer.gender.male`)),1)]),_:1})]),_:1},8,[`modelValue`])])}var Kt=V(Vt,[[`render`,Gt]]),qt=o({name:`AdvancedParams`,components:{ElCollapse:P,ElCollapseItem:ee,ElInput:U,ElSlider:ae,ElInputNumber:L,InfoIcon:Z},data(){return{activeNames:[]}},computed:{config(){return this.$store.state.producer?.config},styleNegative:{get(){return this.$store.state.producer?.config?.style_negative||``},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,style_negative:e||void 0})}},lyricPrompt:{get(){return this.$store.state.producer?.config?.lyric_prompt||``},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,lyric_prompt:e||void 0})}},weirdness:{get(){return this.$store.state.producer?.config?.weirdness??.5},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,weirdness:e})}},soundStrength:{get(){return this.$store.state.producer?.config?.sound_strength??.7},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,sound_strength:e})}},lyricsStrength:{get(){return this.$store.state.producer?.config?.lyrics_strength??.7},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,lyrics_strength:e})}},seed:{get(){return this.$store.state.producer?.config?.seed},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,seed:e})}}},mounted(){let e=this.$store.state.producer?.config;if(!e)return;let t={};typeof e.weirdness==`number`&&e.weirdness>1&&(t.weirdness=e.weirdness/100),typeof e.sound_strength==`number`&&e.sound_strength>1&&(t.sound_strength=e.sound_strength/100),typeof e.lyrics_strength==`number`&&e.lyrics_strength>1&&(t.lyrics_strength=e.lyrics_strength/100),Object.keys(t).length>0&&this.$store.commit(`producer/setConfig`,{...e,...t})}}),Jt={key:0,class:`mb-3`},Yt={class:`flex items-center mb-1`},Xt={class:`text-xs font-bold`},Zt={key:1,class:`mb-3`},Qt={class:`flex items-center mb-1`},$t={class:`text-xs font-bold`},en={class:`mb-3`},tn={class:`flex items-center justify-between mb-1`},nn={class:`flex items-center`},rn={class:`text-xs font-bold`},an={class:`text-xs text-[var(--el-text-color-secondary)]`},on={class:`mb-3`},sn={class:`flex items-center justify-between mb-1`},cn={class:`flex items-center`},ln={class:`text-xs font-bold`},un={class:`text-xs text-[var(--el-text-color-secondary)]`},dn={key:2,class:`mb-3`},fn={class:`flex items-center justify-between mb-1`},pn={class:`flex items-center`},mn={class:`text-xs font-bold`},hn={class:`text-xs text-[var(--el-text-color-secondary)]`},gn={class:`mb-3`},_n={class:`flex items-center mb-1`},vn={class:`text-xs font-bold`};function yn(e,r,o,s,u,m){let h=d(`info-icon`),g=d(`el-input`),_=d(`el-slider`),v=d(`el-input-number`),y=d(`el-collapse-item`),b=d(`el-collapse`);return l(),t(b,{modelValue:e.activeNames,"onUpdate:modelValue":r[6]||=t=>e.activeNames=t,class:`advanced-collapse`},{default:p(()=>[i(y,{title:e.$t(`producer.name.advancedParams`),name:`advanced`},{default:p(()=>[e.config?.custom?(l(),f(`div`,Jt,[n(`div`,Yt,[n(`span`,Xt,c(e.$t(`producer.name.styleNegative`)),1),i(h,{content:e.$t(`producer.description.styleNegative`)},null,8,[`content`])]),i(g,{modelValue:e.styleNegative,"onUpdate:modelValue":r[0]||=t=>e.styleNegative=t,size:`small`,placeholder:e.$t(`producer.placeholder.styleNegative`)},null,8,[`modelValue`,`placeholder`])])):a(``,!0),e.config?.custom&&!e.config?.instrumental?(l(),f(`div`,Zt,[n(`div`,Qt,[n(`span`,$t,c(e.$t(`producer.name.lyricPrompt`)),1),i(h,{content:e.$t(`producer.description.lyricPrompt`)},null,8,[`content`])]),i(g,{modelValue:e.lyricPrompt,"onUpdate:modelValue":r[1]||=t=>e.lyricPrompt=t,size:`small`,placeholder:e.$t(`producer.placeholder.lyricPrompt`)},null,8,[`modelValue`,`placeholder`])])):a(``,!0),n(`div`,en,[n(`div`,tn,[n(`div`,nn,[n(`span`,rn,c(e.$t(`producer.name.weirdness`)),1),i(h,{content:e.$t(`producer.description.weirdness`)},null,8,[`content`])]),n(`span`,an,c(e.weirdness??.5),1)]),i(_,{modelValue:e.weirdness,"onUpdate:modelValue":r[2]||=t=>e.weirdness=t,min:0,max:1,step:.01},null,8,[`modelValue`])]),n(`div`,on,[n(`div`,sn,[n(`div`,cn,[n(`span`,ln,c(e.$t(`producer.name.soundStrength`)),1),i(h,{content:e.$t(`producer.description.soundStrength`)},null,8,[`content`])]),n(`span`,un,c(e.soundStrength??.7),1)]),i(_,{modelValue:e.soundStrength,"onUpdate:modelValue":r[3]||=t=>e.soundStrength=t,min:.2,max:1,step:.01},null,8,[`modelValue`])]),e.config?.custom&&!e.config?.instrumental?(l(),f(`div`,dn,[n(`div`,fn,[n(`div`,pn,[n(`span`,mn,c(e.$t(`producer.name.lyricsStrength`)),1),i(h,{content:e.$t(`producer.description.lyricsStrength`)},null,8,[`content`])]),n(`span`,hn,c(e.lyricsStrength??.7),1)]),i(_,{modelValue:e.lyricsStrength,"onUpdate:modelValue":r[4]||=t=>e.lyricsStrength=t,min:0,max:1,step:.01},null,8,[`modelValue`])])):a(``,!0),n(`div`,gn,[n(`div`,_n,[n(`span`,vn,c(e.$t(`producer.name.seed`)),1),i(h,{content:e.$t(`producer.description.seed`)},null,8,[`content`])]),i(v,{modelValue:e.seed,"onUpdate:modelValue":r[5]||=t=>e.seed=t,min:0,controls:!1,size:`small`,placeholder:e.$t(`producer.placeholder.seed`),class:`w-full`},null,8,[`modelValue`,`placeholder`])])]),_:1},8,[`title`])]),_:1},8,[`modelValue`])}var bn=V(qt,[[`render`,yn],[`__scopeId`,`data-v-f9296888`]]),xn=o({name:`ReplaceSectionInput`,components:{ElInputNumber:L,ElImage:A,InfoIcon:Z},computed:{audio(){return this.$store.state.producer?.config?.audio},replaceSectionStart:{get(){return this.$store.state.producer?.config?.replace_section_start},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,replace_section_start:e})}},replaceSectionEnd:{get(){return this.$store.state.producer?.config?.replace_section_end},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,replace_section_end:e})}}},methods:{onClick(e){this.$store.dispatch(`producer/setAudio`,{...this.$store.state.producer.audio,...e,state:`playing`})}}}),Sn={class:`field`},Cn={class:`flex items-center mb-2`},wn={class:`text-sm font-bold m-0`},Tn={key:0,class:`task mb-2`},En={class:`left relative w-[50px] h-[50px] mr-3 flex-shrink-0`},Dn={class:`info flex-1 min-w-0`},On={class:`text-sm font-bold m-0 truncate`},kn={class:`text-xs text-[var(--el-text-color-secondary)] m-0 truncate`},An={class:`flex gap-2`};function jn(e,t,r,o,s,u){let p=d(`info-icon`),g=d(`el-image`),_=d(`el-input-number`),v=m(`loading`);return l(),f(`div`,Sn,[n(`div`,Cn,[n(`h2`,wn,c(e.$t(`producer.name.replaceSection`)),1),i(p,{content:e.$t(`producer.description.replaceSection`)},null,8,[`content`])]),e.audio?(l(),f(`div`,Tn,[n(`div`,{class:`audio flex items-center`,onClick:t[0]||=t=>e.onClick(e.audio)},[h((l(),f(`div`,En,[i(g,{src:e.audio?.image_url,class:`w-full h-full rounded`,fit:`cover`},null,8,[`src`])])),[[v,!e.audio?.audio_url]]),n(`div`,Dn,[n(`h2`,On,c(e.audio?.title),1),n(`p`,kn,c(e.audio?.style),1)])])])):a(``,!0),n(`div`,An,[i(_,{modelValue:e.replaceSectionStart,"onUpdate:modelValue":t[1]||=t=>e.replaceSectionStart=t,class:`flex-1`,min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t(`producer.placeholder.replaceSectionStart`)},null,8,[`modelValue`,`max`,`placeholder`]),i(_,{modelValue:e.replaceSectionEnd,"onUpdate:modelValue":t[2]||=t=>e.replaceSectionEnd=t,class:`flex-1`,min:e.replaceSectionStart||0,max:e.audio?.duration,controls:!1,placeholder:e.$t(`producer.placeholder.replaceSectionEnd`)},null,8,[`modelValue`,`min`,`max`,`placeholder`])])])}var Mn=o({name:`PresetPanel`,components:{TypeSelector:Ie,PromptInput:Ye,LyricInput:nt,StyleInput:lt,TitleInput:ht,ExtendFromInput:Ot,CoverFromInput:Bt,UploadAudio:Ke,VocalGenderSelector:Kt,AdvancedParams:bn,ReplaceSectionInput:V(xn,[[`render`,jn]]),FontAwesomeIcon:X,ElButton:v,ElTabs:E,ElTabPane:D,Consumption:he},emits:[`generate`],computed:{config(){return this.$store.state.producer?.config},mode:{get(){return this.$store.state.producer?.config?.custom?`custom`:`simple`},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,custom:e===`custom`})}},consumption(){return W(this.config,this.service?.cost)},service(){return this.$store.state.producer?.service},generateButtonText(){let e=this.config?.action;return e===`extend`||e===`upload_extend`?this.$t(`producer.button.extend`):e===`cover`||e===`upload_cover`?this.$t(`producer.button.cover_music`):e===`variation`?this.$t(`producer.button.variation`):e===`replace_section`?this.$t(`producer.button.replace_section`):e===`stems`?this.$t(`producer.button.get_stems`):e===`swap_vocals`?this.$t(`producer.button.swap_vocals`):e===`swap_instrumentals`?this.$t(`producer.button.swap_instrumentals`):this.$t(`producer.button.generate`)}},methods:{onGenerate(){this.$emit(`generate`)},onClearAll(){this.$store.commit(`producer/setConfig`,{custom:this.$store.state.producer?.config?.custom||!1,instrumental:!1,prompt:``,lyric:``,style:``,title:``,model:this.$store.state.producer?.config?.model})}}}),Nn={class:`flex flex-col h-full`},Pn={class:`flex-1 overflow-y-auto p-5`},Fn={class:`pt-2 px-1`},In={class:`pt-2 px-1`},Ln={class:`flex flex-col items-center justify-center px-5 pb-5 gap-2`},Rn={class:`flex gap-2 w-full`};function zn(e,o,s,u,m,h){let g=d(`type-selector`),_=d(`upload-audio`),v=d(`prompt-input`),y=d(`extend-from-input`),b=d(`cover-from-input`),x=d(`replace-section-input`),S=d(`advanced-params`),C=d(`el-tab-pane`),w=d(`lyric-input`),T=d(`style-input`),E=d(`title-input`),D=d(`vocal-gender-selector`),O=d(`el-tabs`),k=d(`consumption`),A=d(`font-awesome-icon`),j=d(`el-button`);return l(),f(`div`,Nn,[n(`div`,Pn,[i(O,{modelValue:e.mode,"onUpdate:modelValue":o[0]||=t=>e.mode=t,class:`producer-mode-tabs`,stretch:``},{default:p(()=>[i(C,{label:e.$t(`producer.mode.simple`),name:`simple`},{default:p(()=>[n(`div`,Fn,[i(g,{class:`mb-4`}),i(_,{class:`mb-4`}),i(v,{class:`mb-4`}),e.config?.action===`extend`?(l(),t(y,{key:0,class:`mb-4`})):a(``,!0),e.config?.action===`cover`?(l(),t(b,{key:1,class:`mb-4`})):a(``,!0),e.config?.action===`replace_section`?(l(),t(x,{key:2,class:`mb-4`})):a(``,!0),i(S,{class:`mb-4`})])]),_:1},8,[`label`]),i(C,{label:e.$t(`producer.mode.custom`),name:`custom`},{default:p(()=>[n(`div`,In,[i(g,{class:`mb-4`}),i(_,{class:`mb-4`}),e.config?.instrumental?a(``,!0):(l(),t(w,{key:0,class:`mb-4`})),i(T,{class:`mb-4`}),i(E,{class:`mb-4`}),e.config?.instrumental?a(``,!0):(l(),t(D,{key:1,class:`mb-4`})),e.config?.action===`extend`?(l(),t(y,{key:2,class:`mb-4`})):a(``,!0),e.config?.action===`cover`?(l(),t(b,{key:3,class:`mb-4`})):a(``,!0),e.config?.action===`replace_section`?(l(),t(x,{key:4,class:`mb-4`})):a(``,!0),i(S,{class:`mb-4`})])]),_:1},8,[`label`])]),_:1},8,[`modelValue`])]),n(`div`,Ln,[i(k,{value:e.consumption,service:e.service},null,8,[`value`,`service`]),n(`div`,Rn,[i(j,{class:`flex-1`,onClick:e.onClearAll},{default:p(()=>[i(A,{icon:`fa-solid fa-broom`,class:`mr-1`}),r(` `+c(e.$t(`producer.button.clear_all`)),1)]),_:1},8,[`onClick`]),i(j,{type:`primary`,class:`flex-1`,round:``,onClick:e.onGenerate},{default:p(()=>[i(A,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+c(e.generateButtonText),1)]),_:1},8,[`onClick`])])])])}var Bn=V(Mn,[[`render`,zn],[`__scopeId`,`data-v-4a4b209e`]]),Vn=ge(),Hn=R(`producer`),Un=o({name:`TaskPreview`,components:{ElImage:A,ElIcon:S,ElTooltip:k,FontAwesomeIcon:X,VideoPlay:b,VideoPause:x,ElDropdown:ne,ElDropdownMenu:te,ElDropdownItem:I,Loading:y,ApiCodeDialog:de},props:{modelValue:{type:Object,required:!0}},data(){return{isFetchingVideoUrl:!1,isFetchingWav:!1,apiCodeVisible:!1,apiCodePath:`/producer/audios`,apiCodeBody:{}}},computed:{loading(){return this.$store.state.producer?.status?.getApplications===Y.Request},credential(){return this.$store.state.producer.credential},config(){return this.$store.state.producer.config},task(){return this.$store.state.producer?.tasks},audios(){let e=this.modelValue?.response?.data??[],t=this.modelValue?.request?.action;return t?e.map(e=>({...e,action:t})):e},application(){return this.$store.state.producer?.application},active(){return this.$store.state.producer?.tasks?.active}},methods:{useFormatDuring:Q,onViewCode(){let e=this.modelValue?.request||{},t={};Object.entries(e).forEach(([e,n])=>{e===`application_id`||e===`callback_url`||n!=null&&(typeof n==`string`&&n===``||Array.isArray(n)&&n.length===0||(t[e]=n))}),this.apiCodeBody=t,this.apiCodePath=`/producer/audios`,this.apiCodeVisible=!0},onPlay(e){this.$store.dispatch(`producer/setAudio`,{...this.$store.state.producer.audio,...e,state:`playing`}),console.log(`on play`)},onPause(e){this.$store.dispatch(`producer/setAudio`,{...this.$store.state.producer.audio,...e,state:`paused`}),console.log(`on pause`)},onClick(e){this.$store.state?.producer?.audio?.id!==e.id&&this.onPlay({...e,progress:0})},onExtend(e,t){e?.stopPropagation(),console.debug(`set config`,t),this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,model:t.model,custom:!0,instrumental:!1,style:t.style,action:`extend`,audio:t,audio_id:t.id,continue_at:t.duration})},onDownload(e,t){e&&e?.stopPropagation();let n=new URL(t).pathname,r=n.substring(n.lastIndexOf(`/`)+1);fetch(t).then(e=>e.blob()).then(e=>{(0,Vn.saveAs)(e,r)})},async handleVideoDownload(e){if(e.video_url){this.onDownload(null,e.video_url);return}if(!this.isFetchingVideoUrl)try{this.isFetchingVideoUrl=!0;let t=await this.fetchVideoUrlFromApi(e?.id);console.log(`get videoUrl: ${t}`),e.video_url=t,this.onDownload(null,t)}catch(e){console.error(`get videoUrl failed:`,e),q.error(this.$t(`producer.message.getVideoUrlFailed`))}finally{this.isFetchingVideoUrl=!1}},async fetchVideoUrlFromApi(e){return new Promise((t,n)=>{let r={audio_id:e},i=this.credential?.token;if(!i){console.error(`no token specified`),n(Error(`No token specified`));return}J.video(r,{token:i}).then(e=>{let r=e.data?.data?.video_url;r?t(r):n(Error(`Video URL not found in response`))}).catch(e=>{n(e)})})},onPreview(e,t){e?.stopPropagation(),window.open(t,`_blank`)},async onGetStems(e){await this.onGenerateAudioUrl(`stems`,e)},onCover(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,model:e.model,custom:!0,instrumental:!1,style:e.style,action:`cover`,audio:e,audio_id:e.id})},onVariation(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,model:e.model,custom:!0,style:e.style,action:`variation`,audio:e,audio_id:e.id})},async onSwapVocals(e){await this.onGenerateAudioUrl(`swap_vocals`,e)},async onSwapInstrumentals(e){await this.onGenerateAudioUrl(`swap_instrumentals`,e)},async onGetAllStems(e){await this.onGenerateAudioUrl(`all_stems`,e)},onReplaceSection(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,model:e.model,custom:!0,instrumental:!1,style:e.style,action:`replace_section`,audio:e,audio_id:e.id,replace_section_start:0,replace_section_end:Math.min(30,e.duration||30)})},async handleWavDownload(e){if(!e?.id||this.isFetchingWav)return;let t=this.credential?.token;if(t)try{this.isFetchingWav=!0,q.info(this.$t(`producer.message.fetchingWav`));let n=(await J.wav({audio_id:e.id},{token:t})).data?.data,r=Array.isArray(n)?n[0]?.file_url:n?.file_url||n?.audio_url;r?this.onDownload(null,r):q.error(this.$t(`producer.message.fetchWavFailed`))}catch{q.error(this.$t(`producer.message.fetchWavFailed`))}finally{this.isFetchingWav=!1}},async onGenerateAudioUrl(e,t){let n={action:e,audio_id:t,callback_url:Hn},r=this.credential?.token;if(!r){console.error(`no token specified`);return}q.info(this.$t(`producer.message.startingTask`)),J.audio(n,{token:r}).then(()=>{q.success(this.$t(`producer.message.startTaskSuccess`))}).catch(e=>{q.error(e?.response?.data?.error?.message||this.$t(`producer.message.startTaskFailed`))}).finally(async()=>{await this.onGetTasks(),await this.onScrollDown()})},async onScrollDown(){setTimeout(()=>{let e=document.querySelector(`.tasks`);e&&(e.scrollTop=e.scrollHeight)},1e3)},async onGetTasks(){if(this.loading){console.debug(`loading`);return}await this.$store.dispatch(`producer/getTasks`,{limit:30,offset:0})}}}),Wn={class:`task`},Gn=[`onClick`],Kn={class:`left`},qn=[`onClick`],Jn=[`onClick`],Yn={key:2,class:`duration`},Xn={class:`info`},Zn={class:`title`},Qn={class:`style`},$n={class:`right`},er={class:`el-dropdown-link`},tr={class:`flex items-center min-w-[120px]`},nr={class:`flex items-center min-w-[120px]`},rr={class:`el-dropdown-link`};function ir(e,o,u,v,y,b){let x=d(`el-image`),S=d(`video-pause`),C=d(`el-icon`),w=d(`video-play`),T=d(`font-awesome-icon`),E=d(`el-tooltip`),D=d(`Loading`),O=d(`el-dropdown-item`),k=d(`el-dropdown-menu`),A=d(`el-dropdown`),j=d(`api-code-dialog`),M=m(`loading`);return l(),f(`div`,Wn,[(l(!0),f(g,null,s(e.audios,o=>(l(),f(`div`,{key:o.id,class:`audio`,onClick:_(t=>e.onClick(o),[`stop`])},[h((l(),f(`div`,Kn,[i(x,{src:o?.image_url,class:`cover`,fit:`cover`,lazy:``},null,8,[`src`]),o?.audio_url&&e.$store.state?.producer?.audio?.id===o.id&&e.$store.state?.producer?.audio?.state===`playing`?(l(),f(`div`,{key:0,class:`overlay`,onClick:_(t=>e.onPause(o),[`stop`])},[i(C,null,{default:p(()=>[i(S)]),_:1})],8,qn)):a(``,!0),o?.audio_url&&(e.$store.state?.producer?.audio?.id!==o.id||e.$store.state?.producer?.audio?.id===o.id&&e.$store.state?.producer?.audio?.state===`paused`)?(l(),f(`div`,{key:1,class:`overlay`,onClick:_(t=>e.onPlay(o),[`stop`])},[i(C,null,{default:p(()=>[i(w)]),_:1})],8,Jn)):a(``,!0),o?.duration?(l(),f(`div`,Yn,c(e.useFormatDuring(o?.duration)),1)):a(``,!0)])),[[M,!o?.audio_url]]),n(`div`,Xn,[n(`h2`,Zn,c(o?.title),1),n(`p`,Qn,c(o?.style),1)]),n(`div`,$n,[i(A,null,{dropdown:p(()=>[i(k,null,{default:p(()=>[i(O,{disabled:e.isFetchingVideoUrl,onClick:t=>e.handleVideoDownload(o)},{default:p(()=>[n(`div`,tr,[e.isFetchingVideoUrl?(l(),t(C,{key:0,class:`is-loading mr-2`},{default:p(()=>[i(D)]),_:1})):a(``,!0),n(`span`,null,c(e.$t(`producer.button.download_video`)),1)])]),_:1},8,[`disabled`,`onClick`]),o?.audio_url?(l(),t(O,{key:0,onClick:_(t=>e.onDownload(t,o?.audio_url),[`stop`])},{default:p(()=>[r(c(e.$t(`producer.button.download_audio`)),1)]),_:1},8,[`onClick`])):a(``,!0),i(O,{disabled:e.isFetchingWav,onClick:t=>e.handleWavDownload(o)},{default:p(()=>[n(`div`,nr,[e.isFetchingWav?(l(),t(C,{key:0,class:`is-loading mr-2`},{default:p(()=>[i(D)]),_:1})):a(``,!0),n(`span`,null,c(e.$t(`producer.button.download_wav`)),1)])]),_:1},8,[`disabled`,`onClick`])]),_:2},1024)]),default:p(()=>[n(`span`,er,[i(E,{effect:`dark`,content:e.$t(`producer.button.download`),placement:`top`},{default:p(()=>[o?.audio_url||o?.video_url?(l(),t(T,{key:0,icon:`fa-solid fa-download`,class:`icon icon-download`})):a(``,!0)]),_:2},1032,[`content`])])]),_:2},1024),i(A,null,{dropdown:p(()=>[i(k,null,{default:p(()=>[o?.audio_url?(l(),t(O,{key:0,onClick:_(t=>e.onExtend(t,o),[`stop`])},{default:p(()=>[r(c(e.$t(`producer.button.extend`)),1)]),_:1},8,[`onClick`])):a(``,!0),o.id?(l(),t(O,{key:1,onClick:_(t=>e.onGetStems(o.id),[`stop`])},{default:p(()=>[r(c(e.$t(`producer.button.get_stems`)),1)]),_:1},8,[`onClick`])):a(``,!0),o.id?(l(),t(O,{key:2,onClick:_(t=>e.onGetAllStems(o.id),[`stop`])},{default:p(()=>[r(c(e.$t(`producer.button.all_stems`)),1)]),_:1},8,[`onClick`])):a(``,!0),i(O,{onClick:_(t=>e.onCover(o),[`stop`])},{default:p(()=>[r(c(e.$t(`producer.button.cover_music`)),1)]),_:1},8,[`onClick`]),o?.id?(l(),t(O,{key:3,onClick:_(t=>e.onVariation(o),[`stop`])},{default:p(()=>[r(c(e.$t(`producer.button.variation`)),1)]),_:1},8,[`onClick`])):a(``,!0),o?.id?(l(),t(O,{key:4,onClick:_(t=>e.onSwapVocals(o.id),[`stop`])},{default:p(()=>[r(c(e.$t(`producer.button.swap_vocals`)),1)]),_:1},8,[`onClick`])):a(``,!0),o?.id?(l(),t(O,{key:5,onClick:_(t=>e.onSwapInstrumentals(o.id),[`stop`])},{default:p(()=>[r(c(e.$t(`producer.button.swap_instrumentals`)),1)]),_:1},8,[`onClick`])):a(``,!0),o?.id?(l(),t(O,{key:6,onClick:_(t=>e.onReplaceSection(o),[`stop`])},{default:p(()=>[r(c(e.$t(`producer.button.replace_section`)),1)]),_:1},8,[`onClick`])):a(``,!0),i(O,{onClick:_(e.onViewCode,[`stop`])},{default:p(()=>[i(T,{icon:`fa-solid fa-code`,class:`mr-1`}),r(` `+c(e.$t(`common.button.viewCode`)),1)]),_:1},8,[`onClick`])]),_:2},1024)]),default:p(()=>[n(`span`,rr,[i(E,{effect:`dark`,content:e.$t(`producer.button.more`),placement:`top`},{default:p(()=>[o?.audio_url||o?.video_url?(l(),t(T,{key:0,icon:`fa-solid fa-ellipsis`,class:`icon icon-ellipsis`})):a(``,!0)]),_:2},1032,[`content`])])]),_:2},1024)])],8,Gn))),128)),i(j,{visible:e.apiCodeVisible,"onUpdate:visible":o[0]||=t=>e.apiCodeVisible=t,method:`POST`,path:e.apiCodePath,body:e.apiCodeBody,token:e.$store.state.producer?.credential?.token||``},null,8,[`visible`,`path`,`body`,`token`])])}var ar=o({name:`RecentPanel`,components:{ElSkeletonItem:re,ElSkeleton:ie,TaskPreview:V(Un,[[`render`,ir]]),Player:_e,NoTasks:me,ScrollList:ue},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.producer?.tasks,items:this.$store.state.producer?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),or={key:0,class:`tasks`},sr={class:`left w-[70px] p-[10px] flex items-center`},$={class:`main w-[calc(100%-70px)] flex-1 p-[10px]`},cr={key:2,class:`w-full flex-1 flex items-center justify-center`},lr={class:`h-20`};function ur(e,r,o,c,m,_){let v=d(`el-skeleton-item`),y=d(`el-skeleton`),b=d(`task-preview`),x=d(`scroll-list`),S=d(`no-tasks`),C=d(`player`);return l(),f(g,null,[e.tasks?.items===void 0?(l(),f(`div`,or,[(l(),f(g,null,s(3,e=>n(`div`,{key:e,class:`flex`},[n(`div`,sr,[i(y,{animated:``},{template:p(()=>[i(v,{variant:`image`,class:`avatar w-[50px] h-[50px]`})]),_:1})]),n(`div`,$,[i(y,{animated:``},{template:p(()=>[i(v,{variant:`p`,class:`w-[200px] h-[15px] mb-[5px] mt-[10px]`}),i(v,{variant:`text`})]),_:1})])])),64))])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(l(),t(x,{key:1,ref:`scrollList`,class:`flex-1 w-full overflow-y-auto tasks p-2`,loading:e.loading,onReachTop:r[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(l(!0),f(g,null,s(e.tasks?.items,(e,n)=>(l(),t(b,{key:n,"model-value":e,class:`preview`},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):a(``,!0),e.tasks?.items?.length===0?(l(),f(`div`,cr,[i(S)])):a(``,!0),h(n(`div`,lr,[i(C,{namespace:`producer`})],512),[[u,!!e.$store?.state?.producer?.audio?.object]])],64)}var dr=V(ar,[[`render`,ur]]),fr=o({name:`TaskPreview`,components:{IconPicture:C,ElImage:A,ElAvatar:j,ElIcon:S},computed:{audio(){return this.$store.state.producer?.audio}}}),pr={key:0,class:`size-full overflow-hidden`},mr={class:`relative h-[300px]`},hr={class:`flex items-center justify-center size-full bg-[var(--el-bg-color)]`},gr={class:`absolute bottom-0 left-0 right-0 m-0 p-4 text-white z-10 bg-gradient-to-t from-black/70 to-transparent`},_r={class:`p-4`},vr={class:`flex items-center font-bold mb-2`},yr={class:`text-[var(--el-text-color-regular)] mb-2`},br={class:`text-xs text-[var(--el-text-color-regular)]`},xr={class:`mt-4 text-sm leading-[25px] whitespace-pre-wrap`},Sr={key:1,class:`w-full h-full`};function Cr(e,t,r,a,o,s){let u=d(`icon-picture`),m=d(`el-icon`),h=d(`el-image`),g=d(`el-avatar`);return e.audio?.object?(l(),f(`div`,pr,[n(`div`,mr,[i(h,{src:e.audio.image_url,fit:`cover`,class:`size-full`},{error:p(()=>[n(`div`,hr,[i(m,{class:`text-3xl`},{default:p(()=>[i(u)]),_:1})])]),_:1},8,[`src`]),n(`h2`,gr,c(e.audio?.title),1)]),n(`div`,_r,[n(`div`,vr,[i(g,{size:30,src:e.audio?.image_url,class:`mr-2`},null,8,[`src`]),n(`span`,null,c(e.audio?.title),1)]),n(`p`,yr,c(e.audio?.style),1),n(`p`,br,c(e.$dayjs.format(e.audio?.created_at)),1),n(`div`,xr,[n(`p`,null,c(e.audio?.lyric),1)])])])):(l(),f(`div`,Sr))}var wr=V(fr,[[`render`,Cr]]),Tr=R(`producer`),Er=o({name:`ProducerIndex`,components:{Layout:we,ConfigPanel:Bn,RecentPanel:dr,PreviewPanel:wr},mixins:[B],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.producer?.status?.getApplications===Y.Request},tasksLoading(){return this.$store.state.producer?.status?.getTasks===Y.Request||this.fetchingTasks},service(){return this.$store.state.producer.service},credential(){return this.$store.state.producer.credential},config(){return this.$store.state.producer.config},initializing(){return this.$store.state.producer.status.getApplications===Y.Request},needApply(){return this.$store.state.producer.status.getApplications===Y.Success&&!this.application},application(){return this.$store.state.producer.application},tasks(){return this.$store.state.producer.tasks},applications(){return this.$store.state.producer.applications}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await fe({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`producer/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplications`),await this.$store.dispatch(`producer/getApplications`),console.debug(`end onGetApplications`),await this.onGetTasks()},onApply(){z.create({application:this.application}).then(({data:e})=>{this.application=e,q.success(this.$t(`application.message.applySuccessfully`))}).catch(e=>{e?.response?.data?.code===`duplication`&&q.error(this.$t(`application.message.alreadyApplied`))})},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`producer/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerateAudio(){if(!G(this.uploadTracker,e=>this.$t(e),e=>q.warning(e)))return;let e={...this.config,callback_url:Tr},t=this.credential?.token;if(!t){console.error(`no token specified`);return}q.info(this.$t(`producer.message.startingTask`)),H(`producer`,J.audio(e,{token:t})).then(()=>{q.success(this.$t(`producer.message.startTaskSuccess`))}).catch(e=>{q.error(e?.response?.data?.error?.message||this.$t(`producer.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Dr(e,n,r,a,o,s){let c=d(`config-panel`),u=d(`recent-panel`),f=d(`preview-panel`),m=d(`layout`);return l(),t(m,null,{config:p(()=>[i(c,{onGenerate:e.onGenerateAudio},null,8,[`onGenerate`])]),result:p(()=>[i(u,{ref:`recentPanel`,class:`panel recent`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),preview:p(()=>[i(f)]),_:1})}var Or=V(Er,[[`render`,Dr],[`__scopeId`,`data-v-a766e27a`]]);export{Or as default};
|