@acedatacloud/nexior 3.162.0 → 3.164.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/dist/assets/{Auth-CWHfE0Bh.js → Auth-BfAOSpAe.js} +1 -1
  2. package/dist/assets/{BotPlaceholder-CXwVfZf3.js → BotPlaceholder-C54AZ889.js} +1 -1
  3. package/dist/assets/{Callback-Dw23ybg2.js → Callback-DZoSWk-Z.js} +1 -1
  4. package/dist/assets/{Console-Bg3a295D.js → Console-CDlazkxl.js} +1 -1
  5. package/dist/assets/{Consumption-B9gj7rI5.js → Consumption-DPIPEsS9.js} +1 -1
  6. package/dist/assets/{Conversation-DmfA3sxW.js → Conversation-oml46p2K.js} +1 -1
  7. package/dist/assets/{CopyToClipboard-DDFChBm_.js → CopyToClipboard-ChBaidri.js} +1 -1
  8. package/dist/assets/{Detail-T7f3rgnJ.js → Detail-CqwkxR83.js} +2 -2
  9. package/dist/assets/{EditArray-bLEJluIK.js → EditArray-BLlSziun.js} +1 -1
  10. package/dist/assets/{Extra-Ckc1_mtB.js → Extra-D498Jr_t.js} +1 -1
  11. package/dist/assets/{FilePreview-DyYhukMl.js → FilePreview-B1-9pFQy.js} +1 -1
  12. package/dist/assets/{History-CpZWNn_D.js → History-XuJNS5x5.js} +1 -1
  13. package/dist/assets/{IconPark.vue_vue_type_script_setup_true_lang-CcuE7020.js → IconPark.vue_vue_type_script_setup_true_lang-C6pchWWV.js} +1 -1
  14. package/dist/assets/{ImagePreview-B4dl6UUl.js → ImagePreview--cyOeVsV.js} +1 -1
  15. package/dist/assets/{ImageWrapper-C7KzvBjb.js → ImageWrapper-CRx7FO3Y.js} +1 -1
  16. package/dist/assets/{Index-BJj4jSnf.css → Index-0IwB1Y5h.css} +1 -1
  17. package/dist/assets/{Index-lJMndMZ7.js → Index-4k3NQnOs.js} +1 -1
  18. package/dist/assets/{Index-BhyqSwgS.js → Index-BEuERy96.js} +1 -1
  19. package/dist/assets/{Index-D7qfY-Vs.js → Index-BOxujQlS.js} +1 -1
  20. package/dist/assets/{Index-CbE8WDa2.js → Index-BSmwEk-A.js} +1 -1
  21. package/dist/assets/{Index-CNz_7K-8.js → Index-BhOygytU.js} +1 -1
  22. package/dist/assets/Index-BkIK__q9.css +1 -0
  23. package/dist/assets/{Index-CGu_vtvZ.js → Index-Brmtmo_l.js} +1 -1
  24. package/dist/assets/{Index-BKKy5L-L.js → Index-CGC3_Z0p.js} +1 -1
  25. package/dist/assets/{Index-Bm4QYO2z.js → Index-CLGpkhcF.js} +1 -1
  26. package/dist/assets/{Index-BnqYI8B1.js → Index-CP8Hn4z8.js} +1 -1
  27. package/dist/assets/Index-CbeERdJU.js +1 -0
  28. package/dist/assets/{Index-DT0U1fYz.js → Index-CbxsYfKJ.js} +1 -1
  29. package/dist/assets/{Index-CnakrVzF.js → Index-CmzAQYSg.js} +1 -1
  30. package/dist/assets/{Index-B-Rv66fr.js → Index-Cph1cpVq.js} +1 -1
  31. package/dist/assets/{Index-C8m5rWSy.js → Index-DHO72KUG.js} +1 -1
  32. package/dist/assets/{Index-Y8KKS5YR.js → Index-DKUksnKe.js} +1 -1
  33. package/dist/assets/{Index-B1WMh0J2.js → Index-DOCJqoTA.js} +1 -1
  34. package/dist/assets/{Index-uP5bcZ9C.js → Index-DZtA08Vf.js} +1 -1
  35. package/dist/assets/Index-DbEJhH7W.js +1 -0
  36. package/dist/assets/{Index-nAlGJ2aj.js → Index-DkZxqqao.js} +1 -1
  37. package/dist/assets/{Index-D7kqYKA9.js → Index-DmuAbmPF.js} +1 -1
  38. package/dist/assets/{Index-h7_qcwYp.js → Index-Gywcw8-y.js} +1 -1
  39. package/dist/assets/{Index-iAMtAGA1.js → Index-VmYdjQ_f.js} +1 -1
  40. package/dist/assets/{Index-B6CaUc6p.js → Index-l8B8tjIg.js} +1 -1
  41. package/dist/assets/{Index-DCOvvWff.js → Index-lHzvsRxc.js} +1 -1
  42. package/dist/assets/{Invitees-CXmMeXs_.js → Invitees-CZ29XnGS.js} +1 -1
  43. package/dist/assets/{List-C5_DWyZb.js → List-BNKL0l41.js} +1 -1
  44. package/dist/assets/{List-BqMcDV57.js → List-Bm7kPu5x.js} +1 -1
  45. package/dist/assets/{List-BCqzCUGp.js → List-bXdxaC4F.js} +1 -1
  46. package/dist/assets/{Main-DUe8uFEY.js → Main-9QhicBIw.js} +1 -1
  47. package/dist/assets/{Navigator-caj9NvyO.js → Navigator-Dsy4uSNW.js} +1 -1
  48. package/dist/assets/{NoTasks-C0_ki8Ur.js → NoTasks-d5P_8OkS.js} +1 -1
  49. package/dist/assets/{NotFound-BZ0PjgkI.js → NotFound-DyWtHXjT.js} +1 -1
  50. package/dist/assets/{OAuthCallback-rJGNyWEb.js → OAuthCallback-BMpq52HD.js} +1 -1
  51. package/dist/assets/{Pagination-3WwpcEG-.js → Pagination-Dv60IGeA.js} +1 -1
  52. package/dist/assets/{Status-B-3tIyiq.js → Status-vkOUzg8t.js} +1 -1
  53. package/dist/assets/{Subscribe-BzCSim6_.js → Subscribe-DTJDj4Vm.js} +1 -1
  54. package/dist/assets/{VideoPlayer-lbflQfYO.js → VideoPlayer-CnC3dy-X.js} +1 -1
  55. package/dist/assets/{_Uint8Array-rxEgK7pZ.js → _Uint8Array-DnXEH1kJ.js} +1 -1
  56. package/dist/assets/{_baseClone-CoFSI4Xz.js → _baseClone-DrdzZuzq.js} +1 -1
  57. package/dist/assets/{_baseIteratee-BP_fhl98.js → _baseIteratee-Dxd4hwaV.js} +1 -1
  58. package/dist/assets/{_initCloneObject-CSU1ND3o.js → _initCloneObject-CPj4Zmvt.js} +1 -1
  59. package/dist/assets/{add-C-CLMzx4.js → add-cxPg11OF.js} +1 -1
  60. package/dist/assets/{all-wallets-Dh-3cIg_.js → all-wallets-NyQuYf8C.js} +1 -1
  61. package/dist/assets/{app-store-CdSIGe2k.js → app-store-Celv8s5q.js} +1 -1
  62. package/dist/assets/{apple-DoADcqi3.js → apple-H2u4gTsm.js} +1 -1
  63. package/dist/assets/{arrow-bottom-CyFvfalx.js → arrow-bottom-DbFyQpBg.js} +1 -1
  64. package/dist/assets/{arrow-bottom-circle-BR8RckwT.js → arrow-bottom-circle-BD0sTKEb.js} +1 -1
  65. package/dist/assets/{arrow-left-BH_EVnIw.js → arrow-left-DSnefc8T.js} +1 -1
  66. package/dist/assets/{arrow-right-DZJdpv__.js → arrow-right-DdAnBRTH.js} +1 -1
  67. package/dist/assets/{arrow-top-Bl_NWuCO.js → arrow-top-B148nnK4.js} +1 -1
  68. package/dist/assets/{avatar-Cxest084.js → avatar-CyroQJ9i.js} +1 -1
  69. package/dist/assets/{bank-CtFLQcXv.js → bank-XrFR1LOV.js} +1 -1
  70. package/dist/assets/{basic-CN6GoObg.js → basic-EambTkf3.js} +1 -1
  71. package/dist/assets/{browser-DnMqFLoO.js → browser-BHb5uM4Z.js} +1 -1
  72. package/dist/assets/{byokCredential-BxxS0esT.js → byokCredential-BF5blPGZ.js} +1 -1
  73. package/dist/assets/{card-B8cMPY-O.js → card-CFgyRD2r.js} +1 -1
  74. package/dist/assets/{castArray-B2H9FWSG.js → castArray-D8by9zqR.js} +1 -1
  75. package/dist/assets/{chat-BDzBUqAR.js → chat-D--NGdo3.js} +1 -1
  76. package/dist/assets/{checkmark-bold-AuGKAxQn.js → checkmark-bold-DPJbJy8s.js} +1 -1
  77. package/dist/assets/{checkmark-BYdSr5Xt.js → checkmark-g_BmTw_H.js} +1 -1
  78. package/dist/assets/{chevron-bottom-BRHconub.js → chevron-bottom-fZDmGv1i.js} +1 -1
  79. package/dist/assets/{chevron-left-CNrelQQT.js → chevron-left-ITBjAm_K.js} +1 -1
  80. package/dist/assets/{chevron-right-D8pwAoEL.js → chevron-right-DQxUlX7k.js} +1 -1
  81. package/dist/assets/{chevron-top-DLsAFSc5.js → chevron-top-DL6CPBde.js} +1 -1
  82. package/dist/assets/{chrome-store-Cd-rdHtd.js → chrome-store-PwmK7sL3.js} +1 -1
  83. package/dist/assets/{clock-CDKOVWN3.js → clock-Dop8NzBd.js} +1 -1
  84. package/dist/assets/{close-DA6-jRe4.js → close-CrA9WrRK.js} +1 -1
  85. package/dist/assets/{coinPlaceholder-CkJiixxL.js → coinPlaceholder-Bcj4IcKK.js} +1 -1
  86. package/dist/assets/{compass-B9Z1VADa.js → compass-rkxrbPSi.js} +1 -1
  87. package/dist/assets/{copy-C_pc6iuN.js → copy-Bl7rIKC1.js} +1 -1
  88. package/dist/assets/{createTaskActions-Dl49i_JA.js → createTaskActions-UCF25Z80.js} +1 -1
  89. package/dist/assets/{cursor-DHA3q7im.js → cursor-CA-UiBx5.js} +1 -1
  90. package/dist/assets/{cursor-transparent-CAkIxYll.js → cursor-transparent-CcRL94i_.js} +1 -1
  91. package/dist/assets/{debounce-BCcGKj6U.js → debounce-CnJPNhnw.js} +1 -1
  92. package/dist/assets/{desktop-Oal_Kgcg.js → desktop-4slPVawB.js} +1 -1
  93. package/dist/assets/{disconnect-BCyBuxxI.js → disconnect-DIdv-3bJ.js} +1 -1
  94. package/dist/assets/{discord-CR2jyXtu.js → discord-UpbfBQao.js} +1 -1
  95. package/dist/assets/{distribution-XQH4Lhk5.js → distribution-DAr9xwlG.js} +1 -1
  96. package/dist/assets/{dropdown-8Ina1NwG.js → dropdown-BDaEjakL.js} +1 -1
  97. package/dist/assets/{etherscan-CzaUnJ8A.js → etherscan-b-CfiwKd.js} +1 -1
  98. package/dist/assets/{exclamation-triangle-DDijLHzr.js → exclamation-triangle-BpCQ2tjn.js} +1 -1
  99. package/dist/assets/{extension-CSnCETai.js → extension-CXUk4M6Y.js} +1 -1
  100. package/dist/assets/{external-link-CyYDZYYR.js → external-link-CDiquWG1.js} +1 -1
  101. package/dist/assets/{facebook-C6OPBKIT.js → facebook-OjS1SpgQ.js} +1 -1
  102. package/dist/assets/{farcaster-NItkH33M.js → farcaster-DM2eHmhu.js} +1 -1
  103. package/dist/assets/{filters-D70SWWN6.js → filters-ZPLCGT8f.js} +1 -1
  104. package/dist/assets/{github-BD6D60VA.js → github-DFvU6SQx.js} +1 -1
  105. package/dist/assets/{google-CL4CHBLv.js → google-BNGSy46X.js} +1 -1
  106. package/dist/assets/{help-circle-Bb4YjXkd.js → help-circle-CDop9dfe.js} +1 -1
  107. package/dist/assets/{id-Bg7DotmK.js → id-xE2H9DKJ.js} +1 -1
  108. package/dist/assets/{image-COisjBw3.js → image-CqE-71Cx.js} +1 -1
  109. package/dist/assets/{index-CuDB9gdd.js → index-B30WeW08.js} +1 -1
  110. package/dist/assets/{index-CRznp8jk.js → index-B3lIX5cz.js} +1 -1
  111. package/dist/assets/{index-mHJfpS-g.js → index-BF3Rq1XL.js} +5 -5
  112. package/dist/assets/{index-CQbxCkA3.js → index-BGRgkQ5h.js} +1 -1
  113. package/dist/assets/{index-Do96V_OF.js → index-BIqNApLC.js} +3 -3
  114. package/dist/assets/{index-oZSQuc3z.js → index-BLw4_-YE.js} +1 -1
  115. package/dist/assets/{index-luTn-W_l.js → index-BWS4r1rE.js} +1 -1
  116. package/dist/assets/{index-CYL-RFc_.js → index-BczSESIm.js} +1 -1
  117. package/dist/assets/{index-Xv72FIVH.js → index-BdwdvwKp.js} +4 -4
  118. package/dist/assets/{index-BalKdl4I.js → index-BgsmfQdk.js} +1 -1
  119. package/dist/assets/{index-Dh-jNQrR.js → index-BhBU1Fk1.js} +1 -1
  120. package/dist/assets/{index-CYDHERfE.js → index-Bm7RST_m.js} +1 -1
  121. package/dist/assets/{index-Cyxq6Qua.js → index-BmByH58N.js} +2 -2
  122. package/dist/assets/{index-CBWw2dqX.js → index-BoNWZ7Fa.js} +1 -1
  123. package/dist/assets/{index-D7HrNCd6.js → index-BpnsEp0p.js} +1 -1
  124. package/dist/assets/{index-CHYLT97t.js → index-BrXFOL-3.js} +1 -1
  125. package/dist/assets/{index-CpzfV0pW.js → index-BtIfTbFi.js} +1 -1
  126. package/dist/assets/{index-COuezDm-.js → index-BuHr9c4v.js} +1 -1
  127. package/dist/assets/{index-C1nFLlUB.js → index-ByGPm-DU.js} +1 -1
  128. package/dist/assets/{index-BKKI0C_o.js → index-C0IqcCXT.js} +1 -1
  129. package/dist/assets/{index-CF1ww37w.js → index-C1rOZdVC.js} +1 -1
  130. package/dist/assets/{index-JI-AWDGe.js → index-CAsSoYAm.js} +1 -1
  131. package/dist/assets/{index-BcQ33bMX.js → index-CEtDd0G2.js} +1 -1
  132. package/dist/assets/{index-CG04RGrn.js → index-CLjlMMvy.js} +1 -1
  133. package/dist/assets/{index-Cm5OjimQ.js → index-CQZzur7e.js} +1 -1
  134. package/dist/assets/{index-b2PBMUP6.js → index-CVB9cxDS.js} +1 -1
  135. package/dist/assets/{index-L20hlNKs.js → index-CYuwcx0E.js} +1 -1
  136. package/dist/assets/{index-aZuO1MNl.js → index-CacrVDTc.js} +1 -1
  137. package/dist/assets/{index-Bn-yW66l.js → index-CiXAP8xZ.js} +1 -1
  138. package/dist/assets/{index-Bn6bJIWW.js → index-CkIFkOfg.js} +1 -1
  139. package/dist/assets/{index-XdDjb_qZ.js → index-Cn2LGxPD.js} +1 -1
  140. package/dist/assets/{index-CCYrnVY8.js → index-Cnp-FFxE.js} +1 -1
  141. package/dist/assets/{index-Cu2Po3TS.js → index-Cowx5J9-.js} +1 -1
  142. package/dist/assets/{index-UzoKOEii.js → index-Cqy8qcZ7.js} +1 -1
  143. package/dist/assets/{index-BIiWMqeL.js → index-CvbShugB.js} +1 -1
  144. package/dist/assets/{index-DAqtSXwe.js → index-D1pusCuL.js} +1 -1
  145. package/dist/assets/{index-ZTLaZITs.js → index-D78_bBLX.js} +1 -1
  146. package/dist/assets/{index-DtdH4elb.js → index-D7oX2ZSb.js} +1 -1
  147. package/dist/assets/{index-C7UOzYYd.js → index-DCckHLpZ.js} +1 -1
  148. package/dist/assets/{index-AyRUBxd4.js → index-DGCbBDjn.js} +1 -1
  149. package/dist/assets/{index-n8xs681c.js → index-DMKqP0Mz.js} +1 -1
  150. package/dist/assets/{index-C5h9Q8MC.js → index-DRpzcCnC.js} +1 -1
  151. package/dist/assets/{index-Bwrk7Ay6.js → index-DSrjFwJE.js} +1 -1
  152. package/dist/assets/{index-BKDppBCe.js → index-DWmnF75P.js} +1 -1
  153. package/dist/assets/{index-DLqlJAfA.js → index-DYQPejxP.js} +1 -1
  154. package/dist/assets/{index-FOpEkA01.js → index-Da1vJcC1.js} +1 -1
  155. package/dist/assets/{index-DvFXOuuR.js → index-Dd7ecF4f.js} +1 -1
  156. package/dist/assets/{index-BqvdpzbI.js → index-De2HByYk.js} +1 -1
  157. package/dist/assets/{index-RD-mMB30.js → index-DfxADpfB.js} +1 -1
  158. package/dist/assets/{index-DQ7BtYvz.js → index-DyvvJr6M.js} +1 -1
  159. package/dist/assets/{index-Bil93Tro.js → index-TGgCnQxQ.js} +1 -1
  160. package/dist/assets/{index-DpZxJ0M6.js → index-Yu_fXSL9.js} +1 -1
  161. package/dist/assets/{index-DRXhgLGg.js → index-aF4v7HAw.js} +1 -1
  162. package/dist/assets/{index-DfBSnkgR.js → index-cZpA3wfw.js} +1 -1
  163. package/dist/assets/{index-BEXNUoMv.js → index-iJC_SaQ8.js} +1 -1
  164. package/dist/assets/{index-BrOvr1pb.js → index-mOvOnRBe.js} +1 -1
  165. package/dist/assets/{index-BzQJoc4N.js → index-qG5c_vTa.js} +1 -1
  166. package/dist/assets/{index-BtzJAibB.js → index-vq7oBl71.js} +1 -1
  167. package/dist/assets/{index-D5rOlNGq.js → index-xrbiuF5s.js} +1 -1
  168. package/dist/assets/{index-DnRc5FMB.js → index-zTILn32w.js} +1 -1
  169. package/dist/assets/{index.browser.esm-C0AjK3ok.js → index.browser.esm-D8D8TD91.js} +1 -1
  170. package/dist/assets/{index.es-DD6X2EPt.js → index.es-CNlr9fic.js} +1 -1
  171. package/dist/assets/{info-C4KMlAq1.js → info-Cry3_Lz9.js} +1 -1
  172. package/dist/assets/{info-circle-DGSR70Sk.js → info-circle-CGqHSBLn.js} +1 -1
  173. package/dist/assets/{isEqual-CbZBrtf3.js → isEqual-oZYHlzFx.js} +1 -1
  174. package/dist/assets/{isPlainObject-D2wVAlac.js → isPlainObject-DUkQhYom.js} +1 -1
  175. package/dist/assets/{lightbulb-DY3RCbyM.js → lightbulb-BxldhxbK.js} +1 -1
  176. package/dist/assets/{mail-SdbEDESl.js → mail-DZXKJmgH.js} +1 -1
  177. package/dist/assets/{midjourney-gdtajJ_M.js → midjourney-BZ6XiSLE.js} +1 -1
  178. package/dist/assets/{midjourney-_lDhk07O.js → midjourney-CRY51NVB.js} +1 -1
  179. package/dist/assets/{midjourney-CnPVNdk4.js → midjourney-CcJFiuWe.js} +1 -1
  180. package/dist/assets/{mobile-EgH74Rl2.js → mobile-1V6dS0VG.js} +1 -1
  181. package/dist/assets/{more-C960U83D.js → more-CJnsSwd4.js} +1 -1
  182. package/dist/assets/{network-placeholder-ilnAmgqr.js → network-placeholder-BiaSEtJ4.js} +1 -1
  183. package/dist/assets/{nftPlaceholder-Csn0_dzo.js → nftPlaceholder-DBf5SUj9.js} +1 -1
  184. package/dist/assets/{off-DROmGaJg.js → off-BK_H44r7.js} +1 -1
  185. package/dist/assets/{order-BiuGmqe-.js → order-CVoBwnMt.js} +1 -1
  186. package/dist/assets/{pagination-DI9u8VbS.js → pagination-B5HX_ZMJ.js} +1 -1
  187. package/dist/assets/{play-store-C8S-7L4p.js → play-store-Bvdddp76.js} +1 -1
  188. package/dist/assets/{plus-B6Adqxdl.js → plus-DUsWr1cR.js} +1 -1
  189. package/dist/assets/{price-DnUP-rdM.js → price-BWuBATEa.js} +1 -1
  190. package/dist/assets/{producer-DYPve2Lw.js → producer-9w75I-PK.js} +1 -1
  191. package/dist/assets/{qr-code-L3f67Lhc.js → qr-code-BHos1YyE.js} +1 -1
  192. package/dist/assets/{recycle-horizontal-BOptpUSq.js → recycle-horizontal-BSgLeG10.js} +1 -1
  193. package/dist/assets/{refresh-Dg1bee-F.js → refresh-C_q0gfsJ.js} +1 -1
  194. package/dist/assets/{reown-logo-OHOdgqET.js → reown-logo-g3IAshP7.js} +1 -1
  195. package/dist/assets/{search-qTm4Fy3p.js → search-tyd_qWtx.js} +1 -1
  196. package/dist/assets/{secp256k1-CCOfCah1.js → secp256k1-CVzGHd_U.js} +1 -1
  197. package/dist/assets/{secp256k1-DyBLShZg.js → secp256k1-D_T2V5Du.js} +1 -1
  198. package/dist/assets/{seedream-B_e-kC75.js → seedream-BnJOITnu.js} +1 -1
  199. package/dist/assets/{send-Cng2Agiv.js → send-Oq3-B3go.js} +1 -1
  200. package/dist/assets/{service-DCBP4w6C.js → service-CKAPM37D.js} +1 -1
  201. package/dist/assets/{solana-wallets-CHdd2Soi.js → solana-wallets-YLI5oIO5.js} +2 -2
  202. package/dist/assets/{solana-wallets-vue-DXdQA3wF.js → solana-wallets-vue-DErwyIiy.js} +1 -1
  203. package/dist/assets/{suno-VHZnREr3.js → suno-BJ1HTsSo.js} +1 -1
  204. package/dist/assets/{swapHorizontal-ClcM19xY.js → swapHorizontal-W_ueRch5.js} +1 -1
  205. package/dist/assets/{swapHorizontalBold-C2zOVAGI.js → swapHorizontalBold-BcJvlRKh.js} +1 -1
  206. package/dist/assets/{swapHorizontalMedium-DfWzT06C.js → swapHorizontalMedium-CY5yWfCq.js} +1 -1
  207. package/dist/assets/{swapHorizontalRoundedBold-CzWrlugC.js → swapHorizontalRoundedBold-B85NQeE0.js} +1 -1
  208. package/dist/assets/{swapVertical-BEuzT43E.js → swapVertical-DX1Z_e_N.js} +1 -1
  209. package/dist/assets/{telegram-Vz49BmbI.js → telegram-Dp2sV4OQ.js} +1 -1
  210. package/dist/assets/{three-dots-DIxrWEUM.js → three-dots-DqF0AR8-.js} +1 -1
  211. package/dist/assets/{twitch-NB_CnOrf.js → twitch-DZKRj53q.js} +1 -1
  212. package/dist/assets/{twitterIcon-CurNDEql.js → twitterIcon-Db-1KT5w.js} +1 -1
  213. package/dist/assets/{typescript-B81uJgVE.js → typescript-D_h56YKw.js} +1 -1
  214. package/dist/assets/{use-form-item-C7Jxi2ST.js → use-form-item-CtSDYkuV.js} +1 -1
  215. package/dist/assets/validator-WXysqxJM.js +1 -0
  216. package/dist/assets/{verify-7dT2G6tU.js → verify-BcITGpl0.js} +1 -1
  217. package/dist/assets/{verify-filled-HokfQN4y.js → verify-filled-D98hMOBf.js} +1 -1
  218. package/dist/assets/{w3m-modal-BX4u6n70.js → w3m-modal-SaZ66U2E.js} +1 -1
  219. package/dist/assets/{wallet-DxYDyUIW.js → wallet-oGl2RHLW.js} +1 -1
  220. package/dist/assets/{wallet-placeholder-gz3NJUtM.js → wallet-placeholder-BzK0y1_4.js} +1 -1
  221. package/dist/assets/{walletconnect-2MoQnfGl.js → walletconnect-D4yZ3pzR.js} +1 -1
  222. package/dist/assets/{warning-circle-BjICCYBI.js → warning-circle-DBI8iWo3.js} +1 -1
  223. package/dist/assets/{web-CaAeAsJT.js → web-BuALFeBK.js} +1 -1
  224. package/dist/assets/{web-Dm4lgJzB.js → web-CdQ8n5yn.js} +1 -1
  225. package/dist/assets/{x-BFi7xuLm.js → x-DCdp-TCd.js} +1 -1
  226. package/dist/index.html +1 -1
  227. package/package.json +1 -1
  228. package/dist/assets/Index-BKzSdZ2c.css +0 -1
  229. package/dist/assets/Index-BrI905TY.js +0 -1
  230. package/dist/assets/Index-EiKae0LE.js +0 -1
  231. package/dist/assets/validator-DtSW4gh2.js +0 -1
