@acedatacloud/nexior 3.32.5 → 3.32.6

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 (276) hide show
  1. package/dist/assets/{Auth-CWkMFOC-.js → Auth-CbhdXVlZ.js} +1 -1
  2. package/dist/assets/{BotPlaceholder-ClkF4VzC.js → BotPlaceholder-4xqKcsb2.js} +1 -1
  3. package/dist/assets/{Callback-D3LR1_01.js → Callback-BbjpoZdI.js} +1 -1
  4. package/dist/assets/{Console-DosVPLxD.js → Console-B7jDE8W1.js} +1 -1
  5. package/dist/assets/{Conversation-2qRWgQUS.js → Conversation-BJ1BUNqc.js} +1 -1
  6. package/dist/assets/{CopyToClipboard-BXZ_JLam.js → CopyToClipboard-jWxr3xe-.js} +1 -1
  7. package/dist/assets/{Detail-C4yCr9BN.js → Detail-CZma9h9c.js} +2 -2
  8. package/dist/assets/{EditArray--myCPTrp.js → EditArray-BcoTXdg2.js} +1 -1
  9. package/dist/assets/{Extra-Dgox8UME.js → Extra-Do_PGoRW.js} +1 -1
  10. package/dist/assets/{FilePreview-D4OiDrGf.js → FilePreview-CBNy_XWe.js} +1 -1
  11. package/dist/assets/{History-YW70CRJF.js → History-Dyfl6UOR.js} +1 -1
  12. package/dist/assets/{ImagePreview-VkiDVAyi.js → ImagePreview-YbDjRoDP.js} +1 -1
  13. package/dist/assets/{ImageWrapper-xTknZyTG.js → ImageWrapper-_o2mlETS.js} +1 -1
  14. package/dist/assets/{Index-DDxHMUMU.js → Index-BCnf9SsH.js} +1 -1
  15. package/dist/assets/{Index-BkKqM5bT.js → Index-BNwdn1-M.js} +1 -1
  16. package/dist/assets/{Index-Ce2LQtzb.js → Index-B_etggd0.js} +1 -1
  17. package/dist/assets/{Index-DkB7Apct.js → Index-CMk0BUUc.js} +1 -1
  18. package/dist/assets/{Index-CgBTM1GL.js → Index-CqRTbw9q.js} +1 -1
  19. package/dist/assets/{Index-DAK9qvw2.js → Index-Cqga3cf6.js} +1 -1
  20. package/dist/assets/{Index-CwXfNqNy.js → Index-Csg_YxRf.js} +1 -1
  21. package/dist/assets/{Index-CyROKe18.js → Index-D6vX9YPr.js} +1 -1
  22. package/dist/assets/{Index-CPRj3yDW.js → Index-D9_k7mYF.js} +1 -1
  23. package/dist/assets/{Index-CrRSCMBs.js → Index-DCPx2hVg.js} +1 -1
  24. package/dist/assets/{Index-Cd93G5Ln.js → Index-DGq7Vo9b.js} +1 -1
  25. package/dist/assets/{Index-sVYgDxgu.js → Index-DHJRxyQQ.js} +1 -1
  26. package/dist/assets/{Index-D1qsw8wH.js → Index-DqnR_09A.js} +1 -1
  27. package/dist/assets/{Index-DFETf9cF.js → Index-Dw5_3UPH.js} +1 -1
  28. package/dist/assets/{Index-DFJgOUDX.js → Index-Dyj124ko.js} +1 -1
  29. package/dist/assets/{Index-DeiqlNLB.js → Index-E2hjs4Sq.js} +1 -1
  30. package/dist/assets/{Index-D9Bl8vjr.js → Index-R4Fh-Ngl.js} +1 -1
  31. package/dist/assets/{Index-CzUVh66Y.js → Index-WBRrf-rU.js} +1 -1
  32. package/dist/assets/{Index-CfDjAGIs.js → Index-m_4JhRPQ.js} +1 -1
  33. package/dist/assets/{Index-Cq6q1F-9.js → Index-vC6EKi7O.js} +1 -1
  34. package/dist/assets/{Invitees-DQcr5X4a.js → Invitees-B4LVPYs2.js} +1 -1
  35. package/dist/assets/{List-DNHdCF2P.js → List-CICnDfqP.js} +1 -1
  36. package/dist/assets/{List-DDhD2Eb4.js → List-CIgrsqwb.js} +1 -1
  37. package/dist/assets/{List-DG9-Ipl-.js → List-CpB-1MBq.js} +1 -1
  38. package/dist/assets/{Main-Dfc-8_4B.js → Main-Sredtjx5.js} +1 -1
  39. package/dist/assets/{Navigator-B6SWG7g4.js → Navigator-CfXc0GO3.js} +1 -1
  40. package/dist/assets/{NoTasks-C89T1fZz.js → NoTasks-Dpxe4xfM.js} +1 -1
  41. package/dist/assets/{Pagination-DbD7QHjF.js → Pagination-B-MXR0Z7.js} +1 -1
  42. package/dist/assets/{ScrollList-2fA4pSP6.js → ScrollList-BGZ0Fkh5.js} +1 -1
  43. package/dist/assets/{Status-uxHwlRWN.js → Status-BGKg_G7N.js} +1 -1
  44. package/dist/assets/{Subscribe-BL-txXEY.js → Subscribe-Dh1UoDCs.js} +1 -1
  45. package/dist/assets/{TransportWebHID-DOleuP0-.js → TransportWebHID-BMKas6kS.js} +1 -1
  46. package/dist/assets/{VideoPlayer-BgmN-u33.js → VideoPlayer-CfppHbtZ.js} +1 -1
  47. package/dist/assets/{avatar-CcO18mGO.js → avatar-Cp2nQHJG.js} +1 -1
  48. package/dist/assets/{bignumber-BYIHvKdE.js → bignumber-BDPO6KDj.js} +1 -1
  49. package/dist/assets/chat-1g0bgYFI.js +1 -0
  50. package/dist/assets/chat-8uDKI-zS.js +1 -0
  51. package/dist/assets/chat-B91pl-y-.js +1 -0
  52. package/dist/assets/chat-BDyJtcnn.js +1 -0
  53. package/dist/assets/chat-BdzpOmc7.js +1 -0
  54. package/dist/assets/chat-Bro-uoHQ.js +1 -0
  55. package/dist/assets/chat-CDkXQpzo.js +1 -0
  56. package/dist/assets/chat-CHHe_Pye.js +1 -0
  57. package/dist/assets/chat-CVKTJfze.js +1 -0
  58. package/dist/assets/chat-CdUgDfh3.js +1 -0
  59. package/dist/assets/chat-DicMBG2O.js +1 -0
  60. package/dist/assets/chat-DlQqlDLq.js +1 -0
  61. package/dist/assets/chat-DvkI0CcW.js +1 -0
  62. package/dist/assets/chat-Dzkk13eH.js +1 -0
  63. package/dist/assets/chat-MgkN7r1L.js +1 -0
  64. package/dist/assets/chat-NKlg3qJd.js +1 -0
  65. package/dist/assets/chat-xza8nfuJ.js +1 -0
  66. package/dist/assets/common-3Pg61o6G.js +1 -0
  67. package/dist/assets/common-B8_Eb5IW.js +1 -0
  68. package/dist/assets/common-Bj9oNp8q.js +1 -0
  69. package/dist/assets/common-CEc4vS1f.js +1 -0
  70. package/dist/assets/common-CLSGXaJd.js +1 -0
  71. package/dist/assets/common-CL_-d-go.js +1 -0
  72. package/dist/assets/common-CUB3pCfH.js +1 -0
  73. package/dist/assets/common-CeFwYjid.js +1 -0
  74. package/dist/assets/common-DP81pwvO.js +1 -0
  75. package/dist/assets/common-DTy2PGv4.js +1 -0
  76. package/dist/assets/common-DWpgU1IT.js +1 -0
  77. package/dist/assets/common-Db1-wqDl.js +1 -0
  78. package/dist/assets/common-Dd-si0ye.js +1 -0
  79. package/dist/assets/common-EuUt8iDT.js +1 -0
  80. package/dist/assets/common-G4FV4g0I.js +1 -0
  81. package/dist/assets/common-ZKrTz1O9.js +1 -0
  82. package/dist/assets/common-k5yR_AUi.js +1 -0
  83. package/dist/assets/{distribution-Bt870ZcO.js → distribution-CIiS3Bxb.js} +1 -1
  84. package/dist/assets/hailuo-B5STl3xi.js +1 -0
  85. package/dist/assets/hailuo-B8Wij-Oz.js +1 -0
  86. package/dist/assets/hailuo-CKb-vhXt.js +1 -0
  87. package/dist/assets/hailuo-CLBqynJI.js +1 -0
  88. package/dist/assets/hailuo-CSutXhAB.js +1 -0
  89. package/dist/assets/hailuo-CWfb1Oqx.js +1 -0
  90. package/dist/assets/hailuo-CXyQAncN.js +1 -0
  91. package/dist/assets/hailuo-CbV-wE3A.js +1 -0
  92. package/dist/assets/hailuo-CbqS5hVf.js +1 -0
  93. package/dist/assets/hailuo-CloZKI-a.js +1 -0
  94. package/dist/assets/hailuo-CyqqaoD8.js +1 -0
  95. package/dist/assets/hailuo-DV2zKef9.js +1 -0
  96. package/dist/assets/hailuo-DVDM-rW3.js +1 -0
  97. package/dist/assets/hailuo-TPI5HzbE.js +1 -0
  98. package/dist/assets/hailuo-W5OBmY5R.js +1 -0
  99. package/dist/assets/hailuo-Zh8ZzYrJ.js +1 -0
  100. package/dist/assets/hailuo-zdsLvEUi.js +1 -0
  101. package/dist/assets/{index-CXEtoAdh.js → index-BgDGDofP.js} +1 -1
  102. package/dist/assets/{index-QgxRGT_4.js → index-CdlFEyD2.js} +1 -1
  103. package/dist/assets/{index-Dy6gUoIU.js → index-Cg12Puws.js} +1 -1
  104. package/dist/assets/{index-DmLTLHg-.js → index-CqL6zWO4.js} +5 -5
  105. package/dist/assets/{index-DN5gs60Y.js → index-CyXksVZ4.js} +1 -1
  106. package/dist/assets/{index-DNWLzi2M.js → index-DOTDDv__.js} +1 -1
  107. package/dist/assets/{index-B_LuQlIq.js → index-kv1ttZgM.js} +1 -1
  108. package/dist/assets/{index-z51UU2kI.js → index-vB21LY8A.js} +1 -1
  109. package/dist/assets/{index.es-C57T75UL.js → index.es-vNwt4sbI.js} +1 -1
  110. package/dist/assets/midjourney-BFITzVKB.js +1 -0
  111. package/dist/assets/midjourney-BSYpft7W.js +1 -0
  112. package/dist/assets/midjourney-Bokdgi5z.js +1 -0
  113. package/dist/assets/midjourney-C-jIPqBK.js +1 -0
  114. package/dist/assets/midjourney-CHbKsgG3.js +1 -0
  115. package/dist/assets/midjourney-CLRM-RRm.js +1 -0
  116. package/dist/assets/midjourney-CTprsD9_.js +1 -0
  117. package/dist/assets/midjourney-CVcLgD9A.js +1 -0
  118. package/dist/assets/midjourney-CmqnU6qc.js +1 -0
  119. package/dist/assets/midjourney-Csrcun4w.js +1 -0
  120. package/dist/assets/midjourney-Cv3IT6Tb.js +1 -0
  121. package/dist/assets/midjourney-D4Cnt_rw.js +1 -0
  122. package/dist/assets/midjourney-DOblNcoo.js +1 -0
  123. package/dist/assets/midjourney-DQIseJPm.js +1 -0
  124. package/dist/assets/midjourney-DezNNCBe.js +1 -0
  125. package/dist/assets/midjourney-KfKcVT7I.js +1 -0
  126. package/dist/assets/midjourney-iC01w_m6.js +1 -0
  127. package/dist/assets/order-5qA_Tyh8.js +1 -0
  128. package/dist/assets/order-9nfJ8A90.js +1 -0
  129. package/dist/assets/order-BN3dpqvG.js +1 -0
  130. package/dist/assets/order-BTmBLJaK.js +1 -0
  131. package/dist/assets/{order-CZSeM2w4.js → order-BbLF8ipn.js} +1 -1
  132. package/dist/assets/order-BftLdFGm.js +1 -0
  133. package/dist/assets/order-BjTLjJLs.js +1 -0
  134. package/dist/assets/order-BoZk92NC.js +1 -0
  135. package/dist/assets/order-BtQos6TQ.js +1 -0
  136. package/dist/assets/order-C-eebXs4.js +1 -0
  137. package/dist/assets/order-C1LbxCIE.js +1 -0
  138. package/dist/assets/order-CFConAaV.js +1 -0
  139. package/dist/assets/order-DDY8y6pc.js +1 -0
  140. package/dist/assets/order-DKULBrBK.js +1 -0
  141. package/dist/assets/order-LsX4lEG_.js +1 -0
  142. package/dist/assets/order-RVok9vvs.js +1 -0
  143. package/dist/assets/order-RkmomuXc.js +1 -0
  144. package/dist/assets/order-xKN_YBy7.js +1 -0
  145. package/dist/assets/{price-ClaXuKyA.js → price-C8BXaFbS.js} +1 -1
  146. package/dist/assets/seedance-BCbPJdHI.js +1 -0
  147. package/dist/assets/seedance-CVG6IOXI.js +1 -0
  148. package/dist/assets/seedance-D8HJGAis.js +1 -0
  149. package/dist/assets/seedance-DICJhTnA.js +1 -0
  150. package/dist/assets/seedance-DtvM9JfA.js +1 -0
  151. package/dist/assets/{solana-wallets-7nljjsUZ.js → solana-wallets-B2tH0ked.js} +2 -2
  152. package/dist/assets/{solanaEmbed.esm-0NhrI64t.js → solanaEmbed.esm-DUeZW4Dp.js} +1 -1
  153. package/dist/assets/{string_decoder-CXOZ6KpD.js → string_decoder-CLvB3Ip0.js} +1 -1
  154. package/dist/assets/suno--6VcR04-.js +7 -0
  155. package/dist/assets/suno-9iqbxF4A.js +7 -0
  156. package/dist/assets/suno-B2N7k4ag.js +7 -0
  157. package/dist/assets/{suno-B6J742Fo.js → suno-BN0-fpVZ.js} +1 -1
  158. package/dist/assets/{suno-CO3QsQOg.js → suno-BO4l5Hqa.js} +2 -2
  159. package/dist/assets/suno-BrO0g2kg.js +7 -0
  160. package/dist/assets/suno-C3ri5VQr.js +7 -0
  161. package/dist/assets/suno-C43u7ROi.js +7 -0
  162. package/dist/assets/suno-CGHbYOAC.js +7 -0
  163. package/dist/assets/suno-CIBIrbMD.js +7 -0
  164. package/dist/assets/suno-D77ebmh0.js +7 -0
  165. package/dist/assets/{suno-Dyr3BJr2.js → suno-DS59HGEa.js} +2 -2
  166. package/dist/assets/suno-DUhouAsK.js +7 -0
  167. package/dist/assets/suno-DaSqz5Ru.js +7 -0
  168. package/dist/assets/{suno-CDE5lAPt.js → suno-GqDcO0YU.js} +2 -2
  169. package/dist/assets/suno-OZVZeVhI.js +7 -0
  170. package/dist/assets/{vendor-web3-CtYWvkaI.js → vendor-web3-BT8AOwfJ.js} +4 -4
  171. package/dist/assets/{web-DnTg_eVi.js → web-0G0qMWRK.js} +1 -1
  172. package/dist/assets/{web-ZwFxafGr.js → web-DmXk_g8Z.js} +1 -1
  173. package/dist/index.html +2 -2
  174. package/package.json +1 -1
  175. package/dist/assets/chat-1wdicyKD.js +0 -1
  176. package/dist/assets/chat-B-uKFtD7.js +0 -1
  177. package/dist/assets/chat-BEDsBWut.js +0 -1
  178. package/dist/assets/chat-BQnI3ESW.js +0 -1
  179. package/dist/assets/chat-BiV3N1L7.js +0 -1
  180. package/dist/assets/chat-C9BP-9pH.js +0 -1
  181. package/dist/assets/chat-CIFszBeW.js +0 -1
  182. package/dist/assets/chat-CSy-anRg.js +0 -1
  183. package/dist/assets/chat-Cdd0Zncj.js +0 -1
  184. package/dist/assets/chat-ChvajOsf.js +0 -1
  185. package/dist/assets/chat-CxVvavJQ.js +0 -1
  186. package/dist/assets/chat-DHFEiySY.js +0 -1
  187. package/dist/assets/chat-DU4P7SnG.js +0 -1
  188. package/dist/assets/chat-DX4gOtIG.js +0 -1
  189. package/dist/assets/chat-Dh7cMtaE.js +0 -1
  190. package/dist/assets/chat-IdMAYo0v.js +0 -1
  191. package/dist/assets/chat-mMqO_p2Y.js +0 -1
  192. package/dist/assets/common-2iCqJUYS.js +0 -1
  193. package/dist/assets/common-B06MFMQf.js +0 -1
  194. package/dist/assets/common-BRAtmRsJ.js +0 -1
  195. package/dist/assets/common-B_3m6buh.js +0 -1
  196. package/dist/assets/common-Byo6dAD4.js +0 -1
  197. package/dist/assets/common-C3IcqE8H.js +0 -1
  198. package/dist/assets/common-CJCw-vr8.js +0 -1
  199. package/dist/assets/common-CKY-0a3p.js +0 -1
  200. package/dist/assets/common-CoMaFFWX.js +0 -1
  201. package/dist/assets/common-DBDoN2vb.js +0 -1
  202. package/dist/assets/common-DsjfBo3C.js +0 -1
  203. package/dist/assets/common-Dz3-yCD-.js +0 -1
  204. package/dist/assets/common-QjLqEtxc.js +0 -1
  205. package/dist/assets/common-Ug6XoAMF.js +0 -1
  206. package/dist/assets/common-XtvWbkCC.js +0 -1
  207. package/dist/assets/common-npA49Z8g.js +0 -1
  208. package/dist/assets/common-rd-6seH4.js +0 -1
  209. package/dist/assets/hailuo-BM8Zb9tM.js +0 -1
  210. package/dist/assets/hailuo-BQt1d1O3.js +0 -1
  211. package/dist/assets/hailuo-BTz1l03a.js +0 -1
  212. package/dist/assets/hailuo-BW-py-iC.js +0 -1
  213. package/dist/assets/hailuo-BetkXkF7.js +0 -1
  214. package/dist/assets/hailuo-CtjbxtZg.js +0 -1
  215. package/dist/assets/hailuo-CuPAsaLK.js +0 -1
  216. package/dist/assets/hailuo-CxU6ifF9.js +0 -1
  217. package/dist/assets/hailuo-DHHrp9_h.js +0 -1
  218. package/dist/assets/hailuo-DPLP4ZfQ.js +0 -1
  219. package/dist/assets/hailuo-DquHPVRM.js +0 -1
  220. package/dist/assets/hailuo-DuMmmmEQ.js +0 -1
  221. package/dist/assets/hailuo-HvSBabx1.js +0 -1
  222. package/dist/assets/hailuo-Ls1nqE13.js +0 -1
  223. package/dist/assets/hailuo-Y_XixcQP.js +0 -1
  224. package/dist/assets/hailuo-e03mE7Om.js +0 -1
  225. package/dist/assets/hailuo-xgGk4uQk.js +0 -1
  226. package/dist/assets/midjourney-7qNi1gDF.js +0 -1
  227. package/dist/assets/midjourney-AZSr0dUI.js +0 -1
  228. package/dist/assets/midjourney-BA9N9EzD.js +0 -1
  229. package/dist/assets/midjourney-BELjzcp_.js +0 -1
  230. package/dist/assets/midjourney-BXioF2pd.js +0 -1
  231. package/dist/assets/midjourney-BertSXin.js +0 -1
  232. package/dist/assets/midjourney-C9mIk6WS.js +0 -1
  233. package/dist/assets/midjourney-CD2E4s8K.js +0 -1
  234. package/dist/assets/midjourney-CJ_sZW8R.js +0 -1
  235. package/dist/assets/midjourney-CTHpnRlb.js +0 -1
  236. package/dist/assets/midjourney-CZZTzaNU.js +0 -1
  237. package/dist/assets/midjourney-CZybL7nq.js +0 -1
  238. package/dist/assets/midjourney-D0jbNv1J.js +0 -1
  239. package/dist/assets/midjourney-D7EOsHLu.js +0 -1
  240. package/dist/assets/midjourney-H5Wuq1-p.js +0 -1
  241. package/dist/assets/midjourney-HSS4vV-y.js +0 -1
  242. package/dist/assets/midjourney-NmlOsMCS.js +0 -1
  243. package/dist/assets/order-2938TXeL.js +0 -1
  244. package/dist/assets/order-7yDEF-wE.js +0 -1
  245. package/dist/assets/order-BDWVwDAn.js +0 -1
  246. package/dist/assets/order-BIslMDZP.js +0 -1
  247. package/dist/assets/order-Bqc53rmv.js +0 -1
  248. package/dist/assets/order-CESPqprA.js +0 -1
  249. package/dist/assets/order-CH4FTZdz.js +0 -1
  250. package/dist/assets/order-CL6RqSCE.js +0 -1
  251. package/dist/assets/order-C_9poK2b.js +0 -1
  252. package/dist/assets/order-CfKXYzuo.js +0 -1
  253. package/dist/assets/order-CjpgvCGB.js +0 -1
  254. package/dist/assets/order-Cx9acmu9.js +0 -1
  255. package/dist/assets/order-DQmJSByk.js +0 -1
  256. package/dist/assets/order-DdMK7tK_.js +0 -1
  257. package/dist/assets/order-DqKzccXP.js +0 -1
  258. package/dist/assets/order-DxbjGnCv.js +0 -1
  259. package/dist/assets/order-yEiwj_v2.js +0 -1
  260. package/dist/assets/seedance-ClhqHARJ.js +0 -1
  261. package/dist/assets/seedance-DNyJQURN.js +0 -1
  262. package/dist/assets/seedance-RKVqYt_e.js +0 -1
  263. package/dist/assets/seedance-fVb-ffa9.js +0 -1
  264. package/dist/assets/seedance-wjrAwBhs.js +0 -1
  265. package/dist/assets/suno-2kZeX0SQ.js +0 -7
  266. package/dist/assets/suno-B5c1_QMK.js +0 -7
  267. package/dist/assets/suno-BCDSe33m.js +0 -7
  268. package/dist/assets/suno-BYLAqYbi.js +0 -7
  269. package/dist/assets/suno-CW7PL610.js +0 -7
  270. package/dist/assets/suno-D9sWL4Gy.js +0 -7
  271. package/dist/assets/suno-NFdoRO-U.js +0 -7
  272. package/dist/assets/suno-PaSB1jMT.js +0 -7
  273. package/dist/assets/suno-aZGZNio8.js +0 -7
  274. package/dist/assets/suno-gAW2-3QC.js +0 -7
  275. package/dist/assets/suno-ql0IUND1.js +0 -7
  276. package/dist/assets/suno-xyIB74FR.js +0 -7
