@acedatacloud/nexior 3.274.1 → 3.274.3
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-C3EVZAE2.js → ApiCodeButton-Bfe1fDwO.js} +1 -1
- package/dist/assets/AskUserQuestionCard-DBEiRKAC.css +1 -0
- package/dist/assets/AskUserQuestionCard-DJ0vw5fH.js +20 -0
- package/dist/assets/{Auth-D2YcEeY-.js → Auth-BCnq2ZMi.js} +1 -1
- package/dist/assets/{Bare-SrZNHviQ.js → Bare-j1zauGsF.js} +1 -1
- package/dist/assets/{BotPlaceholder-DB5a5MjZ.js → BotPlaceholder-BSK6Rf4y.js} +1 -1
- package/dist/assets/{BottomFooter-BDkKCDmh.js → BottomFooter-C1F986Ol.js} +1 -1
- package/dist/assets/{Callback-D7XW2-75.js → Callback-wA2b-1nr.js} +1 -1
- package/dist/assets/{Console-BNJ0MMz1.js → Console-C8YqyhMg.js} +1 -1
- package/dist/assets/{Consumption-Doupb3lK.js → Consumption-Jipz0FdC.js} +1 -1
- package/dist/assets/{Conversation-BCMyn2AR.css → Conversation-Cb7fSFDv.css} +1 -1
- package/dist/assets/Conversation-D2dCEpkN.js +3 -0
- package/dist/assets/{CopyToClipboard-KY6HaCxY.js → CopyToClipboard-Bjiu0-VD.js} +1 -1
- package/dist/assets/Detail-CDUUM7o3.js +2 -0
- package/dist/assets/Extra-JJInmL9D.js +1 -0
- package/dist/assets/{FilePreview-D-79tvH8.js → FilePreview-Bmm7GA18.js} +1 -1
- package/dist/assets/{Hailuo-C9HGE8gO.js → Hailuo-lU7CVwZ1.js} +1 -1
- package/dist/assets/{History-BFhbTP78.js → History-DAaJYV1_.js} +1 -1
- package/dist/assets/{ImagePreview-Ek81a8Dx.js → ImagePreview-D5X8TUlF.js} +1 -1
- package/dist/assets/{ImageWrapper-F7vvcPAe.js → ImageWrapper-BTTjpI7_.js} +1 -1
- package/dist/assets/{Index-5GRRUILp.js → Index-AW_9oXDN.js} +1 -1
- package/dist/assets/{Index-GMZx3bgm.js → Index-BBYLLHax.js} +1 -1
- package/dist/assets/{Index-BPFCasWJ.js → Index-BIWlL7Cm.js} +1 -1
- package/dist/assets/Index-BKZWZ5X8.js +1 -0
- package/dist/assets/Index-BRboOWCX.js +1 -0
- package/dist/assets/{Index-CYiYyKr-.js → Index-B_2mYB7S.js} +1 -1
- package/dist/assets/Index-BvKE5kj_.js +1 -0
- package/dist/assets/{Index-Dm-tMQX6.js → Index-C-IDYWNM.js} +1 -1
- package/dist/assets/{Index-3HV6qaX3.js → Index-C-e3ahk8.js} +2 -2
- package/dist/assets/Index-C8PrvGQi.js +1 -0
- package/dist/assets/{Index-CMTeqhWA.js → Index-CE8qwwBK.js} +1 -1
- package/dist/assets/{Index-CXrNdrud.js → Index-CGP4gExJ.js} +1 -1
- package/dist/assets/Index-CQo8yLx8.js +1 -0
- package/dist/assets/{Index-C8o63WmR2.js → Index-CdHxtLHz.js} +1 -1
- package/dist/assets/Index-D1n6Si7S.js +1 -0
- package/dist/assets/{Index-CVmydTNH.js → Index-D9h3cnjr.js} +1 -1
- package/dist/assets/{Index-Ddv7Dzau.js → Index-DLOPlo18.js} +1 -1
- package/dist/assets/Index-DRptzXAf.css +1 -0
- package/dist/assets/Index-DZWvND7j.js +1 -0
- package/dist/assets/Index-DbbZbszd.js +1 -0
- package/dist/assets/{Index-B4ie6uo3.js → Index-Dh7E1N27.js} +1 -1
- package/dist/assets/Index-Dp4buyFO.js +1 -0
- package/dist/assets/{Index-DzEEEupa.css → Index-DuLEDnvW.css} +1 -1
- package/dist/assets/Index-DughvbBb.js +1 -0
- package/dist/assets/Index-H0GENNZf.css +1 -0
- package/dist/assets/Index-R2gkp4S3.js +1 -0
- package/dist/assets/{Index-BCCSOr5n.js → Index-mQV1K6Vv.js} +1 -1
- package/dist/assets/Index-tRguwJoC.js +1 -0
- package/dist/assets/Index-uYMYrTxK.js +1 -0
- package/dist/assets/{Invitees-MlBDQaxD.js → Invitees-su1n-BeX.js} +1 -1
- package/dist/assets/{List-CM7gaMF9.js → List-5laWDujY.js} +1 -1
- package/dist/assets/{List-DJ8RX5AV.js → List-BJQFTzxF.js} +1 -1
- package/dist/assets/{List-C42HEhcA.js → List-CqzKbfOs.js} +1 -1
- package/dist/assets/{Login-2EmyO41N.js → Login-D8lHpp8_.js} +1 -1
- package/dist/assets/{Main-BhTkwF2R.js → Main-Cs3kfAHx.js} +1 -1
- package/dist/assets/Model-Cg29bGxH.js +1 -0
- package/dist/assets/Navigator-16b84XMw.js +4 -0
- package/dist/assets/{Navigator-CC-7G7eZ.css → Navigator-BbJyIBrU.css} +1 -1
- package/dist/assets/{NoTasks-8I8Kf6PS.js → NoTasks-qUri5oTo.js} +1 -1
- package/dist/assets/{NotFound-1m3ICyU8.css → NotFound-By7mXzN3.css} +1 -1
- package/dist/assets/{NotFound-C58eexH2.js → NotFound-OY0Vr9v2.js} +1 -1
- package/dist/assets/{Pagination-A6wLxXgU.js → Pagination-C5qfXnOa.js} +1 -1
- package/dist/assets/{Pay-qWPUquao.js → Pay-IGhZRuHS.js} +1 -1
- package/dist/assets/{Player-Cq-jFeS-.js → Player-DnAW_Yqr.js} +1 -1
- package/dist/assets/Seedance-CmfjCl3v.css +1 -0
- package/dist/assets/Seedance-Dohw_NcR.js +1 -0
- package/dist/assets/{Status-C0tb0yX5.js → Status-BXMyemE8.js} +1 -1
- package/dist/assets/{Subscribe-DxnKQcSl.js → Subscribe-Cw9F3noA.js} +1 -1
- package/dist/assets/{TabSwitcher-C3mzLlzp.js → TabSwitcher-DY9rtI83.js} +1 -1
- package/dist/assets/Tts-Bcg-v804.js +1 -0
- package/dist/assets/{VideoPlayer-DtL7g2wb.js → VideoPlayer-DZaH2bws.js} +1 -1
- package/dist/assets/{_Uint8Array-BWFOsHS0.js → _Uint8Array-0UxlbjS_.js} +1 -1
- package/dist/assets/{_baseClone-DaZo-ISG.js → _baseClone-7uTPqT6Z.js} +1 -1
- package/dist/assets/{_baseIteratee-BuOT9sRw.js → _baseIteratee-Bt4PVrpe.js} +1 -1
- package/dist/assets/{_initCloneObject-Cul0qGeO.js → _initCloneObject-BJVAPsyT.js} +1 -1
- package/dist/assets/{alert-Cs6WDxgv.js → alert-BJj7gY4q.js} +1 -1
- package/dist/assets/{avatar-BR7pNT_X.js → avatar-C4GcFWIv.js} +1 -1
- package/dist/assets/{avatar-D6ktPryp.js → avatar-DJGt2zYX.js} +1 -1
- package/dist/assets/{basic-BrvrsWLi.js → basic-C1NwVfym.js} +1 -1
- package/dist/assets/{button-Diu_mJ2H.js → button-DWzbdjZV.js} +1 -1
- package/dist/assets/{card-ctDPo7It.js → card-B1OoUKT4.js} +1 -1
- package/dist/assets/castArray-BFcmUPBb.js +1 -0
- package/dist/assets/chat-B1j1nGpk.js +1 -0
- package/dist/assets/chat-BH-MA0nJ.js +1 -0
- package/dist/assets/chat-BeY-c4Fi.js +1 -0
- package/dist/assets/chat-BiIuxmvS.js +1 -0
- package/dist/assets/chat-BvJMXIgI.js +1 -0
- package/dist/assets/chat-Bzs237ot.js +1 -0
- package/dist/assets/chat-CCavc06u.js +1 -0
- package/dist/assets/chat-Cj2tYRzY.js +1 -0
- package/dist/assets/chat-CklKbwE_.js +1 -0
- package/dist/assets/chat-Cnq6zi6V.js +1 -0
- package/dist/assets/chat-D5Il9KPM.js +1 -0
- package/dist/assets/{chat-sVLAutx0.js → chat-DajhMCMw.js} +1 -1
- package/dist/assets/chat-DmVGde2g.js +1 -0
- package/dist/assets/chat-Dv3M0RJE.js +1 -0
- package/dist/assets/chat-Kom-L-Tl.js +1 -0
- package/dist/assets/chat-LWnmQe5u.js +1 -0
- package/dist/assets/chat-VkQsyTTi.js +1 -0
- package/dist/assets/chat-hMaFq0yM.js +1 -0
- package/dist/assets/chat-xWXKsCl4.js +1 -0
- package/dist/assets/{checkbox-CC_Z1s1v.js → checkbox-hfJFSY6z.js} +1 -1
- package/dist/assets/{click-outside-ue1o0Mzw.js → click-outside-DSZqOY28.js} +1 -1
- package/dist/assets/codingBridge-99Xe6gEF.js +1 -0
- package/dist/assets/codingBridge-B7H-MUcV.js +1 -0
- package/dist/assets/codingBridge-BtMiSZvm.js +1 -0
- package/dist/assets/codingBridge-CEA68s26.js +1 -0
- package/dist/assets/codingBridge-CUw3mU8O.js +1 -0
- package/dist/assets/codingBridge-Cr-qrbg3.js +1 -0
- package/dist/assets/codingBridge-D1LC_OhC.js +1 -0
- package/dist/assets/codingBridge-D5RbQ66Y.js +1 -0
- package/dist/assets/codingBridge-DGhOZyud.js +1 -0
- package/dist/assets/codingBridge-D_gXhzYC.js +1 -0
- package/dist/assets/codingBridge-DmJe9lO9.js +1 -0
- package/dist/assets/codingBridge-Dn8nv9AC.js +1 -0
- package/dist/assets/codingBridge-FsHhTmXM.js +1 -0
- package/dist/assets/codingBridge-I7QFljGs.js +1 -0
- package/dist/assets/codingBridge-WbNBgmNM.js +1 -0
- package/dist/assets/codingBridge-ZYr6rRE4.js +1 -0
- package/dist/assets/codingBridge-dtT7_tSf.js +1 -0
- package/dist/assets/codingBridge-j9ogGIAZ.js +2 -0
- package/dist/assets/codingBridge-lDNPWIvm.js +1 -0
- package/dist/assets/{collapse-CIptIyBk.js → collapse-D67Kjcrc.js} +1 -1
- package/dist/assets/{collapse-transition-ee9MUgpU.js → collapse-transition-C7m30vMg.js} +1 -1
- package/dist/assets/common-B9ZcPZVw.js +1 -0
- package/dist/assets/{common-DnnrEdhT.js → common-Br9T8KnP.js} +1 -1
- package/dist/assets/{common-QIqdJFYK.js → common-BzLOOdZl.js} +1 -1
- package/dist/assets/{common-BOEMt2vL.js → common-C1f80x5q.js} +1 -1
- package/dist/assets/common-CmGEY1zP.js +1 -0
- package/dist/assets/common-D0sTFWc3.js +1 -0
- package/dist/assets/common-D6gFX3M_.js +1 -0
- package/dist/assets/common-DFwCi8aH.js +1 -0
- package/dist/assets/{common-f8oTUIGg.js → common-DGknNLsE.js} +1 -1
- package/dist/assets/{common-Ccu0TKVV.js → common-DMEm7Rs7.js} +1 -1
- package/dist/assets/common-Day4Srji.js +1 -0
- package/dist/assets/{common-DbZaQfMY.js → common-Ddqjp1s7.js} +1 -1
- package/dist/assets/{common-CwKsZm73.js → common-Dq-uo3wJ.js} +1 -1
- package/dist/assets/{common-CeYQ_dOh.js → common-DvA6VZhe.js} +1 -1
- package/dist/assets/{common-Bz5PGg0z.js → common-XiY362Y2.js} +1 -1
- package/dist/assets/{common-BnWI3tHZ.js → common-fmwYpuPs.js} +1 -1
- package/dist/assets/{common-ewEplSeG.js → common-tUeDXkDy.js} +1 -1
- package/dist/assets/common-v14C2y2H.js +1 -0
- package/dist/assets/constants-DDcIM163.js +3 -0
- package/dist/assets/{container-Da1G38HZ.js → container-DUnSq7iO.js} +1 -1
- package/dist/assets/{createTaskActions-DVJADNYl.js → createTaskActions-DVeIyBNQ.js} +1 -1
- package/dist/assets/{date-picker-BEUeqxyV.js → date-picker-upO_n0rx.js} +1 -1
- package/dist/assets/{debounce-C3gzpw75.js → debounce-BY7z7rFy.js} +1 -1
- package/dist/assets/{divider-DpYRdXgs.js → divider-Ba_Z3oBh.js} +1 -1
- package/dist/assets/{drawer-B42T8GMw.js → drawer-BvYPSxXh.js} +1 -1
- package/dist/assets/{dropdown-Cl5vU9EC.js → dropdown-DGc8udGs.js} +1 -1
- package/dist/assets/{esm-BkNJ0Oic.js → esm-C3r_WRaI.js} +1 -1
- package/dist/assets/{esm-D-0ZeK78.js → esm-DPF5q2fD.js} +3 -3
- package/dist/assets/{esm-D5APNXPw.js → esm-DS5neUyo.js} +1 -1
- package/dist/assets/{esm-DtEt5cZz.js → esm-oHwv9ewJ.js} +2 -2
- package/dist/assets/{esm-DOg1IGf_.js → esm-yc7IoIxA.js} +1 -1
- package/dist/assets/fish-GiyZoe9r.js +1 -0
- package/dist/assets/{flux-DCpWw8VW.js → flux-ACp6RxUG.js} +1 -1
- package/dist/assets/{form-BlaCq7xv.js → form-D0aSFxDK.js} +1 -1
- package/dist/assets/grokvideo-AiKED_Kk.js +1 -0
- package/dist/assets/grokvideo-B6kHVyju.js +1 -0
- package/dist/assets/grokvideo-BAFMcBW1.js +1 -0
- package/dist/assets/grokvideo-BCXPJSWa.js +1 -0
- package/dist/assets/grokvideo-BSrEUixx.js +1 -0
- package/dist/assets/grokvideo-B_dAyB0X.js +1 -0
- package/dist/assets/grokvideo-Bdz4yWG5.js +1 -0
- package/dist/assets/grokvideo-C2ZHW1cN.js +1 -0
- package/dist/assets/grokvideo-CYMpC7HG.js +1 -0
- package/dist/assets/{seedance-i-JhgAQT.js → grokvideo-CZynEpPd.js} +1 -1
- package/dist/assets/grokvideo-DKci7nDj.js +1 -0
- package/dist/assets/grokvideo-DQZW36Tk.js +1 -0
- package/dist/assets/grokvideo-Dyv36-vR.js +1 -0
- package/dist/assets/grokvideo-Oq66uNZS.js +1 -0
- package/dist/assets/grokvideo-aNVkjTom.js +1 -0
- package/dist/assets/grokvideo-scugZKPG.js +1 -0
- package/dist/assets/grokvideo-t8ZvBusV.js +1 -0
- package/dist/assets/grokvideo-tQx4XTBJ.js +1 -0
- package/dist/assets/grokvideo-zn0Cf79G.js +1 -0
- package/dist/assets/{pixverse-DBxOgyPK.js → hailuo-DdXpuIqm.js} +1 -1
- package/dist/assets/{headshots-BLBRVTFt.js → headshots-yEbYCcYV.js} +1 -1
- package/dist/assets/image-dbbYkOOx.js +1 -0
- package/dist/assets/index-C16pnEK3.js +570 -0
- package/dist/assets/{index-DzfCaX1N.css → index-CPKBiv4e.css} +1 -1
- package/dist/assets/{index.browser.esm-D5tMh_nT.js → index.browser.esm-BAOJaMuj.js} +1 -1
- package/dist/assets/{index.es-BkuxA5W8.js → index.es-D96NPyN9.js} +1 -1
- package/dist/assets/{input-number-CC70lFIw.js → input-number-BpGzQCcW.js} +1 -1
- package/dist/assets/{install-CzQRVga2.js → install-ClulZuUd.js} +1 -1
- package/dist/assets/{isEqual-sAbJQayi.js → isEqual-XQKSKR3y.js} +1 -1
- package/dist/assets/isPlainObject-2p88HvQz.js +1 -0
- package/dist/assets/{kling-9LZuogWF.js → kling-rt9C4y1k.js} +1 -1
- package/dist/assets/{qrart-DdmV2UYZ.js → luma-CfzPdGPr.js} +1 -1
- package/dist/assets/{midjourney-gqEO_Ce8.js → midjourney-Bz49nRWJ.js} +1 -1
- package/dist/assets/nanobanana-CzS7TH6t.js +1 -0
- package/dist/assets/{openaiimage-C65i3kxn.js → openaiimage-CNv4hI79.js} +1 -1
- package/dist/assets/{pagination-CnFr2BK-.js → pagination-DThkyS9k.js} +1 -1
- package/dist/assets/{wan-B_WgOkqO.js → pika-DMLrszYe.js} +1 -1
- package/dist/assets/pixverse-CQ8_iBGb.js +1 -0
- package/dist/assets/{popover-BkK_L9t6.js → popover-BUTBEKcB.js} +1 -1
- package/dist/assets/{producer-BtD2llnD.js → producer-5SV1E8gm.js} +1 -1
- package/dist/assets/{progress-D3pXGVL9.js → progress-Djs_fbqu.js} +1 -1
- package/dist/assets/{luma-12etEurj.js → qrart-HvtNtFr6.js} +1 -1
- package/dist/assets/{radio-ClH7NqRe.js → radio-IJQsW93X.js} +1 -1
- package/dist/assets/raf-Bo8-dFzL.js +1 -0
- package/dist/assets/{repeat-click-DLdqLbt2.js → repeat-click-bdfKzhUt.js} +1 -1
- package/dist/assets/{row-CXoGz5_v.js → row-C4Z9x5Yy.js} +1 -1
- package/dist/assets/{runtime-CWC3rvzM.js → runtime-Cvku-lF9.js} +1 -1
- package/dist/assets/{scroll-DpzO3iLP.js → scroll-Dk1pKbmY.js} +1 -1
- package/dist/assets/{scrollbar-C42eaQUF.js → scrollbar-BkgtdYMt.js} +1 -1
- package/dist/assets/{nanobanana-ChOQilt6.js → seedance-BAYq19Gs.js} +1 -1
- package/dist/assets/{seedream-Cr1SvbaV.js → seedream-DlqEQTCF.js} +1 -1
- package/dist/assets/{select-DWNgO63K.js → select-Dd2EIHDR.js} +1 -1
- package/dist/assets/{serp-BMfg9Ar9.js → serp-Dj4OtkQ3.js} +1 -1
- package/dist/assets/{skeleton-Cc4nM_v1.js → skeleton-Cn4UY-T8.js} +1 -1
- package/dist/assets/{slider-DC2TXYno.js → slider-BHp2gKVa.js} +1 -1
- package/dist/assets/{solana-wallets-DXo_zmOu.js → solana-wallets-CXP-datF.js} +2 -2
- package/dist/assets/{solana-wallets-vue-9ViL9Kcd.js → solana-wallets-vue-DwQ8wk8j.js} +1 -1
- package/dist/assets/{pika-CMLo8HvO.js → sora-CPCT74QK.js} +1 -1
- package/dist/assets/strings-DaYxHDzK.js +1 -0
- package/dist/assets/{suno-C-cgncsN.js → suno-DJWL7F_l.js} +1 -1
- package/dist/assets/{switch-DVJS8YtM.js → switch-C6k-HtKw.js} +1 -1
- package/dist/assets/{table-DfFIvmbC.js → table-fY8LUehs.js} +1 -1
- package/dist/assets/{tabs-BkSGzV77.js → tabs-Iq532XbG.js} +1 -1
- package/dist/assets/{teleport-B-ddnr86.js → teleport-B3tPbGeJ.js} +1 -1
- package/dist/assets/{tooltip-hII4wDEz.js → tooltip-C3PYfh8V.js} +1 -1
- package/dist/assets/{upload-BrKQUZi2.js → upload-HDT7x_5o.js} +1 -1
- package/dist/assets/{use-aria-CPXaRRmL.js → use-aria-B1wQLdcx.js} +1 -1
- package/dist/assets/{use-deprecated-BhaeS12t.js → use-deprecated-CPfQu7wa.js} +1 -1
- package/dist/assets/{use-dialog-D7UxhezB.js → use-dialog-Daprv7SC.js} +1 -1
- package/dist/assets/vendor-chart-mdwpew_o.js +5 -0
- package/dist/assets/{vendor-highlight-mMg7GAOR.js → vendor-highlight-BtIeKitL.js} +1 -1
- package/dist/assets/vendor-vue-router-ChMPprnO.js +1 -0
- package/dist/assets/{veo-Cmcj0VD1.js → veo-C8CbcatO.js} +1 -1
- package/dist/assets/{vnode-DGJOCX4v.js → vnode-BMVwTmkF.js} +1 -1
- package/dist/assets/{sora-BRbJXPAK.js → wan-8CWCsZ-D.js} +1 -1
- package/dist/assets/web-BcSP1NlC.js +1 -0
- package/dist/assets/{web-DXC0pwSP.js → web-CkEHpnz9.js} +1 -1
- package/dist/assets/{web-BOwXMkyZ.js → web-CxoVPYIH.js} +1 -1
- package/dist/assets/{web-LjhIpZ4x.js → web-D3B9ZXGV.js} +1 -1
- package/dist/assets/webextrator-Drt1gu1h.js +1 -0
- package/dist/assets/{wechat-4Hcv82eB.js → wechat-iv-pzVEX.js} +1 -1
- package/dist/index.html +14 -14
- package/package.json +7 -7
- package/dist/assets/AskUserQuestionCard-BUB3tOqK.js +0 -20
- package/dist/assets/AskUserQuestionCard-CaxXoCO4.css +0 -1
- package/dist/assets/Conversation-B-MfXCTA.js +0 -3
- package/dist/assets/Detail-DOWVbTfb.js +0 -2
- package/dist/assets/Extra-BOfUAVX5.js +0 -1
- package/dist/assets/Index-B835g6mA.js +0 -1
- package/dist/assets/Index-BHQzZv3-.js +0 -1
- package/dist/assets/Index-BcOYvwEP2.js +0 -1
- package/dist/assets/Index-C24dxIhQ.js +0 -1
- package/dist/assets/Index-C3avO93h.js +0 -1
- package/dist/assets/Index-COOW3X0T.css +0 -1
- package/dist/assets/Index-D1QeeQef.js +0 -1
- package/dist/assets/Index-D4A-Sgu_.js +0 -1
- package/dist/assets/Index-GURXcuzB.js +0 -1
- package/dist/assets/Index-LyBbiotd.js +0 -1
- package/dist/assets/Index-PZZYAI84.js +0 -1
- package/dist/assets/Index-SxBo_1-C.js +0 -1
- package/dist/assets/Index-drvjYxSE2.js +0 -1
- package/dist/assets/Model-DkPC7Ywx.js +0 -1
- package/dist/assets/Navigator-DHYlJVWe.js +0 -4
- package/dist/assets/Tts-D1Lhro0z.js +0 -1
- package/dist/assets/castArray-C8iSMqbN.js +0 -1
- package/dist/assets/chat-B5qaH8Zb.js +0 -1
- package/dist/assets/chat-BVyFYVzZ.js +0 -1
- package/dist/assets/chat-BYPjxb6J.js +0 -1
- package/dist/assets/chat-B_u4bQbo.js +0 -1
- package/dist/assets/chat-C1g0ddks.js +0 -1
- package/dist/assets/chat-CHwyMvMR.js +0 -1
- package/dist/assets/chat-Cfc2fCiv.js +0 -1
- package/dist/assets/chat-CsjVWfQv.js +0 -1
- package/dist/assets/chat-DIN8Qvbw.js +0 -1
- package/dist/assets/chat-DVJ4MT0_.js +0 -1
- package/dist/assets/chat-DdTeP3LM.js +0 -1
- package/dist/assets/chat-Dil-tfqu.js +0 -1
- package/dist/assets/chat-DlS6uWPJ.js +0 -1
- package/dist/assets/chat-Dm6Rq5Kb.js +0 -1
- package/dist/assets/chat-Du22ct8N.js +0 -1
- package/dist/assets/chat-LWIQPCx_.js +0 -1
- package/dist/assets/chat-RSDEZOQj.js +0 -1
- package/dist/assets/chat-jDULlodh.js +0 -1
- package/dist/assets/codingBridge-BBTz-LNk.js +0 -1
- package/dist/assets/codingBridge-BEdoIvhU.js +0 -1
- package/dist/assets/codingBridge-BJOs2wGl.js +0 -1
- package/dist/assets/codingBridge-Bb2vpBlj.js +0 -1
- package/dist/assets/codingBridge-Bg-bg7GC.js +0 -1
- package/dist/assets/codingBridge-BtUDmyf5.js +0 -1
- package/dist/assets/codingBridge-CapiE9kS.js +0 -1
- package/dist/assets/codingBridge-D0aUF3ys.js +0 -1
- package/dist/assets/codingBridge-DBHW6da0.js +0 -1
- package/dist/assets/codingBridge-DHBG8hRH.js +0 -1
- package/dist/assets/codingBridge-DPbhaNxe.js +0 -1
- package/dist/assets/codingBridge-DdWd-svT.js +0 -1
- package/dist/assets/codingBridge-DesQMnCS.js +0 -1
- package/dist/assets/codingBridge-DhU4hcRW.js +0 -1
- package/dist/assets/codingBridge-DyGBsBaQ.js +0 -1
- package/dist/assets/codingBridge-SyvoL5aZ.js +0 -2
- package/dist/assets/codingBridge-VBvS-ufO.js +0 -1
- package/dist/assets/codingBridge-cDeiH5ZF.js +0 -1
- package/dist/assets/codingBridge-gF-qCrm2.js +0 -1
- package/dist/assets/common-7uHJ3zmH.js +0 -1
- package/dist/assets/common-CAX1cGSt.js +0 -1
- package/dist/assets/common-CHoc1QIe.js +0 -1
- package/dist/assets/common-D0aOb7Q5.js +0 -1
- package/dist/assets/common-Ddol8GL_.js +0 -1
- package/dist/assets/common-wZMBJ1zd.js +0 -1
- package/dist/assets/common-xAJMRhhA.js +0 -1
- package/dist/assets/constants-C2ehd_ov.js +0 -3
- package/dist/assets/fish-BLPcAvyf.js +0 -1
- package/dist/assets/hailuo-svkcKG4q.js +0 -1
- package/dist/assets/image-CpHxi4jB.js +0 -1
- package/dist/assets/index-BcKy7BlO.js +0 -570
- package/dist/assets/isPlainObject-BAq5HH2u.js +0 -1
- package/dist/assets/raf-D3_r8guP.js +0 -1
- package/dist/assets/strings-BCTXLmYx.js +0 -1
- package/dist/assets/vendor-chart-Df3WBvr0.js +0 -5
- package/dist/assets/vendor-vue-router-9EMRKZ2R.js +0 -1
- package/dist/assets/web-5WDtFL6x.js +0 -1
- package/dist/assets/webextrator-Dy705XB6.js +0 -1
|
@@ -0,0 +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-Dd2EIHDR.js";import{n as E,t as D}from"./tabs-Iq532XbG.js";import{t as O}from"./upload-HDT7x_5o.js";import{t as k}from"./tooltip-C3PYfh8V.js";import{t as A}from"./image-dbbYkOOx.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-D67Kjcrc.js";import{t as F}from"./drawer-BvYPSxXh.js";import{n as I,r as te,t as ne}from"./dropdown-DGc8udGs.js";import{t as L}from"./input-number-BpGzQCcW.js";import{n as re,t as ie}from"./skeleton-Cn4UY-T8.js";import{t as ae}from"./slider-BHp2gKVa.js";import{t as oe}from"./switch-C6k-HtKw.js";import{On as se,di as R}from"./constants-DDcIM163.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-C16pnEK3.js";import{t as X}from"./index.es-D96NPyN9.js";import{i as Z,n as le,r as ue,t as de}from"./pagination-DThkyS9k.js";import{n as fe,t as pe}from"./NoTasks-qUri5oTo.js";import{t as me}from"./Consumption-Jipz0FdC.js";import{n as he,r as Q,t as ge}from"./Player-DnAW_Yqr.js";var _e=o({name:`LayoutProducer`,components:{ElDrawer:F,ElButton:v,FontAwesomeIcon:X},data(){return{drawer:!1,preview:!1}},computed:{}}),ve={class:`main flex flex-row flex-1`},ye={class:`config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},be={class:`result h-full flex flex-col flex-1 min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`},xe={class:`preview h-full w-[300px] flex flex-col`};function Se(t,r,a,o,s,c){let u=d(`font-awesome-icon`),m=d(`el-button`),h=d(`el-drawer`);return l(),f(`div`,ve,[n(`div`,ye,[e(t.$slots,`config`,{},void 0,!0)]),n(`div`,be,[e(t.$slots,`result`,{},void 0,!0)]),n(`div`,xe,[e(t.$slots,`preview`,{},void 0,!0)]),i(m,{circle:``,class:`menu`,onClick:r[0]||=e=>t.drawer=!0},{default:p(()=>[i(u,{icon:`fa-solid fa-magic`})]),_:1}),i(h,{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 Ce=V(_e,[[`render`,Se],[`__scopeId`,`data-v-03e2979b`]]),we=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}}),Te={class:`mb-3`},Ee={class:`flex items-center mb-1`},De={class:`text-sm font-bold`},Oe={class:`model-option`},ke={class:`model-option-name`},Ae={class:`model-option-desc`},je={key:0,class:`flex items-center justify-between mb-3`},Me={class:`flex items-center`},Ne={class:`text-sm font-bold`};function Pe(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`,Te,[n(`div`,Ee,[n(`span`,De,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`,Oe,[n(`span`,ke,c(e.label),1),n(`span`,Ae,c(e.desc),1)])]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])]),e.custom?(l(),f(`div`,je,[n(`div`,Me,[n(`span`,Ne,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 Fe=V(we,[[`render`,Pe],[`__scopeId`,`data-v-42496b9a`]]),Ie=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}}}}),Le={class:`relative`},Re={class:`flex justify-between items-center mb-2`},ze={class:`flex justify-start items-center`},Be={class:`text-sm font-bold`},Ve={key:0,class:`mb-2`},He=[`src`],Ue={key:1,class:`mt-1`};function We(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`,Le,[n(`div`,Re,[n(`div`,ze,[n(`span`,Be,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`,Ve,[n(`audio`,{src:e.audioPreviewUrl,controls:``,class:`w-full`},null,8,He)])):a(``,!0),e.hasUploadedAudio?(l(),f(`div`,Ue,[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 Ge=V(Ie,[[`render`,We],[`__scopeId`,`data-v-7fd0580a`]]),Ke=o({name:`PromptInput`,components:{PromptTextarea:fe},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 qe(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 Je=V(Ke,[[`render`,qe]]),Ye=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}}}}),Xe={class:`field`},Ze={class:`flex items-center justify-between mb-1`},Qe={class:`flex items-center`},$e={class:`text-sm font-bold`};function et(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`,Xe,[n(`div`,Ze,[n(`div`,Qe,[n(`span`,$e,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 tt=V(Ye,[[`render`,et],[`__scopeId`,`data-v-88c6da2b`]]),nt=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})}}}}),rt={class:`field`},it={class:`flex items-center justify-between mb-1`},at={class:`flex items-center`},ot={class:`text-sm font-bold`};function st(e,t,r,a,o,s){let u=d(`info-icon`),p=d(`el-input`);return l(),f(`div`,rt,[n(`div`,it,[n(`div`,at,[n(`span`,ot,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 ct=V(nt,[[`render`,st]]),lt=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})}}}}),ut={class:`field`},dt={class:`flex items-center mb-1`},ft={class:`text-sm font-bold`};function pt(e,t,r,a,o,s){let u=d(`info-icon`),p=d(`el-input`);return l(),f(`div`,ut,[n(`div`,dt,[n(`span`,ft,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 mt=V(lt,[[`render`,pt]]),ht=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})}}}),gt={class:`field`},_t={class:`box`},vt={class:`title font-bold`},yt={class:`input-wrapper`},bt={class:`task`},xt={class:`left`},St={key:2,class:`duration`},Ct={class:`info`},wt={class:`title`},Tt={class:`style`};function Et(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`,gt,[n(`div`,_t,[n(`h2`,vt,c(e.$t(`producer.name.extend`)),1),n(`div`,yt,[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`,bt,[e.audio?(l(),f(`div`,{key:0,class:`audio`,onClick:t[3]||=t=>e.onClick(e.audio)},[h((l(),f(`div`,xt,[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`,St,c(e.useFormatDuring(e.audio?.duration)),1)):a(``,!0)])),[[x,!e.audio?.audio_url]]),n(`div`,Ct,[n(`h2`,wt,c(e.audio?.title),1),n(`p`,Tt,c(e.audio?.style),1)])])):a(``,!0)])])}var Dt=V(ht,[[`render`,Et],[`__scopeId`,`data-v-26d43480`]]),Ot=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})}}}),kt={class:`field`},At={class:`box`},jt={class:`title font-bold`},Mt={class:`task`},Nt={class:`left`},Pt={key:2,class:`duration`},Ft={class:`info`},It={class:`title`},Lt={class:`style`};function Rt(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`,kt,[n(`div`,At,[n(`h2`,jt,c(e.$t(`producer.name.cover`)),1)]),n(`div`,Mt,[e.audio?(l(),f(`div`,{key:0,class:`audio`,onClick:t[2]||=t=>e.onClick(e.audio)},[h((l(),f(`div`,Nt,[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`,Pt,c(e.useFormatDuring(e.audio?.duration)),1)):a(``,!0)])),[[b,!e.audio?.audio_url]]),n(`div`,Ft,[n(`h2`,It,c(e.audio?.title),1),n(`p`,Lt,c(e.audio?.style),1)])])):a(``,!0)])])}var zt=V(Ot,[[`render`,Rt],[`__scopeId`,`data-v-d8a8e583`]]),Bt=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})}}}}),Vt={class:`mb-2`},Ht={class:`flex items-center mb-1`},Ut={class:`text-sm font-bold`};function Wt(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`,Vt,[n(`div`,Ht,[n(`span`,Ut,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 Gt=V(Bt,[[`render`,Wt]]),Kt=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})}}),qt={key:0,class:`mb-3`},Jt={class:`flex items-center mb-1`},Yt={class:`text-xs font-bold`},Xt={key:1,class:`mb-3`},Zt={class:`flex items-center mb-1`},Qt={class:`text-xs font-bold`},$t={class:`mb-3`},en={class:`flex items-center justify-between mb-1`},tn={class:`flex items-center`},nn={class:`text-xs font-bold`},rn={class:`text-xs text-[var(--el-text-color-secondary)]`},an={class:`mb-3`},on={class:`flex items-center justify-between mb-1`},sn={class:`flex items-center`},cn={class:`text-xs font-bold`},ln={class:`text-xs text-[var(--el-text-color-secondary)]`},un={key:2,class:`mb-3`},dn={class:`flex items-center justify-between mb-1`},fn={class:`flex items-center`},pn={class:`text-xs font-bold`},mn={class:`text-xs text-[var(--el-text-color-secondary)]`},hn={class:`mb-3`},gn={class:`flex items-center mb-1`},_n={class:`text-xs font-bold`};function vn(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`,qt,[n(`div`,Jt,[n(`span`,Yt,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`,Xt,[n(`div`,Zt,[n(`span`,Qt,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`,$t,[n(`div`,en,[n(`div`,tn,[n(`span`,nn,c(e.$t(`producer.name.weirdness`)),1),i(h,{content:e.$t(`producer.description.weirdness`)},null,8,[`content`])]),n(`span`,rn,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`,an,[n(`div`,on,[n(`div`,sn,[n(`span`,cn,c(e.$t(`producer.name.soundStrength`)),1),i(h,{content:e.$t(`producer.description.soundStrength`)},null,8,[`content`])]),n(`span`,ln,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`,un,[n(`div`,dn,[n(`div`,fn,[n(`span`,pn,c(e.$t(`producer.name.lyricsStrength`)),1),i(h,{content:e.$t(`producer.description.lyricsStrength`)},null,8,[`content`])]),n(`span`,mn,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`,hn,[n(`div`,gn,[n(`span`,_n,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 yn=V(Kt,[[`render`,vn],[`__scopeId`,`data-v-f9296888`]]),bn=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`})}}}),xn={class:`field`},Sn={class:`flex items-center mb-2`},Cn={class:`text-sm font-bold m-0`},wn={key:0,class:`task mb-2`},Tn={class:`left relative w-[50px] h-[50px] mr-3 flex-shrink-0`},En={class:`info flex-1 min-w-0`},Dn={class:`text-sm font-bold m-0 truncate`},On={class:`text-xs text-[var(--el-text-color-secondary)] m-0 truncate`},kn={class:`flex gap-2`};function An(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`,xn,[n(`div`,Sn,[n(`h2`,Cn,c(e.$t(`producer.name.replaceSection`)),1),i(p,{content:e.$t(`producer.description.replaceSection`)},null,8,[`content`])]),e.audio?(l(),f(`div`,wn,[n(`div`,{class:`audio flex items-center`,onClick:t[0]||=t=>e.onClick(e.audio)},[h((l(),f(`div`,Tn,[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`,En,[n(`h2`,Dn,c(e.audio?.title),1),n(`p`,On,c(e.audio?.style),1)])])])):a(``,!0),n(`div`,kn,[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 jn=o({name:`PresetPanel`,components:{TypeSelector:Fe,PromptInput:Je,LyricInput:tt,StyleInput:ct,TitleInput:mt,ExtendFromInput:Dt,CoverFromInput:zt,UploadAudio:Ge,VocalGenderSelector:Gt,AdvancedParams:yn,ReplaceSectionInput:V(bn,[[`render`,An]]),FontAwesomeIcon:X,ElButton:v,ElTabs:E,ElTabPane:D,Consumption:me},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})}}}),Mn={class:`flex flex-col h-full`},Nn={class:`flex-1 overflow-y-auto p-5`},Pn={class:`pt-2 px-1`},Fn={class:`pt-2 px-1`},In={class:`flex flex-col items-center justify-center px-5 pb-5 gap-2`},Ln={class:`flex gap-2 w-full`};function Rn(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`,Mn,[n(`div`,Nn,[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`,Pn,[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`,Fn,[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`,In,[i(k,{value:e.consumption,service:e.service},null,8,[`value`,`service`]),n(`div`,Ln,[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 zn=V(jn,[[`render`,Rn],[`__scopeId`,`data-v-4a4b209e`]]),Bn=he(),Vn=R(`producer`),Hn=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:ue},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,Bn.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:Vn},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})}}}),Un={class:`task`},Wn=[`onClick`],Gn={class:`left`},Kn=[`onClick`],qn=[`onClick`],Jn={key:2,class:`duration`},Yn={class:`info`},Xn={class:`title`},Zn={class:`style`},Qn={class:`right`},$n={class:`el-dropdown-link`},er={class:`flex items-center min-w-[120px]`},tr={class:`flex items-center min-w-[120px]`},nr={class:`el-dropdown-link`};function rr(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`,Un,[(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`,Gn,[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,Kn)):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,qn)):a(``,!0),o?.duration?(l(),f(`div`,Jn,c(e.useFormatDuring(o?.duration)),1)):a(``,!0)])),[[M,!o?.audio_url]]),n(`div`,Yn,[n(`h2`,Xn,c(o?.title),1),n(`p`,Zn,c(o?.style),1)]),n(`div`,Qn,[i(A,null,{dropdown:p(()=>[i(k,null,{default:p(()=>[i(O,{disabled:e.isFetchingVideoUrl,onClick:t=>e.handleVideoDownload(o)},{default:p(()=>[n(`div`,er,[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`,tr,[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`,$n,[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`,nr,[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,Wn))),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 ir=o({name:`RecentPanel`,components:{ElSkeletonItem:re,ElSkeleton:ie,TaskPreview:V(Hn,[[`render`,rr]]),Player:ge,NoTasks:pe,ScrollList:le},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?.()}}}),ar={key:0,class:`tasks`},or={class:`left w-[70px] p-[10px] flex items-center`},sr={class:`main w-[calc(100%-70px)] flex-1 p-[10px]`},$={key:2,class:`w-full flex-1 flex items-center justify-center`},cr={class:`h-20`};function lr(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`,ar,[(l(),f(g,null,s(3,e=>n(`div`,{key:e,class:`flex`},[n(`div`,or,[i(y,{animated:``},{template:p(()=>[i(v,{variant:`image`,class:`avatar w-[50px] h-[50px]`})]),_:1})]),n(`div`,sr,[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`,$,[i(S)])):a(``,!0),h(n(`div`,cr,[i(C,{namespace:`producer`})],512),[[u,!!e.$store?.state?.producer?.audio?.object]])],64)}var ur=V(ir,[[`render`,lr]]),dr=o({name:`TaskPreview`,components:{IconPicture:C,ElImage:A,ElAvatar:j,ElIcon:S},computed:{audio(){return this.$store.state.producer?.audio}}}),fr={key:0,class:`size-full overflow-hidden`},pr={class:`relative h-[300px]`},mr={class:`flex items-center justify-center size-full bg-[var(--el-bg-color)]`},hr={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`},gr={class:`p-4`},_r={class:`flex items-center font-bold mb-2`},vr={class:`text-[var(--el-text-color-regular)] mb-2`},yr={class:`text-xs text-[var(--el-text-color-regular)]`},br={class:`mt-4 text-sm leading-[25px] whitespace-pre-wrap`},xr={key:1,class:`w-full h-full`};function Sr(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`,fr,[n(`div`,pr,[i(h,{src:e.audio.image_url,fit:`cover`,class:`size-full`},{error:p(()=>[n(`div`,mr,[i(m,{class:`text-3xl`},{default:p(()=>[i(u)]),_:1})])]),_:1},8,[`src`]),n(`h2`,hr,c(e.audio?.title),1)]),n(`div`,gr,[n(`div`,_r,[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`,vr,c(e.audio?.style),1),n(`p`,yr,c(e.$dayjs.format(e.audio?.created_at)),1),n(`div`,br,[n(`p`,null,c(e.audio?.lyric),1)])])])):(l(),f(`div`,xr))}var Cr=V(dr,[[`render`,Sr]]),wr=R(`producer`),Tr=o({name:`ProducerIndex`,components:{Layout:Ce,ConfigPanel:zn,RecentPanel:ur,PreviewPanel:Cr},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 de({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:wr},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 Er(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 Dr=V(Tr,[[`render`,Er],[`__scopeId`,`data-v-a766e27a`]]);export{Dr as default};
|
|
@@ -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,tt as h,ut as g,v as _,x as v,y}from"./vendor-chart-Df3WBvr0.js";import{t as b}from"./button-Diu_mJ2H.js";import{F as x,X as S,Y as C,tt as w,z as T}from"./use-deprecated-BhaeS12t.js";import{r as E,t as D}from"./select-DWNgO63K.js";import{n as O,t as k}from"./tabs-BkSGzV77.js";import{n as A,t as j}from"./form-BlaCq7xv.js";import{t as M}from"./upload-BrKQUZi2.js";import{t as N}from"./tooltip-hII4wDEz.js";import{t as P}from"./image-CpHxi4jB.js";import{t as F}from"./avatar-D6ktPryp.js";import{t as I}from"./checkbox-CC_Z1s1v.js";import{n as L,r as R,t as ee}from"./radio-ClH7NqRe.js";import{n as te,t as ne}from"./collapse-CIptIyBk.js";import{t as z}from"./drawer-B42T8GMw.js";import{n as B,r as V,t as re}from"./dropdown-Cl5vU9EC.js";import{t as H}from"./input-number-CC70lFIw.js";import{t as ie}from"./popover-BkK_L9t6.js";import{t as ae}from"./progress-D3pXGVL9.js";import{n as oe,t as se}from"./skeleton-Cc4nM_v1.js";import{t as ce}from"./slider-DC2TXYno.js";import{t as le}from"./switch-DVJS8YtM.js";import{Yr as U,hn as ue}from"./constants-C2ehd_ov.js";import{Dt as de,E as W,Er as G,Mt as fe,Nn as pe,Nr as K,On as me,Ot as he,Tr as q,gr as J,kr as Y,kt as ge,tn as X,yr as _e}from"./index-BcKy7BlO.js";import{t as Z}from"./index.es-BkuxA5W8.js";import{i as Q,n as ve,r as ye,t as be}from"./pagination-CnFr2BK-.js";import{n as xe,t as Se}from"./NoTasks-8I8Kf6PS.js";import{t as Ce}from"./Consumption-Doupb3lK.js";import{n as we,r as $,t as Te}from"./Player-Cq-jFeS-.js";var Ee=s({name:`LayoutSuno`,components:{ElDrawer:z,ElButton:b,FontAwesomeIcon:Z},data(){return{drawer:!1,preview:!1}},computed:{}}),De={class:`main flex flex-row flex-1`},Oe={class:`config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},ke={class:`result h-full flex flex-col flex-1 min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`},Ae={class:`preview h-full w-[300px] flex flex-col`};function je(t,n,i,o,s,c){let l=f(`font-awesome-icon`),d=f(`el-button`),h=f(`el-drawer`);return u(),p(`div`,De,[r(`div`,Oe,[e(t.$slots,`config`,{},void 0,!0)]),r(`div`,ke,[e(t.$slots,`result`,{},void 0,!0)]),r(`div`,Ae,[e(t.$slots,`preview`,{},void 0,!0)]),a(d,{circle:``,class:`menu`,onClick:n[0]||=e=>t.drawer=!0},{default:m(()=>[a(l,{icon:`fa-solid fa-magic`})]),_:1}),a(h,{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 Me=W(Ee,[[`render`,je],[`__scopeId`,`data-v-abe843c9`]]),Ne=s({name:`TypeSelector`,components:{ElSelect:E,ElOption:D,ElSwitch:le},data(){return{options:[{label:`v5.5`,value:`chirp-v5-5`,desc:this.$t(`suno.model.v55desc`)},{label:`v5`,value:`chirp-v5`,desc:this.$t(`suno.model.v5desc`)},{label:`v4.5+`,value:`chirp-v4-5-plus`,desc:this.$t(`suno.model.v45plusdesc`)},{label:`v4.5`,value:`chirp-v4-5`,desc:this.$t(`suno.model.v45desc`),dividerAfter:!0},{label:`v4`,value:`chirp-v4`,desc:this.$t(`suno.model.v4desc`)},{label:`v3.5`,value:`chirp-v3-5`,desc:this.$t(`suno.model.v35desc`)},{label:`v3`,value:`chirp-v3-0`,desc:this.$t(`suno.model.v3desc`)}]}},computed:{custom:{get(){return this.$store.state.suno?.config?.custom||!1},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,custom:e})}},instrumental:{get(){return this.$store.state.suno?.config?.instrumental||!1},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,instrumental:e})}},model:{get(){return this.$store.state.suno?.config?.model},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,model:e})}}},mounted(){this.model||=ue}}),Pe={class:`mb-3`},Fe={class:`flex items-center mb-1`},Ie={class:`text-sm font-bold`},Le={class:`model-option`},Re={class:`model-option-left`},ze={class:`model-option-name`},Be={class:`model-option-desc`},Ve={key:0,class:`flex items-center justify-between mb-3`},He={class:`text-sm font-bold`};function Ue(e,i,s,d,h,g){let _=f(`el-option`),y=f(`el-select`),b=f(`el-switch`);return u(),p(`div`,null,[r(`div`,Pe,[r(`div`,Fe,[r(`span`,Ie,l(e.$t(`suno.name.model`)),1)]),a(y,{modelValue:e.model,"onUpdate:modelValue":i[0]||=t=>e.model=t,class:`w-full model-select`,size:`default`,placeholder:e.$t(`suno.placeholder.select`)},{default:m(()=>[(u(!0),p(v,null,c(e.options,e=>(u(),n(_,{key:e.value,label:e.label,value:e.value,class:t({"model-option-divider":e.dividerAfter})},{default:m(()=>[r(`div`,Le,[r(`div`,Re,[r(`span`,ze,l(e.label),1)]),r(`span`,Be,l(e.desc),1)])]),_:2},1032,[`label`,`value`,`class`]))),128))]),_:1},8,[`modelValue`,`placeholder`])]),e.custom?(u(),p(`div`,Ve,[r(`span`,He,l(e.$t(`suno.name.instrumental`)),1),a(b,{modelValue:e.instrumental,"onUpdate:modelValue":i[1]||=t=>e.instrumental=t},null,8,[`modelValue`])])):o(``,!0)])}var We=W(Ne,[[`render`,Ue],[`__scopeId`,`data-v-16e4d6fc`]]),Ge=s({name:`UploadAudio`,components:{ElUpload:M,ElButton:b,ElDialog:Y,ElTabs:O,ElTabPane:k,InfoIcon:Q,FontAwesomeIcon:Z,ElRadioGroup:R,ElRadioButton:L},mixins:[he],emits:[`change`],data(){return{fileList:[],uploadUrl:_e()+`/api/v1/files/`,dialogVisible:!1,activeTab:`browse`,recording:!1,recordedBlob:null,recordedAudioUrl:null,audioPreviewUrl:null,recordTimer:null,recordSeconds:0,mediaRecorder:null,mediaStream:null,recordedChunks:[],uploadingRecord:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},credential(){return this.$store.state.suno.credential},config(){return this.$store.state.suno.config},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.suno?.config?.audio_id},set(){}},hasUploadedAudio(){let e=this.$store.state.suno?.config?.action;return e===`upload_extend`||e===`upload_cover`},uploadAction:{get(){return this.$store.state.suno?.config?.action||`upload_extend`},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,action:e})}},formattedTime(){return`${Math.floor(this.recordSeconds/60).toString().padStart(2,`0`)}:${(this.recordSeconds%60).toString().padStart(2,`0`)}`}},watch:{urls:{handler(e){this.$emit(`change`,e)}}},beforeUnmount(){this.cleanupRecording()},methods:{onExceed(){G.warning(this.$t(`suno.message.uploadReferencesExceed`))},onError(){G.error(this.$t(`suno.message.uploadReferencesError`))},async onBrowseSuccess(){let e=this.urls?.[0];e&&(this.audioPreviewUrl=e,await this.onGenerateAudioId(e),this.dialogVisible=!1)},async onGenerateAudioId(e){let t={audio_url:e},n=this.credential?.token;if(!n){console.error(`no token specified`);return}G.info(this.$t(`suno.message.startingUploadAudio`));try{let e=await X.upload(t,{token:n});console.debug(`get upload music success`,e.data);let r=e.data?.data.audio_id;this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,audio_id:r,action:`upload_extend`}),G.success(this.$t(`suno.message.startUploadAudioSuccess`))}catch(e){G.error(e?.response?.data?.error?.message||this.$t(`suno.message.startUploadAudioFailed`))}},async startRecording(){if(!navigator.mediaDevices?.getUserMedia||typeof MediaRecorder>`u`){G.error(this.$t(`suno.message.recordingUnsupported`));return}try{this.mediaStream=await navigator.mediaDevices.getUserMedia({audio:!0}),this.recordedChunks=[],this.mediaRecorder=new MediaRecorder(this.mediaStream),this.mediaRecorder.ondataavailable=e=>{e.data&&e.data.size>0&&this.recordedChunks.push(e.data)},this.mediaRecorder.onstop=()=>{let e=new Blob(this.recordedChunks,{type:`audio/webm`});this.recordedBlob=e,this.recordedAudioUrl&&URL.revokeObjectURL(this.recordedAudioUrl),this.recordedAudioUrl=URL.createObjectURL(e),this.releaseStream()},this.mediaRecorder.start(),this.recording=!0,this.recordSeconds=0,this.recordTimer=window.setInterval(()=>{this.recordSeconds+=1,this.recordSeconds>=600&&this.stopRecording()},1e3)}catch(e){console.error(`record error`,e),G.error(this.$t(`suno.message.recordingPermissionDenied`))}},stopRecording(){this.recordTimer&&=(window.clearInterval(this.recordTimer),null),this.mediaRecorder&&this.mediaRecorder.state!==`inactive`&&this.mediaRecorder.stop(),this.recording=!1},resetRecording(){this.recordedAudioUrl&&URL.revokeObjectURL(this.recordedAudioUrl),this.recordedBlob=null,this.recordedAudioUrl=null,this.recordSeconds=0},async uploadRecording(){if(this.recordedBlob){this.uploadingRecord=!0;try{let e=new FormData,t=`recording-${Date.now()}.webm`;e.append(`file`,this.recordedBlob,t);let n=await fetch(this.uploadUrl,{method:`POST`,headers:{Authorization:`Bearer ${this.$store.state.token.access}`},body:e});if(!n.ok)throw Error(`upload failed: ${n.status}`);let r=await n.json(),i=r?.file_url||r?.data?.file_url;if(!i)throw Error(`no file_url in response`);this.audioPreviewUrl=i,await this.onGenerateAudioId(i),this.dialogVisible=!1,this.resetRecording()}catch(e){console.error(e),G.error(e?.message||this.$t(`suno.message.uploadReferencesError`))}finally{this.uploadingRecord=!1}}},releaseStream(){this.mediaStream&&=(this.mediaStream.getTracks().forEach(e=>e.stop()),null)},cleanupRecording(){this.recordTimer&&=(window.clearInterval(this.recordTimer),null),this.releaseStream(),this.recordedAudioUrl&&=(URL.revokeObjectURL(this.recordedAudioUrl),null)}}}),Ke={class:`relative`},qe={class:`flex justify-between items-center mb-2`},Je={class:`flex justify-start items-center`},Ye={class:`text-sm font-bold`},Xe={key:0,class:`mb-2`},Ze=[`src`],Qe={key:1,class:`mt-2`},$e={class:`py-4`},et={class:`text-center py-6`},tt={class:`text-sm`},nt={class:`text-xs text-gray-400 mt-1`},rt={class:`py-4 text-center`},it={class:`recorder-display mb-4`},at={key:0,class:`text-red-500 flex items-center justify-center gap-2`},ot={class:`text-2xl font-mono`},st={key:1,class:`text-green-600`},ct={key:2,class:`text-gray-400 text-2xl font-mono`},lt={key:0,class:`mb-4`},ut=[`src`],dt={class:`flex justify-center gap-3`};function ft(e,t,s,c,d,h){let g=f(`info-icon`),_=f(`font-awesome-icon`),y=f(`el-button`),b=f(`el-radio-button`),x=f(`el-radio-group`),S=f(`el-upload`),C=f(`el-tab-pane`),w=f(`el-tabs`),T=f(`el-dialog`);return u(),p(`div`,Ke,[r(`div`,qe,[r(`div`,Je,[r(`span`,Ye,l(e.$t(`suno.name.referenceAudios`)),1),a(g,{content:e.$t(`suno.description.uploadAudios`)},null,8,[`content`])]),a(y,{round:``,type:`primary`,size:`small`,onClick:t[0]||=t=>e.dialogVisible=!0},{default:m(()=>[a(_,{icon:`fa-solid fa-plus`,class:`icon mr-1`}),i(` `+l(e.$t(`suno.button.addAudio`)),1)]),_:1})]),e.audioPreviewUrl?(u(),p(`div`,Xe,[r(`audio`,{src:e.audioPreviewUrl,controls:``,class:`w-full`},null,8,Ze)])):o(``,!0),e.hasUploadedAudio?(u(),p(`div`,Qe,[a(x,{modelValue:e.uploadAction,"onUpdate:modelValue":t[1]||=t=>e.uploadAction=t,size:`small`},{default:m(()=>[a(b,{value:`upload_extend`},{default:m(()=>[i(l(e.$t(`suno.button.extend`)),1)]),_:1}),a(b,{value:`upload_cover`},{default:m(()=>[i(l(e.$t(`suno.button.upload_cover`)),1)]),_:1})]),_:1},8,[`modelValue`])])):o(``,!0),a(T,{modelValue:e.dialogVisible,"onUpdate:modelValue":t[4]||=t=>e.dialogVisible=t,title:e.$t(`suno.name.addAudio`),width:`520px`,"close-on-click-modal":!1,"append-to-body":``},{default:m(()=>[a(w,{modelValue:e.activeTab,"onUpdate:modelValue":t[3]||=t=>e.activeTab=t,class:`add-audio-tabs`},{default:m(()=>[a(C,{name:`browse`,label:e.$t(`suno.tab.browse`)},{default:m(()=>[r(`div`,$e,[a(S,{"file-list":e.fileList,"onUpdate:fileList":t[2]||=t=>e.fileList=t,name:`file`,limit:1,class:`upload-wrapper`,action:e.uploadUrl,accept:`.mp3,.wav,.m4a,audio/*`,"show-file-list":!0,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onBrowseSuccess,headers:e.headers,drag:``},{default:m(()=>[r(`div`,et,[a(_,{icon:`fa-solid fa-upload`,class:`text-4xl text-gray-400 mb-3`}),r(`div`,tt,l(e.$t(`suno.description.dropAudioHere`)),1),r(`div`,nt,l(e.$t(`suno.description.audioFormats`)),1)])]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])]),_:1},8,[`label`]),a(C,{name:`record`,label:e.$t(`suno.tab.record`)},{default:m(()=>[r(`div`,rt,[r(`div`,it,[e.recording?(u(),p(`div`,at,[t[5]||=r(`span`,{class:`recording-dot`},null,-1),r(`span`,ot,l(e.formattedTime),1)])):e.recordedBlob?(u(),p(`div`,st,[a(_,{icon:`fa-solid fa-check-circle`,class:`text-2xl mr-2`}),r(`span`,null,l(e.$t(`suno.message.recordingReady`))+` (`+l(e.formattedTime)+`)`,1)])):(u(),p(`div`,ct,`00:00`))]),e.recordedAudioUrl&&!e.recording?(u(),p(`div`,lt,[r(`audio`,{src:e.recordedAudioUrl,controls:``,class:`w-full`},null,8,ut)])):o(``,!0),r(`div`,dt,[!e.recording&&!e.recordedBlob?(u(),n(y,{key:0,type:`primary`,round:``,onClick:e.startRecording},{default:m(()=>[a(_,{icon:`fa-solid fa-microphone`,class:`mr-1`}),i(` `+l(e.$t(`suno.button.startRecord`)),1)]),_:1},8,[`onClick`])):o(``,!0),e.recording?(u(),n(y,{key:1,type:`danger`,round:``,onClick:e.stopRecording},{default:m(()=>[a(_,{icon:`fa-solid fa-stop`,class:`mr-1`}),i(` `+l(e.$t(`suno.button.stopRecord`)),1)]),_:1},8,[`onClick`])):o(``,!0),e.recordedBlob&&!e.recording?(u(),p(v,{key:2},[a(y,{round:``,onClick:e.resetRecording},{default:m(()=>[a(_,{icon:`fa-solid fa-rotate-left`,class:`mr-1`}),i(` `+l(e.$t(`suno.button.reRecord`)),1)]),_:1},8,[`onClick`]),a(y,{type:`primary`,round:``,loading:e.uploadingRecord,onClick:e.uploadRecording},{default:m(()=>[a(_,{icon:`fa-solid fa-upload`,class:`mr-1`}),i(` `+l(e.$t(`suno.button.useRecording`)),1)]),_:1},8,[`loading`,`onClick`])],64)):o(``,!0)])])]),_:1},8,[`label`])]),_:1},8,[`modelValue`])]),_:1},8,[`modelValue`,`title`])])}var pt=W(Ge,[[`render`,ft],[`__scopeId`,`data-v-5f17a1f4`]]),mt=[{key:`lofi`,label:`🎧 Lo-fi Chill`,prompt:`a relaxing lo-fi hip hop beat for studying`},{key:`pop-love`,label:`💕 Pop Love Song`,prompt:`a catchy pop love song with sweet melodies`},{key:`rock-anthem`,label:`🎸 Rock Anthem`,prompt:`an energetic rock anthem with electric guitars`},{key:`jazz-night`,label:`🎷 Jazz Night`,prompt:`a smooth late-night jazz piece with saxophone`},{key:`edm-drop`,label:`⚡ EDM Drop`,prompt:`an intense EDM track with a massive drop`},{key:`folk-story`,label:`🪕 Folk Story`,prompt:`a warm folk song telling a story about traveling`},{key:`rnb-groove`,label:`🎤 R&B Groove`,prompt:`a smooth R&B groove with soulful vocals`},{key:`classical`,label:`🎻 Classical`,prompt:`an elegant classical piece for orchestra`},{key:`hip-hop`,label:`🎤 Hip Hop`,prompt:`a hard-hitting hip hop beat with bass`},{key:`country`,label:`🤠 Country`,prompt:`an upbeat country song with acoustic guitar and banjo`},{key:`reggae`,label:`🌴 Reggae`,prompt:`a laid-back reggae tune with island vibes`},{key:`latin`,label:`💃 Latin`,prompt:`a vibrant Latin dance track with percussion`},{key:`ambient`,label:`🌊 Ambient`,prompt:`a dreamy ambient soundscape for relaxation`},{key:`metal`,label:`🤘 Metal`,prompt:`a powerful metal song with heavy riffs and double bass drums`},{key:`soul`,label:`🎵 Soul`,prompt:`a heartfelt soul ballad with gospel harmonies`},{key:`synthwave`,label:`🌃 Synthwave`,prompt:`a retro synthwave track with 80s vibes`},{key:`kpop`,label:`🇰🇷 K-Pop`,prompt:`a catchy K-pop dance track with hook`},{key:`lullaby`,label:`🌙 Lullaby`,prompt:`a gentle lullaby for bedtime with soft piano`},{key:`cinematic`,label:`🎬 Cinematic`,prompt:`an epic cinematic orchestral score for a movie trailer`},{key:`blues`,label:`🎸 Blues`,prompt:`a soulful blues song with electric guitar bends`},{key:`disco`,label:`🕺 Disco`,prompt:`a funky disco track with groovy bassline`},{key:`punk`,label:`🔥 Punk Rock`,prompt:`a fast punk rock song with raw energy`},{key:`gospel`,label:`⛪ Gospel`,prompt:`an uplifting gospel choir song with piano`},{key:`trap`,label:`🔊 Trap`,prompt:`a dark trap beat with 808s and hi-hats`},{key:`bossa`,label:`☕ Bossa Nova`,prompt:`a gentle bossa nova with nylon guitar`},{key:`indie`,label:`🎶 Indie`,prompt:`a dreamy indie track with ethereal vocals`},{key:`cpop`,label:`🇨🇳 C-Pop`,prompt:`a beautiful Chinese pop ballad with emotional vocals`},{key:`jpop`,label:`🇯🇵 J-Pop`,prompt:`a cheerful J-pop song with anime vibes`},{key:`afrobeat`,label:`🥁 Afrobeat`,prompt:`a groovy Afrobeat track with layered percussion`},{key:`game`,label:`🎮 Game BGM`,prompt:`an adventurous video game background music`}],ht=8;function gt(e){let t=[...e];for(let e=t.length-1;e>0;e--){let n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}return t}var _t=s({name:`PromptInput`,components:{FontAwesomeIcon:Z,PromptTextarea:xe},data(){return{shuffledTags:gt(mt)}},computed:{prompt:{get(){return this.$store.state.suno?.config?.prompt},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,prompt:e})}},visibleTags(){return this.shuffledTags.slice(0,ht)}},mounted(){this.prompt||=``},methods:{onTagClick(e){this.prompt=e.prompt},onRefreshTags(){this.shuffledTags=gt(mt)}}}),vt={class:`inspo-tags`},yt=[`onClick`];function bt(e,t,i,o,s,d){let h=f(`font-awesome-icon`),g=f(`prompt-textarea`);return u(),n(g,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||=t=>e.prompt=t,title:e.$t(`suno.name.songDescription`),info:e.$t(`suno.description.prompt`),placeholder:e.$t(`suno.placeholder.prompt`),"min-rows":5,"max-rows":14},{after:m(()=>[r(`div`,vt,[(u(!0),p(v,null,c(e.visibleTags,t=>(u(),p(`button`,{key:t.key,class:`inspo-tag`,onClick:n=>e.onTagClick(t)},l(t.label),9,yt))),128)),r(`button`,{class:`inspo-tag inspo-tag-refresh`,onClick:t[0]||=(...t)=>e.onRefreshTags&&e.onRefreshTags(...t)},[a(h,{icon:`fa-solid fa-arrows-rotate`})])])]),_:1},8,[`modelValue`,`title`,`info`,`placeholder`])}var xt=W(_t,[[`render`,bt],[`__scopeId`,`data-v-58ffcd38`]]),St=s({name:`LyricInput`,components:{ElInput:K,ElButton:b,ElTooltip:N,ElDialog:Y,FontAwesomeIcon:Z,InfoIcon:Q},data(){return{generatingLyrics:!1,enhancingLyrics:!1,enhancePrompt:``,lyricHistory:[],expanded:!1}},computed:{lyric:{get(){return this.$store.state.suno?.config?.lyric},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,lyric:e})}},config(){return this.$store.state.suno?.config},credential(){return this.$store.state.suno?.credential}},mounted(){this.lyric||=``},methods:{pushHistory(){this.lyric&&(this.lyricHistory.push(this.lyric),this.lyricHistory.length>20&&this.lyricHistory.shift())},onUndo(){let e=this.lyricHistory.pop();e!==void 0&&(this.lyric=e)},onClear(){this.pushHistory(),this.lyric=``},async onEnhanceLyrics(){let e=this.credential?.token;if(!(!e||!this.lyric||!this.enhancePrompt)){this.pushHistory(),this.enhancingLyrics=!0,G.info(this.$t(`suno.message.enhancingLyrics`));try{let t=`${this.enhancePrompt}\n\nOriginal lyrics:\n${this.lyric}`,n=(await X.lyric({prompt:t},{token:e})).data?.data;n?.text&&(this.lyric=n.text,this.enhancePrompt=``,G.success(this.$t(`suno.message.enhanceLyricsSuccess`)))}catch{G.error(this.$t(`suno.message.enhanceLyricsFailed`))}finally{this.enhancingLyrics=!1}}},async onGenerateLyrics(){let e=this.credential?.token;if(!e)return;let t;try{t=((await q.prompt(this.$t(`suno.message.lyricsThemePromptMessage`),this.$t(`suno.message.lyricsThemePromptTitle`),{confirmButtonText:this.$t(`common.button.confirm`),cancelButtonText:this.$t(`common.button.cancel`),inputPlaceholder:this.$t(`suno.placeholder.lyricsTheme`),inputValue:this.config?.title||``,inputType:`textarea`,inputValidator:e=>typeof e==`string`&&e.trim().length>0||this.$t(`suno.message.lyricsThemeRequired`)})).value||``).trim()}catch{return}if(t){this.pushHistory(),this.generatingLyrics=!0,G.info(this.$t(`suno.message.generatingLyrics`));try{let n=(await X.lyric({prompt:t},{token:e})).data?.data;n?.text&&(this.lyric=n.text,n?.title&&!this.config?.title&&this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,lyric:n.text,title:n.title}),G.success(this.$t(`suno.message.generateLyricsSuccess`)))}catch{G.error(this.$t(`suno.message.generateLyricsFailed`))}finally{this.generatingLyrics=!1}}}}}),Ct={class:`field`},wt={class:`flex items-center justify-between mb-1`},Tt={class:`flex items-center`},Et={class:`text-sm font-bold`},Dt={class:`flex items-center gap-1`},Ot={class:`relative`},kt={class:`text-xs text-right text-[var(--el-text-color-secondary)] mt-1`},At={key:0,class:`enhance-bar`},jt={key:0,class:`enhance-bar mt-3`},Mt={class:`flex items-center justify-between`},Nt={class:`flex items-center gap-1`};function Pt(e,t,s,c,d,h){let g=f(`info-icon`),v=f(`font-awesome-icon`),y=f(`el-button`),b=f(`el-tooltip`),x=f(`el-input`),S=f(`el-dialog`);return u(),p(`div`,Ct,[r(`div`,wt,[r(`div`,Tt,[r(`span`,Et,l(e.$t(`suno.name.lyrics`)),1),a(g,{content:e.$t(`suno.description.lyrics`)},null,8,[`content`])]),r(`div`,Dt,[e.lyricHistory.length>0?(u(),n(b,{key:0,content:e.$t(`suno.button.undo`),placement:`top`},{default:m(()=>[a(y,{size:`small`,circle:``,onClick:e.onUndo},{default:m(()=>[a(v,{icon:`fa-solid fa-rotate-left`})]),_:1},8,[`onClick`])]),_:1},8,[`content`])):o(``,!0),e.lyric?(u(),n(b,{key:1,content:e.$t(`suno.button.clear_lyrics`),placement:`top`},{default:m(()=>[a(y,{size:`small`,circle:``,onClick:e.onClear},{default:m(()=>[a(v,{icon:`fa-solid fa-eraser`})]),_:1},8,[`onClick`])]),_:1},8,[`content`])):o(``,!0),a(b,{content:e.$t(`suno.button.expand_lyrics`),placement:`top`},{default:m(()=>[a(y,{size:`small`,circle:``,onClick:t[0]||=t=>e.expanded=!0},{default:m(()=>[a(v,{icon:`fa-solid fa-expand`})]),_:1})]),_:1},8,[`content`]),e.config?.action===`extend`?o(``,!0):(u(),n(y,{key:2,size:`small`,loading:e.generatingLyrics,round:``,onClick:e.onGenerateLyrics},{default:m(()=>[e.generatingLyrics?o(``,!0):(u(),n(v,{key:0,icon:`fa-solid fa-wand-magic-sparkles`,class:`mr-1`})),i(` `+l(e.$t(`suno.button.generate_lyrics`)),1)]),_:1},8,[`loading`,`onClick`]))])]),r(`div`,Ot,[e.config?.action===`extend`?(u(),n(x,{key:1,modelValue:e.lyric,"onUpdate:modelValue":t[2]||=t=>e.lyric=t,rows:5,type:`textarea`,class:`lyrics`,placeholder:e.$t(`suno.placeholder.extend.lyrics`)},null,8,[`modelValue`,`placeholder`])):(u(),n(x,{key:0,modelValue:e.lyric,"onUpdate:modelValue":t[1]||=t=>e.lyric=t,rows:5,type:`textarea`,class:`lyrics`,placeholder:e.$t(`suno.placeholder.lyrics`)},null,8,[`modelValue`,`placeholder`])),r(`div`,kt,l(e.lyric?.length||0)+`/5000`,1)]),e.lyric&&e.config?.action!==`extend`?(u(),p(`div`,At,[a(x,{modelValue:e.enhancePrompt,"onUpdate:modelValue":t[3]||=t=>e.enhancePrompt=t,size:`small`,placeholder:e.$t(`suno.placeholder.enhanceLyrics`),class:`enhance-input`,onKeyup:_(e.onEnhanceLyrics,[`enter`])},{append:m(()=>[a(y,{loading:e.enhancingLyrics,onClick:e.onEnhanceLyrics},{default:m(()=>[e.enhancingLyrics?o(``,!0):(u(),n(v,{key:0,icon:`fa-solid fa-wand-magic-sparkles`,class:`mr-1`})),i(` `+l(e.$t(`suno.button.enhance_lyrics`)),1)]),_:1},8,[`loading`,`onClick`])]),_:1},8,[`modelValue`,`placeholder`,`onKeyup`])])):o(``,!0),a(S,{modelValue:e.expanded,"onUpdate:modelValue":t[7]||=t=>e.expanded=t,title:e.$t(`suno.name.lyrics`),width:`720px`,top:`5vh`,"close-on-click-modal":!1,class:`lyrics-expand-dialog`},{footer:m(()=>[r(`div`,Mt,[r(`div`,Nt,[e.lyricHistory.length>0?(u(),n(y,{key:0,size:`small`,onClick:e.onUndo},{default:m(()=>[a(v,{icon:`fa-solid fa-rotate-left`,class:`mr-1`}),i(` `+l(e.$t(`suno.button.undo`)),1)]),_:1},8,[`onClick`])):o(``,!0),e.lyric?(u(),n(y,{key:1,size:`small`,onClick:e.onClear},{default:m(()=>[a(v,{icon:`fa-solid fa-eraser`,class:`mr-1`}),i(` `+l(e.$t(`suno.button.clear_lyrics`)),1)]),_:1},8,[`onClick`])):o(``,!0),e.config?.action===`extend`?o(``,!0):(u(),n(y,{key:2,size:`small`,loading:e.generatingLyrics,onClick:e.onGenerateLyrics},{default:m(()=>[e.generatingLyrics?o(``,!0):(u(),n(v,{key:0,icon:`fa-solid fa-wand-magic-sparkles`,class:`mr-1`})),i(` `+l(e.$t(`suno.button.generate_lyrics`)),1)]),_:1},8,[`loading`,`onClick`]))]),a(y,{type:`primary`,onClick:t[6]||=t=>e.expanded=!1},{default:m(()=>[i(l(e.$t(`common.button.confirm`)),1)]),_:1})])]),default:m(()=>[a(x,{modelValue:e.lyric,"onUpdate:modelValue":t[4]||=t=>e.lyric=t,type:`textarea`,rows:20,class:`lyrics-expanded`,placeholder:e.$t(`suno.placeholder.lyrics`),autofocus:``},null,8,[`modelValue`,`placeholder`]),e.config?.action===`extend`?o(``,!0):(u(),p(`div`,jt,[a(x,{modelValue:e.enhancePrompt,"onUpdate:modelValue":t[5]||=t=>e.enhancePrompt=t,size:`small`,placeholder:e.$t(`suno.placeholder.enhanceLyrics`),class:`enhance-input`,onKeyup:_(e.onEnhanceLyrics,[`enter`])},{append:m(()=>[a(y,{loading:e.enhancingLyrics,onClick:e.onEnhanceLyrics},{default:m(()=>[e.enhancingLyrics?o(``,!0):(u(),n(v,{key:0,icon:`fa-solid fa-wand-magic-sparkles`,class:`mr-1`})),i(` `+l(e.$t(`suno.button.enhance_lyrics`)),1)]),_:1},8,[`loading`,`onClick`])]),_:1},8,[`modelValue`,`placeholder`,`onKeyup`])]))]),_:1},8,[`modelValue`,`title`])])}var Ft=W(St,[[`render`,Pt],[`__scopeId`,`data-v-d7d2ec74`]]),It=`Pop.Rock.Jazz.R&B.Hip Hop.Lo-fi.Electronic.Classical.Country.Blues.Folk.Reggae.Metal.Punk.Soul.Funk.Ambient.Indie.Latin.Acoustic.Dance.Disco.Gospel.K-Pop.J-Pop.C-Pop.Bossa Nova.Trap.Drill.House.Techno.Dubstep.Synthwave.Chill.Dreamy.Upbeat.Melancholic.Romantic.Epic.Cinematic.Orchestral.Piano.Guitar.Saxophone.Violin.Tribal.World Music.Afrobeat.Ska.Grunge`.split(`.`),Lt=12;function Rt(e){let t=[...e];for(let e=t.length-1;e>0;e--){let n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}return t}var zt=s({name:`StyleInput`,components:{ElInput:K,ElButton:b,FontAwesomeIcon:Z,InfoIcon:Q},data(){return{optimizing:!1,shuffledTags:Rt(It)}},computed:{style:{get(){return this.$store.state.suno?.config?.style},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,style:e})}},credential(){return this.$store.state.suno?.credential},visibleTags(){return this.shuffledTags.slice(0,Lt)}},methods:{onTagClick(e){let t=this.style||``;t.toLowerCase().includes(e.toLowerCase())||(this.style=t?`${t}, ${e}`:e)},onRefreshTags(){this.shuffledTags=Rt(It)},async onOptimizeStyle(){let e=this.credential?.token;if(!(!e||!this.style)){this.optimizing=!0,G.info(this.$t(`suno.message.optimizingStyle`));try{let t=await X.style({prompt:this.style},{token:e}),n=t.data?.text||t.data?.data?.text;n&&(this.style=n,G.success(this.$t(`suno.message.optimizeStyleSuccess`)))}catch{G.error(this.$t(`suno.message.optimizeStyleFailed`))}finally{this.optimizing=!1}}}}}),Bt={class:`field`},Vt={class:`flex items-center justify-between mb-1`},Ht={class:`flex items-center`},Ut={class:`text-sm font-bold`},Wt={class:`relative`},Gt={class:`text-xs text-right text-[var(--el-text-color-secondary)] mt-1`},Kt={class:`style-tags`},qt=[`onClick`];function Jt(e,t,s,d,h,g){let _=f(`info-icon`),y=f(`font-awesome-icon`),b=f(`el-button`),x=f(`el-input`);return u(),p(`div`,Bt,[r(`div`,Vt,[r(`div`,Ht,[r(`span`,Ut,l(e.$t(`suno.name.style`)),1),a(_,{content:e.$t(`suno.description.style`)},null,8,[`content`])]),a(b,{size:`small`,loading:e.optimizing,round:``,onClick:e.onOptimizeStyle},{default:m(()=>[e.optimizing?o(``,!0):(u(),n(y,{key:0,icon:`fa-solid fa-wand-magic-sparkles`,class:`mr-1`})),i(` `+l(e.$t(`suno.button.optimize_style`)),1)]),_:1},8,[`loading`,`onClick`])]),r(`div`,Wt,[a(x,{modelValue:e.style,"onUpdate:modelValue":t[0]||=t=>e.style=t,rows:2,type:`textarea`,placeholder:e.$t(`suno.placeholder.style`)},null,8,[`modelValue`,`placeholder`]),r(`div`,Gt,l(e.style?.length||0)+`/1000`,1)]),r(`div`,Kt,[(u(!0),p(v,null,c(e.visibleTags,t=>(u(),p(`button`,{key:t,class:`style-tag`,onClick:n=>e.onTagClick(t)},l(t),9,qt))),128)),r(`button`,{class:`style-tag style-tag-refresh`,onClick:t[1]||=(...t)=>e.onRefreshTags&&e.onRefreshTags(...t)},[a(y,{icon:`fa-solid fa-arrows-rotate`})])])])}var Yt=W(zt,[[`render`,Jt],[`__scopeId`,`data-v-ddebb076`]]),Xt=s({name:`TitleInput`,components:{ElInput:K,InfoIcon:Q},computed:{title:{get(){return this.$store.state.suno?.config?.title},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,title:e})}}}}),Zt={class:`field`},Qt={class:`flex items-center mb-1`},$t={class:`text-sm font-bold`};function en(e,t,n,i,o,s){let c=f(`info-icon`),d=f(`el-input`);return u(),p(`div`,Zt,[r(`div`,Qt,[r(`span`,$t,l(e.$t(`suno.name.title`)),1),a(c,{content:e.$t(`suno.description.title`)},null,8,[`content`])]),a(d,{modelValue:e.title,"onUpdate:modelValue":t[0]||=t=>e.title=t,placeholder:e.$t(`suno.placeholder.title`)},null,8,[`modelValue`,`placeholder`])])}var tn=W(Xt,[[`render`,en]]),nn=s({name:`ExtendFromInput`,components:{ElImage:P,ElIcon:w,ElInputNumber:H,VideoPlay:S,VideoPause:C},data(){return{}},computed:{audio(){return this.$store.state.suno?.config?.audio},value:{get(){return this.$store.state.suno?.config?.continue_at},set(e){console.debug(`set continue_at`,e),this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.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:$,onPlay(e){this.$store.dispatch(`suno/setAudio`,{...this.$store.state.suno.audio,...e,state:`playing`}),console.log(`on play`)},onPause(e){this.$store.dispatch(`suno/setAudio`,{...this.$store.state.suno.audio,...e,state:`paused`}),console.log(`on pause`)},onClick(e){this.$store.state?.suno?.audio?.id!==e.id&&this.onPlay({...e,progress:0})}}}),rn={class:`field`},an={class:`box`},on={class:`title font-bold`},sn={class:`input-wrapper`},cn={class:`task`},ln={class:`left`},un={key:2,class:`duration`},dn={class:`info`},fn={class:`title`},pn={class:`style`};function mn(e,t,n,i,s,c){let d=f(`el-input-number`),_=f(`el-image`),v=f(`video-pause`),y=f(`el-icon`),b=f(`video-play`),x=h(`loading`);return u(),p(`div`,rn,[r(`div`,an,[r(`h2`,on,l(e.$t(`suno.name.extend`)),1),r(`div`,sn,[a(d,{modelValue:e.value,"onUpdate:modelValue":t[0]||=t=>e.value=t,class:`value`,min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t(`suno.placeholder.extend.continue_at`),onChange:e.handleChange},null,8,[`modelValue`,`max`,`placeholder`,`onChange`])])]),r(`div`,cn,[e.audio?(u(),p(`div`,{key:0,class:`audio`,onClick:t[3]||=t=>e.onClick(e.audio)},[g((u(),p(`div`,ln,[a(_,{src:e.audio?.image_url,class:`cover`,fit:`cover`},null,8,[`src`]),e.audio?.audio_url&&e.$store.state?.suno?.audio?.id===e.audio.id&&e.$store.state?.suno?.audio?.state===`playing`?(u(),p(`div`,{key:0,class:`overlay`,onClick:t[1]||=t=>e.onPause(e.audio)},[a(y,null,{default:m(()=>[a(v)]),_:1})])):o(``,!0),e.audio?.audio_url&&(e.$store.state?.suno?.audio?.id!==e.audio.id||e.$store.state?.suno?.audio?.id===e.audio.id&&e.$store.state?.suno?.audio?.state===`paused`)?(u(),p(`div`,{key:1,class:`overlay`,onClick:t[2]||=t=>e.onPlay(e.audio)},[a(y,null,{default:m(()=>[a(b)]),_:1})])):o(``,!0),e.audio?.duration?(u(),p(`div`,un,l(e.useFormatDuring(e.audio?.duration)),1)):o(``,!0)])),[[x,!e.audio?.audio_url]]),r(`div`,dn,[r(`h2`,fn,l(e.audio?.title),1),r(`p`,pn,l(e.audio?.style),1)])])):o(``,!0)])])}var hn=W(nn,[[`render`,mn],[`__scopeId`,`data-v-bcce4821`]]),gn=s({name:`CoverFromInput`,components:{ElImage:P,ElIcon:w,VideoPlay:S,VideoPause:C},data(){return{}},computed:{audio(){return this.$store.state.suno?.config?.audio},value:{get(){return this.$store.state.suno?.config?.continue_at},set(e){console.debug(`set continue_at`,e),this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.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:$,onPlay(e){this.$store.dispatch(`suno/setAudio`,{...this.$store.state.suno.audio,...e,state:`playing`}),console.log(`on play`)},onPause(e){this.$store.dispatch(`suno/setAudio`,{...this.$store.state.suno.audio,...e,state:`paused`}),console.log(`on pause`)},onClick(e){this.$store.state?.suno?.audio?.id!==e.id&&this.onPlay({...e,progress:0})}}}),_n={class:`field`},vn={class:`box`},yn={class:`title font-bold`},bn={class:`task`},xn={class:`left`},Sn={key:2,class:`duration`},Cn={class:`info`},wn={class:`title`},Tn={class:`style`};function En(e,t,n,i,s,c){let d=f(`el-image`),_=f(`video-pause`),v=f(`el-icon`),y=f(`video-play`),b=h(`loading`);return u(),p(`div`,_n,[r(`div`,vn,[r(`h2`,yn,l(e.$t(`suno.name.cover`)),1)]),r(`div`,bn,[e.audio?(u(),p(`div`,{key:0,class:`audio`,onClick:t[2]||=t=>e.onClick(e.audio)},[g((u(),p(`div`,xn,[a(d,{src:e.audio?.image_url,class:`cover`,fit:`cover`},null,8,[`src`]),e.audio?.audio_url&&e.$store.state?.suno?.audio?.id===e.audio.id&&e.$store.state?.suno?.audio?.state===`playing`?(u(),p(`div`,{key:0,class:`overlay`,onClick:t[0]||=t=>e.onPause(e.audio)},[a(v,null,{default:m(()=>[a(_)]),_:1})])):o(``,!0),e.audio?.audio_url&&(e.$store.state?.suno?.audio?.id!==e.audio.id||e.$store.state?.suno?.audio?.id===e.audio.id&&e.$store.state?.suno?.audio?.state===`paused`)?(u(),p(`div`,{key:1,class:`overlay`,onClick:t[1]||=t=>e.onPlay(e.audio)},[a(v,null,{default:m(()=>[a(y)]),_:1})])):o(``,!0),e.audio?.duration?(u(),p(`div`,Sn,l(e.useFormatDuring(e.audio?.duration)),1)):o(``,!0)])),[[b,!e.audio?.audio_url]]),r(`div`,Cn,[r(`h2`,wn,l(e.audio?.title),1),r(`p`,Tn,l(e.audio?.style),1)])])):o(``,!0)])])}var Dn=W(gn,[[`render`,En],[`__scopeId`,`data-v-06640216`]]),On=s({name:`VocalGenderSelector`,components:{ElRadioGroup:R,ElRadioButton:L,InfoIcon:Q},computed:{vocalGender:{get(){return this.$store.state.suno?.config?.vocal_gender||``},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,vocal_gender:e||void 0})}}}}),kn={class:`flex items-center mb-1`},An={class:`text-sm font-bold`};function jn(e,t,n,o,s,c){let d=f(`info-icon`),h=f(`el-radio-button`),g=f(`el-radio-group`);return u(),p(`div`,null,[r(`div`,kn,[r(`span`,An,l(e.$t(`suno.name.vocalGender`)),1),a(d,{content:e.$t(`suno.description.vocalGender`)},null,8,[`content`])]),a(g,{modelValue:e.vocalGender,"onUpdate:modelValue":t[0]||=t=>e.vocalGender=t,size:`small`},{default:m(()=>[a(h,{value:``},{default:m(()=>[i(l(e.$t(`suno.gender.auto`)),1)]),_:1}),a(h,{value:`f`},{default:m(()=>[i(l(e.$t(`suno.gender.female`)),1)]),_:1}),a(h,{value:`m`},{default:m(()=>[i(l(e.$t(`suno.gender.male`)),1)]),_:1})]),_:1},8,[`modelValue`])])}var Mn=W(On,[[`render`,jn]]),Nn=s({name:`AdvancedParams`,components:{ElCollapse:ne,ElCollapseItem:te,ElInput:K,ElSlider:ce,ElRadioGroup:R,ElRadioButton:L},data(){return{activeNames:[]}},computed:{config(){return this.$store.state.suno?.config},isV5OrAbove(){let e=this.config?.model||``;return[`chirp-v5`,`chirp-v5-5`].includes(e)},styleNegative:{get(){return this.$store.state.suno?.config?.style_negative||``},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,style_negative:e||void 0})}},lyricPrompt:{get(){return this.$store.state.suno?.config?.lyric_prompt||``},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,lyric_prompt:e||void 0})}},weirdness:{get(){return this.$store.state.suno?.config?.weirdness??0},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,weirdness:e||void 0})}},styleInfluence:{get(){return this.$store.state.suno?.config?.style_influence??.5},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,style_influence:e})}},variationCategory:{get(){return this.$store.state.suno?.config?.variation_category||``},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,variation_category:e||void 0})}},audioWeight:{get(){return this.$store.state.suno?.config?.audio_weight??.5},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,audio_weight:e})}},lyricsMode:{get(){return this.$store.state.suno?.config?.lyrics_mode||`manual`},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,lyrics_mode:e})}}},mounted(){let e=this.$store.state.suno?.config;if(!e)return;let t={};typeof e.weirdness==`number`&&e.weirdness>1&&(t.weirdness=e.weirdness/100),typeof e.style_influence==`number`&&e.style_influence>1&&(t.style_influence=e.style_influence/100),typeof e.audio_weight==`number`&&e.audio_weight>1&&(t.audio_weight=e.audio_weight/100),Object.keys(t).length>0&&this.$store.commit(`suno/setConfig`,{...e,...t})}}),Pn={key:0,class:`mb-3`},Fn={class:`flex items-center mb-1`},In={class:`text-xs font-bold`},Ln={key:1,class:`mb-3`},Rn={class:`flex items-center mb-1`},zn={class:`text-xs font-bold`},Bn={key:2,class:`mb-3`},Vn={class:`flex items-center justify-between mb-1`},Hn={class:`text-xs font-bold`},Un={class:`text-xs text-[var(--el-text-color-secondary)]`},Wn={key:3,class:`mb-3`},Gn={class:`flex items-center justify-between mb-1`},Kn={class:`text-xs font-bold`},qn={class:`text-xs text-[var(--el-text-color-secondary)]`},Jn={key:4,class:`mb-3`},Yn={class:`flex items-center mb-1`},Xn={class:`text-xs font-bold`},Zn={key:5,class:`mb-3`},Qn={class:`flex items-center justify-between mb-1`},$n={class:`text-xs font-bold`},er={class:`text-xs text-[var(--el-text-color-secondary)]`},tr={key:6,class:`mb-3`},nr={class:`flex items-center mb-1`},rr={class:`text-xs font-bold`};function ir(e,t,s,c,d,h){let g=f(`el-input`),_=f(`el-slider`),v=f(`el-radio-button`),y=f(`el-radio-group`),b=f(`el-collapse-item`),x=f(`el-collapse`);return u(),n(x,{modelValue:e.activeNames,"onUpdate:modelValue":t[7]||=t=>e.activeNames=t,class:`advanced-collapse`},{default:m(()=>[a(b,{title:e.$t(`suno.name.advancedParams`),name:`advanced`},{default:m(()=>[e.config?.custom?(u(),p(`div`,Pn,[r(`div`,Fn,[r(`span`,In,l(e.$t(`suno.name.styleNegative`)),1)]),a(g,{modelValue:e.styleNegative,"onUpdate:modelValue":t[0]||=t=>e.styleNegative=t,size:`small`,placeholder:e.$t(`suno.placeholder.styleNegative`)},null,8,[`modelValue`,`placeholder`])])):o(``,!0),e.config?.custom&&!e.config?.instrumental?(u(),p(`div`,Ln,[r(`div`,Rn,[r(`span`,zn,l(e.$t(`suno.name.lyricPrompt`)),1)]),a(g,{modelValue:e.lyricPrompt,"onUpdate:modelValue":t[1]||=t=>e.lyricPrompt=t,size:`small`,placeholder:e.$t(`suno.placeholder.lyricPrompt`)},null,8,[`modelValue`,`placeholder`])])):o(``,!0),e.config?.custom?(u(),p(`div`,Bn,[r(`div`,Vn,[r(`span`,Hn,l(e.$t(`suno.name.weirdness`)),1),r(`span`,Un,l(e.weirdness??0),1)]),a(_,{modelValue:e.weirdness,"onUpdate:modelValue":t[2]||=t=>e.weirdness=t,min:0,max:1,step:.01},null,8,[`modelValue`])])):o(``,!0),e.config?.custom?(u(),p(`div`,Wn,[r(`div`,Gn,[r(`span`,Kn,l(e.$t(`suno.name.styleInfluence`)),1),r(`span`,qn,l(e.styleInfluence??.5),1)]),a(_,{modelValue:e.styleInfluence,"onUpdate:modelValue":t[3]||=t=>e.styleInfluence=t,min:0,max:1,step:.01},null,8,[`modelValue`])])):o(``,!0),e.isV5OrAbove?(u(),p(`div`,Jn,[r(`div`,Yn,[r(`span`,Xn,l(e.$t(`suno.name.variationCategory`)),1)]),a(y,{modelValue:e.variationCategory,"onUpdate:modelValue":t[4]||=t=>e.variationCategory=t,size:`small`},{default:m(()=>[a(v,{value:``},{default:m(()=>[i(l(e.$t(`suno.gender.auto`)),1)]),_:1}),a(v,{value:`high`},{default:m(()=>[i(l(e.$t(`suno.variation.high`)),1)]),_:1}),a(v,{value:`low`},{default:m(()=>[i(l(e.$t(`suno.variation.low`)),1)]),_:1})]),_:1},8,[`modelValue`])])):o(``,!0),e.config?.action===`cover`?(u(),p(`div`,Zn,[r(`div`,Qn,[r(`span`,$n,l(e.$t(`suno.name.audioWeight`)),1),r(`span`,er,l(e.audioWeight??.5),1)]),a(_,{modelValue:e.audioWeight,"onUpdate:modelValue":t[5]||=t=>e.audioWeight=t,min:0,max:1,step:.01},null,8,[`modelValue`])])):o(``,!0),e.config?.custom&&!e.config?.instrumental?(u(),p(`div`,tr,[r(`div`,nr,[r(`span`,rr,l(e.$t(`suno.name.lyricsMode`)),1)]),a(y,{modelValue:e.lyricsMode,"onUpdate:modelValue":t[6]||=t=>e.lyricsMode=t,size:`small`},{default:m(()=>[a(v,{value:`manual`},{default:m(()=>[i(l(e.$t(`suno.lyricsMode.manual`)),1)]),_:1}),a(v,{value:`auto`},{default:m(()=>[i(l(e.$t(`suno.lyricsMode.auto`)),1)]),_:1})]),_:1},8,[`modelValue`])])):o(``,!0)]),_:1},8,[`title`])]),_:1},8,[`modelValue`])}var ar=W(Nn,[[`render`,ir],[`__scopeId`,`data-v-363599d3`]]),or=s({name:`ReplaceSectionInput`,components:{ElInputNumber:H,ElImage:P,InfoIcon:Q},computed:{audio(){return this.$store.state.suno?.config?.audio},replaceSectionStart:{get(){return this.$store.state.suno?.config?.replace_section_start},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,replace_section_start:e})}},replaceSectionEnd:{get(){return this.$store.state.suno?.config?.replace_section_end},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,replace_section_end:e})}}},methods:{onClick(e){this.$store.dispatch(`suno/setAudio`,{...this.$store.state.suno.audio,...e,state:`playing`})}}}),sr={class:`field`},cr={class:`flex items-center mb-2`},lr={class:`text-sm font-bold m-0`},ur={key:0,class:`task mb-2`},dr={class:`left relative w-[50px] h-[50px] mr-3 flex-shrink-0`},fr={class:`info flex-1 min-w-0`},pr={class:`text-sm font-bold m-0 truncate`},mr={class:`text-xs text-[var(--el-text-color-secondary)] m-0 truncate`},hr={class:`flex gap-2`};function gr(e,t,n,i,s,c){let d=f(`info-icon`),m=f(`el-image`),_=f(`el-input-number`),v=h(`loading`);return u(),p(`div`,sr,[r(`div`,cr,[r(`h2`,lr,l(e.$t(`suno.name.replaceSection`)),1),a(d,{content:e.$t(`suno.description.replaceSection`)},null,8,[`content`])]),e.audio?(u(),p(`div`,ur,[r(`div`,{class:`audio flex items-center`,onClick:t[0]||=t=>e.onClick(e.audio)},[g((u(),p(`div`,dr,[a(m,{src:e.audio?.image_url,class:`w-full h-full rounded`,fit:`cover`},null,8,[`src`])])),[[v,!e.audio?.audio_url]]),r(`div`,fr,[r(`h2`,pr,l(e.audio?.title),1),r(`p`,mr,l(e.audio?.style),1)])])])):o(``,!0),r(`div`,hr,[a(_,{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(`suno.placeholder.replaceSectionStart`)},null,8,[`modelValue`,`max`,`placeholder`]),a(_,{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(`suno.placeholder.replaceSectionEnd`)},null,8,[`modelValue`,`min`,`max`,`placeholder`])])])}var _r=W(or,[[`render`,gr]]),vr=s({name:`OverpaintingInput`,components:{ElInputNumber:H,ElImage:P,InfoIcon:Q},computed:{audio(){return this.$store.state.suno?.config?.audio},overpaintingStart:{get(){return this.$store.state.suno?.config?.overpainting_start},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,overpainting_start:e})}},overpaintingEnd:{get(){return this.$store.state.suno?.config?.overpainting_end},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,overpainting_end:e})}}},methods:{onClick(e){this.$store.dispatch(`suno/setAudio`,{...this.$store.state.suno.audio,...e,state:`playing`})}}}),yr={class:`field`},br={class:`flex items-center mb-2`},xr={class:`text-sm font-bold m-0`},Sr={key:0,class:`task mb-2`},Cr={class:`left relative w-[50px] h-[50px] mr-3 flex-shrink-0`},wr={class:`info flex-1 min-w-0`},Tr={class:`text-sm font-bold m-0 truncate`},Er={class:`text-xs text-[var(--el-text-color-secondary)] m-0 truncate`},Dr={class:`flex gap-2`};function Or(e,t,n,i,s,c){let d=f(`info-icon`),m=f(`el-image`),_=f(`el-input-number`),v=h(`loading`);return u(),p(`div`,yr,[r(`div`,br,[r(`h2`,xr,l(e.$t(`suno.name.overpaintingRange`)),1),a(d,{content:e.$t(`suno.description.overpainting`)},null,8,[`content`])]),e.audio?(u(),p(`div`,Sr,[r(`div`,{class:`audio flex items-center`,onClick:t[0]||=t=>e.onClick(e.audio)},[g((u(),p(`div`,Cr,[a(m,{src:e.audio?.image_url,class:`w-full h-full rounded`,fit:`cover`},null,8,[`src`])])),[[v,!e.audio?.audio_url]]),r(`div`,wr,[r(`h2`,Tr,l(e.audio?.title),1),r(`p`,Er,l(e.audio?.style),1)])])])):o(``,!0),r(`div`,Dr,[a(_,{modelValue:e.overpaintingStart,"onUpdate:modelValue":t[1]||=t=>e.overpaintingStart=t,class:`flex-1`,size:`small`,min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t(`suno.placeholder.overpaintingStart`)},null,8,[`modelValue`,`max`,`placeholder`]),a(_,{modelValue:e.overpaintingEnd,"onUpdate:modelValue":t[2]||=t=>e.overpaintingEnd=t,class:`flex-1`,size:`small`,min:e.overpaintingStart||0,max:e.audio?.duration,controls:!1,placeholder:e.$t(`suno.placeholder.overpaintingEnd`)},null,8,[`modelValue`,`min`,`max`,`placeholder`])])])}var kr=W(vr,[[`render`,Or]]),Ar=s({name:`UnderpaintingInput`,components:{ElInputNumber:H,ElImage:P,InfoIcon:Q},computed:{audio(){return this.$store.state.suno?.config?.audio},underpaintingStart:{get(){return this.$store.state.suno?.config?.underpainting_start},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,underpainting_start:e})}},underpaintingEnd:{get(){return this.$store.state.suno?.config?.underpainting_end},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,underpainting_end:e})}}},methods:{onClick(e){this.$store.dispatch(`suno/setAudio`,{...this.$store.state.suno.audio,...e,state:`playing`})}}}),jr={class:`field`},Mr={class:`flex items-center mb-2`},Nr={class:`text-sm font-bold m-0`},Pr={key:0,class:`task mb-2`},Fr={class:`left relative w-[50px] h-[50px] mr-3 flex-shrink-0`},Ir={class:`info flex-1 min-w-0`},Lr={class:`text-sm font-bold m-0 truncate`},Rr={class:`text-xs text-[var(--el-text-color-secondary)] m-0 truncate`},zr={class:`flex gap-2`};function Br(e,t,n,i,s,c){let d=f(`info-icon`),m=f(`el-image`),_=f(`el-input-number`),v=h(`loading`);return u(),p(`div`,jr,[r(`div`,Mr,[r(`h2`,Nr,l(e.$t(`suno.name.underpaintingRange`)),1),a(d,{content:e.$t(`suno.description.underpainting`)},null,8,[`content`])]),e.audio?(u(),p(`div`,Pr,[r(`div`,{class:`audio flex items-center`,onClick:t[0]||=t=>e.onClick(e.audio)},[g((u(),p(`div`,Fr,[a(m,{src:e.audio?.image_url,class:`w-full h-full rounded`,fit:`cover`},null,8,[`src`])])),[[v,!e.audio?.audio_url]]),r(`div`,Ir,[r(`h2`,Lr,l(e.audio?.title),1),r(`p`,Rr,l(e.audio?.style),1)])])])):o(``,!0),r(`div`,zr,[a(_,{modelValue:e.underpaintingStart,"onUpdate:modelValue":t[1]||=t=>e.underpaintingStart=t,class:`flex-1`,size:`small`,min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t(`suno.placeholder.underpaintingStart`)},null,8,[`modelValue`,`max`,`placeholder`]),a(_,{modelValue:e.underpaintingEnd,"onUpdate:modelValue":t[2]||=t=>e.underpaintingEnd=t,class:`flex-1`,size:`small`,min:e.underpaintingStart||0,max:e.audio?.duration,controls:!1,placeholder:e.$t(`suno.placeholder.underpaintingEnd`)},null,8,[`modelValue`,`min`,`max`,`placeholder`])])])}var Vr=W(Ar,[[`render`,Br]]),Hr=s({name:`SamplesInput`,components:{ElInputNumber:H,ElImage:P,InfoIcon:Q},computed:{audio(){return this.$store.state.suno?.config?.audio},samplesStart:{get(){return this.$store.state.suno?.config?.samples_start},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,samples_start:e})}},samplesEnd:{get(){return this.$store.state.suno?.config?.samples_end},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,samples_end:e})}}},methods:{onClick(e){this.$store.dispatch(`suno/setAudio`,{...this.$store.state.suno.audio,...e,state:`playing`})}}}),Ur={class:`field`},Wr={class:`flex items-center mb-2`},Gr={class:`text-sm font-bold m-0`},Kr={key:0,class:`task mb-2`},qr={class:`left relative w-[50px] h-[50px] mr-3 flex-shrink-0`},Jr={class:`info flex-1 min-w-0`},Yr={class:`text-sm font-bold m-0 truncate`},Xr={class:`text-xs text-[var(--el-text-color-secondary)] m-0 truncate`},Zr={class:`flex gap-2`};function Qr(e,t,n,i,s,c){let d=f(`info-icon`),m=f(`el-image`),_=f(`el-input-number`),v=h(`loading`);return u(),p(`div`,Ur,[r(`div`,Wr,[r(`h2`,Gr,l(e.$t(`suno.name.samplesRange`)),1),a(d,{content:e.$t(`suno.description.samples`)},null,8,[`content`])]),e.audio?(u(),p(`div`,Kr,[r(`div`,{class:`audio flex items-center`,onClick:t[0]||=t=>e.onClick(e.audio)},[g((u(),p(`div`,qr,[a(m,{src:e.audio?.image_url,class:`w-full h-full rounded`,fit:`cover`},null,8,[`src`])])),[[v,!e.audio?.audio_url]]),r(`div`,Jr,[r(`h2`,Yr,l(e.audio?.title),1),r(`p`,Xr,l(e.audio?.style),1)])])])):o(``,!0),r(`div`,Zr,[a(_,{modelValue:e.samplesStart,"onUpdate:modelValue":t[1]||=t=>e.samplesStart=t,class:`flex-1`,size:`small`,min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t(`suno.placeholder.samplesStart`)},null,8,[`modelValue`,`max`,`placeholder`]),a(_,{modelValue:e.samplesEnd,"onUpdate:modelValue":t[2]||=t=>e.samplesEnd=t,class:`flex-1`,size:`small`,min:e.samplesStart||0,max:e.audio?.duration,controls:!1,placeholder:e.$t(`suno.placeholder.samplesEnd`)},null,8,[`modelValue`,`min`,`max`,`placeholder`])])])}var $r=W(Hr,[[`render`,Qr]]),ei=[.5,.75,1,1.25,1.5,2],ti=s({name:`AdjustSpeedInput`,components:{ElRadioGroup:R,ElRadioButton:L,ElImage:P,InfoIcon:Q},data(){return{options:ei}},computed:{audio(){return this.$store.state.suno?.config?.audio},speed:{get(){let e=this.$store.state.suno?.config?.speed;return typeof e==`number`?e:1},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,speed:e})}}},methods:{onClick(e){this.$store.dispatch(`suno/setAudio`,{...this.$store.state.suno.audio,...e,state:`playing`})}}}),ni={class:`field`},ri={class:`flex items-center mb-2`},ii={class:`text-sm font-bold m-0`},ai={key:0,class:`task mb-2`},oi={class:`left relative w-[50px] h-[50px] mr-3 flex-shrink-0`},si={class:`info flex-1 min-w-0`},ci={class:`text-sm font-bold m-0 truncate`},li={class:`text-xs text-[var(--el-text-color-secondary)] m-0 truncate`};function ui(e,t,s,d,_,y){let b=f(`info-icon`),x=f(`el-image`),S=f(`el-radio-button`),C=f(`el-radio-group`),w=h(`loading`);return u(),p(`div`,ni,[r(`div`,ri,[r(`h2`,ii,l(e.$t(`suno.name.adjustSpeed`)),1),a(b,{content:e.$t(`suno.description.adjustSpeed`)},null,8,[`content`])]),e.audio?(u(),p(`div`,ai,[r(`div`,{class:`audio flex items-center`,onClick:t[0]||=t=>e.onClick(e.audio)},[g((u(),p(`div`,oi,[a(x,{src:e.audio?.image_url,class:`w-full h-full rounded`,fit:`cover`},null,8,[`src`])])),[[w,!e.audio?.audio_url]]),r(`div`,si,[r(`h2`,ci,l(e.audio?.title),1),r(`p`,li,l(e.audio?.style),1)])])])):o(``,!0),a(C,{modelValue:e.speed,"onUpdate:modelValue":t[1]||=t=>e.speed=t,size:`small`,class:`speed-group`},{default:m(()=>[(u(!0),p(v,null,c(e.options,e=>(u(),n(S,{key:e,value:e},{default:m(()=>[i(l(e)+`x`,1)]),_:2},1032,[`value`]))),128))]),_:1},8,[`modelValue`])])}var di=W(ti,[[`render`,ui],[`__scopeId`,`data-v-ba834628`]]),fi=s({name:`VoiceCreateDialog`,components:{ElDialog:Y,ElForm:j,ElFormItem:A,ElInput:K,ElButton:b,ElRadioGroup:R,ElRadio:ee},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`,`created`],data(){return{sourceType:`song`,form:{name:``,description:``,audio_id:``,audio_url:``},loading:!1}},computed:{visible:{get(){return this.modelValue},set(e){this.$emit(`update:modelValue`,e)}},token(){return this.$store.state.suno?.credential?.token},canSubmit(){return!(!this.form.name||this.sourceType===`song`&&!this.form.audio_id||this.sourceType===`upload`&&!this.form.audio_url)}},methods:{onClose(){this.visible=!1,this.resetForm()},resetForm(){this.form={name:``,description:``,audio_id:``,audio_url:``},this.sourceType=`song`},async onSubmit(){if(this.token){this.loading=!0;try{this.sourceType===`song`?await X.persona({audio_id:this.form.audio_id,name:this.form.name,description:this.form.description},{token:this.token}):await X.voices({audio_url:this.form.audio_url,name:this.form.name,description:this.form.description},{token:this.token}),G.success(this.$t(`suno.voice.createSuccess`)),this.$emit(`created`),this.onClose()}catch{G.error(this.$t(`suno.voice.createFailed`))}finally{this.loading=!1}}}}});function pi(e,t,r,s,c,d){let p=f(`el-input`),h=f(`el-form-item`),g=f(`el-radio`),_=f(`el-radio-group`),v=f(`el-form`),y=f(`el-button`),b=f(`el-dialog`);return u(),n(b,{modelValue:e.visible,"onUpdate:modelValue":t[5]||=t=>e.visible=t,title:e.$t(`suno.voice.createTitle`),width:`480px`,"close-on-click-modal":!1,onClose:e.onClose},{footer:m(()=>[a(y,{onClick:e.onClose},{default:m(()=>[i(l(e.$t(`common.button.cancel`)),1)]),_:1},8,[`onClick`]),a(y,{type:`primary`,loading:e.loading,disabled:!e.canSubmit,onClick:e.onSubmit},{default:m(()=>[i(l(e.$t(`suno.voice.create`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])]),default:m(()=>[a(v,{"label-position":`top`,class:`voice-create-form`},{default:m(()=>[a(h,{label:e.$t(`suno.voice.name`)},{default:m(()=>[a(p,{modelValue:e.form.name,"onUpdate:modelValue":t[0]||=t=>e.form.name=t,placeholder:e.$t(`suno.voice.namePlaceholder`),maxlength:`50`},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`label`]),a(h,{label:e.$t(`suno.voice.description`)},{default:m(()=>[a(p,{modelValue:e.form.description,"onUpdate:modelValue":t[1]||=t=>e.form.description=t,type:`textarea`,rows:2,placeholder:e.$t(`suno.voice.descriptionPlaceholder`),maxlength:`200`},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`label`]),a(h,{label:e.$t(`suno.voice.sourceType`)},{default:m(()=>[a(_,{modelValue:e.sourceType,"onUpdate:modelValue":t[2]||=t=>e.sourceType=t,class:`w-full`},{default:m(()=>[a(g,{value:`song`},{default:m(()=>[i(l(e.$t(`suno.voice.fromSong`)),1)]),_:1}),a(g,{value:`upload`},{default:m(()=>[i(l(e.$t(`suno.voice.fromUpload`)),1)]),_:1})]),_:1},8,[`modelValue`])]),_:1},8,[`label`]),e.sourceType===`song`?(u(),n(h,{key:0,label:e.$t(`suno.voice.audioId`)},{default:m(()=>[a(p,{modelValue:e.form.audio_id,"onUpdate:modelValue":t[3]||=t=>e.form.audio_id=t,placeholder:e.$t(`suno.voice.audioIdPlaceholder`)},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`label`])):o(``,!0),e.sourceType===`upload`?(u(),n(h,{key:1,label:e.$t(`suno.voice.audioUrl`)},{default:m(()=>[a(p,{modelValue:e.form.audio_url,"onUpdate:modelValue":t[4]||=t=>e.form.audio_url=t,placeholder:e.$t(`suno.voice.audioUrlPlaceholder`)},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`label`])):o(``,!0)]),_:1})]),_:1},8,[`modelValue`,`title`,`onClose`])}var mi=s({name:`VoiceManager`,components:{ElButton:b,ElIcon:w,ElTabs:O,ElTabPane:k,ElTooltip:N,Loading:x,FontAwesomeIcon:Z,VoiceCreateDialog:W(fi,[[`render`,pi]])},data(){return{showCreateDialog:!1,loading:!1,deletingId:null,activeTab:`all`}},computed:{personas(){return this.$store.state.suno?.personas||[]},favoriteIds(){return this.$store.state.suno?.favoritePersonaIds||[]},favoritePersonas(){return this.personas.filter(e=>e.persona_id&&this.favoriteIds.includes(e.persona_id))},visiblePersonas(){return this.activeTab===`favorites`?this.favoritePersonas:this.personas},selectedPersonaId(){return this.$store.state.suno?.config?.persona_id}},watch:{"$store.state.suno.credential":{handler(){this.loadPersonas()},immediate:!0}},methods:{isFavorite(e){return!!e&&this.favoriteIds.includes(e)},onToggleFavorite(e){e.persona_id&&this.$store.commit(`suno/togglePersonaFavorite`,e.persona_id)},async loadPersonas(){if(this.$store.state.suno?.credential?.token){this.loading=!0;try{await this.$store.dispatch(`suno/getPersonas`)}finally{this.loading=!1}}},selectPersona(e){let t={...this.$store.state.suno?.config};t.persona_id===e.persona_id?t.persona_id=void 0:t.persona_id=e.persona_id,this.$store.dispatch(`suno/setConfig`,t)},async onDelete(e){try{await q.confirm(this.$t(`suno.voice.confirmDelete`),this.$t(`suno.voice.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.confirm`),cancelButtonText:this.$t(`common.button.cancel`)})}catch{return}if(!e.persona_id)return;this.deletingId=e.persona_id;let t=await this.$store.dispatch(`suno/deletePersona`,e.persona_id);if(this.deletingId=null,t){if(G.success(this.$t(`suno.voice.deleteSuccess`)),this.selectedPersonaId===e.persona_id){let e={...this.$store.state.suno?.config,persona_id:void 0};this.$store.dispatch(`suno/setConfig`,e)}this.favoriteIds.includes(e.persona_id)&&this.$store.commit(`suno/togglePersonaFavorite`,e.persona_id)}else G.error(this.$t(`suno.voice.deleteFailed`))},async onCreated(){await this.loadPersonas()}}}),hi={class:`voice-manager`},gi={class:`flex items-center justify-between mb-3`},_i={class:`text-sm font-medium`},vi={key:0,class:`text-center py-6`},yi={key:1,class:`text-center py-6 text-gray-400 text-sm`},bi={key:2,class:`voice-list`},xi=[`onClick`],Si={class:`flex-1 min-w-0`},Ci={class:`voice-name`},wi={key:0,class:`voice-desc`};function Ti(e,n,s,d,h,g){let _=f(`font-awesome-icon`),b=f(`el-button`),x=f(`el-tab-pane`),S=f(`el-tabs`),C=f(`loading`),w=f(`el-icon`),T=f(`el-tooltip`),E=f(`voice-create-dialog`);return u(),p(`div`,hi,[r(`div`,gi,[r(`span`,_i,l(e.$t(`suno.voice.title`)),1),a(b,{type:`primary`,size:`small`,onClick:n[0]||=t=>e.showCreateDialog=!0},{default:m(()=>[a(_,{icon:`fa-solid fa-plus`,class:`mr-1`}),i(` `+l(e.$t(`suno.voice.create`)),1)]),_:1})]),a(S,{modelValue:e.activeTab,"onUpdate:modelValue":n[1]||=t=>e.activeTab=t,class:`voice-tabs`,size:`small`},{default:m(()=>[a(x,{name:`all`,label:e.$t(`suno.voice.tabAll`)+` (`+(e.personas?.length||0)+`)`},null,8,[`label`]),a(x,{name:`favorites`,label:e.$t(`suno.voice.tabFavorites`)+` (`+e.favoritePersonas.length+`)`},null,8,[`label`])]),_:1},8,[`modelValue`]),e.loading?(u(),p(`div`,vi,[a(w,{class:`is-loading`},{default:m(()=>[a(C)]),_:1})])):e.visiblePersonas.length===0?(u(),p(`div`,yi,l(e.activeTab===`favorites`?e.$t(`suno.voice.emptyFavorites`):e.$t(`suno.voice.empty`)),1)):(u(),p(`div`,bi,[(u(!0),p(v,null,c(e.visiblePersonas,s=>(u(),p(`div`,{key:s.persona_id,class:t([`voice-item`,{active:e.selectedPersonaId===s.persona_id}]),onClick:t=>e.selectPersona(s)},[r(`div`,Si,[r(`div`,Ci,[a(_,{icon:s.source_type===`voice`?`fa-solid fa-microphone`:`fa-solid fa-music`,class:`mr-1.5 text-xs opacity-60`},null,8,[`icon`]),i(` `+l(s.name||s.persona_id),1)]),s.description?(u(),p(`div`,wi,l(s.description),1)):o(``,!0)]),r(`div`,{class:`voice-actions`,onClick:n[2]||=y(()=>{},[`stop`])},[a(T,{content:e.isFavorite(s.persona_id)?e.$t(`suno.voice.unfavorite`):e.$t(`suno.voice.favorite`),placement:`top`},{default:m(()=>[a(b,{size:`small`,text:``,class:t({"voice-fav-active":e.isFavorite(s.persona_id)}),onClick:t=>e.onToggleFavorite(s)},{default:m(()=>[a(_,{icon:e.isFavorite(s.persona_id)?`fa-solid fa-star`:`fa-regular fa-star`},null,8,[`icon`])]),_:2},1032,[`class`,`onClick`])]),_:2},1032,[`content`]),a(b,{type:`danger`,size:`small`,text:``,loading:e.deletingId===s.persona_id,onClick:t=>e.onDelete(s)},{default:m(()=>[a(_,{icon:`fa-solid fa-trash`})]),_:1},8,[`loading`,`onClick`])])],10,xi))),128))])),a(E,{modelValue:e.showCreateDialog,"onUpdate:modelValue":n[3]||=t=>e.showCreateDialog=t,onCreated:e.onCreated},null,8,[`modelValue`,`onCreated`])])}var Ei=s({name:`PersonaInput`,components:{ElSelect:E,ElOption:D,ElButton:b,ElDrawer:z,FontAwesomeIcon:Z,InfoIcon:Q,VoiceManager:W(mi,[[`render`,Ti],[`__scopeId`,`data-v-8b8e36d9`]])},data(){return{showManager:!1}},computed:{personaId:{get(){return this.$store.state.suno?.config?.persona_id||``},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,persona_id:e||void 0})}},personas(){return this.$store.state.suno?.personas||[]}}}),Di={class:`field`},Oi={class:`flex items-center justify-between mb-2`},ki={class:`flex items-center`},Ai={class:`text-sm font-bold`},ji={class:`flex items-center justify-between w-full`},Mi={key:0,class:`text-xs text-gray-400 ml-2`};function Ni(e,t,s,d,h,g){let _=f(`info-icon`),y=f(`font-awesome-icon`),b=f(`el-button`),x=f(`el-option`),S=f(`el-select`),C=f(`voice-manager`),w=f(`el-drawer`);return u(),p(`div`,Di,[r(`div`,Oi,[r(`div`,ki,[r(`span`,Ai,l(e.$t(`suno.name.persona`)),1),a(_,{content:e.$t(`suno.description.persona`)},null,8,[`content`])]),a(b,{size:`small`,round:``,onClick:t[0]||=t=>e.showManager=!0},{default:m(()=>[a(y,{icon:`fa-solid fa-microphone`,class:`mr-1`}),i(` `+l(e.$t(`suno.voice.manage`)),1)]),_:1})]),a(S,{modelValue:e.personaId,"onUpdate:modelValue":t[1]||=t=>e.personaId=t,placeholder:e.$t(`suno.placeholder.personaId`),clearable:``,filterable:``,class:`w-full`},{default:m(()=>[(u(!0),p(v,null,c(e.personas,e=>(u(),n(x,{key:e.persona_id||``,value:e.persona_id||``,label:e.name||e.persona_id||``},{default:m(()=>[r(`div`,ji,[r(`span`,null,l(e.name||e.persona_id),1),e.source_type?(u(),p(`span`,Mi,l(e.source_type),1)):o(``,!0)])]),_:2},1032,[`value`,`label`]))),128))]),_:1},8,[`modelValue`,`placeholder`]),a(w,{modelValue:e.showManager,"onUpdate:modelValue":t[2]||=t=>e.showManager=t,title:e.$t(`suno.voice.title`),size:`380px`,direction:`rtl`},{default:m(()=>[a(C)]),_:1},8,[`modelValue`,`title`])])}var Pi=s({name:`PresetPanel`,components:{TypeSelector:We,PromptInput:xt,LyricInput:Ft,StyleInput:Yt,TitleInput:tn,ExtendFromInput:hn,CoverFromInput:Dn,UploadAudio:pt,VocalGenderSelector:Mn,AdvancedParams:ar,ReplaceSectionInput:_r,OverpaintingInput:kr,UnderpaintingInput:Vr,SamplesInput:$r,AdjustSpeedInput:di,PersonaInput:W(Ei,[[`render`,Ni]]),FontAwesomeIcon:Z,ElButton:b,ElTabs:O,ElTabPane:k,Consumption:Ce},emits:[`generate`],computed:{config(){return this.$store.state.suno?.config},mode:{get(){return this.$store.state.suno?.config?.custom?`custom`:`simple`},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,custom:e===`custom`})}},consumption(){return fe(this.config,this.service?.cost)},service(){return this.$store.state.suno?.service},supportsVocalGender(){let e=this.config?.model||``;return[`chirp-v4-5-plus`,`chirp-v5`,`chirp-v5-5`].includes(e)},supportsPersona(){let e=this.config?.action;return!e||e===`generate`||e===`artist_consistency`||e===`artist_consistency_vox`},generateButtonText(){let e=this.config?.action;return e===`extend`?this.$t(`suno.button.extend`):e===`cover`?this.$t(`suno.button.cover_music`):e===`remaster`?this.$t(`suno.button.remaster`):e===`replace_section`?this.$t(`suno.button.replace_section`):e===`mashup`?this.$t(`suno.button.mashup`):e===`stems`?this.$t(`suno.button.get_stems`):e===`concat`?this.$t(`suno.button.concat_music`):e===`upload_cover`?this.$t(`suno.button.upload_cover`):e===`artist_consistency`?this.$t(`suno.button.artist_consistency`):e===`artist_consistency_vox`?this.$t(`suno.button.artist_consistency_vox`):e===`overpainting`?this.$t(`suno.button.overpainting`):e===`underpainting`?this.$t(`suno.button.underpainting`):e===`samples`?this.$t(`suno.button.samples`):e===`adjust_speed`?this.$t(`suno.button.adjust_speed`):this.$t(`suno.button.generate`)}},methods:{onGenerate(){this.$emit(`generate`)},onClearAll(){this.$store.commit(`suno/setConfig`,{custom:!1,sounds:!1,instrumental:!1,lyric:``,style:``,title:``,lyrics_mode:`manual`,model:this.$store.state.suno?.config?.model})}}}),Fi={class:`flex flex-col h-full`},Ii={class:`flex-1 overflow-y-auto p-5`},Li={class:`pt-2 px-1`},Ri={class:`pt-2 px-1`},zi={class:`flex flex-col items-center justify-center px-5 pb-5 gap-2`},Bi={class:`flex gap-2 w-full`};function Vi(e,t,s,c,d,h){let g=f(`type-selector`),_=f(`upload-audio`),v=f(`prompt-input`),y=f(`extend-from-input`),b=f(`cover-from-input`),x=f(`replace-section-input`),S=f(`overpainting-input`),C=f(`underpainting-input`),w=f(`samples-input`),T=f(`adjust-speed-input`),E=f(`advanced-params`),D=f(`el-tab-pane`),O=f(`lyric-input`),k=f(`style-input`),A=f(`title-input`),j=f(`vocal-gender-selector`),M=f(`persona-input`),N=f(`el-tabs`),P=f(`consumption`),F=f(`font-awesome-icon`),I=f(`el-button`);return u(),p(`div`,Fi,[r(`div`,Ii,[a(N,{modelValue:e.mode,"onUpdate:modelValue":t[0]||=t=>e.mode=t,class:`suno-mode-tabs`,stretch:``},{default:m(()=>[a(D,{label:e.$t(`suno.mode.simple`),name:`simple`},{default:m(()=>[r(`div`,Li,[a(g,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),e.config?.action===`extend`?(u(),n(y,{key:0,class:`mb-4`})):o(``,!0),e.config?.action===`cover`?(u(),n(b,{key:1,class:`mb-4`})):o(``,!0),e.config?.action===`replace_section`?(u(),n(x,{key:2,class:`mb-4`})):o(``,!0),e.config?.action===`overpainting`?(u(),n(S,{key:3,class:`mb-4`})):o(``,!0),e.config?.action===`underpainting`?(u(),n(C,{key:4,class:`mb-4`})):o(``,!0),e.config?.action===`samples`?(u(),n(w,{key:5,class:`mb-4`})):o(``,!0),e.config?.action===`adjust_speed`?(u(),n(T,{key:6,class:`mb-4`})):o(``,!0),a(E,{class:`mb-4`})])]),_:1},8,[`label`]),a(D,{label:e.$t(`suno.mode.custom`),name:`custom`},{default:m(()=>[r(`div`,Ri,[a(g,{class:`mb-4`}),a(_,{class:`mb-4`}),e.config?.instrumental?o(``,!0):(u(),n(O,{key:0,class:`mb-4`})),a(k,{class:`mb-4`}),a(A,{class:`mb-4`}),!e.config?.instrumental&&e.supportsVocalGender?(u(),n(j,{key:1,class:`mb-4`})):o(``,!0),e.supportsPersona?(u(),n(M,{key:2,class:`mb-4`})):o(``,!0),e.config?.action===`extend`?(u(),n(y,{key:3,class:`mb-4`})):o(``,!0),e.config?.action===`cover`?(u(),n(b,{key:4,class:`mb-4`})):o(``,!0),e.config?.action===`replace_section`?(u(),n(x,{key:5,class:`mb-4`})):o(``,!0),e.config?.action===`overpainting`?(u(),n(S,{key:6,class:`mb-4`})):o(``,!0),e.config?.action===`underpainting`?(u(),n(C,{key:7,class:`mb-4`})):o(``,!0),e.config?.action===`samples`?(u(),n(w,{key:8,class:`mb-4`})):o(``,!0),e.config?.action===`adjust_speed`?(u(),n(T,{key:9,class:`mb-4`})):o(``,!0),a(E,{class:`mb-4`})])]),_:1},8,[`label`])]),_:1},8,[`modelValue`])]),r(`div`,zi,[a(P,{value:e.consumption,service:e.service},null,8,[`value`,`service`]),r(`div`,Bi,[a(I,{class:`flex-1`,onClick:e.onClearAll},{default:m(()=>[a(F,{icon:`fa-solid fa-broom`,class:`mr-1`}),i(` `+l(e.$t(`suno.button.clear_all`)),1)]),_:1},8,[`onClick`]),a(I,{type:`primary`,class:`flex-1`,round:``,onClick:e.onGenerate},{default:m(()=>[a(F,{icon:`fa-solid fa-magic`,class:`mr-2`}),i(` `+l(e.generateButtonText),1)]),_:1},8,[`onClick`])])])])}var Hi=W(Pi,[[`render`,Vi],[`__scopeId`,`data-v-c62324e6`]]),Ui=we(),Wi=U(`suno`),Gi=s({name:`TaskPreview`,components:{ElImage:P,ElIcon:w,ElTooltip:N,FontAwesomeIcon:Z,VideoPlay:S,VideoPause:C,ElDropdown:re,ElDropdownMenu:V,ElDropdownItem:B,ElInput:K,ElProgress:ae,ElCheckbox:I,Loading:x,ApiCodeDialog:ye},props:{modelValue:{type:Object,required:!0}},data(){return{isFetchingVideoUrl:!1,isFetchingWav:!1,isFetchingMidi:!1,editingAudioId:null,editingTitle:``,apiCodeVisible:!1,apiCodePath:`/suno/audios`,apiCodeBody:{}}},computed:{loading(){return this.$store.state.suno?.status?.getApplications===J.Request},credential(){return this.$store.state.suno.credential},config(){return this.$store.state.suno.config},task(){return this.$store.state.suno?.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.suno?.application},active(){return this.$store.state.suno?.tasks?.active},isMashupMode(){return this.$store.state.suno?.config?.action===`mashup`},mashupAudioIds(){return this.$store.state.suno?.config?.mashup_audio_ids||[]}},methods:{useFormatDuring:$,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=`/suno/audios`,this.apiCodeVisible=!0},onPlay(e){this.$store.dispatch(`suno/setAudio`,{...this.$store.state.suno.audio,...e,state:`playing`}),console.log(`on play`)},onPause(e){this.$store.dispatch(`suno/setAudio`,{...this.$store.state.suno.audio,...e,state:`paused`}),console.log(`on pause`)},onClick(e){this.$store.state?.suno?.audio?.id!==e.id&&this.onPlay({...e,progress:0})},onExtend(e,t){e.stopPropagation(),console.log(`on extend`),console.debug(`set config`,t),this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.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(),console.log(`on download`,t);let n=new URL(t).pathname,r=n.substring(n.lastIndexOf(`/`)+1);console.log(`on preview`,r),fetch(t).then(e=>e.blob()).then(e=>{(0,Ui.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),G.error(this.$t(`suno.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}X.mp4(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(),console.log(`on preview`,t),window.open(t,`_blank`)},async onGetStems(e){await this.onGenerateAudioUrl(`stems`,e)},onCover(e){console.log(`on cover`),console.debug(`set config`,e),this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,model:e.model,custom:!0,instrumental:!1,style:e.style,action:`cover`,audio:e,audio_id:e.id})},async onConcatMusic(e){await this.onGenerateAudioUrl(`concat`,e)},async onRemaster(e){await this.onGenerateAudioUrl(`remaster`,e)},async onGetAllStems(e){await this.onGenerateAudioUrl(`all_stems`,e)},onReplaceSection(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.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)})},onMashup(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:`mashup`,audio:e,audio_id:e.id,mashup_audio_ids:[e.id]})},onOverpainting(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:`overpainting`,audio:e,audio_id:e.id,overpainting_start:0,overpainting_end:Math.min(30,e.duration||30)})},onUnderpainting(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:`underpainting`,audio:e,audio_id:e.id,underpainting_start:0,underpainting_end:Math.min(30,e.duration||30)})},onSamples(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:`samples`,audio:e,audio_id:e.id,samples_start:0,samples_end:Math.min(30,e.duration||30)})},onArtistConsistency(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:`artist_consistency`,audio:e,audio_id:e.id})},onAdjustSpeed(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:`adjust_speed`,audio:e,audio_id:e.id,speed:1})},onReusePrompt(e){let t=this.modelValue?.request??{};if(!(t.prompt||t.lyric||t.style||t.title||t.lyric_prompt||t.style_negative||t.persona_id)){G.warning(this.$t(`suno.message.reusePromptEmpty`));return}this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,model:t.model??e.model,custom:t.custom??!1,instrumental:t.instrumental??!1,prompt:t.prompt??``,lyric:t.lyric??``,lyric_prompt:t.lyric_prompt??``,lyrics_mode:t.lyrics_mode??`manual`,title:t.title??``,style:t.style??``,style_negative:t.style_negative??``,vocal_gender:t.vocal_gender,weirdness:t.weirdness,style_influence:t.style_influence,variation_category:t.variation_category,audio_weight:t.audio_weight,persona_id:t.persona_id,action:void 0,audio:void 0,audio_id:void 0,mashup_audio_ids:void 0,continue_at:void 0,speed:void 0,replace_section_start:void 0,replace_section_end:void 0,overpainting_start:void 0,overpainting_end:void 0,underpainting_start:void 0,underpainting_end:void 0,samples_start:void 0,samples_end:void 0}),G.success(this.$t(`suno.message.reusePromptSuccess`))},async onExtractVocals(e){let t=this.credential?.token;t&&(G.info(this.$t(`suno.message.extractingVocals`)),X.vox({audio_id:e,callback_url:Wi},{token:t}).then(()=>{G.success(this.$t(`suno.message.extractVocalsSuccess`))}).catch(e=>{G.error(e?.response?.data?.error?.message||this.$t(`suno.message.extractVocalsFailed`))}).finally(async()=>{await this.onGetTasks(),await this.onScrollDown()}))},async onGetTiming(e){let t=this.credential?.token;t&&(G.info(this.$t(`suno.message.fetchingTiming`)),X.timing({audio_id:e},{token:t}).then(e=>{G.success(this.$t(`suno.message.fetchTimingSuccess`)),console.debug(`timing data`,e.data)}).catch(e=>{G.error(e?.response?.data?.error?.message||this.$t(`suno.message.fetchTimingFailed`))}))},async handleWavDownload(e){if(!e?.id||this.isFetchingWav)return;let t=this.credential?.token;if(t)try{this.isFetchingWav=!0,G.info(this.$t(`suno.message.fetchingWav`));let n=(await X.wav({audio_id:e.id},{token:t})).data?.data?.[0]?.file_url;n?this.onDownload(null,n):G.error(this.$t(`suno.message.fetchWavFailed`))}catch(e){let t=e?.response?.data?.error?.message;G.error(t||this.$t(`suno.message.fetchWavFailed`))}finally{this.isFetchingWav=!1}},async handleMidiDownload(e){if(!e?.id||this.isFetchingMidi)return;let t=this.credential?.token;if(t)try{this.isFetchingMidi=!0,G.info(this.$t(`suno.message.fetchingMidi`));let n=(await X.midi({audio_id:e.id},{token:t})).data?.data;if(!n?.length){G.error(this.$t(`suno.message.fetchMidiFailed`));return}let r=(e.title||e.id||`suno`).replace(/[^\w.-]+/g,`_`)+`.json`;(0,Ui.saveAs)(new Blob([JSON.stringify(n,null,2)],{type:`application/json`}),r)}catch(e){let t=e?.response?.data?.error?.message;G.error(t||this.$t(`suno.message.fetchMidiFailed`))}finally{this.isFetchingMidi=!1}},async onGenerateAudioUrl(e,t){let n={action:e,audio_id:t,callback_url:Wi},r=this.credential?.token;if(!r){console.error(`no token specified`);return}G.info(this.$t(`suno.message.startingTask`)),X.audio(n,{token:r}).then(()=>{G.success(this.$t(`suno.message.startTaskSuccess`))}).catch(e=>{G.error(e?.response?.data?.error?.message||this.$t(`suno.message.startTaskFailed`))}).finally(async()=>{await this.onGetTasks(),await this.onScrollDown()})},isMashupSelected(e){return!!e.id&&this.mashupAudioIds.includes(e.id)},onToggleMashup(e){if(!e.id)return;let t=[...this.mashupAudioIds],n=t.indexOf(e.id);n===-1?t.push(e.id):t.splice(n,1),this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,mashup_audio_ids:t})},async onScrollDown(){setTimeout(()=>{let e=document.querySelector(`.tasks`);e&&(e.scrollTop=e.scrollHeight)},1e3)},onStartTitleEdit(e){this.editingAudioId=e.id??null,this.editingTitle=e.title||``,this.$nextTick(()=>{this.$refs.titleInput?.focus?.()})},onSaveTitleEdit(e){if(this.editingAudioId!==e.id)return;let t=this.editingTitle.trim();if(t&&t!==e.title){let n=this.$store.state.suno?.tasks;if(n?.items)for(let r of n.items){let n=(r?.response?.data??[]).find(t=>t.id===e.id);if(n){n.title=t;break}}}this.editingAudioId=null,this.editingTitle=``},onCancelTitleEdit(){this.editingAudioId=null,this.editingTitle=``},async onDelete(e){try{await q.confirm(this.$t(`suno.message.confirmDelete`),{confirmButtonText:this.$t(`suno.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`})}catch{return}let t=this.$store.state.suno?.tasks;if(t?.items)for(let n of t.items){let r=n?.response?.data??[],i=r.findIndex(t=>t.id===e.id);if(i!==-1){if(r.splice(i,1),r.length===0){let e=t.items.indexOf(n);e!==-1&&t.items.splice(e,1)}break}}this.$store.state?.suno?.audio?.id===e.id&&this.$store.dispatch(`suno/setAudio`,null),G.success(this.$t(`suno.message.deleteSuccess`))},async onGetTasks(){if(this.loading){console.debug(`loading`);return}await this.$store.dispatch(`suno/getTasks`,{limit:30,offset:0})}}}),Ki={class:`task`},qi=[`onClick`],Ji=[`onClick`],Yi={class:`left`},Xi=[`onClick`],Zi=[`onClick`],Qi={key:2,class:`duration`},$i={class:`info`},ea={key:1,class:`title-row`},ta={class:`title`},na={class:`style`},ra={key:2,class:`progress-row`},ia={class:`progress-text`},aa={class:`right`},oa={class:`el-dropdown-link`},sa={class:`flex items-center min-w-[120px]`},ca={class:`flex items-center min-w-[120px]`},la={class:`flex items-center min-w-[120px]`},ua={class:`el-dropdown-link`};function da(e,s,d,b,x,S){let C=f(`el-checkbox`),w=f(`el-image`),T=f(`video-pause`),E=f(`el-icon`),D=f(`video-play`),O=f(`el-input`),k=f(`font-awesome-icon`),A=f(`el-progress`),j=f(`el-tooltip`),M=f(`Loading`),N=f(`el-dropdown-item`),P=f(`el-dropdown-menu`),F=f(`el-dropdown`),I=f(`api-code-dialog`),L=h(`loading`);return u(),p(`div`,Ki,[(u(!0),p(v,null,c(e.audios,c=>(u(),p(`div`,{key:c.id,class:t([`audio`,{"mashup-selected":e.isMashupSelected(c)}]),onClick:y(t=>e.onClick(c),[`stop`])},[e.isMashupMode&&c?.audio_url?(u(),p(`div`,{key:0,class:`mashup-check`,onClick:y(t=>e.onToggleMashup(c),[`stop`])},[a(C,{"model-value":e.isMashupSelected(c),onClick:s[0]||=y(()=>{},[`stop`])},null,8,[`model-value`])],8,Ji)):o(``,!0),g((u(),p(`div`,Yi,[a(w,{src:c?.image_url,class:`cover`,fit:`cover`,lazy:``},null,8,[`src`]),c?.audio_url&&e.$store.state?.suno?.audio?.id===c.id&&e.$store.state?.suno?.audio?.state===`playing`?(u(),p(`div`,{key:0,class:`overlay`,onClick:y(t=>e.onPause(c),[`stop`])},[a(E,null,{default:m(()=>[a(T)]),_:1})],8,Xi)):o(``,!0),c?.audio_url&&(e.$store.state?.suno?.audio?.id!==c.id||e.$store.state?.suno?.audio?.id===c.id&&e.$store.state?.suno?.audio?.state===`paused`)?(u(),p(`div`,{key:1,class:`overlay`,onClick:y(t=>e.onPlay(c),[`stop`])},[a(E,null,{default:m(()=>[a(D)]),_:1})],8,Zi)):o(``,!0),c?.duration?(u(),p(`div`,Qi,l(e.useFormatDuring(c?.duration)),1)):o(``,!0)])),[[L,!c?.audio_url]]),r(`div`,$i,[e.editingAudioId===c.id?(u(),p(`div`,{key:0,class:`title-edit`,onClick:s[2]||=y(()=>{},[`stop`])},[a(O,{ref_for:!0,ref:`titleInput`,modelValue:e.editingTitle,"onUpdate:modelValue":s[1]||=t=>e.editingTitle=t,size:`small`,onKeyup:[_(t=>e.onSaveTitleEdit(c),[`enter`]),_(e.onCancelTitleEdit,[`escape`])],onBlur:t=>e.onSaveTitleEdit(c)},null,8,[`modelValue`,`onKeyup`,`onBlur`])])):(u(),p(`div`,ea,[r(`h2`,ta,l(c?.title),1),c?.audio_url?(u(),n(k,{key:0,icon:`fa-solid fa-pen`,class:`edit-icon`,onClick:y(t=>e.onStartTitleEdit(c),[`stop`])},null,8,[`onClick`])):o(``,!0)])),r(`p`,na,l(c?.style),1),!c?.audio_url&&c?.progress!=null&&c?.progress<100?(u(),p(`div`,ra,[a(A,{percentage:Math.round(c.progress),"stroke-width":4,"show-text":!1,status:`warning`,class:`progress-bar`},null,8,[`percentage`]),r(`span`,ia,l(e.$t(`suno.name.generating`))+` `+l(Math.round(c.progress))+`%`,1)])):o(``,!0)]),r(`div`,aa,[a(F,null,{dropdown:m(()=>[a(P,null,{default:m(()=>[a(N,{disabled:e.isFetchingVideoUrl,onClick:t=>e.handleVideoDownload(c)},{default:m(()=>[r(`div`,sa,[e.isFetchingVideoUrl?(u(),n(E,{key:0,class:`is-loading mr-2`},{default:m(()=>[a(M)]),_:1})):o(``,!0),r(`span`,null,l(e.$t(`suno.button.download_video`)),1)])]),_:1},8,[`disabled`,`onClick`]),c?.audio_url?(u(),n(N,{key:0,onClick:y(t=>e.onDownload(t,c?.audio_url),[`stop`])},{default:m(()=>[i(l(e.$t(`suno.button.download_audio`)),1)]),_:1},8,[`onClick`])):o(``,!0),a(N,{disabled:e.isFetchingWav,onClick:t=>e.handleWavDownload(c)},{default:m(()=>[r(`div`,ca,[e.isFetchingWav?(u(),n(E,{key:0,class:`is-loading mr-2`},{default:m(()=>[a(M)]),_:1})):o(``,!0),r(`span`,null,l(e.$t(`suno.button.download_wav`)),1)])]),_:1},8,[`disabled`,`onClick`]),a(N,{disabled:e.isFetchingMidi,onClick:t=>e.handleMidiDownload(c)},{default:m(()=>[r(`div`,la,[e.isFetchingMidi?(u(),n(E,{key:0,class:`is-loading mr-2`},{default:m(()=>[a(M)]),_:1})):o(``,!0),r(`span`,null,l(e.$t(`suno.button.download_midi`)),1)])]),_:1},8,[`disabled`,`onClick`])]),_:2},1024)]),default:m(()=>[r(`span`,oa,[a(j,{effect:`dark`,content:e.$t(`suno.button.download`),placement:`top`},{default:m(()=>[c?.audio_url||c?.video_url?(u(),n(k,{key:0,icon:`fa-solid fa-download`,class:`icon icon-download`})):o(``,!0)]),_:2},1032,[`content`])])]),_:2},1024),a(F,null,{dropdown:m(()=>[a(P,{class:`suno-action-menu`},{default:m(()=>[c?.audio_url?(u(),n(N,{key:0,onClick:y(t=>e.onExtend(t,c),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-forward`,class:`menu-icon`}),i(` `+l(e.$t(`suno.button.extend`)),1)]),_:1},8,[`onClick`])):o(``,!0),a(N,{onClick:y(t=>e.onCover(c),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-music`,class:`menu-icon`}),i(` `+l(e.$t(`suno.button.cover_music`)),1)]),_:1},8,[`onClick`]),c?.id?(u(),n(N,{key:1,onClick:y(t=>e.onMashup(c),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-shuffle`,class:`menu-icon`}),i(` `+l(e.$t(`suno.button.mashup`)),1)]),_:1},8,[`onClick`])):o(``,!0),c?.id&&c?.action===`extend`?(u(),n(N,{key:2,onClick:y(t=>e.onConcatMusic(c?.id),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-link`,class:`menu-icon`}),i(` `+l(e.$t(`suno.button.concat_music`)),1)]),_:1},8,[`onClick`])):o(``,!0),s[4]||=r(`div`,{class:`menu-divider`},null,-1),c?.id?(u(),n(N,{key:3,onClick:y(t=>e.onReplaceSection(c),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-scissors`,class:`menu-icon`}),i(` `+l(e.$t(`suno.button.replace_section`)),1)]),_:1},8,[`onClick`])):o(``,!0),c?.id?(u(),n(N,{key:4,onClick:y(t=>e.onOverpainting(c),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-microphone`,class:`menu-icon`}),i(` `+l(e.$t(`suno.button.overpainting`)),1)]),_:1},8,[`onClick`])):o(``,!0),c?.id?(u(),n(N,{key:5,onClick:y(t=>e.onUnderpainting(c),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-guitar`,class:`menu-icon`}),i(` `+l(e.$t(`suno.button.underpainting`)),1)]),_:1},8,[`onClick`])):o(``,!0),c?.id?(u(),n(N,{key:6,onClick:y(t=>e.onSamples(c),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-drum`,class:`menu-icon`}),i(` `+l(e.$t(`suno.button.samples`)),1)]),_:1},8,[`onClick`])):o(``,!0),s[5]||=r(`div`,{class:`menu-divider`},null,-1),c.id?(u(),n(N,{key:7,onClick:y(t=>e.onGetStems(c.id),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-layer-group`,class:`menu-icon`}),i(` `+l(e.$t(`suno.button.get_stems`)),1)]),_:1},8,[`onClick`])):o(``,!0),c.id?(u(),n(N,{key:8,onClick:y(t=>e.onGetAllStems(c.id),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-bars-staggered`,class:`menu-icon`}),i(` `+l(e.$t(`suno.button.all_stems`)),1)]),_:1},8,[`onClick`])):o(``,!0),c?.id?(u(),n(N,{key:9,onClick:y(t=>e.onRemaster(c.id),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-wand-magic-sparkles`,class:`menu-icon`}),i(` `+l(e.$t(`suno.button.remaster`)),1)]),_:1},8,[`onClick`])):o(``,!0),c?.id?(u(),n(N,{key:10,onClick:y(t=>e.onExtractVocals(c.id),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-headphones`,class:`menu-icon`}),i(` `+l(e.$t(`suno.button.extract_vocals`)),1)]),_:1},8,[`onClick`])):o(``,!0),c?.id?(u(),n(N,{key:11,onClick:y(t=>e.onArtistConsistency(c),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-palette`,class:`menu-icon`}),i(` `+l(e.$t(`suno.button.artist_consistency`)),1)]),_:1},8,[`onClick`])):o(``,!0),c?.id?(u(),n(N,{key:12,onClick:y(t=>e.onAdjustSpeed(c),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-gauge-high`,class:`menu-icon`}),i(` `+l(e.$t(`suno.button.adjust_speed`)),1)]),_:1},8,[`onClick`])):o(``,!0),s[6]||=r(`div`,{class:`menu-divider`},null,-1),a(N,{onClick:y(t=>e.onReusePrompt(c),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-rotate-left`,class:`menu-icon`}),i(` `+l(e.$t(`suno.button.reuse_prompt`)),1)]),_:1},8,[`onClick`]),c?.id?(u(),n(N,{key:13,onClick:y(t=>e.onGetTiming(c.id),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-clock`,class:`menu-icon`}),i(` `+l(e.$t(`suno.button.get_timing`)),1)]),_:1},8,[`onClick`])):o(``,!0),a(N,{onClick:y(e.onViewCode,[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-code`,class:`menu-icon`}),i(` `+l(e.$t(`common.button.viewCode`)),1)]),_:1},8,[`onClick`]),s[7]||=r(`div`,{class:`menu-divider`},null,-1),c?.id?(u(),n(N,{key:14,class:`delete-item`,onClick:y(t=>e.onDelete(c),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-trash`,class:`menu-icon delete-icon`}),i(` `+l(e.$t(`suno.button.delete`)),1)]),_:1},8,[`onClick`])):o(``,!0)]),_:2},1024)]),default:m(()=>[r(`span`,ua,[a(j,{effect:`dark`,content:e.$t(`suno.button.more`),placement:`top`},{default:m(()=>[c?.audio_url||c?.video_url?(u(),n(k,{key:0,icon:`fa-solid fa-ellipsis`,class:`icon icon-ellipsis`})):o(``,!0)]),_:2},1032,[`content`])])]),_:2},1024)])],10,qi))),128)),a(I,{visible:e.apiCodeVisible,"onUpdate:visible":s[3]||=t=>e.apiCodeVisible=t,method:`POST`,path:e.apiCodePath,body:e.apiCodeBody,token:e.$store.state.suno?.credential?.token||``},null,8,[`visible`,`path`,`body`,`token`])])}var fa=s({name:`RecentPanel`,components:{ElSkeletonItem:oe,ElSkeleton:se,ElInput:K,ElButton:b,ElDropdown:re,ElDropdownMenu:V,ElDropdownItem:B,ElPopover:ie,ElRadioGroup:R,ElRadioButton:L,ElSelect:E,ElOption:D,FontAwesomeIcon:Z,TaskPreview:W(Gi,[[`render`,da]]),Player:Te,NoTasks:Se,ScrollList:ve},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0,searchQuery:``,sortBy:`newest`,filterType:`all`,filterDuration:`all`,filterVideo:`all`,filterModel:`all`}},computed:{tasks(){return{...this.$store.state.suno?.tasks,items:this.$store.state.suno?.tasks?.items?.slice()}},sortLabel(){return this.sortBy===`newest`?this.$t(`suno.sort.newest`):this.$t(`suno.sort.oldest`)},activeFilterCount(){let e=0;return this.filterType!==`all`&&e++,this.filterDuration!==`all`&&e++,this.filterVideo!==`all`&&e++,this.filterModel&&this.filterModel!==`all`&&e++,e},availableModels(){let e=this.tasks?.items||[],t=new Set;for(let n of e){let e=n?.response?.data??[];for(let n of e)n.model&&t.add(n.model)}return Array.from(t).sort()},filteredTasks(){let e=this.tasks?.items||[];if(this.searchQuery){let t=this.searchQuery.toLowerCase();e=e.filter(e=>(e?.response?.data??[]).some(e=>e.title?.toLowerCase().includes(t)||e.style?.toLowerCase().includes(t)||e.prompt?.toLowerCase().includes(t)))}return this.activeFilterCount>0&&(e=e.filter(e=>{let t=e?.request??{},n=e?.response?.data??[];return this.filterType===`vocal`&&t.instrumental===!0||this.filterType===`instrumental`&&t.instrumental!==!0?!1:this.filterDuration!==`all`||this.filterVideo!==`all`||this.filterModel&&this.filterModel!==`all`?n.some(e=>!(this.filterDuration===`short`&&!(typeof e.duration==`number`&&e.duration<60)||this.filterDuration===`medium`&&!(typeof e.duration==`number`&&e.duration>=60&&e.duration<=180)||this.filterDuration===`long`&&!(typeof e.duration==`number`&&e.duration>180)||this.filterVideo===`with`&&!e.video_url||this.filterVideo===`without`&&e.video_url||this.filterModel&&this.filterModel!==`all`&&e.model!==this.filterModel)):!0})),this.sortBy===`oldest`&&(e=[...e].reverse()),e}},methods:{onSortChange(e){this.sortBy=e},onResetFilters(){this.filterType=`all`,this.filterDuration=`all`,this.filterVideo=`all`,this.filterModel=`all`},getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),pa={key:0,class:`tasks`},ma={class:`left w-[70px] p-[10px] flex items-center`},ha={class:`main w-[calc(100%-70px)] flex-1 p-[10px]`},ga={key:0,class:`task-toolbar`},_a={key:0,class:`filter-badge`},va={class:`filter-popover`},ya={class:`filter-row`},ba={class:`filter-label`},xa={class:`filter-row`},Sa={class:`filter-label`},Ca={class:`filter-row`},wa={class:`filter-label`},Ta={key:0,class:`filter-row`},Ea={class:`filter-label`},Da={class:`filter-actions`},Oa={key:2,class:`w-full flex-1 flex items-center justify-center`},ka={class:`text-sm text-gray-400`},Aa={key:3,class:`w-full flex-1 flex flex-col items-center justify-center gap-2`},ja={class:`text-sm text-gray-400`},Ma={key:4,class:`w-full flex-1 flex items-center justify-center`},Na={class:`h-20`};function Pa(e,s,h,_,y,b){let x=f(`el-skeleton-item`),S=f(`el-skeleton`),C=f(`font-awesome-icon`),w=f(`el-input`),T=f(`el-button`),E=f(`el-dropdown-item`),D=f(`el-dropdown-menu`),O=f(`el-dropdown`),k=f(`el-radio-button`),A=f(`el-radio-group`),j=f(`el-option`),M=f(`el-select`),N=f(`el-popover`),P=f(`task-preview`),F=f(`scroll-list`),I=f(`no-tasks`),L=f(`player`);return u(),p(v,null,[e.tasks?.items===void 0?(u(),p(`div`,pa,[(u(),p(v,null,c(3,e=>r(`div`,{key:e,class:`flex`},[r(`div`,ma,[a(S,{animated:``},{template:m(()=>[a(x,{variant:`image`,class:`avatar w-[50px] h-[50px]`})]),_:1})]),r(`div`,ha,[a(S,{animated:``},{template:m(()=>[a(x,{variant:`p`,class:`w-[200px] h-[15px] mb-[5px] mt-[10px]`}),a(x,{variant:`text`})]),_:1})])])),64))])):(u(),p(v,{key:1},[e.tasks?.items?.length?(u(),p(`div`,ga,[a(w,{modelValue:e.searchQuery,"onUpdate:modelValue":s[0]||=t=>e.searchQuery=t,size:`small`,placeholder:e.$t(`suno.placeholder.searchSongs`),clearable:``,class:`task-search`},{prefix:m(()=>[a(C,{icon:`fa-solid fa-magnifying-glass`,class:`text-xs`})]),_:1},8,[`modelValue`,`placeholder`]),a(O,{trigger:`click`,onCommand:e.onSortChange},{dropdown:m(()=>[a(D,null,{default:m(()=>[a(E,{command:`newest`,class:t({"is-active":e.sortBy===`newest`})},{default:m(()=>[i(l(e.$t(`suno.sort.newest`)),1)]),_:1},8,[`class`]),a(E,{command:`oldest`,class:t({"is-active":e.sortBy===`oldest`})},{default:m(()=>[i(l(e.$t(`suno.sort.oldest`)),1)]),_:1},8,[`class`])]),_:1})]),default:m(()=>[a(T,{size:`small`,class:`sort-btn`},{default:m(()=>[a(C,{icon:`fa-solid fa-arrow-down-wide-short`,class:`mr-1`}),i(` `+l(e.sortLabel),1)]),_:1})]),_:1},8,[`onCommand`]),a(N,{trigger:`click`,placement:`bottom-end`,width:260},{reference:m(()=>[a(T,{size:`small`,class:t([`filter-btn`,{"has-active-filter":e.activeFilterCount>0}])},{default:m(()=>[a(C,{icon:`fa-solid fa-filter`,class:`mr-1`}),i(` `+l(e.$t(`suno.filter.title`))+` `,1),e.activeFilterCount>0?(u(),p(`span`,_a,l(e.activeFilterCount),1)):o(``,!0)]),_:1},8,[`class`])]),default:m(()=>[r(`div`,va,[r(`div`,ya,[r(`div`,ba,l(e.$t(`suno.filter.type`)),1),a(A,{modelValue:e.filterType,"onUpdate:modelValue":s[1]||=t=>e.filterType=t,size:`small`},{default:m(()=>[a(k,{value:`all`},{default:m(()=>[i(l(e.$t(`suno.filter.typeAll`)),1)]),_:1}),a(k,{value:`vocal`},{default:m(()=>[i(l(e.$t(`suno.filter.typeVocal`)),1)]),_:1}),a(k,{value:`instrumental`},{default:m(()=>[i(l(e.$t(`suno.filter.typeInstrumental`)),1)]),_:1})]),_:1},8,[`modelValue`])]),r(`div`,xa,[r(`div`,Sa,l(e.$t(`suno.filter.duration`)),1),a(A,{modelValue:e.filterDuration,"onUpdate:modelValue":s[2]||=t=>e.filterDuration=t,size:`small`},{default:m(()=>[a(k,{value:`all`},{default:m(()=>[i(l(e.$t(`suno.filter.durationAll`)),1)]),_:1}),a(k,{value:`short`},{default:m(()=>[i(l(e.$t(`suno.filter.durationShort`)),1)]),_:1}),a(k,{value:`medium`},{default:m(()=>[i(l(e.$t(`suno.filter.durationMedium`)),1)]),_:1}),a(k,{value:`long`},{default:m(()=>[i(l(e.$t(`suno.filter.durationLong`)),1)]),_:1})]),_:1},8,[`modelValue`])]),r(`div`,Ca,[r(`div`,wa,l(e.$t(`suno.filter.video`)),1),a(A,{modelValue:e.filterVideo,"onUpdate:modelValue":s[3]||=t=>e.filterVideo=t,size:`small`},{default:m(()=>[a(k,{value:`all`},{default:m(()=>[i(l(e.$t(`suno.filter.videoAll`)),1)]),_:1}),a(k,{value:`with`},{default:m(()=>[i(l(e.$t(`suno.filter.videoWith`)),1)]),_:1}),a(k,{value:`without`},{default:m(()=>[i(l(e.$t(`suno.filter.videoWithout`)),1)]),_:1})]),_:1},8,[`modelValue`])]),e.availableModels.length>0?(u(),p(`div`,Ta,[r(`div`,Ea,l(e.$t(`suno.filter.model`)),1),a(M,{modelValue:e.filterModel,"onUpdate:modelValue":s[4]||=t=>e.filterModel=t,size:`small`,placeholder:e.$t(`suno.filter.modelAll`),clearable:``},{default:m(()=>[a(j,{label:e.$t(`suno.filter.modelAll`),value:`all`},null,8,[`label`]),(u(!0),p(v,null,c(e.availableModels,e=>(u(),n(j,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])):o(``,!0),r(`div`,Da,[a(T,{size:`small`,text:``,onClick:e.onResetFilters},{default:m(()=>[i(l(e.$t(`suno.filter.reset`)),1)]),_:1},8,[`onClick`])])])]),_:1})])):o(``,!0),e.filteredTasks?.length>0?(u(),n(F,{key:1,ref:`scrollList`,class:`flex-1 w-full overflow-y-auto tasks p-2`,loading:e.loading,onReachTop:s[5]||=t=>e.$emit(`reach-top`)},{default:m(()=>[(u(!0),p(v,null,c(e.filteredTasks,(e,t)=>(u(),n(P,{key:t,"model-value":e,class:`preview`},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):e.searchQuery&&e.tasks?.items?.length>0?(u(),p(`div`,Oa,[r(`p`,ka,l(e.$t(`suno.message.noSearchResults`)),1)])):e.activeFilterCount>0&&e.tasks?.items?.length>0?(u(),p(`div`,Aa,[r(`p`,ja,l(e.$t(`suno.message.noFilterResults`)),1),a(T,{size:`small`,text:``,onClick:e.onResetFilters},{default:m(()=>[i(l(e.$t(`suno.filter.reset`)),1)]),_:1},8,[`onClick`])])):e.tasks?.items?.length===0?(u(),p(`div`,Ma,[a(I)])):o(``,!0)],64)),g(r(`div`,Na,[a(L,{namespace:`suno`})],512),[[d,!!e.$store?.state?.suno?.audio?.object]])],64)}var Fa=W(fa,[[`render`,Pa],[`__scopeId`,`data-v-6ce376c9`]]),Ia=s({name:`TaskPreview`,components:{IconPicture:T,ElImage:P,ElAvatar:F,ElIcon:w},computed:{audio(){return this.$store.state.suno?.audio}}}),La={key:0,class:`size-full overflow-hidden`},Ra={class:`relative h-[300px]`},za={class:`flex items-center justify-center size-full bg-[var(--el-bg-color)]`},Ba={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`},Va={class:`p-4`},Ha={class:`flex items-center font-bold mb-2`},Ua={class:`text-[var(--el-text-color-regular)] mb-2`},Wa={class:`text-xs text-[var(--el-text-color-regular)]`},Ga={class:`mt-4 text-sm leading-[25px] whitespace-pre-wrap`},Ka={key:1,class:`w-full h-full`};function qa(e,t,n,i,o,s){let c=f(`icon-picture`),d=f(`el-icon`),h=f(`el-image`),g=f(`el-avatar`);return e.audio?.object?(u(),p(`div`,La,[r(`div`,Ra,[a(h,{src:e.audio.image_url,fit:`cover`,class:`size-full`},{error:m(()=>[r(`div`,za,[a(d,{class:`text-3xl`},{default:m(()=>[a(c)]),_:1})])]),_:1},8,[`src`]),r(`h2`,Ba,l(e.audio?.title),1)]),r(`div`,Va,[r(`div`,Ha,[a(g,{size:30,src:e.audio?.image_url,class:`mr-2`},null,8,[`src`]),r(`span`,null,l(e.audio?.title),1)]),r(`p`,Ua,l(e.audio?.style),1),r(`p`,Wa,l(e.$dayjs.format(e.audio?.created_at)),1),r(`div`,Ga,[r(`p`,null,l(e.audio?.lyric),1)])])])):(u(),p(`div`,Ka))}var Ja=W(Ia,[[`render`,qa]]),Ya=U(`suno`),Xa=s({name:`SunoIndex`,components:{Layout:Me,ConfigPanel:Hi,RecentPanel:Fa,PreviewPanel:Ja},mixins:[ge],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.suno?.status?.getApplications===J.Request},tasksLoading(){return this.$store.state.suno?.status?.getTasks===J.Request||this.fetchingTasks},service(){return this.$store.state.suno.service},credential(){return this.$store.state.suno.credential},config(){return this.$store.state.suno.config},initializing(){return this.$store.state.suno.status.getApplications===J.Request},needApply(){return this.$store.state.suno.status.getApplications===J.Success&&!this.application},application(){return this.$store.state.suno.application},tasks(){return this.$store.state.suno.tasks},applications(){return this.$store.state.suno.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 be({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(`suno/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplications`),await this.$store.dispatch(`suno/getApplications`),console.debug(`end onGetApplications`),await this.onGetTasks()},onApply(){me.create({application:this.application}).then(({data:e})=>{this.application=e,G.success(this.$t(`application.message.applySuccessfully`))}).catch(e=>{e?.response?.data?.code===`duplication`&&G.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(`suno/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerateAudio(){if(!de(this.uploadTracker,e=>this.$t(e),e=>G.warning(e)))return;let e={...this.config,callback_url:Ya};if(!this.hasSunoInput(e)){G.error(this.$t(`suno.message.promptRequired`));return}this.hasText(e.prompt)&&(e.prompt=e.prompt.trim());let t=this.credential?.token;if(!t){console.error(`no token specified`);return}G.info(this.$t(`suno.message.startingTask`)),pe(`suno`,X.audio(e,{token:t})).then(()=>{G.success(this.$t(`suno.message.startTaskSuccess`))}).catch(e=>{G.error(e?.response?.data?.error?.message||this.$t(`suno.message.startTaskFailed`))}).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},hasSunoInput(e){return[e.prompt,e.lyric,e.lyric_prompt,e.style,e.title].some(e=>this.hasText(e))||this.hasText(e.audio_id)||Array.isArray(e.mashup_audio_ids)&&e.mashup_audio_ids.length>0}}});function Za(e,t,r,i,o,s){let c=f(`config-panel`),l=f(`recent-panel`),d=f(`preview-panel`),p=f(`layout`);return u(),n(p,null,{config:m(()=>[a(c,{onGenerate:e.onGenerateAudio},null,8,[`onGenerate`])]),result:m(()=>[a(l,{ref:`recentPanel`,class:`panel recent`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),preview:m(()=>[a(d)]),_:1})}var Qa=W(Xa,[[`render`,Za],[`__scopeId`,`data-v-b9beee12`]]);export{Qa 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,tt as h,ut as g,v as _,x as v,y}from"./vendor-chart-mdwpew_o.js";import{t as b}from"./button-DWzbdjZV.js";import{F as x,X as S,Y as C,tt as w,z as T}from"./use-deprecated-CPfQu7wa.js";import{r as E,t as D}from"./select-Dd2EIHDR.js";import{n as O,t as k}from"./tabs-Iq532XbG.js";import{n as A,t as j}from"./form-D0aSFxDK.js";import{t as M}from"./upload-HDT7x_5o.js";import{t as N}from"./tooltip-C3PYfh8V.js";import{t as P}from"./image-dbbYkOOx.js";import{t as F}from"./avatar-DJGt2zYX.js";import{t as I}from"./checkbox-hfJFSY6z.js";import{n as L,r as R,t as ee}from"./radio-IJQsW93X.js";import{n as te,t as ne}from"./collapse-D67Kjcrc.js";import{t as z}from"./drawer-BvYPSxXh.js";import{n as B,r as re,t as V}from"./dropdown-DGc8udGs.js";import{t as H}from"./input-number-BpGzQCcW.js";import{t as ie}from"./popover-BUTBEKcB.js";import{t as ae}from"./progress-Djs_fbqu.js";import{n as oe,t as se}from"./skeleton-Cn4UY-T8.js";import{t as ce}from"./slider-BHp2gKVa.js";import{t as le}from"./switch-C6k-HtKw.js";import{di as U,jn as ue}from"./constants-DDcIM163.js";import{An as de,At as fe,E as W,Fn as pe,Ir as G,Mr as K,Nt as me,Or as q,Ot as he,Sr as ge,kr as J,kt as _e,rn as Y,yr as X}from"./index-C16pnEK3.js";import{t as Z}from"./index.es-D96NPyN9.js";import{i as Q,n as ve,r as ye,t as be}from"./pagination-DThkyS9k.js";import{n as xe,t as Se}from"./NoTasks-qUri5oTo.js";import{t as Ce}from"./Consumption-Jipz0FdC.js";import{n as we,r as $,t as Te}from"./Player-DnAW_Yqr.js";var Ee=s({name:`LayoutSuno`,components:{ElDrawer:z,ElButton:b,FontAwesomeIcon:Z},data(){return{drawer:!1,preview:!1}},computed:{}}),De={class:`main flex flex-row flex-1`},Oe={class:`config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},ke={class:`result h-full flex flex-col flex-1 min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`},Ae={class:`preview h-full w-[300px] flex flex-col`};function je(t,n,i,o,s,c){let l=f(`font-awesome-icon`),d=f(`el-button`),h=f(`el-drawer`);return u(),p(`div`,De,[r(`div`,Oe,[e(t.$slots,`config`,{},void 0,!0)]),r(`div`,ke,[e(t.$slots,`result`,{},void 0,!0)]),r(`div`,Ae,[e(t.$slots,`preview`,{},void 0,!0)]),a(d,{circle:``,class:`menu`,onClick:n[0]||=e=>t.drawer=!0},{default:m(()=>[a(l,{icon:`fa-solid fa-magic`})]),_:1}),a(h,{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 Me=W(Ee,[[`render`,je],[`__scopeId`,`data-v-abe843c9`]]),Ne=s({name:`TypeSelector`,components:{ElSelect:E,ElOption:D,ElSwitch:le},data(){return{options:[{label:`v5.5`,value:`chirp-v5-5`,desc:this.$t(`suno.model.v55desc`)},{label:`v5`,value:`chirp-v5`,desc:this.$t(`suno.model.v5desc`)},{label:`v4.5+`,value:`chirp-v4-5-plus`,desc:this.$t(`suno.model.v45plusdesc`)},{label:`v4.5`,value:`chirp-v4-5`,desc:this.$t(`suno.model.v45desc`),dividerAfter:!0},{label:`v4`,value:`chirp-v4`,desc:this.$t(`suno.model.v4desc`)},{label:`v3.5`,value:`chirp-v3-5`,desc:this.$t(`suno.model.v35desc`)},{label:`v3`,value:`chirp-v3-0`,desc:this.$t(`suno.model.v3desc`)}]}},computed:{custom:{get(){return this.$store.state.suno?.config?.custom||!1},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,custom:e})}},instrumental:{get(){return this.$store.state.suno?.config?.instrumental||!1},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,instrumental:e})}},model:{get(){return this.$store.state.suno?.config?.model},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,model:e})}}},mounted(){this.model||=ue}}),Pe={class:`mb-3`},Fe={class:`flex items-center mb-1`},Ie={class:`text-sm font-bold`},Le={class:`model-option`},Re={class:`model-option-left`},ze={class:`model-option-name`},Be={class:`model-option-desc`},Ve={key:0,class:`flex items-center justify-between mb-3`},He={class:`text-sm font-bold`};function Ue(e,i,s,d,h,g){let _=f(`el-option`),y=f(`el-select`),b=f(`el-switch`);return u(),p(`div`,null,[r(`div`,Pe,[r(`div`,Fe,[r(`span`,Ie,l(e.$t(`suno.name.model`)),1)]),a(y,{modelValue:e.model,"onUpdate:modelValue":i[0]||=t=>e.model=t,class:`w-full model-select`,size:`default`,placeholder:e.$t(`suno.placeholder.select`)},{default:m(()=>[(u(!0),p(v,null,c(e.options,e=>(u(),n(_,{key:e.value,label:e.label,value:e.value,class:t({"model-option-divider":e.dividerAfter})},{default:m(()=>[r(`div`,Le,[r(`div`,Re,[r(`span`,ze,l(e.label),1)]),r(`span`,Be,l(e.desc),1)])]),_:2},1032,[`label`,`value`,`class`]))),128))]),_:1},8,[`modelValue`,`placeholder`])]),e.custom?(u(),p(`div`,Ve,[r(`span`,He,l(e.$t(`suno.name.instrumental`)),1),a(b,{modelValue:e.instrumental,"onUpdate:modelValue":i[1]||=t=>e.instrumental=t},null,8,[`modelValue`])])):o(``,!0)])}var We=W(Ne,[[`render`,Ue],[`__scopeId`,`data-v-16e4d6fc`]]),Ge=s({name:`UploadAudio`,components:{ElUpload:M,ElButton:b,ElDialog:K,ElTabs:O,ElTabPane:k,InfoIcon:Q,FontAwesomeIcon:Z,ElRadioGroup:R,ElRadioButton:L},mixins:[_e],emits:[`change`],data(){return{fileList:[],uploadUrl:ge()+`/api/v1/files/`,dialogVisible:!1,activeTab:`browse`,recording:!1,recordedBlob:null,recordedAudioUrl:null,audioPreviewUrl:null,recordTimer:null,recordSeconds:0,mediaRecorder:null,mediaStream:null,recordedChunks:[],uploadingRecord:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},credential(){return this.$store.state.suno.credential},config(){return this.$store.state.suno.config},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.suno?.config?.audio_id},set(){}},hasUploadedAudio(){let e=this.$store.state.suno?.config?.action;return e===`upload_extend`||e===`upload_cover`},uploadAction:{get(){return this.$store.state.suno?.config?.action||`upload_extend`},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,action:e})}},formattedTime(){return`${Math.floor(this.recordSeconds/60).toString().padStart(2,`0`)}:${(this.recordSeconds%60).toString().padStart(2,`0`)}`}},watch:{urls:{handler(e){this.$emit(`change`,e)}}},beforeUnmount(){this.cleanupRecording()},methods:{onExceed(){J.warning(this.$t(`suno.message.uploadReferencesExceed`))},onError(){J.error(this.$t(`suno.message.uploadReferencesError`))},async onBrowseSuccess(){let e=this.urls?.[0];e&&(this.audioPreviewUrl=e,await this.onGenerateAudioId(e),this.dialogVisible=!1)},async onGenerateAudioId(e){let t={audio_url:e},n=this.credential?.token;if(!n){console.error(`no token specified`);return}J.info(this.$t(`suno.message.startingUploadAudio`));try{let e=await Y.upload(t,{token:n});console.debug(`get upload music success`,e.data);let r=e.data?.data.audio_id;this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,audio_id:r,action:`upload_extend`}),J.success(this.$t(`suno.message.startUploadAudioSuccess`))}catch(e){J.error(e?.response?.data?.error?.message||this.$t(`suno.message.startUploadAudioFailed`))}},async startRecording(){if(!navigator.mediaDevices?.getUserMedia||typeof MediaRecorder>`u`){J.error(this.$t(`suno.message.recordingUnsupported`));return}try{this.mediaStream=await navigator.mediaDevices.getUserMedia({audio:!0}),this.recordedChunks=[],this.mediaRecorder=new MediaRecorder(this.mediaStream),this.mediaRecorder.ondataavailable=e=>{e.data&&e.data.size>0&&this.recordedChunks.push(e.data)},this.mediaRecorder.onstop=()=>{let e=new Blob(this.recordedChunks,{type:`audio/webm`});this.recordedBlob=e,this.recordedAudioUrl&&URL.revokeObjectURL(this.recordedAudioUrl),this.recordedAudioUrl=URL.createObjectURL(e),this.releaseStream()},this.mediaRecorder.start(),this.recording=!0,this.recordSeconds=0,this.recordTimer=window.setInterval(()=>{this.recordSeconds+=1,this.recordSeconds>=600&&this.stopRecording()},1e3)}catch(e){console.error(`record error`,e),J.error(this.$t(`suno.message.recordingPermissionDenied`))}},stopRecording(){this.recordTimer&&=(window.clearInterval(this.recordTimer),null),this.mediaRecorder&&this.mediaRecorder.state!==`inactive`&&this.mediaRecorder.stop(),this.recording=!1},resetRecording(){this.recordedAudioUrl&&URL.revokeObjectURL(this.recordedAudioUrl),this.recordedBlob=null,this.recordedAudioUrl=null,this.recordSeconds=0},async uploadRecording(){if(this.recordedBlob){this.uploadingRecord=!0;try{let e=new FormData,t=`recording-${Date.now()}.webm`;e.append(`file`,this.recordedBlob,t);let n=await fetch(this.uploadUrl,{method:`POST`,headers:{Authorization:`Bearer ${this.$store.state.token.access}`},body:e});if(!n.ok)throw Error(`upload failed: ${n.status}`);let r=await n.json(),i=r?.file_url||r?.data?.file_url;if(!i)throw Error(`no file_url in response`);this.audioPreviewUrl=i,await this.onGenerateAudioId(i),this.dialogVisible=!1,this.resetRecording()}catch(e){console.error(e),J.error(e?.message||this.$t(`suno.message.uploadReferencesError`))}finally{this.uploadingRecord=!1}}},releaseStream(){this.mediaStream&&=(this.mediaStream.getTracks().forEach(e=>e.stop()),null)},cleanupRecording(){this.recordTimer&&=(window.clearInterval(this.recordTimer),null),this.releaseStream(),this.recordedAudioUrl&&=(URL.revokeObjectURL(this.recordedAudioUrl),null)}}}),Ke={class:`relative`},qe={class:`flex justify-between items-center mb-2`},Je={class:`flex justify-start items-center`},Ye={class:`text-sm font-bold`},Xe={key:0,class:`mb-2`},Ze=[`src`],Qe={key:1,class:`mt-2`},$e={class:`py-4`},et={class:`text-center py-6`},tt={class:`text-sm`},nt={class:`text-xs text-gray-400 mt-1`},rt={class:`py-4 text-center`},it={class:`recorder-display mb-4`},at={key:0,class:`text-red-500 flex items-center justify-center gap-2`},ot={class:`text-2xl font-mono`},st={key:1,class:`text-green-600`},ct={key:2,class:`text-gray-400 text-2xl font-mono`},lt={key:0,class:`mb-4`},ut=[`src`],dt={class:`flex justify-center gap-3`};function ft(e,t,s,c,d,h){let g=f(`info-icon`),_=f(`font-awesome-icon`),y=f(`el-button`),b=f(`el-radio-button`),x=f(`el-radio-group`),S=f(`el-upload`),C=f(`el-tab-pane`),w=f(`el-tabs`),T=f(`el-dialog`);return u(),p(`div`,Ke,[r(`div`,qe,[r(`div`,Je,[r(`span`,Ye,l(e.$t(`suno.name.referenceAudios`)),1),a(g,{content:e.$t(`suno.description.uploadAudios`)},null,8,[`content`])]),a(y,{round:``,type:`primary`,size:`small`,onClick:t[0]||=t=>e.dialogVisible=!0},{default:m(()=>[a(_,{icon:`fa-solid fa-plus`,class:`icon mr-1`}),i(` `+l(e.$t(`suno.button.addAudio`)),1)]),_:1})]),e.audioPreviewUrl?(u(),p(`div`,Xe,[r(`audio`,{src:e.audioPreviewUrl,controls:``,class:`w-full`},null,8,Ze)])):o(``,!0),e.hasUploadedAudio?(u(),p(`div`,Qe,[a(x,{modelValue:e.uploadAction,"onUpdate:modelValue":t[1]||=t=>e.uploadAction=t,size:`small`},{default:m(()=>[a(b,{value:`upload_extend`},{default:m(()=>[i(l(e.$t(`suno.button.extend`)),1)]),_:1}),a(b,{value:`upload_cover`},{default:m(()=>[i(l(e.$t(`suno.button.upload_cover`)),1)]),_:1})]),_:1},8,[`modelValue`])])):o(``,!0),a(T,{modelValue:e.dialogVisible,"onUpdate:modelValue":t[4]||=t=>e.dialogVisible=t,title:e.$t(`suno.name.addAudio`),width:`520px`,"close-on-click-modal":!1,"append-to-body":``},{default:m(()=>[a(w,{modelValue:e.activeTab,"onUpdate:modelValue":t[3]||=t=>e.activeTab=t,class:`add-audio-tabs`},{default:m(()=>[a(C,{name:`browse`,label:e.$t(`suno.tab.browse`)},{default:m(()=>[r(`div`,$e,[a(S,{"file-list":e.fileList,"onUpdate:fileList":t[2]||=t=>e.fileList=t,name:`file`,limit:1,class:`upload-wrapper`,action:e.uploadUrl,accept:`.mp3,.wav,.m4a,audio/*`,"show-file-list":!0,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onBrowseSuccess,headers:e.headers,drag:``},{default:m(()=>[r(`div`,et,[a(_,{icon:`fa-solid fa-upload`,class:`text-4xl text-gray-400 mb-3`}),r(`div`,tt,l(e.$t(`suno.description.dropAudioHere`)),1),r(`div`,nt,l(e.$t(`suno.description.audioFormats`)),1)])]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])]),_:1},8,[`label`]),a(C,{name:`record`,label:e.$t(`suno.tab.record`)},{default:m(()=>[r(`div`,rt,[r(`div`,it,[e.recording?(u(),p(`div`,at,[t[5]||=r(`span`,{class:`recording-dot`},null,-1),r(`span`,ot,l(e.formattedTime),1)])):e.recordedBlob?(u(),p(`div`,st,[a(_,{icon:`fa-solid fa-check-circle`,class:`text-2xl mr-2`}),r(`span`,null,l(e.$t(`suno.message.recordingReady`))+` (`+l(e.formattedTime)+`)`,1)])):(u(),p(`div`,ct,`00:00`))]),e.recordedAudioUrl&&!e.recording?(u(),p(`div`,lt,[r(`audio`,{src:e.recordedAudioUrl,controls:``,class:`w-full`},null,8,ut)])):o(``,!0),r(`div`,dt,[!e.recording&&!e.recordedBlob?(u(),n(y,{key:0,type:`primary`,round:``,onClick:e.startRecording},{default:m(()=>[a(_,{icon:`fa-solid fa-microphone`,class:`mr-1`}),i(` `+l(e.$t(`suno.button.startRecord`)),1)]),_:1},8,[`onClick`])):o(``,!0),e.recording?(u(),n(y,{key:1,type:`danger`,round:``,onClick:e.stopRecording},{default:m(()=>[a(_,{icon:`fa-solid fa-stop`,class:`mr-1`}),i(` `+l(e.$t(`suno.button.stopRecord`)),1)]),_:1},8,[`onClick`])):o(``,!0),e.recordedBlob&&!e.recording?(u(),p(v,{key:2},[a(y,{round:``,onClick:e.resetRecording},{default:m(()=>[a(_,{icon:`fa-solid fa-rotate-left`,class:`mr-1`}),i(` `+l(e.$t(`suno.button.reRecord`)),1)]),_:1},8,[`onClick`]),a(y,{type:`primary`,round:``,loading:e.uploadingRecord,onClick:e.uploadRecording},{default:m(()=>[a(_,{icon:`fa-solid fa-upload`,class:`mr-1`}),i(` `+l(e.$t(`suno.button.useRecording`)),1)]),_:1},8,[`loading`,`onClick`])],64)):o(``,!0)])])]),_:1},8,[`label`])]),_:1},8,[`modelValue`])]),_:1},8,[`modelValue`,`title`])])}var pt=W(Ge,[[`render`,ft],[`__scopeId`,`data-v-5f17a1f4`]]),mt=[{key:`lofi`,label:`🎧 Lo-fi Chill`,prompt:`a relaxing lo-fi hip hop beat for studying`},{key:`pop-love`,label:`💕 Pop Love Song`,prompt:`a catchy pop love song with sweet melodies`},{key:`rock-anthem`,label:`🎸 Rock Anthem`,prompt:`an energetic rock anthem with electric guitars`},{key:`jazz-night`,label:`🎷 Jazz Night`,prompt:`a smooth late-night jazz piece with saxophone`},{key:`edm-drop`,label:`⚡ EDM Drop`,prompt:`an intense EDM track with a massive drop`},{key:`folk-story`,label:`🪕 Folk Story`,prompt:`a warm folk song telling a story about traveling`},{key:`rnb-groove`,label:`🎤 R&B Groove`,prompt:`a smooth R&B groove with soulful vocals`},{key:`classical`,label:`🎻 Classical`,prompt:`an elegant classical piece for orchestra`},{key:`hip-hop`,label:`🎤 Hip Hop`,prompt:`a hard-hitting hip hop beat with bass`},{key:`country`,label:`🤠 Country`,prompt:`an upbeat country song with acoustic guitar and banjo`},{key:`reggae`,label:`🌴 Reggae`,prompt:`a laid-back reggae tune with island vibes`},{key:`latin`,label:`💃 Latin`,prompt:`a vibrant Latin dance track with percussion`},{key:`ambient`,label:`🌊 Ambient`,prompt:`a dreamy ambient soundscape for relaxation`},{key:`metal`,label:`🤘 Metal`,prompt:`a powerful metal song with heavy riffs and double bass drums`},{key:`soul`,label:`🎵 Soul`,prompt:`a heartfelt soul ballad with gospel harmonies`},{key:`synthwave`,label:`🌃 Synthwave`,prompt:`a retro synthwave track with 80s vibes`},{key:`kpop`,label:`🇰🇷 K-Pop`,prompt:`a catchy K-pop dance track with hook`},{key:`lullaby`,label:`🌙 Lullaby`,prompt:`a gentle lullaby for bedtime with soft piano`},{key:`cinematic`,label:`🎬 Cinematic`,prompt:`an epic cinematic orchestral score for a movie trailer`},{key:`blues`,label:`🎸 Blues`,prompt:`a soulful blues song with electric guitar bends`},{key:`disco`,label:`🕺 Disco`,prompt:`a funky disco track with groovy bassline`},{key:`punk`,label:`🔥 Punk Rock`,prompt:`a fast punk rock song with raw energy`},{key:`gospel`,label:`⛪ Gospel`,prompt:`an uplifting gospel choir song with piano`},{key:`trap`,label:`🔊 Trap`,prompt:`a dark trap beat with 808s and hi-hats`},{key:`bossa`,label:`☕ Bossa Nova`,prompt:`a gentle bossa nova with nylon guitar`},{key:`indie`,label:`🎶 Indie`,prompt:`a dreamy indie track with ethereal vocals`},{key:`cpop`,label:`🇨🇳 C-Pop`,prompt:`a beautiful Chinese pop ballad with emotional vocals`},{key:`jpop`,label:`🇯🇵 J-Pop`,prompt:`a cheerful J-pop song with anime vibes`},{key:`afrobeat`,label:`🥁 Afrobeat`,prompt:`a groovy Afrobeat track with layered percussion`},{key:`game`,label:`🎮 Game BGM`,prompt:`an adventurous video game background music`}],ht=8;function gt(e){let t=[...e];for(let e=t.length-1;e>0;e--){let n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}return t}var _t=s({name:`PromptInput`,components:{FontAwesomeIcon:Z,PromptTextarea:xe},data(){return{shuffledTags:gt(mt)}},computed:{prompt:{get(){return this.$store.state.suno?.config?.prompt},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,prompt:e})}},visibleTags(){return this.shuffledTags.slice(0,ht)}},mounted(){this.prompt||=``},methods:{onTagClick(e){this.prompt=e.prompt},onRefreshTags(){this.shuffledTags=gt(mt)}}}),vt={class:`inspo-tags`},yt=[`onClick`];function bt(e,t,i,o,s,d){let h=f(`font-awesome-icon`),g=f(`prompt-textarea`);return u(),n(g,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||=t=>e.prompt=t,title:e.$t(`suno.name.songDescription`),info:e.$t(`suno.description.prompt`),placeholder:e.$t(`suno.placeholder.prompt`),"min-rows":5,"max-rows":14},{after:m(()=>[r(`div`,vt,[(u(!0),p(v,null,c(e.visibleTags,t=>(u(),p(`button`,{key:t.key,class:`inspo-tag`,onClick:n=>e.onTagClick(t)},l(t.label),9,yt))),128)),r(`button`,{class:`inspo-tag inspo-tag-refresh`,onClick:t[0]||=(...t)=>e.onRefreshTags&&e.onRefreshTags(...t)},[a(h,{icon:`fa-solid fa-arrows-rotate`})])])]),_:1},8,[`modelValue`,`title`,`info`,`placeholder`])}var xt=W(_t,[[`render`,bt],[`__scopeId`,`data-v-58ffcd38`]]),St=s({name:`LyricInput`,components:{ElInput:G,ElButton:b,ElTooltip:N,ElDialog:K,FontAwesomeIcon:Z,InfoIcon:Q},data(){return{generatingLyrics:!1,enhancingLyrics:!1,enhancePrompt:``,lyricHistory:[],expanded:!1}},computed:{lyric:{get(){return this.$store.state.suno?.config?.lyric},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,lyric:e})}},config(){return this.$store.state.suno?.config},credential(){return this.$store.state.suno?.credential}},mounted(){this.lyric||=``},methods:{pushHistory(){this.lyric&&(this.lyricHistory.push(this.lyric),this.lyricHistory.length>20&&this.lyricHistory.shift())},onUndo(){let e=this.lyricHistory.pop();e!==void 0&&(this.lyric=e)},onClear(){this.pushHistory(),this.lyric=``},async onEnhanceLyrics(){let e=this.credential?.token;if(!(!e||!this.lyric||!this.enhancePrompt)){this.pushHistory(),this.enhancingLyrics=!0,J.info(this.$t(`suno.message.enhancingLyrics`));try{let t=`${this.enhancePrompt}\n\nOriginal lyrics:\n${this.lyric}`,n=(await Y.lyric({prompt:t},{token:e})).data?.data;n?.text&&(this.lyric=n.text,this.enhancePrompt=``,J.success(this.$t(`suno.message.enhanceLyricsSuccess`)))}catch{J.error(this.$t(`suno.message.enhanceLyricsFailed`))}finally{this.enhancingLyrics=!1}}},async onGenerateLyrics(){let e=this.credential?.token;if(!e)return;let t;try{t=((await q.prompt(this.$t(`suno.message.lyricsThemePromptMessage`),this.$t(`suno.message.lyricsThemePromptTitle`),{confirmButtonText:this.$t(`common.button.confirm`),cancelButtonText:this.$t(`common.button.cancel`),inputPlaceholder:this.$t(`suno.placeholder.lyricsTheme`),inputValue:this.config?.title||``,inputType:`textarea`,inputValidator:e=>typeof e==`string`&&e.trim().length>0||this.$t(`suno.message.lyricsThemeRequired`)})).value||``).trim()}catch{return}if(t){this.pushHistory(),this.generatingLyrics=!0,J.info(this.$t(`suno.message.generatingLyrics`));try{let n=(await Y.lyric({prompt:t},{token:e})).data?.data;n?.text&&(this.lyric=n.text,n?.title&&!this.config?.title&&this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,lyric:n.text,title:n.title}),J.success(this.$t(`suno.message.generateLyricsSuccess`)))}catch{J.error(this.$t(`suno.message.generateLyricsFailed`))}finally{this.generatingLyrics=!1}}}}}),Ct={class:`field`},wt={class:`flex items-center justify-between mb-1`},Tt={class:`flex items-center`},Et={class:`text-sm font-bold`},Dt={class:`flex items-center gap-1`},Ot={class:`relative`},kt={class:`text-xs text-right text-[var(--el-text-color-secondary)] mt-1`},At={key:0,class:`enhance-bar`},jt={key:0,class:`enhance-bar mt-3`},Mt={class:`flex items-center justify-between`},Nt={class:`flex items-center gap-1`};function Pt(e,t,s,c,d,h){let g=f(`info-icon`),v=f(`font-awesome-icon`),y=f(`el-button`),b=f(`el-tooltip`),x=f(`el-input`),S=f(`el-dialog`);return u(),p(`div`,Ct,[r(`div`,wt,[r(`div`,Tt,[r(`span`,Et,l(e.$t(`suno.name.lyrics`)),1),a(g,{content:e.$t(`suno.description.lyrics`)},null,8,[`content`])]),r(`div`,Dt,[e.lyricHistory.length>0?(u(),n(b,{key:0,content:e.$t(`suno.button.undo`),placement:`top`},{default:m(()=>[a(y,{size:`small`,circle:``,onClick:e.onUndo},{default:m(()=>[a(v,{icon:`fa-solid fa-rotate-left`})]),_:1},8,[`onClick`])]),_:1},8,[`content`])):o(``,!0),e.lyric?(u(),n(b,{key:1,content:e.$t(`suno.button.clear_lyrics`),placement:`top`},{default:m(()=>[a(y,{size:`small`,circle:``,onClick:e.onClear},{default:m(()=>[a(v,{icon:`fa-solid fa-eraser`})]),_:1},8,[`onClick`])]),_:1},8,[`content`])):o(``,!0),a(b,{content:e.$t(`suno.button.expand_lyrics`),placement:`top`},{default:m(()=>[a(y,{size:`small`,circle:``,onClick:t[0]||=t=>e.expanded=!0},{default:m(()=>[a(v,{icon:`fa-solid fa-expand`})]),_:1})]),_:1},8,[`content`]),e.config?.action===`extend`?o(``,!0):(u(),n(y,{key:2,size:`small`,loading:e.generatingLyrics,round:``,onClick:e.onGenerateLyrics},{default:m(()=>[e.generatingLyrics?o(``,!0):(u(),n(v,{key:0,icon:`fa-solid fa-wand-magic-sparkles`,class:`mr-1`})),i(` `+l(e.$t(`suno.button.generate_lyrics`)),1)]),_:1},8,[`loading`,`onClick`]))])]),r(`div`,Ot,[e.config?.action===`extend`?(u(),n(x,{key:1,modelValue:e.lyric,"onUpdate:modelValue":t[2]||=t=>e.lyric=t,rows:5,type:`textarea`,class:`lyrics`,placeholder:e.$t(`suno.placeholder.extend.lyrics`)},null,8,[`modelValue`,`placeholder`])):(u(),n(x,{key:0,modelValue:e.lyric,"onUpdate:modelValue":t[1]||=t=>e.lyric=t,rows:5,type:`textarea`,class:`lyrics`,placeholder:e.$t(`suno.placeholder.lyrics`)},null,8,[`modelValue`,`placeholder`])),r(`div`,kt,l(e.lyric?.length||0)+`/5000`,1)]),e.lyric&&e.config?.action!==`extend`?(u(),p(`div`,At,[a(x,{modelValue:e.enhancePrompt,"onUpdate:modelValue":t[3]||=t=>e.enhancePrompt=t,size:`small`,placeholder:e.$t(`suno.placeholder.enhanceLyrics`),class:`enhance-input`,onKeyup:_(e.onEnhanceLyrics,[`enter`])},{append:m(()=>[a(y,{loading:e.enhancingLyrics,onClick:e.onEnhanceLyrics},{default:m(()=>[e.enhancingLyrics?o(``,!0):(u(),n(v,{key:0,icon:`fa-solid fa-wand-magic-sparkles`,class:`mr-1`})),i(` `+l(e.$t(`suno.button.enhance_lyrics`)),1)]),_:1},8,[`loading`,`onClick`])]),_:1},8,[`modelValue`,`placeholder`,`onKeyup`])])):o(``,!0),a(S,{modelValue:e.expanded,"onUpdate:modelValue":t[7]||=t=>e.expanded=t,title:e.$t(`suno.name.lyrics`),width:`720px`,top:`5vh`,"close-on-click-modal":!1,class:`lyrics-expand-dialog`},{footer:m(()=>[r(`div`,Mt,[r(`div`,Nt,[e.lyricHistory.length>0?(u(),n(y,{key:0,size:`small`,onClick:e.onUndo},{default:m(()=>[a(v,{icon:`fa-solid fa-rotate-left`,class:`mr-1`}),i(` `+l(e.$t(`suno.button.undo`)),1)]),_:1},8,[`onClick`])):o(``,!0),e.lyric?(u(),n(y,{key:1,size:`small`,onClick:e.onClear},{default:m(()=>[a(v,{icon:`fa-solid fa-eraser`,class:`mr-1`}),i(` `+l(e.$t(`suno.button.clear_lyrics`)),1)]),_:1},8,[`onClick`])):o(``,!0),e.config?.action===`extend`?o(``,!0):(u(),n(y,{key:2,size:`small`,loading:e.generatingLyrics,onClick:e.onGenerateLyrics},{default:m(()=>[e.generatingLyrics?o(``,!0):(u(),n(v,{key:0,icon:`fa-solid fa-wand-magic-sparkles`,class:`mr-1`})),i(` `+l(e.$t(`suno.button.generate_lyrics`)),1)]),_:1},8,[`loading`,`onClick`]))]),a(y,{type:`primary`,onClick:t[6]||=t=>e.expanded=!1},{default:m(()=>[i(l(e.$t(`common.button.confirm`)),1)]),_:1})])]),default:m(()=>[a(x,{modelValue:e.lyric,"onUpdate:modelValue":t[4]||=t=>e.lyric=t,type:`textarea`,rows:20,class:`lyrics-expanded`,placeholder:e.$t(`suno.placeholder.lyrics`),autofocus:``},null,8,[`modelValue`,`placeholder`]),e.config?.action===`extend`?o(``,!0):(u(),p(`div`,jt,[a(x,{modelValue:e.enhancePrompt,"onUpdate:modelValue":t[5]||=t=>e.enhancePrompt=t,size:`small`,placeholder:e.$t(`suno.placeholder.enhanceLyrics`),class:`enhance-input`,onKeyup:_(e.onEnhanceLyrics,[`enter`])},{append:m(()=>[a(y,{loading:e.enhancingLyrics,onClick:e.onEnhanceLyrics},{default:m(()=>[e.enhancingLyrics?o(``,!0):(u(),n(v,{key:0,icon:`fa-solid fa-wand-magic-sparkles`,class:`mr-1`})),i(` `+l(e.$t(`suno.button.enhance_lyrics`)),1)]),_:1},8,[`loading`,`onClick`])]),_:1},8,[`modelValue`,`placeholder`,`onKeyup`])]))]),_:1},8,[`modelValue`,`title`])])}var Ft=W(St,[[`render`,Pt],[`__scopeId`,`data-v-d7d2ec74`]]),It=`Pop.Rock.Jazz.R&B.Hip Hop.Lo-fi.Electronic.Classical.Country.Blues.Folk.Reggae.Metal.Punk.Soul.Funk.Ambient.Indie.Latin.Acoustic.Dance.Disco.Gospel.K-Pop.J-Pop.C-Pop.Bossa Nova.Trap.Drill.House.Techno.Dubstep.Synthwave.Chill.Dreamy.Upbeat.Melancholic.Romantic.Epic.Cinematic.Orchestral.Piano.Guitar.Saxophone.Violin.Tribal.World Music.Afrobeat.Ska.Grunge`.split(`.`),Lt=12;function Rt(e){let t=[...e];for(let e=t.length-1;e>0;e--){let n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}return t}var zt=s({name:`StyleInput`,components:{ElInput:G,ElButton:b,FontAwesomeIcon:Z,InfoIcon:Q},data(){return{optimizing:!1,shuffledTags:Rt(It)}},computed:{style:{get(){return this.$store.state.suno?.config?.style},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,style:e})}},credential(){return this.$store.state.suno?.credential},visibleTags(){return this.shuffledTags.slice(0,Lt)}},methods:{onTagClick(e){let t=this.style||``;t.toLowerCase().includes(e.toLowerCase())||(this.style=t?`${t}, ${e}`:e)},onRefreshTags(){this.shuffledTags=Rt(It)},async onOptimizeStyle(){let e=this.credential?.token;if(!(!e||!this.style)){this.optimizing=!0,J.info(this.$t(`suno.message.optimizingStyle`));try{let t=await Y.style({prompt:this.style},{token:e}),n=t.data?.text||t.data?.data?.text;n&&(this.style=n,J.success(this.$t(`suno.message.optimizeStyleSuccess`)))}catch{J.error(this.$t(`suno.message.optimizeStyleFailed`))}finally{this.optimizing=!1}}}}}),Bt={class:`field`},Vt={class:`flex items-center justify-between mb-1`},Ht={class:`flex items-center`},Ut={class:`text-sm font-bold`},Wt={class:`relative`},Gt={class:`text-xs text-right text-[var(--el-text-color-secondary)] mt-1`},Kt={class:`style-tags`},qt=[`onClick`];function Jt(e,t,s,d,h,g){let _=f(`info-icon`),y=f(`font-awesome-icon`),b=f(`el-button`),x=f(`el-input`);return u(),p(`div`,Bt,[r(`div`,Vt,[r(`div`,Ht,[r(`span`,Ut,l(e.$t(`suno.name.style`)),1),a(_,{content:e.$t(`suno.description.style`)},null,8,[`content`])]),a(b,{size:`small`,loading:e.optimizing,round:``,onClick:e.onOptimizeStyle},{default:m(()=>[e.optimizing?o(``,!0):(u(),n(y,{key:0,icon:`fa-solid fa-wand-magic-sparkles`,class:`mr-1`})),i(` `+l(e.$t(`suno.button.optimize_style`)),1)]),_:1},8,[`loading`,`onClick`])]),r(`div`,Wt,[a(x,{modelValue:e.style,"onUpdate:modelValue":t[0]||=t=>e.style=t,rows:2,type:`textarea`,placeholder:e.$t(`suno.placeholder.style`)},null,8,[`modelValue`,`placeholder`]),r(`div`,Gt,l(e.style?.length||0)+`/1000`,1)]),r(`div`,Kt,[(u(!0),p(v,null,c(e.visibleTags,t=>(u(),p(`button`,{key:t,class:`style-tag`,onClick:n=>e.onTagClick(t)},l(t),9,qt))),128)),r(`button`,{class:`style-tag style-tag-refresh`,onClick:t[1]||=(...t)=>e.onRefreshTags&&e.onRefreshTags(...t)},[a(y,{icon:`fa-solid fa-arrows-rotate`})])])])}var Yt=W(zt,[[`render`,Jt],[`__scopeId`,`data-v-ddebb076`]]),Xt=s({name:`TitleInput`,components:{ElInput:G,InfoIcon:Q},computed:{title:{get(){return this.$store.state.suno?.config?.title},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,title:e})}}}}),Zt={class:`field`},Qt={class:`flex items-center mb-1`},$t={class:`text-sm font-bold`};function en(e,t,n,i,o,s){let c=f(`info-icon`),d=f(`el-input`);return u(),p(`div`,Zt,[r(`div`,Qt,[r(`span`,$t,l(e.$t(`suno.name.title`)),1),a(c,{content:e.$t(`suno.description.title`)},null,8,[`content`])]),a(d,{modelValue:e.title,"onUpdate:modelValue":t[0]||=t=>e.title=t,placeholder:e.$t(`suno.placeholder.title`)},null,8,[`modelValue`,`placeholder`])])}var tn=W(Xt,[[`render`,en]]),nn=s({name:`ExtendFromInput`,components:{ElImage:P,ElIcon:w,ElInputNumber:H,VideoPlay:S,VideoPause:C},data(){return{}},computed:{audio(){return this.$store.state.suno?.config?.audio},value:{get(){return this.$store.state.suno?.config?.continue_at},set(e){console.debug(`set continue_at`,e),this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.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:$,onPlay(e){this.$store.dispatch(`suno/setAudio`,{...this.$store.state.suno.audio,...e,state:`playing`}),console.log(`on play`)},onPause(e){this.$store.dispatch(`suno/setAudio`,{...this.$store.state.suno.audio,...e,state:`paused`}),console.log(`on pause`)},onClick(e){this.$store.state?.suno?.audio?.id!==e.id&&this.onPlay({...e,progress:0})}}}),rn={class:`field`},an={class:`box`},on={class:`title font-bold`},sn={class:`input-wrapper`},cn={class:`task`},ln={class:`left`},un={key:2,class:`duration`},dn={class:`info`},fn={class:`title`},pn={class:`style`};function mn(e,t,n,i,s,c){let d=f(`el-input-number`),_=f(`el-image`),v=f(`video-pause`),y=f(`el-icon`),b=f(`video-play`),x=h(`loading`);return u(),p(`div`,rn,[r(`div`,an,[r(`h2`,on,l(e.$t(`suno.name.extend`)),1),r(`div`,sn,[a(d,{modelValue:e.value,"onUpdate:modelValue":t[0]||=t=>e.value=t,class:`value`,min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t(`suno.placeholder.extend.continue_at`),onChange:e.handleChange},null,8,[`modelValue`,`max`,`placeholder`,`onChange`])])]),r(`div`,cn,[e.audio?(u(),p(`div`,{key:0,class:`audio`,onClick:t[3]||=t=>e.onClick(e.audio)},[g((u(),p(`div`,ln,[a(_,{src:e.audio?.image_url,class:`cover`,fit:`cover`},null,8,[`src`]),e.audio?.audio_url&&e.$store.state?.suno?.audio?.id===e.audio.id&&e.$store.state?.suno?.audio?.state===`playing`?(u(),p(`div`,{key:0,class:`overlay`,onClick:t[1]||=t=>e.onPause(e.audio)},[a(y,null,{default:m(()=>[a(v)]),_:1})])):o(``,!0),e.audio?.audio_url&&(e.$store.state?.suno?.audio?.id!==e.audio.id||e.$store.state?.suno?.audio?.id===e.audio.id&&e.$store.state?.suno?.audio?.state===`paused`)?(u(),p(`div`,{key:1,class:`overlay`,onClick:t[2]||=t=>e.onPlay(e.audio)},[a(y,null,{default:m(()=>[a(b)]),_:1})])):o(``,!0),e.audio?.duration?(u(),p(`div`,un,l(e.useFormatDuring(e.audio?.duration)),1)):o(``,!0)])),[[x,!e.audio?.audio_url]]),r(`div`,dn,[r(`h2`,fn,l(e.audio?.title),1),r(`p`,pn,l(e.audio?.style),1)])])):o(``,!0)])])}var hn=W(nn,[[`render`,mn],[`__scopeId`,`data-v-bcce4821`]]),gn=s({name:`CoverFromInput`,components:{ElImage:P,ElIcon:w,VideoPlay:S,VideoPause:C},data(){return{}},computed:{audio(){return this.$store.state.suno?.config?.audio},value:{get(){return this.$store.state.suno?.config?.continue_at},set(e){console.debug(`set continue_at`,e),this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.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:$,onPlay(e){this.$store.dispatch(`suno/setAudio`,{...this.$store.state.suno.audio,...e,state:`playing`}),console.log(`on play`)},onPause(e){this.$store.dispatch(`suno/setAudio`,{...this.$store.state.suno.audio,...e,state:`paused`}),console.log(`on pause`)},onClick(e){this.$store.state?.suno?.audio?.id!==e.id&&this.onPlay({...e,progress:0})}}}),_n={class:`field`},vn={class:`box`},yn={class:`title font-bold`},bn={class:`task`},xn={class:`left`},Sn={key:2,class:`duration`},Cn={class:`info`},wn={class:`title`},Tn={class:`style`};function En(e,t,n,i,s,c){let d=f(`el-image`),_=f(`video-pause`),v=f(`el-icon`),y=f(`video-play`),b=h(`loading`);return u(),p(`div`,_n,[r(`div`,vn,[r(`h2`,yn,l(e.$t(`suno.name.cover`)),1)]),r(`div`,bn,[e.audio?(u(),p(`div`,{key:0,class:`audio`,onClick:t[2]||=t=>e.onClick(e.audio)},[g((u(),p(`div`,xn,[a(d,{src:e.audio?.image_url,class:`cover`,fit:`cover`},null,8,[`src`]),e.audio?.audio_url&&e.$store.state?.suno?.audio?.id===e.audio.id&&e.$store.state?.suno?.audio?.state===`playing`?(u(),p(`div`,{key:0,class:`overlay`,onClick:t[0]||=t=>e.onPause(e.audio)},[a(v,null,{default:m(()=>[a(_)]),_:1})])):o(``,!0),e.audio?.audio_url&&(e.$store.state?.suno?.audio?.id!==e.audio.id||e.$store.state?.suno?.audio?.id===e.audio.id&&e.$store.state?.suno?.audio?.state===`paused`)?(u(),p(`div`,{key:1,class:`overlay`,onClick:t[1]||=t=>e.onPlay(e.audio)},[a(v,null,{default:m(()=>[a(y)]),_:1})])):o(``,!0),e.audio?.duration?(u(),p(`div`,Sn,l(e.useFormatDuring(e.audio?.duration)),1)):o(``,!0)])),[[b,!e.audio?.audio_url]]),r(`div`,Cn,[r(`h2`,wn,l(e.audio?.title),1),r(`p`,Tn,l(e.audio?.style),1)])])):o(``,!0)])])}var Dn=W(gn,[[`render`,En],[`__scopeId`,`data-v-06640216`]]),On=s({name:`VocalGenderSelector`,components:{ElRadioGroup:R,ElRadioButton:L,InfoIcon:Q},computed:{vocalGender:{get(){return this.$store.state.suno?.config?.vocal_gender||``},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,vocal_gender:e||void 0})}}}}),kn={class:`flex items-center mb-1`},An={class:`text-sm font-bold`};function jn(e,t,n,o,s,c){let d=f(`info-icon`),h=f(`el-radio-button`),g=f(`el-radio-group`);return u(),p(`div`,null,[r(`div`,kn,[r(`span`,An,l(e.$t(`suno.name.vocalGender`)),1),a(d,{content:e.$t(`suno.description.vocalGender`)},null,8,[`content`])]),a(g,{modelValue:e.vocalGender,"onUpdate:modelValue":t[0]||=t=>e.vocalGender=t,size:`small`},{default:m(()=>[a(h,{value:``},{default:m(()=>[i(l(e.$t(`suno.gender.auto`)),1)]),_:1}),a(h,{value:`f`},{default:m(()=>[i(l(e.$t(`suno.gender.female`)),1)]),_:1}),a(h,{value:`m`},{default:m(()=>[i(l(e.$t(`suno.gender.male`)),1)]),_:1})]),_:1},8,[`modelValue`])])}var Mn=W(On,[[`render`,jn]]),Nn=s({name:`AdvancedParams`,components:{ElCollapse:ne,ElCollapseItem:te,ElInput:G,ElSlider:ce,ElRadioGroup:R,ElRadioButton:L},data(){return{activeNames:[]}},computed:{config(){return this.$store.state.suno?.config},isV5OrAbove(){let e=this.config?.model||``;return[`chirp-v5`,`chirp-v5-5`].includes(e)},styleNegative:{get(){return this.$store.state.suno?.config?.style_negative||``},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,style_negative:e||void 0})}},lyricPrompt:{get(){return this.$store.state.suno?.config?.lyric_prompt||``},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,lyric_prompt:e||void 0})}},weirdness:{get(){return this.$store.state.suno?.config?.weirdness??0},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,weirdness:e||void 0})}},styleInfluence:{get(){return this.$store.state.suno?.config?.style_influence??.5},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,style_influence:e})}},variationCategory:{get(){return this.$store.state.suno?.config?.variation_category||``},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,variation_category:e||void 0})}},audioWeight:{get(){return this.$store.state.suno?.config?.audio_weight??.5},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,audio_weight:e})}},lyricsMode:{get(){return this.$store.state.suno?.config?.lyrics_mode||`manual`},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,lyrics_mode:e})}}},mounted(){let e=this.$store.state.suno?.config;if(!e)return;let t={};typeof e.weirdness==`number`&&e.weirdness>1&&(t.weirdness=e.weirdness/100),typeof e.style_influence==`number`&&e.style_influence>1&&(t.style_influence=e.style_influence/100),typeof e.audio_weight==`number`&&e.audio_weight>1&&(t.audio_weight=e.audio_weight/100),Object.keys(t).length>0&&this.$store.commit(`suno/setConfig`,{...e,...t})}}),Pn={key:0,class:`mb-3`},Fn={class:`flex items-center mb-1`},In={class:`text-xs font-bold`},Ln={key:1,class:`mb-3`},Rn={class:`flex items-center mb-1`},zn={class:`text-xs font-bold`},Bn={key:2,class:`mb-3`},Vn={class:`flex items-center justify-between mb-1`},Hn={class:`text-xs font-bold`},Un={class:`text-xs text-[var(--el-text-color-secondary)]`},Wn={key:3,class:`mb-3`},Gn={class:`flex items-center justify-between mb-1`},Kn={class:`text-xs font-bold`},qn={class:`text-xs text-[var(--el-text-color-secondary)]`},Jn={key:4,class:`mb-3`},Yn={class:`flex items-center mb-1`},Xn={class:`text-xs font-bold`},Zn={key:5,class:`mb-3`},Qn={class:`flex items-center justify-between mb-1`},$n={class:`text-xs font-bold`},er={class:`text-xs text-[var(--el-text-color-secondary)]`},tr={key:6,class:`mb-3`},nr={class:`flex items-center mb-1`},rr={class:`text-xs font-bold`};function ir(e,t,s,c,d,h){let g=f(`el-input`),_=f(`el-slider`),v=f(`el-radio-button`),y=f(`el-radio-group`),b=f(`el-collapse-item`),x=f(`el-collapse`);return u(),n(x,{modelValue:e.activeNames,"onUpdate:modelValue":t[7]||=t=>e.activeNames=t,class:`advanced-collapse`},{default:m(()=>[a(b,{title:e.$t(`suno.name.advancedParams`),name:`advanced`},{default:m(()=>[e.config?.custom?(u(),p(`div`,Pn,[r(`div`,Fn,[r(`span`,In,l(e.$t(`suno.name.styleNegative`)),1)]),a(g,{modelValue:e.styleNegative,"onUpdate:modelValue":t[0]||=t=>e.styleNegative=t,size:`small`,placeholder:e.$t(`suno.placeholder.styleNegative`)},null,8,[`modelValue`,`placeholder`])])):o(``,!0),e.config?.custom&&!e.config?.instrumental?(u(),p(`div`,Ln,[r(`div`,Rn,[r(`span`,zn,l(e.$t(`suno.name.lyricPrompt`)),1)]),a(g,{modelValue:e.lyricPrompt,"onUpdate:modelValue":t[1]||=t=>e.lyricPrompt=t,size:`small`,placeholder:e.$t(`suno.placeholder.lyricPrompt`)},null,8,[`modelValue`,`placeholder`])])):o(``,!0),e.config?.custom?(u(),p(`div`,Bn,[r(`div`,Vn,[r(`span`,Hn,l(e.$t(`suno.name.weirdness`)),1),r(`span`,Un,l(e.weirdness??0),1)]),a(_,{modelValue:e.weirdness,"onUpdate:modelValue":t[2]||=t=>e.weirdness=t,min:0,max:1,step:.01},null,8,[`modelValue`])])):o(``,!0),e.config?.custom?(u(),p(`div`,Wn,[r(`div`,Gn,[r(`span`,Kn,l(e.$t(`suno.name.styleInfluence`)),1),r(`span`,qn,l(e.styleInfluence??.5),1)]),a(_,{modelValue:e.styleInfluence,"onUpdate:modelValue":t[3]||=t=>e.styleInfluence=t,min:0,max:1,step:.01},null,8,[`modelValue`])])):o(``,!0),e.isV5OrAbove?(u(),p(`div`,Jn,[r(`div`,Yn,[r(`span`,Xn,l(e.$t(`suno.name.variationCategory`)),1)]),a(y,{modelValue:e.variationCategory,"onUpdate:modelValue":t[4]||=t=>e.variationCategory=t,size:`small`},{default:m(()=>[a(v,{value:``},{default:m(()=>[i(l(e.$t(`suno.gender.auto`)),1)]),_:1}),a(v,{value:`high`},{default:m(()=>[i(l(e.$t(`suno.variation.high`)),1)]),_:1}),a(v,{value:`low`},{default:m(()=>[i(l(e.$t(`suno.variation.low`)),1)]),_:1})]),_:1},8,[`modelValue`])])):o(``,!0),e.config?.action===`cover`?(u(),p(`div`,Zn,[r(`div`,Qn,[r(`span`,$n,l(e.$t(`suno.name.audioWeight`)),1),r(`span`,er,l(e.audioWeight??.5),1)]),a(_,{modelValue:e.audioWeight,"onUpdate:modelValue":t[5]||=t=>e.audioWeight=t,min:0,max:1,step:.01},null,8,[`modelValue`])])):o(``,!0),e.config?.custom&&!e.config?.instrumental?(u(),p(`div`,tr,[r(`div`,nr,[r(`span`,rr,l(e.$t(`suno.name.lyricsMode`)),1)]),a(y,{modelValue:e.lyricsMode,"onUpdate:modelValue":t[6]||=t=>e.lyricsMode=t,size:`small`},{default:m(()=>[a(v,{value:`manual`},{default:m(()=>[i(l(e.$t(`suno.lyricsMode.manual`)),1)]),_:1}),a(v,{value:`auto`},{default:m(()=>[i(l(e.$t(`suno.lyricsMode.auto`)),1)]),_:1})]),_:1},8,[`modelValue`])])):o(``,!0)]),_:1},8,[`title`])]),_:1},8,[`modelValue`])}var ar=W(Nn,[[`render`,ir],[`__scopeId`,`data-v-363599d3`]]),or=s({name:`ReplaceSectionInput`,components:{ElInputNumber:H,ElImage:P,InfoIcon:Q},computed:{audio(){return this.$store.state.suno?.config?.audio},replaceSectionStart:{get(){return this.$store.state.suno?.config?.replace_section_start},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,replace_section_start:e})}},replaceSectionEnd:{get(){return this.$store.state.suno?.config?.replace_section_end},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,replace_section_end:e})}}},methods:{onClick(e){this.$store.dispatch(`suno/setAudio`,{...this.$store.state.suno.audio,...e,state:`playing`})}}}),sr={class:`field`},cr={class:`flex items-center mb-2`},lr={class:`text-sm font-bold m-0`},ur={key:0,class:`task mb-2`},dr={class:`left relative w-[50px] h-[50px] mr-3 flex-shrink-0`},fr={class:`info flex-1 min-w-0`},pr={class:`text-sm font-bold m-0 truncate`},mr={class:`text-xs text-[var(--el-text-color-secondary)] m-0 truncate`},hr={class:`flex gap-2`};function gr(e,t,n,i,s,c){let d=f(`info-icon`),m=f(`el-image`),_=f(`el-input-number`),v=h(`loading`);return u(),p(`div`,sr,[r(`div`,cr,[r(`h2`,lr,l(e.$t(`suno.name.replaceSection`)),1),a(d,{content:e.$t(`suno.description.replaceSection`)},null,8,[`content`])]),e.audio?(u(),p(`div`,ur,[r(`div`,{class:`audio flex items-center`,onClick:t[0]||=t=>e.onClick(e.audio)},[g((u(),p(`div`,dr,[a(m,{src:e.audio?.image_url,class:`w-full h-full rounded`,fit:`cover`},null,8,[`src`])])),[[v,!e.audio?.audio_url]]),r(`div`,fr,[r(`h2`,pr,l(e.audio?.title),1),r(`p`,mr,l(e.audio?.style),1)])])])):o(``,!0),r(`div`,hr,[a(_,{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(`suno.placeholder.replaceSectionStart`)},null,8,[`modelValue`,`max`,`placeholder`]),a(_,{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(`suno.placeholder.replaceSectionEnd`)},null,8,[`modelValue`,`min`,`max`,`placeholder`])])])}var _r=W(or,[[`render`,gr]]),vr=s({name:`OverpaintingInput`,components:{ElInputNumber:H,ElImage:P,InfoIcon:Q},computed:{audio(){return this.$store.state.suno?.config?.audio},overpaintingStart:{get(){return this.$store.state.suno?.config?.overpainting_start},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,overpainting_start:e})}},overpaintingEnd:{get(){return this.$store.state.suno?.config?.overpainting_end},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,overpainting_end:e})}}},methods:{onClick(e){this.$store.dispatch(`suno/setAudio`,{...this.$store.state.suno.audio,...e,state:`playing`})}}}),yr={class:`field`},br={class:`flex items-center mb-2`},xr={class:`text-sm font-bold m-0`},Sr={key:0,class:`task mb-2`},Cr={class:`left relative w-[50px] h-[50px] mr-3 flex-shrink-0`},wr={class:`info flex-1 min-w-0`},Tr={class:`text-sm font-bold m-0 truncate`},Er={class:`text-xs text-[var(--el-text-color-secondary)] m-0 truncate`},Dr={class:`flex gap-2`};function Or(e,t,n,i,s,c){let d=f(`info-icon`),m=f(`el-image`),_=f(`el-input-number`),v=h(`loading`);return u(),p(`div`,yr,[r(`div`,br,[r(`h2`,xr,l(e.$t(`suno.name.overpaintingRange`)),1),a(d,{content:e.$t(`suno.description.overpainting`)},null,8,[`content`])]),e.audio?(u(),p(`div`,Sr,[r(`div`,{class:`audio flex items-center`,onClick:t[0]||=t=>e.onClick(e.audio)},[g((u(),p(`div`,Cr,[a(m,{src:e.audio?.image_url,class:`w-full h-full rounded`,fit:`cover`},null,8,[`src`])])),[[v,!e.audio?.audio_url]]),r(`div`,wr,[r(`h2`,Tr,l(e.audio?.title),1),r(`p`,Er,l(e.audio?.style),1)])])])):o(``,!0),r(`div`,Dr,[a(_,{modelValue:e.overpaintingStart,"onUpdate:modelValue":t[1]||=t=>e.overpaintingStart=t,class:`flex-1`,size:`small`,min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t(`suno.placeholder.overpaintingStart`)},null,8,[`modelValue`,`max`,`placeholder`]),a(_,{modelValue:e.overpaintingEnd,"onUpdate:modelValue":t[2]||=t=>e.overpaintingEnd=t,class:`flex-1`,size:`small`,min:e.overpaintingStart||0,max:e.audio?.duration,controls:!1,placeholder:e.$t(`suno.placeholder.overpaintingEnd`)},null,8,[`modelValue`,`min`,`max`,`placeholder`])])])}var kr=W(vr,[[`render`,Or]]),Ar=s({name:`UnderpaintingInput`,components:{ElInputNumber:H,ElImage:P,InfoIcon:Q},computed:{audio(){return this.$store.state.suno?.config?.audio},underpaintingStart:{get(){return this.$store.state.suno?.config?.underpainting_start},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,underpainting_start:e})}},underpaintingEnd:{get(){return this.$store.state.suno?.config?.underpainting_end},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,underpainting_end:e})}}},methods:{onClick(e){this.$store.dispatch(`suno/setAudio`,{...this.$store.state.suno.audio,...e,state:`playing`})}}}),jr={class:`field`},Mr={class:`flex items-center mb-2`},Nr={class:`text-sm font-bold m-0`},Pr={key:0,class:`task mb-2`},Fr={class:`left relative w-[50px] h-[50px] mr-3 flex-shrink-0`},Ir={class:`info flex-1 min-w-0`},Lr={class:`text-sm font-bold m-0 truncate`},Rr={class:`text-xs text-[var(--el-text-color-secondary)] m-0 truncate`},zr={class:`flex gap-2`};function Br(e,t,n,i,s,c){let d=f(`info-icon`),m=f(`el-image`),_=f(`el-input-number`),v=h(`loading`);return u(),p(`div`,jr,[r(`div`,Mr,[r(`h2`,Nr,l(e.$t(`suno.name.underpaintingRange`)),1),a(d,{content:e.$t(`suno.description.underpainting`)},null,8,[`content`])]),e.audio?(u(),p(`div`,Pr,[r(`div`,{class:`audio flex items-center`,onClick:t[0]||=t=>e.onClick(e.audio)},[g((u(),p(`div`,Fr,[a(m,{src:e.audio?.image_url,class:`w-full h-full rounded`,fit:`cover`},null,8,[`src`])])),[[v,!e.audio?.audio_url]]),r(`div`,Ir,[r(`h2`,Lr,l(e.audio?.title),1),r(`p`,Rr,l(e.audio?.style),1)])])])):o(``,!0),r(`div`,zr,[a(_,{modelValue:e.underpaintingStart,"onUpdate:modelValue":t[1]||=t=>e.underpaintingStart=t,class:`flex-1`,size:`small`,min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t(`suno.placeholder.underpaintingStart`)},null,8,[`modelValue`,`max`,`placeholder`]),a(_,{modelValue:e.underpaintingEnd,"onUpdate:modelValue":t[2]||=t=>e.underpaintingEnd=t,class:`flex-1`,size:`small`,min:e.underpaintingStart||0,max:e.audio?.duration,controls:!1,placeholder:e.$t(`suno.placeholder.underpaintingEnd`)},null,8,[`modelValue`,`min`,`max`,`placeholder`])])])}var Vr=W(Ar,[[`render`,Br]]),Hr=s({name:`SamplesInput`,components:{ElInputNumber:H,ElImage:P,InfoIcon:Q},computed:{audio(){return this.$store.state.suno?.config?.audio},samplesStart:{get(){return this.$store.state.suno?.config?.samples_start},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,samples_start:e})}},samplesEnd:{get(){return this.$store.state.suno?.config?.samples_end},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,samples_end:e})}}},methods:{onClick(e){this.$store.dispatch(`suno/setAudio`,{...this.$store.state.suno.audio,...e,state:`playing`})}}}),Ur={class:`field`},Wr={class:`flex items-center mb-2`},Gr={class:`text-sm font-bold m-0`},Kr={key:0,class:`task mb-2`},qr={class:`left relative w-[50px] h-[50px] mr-3 flex-shrink-0`},Jr={class:`info flex-1 min-w-0`},Yr={class:`text-sm font-bold m-0 truncate`},Xr={class:`text-xs text-[var(--el-text-color-secondary)] m-0 truncate`},Zr={class:`flex gap-2`};function Qr(e,t,n,i,s,c){let d=f(`info-icon`),m=f(`el-image`),_=f(`el-input-number`),v=h(`loading`);return u(),p(`div`,Ur,[r(`div`,Wr,[r(`h2`,Gr,l(e.$t(`suno.name.samplesRange`)),1),a(d,{content:e.$t(`suno.description.samples`)},null,8,[`content`])]),e.audio?(u(),p(`div`,Kr,[r(`div`,{class:`audio flex items-center`,onClick:t[0]||=t=>e.onClick(e.audio)},[g((u(),p(`div`,qr,[a(m,{src:e.audio?.image_url,class:`w-full h-full rounded`,fit:`cover`},null,8,[`src`])])),[[v,!e.audio?.audio_url]]),r(`div`,Jr,[r(`h2`,Yr,l(e.audio?.title),1),r(`p`,Xr,l(e.audio?.style),1)])])])):o(``,!0),r(`div`,Zr,[a(_,{modelValue:e.samplesStart,"onUpdate:modelValue":t[1]||=t=>e.samplesStart=t,class:`flex-1`,size:`small`,min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t(`suno.placeholder.samplesStart`)},null,8,[`modelValue`,`max`,`placeholder`]),a(_,{modelValue:e.samplesEnd,"onUpdate:modelValue":t[2]||=t=>e.samplesEnd=t,class:`flex-1`,size:`small`,min:e.samplesStart||0,max:e.audio?.duration,controls:!1,placeholder:e.$t(`suno.placeholder.samplesEnd`)},null,8,[`modelValue`,`min`,`max`,`placeholder`])])])}var $r=W(Hr,[[`render`,Qr]]),ei=[.5,.75,1,1.25,1.5,2],ti=s({name:`AdjustSpeedInput`,components:{ElRadioGroup:R,ElRadioButton:L,ElImage:P,InfoIcon:Q},data(){return{options:ei}},computed:{audio(){return this.$store.state.suno?.config?.audio},speed:{get(){let e=this.$store.state.suno?.config?.speed;return typeof e==`number`?e:1},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,speed:e})}}},methods:{onClick(e){this.$store.dispatch(`suno/setAudio`,{...this.$store.state.suno.audio,...e,state:`playing`})}}}),ni={class:`field`},ri={class:`flex items-center mb-2`},ii={class:`text-sm font-bold m-0`},ai={key:0,class:`task mb-2`},oi={class:`left relative w-[50px] h-[50px] mr-3 flex-shrink-0`},si={class:`info flex-1 min-w-0`},ci={class:`text-sm font-bold m-0 truncate`},li={class:`text-xs text-[var(--el-text-color-secondary)] m-0 truncate`};function ui(e,t,s,d,_,y){let b=f(`info-icon`),x=f(`el-image`),S=f(`el-radio-button`),C=f(`el-radio-group`),w=h(`loading`);return u(),p(`div`,ni,[r(`div`,ri,[r(`h2`,ii,l(e.$t(`suno.name.adjustSpeed`)),1),a(b,{content:e.$t(`suno.description.adjustSpeed`)},null,8,[`content`])]),e.audio?(u(),p(`div`,ai,[r(`div`,{class:`audio flex items-center`,onClick:t[0]||=t=>e.onClick(e.audio)},[g((u(),p(`div`,oi,[a(x,{src:e.audio?.image_url,class:`w-full h-full rounded`,fit:`cover`},null,8,[`src`])])),[[w,!e.audio?.audio_url]]),r(`div`,si,[r(`h2`,ci,l(e.audio?.title),1),r(`p`,li,l(e.audio?.style),1)])])])):o(``,!0),a(C,{modelValue:e.speed,"onUpdate:modelValue":t[1]||=t=>e.speed=t,size:`small`,class:`speed-group`},{default:m(()=>[(u(!0),p(v,null,c(e.options,e=>(u(),n(S,{key:e,value:e},{default:m(()=>[i(l(e)+`x`,1)]),_:2},1032,[`value`]))),128))]),_:1},8,[`modelValue`])])}var di=W(ti,[[`render`,ui],[`__scopeId`,`data-v-ba834628`]]),fi=s({name:`VoiceCreateDialog`,components:{ElDialog:K,ElForm:j,ElFormItem:A,ElInput:G,ElButton:b,ElRadioGroup:R,ElRadio:ee},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`,`created`],data(){return{sourceType:`song`,form:{name:``,description:``,audio_id:``,audio_url:``},loading:!1}},computed:{visible:{get(){return this.modelValue},set(e){this.$emit(`update:modelValue`,e)}},token(){return this.$store.state.suno?.credential?.token},canSubmit(){return!(!this.form.name||this.sourceType===`song`&&!this.form.audio_id||this.sourceType===`upload`&&!this.form.audio_url)}},methods:{onClose(){this.visible=!1,this.resetForm()},resetForm(){this.form={name:``,description:``,audio_id:``,audio_url:``},this.sourceType=`song`},async onSubmit(){if(this.token){this.loading=!0;try{this.sourceType===`song`?await Y.persona({audio_id:this.form.audio_id,name:this.form.name,description:this.form.description},{token:this.token}):await Y.voices({audio_url:this.form.audio_url,name:this.form.name,description:this.form.description},{token:this.token}),J.success(this.$t(`suno.voice.createSuccess`)),this.$emit(`created`),this.onClose()}catch{J.error(this.$t(`suno.voice.createFailed`))}finally{this.loading=!1}}}}});function pi(e,t,r,s,c,d){let p=f(`el-input`),h=f(`el-form-item`),g=f(`el-radio`),_=f(`el-radio-group`),v=f(`el-form`),y=f(`el-button`),b=f(`el-dialog`);return u(),n(b,{modelValue:e.visible,"onUpdate:modelValue":t[5]||=t=>e.visible=t,title:e.$t(`suno.voice.createTitle`),width:`480px`,"close-on-click-modal":!1,onClose:e.onClose},{footer:m(()=>[a(y,{onClick:e.onClose},{default:m(()=>[i(l(e.$t(`common.button.cancel`)),1)]),_:1},8,[`onClick`]),a(y,{type:`primary`,loading:e.loading,disabled:!e.canSubmit,onClick:e.onSubmit},{default:m(()=>[i(l(e.$t(`suno.voice.create`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])]),default:m(()=>[a(v,{"label-position":`top`,class:`voice-create-form`},{default:m(()=>[a(h,{label:e.$t(`suno.voice.name`)},{default:m(()=>[a(p,{modelValue:e.form.name,"onUpdate:modelValue":t[0]||=t=>e.form.name=t,placeholder:e.$t(`suno.voice.namePlaceholder`),maxlength:`50`},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`label`]),a(h,{label:e.$t(`suno.voice.description`)},{default:m(()=>[a(p,{modelValue:e.form.description,"onUpdate:modelValue":t[1]||=t=>e.form.description=t,type:`textarea`,rows:2,placeholder:e.$t(`suno.voice.descriptionPlaceholder`),maxlength:`200`},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`label`]),a(h,{label:e.$t(`suno.voice.sourceType`)},{default:m(()=>[a(_,{modelValue:e.sourceType,"onUpdate:modelValue":t[2]||=t=>e.sourceType=t,class:`w-full`},{default:m(()=>[a(g,{value:`song`},{default:m(()=>[i(l(e.$t(`suno.voice.fromSong`)),1)]),_:1}),a(g,{value:`upload`},{default:m(()=>[i(l(e.$t(`suno.voice.fromUpload`)),1)]),_:1})]),_:1},8,[`modelValue`])]),_:1},8,[`label`]),e.sourceType===`song`?(u(),n(h,{key:0,label:e.$t(`suno.voice.audioId`)},{default:m(()=>[a(p,{modelValue:e.form.audio_id,"onUpdate:modelValue":t[3]||=t=>e.form.audio_id=t,placeholder:e.$t(`suno.voice.audioIdPlaceholder`)},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`label`])):o(``,!0),e.sourceType===`upload`?(u(),n(h,{key:1,label:e.$t(`suno.voice.audioUrl`)},{default:m(()=>[a(p,{modelValue:e.form.audio_url,"onUpdate:modelValue":t[4]||=t=>e.form.audio_url=t,placeholder:e.$t(`suno.voice.audioUrlPlaceholder`)},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`label`])):o(``,!0)]),_:1})]),_:1},8,[`modelValue`,`title`,`onClose`])}var mi=s({name:`VoiceManager`,components:{ElButton:b,ElIcon:w,ElTabs:O,ElTabPane:k,ElTooltip:N,Loading:x,FontAwesomeIcon:Z,VoiceCreateDialog:W(fi,[[`render`,pi]])},data(){return{showCreateDialog:!1,loading:!1,deletingId:null,activeTab:`all`}},computed:{personas(){return this.$store.state.suno?.personas||[]},favoriteIds(){return this.$store.state.suno?.favoritePersonaIds||[]},favoritePersonas(){return this.personas.filter(e=>e.persona_id&&this.favoriteIds.includes(e.persona_id))},visiblePersonas(){return this.activeTab===`favorites`?this.favoritePersonas:this.personas},selectedPersonaId(){return this.$store.state.suno?.config?.persona_id}},watch:{"$store.state.suno.credential":{handler(){this.loadPersonas()},immediate:!0}},methods:{isFavorite(e){return!!e&&this.favoriteIds.includes(e)},onToggleFavorite(e){e.persona_id&&this.$store.commit(`suno/togglePersonaFavorite`,e.persona_id)},async loadPersonas(){if(this.$store.state.suno?.credential?.token){this.loading=!0;try{await this.$store.dispatch(`suno/getPersonas`)}finally{this.loading=!1}}},selectPersona(e){let t={...this.$store.state.suno?.config};t.persona_id===e.persona_id?t.persona_id=void 0:t.persona_id=e.persona_id,this.$store.dispatch(`suno/setConfig`,t)},async onDelete(e){try{await q.confirm(this.$t(`suno.voice.confirmDelete`),this.$t(`suno.voice.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.confirm`),cancelButtonText:this.$t(`common.button.cancel`)})}catch{return}if(!e.persona_id)return;this.deletingId=e.persona_id;let t=await this.$store.dispatch(`suno/deletePersona`,e.persona_id);if(this.deletingId=null,t){if(J.success(this.$t(`suno.voice.deleteSuccess`)),this.selectedPersonaId===e.persona_id){let e={...this.$store.state.suno?.config,persona_id:void 0};this.$store.dispatch(`suno/setConfig`,e)}this.favoriteIds.includes(e.persona_id)&&this.$store.commit(`suno/togglePersonaFavorite`,e.persona_id)}else J.error(this.$t(`suno.voice.deleteFailed`))},async onCreated(){await this.loadPersonas()}}}),hi={class:`voice-manager`},gi={class:`flex items-center justify-between mb-3`},_i={class:`text-sm font-medium`},vi={key:0,class:`text-center py-6`},yi={key:1,class:`text-center py-6 text-gray-400 text-sm`},bi={key:2,class:`voice-list`},xi=[`onClick`],Si={class:`flex-1 min-w-0`},Ci={class:`voice-name`},wi={key:0,class:`voice-desc`};function Ti(e,n,s,d,h,g){let _=f(`font-awesome-icon`),b=f(`el-button`),x=f(`el-tab-pane`),S=f(`el-tabs`),C=f(`loading`),w=f(`el-icon`),T=f(`el-tooltip`),E=f(`voice-create-dialog`);return u(),p(`div`,hi,[r(`div`,gi,[r(`span`,_i,l(e.$t(`suno.voice.title`)),1),a(b,{type:`primary`,size:`small`,onClick:n[0]||=t=>e.showCreateDialog=!0},{default:m(()=>[a(_,{icon:`fa-solid fa-plus`,class:`mr-1`}),i(` `+l(e.$t(`suno.voice.create`)),1)]),_:1})]),a(S,{modelValue:e.activeTab,"onUpdate:modelValue":n[1]||=t=>e.activeTab=t,class:`voice-tabs`,size:`small`},{default:m(()=>[a(x,{name:`all`,label:e.$t(`suno.voice.tabAll`)+` (`+(e.personas?.length||0)+`)`},null,8,[`label`]),a(x,{name:`favorites`,label:e.$t(`suno.voice.tabFavorites`)+` (`+e.favoritePersonas.length+`)`},null,8,[`label`])]),_:1},8,[`modelValue`]),e.loading?(u(),p(`div`,vi,[a(w,{class:`is-loading`},{default:m(()=>[a(C)]),_:1})])):e.visiblePersonas.length===0?(u(),p(`div`,yi,l(e.activeTab===`favorites`?e.$t(`suno.voice.emptyFavorites`):e.$t(`suno.voice.empty`)),1)):(u(),p(`div`,bi,[(u(!0),p(v,null,c(e.visiblePersonas,s=>(u(),p(`div`,{key:s.persona_id,class:t([`voice-item`,{active:e.selectedPersonaId===s.persona_id}]),onClick:t=>e.selectPersona(s)},[r(`div`,Si,[r(`div`,Ci,[a(_,{icon:s.source_type===`voice`?`fa-solid fa-microphone`:`fa-solid fa-music`,class:`mr-1.5 text-xs opacity-60`},null,8,[`icon`]),i(` `+l(s.name||s.persona_id),1)]),s.description?(u(),p(`div`,wi,l(s.description),1)):o(``,!0)]),r(`div`,{class:`voice-actions`,onClick:n[2]||=y(()=>{},[`stop`])},[a(T,{content:e.isFavorite(s.persona_id)?e.$t(`suno.voice.unfavorite`):e.$t(`suno.voice.favorite`),placement:`top`},{default:m(()=>[a(b,{size:`small`,text:``,class:t({"voice-fav-active":e.isFavorite(s.persona_id)}),onClick:t=>e.onToggleFavorite(s)},{default:m(()=>[a(_,{icon:e.isFavorite(s.persona_id)?`fa-solid fa-star`:`fa-regular fa-star`},null,8,[`icon`])]),_:2},1032,[`class`,`onClick`])]),_:2},1032,[`content`]),a(b,{type:`danger`,size:`small`,text:``,loading:e.deletingId===s.persona_id,onClick:t=>e.onDelete(s)},{default:m(()=>[a(_,{icon:`fa-solid fa-trash`})]),_:1},8,[`loading`,`onClick`])])],10,xi))),128))])),a(E,{modelValue:e.showCreateDialog,"onUpdate:modelValue":n[3]||=t=>e.showCreateDialog=t,onCreated:e.onCreated},null,8,[`modelValue`,`onCreated`])])}var Ei=s({name:`PersonaInput`,components:{ElSelect:E,ElOption:D,ElButton:b,ElDrawer:z,FontAwesomeIcon:Z,InfoIcon:Q,VoiceManager:W(mi,[[`render`,Ti],[`__scopeId`,`data-v-8b8e36d9`]])},data(){return{showManager:!1}},computed:{personaId:{get(){return this.$store.state.suno?.config?.persona_id||``},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,persona_id:e||void 0})}},personas(){return this.$store.state.suno?.personas||[]}}}),Di={class:`field`},Oi={class:`flex items-center justify-between mb-2`},ki={class:`flex items-center`},Ai={class:`text-sm font-bold`},ji={class:`flex items-center justify-between w-full`},Mi={key:0,class:`text-xs text-gray-400 ml-2`};function Ni(e,t,s,d,h,g){let _=f(`info-icon`),y=f(`font-awesome-icon`),b=f(`el-button`),x=f(`el-option`),S=f(`el-select`),C=f(`voice-manager`),w=f(`el-drawer`);return u(),p(`div`,Di,[r(`div`,Oi,[r(`div`,ki,[r(`span`,Ai,l(e.$t(`suno.name.persona`)),1),a(_,{content:e.$t(`suno.description.persona`)},null,8,[`content`])]),a(b,{size:`small`,round:``,onClick:t[0]||=t=>e.showManager=!0},{default:m(()=>[a(y,{icon:`fa-solid fa-microphone`,class:`mr-1`}),i(` `+l(e.$t(`suno.voice.manage`)),1)]),_:1})]),a(S,{modelValue:e.personaId,"onUpdate:modelValue":t[1]||=t=>e.personaId=t,placeholder:e.$t(`suno.placeholder.personaId`),clearable:``,filterable:``,class:`w-full`},{default:m(()=>[(u(!0),p(v,null,c(e.personas,e=>(u(),n(x,{key:e.persona_id||``,value:e.persona_id||``,label:e.name||e.persona_id||``},{default:m(()=>[r(`div`,ji,[r(`span`,null,l(e.name||e.persona_id),1),e.source_type?(u(),p(`span`,Mi,l(e.source_type),1)):o(``,!0)])]),_:2},1032,[`value`,`label`]))),128))]),_:1},8,[`modelValue`,`placeholder`]),a(w,{modelValue:e.showManager,"onUpdate:modelValue":t[2]||=t=>e.showManager=t,title:e.$t(`suno.voice.title`),size:`380px`,direction:`rtl`},{default:m(()=>[a(C)]),_:1},8,[`modelValue`,`title`])])}var Pi=s({name:`PresetPanel`,components:{TypeSelector:We,PromptInput:xt,LyricInput:Ft,StyleInput:Yt,TitleInput:tn,ExtendFromInput:hn,CoverFromInput:Dn,UploadAudio:pt,VocalGenderSelector:Mn,AdvancedParams:ar,ReplaceSectionInput:_r,OverpaintingInput:kr,UnderpaintingInput:Vr,SamplesInput:$r,AdjustSpeedInput:di,PersonaInput:W(Ei,[[`render`,Ni]]),FontAwesomeIcon:Z,ElButton:b,ElTabs:O,ElTabPane:k,Consumption:Ce},emits:[`generate`],computed:{config(){return this.$store.state.suno?.config},mode:{get(){return this.$store.state.suno?.config?.custom?`custom`:`simple`},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,custom:e===`custom`})}},consumption(){return me(this.config,this.service?.cost)},service(){return this.$store.state.suno?.service},supportsVocalGender(){let e=this.config?.model||``;return[`chirp-v4-5-plus`,`chirp-v5`,`chirp-v5-5`].includes(e)},supportsPersona(){let e=this.config?.action;return!e||e===`generate`||e===`artist_consistency`||e===`artist_consistency_vox`},generateButtonText(){let e=this.config?.action;return e===`extend`?this.$t(`suno.button.extend`):e===`cover`?this.$t(`suno.button.cover_music`):e===`remaster`?this.$t(`suno.button.remaster`):e===`replace_section`?this.$t(`suno.button.replace_section`):e===`mashup`?this.$t(`suno.button.mashup`):e===`stems`?this.$t(`suno.button.get_stems`):e===`concat`?this.$t(`suno.button.concat_music`):e===`upload_cover`?this.$t(`suno.button.upload_cover`):e===`artist_consistency`?this.$t(`suno.button.artist_consistency`):e===`artist_consistency_vox`?this.$t(`suno.button.artist_consistency_vox`):e===`overpainting`?this.$t(`suno.button.overpainting`):e===`underpainting`?this.$t(`suno.button.underpainting`):e===`samples`?this.$t(`suno.button.samples`):e===`adjust_speed`?this.$t(`suno.button.adjust_speed`):this.$t(`suno.button.generate`)}},methods:{onGenerate(){this.$emit(`generate`)},onClearAll(){this.$store.commit(`suno/setConfig`,{custom:!1,sounds:!1,instrumental:!1,lyric:``,style:``,title:``,lyrics_mode:`manual`,model:this.$store.state.suno?.config?.model})}}}),Fi={class:`flex flex-col h-full`},Ii={class:`flex-1 overflow-y-auto p-5`},Li={class:`pt-2 px-1`},Ri={class:`pt-2 px-1`},zi={class:`flex flex-col items-center justify-center px-5 pb-5 gap-2`},Bi={class:`flex gap-2 w-full`};function Vi(e,t,s,c,d,h){let g=f(`type-selector`),_=f(`upload-audio`),v=f(`prompt-input`),y=f(`extend-from-input`),b=f(`cover-from-input`),x=f(`replace-section-input`),S=f(`overpainting-input`),C=f(`underpainting-input`),w=f(`samples-input`),T=f(`adjust-speed-input`),E=f(`advanced-params`),D=f(`el-tab-pane`),O=f(`lyric-input`),k=f(`style-input`),A=f(`title-input`),j=f(`vocal-gender-selector`),M=f(`persona-input`),N=f(`el-tabs`),P=f(`consumption`),F=f(`font-awesome-icon`),I=f(`el-button`);return u(),p(`div`,Fi,[r(`div`,Ii,[a(N,{modelValue:e.mode,"onUpdate:modelValue":t[0]||=t=>e.mode=t,class:`suno-mode-tabs`,stretch:``},{default:m(()=>[a(D,{label:e.$t(`suno.mode.simple`),name:`simple`},{default:m(()=>[r(`div`,Li,[a(g,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),e.config?.action===`extend`?(u(),n(y,{key:0,class:`mb-4`})):o(``,!0),e.config?.action===`cover`?(u(),n(b,{key:1,class:`mb-4`})):o(``,!0),e.config?.action===`replace_section`?(u(),n(x,{key:2,class:`mb-4`})):o(``,!0),e.config?.action===`overpainting`?(u(),n(S,{key:3,class:`mb-4`})):o(``,!0),e.config?.action===`underpainting`?(u(),n(C,{key:4,class:`mb-4`})):o(``,!0),e.config?.action===`samples`?(u(),n(w,{key:5,class:`mb-4`})):o(``,!0),e.config?.action===`adjust_speed`?(u(),n(T,{key:6,class:`mb-4`})):o(``,!0),a(E,{class:`mb-4`})])]),_:1},8,[`label`]),a(D,{label:e.$t(`suno.mode.custom`),name:`custom`},{default:m(()=>[r(`div`,Ri,[a(g,{class:`mb-4`}),a(_,{class:`mb-4`}),e.config?.instrumental?o(``,!0):(u(),n(O,{key:0,class:`mb-4`})),a(k,{class:`mb-4`}),a(A,{class:`mb-4`}),!e.config?.instrumental&&e.supportsVocalGender?(u(),n(j,{key:1,class:`mb-4`})):o(``,!0),e.supportsPersona?(u(),n(M,{key:2,class:`mb-4`})):o(``,!0),e.config?.action===`extend`?(u(),n(y,{key:3,class:`mb-4`})):o(``,!0),e.config?.action===`cover`?(u(),n(b,{key:4,class:`mb-4`})):o(``,!0),e.config?.action===`replace_section`?(u(),n(x,{key:5,class:`mb-4`})):o(``,!0),e.config?.action===`overpainting`?(u(),n(S,{key:6,class:`mb-4`})):o(``,!0),e.config?.action===`underpainting`?(u(),n(C,{key:7,class:`mb-4`})):o(``,!0),e.config?.action===`samples`?(u(),n(w,{key:8,class:`mb-4`})):o(``,!0),e.config?.action===`adjust_speed`?(u(),n(T,{key:9,class:`mb-4`})):o(``,!0),a(E,{class:`mb-4`})])]),_:1},8,[`label`])]),_:1},8,[`modelValue`])]),r(`div`,zi,[a(P,{value:e.consumption,service:e.service},null,8,[`value`,`service`]),r(`div`,Bi,[a(I,{class:`flex-1`,onClick:e.onClearAll},{default:m(()=>[a(F,{icon:`fa-solid fa-broom`,class:`mr-1`}),i(` `+l(e.$t(`suno.button.clear_all`)),1)]),_:1},8,[`onClick`]),a(I,{type:`primary`,class:`flex-1`,round:``,onClick:e.onGenerate},{default:m(()=>[a(F,{icon:`fa-solid fa-magic`,class:`mr-2`}),i(` `+l(e.generateButtonText),1)]),_:1},8,[`onClick`])])])])}var Hi=W(Pi,[[`render`,Vi],[`__scopeId`,`data-v-c62324e6`]]),Ui=we(),Wi=U(`suno`),Gi=s({name:`TaskPreview`,components:{ElImage:P,ElIcon:w,ElTooltip:N,FontAwesomeIcon:Z,VideoPlay:S,VideoPause:C,ElDropdown:V,ElDropdownMenu:re,ElDropdownItem:B,ElInput:G,ElProgress:ae,ElCheckbox:I,Loading:x,ApiCodeDialog:ye},props:{modelValue:{type:Object,required:!0}},data(){return{isFetchingVideoUrl:!1,isFetchingWav:!1,isFetchingMidi:!1,editingAudioId:null,editingTitle:``,apiCodeVisible:!1,apiCodePath:`/suno/audios`,apiCodeBody:{}}},computed:{loading(){return this.$store.state.suno?.status?.getApplications===X.Request},credential(){return this.$store.state.suno.credential},config(){return this.$store.state.suno.config},task(){return this.$store.state.suno?.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.suno?.application},active(){return this.$store.state.suno?.tasks?.active},isMashupMode(){return this.$store.state.suno?.config?.action===`mashup`},mashupAudioIds(){return this.$store.state.suno?.config?.mashup_audio_ids||[]}},methods:{useFormatDuring:$,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=`/suno/audios`,this.apiCodeVisible=!0},onPlay(e){this.$store.dispatch(`suno/setAudio`,{...this.$store.state.suno.audio,...e,state:`playing`}),console.log(`on play`)},onPause(e){this.$store.dispatch(`suno/setAudio`,{...this.$store.state.suno.audio,...e,state:`paused`}),console.log(`on pause`)},onClick(e){this.$store.state?.suno?.audio?.id!==e.id&&this.onPlay({...e,progress:0})},onExtend(e,t){e.stopPropagation(),console.log(`on extend`),console.debug(`set config`,t),this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.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(),console.log(`on download`,t);let n=new URL(t).pathname,r=n.substring(n.lastIndexOf(`/`)+1);console.log(`on preview`,r),fetch(t).then(e=>e.blob()).then(e=>{(0,Ui.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),J.error(this.$t(`suno.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}Y.mp4(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(),console.log(`on preview`,t),window.open(t,`_blank`)},async onGetStems(e){await this.onGenerateAudioUrl(`stems`,e)},onCover(e){console.log(`on cover`),console.debug(`set config`,e),this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,model:e.model,custom:!0,instrumental:!1,style:e.style,action:`cover`,audio:e,audio_id:e.id})},async onConcatMusic(e){await this.onGenerateAudioUrl(`concat`,e)},async onRemaster(e){await this.onGenerateAudioUrl(`remaster`,e)},async onGetAllStems(e){await this.onGenerateAudioUrl(`all_stems`,e)},onReplaceSection(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.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)})},onMashup(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:`mashup`,audio:e,audio_id:e.id,mashup_audio_ids:[e.id]})},onOverpainting(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:`overpainting`,audio:e,audio_id:e.id,overpainting_start:0,overpainting_end:Math.min(30,e.duration||30)})},onUnderpainting(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:`underpainting`,audio:e,audio_id:e.id,underpainting_start:0,underpainting_end:Math.min(30,e.duration||30)})},onSamples(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:`samples`,audio:e,audio_id:e.id,samples_start:0,samples_end:Math.min(30,e.duration||30)})},onArtistConsistency(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:`artist_consistency`,audio:e,audio_id:e.id})},onAdjustSpeed(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:`adjust_speed`,audio:e,audio_id:e.id,speed:1})},onReusePrompt(e){let t=this.modelValue?.request??{};if(!(t.prompt||t.lyric||t.style||t.title||t.lyric_prompt||t.style_negative||t.persona_id)){J.warning(this.$t(`suno.message.reusePromptEmpty`));return}this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,model:t.model??e.model,custom:t.custom??!1,instrumental:t.instrumental??!1,prompt:t.prompt??``,lyric:t.lyric??``,lyric_prompt:t.lyric_prompt??``,lyrics_mode:t.lyrics_mode??`manual`,title:t.title??``,style:t.style??``,style_negative:t.style_negative??``,vocal_gender:t.vocal_gender,weirdness:t.weirdness,style_influence:t.style_influence,variation_category:t.variation_category,audio_weight:t.audio_weight,persona_id:t.persona_id,action:void 0,audio:void 0,audio_id:void 0,mashup_audio_ids:void 0,continue_at:void 0,speed:void 0,replace_section_start:void 0,replace_section_end:void 0,overpainting_start:void 0,overpainting_end:void 0,underpainting_start:void 0,underpainting_end:void 0,samples_start:void 0,samples_end:void 0}),J.success(this.$t(`suno.message.reusePromptSuccess`))},async onExtractVocals(e){let t=this.credential?.token;t&&(J.info(this.$t(`suno.message.extractingVocals`)),Y.vox({audio_id:e,callback_url:Wi},{token:t}).then(()=>{J.success(this.$t(`suno.message.extractVocalsSuccess`))}).catch(e=>{J.error(e?.response?.data?.error?.message||this.$t(`suno.message.extractVocalsFailed`))}).finally(async()=>{await this.onGetTasks(),await this.onScrollDown()}))},async onGetTiming(e){let t=this.credential?.token;t&&(J.info(this.$t(`suno.message.fetchingTiming`)),Y.timing({audio_id:e},{token:t}).then(e=>{J.success(this.$t(`suno.message.fetchTimingSuccess`)),console.debug(`timing data`,e.data)}).catch(e=>{J.error(e?.response?.data?.error?.message||this.$t(`suno.message.fetchTimingFailed`))}))},async handleWavDownload(e){if(!e?.id||this.isFetchingWav)return;let t=this.credential?.token;if(t)try{this.isFetchingWav=!0,J.info(this.$t(`suno.message.fetchingWav`));let n=(await Y.wav({audio_id:e.id},{token:t})).data?.data?.[0]?.file_url;n?this.onDownload(null,n):J.error(this.$t(`suno.message.fetchWavFailed`))}catch(e){let t=e?.response?.data?.error?.message;J.error(t||this.$t(`suno.message.fetchWavFailed`))}finally{this.isFetchingWav=!1}},async handleMidiDownload(e){if(!e?.id||this.isFetchingMidi)return;let t=this.credential?.token;if(t)try{this.isFetchingMidi=!0,J.info(this.$t(`suno.message.fetchingMidi`));let n=(await Y.midi({audio_id:e.id},{token:t})).data?.data;if(!n?.length){J.error(this.$t(`suno.message.fetchMidiFailed`));return}let r=(e.title||e.id||`suno`).replace(/[^\w.-]+/g,`_`)+`.json`;(0,Ui.saveAs)(new Blob([JSON.stringify(n,null,2)],{type:`application/json`}),r)}catch(e){let t=e?.response?.data?.error?.message;J.error(t||this.$t(`suno.message.fetchMidiFailed`))}finally{this.isFetchingMidi=!1}},async onGenerateAudioUrl(e,t){let n={action:e,audio_id:t,callback_url:Wi},r=this.credential?.token;if(!r){console.error(`no token specified`);return}J.info(this.$t(`suno.message.startingTask`)),Y.audio(n,{token:r}).then(()=>{J.success(this.$t(`suno.message.startTaskSuccess`))}).catch(e=>{J.error(e?.response?.data?.error?.message||this.$t(`suno.message.startTaskFailed`))}).finally(async()=>{await this.onGetTasks(),await this.onScrollDown()})},isMashupSelected(e){return!!e.id&&this.mashupAudioIds.includes(e.id)},onToggleMashup(e){if(!e.id)return;let t=[...this.mashupAudioIds],n=t.indexOf(e.id);n===-1?t.push(e.id):t.splice(n,1),this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,mashup_audio_ids:t})},async onScrollDown(){setTimeout(()=>{let e=document.querySelector(`.tasks`);e&&(e.scrollTop=e.scrollHeight)},1e3)},onStartTitleEdit(e){this.editingAudioId=e.id??null,this.editingTitle=e.title||``,this.$nextTick(()=>{this.$refs.titleInput?.focus?.()})},onSaveTitleEdit(e){if(this.editingAudioId!==e.id)return;let t=this.editingTitle.trim();if(t&&t!==e.title){let n=this.$store.state.suno?.tasks;if(n?.items)for(let r of n.items){let n=(r?.response?.data??[]).find(t=>t.id===e.id);if(n){n.title=t;break}}}this.editingAudioId=null,this.editingTitle=``},onCancelTitleEdit(){this.editingAudioId=null,this.editingTitle=``},async onDelete(e){try{await q.confirm(this.$t(`suno.message.confirmDelete`),{confirmButtonText:this.$t(`suno.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`})}catch{return}let t=this.$store.state.suno?.tasks;if(t?.items)for(let n of t.items){let r=n?.response?.data??[],i=r.findIndex(t=>t.id===e.id);if(i!==-1){if(r.splice(i,1),r.length===0){let e=t.items.indexOf(n);e!==-1&&t.items.splice(e,1)}break}}this.$store.state?.suno?.audio?.id===e.id&&this.$store.dispatch(`suno/setAudio`,null),J.success(this.$t(`suno.message.deleteSuccess`))},async onGetTasks(){if(this.loading){console.debug(`loading`);return}await this.$store.dispatch(`suno/getTasks`,{limit:30,offset:0})}}}),Ki={class:`task`},qi=[`onClick`],Ji=[`onClick`],Yi={class:`left`},Xi=[`onClick`],Zi=[`onClick`],Qi={key:2,class:`duration`},$i={class:`info`},ea={key:1,class:`title-row`},ta={class:`title`},na={class:`style`},ra={key:2,class:`progress-row`},ia={class:`progress-text`},aa={class:`right`},oa={class:`el-dropdown-link`},sa={class:`flex items-center min-w-[120px]`},ca={class:`flex items-center min-w-[120px]`},la={class:`flex items-center min-w-[120px]`},ua={class:`el-dropdown-link`};function da(e,s,d,b,x,S){let C=f(`el-checkbox`),w=f(`el-image`),T=f(`video-pause`),E=f(`el-icon`),D=f(`video-play`),O=f(`el-input`),k=f(`font-awesome-icon`),A=f(`el-progress`),j=f(`el-tooltip`),M=f(`Loading`),N=f(`el-dropdown-item`),P=f(`el-dropdown-menu`),F=f(`el-dropdown`),I=f(`api-code-dialog`),L=h(`loading`);return u(),p(`div`,Ki,[(u(!0),p(v,null,c(e.audios,c=>(u(),p(`div`,{key:c.id,class:t([`audio`,{"mashup-selected":e.isMashupSelected(c)}]),onClick:y(t=>e.onClick(c),[`stop`])},[e.isMashupMode&&c?.audio_url?(u(),p(`div`,{key:0,class:`mashup-check`,onClick:y(t=>e.onToggleMashup(c),[`stop`])},[a(C,{"model-value":e.isMashupSelected(c),onClick:s[0]||=y(()=>{},[`stop`])},null,8,[`model-value`])],8,Ji)):o(``,!0),g((u(),p(`div`,Yi,[a(w,{src:c?.image_url,class:`cover`,fit:`cover`,lazy:``},null,8,[`src`]),c?.audio_url&&e.$store.state?.suno?.audio?.id===c.id&&e.$store.state?.suno?.audio?.state===`playing`?(u(),p(`div`,{key:0,class:`overlay`,onClick:y(t=>e.onPause(c),[`stop`])},[a(E,null,{default:m(()=>[a(T)]),_:1})],8,Xi)):o(``,!0),c?.audio_url&&(e.$store.state?.suno?.audio?.id!==c.id||e.$store.state?.suno?.audio?.id===c.id&&e.$store.state?.suno?.audio?.state===`paused`)?(u(),p(`div`,{key:1,class:`overlay`,onClick:y(t=>e.onPlay(c),[`stop`])},[a(E,null,{default:m(()=>[a(D)]),_:1})],8,Zi)):o(``,!0),c?.duration?(u(),p(`div`,Qi,l(e.useFormatDuring(c?.duration)),1)):o(``,!0)])),[[L,!c?.audio_url]]),r(`div`,$i,[e.editingAudioId===c.id?(u(),p(`div`,{key:0,class:`title-edit`,onClick:s[2]||=y(()=>{},[`stop`])},[a(O,{ref_for:!0,ref:`titleInput`,modelValue:e.editingTitle,"onUpdate:modelValue":s[1]||=t=>e.editingTitle=t,size:`small`,onKeyup:[_(t=>e.onSaveTitleEdit(c),[`enter`]),_(e.onCancelTitleEdit,[`escape`])],onBlur:t=>e.onSaveTitleEdit(c)},null,8,[`modelValue`,`onKeyup`,`onBlur`])])):(u(),p(`div`,ea,[r(`h2`,ta,l(c?.title),1),c?.audio_url?(u(),n(k,{key:0,icon:`fa-solid fa-pen`,class:`edit-icon`,onClick:y(t=>e.onStartTitleEdit(c),[`stop`])},null,8,[`onClick`])):o(``,!0)])),r(`p`,na,l(c?.style),1),!c?.audio_url&&c?.progress!=null&&c?.progress<100?(u(),p(`div`,ra,[a(A,{percentage:Math.round(c.progress),"stroke-width":4,"show-text":!1,status:`warning`,class:`progress-bar`},null,8,[`percentage`]),r(`span`,ia,l(e.$t(`suno.name.generating`))+` `+l(Math.round(c.progress))+`%`,1)])):o(``,!0)]),r(`div`,aa,[a(F,null,{dropdown:m(()=>[a(P,null,{default:m(()=>[a(N,{disabled:e.isFetchingVideoUrl,onClick:t=>e.handleVideoDownload(c)},{default:m(()=>[r(`div`,sa,[e.isFetchingVideoUrl?(u(),n(E,{key:0,class:`is-loading mr-2`},{default:m(()=>[a(M)]),_:1})):o(``,!0),r(`span`,null,l(e.$t(`suno.button.download_video`)),1)])]),_:1},8,[`disabled`,`onClick`]),c?.audio_url?(u(),n(N,{key:0,onClick:y(t=>e.onDownload(t,c?.audio_url),[`stop`])},{default:m(()=>[i(l(e.$t(`suno.button.download_audio`)),1)]),_:1},8,[`onClick`])):o(``,!0),a(N,{disabled:e.isFetchingWav,onClick:t=>e.handleWavDownload(c)},{default:m(()=>[r(`div`,ca,[e.isFetchingWav?(u(),n(E,{key:0,class:`is-loading mr-2`},{default:m(()=>[a(M)]),_:1})):o(``,!0),r(`span`,null,l(e.$t(`suno.button.download_wav`)),1)])]),_:1},8,[`disabled`,`onClick`]),a(N,{disabled:e.isFetchingMidi,onClick:t=>e.handleMidiDownload(c)},{default:m(()=>[r(`div`,la,[e.isFetchingMidi?(u(),n(E,{key:0,class:`is-loading mr-2`},{default:m(()=>[a(M)]),_:1})):o(``,!0),r(`span`,null,l(e.$t(`suno.button.download_midi`)),1)])]),_:1},8,[`disabled`,`onClick`])]),_:2},1024)]),default:m(()=>[r(`span`,oa,[a(j,{effect:`dark`,content:e.$t(`suno.button.download`),placement:`top`},{default:m(()=>[c?.audio_url||c?.video_url?(u(),n(k,{key:0,icon:`fa-solid fa-download`,class:`icon icon-download`})):o(``,!0)]),_:2},1032,[`content`])])]),_:2},1024),a(F,null,{dropdown:m(()=>[a(P,{class:`suno-action-menu`},{default:m(()=>[c?.audio_url?(u(),n(N,{key:0,onClick:y(t=>e.onExtend(t,c),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-forward`,class:`menu-icon`}),i(` `+l(e.$t(`suno.button.extend`)),1)]),_:1},8,[`onClick`])):o(``,!0),a(N,{onClick:y(t=>e.onCover(c),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-music`,class:`menu-icon`}),i(` `+l(e.$t(`suno.button.cover_music`)),1)]),_:1},8,[`onClick`]),c?.id?(u(),n(N,{key:1,onClick:y(t=>e.onMashup(c),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-shuffle`,class:`menu-icon`}),i(` `+l(e.$t(`suno.button.mashup`)),1)]),_:1},8,[`onClick`])):o(``,!0),c?.id&&c?.action===`extend`?(u(),n(N,{key:2,onClick:y(t=>e.onConcatMusic(c?.id),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-link`,class:`menu-icon`}),i(` `+l(e.$t(`suno.button.concat_music`)),1)]),_:1},8,[`onClick`])):o(``,!0),s[4]||=r(`div`,{class:`menu-divider`},null,-1),c?.id?(u(),n(N,{key:3,onClick:y(t=>e.onReplaceSection(c),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-scissors`,class:`menu-icon`}),i(` `+l(e.$t(`suno.button.replace_section`)),1)]),_:1},8,[`onClick`])):o(``,!0),c?.id?(u(),n(N,{key:4,onClick:y(t=>e.onOverpainting(c),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-microphone`,class:`menu-icon`}),i(` `+l(e.$t(`suno.button.overpainting`)),1)]),_:1},8,[`onClick`])):o(``,!0),c?.id?(u(),n(N,{key:5,onClick:y(t=>e.onUnderpainting(c),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-guitar`,class:`menu-icon`}),i(` `+l(e.$t(`suno.button.underpainting`)),1)]),_:1},8,[`onClick`])):o(``,!0),c?.id?(u(),n(N,{key:6,onClick:y(t=>e.onSamples(c),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-drum`,class:`menu-icon`}),i(` `+l(e.$t(`suno.button.samples`)),1)]),_:1},8,[`onClick`])):o(``,!0),s[5]||=r(`div`,{class:`menu-divider`},null,-1),c.id?(u(),n(N,{key:7,onClick:y(t=>e.onGetStems(c.id),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-layer-group`,class:`menu-icon`}),i(` `+l(e.$t(`suno.button.get_stems`)),1)]),_:1},8,[`onClick`])):o(``,!0),c.id?(u(),n(N,{key:8,onClick:y(t=>e.onGetAllStems(c.id),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-bars-staggered`,class:`menu-icon`}),i(` `+l(e.$t(`suno.button.all_stems`)),1)]),_:1},8,[`onClick`])):o(``,!0),c?.id?(u(),n(N,{key:9,onClick:y(t=>e.onRemaster(c.id),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-wand-magic-sparkles`,class:`menu-icon`}),i(` `+l(e.$t(`suno.button.remaster`)),1)]),_:1},8,[`onClick`])):o(``,!0),c?.id?(u(),n(N,{key:10,onClick:y(t=>e.onExtractVocals(c.id),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-headphones`,class:`menu-icon`}),i(` `+l(e.$t(`suno.button.extract_vocals`)),1)]),_:1},8,[`onClick`])):o(``,!0),c?.id?(u(),n(N,{key:11,onClick:y(t=>e.onArtistConsistency(c),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-palette`,class:`menu-icon`}),i(` `+l(e.$t(`suno.button.artist_consistency`)),1)]),_:1},8,[`onClick`])):o(``,!0),c?.id?(u(),n(N,{key:12,onClick:y(t=>e.onAdjustSpeed(c),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-gauge-high`,class:`menu-icon`}),i(` `+l(e.$t(`suno.button.adjust_speed`)),1)]),_:1},8,[`onClick`])):o(``,!0),s[6]||=r(`div`,{class:`menu-divider`},null,-1),a(N,{onClick:y(t=>e.onReusePrompt(c),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-rotate-left`,class:`menu-icon`}),i(` `+l(e.$t(`suno.button.reuse_prompt`)),1)]),_:1},8,[`onClick`]),c?.id?(u(),n(N,{key:13,onClick:y(t=>e.onGetTiming(c.id),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-clock`,class:`menu-icon`}),i(` `+l(e.$t(`suno.button.get_timing`)),1)]),_:1},8,[`onClick`])):o(``,!0),a(N,{onClick:y(e.onViewCode,[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-code`,class:`menu-icon`}),i(` `+l(e.$t(`common.button.viewCode`)),1)]),_:1},8,[`onClick`]),s[7]||=r(`div`,{class:`menu-divider`},null,-1),c?.id?(u(),n(N,{key:14,class:`delete-item`,onClick:y(t=>e.onDelete(c),[`stop`])},{default:m(()=>[a(k,{icon:`fa-solid fa-trash`,class:`menu-icon delete-icon`}),i(` `+l(e.$t(`suno.button.delete`)),1)]),_:1},8,[`onClick`])):o(``,!0)]),_:2},1024)]),default:m(()=>[r(`span`,ua,[a(j,{effect:`dark`,content:e.$t(`suno.button.more`),placement:`top`},{default:m(()=>[c?.audio_url||c?.video_url?(u(),n(k,{key:0,icon:`fa-solid fa-ellipsis`,class:`icon icon-ellipsis`})):o(``,!0)]),_:2},1032,[`content`])])]),_:2},1024)])],10,qi))),128)),a(I,{visible:e.apiCodeVisible,"onUpdate:visible":s[3]||=t=>e.apiCodeVisible=t,method:`POST`,path:e.apiCodePath,body:e.apiCodeBody,token:e.$store.state.suno?.credential?.token||``},null,8,[`visible`,`path`,`body`,`token`])])}var fa=s({name:`RecentPanel`,components:{ElSkeletonItem:oe,ElSkeleton:se,ElInput:G,ElButton:b,ElDropdown:V,ElDropdownMenu:re,ElDropdownItem:B,ElPopover:ie,ElRadioGroup:R,ElRadioButton:L,ElSelect:E,ElOption:D,FontAwesomeIcon:Z,TaskPreview:W(Gi,[[`render`,da]]),Player:Te,NoTasks:Se,ScrollList:ve},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0,searchQuery:``,sortBy:`newest`,filterType:`all`,filterDuration:`all`,filterVideo:`all`,filterModel:`all`}},computed:{tasks(){return{...this.$store.state.suno?.tasks,items:this.$store.state.suno?.tasks?.items?.slice()}},sortLabel(){return this.sortBy===`newest`?this.$t(`suno.sort.newest`):this.$t(`suno.sort.oldest`)},activeFilterCount(){let e=0;return this.filterType!==`all`&&e++,this.filterDuration!==`all`&&e++,this.filterVideo!==`all`&&e++,this.filterModel&&this.filterModel!==`all`&&e++,e},availableModels(){let e=this.tasks?.items||[],t=new Set;for(let n of e){let e=n?.response?.data??[];for(let n of e)n.model&&t.add(n.model)}return Array.from(t).sort()},filteredTasks(){let e=this.tasks?.items||[];if(this.searchQuery){let t=this.searchQuery.toLowerCase();e=e.filter(e=>(e?.response?.data??[]).some(e=>e.title?.toLowerCase().includes(t)||e.style?.toLowerCase().includes(t)||e.prompt?.toLowerCase().includes(t)))}return this.activeFilterCount>0&&(e=e.filter(e=>{let t=e?.request??{},n=e?.response?.data??[];return this.filterType===`vocal`&&t.instrumental===!0||this.filterType===`instrumental`&&t.instrumental!==!0?!1:this.filterDuration!==`all`||this.filterVideo!==`all`||this.filterModel&&this.filterModel!==`all`?n.some(e=>!(this.filterDuration===`short`&&!(typeof e.duration==`number`&&e.duration<60)||this.filterDuration===`medium`&&!(typeof e.duration==`number`&&e.duration>=60&&e.duration<=180)||this.filterDuration===`long`&&!(typeof e.duration==`number`&&e.duration>180)||this.filterVideo===`with`&&!e.video_url||this.filterVideo===`without`&&e.video_url||this.filterModel&&this.filterModel!==`all`&&e.model!==this.filterModel)):!0})),this.sortBy===`oldest`&&(e=[...e].reverse()),e}},methods:{onSortChange(e){this.sortBy=e},onResetFilters(){this.filterType=`all`,this.filterDuration=`all`,this.filterVideo=`all`,this.filterModel=`all`},getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),pa={key:0,class:`tasks`},ma={class:`left w-[70px] p-[10px] flex items-center`},ha={class:`main w-[calc(100%-70px)] flex-1 p-[10px]`},ga={key:0,class:`task-toolbar`},_a={key:0,class:`filter-badge`},va={class:`filter-popover`},ya={class:`filter-row`},ba={class:`filter-label`},xa={class:`filter-row`},Sa={class:`filter-label`},Ca={class:`filter-row`},wa={class:`filter-label`},Ta={key:0,class:`filter-row`},Ea={class:`filter-label`},Da={class:`filter-actions`},Oa={key:2,class:`w-full flex-1 flex items-center justify-center`},ka={class:`text-sm text-gray-400`},Aa={key:3,class:`w-full flex-1 flex flex-col items-center justify-center gap-2`},ja={class:`text-sm text-gray-400`},Ma={key:4,class:`w-full flex-1 flex items-center justify-center`},Na={class:`h-20`};function Pa(e,s,h,_,y,b){let x=f(`el-skeleton-item`),S=f(`el-skeleton`),C=f(`font-awesome-icon`),w=f(`el-input`),T=f(`el-button`),E=f(`el-dropdown-item`),D=f(`el-dropdown-menu`),O=f(`el-dropdown`),k=f(`el-radio-button`),A=f(`el-radio-group`),j=f(`el-option`),M=f(`el-select`),N=f(`el-popover`),P=f(`task-preview`),F=f(`scroll-list`),I=f(`no-tasks`),L=f(`player`);return u(),p(v,null,[e.tasks?.items===void 0?(u(),p(`div`,pa,[(u(),p(v,null,c(3,e=>r(`div`,{key:e,class:`flex`},[r(`div`,ma,[a(S,{animated:``},{template:m(()=>[a(x,{variant:`image`,class:`avatar w-[50px] h-[50px]`})]),_:1})]),r(`div`,ha,[a(S,{animated:``},{template:m(()=>[a(x,{variant:`p`,class:`w-[200px] h-[15px] mb-[5px] mt-[10px]`}),a(x,{variant:`text`})]),_:1})])])),64))])):(u(),p(v,{key:1},[e.tasks?.items?.length?(u(),p(`div`,ga,[a(w,{modelValue:e.searchQuery,"onUpdate:modelValue":s[0]||=t=>e.searchQuery=t,size:`small`,placeholder:e.$t(`suno.placeholder.searchSongs`),clearable:``,class:`task-search`},{prefix:m(()=>[a(C,{icon:`fa-solid fa-magnifying-glass`,class:`text-xs`})]),_:1},8,[`modelValue`,`placeholder`]),a(O,{trigger:`click`,onCommand:e.onSortChange},{dropdown:m(()=>[a(D,null,{default:m(()=>[a(E,{command:`newest`,class:t({"is-active":e.sortBy===`newest`})},{default:m(()=>[i(l(e.$t(`suno.sort.newest`)),1)]),_:1},8,[`class`]),a(E,{command:`oldest`,class:t({"is-active":e.sortBy===`oldest`})},{default:m(()=>[i(l(e.$t(`suno.sort.oldest`)),1)]),_:1},8,[`class`])]),_:1})]),default:m(()=>[a(T,{size:`small`,class:`sort-btn`},{default:m(()=>[a(C,{icon:`fa-solid fa-arrow-down-wide-short`,class:`mr-1`}),i(` `+l(e.sortLabel),1)]),_:1})]),_:1},8,[`onCommand`]),a(N,{trigger:`click`,placement:`bottom-end`,width:260},{reference:m(()=>[a(T,{size:`small`,class:t([`filter-btn`,{"has-active-filter":e.activeFilterCount>0}])},{default:m(()=>[a(C,{icon:`fa-solid fa-filter`,class:`mr-1`}),i(` `+l(e.$t(`suno.filter.title`))+` `,1),e.activeFilterCount>0?(u(),p(`span`,_a,l(e.activeFilterCount),1)):o(``,!0)]),_:1},8,[`class`])]),default:m(()=>[r(`div`,va,[r(`div`,ya,[r(`div`,ba,l(e.$t(`suno.filter.type`)),1),a(A,{modelValue:e.filterType,"onUpdate:modelValue":s[1]||=t=>e.filterType=t,size:`small`},{default:m(()=>[a(k,{value:`all`},{default:m(()=>[i(l(e.$t(`suno.filter.typeAll`)),1)]),_:1}),a(k,{value:`vocal`},{default:m(()=>[i(l(e.$t(`suno.filter.typeVocal`)),1)]),_:1}),a(k,{value:`instrumental`},{default:m(()=>[i(l(e.$t(`suno.filter.typeInstrumental`)),1)]),_:1})]),_:1},8,[`modelValue`])]),r(`div`,xa,[r(`div`,Sa,l(e.$t(`suno.filter.duration`)),1),a(A,{modelValue:e.filterDuration,"onUpdate:modelValue":s[2]||=t=>e.filterDuration=t,size:`small`},{default:m(()=>[a(k,{value:`all`},{default:m(()=>[i(l(e.$t(`suno.filter.durationAll`)),1)]),_:1}),a(k,{value:`short`},{default:m(()=>[i(l(e.$t(`suno.filter.durationShort`)),1)]),_:1}),a(k,{value:`medium`},{default:m(()=>[i(l(e.$t(`suno.filter.durationMedium`)),1)]),_:1}),a(k,{value:`long`},{default:m(()=>[i(l(e.$t(`suno.filter.durationLong`)),1)]),_:1})]),_:1},8,[`modelValue`])]),r(`div`,Ca,[r(`div`,wa,l(e.$t(`suno.filter.video`)),1),a(A,{modelValue:e.filterVideo,"onUpdate:modelValue":s[3]||=t=>e.filterVideo=t,size:`small`},{default:m(()=>[a(k,{value:`all`},{default:m(()=>[i(l(e.$t(`suno.filter.videoAll`)),1)]),_:1}),a(k,{value:`with`},{default:m(()=>[i(l(e.$t(`suno.filter.videoWith`)),1)]),_:1}),a(k,{value:`without`},{default:m(()=>[i(l(e.$t(`suno.filter.videoWithout`)),1)]),_:1})]),_:1},8,[`modelValue`])]),e.availableModels.length>0?(u(),p(`div`,Ta,[r(`div`,Ea,l(e.$t(`suno.filter.model`)),1),a(M,{modelValue:e.filterModel,"onUpdate:modelValue":s[4]||=t=>e.filterModel=t,size:`small`,placeholder:e.$t(`suno.filter.modelAll`),clearable:``},{default:m(()=>[a(j,{label:e.$t(`suno.filter.modelAll`),value:`all`},null,8,[`label`]),(u(!0),p(v,null,c(e.availableModels,e=>(u(),n(j,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])):o(``,!0),r(`div`,Da,[a(T,{size:`small`,text:``,onClick:e.onResetFilters},{default:m(()=>[i(l(e.$t(`suno.filter.reset`)),1)]),_:1},8,[`onClick`])])])]),_:1})])):o(``,!0),e.filteredTasks?.length>0?(u(),n(F,{key:1,ref:`scrollList`,class:`flex-1 w-full overflow-y-auto tasks p-2`,loading:e.loading,onReachTop:s[5]||=t=>e.$emit(`reach-top`)},{default:m(()=>[(u(!0),p(v,null,c(e.filteredTasks,(e,t)=>(u(),n(P,{key:t,"model-value":e,class:`preview`},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):e.searchQuery&&e.tasks?.items?.length>0?(u(),p(`div`,Oa,[r(`p`,ka,l(e.$t(`suno.message.noSearchResults`)),1)])):e.activeFilterCount>0&&e.tasks?.items?.length>0?(u(),p(`div`,Aa,[r(`p`,ja,l(e.$t(`suno.message.noFilterResults`)),1),a(T,{size:`small`,text:``,onClick:e.onResetFilters},{default:m(()=>[i(l(e.$t(`suno.filter.reset`)),1)]),_:1},8,[`onClick`])])):e.tasks?.items?.length===0?(u(),p(`div`,Ma,[a(I)])):o(``,!0)],64)),g(r(`div`,Na,[a(L,{namespace:`suno`})],512),[[d,!!e.$store?.state?.suno?.audio?.object]])],64)}var Fa=W(fa,[[`render`,Pa],[`__scopeId`,`data-v-6ce376c9`]]),Ia=s({name:`TaskPreview`,components:{IconPicture:T,ElImage:P,ElAvatar:F,ElIcon:w},computed:{audio(){return this.$store.state.suno?.audio}}}),La={key:0,class:`size-full overflow-hidden`},Ra={class:`relative h-[300px]`},za={class:`flex items-center justify-center size-full bg-[var(--el-bg-color)]`},Ba={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`},Va={class:`p-4`},Ha={class:`flex items-center font-bold mb-2`},Ua={class:`text-[var(--el-text-color-regular)] mb-2`},Wa={class:`text-xs text-[var(--el-text-color-regular)]`},Ga={class:`mt-4 text-sm leading-[25px] whitespace-pre-wrap`},Ka={key:1,class:`w-full h-full`};function qa(e,t,n,i,o,s){let c=f(`icon-picture`),d=f(`el-icon`),h=f(`el-image`),g=f(`el-avatar`);return e.audio?.object?(u(),p(`div`,La,[r(`div`,Ra,[a(h,{src:e.audio.image_url,fit:`cover`,class:`size-full`},{error:m(()=>[r(`div`,za,[a(d,{class:`text-3xl`},{default:m(()=>[a(c)]),_:1})])]),_:1},8,[`src`]),r(`h2`,Ba,l(e.audio?.title),1)]),r(`div`,Va,[r(`div`,Ha,[a(g,{size:30,src:e.audio?.image_url,class:`mr-2`},null,8,[`src`]),r(`span`,null,l(e.audio?.title),1)]),r(`p`,Ua,l(e.audio?.style),1),r(`p`,Wa,l(e.$dayjs.format(e.audio?.created_at)),1),r(`div`,Ga,[r(`p`,null,l(e.audio?.lyric),1)])])])):(u(),p(`div`,Ka))}var Ja=W(Ia,[[`render`,qa]]),Ya=U(`suno`),Xa=s({name:`SunoIndex`,components:{Layout:Me,ConfigPanel:Hi,RecentPanel:Fa,PreviewPanel:Ja},mixins:[fe],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.suno?.status?.getApplications===X.Request},tasksLoading(){return this.$store.state.suno?.status?.getTasks===X.Request||this.fetchingTasks},service(){return this.$store.state.suno.service},credential(){return this.$store.state.suno.credential},config(){return this.$store.state.suno.config},initializing(){return this.$store.state.suno.status.getApplications===X.Request},needApply(){return this.$store.state.suno.status.getApplications===X.Success&&!this.application},application(){return this.$store.state.suno.application},tasks(){return this.$store.state.suno.tasks},applications(){return this.$store.state.suno.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 be({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(`suno/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplications`),await this.$store.dispatch(`suno/getApplications`),console.debug(`end onGetApplications`),await this.onGetTasks()},onApply(){de.create({application:this.application}).then(({data:e})=>{this.application=e,J.success(this.$t(`application.message.applySuccessfully`))}).catch(e=>{e?.response?.data?.code===`duplication`&&J.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(`suno/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerateAudio(){if(!he(this.uploadTracker,e=>this.$t(e),e=>J.warning(e)))return;let e={...this.config,callback_url:Ya};if(!this.hasSunoInput(e)){J.error(this.$t(`suno.message.promptRequired`));return}this.hasText(e.prompt)&&(e.prompt=e.prompt.trim());let t=this.credential?.token;if(!t){console.error(`no token specified`);return}J.info(this.$t(`suno.message.startingTask`)),pe(`suno`,Y.audio(e,{token:t})).then(()=>{J.success(this.$t(`suno.message.startTaskSuccess`))}).catch(e=>{J.error(e?.response?.data?.error?.message||this.$t(`suno.message.startTaskFailed`))}).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},hasSunoInput(e){return[e.prompt,e.lyric,e.lyric_prompt,e.style,e.title].some(e=>this.hasText(e))||this.hasText(e.audio_id)||Array.isArray(e.mashup_audio_ids)&&e.mashup_audio_ids.length>0}}});function Za(e,t,r,i,o,s){let c=f(`config-panel`),l=f(`recent-panel`),d=f(`preview-panel`),p=f(`layout`);return u(),n(p,null,{config:m(()=>[a(c,{onGenerate:e.onGenerateAudio},null,8,[`onGenerate`])]),result:m(()=>[a(l,{ref:`recentPanel`,class:`panel recent`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),preview:m(()=>[a(d)]),_:1})}var Qa=W(Xa,[[`render`,Za],[`__scopeId`,`data-v-b9beee12`]]);export{Qa as default};
|