@@ -1,4 +1,4 @@
1
- import{F as D}from"./index.es-DD6X2EPt.js";import{E as G}from"./index-JI-AWDGe.js";import{E as Ve}from"./index-C7UOzYYd.js";import{d as A,H as u,E as s,z as se,C as o,y as i,D as l,q as n,F as a,O as M,N as z,J as c,x as y,Q as K,I as v,U as ne,G as B,K as q,M as U,u as j,c as N,w as Re,L as Le}from"./vendor-vue-NSDaktjZ.js";import{G as E,bm as le,bl as Me,ez as re,eA as de,X as x,J as Se,S as X,cs as Te,eB as ee,eC as Fe,cr as ze,n as De}from"./index-Xv72FIVH.js";import{a as je}from"./errorCode-Cqj9Td_Z.js";import{s as L}from"./suno-VHZnREr3.js";import{b as Ge}from"./suno-DFuCGH70.js";import{E as Be}from"./index-DAqtSXwe.js";import{E as ue,a as ce}from"./index-BtzJAibB.js";import{I as F,S as Oe,l as Ne}from"./pagination-DI9u8VbS.js";import{E as te,a as Q,b as qe}from"./index-D5rOlNGq.js";import{E as me,a as pe}from"./index-CBWw2dqX.js";import{E as He}from"./index-L20hlNKs.js";import{E as w}from"./index-ZTLaZITs.js";import{E as H}from"./index-CYDHERfE.js";import{E as fe}from"./index-CRznp8jk.js";import{E as he}from"./index-DvFXOuuR.js";import{u as Z,F as We,O as Ke,_ as ve,P as Je,a as Qe,V as Ye,E as Xe}from"./IconPark.vue_vue_type_script_setup_true_lang-CcuE7020.js";import{E as oe}from"./index-Bwrk7Ay6.js";import{E as O}from"./index-CuDB9gdd.js";import{E as ge}from"./index-BIiWMqeL.js";import{E as Ze,a as xe}from"./index-CCYrnVY8.js";import{E as et,a as tt}from"./index-aZuO1MNl.js";import{C as ot}from"./Consumption-B9gj7rI5.js";import{a as st}from"./price-DnUP-rdM.js";import{E as nt}from"./index-C1nFLlUB.js";import{E as it}from"./index-UzoKOEii.js";import{E as Ae,b as Pe,a as Ue}from"./index-oZSQuc3z.js";import{E as Ee}from"./index-DQ7BtYvz.js";import{N as at}from"./NoTasks-C0_ki8Ur.js";import{a as lt,E as rt}from"./index-CHYLT97t.js";import"./use-form-item-C7Jxi2ST.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./validator-DtSW4gh2.js";import"./index-CYL-RFc_.js";import"./index-CG04RGrn.js";import"./typescript-B81uJgVE.js";import"./strings-beZM2Y-f.js";import"./isEqual-CbZBrtf3.js";import"./_Uint8Array-rxEgK7pZ.js";import"./castArray-B2H9FWSG.js";import"./debounce-BCcGKj6U.js";import"./_baseIteratee-BP_fhl98.js";import"./index-CF1ww37w.js";import"./_baseClone-CoFSI4Xz.js";import"./_initCloneObject-CSU1ND3o.js";import"./isPlainObject-D2wVAlac.js";import"./index-FOpEkA01.js";import"./index-Cu41y2Fl.js";import"./index-COuezDm-.js";import"./dropdown-8Ina1NwG.js";const dt=A({name:"LayoutSuno",components:{ElDrawer:Ve,ElButton:G,FontAwesomeIcon:D},data(){return{drawer:!1,preview:!1}},computed:{}}),ut={class:"main flex flex-row flex-1"},ct={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},mt={class:"result h-full flex flex-col flex-1 min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"},pt={class:"preview h-full w-[300px] flex flex-col"};function ft(e,t,d,r,p,b){const g=l("font-awesome-icon"),m=l("el-button"),f=l("el-drawer");return n(),u("div",ut,[s("div",ct,[se(e.$slots,"config",{},void 0,!0)]),s("div",mt,[se(e.$slots,"result",{},void 0,!0)]),s("div",pt,[se(e.$slots,"preview",{},void 0,!0)]),o(m,{circle:"",class:"menu",onClick:t[0]||(t[0]=$=>e.drawer=!0)},{default:i(()=>[o(g,{icon:"fa-solid fa-magic"})]),_:1}),o(f,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=$=>e.drawer=$),direction:"ltr","with-header":!1,size:"340px",class:"drawer"},{default:i(()=>[se(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const ht=E(dt,[["render",ft],["__scopeId","data-v-c6c85757"]]),gt=A({name:"TypeSelector",components:{ElSelect:ce,ElOption:ue,ElSwitch:Be},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||(this.model=Ge)}}),$t={class:"mb-3"},_t={class:"flex items-center mb-1"},vt={class:"text-sm font-bold"},yt={class:"model-option"},bt={class:"model-option-left"},kt={class:"model-option-name"},wt={class:"model-option-desc"},Ct={key:0,class:"flex items-center justify-between mb-3"},Vt={class:"text-sm font-bold"};function St(e,t,d,r,p,b){const g=l("el-option"),m=l("el-select"),f=l("el-switch");return n(),u("div",null,[s("div",$t,[s("div",_t,[s("span",vt,a(e.$t("suno.name.model")),1)]),o(m,{modelValue:e.model,"onUpdate:modelValue":t[0]||(t[0]=$=>e.model=$),class:"w-full model-select",size:"default",placeholder:e.$t("suno.placeholder.select")},{default:i(()=>[(n(!0),u(M,null,z(e.options,$=>(n(),y(g,{key:$.value,label:$.label,value:$.value,class:K({"model-option-divider":$.dividerAfter})},{default:i(()=>[s("div",yt,[s("div",bt,[s("span",kt,a($.label),1)]),s("span",wt,a($.desc),1)])]),_:2},1032,["label","value","class"]))),128))]),_:1},8,["modelValue","placeholder"])]),e.custom?(n(),u("div",Ct,[s("span",Vt,a(e.$t("suno.name.instrumental")),1),o(f,{modelValue:e.instrumental,"onUpdate:modelValue":t[1]||(t[1]=$=>e.instrumental=$)},null,8,["modelValue"])])):c("",!0)])}const Tt=E(gt,[["render",St],["__scopeId","data-v-16e4d6fc"]]),At=A({name:"UploadAudio",components:{ElUpload:He,ElButton:G,ElDialog:le,ElTabs:pe,ElTabPane:me,InfoIcon:F,FontAwesomeIcon:D,ElRadioGroup:Q,ElRadioButton:te},emits:["change"],data(){return{fileList:[],uploadUrl:Me()+"/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(){const 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(){const e=Math.floor(this.recordSeconds/60).toString().padStart(2,"0"),t=(this.recordSeconds%60).toString().padStart(2,"0");return`${e}:${t}`}},watch:{urls:{handler(e){this.$emit("change",e)}}},beforeUnmount(){this.cleanupRecording()},methods:{onExceed(){w.warning(this.$t("suno.message.uploadReferencesExceed"))},onError(){w.error(this.$t("suno.message.uploadReferencesError"))},async onBrowseSuccess(){const e=this.urls?.[0];e&&(this.audioPreviewUrl=e,await this.onGenerateAudioId(e),this.dialogVisible=!1)},async onGenerateAudioId(e){const t={audio_url:e},d=this.credential?.token;if(!d){console.error("no token specified");return}w.info(this.$t("suno.message.startingUploadAudio"));try{const r=await L.upload(t,{token:d});console.debug("get upload music success",r.data);const p=r.data?.data.audio_id;this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,audio_id:p,action:"upload_extend"}),w.success(this.$t("suno.message.startUploadAudioSuccess"))}catch(r){w.error(r?.response?.data?.error?.message||this.$t("suno.message.startUploadAudioFailed"))}},async startRecording(){if(!navigator.mediaDevices?.getUserMedia||typeof MediaRecorder>"u"){w.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=()=>{const 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),w.error(this.$t("suno.message.recordingPermissionDenied"))}},stopRecording(){this.recordTimer&&(window.clearInterval(this.recordTimer),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{const e=new FormData,t=`recording-${Date.now()}.webm`;e.append("file",this.recordedBlob,t);const d=await fetch(this.uploadUrl,{method:"POST",headers:{Authorization:`Bearer ${this.$store.state.token.access}`},body:e});if(!d.ok)throw new Error(`upload failed: ${d.status}`);const r=await d.json(),p=r?.file_url||r?.data?.file_url;if(!p)throw new Error("no file_url in response");this.audioPreviewUrl=p,await this.onGenerateAudioId(p),this.dialogVisible=!1,this.resetRecording()}catch(e){console.error(e),w.error(e?.message||this.$t("suno.message.uploadReferencesError"))}finally{this.uploadingRecord=!1}}},releaseStream(){this.mediaStream&&(this.mediaStream.getTracks().forEach(e=>e.stop()),this.mediaStream=null)},cleanupRecording(){this.recordTimer&&(window.clearInterval(this.recordTimer),this.recordTimer=null),this.releaseStream(),this.recordedAudioUrl&&(URL.revokeObjectURL(this.recordedAudioUrl),this.recordedAudioUrl=null)}}}),Pt={class:"relative"},Ut={class:"flex justify-between items-center mb-2"},Et={class:"flex justify-start items-center"},It={class:"text-sm font-bold"},Rt={key:0,class:"mb-2"},Lt=["src"],Mt={key:1,class:"mt-2"},Ft={class:"py-4"},zt={class:"text-center py-6"},Dt={class:"text-sm"},jt={class:"text-xs text-gray-400 mt-1"},Gt={class:"py-4 text-center"},Bt={class:"recorder-display mb-4"},Ot={key:0,class:"text-red-500 flex items-center justify-center gap-2"},Nt={class:"text-2xl font-mono"},qt={key:1,class:"text-green-600"},Ht={key:2,class:"text-gray-400 text-2xl font-mono"},Wt={key:0,class:"mb-4"},Kt=["src"],Jt={class:"flex justify-center gap-3"};function Qt(e,t,d,r,p,b){const g=l("info-icon"),m=l("font-awesome-icon"),f=l("el-button"),$=l("el-radio-button"),k=l("el-radio-group"),T=l("el-upload"),_=l("el-tab-pane"),V=l("el-tabs"),C=l("el-dialog");return n(),u("div",Pt,[s("div",Ut,[s("div",Et,[s("span",It,a(e.$t("suno.name.referenceAudios")),1),o(g,{content:e.$t("suno.description.uploadAudios")},null,8,["content"])]),o(f,{round:"",type:"primary",size:"small",onClick:t[0]||(t[0]=I=>e.dialogVisible=!0)},{default:i(()=>[o(m,{icon:"fa-solid fa-plus",class:"icon mr-1"}),v(" "+a(e.$t("suno.button.addAudio")),1)]),_:1})]),e.audioPreviewUrl?(n(),u("div",Rt,[s("audio",{src:e.audioPreviewUrl,controls:"",class:"w-full"},null,8,Lt)])):c("",!0),e.hasUploadedAudio?(n(),u("div",Mt,[o(k,{modelValue:e.uploadAction,"onUpdate:modelValue":t[1]||(t[1]=I=>e.uploadAction=I),size:"small"},{default:i(()=>[o($,{value:"upload_extend"},{default:i(()=>[v(a(e.$t("suno.button.extend")),1)]),_:1}),o($,{value:"upload_cover"},{default:i(()=>[v(a(e.$t("suno.button.upload_cover")),1)]),_:1})]),_:1},8,["modelValue"])])):c("",!0),o(C,{modelValue:e.dialogVisible,"onUpdate:modelValue":t[4]||(t[4]=I=>e.dialogVisible=I),title:e.$t("suno.name.addAudio"),width:"520px","close-on-click-modal":!1,"append-to-body":""},{default:i(()=>[o(V,{modelValue:e.activeTab,"onUpdate:modelValue":t[3]||(t[3]=I=>e.activeTab=I),class:"add-audio-tabs"},{default:i(()=>[o(_,{name:"browse",label:e.$t("suno.tab.browse")},{default:i(()=>[s("div",Ft,[o(T,{"file-list":e.fileList,"onUpdate:fileList":t[2]||(t[2]=I=>e.fileList=I),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:i(()=>[s("div",zt,[o(m,{icon:"fa-solid fa-upload",class:"text-4xl text-gray-400 mb-3"}),s("div",Dt,a(e.$t("suno.description.dropAudioHere")),1),s("div",jt,a(e.$t("suno.description.audioFormats")),1)])]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])]),_:1},8,["label"]),o(_,{name:"record",label:e.$t("suno.tab.record")},{default:i(()=>[s("div",Gt,[s("div",Bt,[e.recording?(n(),u("div",Ot,[t[5]||(t[5]=s("span",{class:"recording-dot"},null,-1)),s("span",Nt,a(e.formattedTime),1)])):e.recordedBlob?(n(),u("div",qt,[o(m,{icon:"fa-solid fa-check-circle",class:"text-2xl mr-2"}),s("span",null,a(e.$t("suno.message.recordingReady"))+" ("+a(e.formattedTime)+")",1)])):(n(),u("div",Ht,"00:00"))]),e.recordedAudioUrl&&!e.recording?(n(),u("div",Wt,[s("audio",{src:e.recordedAudioUrl,controls:"",class:"w-full"},null,8,Kt)])):c("",!0),s("div",Jt,[!e.recording&&!e.recordedBlob?(n(),y(f,{key:0,type:"primary",round:"",onClick:e.startRecording},{default:i(()=>[o(m,{icon:"fa-solid fa-microphone",class:"mr-1"}),v(" "+a(e.$t("suno.button.startRecord")),1)]),_:1},8,["onClick"])):c("",!0),e.recording?(n(),y(f,{key:1,type:"danger",round:"",onClick:e.stopRecording},{default:i(()=>[o(m,{icon:"fa-solid fa-stop",class:"mr-1"}),v(" "+a(e.$t("suno.button.stopRecord")),1)]),_:1},8,["onClick"])):c("",!0),e.recordedBlob&&!e.recording?(n(),u(M,{key:2},[o(f,{round:"",onClick:e.resetRecording},{default:i(()=>[o(m,{icon:"fa-solid fa-rotate-left",class:"mr-1"}),v(" "+a(e.$t("suno.button.reRecord")),1)]),_:1},8,["onClick"]),o(f,{type:"primary",round:"",loading:e.uploadingRecord,onClick:e.uploadRecording},{default:i(()=>[o(m,{icon:"fa-solid fa-upload",class:"mr-1"}),v(" "+a(e.$t("suno.button.useRecording")),1)]),_:1},8,["loading","onClick"])],64)):c("",!0)])])]),_:1},8,["label"])]),_:1},8,["modelValue"])]),_:1},8,["modelValue","title"])])}const Yt=E(At,[["render",Qt],["__scopeId","data-v-bfb6b53d"]]),Xt="",ye=[{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"}],Zt=8;function be(e){const t=[...e];for(let d=t.length-1;d>0;d--){const r=Math.floor(Math.random()*(d+1));[t[d],t[r]]=[t[r],t[d]]}return t}const xt=A({name:"PromptInput",components:{ElInput:H,FontAwesomeIcon:D,InfoIcon:F},data(){return{shuffledTags:be(ye)}},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,Zt)}},mounted(){this.prompt||(this.prompt=Xt)},methods:{onTagClick(e){this.prompt=e.prompt},onRefreshTags(){this.shuffledTags=be(ye)}}}),eo={class:"field"},to={class:"flex items-center mb-1"},oo={class:"text-sm font-bold"},so={class:"inspo-tags"},no=["onClick"];function io(e,t,d,r,p,b){const g=l("info-icon"),m=l("el-input"),f=l("font-awesome-icon");return n(),u("div",eo,[s("div",to,[s("span",oo,a(e.$t("suno.name.songDescription")),1),o(g,{content:e.$t("suno.description.prompt")},null,8,["content"])]),o(m,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=$=>e.prompt=$),rows:4,type:"textarea",placeholder:e.$t("suno.placeholder.prompt")},null,8,["modelValue","placeholder"]),s("div",so,[(n(!0),u(M,null,z(e.visibleTags,$=>(n(),u("button",{key:$.key,class:"inspo-tag",onClick:k=>e.onTagClick($)},a($.label),9,no))),128)),s("button",{class:"inspo-tag inspo-tag-refresh",onClick:t[1]||(t[1]=(...$)=>e.onRefreshTags&&e.onRefreshTags(...$))},[o(f,{icon:"fa-solid fa-arrows-rotate"})])])])}const ao=E(xt,[["render",io],["__scopeId","data-v-378e4372"]]),lo="",ro=A({name:"LyricInput",components:{ElInput:H,ElButton:G,ElTooltip:fe,ElDialog:le,FontAwesomeIcon:D,InfoIcon:F},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||(this.lyric=lo)},methods:{pushHistory(){this.lyric&&(this.lyricHistory.push(this.lyric),this.lyricHistory.length>20&&this.lyricHistory.shift())},onUndo(){const e=this.lyricHistory.pop();e!==void 0&&(this.lyric=e)},onClear(){this.pushHistory(),this.lyric=""},async onEnhanceLyrics(){const e=this.credential?.token;if(!(!e||!this.lyric||!this.enhancePrompt)){this.pushHistory(),this.enhancingLyrics=!0,w.info(this.$t("suno.message.enhancingLyrics"));try{const t=`${this.enhancePrompt}
1
+ import{F as D}from"./index.es-CNlr9fic.js";import{E as G}from"./index-CAsSoYAm.js";import{E as Ve}from"./index-DCckHLpZ.js";import{d as A,H as u,E as s,z as se,C as o,y as i,D as l,q as n,F as a,O as M,N as z,J as c,x as y,Q as K,I as v,U as ne,G as B,K as q,M as U,u as j,c as N,w as Re,L as Le}from"./vendor-vue-NSDaktjZ.js";import{G as E,bm as le,bl as Me,ez as re,eA as de,X as x,J as Se,S as X,cs as Te,eB as ee,eC as Fe,cr as ze,n as De}from"./index-BdwdvwKp.js";import{a as je}from"./errorCode-Cqj9Td_Z.js";import{s as L}from"./suno-BJ1HTsSo.js";import{b as Ge}from"./suno-DFuCGH70.js";import{E as Be}from"./index-D1pusCuL.js";import{E as ue,a as ce}from"./index-vq7oBl71.js";import{I as F,S as Oe,l as Ne}from"./pagination-B5HX_ZMJ.js";import{E as te,a as Q,b as qe}from"./index-xrbiuF5s.js";import{E as me,a as pe}from"./index-BoNWZ7Fa.js";import{E as He}from"./index-CYuwcx0E.js";import{E as w}from"./index-D78_bBLX.js";import{E as H}from"./index-Bm7RST_m.js";import{E as fe}from"./index-B3lIX5cz.js";import{E as he}from"./index-Dd7ecF4f.js";import{u as Z,F as We,O as Ke,_ as ve,P as Je,a as Qe,V as Ye,E as Xe}from"./IconPark.vue_vue_type_script_setup_true_lang-C6pchWWV.js";import{E as oe}from"./index-DSrjFwJE.js";import{E as O}from"./index-B30WeW08.js";import{E as ge}from"./index-CvbShugB.js";import{E as Ze,a as xe}from"./index-Cnp-FFxE.js";import{E as et,a as tt}from"./index-CacrVDTc.js";import{C as ot}from"./Consumption-DPIPEsS9.js";import{a as st}from"./price-BWuBATEa.js";import{E as nt}from"./index-ByGPm-DU.js";import{E as it}from"./index-Cqy8qcZ7.js";import{E as Ae,b as Pe,a as Ue}from"./index-BLw4_-YE.js";import{E as Ee}from"./index-DyvvJr6M.js";import{N as at}from"./NoTasks-d5P_8OkS.js";import{a as lt,E as rt}from"./index-BrXFOL-3.js";import"./use-form-item-CtSDYkuV.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./validator-WXysqxJM.js";import"./index-BczSESIm.js";import"./index-CLjlMMvy.js";import"./typescript-D_h56YKw.js";import"./strings-beZM2Y-f.js";import"./isEqual-oZYHlzFx.js";import"./_Uint8Array-DnXEH1kJ.js";import"./castArray-D8by9zqR.js";import"./debounce-CnJPNhnw.js";import"./_baseIteratee-Dxd4hwaV.js";import"./index-C1rOZdVC.js";import"./_baseClone-DrdzZuzq.js";import"./_initCloneObject-CPj4Zmvt.js";import"./isPlainObject-DUkQhYom.js";import"./index-Da1vJcC1.js";import"./index-Cu41y2Fl.js";import"./index-BuHr9c4v.js";import"./dropdown-BDaEjakL.js";const dt=A({name:"LayoutSuno",components:{ElDrawer:Ve,ElButton:G,FontAwesomeIcon:D},data(){return{drawer:!1,preview:!1}},computed:{}}),ut={class:"main flex flex-row flex-1"},ct={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},mt={class:"result h-full flex flex-col flex-1 min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"},pt={class:"preview h-full w-[300px] flex flex-col"};function ft(e,t,d,r,p,b){const g=l("font-awesome-icon"),m=l("el-button"),f=l("el-drawer");return n(),u("div",ut,[s("div",ct,[se(e.$slots,"config",{},void 0,!0)]),s("div",mt,[se(e.$slots,"result",{},void 0,!0)]),s("div",pt,[se(e.$slots,"preview",{},void 0,!0)]),o(m,{circle:"",class:"menu",onClick:t[0]||(t[0]=$=>e.drawer=!0)},{default:i(()=>[o(g,{icon:"fa-solid fa-magic"})]),_:1}),o(f,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=$=>e.drawer=$),direction:"ltr","with-header":!1,size:"340px",class:"drawer"},{default:i(()=>[se(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const ht=E(dt,[["render",ft],["__scopeId","data-v-c6c85757"]]),gt=A({name:"TypeSelector",components:{ElSelect:ce,ElOption:ue,ElSwitch:Be},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||(this.model=Ge)}}),$t={class:"mb-3"},_t={class:"flex items-center mb-1"},vt={class:"text-sm font-bold"},yt={class:"model-option"},bt={class:"model-option-left"},kt={class:"model-option-name"},wt={class:"model-option-desc"},Ct={key:0,class:"flex items-center justify-between mb-3"},Vt={class:"text-sm font-bold"};function St(e,t,d,r,p,b){const g=l("el-option"),m=l("el-select"),f=l("el-switch");return n(),u("div",null,[s("div",$t,[s("div",_t,[s("span",vt,a(e.$t("suno.name.model")),1)]),o(m,{modelValue:e.model,"onUpdate:modelValue":t[0]||(t[0]=$=>e.model=$),class:"w-full model-select",size:"default",placeholder:e.$t("suno.placeholder.select")},{default:i(()=>[(n(!0),u(M,null,z(e.options,$=>(n(),y(g,{key:$.value,label:$.label,value:$.value,class:K({"model-option-divider":$.dividerAfter})},{default:i(()=>[s("div",yt,[s("div",bt,[s("span",kt,a($.label),1)]),s("span",wt,a($.desc),1)])]),_:2},1032,["label","value","class"]))),128))]),_:1},8,["modelValue","placeholder"])]),e.custom?(n(),u("div",Ct,[s("span",Vt,a(e.$t("suno.name.instrumental")),1),o(f,{modelValue:e.instrumental,"onUpdate:modelValue":t[1]||(t[1]=$=>e.instrumental=$)},null,8,["modelValue"])])):c("",!0)])}const Tt=E(gt,[["render",St],["__scopeId","data-v-16e4d6fc"]]),At=A({name:"UploadAudio",components:{ElUpload:He,ElButton:G,ElDialog:le,ElTabs:pe,ElTabPane:me,InfoIcon:F,FontAwesomeIcon:D,ElRadioGroup:Q,ElRadioButton:te},emits:["change"],data(){return{fileList:[],uploadUrl:Me()+"/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(){const 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(){const e=Math.floor(this.recordSeconds/60).toString().padStart(2,"0"),t=(this.recordSeconds%60).toString().padStart(2,"0");return`${e}:${t}`}},watch:{urls:{handler(e){this.$emit("change",e)}}},beforeUnmount(){this.cleanupRecording()},methods:{onExceed(){w.warning(this.$t("suno.message.uploadReferencesExceed"))},onError(){w.error(this.$t("suno.message.uploadReferencesError"))},async onBrowseSuccess(){const e=this.urls?.[0];e&&(this.audioPreviewUrl=e,await this.onGenerateAudioId(e),this.dialogVisible=!1)},async onGenerateAudioId(e){const t={audio_url:e},d=this.credential?.token;if(!d){console.error("no token specified");return}w.info(this.$t("suno.message.startingUploadAudio"));try{const r=await L.upload(t,{token:d});console.debug("get upload music success",r.data);const p=r.data?.data.audio_id;this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,audio_id:p,action:"upload_extend"}),w.success(this.$t("suno.message.startUploadAudioSuccess"))}catch(r){w.error(r?.response?.data?.error?.message||this.$t("suno.message.startUploadAudioFailed"))}},async startRecording(){if(!navigator.mediaDevices?.getUserMedia||typeof MediaRecorder>"u"){w.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=()=>{const 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),w.error(this.$t("suno.message.recordingPermissionDenied"))}},stopRecording(){this.recordTimer&&(window.clearInterval(this.recordTimer),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{const e=new FormData,t=`recording-${Date.now()}.webm`;e.append("file",this.recordedBlob,t);const d=await fetch(this.uploadUrl,{method:"POST",headers:{Authorization:`Bearer ${this.$store.state.token.access}`},body:e});if(!d.ok)throw new Error(`upload failed: ${d.status}`);const r=await d.json(),p=r?.file_url||r?.data?.file_url;if(!p)throw new Error("no file_url in response");this.audioPreviewUrl=p,await this.onGenerateAudioId(p),this.dialogVisible=!1,this.resetRecording()}catch(e){console.error(e),w.error(e?.message||this.$t("suno.message.uploadReferencesError"))}finally{this.uploadingRecord=!1}}},releaseStream(){this.mediaStream&&(this.mediaStream.getTracks().forEach(e=>e.stop()),this.mediaStream=null)},cleanupRecording(){this.recordTimer&&(window.clearInterval(this.recordTimer),this.recordTimer=null),this.releaseStream(),this.recordedAudioUrl&&(URL.revokeObjectURL(this.recordedAudioUrl),this.recordedAudioUrl=null)}}}),Pt={class:"relative"},Ut={class:"flex justify-between items-center mb-2"},Et={class:"flex justify-start items-center"},It={class:"text-sm font-bold"},Rt={key:0,class:"mb-2"},Lt=["src"],Mt={key:1,class:"mt-2"},Ft={class:"py-4"},zt={class:"text-center py-6"},Dt={class:"text-sm"},jt={class:"text-xs text-gray-400 mt-1"},Gt={class:"py-4 text-center"},Bt={class:"recorder-display mb-4"},Ot={key:0,class:"text-red-500 flex items-center justify-center gap-2"},Nt={class:"text-2xl font-mono"},qt={key:1,class:"text-green-600"},Ht={key:2,class:"text-gray-400 text-2xl font-mono"},Wt={key:0,class:"mb-4"},Kt=["src"],Jt={class:"flex justify-center gap-3"};function Qt(e,t,d,r,p,b){const g=l("info-icon"),m=l("font-awesome-icon"),f=l("el-button"),$=l("el-radio-button"),k=l("el-radio-group"),T=l("el-upload"),_=l("el-tab-pane"),V=l("el-tabs"),C=l("el-dialog");return n(),u("div",Pt,[s("div",Ut,[s("div",Et,[s("span",It,a(e.$t("suno.name.referenceAudios")),1),o(g,{content:e.$t("suno.description.uploadAudios")},null,8,["content"])]),o(f,{round:"",type:"primary",size:"small",onClick:t[0]||(t[0]=I=>e.dialogVisible=!0)},{default:i(()=>[o(m,{icon:"fa-solid fa-plus",class:"icon mr-1"}),v(" "+a(e.$t("suno.button.addAudio")),1)]),_:1})]),e.audioPreviewUrl?(n(),u("div",Rt,[s("audio",{src:e.audioPreviewUrl,controls:"",class:"w-full"},null,8,Lt)])):c("",!0),e.hasUploadedAudio?(n(),u("div",Mt,[o(k,{modelValue:e.uploadAction,"onUpdate:modelValue":t[1]||(t[1]=I=>e.uploadAction=I),size:"small"},{default:i(()=>[o($,{value:"upload_extend"},{default:i(()=>[v(a(e.$t("suno.button.extend")),1)]),_:1}),o($,{value:"upload_cover"},{default:i(()=>[v(a(e.$t("suno.button.upload_cover")),1)]),_:1})]),_:1},8,["modelValue"])])):c("",!0),o(C,{modelValue:e.dialogVisible,"onUpdate:modelValue":t[4]||(t[4]=I=>e.dialogVisible=I),title:e.$t("suno.name.addAudio"),width:"520px","close-on-click-modal":!1,"append-to-body":""},{default:i(()=>[o(V,{modelValue:e.activeTab,"onUpdate:modelValue":t[3]||(t[3]=I=>e.activeTab=I),class:"add-audio-tabs"},{default:i(()=>[o(_,{name:"browse",label:e.$t("suno.tab.browse")},{default:i(()=>[s("div",Ft,[o(T,{"file-list":e.fileList,"onUpdate:fileList":t[2]||(t[2]=I=>e.fileList=I),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:i(()=>[s("div",zt,[o(m,{icon:"fa-solid fa-upload",class:"text-4xl text-gray-400 mb-3"}),s("div",Dt,a(e.$t("suno.description.dropAudioHere")),1),s("div",jt,a(e.$t("suno.description.audioFormats")),1)])]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])]),_:1},8,["label"]),o(_,{name:"record",label:e.$t("suno.tab.record")},{default:i(()=>[s("div",Gt,[s("div",Bt,[e.recording?(n(),u("div",Ot,[t[5]||(t[5]=s("span",{class:"recording-dot"},null,-1)),s("span",Nt,a(e.formattedTime),1)])):e.recordedBlob?(n(),u("div",qt,[o(m,{icon:"fa-solid fa-check-circle",class:"text-2xl mr-2"}),s("span",null,a(e.$t("suno.message.recordingReady"))+" ("+a(e.formattedTime)+")",1)])):(n(),u("div",Ht,"00:00"))]),e.recordedAudioUrl&&!e.recording?(n(),u("div",Wt,[s("audio",{src:e.recordedAudioUrl,controls:"",class:"w-full"},null,8,Kt)])):c("",!0),s("div",Jt,[!e.recording&&!e.recordedBlob?(n(),y(f,{key:0,type:"primary",round:"",onClick:e.startRecording},{default:i(()=>[o(m,{icon:"fa-solid fa-microphone",class:"mr-1"}),v(" "+a(e.$t("suno.button.startRecord")),1)]),_:1},8,["onClick"])):c("",!0),e.recording?(n(),y(f,{key:1,type:"danger",round:"",onClick:e.stopRecording},{default:i(()=>[o(m,{icon:"fa-solid fa-stop",class:"mr-1"}),v(" "+a(e.$t("suno.button.stopRecord")),1)]),_:1},8,["onClick"])):c("",!0),e.recordedBlob&&!e.recording?(n(),u(M,{key:2},[o(f,{round:"",onClick:e.resetRecording},{default:i(()=>[o(m,{icon:"fa-solid fa-rotate-left",class:"mr-1"}),v(" "+a(e.$t("suno.button.reRecord")),1)]),_:1},8,["onClick"]),o(f,{type:"primary",round:"",loading:e.uploadingRecord,onClick:e.uploadRecording},{default:i(()=>[o(m,{icon:"fa-solid fa-upload",class:"mr-1"}),v(" "+a(e.$t("suno.button.useRecording")),1)]),_:1},8,["loading","onClick"])],64)):c("",!0)])])]),_:1},8,["label"])]),_:1},8,["modelValue"])]),_:1},8,["modelValue","title"])])}const Yt=E(At,[["render",Qt],["__scopeId","data-v-bfb6b53d"]]),Xt="",ye=[{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"}],Zt=8;function be(e){const t=[...e];for(let d=t.length-1;d>0;d--){const r=Math.floor(Math.random()*(d+1));[t[d],t[r]]=[t[r],t[d]]}return t}const xt=A({name:"PromptInput",components:{ElInput:H,FontAwesomeIcon:D,InfoIcon:F},data(){return{shuffledTags:be(ye)}},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,Zt)}},mounted(){this.prompt||(this.prompt=Xt)},methods:{onTagClick(e){this.prompt=e.prompt},onRefreshTags(){this.shuffledTags=be(ye)}}}),eo={class:"field"},to={class:"flex items-center mb-1"},oo={class:"text-sm font-bold"},so={class:"inspo-tags"},no=["onClick"];function io(e,t,d,r,p,b){const g=l("info-icon"),m=l("el-input"),f=l("font-awesome-icon");return n(),u("div",eo,[s("div",to,[s("span",oo,a(e.$t("suno.name.songDescription")),1),o(g,{content:e.$t("suno.description.prompt")},null,8,["content"])]),o(m,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=$=>e.prompt=$),rows:4,type:"textarea",placeholder:e.$t("suno.placeholder.prompt")},null,8,["modelValue","placeholder"]),s("div",so,[(n(!0),u(M,null,z(e.visibleTags,$=>(n(),u("button",{key:$.key,class:"inspo-tag",onClick:k=>e.onTagClick($)},a($.label),9,no))),128)),s("button",{class:"inspo-tag inspo-tag-refresh",onClick:t[1]||(t[1]=(...$)=>e.onRefreshTags&&e.onRefreshTags(...$))},[o(f,{icon:"fa-solid fa-arrows-rotate"})])])])}const ao=E(xt,[["render",io],["__scopeId","data-v-378e4372"]]),lo="",ro=A({name:"LyricInput",components:{ElInput:H,ElButton:G,ElTooltip:fe,ElDialog:le,FontAwesomeIcon:D,InfoIcon:F},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||(this.lyric=lo)},methods:{pushHistory(){this.lyric&&(this.lyricHistory.push(this.lyric),this.lyricHistory.length>20&&this.lyricHistory.shift())},onUndo(){const e=this.lyricHistory.pop();e!==void 0&&(this.lyric=e)},onClear(){this.pushHistory(),this.lyric=""},async onEnhanceLyrics(){const e=this.credential?.token;if(!(!e||!this.lyric||!this.enhancePrompt)){this.pushHistory(),this.enhancingLyrics=!0,w.info(this.$t("suno.message.enhancingLyrics"));try{const t=`${this.enhancePrompt}
2
2
 
3
3
  Original lyrics:
4
4
  ${this.lyric}`,r=(await L.lyric({prompt:t},{token:e})).data?.data;r?.text&&(this.lyric=r.text,this.enhancePrompt="",w.success(this.$t("suno.message.enhanceLyricsSuccess")))}catch{w.error(this.$t("suno.message.enhanceLyricsFailed"))}finally{this.enhancingLyrics=!1}}},async onGenerateLyrics(){const e=this.credential?.token;if(!e)return;let t;try{t=((await he.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:r=>typeof r=="string"&&r.trim().length>0||this.$t("suno.message.lyricsThemeRequired")})).value||"").trim()}catch{return}if(t){this.pushHistory(),this.generatingLyrics=!0,w.info(this.$t("suno.message.generatingLyrics"));try{const r=(await L.lyric({prompt:t},{token:e})).data?.data;r?.text&&(this.lyric=r.text,r?.title&&!this.config?.title&&this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,lyric:r.text,title:r.title}),w.success(this.$t("suno.message.generateLyricsSuccess")))}catch{w.error(this.$t("suno.message.generateLyricsFailed"))}finally{this.generatingLyrics=!1}}}}}),uo={class:"field"},co={class:"flex items-center justify-between mb-1"},mo={class:"flex items-center"},po={class:"text-sm font-bold"},fo={class:"flex items-center gap-1"},ho={class:"relative"},go={class:"text-xs text-right text-[var(--el-text-color-secondary)] mt-1"},$o={key:0,class:"enhance-bar"},_o={key:0,class:"enhance-bar mt-3"},vo={class:"flex items-center justify-between"},yo={class:"flex items-center gap-1"};function bo(e,t,d,r,p,b){const g=l("info-icon"),m=l("font-awesome-icon"),f=l("el-button"),$=l("el-tooltip"),k=l("el-input"),T=l("el-dialog");return n(),u("div",uo,[s("div",co,[s("div",mo,[s("span",po,a(e.$t("suno.name.lyrics")),1),o(g,{content:e.$t("suno.description.lyrics")},null,8,["content"])]),s("div",fo,[e.lyricHistory.length>0?(n(),y($,{key:0,content:e.$t("suno.button.undo"),placement:"top"},{default:i(()=>[o(f,{size:"small",circle:"",onClick:e.onUndo},{default:i(()=>[o(m,{icon:"fa-solid fa-rotate-left"})]),_:1},8,["onClick"])]),_:1},8,["content"])):c("",!0),e.lyric?(n(),y($,{key:1,content:e.$t("suno.button.clear_lyrics"),placement:"top"},{default:i(()=>[o(f,{size:"small",circle:"",onClick:e.onClear},{default:i(()=>[o(m,{icon:"fa-solid fa-eraser"})]),_:1},8,["onClick"])]),_:1},8,["content"])):c("",!0),o($,{content:e.$t("suno.button.expand_lyrics"),placement:"top"},{default:i(()=>[o(f,{size:"small",circle:"",onClick:t[0]||(t[0]=_=>e.expanded=!0)},{default:i(()=>[o(m,{icon:"fa-solid fa-expand"})]),_:1})]),_:1},8,["content"]),e.config?.action!=="extend"?(n(),y(f,{key:2,size:"small",loading:e.generatingLyrics,round:"",onClick:e.onGenerateLyrics},{default:i(()=>[e.generatingLyrics?c("",!0):(n(),y(m,{key:0,icon:"fa-solid fa-wand-magic-sparkles",class:"mr-1"})),v(" "+a(e.$t("suno.button.generate_lyrics")),1)]),_:1},8,["loading","onClick"])):c("",!0)])]),s("div",ho,[e.config?.action!=="extend"?(n(),y(k,{key:0,modelValue:e.lyric,"onUpdate:modelValue":t[1]||(t[1]=_=>e.lyric=_),rows:5,type:"textarea",class:"lyrics",placeholder:e.$t("suno.placeholder.lyrics")},null,8,["modelValue","placeholder"])):(n(),y(k,{key:1,modelValue:e.lyric,"onUpdate:modelValue":t[2]||(t[2]=_=>e.lyric=_),rows:5,type:"textarea",class:"lyrics",placeholder:e.$t("suno.placeholder.extend.lyrics")},null,8,["modelValue","placeholder"])),s("div",go,a(e.lyric?.length||0)+"/5000",1)]),e.lyric&&e.config?.action!=="extend"?(n(),u("div",$o,[o(k,{modelValue:e.enhancePrompt,"onUpdate:modelValue":t[3]||(t[3]=_=>e.enhancePrompt=_),size:"small",placeholder:e.$t("suno.placeholder.enhanceLyrics"),class:"enhance-input",onKeyup:ne(e.onEnhanceLyrics,["enter"])},{append:i(()=>[o(f,{loading:e.enhancingLyrics,onClick:e.onEnhanceLyrics},{default:i(()=>[e.enhancingLyrics?c("",!0):(n(),y(m,{key:0,icon:"fa-solid fa-wand-magic-sparkles",class:"mr-1"})),v(" "+a(e.$t("suno.button.enhance_lyrics")),1)]),_:1},8,["loading","onClick"])]),_:1},8,["modelValue","placeholder","onKeyup"])])):c("",!0),o(T,{modelValue:e.expanded,"onUpdate:modelValue":t[7]||(t[7]=_=>e.expanded=_),title:e.$t("suno.name.lyrics"),width:"720px",top:"5vh","close-on-click-modal":!1,class:"lyrics-expand-dialog"},{footer:i(()=>[s("div",vo,[s("div",yo,[e.lyricHistory.length>0?(n(),y(f,{key:0,size:"small",onClick:e.onUndo},{default:i(()=>[o(m,{icon:"fa-solid fa-rotate-left",class:"mr-1"}),v(" "+a(e.$t("suno.button.undo")),1)]),_:1},8,["onClick"])):c("",!0),e.lyric?(n(),y(f,{key:1,size:"small",onClick:e.onClear},{default:i(()=>[o(m,{icon:"fa-solid fa-eraser",class:"mr-1"}),v(" "+a(e.$t("suno.button.clear_lyrics")),1)]),_:1},8,["onClick"])):c("",!0),e.config?.action!=="extend"?(n(),y(f,{key:2,size:"small",loading:e.generatingLyrics,onClick:e.onGenerateLyrics},{default:i(()=>[e.generatingLyrics?c("",!0):(n(),y(m,{key:0,icon:"fa-solid fa-wand-magic-sparkles",class:"mr-1"})),v(" "+a(e.$t("suno.button.generate_lyrics")),1)]),_:1},8,["loading","onClick"])):c("",!0)]),o(f,{type:"primary",onClick:t[6]||(t[6]=_=>e.expanded=!1)},{default:i(()=>[v(a(e.$t("common.button.confirm")),1)]),_:1})])]),default:i(()=>[o(k,{modelValue:e.lyric,"onUpdate:modelValue":t[4]||(t[4]=_=>e.lyric=_),type:"textarea",rows:20,class:"lyrics-expanded",placeholder:e.$t("suno.placeholder.lyrics"),autofocus:""},null,8,["modelValue","placeholder"]),e.config?.action!=="extend"?(n(),u("div",_o,[o(k,{modelValue:e.enhancePrompt,"onUpdate:modelValue":t[5]||(t[5]=_=>e.enhancePrompt=_),size:"small",placeholder:e.$t("suno.placeholder.enhanceLyrics"),class:"enhance-input",onKeyup:ne(e.onEnhanceLyrics,["enter"])},{append:i(()=>[o(f,{loading:e.enhancingLyrics,onClick:e.onEnhanceLyrics},{default:i(()=>[e.enhancingLyrics?c("",!0):(n(),y(m,{key:0,icon:"fa-solid fa-wand-magic-sparkles",class:"mr-1"})),v(" "+a(e.$t("suno.button.enhance_lyrics")),1)]),_:1},8,["loading","onClick"])]),_:1},8,["modelValue","placeholder","onKeyup"])])):c("",!0)]),_:1},8,["modelValue","title"])])}const ko=E(ro,[["render",bo],["__scopeId","data-v-d7d2ec74"]]),ke=["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"],wo=12;function we(e){const t=[...e];for(let d=t.length-1;d>0;d--){const r=Math.floor(Math.random()*(d+1));[t[d],t[r]]=[t[r],t[d]]}return t}const Co=A({name:"StyleInput",components:{ElInput:H,ElButton:G,FontAwesomeIcon:D,InfoIcon:F},data(){return{optimizing:!1,shuffledTags:we(ke)}},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,wo)}},methods:{onTagClick(e){const t=this.style||"";t.toLowerCase().includes(e.toLowerCase())||(this.style=t?`${t}, ${e}`:e)},onRefreshTags(){this.shuffledTags=we(ke)},async onOptimizeStyle(){const e=this.credential?.token;if(!(!e||!this.style)){this.optimizing=!0,w.info(this.$t("suno.message.optimizingStyle"));try{const t=await L.style({prompt:this.style},{token:e}),d=t.data?.text||t.data?.data?.text;d&&(this.style=d,w.success(this.$t("suno.message.optimizeStyleSuccess")))}catch{w.error(this.$t("suno.message.optimizeStyleFailed"))}finally{this.optimizing=!1}}}}}),Vo={class:"field"},So={class:"flex items-center justify-between mb-1"},To={class:"flex items-center"},Ao={class:"text-sm font-bold"},Po={class:"relative"},Uo={class:"text-xs text-right text-[var(--el-text-color-secondary)] mt-1"},Eo={class:"style-tags"},Io=["onClick"];function Ro(e,t,d,r,p,b){const g=l("info-icon"),m=l("font-awesome-icon"),f=l("el-button"),$=l("el-input");return n(),u("div",Vo,[s("div",So,[s("div",To,[s("span",Ao,a(e.$t("suno.name.style")),1),o(g,{content:e.$t("suno.description.style")},null,8,["content"])]),o(f,{size:"small",loading:e.optimizing,round:"",onClick:e.onOptimizeStyle},{default:i(()=>[e.optimizing?c("",!0):(n(),y(m,{key:0,icon:"fa-solid fa-wand-magic-sparkles",class:"mr-1"})),v(" "+a(e.$t("suno.button.optimize_style")),1)]),_:1},8,["loading","onClick"])]),s("div",Po,[o($,{modelValue:e.style,"onUpdate:modelValue":t[0]||(t[0]=k=>e.style=k),rows:2,type:"textarea",placeholder:e.$t("suno.placeholder.style")},null,8,["modelValue","placeholder"]),s("div",Uo,a(e.style?.length||0)+"/1000",1)]),s("div",Eo,[(n(!0),u(M,null,z(e.visibleTags,k=>(n(),u("button",{key:k,class:"style-tag",onClick:T=>e.onTagClick(k)},a(k),9,Io))),128)),s("button",{class:"style-tag style-tag-refresh",onClick:t[1]||(t[1]=(...k)=>e.onRefreshTags&&e.onRefreshTags(...k))},[o(m,{icon:"fa-solid fa-arrows-rotate"})])])])}const Lo=E(Co,[["render",Ro],["__scopeId","data-v-ddebb076"]]),Mo=A({name:"TitleInput",components:{ElInput:H,InfoIcon:F},computed:{title:{get(){return this.$store.state.suno?.config?.title},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,title:e})}}}}),Fo={class:"field"},zo={class:"flex items-center mb-1"},Do={class:"text-sm font-bold"};function jo(e,t,d,r,p,b){const g=l("info-icon"),m=l("el-input");return n(),u("div",Fo,[s("div",zo,[s("span",Do,a(e.$t("suno.name.title")),1),o(g,{content:e.$t("suno.description.title")},null,8,["content"])]),o(m,{modelValue:e.title,"onUpdate:modelValue":t[0]||(t[0]=f=>e.title=f),placeholder:e.$t("suno.placeholder.title")},null,8,["modelValue","placeholder"])])}const Go=E(Mo,[["render",jo]]),Bo=A({name:"ExtendFromInput",components:{ElImage:O,ElIcon:x,ElInputNumber:oe,VideoPlay:de,VideoPause:re},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||(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:Z,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})}}}),Oo={class:"field"},No={class:"box"},qo={class:"title font-bold"},Ho={class:"input-wrapper"},Wo={class:"task"},Ko={class:"left"},Jo={key:2,class:"duration"},Qo={class:"info"},Yo={class:"title"},Xo={class:"style"};function Zo(e,t,d,r,p,b){const g=l("el-input-number"),m=l("el-image"),f=l("video-pause"),$=l("el-icon"),k=l("video-play"),T=q("loading");return n(),u("div",Oo,[s("div",No,[s("h2",qo,a(e.$t("suno.name.extend")),1),s("div",Ho,[o(g,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=_=>e.value=_),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"])])]),s("div",Wo,[e.audio?(n(),u("div",{key:0,class:"audio",onClick:t[3]||(t[3]=_=>e.onClick(e.audio))},[B((n(),u("div",Ko,[o(m,{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"?(n(),u("div",{key:0,class:"overlay",onClick:t[1]||(t[1]=_=>e.onPause(e.audio))},[o($,null,{default:i(()=>[o(f)]),_:1})])):c("",!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")?(n(),u("div",{key:1,class:"overlay",onClick:t[2]||(t[2]=_=>e.onPlay(e.audio))},[o($,null,{default:i(()=>[o(k)]),_:1})])):c("",!0),e.audio?.duration?(n(),u("div",Jo,a(e.useFormatDuring(e.audio?.duration)),1)):c("",!0)])),[[T,!e.audio?.audio_url]]),s("div",Qo,[s("h2",Yo,a(e.audio?.title),1),s("p",Xo,a(e.audio?.style),1)])])):c("",!0)])])}const xo=E(Bo,[["render",Zo],["__scopeId","data-v-bcce4821"]]),es=A({name:"CoverFromInput",components:{ElImage:O,ElIcon:x,VideoPlay:de,VideoPause:re},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||(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:Z,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})}}}),ts={class:"field"},os={class:"box"},ss={class:"title font-bold"},ns={class:"task"},is={class:"left"},as={key:2,class:"duration"},ls={class:"info"},rs={class:"title"},ds={class:"style"};function us(e,t,d,r,p,b){const g=l("el-image"),m=l("video-pause"),f=l("el-icon"),$=l("video-play"),k=q("loading");return n(),u("div",ts,[s("div",os,[s("h2",ss,a(e.$t("suno.name.cover")),1)]),s("div",ns,[e.audio?(n(),u("div",{key:0,class:"audio",onClick:t[2]||(t[2]=T=>e.onClick(e.audio))},[B((n(),u("div",is,[o(g,{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"?(n(),u("div",{key:0,class:"overlay",onClick:t[0]||(t[0]=T=>e.onPause(e.audio))},[o(f,null,{default:i(()=>[o(m)]),_:1})])):c("",!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")?(n(),u("div",{key:1,class:"overlay",onClick:t[1]||(t[1]=T=>e.onPlay(e.audio))},[o(f,null,{default:i(()=>[o($)]),_:1})])):c("",!0),e.audio?.duration?(n(),u("div",as,a(e.useFormatDuring(e.audio?.duration)),1)):c("",!0)])),[[k,!e.audio?.audio_url]]),s("div",ls,[s("h2",rs,a(e.audio?.title),1),s("p",ds,a(e.audio?.style),1)])])):c("",!0)])])}const cs=E(es,[["render",us],["__scopeId","data-v-06640216"]]),ms=A({name:"VocalGenderSelector",components:{ElRadioGroup:Q,ElRadioButton:te,InfoIcon:F},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})}}}}),ps={class:"flex items-center mb-1"},fs={class:"text-sm font-bold"};function hs(e,t,d,r,p,b){const g=l("info-icon"),m=l("el-radio-button"),f=l("el-radio-group");return n(),u("div",null,[s("div",ps,[s("span",fs,a(e.$t("suno.name.vocalGender")),1),o(g,{content:e.$t("suno.description.vocalGender")},null,8,["content"])]),o(f,{modelValue:e.vocalGender,"onUpdate:modelValue":t[0]||(t[0]=$=>e.vocalGender=$),size:"small"},{default:i(()=>[o(m,{value:""},{default:i(()=>[v(a(e.$t("suno.gender.auto")),1)]),_:1}),o(m,{value:"f"},{default:i(()=>[v(a(e.$t("suno.gender.female")),1)]),_:1}),o(m,{value:"m"},{default:i(()=>[v(a(e.$t("suno.gender.male")),1)]),_:1})]),_:1},8,["modelValue"])])}const gs=E(ms,[["render",hs]]),$s=A({name:"AdvancedParams",components:{ElCollapse:xe,ElCollapseItem:Ze,ElInput:H,ElSlider:ge,ElRadioGroup:Q,ElRadioButton:te},data(){return{activeNames:[]}},computed:{config(){return this.$store.state.suno?.config},isV5OrAbove(){const 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??50},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??50},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})}}}}),_s={key:0,class:"mb-3"},vs={class:"flex items-center mb-1"},ys={class:"text-xs font-bold"},bs={key:1,class:"mb-3"},ks={class:"flex items-center mb-1"},ws={class:"text-xs font-bold"},Cs={key:2,class:"mb-3"},Vs={class:"flex items-center justify-between mb-1"},Ss={class:"text-xs font-bold"},Ts={class:"text-xs text-[var(--el-text-color-secondary)]"},As={key:3,class:"mb-3"},Ps={class:"flex items-center justify-between mb-1"},Us={class:"text-xs font-bold"},Es={class:"text-xs text-[var(--el-text-color-secondary)]"},Is={key:4,class:"mb-3"},Rs={class:"flex items-center mb-1"},Ls={class:"text-xs font-bold"},Ms={key:5,class:"mb-3"},Fs={class:"flex items-center justify-between mb-1"},zs={class:"text-xs font-bold"},Ds={class:"text-xs text-[var(--el-text-color-secondary)]"},js={key:6,class:"mb-3"},Gs={class:"flex items-center mb-1"},Bs={class:"text-xs font-bold"};function Os(e,t,d,r,p,b){const g=l("el-input"),m=l("el-slider"),f=l("el-radio-button"),$=l("el-radio-group"),k=l("el-collapse-item"),T=l("el-collapse");return n(),y(T,{modelValue:e.activeNames,"onUpdate:modelValue":t[7]||(t[7]=_=>e.activeNames=_),class:"advanced-collapse"},{default:i(()=>[o(k,{title:e.$t("suno.name.advancedParams"),name:"advanced"},{default:i(()=>[e.config?.custom?(n(),u("div",_s,[s("div",vs,[s("span",ys,a(e.$t("suno.name.styleNegative")),1)]),o(g,{modelValue:e.styleNegative,"onUpdate:modelValue":t[0]||(t[0]=_=>e.styleNegative=_),size:"small",placeholder:e.$t("suno.placeholder.styleNegative")},null,8,["modelValue","placeholder"])])):c("",!0),e.config?.custom&&!e.config?.instrumental?(n(),u("div",bs,[s("div",ks,[s("span",ws,a(e.$t("suno.name.lyricPrompt")),1)]),o(g,{modelValue:e.lyricPrompt,"onUpdate:modelValue":t[1]||(t[1]=_=>e.lyricPrompt=_),size:"small",placeholder:e.$t("suno.placeholder.lyricPrompt")},null,8,["modelValue","placeholder"])])):c("",!0),e.config?.custom?(n(),u("div",Cs,[s("div",Vs,[s("span",Ss,a(e.$t("suno.name.weirdness")),1),s("span",Ts,a(e.weirdness??0),1)]),o(m,{modelValue:e.weirdness,"onUpdate:modelValue":t[2]||(t[2]=_=>e.weirdness=_),min:0,max:100,step:1},null,8,["modelValue"])])):c("",!0),e.config?.custom?(n(),u("div",As,[s("div",Ps,[s("span",Us,a(e.$t("suno.name.styleInfluence")),1),s("span",Es,a(e.styleInfluence??50),1)]),o(m,{modelValue:e.styleInfluence,"onUpdate:modelValue":t[3]||(t[3]=_=>e.styleInfluence=_),min:0,max:100,step:1},null,8,["modelValue"])])):c("",!0),e.isV5OrAbove?(n(),u("div",Is,[s("div",Rs,[s("span",Ls,a(e.$t("suno.name.variationCategory")),1)]),o($,{modelValue:e.variationCategory,"onUpdate:modelValue":t[4]||(t[4]=_=>e.variationCategory=_),size:"small"},{default:i(()=>[o(f,{value:""},{default:i(()=>[v(a(e.$t("suno.gender.auto")),1)]),_:1}),o(f,{value:"high"},{default:i(()=>[v(a(e.$t("suno.variation.high")),1)]),_:1}),o(f,{value:"low"},{default:i(()=>[v(a(e.$t("suno.variation.low")),1)]),_:1})]),_:1},8,["modelValue"])])):c("",!0),e.config?.action==="cover"?(n(),u("div",Ms,[s("div",Fs,[s("span",zs,a(e.$t("suno.name.audioWeight")),1),s("span",Ds,a(e.audioWeight??50),1)]),o(m,{modelValue:e.audioWeight,"onUpdate:modelValue":t[5]||(t[5]=_=>e.audioWeight=_),min:0,max:100,step:1},null,8,["modelValue"])])):c("",!0),e.config?.custom&&!e.config?.instrumental?(n(),u("div",js,[s("div",Gs,[s("span",Bs,a(e.$t("suno.name.lyricsMode")),1)]),o($,{modelValue:e.lyricsMode,"onUpdate:modelValue":t[6]||(t[6]=_=>e.lyricsMode=_),size:"small"},{default:i(()=>[o(f,{value:"manual"},{default:i(()=>[v(a(e.$t("suno.lyricsMode.manual")),1)]),_:1}),o(f,{value:"auto"},{default:i(()=>[v(a(e.$t("suno.lyricsMode.auto")),1)]),_:1})]),_:1},8,["modelValue"])])):c("",!0)]),_:1},8,["title"])]),_:1},8,["modelValue"])}const Ns=E($s,[["render",Os],["__scopeId","data-v-1e19b619"]]),qs=A({name:"ReplaceSectionInput",components:{ElInputNumber:oe,ElImage:O,InfoIcon:F},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"})}}}),Hs={class:"field"},Ws={class:"flex items-center mb-2"},Ks={class:"text-sm font-bold m-0"},Js={key:0,class:"task mb-2"},Qs={class:"left relative w-[50px] h-[50px] mr-3 flex-shrink-0"},Ys={class:"info flex-1 min-w-0"},Xs={class:"text-sm font-bold m-0 truncate"},Zs={class:"text-xs text-[var(--el-text-color-secondary)] m-0 truncate"},xs={class:"flex gap-2"};function en(e,t,d,r,p,b){const g=l("info-icon"),m=l("el-image"),f=l("el-input-number"),$=q("loading");return n(),u("div",Hs,[s("div",Ws,[s("h2",Ks,a(e.$t("suno.name.replaceSection")),1),o(g,{content:e.$t("suno.description.replaceSection")},null,8,["content"])]),e.audio?(n(),u("div",Js,[s("div",{class:"audio flex items-center",onClick:t[0]||(t[0]=k=>e.onClick(e.audio))},[B((n(),u("div",Qs,[o(m,{src:e.audio?.image_url,class:"w-full h-full rounded",fit:"cover"},null,8,["src"])])),[[$,!e.audio?.audio_url]]),s("div",Ys,[s("h2",Xs,a(e.audio?.title),1),s("p",Zs,a(e.audio?.style),1)])])])):c("",!0),s("div",xs,[o(f,{modelValue:e.replaceSectionStart,"onUpdate:modelValue":t[1]||(t[1]=k=>e.replaceSectionStart=k),class:"flex-1",min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.replaceSectionStart")},null,8,["modelValue","max","placeholder"]),o(f,{modelValue:e.replaceSectionEnd,"onUpdate:modelValue":t[2]||(t[2]=k=>e.replaceSectionEnd=k),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"])])])}const tn=E(qs,[["render",en]]),on=A({name:"OverpaintingInput",components:{ElInputNumber:oe,ElImage:O,InfoIcon:F},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"})}}}),sn={class:"field"},nn={class:"flex items-center mb-2"},an={class:"text-sm font-bold m-0"},ln={key:0,class:"task mb-2"},rn={class:"left relative w-[50px] h-[50px] mr-3 flex-shrink-0"},dn={class:"info flex-1 min-w-0"},un={class:"text-sm font-bold m-0 truncate"},cn={class:"text-xs text-[var(--el-text-color-secondary)] m-0 truncate"},mn={class:"flex gap-2"};function pn(e,t,d,r,p,b){const g=l("info-icon"),m=l("el-image"),f=l("el-input-number"),$=q("loading");return n(),u("div",sn,[s("div",nn,[s("h2",an,a(e.$t("suno.name.overpaintingRange")),1),o(g,{content:e.$t("suno.description.overpainting")},null,8,["content"])]),e.audio?(n(),u("div",ln,[s("div",{class:"audio flex items-center",onClick:t[0]||(t[0]=k=>e.onClick(e.audio))},[B((n(),u("div",rn,[o(m,{src:e.audio?.image_url,class:"w-full h-full rounded",fit:"cover"},null,8,["src"])])),[[$,!e.audio?.audio_url]]),s("div",dn,[s("h2",un,a(e.audio?.title),1),s("p",cn,a(e.audio?.style),1)])])])):c("",!0),s("div",mn,[o(f,{modelValue:e.overpaintingStart,"onUpdate:modelValue":t[1]||(t[1]=k=>e.overpaintingStart=k),class:"flex-1",size:"small",min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.overpaintingStart")},null,8,["modelValue","max","placeholder"]),o(f,{modelValue:e.overpaintingEnd,"onUpdate:modelValue":t[2]||(t[2]=k=>e.overpaintingEnd=k),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"])])])}const fn=E(on,[["render",pn]]),hn=A({name:"UnderpaintingInput",components:{ElInputNumber:oe,ElImage:O,InfoIcon:F},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"})}}}),gn={class:"field"},$n={class:"flex items-center mb-2"},_n={class:"text-sm font-bold m-0"},vn={key:0,class:"task mb-2"},yn={class:"left relative w-[50px] h-[50px] mr-3 flex-shrink-0"},bn={class:"info flex-1 min-w-0"},kn={class:"text-sm font-bold m-0 truncate"},wn={class:"text-xs text-[var(--el-text-color-secondary)] m-0 truncate"},Cn={class:"flex gap-2"};function Vn(e,t,d,r,p,b){const g=l("info-icon"),m=l("el-image"),f=l("el-input-number"),$=q("loading");return n(),u("div",gn,[s("div",$n,[s("h2",_n,a(e.$t("suno.name.underpaintingRange")),1),o(g,{content:e.$t("suno.description.underpainting")},null,8,["content"])]),e.audio?(n(),u("div",vn,[s("div",{class:"audio flex items-center",onClick:t[0]||(t[0]=k=>e.onClick(e.audio))},[B((n(),u("div",yn,[o(m,{src:e.audio?.image_url,class:"w-full h-full rounded",fit:"cover"},null,8,["src"])])),[[$,!e.audio?.audio_url]]),s("div",bn,[s("h2",kn,a(e.audio?.title),1),s("p",wn,a(e.audio?.style),1)])])])):c("",!0),s("div",Cn,[o(f,{modelValue:e.underpaintingStart,"onUpdate:modelValue":t[1]||(t[1]=k=>e.underpaintingStart=k),class:"flex-1",size:"small",min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.underpaintingStart")},null,8,["modelValue","max","placeholder"]),o(f,{modelValue:e.underpaintingEnd,"onUpdate:modelValue":t[2]||(t[2]=k=>e.underpaintingEnd=k),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"])])])}const Sn=E(hn,[["render",Vn]]),Tn=A({name:"SamplesInput",components:{ElInputNumber:oe,ElImage:O,InfoIcon:F},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"})}}}),An={class:"field"},Pn={class:"flex items-center mb-2"},Un={class:"text-sm font-bold m-0"},En={key:0,class:"task mb-2"},In={class:"left relative w-[50px] h-[50px] mr-3 flex-shrink-0"},Rn={class:"info flex-1 min-w-0"},Ln={class:"text-sm font-bold m-0 truncate"},Mn={class:"text-xs text-[var(--el-text-color-secondary)] m-0 truncate"},Fn={class:"flex gap-2"};function zn(e,t,d,r,p,b){const g=l("info-icon"),m=l("el-image"),f=l("el-input-number"),$=q("loading");return n(),u("div",An,[s("div",Pn,[s("h2",Un,a(e.$t("suno.name.samplesRange")),1),o(g,{content:e.$t("suno.description.samples")},null,8,["content"])]),e.audio?(n(),u("div",En,[s("div",{class:"audio flex items-center",onClick:t[0]||(t[0]=k=>e.onClick(e.audio))},[B((n(),u("div",In,[o(m,{src:e.audio?.image_url,class:"w-full h-full rounded",fit:"cover"},null,8,["src"])])),[[$,!e.audio?.audio_url]]),s("div",Rn,[s("h2",Ln,a(e.audio?.title),1),s("p",Mn,a(e.audio?.style),1)])])])):c("",!0),s("div",Fn,[o(f,{modelValue:e.samplesStart,"onUpdate:modelValue":t[1]||(t[1]=k=>e.samplesStart=k),class:"flex-1",size:"small",min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.samplesStart")},null,8,["modelValue","max","placeholder"]),o(f,{modelValue:e.samplesEnd,"onUpdate:modelValue":t[2]||(t[2]=k=>e.samplesEnd=k),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"])])])}const Dn=E(Tn,[["render",zn]]),jn=[.5,.75,1,1.25,1.5,2],Gn=A({name:"AdjustSpeedInput",components:{ElRadioGroup:Q,ElRadioButton:te,ElImage:O,InfoIcon:F},data(){return{options:jn}},computed:{audio(){return this.$store.state.suno?.config?.audio},speed:{get(){const 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"})}}}),Bn={class:"field"},On={class:"flex items-center mb-2"},Nn={class:"text-sm font-bold m-0"},qn={key:0,class:"task mb-2"},Hn={class:"left relative w-[50px] h-[50px] mr-3 flex-shrink-0"},Wn={class:"info flex-1 min-w-0"},Kn={class:"text-sm font-bold m-0 truncate"},Jn={class:"text-xs text-[var(--el-text-color-secondary)] m-0 truncate"};function Qn(e,t,d,r,p,b){const g=l("info-icon"),m=l("el-image"),f=l("el-radio-button"),$=l("el-radio-group"),k=q("loading");return n(),u("div",Bn,[s("div",On,[s("h2",Nn,a(e.$t("suno.name.adjustSpeed")),1),o(g,{content:e.$t("suno.description.adjustSpeed")},null,8,["content"])]),e.audio?(n(),u("div",qn,[s("div",{class:"audio flex items-center",onClick:t[0]||(t[0]=T=>e.onClick(e.audio))},[B((n(),u("div",Hn,[o(m,{src:e.audio?.image_url,class:"w-full h-full rounded",fit:"cover"},null,8,["src"])])),[[k,!e.audio?.audio_url]]),s("div",Wn,[s("h2",Kn,a(e.audio?.title),1),s("p",Jn,a(e.audio?.style),1)])])])):c("",!0),o($,{modelValue:e.speed,"onUpdate:modelValue":t[1]||(t[1]=T=>e.speed=T),size:"small",class:"speed-group"},{default:i(()=>[(n(!0),u(M,null,z(e.options,T=>(n(),y(f,{key:T,value:T},{default:i(()=>[v(a(T)+"x",1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])])}const Yn=E(Gn,[["render",Qn],["__scopeId","data-v-ba834628"]]),Xn=A({name:"VoiceCreateDialog",components:{ElDialog:le,ElForm:tt,ElFormItem:et,ElInput:H,ElButton:G,ElRadioGroup:Q,ElRadio:qe},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 L.persona({audio_id:this.form.audio_id,name:this.form.name,description:this.form.description},{token:this.token}):await L.voices({audio_url:this.form.audio_url,name:this.form.name,description:this.form.description},{token:this.token}),w.success(this.$t("suno.voice.createSuccess")),this.$emit("created"),this.onClose()}catch{w.error(this.$t("suno.voice.createFailed"))}finally{this.loading=!1}}}}});function Zn(e,t,d,r,p,b){const g=l("el-input"),m=l("el-form-item"),f=l("el-radio"),$=l("el-radio-group"),k=l("el-form"),T=l("el-button"),_=l("el-dialog");return n(),y(_,{modelValue:e.visible,"onUpdate:modelValue":t[5]||(t[5]=V=>e.visible=V),title:e.$t("suno.voice.createTitle"),width:"480px","close-on-click-modal":!1,onClose:e.onClose},{footer:i(()=>[o(T,{onClick:e.onClose},{default:i(()=>[v(a(e.$t("common.button.cancel")),1)]),_:1},8,["onClick"]),o(T,{type:"primary",loading:e.loading,disabled:!e.canSubmit,onClick:e.onSubmit},{default:i(()=>[v(a(e.$t("suno.voice.create")),1)]),_:1},8,["loading","disabled","onClick"])]),default:i(()=>[o(k,{"label-position":"top",class:"voice-create-form"},{default:i(()=>[o(m,{label:e.$t("suno.voice.name")},{default:i(()=>[o(g,{modelValue:e.form.name,"onUpdate:modelValue":t[0]||(t[0]=V=>e.form.name=V),placeholder:e.$t("suno.voice.namePlaceholder"),maxlength:"50"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),o(m,{label:e.$t("suno.voice.description")},{default:i(()=>[o(g,{modelValue:e.form.description,"onUpdate:modelValue":t[1]||(t[1]=V=>e.form.description=V),type:"textarea",rows:2,placeholder:e.$t("suno.voice.descriptionPlaceholder"),maxlength:"200"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),o(m,{label:e.$t("suno.voice.sourceType")},{default:i(()=>[o($,{modelValue:e.sourceType,"onUpdate:modelValue":t[2]||(t[2]=V=>e.sourceType=V),class:"w-full"},{default:i(()=>[o(f,{value:"song"},{default:i(()=>[v(a(e.$t("suno.voice.fromSong")),1)]),_:1}),o(f,{value:"upload"},{default:i(()=>[v(a(e.$t("suno.voice.fromUpload")),1)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["label"]),e.sourceType==="song"?(n(),y(m,{key:0,label:e.$t("suno.voice.audioId")},{default:i(()=>[o(g,{modelValue:e.form.audio_id,"onUpdate:modelValue":t[3]||(t[3]=V=>e.form.audio_id=V),placeholder:e.$t("suno.voice.audioIdPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"])):c("",!0),e.sourceType==="upload"?(n(),y(m,{key:1,label:e.$t("suno.voice.audioUrl")},{default:i(()=>[o(g,{modelValue:e.form.audio_url,"onUpdate:modelValue":t[4]||(t[4]=V=>e.form.audio_url=V),placeholder:e.$t("suno.voice.audioUrlPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"])):c("",!0)]),_:1})]),_:1},8,["modelValue","title","onClose"])}const xn=E(Xn,[["render",Zn]]),ei=A({name:"VoiceManager",components:{ElButton:G,ElIcon:x,ElTabs:pe,ElTabPane:me,ElTooltip:fe,Loading:Se,FontAwesomeIcon:D,VoiceCreateDialog:xn},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){const 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 he.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;const t=await this.$store.dispatch("suno/deletePersona",e.persona_id);if(this.deletingId=null,t){if(w.success(this.$t("suno.voice.deleteSuccess")),this.selectedPersonaId===e.persona_id){const d={...this.$store.state.suno?.config,persona_id:void 0};this.$store.dispatch("suno/setConfig",d)}this.favoriteIds.includes(e.persona_id)&&this.$store.commit("suno/togglePersonaFavorite",e.persona_id)}else w.error(this.$t("suno.voice.deleteFailed"))},async onCreated(){await this.loadPersonas()}}}),ti={class:"voice-manager"},oi={class:"flex items-center justify-between mb-3"},si={class:"text-sm font-medium"},ni={key:0,class:"text-center py-6"},ii={key:1,class:"text-center py-6 text-gray-400 text-sm"},ai={key:2,class:"voice-list"},li=["onClick"],ri={class:"flex-1 min-w-0"},di={class:"voice-name"},ui={key:0,class:"voice-desc"};function ci(e,t,d,r,p,b){const g=l("font-awesome-icon"),m=l("el-button"),f=l("el-tab-pane"),$=l("el-tabs"),k=l("loading"),T=l("el-icon"),_=l("el-tooltip"),V=l("voice-create-dialog");return n(),u("div",ti,[s("div",oi,[s("span",si,a(e.$t("suno.voice.title")),1),o(m,{type:"primary",size:"small",onClick:t[0]||(t[0]=C=>e.showCreateDialog=!0)},{default:i(()=>[o(g,{icon:"fa-solid fa-plus",class:"mr-1"}),v(" "+a(e.$t("suno.voice.create")),1)]),_:1})]),o($,{modelValue:e.activeTab,"onUpdate:modelValue":t[1]||(t[1]=C=>e.activeTab=C),class:"voice-tabs",size:"small"},{default:i(()=>[o(f,{name:"all",label:e.$t("suno.voice.tabAll")+" ("+(e.personas?.length||0)+")"},null,8,["label"]),o(f,{name:"favorites",label:e.$t("suno.voice.tabFavorites")+" ("+e.favoritePersonas.length+")"},null,8,["label"])]),_:1},8,["modelValue"]),e.loading?(n(),u("div",ni,[o(T,{class:"is-loading"},{default:i(()=>[o(k)]),_:1})])):e.visiblePersonas.length===0?(n(),u("div",ii,a(e.activeTab==="favorites"?e.$t("suno.voice.emptyFavorites"):e.$t("suno.voice.empty")),1)):(n(),u("div",ai,[(n(!0),u(M,null,z(e.visiblePersonas,C=>(n(),u("div",{key:C.persona_id,class:K(["voice-item",{active:e.selectedPersonaId===C.persona_id}]),onClick:I=>e.selectPersona(C)},[s("div",ri,[s("div",di,[o(g,{icon:C.source_type==="voice"?"fa-solid fa-microphone":"fa-solid fa-music",class:"mr-1.5 text-xs opacity-60"},null,8,["icon"]),v(" "+a(C.name||C.persona_id),1)]),C.description?(n(),u("div",ui,a(C.description),1)):c("",!0)]),s("div",{class:"voice-actions",onClick:t[2]||(t[2]=U(()=>{},["stop"]))},[o(_,{content:e.isFavorite(C.persona_id)?e.$t("suno.voice.unfavorite"):e.$t("suno.voice.favorite"),placement:"top"},{default:i(()=>[o(m,{size:"small",text:"",class:K({"voice-fav-active":e.isFavorite(C.persona_id)}),onClick:I=>e.onToggleFavorite(C)},{default:i(()=>[o(g,{icon:e.isFavorite(C.persona_id)?"fa-solid fa-star":"fa-regular fa-star"},null,8,["icon"])]),_:2},1032,["class","onClick"])]),_:2},1032,["content"]),o(m,{type:"danger",size:"small",text:"",loading:e.deletingId===C.persona_id,onClick:I=>e.onDelete(C)},{default:i(()=>[o(g,{icon:"fa-solid fa-trash"})]),_:1},8,["loading","onClick"])])],10,li))),128))])),o(V,{modelValue:e.showCreateDialog,"onUpdate:modelValue":t[3]||(t[3]=C=>e.showCreateDialog=C),onCreated:e.onCreated},null,8,["modelValue","onCreated"])])}const mi=E(ei,[["render",ci],["__scopeId","data-v-8b8e36d9"]]),pi=A({name:"PersonaInput",components:{ElSelect:ce,ElOption:ue,ElButton:G,ElDrawer:Ve,FontAwesomeIcon:D,InfoIcon:F,VoiceManager:mi},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||[]}}}),fi={class:"field"},hi={class:"flex items-center justify-between mb-2"},gi={class:"flex items-center"},$i={class:"text-sm font-bold"},_i={class:"flex items-center justify-between w-full"},vi={key:0,class:"text-xs text-gray-400 ml-2"};function yi(e,t,d,r,p,b){const g=l("info-icon"),m=l("font-awesome-icon"),f=l("el-button"),$=l("el-option"),k=l("el-select"),T=l("voice-manager"),_=l("el-drawer");return n(),u("div",fi,[s("div",hi,[s("div",gi,[s("span",$i,a(e.$t("suno.name.persona")),1),o(g,{content:e.$t("suno.description.persona")},null,8,["content"])]),o(f,{size:"small",round:"",onClick:t[0]||(t[0]=V=>e.showManager=!0)},{default:i(()=>[o(m,{icon:"fa-solid fa-microphone",class:"mr-1"}),v(" "+a(e.$t("suno.voice.manage")),1)]),_:1})]),o(k,{modelValue:e.personaId,"onUpdate:modelValue":t[1]||(t[1]=V=>e.personaId=V),placeholder:e.$t("suno.placeholder.personaId"),clearable:"",filterable:"",class:"w-full"},{default:i(()=>[(n(!0),u(M,null,z(e.personas,V=>(n(),y($,{key:V.persona_id||"",value:V.persona_id||"",label:V.name||V.persona_id||""},{default:i(()=>[s("div",_i,[s("span",null,a(V.name||V.persona_id),1),V.source_type?(n(),u("span",vi,a(V.source_type),1)):c("",!0)])]),_:2},1032,["value","label"]))),128))]),_:1},8,["modelValue","placeholder"]),o(_,{modelValue:e.showManager,"onUpdate:modelValue":t[2]||(t[2]=V=>e.showManager=V),title:e.$t("suno.voice.title"),size:"380px",direction:"rtl"},{default:i(()=>[o(T)]),_:1},8,["modelValue","title"])])}const bi=E(pi,[["render",yi]]),ki=A({name:"PresetPanel",components:{TypeSelector:Tt,PromptInput:ao,LyricInput:ko,StyleInput:Lo,TitleInput:Go,ExtendFromInput:xo,CoverFromInput:cs,UploadAudio:Yt,VocalGenderSelector:gs,AdvancedParams:Ns,ReplaceSectionInput:tn,OverpaintingInput:fn,UnderpaintingInput:Sn,SamplesInput:Dn,AdjustSpeedInput:Yn,PersonaInput:bi,FontAwesomeIcon:D,ElButton:G,ElTabs:pe,ElTabPane:me,Consumption:ot},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 st(this.config,this.service?.cost)},service(){return this.$store.state.suno?.service},supportsVocalGender(){const e=this.config?.model||"";return["chirp-v4-5-plus","chirp-v5","chirp-v5-5"].includes(e)},supportsPersona(){const e=this.config?.action;return!e||e==="generate"||e==="artist_consistency"||e==="artist_consistency_vox"},generateButtonText(){const 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})}}}),wi={class:"flex flex-col h-full"},Ci={class:"flex-1 overflow-y-auto p-5"},Vi={class:"pt-2 px-1"},Si={class:"pt-2 px-1"},Ti={class:"flex flex-col items-center justify-center px-5 pb-5 gap-2"},Ai={class:"flex gap-2 w-full"};function Pi(e,t,d,r,p,b){const g=l("type-selector"),m=l("upload-audio"),f=l("prompt-input"),$=l("extend-from-input"),k=l("cover-from-input"),T=l("replace-section-input"),_=l("overpainting-input"),V=l("underpainting-input"),C=l("samples-input"),I=l("adjust-speed-input"),P=l("advanced-params"),W=l("el-tab-pane"),J=l("lyric-input"),Y=l("style-input"),h=l("title-input"),S=l("vocal-gender-selector"),ie=l("persona-input"),R=l("el-tabs"),ae=l("consumption"),$e=l("font-awesome-icon"),_e=l("el-button");return n(),u("div",wi,[s("div",Ci,[o(R,{modelValue:e.mode,"onUpdate:modelValue":t[0]||(t[0]=Ie=>e.mode=Ie),class:"suno-mode-tabs",stretch:""},{default:i(()=>[o(W,{label:e.$t("suno.mode.simple"),name:"simple"},{default:i(()=>[s("div",Vi,[o(g,{class:"mb-4"}),o(m,{class:"mb-4"}),o(f,{class:"mb-4"}),e.config?.action==="extend"?(n(),y($,{key:0,class:"mb-4"})):c("",!0),e.config?.action==="cover"?(n(),y(k,{key:1,class:"mb-4"})):c("",!0),e.config?.action==="replace_section"?(n(),y(T,{key:2,class:"mb-4"})):c("",!0),e.config?.action==="overpainting"?(n(),y(_,{key:3,class:"mb-4"})):c("",!0),e.config?.action==="underpainting"?(n(),y(V,{key:4,class:"mb-4"})):c("",!0),e.config?.action==="samples"?(n(),y(C,{key:5,class:"mb-4"})):c("",!0),e.config?.action==="adjust_speed"?(n(),y(I,{key:6,class:"mb-4"})):c("",!0),o(P,{class:"mb-4"})])]),_:1},8,["label"]),o(W,{label:e.$t("suno.mode.custom"),name:"custom"},{default:i(()=>[s("div",Si,[o(g,{class:"mb-4"}),o(m,{class:"mb-4"}),e.config?.instrumental?c("",!0):(n(),y(J,{key:0,class:"mb-4"})),o(Y,{class:"mb-4"}),o(h,{class:"mb-4"}),!e.config?.instrumental&&e.supportsVocalGender?(n(),y(S,{key:1,class:"mb-4"})):c("",!0),e.supportsPersona?(n(),y(ie,{key:2,class:"mb-4"})):c("",!0),e.config?.action==="extend"?(n(),y($,{key:3,class:"mb-4"})):c("",!0),e.config?.action==="cover"?(n(),y(k,{key:4,class:"mb-4"})):c("",!0),e.config?.action==="replace_section"?(n(),y(T,{key:5,class:"mb-4"})):c("",!0),e.config?.action==="overpainting"?(n(),y(_,{key:6,class:"mb-4"})):c("",!0),e.config?.action==="underpainting"?(n(),y(V,{key:7,class:"mb-4"})):c("",!0),e.config?.action==="samples"?(n(),y(C,{key:8,class:"mb-4"})):c("",!0),e.config?.action==="adjust_speed"?(n(),y(I,{key:9,class:"mb-4"})):c("",!0),o(P,{class:"mb-4"})])]),_:1},8,["label"])]),_:1},8,["modelValue"])]),s("div",Ti,[o(ae,{value:e.consumption,service:e.service},null,8,["value","service"]),s("div",Ai,[o(_e,{class:"flex-1",onClick:e.onClearAll},{default:i(()=>[o($e,{icon:"fa-solid fa-broom",class:"mr-1"}),v(" "+a(e.$t("suno.button.clear_all")),1)]),_:1},8,["onClick"]),o(_e,{type:"primary",class:"flex-1",round:"",onClick:e.onGenerate},{default:i(()=>[o($e,{icon:"fa-solid fa-magic",class:"mr-2"}),v(" "+a(e.generateButtonText),1)]),_:1},8,["onClick"])])])])}const Ui=E(ki,[["render",Pi],["__scopeId","data-v-c62324e6"]]),Ce=Te("suno"),Ei=A({name:"TaskPreview",components:{ElImage:O,ElIcon:x,ElTooltip:fe,FontAwesomeIcon:D,VideoPlay:de,VideoPause:re,ElDropdown:Ue,ElDropdownMenu:Pe,ElDropdownItem:Ae,ElInput:H,ElProgress:it,ElCheckbox:nt,Loading:Se},props:{modelValue:{type:Object,required:!0}},data(){return{isFetchingVideoUrl:!1,isFetchingWav:!1,isFetchingMidi:!1,editingAudioId:null,editingTitle:""}},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(){const e=this.modelValue?.response?.data??[],t=this.modelValue?.request?.action;return t?e.map(d=>({...d,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:Z,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);const r=new URL(t).pathname,p=r.substring(r.lastIndexOf("/")+1);console.log("on preview",p),fetch(t).then(b=>b.blob()).then(b=>{We.saveAs(b,p)})},async handleVideoDownload(e){if(e.video_url){this.onDownload(null,e.video_url);return}if(!this.isFetchingVideoUrl)try{this.isFetchingVideoUrl=!0;const t=await this.fetchVideoUrlFromApi(e?.id);console.log(`get videoUrl: ${t}`),e.video_url=t,this.onDownload(null,t)}catch(t){console.error("get videoUrl failed:",t),w.error(this.$t("suno.message.getVideoUrlFailed"))}finally{this.isFetchingVideoUrl=!1}},async fetchVideoUrlFromApi(e){return new Promise((t,d)=>{const r={audio_id:e},p=this.credential?.token;if(!p){console.error("no token specified"),d(new Error("No token specified"));return}L.mp4(r,{token:p}).then(b=>{const g=b.data?.data?.video_url;g?t(g):d(new Error("Video URL not found in response"))}).catch(b=>{d(b)})})},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){const t=this.modelValue?.request??{};if(!(t.prompt||t.lyric||t.style||t.title||t.lyric_prompt||t.style_negative||t.persona_id)){w.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}),w.success(this.$t("suno.message.reusePromptSuccess"))},async onExtractVocals(e){const t=this.credential?.token;t&&(w.info(this.$t("suno.message.extractingVocals")),L.vox({audio_id:e,callback_url:Ce},{token:t}).then(()=>{w.success(this.$t("suno.message.extractVocalsSuccess"))}).catch(d=>{w.error(d?.response?.data?.error?.message||this.$t("suno.message.extractVocalsFailed"))}).finally(async()=>{await this.onGetTasks(),await this.onScrollDown()}))},async onGetTiming(e){const t=this.credential?.token;t&&(w.info(this.$t("suno.message.fetchingTiming")),L.timing({audio_id:e},{token:t}).then(d=>{w.success(this.$t("suno.message.fetchTimingSuccess")),console.debug("timing data",d.data)}).catch(d=>{w.error(d?.response?.data?.error?.message||this.$t("suno.message.fetchTimingFailed"))}))},async handleWavDownload(e){if(!e?.id||this.isFetchingWav)return;const t=this.credential?.token;if(t)try{this.isFetchingWav=!0,w.info(this.$t("suno.message.fetchingWav"));const r=(await L.wav({audio_id:e.id},{token:t})).data?.data?.audio_url;r?this.onDownload(null,r):w.error(this.$t("suno.message.fetchWavFailed"))}catch{w.error(this.$t("suno.message.fetchWavFailed"))}finally{this.isFetchingWav=!1}},async handleMidiDownload(e){if(!e?.id||this.isFetchingMidi)return;const t=this.credential?.token;if(t)try{this.isFetchingMidi=!0,w.info(this.$t("suno.message.fetchingMidi"));const r=(await L.midi({audio_id:e.id},{token:t})).data?.data?.midi_url;r?this.onDownload(null,r):w.error(this.$t("suno.message.fetchMidiFailed"))}catch{w.error(this.$t("suno.message.fetchMidiFailed"))}finally{this.isFetchingMidi=!1}},async onGenerateAudioUrl(e,t){const d={action:e,audio_id:t,callback_url:Ce},r=this.credential?.token;if(!r){console.error("no token specified");return}w.info(this.$t("suno.message.startingTask")),L.audio(d,{token:r}).then(()=>{w.success(this.$t("suno.message.startTaskSuccess"))}).catch(p=>{w.error(p?.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;const t=[...this.mashupAudioIds],d=t.indexOf(e.id);d!==-1?t.splice(d,1):t.push(e.id),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,mashup_audio_ids:t})},async onScrollDown(){setTimeout(()=>{const 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;const t=this.editingTitle.trim();if(t&&t!==e.title){const d=this.$store.state.suno?.tasks;if(d?.items)for(const r of d.items){const b=(r?.response?.data??[]).find(g=>g.id===e.id);if(b){b.title=t;break}}}this.editingAudioId=null,this.editingTitle=""},onCancelTitleEdit(){this.editingAudioId=null,this.editingTitle=""},async onDelete(e){try{await he.confirm(this.$t("suno.message.confirmDelete"),{confirmButtonText:this.$t("suno.button.delete"),cancelButtonText:this.$t("common.button.cancel"),type:"warning"})}catch{return}const t=this.$store.state.suno?.tasks;if(t?.items)for(const d of t.items){const r=d?.response?.data??[],p=r.findIndex(b=>b.id===e.id);if(p!==-1){if(r.splice(p,1),r.length===0){const b=t.items.indexOf(d);b!==-1&&t.items.splice(b,1)}break}}this.$store.state?.suno?.audio?.id===e.id&&this.$store.dispatch("suno/setAudio",null),w.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})}}}),Ii={class:"task"},Ri=["onClick"],Li=["onClick"],Mi={class:"left"},Fi=["onClick"],zi=["onClick"],Di={key:2,class:"duration"},ji={class:"info"},Gi={key:1,class:"title-row"},Bi={class:"title"},Oi={class:"style"},Ni={key:2,class:"progress-row"},qi={class:"progress-text"},Hi={class:"right"},Wi={class:"el-dropdown-link"},Ki={class:"flex items-center min-w-[120px]"},Ji={class:"flex items-center min-w-[120px]"},Qi={class:"flex items-center min-w-[120px]"},Yi={class:"el-dropdown-link"};function Xi(e,t,d,r,p,b){const g=l("el-checkbox"),m=l("el-image"),f=l("video-pause"),$=l("el-icon"),k=l("video-play"),T=l("el-input"),_=l("font-awesome-icon"),V=l("el-progress"),C=l("el-tooltip"),I=l("Loading"),P=l("el-dropdown-item"),W=l("el-dropdown-menu"),J=l("el-dropdown"),Y=q("loading");return n(),u("div",Ii,[(n(!0),u(M,null,z(e.audios,h=>(n(),u("div",{key:h.id,class:K(["audio",{"mashup-selected":e.isMashupSelected(h)}]),onClick:U(S=>e.onClick(h),["stop"])},[e.isMashupMode&&h?.audio_url?(n(),u("div",{key:0,class:"mashup-check",onClick:U(S=>e.onToggleMashup(h),["stop"])},[o(g,{"model-value":e.isMashupSelected(h),onClick:t[0]||(t[0]=U(()=>{},["stop"]))},null,8,["model-value"])],8,Li)):c("",!0),B((n(),u("div",Mi,[o(m,{src:h?.image_url,class:"cover",fit:"cover",lazy:""},null,8,["src"]),h?.audio_url&&e.$store.state?.suno?.audio?.id===h.id&&e.$store.state?.suno?.audio?.state==="playing"?(n(),u("div",{key:0,class:"overlay",onClick:U(S=>e.onPause(h),["stop"])},[o($,null,{default:i(()=>[o(f)]),_:1})],8,Fi)):c("",!0),h?.audio_url&&(e.$store.state?.suno?.audio?.id!==h.id||e.$store.state?.suno?.audio?.id===h.id&&e.$store.state?.suno?.audio?.state==="paused")?(n(),u("div",{key:1,class:"overlay",onClick:U(S=>e.onPlay(h),["stop"])},[o($,null,{default:i(()=>[o(k)]),_:1})],8,zi)):c("",!0),h?.duration?(n(),u("div",Di,a(e.useFormatDuring(h?.duration)),1)):c("",!0)])),[[Y,!h?.audio_url]]),s("div",ji,[e.editingAudioId===h.id?(n(),u("div",{key:0,class:"title-edit",onClick:t[2]||(t[2]=U(()=>{},["stop"]))},[o(T,{ref_for:!0,ref:"titleInput",modelValue:e.editingTitle,"onUpdate:modelValue":t[1]||(t[1]=S=>e.editingTitle=S),size:"small",onKeyup:[ne(S=>e.onSaveTitleEdit(h),["enter"]),ne(e.onCancelTitleEdit,["escape"])],onBlur:S=>e.onSaveTitleEdit(h)},null,8,["modelValue","onKeyup","onBlur"])])):(n(),u("div",Gi,[s("h2",Bi,a(h?.title),1),h?.audio_url?(n(),y(_,{key:0,icon:"fa-solid fa-pen",class:"edit-icon",onClick:U(S=>e.onStartTitleEdit(h),["stop"])},null,8,["onClick"])):c("",!0)])),s("p",Oi,a(h?.style),1),!h?.audio_url&&h?.progress!=null&&h?.progress<100?(n(),u("div",Ni,[o(V,{percentage:Math.round(h.progress),"stroke-width":4,"show-text":!1,status:"warning",class:"progress-bar"},null,8,["percentage"]),s("span",qi,a(e.$t("suno.name.generating"))+" "+a(Math.round(h.progress))+"%",1)])):c("",!0)]),s("div",Hi,[o(J,null,{dropdown:i(()=>[o(W,null,{default:i(()=>[o(P,{disabled:e.isFetchingVideoUrl,onClick:S=>e.handleVideoDownload(h)},{default:i(()=>[s("div",Ki,[e.isFetchingVideoUrl?(n(),y($,{key:0,class:"is-loading mr-2"},{default:i(()=>[o(I)]),_:1})):c("",!0),s("span",null,a(e.$t("suno.button.download_video")),1)])]),_:1},8,["disabled","onClick"]),h?.audio_url?(n(),y(P,{key:0,onClick:U(S=>e.onDownload(S,h?.audio_url),["stop"])},{default:i(()=>[v(a(e.$t("suno.button.download_audio")),1)]),_:1},8,["onClick"])):c("",!0),o(P,{disabled:e.isFetchingWav,onClick:S=>e.handleWavDownload(h)},{default:i(()=>[s("div",Ji,[e.isFetchingWav?(n(),y($,{key:0,class:"is-loading mr-2"},{default:i(()=>[o(I)]),_:1})):c("",!0),s("span",null,a(e.$t("suno.button.download_wav")),1)])]),_:1},8,["disabled","onClick"]),o(P,{disabled:e.isFetchingMidi,onClick:S=>e.handleMidiDownload(h)},{default:i(()=>[s("div",Qi,[e.isFetchingMidi?(n(),y($,{key:0,class:"is-loading mr-2"},{default:i(()=>[o(I)]),_:1})):c("",!0),s("span",null,a(e.$t("suno.button.download_midi")),1)])]),_:1},8,["disabled","onClick"])]),_:2},1024)]),default:i(()=>[s("span",Wi,[o(C,{effect:"dark",content:e.$t("suno.button.download"),placement:"top"},{default:i(()=>[h?.audio_url||h?.video_url?(n(),y(_,{key:0,icon:"fa-solid fa-download",class:"icon icon-download"})):c("",!0)]),_:2},1032,["content"])])]),_:2},1024),o(J,null,{dropdown:i(()=>[o(W,{class:"suno-action-menu"},{default:i(()=>[h?.audio_url?(n(),y(P,{key:0,onClick:U(S=>e.onExtend(S,h),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-forward",class:"menu-icon"}),v(" "+a(e.$t("suno.button.extend")),1)]),_:1},8,["onClick"])):c("",!0),o(P,{onClick:U(S=>e.onCover(h),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-music",class:"menu-icon"}),v(" "+a(e.$t("suno.button.cover_music")),1)]),_:1},8,["onClick"]),h?.id?(n(),y(P,{key:1,onClick:U(S=>e.onMashup(h),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-shuffle",class:"menu-icon"}),v(" "+a(e.$t("suno.button.mashup")),1)]),_:1},8,["onClick"])):c("",!0),h?.id&&h?.action==="extend"?(n(),y(P,{key:2,onClick:U(S=>e.onConcatMusic(h?.id),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-link",class:"menu-icon"}),v(" "+a(e.$t("suno.button.concat_music")),1)]),_:1},8,["onClick"])):c("",!0),t[3]||(t[3]=s("div",{class:"menu-divider"},null,-1)),h?.id?(n(),y(P,{key:3,onClick:U(S=>e.onReplaceSection(h),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-scissors",class:"menu-icon"}),v(" "+a(e.$t("suno.button.replace_section")),1)]),_:1},8,["onClick"])):c("",!0),h?.id?(n(),y(P,{key:4,onClick:U(S=>e.onOverpainting(h),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-microphone",class:"menu-icon"}),v(" "+a(e.$t("suno.button.overpainting")),1)]),_:1},8,["onClick"])):c("",!0),h?.id?(n(),y(P,{key:5,onClick:U(S=>e.onUnderpainting(h),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-guitar",class:"menu-icon"}),v(" "+a(e.$t("suno.button.underpainting")),1)]),_:1},8,["onClick"])):c("",!0),h?.id?(n(),y(P,{key:6,onClick:U(S=>e.onSamples(h),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-drum",class:"menu-icon"}),v(" "+a(e.$t("suno.button.samples")),1)]),_:1},8,["onClick"])):c("",!0),t[4]||(t[4]=s("div",{class:"menu-divider"},null,-1)),h.id?(n(),y(P,{key:7,onClick:U(S=>e.onGetStems(h.id),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-layer-group",class:"menu-icon"}),v(" "+a(e.$t("suno.button.get_stems")),1)]),_:1},8,["onClick"])):c("",!0),h.id?(n(),y(P,{key:8,onClick:U(S=>e.onGetAllStems(h.id),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-bars-staggered",class:"menu-icon"}),v(" "+a(e.$t("suno.button.all_stems")),1)]),_:1},8,["onClick"])):c("",!0),h?.id?(n(),y(P,{key:9,onClick:U(S=>e.onRemaster(h.id),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-wand-magic-sparkles",class:"menu-icon"}),v(" "+a(e.$t("suno.button.remaster")),1)]),_:1},8,["onClick"])):c("",!0),h?.id?(n(),y(P,{key:10,onClick:U(S=>e.onExtractVocals(h.id),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-headphones",class:"menu-icon"}),v(" "+a(e.$t("suno.button.extract_vocals")),1)]),_:1},8,["onClick"])):c("",!0),h?.id?(n(),y(P,{key:11,onClick:U(S=>e.onArtistConsistency(h),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-palette",class:"menu-icon"}),v(" "+a(e.$t("suno.button.artist_consistency")),1)]),_:1},8,["onClick"])):c("",!0),h?.id?(n(),y(P,{key:12,onClick:U(S=>e.onAdjustSpeed(h),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-gauge-high",class:"menu-icon"}),v(" "+a(e.$t("suno.button.adjust_speed")),1)]),_:1},8,["onClick"])):c("",!0),t[5]||(t[5]=s("div",{class:"menu-divider"},null,-1)),o(P,{onClick:U(S=>e.onReusePrompt(h),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-rotate-left",class:"menu-icon"}),v(" "+a(e.$t("suno.button.reuse_prompt")),1)]),_:1},8,["onClick"]),h?.id?(n(),y(P,{key:13,onClick:U(S=>e.onGetTiming(h.id),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-clock",class:"menu-icon"}),v(" "+a(e.$t("suno.button.get_timing")),1)]),_:1},8,["onClick"])):c("",!0),t[6]||(t[6]=s("div",{class:"menu-divider"},null,-1)),h?.id?(n(),y(P,{key:14,class:"delete-item",onClick:U(S=>e.onDelete(h),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-trash",class:"menu-icon delete-icon"}),v(" "+a(e.$t("suno.button.delete")),1)]),_:1},8,["onClick"])):c("",!0)]),_:2},1024)]),default:i(()=>[s("span",Yi,[o(C,{effect:"dark",content:e.$t("suno.button.more"),placement:"top"},{default:i(()=>[h?.audio_url||h?.video_url?(n(),y(_,{key:0,icon:"fa-solid fa-ellipsis",class:"icon icon-ellipsis"})):c("",!0)]),_:2},1032,["content"])])]),_:2},1024)])],10,Ri))),128))])}const Zi=E(Ei,[["render",Xi]]),xi={class:"player-slider"},ea=A({__name:"PlayerSlider",setup(e){const t=ee(),d=N({get:()=>t.state.suno?.audio?.progress,set:g=>t.commit("suno/setAudio",{...t.state.suno.audio,progress:g})}),r=N({get:()=>t.state.suno?.audio?.duration,set:g=>t.commit("suno/setAudio",{...t.state.suno.audio,duration:g})}),p=()=>{},b=g=>t.dispatch("suno/setAudio",{...t.state.suno.audio,progress:g});return(g,m)=>(n(),u("div",xi,[o(j(ge),{modelValue:d.value,"onUpdate:modelValue":m[0]||(m[0]=f=>d.value=f),"show-tooltip":!1,min:0,max:r.value,onChange:b,onInput:p},null,8,["modelValue","max"])]))}}),ta={class:"flex player-song"},oa=["src"],sa={class:"ml-2 text-xs flex flex-col justify-between"},na={class:"w-52 2xl:w-96 cursor-pointer truncate"},ia={class:"flex"},aa={class:"ml-2 text-dc"},la=A({__name:"PlayerSong",setup(e){const t=ee(),d=N({get:()=>t.state.suno.audio,set:r=>t.commit("suno/setAudio",r)});return Re(d,(r,p)=>{if(r?.audio_url!==p?.audio_url){console.log("audio changed",r),r.object&&(console.log("111",r.object),r.object.pause(),delete r.object);const b=new Audio(r.audio_url);r.state==="playing"?b.play():b.pause(),b.addEventListener("loadedmetadata",()=>{b.currentTime=0,b.addEventListener("timeupdate",()=>{t.commit("suno/setAudio",{...t.state.suno.audio,progress:b.currentTime})})}),t.commit("suno/setAudio",{...t.state.suno.audio,object:b})}else if(r?.progress!==p?.progress&&Math.abs(r.progress-r.object.currentTime)>2){console.log("progress changed",r.progress);const b=t.state.suno.audio;b.object&&(b.object.currentTime=b.progress)}else r?.state!==p?.state&&(console.log("state changed",r.state),r.object&&(r.state==="playing"?r.object.play():r.object.pause()));r?.volume!==p?.volume&&(console.log("volume changed",r.volume),r.object&&(r.object.volume=r.volume/100))}),(r,p)=>(n(),u("div",ta,[s("img",{alt:"",class:"w-11 h-11 rounded",src:d.value?.image_url||j(Ke)},null,8,oa),s("div",sa,[s("div",na,[s("div",ia,[s("span",null,a(d.value?.title||"Music"),1),s("span",aa,"- "+a(d.value?.style||"SmallRuralDog"),1)])])])]))}}),ra={class:"flex justify-end items-center gap-x-2.5"},da={class:"text-xs"},ua=A({__name:"PlayerAction",setup(e){const t=ee(),d=N({get:()=>t.state.suno?.audio?.progress,set:p=>t.commit("suno/setAudio",{...t.state.suno.audio,progress:p})}),r=N({get:()=>t.state.suno?.audio?.duration,set:p=>t.commit("suno/setAudio",{...t.state.suno.audio,duration:p})});return(p,b)=>(n(),u("div",ra,[s("span",da,a(j(Z)(d.value))+" / "+a(j(Z)(r.value)),1)]))}}),ca={class:"player-volume flex flex-col items-center pt-2"},ma={class:"text-sm mt-3"},pa=A({__name:"PlayerVolumeSlider",setup(e){const t=ee(),d=N({get:()=>t.state.suno.audio?.volume,set:b=>t.commit("suno/setAudio",{...t.state.suno.audio,volume:b})}),r=N({get:()=>t.state.suno.audio?.muted,set:b=>t.commit("suno/setAudio",{...t.state.suno.audio,muted:b})}),p=b=>t.dispatch("suno/setVolume",b);return(b,g)=>(n(),u("div",ca,[o(j(ge),{modelValue:d.value,"onUpdate:modelValue":g[0]||(g[0]=m=>d.value=m),vertical:"",height:"100px","show-tooltip":!1,max:100,min:0,size:"small",disabled:r.value,onInput:p},null,8,["modelValue","disabled"]),s("div",ma,a(d.value),1)]))}}),fa={class:"flex items-center justify-center gap-x-3"},ha=A({__name:"PlayerController",setup(e){const t=ee(),d=()=>t.dispatch("suno/setAudio",{...t.state.suno.audio,state:t.state.suno.audio.state==="playing"?"paused":"playing"}),r=N(()=>t.state.suno.audio);return(p,b)=>(n(),u("div",fa,[o(ve,{icon:r.value?.state==="playing"?j(Je):j(Qe),size:"45",theme:"filled",class:"text-[var(--el-color-primary)] cursor-pointer",onClick:d},null,8,["icon"]),o(j(Ee),{placement:"top",width:"50px",trigger:"click"},{reference:i(()=>[o(ve,{icon:j(Ye),size:"20","stroke-width":2,class:"cursor-pointer"},null,8,["icon"])]),default:i(()=>[o(pa)]),_:1})]))}}),ga={class:"flex flex-col items-stretch h-20"},$a={class:"flex grow px-5 items-center"},_a={class:"flex-1"},va={class:"flex-1"},ya={class:"flex-1"},ba=A({__name:"Player",setup(e){return(t,d)=>(n(),u("div",ga,[o(ea),s("div",$a,[s("div",_a,[o(la)]),s("div",va,[o(ha)]),s("div",ya,[o(ua)])])]))}}),ka=A({name:"RecentPanel",components:{ElSkeletonItem:rt,ElSkeleton:lt,ElInput:H,ElButton:G,ElDropdown:Ue,ElDropdownMenu:Pe,ElDropdownItem:Ae,ElPopover:Ee,ElRadioGroup:Q,ElRadioButton:te,ElSelect:ce,ElOption:ue,FontAwesomeIcon:D,TaskPreview:Zi,Player:ba,NoTasks:at,ScrollList:Oe},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(){const e=this.tasks?.items||[],t=new Set;for(const d of e){const r=d?.response?.data??[];for(const p of r)p.model&&t.add(p.model)}return Array.from(t).sort()},filteredTasks(){let e=this.tasks?.items||[];if(this.searchQuery){const t=this.searchQuery.toLowerCase();e=e.filter(d=>(d?.response?.data??[]).some(p=>p.title?.toLowerCase().includes(t)||p.style?.toLowerCase().includes(t)||p.prompt?.toLowerCase().includes(t)))}return this.activeFilterCount>0&&(e=e.filter(t=>{const d=t?.request??{},r=t?.response?.data??[];return this.filterType==="vocal"&&d.instrumental===!0||this.filterType==="instrumental"&&d.instrumental!==!0?!1:this.filterDuration!=="all"||this.filterVideo!=="all"||this.filterModel&&this.filterModel!=="all"?r.some(p=>!(this.filterDuration==="short"&&!(typeof p.duration=="number"&&p.duration<60)||this.filterDuration==="medium"&&!(typeof p.duration=="number"&&p.duration>=60&&p.duration<=180)||this.filterDuration==="long"&&!(typeof p.duration=="number"&&p.duration>180)||this.filterVideo==="with"&&!p.video_url||this.filterVideo==="without"&&p.video_url||this.filterModel&&this.filterModel!=="all"&&p.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?.()}}}),wa={key:0,class:"tasks"},Ca={class:"left w-[70px] p-[10px] flex items-center"},Va={class:"main w-[calc(100%-70px)] flex-1 p-[10px]"},Sa={key:0,class:"task-toolbar"},Ta={key:0,class:"filter-badge"},Aa={class:"filter-popover"},Pa={class:"filter-row"},Ua={class:"filter-label"},Ea={class:"filter-row"},Ia={class:"filter-label"},Ra={class:"filter-row"},La={class:"filter-label"},Ma={key:0,class:"filter-row"},Fa={class:"filter-label"},za={class:"filter-actions"},Da={key:2,class:"w-full flex-1 flex items-center justify-center"},ja={class:"text-sm text-gray-400"},Ga={key:3,class:"w-full flex-1 flex flex-col items-center justify-center gap-2"},Ba={class:"text-sm text-gray-400"},Oa={key:4,class:"w-full flex-1 flex items-center justify-center"},Na={class:"h-20"};function qa(e,t,d,r,p,b){const g=l("el-skeleton-item"),m=l("el-skeleton"),f=l("font-awesome-icon"),$=l("el-input"),k=l("el-button"),T=l("el-dropdown-item"),_=l("el-dropdown-menu"),V=l("el-dropdown"),C=l("el-radio-button"),I=l("el-radio-group"),P=l("el-option"),W=l("el-select"),J=l("el-popover"),Y=l("task-preview"),h=l("scroll-list"),S=l("no-tasks"),ie=l("player");return n(),u(M,null,[e.tasks?.items===void 0?(n(),u("div",wa,[(n(),u(M,null,z(3,R=>s("div",{key:R,class:"flex"},[s("div",Ca,[o(m,{animated:""},{template:i(()=>[o(g,{variant:"image",class:"avatar w-[50px] h-[50px]"})]),_:1})]),s("div",Va,[o(m,{animated:""},{template:i(()=>[o(g,{variant:"p",class:"w-[200px] h-[15px] mb-[5px] mt-[10px]"}),o(g,{variant:"text"})]),_:1})])])),64))])):(n(),u(M,{key:1},[e.tasks?.items?.length?(n(),u("div",Sa,[o($,{modelValue:e.searchQuery,"onUpdate:modelValue":t[0]||(t[0]=R=>e.searchQuery=R),size:"small",placeholder:e.$t("suno.placeholder.searchSongs"),clearable:"",class:"task-search"},{prefix:i(()=>[o(f,{icon:"fa-solid fa-magnifying-glass",class:"text-xs"})]),_:1},8,["modelValue","placeholder"]),o(V,{trigger:"click",onCommand:e.onSortChange},{dropdown:i(()=>[o(_,null,{default:i(()=>[o(T,{command:"newest",class:K({"is-active":e.sortBy==="newest"})},{default:i(()=>[v(a(e.$t("suno.sort.newest")),1)]),_:1},8,["class"]),o(T,{command:"oldest",class:K({"is-active":e.sortBy==="oldest"})},{default:i(()=>[v(a(e.$t("suno.sort.oldest")),1)]),_:1},8,["class"])]),_:1})]),default:i(()=>[o(k,{size:"small",class:"sort-btn"},{default:i(()=>[o(f,{icon:"fa-solid fa-arrow-down-wide-short",class:"mr-1"}),v(" "+a(e.sortLabel),1)]),_:1})]),_:1},8,["onCommand"]),o(J,{trigger:"click",placement:"bottom-end",width:260},{reference:i(()=>[o(k,{size:"small",class:K(["filter-btn",{"has-active-filter":e.activeFilterCount>0}])},{default:i(()=>[o(f,{icon:"fa-solid fa-filter",class:"mr-1"}),v(" "+a(e.$t("suno.filter.title"))+" ",1),e.activeFilterCount>0?(n(),u("span",Ta,a(e.activeFilterCount),1)):c("",!0)]),_:1},8,["class"])]),default:i(()=>[s("div",Aa,[s("div",Pa,[s("div",Ua,a(e.$t("suno.filter.type")),1),o(I,{modelValue:e.filterType,"onUpdate:modelValue":t[1]||(t[1]=R=>e.filterType=R),size:"small"},{default:i(()=>[o(C,{value:"all"},{default:i(()=>[v(a(e.$t("suno.filter.typeAll")),1)]),_:1}),o(C,{value:"vocal"},{default:i(()=>[v(a(e.$t("suno.filter.typeVocal")),1)]),_:1}),o(C,{value:"instrumental"},{default:i(()=>[v(a(e.$t("suno.filter.typeInstrumental")),1)]),_:1})]),_:1},8,["modelValue"])]),s("div",Ea,[s("div",Ia,a(e.$t("suno.filter.duration")),1),o(I,{modelValue:e.filterDuration,"onUpdate:modelValue":t[2]||(t[2]=R=>e.filterDuration=R),size:"small"},{default:i(()=>[o(C,{value:"all"},{default:i(()=>[v(a(e.$t("suno.filter.durationAll")),1)]),_:1}),o(C,{value:"short"},{default:i(()=>[v(a(e.$t("suno.filter.durationShort")),1)]),_:1}),o(C,{value:"medium"},{default:i(()=>[v(a(e.$t("suno.filter.durationMedium")),1)]),_:1}),o(C,{value:"long"},{default:i(()=>[v(a(e.$t("suno.filter.durationLong")),1)]),_:1})]),_:1},8,["modelValue"])]),s("div",Ra,[s("div",La,a(e.$t("suno.filter.video")),1),o(I,{modelValue:e.filterVideo,"onUpdate:modelValue":t[3]||(t[3]=R=>e.filterVideo=R),size:"small"},{default:i(()=>[o(C,{value:"all"},{default:i(()=>[v(a(e.$t("suno.filter.videoAll")),1)]),_:1}),o(C,{value:"with"},{default:i(()=>[v(a(e.$t("suno.filter.videoWith")),1)]),_:1}),o(C,{value:"without"},{default:i(()=>[v(a(e.$t("suno.filter.videoWithout")),1)]),_:1})]),_:1},8,["modelValue"])]),e.availableModels.length>0?(n(),u("div",Ma,[s("div",Fa,a(e.$t("suno.filter.model")),1),o(W,{modelValue:e.filterModel,"onUpdate:modelValue":t[4]||(t[4]=R=>e.filterModel=R),size:"small",placeholder:e.$t("suno.filter.modelAll"),clearable:""},{default:i(()=>[o(P,{label:e.$t("suno.filter.modelAll"),value:"all"},null,8,["label"]),(n(!0),u(M,null,z(e.availableModels,R=>(n(),y(P,{key:R,label:R,value:R},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])):c("",!0),s("div",za,[o(k,{size:"small",text:"",onClick:e.onResetFilters},{default:i(()=>[v(a(e.$t("suno.filter.reset")),1)]),_:1},8,["onClick"])])])]),_:1})])):c("",!0),e.filteredTasks?.length>0?(n(),y(h,{key:1,ref:"scrollList",class:"flex-1 w-full overflow-y-auto tasks p-2",loading:e.loading,onReachTop:t[5]||(t[5]=R=>e.$emit("reach-top"))},{default:i(()=>[(n(!0),u(M,null,z(e.filteredTasks,(R,ae)=>(n(),y(Y,{key:ae,"model-value":R,class:"preview"},null,8,["model-value"]))),128))]),_:1},8,["loading"])):e.searchQuery&&e.tasks?.items?.length>0?(n(),u("div",Da,[s("p",ja,a(e.$t("suno.message.noSearchResults")),1)])):e.activeFilterCount>0&&e.tasks?.items?.length>0?(n(),u("div",Ga,[s("p",Ba,a(e.$t("suno.message.noFilterResults")),1),o(k,{size:"small",text:"",onClick:e.onResetFilters},{default:i(()=>[v(a(e.$t("suno.filter.reset")),1)]),_:1},8,["onClick"])])):e.tasks?.items?.length===0?(n(),u("div",Oa,[o(S)])):c("",!0)],64)),B(s("div",Na,[o(ie)],512),[[Le,!!e.$store?.state?.suno?.audio?.object]])],64)}const Ha=E(ka,[["render",qa],["__scopeId","data-v-4ab3f8f2"]]),Wa=A({name:"TaskPreview",components:{IconPicture:Fe,ElImage:O,ElAvatar:Xe,ElIcon:x},computed:{audio(){return this.$store.state.suno?.audio}}}),Ka={key:0,class:"size-full overflow-hidden"},Ja={class:"relative h-[300px]"},Qa={class:"flex items-center justify-center size-full bg-[var(--el-bg-color)]"},Ya={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"},Xa={class:"p-4"},Za={class:"flex items-center font-bold mb-2"},xa={class:"text-[var(--el-text-color-regular)] mb-2"},el={class:"text-xs text-[var(--el-text-color-regular)]"},tl={class:"mt-4 text-sm leading-[25px] whitespace-pre-wrap"},ol={key:1,class:"w-full h-full"};function sl(e,t,d,r,p,b){const g=l("icon-picture"),m=l("el-icon"),f=l("el-image"),$=l("el-avatar");return e.audio?.object?(n(),u("div",Ka,[s("div",Ja,[o(f,{src:e.audio.image_url,fit:"cover",class:"size-full"},{error:i(()=>[s("div",Qa,[o(m,{class:"text-3xl"},{default:i(()=>[o(g)]),_:1})])]),_:1},8,["src"]),s("h2",Ya,a(e.audio?.title),1)]),s("div",Xa,[s("div",Za,[o($,{size:30,src:e.audio?.image_url,class:"mr-2"},null,8,["src"]),s("span",null,a(e.audio?.title),1)]),s("p",xa,a(e.audio?.style),1),s("p",el,a(e.$dayjs.format(e.audio?.created_at)),1),s("div",tl,[s("p",null,a(e.audio?.lyric),1)])])])):(n(),u("div",ol))}const nl=E(Wa,[["render",sl]]),il=Te("suno"),al=A({name:"SunoIndex",components:{Layout:ht,ConfigPanel:Ui,RecentPanel:Ha,PreviewPanel:nl},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 Ne({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,w.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{e?.response?.data?.code===je&&w.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){await this.$nextTick();const 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);const{limit:t=5,createdAtMin:d,createdAtMax:r}=e||{};console.debug("limit",t,"createdAtMin",d,"createdAtMax",r),this.fetchingTasks=!0;try{await this.$store.dispatch("suno/getTasks",{limit:t,createdAtMin:d,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerateAudio(){const e={...this.config,callback_url:il},t=this.credential?.token;if(!t){console.error("no token specified");return}w.info(this.$t("suno.message.startingTask")),ze("suno",L.audio(e,{token:t})).then(()=>{w.success(this.$t("suno.message.startTaskSuccess"))}).catch(d=>{w.error(d?.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?.()}}});function ll(e,t,d,r,p,b){const g=l("config-panel"),m=l("recent-panel"),f=l("preview-panel"),$=l("layout");return n(),y($,null,{config:i(()=>[o(g,{onGenerate:e.onGenerateAudio},null,8,["onGenerate"])]),result:i(()=>[o(m,{ref:"recentPanel",class:"panel recent",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),preview:i(()=>[o(f)]),_:1})}const dr=E(al,[["render",ll],["__scopeId","data-v-933ac61a"]]);export{dr as default};
@@ -1 +1 @@
1
- import{F as L}from"./index.es-DD6X2EPt.js";import{E}from"./index-JI-AWDGe.js";import{E as R}from"./index-C7UOzYYd.js";import{d as b,H as i,E as r,z as T,C as t,y as u,D as a,q as s,F as o,O as C,N as G,x as v,I as d,J as m,M as A,Q as S}from"./vendor-vue-NSDaktjZ.js";import{G as k,bl as M,cr as D,aR as j,S as U,cs as B}from"./index-Xv72FIVH.js";import{a as q}from"./hailuo-C8Dw-0xR.js";import{E as F,a as O}from"./index-BtzJAibB.js";import{p as z}from"./pasteUploadMixin-BurWbGNQ.js";import{I as P,S as N,l as H}from"./pagination-DI9u8VbS.js";import{I as J}from"./ImagePreview-B4dl6UUl.js";import{E as K}from"./index-L20hlNKs.js";import{E as V}from"./index-ZTLaZITs.js";import{E as Q}from"./index-CYDHERfE.js";import{C as W}from"./Consumption-B9gj7rI5.js";import{a as X}from"./price-DnUP-rdM.js";import{b as Y}from"./errorCode-Cqj9Td_Z.js";import{C as Z}from"./CopyToClipboard-DDFChBm_.js";import{V as x}from"./VideoPlayer-lbflQfYO.js";import{E as ee}from"./index-CRznp8jk.js";import{E as te}from"./index-n8xs681c.js";import{E as oe}from"./index-CuDB9gdd.js";import{B as se}from"./BotPlaceholder-CXwVfZf3.js";import{N as ae}from"./NoTasks-C0_ki8Ur.js";import"./use-form-item-C7Jxi2ST.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./index-CG04RGrn.js";import"./typescript-B81uJgVE.js";import"./index-CYL-RFc_.js";import"./strings-beZM2Y-f.js";import"./isEqual-CbZBrtf3.js";import"./_Uint8Array-rxEgK7pZ.js";import"./castArray-B2H9FWSG.js";import"./debounce-BCcGKj6U.js";import"./_baseIteratee-BP_fhl98.js";import"./index-CF1ww37w.js";import"./index-UzoKOEii.js";import"./_baseClone-CoFSI4Xz.js";import"./_initCloneObject-CSU1ND3o.js";import"./index-FOpEkA01.js";import"./vue-plyr-BO2nlN4c.js";import"./index-CHYLT97t.js";const ne=b({name:"LayoutHailuo",components:{ElDrawer:R,ElButton:E,FontAwesomeIcon:L},data(){return{drawer:!1}}}),le={class:"main flex flex-row flex-1"},ie={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},re={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function ce(e,n,f,g,w,y){const p=a("font-awesome-icon"),h=a("el-button"),c=a("el-drawer");return s(),i("div",le,[r("div",ie,[T(e.$slots,"config",{},void 0,!0)]),r("div",re,[T(e.$slots,"result",{},void 0,!0)]),t(h,{circle:"",class:"menu",onClick:n[0]||(n[0]=_=>e.drawer=!0)},{default:u(()=>[t(p,{icon:"fa-solid fa-magic"})]),_:1}),t(c,{modelValue:e.drawer,"onUpdate:modelValue":n[1]||(n[1]=_=>e.drawer=_),direction:"ltr","with-header":!1,size:"340px"},{default:u(()=>[T(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const ue=k(ne,[["render",ce],["__scopeId","data-v-fa61db7a"]]),de=b({name:"ModelSelector",components:{ElSelect:O,ElOption:F},data(){return{}},computed:{options(){return[{value:"minimax-t2v",label:this.$t("hailuo.button.model1")},{value:"minimax-i2v",label:this.$t("hailuo.button.model2")},{value:"minimax-i2v-director",label:this.$t("hailuo.button.model3")}]},value:{get(){return this.$store.state.hailuo?.config?.model},set(e){this.$store.commit("hailuo/setConfig",{...this.$store.state.hailuo?.config,model:e})}}},mounted(){this.value||(this.value=q)}}),me={class:"field"},pe={class:"title font-bold"},he={class:"float-left"};function fe(e,n,f,g,w,y){const p=a("el-option"),h=a("el-select");return s(),i("div",me,[r("h2",pe,o(e.$t("hailuo.name.model")),1),t(h,{modelValue:e.value,"onUpdate:modelValue":n[0]||(n[0]=c=>e.value=c),class:"value",placeholder:e.$t("hailuo.placeholder.select"),clearable:""},{default:u(()=>[(s(!0),i(C,null,G(e.options,c=>(s(),v(p,{key:c.value,label:c.label,value:c.value},{default:u(()=>[r("span",he,o(c.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const ge=k(de,[["render",fe],["__scopeId","data-v-a768fbd9"]]),_e=b({name:"StartImageUrlInput",components:{ElUpload:K,ElButton:E,InfoIcon:P,ImagePreview:J},mixins:[z],data(){return{fileList:[],uploadUrl:M()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e.url).filter(e=>e!==void 0)},value:{get(){return this.$store.state.hailuo?.config?.first_image_url},set(){const e=this.urls?.[0];this.$store.commit("hailuo/setConfig",{...this.$store.state.hailuo?.config,first_image_url:e})}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){V.warning(this.$t("hailuo.message.uploadStartImageExceed"))},onError(){V.error(this.$t("hailuo.message.uploadStartImageError"))},async onRemove(){V.error(this.$t("hailuo.message.uploadStartImageError"))},onSetStartImageUrl(){const e=this.urls?.[0];this.$store.commit("hailuo/setConfig",{...this.$store.state.hailuo?.config,first_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),$e={class:"relative"},ve={class:"flex justify-between"},be={class:"flex justify-start items-center"},ke={class:"text-sm font-bold"};function we(e,n,f,g,w,y){const p=a("info-icon"),h=a("image-preview"),c=a("el-button"),_=a("el-upload");return s(),i("div",$e,[r("div",ve,[r("div",be,[r("span",ke,o(e.$t("hailuo.name.startImageUrl")),1),t(p,{content:e.$t("hailuo.description.startImageUrl"),class:"info"},null,8,["content"])])]),t(_,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":n[0]||(n[0]=l=>e.fileList=l),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file","show-file-list":!0,limit:1,multiple:!1,"list-type":"picture",action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-remove":e.onRemove,"on-success":e.onSuccess,headers:e.headers},{file:u(({file:l})=>[l.url&&l.percentage!==void 0?(s(),v(h,{key:0,url:l.url,name:l.name,percentage:l.percentage,onRemove:$=>e.fileList.splice(e.fileList.indexOf(l),1)},null,8,["url","name","percentage","onRemove"])):m("",!0)]),default:u(()=>[t(c,{size:"small",type:"primary",class:"btn btn-upload",round:""},{default:u(()=>[d(o(e.$t("hailuo.button.uploadStartImageUrl")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-remove","on-success","headers"])])}const ye=k(_e,[["render",we],["__scopeId","data-v-48f4a681"]]),Ve="",Ee=b({name:"PromptInput",components:{ElInput:Q,InfoIcon:P},computed:{prompt:{get(){return this.$store.state.hailuo?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("hailuo/setConfig",{...this.$store.state.hailuo?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=Ve)}}),Se={class:"field"},Ie={class:"box"},Te={class:"title font-bold"};function Ce(e,n,f,g,w,y){const p=a("info-icon"),h=a("el-input");return s(),i("div",Se,[r("div",Ie,[r("h2",Te,o(e.$t("hailuo.name.prompt")),1),t(p,{content:e.$t("hailuo.description.prompt"),class:"info"},null,8,["content"])]),t(h,{modelValue:e.prompt,"onUpdate:modelValue":n[0]||(n[0]=c=>e.prompt=c),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("hailuo.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const Le=k(Ee,[["render",Ce],["__scopeId","data-v-c601bcba"]]),Ue=b({name:"PresetPanel",components:{ElButton:E,FontAwesomeIcon:L,PromptInput:Le,StartImageUrlInput:ye,ModelSelector:ge,Consumption:W},emits:["generate"],computed:{config(){return this.$store.state.hailuo?.config},consumption(){return X(this.config,this.service?.cost)},service(){return this.$store.state.hailuo?.service}},methods:{onGenerate(){this.$emit("generate")}}}),Ge={class:"flex flex-col h-full"},Pe={class:"flex-1 overflow-y-auto p-5"},Re={class:"flex flex-col items-center justify-center px-5 pb-5"};function Ae(e,n,f,g,w,y){const p=a("prompt-input"),h=a("model-selector"),c=a("start-image-url-input"),_=a("consumption"),l=a("font-awesome-icon"),$=a("el-button");return s(),i("div",Ge,[r("div",Pe,[t(p,{class:"mb-4"}),t(h,{class:"mb-4"}),e.config?.model==="minimax-i2v"?(s(),v(c,{key:0,class:"mb-2"})):m("",!0)]),r("div",Re,[t(_,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(s(),v($,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:u(()=>[t(l,{icon:"fa-solid fa-magic",class:"mr-2"}),d(" "+o(e.$t("hailuo.button.extend")),1)]),_:1},8,["onClick"])):(s(),v($,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:u(()=>[t(l,{icon:"fa-solid fa-magic",class:"mr-2"}),d(" "+o(e.$t("hailuo.button.generate")),1)]),_:1},8,["onClick"]))])])}const Me=k(Ue,[["render",Ae]]),De=b({name:"TaskPreview",components:{ElImage:oe,CopyToClipboard:Z,FontAwesomeIcon:L,ElAlert:te,VideoPlayer:x,ElTooltip:ee,ElButton:E},props:{modelValue:{type:Object,required:!0}},computed:{application(){return this.$store.state.hailuo?.application},config(){return this.$store.state.hailuo?.config},video(){return this.modelValue?.response?.data?.[0]}},methods:{onDownload(e){console.debug("on download hailuo video",e),window.open(e,"_blank")}}}),je={class:"preview"},Be={class:"left"},qe={class:"main"},Fe={class:"bot"},Oe={class:"datetime"},ze={class:"info"},Ne={key:0,class:"prompt mt-2"},He={key:0},Je={key:1},Ke={key:0,class:S({content:!0,failed:!0})},Qe={key:0,class:"mb-4"},We={key:1,class:S({operations:!0,"mt-2":!0})},Xe={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ye={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ze={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},xe={key:1,class:S({content:!0})},et={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},tt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ot={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},st={class:"text-[var(--el-text-color-regular)] text-xs mb-0"},at={key:2,class:S({content:!0})},nt={class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function lt(e,n,f,g,w,y){const p=a("el-image"),h=a("video-player"),c=a("el-button"),_=a("el-tooltip"),l=a("font-awesome-icon"),$=a("copy-to-clipboard"),I=a("el-alert");return s(),i("div",je,[r("div",Be,[t(p,{src:"https://cdn.acedata.cloud/0qg4gp.png",class:"avatar"})]),r("div",qe,[r("div",Fe,[d(o(e.$t("hailuo.name.hailuoBot"))+" ",1),r("span",Oe,o(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),r("div",ze,[e.modelValue?.request?.prompt?(s(),i("p",Ne,[d(o(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?m("",!0):(s(),i("span",He," - ("+o(e.$t("hailuo.status.pending"))+") ",1)),e.video?.state==="processing"||e.video?.state==="pending"||e.video?.state==="running"?(s(),i("span",Je," - ("+o(e.$t("hailuo.status.processing"))+") ",1)):m("",!0)])):m("",!0)]),e.modelValue?.response?.success===!0?(s(),i("div",Ke,[e.video?.video_url?(s(),i("div",Qe,[t(h,{src:e.video?.video_url},null,8,["src"])])):m("",!0),e.video?(s(),i("div",We,[t(_,{class:"box-item",effect:"dark",content:e.$t("hailuo.message.downloadVideo"),placement:"top-start"},{default:u(()=>[e.video?.video_url?(s(),v(c,{key:0,type:"info",size:"small",class:"mb-2",onClick:n[0]||(n[0]=A(gt=>e.onDownload(e.video?.video_url),["stop"]))},{default:u(()=>[d(o(e.$t("hailuo.button.download")),1)]),_:1})):m("",!0)]),_:1},8,["content"])])):m("",!0),t(I,{closable:!1,class:"mt-2 success"},{default:u(()=>[e.modelValue?.request?.model?(s(),i("p",Xe,[t(l,{icon:"fa-solid fa-hashtag",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.model"))+": "+o(e.modelValue?.request?.model)+" ",1),t($,{content:e.modelValue?.id},null,8,["content"])])):m("",!0),r("p",Ye,[t(l,{icon:"fa-solid fa-magic",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),t($,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(s(),i("p",Ze,[t(l,{icon:"fa-solid fa-clock",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):m("",!0)]),_:1})])):m("",!0),e.modelValue?.response?.success===!1?(s(),i("div",xe,[t(I,{closable:!1,class:"failure"},{template:u(()=>[t(l,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.failure")),1)]),default:u(()=>[r("p",et,[t(l,{icon:"fa-solid fa-magic",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),t($,{content:e.modelValue?.id},null,8,["content"])]),r("p",tt,[t(l,{icon:"fa-solid fa-circle-info",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.failureReason"))+": "+o(e.modelValue?.response?.error?.message)+" ",1),t($,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(s(),i("p",ot,[t(l,{icon:"fa-solid fa-clock",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):m("",!0),r("p",st,[t(l,{icon:"fa-solid fa-hashtag",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),t($,{content:e.modelValue?.response?.trace_id},null,8,["content"])])]),_:1})])):m("",!0),e.modelValue?.response?.success===void 0?(s(),i("div",at,[t(I,{closable:!1,class:"info"},{template:u(()=>[t(l,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.failure")),1)]),default:u(()=>[r("p",nt,[t(l,{icon:"fa-solid fa-magic",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),t($,{content:e.modelValue?.id},null,8,["content"])])]),_:1})])):m("",!0)])])}const it=k(De,[["render",lt],["__scopeId","data-v-1ff65585"]]),rt=b({name:"RecentPanel",components:{TaskPreview:it,BotPlaceholder:se,NoTasks:ae,ScrollList:N},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.hailuo?.tasks,items:this.$store.state.hailuo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),ct={key:0},ut={key:2,class:"w-full h-full flex items-center justify-center"};function dt(e,n,f,g,w,y){const p=a("bot-placeholder"),h=a("task-preview"),c=a("scroll-list"),_=a("no-tasks");return s(),i(C,null,[e.tasks?.items===void 0?(s(),i("div",ct,[t(p)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(s(),v(c,{key:1,ref:"scrollList",class:"tasks w-full h-full overflow-y-auto",loading:e.loading,onReachTop:n[0]||(n[0]=l=>e.$emit("reach-top"))},{default:u(()=>[(s(!0),i(C,null,G(e.tasks?.items,l=>(s(),v(h,{key:l.id,"model-value":l},null,8,["model-value"]))),128))]),_:1},8,["loading"])):m("",!0),e.tasks?.items?.length===0?(s(),i("div",ut,[t(_)])):m("",!0)],64)}const mt=k(rt,[["render",dt]]),pt=B("hailuo"),ht=b({name:"HailuoIndex",components:{ConfigPanel:Me,Layout:ue,RecentPanel:mt},inject:["initialized"],data(){return{task:void 0,job:0,timer:void 0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.hailuo?.status?.getApplications===U.Request},tasksLoading(){return this.$store.state.hailuo?.status?.getTasks===U.Request||this.fetchingTasks},credential(){return this.$store.state.hailuo.credential},config(){return this.$store.state.hailuo.config},application(){return this.$store.state.hailuo.application},tasks(){return this.$store.state.hailuo.tasks}},watch:{tasks:{handler(e,n){e?.items?.length>n?.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 H({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("hailuo/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("hailuo/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();const 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);const{limit:n=5,createdAtMin:f,createdAtMax:g}=e||{};console.debug("limit",n,"createdAtMin",f,"createdAtMax",g),this.fetchingTasks=!0;try{await this.$store.dispatch("hailuo/getTasks",{limit:n,createdAtMin:f,createdAtMax:g})}finally{this.fetchingTasks=!1}},async onGenerate(){const e={...this.config,callback_url:pt},n=this.credential?.token;if(!n){console.error("no token specified");return}V.info(this.$t("hailuo.message.startingTask")),D("hailuo",j.generate(e,{token:n})).then(()=>{V.success(this.$t("hailuo.message.startTaskSuccess"))}).catch(f=>{f?.response?.data?.error?.code===Y?V.error(this.$t("hailuo.message.usedUp")):V.error(this.$t("hailuo.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function ft(e,n,f,g,w,y){const p=a("config-panel"),h=a("recent-panel"),c=a("layout");return s(),v(c,null,{config:u(()=>[t(p,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:u(()=>[t(h,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const io=k(ht,[["render",ft]]);export{io as default};
1
+ import{F as L}from"./index.es-CNlr9fic.js";import{E}from"./index-CAsSoYAm.js";import{E as R}from"./index-DCckHLpZ.js";import{d as b,H as i,E as r,z as T,C as t,y as u,D as a,q as s,F as o,O as C,N as G,x as v,I as d,J as m,M as A,Q as S}from"./vendor-vue-NSDaktjZ.js";import{G as k,bl as M,cr as D,aR as j,S as U,cs as B}from"./index-BdwdvwKp.js";import{a as q}from"./hailuo-C8Dw-0xR.js";import{E as F,a as O}from"./index-vq7oBl71.js";import{p as z}from"./pasteUploadMixin-BurWbGNQ.js";import{I as P,S as N,l as H}from"./pagination-B5HX_ZMJ.js";import{I as J}from"./ImagePreview--cyOeVsV.js";import{E as K}from"./index-CYuwcx0E.js";import{E as V}from"./index-D78_bBLX.js";import{E as Q}from"./index-Bm7RST_m.js";import{C as W}from"./Consumption-DPIPEsS9.js";import{a as X}from"./price-BWuBATEa.js";import{b as Y}from"./errorCode-Cqj9Td_Z.js";import{C as Z}from"./CopyToClipboard-ChBaidri.js";import{V as x}from"./VideoPlayer-CnC3dy-X.js";import{E as ee}from"./index-B3lIX5cz.js";import{E as te}from"./index-DMKqP0Mz.js";import{E as oe}from"./index-B30WeW08.js";import{B as se}from"./BotPlaceholder-C54AZ889.js";import{N as ae}from"./NoTasks-d5P_8OkS.js";import"./use-form-item-CtSDYkuV.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./index-CLjlMMvy.js";import"./typescript-D_h56YKw.js";import"./index-BczSESIm.js";import"./strings-beZM2Y-f.js";import"./isEqual-oZYHlzFx.js";import"./_Uint8Array-DnXEH1kJ.js";import"./castArray-D8by9zqR.js";import"./debounce-CnJPNhnw.js";import"./_baseIteratee-Dxd4hwaV.js";import"./index-C1rOZdVC.js";import"./index-Cqy8qcZ7.js";import"./_baseClone-DrdzZuzq.js";import"./_initCloneObject-CPj4Zmvt.js";import"./index-Da1vJcC1.js";import"./vue-plyr-BO2nlN4c.js";import"./index-BrXFOL-3.js";const ne=b({name:"LayoutHailuo",components:{ElDrawer:R,ElButton:E,FontAwesomeIcon:L},data(){return{drawer:!1}}}),le={class:"main flex flex-row flex-1"},ie={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},re={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function ce(e,n,f,g,w,y){const p=a("font-awesome-icon"),h=a("el-button"),c=a("el-drawer");return s(),i("div",le,[r("div",ie,[T(e.$slots,"config",{},void 0,!0)]),r("div",re,[T(e.$slots,"result",{},void 0,!0)]),t(h,{circle:"",class:"menu",onClick:n[0]||(n[0]=_=>e.drawer=!0)},{default:u(()=>[t(p,{icon:"fa-solid fa-magic"})]),_:1}),t(c,{modelValue:e.drawer,"onUpdate:modelValue":n[1]||(n[1]=_=>e.drawer=_),direction:"ltr","with-header":!1,size:"340px"},{default:u(()=>[T(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const ue=k(ne,[["render",ce],["__scopeId","data-v-fa61db7a"]]),de=b({name:"ModelSelector",components:{ElSelect:O,ElOption:F},data(){return{}},computed:{options(){return[{value:"minimax-t2v",label:this.$t("hailuo.button.model1")},{value:"minimax-i2v",label:this.$t("hailuo.button.model2")},{value:"minimax-i2v-director",label:this.$t("hailuo.button.model3")}]},value:{get(){return this.$store.state.hailuo?.config?.model},set(e){this.$store.commit("hailuo/setConfig",{...this.$store.state.hailuo?.config,model:e})}}},mounted(){this.value||(this.value=q)}}),me={class:"field"},pe={class:"title font-bold"},he={class:"float-left"};function fe(e,n,f,g,w,y){const p=a("el-option"),h=a("el-select");return s(),i("div",me,[r("h2",pe,o(e.$t("hailuo.name.model")),1),t(h,{modelValue:e.value,"onUpdate:modelValue":n[0]||(n[0]=c=>e.value=c),class:"value",placeholder:e.$t("hailuo.placeholder.select"),clearable:""},{default:u(()=>[(s(!0),i(C,null,G(e.options,c=>(s(),v(p,{key:c.value,label:c.label,value:c.value},{default:u(()=>[r("span",he,o(c.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const ge=k(de,[["render",fe],["__scopeId","data-v-a768fbd9"]]),_e=b({name:"StartImageUrlInput",components:{ElUpload:K,ElButton:E,InfoIcon:P,ImagePreview:J},mixins:[z],data(){return{fileList:[],uploadUrl:M()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e.url).filter(e=>e!==void 0)},value:{get(){return this.$store.state.hailuo?.config?.first_image_url},set(){const e=this.urls?.[0];this.$store.commit("hailuo/setConfig",{...this.$store.state.hailuo?.config,first_image_url:e})}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){V.warning(this.$t("hailuo.message.uploadStartImageExceed"))},onError(){V.error(this.$t("hailuo.message.uploadStartImageError"))},async onRemove(){V.error(this.$t("hailuo.message.uploadStartImageError"))},onSetStartImageUrl(){const e=this.urls?.[0];this.$store.commit("hailuo/setConfig",{...this.$store.state.hailuo?.config,first_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),$e={class:"relative"},ve={class:"flex justify-between"},be={class:"flex justify-start items-center"},ke={class:"text-sm font-bold"};function we(e,n,f,g,w,y){const p=a("info-icon"),h=a("image-preview"),c=a("el-button"),_=a("el-upload");return s(),i("div",$e,[r("div",ve,[r("div",be,[r("span",ke,o(e.$t("hailuo.name.startImageUrl")),1),t(p,{content:e.$t("hailuo.description.startImageUrl"),class:"info"},null,8,["content"])])]),t(_,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":n[0]||(n[0]=l=>e.fileList=l),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file","show-file-list":!0,limit:1,multiple:!1,"list-type":"picture",action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-remove":e.onRemove,"on-success":e.onSuccess,headers:e.headers},{file:u(({file:l})=>[l.url&&l.percentage!==void 0?(s(),v(h,{key:0,url:l.url,name:l.name,percentage:l.percentage,onRemove:$=>e.fileList.splice(e.fileList.indexOf(l),1)},null,8,["url","name","percentage","onRemove"])):m("",!0)]),default:u(()=>[t(c,{size:"small",type:"primary",class:"btn btn-upload",round:""},{default:u(()=>[d(o(e.$t("hailuo.button.uploadStartImageUrl")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-remove","on-success","headers"])])}const ye=k(_e,[["render",we],["__scopeId","data-v-48f4a681"]]),Ve="",Ee=b({name:"PromptInput",components:{ElInput:Q,InfoIcon:P},computed:{prompt:{get(){return this.$store.state.hailuo?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("hailuo/setConfig",{...this.$store.state.hailuo?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=Ve)}}),Se={class:"field"},Ie={class:"box"},Te={class:"title font-bold"};function Ce(e,n,f,g,w,y){const p=a("info-icon"),h=a("el-input");return s(),i("div",Se,[r("div",Ie,[r("h2",Te,o(e.$t("hailuo.name.prompt")),1),t(p,{content:e.$t("hailuo.description.prompt"),class:"info"},null,8,["content"])]),t(h,{modelValue:e.prompt,"onUpdate:modelValue":n[0]||(n[0]=c=>e.prompt=c),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("hailuo.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const Le=k(Ee,[["render",Ce],["__scopeId","data-v-c601bcba"]]),Ue=b({name:"PresetPanel",components:{ElButton:E,FontAwesomeIcon:L,PromptInput:Le,StartImageUrlInput:ye,ModelSelector:ge,Consumption:W},emits:["generate"],computed:{config(){return this.$store.state.hailuo?.config},consumption(){return X(this.config,this.service?.cost)},service(){return this.$store.state.hailuo?.service}},methods:{onGenerate(){this.$emit("generate")}}}),Ge={class:"flex flex-col h-full"},Pe={class:"flex-1 overflow-y-auto p-5"},Re={class:"flex flex-col items-center justify-center px-5 pb-5"};function Ae(e,n,f,g,w,y){const p=a("prompt-input"),h=a("model-selector"),c=a("start-image-url-input"),_=a("consumption"),l=a("font-awesome-icon"),$=a("el-button");return s(),i("div",Ge,[r("div",Pe,[t(p,{class:"mb-4"}),t(h,{class:"mb-4"}),e.config?.model==="minimax-i2v"?(s(),v(c,{key:0,class:"mb-2"})):m("",!0)]),r("div",Re,[t(_,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(s(),v($,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:u(()=>[t(l,{icon:"fa-solid fa-magic",class:"mr-2"}),d(" "+o(e.$t("hailuo.button.extend")),1)]),_:1},8,["onClick"])):(s(),v($,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:u(()=>[t(l,{icon:"fa-solid fa-magic",class:"mr-2"}),d(" "+o(e.$t("hailuo.button.generate")),1)]),_:1},8,["onClick"]))])])}const Me=k(Ue,[["render",Ae]]),De=b({name:"TaskPreview",components:{ElImage:oe,CopyToClipboard:Z,FontAwesomeIcon:L,ElAlert:te,VideoPlayer:x,ElTooltip:ee,ElButton:E},props:{modelValue:{type:Object,required:!0}},computed:{application(){return this.$store.state.hailuo?.application},config(){return this.$store.state.hailuo?.config},video(){return this.modelValue?.response?.data?.[0]}},methods:{onDownload(e){console.debug("on download hailuo video",e),window.open(e,"_blank")}}}),je={class:"preview"},Be={class:"left"},qe={class:"main"},Fe={class:"bot"},Oe={class:"datetime"},ze={class:"info"},Ne={key:0,class:"prompt mt-2"},He={key:0},Je={key:1},Ke={key:0,class:S({content:!0,failed:!0})},Qe={key:0,class:"mb-4"},We={key:1,class:S({operations:!0,"mt-2":!0})},Xe={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ye={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ze={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},xe={key:1,class:S({content:!0})},et={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},tt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ot={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},st={class:"text-[var(--el-text-color-regular)] text-xs mb-0"},at={key:2,class:S({content:!0})},nt={class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function lt(e,n,f,g,w,y){const p=a("el-image"),h=a("video-player"),c=a("el-button"),_=a("el-tooltip"),l=a("font-awesome-icon"),$=a("copy-to-clipboard"),I=a("el-alert");return s(),i("div",je,[r("div",Be,[t(p,{src:"https://cdn.acedata.cloud/0qg4gp.png",class:"avatar"})]),r("div",qe,[r("div",Fe,[d(o(e.$t("hailuo.name.hailuoBot"))+" ",1),r("span",Oe,o(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),r("div",ze,[e.modelValue?.request?.prompt?(s(),i("p",Ne,[d(o(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?m("",!0):(s(),i("span",He," - ("+o(e.$t("hailuo.status.pending"))+") ",1)),e.video?.state==="processing"||e.video?.state==="pending"||e.video?.state==="running"?(s(),i("span",Je," - ("+o(e.$t("hailuo.status.processing"))+") ",1)):m("",!0)])):m("",!0)]),e.modelValue?.response?.success===!0?(s(),i("div",Ke,[e.video?.video_url?(s(),i("div",Qe,[t(h,{src:e.video?.video_url},null,8,["src"])])):m("",!0),e.video?(s(),i("div",We,[t(_,{class:"box-item",effect:"dark",content:e.$t("hailuo.message.downloadVideo"),placement:"top-start"},{default:u(()=>[e.video?.video_url?(s(),v(c,{key:0,type:"info",size:"small",class:"mb-2",onClick:n[0]||(n[0]=A(gt=>e.onDownload(e.video?.video_url),["stop"]))},{default:u(()=>[d(o(e.$t("hailuo.button.download")),1)]),_:1})):m("",!0)]),_:1},8,["content"])])):m("",!0),t(I,{closable:!1,class:"mt-2 success"},{default:u(()=>[e.modelValue?.request?.model?(s(),i("p",Xe,[t(l,{icon:"fa-solid fa-hashtag",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.model"))+": "+o(e.modelValue?.request?.model)+" ",1),t($,{content:e.modelValue?.id},null,8,["content"])])):m("",!0),r("p",Ye,[t(l,{icon:"fa-solid fa-magic",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),t($,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(s(),i("p",Ze,[t(l,{icon:"fa-solid fa-clock",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):m("",!0)]),_:1})])):m("",!0),e.modelValue?.response?.success===!1?(s(),i("div",xe,[t(I,{closable:!1,class:"failure"},{template:u(()=>[t(l,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.failure")),1)]),default:u(()=>[r("p",et,[t(l,{icon:"fa-solid fa-magic",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),t($,{content:e.modelValue?.id},null,8,["content"])]),r("p",tt,[t(l,{icon:"fa-solid fa-circle-info",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.failureReason"))+": "+o(e.modelValue?.response?.error?.message)+" ",1),t($,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(s(),i("p",ot,[t(l,{icon:"fa-solid fa-clock",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):m("",!0),r("p",st,[t(l,{icon:"fa-solid fa-hashtag",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),t($,{content:e.modelValue?.response?.trace_id},null,8,["content"])])]),_:1})])):m("",!0),e.modelValue?.response?.success===void 0?(s(),i("div",at,[t(I,{closable:!1,class:"info"},{template:u(()=>[t(l,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.failure")),1)]),default:u(()=>[r("p",nt,[t(l,{icon:"fa-solid fa-magic",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),t($,{content:e.modelValue?.id},null,8,["content"])])]),_:1})])):m("",!0)])])}const it=k(De,[["render",lt],["__scopeId","data-v-1ff65585"]]),rt=b({name:"RecentPanel",components:{TaskPreview:it,BotPlaceholder:se,NoTasks:ae,ScrollList:N},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.hailuo?.tasks,items:this.$store.state.hailuo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),ct={key:0},ut={key:2,class:"w-full h-full flex items-center justify-center"};function dt(e,n,f,g,w,y){const p=a("bot-placeholder"),h=a("task-preview"),c=a("scroll-list"),_=a("no-tasks");return s(),i(C,null,[e.tasks?.items===void 0?(s(),i("div",ct,[t(p)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(s(),v(c,{key:1,ref:"scrollList",class:"tasks w-full h-full overflow-y-auto",loading:e.loading,onReachTop:n[0]||(n[0]=l=>e.$emit("reach-top"))},{default:u(()=>[(s(!0),i(C,null,G(e.tasks?.items,l=>(s(),v(h,{key:l.id,"model-value":l},null,8,["model-value"]))),128))]),_:1},8,["loading"])):m("",!0),e.tasks?.items?.length===0?(s(),i("div",ut,[t(_)])):m("",!0)],64)}const mt=k(rt,[["render",dt]]),pt=B("hailuo"),ht=b({name:"HailuoIndex",components:{ConfigPanel:Me,Layout:ue,RecentPanel:mt},inject:["initialized"],data(){return{task:void 0,job:0,timer:void 0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.hailuo?.status?.getApplications===U.Request},tasksLoading(){return this.$store.state.hailuo?.status?.getTasks===U.Request||this.fetchingTasks},credential(){return this.$store.state.hailuo.credential},config(){return this.$store.state.hailuo.config},application(){return this.$store.state.hailuo.application},tasks(){return this.$store.state.hailuo.tasks}},watch:{tasks:{handler(e,n){e?.items?.length>n?.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 H({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("hailuo/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("hailuo/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();const 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);const{limit:n=5,createdAtMin:f,createdAtMax:g}=e||{};console.debug("limit",n,"createdAtMin",f,"createdAtMax",g),this.fetchingTasks=!0;try{await this.$store.dispatch("hailuo/getTasks",{limit:n,createdAtMin:f,createdAtMax:g})}finally{this.fetchingTasks=!1}},async onGenerate(){const e={...this.config,callback_url:pt},n=this.credential?.token;if(!n){console.error("no token specified");return}V.info(this.$t("hailuo.message.startingTask")),D("hailuo",j.generate(e,{token:n})).then(()=>{V.success(this.$t("hailuo.message.startTaskSuccess"))}).catch(f=>{f?.response?.data?.error?.code===Y?V.error(this.$t("hailuo.message.usedUp")):V.error(this.$t("hailuo.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function ft(e,n,f,g,w,y){const p=a("config-panel"),h=a("recent-panel"),c=a("layout");return s(),v(c,null,{config:u(()=>[t(p,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:u(()=>[t(h,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const io=k(ht,[["render",ft]]);export{io as default};
@@ -1 +1 @@
1
- import{L as S,d as G}from"./avatar-Cxest084.js";import{bv as V,bs as A,bw as q,bx as M,bn as j,bu as O,G as k,by as P}from"./index-Xv72FIVH.js";import{b as z,E as J,a as K}from"./index-BzQJoc4N.js";import{E as W}from"./index-JI-AWDGe.js";import{E as X,a as Y}from"./index-oZSQuc3z.js";import{a as L,E as R}from"./index-RD-mMB30.js";import{d as g,x as u,y as n,C as o,G as i,J as p,I as _,F as m,H as I,E as f,D as t,K as Q,q as r}from"./vendor-vue-NSDaktjZ.js";import{F as Z}from"./index.es-DD6X2EPt.js";import{a as N,b as x,c as ee,E as oe}from"./index-XdDjb_qZ.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./typescript-B81uJgVE.js";import"./index-COuezDm-.js";import"./index-CRznp8jk.js";import"./index-CYL-RFc_.js";import"./index-BuyEbX8F.js";import"./index-CF1ww37w.js";import"./use-form-item-C7Jxi2ST.js";import"./index-CG04RGrn.js";import"./dropdown-8Ina1NwG.js";import"./castArray-B2H9FWSG.js";const te=g({name:"TopHeader",components:{ElCol:R,Logo:S,ElRow:L,ElDropdown:Y,ElMenu:K,ElMenuItem:J,ElDropdownItem:X,ElButton:W,ElSubMenu:z},data(){return{defaultAvatar:G,products:"chat"}},computed:{site(){return this.$store.state?.site},dark(){return this.$store.getters?.dark},active(){return this.$route.matched?.[0]?.path},user(){return this.$store.getters?.user},authenticated(){return this.$store.getters?.authenticated}},methods:{openTab(e){window.open(e,"_blank")},onSelect(e){e&&this.$router.push(e)},onHome(){this.$router.push({name:j})},onLogin(){this.$router.push({name:M})},onDownload(){this.$router.push({name:q})},onProfile(){const e=O();window.open(A(`${e}/user/profile`),"_blank")},onVerify(){const e=O();window.open(A(`${e}/user/verify`),"_blank")},onConsole(){this.$router.push({name:V})},async onLogout(){this.$store.dispatch("logout")}}}),ne={key:0,class:"mt-4 pr-10"},ae={key:1,class:"float-right"},se=["src"];function re(e,s,C,E,y,D){const h=t("logo"),c=t("el-col"),a=t("el-menu-item"),$=t("el-sub-menu"),b=t("el-menu"),v=t("el-button"),w=t("language-selector"),U=t("dark-selector"),T=t("el-dropdown-item"),B=t("el-dropdown-menu"),F=t("el-dropdown"),H=t("el-row"),l=Q("t");return r(),u(H,{class:"header"},{default:n(()=>[o(c,{md:4,xs:24,class:"brand-col"},{default:n(()=>[o(h,{onClick:e.onHome},null,8,["onClick"])]),_:1}),o(c,{md:16,xs:13},{default:n(()=>[o(b,{"default-active":e.active,mode:"horizontal",class:"menu",ellipsis:!0,onSelect:e.onSelect},{default:n(()=>[o($,{index:e.products},{title:n(()=>[_(m(e.$t("common.nav.products")),1)]),default:n(()=>[e.site?.features?.chatgpt?.enabled?i((r(),u(a,{key:0,index:"/chat"},null,512)),[[l,"index.title.chat"]]):p("",!0),e.site?.features?.midjourney?.enabled?i((r(),u(a,{key:1,index:"/midjourney"},null,512)),[[l,"index.title.midjourney"]]):p("",!0),e.site?.features?.qrart?.enabled?i((r(),u(a,{key:2,index:"/qrart"},null,512)),[[l,"index.title.qrart"]]):p("",!0),e.site?.features?.suno?.enabled?i((r(),u(a,{key:3,index:"/suno"},null,512)),[[l,"index.title.suno"]]):p("",!0),e.site?.features?.luma?.enabled?i((r(),u(a,{key:4,index:"/luma"},null,512)),[[l,"index.title.luma"]]):p("",!0),e.site?.features?.headshots?.enabled?i((r(),u(a,{key:5,index:"/headshots"},null,512)),[[l,"index.title.headshots"]]):p("",!0)]),_:1},8,["index"]),i(o(a,{onRoute:d=>{},onClick:e.onDownload},null,8,["onClick"]),[[l,"common.nav.mobileApp"]]),i(o(a,{onRoute:d=>{},onClick:s[0]||(s[0]=d=>e.openTab("https://platform.acedata.cloud"))},null,512),[[l,"common.nav.apiPlatform"]]),i(o(a,{onRoute:d=>{},onClick:s[1]||(s[1]=d=>e.openTab("https://platform.acedata.cloud/support"))},null,512),[[l,"common.nav.support"]]),i(o(a,{onRoute:d=>{},onClick:s[2]||(s[2]=d=>e.openTab("https://platform.acedata.cloud/earning"))},null,512),[[l,"common.nav.referral"]])]),_:1},8,["default-active","onSelect"])]),_:1}),o(c,{md:4,xs:11},{default:n(()=>[e.authenticated?(r(),I("div",ae,[f("div",{class:"console",onClick:s[3]||(s[3]=(...d)=>e.onConsole&&e.onConsole(...d))},m(e.$t("common.button.console")),1),o(F,{trigger:"click"},{dropdown:n(()=>[o(B,null,{default:n(()=>[o(T,{onClick:e.onProfile},{default:n(()=>[_(m(e.$t("common.button.profile")),1)]),_:1},8,["onClick"]),o(T,{onClick:e.onLogout},{default:n(()=>[_(m(e.$t("common.button.logout")),1)]),_:1},8,["onClick"])]),_:1})]),default:n(()=>[f("img",{src:e.user?.avatar||e.defaultAvatar,class:"avatar"},null,8,se)]),_:1})])):(r(),I("div",ne,[o(v,{type:"primary",class:"float-right",size:"small",round:"",onClick:e.onLogin},{default:n(()=>[_(m(e.$t("common.button.login")),1)]),_:1},8,["onClick"]),o(w,{class:"locale float-right mr-4"}),o(U,{class:"float-right mr-4"})]))]),_:1})]),_:1})}const le=k(te,[["render",re]]),ie=g({name:"BottomFooter",components:{ElContainer:N,ElRow:L,ElCol:R,FontAwesomeIcon:Z},data(){return{faGithub:P}},computed:{},methods:{}}),ue={href:"/download"},me={href:"https://platform.acedata.cloud"},ce=["title"];function de(e,s,C,E,y,D){const h=t("font-awesome-icon"),c=t("el-col"),a=t("el-row"),$=t("el-container");return r(),u($,{id:"footer",class:"footer"},{default:n(()=>[o(a,{class:"w-full"},{default:n(()=>[o(c,{class:"container",span:18,offset:3},{default:n(()=>[o(a,null,{default:n(()=>[o(c,{span:24,class:"text-center"},{default:n(()=>[f("p",null,[f("a",ue,m(e.$t("common.nav.mobileApp")),1),s[0]||(s[0]=_(" · ",-1)),f("a",me,m(e.$t("common.entity.website")),1),_(" © "+m(new Date().getFullYear())+" "+m(e.$t("common.entity.copyright"))+" · ",1),f("a",{href:"https://github.com/AceDataCloud/Nexior",target:"_blank",rel:"noopener noreferrer",class:"github-link",title:e.$t("common.nav.github")},[o(h,{icon:e.faGithub},null,8,["icon"])],8,ce)])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}const pe=k(ie,[["render",de],["__scopeId","data-v-f6b91b08"]]),_e=g({name:"LayoutIndex",components:{TopHeader:le,BottomFooter:pe,ElContainer:N,ElMain:oe,ElFooter:ee,ElHeader:x}});function fe(e,s,C,E,y,D){const h=t("top-header"),c=t("el-header"),a=t("router-view"),$=t("el-main"),b=t("bottom-footer"),v=t("el-footer"),w=t("el-container");return r(),u(w,{class:"wrapper min-h-[100vh]"},{default:n(()=>[o(c,{class:"header p-0 h-auto"},{default:n(()=>[o(h)]),_:1}),o($,{class:"main"},{default:n(()=>[o(a)]),_:1}),o(v,{class:"footer p-0 h-auto"},{default:n(()=>[o(b)]),_:1})]),_:1})}const Se=k(_e,[["render",fe]]);export{Se as default};
1
+ import{L as S,d as G}from"./avatar-CyroQJ9i.js";import{bv as V,bs as A,bw as q,bx as M,bn as j,bu as O,G as k,by as P}from"./index-BdwdvwKp.js";import{b as z,E as J,a as K}from"./index-qG5c_vTa.js";import{E as W}from"./index-CAsSoYAm.js";import{E as X,a as Y}from"./index-BLw4_-YE.js";import{a as L,E as R}from"./index-DfxADpfB.js";import{d as g,x as u,y as n,C as o,G as i,J as p,I as _,F as m,H as I,E as f,D as t,K as Q,q as r}from"./vendor-vue-NSDaktjZ.js";import{F as Z}from"./index.es-CNlr9fic.js";import{a as N,b as x,c as ee,E as oe}from"./index-Cn2LGxPD.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./typescript-D_h56YKw.js";import"./index-BuHr9c4v.js";import"./index-B3lIX5cz.js";import"./index-BczSESIm.js";import"./index-BuyEbX8F.js";import"./index-C1rOZdVC.js";import"./use-form-item-CtSDYkuV.js";import"./index-CLjlMMvy.js";import"./dropdown-BDaEjakL.js";import"./castArray-D8by9zqR.js";const te=g({name:"TopHeader",components:{ElCol:R,Logo:S,ElRow:L,ElDropdown:Y,ElMenu:K,ElMenuItem:J,ElDropdownItem:X,ElButton:W,ElSubMenu:z},data(){return{defaultAvatar:G,products:"chat"}},computed:{site(){return this.$store.state?.site},dark(){return this.$store.getters?.dark},active(){return this.$route.matched?.[0]?.path},user(){return this.$store.getters?.user},authenticated(){return this.$store.getters?.authenticated}},methods:{openTab(e){window.open(e,"_blank")},onSelect(e){e&&this.$router.push(e)},onHome(){this.$router.push({name:j})},onLogin(){this.$router.push({name:M})},onDownload(){this.$router.push({name:q})},onProfile(){const e=O();window.open(A(`${e}/user/profile`),"_blank")},onVerify(){const e=O();window.open(A(`${e}/user/verify`),"_blank")},onConsole(){this.$router.push({name:V})},async onLogout(){this.$store.dispatch("logout")}}}),ne={key:0,class:"mt-4 pr-10"},ae={key:1,class:"float-right"},se=["src"];function re(e,s,C,E,y,D){const h=t("logo"),c=t("el-col"),a=t("el-menu-item"),$=t("el-sub-menu"),b=t("el-menu"),v=t("el-button"),w=t("language-selector"),U=t("dark-selector"),T=t("el-dropdown-item"),B=t("el-dropdown-menu"),F=t("el-dropdown"),H=t("el-row"),l=Q("t");return r(),u(H,{class:"header"},{default:n(()=>[o(c,{md:4,xs:24,class:"brand-col"},{default:n(()=>[o(h,{onClick:e.onHome},null,8,["onClick"])]),_:1}),o(c,{md:16,xs:13},{default:n(()=>[o(b,{"default-active":e.active,mode:"horizontal",class:"menu",ellipsis:!0,onSelect:e.onSelect},{default:n(()=>[o($,{index:e.products},{title:n(()=>[_(m(e.$t("common.nav.products")),1)]),default:n(()=>[e.site?.features?.chatgpt?.enabled?i((r(),u(a,{key:0,index:"/chat"},null,512)),[[l,"index.title.chat"]]):p("",!0),e.site?.features?.midjourney?.enabled?i((r(),u(a,{key:1,index:"/midjourney"},null,512)),[[l,"index.title.midjourney"]]):p("",!0),e.site?.features?.qrart?.enabled?i((r(),u(a,{key:2,index:"/qrart"},null,512)),[[l,"index.title.qrart"]]):p("",!0),e.site?.features?.suno?.enabled?i((r(),u(a,{key:3,index:"/suno"},null,512)),[[l,"index.title.suno"]]):p("",!0),e.site?.features?.luma?.enabled?i((r(),u(a,{key:4,index:"/luma"},null,512)),[[l,"index.title.luma"]]):p("",!0),e.site?.features?.headshots?.enabled?i((r(),u(a,{key:5,index:"/headshots"},null,512)),[[l,"index.title.headshots"]]):p("",!0)]),_:1},8,["index"]),i(o(a,{onRoute:d=>{},onClick:e.onDownload},null,8,["onClick"]),[[l,"common.nav.mobileApp"]]),i(o(a,{onRoute:d=>{},onClick:s[0]||(s[0]=d=>e.openTab("https://platform.acedata.cloud"))},null,512),[[l,"common.nav.apiPlatform"]]),i(o(a,{onRoute:d=>{},onClick:s[1]||(s[1]=d=>e.openTab("https://platform.acedata.cloud/support"))},null,512),[[l,"common.nav.support"]]),i(o(a,{onRoute:d=>{},onClick:s[2]||(s[2]=d=>e.openTab("https://platform.acedata.cloud/earning"))},null,512),[[l,"common.nav.referral"]])]),_:1},8,["default-active","onSelect"])]),_:1}),o(c,{md:4,xs:11},{default:n(()=>[e.authenticated?(r(),I("div",ae,[f("div",{class:"console",onClick:s[3]||(s[3]=(...d)=>e.onConsole&&e.onConsole(...d))},m(e.$t("common.button.console")),1),o(F,{trigger:"click"},{dropdown:n(()=>[o(B,null,{default:n(()=>[o(T,{onClick:e.onProfile},{default:n(()=>[_(m(e.$t("common.button.profile")),1)]),_:1},8,["onClick"]),o(T,{onClick:e.onLogout},{default:n(()=>[_(m(e.$t("common.button.logout")),1)]),_:1},8,["onClick"])]),_:1})]),default:n(()=>[f("img",{src:e.user?.avatar||e.defaultAvatar,class:"avatar"},null,8,se)]),_:1})])):(r(),I("div",ne,[o(v,{type:"primary",class:"float-right",size:"small",round:"",onClick:e.onLogin},{default:n(()=>[_(m(e.$t("common.button.login")),1)]),_:1},8,["onClick"]),o(w,{class:"locale float-right mr-4"}),o(U,{class:"float-right mr-4"})]))]),_:1})]),_:1})}const le=k(te,[["render",re]]),ie=g({name:"BottomFooter",components:{ElContainer:N,ElRow:L,ElCol:R,FontAwesomeIcon:Z},data(){return{faGithub:P}},computed:{},methods:{}}),ue={href:"/download"},me={href:"https://platform.acedata.cloud"},ce=["title"];function de(e,s,C,E,y,D){const h=t("font-awesome-icon"),c=t("el-col"),a=t("el-row"),$=t("el-container");return r(),u($,{id:"footer",class:"footer"},{default:n(()=>[o(a,{class:"w-full"},{default:n(()=>[o(c,{class:"container",span:18,offset:3},{default:n(()=>[o(a,null,{default:n(()=>[o(c,{span:24,class:"text-center"},{default:n(()=>[f("p",null,[f("a",ue,m(e.$t("common.nav.mobileApp")),1),s[0]||(s[0]=_(" · ",-1)),f("a",me,m(e.$t("common.entity.website")),1),_(" © "+m(new Date().getFullYear())+" "+m(e.$t("common.entity.copyright"))+" · ",1),f("a",{href:"https://github.com/AceDataCloud/Nexior",target:"_blank",rel:"noopener noreferrer",class:"github-link",title:e.$t("common.nav.github")},[o(h,{icon:e.faGithub},null,8,["icon"])],8,ce)])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}const pe=k(ie,[["render",de],["__scopeId","data-v-f6b91b08"]]),_e=g({name:"LayoutIndex",components:{TopHeader:le,BottomFooter:pe,ElContainer:N,ElMain:oe,ElFooter:ee,ElHeader:x}});function fe(e,s,C,E,y,D){const h=t("top-header"),c=t("el-header"),a=t("router-view"),$=t("el-main"),b=t("bottom-footer"),v=t("el-footer"),w=t("el-container");return r(),u(w,{class:"wrapper min-h-[100vh]"},{default:n(()=>[o(c,{class:"header p-0 h-auto"},{default:n(()=>[o(h)]),_:1}),o($,{class:"main"},{default:n(()=>[o(a)]),_:1}),o(v,{class:"footer p-0 h-auto"},{default:n(()=>[o(b)]),_:1})]),_:1})}const Se=k(_e,[["render",fe]]);export{Se as default};