@@ -1 +1 @@
1
- import{C as I}from"./CopyToClipboard-BXZ_JLam.js";import{ap as T,b5 as E,b6 as F,b7 as N,_ as P}from"./index-DmLTLHg-.js";import{d as O,a as $,s as B}from"./distribution-Bt870ZcO.js";import{g as q}from"./price-ClaXuKyA.js";import{F as M}from"./index.es-C57T75UL.js";import{K as R,x as z,y as U,p as V,w as A,o as G,l as H,z as Q,A as K,T as J}from"./vendor-element-plus-B4FTqxj4.js";import{d as W,J as r,K as o,T as i,ai as l,G as e,R as s,C as p,Q as _,O as k,D as n}from"./vendor-vue-1w_NBnjl.js";import"./vendor-web3-CtYWvkaI.js";import"./vendor-dayjs-CzbnksQQ.js";import"./vendor-axios-NIGUFBhG.js";import"./vendor-vue-router-Dj5bcX0v.js";const Y=W({name:"ConsoleDistributionList",components:{CopyToClipboard:I,FontAwesomeIcon:M,QrCode:T,ElProgress:J,ElRow:K,ElCol:Q,ElButton:H,ElDivider:G,ElCard:A,ElTooltip:V,ElTable:U,ElTableColumn:z,ElSkeleton:R},data(){return{invitees:[],inviteesCount:void 0,distributionLevels:[],distributionLink:void 0,distributionStatus:void 0,loading:!1}},computed:{redirect(){return this.$route.query.redirect},page(){return parseInt(this.$route.query.page?.toString()||"1")},qrColor(){const t=document.documentElement.classList.contains("dark");return{dark:t?"#ffffff":"#000000",light:t?"#1e1e1e":"#ffffff"}},distributionLevelMap(){let t={};return this.distributionLevels.forEach(a=>{t[a.level]=a}),t}},watch:{page:{handler(){this.onFetchData()}}},async mounted(){this.onFetchData(),this.onGenerateDistributionLink()},methods:{getPriceString:q,goHistory(){this.$router.push({name:N})},goInvitees(){this.$router.push({name:F})},onPageChange(t){this.$router.push({name:this.$route.name?.toString(),query:{page:t}})},getPercentageForNextLevel(){const t=this.distributionLevelMap[this.distributionStatus?.level?.level]?.threshold,a=this.distributionLevelMap[this.distributionStatus?.level?.level+1]?.threshold;return Math.floor((this.distributionStatus?.price-t)/(a-t)*100)},getDeltaForNextLevel(){const t=this.distributionLevelMap[this.distributionStatus?.level?.level+1]?.threshold;return Math.floor(t-this.distributionStatus?.price)},async onFetchData(){this.loading=!0,await $.initialize(),Promise.all([this.onFetchDistributionStatus(),this.onFetchDistributionLevels(),this.onFetchInvitees()]).finally(()=>{this.loading=!1})},async onGenerateDistributionLink(){const a=`${window.location.origin}?inviter_id=${this.$store.getters.user.id}`;try{const v=(await B.create(a))?.data?.data?.url;this.distributionLink=(v||a).replace("surl.id","share.acedata.cloud")}catch{this.distributionLink=a}},async onFetchDistributionStatus(){const{data:t}=await $.getAll({user_id:this.$store.getters.user.id});t.items&&t.items.length>0&&(this.distributionStatus=t.items[0])},async onFetchDistributionLevels(){const{data:t}=await O.getAll({limit:20,user_id:this.$store.getters.user.id});this.distributionLevels=t.items},async onFetchInvitees(){const{data:t}=await E.getInvitees({});this.invitees=t.items,this.inviteesCount=t.count}}}),j={class:"title"},X={key:1},Z={class:"icon-wrapper"},x={class:"text-left"},tt={class:"description"},et={class:"value"},it={key:1},st={class:"icon-wrapper"},ot={class:"text-left"},nt={class:"description"},lt={class:"value"},at={key:1},rt={class:"icon-wrapper"},dt={class:"text-left"},ct={class:"description"},ut={class:"value"},pt={key:1},ht={class:"icon-wrapper"},_t={class:"text-left"},mt={class:"description"},bt={class:"value"},vt={key:1},ft={class:"title"},gt={class:"clear-both overflow-hidden"},kt={class:"float-left description"},wt={class:"float-right description"},yt={class:"description"},$t={class:"level"},Lt={class:"level"},St={class:"level"},Ct={key:1},Dt={class:"title"},It={class:"link-wrapper text-center"},Tt=["href"],Et={class:"qr-wrapper ml-auto mr-auto"},Ft={class:"mt-0"},Nt={class:"description"},Pt={class:"more"};function Ot(t,a,v,Bt,qt,Mt){const d=l("el-col"),m=l("el-row"),c=l("el-skeleton"),b=l("font-awesome-icon"),f=l("el-button"),u=l("el-card"),w=l("el-tooltip"),L=l("el-progress"),y=l("el-divider"),g=l("el-table-column"),S=l("el-table"),C=l("copy-to-clipboard"),D=l("qr-code");return n(),r(m,{class:"panel"},{default:o(()=>[i(d,{span:24},{default:o(()=>[i(m,null,{default:o(()=>[i(d,{span:24},{default:o(()=>[e("h2",j,s(t.$t("common.title.distribution")),1)]),_:1})]),_:1}),i(m,{gutter:15},{default:o(()=>[i(d,{md:6,xs:24},{default:o(()=>[i(u,{shadow:"hover",class:"item-mini mb-4"},{default:o(()=>[t.loading?(n(),r(c,{key:0})):(n(),p("div",X,[e("div",Z,[i(b,{icon:"fa-solid fa-wallet",class:"icon"})]),e("div",x,[e("p",tt,s(t.$t("distribution.title.price")),1),e("p",et,s(t.getPriceString({value:t.distributionStatus?.price})),1)]),i(f,{type:"primary",round:"",size:"small",class:"btn",onClick:t.goHistory},{default:o(()=>[_(s(t.$t("distribution.button.detail")),1)]),_:1},8,["onClick"])]))]),_:1})]),_:1}),i(d,{md:6,xs:24},{default:o(()=>[i(u,{shadow:"hover",class:"item-mini mb-4"},{default:o(()=>[t.loading?(n(),r(c,{key:0})):(n(),p("div",it,[e("div",st,[i(b,{icon:"fa-solid fa-coins",class:"icon"})]),e("div",ot,[e("p",nt,s(t.$t("distribution.title.reward")),1),e("p",lt,s(t.getPriceString({value:t.distributionStatus?.reward})),1)]),i(w,{effect:"dark",content:t.$t("distribution.message.developingWithDrawal"),placement:"top"},{default:o(()=>[i(f,{type:"primary",round:"",size:"small",class:"btn"},{default:o(()=>[_(s(t.$t("distribution.button.withdrawal")),1)]),_:1})]),_:1},8,["content"])]))]),_:1})]),_:1}),i(d,{md:6,xs:24},{default:o(()=>[i(u,{shadow:"hover",class:"item-mini mb-4"},{default:o(()=>[t.loading?(n(),r(c,{key:0})):(n(),p("div",at,[e("div",rt,[i(b,{icon:"fa-solid fa-percent",class:"icon"})]),e("div",dt,[e("p",ct,s(t.$t("distribution.title.percentage")),1),e("p",ut,s(t.distributionStatus?.level?.percentage)+"%",1)])]))]),_:1})]),_:1}),i(d,{md:6,xs:24},{default:o(()=>[i(u,{shadow:"hover",class:"item-mini mb-4"},{default:o(()=>[t.loading?(n(),r(c,{key:0})):(n(),p("div",pt,[e("div",ht,[i(b,{icon:"fa-regular fa-user",class:"icon"})]),e("div",_t,[e("p",mt,s(t.$t("distribution.title.inviteesCount")),1),e("p",bt,s(t.inviteesCount),1)]),i(f,{type:"primary",round:"",size:"small",class:"btn",onClick:t.goInvitees},{default:o(()=>[_(s(t.$t("distribution.button.detail")),1)]),_:1},8,["onClick"])]))]),_:1})]),_:1})]),_:1}),i(m,{gutter:15},{default:o(()=>[i(d,{md:12,xs:24},{default:o(()=>[i(u,{shadow:"hover",class:"level-info mb-4"},{default:o(()=>[t.loading?(n(),r(c,{key:0})):(n(),p("div",vt,[e("h4",ft,s(t.$t("distribution.title.levelInfo")),1),e("div",gt,[e("div",kt,[e("p",null,s(t.$t("distribution.title.currentLevel"))+": L"+s(t.distributionStatus?.level?.level),1),e("p",null,s(t.$t("distribution.title.currentPercentage"))+": "+s(t.distributionLevelMap[t.distributionStatus?.level?.level]?.percentage)+"% ",1)]),e("div",wt,[e("p",null,s(t.$t("distribution.title.nextLevel"))+": L"+s(t.distributionStatus?.level?.level+1),1),e("p",null,s(t.$t("distribution.title.nextPercentage"))+": "+s(t.distributionLevelMap[t.distributionStatus?.level?.level+1]?.percentage)+"% ",1)])]),i(L,{"text-inside":!0,"stroke-width":20,percentage:t.getPercentageForNextLevel(),class:"mb-2"},null,8,["percentage"]),e("p",yt,s(t.$t("distribution.message.deltaPriceForNextLevel"))+": $"+s(t.getDeltaForNextLevel()),1),i(y),t.distributionLevels?(n(),r(S,{key:0,data:t.distributionLevels,stripe:""},{default:o(()=>[i(g,{label:t.$t("distribution.field.level")},{default:o(h=>[e("span",$t,"L"+s(h.row?.level),1)]),_:1},8,["label"]),i(g,{label:t.$t("distribution.field.threshold")},{default:o(h=>[e("span",Lt,"$"+s(h.row?.threshold),1)]),_:1},8,["label"]),i(g,{label:t.$t("distribution.field.percentage")},{default:o(h=>[e("span",St,s(h.row?.percentage)+"%",1)]),_:1},8,["label"])]),_:1},8,["data"])):k("",!0)]))]),_:1})]),_:1}),i(d,{md:12,xs:24},{default:o(()=>[i(u,{shadow:"hover",class:"distribution-info mb-4"},{default:o(()=>[t.loading?(n(),r(c,{key:0})):(n(),p("div",Ct,[e("h4",Dt,s(t.$t("distribution.title.distributionLink")),1),i(y),e("div",It,[k("",!0),e("a",{href:t.distributionLink,class:"link"},s(t.distributionLink),9,Tt),i(C,{content:t.distributionLink},null,8,["content"])]),e("div",Et,[t.distributionLink?(n(),r(D,{key:0,value:t.distributionLink,size:180,margin:2,class:"block mb-2 ml-auto mr-auto",type:"image/png",color:t.qrColor},null,8,["value","color"])):k("",!0),e("p",Ft,s(t.$t("distribution.message.distributionQrDescription")),1)]),e("p",Nt,[_(s(t.$t("distribution.message.distributionLinkDescription"))+" ",1),e("span",Pt,[i(w,{effect:"dark",content:t.$t("distribution.message.distributionLinkDescription2"),placement:"top"},{default:o(()=>[_(s(t.$t("distribution.message.technicalDetail")),1)]),_:1},8,["content"])])])]))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}const Yt=P(Y,[["render",Ot],["__scopeId","data-v-1ca0740d"]]);export{Yt as default};
1
+ import{C as I}from"./CopyToClipboard-jWxr3xe-.js";import{ap as T,b5 as E,b6 as F,b7 as N,_ as P}from"./index-CqL6zWO4.js";import{d as O,a as $,s as B}from"./distribution-CIiS3Bxb.js";import{g as q}from"./price-C8BXaFbS.js";import{F as M}from"./index.es-vNwt4sbI.js";import{K as R,x as z,y as U,p as V,w as A,o as G,l as H,z as Q,A as K,T as J}from"./vendor-element-plus-B4FTqxj4.js";import{d as W,J as r,K as o,T as i,ai as l,G as e,R as s,C as p,Q as _,O as k,D as n}from"./vendor-vue-1w_NBnjl.js";import"./vendor-web3-BT8AOwfJ.js";import"./vendor-dayjs-CzbnksQQ.js";import"./vendor-axios-NIGUFBhG.js";import"./vendor-vue-router-Dj5bcX0v.js";const Y=W({name:"ConsoleDistributionList",components:{CopyToClipboard:I,FontAwesomeIcon:M,QrCode:T,ElProgress:J,ElRow:K,ElCol:Q,ElButton:H,ElDivider:G,ElCard:A,ElTooltip:V,ElTable:U,ElTableColumn:z,ElSkeleton:R},data(){return{invitees:[],inviteesCount:void 0,distributionLevels:[],distributionLink:void 0,distributionStatus:void 0,loading:!1}},computed:{redirect(){return this.$route.query.redirect},page(){return parseInt(this.$route.query.page?.toString()||"1")},qrColor(){const t=document.documentElement.classList.contains("dark");return{dark:t?"#ffffff":"#000000",light:t?"#1e1e1e":"#ffffff"}},distributionLevelMap(){let t={};return this.distributionLevels.forEach(a=>{t[a.level]=a}),t}},watch:{page:{handler(){this.onFetchData()}}},async mounted(){this.onFetchData(),this.onGenerateDistributionLink()},methods:{getPriceString:q,goHistory(){this.$router.push({name:N})},goInvitees(){this.$router.push({name:F})},onPageChange(t){this.$router.push({name:this.$route.name?.toString(),query:{page:t}})},getPercentageForNextLevel(){const t=this.distributionLevelMap[this.distributionStatus?.level?.level]?.threshold,a=this.distributionLevelMap[this.distributionStatus?.level?.level+1]?.threshold;return Math.floor((this.distributionStatus?.price-t)/(a-t)*100)},getDeltaForNextLevel(){const t=this.distributionLevelMap[this.distributionStatus?.level?.level+1]?.threshold;return Math.floor(t-this.distributionStatus?.price)},async onFetchData(){this.loading=!0,await $.initialize(),Promise.all([this.onFetchDistributionStatus(),this.onFetchDistributionLevels(),this.onFetchInvitees()]).finally(()=>{this.loading=!1})},async onGenerateDistributionLink(){const a=`${window.location.origin}?inviter_id=${this.$store.getters.user.id}`;try{const v=(await B.create(a))?.data?.data?.url;this.distributionLink=(v||a).replace("surl.id","share.acedata.cloud")}catch{this.distributionLink=a}},async onFetchDistributionStatus(){const{data:t}=await $.getAll({user_id:this.$store.getters.user.id});t.items&&t.items.length>0&&(this.distributionStatus=t.items[0])},async onFetchDistributionLevels(){const{data:t}=await O.getAll({limit:20,user_id:this.$store.getters.user.id});this.distributionLevels=t.items},async onFetchInvitees(){const{data:t}=await E.getInvitees({});this.invitees=t.items,this.inviteesCount=t.count}}}),j={class:"title"},X={key:1},Z={class:"icon-wrapper"},x={class:"text-left"},tt={class:"description"},et={class:"value"},it={key:1},st={class:"icon-wrapper"},ot={class:"text-left"},nt={class:"description"},lt={class:"value"},at={key:1},rt={class:"icon-wrapper"},dt={class:"text-left"},ct={class:"description"},ut={class:"value"},pt={key:1},ht={class:"icon-wrapper"},_t={class:"text-left"},mt={class:"description"},bt={class:"value"},vt={key:1},ft={class:"title"},gt={class:"clear-both overflow-hidden"},kt={class:"float-left description"},wt={class:"float-right description"},yt={class:"description"},$t={class:"level"},Lt={class:"level"},St={class:"level"},Ct={key:1},Dt={class:"title"},It={class:"link-wrapper text-center"},Tt=["href"],Et={class:"qr-wrapper ml-auto mr-auto"},Ft={class:"mt-0"},Nt={class:"description"},Pt={class:"more"};function Ot(t,a,v,Bt,qt,Mt){const d=l("el-col"),m=l("el-row"),c=l("el-skeleton"),b=l("font-awesome-icon"),f=l("el-button"),u=l("el-card"),w=l("el-tooltip"),L=l("el-progress"),y=l("el-divider"),g=l("el-table-column"),S=l("el-table"),C=l("copy-to-clipboard"),D=l("qr-code");return n(),r(m,{class:"panel"},{default:o(()=>[i(d,{span:24},{default:o(()=>[i(m,null,{default:o(()=>[i(d,{span:24},{default:o(()=>[e("h2",j,s(t.$t("common.title.distribution")),1)]),_:1})]),_:1}),i(m,{gutter:15},{default:o(()=>[i(d,{md:6,xs:24},{default:o(()=>[i(u,{shadow:"hover",class:"item-mini mb-4"},{default:o(()=>[t.loading?(n(),r(c,{key:0})):(n(),p("div",X,[e("div",Z,[i(b,{icon:"fa-solid fa-wallet",class:"icon"})]),e("div",x,[e("p",tt,s(t.$t("distribution.title.price")),1),e("p",et,s(t.getPriceString({value:t.distributionStatus?.price})),1)]),i(f,{type:"primary",round:"",size:"small",class:"btn",onClick:t.goHistory},{default:o(()=>[_(s(t.$t("distribution.button.detail")),1)]),_:1},8,["onClick"])]))]),_:1})]),_:1}),i(d,{md:6,xs:24},{default:o(()=>[i(u,{shadow:"hover",class:"item-mini mb-4"},{default:o(()=>[t.loading?(n(),r(c,{key:0})):(n(),p("div",it,[e("div",st,[i(b,{icon:"fa-solid fa-coins",class:"icon"})]),e("div",ot,[e("p",nt,s(t.$t("distribution.title.reward")),1),e("p",lt,s(t.getPriceString({value:t.distributionStatus?.reward})),1)]),i(w,{effect:"dark",content:t.$t("distribution.message.developingWithDrawal"),placement:"top"},{default:o(()=>[i(f,{type:"primary",round:"",size:"small",class:"btn"},{default:o(()=>[_(s(t.$t("distribution.button.withdrawal")),1)]),_:1})]),_:1},8,["content"])]))]),_:1})]),_:1}),i(d,{md:6,xs:24},{default:o(()=>[i(u,{shadow:"hover",class:"item-mini mb-4"},{default:o(()=>[t.loading?(n(),r(c,{key:0})):(n(),p("div",at,[e("div",rt,[i(b,{icon:"fa-solid fa-percent",class:"icon"})]),e("div",dt,[e("p",ct,s(t.$t("distribution.title.percentage")),1),e("p",ut,s(t.distributionStatus?.level?.percentage)+"%",1)])]))]),_:1})]),_:1}),i(d,{md:6,xs:24},{default:o(()=>[i(u,{shadow:"hover",class:"item-mini mb-4"},{default:o(()=>[t.loading?(n(),r(c,{key:0})):(n(),p("div",pt,[e("div",ht,[i(b,{icon:"fa-regular fa-user",class:"icon"})]),e("div",_t,[e("p",mt,s(t.$t("distribution.title.inviteesCount")),1),e("p",bt,s(t.inviteesCount),1)]),i(f,{type:"primary",round:"",size:"small",class:"btn",onClick:t.goInvitees},{default:o(()=>[_(s(t.$t("distribution.button.detail")),1)]),_:1},8,["onClick"])]))]),_:1})]),_:1})]),_:1}),i(m,{gutter:15},{default:o(()=>[i(d,{md:12,xs:24},{default:o(()=>[i(u,{shadow:"hover",class:"level-info mb-4"},{default:o(()=>[t.loading?(n(),r(c,{key:0})):(n(),p("div",vt,[e("h4",ft,s(t.$t("distribution.title.levelInfo")),1),e("div",gt,[e("div",kt,[e("p",null,s(t.$t("distribution.title.currentLevel"))+": L"+s(t.distributionStatus?.level?.level),1),e("p",null,s(t.$t("distribution.title.currentPercentage"))+": "+s(t.distributionLevelMap[t.distributionStatus?.level?.level]?.percentage)+"% ",1)]),e("div",wt,[e("p",null,s(t.$t("distribution.title.nextLevel"))+": L"+s(t.distributionStatus?.level?.level+1),1),e("p",null,s(t.$t("distribution.title.nextPercentage"))+": "+s(t.distributionLevelMap[t.distributionStatus?.level?.level+1]?.percentage)+"% ",1)])]),i(L,{"text-inside":!0,"stroke-width":20,percentage:t.getPercentageForNextLevel(),class:"mb-2"},null,8,["percentage"]),e("p",yt,s(t.$t("distribution.message.deltaPriceForNextLevel"))+": $"+s(t.getDeltaForNextLevel()),1),i(y),t.distributionLevels?(n(),r(S,{key:0,data:t.distributionLevels,stripe:""},{default:o(()=>[i(g,{label:t.$t("distribution.field.level")},{default:o(h=>[e("span",$t,"L"+s(h.row?.level),1)]),_:1},8,["label"]),i(g,{label:t.$t("distribution.field.threshold")},{default:o(h=>[e("span",Lt,"$"+s(h.row?.threshold),1)]),_:1},8,["label"]),i(g,{label:t.$t("distribution.field.percentage")},{default:o(h=>[e("span",St,s(h.row?.percentage)+"%",1)]),_:1},8,["label"])]),_:1},8,["data"])):k("",!0)]))]),_:1})]),_:1}),i(d,{md:12,xs:24},{default:o(()=>[i(u,{shadow:"hover",class:"distribution-info mb-4"},{default:o(()=>[t.loading?(n(),r(c,{key:0})):(n(),p("div",Ct,[e("h4",Dt,s(t.$t("distribution.title.distributionLink")),1),i(y),e("div",It,[k("",!0),e("a",{href:t.distributionLink,class:"link"},s(t.distributionLink),9,Tt),i(C,{content:t.distributionLink},null,8,["content"])]),e("div",Et,[t.distributionLink?(n(),r(D,{key:0,value:t.distributionLink,size:180,margin:2,class:"block mb-2 ml-auto mr-auto",type:"image/png",color:t.qrColor},null,8,["value","color"])):k("",!0),e("p",Ft,s(t.$t("distribution.message.distributionQrDescription")),1)]),e("p",Nt,[_(s(t.$t("distribution.message.distributionLinkDescription"))+" ",1),e("span",Pt,[i(w,{effect:"dark",content:t.$t("distribution.message.distributionLinkDescription2"),placement:"top"},{default:o(()=>[_(s(t.$t("distribution.message.technicalDetail")),1)]),_:1},8,["content"])])])]))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}const Yt=P(Y,[["render",Ot],["__scopeId","data-v-1ca0740d"]]);export{Yt as default};
@@ -1 +1 @@
1
- import{F as L}from"./index.es-C57T75UL.js";import{l as D,S as F,N as C,O as R,t as q,u as T,s as K,p as J,G as Q,j as W}from"./vendor-element-plus-B4FTqxj4.js";import{d as b,C as i,G as r,T as o,E as U,K as u,ai as s,D as n,R as l,S as V,ag as A,J as y,M as I,Y,Q as h,O as $,L as Z,U as H}from"./vendor-vue-1w_NBnjl.js";import{_ as k,bI as P,bJ as M,bK as S,bL as z,bM as X,bN as x,bO as ee,bP as te,aj as oe,bQ as se,bR as ae,aB as ne,ay as G}from"./index-DmLTLHg-.js";import{I as j,S as le}from"./ScrollList-2fA4pSP6.js";import{I as re}from"./ImagePreview-VkiDVAyi.js";import{C as ie,N as ce}from"./NoTasks-C89T1fZz.js";import{a as de}from"./price-ClaXuKyA.js";import{C as ue}from"./CopyToClipboard-BXZ_JLam.js";import{V as pe}from"./VideoPlayer-BgmN-u33.js";import{B as me}from"./BotPlaceholder-ClkF4VzC.js";import{l as fe}from"./pagination-CihAE3FS.js";import"./vendor-dayjs-CzbnksQQ.js";import"./vendor-web3-CtYWvkaI.js";import"./vendor-axios-NIGUFBhG.js";import"./vendor-vue-router-Dj5bcX0v.js";import"./vue-plyr-QZFBikSk.js";const _e=b({name:"LayoutSora",components:{ElDrawer:F,ElButton:D,FontAwesomeIcon:L},data(){return{drawer:!1}}}),he={class:"main flex flex-row flex-1"},$e={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},ge={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function ve(e,t,p,m,g,v){const c=s("font-awesome-icon"),d=s("el-button"),a=s("el-drawer");return n(),i("div",he,[r("div",$e,[U(e.$slots,"config",{},void 0,!0)]),r("div",ge,[U(e.$slots,"result",{},void 0,!0)]),o(d,{circle:"",class:"menu",onClick:t[0]||(t[0]=w=>e.drawer=!0)},{default:u(()=>[o(c,{icon:"fa-solid fa-magic"})]),_:1}),o(a,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=w=>e.drawer=w),direction:"ltr","with-header":!1,size:"350px"},{default:u(()=>[U(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const be=k(_e,[["render",ve],["__scopeId","data-v-2dca3c13"]]),ke=b({name:"ModelSelector",components:{ElSelect:R,ElOption:C},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{options:[{value:X,label:"sora-2"},{value:x,label:"sora-2-pro"}]}},computed:{value:{get(){return this.$store.state.sora?.config?.model},set(e){const t=this.$store.state.sora?.config||{},p=M[e]||[S],m=t.duration,g=m&&p.includes(m)?m:p.includes(S)?S:p[0],v={...t,model:e,duration:g,size:t.size||z};this.$store.commit("sora/setConfig",v)}}},mounted(){this.value||(this.value=P)}}),we={class:"field"},ye={class:"title font-bold"};function Se(e,t,p,m,g,v){const c=s("el-option"),d=s("el-select");return n(),i("div",we,[r("h2",ye,l(e.$t("sora.name.model")),1),o(d,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=a=>e.value=a),class:"value",placeholder:e.$t("sora.placeholder.select")},{default:u(()=>[(n(!0),i(V,null,A(e.options,a=>(n(),y(c,{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Ve=k(ke,[["render",Se],["__scopeId","data-v-0cb7913d"]]),Ee=b({name:"ActionSelector",components:{ElSelect:R,ElOption:C},data(){return{}},computed:{options(){return[{value:"text2video",label:this.$t("sora.button.action1")},{value:"image2video",label:this.$t("sora.button.action2")}]},value:{get(){return this.$store.state.sora?.config?.action},set(e){this.$store.commit("sora/setConfig",{...this.$store.state.sora?.config,action:e})}}},mounted(){this.value||(this.value=ee)}}),Te={class:"field"},Ie={class:"title font-bold"},Ae={class:"float-left"};function Le(e,t,p,m,g,v){const c=s("el-option"),d=s("el-select");return n(),i("div",Te,[r("h2",Ie,l(e.$t("sora.name.action")),1),o(d,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=a=>e.value=a),class:"value",placeholder:e.$t("sora.placeholder.select"),clearable:""},{default:u(()=>[(n(!0),i(V,null,A(e.options,a=>(n(),y(c,{key:a.value,label:a.label,value:a.value},{default:u(()=>[r("span",Ae,l(a.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const De=k(Ee,[["render",Le],["__scopeId","data-v-7b82fa7f"]]),Ce=b({name:"DurationSelector",components:{ElSelect:R,ElOption:C},computed:{model(){return this.$store.state.sora?.config?.model||P},allowedDurations(){return M[this.model]||[S]},optionsForModel(){return this.allowedDurations.map(e=>({value:e,label:`${e}s`}))},value:{get(){return this.$store.state.sora?.config?.duration},set(e){const t=this.$store.state.sora?.config||{};this.$store.commit("sora/setConfig",{...t,duration:e})}}},watch:{allowedDurations(){const e=this.allowedDurations;if(!e.includes(this.value)){const t=e.includes(S)?S:e[0];this.value=t}}},mounted(){this.value||(this.value=S)}}),Re={class:"field"},Oe={class:"control"},Ue={class:"title font-bold"};function Ge(e,t,p,m,g,v){const c=s("el-option"),d=s("el-select");return n(),i("div",Re,[r("div",Oe,[r("h2",Ue,l(e.$t("sora.name.duration")),1),o(d,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=a=>e.value=a),class:"value",placeholder:e.$t("sora.placeholder.select")},{default:u(()=>[(n(!0),i(V,null,A(e.optionsForModel,a=>(n(),y(c,{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])])}const Pe=k(Ce,[["render",Ge],["__scopeId","data-v-c2934598"]]),Me=b({name:"OrientationSelector",data(){return{options:[{value:"portrait",labelKey:"sora.option.portrait",width:13,height:25},{value:"landscape",labelKey:"sora.option.landscape",width:25,height:13}]}},computed:{active(){const e=this.options.findIndex(t=>t.value===this.value);return e>=0?e:0},value:{get(){return this.$store.state.sora?.config?.orientation},set(e){console.debug("set orientation",e),this.$store.commit("sora/setConfig",{...this.$store.state?.sora?.config,orientation:e})}}},mounted(){this.value||(this.value=te)}}),ze={class:"text-sm font-bold mb-2 block"},je={class:"items"},Be=["onClick"],Ne={class:"name"};function Fe(e,t,p,m,g,v){return n(),i("div",null,[r("span",ze,l(e.$t("sora.name.orientation")),1),r("div",je,[(n(!0),i(V,null,A(e.options,(c,d)=>(n(),i("div",{key:d,class:I({active:e.active===d,item:!0}),onClick:a=>e.value=c.value},[r("div",{class:I(["preview",c.value])},[r("div",{class:"rect",style:Y({width:c.width+"px",height:c.height+"px"})},null,4)],2),r("p",Ne,l(e.$t(c.labelKey)),1)],10,Be))),128))])])}const qe=k(Me,[["render",Fe],["__scopeId","data-v-e791975f"]]),Ke=b({name:"StartEndImage",components:{ElUpload:q,ElButton:D,InfoIcon:j,FontAwesomeIcon:L,ImagePreview:re},emits:["change"],data(){return{fileList:[],uploadUrl:oe()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.sora?.config?.image_urls},set(){}}},mounted(){this.value||(this.value=void 0),this.onSetStartEndImageUrl()},methods:{onExceed(){T.warning(this.$t("sora.message.uploadReferencesExceed"))},onError(){T.error(this.$t("sora.message.uploadReferencesError"))},onSetStartEndImageUrl(){const e=this.urls;this.$store.commit("sora/setConfig",{...this.$store.state?.sora?.config,image_urls:e})},async onSuccess(){this.onSetStartEndImageUrl()}}}),Je={class:"relative"},Qe={class:"flex justify-between"},We={class:"flex justify-start items-center"},Ye={class:"text-sm font-bold"};function Ze(e,t,p,m,g,v){const c=s("info-icon"),d=s("image-preview"),a=s("font-awesome-icon"),w=s("el-button"),_=s("el-upload");return n(),i("div",Je,[r("div",Qe,[r("div",We,[r("span",Ye,l(e.$t("sora.name.startEndImage")),1),o(c,{content:e.$t("sora.description.uploadStartEndImage")},null,8,["content"])])]),o(_,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=f=>e.fileList=f),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:2,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:u(({file:f})=>[f.url&&f.percentage!==void 0?(n(),y(d,{key:0,url:f.url,name:f.name,percentage:f.percentage,onRemove:E=>e.fileList.splice(e.fileList.indexOf(f),1)},null,8,["url","name","percentage","onRemove"])):$("",!0)]),default:u(()=>[o(w,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:u(()=>[o(a,{icon:"fa-solid fa-upload",class:"icon mr-1"}),h(" "+l(e.$t("sora.button.uploadReferences")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const He=k(Ke,[["render",Ze],["__scopeId","data-v-fd6e5c97"]]),Xe=e=>e&&e.charAt(0).toUpperCase()+e.slice(1),xe=b({name:"SizeSelector",components:{ElSelect:R,ElOption:C},data(){return{options:se.map(e=>({value:e,label:Xe(e)}))}},computed:{value:{get(){return this.$store.state.sora?.config?.size},set(e){const t=this.$store.state.sora?.config||{};this.$store.commit("sora/setConfig",{...t,size:e})}}},mounted(){this.value||(this.value=z)}}),et={class:"field"},tt={class:"control"},ot={class:"title font-bold"};function st(e,t,p,m,g,v){const c=s("el-option"),d=s("el-select");return n(),i("div",et,[r("div",tt,[r("h2",ot,l(e.$t("sora.name.size")),1),o(d,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=a=>e.value=a),class:"value",placeholder:e.$t("sora.placeholder.select")},{default:u(()=>[(n(!0),i(V,null,A(e.options,a=>(n(),y(c,{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])])}const at=k(xe,[["render",st],["__scopeId","data-v-8c485f0f"]]),nt="",lt=b({name:"PromptInput",components:{ElInput:K,InfoIcon:j},computed:{prompt:{get(){return this.$store.state.sora?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("sora/setConfig",{...this.$store.state.sora?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=nt)}}),rt={class:"field"},it={class:"box"},ct={class:"title font-bold"};function dt(e,t,p,m,g,v){const c=s("info-icon"),d=s("el-input");return n(),i("div",rt,[r("div",it,[r("h2",ct,l(e.$t("sora.name.prompt")),1),o(c,{content:e.$t("sora.description.prompt"),class:"info"},null,8,["content"])]),o(d,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=a=>e.prompt=a),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("sora.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const ut=k(lt,[["render",dt],["__scopeId","data-v-a57633d5"]]),pt=b({name:"ConfigPanel",components:{ElButton:D,Consumption:ie,FontAwesomeIcon:L,PromptInput:ut,ModelSelector:Ve,StartEndImage:He,SizeSelector:at,ActionSelector:De,OrientationSelector:qe,DurationSelector:Pe},emits:["generate"],computed:{config(){return this.$store.state.sora?.config},consumption(){return de(this.config,this.service?.cost)},service(){return this.$store.state.sora?.service}},methods:{onGenerate(){this.$emit("generate")}}}),mt={class:"flex flex-col h-full"},ft={class:"flex-1 overflow-y-auto p-5"},_t={class:"flex flex-col items-center justify-center px-5 pb-5"};function ht(e,t,p,m,g,v){const c=s("model-selector"),d=s("action-selector"),a=s("duration-selector"),w=s("size-selector"),_=s("orientation-selector"),f=s("prompt-input"),E=s("start-end-image"),O=s("consumption"),B=s("font-awesome-icon"),N=s("el-button");return n(),i("div",mt,[r("div",ft,[o(c,{class:"mb-4"}),o(d,{class:"mb-4"}),o(a,{class:"mb-4"}),o(w,{class:"mb-4"}),o(_,{class:"mb-4"}),o(f,{class:"mb-4"}),Z(o(E,{class:"mb-2"},null,512),[[H,e.config?.action==="image2video"]])]),r("div",_t,[o(O,{value:e.consumption,service:e.service},null,8,["value","service"]),o(N,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:u(()=>[o(B,{icon:"fa-solid fa-magic",class:"mr-2"}),h(" "+l(e.$t("sora.button.generate")),1)]),_:1},8,["onClick"])])])}const $t=k(pt,[["render",ht]]),gt=b({name:"TaskPreview",components:{ElImage:W,CopyToClipboard:ue,FontAwesomeIcon:L,ElAlert:Q,VideoPlayer:pe,ElTooltip:J,ElButton:D},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.sora?.application},config(){return this.$store.state.sora?.config}},methods:{onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onOpenVideo(e){window.open(e,"_blank")}}}),vt={class:"preview"},bt={class:"left"},kt={class:"main"},wt={class:"bot"},yt={class:"datetime"},St={class:"info"},Vt={key:0,class:"prompt mt-2"},Et={key:0},Tt={key:1},It={key:0,class:I({content:!0,failed:!0})},At={key:0,class:"mb-4"},Lt={key:1,class:I({operations:!0,"mt-2":!0})},Dt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ct={class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Rt={key:1,class:I({content:!0})},Ot={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ut={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Gt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Pt={key:2,class:I({content:!0})},Mt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},zt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function jt(e,t,p,m,g,v){const c=s("el-image"),d=s("video-player"),a=s("el-button"),w=s("el-tooltip"),_=s("font-awesome-icon"),f=s("copy-to-clipboard"),E=s("el-alert");return n(),i("div",vt,[r("div",bt,[o(c,{src:"https://cdn.acedata.cloud/z5id1u.png",class:"avatar"})]),r("div",kt,[r("div",wt,[h(l(e.$t("sora.name.soraBot"))+" ",1),r("span",yt,l(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),r("div",St,[e.modelValue?.request?.prompt?(n(),i("p",Vt,[h(l(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?$("",!0):(n(),i("span",Et," - ("+l(e.$t("sora.status.pending"))+") ",1)),Array.isArray(e.modelValue?.response?.data)&&e.modelValue?.response?.data[0]?.state==="pending"?(n(),i("span",Tt," - ("+l(e.$t("sora.status.processing"))+") ",1)):$("",!0)])):$("",!0)]),e.modelValue?.response?.success===!0&&e.modelValue?.response?.data?(n(),i("div",It,[e.modelValue?.response?.data[0]?.video_url?(n(),i("div",At,[o(d,{src:e.modelValue?.response?.data[0]?.video_url},null,8,["src"])])):$("",!0),e.modelValue?.response.success?(n(),i("div",Lt,[o(w,{class:"box-item",effect:"dark",content:e.$t("sora.message.downloadVideo"),placement:"top-start"},{default:u(()=>[e.modelValue?.response?.data[0]?.video_url?(n(),y(a,{key:0,type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=O=>e.onDownload(O,e.modelValue?.response?.data[0]?.video_url))},{default:u(()=>[h(l(e.$t("sora.button.download")),1)]),_:1})):$("",!0)]),_:1},8,["content"])])):$("",!0),o(E,{closable:!1,class:"mt-2 success"},{default:u(()=>[r("p",Dt,[o(_,{icon:"fa-solid fa-hashtag",class:"mr-1"}),h(" "+l(e.$t("sora.name.model"))+": "+l(e.modelValue?.request?.model),1)]),r("p",Ct,[o(_,{icon:"fa-solid fa-magic",class:"mr-1"}),h(" "+l(e.$t("sora.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),o(f,{content:e.modelValue?.id},null,8,["content"])])]),_:1})])):$("",!0),e.modelValue?.response?.success===!1?(n(),i("div",Rt,[o(E,{closable:!1,class:"failure"},{template:u(()=>[o(_,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),h(" "+l(e.$t("sora.name.failure")),1)]),default:u(()=>[r("p",Ot,[o(_,{icon:"fa-solid fa-magic",class:"mr-1"}),h(" "+l(e.$t("sora.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),o(f,{content:e.modelValue?.id},null,8,["content"])]),r("p",Ut,[o(_,{icon:"fa-solid fa-circle-info",class:"mr-1"}),h(" "+l(e.$t("sora.name.failureReason"))+": "+l(e.modelValue?.response?.error?.message)+" ",1),o(f,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.response?.trace_id?(n(),i("p",Gt,[o(_,{icon:"fa-solid fa-hashtag",class:"mr-1"}),h(" "+l(e.$t("sora.name.traceId"))+": "+l(e.modelValue?.response?.trace_id)+" ",1),o(f,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):$("",!0)]),_:1})])):$("",!0),e.modelValue?.response?.success===void 0?(n(),i("div",Pt,[o(E,{closable:!1,class:"info"},{template:u(()=>[o(_,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),h(" "+l(e.$t("sora.name.failure")),1)]),default:u(()=>[r("p",Mt,[o(_,{icon:"fa-solid fa-magic",class:"mr-1"}),h(" "+l(e.$t("sora.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),o(f,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.response?.trace_id?(n(),i("p",zt,[o(_,{icon:"fa-solid fa-hashtag",class:"mr-1"}),h(" "+l(e.$t("sora.name.traceId"))+": "+l(e.modelValue?.response?.trace_id)+" ",1),o(f,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):$("",!0)]),_:1})])):$("",!0)])])}const Bt=k(gt,[["render",jt],["__scopeId","data-v-424528ef"]]),Nt=b({name:"RecentPanel",components:{TaskPreview:Bt,NoTasks:ce,BotPlaceholder:me,ScrollList:le},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.sora?.tasks,items:this.$store.state.sora?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Ft={key:0},qt={key:2,class:"w-full h-full flex items-center justify-center"};function Kt(e,t,p,m,g,v){const c=s("bot-placeholder"),d=s("task-preview"),a=s("scroll-list"),w=s("no-tasks");return n(),i(V,null,[e.tasks?.items===void 0?(n(),i("div",Ft,[o(c)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(n(),y(a,{key:1,ref:"scrollList",class:"tasks h-full w-full overflow-y-auto",loading:e.loading,onReachTop:t[0]||(t[0]=_=>e.$emit("reach-top"))},{default:u(()=>[(n(!0),i(V,null,A(e.tasks?.items,(_,f)=>(n(),y(d,{key:f,"model-value":_},null,8,["model-value"]))),128))]),_:1},8,["loading"])):$("",!0),e.tasks?.items?.length===0?(n(),i("div",qt,[o(w)])):$("",!0)],64)}const Jt=k(Nt,[["render",Kt]]),Qt="https://webhook.acedata.cloud/sora",Wt=b({name:"SoraIndex",components:{ConfigPanel:$t,Layout:be,RecentPanel:Jt},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.sora?.status?.getApplications===G.Request},tasksLoading(){return this.$store.state.sora?.status?.getTasks===G.Request||this.fetchingTasks},credential(){return this.$store.state.sora.credential},config(){return this.$store.state.sora.config},tasks(){return this.$store.state.sora.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await fe({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("sora/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("sora/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:t=5,createdAtMin:p,createdAtMax:m}=e||{};console.debug("limit",t,"createdAtMin",p,"createdAtMax",m),this.fetchingTasks=!0;try{await this.$store.dispatch("sora/getTasks",{limit:t,createdAtMin:p,createdAtMax:m})}finally{this.fetchingTasks=!1}},async onGenerate(){const e={...this.config,callback_url:Qt},t=this.credential?.token;if(!t){console.error("no token specified");return}T.info(this.$t("sora.message.startingTask")),ae.generate(e,{token:t}).then(()=>{T.success(this.$t("sora.message.startTaskSuccess"))}).catch(p=>{p?.response?.data?.error?.code===ne?T.error(this.$t("sora.message.usedUp")):T.error(this.$t("sora.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Yt(e,t,p,m,g,v){const c=s("config-panel"),d=s("recent-panel"),a=s("layout");return n(),y(a,null,{config:u(()=>[o(c,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:u(()=>[o(d,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const fo=k(Wt,[["render",Yt]]);export{fo as default};
1
+ import{F as L}from"./index.es-vNwt4sbI.js";import{l as D,S as F,N as C,O as R,t as q,u as T,s as K,p as J,G as Q,j as W}from"./vendor-element-plus-B4FTqxj4.js";import{d as b,C as i,G as r,T as o,E as U,K as u,ai as s,D as n,R as l,S as V,ag as A,J as y,M as I,Y,Q as h,O as $,L as Z,U as H}from"./vendor-vue-1w_NBnjl.js";import{_ as k,bI as P,bJ as M,bK as S,bL as z,bM as X,bN as x,bO as ee,bP as te,aj as oe,bQ as se,bR as ae,aB as ne,ay as G}from"./index-CqL6zWO4.js";import{I as j,S as le}from"./ScrollList-BGZ0Fkh5.js";import{I as re}from"./ImagePreview-YbDjRoDP.js";import{C as ie,N as ce}from"./NoTasks-Dpxe4xfM.js";import{a as de}from"./price-C8BXaFbS.js";import{C as ue}from"./CopyToClipboard-jWxr3xe-.js";import{V as pe}from"./VideoPlayer-CfppHbtZ.js";import{B as me}from"./BotPlaceholder-4xqKcsb2.js";import{l as fe}from"./pagination-CihAE3FS.js";import"./vendor-dayjs-CzbnksQQ.js";import"./vendor-web3-BT8AOwfJ.js";import"./vendor-axios-NIGUFBhG.js";import"./vendor-vue-router-Dj5bcX0v.js";import"./vue-plyr-QZFBikSk.js";const _e=b({name:"LayoutSora",components:{ElDrawer:F,ElButton:D,FontAwesomeIcon:L},data(){return{drawer:!1}}}),he={class:"main flex flex-row flex-1"},$e={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},ge={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function ve(e,t,p,m,g,v){const c=s("font-awesome-icon"),d=s("el-button"),a=s("el-drawer");return n(),i("div",he,[r("div",$e,[U(e.$slots,"config",{},void 0,!0)]),r("div",ge,[U(e.$slots,"result",{},void 0,!0)]),o(d,{circle:"",class:"menu",onClick:t[0]||(t[0]=w=>e.drawer=!0)},{default:u(()=>[o(c,{icon:"fa-solid fa-magic"})]),_:1}),o(a,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=w=>e.drawer=w),direction:"ltr","with-header":!1,size:"350px"},{default:u(()=>[U(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const be=k(_e,[["render",ve],["__scopeId","data-v-2dca3c13"]]),ke=b({name:"ModelSelector",components:{ElSelect:R,ElOption:C},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{options:[{value:X,label:"sora-2"},{value:x,label:"sora-2-pro"}]}},computed:{value:{get(){return this.$store.state.sora?.config?.model},set(e){const t=this.$store.state.sora?.config||{},p=M[e]||[S],m=t.duration,g=m&&p.includes(m)?m:p.includes(S)?S:p[0],v={...t,model:e,duration:g,size:t.size||z};this.$store.commit("sora/setConfig",v)}}},mounted(){this.value||(this.value=P)}}),we={class:"field"},ye={class:"title font-bold"};function Se(e,t,p,m,g,v){const c=s("el-option"),d=s("el-select");return n(),i("div",we,[r("h2",ye,l(e.$t("sora.name.model")),1),o(d,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=a=>e.value=a),class:"value",placeholder:e.$t("sora.placeholder.select")},{default:u(()=>[(n(!0),i(V,null,A(e.options,a=>(n(),y(c,{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Ve=k(ke,[["render",Se],["__scopeId","data-v-0cb7913d"]]),Ee=b({name:"ActionSelector",components:{ElSelect:R,ElOption:C},data(){return{}},computed:{options(){return[{value:"text2video",label:this.$t("sora.button.action1")},{value:"image2video",label:this.$t("sora.button.action2")}]},value:{get(){return this.$store.state.sora?.config?.action},set(e){this.$store.commit("sora/setConfig",{...this.$store.state.sora?.config,action:e})}}},mounted(){this.value||(this.value=ee)}}),Te={class:"field"},Ie={class:"title font-bold"},Ae={class:"float-left"};function Le(e,t,p,m,g,v){const c=s("el-option"),d=s("el-select");return n(),i("div",Te,[r("h2",Ie,l(e.$t("sora.name.action")),1),o(d,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=a=>e.value=a),class:"value",placeholder:e.$t("sora.placeholder.select"),clearable:""},{default:u(()=>[(n(!0),i(V,null,A(e.options,a=>(n(),y(c,{key:a.value,label:a.label,value:a.value},{default:u(()=>[r("span",Ae,l(a.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const De=k(Ee,[["render",Le],["__scopeId","data-v-7b82fa7f"]]),Ce=b({name:"DurationSelector",components:{ElSelect:R,ElOption:C},computed:{model(){return this.$store.state.sora?.config?.model||P},allowedDurations(){return M[this.model]||[S]},optionsForModel(){return this.allowedDurations.map(e=>({value:e,label:`${e}s`}))},value:{get(){return this.$store.state.sora?.config?.duration},set(e){const t=this.$store.state.sora?.config||{};this.$store.commit("sora/setConfig",{...t,duration:e})}}},watch:{allowedDurations(){const e=this.allowedDurations;if(!e.includes(this.value)){const t=e.includes(S)?S:e[0];this.value=t}}},mounted(){this.value||(this.value=S)}}),Re={class:"field"},Oe={class:"control"},Ue={class:"title font-bold"};function Ge(e,t,p,m,g,v){const c=s("el-option"),d=s("el-select");return n(),i("div",Re,[r("div",Oe,[r("h2",Ue,l(e.$t("sora.name.duration")),1),o(d,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=a=>e.value=a),class:"value",placeholder:e.$t("sora.placeholder.select")},{default:u(()=>[(n(!0),i(V,null,A(e.optionsForModel,a=>(n(),y(c,{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])])}const Pe=k(Ce,[["render",Ge],["__scopeId","data-v-c2934598"]]),Me=b({name:"OrientationSelector",data(){return{options:[{value:"portrait",labelKey:"sora.option.portrait",width:13,height:25},{value:"landscape",labelKey:"sora.option.landscape",width:25,height:13}]}},computed:{active(){const e=this.options.findIndex(t=>t.value===this.value);return e>=0?e:0},value:{get(){return this.$store.state.sora?.config?.orientation},set(e){console.debug("set orientation",e),this.$store.commit("sora/setConfig",{...this.$store.state?.sora?.config,orientation:e})}}},mounted(){this.value||(this.value=te)}}),ze={class:"text-sm font-bold mb-2 block"},je={class:"items"},Be=["onClick"],Ne={class:"name"};function Fe(e,t,p,m,g,v){return n(),i("div",null,[r("span",ze,l(e.$t("sora.name.orientation")),1),r("div",je,[(n(!0),i(V,null,A(e.options,(c,d)=>(n(),i("div",{key:d,class:I({active:e.active===d,item:!0}),onClick:a=>e.value=c.value},[r("div",{class:I(["preview",c.value])},[r("div",{class:"rect",style:Y({width:c.width+"px",height:c.height+"px"})},null,4)],2),r("p",Ne,l(e.$t(c.labelKey)),1)],10,Be))),128))])])}const qe=k(Me,[["render",Fe],["__scopeId","data-v-e791975f"]]),Ke=b({name:"StartEndImage",components:{ElUpload:q,ElButton:D,InfoIcon:j,FontAwesomeIcon:L,ImagePreview:re},emits:["change"],data(){return{fileList:[],uploadUrl:oe()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.sora?.config?.image_urls},set(){}}},mounted(){this.value||(this.value=void 0),this.onSetStartEndImageUrl()},methods:{onExceed(){T.warning(this.$t("sora.message.uploadReferencesExceed"))},onError(){T.error(this.$t("sora.message.uploadReferencesError"))},onSetStartEndImageUrl(){const e=this.urls;this.$store.commit("sora/setConfig",{...this.$store.state?.sora?.config,image_urls:e})},async onSuccess(){this.onSetStartEndImageUrl()}}}),Je={class:"relative"},Qe={class:"flex justify-between"},We={class:"flex justify-start items-center"},Ye={class:"text-sm font-bold"};function Ze(e,t,p,m,g,v){const c=s("info-icon"),d=s("image-preview"),a=s("font-awesome-icon"),w=s("el-button"),_=s("el-upload");return n(),i("div",Je,[r("div",Qe,[r("div",We,[r("span",Ye,l(e.$t("sora.name.startEndImage")),1),o(c,{content:e.$t("sora.description.uploadStartEndImage")},null,8,["content"])])]),o(_,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=f=>e.fileList=f),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:2,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:u(({file:f})=>[f.url&&f.percentage!==void 0?(n(),y(d,{key:0,url:f.url,name:f.name,percentage:f.percentage,onRemove:E=>e.fileList.splice(e.fileList.indexOf(f),1)},null,8,["url","name","percentage","onRemove"])):$("",!0)]),default:u(()=>[o(w,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:u(()=>[o(a,{icon:"fa-solid fa-upload",class:"icon mr-1"}),h(" "+l(e.$t("sora.button.uploadReferences")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const He=k(Ke,[["render",Ze],["__scopeId","data-v-fd6e5c97"]]),Xe=e=>e&&e.charAt(0).toUpperCase()+e.slice(1),xe=b({name:"SizeSelector",components:{ElSelect:R,ElOption:C},data(){return{options:se.map(e=>({value:e,label:Xe(e)}))}},computed:{value:{get(){return this.$store.state.sora?.config?.size},set(e){const t=this.$store.state.sora?.config||{};this.$store.commit("sora/setConfig",{...t,size:e})}}},mounted(){this.value||(this.value=z)}}),et={class:"field"},tt={class:"control"},ot={class:"title font-bold"};function st(e,t,p,m,g,v){const c=s("el-option"),d=s("el-select");return n(),i("div",et,[r("div",tt,[r("h2",ot,l(e.$t("sora.name.size")),1),o(d,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=a=>e.value=a),class:"value",placeholder:e.$t("sora.placeholder.select")},{default:u(()=>[(n(!0),i(V,null,A(e.options,a=>(n(),y(c,{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])])}const at=k(xe,[["render",st],["__scopeId","data-v-8c485f0f"]]),nt="",lt=b({name:"PromptInput",components:{ElInput:K,InfoIcon:j},computed:{prompt:{get(){return this.$store.state.sora?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("sora/setConfig",{...this.$store.state.sora?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=nt)}}),rt={class:"field"},it={class:"box"},ct={class:"title font-bold"};function dt(e,t,p,m,g,v){const c=s("info-icon"),d=s("el-input");return n(),i("div",rt,[r("div",it,[r("h2",ct,l(e.$t("sora.name.prompt")),1),o(c,{content:e.$t("sora.description.prompt"),class:"info"},null,8,["content"])]),o(d,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=a=>e.prompt=a),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("sora.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const ut=k(lt,[["render",dt],["__scopeId","data-v-a57633d5"]]),pt=b({name:"ConfigPanel",components:{ElButton:D,Consumption:ie,FontAwesomeIcon:L,PromptInput:ut,ModelSelector:Ve,StartEndImage:He,SizeSelector:at,ActionSelector:De,OrientationSelector:qe,DurationSelector:Pe},emits:["generate"],computed:{config(){return this.$store.state.sora?.config},consumption(){return de(this.config,this.service?.cost)},service(){return this.$store.state.sora?.service}},methods:{onGenerate(){this.$emit("generate")}}}),mt={class:"flex flex-col h-full"},ft={class:"flex-1 overflow-y-auto p-5"},_t={class:"flex flex-col items-center justify-center px-5 pb-5"};function ht(e,t,p,m,g,v){const c=s("model-selector"),d=s("action-selector"),a=s("duration-selector"),w=s("size-selector"),_=s("orientation-selector"),f=s("prompt-input"),E=s("start-end-image"),O=s("consumption"),B=s("font-awesome-icon"),N=s("el-button");return n(),i("div",mt,[r("div",ft,[o(c,{class:"mb-4"}),o(d,{class:"mb-4"}),o(a,{class:"mb-4"}),o(w,{class:"mb-4"}),o(_,{class:"mb-4"}),o(f,{class:"mb-4"}),Z(o(E,{class:"mb-2"},null,512),[[H,e.config?.action==="image2video"]])]),r("div",_t,[o(O,{value:e.consumption,service:e.service},null,8,["value","service"]),o(N,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:u(()=>[o(B,{icon:"fa-solid fa-magic",class:"mr-2"}),h(" "+l(e.$t("sora.button.generate")),1)]),_:1},8,["onClick"])])])}const $t=k(pt,[["render",ht]]),gt=b({name:"TaskPreview",components:{ElImage:W,CopyToClipboard:ue,FontAwesomeIcon:L,ElAlert:Q,VideoPlayer:pe,ElTooltip:J,ElButton:D},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.sora?.application},config(){return this.$store.state.sora?.config}},methods:{onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onOpenVideo(e){window.open(e,"_blank")}}}),vt={class:"preview"},bt={class:"left"},kt={class:"main"},wt={class:"bot"},yt={class:"datetime"},St={class:"info"},Vt={key:0,class:"prompt mt-2"},Et={key:0},Tt={key:1},It={key:0,class:I({content:!0,failed:!0})},At={key:0,class:"mb-4"},Lt={key:1,class:I({operations:!0,"mt-2":!0})},Dt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ct={class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Rt={key:1,class:I({content:!0})},Ot={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ut={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Gt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Pt={key:2,class:I({content:!0})},Mt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},zt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function jt(e,t,p,m,g,v){const c=s("el-image"),d=s("video-player"),a=s("el-button"),w=s("el-tooltip"),_=s("font-awesome-icon"),f=s("copy-to-clipboard"),E=s("el-alert");return n(),i("div",vt,[r("div",bt,[o(c,{src:"https://cdn.acedata.cloud/z5id1u.png",class:"avatar"})]),r("div",kt,[r("div",wt,[h(l(e.$t("sora.name.soraBot"))+" ",1),r("span",yt,l(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),r("div",St,[e.modelValue?.request?.prompt?(n(),i("p",Vt,[h(l(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?$("",!0):(n(),i("span",Et," - ("+l(e.$t("sora.status.pending"))+") ",1)),Array.isArray(e.modelValue?.response?.data)&&e.modelValue?.response?.data[0]?.state==="pending"?(n(),i("span",Tt," - ("+l(e.$t("sora.status.processing"))+") ",1)):$("",!0)])):$("",!0)]),e.modelValue?.response?.success===!0&&e.modelValue?.response?.data?(n(),i("div",It,[e.modelValue?.response?.data[0]?.video_url?(n(),i("div",At,[o(d,{src:e.modelValue?.response?.data[0]?.video_url},null,8,["src"])])):$("",!0),e.modelValue?.response.success?(n(),i("div",Lt,[o(w,{class:"box-item",effect:"dark",content:e.$t("sora.message.downloadVideo"),placement:"top-start"},{default:u(()=>[e.modelValue?.response?.data[0]?.video_url?(n(),y(a,{key:0,type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=O=>e.onDownload(O,e.modelValue?.response?.data[0]?.video_url))},{default:u(()=>[h(l(e.$t("sora.button.download")),1)]),_:1})):$("",!0)]),_:1},8,["content"])])):$("",!0),o(E,{closable:!1,class:"mt-2 success"},{default:u(()=>[r("p",Dt,[o(_,{icon:"fa-solid fa-hashtag",class:"mr-1"}),h(" "+l(e.$t("sora.name.model"))+": "+l(e.modelValue?.request?.model),1)]),r("p",Ct,[o(_,{icon:"fa-solid fa-magic",class:"mr-1"}),h(" "+l(e.$t("sora.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),o(f,{content:e.modelValue?.id},null,8,["content"])])]),_:1})])):$("",!0),e.modelValue?.response?.success===!1?(n(),i("div",Rt,[o(E,{closable:!1,class:"failure"},{template:u(()=>[o(_,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),h(" "+l(e.$t("sora.name.failure")),1)]),default:u(()=>[r("p",Ot,[o(_,{icon:"fa-solid fa-magic",class:"mr-1"}),h(" "+l(e.$t("sora.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),o(f,{content:e.modelValue?.id},null,8,["content"])]),r("p",Ut,[o(_,{icon:"fa-solid fa-circle-info",class:"mr-1"}),h(" "+l(e.$t("sora.name.failureReason"))+": "+l(e.modelValue?.response?.error?.message)+" ",1),o(f,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.response?.trace_id?(n(),i("p",Gt,[o(_,{icon:"fa-solid fa-hashtag",class:"mr-1"}),h(" "+l(e.$t("sora.name.traceId"))+": "+l(e.modelValue?.response?.trace_id)+" ",1),o(f,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):$("",!0)]),_:1})])):$("",!0),e.modelValue?.response?.success===void 0?(n(),i("div",Pt,[o(E,{closable:!1,class:"info"},{template:u(()=>[o(_,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),h(" "+l(e.$t("sora.name.failure")),1)]),default:u(()=>[r("p",Mt,[o(_,{icon:"fa-solid fa-magic",class:"mr-1"}),h(" "+l(e.$t("sora.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),o(f,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.response?.trace_id?(n(),i("p",zt,[o(_,{icon:"fa-solid fa-hashtag",class:"mr-1"}),h(" "+l(e.$t("sora.name.traceId"))+": "+l(e.modelValue?.response?.trace_id)+" ",1),o(f,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):$("",!0)]),_:1})])):$("",!0)])])}const Bt=k(gt,[["render",jt],["__scopeId","data-v-424528ef"]]),Nt=b({name:"RecentPanel",components:{TaskPreview:Bt,NoTasks:ce,BotPlaceholder:me,ScrollList:le},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.sora?.tasks,items:this.$store.state.sora?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Ft={key:0},qt={key:2,class:"w-full h-full flex items-center justify-center"};function Kt(e,t,p,m,g,v){const c=s("bot-placeholder"),d=s("task-preview"),a=s("scroll-list"),w=s("no-tasks");return n(),i(V,null,[e.tasks?.items===void 0?(n(),i("div",Ft,[o(c)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(n(),y(a,{key:1,ref:"scrollList",class:"tasks h-full w-full overflow-y-auto",loading:e.loading,onReachTop:t[0]||(t[0]=_=>e.$emit("reach-top"))},{default:u(()=>[(n(!0),i(V,null,A(e.tasks?.items,(_,f)=>(n(),y(d,{key:f,"model-value":_},null,8,["model-value"]))),128))]),_:1},8,["loading"])):$("",!0),e.tasks?.items?.length===0?(n(),i("div",qt,[o(w)])):$("",!0)],64)}const Jt=k(Nt,[["render",Kt]]),Qt="https://webhook.acedata.cloud/sora",Wt=b({name:"SoraIndex",components:{ConfigPanel:$t,Layout:be,RecentPanel:Jt},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.sora?.status?.getApplications===G.Request},tasksLoading(){return this.$store.state.sora?.status?.getTasks===G.Request||this.fetchingTasks},credential(){return this.$store.state.sora.credential},config(){return this.$store.state.sora.config},tasks(){return this.$store.state.sora.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await fe({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("sora/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("sora/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:t=5,createdAtMin:p,createdAtMax:m}=e||{};console.debug("limit",t,"createdAtMin",p,"createdAtMax",m),this.fetchingTasks=!0;try{await this.$store.dispatch("sora/getTasks",{limit:t,createdAtMin:p,createdAtMax:m})}finally{this.fetchingTasks=!1}},async onGenerate(){const e={...this.config,callback_url:Qt},t=this.credential?.token;if(!t){console.error("no token specified");return}T.info(this.$t("sora.message.startingTask")),ae.generate(e,{token:t}).then(()=>{T.success(this.$t("sora.message.startTaskSuccess"))}).catch(p=>{p?.response?.data?.error?.code===ne?T.error(this.$t("sora.message.usedUp")):T.error(this.$t("sora.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Yt(e,t,p,m,g,v){const c=s("config-panel"),d=s("recent-panel"),a=s("layout");return n(),y(a,null,{config:u(()=>[o(c,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:u(()=>[o(d,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const fo=k(Wt,[["render",Yt]]);export{fo as default};
@@ -1 +1 @@
1
- import{E as T,a as D,b as E}from"./EditArray--myCPTrp.js";import{h as U,_ as V}from"./index-DmLTLHg-.js";import{L as F,k as A,M as L,w as _,z as q,j,A as B,o as N}from"./vendor-element-plus-B4FTqxj4.js";import{d as R,J as O,K as s,T as t,ai as n,G as l,R as o,Q as m,C as y,ag as Q,S as K,D as w,L as k,O as z,U as C}from"./vendor-vue-1w_NBnjl.js";import"./index.es-C57T75UL.js";import"./vendor-web3-CtYWvkaI.js";import"./vendor-dayjs-CzbnksQQ.js";import"./vendor-axios-NIGUFBhG.js";import"./vendor-vue-router-Dj5bcX0v.js";const G=R({name:"SiteIndex",components:{EditText:E,EditImage:D,EditArray:T,ElDivider:N,ElRow:B,ElImage:j,ElCol:q,ElCard:_,ElForm:L,ElSwitch:A,ElFormItem:F},data(){return{editing:{title:!1}}},computed:{site(){return this.$store.getters.site}},methods:{onSave(e){const a={...this.site,...e};U.update(this.site?.id,a).then(()=>{console.debug("getSite for id",this.site?.id),this.$store.dispatch("getSite")})}}}),J={class:"title"},M={class:"title"},W={class:"block w-full"},H={class:"block tip"},P={class:"block w-full"},X={class:"block tip"},Y={class:"block w-full"},Z={class:"block tip"},x={class:"block w-full"},ee={class:"block tip"},te={class:"block w-full"},ie={class:"block tip"},se={class:"title"},le={class:"block w-full"},oe={class:"block tip"},ae={class:"block w-full"},de={class:"block tip"},ne={class:"title"},re={class:"block tip"},me={class:"block tip"},ue={class:"title"},pe={class:"w-full"},fe={class:"block tip w-full"},be={key:0},ve={class:"block w-full"},he={class:"block w-full"};function ce(e,a,$e,ge,we,ke){const f=n("el-col"),h=n("el-row"),u=n("el-divider"),d=n("el-form-item"),p=n("edit-text"),c=n("el-image"),$=n("edit-image"),I=n("edit-array"),b=n("el-form"),v=n("el-card"),g=n("el-switch");return w(),O(h,{class:"panel"},{default:s(()=>[t(f,{span:24},{default:s(()=>[t(h,null,{default:s(()=>[t(f,{span:24},{default:s(()=>[l("h2",J,o(e.$t("common.title.site")),1)]),_:1})]),_:1}),t(h,{gutter:15},{default:s(()=>[t(f,{md:12,xs:24},{default:s(()=>[t(v,{shadow:"hover",class:"mb-4"},{default:s(()=>[l("h4",M,o(e.$t("site.title.basicConfig")),1),t(u),t(b,{model:e.site,class:"form","label-width":"auto",style:{"max-width":"600px"}},{default:s(()=>[t(d,{label:e.$t("site.field.origin")},{default:s(()=>[l("span",W,o(e.site.origin),1),l("span",H,o(e.$t("site.message.originTip")),1)]),_:1},8,["label"]),t(d,{label:e.$t("site.field.title")},{default:s(()=>[l("span",P,[m(o(e.site.title)+" ",1),t(p,{"model-value":e.site.title,title:e.$t("site.title.editTitle"),placeholder:e.$t("site.placeholder.title"),onConfirm:a[0]||(a[0]=i=>e.onSave({title:i}))},null,8,["model-value","title","placeholder"])]),l("span",X,o(e.$t("site.message.titleTip")),1)]),_:1},8,["label"]),t(d,{label:e.$t("site.field.logo")},{default:s(()=>[l("span",Y,[t(c,{src:e.site.logo,class:"logo"},null,8,["src"]),t($,{"model-value":e.site.logo,title:e.$t("site.title.editLogo"),tip:e.$t("site.message.editLogoTip"),onConfirm:a[1]||(a[1]=i=>e.onSave({logo:i}))},null,8,["model-value","title","tip"])]),l("span",Z,o(e.$t("site.message.logoTip")),1)]),_:1},8,["label"]),t(d,{label:e.$t("site.field.favicon")},{default:s(()=>[l("span",x,[t(c,{src:e.site.favicon,class:"favicon"},null,8,["src"]),t($,{"model-value":e.site.favicon,title:e.$t("site.title.editFavicon"),tip:e.$t("site.message.editFaviconTip"),onConfirm:a[2]||(a[2]=i=>e.onSave({favicon:i}))},null,8,["model-value","title","tip"])]),l("span",ee,o(e.$t("site.message.faviconTip")),1)]),_:1},8,["label"]),t(u,{"border-style":"dashed"}),t(d,{label:e.$t("site.field.admins")},{default:s(()=>[l("span",te,[m(o(e.site.admins?.join(", "))+" ",1),t(I,{"model-value":e.site?.admins||[],title:e.$t("site.title.editAdmins"),placeholder:e.$t("site.placeholder.admins"),tip:e.$t("site.message.adminsTip2"),min:1,"min-error-message":e.$t("site.message.atLeastOneAdmin"),onConfirm:a[3]||(a[3]=i=>e.onSave({admins:i}))},null,8,["model-value","title","placeholder","tip","min-error-message"])]),l("span",ie,o(e.$t("site.message.adminsTip")),1)]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),t(v,{shadow:"hover"},{default:s(()=>[l("h4",se,o(e.$t("site.title.seoConfig")),1),t(u),t(b,{model:e.site,class:"form","label-width":"auto",style:{"max-width":"600px"}},{default:s(()=>[t(d,{label:e.$t("site.field.description")},{default:s(()=>[l("span",le,[m(o(e.site.description)+" ",1),t(p,{"model-value":e.site.description,title:e.$t("site.title.editDescription"),placeholder:e.$t("site.placeholder.description"),onConfirm:a[4]||(a[4]=i=>e.onSave({description:i}))},null,8,["model-value","title","placeholder"])]),l("span",oe,o(e.$t("site.message.descriptionTip")),1)]),_:1},8,["label"]),t(d,{label:e.$t("site.field.keywords")},{default:s(()=>[l("span",ae,[m(o(e.site.keywords?.join(", "))+" ",1),t(I,{"model-value":e.site?.keywords||[],title:e.$t("site.title.editKeywords"),placeholder:e.$t("site.placeholder.keywords"),tip:e.$t("site.message.keywordsTip2"),onConfirm:a[5]||(a[5]=i=>e.onSave({keywords:i}))},null,8,["model-value","title","placeholder","tip"])]),l("span",de,o(e.$t("site.message.keywordsTip")),1)]),_:1},8,["label"])]),_:1},8,["model"])]),_:1})]),_:1}),t(f,{md:12,xs:24},{default:s(()=>[t(v,{shadow:"hover",class:"mb-4"},{default:s(()=>[l("h4",ne,o(e.$t("site.title.distributionConfig")),1),t(u),t(b,{model:e.site,class:"form","label-width":"auto",style:{"max-width":"600px"}},{default:s(()=>[t(d,{label:e.$t("site.field.distributionDefaultInviterId")},{default:s(()=>[m(o(e.site.distribution?.default_inviter_id)+" ",1),t(p,{"model-value":e.site.distribution?.default_inviter_id,title:e.$t("site.title.editDistributionDefaultInviterId"),placeholder:e.$t("site.placeholder.editDistributionDefaultInviterId"),onConfirm:a[6]||(a[6]=i=>e.onSave({distribution:{...e.site.distribution,default_inviter_id:i}}))},null,8,["model-value","title","placeholder"]),l("span",re,o(e.$t("site.message.distributionDefaultInviterIdTip")),1)]),_:1},8,["label"]),t(d,{label:e.$t("site.field.distributionForceInviterId")},{default:s(()=>[m(o(e.site.distribution?.force_inviter_id)+" ",1),t(p,{"model-value":e.site.distribution?.force_inviter_id,title:e.$t("site.title.editDistributionForceInviterId"),placeholder:e.$t("site.placeholder.editDistributionForceInviterId"),onConfirm:a[7]||(a[7]=i=>e.onSave({distribution:{...e.site.distribution,force_inviter_id:i}}))},null,8,["model-value","title","placeholder"]),l("span",me,o(e.$t("site.message.distributionForceInviterIdTip")),1)]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),t(v,{shadow:"hover"},{default:s(()=>[l("h4",ue,o(e.$t("site.title.featuresConfig")),1),t(u),t(b,{model:e.site,class:"form","label-width":"auto",style:{"max-width":"600px"}},{default:s(()=>[(w(),y(K,null,Q(["chat","midjourney","qrart","nanobanana","seedream","seedance","suno","luma","pika","kling","flux","hailuo","headshots","support"],(i,S)=>t(d,{key:S,label:e.$t("site.field.features"+i.charAt(0).toUpperCase()+i.slice(1))},{default:s(()=>[l("div",pe,[t(g,{"model-value":e.site.features[i]?.enabled||!1,"inline-prompt":"","active-text":e.$t("site.button.enabled"),"inactive-text":e.$t("site.button.disabled"),"onUpdate:modelValue":r=>e.onSave({features:{...e.site.features,[i]:{...e.site.features[i],enabled:r}}})},null,8,["model-value","active-text","inactive-text","onUpdate:modelValue"])]),l("span",fe,o(e.$t("site.message.features"+i.charAt(0).toUpperCase()+i.slice(1))),1),i==="support"?k((w(),y("div",be,[t(d,{label:"WeChat"},{default:s(()=>[t(g,{"model-value":e.site.features[i]?.wechat?.enabled||!1,"inline-prompt":"","active-text":e.$t("site.button.enabled"),"inactive-text":e.$t("site.button.disabled"),"onUpdate:modelValue":r=>e.onSave({features:{...e.site.features,[i]:{...e.site.features[i],wechat:{...e.site.features[i]?.wechat,enabled:r}}}})},null,8,["model-value","active-text","inactive-text","onUpdate:modelValue"])]),_:2},1024),k(t(d,{label:e.$t("site.field.qr")},{default:s(()=>[l("span",ve,[t(c,{src:e.site.features[i]?.wechat?.qr},null,8,["src"]),t($,{"model-value":e.site.features[i]?.wechat?.qr,title:e.$t("site.title.editQR"),tip:e.$t("site.message.editQRTip"),onConfirm:r=>e.onSave({features:{...e.site.features,[i]:{...e.site.features[i],wechat:{...e.site.features[i]?.wechat,qr:r}}}})},null,8,["model-value","title","tip","onConfirm"])])]),_:2},1032,["label"]),[[C,e.site.features[i]?.wechat?.enabled]]),t(d,{label:"Discord"},{default:s(()=>[t(g,{"model-value":e.site.features[i]?.discord?.enabled||!1,"inline-prompt":"","active-text":e.$t("site.button.enabled"),"inactive-text":e.$t("site.button.disabled"),"onUpdate:modelValue":r=>e.onSave({features:{...e.site.features,[i]:{...e.site.features[i],discord:{...e.site.features[i]?.discord,enabled:r}}}})},null,8,["model-value","active-text","inactive-text","onUpdate:modelValue"])]),_:2},1024),k(t(d,{label:e.$t("site.field.url")},{default:s(()=>[l("span",he,[m(o(e.site.features[i]?.discord?.url)+" ",1),t(p,{"model-value":e.site.features[i]?.discord?.url,title:e.$t("site.title.editUrl"),placeholder:e.$t("site.placeholder.editUrl"),onConfirm:r=>e.onSave({features:{...e.site.features,[i]:{...e.site.features[i],discord:{...e.site.features[i]?.discord,url:r}}}})},null,8,["model-value","title","placeholder","onConfirm"])])]),_:2},1032,["label"]),[[C,e.site.features[i]?.discord?.enabled]])],512)),[[C,e.site.features[i]?.enabled]]):z("",!0)]),_:2},1032,["label"])),64))]),_:1},8,["model"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}const Fe=V(G,[["render",ce],["__scopeId","data-v-de742379"]]);export{Fe as default};
1
+ import{E as T,a as D,b as E}from"./EditArray-BcoTXdg2.js";import{h as U,_ as V}from"./index-CqL6zWO4.js";import{L as F,k as A,M as L,w as _,z as q,j,A as B,o as N}from"./vendor-element-plus-B4FTqxj4.js";import{d as R,J as O,K as s,T as t,ai as n,G as l,R as o,Q as m,C as y,ag as Q,S as K,D as w,L as k,O as z,U as C}from"./vendor-vue-1w_NBnjl.js";import"./index.es-vNwt4sbI.js";import"./vendor-web3-BT8AOwfJ.js";import"./vendor-dayjs-CzbnksQQ.js";import"./vendor-axios-NIGUFBhG.js";import"./vendor-vue-router-Dj5bcX0v.js";const G=R({name:"SiteIndex",components:{EditText:E,EditImage:D,EditArray:T,ElDivider:N,ElRow:B,ElImage:j,ElCol:q,ElCard:_,ElForm:L,ElSwitch:A,ElFormItem:F},data(){return{editing:{title:!1}}},computed:{site(){return this.$store.getters.site}},methods:{onSave(e){const a={...this.site,...e};U.update(this.site?.id,a).then(()=>{console.debug("getSite for id",this.site?.id),this.$store.dispatch("getSite")})}}}),J={class:"title"},M={class:"title"},W={class:"block w-full"},H={class:"block tip"},P={class:"block w-full"},X={class:"block tip"},Y={class:"block w-full"},Z={class:"block tip"},x={class:"block w-full"},ee={class:"block tip"},te={class:"block w-full"},ie={class:"block tip"},se={class:"title"},le={class:"block w-full"},oe={class:"block tip"},ae={class:"block w-full"},de={class:"block tip"},ne={class:"title"},re={class:"block tip"},me={class:"block tip"},ue={class:"title"},pe={class:"w-full"},fe={class:"block tip w-full"},be={key:0},ve={class:"block w-full"},he={class:"block w-full"};function ce(e,a,$e,ge,we,ke){const f=n("el-col"),h=n("el-row"),u=n("el-divider"),d=n("el-form-item"),p=n("edit-text"),c=n("el-image"),$=n("edit-image"),I=n("edit-array"),b=n("el-form"),v=n("el-card"),g=n("el-switch");return w(),O(h,{class:"panel"},{default:s(()=>[t(f,{span:24},{default:s(()=>[t(h,null,{default:s(()=>[t(f,{span:24},{default:s(()=>[l("h2",J,o(e.$t("common.title.site")),1)]),_:1})]),_:1}),t(h,{gutter:15},{default:s(()=>[t(f,{md:12,xs:24},{default:s(()=>[t(v,{shadow:"hover",class:"mb-4"},{default:s(()=>[l("h4",M,o(e.$t("site.title.basicConfig")),1),t(u),t(b,{model:e.site,class:"form","label-width":"auto",style:{"max-width":"600px"}},{default:s(()=>[t(d,{label:e.$t("site.field.origin")},{default:s(()=>[l("span",W,o(e.site.origin),1),l("span",H,o(e.$t("site.message.originTip")),1)]),_:1},8,["label"]),t(d,{label:e.$t("site.field.title")},{default:s(()=>[l("span",P,[m(o(e.site.title)+" ",1),t(p,{"model-value":e.site.title,title:e.$t("site.title.editTitle"),placeholder:e.$t("site.placeholder.title"),onConfirm:a[0]||(a[0]=i=>e.onSave({title:i}))},null,8,["model-value","title","placeholder"])]),l("span",X,o(e.$t("site.message.titleTip")),1)]),_:1},8,["label"]),t(d,{label:e.$t("site.field.logo")},{default:s(()=>[l("span",Y,[t(c,{src:e.site.logo,class:"logo"},null,8,["src"]),t($,{"model-value":e.site.logo,title:e.$t("site.title.editLogo"),tip:e.$t("site.message.editLogoTip"),onConfirm:a[1]||(a[1]=i=>e.onSave({logo:i}))},null,8,["model-value","title","tip"])]),l("span",Z,o(e.$t("site.message.logoTip")),1)]),_:1},8,["label"]),t(d,{label:e.$t("site.field.favicon")},{default:s(()=>[l("span",x,[t(c,{src:e.site.favicon,class:"favicon"},null,8,["src"]),t($,{"model-value":e.site.favicon,title:e.$t("site.title.editFavicon"),tip:e.$t("site.message.editFaviconTip"),onConfirm:a[2]||(a[2]=i=>e.onSave({favicon:i}))},null,8,["model-value","title","tip"])]),l("span",ee,o(e.$t("site.message.faviconTip")),1)]),_:1},8,["label"]),t(u,{"border-style":"dashed"}),t(d,{label:e.$t("site.field.admins")},{default:s(()=>[l("span",te,[m(o(e.site.admins?.join(", "))+" ",1),t(I,{"model-value":e.site?.admins||[],title:e.$t("site.title.editAdmins"),placeholder:e.$t("site.placeholder.admins"),tip:e.$t("site.message.adminsTip2"),min:1,"min-error-message":e.$t("site.message.atLeastOneAdmin"),onConfirm:a[3]||(a[3]=i=>e.onSave({admins:i}))},null,8,["model-value","title","placeholder","tip","min-error-message"])]),l("span",ie,o(e.$t("site.message.adminsTip")),1)]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),t(v,{shadow:"hover"},{default:s(()=>[l("h4",se,o(e.$t("site.title.seoConfig")),1),t(u),t(b,{model:e.site,class:"form","label-width":"auto",style:{"max-width":"600px"}},{default:s(()=>[t(d,{label:e.$t("site.field.description")},{default:s(()=>[l("span",le,[m(o(e.site.description)+" ",1),t(p,{"model-value":e.site.description,title:e.$t("site.title.editDescription"),placeholder:e.$t("site.placeholder.description"),onConfirm:a[4]||(a[4]=i=>e.onSave({description:i}))},null,8,["model-value","title","placeholder"])]),l("span",oe,o(e.$t("site.message.descriptionTip")),1)]),_:1},8,["label"]),t(d,{label:e.$t("site.field.keywords")},{default:s(()=>[l("span",ae,[m(o(e.site.keywords?.join(", "))+" ",1),t(I,{"model-value":e.site?.keywords||[],title:e.$t("site.title.editKeywords"),placeholder:e.$t("site.placeholder.keywords"),tip:e.$t("site.message.keywordsTip2"),onConfirm:a[5]||(a[5]=i=>e.onSave({keywords:i}))},null,8,["model-value","title","placeholder","tip"])]),l("span",de,o(e.$t("site.message.keywordsTip")),1)]),_:1},8,["label"])]),_:1},8,["model"])]),_:1})]),_:1}),t(f,{md:12,xs:24},{default:s(()=>[t(v,{shadow:"hover",class:"mb-4"},{default:s(()=>[l("h4",ne,o(e.$t("site.title.distributionConfig")),1),t(u),t(b,{model:e.site,class:"form","label-width":"auto",style:{"max-width":"600px"}},{default:s(()=>[t(d,{label:e.$t("site.field.distributionDefaultInviterId")},{default:s(()=>[m(o(e.site.distribution?.default_inviter_id)+" ",1),t(p,{"model-value":e.site.distribution?.default_inviter_id,title:e.$t("site.title.editDistributionDefaultInviterId"),placeholder:e.$t("site.placeholder.editDistributionDefaultInviterId"),onConfirm:a[6]||(a[6]=i=>e.onSave({distribution:{...e.site.distribution,default_inviter_id:i}}))},null,8,["model-value","title","placeholder"]),l("span",re,o(e.$t("site.message.distributionDefaultInviterIdTip")),1)]),_:1},8,["label"]),t(d,{label:e.$t("site.field.distributionForceInviterId")},{default:s(()=>[m(o(e.site.distribution?.force_inviter_id)+" ",1),t(p,{"model-value":e.site.distribution?.force_inviter_id,title:e.$t("site.title.editDistributionForceInviterId"),placeholder:e.$t("site.placeholder.editDistributionForceInviterId"),onConfirm:a[7]||(a[7]=i=>e.onSave({distribution:{...e.site.distribution,force_inviter_id:i}}))},null,8,["model-value","title","placeholder"]),l("span",me,o(e.$t("site.message.distributionForceInviterIdTip")),1)]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),t(v,{shadow:"hover"},{default:s(()=>[l("h4",ue,o(e.$t("site.title.featuresConfig")),1),t(u),t(b,{model:e.site,class:"form","label-width":"auto",style:{"max-width":"600px"}},{default:s(()=>[(w(),y(K,null,Q(["chat","midjourney","qrart","nanobanana","seedream","seedance","suno","luma","pika","kling","flux","hailuo","headshots","support"],(i,S)=>t(d,{key:S,label:e.$t("site.field.features"+i.charAt(0).toUpperCase()+i.slice(1))},{default:s(()=>[l("div",pe,[t(g,{"model-value":e.site.features[i]?.enabled||!1,"inline-prompt":"","active-text":e.$t("site.button.enabled"),"inactive-text":e.$t("site.button.disabled"),"onUpdate:modelValue":r=>e.onSave({features:{...e.site.features,[i]:{...e.site.features[i],enabled:r}}})},null,8,["model-value","active-text","inactive-text","onUpdate:modelValue"])]),l("span",fe,o(e.$t("site.message.features"+i.charAt(0).toUpperCase()+i.slice(1))),1),i==="support"?k((w(),y("div",be,[t(d,{label:"WeChat"},{default:s(()=>[t(g,{"model-value":e.site.features[i]?.wechat?.enabled||!1,"inline-prompt":"","active-text":e.$t("site.button.enabled"),"inactive-text":e.$t("site.button.disabled"),"onUpdate:modelValue":r=>e.onSave({features:{...e.site.features,[i]:{...e.site.features[i],wechat:{...e.site.features[i]?.wechat,enabled:r}}}})},null,8,["model-value","active-text","inactive-text","onUpdate:modelValue"])]),_:2},1024),k(t(d,{label:e.$t("site.field.qr")},{default:s(()=>[l("span",ve,[t(c,{src:e.site.features[i]?.wechat?.qr},null,8,["src"]),t($,{"model-value":e.site.features[i]?.wechat?.qr,title:e.$t("site.title.editQR"),tip:e.$t("site.message.editQRTip"),onConfirm:r=>e.onSave({features:{...e.site.features,[i]:{...e.site.features[i],wechat:{...e.site.features[i]?.wechat,qr:r}}}})},null,8,["model-value","title","tip","onConfirm"])])]),_:2},1032,["label"]),[[C,e.site.features[i]?.wechat?.enabled]]),t(d,{label:"Discord"},{default:s(()=>[t(g,{"model-value":e.site.features[i]?.discord?.enabled||!1,"inline-prompt":"","active-text":e.$t("site.button.enabled"),"inactive-text":e.$t("site.button.disabled"),"onUpdate:modelValue":r=>e.onSave({features:{...e.site.features,[i]:{...e.site.features[i],discord:{...e.site.features[i]?.discord,enabled:r}}}})},null,8,["model-value","active-text","inactive-text","onUpdate:modelValue"])]),_:2},1024),k(t(d,{label:e.$t("site.field.url")},{default:s(()=>[l("span",he,[m(o(e.site.features[i]?.discord?.url)+" ",1),t(p,{"model-value":e.site.features[i]?.discord?.url,title:e.$t("site.title.editUrl"),placeholder:e.$t("site.placeholder.editUrl"),onConfirm:r=>e.onSave({features:{...e.site.features,[i]:{...e.site.features[i],discord:{...e.site.features[i]?.discord,url:r}}}})},null,8,["model-value","title","placeholder","onConfirm"])])]),_:2},1032,["label"]),[[C,e.site.features[i]?.discord?.enabled]])],512)),[[C,e.site.features[i]?.enabled]]):z("",!0)]),_:2},1032,["label"])),64))]),_:1},8,["model"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}const Fe=V(G,[["render",ce],["__scopeId","data-v-de742379"]]);export{Fe as default};
@@ -1 +1 @@
1
- import{F as M}from"./index.es-C57T75UL.js";import{l as O,S as re,k as ce,N as ue,O as de,t as pe,u as C,s as B,a1 as x,a2 as ee,U as ie,e as J,j as N,D as ae,F as le,V as te,a3 as me,a4 as fe,Z as he,f as _e,g as ge,h as $e,p as ve,q as ye,K as ke,Y as we,a5 as be,a6 as Ce}from"./vendor-element-plus-B4FTqxj4.js";import{d as S,C as g,G as n,T as s,E as K,K as m,ai as a,D as i,O as y,R as u,S as D,ag as Y,J as w,Q as L,L as q,aq as Q,X as F,c as I,u as T,w as Se,b as Ve,P as Le,U as Ae}from"./vendor-vue-1w_NBnjl.js";import{_ as A,c4 as je,c5 as P,aj as Fe,ay as R,c6 as H,ar as Ee,ax as Te}from"./index-DmLTLHg-.js";import{I as G,S as Ue}from"./ScrollList-2fA4pSP6.js";import{C as Pe,N as Ie}from"./NoTasks-C89T1fZz.js";import{a as ze}from"./price-ClaXuKyA.js";import{j as Z}from"./vendor-dayjs-CzbnksQQ.js";import{l as Ge}from"./pagination-CihAE3FS.js";import"./vendor-web3-CtYWvkaI.js";import"./vendor-axios-NIGUFBhG.js";import"./vendor-vue-router-Dj5bcX0v.js";const Me=S({name:"LayoutSuno",components:{ElDrawer:re,ElButton:O,FontAwesomeIcon:M},data(){return{drawer:!1,preview:!1}},computed:{}}),Re={class:"main flex flex-row flex-1"},De={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},We={class:"result h-full flex flex-col flex-1 min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"},Oe={class:"preview h-full w-[300px] flex flex-col"};function Be(e,t,l,o,c,p){const d=a("font-awesome-icon"),_=a("el-button"),$=a("el-drawer");return i(),g("div",Re,[n("div",De,[K(e.$slots,"config",{},void 0,!0)]),n("div",We,[K(e.$slots,"result",{},void 0,!0)]),n("div",Oe,[K(e.$slots,"preview",{},void 0,!0)]),s(_,{circle:"",class:"menu",onClick:t[0]||(t[0]=r=>e.drawer=!0)},{default:m(()=>[s(d,{icon:"fa-solid fa-magic"})]),_:1}),s($,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=r=>e.drawer=r),direction:"ltr","with-header":!1,size:"340px",class:"drawer"},{default:m(()=>[K(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Ne=A(Me,[["render",Be],["__scopeId","data-v-c6c85757"]]),qe=S({name:"TypeSelector",components:{ElSelect:de,ElOption:ue,ElSwitch:ce},data(){return{options:[{label:"Suno v5",value:"chirp-v5",info:"8 min"},{label:"Suno v4.5+",value:"chirp-v4-5-plus",info:"8 min"},{label:"Suno v4.5",value:"chirp-v4-5",info:"4 min"},{label:"Suno v4",value:"chirp-v4",info:"2.5 min"},{label:"Suno v3.5",value:"chirp-v3-5",info:"2 min"},{label:"Suno v3",value:"chirp-v3-0",info:"2 min"}]}},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=je)}}),He={class:"flex items-center justify-between mb-3"},Ke={class:"text-sm font-bold"},Ze={class:"mb-3"},Xe={class:"flex items-center mb-1"},Ye={class:"text-sm font-bold"},Je={class:"flex items-center justify-between w-full"},Qe={class:"text-xs text-[var(--el-text-color-placeholder)]"},xe={key:0,class:"flex items-center justify-between mb-3"},et={class:"text-sm font-bold"};function tt(e,t,l,o,c,p){const d=a("el-switch"),_=a("el-option"),$=a("el-select");return i(),g("div",null,[n("div",He,[n("span",Ke,u(e.$t("suno.name.type")),1),s(d,{modelValue:e.custom,"onUpdate:modelValue":t[0]||(t[0]=r=>e.custom=r),size:"small"},null,8,["modelValue"])]),n("div",Ze,[n("div",Xe,[n("span",Ye,u(e.$t("suno.name.model")),1)]),s($,{modelValue:e.model,"onUpdate:modelValue":t[1]||(t[1]=r=>e.model=r),class:"w-full",size:"default",placeholder:e.$t("suno.placeholder.select")},{default:m(()=>[(i(!0),g(D,null,Y(e.options,r=>(i(),w(_,{key:r.value,label:r.label,value:r.value},{default:m(()=>[n("div",Je,[n("span",null,u(r.label),1),n("span",Qe,u(r.info),1)])]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),e.custom?(i(),g("div",xe,[n("span",et,u(e.$t("suno.name.instrumental")),1),s(d,{modelValue:e.instrumental,"onUpdate:modelValue":t[2]||(t[2]=r=>e.instrumental=r),size:"small"},null,8,["modelValue"])])):y("",!0)])}const ot=A(qe,[["render",tt]]),st=S({name:"UploadAudio",components:{ElUpload:pe,ElButton:O,InfoIcon:G,FontAwesomeIcon:M},emits:["change"],data(){return{fileList:[],uploadUrl:Fe()+"/api/v1/files/"}},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(){}}},watch:{urls:{handler(e){this.$emit("change",e)}}},mounted(){this.value||(this.value=void 0),this.onSetAudio()},methods:{onExceed(){C.warning(this.$t("suno.message.uploadReferencesExceed"))},onError(){C.error(this.$t("suno.message.uploadReferencesError"))},async onSuccess(){const e=this.urls?.[0];await this.onGenerateAudioId(e)},async onGenerateAudioId(e){const t={audio_url:e},l=this.credential?.token;if(!l){console.error("no token specified");return}C.info(this.$t("suno.message.startingUploadAudio")),P.upload(t,{token:l}).then(o=>{console.debug("get upload music success",o.data);const c=o.data?.data.audio_id;this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,audio_id:c,action:"upload_extend"}),C.success(this.$t("suno.message.startUploadAudioSuccess"))}).catch(o=>{C.error(o?.response?.data?.error?.message||this.$t("suno.message.startUploadAudioFailed"))})},onSetAudio(){}}}),nt={class:"relative"},it={class:"flex justify-between"},at={class:"flex justify-start items-center"},lt={class:"text-sm font-bold"};function rt(e,t,l,o,c,p){const d=a("info-icon"),_=a("font-awesome-icon"),$=a("el-button"),r=a("el-upload");return i(),g("div",nt,[n("div",it,[n("div",at,[n("span",lt,u(e.$t("suno.name.referenceAudios")),1),s(d,{content:e.$t("suno.description.uploadAudios")},null,8,["content"])])]),s(r,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=h=>e.fileList=h),name:"file",limit:1,class:"upload-wrapper",action:e.uploadUrl,accept:".mp3","show-file-list":!0,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{default:m(()=>[s($,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:m(()=>[s(_,{icon:"fa-solid fa-upload",class:"icon mr-1"}),L(" "+u(e.$t("suno.button.uploadAudios")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const ct=A(st,[["render",rt],["__scopeId","data-v-6236152c"]]),ut="",dt=S({name:"PromptInput",components:{ElInput:B,InfoIcon:G},computed:{prompt:{get(){return this.$store.state.suno?.config?.prompt},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=ut)}}),pt={class:"field"},mt={class:"flex items-center mb-1"},ft={class:"text-sm font-bold"};function ht(e,t,l,o,c,p){const d=a("info-icon"),_=a("el-input");return i(),g("div",pt,[n("div",mt,[n("span",ft,u(e.$t("suno.name.songDescription")),1),s(d,{content:e.$t("suno.description.prompt")},null,8,["content"])]),s(_,{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"])])}const _t=A(dt,[["render",ht]]),gt="",$t=S({name:"LyricInput",components:{ElInput:B,ElButton:O,FontAwesomeIcon:M,InfoIcon:G},data(){return{generatingLyrics:!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=gt)},methods:{async onGenerateLyrics(){const e=this.credential?.token;if(!e)return;const t=this.config?.style||this.config?.title||"a beautiful song";this.generatingLyrics=!0,C.info(this.$t("suno.message.generatingLyrics"));try{const o=(await P.lyric({prompt:t},{token:e})).data?.data;o?.text&&(this.lyric=o.text,o?.title&&!this.config?.title&&this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,lyric:o.text,title:o.title}),C.success(this.$t("suno.message.generateLyricsSuccess")))}catch{C.error(this.$t("suno.message.generateLyricsFailed"))}finally{this.generatingLyrics=!1}}}}),vt={class:"field"},yt={class:"flex items-center justify-between mb-1"},kt={class:"flex items-center"},wt={class:"text-sm font-bold"};function bt(e,t,l,o,c,p){const d=a("info-icon"),_=a("font-awesome-icon"),$=a("el-button"),r=a("el-input");return i(),g("div",vt,[n("div",yt,[n("div",kt,[n("span",wt,u(e.$t("suno.name.lyrics")),1),s(d,{content:e.$t("suno.description.lyrics")},null,8,["content"])]),e.config?.action!=="extend"?(i(),w($,{key:0,size:"small",loading:e.generatingLyrics,round:"",onClick:e.onGenerateLyrics},{default:m(()=>[e.generatingLyrics?y("",!0):(i(),w(_,{key:0,icon:"fa-solid fa-wand-magic-sparkles",class:"mr-1"})),L(" "+u(e.$t("suno.button.generate_lyrics")),1)]),_:1},8,["loading","onClick"])):y("",!0)]),e.config?.action!=="extend"?(i(),w(r,{key:0,modelValue:e.lyric,"onUpdate:modelValue":t[0]||(t[0]=h=>e.lyric=h),rows:5,type:"textarea",class:"lyrics",placeholder:e.$t("suno.placeholder.lyrics")},null,8,["modelValue","placeholder"])):(i(),w(r,{key:1,modelValue:e.lyric,"onUpdate:modelValue":t[1]||(t[1]=h=>e.lyric=h),rows:5,type:"textarea",class:"lyrics",placeholder:e.$t("suno.placeholder.extend.lyrics")},null,8,["modelValue","placeholder"]))])}const Ct=A($t,[["render",bt],["__scopeId","data-v-210d2670"]]),St=S({name:"StyleInput",components:{ElInput:B,ElButton:O,FontAwesomeIcon:M,InfoIcon:G},data(){return{optimizing:!1}},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}},methods:{async onOptimizeStyle(){const e=this.credential?.token;if(!(!e||!this.style)){this.optimizing=!0,C.info(this.$t("suno.message.optimizingStyle"));try{const t=await P.style({prompt:this.style},{token:e}),l=t.data?.text||t.data?.data?.text;l&&(this.style=l,C.success(this.$t("suno.message.optimizeStyleSuccess")))}catch{C.error(this.$t("suno.message.optimizeStyleFailed"))}finally{this.optimizing=!1}}}}}),Vt={class:"field"},Lt={class:"flex items-center justify-between mb-1"},At={class:"flex items-center"},jt={class:"text-sm font-bold"};function Ft(e,t,l,o,c,p){const d=a("info-icon"),_=a("font-awesome-icon"),$=a("el-button"),r=a("el-input");return i(),g("div",Vt,[n("div",Lt,[n("div",At,[n("span",jt,u(e.$t("suno.name.style")),1),s(d,{content:e.$t("suno.description.style")},null,8,["content"])]),s($,{size:"small",loading:e.optimizing,round:"",onClick:e.onOptimizeStyle},{default:m(()=>[e.optimizing?y("",!0):(i(),w(_,{key:0,icon:"fa-solid fa-wand-magic-sparkles",class:"mr-1"})),L(" "+u(e.$t("suno.button.optimize_style")),1)]),_:1},8,["loading","onClick"])]),s(r,{modelValue:e.style,"onUpdate:modelValue":t[0]||(t[0]=h=>e.style=h),rows:2,type:"textarea",placeholder:e.$t("suno.placeholder.style")},null,8,["modelValue","placeholder"])])}const Et=A(St,[["render",Ft]]),Tt=S({name:"TitleInput",components:{ElInput:B,InfoIcon:G},computed:{title:{get(){return this.$store.state.suno?.config?.title},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,title:e})}}}}),Ut={class:"field"},Pt={class:"flex items-center mb-1"},It={class:"text-sm font-bold"};function zt(e,t,l,o,c,p){const d=a("info-icon"),_=a("el-input");return i(),g("div",Ut,[n("div",Pt,[n("span",It,u(e.$t("suno.name.title")),1),s(d,{content:e.$t("suno.description.title")},null,8,["content"])]),s(_,{modelValue:e.title,"onUpdate:modelValue":t[0]||(t[0]=$=>e.title=$),placeholder:e.$t("suno.placeholder.title")},null,8,["modelValue","placeholder"])])}const Gt=A(Tt,[["render",zt]]);function W(e){const t=Math.floor(e)%60;e=Math.floor(e/60);const l=e%60,o=l<10?`0${l}`:l,c=t<10?`0${t}`:t;return o+":"+c}const Mt=S({name:"ExtendFromInput",components:{ElImage:N,ElIcon:J,ElInputNumber:ie,VideoPlay:ee,VideoPause:x},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:W,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})}}}),Rt={class:"field"},Dt={class:"box"},Wt={class:"title font-bold"},Ot={class:"input-wrapper"},Bt={class:"task"},Nt={class:"left"},qt={key:2,class:"duration"},Ht={class:"info"},Kt={class:"title"},Zt={class:"style"};function Xt(e,t,l,o,c,p){const d=a("el-input-number"),_=a("el-image"),$=a("video-pause"),r=a("el-icon"),h=a("video-play"),b=Q("loading");return i(),g("div",Rt,[n("div",Dt,[n("h2",Wt,u(e.$t("suno.name.extend")),1),n("div",Ot,[s(d,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=f=>e.value=f),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"])])]),n("div",Bt,[e.audio?(i(),g("div",{key:0,class:"audio",onClick:t[3]||(t[3]=f=>e.onClick(e.audio))},[q((i(),g("div",Nt,[s(_,{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"?(i(),g("div",{key:0,class:"overlay",onClick:t[1]||(t[1]=f=>e.onPause(e.audio))},[s(r,null,{default:m(()=>[s($)]),_:1})])):y("",!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")?(i(),g("div",{key:1,class:"overlay",onClick:t[2]||(t[2]=f=>e.onPlay(e.audio))},[s(r,null,{default:m(()=>[s(h)]),_:1})])):y("",!0),e.audio?.duration?(i(),g("div",qt,u(e.useFormatDuring(e.audio?.duration)),1)):y("",!0)])),[[b,!e.audio?.audio_url]]),n("div",Ht,[n("h2",Kt,u(e.audio?.title),1),n("p",Zt,u(e.audio?.style),1)])])):y("",!0)])])}const Yt=A(Mt,[["render",Xt],["__scopeId","data-v-bcce4821"]]),Jt=S({name:"CoverFromInput",components:{ElImage:N,ElIcon:J,VideoPlay:ee,VideoPause:x},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:W,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})}}}),Qt={class:"field"},xt={class:"box"},eo={class:"title font-bold"},to={class:"task"},oo={class:"left"},so={key:2,class:"duration"},no={class:"info"},io={class:"title"},ao={class:"style"};function lo(e,t,l,o,c,p){const d=a("el-image"),_=a("video-pause"),$=a("el-icon"),r=a("video-play"),h=Q("loading");return i(),g("div",Qt,[n("div",xt,[n("h2",eo,u(e.$t("suno.name.cover")),1)]),n("div",to,[e.audio?(i(),g("div",{key:0,class:"audio",onClick:t[2]||(t[2]=b=>e.onClick(e.audio))},[q((i(),g("div",oo,[s(d,{src:e.audio?.image_url,class:"cover",fit:"cover"},null,8,["src"]),e.audio?.audio_url&&e.$store.state?.suno?.audio?.id===e.audio.id&&e.$store.state?.suno?.audio?.state==="playing"?(i(),g("div",{key:0,class:"overlay",onClick:t[0]||(t[0]=b=>e.onPause(e.audio))},[s($,null,{default:m(()=>[s(_)]),_:1})])):y("",!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")?(i(),g("div",{key:1,class:"overlay",onClick:t[1]||(t[1]=b=>e.onPlay(e.audio))},[s($,null,{default:m(()=>[s(r)]),_:1})])):y("",!0),e.audio?.duration?(i(),g("div",so,u(e.useFormatDuring(e.audio?.duration)),1)):y("",!0)])),[[h,!e.audio?.audio_url]]),n("div",no,[n("h2",io,u(e.audio?.title),1),n("p",ao,u(e.audio?.style),1)])])):y("",!0)])])}const ro=A(Jt,[["render",lo],["__scopeId","data-v-06640216"]]),co=S({name:"VocalGenderSelector",components:{ElRadioGroup:le,ElRadioButton:ae,InfoIcon:G},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})}}}}),uo={class:"mb-2"},po={class:"flex items-center mb-1"},mo={class:"text-sm font-bold"};function fo(e,t,l,o,c,p){const d=a("info-icon"),_=a("el-radio-button"),$=a("el-radio-group");return i(),g("div",uo,[n("div",po,[n("span",mo,u(e.$t("suno.name.vocalGender")),1),s(d,{content:e.$t("suno.description.vocalGender")},null,8,["content"])]),s($,{modelValue:e.vocalGender,"onUpdate:modelValue":t[0]||(t[0]=r=>e.vocalGender=r),size:"small"},{default:m(()=>[s(_,{value:""},{default:m(()=>[L(u(e.$t("suno.gender.auto")),1)]),_:1}),s(_,{value:"f"},{default:m(()=>[L(u(e.$t("suno.gender.female")),1)]),_:1}),s(_,{value:"m"},{default:m(()=>[L(u(e.$t("suno.gender.male")),1)]),_:1})]),_:1},8,["modelValue"])])}const ho=A(co,[["render",fo]]),_o=S({name:"AdvancedParams",components:{ElCollapse:fe,ElCollapseItem:me,ElInput:B,ElSlider:te,ElRadioGroup:le,ElRadioButton:ae},data(){return{activeNames:[]}},computed:{config(){return this.$store.state.suno?.config},isV5OrAbove(){return(this.config?.model||"")==="chirp-v5"},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})}}}}),go={key:0,class:"mb-3"},$o={class:"flex items-center mb-1"},vo={class:"text-xs font-bold"},yo={key:1,class:"mb-3"},ko={class:"flex items-center mb-1"},wo={class:"text-xs font-bold"},bo={key:2,class:"mb-3"},Co={class:"flex items-center justify-between mb-1"},So={class:"text-xs font-bold"},Vo={class:"text-xs text-[var(--el-text-color-secondary)]"},Lo={key:3,class:"mb-3"},Ao={class:"flex items-center justify-between mb-1"},jo={class:"text-xs font-bold"},Fo={class:"text-xs text-[var(--el-text-color-secondary)]"},Eo={key:4,class:"mb-3"},To={class:"flex items-center mb-1"},Uo={class:"text-xs font-bold"},Po={key:5,class:"mb-3"},Io={class:"flex items-center justify-between mb-1"},zo={class:"text-xs font-bold"},Go={class:"text-xs text-[var(--el-text-color-secondary)]"};function Mo(e,t,l,o,c,p){const d=a("el-input"),_=a("el-slider"),$=a("el-radio-button"),r=a("el-radio-group"),h=a("el-collapse-item"),b=a("el-collapse");return i(),w(b,{modelValue:e.activeNames,"onUpdate:modelValue":t[6]||(t[6]=f=>e.activeNames=f),class:"advanced-collapse"},{default:m(()=>[s(h,{title:e.$t("suno.name.advancedParams"),name:"advanced"},{default:m(()=>[e.config?.custom?(i(),g("div",go,[n("div",$o,[n("span",vo,u(e.$t("suno.name.styleNegative")),1)]),s(d,{modelValue:e.styleNegative,"onUpdate:modelValue":t[0]||(t[0]=f=>e.styleNegative=f),size:"small",placeholder:e.$t("suno.placeholder.styleNegative")},null,8,["modelValue","placeholder"])])):y("",!0),e.config?.custom&&!e.config?.instrumental?(i(),g("div",yo,[n("div",ko,[n("span",wo,u(e.$t("suno.name.lyricPrompt")),1)]),s(d,{modelValue:e.lyricPrompt,"onUpdate:modelValue":t[1]||(t[1]=f=>e.lyricPrompt=f),size:"small",placeholder:e.$t("suno.placeholder.lyricPrompt")},null,8,["modelValue","placeholder"])])):y("",!0),e.config?.custom?(i(),g("div",bo,[n("div",Co,[n("span",So,u(e.$t("suno.name.weirdness")),1),n("span",Vo,u(e.weirdness??0),1)]),s(_,{modelValue:e.weirdness,"onUpdate:modelValue":t[2]||(t[2]=f=>e.weirdness=f),min:0,max:100,step:1,size:"small"},null,8,["modelValue"])])):y("",!0),e.config?.custom?(i(),g("div",Lo,[n("div",Ao,[n("span",jo,u(e.$t("suno.name.styleInfluence")),1),n("span",Fo,u(e.styleInfluence??50),1)]),s(_,{modelValue:e.styleInfluence,"onUpdate:modelValue":t[3]||(t[3]=f=>e.styleInfluence=f),min:0,max:100,step:1,size:"small"},null,8,["modelValue"])])):y("",!0),e.isV5OrAbove?(i(),g("div",Eo,[n("div",To,[n("span",Uo,u(e.$t("suno.name.variationCategory")),1)]),s(r,{modelValue:e.variationCategory,"onUpdate:modelValue":t[4]||(t[4]=f=>e.variationCategory=f),size:"small"},{default:m(()=>[s($,{value:""},{default:m(()=>[L(u(e.$t("suno.gender.auto")),1)]),_:1}),s($,{value:"high"},{default:m(()=>[L(u(e.$t("suno.variation.high")),1)]),_:1}),s($,{value:"low"},{default:m(()=>[L(u(e.$t("suno.variation.low")),1)]),_:1})]),_:1},8,["modelValue"])])):y("",!0),e.config?.action==="cover"?(i(),g("div",Po,[n("div",Io,[n("span",zo,u(e.$t("suno.name.audioWeight")),1),n("span",Go,u(e.audioWeight??50),1)]),s(_,{modelValue:e.audioWeight,"onUpdate:modelValue":t[5]||(t[5]=f=>e.audioWeight=f),min:0,max:100,step:1,size:"small"},null,8,["modelValue"])])):y("",!0)]),_:1},8,["title"])]),_:1},8,["modelValue"])}const Ro=A(_o,[["render",Mo],["__scopeId","data-v-be135363"]]),Do=S({name:"ReplaceSectionInput",components:{ElInputNumber:ie,ElImage:N,InfoIcon:G},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"})}}}),Wo={class:"field"},Oo={class:"flex items-center mb-2"},Bo={class:"text-sm font-bold m-0"},No={key:0,class:"task mb-2"},qo={class:"left relative w-[50px] h-[50px] mr-3 flex-shrink-0"},Ho={class:"info flex-1 min-w-0"},Ko={class:"text-sm font-bold m-0 truncate"},Zo={class:"text-xs text-[var(--el-text-color-secondary)] m-0 truncate"},Xo={class:"flex gap-2"};function Yo(e,t,l,o,c,p){const d=a("info-icon"),_=a("el-image"),$=a("el-input-number"),r=Q("loading");return i(),g("div",Wo,[n("div",Oo,[n("h2",Bo,u(e.$t("suno.name.replaceSection")),1),s(d,{content:e.$t("suno.description.replaceSection")},null,8,["content"])]),e.audio?(i(),g("div",No,[n("div",{class:"audio flex items-center",onClick:t[0]||(t[0]=h=>e.onClick(e.audio))},[q((i(),g("div",qo,[s(_,{src:e.audio?.image_url,class:"w-full h-full rounded",fit:"cover"},null,8,["src"])])),[[r,!e.audio?.audio_url]]),n("div",Ho,[n("h2",Ko,u(e.audio?.title),1),n("p",Zo,u(e.audio?.style),1)])])])):y("",!0),n("div",Xo,[s($,{modelValue:e.replaceSectionStart,"onUpdate:modelValue":t[1]||(t[1]=h=>e.replaceSectionStart=h),class:"flex-1",size:"small",min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.replaceSectionStart")},null,8,["modelValue","max","placeholder"]),s($,{modelValue:e.replaceSectionEnd,"onUpdate:modelValue":t[2]||(t[2]=h=>e.replaceSectionEnd=h),class:"flex-1",size:"small",min:e.replaceSectionStart||0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.replaceSectionEnd")},null,8,["modelValue","min","max","placeholder"])])])}const Jo=A(Do,[["render",Yo]]),Qo=S({name:"PresetPanel",components:{TypeSelector:ot,PromptInput:_t,LyricInput:Ct,StyleInput:Et,TitleInput:Gt,ExtendFromInput:Yt,CoverFromInput:ro,UploadAudio:ct,VocalGenderSelector:ho,AdvancedParams:Ro,ReplaceSectionInput:Jo,FontAwesomeIcon:M,ElButton:O,Consumption:Pe},emits:["generate"],computed:{config(){return this.$store.state.suno?.config},consumption(){return ze(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"].includes(e)},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"):this.$t("suno.button.generate")}},methods:{onGenerate(){this.$emit("generate")}}}),xo={class:"flex flex-col h-full"},es={class:"flex-1 overflow-y-auto p-5"},ts={class:"flex flex-col items-center justify-center px-5 pb-5"};function os(e,t,l,o,c,p){const d=a("type-selector"),_=a("upload-audio"),$=a("prompt-input"),r=a("lyric-input"),h=a("style-input"),b=a("title-input"),f=a("vocal-gender-selector"),k=a("extend-from-input"),U=a("cover-from-input"),E=a("replace-section-input"),j=a("advanced-params"),v=a("consumption"),V=a("font-awesome-icon"),z=a("el-button");return i(),g("div",xo,[n("div",es,[s(d,{class:"mb-4"}),s(_,{class:"mb-4"}),e.config?.custom?y("",!0):(i(),w($,{key:0,class:"mb-4"})),e.config?.custom&&!e.config.instrumental?(i(),w(r,{key:1,class:"mb-4"})):y("",!0),e.config?.custom?(i(),w(h,{key:2,class:"mb-4"})):y("",!0),e.config?.custom?(i(),w(b,{key:3,class:"mb-4"})):y("",!0),e.config?.custom&&!e.config.instrumental&&e.supportsVocalGender?(i(),w(f,{key:4,class:"mb-4"})):y("",!0),e.config?.action==="extend"?(i(),w(k,{key:5,class:"mb-4"})):y("",!0),e.config?.action==="cover"?(i(),w(U,{key:6,class:"mb-4"})):y("",!0),e.config?.action==="replace_section"?(i(),w(E,{key:7,class:"mb-4"})):y("",!0),s(j,{class:"mb-4"})]),n("div",ts,[s(v,{value:e.consumption,service:e.service},null,8,["value","service"]),s(z,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:m(()=>[s(V,{icon:"fa-solid fa-magic",class:"mr-2"}),L(" "+u(e.generateButtonText),1)]),_:1},8,["onClick"])])])}const ss=A(Qo,[["render",os],["__scopeId","data-v-a4cbdb91"]]);var X={exports:{}},ns=X.exports,se;function is(){return se||(se=1,function(e,t){(function(l,o){o()})(ns,function(){function l(r,h){return typeof h>"u"?h={autoBom:!1}:typeof h!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),h={autoBom:!h}),h.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(r.type)?new Blob(["\uFEFF",r],{type:r.type}):r}function o(r,h,b){var f=new XMLHttpRequest;f.open("GET",r),f.responseType="blob",f.onload=function(){$(f.response,h,b)},f.onerror=function(){console.error("could not download file")},f.send()}function c(r){var h=new XMLHttpRequest;h.open("HEAD",r,!1);try{h.send()}catch{}return 200<=h.status&&299>=h.status}function p(r){try{r.dispatchEvent(new MouseEvent("click"))}catch{var h=document.createEvent("MouseEvents");h.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),r.dispatchEvent(h)}}var d=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Z=="object"&&Z.global===Z?Z:void 0,_=d.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),$=d.saveAs||(typeof window!="object"||window!==d?function(){}:"download"in HTMLAnchorElement.prototype&&!_?function(r,h,b){var f=d.URL||d.webkitURL,k=document.createElement("a");h=h||r.name||"download",k.download=h,k.rel="noopener",typeof r=="string"?(k.href=r,k.origin===location.origin?p(k):c(k.href)?o(r,h,b):p(k,k.target="_blank")):(k.href=f.createObjectURL(r),setTimeout(function(){f.revokeObjectURL(k.href)},4e4),setTimeout(function(){p(k)},0))}:"msSaveOrOpenBlob"in navigator?function(r,h,b){if(h=h||r.name||"download",typeof r!="string")navigator.msSaveOrOpenBlob(l(r,b),h);else if(c(r))o(r,h,b);else{var f=document.createElement("a");f.href=r,f.target="_blank",setTimeout(function(){p(f)})}}:function(r,h,b,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof r=="string")return o(r,h,b);var k=r.type==="application/octet-stream",U=/constructor/i.test(d.HTMLElement)||d.safari,E=/CriOS\/[\d]+/.test(navigator.userAgent);if((E||k&&U||_)&&typeof FileReader<"u"){var j=new FileReader;j.onloadend=function(){var z=j.result;z=E?z:z.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=z:location=z,f=null},j.readAsDataURL(r)}else{var v=d.URL||d.webkitURL,V=v.createObjectURL(r);f?f.location=V:location.href=V,f=null,setTimeout(function(){v.revokeObjectURL(V)},4e4)}});d.saveAs=$.saveAs=$,e.exports=$})}(X)),X.exports}var as=is();const ls="https://webhook.acedata.cloud/suno",rs=S({name:"TaskPreview",components:{ElImage:N,ElIcon:J,ElTooltip:ve,FontAwesomeIcon:M,VideoPlay:ee,VideoPause:x,ElDropdown:$e,ElDropdownMenu:ge,ElDropdownItem:_e,Loading:he},props:{modelValue:{type:Object,required:!0}},data(){return{isFetchingVideoUrl:!1,isFetchingWav:!1,isFetchingMidi:!1}},computed:{loading(){return this.$store.state.suno?.status?.getApplications===R.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(l=>({...l,action:t})):e},application(){return this.$store.state.suno?.application},active(){return this.$store.state.suno?.tasks?.active}},methods:{useFormatDuring:W,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 o=new URL(t).pathname,c=o.substring(o.lastIndexOf("/")+1);console.log("on preview",c),fetch(t).then(p=>p.blob()).then(p=>{as.saveAs(p,c)})},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),C.error(this.$t("suno.message.getVideoUrlFailed"))}finally{this.isFetchingVideoUrl=!1}},async fetchVideoUrlFromApi(e){return new Promise((t,l)=>{const o={audio_id:e},c=this.credential?.token;if(!c){console.error("no token specified"),l(new Error("No token specified"));return}P.mp4(o,{token:c}).then(p=>{const d=p.data?.data?.video_url;d?t(d):l(new Error("Video URL not found in response"))}).catch(p=>{l(p)})})},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]})},async handleWavDownload(e){if(!e?.id||this.isFetchingWav)return;const t=this.credential?.token;if(t)try{this.isFetchingWav=!0,C.info(this.$t("suno.message.fetchingWav"));const o=(await P.wav({audio_id:e.id},{token:t})).data?.data?.audio_url;o?this.onDownload(null,o):C.error(this.$t("suno.message.fetchWavFailed"))}catch{C.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,C.info(this.$t("suno.message.fetchingMidi"));const o=(await P.midi({audio_id:e.id},{token:t})).data?.data?.midi_url;o?this.onDownload(null,o):C.error(this.$t("suno.message.fetchMidiFailed"))}catch{C.error(this.$t("suno.message.fetchMidiFailed"))}finally{this.isFetchingMidi=!1}},async onGenerateAudioUrl(e,t){const l={action:e,audio_id:t,callback_url:ls},o=this.credential?.token;if(!o){console.error("no token specified");return}C.info(this.$t("suno.message.startingTask")),P.audio(l,{token:o}).then(()=>{C.success(this.$t("suno.message.startTaskSuccess"))}).catch(c=>{C.error(c?.response?.data?.error?.message||this.$t("suno.message.startTaskFailed"))}).finally(async()=>{await this.onGetTasks(),await this.onScrollDown()})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".tasks");e&&(e.scrollTop=e.scrollHeight)},1e3)},async onGetTasks(){if(this.loading){console.debug("loading");return}await this.$store.dispatch("suno/getTasks",{limit:30,offset:0})}}}),cs={class:"task"},us=["onClick"],ds={class:"left"},ps=["onClick"],ms=["onClick"],fs={key:2,class:"duration"},hs={class:"info"},_s={class:"title"},gs={class:"style"},$s={class:"right"},vs={class:"el-dropdown-link"},ys={class:"flex items-center min-w-[120px]"},ks={class:"flex items-center min-w-[120px]"},ws={class:"flex items-center min-w-[120px]"},bs={class:"el-dropdown-link"};function Cs(e,t,l,o,c,p){const d=a("el-image"),_=a("video-pause"),$=a("el-icon"),r=a("video-play"),h=a("font-awesome-icon"),b=a("el-tooltip"),f=a("Loading"),k=a("el-dropdown-item"),U=a("el-dropdown-menu"),E=a("el-dropdown"),j=Q("loading");return i(),g("div",cs,[(i(!0),g(D,null,Y(e.audios,v=>(i(),g("div",{key:v.id,class:"audio",onClick:F(V=>e.onClick(v),["stop"])},[q((i(),g("div",ds,[s(d,{src:v?.image_url,class:"cover",fit:"cover",lazy:""},null,8,["src"]),v?.audio_url&&e.$store.state?.suno?.audio?.id===v.id&&e.$store.state?.suno?.audio?.state==="playing"?(i(),g("div",{key:0,class:"overlay",onClick:F(V=>e.onPause(v),["stop"])},[s($,null,{default:m(()=>[s(_)]),_:1})],8,ps)):y("",!0),v?.audio_url&&(e.$store.state?.suno?.audio?.id!==v.id||e.$store.state?.suno?.audio?.id===v.id&&e.$store.state?.suno?.audio?.state==="paused")?(i(),g("div",{key:1,class:"overlay",onClick:F(V=>e.onPlay(v),["stop"])},[s($,null,{default:m(()=>[s(r)]),_:1})],8,ms)):y("",!0),v?.duration?(i(),g("div",fs,u(e.useFormatDuring(v?.duration)),1)):y("",!0)])),[[j,!v?.audio_url]]),n("div",hs,[n("h2",_s,u(v?.title),1),n("p",gs,u(v?.style),1)]),n("div",$s,[s(E,null,{dropdown:m(()=>[s(U,null,{default:m(()=>[s(k,{disabled:e.isFetchingVideoUrl,onClick:V=>e.handleVideoDownload(v)},{default:m(()=>[n("div",ys,[e.isFetchingVideoUrl?(i(),w($,{key:0,class:"is-loading mr-2"},{default:m(()=>[s(f)]),_:1})):y("",!0),n("span",null,u(e.$t("suno.button.download_video")),1)])]),_:2},1032,["disabled","onClick"]),v?.audio_url?(i(),w(k,{key:0,onClick:F(V=>e.onDownload(V,v?.audio_url),["stop"])},{default:m(()=>[L(u(e.$t("suno.button.download_audio")),1)]),_:2},1032,["onClick"])):y("",!0),s(k,{disabled:e.isFetchingWav,onClick:V=>e.handleWavDownload(v)},{default:m(()=>[n("div",ks,[e.isFetchingWav?(i(),w($,{key:0,class:"is-loading mr-2"},{default:m(()=>[s(f)]),_:1})):y("",!0),n("span",null,u(e.$t("suno.button.download_wav")),1)])]),_:2},1032,["disabled","onClick"]),s(k,{disabled:e.isFetchingMidi,onClick:V=>e.handleMidiDownload(v)},{default:m(()=>[n("div",ws,[e.isFetchingMidi?(i(),w($,{key:0,class:"is-loading mr-2"},{default:m(()=>[s(f)]),_:1})):y("",!0),n("span",null,u(e.$t("suno.button.download_midi")),1)])]),_:2},1032,["disabled","onClick"])]),_:2},1024)]),default:m(()=>[n("span",vs,[s(b,{effect:"dark",content:e.$t("suno.button.download"),placement:"top"},{default:m(()=>[v?.audio_url||v?.video_url?(i(),w(h,{key:0,icon:"fa-solid fa-download",class:"icon icon-download"})):y("",!0)]),_:2},1032,["content"])])]),_:2},1024),s(E,null,{dropdown:m(()=>[s(U,null,{default:m(()=>[v?.audio_url?(i(),w(k,{key:0,onClick:F(V=>e.onExtend(V,v),["stop"])},{default:m(()=>[L(u(e.$t("suno.button.extend")),1)]),_:2},1032,["onClick"])):y("",!0),v.id?(i(),w(k,{key:1,onClick:F(V=>e.onGetStems(v.id),["stop"])},{default:m(()=>[L(u(e.$t("suno.button.get_stems")),1)]),_:2},1032,["onClick"])):y("",!0),v.id?(i(),w(k,{key:2,onClick:F(V=>e.onGetAllStems(v.id),["stop"])},{default:m(()=>[L(u(e.$t("suno.button.all_stems")),1)]),_:2},1032,["onClick"])):y("",!0),s(k,{onClick:F(V=>e.onCover(v),["stop"])},{default:m(()=>[L(u(e.$t("suno.button.cover_music")),1)]),_:2},1032,["onClick"]),v?.id?(i(),w(k,{key:3,onClick:F(V=>e.onRemaster(v.id),["stop"])},{default:m(()=>[L(u(e.$t("suno.button.remaster")),1)]),_:2},1032,["onClick"])):y("",!0),v?.id?(i(),w(k,{key:4,onClick:F(V=>e.onReplaceSection(v),["stop"])},{default:m(()=>[L(u(e.$t("suno.button.replace_section")),1)]),_:2},1032,["onClick"])):y("",!0),v?.id?(i(),w(k,{key:5,onClick:F(V=>e.onMashup(v),["stop"])},{default:m(()=>[L(u(e.$t("suno.button.mashup")),1)]),_:2},1032,["onClick"])):y("",!0),v?.id&&v?.action==="extend"?(i(),w(k,{key:6,onClick:F(V=>e.onConcatMusic(v?.id),["stop"])},{default:m(()=>[L(u(e.$t("suno.button.concat_music")),1)]),_:2},1032,["onClick"])):y("",!0)]),_:2},1024)]),default:m(()=>[n("span",bs,[s(b,{effect:"dark",content:e.$t("suno.button.more"),placement:"top"},{default:m(()=>[v?.audio_url||v?.video_url?(i(),w(h,{key:0,icon:"fa-solid fa-ellipsis",class:"icon icon-ellipsis"})):y("",!0)]),_:2},1032,["content"])])]),_:2},1024)])],8,us))),128))])}const Ss=A(rs,[["render",Cs]]),Vs={class:"player-slider"},Ls=S({__name:"PlayerSlider",setup(e){const t=H(),l=I({get:()=>t.state.suno?.audio?.progress,set:d=>t.commit("suno/setAudio",{...t.state.suno.audio,progress:d})}),o=I({get:()=>t.state.suno?.audio?.duration,set:d=>t.commit("suno/setAudio",{...t.state.suno.audio,duration:d})}),c=()=>{},p=d=>t.dispatch("suno/setAudio",{...t.state.suno.audio,progress:d});return(d,_)=>(i(),g("div",Vs,[s(T(te),{modelValue:l.value,"onUpdate:modelValue":_[0]||(_[0]=$=>l.value=$),"show-tooltip":!1,min:0,max:o.value,onChange:p,onInput:c},null,8,["modelValue","max"])]))}}),As="/assets/disk-XFRmVAfp.png",js={class:"flex player-song"},Fs=["src"],Es={class:"ml-2 text-xs flex flex-col justify-between"},Ts={class:"w-52 2xl:w-96 cursor-pointer truncate"},Us={class:"flex"},Ps={class:"ml-2 text-dc"},Is=S({__name:"PlayerSong",setup(e){const t=H(),l=I({get:()=>t.state.suno.audio,set:o=>t.commit("suno/setAudio",o)});return Se(l,(o,c)=>{if(o?.audio_url!==c?.audio_url){console.log("audio changed",o),o.object&&(console.log("111",o.object),o.object.pause(),delete o.object);const p=new Audio(o.audio_url);o.state==="playing"?p.play():p.pause(),p.addEventListener("loadedmetadata",()=>{p.currentTime=0,p.addEventListener("timeupdate",()=>{t.commit("suno/setAudio",{...t.state.suno.audio,progress:p.currentTime})})}),t.commit("suno/setAudio",{...t.state.suno.audio,object:p})}else if(o?.progress!==c?.progress&&Math.abs(o.progress-o.object.currentTime)>2){console.log("progress changed",o.progress);const p=t.state.suno.audio;p.object&&(p.object.currentTime=p.progress)}else o?.state!==c?.state&&(console.log("state changed",o.state),o.object&&(o.state==="playing"?o.object.play():o.object.pause()));o?.volume!==c?.volume&&(console.log("volume changed",o.volume),o.object&&(o.object.volume=o.volume/100))}),(o,c)=>(i(),g("div",js,[n("img",{alt:"",class:"w-11 h-11 rounded",src:l.value?.image_url||T(As)},null,8,Fs),n("div",Es,[n("div",Ts,[n("div",Us,[n("span",null,u(l.value?.title||"Music"),1),n("span",Ps,"- "+u(l.value?.style||"SmallRuralDog"),1)])])])]))}}),zs={class:"flex justify-end items-center gap-x-2.5"},Gs={class:"text-xs"},Ms=S({__name:"PlayerAction",setup(e){const t=H(),l=I({get:()=>t.state.suno?.audio?.progress,set:c=>t.commit("suno/setAudio",{...t.state.suno.audio,progress:c})}),o=I({get:()=>t.state.suno?.audio?.duration,set:c=>t.commit("suno/setAudio",{...t.state.suno.audio,duration:c})});return(c,p)=>(i(),g("div",zs,[n("span",Gs,u(T(W)(l.value))+" / "+u(T(W)(o.value)),1)]))}});var Rs={size:"1em",strokeWidth:4,strokeLinecap:"round",strokeLinejoin:"round",rtl:!1,theme:"outline",colors:{outline:{fill:"#333",background:"transparent"},filled:{fill:"#333",background:"#FFF"},twoTone:{fill:"#333",twoTone:"#2F88FF"},multiColor:{outStrokeColor:"#333",outFillColor:"#2F88FF",innerStrokeColor:"#FFF",innerFillColor:"#43CCF8"}},prefix:"i"};function Ds(){return"icon-"+((1+Math.random())*4294967296|0).toString(16).substring(1)}function Ws(e,t,l){var o=typeof t.fill=="string"?[t.fill]:t.fill||[],c=[],p=t.theme||l.theme;switch(p){case"outline":c.push(typeof o[0]=="string"?o[0]:"currentColor"),c.push("none"),c.push(typeof o[0]=="string"?o[0]:"currentColor"),c.push("none");break;case"filled":c.push(typeof o[0]=="string"?o[0]:"currentColor"),c.push(typeof o[0]=="string"?o[0]:"currentColor"),c.push("#FFF"),c.push("#FFF");break;case"two-tone":c.push(typeof o[0]=="string"?o[0]:"currentColor"),c.push(typeof o[1]=="string"?o[1]:l.colors.twoTone.twoTone),c.push(typeof o[0]=="string"?o[0]:"currentColor"),c.push(typeof o[1]=="string"?o[1]:l.colors.twoTone.twoTone);break;case"multi-color":c.push(typeof o[0]=="string"?o[0]:"currentColor"),c.push(typeof o[1]=="string"?o[1]:l.colors.multiColor.outFillColor),c.push(typeof o[2]=="string"?o[2]:l.colors.multiColor.innerStrokeColor),c.push(typeof o[3]=="string"?o[3]:l.colors.multiColor.innerFillColor);break}return{size:t.size||l.size,strokeWidth:t.strokeWidth||l.strokeWidth,strokeLinecap:t.strokeLinecap||l.strokeLinecap,strokeLinejoin:t.strokeLinejoin||l.strokeLinejoin,colors:c,id:e}}var Os=Symbol("icon-context");function oe(e,t,l){var o={name:"icon-"+e,props:["size","strokeWidth","strokeLinecap","strokeLinejoin","theme","fill","spin"],setup:function(p){var d=Ds(),_=Ve(Os,Rs);return function(){var $=p.size,r=p.strokeWidth,h=p.strokeLinecap,b=p.strokeLinejoin,f=p.theme,k=p.fill,U=p.spin,E=Ws(d,{size:$,strokeWidth:r,strokeLinecap:h,strokeLinejoin:b,theme:f,fill:k},_),j=[_.prefix+"-icon"];return j.push(_.prefix+"-icon-"+e),t&&_.rtl&&j.push(_.prefix+"-icon-rtl"),U&&j.push(_.prefix+"-icon-spin"),s("span",{class:j.join(" ")},[l(E)])}}};return o}const Bs=oe("pause-one",!1,function(e){return s("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},[s("path",{d:"M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z",fill:e.colors[1],stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linejoin":e.strokeLinejoin},null),s("path",{d:"M19 18V30",stroke:e.colors[2],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null),s("path",{d:"M29 18V30",stroke:e.colors[2],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null)])}),Ns=oe("play",!0,function(e){return s("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},[s("path",{d:"M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z",fill:e.colors[1],stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linejoin":e.strokeLinejoin},null),s("path",{d:"M20 24V17.0718L26 20.5359L32 24L26 27.4641L20 30.9282V24Z",fill:e.colors[3],stroke:e.colors[2],"stroke-width":e.strokeWidth,"stroke-linejoin":e.strokeLinejoin},null)])}),qs=oe("volume-small",!0,function(e){return s("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},[s("path",{d:"M24 6V42C17 42 11.7985 32.8391 11.7985 32.8391H6C4.89543 32.8391 4 31.9437 4 30.8391V17.0108C4 15.9062 4.89543 15.0108 6 15.0108H11.7985C11.7985 15.0108 17 6 24 6Z",fill:e.colors[1],stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linejoin":e.strokeLinejoin},null),s("path",{d:"M32 15L32 15C32.6232 15.5565 33.1881 16.1797 33.6841 16.8588C35.1387 18.8504 36 21.3223 36 24C36 26.6545 35.1535 29.1067 33.7218 31.0893C33.2168 31.7885 32.6391 32.4293 32 33",stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null)])}),ne=S({__name:"IconPark",props:{icon:{},theme:{},size:{},spin:{type:Boolean},fill:{},strokeLinecap:{},strokeLinejoin:{},strokeWidth:{}},setup(e){return(t,l)=>(i(),w(Le(t.icon),{theme:t.theme,size:t.size,spin:t.spin,fill:t.fill,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin,"stroke-width":t.strokeWidth},null,8,["theme","size","spin","fill","stroke-linecap","stroke-linejoin","stroke-width"]))}}),Hs={class:"player-volume flex flex-col items-center pt-2"},Ks={class:"text-sm mt-3"},Zs=S({__name:"PlayerVolumeSlider",setup(e){const t=H(),l=I({get:()=>t.state.suno.audio?.volume,set:p=>t.commit("suno/setAudio",{...t.state.suno.audio,volume:p})}),o=I({get:()=>t.state.suno.audio?.muted,set:p=>t.commit("suno/setAudio",{...t.state.suno.audio,muted:p})}),c=p=>t.dispatch("suno/setVolume",p);return(p,d)=>(i(),g("div",Hs,[s(T(te),{modelValue:l.value,"onUpdate:modelValue":d[0]||(d[0]=_=>l.value=_),vertical:"",height:"100px","show-tooltip":!1,max:100,min:0,size:"small",disabled:o.value,onInput:c},null,8,["modelValue","disabled"]),n("div",Ks,u(l.value),1)]))}}),Xs={class:"flex items-center justify-center gap-x-3"},Ys=S({__name:"PlayerController",setup(e){const t=H(),l=()=>t.dispatch("suno/setAudio",{...t.state.suno.audio,state:t.state.suno.audio.state==="playing"?"paused":"playing"}),o=I(()=>t.state.suno.audio);return(c,p)=>(i(),g("div",Xs,[s(ne,{icon:o.value?.state==="playing"?T(Bs):T(Ns),size:"45",theme:"filled",class:"text-[var(--el-color-primary)] cursor-pointer",onClick:l},null,8,["icon"]),s(T(ye),{placement:"top",width:"50px",trigger:"click"},{reference:m(()=>[s(ne,{icon:T(qs),size:"20","stroke-width":2,class:"cursor-pointer"},null,8,["icon"])]),default:m(()=>[s(Zs)]),_:1})]))}}),Js={class:"flex flex-col items-stretch h-20"},Qs={class:"flex grow px-5 items-center"},xs={class:"flex-1"},en={class:"flex-1"},tn={class:"flex-1"},on=S({__name:"Player",setup(e){return(t,l)=>(i(),g("div",Js,[s(Ls),n("div",Qs,[n("div",xs,[s(Is)]),n("div",en,[s(Ys)]),n("div",tn,[s(Ms)])])]))}}),sn=S({name:"RecentPanel",components:{ElSkeletonItem:we,ElSkeleton:ke,TaskPreview:Ss,Player:on,NoTasks:Ie,ScrollList:Ue},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.suno?.tasks,items:this.$store.state.suno?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),nn={key:0,class:"tasks"},an={class:"left w-[70px] p-[10px] flex items-center"},ln={class:"main w-[calc(100%-70px)] flex-1 p-[10px]"},rn={key:2,class:"w-full flex-1 flex items-center justify-center"},cn={class:"h-20"};function un(e,t,l,o,c,p){const d=a("el-skeleton-item"),_=a("el-skeleton"),$=a("task-preview"),r=a("scroll-list"),h=a("no-tasks"),b=a("player");return i(),g(D,null,[e.tasks?.items===void 0?(i(),g("div",nn,[(i(),g(D,null,Y(3,f=>n("div",{key:f,class:"flex"},[n("div",an,[s(_,{animated:""},{template:m(()=>[s(d,{variant:"image",class:"avatar w-[50px] h-[50px]"})]),_:1})]),n("div",ln,[s(_,{animated:""},{template:m(()=>[s(d,{variant:"p",class:"w-[200px] h-[15px] mb-[5px] mt-[10px]"}),s(d,{variant:"text"})]),_:1})])])),64))])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(i(),w(r,{key:1,ref:"scrollList",class:"flex-1 w-full overflow-y-auto tasks p-2",loading:e.loading,onReachTop:t[0]||(t[0]=f=>e.$emit("reach-top"))},{default:m(()=>[(i(!0),g(D,null,Y(e.tasks?.items,(f,k)=>(i(),w($,{key:k,"model-value":f,class:"preview"},null,8,["model-value"]))),128))]),_:1},8,["loading"])):y("",!0),e.tasks?.items?.length===0?(i(),g("div",rn,[s(h)])):y("",!0),q(n("div",cn,[s(b)],512),[[Ae,!!e.$store?.state?.suno?.audio?.object]])],64)}const dn=A(sn,[["render",un]]),pn=S({name:"TaskPreview",components:{IconPicture:Ce,ElImage:N,ElAvatar:be,ElIcon:J},computed:{audio(){return this.$store.state.suno?.audio}}}),mn={key:0,class:"size-full overflow-hidden"},fn={class:"relative h-[300px]"},hn={class:"flex items-center justify-center size-full bg-[var(--el-bg-color)]"},_n={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"},gn={class:"p-4"},$n={class:"flex items-center font-bold mb-2"},vn={class:"text-[var(--el-text-color-regular)] mb-2"},yn={class:"text-xs text-[var(--el-text-color-regular)]"},kn={class:"mt-4 text-sm leading-[25px] whitespace-pre-wrap"},wn={key:1,class:"w-full h-full"};function bn(e,t,l,o,c,p){const d=a("icon-picture"),_=a("el-icon"),$=a("el-image"),r=a("el-avatar");return e.audio?.object?(i(),g("div",mn,[n("div",fn,[s($,{src:e.audio.image_url,fit:"cover",class:"size-full"},{error:m(()=>[n("div",hn,[s(_,{class:"text-3xl"},{default:m(()=>[s(d)]),_:1})])]),_:1},8,["src"]),n("h2",_n,u(e.audio?.title),1)]),n("div",gn,[n("div",$n,[s(r,{size:30,src:e.audio?.image_url,class:"mr-2"},null,8,["src"]),n("span",null,u(e.audio?.title),1)]),n("p",vn,u(e.audio?.style),1),n("p",yn,u(e.$dayjs.format(e.audio?.created_at)),1),n("div",kn,[n("p",null,u(e.audio?.lyric),1)])])])):(i(),g("div",wn))}const Cn=A(pn,[["render",bn]]),Sn="https://webhook.acedata.cloud/suno",Vn=S({name:"SunoIndex",components:{Layout:Ne,ConfigPanel:ss,RecentPanel:dn,PreviewPanel:Cn},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.suno?.status?.getApplications===R.Request},tasksLoading(){return this.$store.state.suno?.status?.getTasks===R.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===R.Request},needApply(){return this.$store.state.suno.status.getApplications===R.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 Ge({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(){Ee.create({application:this.application}).then(({data:e})=>{this.application=e,C.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{e?.response?.data?.code===Te&&C.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:l,createdAtMax:o}=e||{};console.debug("limit",t,"createdAtMin",l,"createdAtMax",o),this.fetchingTasks=!0;try{await this.$store.dispatch("suno/getTasks",{limit:t,createdAtMin:l,createdAtMax:o})}finally{this.fetchingTasks=!1}},async onGenerateAudio(){const e={...this.config,callback_url:Sn},t=this.credential?.token;if(!t){console.error("no token specified");return}C.info(this.$t("suno.message.startingTask")),P.audio(e,{token:t}).then(()=>{C.success(this.$t("suno.message.startTaskSuccess"))}).catch(l=>{C.error(l?.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 Ln(e,t,l,o,c,p){const d=a("config-panel"),_=a("recent-panel"),$=a("preview-panel"),r=a("layout");return i(),w(r,null,{config:m(()=>[s(d,{onGenerate:e.onGenerateAudio},null,8,["onGenerate"])]),result:m(()=>[s(_,{ref:"recentPanel",class:"panel recent",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),preview:m(()=>[s($)]),_:1})}const Dn=A(Vn,[["render",Ln],["__scopeId","data-v-d1296b1a"]]);export{Dn as default};
1
+ import{F as M}from"./index.es-vNwt4sbI.js";import{l as O,S as re,k as ce,N as ue,O as de,t as pe,u as C,s as B,a1 as x,a2 as ee,U as ie,e as J,j as N,D as ae,F as le,V as te,a3 as me,a4 as fe,Z as he,f as _e,g as ge,h as $e,p as ve,q as ye,K as ke,Y as we,a5 as be,a6 as Ce}from"./vendor-element-plus-B4FTqxj4.js";import{d as S,C as g,G as n,T as s,E as K,K as m,ai as a,D as i,O as y,R as u,S as D,ag as Y,J as w,Q as L,L as q,aq as Q,X as F,c as I,u as T,w as Se,b as Ve,P as Le,U as Ae}from"./vendor-vue-1w_NBnjl.js";import{_ as A,c4 as je,c5 as P,aj as Fe,ay as R,c6 as H,ar as Ee,ax as Te}from"./index-CqL6zWO4.js";import{I as G,S as Ue}from"./ScrollList-BGZ0Fkh5.js";import{C as Pe,N as Ie}from"./NoTasks-Dpxe4xfM.js";import{a as ze}from"./price-C8BXaFbS.js";import{j as Z}from"./vendor-dayjs-CzbnksQQ.js";import{l as Ge}from"./pagination-CihAE3FS.js";import"./vendor-web3-BT8AOwfJ.js";import"./vendor-axios-NIGUFBhG.js";import"./vendor-vue-router-Dj5bcX0v.js";const Me=S({name:"LayoutSuno",components:{ElDrawer:re,ElButton:O,FontAwesomeIcon:M},data(){return{drawer:!1,preview:!1}},computed:{}}),Re={class:"main flex flex-row flex-1"},De={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},We={class:"result h-full flex flex-col flex-1 min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"},Oe={class:"preview h-full w-[300px] flex flex-col"};function Be(e,t,l,o,c,p){const d=a("font-awesome-icon"),_=a("el-button"),$=a("el-drawer");return i(),g("div",Re,[n("div",De,[K(e.$slots,"config",{},void 0,!0)]),n("div",We,[K(e.$slots,"result",{},void 0,!0)]),n("div",Oe,[K(e.$slots,"preview",{},void 0,!0)]),s(_,{circle:"",class:"menu",onClick:t[0]||(t[0]=r=>e.drawer=!0)},{default:m(()=>[s(d,{icon:"fa-solid fa-magic"})]),_:1}),s($,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=r=>e.drawer=r),direction:"ltr","with-header":!1,size:"340px",class:"drawer"},{default:m(()=>[K(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Ne=A(Me,[["render",Be],["__scopeId","data-v-c6c85757"]]),qe=S({name:"TypeSelector",components:{ElSelect:de,ElOption:ue,ElSwitch:ce},data(){return{options:[{label:"Suno v5",value:"chirp-v5",info:"8 min"},{label:"Suno v4.5+",value:"chirp-v4-5-plus",info:"8 min"},{label:"Suno v4.5",value:"chirp-v4-5",info:"4 min"},{label:"Suno v4",value:"chirp-v4",info:"2.5 min"},{label:"Suno v3.5",value:"chirp-v3-5",info:"2 min"},{label:"Suno v3",value:"chirp-v3-0",info:"2 min"}]}},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=je)}}),He={class:"flex items-center justify-between mb-3"},Ke={class:"text-sm font-bold"},Ze={class:"mb-3"},Xe={class:"flex items-center mb-1"},Ye={class:"text-sm font-bold"},Je={class:"flex items-center justify-between w-full"},Qe={class:"text-xs text-[var(--el-text-color-placeholder)]"},xe={key:0,class:"flex items-center justify-between mb-3"},et={class:"text-sm font-bold"};function tt(e,t,l,o,c,p){const d=a("el-switch"),_=a("el-option"),$=a("el-select");return i(),g("div",null,[n("div",He,[n("span",Ke,u(e.$t("suno.name.type")),1),s(d,{modelValue:e.custom,"onUpdate:modelValue":t[0]||(t[0]=r=>e.custom=r),size:"small"},null,8,["modelValue"])]),n("div",Ze,[n("div",Xe,[n("span",Ye,u(e.$t("suno.name.model")),1)]),s($,{modelValue:e.model,"onUpdate:modelValue":t[1]||(t[1]=r=>e.model=r),class:"w-full",size:"default",placeholder:e.$t("suno.placeholder.select")},{default:m(()=>[(i(!0),g(D,null,Y(e.options,r=>(i(),w(_,{key:r.value,label:r.label,value:r.value},{default:m(()=>[n("div",Je,[n("span",null,u(r.label),1),n("span",Qe,u(r.info),1)])]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),e.custom?(i(),g("div",xe,[n("span",et,u(e.$t("suno.name.instrumental")),1),s(d,{modelValue:e.instrumental,"onUpdate:modelValue":t[2]||(t[2]=r=>e.instrumental=r),size:"small"},null,8,["modelValue"])])):y("",!0)])}const ot=A(qe,[["render",tt]]),st=S({name:"UploadAudio",components:{ElUpload:pe,ElButton:O,InfoIcon:G,FontAwesomeIcon:M},emits:["change"],data(){return{fileList:[],uploadUrl:Fe()+"/api/v1/files/"}},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(){}}},watch:{urls:{handler(e){this.$emit("change",e)}}},mounted(){this.value||(this.value=void 0),this.onSetAudio()},methods:{onExceed(){C.warning(this.$t("suno.message.uploadReferencesExceed"))},onError(){C.error(this.$t("suno.message.uploadReferencesError"))},async onSuccess(){const e=this.urls?.[0];await this.onGenerateAudioId(e)},async onGenerateAudioId(e){const t={audio_url:e},l=this.credential?.token;if(!l){console.error("no token specified");return}C.info(this.$t("suno.message.startingUploadAudio")),P.upload(t,{token:l}).then(o=>{console.debug("get upload music success",o.data);const c=o.data?.data.audio_id;this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,audio_id:c,action:"upload_extend"}),C.success(this.$t("suno.message.startUploadAudioSuccess"))}).catch(o=>{C.error(o?.response?.data?.error?.message||this.$t("suno.message.startUploadAudioFailed"))})},onSetAudio(){}}}),nt={class:"relative"},it={class:"flex justify-between"},at={class:"flex justify-start items-center"},lt={class:"text-sm font-bold"};function rt(e,t,l,o,c,p){const d=a("info-icon"),_=a("font-awesome-icon"),$=a("el-button"),r=a("el-upload");return i(),g("div",nt,[n("div",it,[n("div",at,[n("span",lt,u(e.$t("suno.name.referenceAudios")),1),s(d,{content:e.$t("suno.description.uploadAudios")},null,8,["content"])])]),s(r,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=h=>e.fileList=h),name:"file",limit:1,class:"upload-wrapper",action:e.uploadUrl,accept:".mp3","show-file-list":!0,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{default:m(()=>[s($,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:m(()=>[s(_,{icon:"fa-solid fa-upload",class:"icon mr-1"}),L(" "+u(e.$t("suno.button.uploadAudios")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const ct=A(st,[["render",rt],["__scopeId","data-v-6236152c"]]),ut="",dt=S({name:"PromptInput",components:{ElInput:B,InfoIcon:G},computed:{prompt:{get(){return this.$store.state.suno?.config?.prompt},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=ut)}}),pt={class:"field"},mt={class:"flex items-center mb-1"},ft={class:"text-sm font-bold"};function ht(e,t,l,o,c,p){const d=a("info-icon"),_=a("el-input");return i(),g("div",pt,[n("div",mt,[n("span",ft,u(e.$t("suno.name.songDescription")),1),s(d,{content:e.$t("suno.description.prompt")},null,8,["content"])]),s(_,{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"])])}const _t=A(dt,[["render",ht]]),gt="",$t=S({name:"LyricInput",components:{ElInput:B,ElButton:O,FontAwesomeIcon:M,InfoIcon:G},data(){return{generatingLyrics:!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=gt)},methods:{async onGenerateLyrics(){const e=this.credential?.token;if(!e)return;const t=this.config?.style||this.config?.title||"a beautiful song";this.generatingLyrics=!0,C.info(this.$t("suno.message.generatingLyrics"));try{const o=(await P.lyric({prompt:t},{token:e})).data?.data;o?.text&&(this.lyric=o.text,o?.title&&!this.config?.title&&this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,lyric:o.text,title:o.title}),C.success(this.$t("suno.message.generateLyricsSuccess")))}catch{C.error(this.$t("suno.message.generateLyricsFailed"))}finally{this.generatingLyrics=!1}}}}),vt={class:"field"},yt={class:"flex items-center justify-between mb-1"},kt={class:"flex items-center"},wt={class:"text-sm font-bold"};function bt(e,t,l,o,c,p){const d=a("info-icon"),_=a("font-awesome-icon"),$=a("el-button"),r=a("el-input");return i(),g("div",vt,[n("div",yt,[n("div",kt,[n("span",wt,u(e.$t("suno.name.lyrics")),1),s(d,{content:e.$t("suno.description.lyrics")},null,8,["content"])]),e.config?.action!=="extend"?(i(),w($,{key:0,size:"small",loading:e.generatingLyrics,round:"",onClick:e.onGenerateLyrics},{default:m(()=>[e.generatingLyrics?y("",!0):(i(),w(_,{key:0,icon:"fa-solid fa-wand-magic-sparkles",class:"mr-1"})),L(" "+u(e.$t("suno.button.generate_lyrics")),1)]),_:1},8,["loading","onClick"])):y("",!0)]),e.config?.action!=="extend"?(i(),w(r,{key:0,modelValue:e.lyric,"onUpdate:modelValue":t[0]||(t[0]=h=>e.lyric=h),rows:5,type:"textarea",class:"lyrics",placeholder:e.$t("suno.placeholder.lyrics")},null,8,["modelValue","placeholder"])):(i(),w(r,{key:1,modelValue:e.lyric,"onUpdate:modelValue":t[1]||(t[1]=h=>e.lyric=h),rows:5,type:"textarea",class:"lyrics",placeholder:e.$t("suno.placeholder.extend.lyrics")},null,8,["modelValue","placeholder"]))])}const Ct=A($t,[["render",bt],["__scopeId","data-v-210d2670"]]),St=S({name:"StyleInput",components:{ElInput:B,ElButton:O,FontAwesomeIcon:M,InfoIcon:G},data(){return{optimizing:!1}},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}},methods:{async onOptimizeStyle(){const e=this.credential?.token;if(!(!e||!this.style)){this.optimizing=!0,C.info(this.$t("suno.message.optimizingStyle"));try{const t=await P.style({prompt:this.style},{token:e}),l=t.data?.text||t.data?.data?.text;l&&(this.style=l,C.success(this.$t("suno.message.optimizeStyleSuccess")))}catch{C.error(this.$t("suno.message.optimizeStyleFailed"))}finally{this.optimizing=!1}}}}}),Vt={class:"field"},Lt={class:"flex items-center justify-between mb-1"},At={class:"flex items-center"},jt={class:"text-sm font-bold"};function Ft(e,t,l,o,c,p){const d=a("info-icon"),_=a("font-awesome-icon"),$=a("el-button"),r=a("el-input");return i(),g("div",Vt,[n("div",Lt,[n("div",At,[n("span",jt,u(e.$t("suno.name.style")),1),s(d,{content:e.$t("suno.description.style")},null,8,["content"])]),s($,{size:"small",loading:e.optimizing,round:"",onClick:e.onOptimizeStyle},{default:m(()=>[e.optimizing?y("",!0):(i(),w(_,{key:0,icon:"fa-solid fa-wand-magic-sparkles",class:"mr-1"})),L(" "+u(e.$t("suno.button.optimize_style")),1)]),_:1},8,["loading","onClick"])]),s(r,{modelValue:e.style,"onUpdate:modelValue":t[0]||(t[0]=h=>e.style=h),rows:2,type:"textarea",placeholder:e.$t("suno.placeholder.style")},null,8,["modelValue","placeholder"])])}const Et=A(St,[["render",Ft]]),Tt=S({name:"TitleInput",components:{ElInput:B,InfoIcon:G},computed:{title:{get(){return this.$store.state.suno?.config?.title},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,title:e})}}}}),Ut={class:"field"},Pt={class:"flex items-center mb-1"},It={class:"text-sm font-bold"};function zt(e,t,l,o,c,p){const d=a("info-icon"),_=a("el-input");return i(),g("div",Ut,[n("div",Pt,[n("span",It,u(e.$t("suno.name.title")),1),s(d,{content:e.$t("suno.description.title")},null,8,["content"])]),s(_,{modelValue:e.title,"onUpdate:modelValue":t[0]||(t[0]=$=>e.title=$),placeholder:e.$t("suno.placeholder.title")},null,8,["modelValue","placeholder"])])}const Gt=A(Tt,[["render",zt]]);function W(e){const t=Math.floor(e)%60;e=Math.floor(e/60);const l=e%60,o=l<10?`0${l}`:l,c=t<10?`0${t}`:t;return o+":"+c}const Mt=S({name:"ExtendFromInput",components:{ElImage:N,ElIcon:J,ElInputNumber:ie,VideoPlay:ee,VideoPause:x},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:W,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})}}}),Rt={class:"field"},Dt={class:"box"},Wt={class:"title font-bold"},Ot={class:"input-wrapper"},Bt={class:"task"},Nt={class:"left"},qt={key:2,class:"duration"},Ht={class:"info"},Kt={class:"title"},Zt={class:"style"};function Xt(e,t,l,o,c,p){const d=a("el-input-number"),_=a("el-image"),$=a("video-pause"),r=a("el-icon"),h=a("video-play"),b=Q("loading");return i(),g("div",Rt,[n("div",Dt,[n("h2",Wt,u(e.$t("suno.name.extend")),1),n("div",Ot,[s(d,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=f=>e.value=f),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"])])]),n("div",Bt,[e.audio?(i(),g("div",{key:0,class:"audio",onClick:t[3]||(t[3]=f=>e.onClick(e.audio))},[q((i(),g("div",Nt,[s(_,{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"?(i(),g("div",{key:0,class:"overlay",onClick:t[1]||(t[1]=f=>e.onPause(e.audio))},[s(r,null,{default:m(()=>[s($)]),_:1})])):y("",!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")?(i(),g("div",{key:1,class:"overlay",onClick:t[2]||(t[2]=f=>e.onPlay(e.audio))},[s(r,null,{default:m(()=>[s(h)]),_:1})])):y("",!0),e.audio?.duration?(i(),g("div",qt,u(e.useFormatDuring(e.audio?.duration)),1)):y("",!0)])),[[b,!e.audio?.audio_url]]),n("div",Ht,[n("h2",Kt,u(e.audio?.title),1),n("p",Zt,u(e.audio?.style),1)])])):y("",!0)])])}const Yt=A(Mt,[["render",Xt],["__scopeId","data-v-bcce4821"]]),Jt=S({name:"CoverFromInput",components:{ElImage:N,ElIcon:J,VideoPlay:ee,VideoPause:x},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:W,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})}}}),Qt={class:"field"},xt={class:"box"},eo={class:"title font-bold"},to={class:"task"},oo={class:"left"},so={key:2,class:"duration"},no={class:"info"},io={class:"title"},ao={class:"style"};function lo(e,t,l,o,c,p){const d=a("el-image"),_=a("video-pause"),$=a("el-icon"),r=a("video-play"),h=Q("loading");return i(),g("div",Qt,[n("div",xt,[n("h2",eo,u(e.$t("suno.name.cover")),1)]),n("div",to,[e.audio?(i(),g("div",{key:0,class:"audio",onClick:t[2]||(t[2]=b=>e.onClick(e.audio))},[q((i(),g("div",oo,[s(d,{src:e.audio?.image_url,class:"cover",fit:"cover"},null,8,["src"]),e.audio?.audio_url&&e.$store.state?.suno?.audio?.id===e.audio.id&&e.$store.state?.suno?.audio?.state==="playing"?(i(),g("div",{key:0,class:"overlay",onClick:t[0]||(t[0]=b=>e.onPause(e.audio))},[s($,null,{default:m(()=>[s(_)]),_:1})])):y("",!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")?(i(),g("div",{key:1,class:"overlay",onClick:t[1]||(t[1]=b=>e.onPlay(e.audio))},[s($,null,{default:m(()=>[s(r)]),_:1})])):y("",!0),e.audio?.duration?(i(),g("div",so,u(e.useFormatDuring(e.audio?.duration)),1)):y("",!0)])),[[h,!e.audio?.audio_url]]),n("div",no,[n("h2",io,u(e.audio?.title),1),n("p",ao,u(e.audio?.style),1)])])):y("",!0)])])}const ro=A(Jt,[["render",lo],["__scopeId","data-v-06640216"]]),co=S({name:"VocalGenderSelector",components:{ElRadioGroup:le,ElRadioButton:ae,InfoIcon:G},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})}}}}),uo={class:"mb-2"},po={class:"flex items-center mb-1"},mo={class:"text-sm font-bold"};function fo(e,t,l,o,c,p){const d=a("info-icon"),_=a("el-radio-button"),$=a("el-radio-group");return i(),g("div",uo,[n("div",po,[n("span",mo,u(e.$t("suno.name.vocalGender")),1),s(d,{content:e.$t("suno.description.vocalGender")},null,8,["content"])]),s($,{modelValue:e.vocalGender,"onUpdate:modelValue":t[0]||(t[0]=r=>e.vocalGender=r),size:"small"},{default:m(()=>[s(_,{value:""},{default:m(()=>[L(u(e.$t("suno.gender.auto")),1)]),_:1}),s(_,{value:"f"},{default:m(()=>[L(u(e.$t("suno.gender.female")),1)]),_:1}),s(_,{value:"m"},{default:m(()=>[L(u(e.$t("suno.gender.male")),1)]),_:1})]),_:1},8,["modelValue"])])}const ho=A(co,[["render",fo]]),_o=S({name:"AdvancedParams",components:{ElCollapse:fe,ElCollapseItem:me,ElInput:B,ElSlider:te,ElRadioGroup:le,ElRadioButton:ae},data(){return{activeNames:[]}},computed:{config(){return this.$store.state.suno?.config},isV5OrAbove(){return(this.config?.model||"")==="chirp-v5"},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})}}}}),go={key:0,class:"mb-3"},$o={class:"flex items-center mb-1"},vo={class:"text-xs font-bold"},yo={key:1,class:"mb-3"},ko={class:"flex items-center mb-1"},wo={class:"text-xs font-bold"},bo={key:2,class:"mb-3"},Co={class:"flex items-center justify-between mb-1"},So={class:"text-xs font-bold"},Vo={class:"text-xs text-[var(--el-text-color-secondary)]"},Lo={key:3,class:"mb-3"},Ao={class:"flex items-center justify-between mb-1"},jo={class:"text-xs font-bold"},Fo={class:"text-xs text-[var(--el-text-color-secondary)]"},Eo={key:4,class:"mb-3"},To={class:"flex items-center mb-1"},Uo={class:"text-xs font-bold"},Po={key:5,class:"mb-3"},Io={class:"flex items-center justify-between mb-1"},zo={class:"text-xs font-bold"},Go={class:"text-xs text-[var(--el-text-color-secondary)]"};function Mo(e,t,l,o,c,p){const d=a("el-input"),_=a("el-slider"),$=a("el-radio-button"),r=a("el-radio-group"),h=a("el-collapse-item"),b=a("el-collapse");return i(),w(b,{modelValue:e.activeNames,"onUpdate:modelValue":t[6]||(t[6]=f=>e.activeNames=f),class:"advanced-collapse"},{default:m(()=>[s(h,{title:e.$t("suno.name.advancedParams"),name:"advanced"},{default:m(()=>[e.config?.custom?(i(),g("div",go,[n("div",$o,[n("span",vo,u(e.$t("suno.name.styleNegative")),1)]),s(d,{modelValue:e.styleNegative,"onUpdate:modelValue":t[0]||(t[0]=f=>e.styleNegative=f),size:"small",placeholder:e.$t("suno.placeholder.styleNegative")},null,8,["modelValue","placeholder"])])):y("",!0),e.config?.custom&&!e.config?.instrumental?(i(),g("div",yo,[n("div",ko,[n("span",wo,u(e.$t("suno.name.lyricPrompt")),1)]),s(d,{modelValue:e.lyricPrompt,"onUpdate:modelValue":t[1]||(t[1]=f=>e.lyricPrompt=f),size:"small",placeholder:e.$t("suno.placeholder.lyricPrompt")},null,8,["modelValue","placeholder"])])):y("",!0),e.config?.custom?(i(),g("div",bo,[n("div",Co,[n("span",So,u(e.$t("suno.name.weirdness")),1),n("span",Vo,u(e.weirdness??0),1)]),s(_,{modelValue:e.weirdness,"onUpdate:modelValue":t[2]||(t[2]=f=>e.weirdness=f),min:0,max:100,step:1,size:"small"},null,8,["modelValue"])])):y("",!0),e.config?.custom?(i(),g("div",Lo,[n("div",Ao,[n("span",jo,u(e.$t("suno.name.styleInfluence")),1),n("span",Fo,u(e.styleInfluence??50),1)]),s(_,{modelValue:e.styleInfluence,"onUpdate:modelValue":t[3]||(t[3]=f=>e.styleInfluence=f),min:0,max:100,step:1,size:"small"},null,8,["modelValue"])])):y("",!0),e.isV5OrAbove?(i(),g("div",Eo,[n("div",To,[n("span",Uo,u(e.$t("suno.name.variationCategory")),1)]),s(r,{modelValue:e.variationCategory,"onUpdate:modelValue":t[4]||(t[4]=f=>e.variationCategory=f),size:"small"},{default:m(()=>[s($,{value:""},{default:m(()=>[L(u(e.$t("suno.gender.auto")),1)]),_:1}),s($,{value:"high"},{default:m(()=>[L(u(e.$t("suno.variation.high")),1)]),_:1}),s($,{value:"low"},{default:m(()=>[L(u(e.$t("suno.variation.low")),1)]),_:1})]),_:1},8,["modelValue"])])):y("",!0),e.config?.action==="cover"?(i(),g("div",Po,[n("div",Io,[n("span",zo,u(e.$t("suno.name.audioWeight")),1),n("span",Go,u(e.audioWeight??50),1)]),s(_,{modelValue:e.audioWeight,"onUpdate:modelValue":t[5]||(t[5]=f=>e.audioWeight=f),min:0,max:100,step:1,size:"small"},null,8,["modelValue"])])):y("",!0)]),_:1},8,["title"])]),_:1},8,["modelValue"])}const Ro=A(_o,[["render",Mo],["__scopeId","data-v-be135363"]]),Do=S({name:"ReplaceSectionInput",components:{ElInputNumber:ie,ElImage:N,InfoIcon:G},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"})}}}),Wo={class:"field"},Oo={class:"flex items-center mb-2"},Bo={class:"text-sm font-bold m-0"},No={key:0,class:"task mb-2"},qo={class:"left relative w-[50px] h-[50px] mr-3 flex-shrink-0"},Ho={class:"info flex-1 min-w-0"},Ko={class:"text-sm font-bold m-0 truncate"},Zo={class:"text-xs text-[var(--el-text-color-secondary)] m-0 truncate"},Xo={class:"flex gap-2"};function Yo(e,t,l,o,c,p){const d=a("info-icon"),_=a("el-image"),$=a("el-input-number"),r=Q("loading");return i(),g("div",Wo,[n("div",Oo,[n("h2",Bo,u(e.$t("suno.name.replaceSection")),1),s(d,{content:e.$t("suno.description.replaceSection")},null,8,["content"])]),e.audio?(i(),g("div",No,[n("div",{class:"audio flex items-center",onClick:t[0]||(t[0]=h=>e.onClick(e.audio))},[q((i(),g("div",qo,[s(_,{src:e.audio?.image_url,class:"w-full h-full rounded",fit:"cover"},null,8,["src"])])),[[r,!e.audio?.audio_url]]),n("div",Ho,[n("h2",Ko,u(e.audio?.title),1),n("p",Zo,u(e.audio?.style),1)])])])):y("",!0),n("div",Xo,[s($,{modelValue:e.replaceSectionStart,"onUpdate:modelValue":t[1]||(t[1]=h=>e.replaceSectionStart=h),class:"flex-1",size:"small",min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.replaceSectionStart")},null,8,["modelValue","max","placeholder"]),s($,{modelValue:e.replaceSectionEnd,"onUpdate:modelValue":t[2]||(t[2]=h=>e.replaceSectionEnd=h),class:"flex-1",size:"small",min:e.replaceSectionStart||0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.replaceSectionEnd")},null,8,["modelValue","min","max","placeholder"])])])}const Jo=A(Do,[["render",Yo]]),Qo=S({name:"PresetPanel",components:{TypeSelector:ot,PromptInput:_t,LyricInput:Ct,StyleInput:Et,TitleInput:Gt,ExtendFromInput:Yt,CoverFromInput:ro,UploadAudio:ct,VocalGenderSelector:ho,AdvancedParams:Ro,ReplaceSectionInput:Jo,FontAwesomeIcon:M,ElButton:O,Consumption:Pe},emits:["generate"],computed:{config(){return this.$store.state.suno?.config},consumption(){return ze(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"].includes(e)},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"):this.$t("suno.button.generate")}},methods:{onGenerate(){this.$emit("generate")}}}),xo={class:"flex flex-col h-full"},es={class:"flex-1 overflow-y-auto p-5"},ts={class:"flex flex-col items-center justify-center px-5 pb-5"};function os(e,t,l,o,c,p){const d=a("type-selector"),_=a("upload-audio"),$=a("prompt-input"),r=a("lyric-input"),h=a("style-input"),b=a("title-input"),f=a("vocal-gender-selector"),k=a("extend-from-input"),U=a("cover-from-input"),E=a("replace-section-input"),j=a("advanced-params"),v=a("consumption"),V=a("font-awesome-icon"),z=a("el-button");return i(),g("div",xo,[n("div",es,[s(d,{class:"mb-4"}),s(_,{class:"mb-4"}),e.config?.custom?y("",!0):(i(),w($,{key:0,class:"mb-4"})),e.config?.custom&&!e.config.instrumental?(i(),w(r,{key:1,class:"mb-4"})):y("",!0),e.config?.custom?(i(),w(h,{key:2,class:"mb-4"})):y("",!0),e.config?.custom?(i(),w(b,{key:3,class:"mb-4"})):y("",!0),e.config?.custom&&!e.config.instrumental&&e.supportsVocalGender?(i(),w(f,{key:4,class:"mb-4"})):y("",!0),e.config?.action==="extend"?(i(),w(k,{key:5,class:"mb-4"})):y("",!0),e.config?.action==="cover"?(i(),w(U,{key:6,class:"mb-4"})):y("",!0),e.config?.action==="replace_section"?(i(),w(E,{key:7,class:"mb-4"})):y("",!0),s(j,{class:"mb-4"})]),n("div",ts,[s(v,{value:e.consumption,service:e.service},null,8,["value","service"]),s(z,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:m(()=>[s(V,{icon:"fa-solid fa-magic",class:"mr-2"}),L(" "+u(e.generateButtonText),1)]),_:1},8,["onClick"])])])}const ss=A(Qo,[["render",os],["__scopeId","data-v-a4cbdb91"]]);var X={exports:{}},ns=X.exports,se;function is(){return se||(se=1,function(e,t){(function(l,o){o()})(ns,function(){function l(r,h){return typeof h>"u"?h={autoBom:!1}:typeof h!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),h={autoBom:!h}),h.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(r.type)?new Blob(["\uFEFF",r],{type:r.type}):r}function o(r,h,b){var f=new XMLHttpRequest;f.open("GET",r),f.responseType="blob",f.onload=function(){$(f.response,h,b)},f.onerror=function(){console.error("could not download file")},f.send()}function c(r){var h=new XMLHttpRequest;h.open("HEAD",r,!1);try{h.send()}catch{}return 200<=h.status&&299>=h.status}function p(r){try{r.dispatchEvent(new MouseEvent("click"))}catch{var h=document.createEvent("MouseEvents");h.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),r.dispatchEvent(h)}}var d=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Z=="object"&&Z.global===Z?Z:void 0,_=d.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),$=d.saveAs||(typeof window!="object"||window!==d?function(){}:"download"in HTMLAnchorElement.prototype&&!_?function(r,h,b){var f=d.URL||d.webkitURL,k=document.createElement("a");h=h||r.name||"download",k.download=h,k.rel="noopener",typeof r=="string"?(k.href=r,k.origin===location.origin?p(k):c(k.href)?o(r,h,b):p(k,k.target="_blank")):(k.href=f.createObjectURL(r),setTimeout(function(){f.revokeObjectURL(k.href)},4e4),setTimeout(function(){p(k)},0))}:"msSaveOrOpenBlob"in navigator?function(r,h,b){if(h=h||r.name||"download",typeof r!="string")navigator.msSaveOrOpenBlob(l(r,b),h);else if(c(r))o(r,h,b);else{var f=document.createElement("a");f.href=r,f.target="_blank",setTimeout(function(){p(f)})}}:function(r,h,b,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof r=="string")return o(r,h,b);var k=r.type==="application/octet-stream",U=/constructor/i.test(d.HTMLElement)||d.safari,E=/CriOS\/[\d]+/.test(navigator.userAgent);if((E||k&&U||_)&&typeof FileReader<"u"){var j=new FileReader;j.onloadend=function(){var z=j.result;z=E?z:z.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=z:location=z,f=null},j.readAsDataURL(r)}else{var v=d.URL||d.webkitURL,V=v.createObjectURL(r);f?f.location=V:location.href=V,f=null,setTimeout(function(){v.revokeObjectURL(V)},4e4)}});d.saveAs=$.saveAs=$,e.exports=$})}(X)),X.exports}var as=is();const ls="https://webhook.acedata.cloud/suno",rs=S({name:"TaskPreview",components:{ElImage:N,ElIcon:J,ElTooltip:ve,FontAwesomeIcon:M,VideoPlay:ee,VideoPause:x,ElDropdown:$e,ElDropdownMenu:ge,ElDropdownItem:_e,Loading:he},props:{modelValue:{type:Object,required:!0}},data(){return{isFetchingVideoUrl:!1,isFetchingWav:!1,isFetchingMidi:!1}},computed:{loading(){return this.$store.state.suno?.status?.getApplications===R.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(l=>({...l,action:t})):e},application(){return this.$store.state.suno?.application},active(){return this.$store.state.suno?.tasks?.active}},methods:{useFormatDuring:W,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 o=new URL(t).pathname,c=o.substring(o.lastIndexOf("/")+1);console.log("on preview",c),fetch(t).then(p=>p.blob()).then(p=>{as.saveAs(p,c)})},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),C.error(this.$t("suno.message.getVideoUrlFailed"))}finally{this.isFetchingVideoUrl=!1}},async fetchVideoUrlFromApi(e){return new Promise((t,l)=>{const o={audio_id:e},c=this.credential?.token;if(!c){console.error("no token specified"),l(new Error("No token specified"));return}P.mp4(o,{token:c}).then(p=>{const d=p.data?.data?.video_url;d?t(d):l(new Error("Video URL not found in response"))}).catch(p=>{l(p)})})},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]})},async handleWavDownload(e){if(!e?.id||this.isFetchingWav)return;const t=this.credential?.token;if(t)try{this.isFetchingWav=!0,C.info(this.$t("suno.message.fetchingWav"));const o=(await P.wav({audio_id:e.id},{token:t})).data?.data?.audio_url;o?this.onDownload(null,o):C.error(this.$t("suno.message.fetchWavFailed"))}catch{C.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,C.info(this.$t("suno.message.fetchingMidi"));const o=(await P.midi({audio_id:e.id},{token:t})).data?.data?.midi_url;o?this.onDownload(null,o):C.error(this.$t("suno.message.fetchMidiFailed"))}catch{C.error(this.$t("suno.message.fetchMidiFailed"))}finally{this.isFetchingMidi=!1}},async onGenerateAudioUrl(e,t){const l={action:e,audio_id:t,callback_url:ls},o=this.credential?.token;if(!o){console.error("no token specified");return}C.info(this.$t("suno.message.startingTask")),P.audio(l,{token:o}).then(()=>{C.success(this.$t("suno.message.startTaskSuccess"))}).catch(c=>{C.error(c?.response?.data?.error?.message||this.$t("suno.message.startTaskFailed"))}).finally(async()=>{await this.onGetTasks(),await this.onScrollDown()})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".tasks");e&&(e.scrollTop=e.scrollHeight)},1e3)},async onGetTasks(){if(this.loading){console.debug("loading");return}await this.$store.dispatch("suno/getTasks",{limit:30,offset:0})}}}),cs={class:"task"},us=["onClick"],ds={class:"left"},ps=["onClick"],ms=["onClick"],fs={key:2,class:"duration"},hs={class:"info"},_s={class:"title"},gs={class:"style"},$s={class:"right"},vs={class:"el-dropdown-link"},ys={class:"flex items-center min-w-[120px]"},ks={class:"flex items-center min-w-[120px]"},ws={class:"flex items-center min-w-[120px]"},bs={class:"el-dropdown-link"};function Cs(e,t,l,o,c,p){const d=a("el-image"),_=a("video-pause"),$=a("el-icon"),r=a("video-play"),h=a("font-awesome-icon"),b=a("el-tooltip"),f=a("Loading"),k=a("el-dropdown-item"),U=a("el-dropdown-menu"),E=a("el-dropdown"),j=Q("loading");return i(),g("div",cs,[(i(!0),g(D,null,Y(e.audios,v=>(i(),g("div",{key:v.id,class:"audio",onClick:F(V=>e.onClick(v),["stop"])},[q((i(),g("div",ds,[s(d,{src:v?.image_url,class:"cover",fit:"cover",lazy:""},null,8,["src"]),v?.audio_url&&e.$store.state?.suno?.audio?.id===v.id&&e.$store.state?.suno?.audio?.state==="playing"?(i(),g("div",{key:0,class:"overlay",onClick:F(V=>e.onPause(v),["stop"])},[s($,null,{default:m(()=>[s(_)]),_:1})],8,ps)):y("",!0),v?.audio_url&&(e.$store.state?.suno?.audio?.id!==v.id||e.$store.state?.suno?.audio?.id===v.id&&e.$store.state?.suno?.audio?.state==="paused")?(i(),g("div",{key:1,class:"overlay",onClick:F(V=>e.onPlay(v),["stop"])},[s($,null,{default:m(()=>[s(r)]),_:1})],8,ms)):y("",!0),v?.duration?(i(),g("div",fs,u(e.useFormatDuring(v?.duration)),1)):y("",!0)])),[[j,!v?.audio_url]]),n("div",hs,[n("h2",_s,u(v?.title),1),n("p",gs,u(v?.style),1)]),n("div",$s,[s(E,null,{dropdown:m(()=>[s(U,null,{default:m(()=>[s(k,{disabled:e.isFetchingVideoUrl,onClick:V=>e.handleVideoDownload(v)},{default:m(()=>[n("div",ys,[e.isFetchingVideoUrl?(i(),w($,{key:0,class:"is-loading mr-2"},{default:m(()=>[s(f)]),_:1})):y("",!0),n("span",null,u(e.$t("suno.button.download_video")),1)])]),_:2},1032,["disabled","onClick"]),v?.audio_url?(i(),w(k,{key:0,onClick:F(V=>e.onDownload(V,v?.audio_url),["stop"])},{default:m(()=>[L(u(e.$t("suno.button.download_audio")),1)]),_:2},1032,["onClick"])):y("",!0),s(k,{disabled:e.isFetchingWav,onClick:V=>e.handleWavDownload(v)},{default:m(()=>[n("div",ks,[e.isFetchingWav?(i(),w($,{key:0,class:"is-loading mr-2"},{default:m(()=>[s(f)]),_:1})):y("",!0),n("span",null,u(e.$t("suno.button.download_wav")),1)])]),_:2},1032,["disabled","onClick"]),s(k,{disabled:e.isFetchingMidi,onClick:V=>e.handleMidiDownload(v)},{default:m(()=>[n("div",ws,[e.isFetchingMidi?(i(),w($,{key:0,class:"is-loading mr-2"},{default:m(()=>[s(f)]),_:1})):y("",!0),n("span",null,u(e.$t("suno.button.download_midi")),1)])]),_:2},1032,["disabled","onClick"])]),_:2},1024)]),default:m(()=>[n("span",vs,[s(b,{effect:"dark",content:e.$t("suno.button.download"),placement:"top"},{default:m(()=>[v?.audio_url||v?.video_url?(i(),w(h,{key:0,icon:"fa-solid fa-download",class:"icon icon-download"})):y("",!0)]),_:2},1032,["content"])])]),_:2},1024),s(E,null,{dropdown:m(()=>[s(U,null,{default:m(()=>[v?.audio_url?(i(),w(k,{key:0,onClick:F(V=>e.onExtend(V,v),["stop"])},{default:m(()=>[L(u(e.$t("suno.button.extend")),1)]),_:2},1032,["onClick"])):y("",!0),v.id?(i(),w(k,{key:1,onClick:F(V=>e.onGetStems(v.id),["stop"])},{default:m(()=>[L(u(e.$t("suno.button.get_stems")),1)]),_:2},1032,["onClick"])):y("",!0),v.id?(i(),w(k,{key:2,onClick:F(V=>e.onGetAllStems(v.id),["stop"])},{default:m(()=>[L(u(e.$t("suno.button.all_stems")),1)]),_:2},1032,["onClick"])):y("",!0),s(k,{onClick:F(V=>e.onCover(v),["stop"])},{default:m(()=>[L(u(e.$t("suno.button.cover_music")),1)]),_:2},1032,["onClick"]),v?.id?(i(),w(k,{key:3,onClick:F(V=>e.onRemaster(v.id),["stop"])},{default:m(()=>[L(u(e.$t("suno.button.remaster")),1)]),_:2},1032,["onClick"])):y("",!0),v?.id?(i(),w(k,{key:4,onClick:F(V=>e.onReplaceSection(v),["stop"])},{default:m(()=>[L(u(e.$t("suno.button.replace_section")),1)]),_:2},1032,["onClick"])):y("",!0),v?.id?(i(),w(k,{key:5,onClick:F(V=>e.onMashup(v),["stop"])},{default:m(()=>[L(u(e.$t("suno.button.mashup")),1)]),_:2},1032,["onClick"])):y("",!0),v?.id&&v?.action==="extend"?(i(),w(k,{key:6,onClick:F(V=>e.onConcatMusic(v?.id),["stop"])},{default:m(()=>[L(u(e.$t("suno.button.concat_music")),1)]),_:2},1032,["onClick"])):y("",!0)]),_:2},1024)]),default:m(()=>[n("span",bs,[s(b,{effect:"dark",content:e.$t("suno.button.more"),placement:"top"},{default:m(()=>[v?.audio_url||v?.video_url?(i(),w(h,{key:0,icon:"fa-solid fa-ellipsis",class:"icon icon-ellipsis"})):y("",!0)]),_:2},1032,["content"])])]),_:2},1024)])],8,us))),128))])}const Ss=A(rs,[["render",Cs]]),Vs={class:"player-slider"},Ls=S({__name:"PlayerSlider",setup(e){const t=H(),l=I({get:()=>t.state.suno?.audio?.progress,set:d=>t.commit("suno/setAudio",{...t.state.suno.audio,progress:d})}),o=I({get:()=>t.state.suno?.audio?.duration,set:d=>t.commit("suno/setAudio",{...t.state.suno.audio,duration:d})}),c=()=>{},p=d=>t.dispatch("suno/setAudio",{...t.state.suno.audio,progress:d});return(d,_)=>(i(),g("div",Vs,[s(T(te),{modelValue:l.value,"onUpdate:modelValue":_[0]||(_[0]=$=>l.value=$),"show-tooltip":!1,min:0,max:o.value,onChange:p,onInput:c},null,8,["modelValue","max"])]))}}),As="/assets/disk-XFRmVAfp.png",js={class:"flex player-song"},Fs=["src"],Es={class:"ml-2 text-xs flex flex-col justify-between"},Ts={class:"w-52 2xl:w-96 cursor-pointer truncate"},Us={class:"flex"},Ps={class:"ml-2 text-dc"},Is=S({__name:"PlayerSong",setup(e){const t=H(),l=I({get:()=>t.state.suno.audio,set:o=>t.commit("suno/setAudio",o)});return Se(l,(o,c)=>{if(o?.audio_url!==c?.audio_url){console.log("audio changed",o),o.object&&(console.log("111",o.object),o.object.pause(),delete o.object);const p=new Audio(o.audio_url);o.state==="playing"?p.play():p.pause(),p.addEventListener("loadedmetadata",()=>{p.currentTime=0,p.addEventListener("timeupdate",()=>{t.commit("suno/setAudio",{...t.state.suno.audio,progress:p.currentTime})})}),t.commit("suno/setAudio",{...t.state.suno.audio,object:p})}else if(o?.progress!==c?.progress&&Math.abs(o.progress-o.object.currentTime)>2){console.log("progress changed",o.progress);const p=t.state.suno.audio;p.object&&(p.object.currentTime=p.progress)}else o?.state!==c?.state&&(console.log("state changed",o.state),o.object&&(o.state==="playing"?o.object.play():o.object.pause()));o?.volume!==c?.volume&&(console.log("volume changed",o.volume),o.object&&(o.object.volume=o.volume/100))}),(o,c)=>(i(),g("div",js,[n("img",{alt:"",class:"w-11 h-11 rounded",src:l.value?.image_url||T(As)},null,8,Fs),n("div",Es,[n("div",Ts,[n("div",Us,[n("span",null,u(l.value?.title||"Music"),1),n("span",Ps,"- "+u(l.value?.style||"SmallRuralDog"),1)])])])]))}}),zs={class:"flex justify-end items-center gap-x-2.5"},Gs={class:"text-xs"},Ms=S({__name:"PlayerAction",setup(e){const t=H(),l=I({get:()=>t.state.suno?.audio?.progress,set:c=>t.commit("suno/setAudio",{...t.state.suno.audio,progress:c})}),o=I({get:()=>t.state.suno?.audio?.duration,set:c=>t.commit("suno/setAudio",{...t.state.suno.audio,duration:c})});return(c,p)=>(i(),g("div",zs,[n("span",Gs,u(T(W)(l.value))+" / "+u(T(W)(o.value)),1)]))}});var Rs={size:"1em",strokeWidth:4,strokeLinecap:"round",strokeLinejoin:"round",rtl:!1,theme:"outline",colors:{outline:{fill:"#333",background:"transparent"},filled:{fill:"#333",background:"#FFF"},twoTone:{fill:"#333",twoTone:"#2F88FF"},multiColor:{outStrokeColor:"#333",outFillColor:"#2F88FF",innerStrokeColor:"#FFF",innerFillColor:"#43CCF8"}},prefix:"i"};function Ds(){return"icon-"+((1+Math.random())*4294967296|0).toString(16).substring(1)}function Ws(e,t,l){var o=typeof t.fill=="string"?[t.fill]:t.fill||[],c=[],p=t.theme||l.theme;switch(p){case"outline":c.push(typeof o[0]=="string"?o[0]:"currentColor"),c.push("none"),c.push(typeof o[0]=="string"?o[0]:"currentColor"),c.push("none");break;case"filled":c.push(typeof o[0]=="string"?o[0]:"currentColor"),c.push(typeof o[0]=="string"?o[0]:"currentColor"),c.push("#FFF"),c.push("#FFF");break;case"two-tone":c.push(typeof o[0]=="string"?o[0]:"currentColor"),c.push(typeof o[1]=="string"?o[1]:l.colors.twoTone.twoTone),c.push(typeof o[0]=="string"?o[0]:"currentColor"),c.push(typeof o[1]=="string"?o[1]:l.colors.twoTone.twoTone);break;case"multi-color":c.push(typeof o[0]=="string"?o[0]:"currentColor"),c.push(typeof o[1]=="string"?o[1]:l.colors.multiColor.outFillColor),c.push(typeof o[2]=="string"?o[2]:l.colors.multiColor.innerStrokeColor),c.push(typeof o[3]=="string"?o[3]:l.colors.multiColor.innerFillColor);break}return{size:t.size||l.size,strokeWidth:t.strokeWidth||l.strokeWidth,strokeLinecap:t.strokeLinecap||l.strokeLinecap,strokeLinejoin:t.strokeLinejoin||l.strokeLinejoin,colors:c,id:e}}var Os=Symbol("icon-context");function oe(e,t,l){var o={name:"icon-"+e,props:["size","strokeWidth","strokeLinecap","strokeLinejoin","theme","fill","spin"],setup:function(p){var d=Ds(),_=Ve(Os,Rs);return function(){var $=p.size,r=p.strokeWidth,h=p.strokeLinecap,b=p.strokeLinejoin,f=p.theme,k=p.fill,U=p.spin,E=Ws(d,{size:$,strokeWidth:r,strokeLinecap:h,strokeLinejoin:b,theme:f,fill:k},_),j=[_.prefix+"-icon"];return j.push(_.prefix+"-icon-"+e),t&&_.rtl&&j.push(_.prefix+"-icon-rtl"),U&&j.push(_.prefix+"-icon-spin"),s("span",{class:j.join(" ")},[l(E)])}}};return o}const Bs=oe("pause-one",!1,function(e){return s("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},[s("path",{d:"M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z",fill:e.colors[1],stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linejoin":e.strokeLinejoin},null),s("path",{d:"M19 18V30",stroke:e.colors[2],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null),s("path",{d:"M29 18V30",stroke:e.colors[2],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null)])}),Ns=oe("play",!0,function(e){return s("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},[s("path",{d:"M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z",fill:e.colors[1],stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linejoin":e.strokeLinejoin},null),s("path",{d:"M20 24V17.0718L26 20.5359L32 24L26 27.4641L20 30.9282V24Z",fill:e.colors[3],stroke:e.colors[2],"stroke-width":e.strokeWidth,"stroke-linejoin":e.strokeLinejoin},null)])}),qs=oe("volume-small",!0,function(e){return s("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},[s("path",{d:"M24 6V42C17 42 11.7985 32.8391 11.7985 32.8391H6C4.89543 32.8391 4 31.9437 4 30.8391V17.0108C4 15.9062 4.89543 15.0108 6 15.0108H11.7985C11.7985 15.0108 17 6 24 6Z",fill:e.colors[1],stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linejoin":e.strokeLinejoin},null),s("path",{d:"M32 15L32 15C32.6232 15.5565 33.1881 16.1797 33.6841 16.8588C35.1387 18.8504 36 21.3223 36 24C36 26.6545 35.1535 29.1067 33.7218 31.0893C33.2168 31.7885 32.6391 32.4293 32 33",stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null)])}),ne=S({__name:"IconPark",props:{icon:{},theme:{},size:{},spin:{type:Boolean},fill:{},strokeLinecap:{},strokeLinejoin:{},strokeWidth:{}},setup(e){return(t,l)=>(i(),w(Le(t.icon),{theme:t.theme,size:t.size,spin:t.spin,fill:t.fill,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin,"stroke-width":t.strokeWidth},null,8,["theme","size","spin","fill","stroke-linecap","stroke-linejoin","stroke-width"]))}}),Hs={class:"player-volume flex flex-col items-center pt-2"},Ks={class:"text-sm mt-3"},Zs=S({__name:"PlayerVolumeSlider",setup(e){const t=H(),l=I({get:()=>t.state.suno.audio?.volume,set:p=>t.commit("suno/setAudio",{...t.state.suno.audio,volume:p})}),o=I({get:()=>t.state.suno.audio?.muted,set:p=>t.commit("suno/setAudio",{...t.state.suno.audio,muted:p})}),c=p=>t.dispatch("suno/setVolume",p);return(p,d)=>(i(),g("div",Hs,[s(T(te),{modelValue:l.value,"onUpdate:modelValue":d[0]||(d[0]=_=>l.value=_),vertical:"",height:"100px","show-tooltip":!1,max:100,min:0,size:"small",disabled:o.value,onInput:c},null,8,["modelValue","disabled"]),n("div",Ks,u(l.value),1)]))}}),Xs={class:"flex items-center justify-center gap-x-3"},Ys=S({__name:"PlayerController",setup(e){const t=H(),l=()=>t.dispatch("suno/setAudio",{...t.state.suno.audio,state:t.state.suno.audio.state==="playing"?"paused":"playing"}),o=I(()=>t.state.suno.audio);return(c,p)=>(i(),g("div",Xs,[s(ne,{icon:o.value?.state==="playing"?T(Bs):T(Ns),size:"45",theme:"filled",class:"text-[var(--el-color-primary)] cursor-pointer",onClick:l},null,8,["icon"]),s(T(ye),{placement:"top",width:"50px",trigger:"click"},{reference:m(()=>[s(ne,{icon:T(qs),size:"20","stroke-width":2,class:"cursor-pointer"},null,8,["icon"])]),default:m(()=>[s(Zs)]),_:1})]))}}),Js={class:"flex flex-col items-stretch h-20"},Qs={class:"flex grow px-5 items-center"},xs={class:"flex-1"},en={class:"flex-1"},tn={class:"flex-1"},on=S({__name:"Player",setup(e){return(t,l)=>(i(),g("div",Js,[s(Ls),n("div",Qs,[n("div",xs,[s(Is)]),n("div",en,[s(Ys)]),n("div",tn,[s(Ms)])])]))}}),sn=S({name:"RecentPanel",components:{ElSkeletonItem:we,ElSkeleton:ke,TaskPreview:Ss,Player:on,NoTasks:Ie,ScrollList:Ue},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.suno?.tasks,items:this.$store.state.suno?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),nn={key:0,class:"tasks"},an={class:"left w-[70px] p-[10px] flex items-center"},ln={class:"main w-[calc(100%-70px)] flex-1 p-[10px]"},rn={key:2,class:"w-full flex-1 flex items-center justify-center"},cn={class:"h-20"};function un(e,t,l,o,c,p){const d=a("el-skeleton-item"),_=a("el-skeleton"),$=a("task-preview"),r=a("scroll-list"),h=a("no-tasks"),b=a("player");return i(),g(D,null,[e.tasks?.items===void 0?(i(),g("div",nn,[(i(),g(D,null,Y(3,f=>n("div",{key:f,class:"flex"},[n("div",an,[s(_,{animated:""},{template:m(()=>[s(d,{variant:"image",class:"avatar w-[50px] h-[50px]"})]),_:1})]),n("div",ln,[s(_,{animated:""},{template:m(()=>[s(d,{variant:"p",class:"w-[200px] h-[15px] mb-[5px] mt-[10px]"}),s(d,{variant:"text"})]),_:1})])])),64))])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(i(),w(r,{key:1,ref:"scrollList",class:"flex-1 w-full overflow-y-auto tasks p-2",loading:e.loading,onReachTop:t[0]||(t[0]=f=>e.$emit("reach-top"))},{default:m(()=>[(i(!0),g(D,null,Y(e.tasks?.items,(f,k)=>(i(),w($,{key:k,"model-value":f,class:"preview"},null,8,["model-value"]))),128))]),_:1},8,["loading"])):y("",!0),e.tasks?.items?.length===0?(i(),g("div",rn,[s(h)])):y("",!0),q(n("div",cn,[s(b)],512),[[Ae,!!e.$store?.state?.suno?.audio?.object]])],64)}const dn=A(sn,[["render",un]]),pn=S({name:"TaskPreview",components:{IconPicture:Ce,ElImage:N,ElAvatar:be,ElIcon:J},computed:{audio(){return this.$store.state.suno?.audio}}}),mn={key:0,class:"size-full overflow-hidden"},fn={class:"relative h-[300px]"},hn={class:"flex items-center justify-center size-full bg-[var(--el-bg-color)]"},_n={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"},gn={class:"p-4"},$n={class:"flex items-center font-bold mb-2"},vn={class:"text-[var(--el-text-color-regular)] mb-2"},yn={class:"text-xs text-[var(--el-text-color-regular)]"},kn={class:"mt-4 text-sm leading-[25px] whitespace-pre-wrap"},wn={key:1,class:"w-full h-full"};function bn(e,t,l,o,c,p){const d=a("icon-picture"),_=a("el-icon"),$=a("el-image"),r=a("el-avatar");return e.audio?.object?(i(),g("div",mn,[n("div",fn,[s($,{src:e.audio.image_url,fit:"cover",class:"size-full"},{error:m(()=>[n("div",hn,[s(_,{class:"text-3xl"},{default:m(()=>[s(d)]),_:1})])]),_:1},8,["src"]),n("h2",_n,u(e.audio?.title),1)]),n("div",gn,[n("div",$n,[s(r,{size:30,src:e.audio?.image_url,class:"mr-2"},null,8,["src"]),n("span",null,u(e.audio?.title),1)]),n("p",vn,u(e.audio?.style),1),n("p",yn,u(e.$dayjs.format(e.audio?.created_at)),1),n("div",kn,[n("p",null,u(e.audio?.lyric),1)])])])):(i(),g("div",wn))}const Cn=A(pn,[["render",bn]]),Sn="https://webhook.acedata.cloud/suno",Vn=S({name:"SunoIndex",components:{Layout:Ne,ConfigPanel:ss,RecentPanel:dn,PreviewPanel:Cn},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.suno?.status?.getApplications===R.Request},tasksLoading(){return this.$store.state.suno?.status?.getTasks===R.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===R.Request},needApply(){return this.$store.state.suno.status.getApplications===R.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 Ge({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(){Ee.create({application:this.application}).then(({data:e})=>{this.application=e,C.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{e?.response?.data?.code===Te&&C.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:l,createdAtMax:o}=e||{};console.debug("limit",t,"createdAtMin",l,"createdAtMax",o),this.fetchingTasks=!0;try{await this.$store.dispatch("suno/getTasks",{limit:t,createdAtMin:l,createdAtMax:o})}finally{this.fetchingTasks=!1}},async onGenerateAudio(){const e={...this.config,callback_url:Sn},t=this.credential?.token;if(!t){console.error("no token specified");return}C.info(this.$t("suno.message.startingTask")),P.audio(e,{token:t}).then(()=>{C.success(this.$t("suno.message.startTaskSuccess"))}).catch(l=>{C.error(l?.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 Ln(e,t,l,o,c,p){const d=a("config-panel"),_=a("recent-panel"),$=a("preview-panel"),r=a("layout");return i(),w(r,null,{config:m(()=>[s(d,{onGenerate:e.onGenerateAudio},null,8,["onGenerate"])]),result:m(()=>[s(_,{ref:"recentPanel",class:"panel recent",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),preview:m(()=>[s($)]),_:1})}const Dn=A(Vn,[["render",Ln],["__scopeId","data-v-d1296b1a"]]);export{Dn as default};