@acedatacloud/nexior 3.329.27 → 3.329.29

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 (238) hide show
  1. package/dist/assets/{ApiCodeButton-CbZLUqWT.js → ApiCodeButton-CEM3IO2x.js} +1 -1
  2. package/dist/assets/{Artifacts-Chvkgamy.js → Artifacts-BFs3gYCt.js} +1 -1
  3. package/dist/assets/{AskUserQuestionCard-BuRuSjbr.js → AskUserQuestionCard-lsj8s7Lz.js} +1 -1
  4. package/dist/assets/{AudioPreview-t34MHY1X.js → AudioPreview-Dg01t-bP.js} +1 -1
  5. package/dist/assets/{Auth-DZ-ugjEm.js → Auth-CTudP-Nr.js} +1 -1
  6. package/dist/assets/{Bare-CVAM5zEs.js → Bare-3fiJWEuY.js} +1 -1
  7. package/dist/assets/{BotPlaceholder-HnC2WR5J.js → BotPlaceholder-DLp760iP.js} +1 -1
  8. package/dist/assets/{BottomFooter-B1gZpsWK.js → BottomFooter-yDjHUxel.js} +1 -1
  9. package/dist/assets/{Callback-C3Weay2s.js → Callback-D-dnKXWt.js} +1 -1
  10. package/dist/assets/{CodeSnippet-zpA8z4M_.js → CodeSnippet-BIa9Iqih.js} +1 -1
  11. package/dist/assets/{Console-Cn8Xx0ed.js → Console-4uE3YAOK.js} +1 -1
  12. package/dist/assets/{Consumption-Byvcpogq.js → Consumption-D0iST8rP.js} +1 -1
  13. package/dist/assets/{Conversation-Cgalh2Xr.js → Conversation-B8dmXCAR.js} +1 -1
  14. package/dist/assets/{Conversation-DS-SAPI-.js → Conversation-J_BZmaSK.js} +1 -1
  15. package/dist/assets/{CopyToClipboard-CMiMmisS.js → CopyToClipboard-CGvL0GmD.js} +1 -1
  16. package/dist/assets/{Detail-CJwEkPQE.js → Detail-BVOC60Ll.js} +2 -2
  17. package/dist/assets/{Extra-DqL_WU8l.js → Extra-DT_FmBJe.js} +1 -1
  18. package/dist/assets/{FilePreview-Bc3RJz-d.js → FilePreview-CXWIVFVW.js} +1 -1
  19. package/dist/assets/{Hailuo-TngjeGp5.js → Hailuo-DTXrEvRz.js} +1 -1
  20. package/dist/assets/{History-NtAyP2vP.js → History-29pgQAlg.js} +1 -1
  21. package/dist/assets/{ImagePreview-BjSo9spH.js → ImagePreview-DYhHlMvg.js} +1 -1
  22. package/dist/assets/{ImageWrapper-DbMM6MID.js → ImageWrapper-DU41ScwL.js} +1 -1
  23. package/dist/assets/{Index-DDg32mh2.js → Index-31Kin5MC.js} +1 -1
  24. package/dist/assets/{Index-C5Rbuqvt.js → Index-7kQQzyvX.js} +1 -1
  25. package/dist/assets/Index-B4RXOmjU.js +1 -0
  26. package/dist/assets/{Index-B_05L791.js → Index-B70S9YV3.js} +1 -1
  27. package/dist/assets/{Index-C77fdGjX.css → Index-BHSQAbiD.css} +1 -1
  28. package/dist/assets/{Index-Bawc26Rz.js → Index-BJ_DOqA0.js} +1 -1
  29. package/dist/assets/{Index-hsoWM_bm.js → Index-BbZ86FA0.js} +1 -1
  30. package/dist/assets/{Index-BtN73Su-.js → Index-Bf1z_3f3.js} +1 -1
  31. package/dist/assets/Index-Bgd9S0y7.js +1 -0
  32. package/dist/assets/{Index-CSLOyNE_.js → Index-CDezJClv.js} +1 -1
  33. package/dist/assets/Index-CIeJII7k.js +1 -0
  34. package/dist/assets/{Index-2BHiRzfi.js → Index-COIGDNzq.js} +1 -1
  35. package/dist/assets/{Index-DTbh7YXB.js → Index-CQNYFWRW.js} +1 -1
  36. package/dist/assets/Index-CTwBpucZ.js +1 -0
  37. package/dist/assets/{Index-DCP2o6oM.js → Index-CYHCNBQw.js} +1 -1
  38. package/dist/assets/{Index-CbZxmOH_.css → Index-CbQKUX9Y.css} +1 -1
  39. package/dist/assets/{Index-CRKHLB9S.css → Index-Ck_lbC7I.css} +1 -1
  40. package/dist/assets/{Index-DYmXOkwP.js → Index-CqvgUpQY.js} +1 -1
  41. package/dist/assets/{Index-BeG-oZzP.js → Index-Cx6qvGCJ.js} +1 -1
  42. package/dist/assets/{Index-DwozO2xY.js → Index-D9CX8syk.js} +1 -1
  43. package/dist/assets/{Index-Dnkgxcl7.js → Index-DDOF4I-y.js} +1 -1
  44. package/dist/assets/{Index-uwC7aIfr.js → Index-DHTriL73.js} +1 -1
  45. package/dist/assets/{Index-BS7nHzcA.js → Index-DP1ILkDy.js} +1 -1
  46. package/dist/assets/{Index-nMcSjZEH.js → Index-Dal0OIB8.js} +1 -1
  47. package/dist/assets/{Index-D-jh6suG.js → Index-DhUdbPaR.js} +1 -1
  48. package/dist/assets/{Index-CWfdrTdD.css → Index-DkHadGVw.css} +1 -1
  49. package/dist/assets/{Index-DWAvFo2d.js → Index-DsFsOAFl.js} +1 -1
  50. package/dist/assets/{Index-C1RxZl2p.js → Index-S3JSM3dl.js} +1 -1
  51. package/dist/assets/{Index-D7jKV_ZK.js → Index-XP9ArjM9.js} +1 -1
  52. package/dist/assets/{Index-DOT4Hkl_.js → Index-k19x9S7v.js} +1 -1
  53. package/dist/assets/{Index-UZQ9Snis.js → Index-o-qkKeaq.js} +1 -1
  54. package/dist/assets/{Index-16lRcFkO.js → Index-qOkFujHz.js} +1 -1
  55. package/dist/assets/{Index-D5uwpezH.js → Index-v6cmJJ7L.js} +1 -1
  56. package/dist/assets/{Invitees-Bew2QtpH.js → Invitees-DKR491e4.js} +1 -1
  57. package/dist/assets/{List-Bste7J8J.js → List-BFbbM-U9.js} +1 -1
  58. package/dist/assets/{List-22CiGNPU.js → List-Cn1QZqIq.js} +1 -1
  59. package/dist/assets/{List-iu_F5Zd_.js → List-D6emiDnW.js} +1 -1
  60. package/dist/assets/{LocalTools-CVyUE98T.js → LocalTools-CJJHNFnX.js} +1 -1
  61. package/dist/assets/{LocalTools-C7Nn1thu.js → LocalTools-DVmtbWGS.js} +1 -1
  62. package/dist/assets/{Main-B6aDqobB.js → Main-C92mBkPN.js} +1 -1
  63. package/dist/assets/{Message-CDOsw4dj.js → Message-B3sAv2aS.js} +1 -1
  64. package/dist/assets/{Model-NQ0hmVc0.js → Model-DzbI_Tmr.js} +1 -1
  65. package/dist/assets/{Navigator-DTi99yI1.js → Navigator-BY51HnNR.js} +3 -3
  66. package/dist/assets/{NotFound-CAEk1nwS.js → NotFound-1K4xMiB8.js} +1 -1
  67. package/dist/assets/{Pay-1V6xxD2-.js → Pay-DAV2VAWs.js} +1 -1
  68. package/dist/assets/{Player-DVwQKYQ5.js → Player-BT_xIoKP.js} +1 -1
  69. package/dist/assets/{PromptTextarea-Dhj4WJey.js → PromptTextarea-BhQ60y-5.js} +1 -1
  70. package/dist/assets/{RealtimeCall-3WMhkP5q.js → RealtimeCall-DLlKZZf3.js} +1 -1
  71. package/dist/assets/{ScheduledTasks-DNNoIDHv.js → ScheduledTasks-DxiLHh8z.js} +1 -1
  72. package/dist/assets/{Status-Bgf1q1s1.js → Status-DFU0ZTsV.js} +1 -1
  73. package/dist/assets/{Subscribe-3OdKPYKO.js → Subscribe-_YAe-9l6.js} +1 -1
  74. package/dist/assets/{TabSwitcher-DoWJlQlV.js → TabSwitcher-CobzccoB.js} +1 -1
  75. package/dist/assets/{Tts-Br6aclCA.js → Tts-vgwlvpV-.js} +1 -1
  76. package/dist/assets/{VideoPlayer-C-TSeOkk.js → VideoPlayer-Di2T9WT1.js} +1 -1
  77. package/dist/assets/{alert-B8xKY_cZ.js → alert-cG1MqKo8.js} +1 -1
  78. package/dist/assets/arrow-down-BWof_t8x.js +1 -0
  79. package/dist/assets/{arrow-down-wide-narrow-DzdoiI9L.js → arrow-down-wide-narrow-Deut7hlc.js} +1 -1
  80. package/dist/assets/arrow-left-DOxJiLeK.js +1 -0
  81. package/dist/assets/arrow-right-Cog5Q14n.js +1 -0
  82. package/dist/assets/arrow-up-D4c705sl.js +1 -0
  83. package/dist/assets/{avatar-BbkcCX2P.js → avatar-DZuVNFJn.js} +1 -1
  84. package/dist/assets/{basic-2CeDYHhH.js → basic-DPVOLgIc.js} +1 -1
  85. package/dist/assets/{box-BQZFgJhA.js → box-DkEXqk4R.js} +1 -1
  86. package/dist/assets/{boxes-BNL0DDxl.js → boxes-CuWO-Xwz.js} +1 -1
  87. package/dist/assets/{brain-Bk4dnx_k.js → brain-BYClf5ky.js} +1 -1
  88. package/dist/assets/{chart-no-axes-combined-CiEYEEGq.js → chart-no-axes-combined-Dsy5AR7L.js} +1 -1
  89. package/dist/assets/{chat-BMxhddIF.js → chat-DvNnFdIu.js} +1 -1
  90. package/dist/assets/check-BVXsTT0Y.js +1 -0
  91. package/dist/assets/chevron-down-DCIKAEnr.js +1 -0
  92. package/dist/assets/chevron-right-DIQ-UABh.js +1 -0
  93. package/dist/assets/circle-check-DEUYa6MY.js +1 -0
  94. package/dist/assets/clock-SG9m0Vz-.js +1 -0
  95. package/dist/assets/{codingBridge-CebQStfH.js → codingBridge-Dm_9p0MX.js} +1 -1
  96. package/dist/assets/{codingBridgeNotify-Bgs35h3e.js → codingBridgeNotify-C1DrQ6qY.js} +2 -2
  97. package/dist/assets/{coins-B-lUTm64.js → coins-DsWo-vO_.js} +1 -1
  98. package/dist/assets/{collapse-DLomRoFE.js → collapse-XBEavCAW.js} +1 -1
  99. package/dist/assets/{createTaskActions-Bma6TaWY.js → createTaskActions-BEbSa6Pt.js} +1 -1
  100. package/dist/assets/{digitalhuman-CRouEcai.js → digitalhuman-Cnx-X6iM.js} +1 -1
  101. package/dist/assets/{dollar-sign-D30nvB9I.js → dollar-sign-B-unpjPl.js} +1 -1
  102. package/dist/assets/{download-Ct2jPsJB.js → download-C0Ybc-fk.js} +1 -1
  103. package/dist/assets/{drawer-B3YqI23b.js → drawer-BcJK6ChC.js} +1 -1
  104. package/dist/assets/{dropdown-B9g7G6sW.js → dropdown-C9Yyar8P.js} +1 -1
  105. package/dist/assets/{dropdown-CMqex_tL.js → dropdown-DgOY18wt.js} +1 -1
  106. package/dist/assets/{ellipsis-D6zla1fr.js → ellipsis-CGTN3CUt.js} +1 -1
  107. package/dist/assets/esm-Bubgs6cz.js +1 -0
  108. package/dist/assets/{esm-B7uCI6Jo.js → esm-Cuog3fa7.js} +2 -2
  109. package/dist/assets/{esm-B_EbPprO.js → esm-DMJA4ejc.js} +3 -3
  110. package/dist/assets/{esm-GP8JDzz3.js → esm-DPrnsid1.js} +2 -2
  111. package/dist/assets/{esm-BB-hiidi.js → esm-Dd_oKZOb.js} +1 -1
  112. package/dist/assets/{esm-TWPziMtX.js → esm-NYrLWLtZ.js} +1 -1
  113. package/dist/assets/{esm-BGdJcoMp.js → esm-rUReflPc.js} +1 -1
  114. package/dist/assets/{external-link-DdjcySYE.js → external-link-XjK2aIuE.js} +1 -1
  115. package/dist/assets/{eye-ChXnBYFt.js → eye-D112inph.js} +1 -1
  116. package/dist/assets/{file-output-B4IbqxGY.js → file-output-DHnH4oTi.js} +1 -1
  117. package/dist/assets/{file-text-C6haQUUh.js → file-text-6eZ4bzBg.js} +1 -1
  118. package/dist/assets/{fish-BA7waa57.js → fish-Dp3IPCFt.js} +1 -1
  119. package/dist/assets/{flux-B3E9NRsX.js → flux-DxgkZH2z.js} +1 -1
  120. package/dist/assets/{folder-oTpycFS0.js → folder-C8QrxBCI.js} +1 -1
  121. package/dist/assets/gauge-CPK9-Pit.js +1 -0
  122. package/dist/assets/{globe-DoXOBwuI.js → globe-C5dnXM0M.js} +1 -1
  123. package/dist/assets/{grokvideo-D3_p-TUq.js → grokvideo-Den1nT2M.js} +1 -1
  124. package/dist/assets/{hailuo-C5DAJEFe.js → hailuo-GbmLQhIG.js} +1 -1
  125. package/dist/assets/{hash-CC5NzWfo.js → hash-CjdMDema.js} +1 -1
  126. package/dist/assets/{headphones-CV5rXd3Z.js → headphones-tqHeW8jB.js} +1 -1
  127. package/dist/assets/{history-DbnTb1x_.js → history-IV8_Jx-l.js} +1 -1
  128. package/dist/assets/{image-OOgYSkAt.js → image-gqsRebqP.js} +1 -1
  129. package/dist/assets/{index-BFeCxAir.js → index-2sx9DG7X.js} +3 -3
  130. package/dist/assets/{index-D2CNFRRj.css → index-Cfewjxc5.css} +1 -1
  131. package/dist/assets/{index.browser.esm-DQaRfXoI.js → index.browser.esm-DUBvfTSL.js} +1 -1
  132. package/dist/assets/{index.es-Cw8I3uag.js → index.es-8cTwg33G.js} +1 -1
  133. package/dist/assets/{info-C2D_XeJh.js → info-Dy7fSJfK.js} +1 -1
  134. package/dist/assets/{input-number-ColumRcM.js → input-number-D4wsRhDG.js} +1 -1
  135. package/dist/assets/{key-round-Dtae8UvU.js → key-round-MjfKq9o3.js} +1 -1
  136. package/dist/assets/{kling-Bu5USCbc.js → kling-Di1NG3_b.js} +1 -1
  137. package/dist/assets/{languages-DDAFwTLw.js → languages-ZHxIxcgG.js} +1 -1
  138. package/dist/assets/{laptop-lfNEIupT.js → laptop-DoH82V4C.js} +1 -1
  139. package/dist/assets/{lightbulb-CFYGFGVT.js → lightbulb-8NaGkcVC.js} +1 -1
  140. package/dist/assets/{link-CuToP8s_.js → link-_0GkCMb-.js} +1 -1
  141. package/dist/assets/loader-circle-DukCwkYu.js +1 -0
  142. package/dist/assets/{luma-DGwmVnfX.js → luma-C9ikgLoO.js} +1 -1
  143. package/dist/assets/{maestro-Bx5he5Oq.js → maestro-BsN7cQeb.js} +1 -1
  144. package/dist/assets/{mail-_s2rPJZJ.js → mail-Bxih22Ze.js} +1 -1
  145. package/dist/assets/{message-circle-BDB6M5Bo.js → message-circle-CWHA3G7n.js} +1 -1
  146. package/dist/assets/{mic-D59HeE8Q.js → mic-CbljPOlv.js} +1 -1
  147. package/dist/assets/{midjourney-DXV9B6lW.js → midjourney-gK6_5Hye.js} +1 -1
  148. package/dist/assets/{mobileLocalExec-DJwJ4f1Q.js → mobileLocalExec-B8mgkTIR.js} +2 -2
  149. package/dist/assets/{mouse-pointer-2-BnxCg9Pc.js → mouse-pointer-2-C00uEVP1.js} +1 -1
  150. package/dist/assets/music-2-Cl48b0Tj.js +1 -0
  151. package/dist/assets/{nanobanana-ZmCx9HIE.js → nanobanana-BiWj0v0V.js} +1 -1
  152. package/dist/assets/{omni-DMr56bKh.js → omni-B_z_CVJx.js} +1 -1
  153. package/dist/assets/{openaiimage-BUuMHQtZ.js → openaiimage-woTxjiqb.js} +1 -1
  154. package/dist/assets/{pagination-hXYdo7XR.js → pagination-B0j90y99.js} +1 -1
  155. package/dist/assets/{pagination-CB3471Sj.js → pagination-BXRQvWri.js} +1 -1
  156. package/dist/assets/{palette-BRHvysMf.js → palette-Nm71S2a-.js} +1 -1
  157. package/dist/assets/{paperclip-Bgm9ZPGF.js → paperclip-DbmU3dPk.js} +1 -1
  158. package/dist/assets/{pause-KEZ__Cmx.js → pause-DTXn5hGt.js} +1 -1
  159. package/dist/assets/{pencil-LuRVBNP-.js → pencil-mGxevkDn.js} +1 -1
  160. package/dist/assets/{pika-kjOU525t.js → pika-B31AlnFz.js} +1 -1
  161. package/dist/assets/{pixverse-CtfsUojl.js → pixverse-D1yL8GkD.js} +1 -1
  162. package/dist/assets/play-DAi-fAVa.js +1 -0
  163. package/dist/assets/plus-V_Vch-3O.js +1 -0
  164. package/dist/assets/{popover-CWDn0Yqb.js → popover-c-pXVKCI.js} +1 -1
  165. package/dist/assets/{producer-BDvSXhJH.js → producer-Cnrwq5nE.js} +1 -1
  166. package/dist/assets/{qrart-Bt7gaBIi.js → qrart-CvjLsG0z.js} +1 -1
  167. package/dist/assets/{realtime-81cc0bWI.js → realtime-DI4hwjAD.js} +1 -1
  168. package/dist/assets/{refresh-cw-DZq5AcuC.js → refresh-cw-CHWJ9aRj.js} +1 -1
  169. package/dist/assets/rotate-ccw-j1iUFCVS.js +1 -0
  170. package/dist/assets/rotate-cw-N_wibo2G.js +1 -0
  171. package/dist/assets/{row-B1TJrqsS.js → row-3rjXTSOk.js} +1 -1
  172. package/dist/assets/search-DQjimFlQ.js +1 -0
  173. package/dist/assets/{seedance-CLMnr6zL.js → seedance-B6UVlVGe.js} +1 -1
  174. package/dist/assets/{seedream-D5C_qxfy.js → seedream-DfKzrSrj.js} +1 -1
  175. package/dist/assets/{select-DT9RB41V.js → select-rliTB5rn.js} +1 -1
  176. package/dist/assets/{serp-DFkO5g8g.js → serp-DhygWqCQ.js} +1 -1
  177. package/dist/assets/{shield-C4oR8VO2.js → shield-BaKqhxsi.js} +1 -1
  178. package/dist/assets/{shuffle-YFtZhmWN.js → shuffle-6sVNZtlq.js} +1 -1
  179. package/dist/assets/{slider-CRLZZmIa.js → slider-BeHvHRDP.js} +1 -1
  180. package/dist/assets/{sliders-horizontal-CaXeAW3w.js → sliders-horizontal-CCF0GpuF.js} +1 -1
  181. package/dist/assets/{solana-wallets-DvnDmLSP.js → solana-wallets-8iUDukuz.js} +2 -2
  182. package/dist/assets/{solana-wallets-vue-FirM8r-E.js → solana-wallets-vue-Cc_Adg4C.js} +1 -1
  183. package/dist/assets/{sora-DZFqIWJo.js → sora-D9obayOH.js} +1 -1
  184. package/dist/assets/square-BEo294Kg.js +1 -0
  185. package/dist/assets/{suno-Cjw0RFP7.js → suno-DHIt9cSf.js} +1 -1
  186. package/dist/assets/{switch-CyBT54Uh.js → switch-uEdbPjYi.js} +1 -1
  187. package/dist/assets/{table-BMr39fgx.js → table-DKwUiZLq.js} +1 -1
  188. package/dist/assets/{tabs-CR27Alo5.js → tabs-195B2C0Q.js} +1 -1
  189. package/dist/assets/{tag-DbiGRztm.js → tag-BNxGWllB.js} +1 -1
  190. package/dist/assets/{taskDrawerMixin-CjsoaGWg.js → taskDrawerMixin-CR-kpm7S.js} +1 -1
  191. package/dist/assets/terminal-Re0RZK5y.js +1 -0
  192. package/dist/assets/{time-picker-CjY_AuYN.js → time-picker-DUSxj7xk.js} +1 -1
  193. package/dist/assets/{tooltip-BPoFx_0r.js → tooltip-sB40ADu-.js} +1 -1
  194. package/dist/assets/{trash-2-DJ2DJzQE.js → trash-2-Cin3mWUo.js} +1 -1
  195. package/dist/assets/{triangle-alert-DmzQvoA8.js → triangle-alert-DSRszaWP.js} +1 -1
  196. package/dist/assets/{upload-B5dfYOVm.js → upload-CmHzqO3M.js} +1 -1
  197. package/dist/assets/{upload-CwrIdcvB.js → upload-CnEkfRD3.js} +1 -1
  198. package/dist/assets/user-BAVpdfB4.js +1 -0
  199. package/dist/assets/{veo-Co9VXUo2.js → veo-Dv3qih0l.js} +1 -1
  200. package/dist/assets/{video-s497gPSq.js → video-DWlrLFpz.js} +1 -1
  201. package/dist/assets/{volume-2-oaWvFyL6.js → volume-2-CMQJjQWv.js} +1 -1
  202. package/dist/assets/{wallet-D6j9eGtF.js → wallet-BK3m-HYq.js} +1 -1
  203. package/dist/assets/{wan-BTJ30eT_.js → wan-FbNbhv95.js} +1 -1
  204. package/dist/assets/{wand-sparkles-RP6KkE1-.js → wand-sparkles-Drjdpr4V.js} +1 -1
  205. package/dist/assets/{web-DHOsSdD0.js → web-CX5FHNTX.js} +1 -1
  206. package/dist/assets/{web-CfBKqXUg.js → web-DlPpVkFg.js} +1 -1
  207. package/dist/assets/{web-CMDm_WKq.js → web-ihECRB1m.js} +1 -1
  208. package/dist/assets/{web-CR1Ti7pr.js → web-ru6frn_G.js} +1 -1
  209. package/dist/assets/{web-ZkNhAIBE.js → web-sLgmKFND.js} +1 -1
  210. package/dist/assets/{webextrator-BsefbuHL.js → webextrator-DPo-nOfc.js} +1 -1
  211. package/dist/assets/{zap-BvpwfPaQ.js → zap-DBX2VaX8.js} +1 -1
  212. package/dist/index.html +2 -2
  213. package/package.json +1 -1
  214. package/dist/assets/Index-BUCFZJmS.js +0 -1
  215. package/dist/assets/Index-ClM2SMJJ.js +0 -1
  216. package/dist/assets/Index-DPMb4QS2.js +0 -1
  217. package/dist/assets/Index-DqtzyoOS.js +0 -1
  218. package/dist/assets/arrow-down-GzJVZZJD.js +0 -1
  219. package/dist/assets/arrow-left-HE170TRW.js +0 -1
  220. package/dist/assets/arrow-right-B8iX4AMa.js +0 -1
  221. package/dist/assets/arrow-up-Bbos6asC.js +0 -1
  222. package/dist/assets/check-Clof9oh_.js +0 -1
  223. package/dist/assets/chevron-down-DXC6HS37.js +0 -1
  224. package/dist/assets/chevron-right-DUSeDe2V.js +0 -1
  225. package/dist/assets/circle-check-Cjgr9Ugg.js +0 -1
  226. package/dist/assets/clock-bNJ1O4h8.js +0 -1
  227. package/dist/assets/esm-D8h3eHEh.js +0 -1
  228. package/dist/assets/gauge-8OBRNfw2.js +0 -1
  229. package/dist/assets/loader-circle-q3hhAvQp.js +0 -1
  230. package/dist/assets/music-2-DqqiIX_j.js +0 -1
  231. package/dist/assets/play-CTiSUyyP.js +0 -1
  232. package/dist/assets/plus-BgxTy_7g.js +0 -1
  233. package/dist/assets/rotate-ccw-v9BtrxkO.js +0 -1
  234. package/dist/assets/rotate-cw-ByDC8khe.js +0 -1
  235. package/dist/assets/search-COWjz9ZH.js +0 -1
  236. package/dist/assets/square-CTFZS-XR.js +0 -1
  237. package/dist/assets/terminal-CBU3r3IS.js +0 -1
  238. package/dist/assets/user-C1YjKxgh.js +0 -1
@@ -1 +0,0 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{r as y,t as b}from"./select-DT9RB41V.js";import{n as x,t as S}from"./tabs-CR27Alo5.js";import{t as C}from"./upload-CwrIdcvB.js";import{t as w}from"./tooltip-BPoFx_0r.js";import{t as T}from"./alert-B8xKY_cZ.js";import{n as E,r as D}from"./radio-B0Elgaw9.js";import{t as O}from"./drawer-B3YqI23b.js";import{t as k}from"./input-number-ColumRcM.js";import{t as A}from"./slider-CRLZZmIa.js";import{t as j}from"./switch-CyBT54Uh.js";import{n as M}from"./taskDrawerMixin-CjsoaGWg.js";import{t as ee}from"./clock-bNJ1O4h8.js";import{t as te}from"./CopyToClipboard-CMiMmisS.js";import{t as ne}from"./hash-CC5NzWfo.js";import{t as re}from"./headphones-CV5rXd3Z.js";import{t as ie}from"./info-C2D_XeJh.js";import{t as ae}from"./lightbulb-CFYGFGVT.js";import{t as oe}from"./PromptTextarea-Dhj4WJey.js";import{t as se}from"./triangle-alert-DmzQvoA8.js";import{t as N}from"./upload-B5dfYOVm.js";import{t as P}from"./wand-sparkles-RP6KkE1-.js";import{ci as ce,ii as le,li as F,si as ue}from"./constants-CqjLASsC.js";import{$t as I,Ai as L,Bt as R,E as z,Ht as B,Oi as de,Vn as V,Vt as fe,Wt as pe,ei as me,gi as H,hi as U,mr as W,pi as he,ri as G,zi as K,zt as q}from"./index-BFeCxAir.js";import{t as ge}from"./FilePreview-Bc3RJz-d.js";import{t as J}from"./ImagePreview-BjSo9spH.js";import{t as Y}from"./Consumption-Byvcpogq.js";import{a as X,n as _e,r as ve,t as ye}from"./pagination-CB3471Sj.js";import{t as be}from"./VideoPlayer-C-TSeOkk.js";import{t as xe}from"./ApiCodeButton-CbZLUqWT.js";import{t as Se}from"./BotPlaceholder-HnC2WR5J.js";import{n as Ce,t as we}from"./AudioPreview-t34MHY1X.js";var Te=v({name:`LayoutKling`,components:{MagicIcon:P,ElDrawer:O,ElButton:L},mixins:[M]}),Ee={class:`main flex flex-row flex-1 min-h-0`},De={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Oe={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function ke(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Ee,[e(`div`,De,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Oe,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Ae=z(Te,[[`render`,ke],[`__scopeId`,`data-v-2d826924`]]),je={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};function Z(e,t,n){let r=t||`std`,i=n??5;switch(e){case`kling-v1`:return{text2video:!0,image2video:!0,endImage:i===5,audio:!1,motionControl:i===5,referenceVideo:!1,referenceImages:!1};case`kling-v1-6`:case`kling-v2-5-turbo`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v2-6`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:r===`pro`,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v2-master`:case`kling-v2-1-master`:return{text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v3`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:r!==`4k`,referenceVideo:!1,referenceImages:!1};case`kling-v3-omni`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:!1,referenceVideo:!0,referenceImages:!0};case`kling-o1`:return{text2video:!0,image2video:!0,endImage:!0,audio:!1,motionControl:!1,referenceVideo:!0,referenceImages:!0};default:return je}}var Q=`<<<video_1>>>`,Me=/<<<image_\d+>>>/g;function Ne(e){return e?e.split(Q).join(` `).replace(/\s{2,}/g,` `).trim():``}function Pe(e){return e?e.replace(Me,` `).replace(/\s{2,}/g,` `).trim():``}function Fe(e,t){if(!e)return[];let n=t.model??e.model,r=t.mode??e.mode,i=t.duration??e.duration;if(!n)return[];let a=Z(n,r,i),o=[];e.end_image_url&&!a.endImage&&o.push({field:`end_image_url`,i18nLabel:`kling.name.endImage`}),e.generate_audio&&!a.audio&&o.push({field:`generate_audio`,i18nLabel:`kling.name.generateAudio`}),e.camera_control?.type&&(!a.motionControl||e.start_image_url)&&o.push({field:`camera_control`,i18nLabel:`kling.name.cameraControl`}),e.video_list?.length&&!a.referenceVideo&&o.push({field:`video_list`,i18nLabel:`kling.name.referenceVideo`}),e.image_list?.length&&!a.referenceImages&&o.push({field:`image_list`,i18nLabel:`kling.name.referenceImages`});let s=n===`kling-o1`||!!(e.image_list?.length||e.video_list?.length);return s&&e.cfg_scale!==void 0&&o.push({field:`cfg_scale`,i18nLabel:`kling.name.cfgScale`}),s&&e.negative_prompt&&o.push({field:`negative_prompt`,i18nLabel:`kling.name.negativePrompt`}),o}function Ie(e,t){let n={...e};for(let e of t)e.field===`end_image_url`&&(n.end_image_url=void 0),e.field===`generate_audio`&&(n.generate_audio=!1),e.field===`camera_control`&&(n.camera_control=void 0),e.field===`cfg_scale`&&(n.cfg_scale=void 0),e.field===`negative_prompt`&&(n.negative_prompt=void 0),e.field===`video_list`&&(n.video_list=void 0,n.prompt=Ne(n.prompt)),e.field===`image_list`&&(n.image_list=void 0,n.prompt=Pe(n.prompt));return n}var Le=v({name:`ModelSelector`,components:{ElSelect:y,ElOption:b},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{revertKey:0,options:[{value:`kling-v3`,label:`v3`},{value:`kling-v3-omni`,label:`v3-Omni`},{value:`kling-v2-6`,label:`v2.6`},{value:`kling-v2-5-turbo`,label:`v2.5-Turbo`},{value:`kling-v2-1-master`,label:`v2.1-Master`},{value:`kling-v2-master`,label:`v2-Master`},{value:`kling-v1-6`,label:`v1.6`},{value:`kling-v1`,label:`v1`},{value:`kling-o1`,label:`Kling O1`}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(le)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=Fe(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await U.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=Ie({...t,model:e},n);this.$store.commit(`kling/setConfig`,i),H.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,model:e})}}}),Re={class:`field`},ze={class:`title font-bold`};function Be(t,n,r,a,o,u){let d=l(`el-option`),m=l(`el-select`);return g(),s(`div`,Re,[e(`h2`,ze,i(t.$t(`pika.name.model`)),1),(g(),f(m,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`pika.placeholder.select`),onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(d,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var Ve=z(Le,[[`render`,Be],[`__scopeId`,`data-v-a74e7f31`]]),He=v({name:`ModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:X},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},cameraControlSet(){return!!this.$store.state.kling?.config?.camera_control?.type},fourKReason(){return F.includes(this.selectedModel)?this.cameraControlSet?this.$t(`kling.description.mode4kIncompatibleCamera`):``:this.$t(`kling.description.mode4kRequiresV3`)},options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`),disabled:!1,disabledReason:``},{value:`pro`,label:this.$t(`kling.name.modePro`),disabled:!1,disabledReason:``},{value:`4k`,label:this.$t(`kling.name.mode4k`),disabled:!!this.fourKReason,disabledReason:this.fourKReason}]},value(){return this.$store.state.kling?.config?.mode}},watch:{fourKReason(e){e&&this.value===`4k`&&this.applyMode(`std`)}},mounted(){this.value||this.applyMode(`std`)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=Fe(t,{mode:e});if(n.length===0){this.applyMode(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await U.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=Ie({...t,mode:e},n);this.$store.commit(`kling/setConfig`,i),H.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyMode(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,mode:e})}}}),Ue={class:`field`},We={class:`header`},Ge={class:`title font-bold`},Ke={key:0,class:`opt-tip`};function qe(t,r,u,d,m,_){let v=l(`info-icon`),y=l(`el-option`),b=l(`el-select`);return g(),s(`div`,Ue,[e(`div`,We,[e(`h2`,Ge,i(t.$t(`kling.name.mode`)),1),a(v,{content:t.$t(`kling.description.mode`),class:`info-icon`},null,8,[`content`])]),(g(),f(b,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`kling.placeholder.select`),clearable:!0,onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.options,t=>(g(),f(y,{key:t.value,label:t.label,value:t.value,disabled:t.disabled},{default:p(()=>[e(`span`,{class:n({"opt-disabled":t.disabled})},i(t.label),3),t.disabled&&t.disabledReason?(g(),s(`span`,Ke,i(t.disabledReason),1)):o(``,!0)]),_:2},1032,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var Je=z(He,[[`render`,qe],[`__scopeId`,`data-v-9a8fa3c5`]]),Ye=[3,5,8,10,12,15],Xe=[5,10],Ze=[5],Qe=v({name:`DurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:X},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},isV3Model(){return F.includes(this.selectedModel)},allowedDurations(){return this.selectedModel===`kling-o1`?Ze:this.isV3Model?Ye:Xe},value(){return this.$store.state.kling?.config?.duration??5},selectValue(){let e=this.allowedDurations;return e.includes(this.value)?this.value:e.includes(5)?5:e[0]}},watch:{selectedModel(){this.allowedDurations.includes(this.value)||this.applyDuration(5)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(5)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=Fe(t,{duration:e});if(n.length===0){this.applyDuration(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await U.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=Ie({...t,duration:e},n);this.$store.commit(`kling/setConfig`,i),H.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyDuration(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,duration:e})}}}),$e={class:`field`},et={class:`control`},tt={class:`label`},nt={class:`title font-bold`};function rt(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,$e,[e(`div`,et,[e(`div`,tt,[e(`h2`,nt,i(t.$t(`kling.name.duration`)),1),a(m,{content:t.$t(`kling.description.duration`),class:`info-icon ml-1`},null,8,[`content`])]),(g(),f(v,{key:t.revertKey,"model-value":t.selectValue,class:`value`,placeholder:t.$t(`kling.placeholder.select`),onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.allowedDurations,e=>(g(),f(_,{key:e,label:`${e}s`,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])])}var it=z(Qe,[[`render`,rt],[`__scopeId`,`data-v-496bf31c`]]),at=v({name:`RatioSelector`,data(){return{options:[{value:`1:1`,label:`1:1`,width:20,height:20},{value:`16:9`,label:`16:9`,width:25,height:13},{value:`9:16`,label:`9:16`,width:13,height:25}]}},computed:{active(){return this.options.findIndex(e=>e.value===this.value)||0},value:{get(){return this.$store.state?.kling?.config?.aspect_ratio},set(e){console.debug(`set ratio`,e),this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,aspect_ratio:e})}}},mounted(){this.value||=`1:1`}}),ot={class:`text-sm font-bold mb-2 block`},st={class:`items`},ct=[`onClick`],lt={class:`name`};function ut(t,r,a,o,l,u){return g(),s(`div`,null,[e(`span`,ot,i(t.$t(`kling.name.ratio`)),1),e(`div`,st,[(g(!0),s(c,null,h(t.options,(r,a)=>(g(),s(`div`,{key:a,class:n({active:t.active===a,item:!0}),onClick:e=>t.value=r.value},[e(`div`,{class:n([`preview`,r.label])},[e(`div`,{class:`rect`,style:m({width:r.width+`px`,height:r.height+`px`})},null,4)],2),e(`p`,lt,i(r.label),1)],10,ct))),128))])])}var dt=z(at,[[`render`,ut],[`__scopeId`,`data-v-cdb14b2f`]]),ft=v({name:`StartImage`,components:{UploadIcon:N,ElUpload:C,ElButton:L,ElTooltip:w,InfoIcon:X,ImagePreview:J},mixins:[B,R],emits:[`change`],data(){return{fileList:[],uploadUrl:G()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},value:{get(){return this.$store.state?.kling?.config?.start_image_url},set(){}}},watch:{value(e){!e&&this.fileList.length>0&&(this.fileList=[])}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){H.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){H.error(this.$t(`kling.message.uploadReferencesError`))},onBeforeUpload(){let e=this.$store.state.kling?.config||{};if(e.video_list?.[0]?.refer_type===`base`)return H.warning(this.$t(`kling.message.baseVideoFrameConflict`)),!1;let t=e.video_list?.length?4:7;return(e.image_list?.length||0)+Number(!!e.end_image_url)+1>t?(H.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:t})),!1):!0},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetStartImageUrl()}}}),pt={class:`relative`},mt={class:`flex justify-between`},ht={class:`flex justify-start items-center`},gt={class:`text-sm font-bold`};function _t(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,pt,[e(`div`,mt,[e(`div`,ht,[e(`span`,gt,i(t.$t(`kling.name.startImage`)),1),a(h,{content:t.$t(`kling.description.uploadStartImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,disabled:t.reachedLimit,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"before-upload":t.onBeforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.$t(`kling.message.uploadReferencesExceed`),disabled:!t.reachedLimit,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.reachedLimit},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`disabled`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var vt=z(ft,[[`render`,_t],[`__scopeId`,`data-v-6a50b40e`]]),yt=v({name:`EndImage`,components:{UploadIcon:N,ElUpload:C,ElButton:L,ElTooltip:w,ImagePreview:J,InfoIcon:X},mixins:[B,R],data(){return{fileList:[],uploadUrl:G()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},klingConfig(){return this.$store.state?.kling?.config||{}},endImageSupported(){return Z(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},hasStartImage(){return!!this.klingConfig.start_image_url},uploadDisabled(){return this.reachedLimit||!this.endImageSupported||!this.hasStartImage},uploadTooltip(){return this.endImageSupported?this.hasStartImage?this.reachedLimit?this.$t(`kling.message.uploadReferencesExceed`):``:this.$t(`kling.message.endImageRequiresStart`):this.$t(`kling.message.endImageNotSupported`)},storeValue(){return this.klingConfig.end_image_url},value:{get(){return this.storeValue},set(){}}},watch:{storeValue(e){!e&&this.fileList.length>0&&(this.fileList=[])},hasStartImage(e){!e&&this.storeValue&&(this.fileList=[],this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,end_image_url:void 0}))}},mounted(){this.value||=void 0,this.onSetEndImageUrl()},methods:{onBeforeUpload(){if(!this.endImageSupported)return H.warning(this.$t(`kling.message.endImageNotSupported`)),!1;if(!this.hasStartImage)return H.warning(this.$t(`kling.message.endImageRequiresStart`)),!1;if(this.klingConfig.video_list?.[0]?.refer_type===`base`)return H.warning(this.$t(`kling.message.baseVideoFrameConflict`)),!1;let e=this.klingConfig.video_list?.length?4:7;return(this.klingConfig.image_list?.length||0)+2>e?(H.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:e})),!1):!0},onExceed(){H.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){H.error(this.$t(`kling.message.uploadReferencesError`))},onSetEndImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetEndImageUrl()}}}),bt={class:`relative`},xt={class:`flex justify-between`},St={class:`flex justify-start items-center`},Ct={class:`text-sm font-bold`};function wt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,bt,[e(`div`,xt,[e(`div`,St,[e(`span`,Ct,i(t.$t(`kling.name.endImage`)),1),a(h,{content:t.$t(`kling.description.uploadEndImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,disabled:t.uploadDisabled,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"before-upload":t.onBeforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`disabled`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Tt=z(yt,[[`render`,wt],[`__scopeId`,`data-v-bc6519b8`]]),Et=v({name:`ReferenceVideo`,components:{ElUpload:C,ElButton:L,ElRadioButton:E,ElRadioGroup:D,ElSwitch:j,InfoIcon:X,FilePreview:ge,UploadIcon:N},mixins:[R],data(){return{fileList:[],uploadUrl:G()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},config(){return this.$store.state.kling?.config||{}},hasVideo(){return!!this.urls?.[0]},referenceType:{get(){return this.config.video_list?.[0]?.refer_type||`feature`},set(e){this.updateVideoOptions(e,this.keepOriginalSound)}},keepOriginalSound:{get(){return this.config.video_list?.[0]?.keep_original_sound===`yes`},set(e){this.updateVideoOptions(this.referenceType,e)}}},methods:{onExceed(){H.warning(this.$t(`kling.message.referenceVideoExceed`))},onError(){H.error(this.$t(`kling.message.referenceVideoError`))},beforeUpload(e){if((this.config.image_list?.length||0)+Number(!!this.config.start_image_url)+Number(!!this.config.end_image_url)>4)return H.error(this.$t(`kling.message.referenceVideoImageLimit`)),!1;let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=e.size/1024/1024<200;return t?n?!0:(H.error(this.$t(`kling.message.referenceVideoSizeExceed`)),!1):(H.error(this.$t(`kling.message.referenceVideoTypeFailed`)),!1)},ensurePromptToken(e){let t=this.$store.state.kling?.config,n=t?.prompt||``,r=n.includes(Q),i;if(e&&!r)i=n?`${n} ${Q}`:Q;else if(!e&&r)i=Ne(n);else return;this.$store.commit(`kling/setConfig`,{...t,prompt:i})},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,video_list:void 0}),this.ensurePromptToken(!1)},onSetVideoList(){let e=this.urls?.[0],t=e?[{video_url:e,refer_type:this.referenceType,keep_original_sound:this.keepOriginalSound?`yes`:`no`}]:void 0;this.$store.commit(`kling/setConfig`,{...this.config,video_list:t,generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0}),this.ensurePromptToken(!!e)},updateVideoOptions(e,t){let n=this.urls?.[0];n&&this.$store.commit(`kling/setConfig`,{...this.config,video_list:[{video_url:n,refer_type:e,keep_original_sound:t?`yes`:`no`}],...e===`base`?{start_image_url:void 0,end_image_url:void 0}:{},generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0})},async onSuccess(){this.onSetVideoList()}}}),Dt={class:`relative`},Ot={class:`flex justify-between`},kt={class:`flex justify-start items-center`},At={class:`text-sm font-bold`},jt={key:0,class:`reference-options mt-3 flex flex-col gap-3`},Mt={class:`flex flex-col items-stretch gap-2 sm:flex-row sm:items-center sm:justify-between`},Nt={class:`text-sm`},Pt={class:`flex items-center justify-between gap-3`},Ft={class:`text-sm`};function It(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`),x=l(`el-radio-button`),S=l(`el-radio-group`),C=l(`el-switch`);return g(),s(`div`,Dt,[e(`div`,Ot,[e(`div`,kt,[e(`span`,At,i(t.$t(`kling.name.referenceVideo`)),1),a(h,{content:t.$t(`kling.description.omniReferenceVideo`)},null,8,[`content`])])]),a(b,{"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4,.mov`,name:`file`,class:`value`,"show-file-list":!0,limit:1,multiple:!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.percentage===void 0?o(``,!0):(g(),f(_,{key:0,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferenceVideo`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`]),t.hasVideo?(g(),s(`div`,jt,[e(`div`,Mt,[e(`span`,Nt,i(t.$t(`kling.name.referenceVideoType`)),1),a(S,{modelValue:t.referenceType,"onUpdate:modelValue":n[1]||=e=>t.referenceType=e,size:`small`},{default:p(()=>[a(x,{value:`feature`},{default:p(()=>[r(i(t.$t(`kling.name.referenceVideoFeature`)),1)]),_:1}),a(x,{value:`base`},{default:p(()=>[r(i(t.$t(`kling.name.referenceVideoBase`)),1)]),_:1})]),_:1},8,[`modelValue`])]),e(`div`,Pt,[e(`span`,Ft,i(t.$t(`kling.name.keepOriginalSound`)),1),a(C,{modelValue:t.keepOriginalSound,"onUpdate:modelValue":n[2]||=e=>t.keepOriginalSound=e},null,8,[`modelValue`])])])):o(``,!0)])}var Lt=z(Et,[[`render`,It],[`__scopeId`,`data-v-e2491bf9`]]),Rt=v({name:`KlingReferenceImages`,components:{ElButton:L,ElUpload:C,UploadIcon:N,ImagePreview:J,InfoIcon:X},mixins:[B,R],data(){return{fileList:[],uploadUrl:G()+`/api/v1/files/`}},computed:{config(){return this.$store.state.kling?.config||{}},headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},frameCount(){return Number(!!this.config.start_image_url)+Number(!!this.config.end_image_url)},maxImages(){return this.config.video_list?.length?4:7},referenceLimit(){return Math.max(0,this.maxImages-this.frameCount)},remainingSlots(){return Math.max(0,this.referenceLimit-this.urls.length)},urls(){return this.fileList.map(e=>e.response?.file_url||e.url).filter(Boolean)},storeImages(){return this.config.image_list}},watch:{frameCount(){this.syncPromptTokens()},storeImages(e){!e?.length&&this.fileList.length>0&&(this.fileList=[])}},methods:{beforeUpload(){return this.remainingSlots===0?(this.onExceed(),!1):!0},onExceed(){H.warning(this.$t(`kling.message.referenceImagesExceed`,{count:this.remainingSlots}))},onError(){H.error(this.$t(`kling.message.referenceImagesError`))},clearOmniConflicts(e){return{...e,generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0}},syncPromptTokens(e){let t=e||this.config,n=[Pe(t.prompt),...this.urls.map((e,t)=>`<<<image_${this.frameCount+t+1}>>>`)].filter(Boolean).join(` `);n!==t.prompt&&this.$store.commit(`kling/setConfig`,{...t,prompt:n})},syncConfig(){let e=this.urls.length?this.urls.map(e=>({image_url:e})):void 0,t=this.clearOmniConflicts({...this.config,image_list:e});this.$store.commit(`kling/setConfig`,t),this.syncPromptTokens(t)},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.syncConfig()},onRemove(e,t){this.fileList.splice(e,1),t.url?.startsWith(`blob:`)&&URL.revokeObjectURL(t.url),this.syncConfig()}}}),zt={class:`relative`},Bt={class:`flex justify-between items-center`},Vt={class:`flex justify-start items-center`},Ht={class:`text-sm font-bold`},Ut={key:0,class:`file-list flex flex-wrap gap-2 mt-2`};function Wt(t,n,u,d,m,_){let v=l(`info-icon`),y=l(`UploadIcon`),b=l(`el-button`),x=l(`el-upload`),S=l(`image-preview`);return g(),s(`div`,zt,[e(`div`,Bt,[e(`div`,Vt,[e(`span`,Ht,i(t.$t(`kling.name.referenceImages`)),1),a(v,{content:t.$t(`kling.description.referenceImages`)},null,8,[`content`])]),a(x,{"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg`,name:`file`,limit:t.referenceLimit,multiple:!0,"show-file-list":!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{default:p(()=>[a(b,{round:``,type:`primary`,size:`small`,disabled:t.remainingSlots===0},{default:p(()=>[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferenceImages`)),1)]),_:1},8,[`disabled`])]),_:1},8,[`file-list`,`limit`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])]),t.fileList.length?(g(),s(`div`,Ut,[(g(!0),s(c,null,h(t.fileList,(e,n)=>(g(),f(S,{key:e.uid||e.url||n,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemove(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])):o(``,!0)])}var Gt=z(Rt,[[`render`,Wt]]),Kt=v({name:`CfgScaleSelector`,components:{ElSlider:A,InfoIcon:X,ElInputNumber:k},computed:{value:{get(){return this.$store.state?.kling?.config?.cfg_scale},set(e){console.debug(`set cfg_scale`,e),this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,cfg_scale:e})}}},mounted(){this.value||=0}}),qt={class:`flex justify-between`},Jt={class:`flex justify-start items-center`},Yt={class:`text-sm font-bold`},Xt={class:`flex justify-end items-center`},Zt={class:`w-full`};function Qt(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input-number`),p=l(`el-slider`);return g(),s(`div`,null,[e(`div`,qt,[e(`div`,Jt,[e(`span`,Yt,i(t.$t(`kling.name.cfgScale`)),1),a(d,{content:t.$t(`kling.description.cfgScale`)},null,8,[`content`])]),e(`div`,Xt,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,Zt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:0,max:1,step:.1},null,8,[`modelValue`])])])}var $t=z(Kt,[[`render`,Qt]]),en=v({name:`GenerateAudioSelector`,components:{ElSwitch:j,InfoIcon:X},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},selectedMode(){return this.$store.state.kling?.config?.mode||``},supported(){return!!(F.includes(this.selectedModel)||this.selectedModel===`kling-v2-6`&&this.selectedMode===`pro`)},tooltipContent(){return this.supported?this.$t(`kling.description.generateAudio`):this.$t(`kling.description.generateAudioUnsupported`)},value:{get(){return this.supported?this.$store.state.kling?.config?.generate_audio??!1:!1},set(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,generate_audio:e})}}},watch:{supported(e){!e&&this.$store.state.kling?.config?.generate_audio&&this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,generate_audio:!1})}}}),tn={class:`relative`},nn={class:`flex justify-between items-center`},rn={class:`flex justify-start items-center`},an={class:`text-sm font-bold`};function on(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,tn,[e(`div`,nn,[e(`div`,rn,[e(`span`,an,i(t.$t(`kling.name.generateAudio`)),1),a(d,{content:t.tooltipContent},null,8,[`content`])]),a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,disabled:!t.supported},null,8,[`modelValue`,`disabled`])])])}var sn=z(en,[[`render`,on]]),cn=[`horizontal`,`vertical`,`pan`,`tilt`,`roll`,`zoom`],ln=v({name:`CameraControlSelector`,components:{ElSelect:y,ElOption:b,ElSlider:A,ElInputNumber:k,InfoIcon:X},data(){return{configKeys:cn}},computed:{typeOptions(){return[{value:``,label:this.$t(`kling.name.cameraTypeNone`)},{value:`simple`,label:this.$t(`kling.name.cameraTypeSimple`)},{value:`down_back`,label:this.$t(`kling.name.cameraTypeDownBack`)},{value:`forward_up`,label:this.$t(`kling.name.cameraTypeForwardUp`)},{value:`left_turn_forward`,label:this.$t(`kling.name.cameraTypeLeftTurnForward`)},{value:`right_turn_forward`,label:this.$t(`kling.name.cameraTypeRightTurnForward`)}]},selectedMode(){return this.$store.state.kling?.config?.mode||``},selectedModel(){return this.$store.state.kling?.config?.model||``},selectedDuration(){return this.$store.state.kling?.config?.duration},motionControlSupported(){return Z(this.selectedModel,this.selectedMode,this.selectedDuration).motionControl},hasStartImage(){return!!this.$store.state.kling?.config?.start_image_url},disabled(){return!this.motionControlSupported||this.hasStartImage},tooltipContent(){return this.motionControlSupported?this.hasStartImage?this.$t(`kling.description.cameraControlDisabledImage2Video`):this.$t(`kling.description.cameraControl`):this.$t(`kling.description.cameraControlNotSupported`)},selectedType(){return this.$store.state.kling?.config?.camera_control?.type},selectedTypeRaw:{get(){return this.selectedType??``},set(e){let t=this.$store.state.kling?.config||{};if(!e){let e={...t};delete e.camera_control,this.$store.commit(`kling/setConfig`,e);return}let n=e;this.$store.commit(`kling/setConfig`,{...t,camera_control:{type:n,config:n===`simple`?t.camera_control?.config||{}:void 0}})}},configValues(){return this.$store.state.kling?.config?.camera_control?.config||{}}},watch:{disabled(e){e&&this.selectedType!==void 0&&(this.selectedTypeRaw=``)}},methods:{writeConfig(e,t){let n=this.$store.state.kling?.config||{},r=n.camera_control||{type:`simple`},i={...r.config||{}};t==null?delete i[e]:i[e]=t,this.$store.commit(`kling/setConfig`,{...n,camera_control:{...r,type:`simple`,config:i}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),un={class:`field`},dn={class:`header`},fn={class:`text-sm font-bold`},pn={key:0,class:`config-grid`},mn={class:`cfg-row-head`},hn={class:`cfg-name`};function gn(t,n,r,u,d,m){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-select`),b=l(`el-input-number`),x=l(`el-slider`);return g(),s(`div`,un,[e(`div`,dn,[e(`span`,fn,i(t.$t(`kling.name.cameraControl`)),1),a(_,{content:t.tooltipContent},null,8,[`content`])]),a(y,{modelValue:t.selectedTypeRaw,"onUpdate:modelValue":n[0]||=e=>t.selectedTypeRaw=e,class:`value`,placeholder:t.$t(`kling.placeholder.cameraType`),clearable:!0,disabled:t.disabled},{default:p(()=>[(g(!0),s(c,null,h(t.typeOptions,e=>(g(),f(v,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`]),t.selectedType===`simple`&&!t.disabled?(g(),s(`div`,pn,[(g(!0),s(c,null,h(t.configKeys,n=>(g(),s(`div`,{key:n,class:`cfg-row`},[e(`div`,mn,[e(`span`,hn,i(t.$t(`kling.name.cc_${n}`)),1),a(b,{modelValue:t.configValues[n],"onUpdate:modelValue":e=>t.configValues[n]=e,min:-1,max:1,step:.1,precision:1,"controls-position":`right`,size:`small`,class:`cfg-num`,onChange:e=>t.onNumberChange(n,e)},null,8,[`modelValue`,`onUpdate:modelValue`,`onChange`])]),a(x,{"model-value":t.configValues[n]??0,min:-1,max:1,step:.1,onInput:e=>t.onSliderChange(n,e)},null,8,[`model-value`,`onInput`])]))),128))])):o(``,!0)])}var _n=z(ln,[[`render`,gn],[`__scopeId`,`data-v-cd896060`]]),vn=[{groupKey:`cameraMovements`,chipKeys:[`rotateAround`,`stationary`,`handheld`,`zoomOut`,`zoomIn`,`follow`,`panRight`,`tiltUp`,`tiltDown`,`orbit`]},{groupKey:`cameraSpeed`,chipKeys:[`speedSlow`,`speedMedium`,`speedFast`]},{groupKey:`shotType`,chipKeys:[`shotClose`,`shotMedium`,`shotLong`,`shotLowAngle`,`shotHighAngle`,`shotShallowDof`,`shotFront`,`shotProfile`,`shotCloseUp`,`shotDrone`]},{groupKey:`light`,chipKeys:[`lightSunlight`,`lightSoft`,`lightNeon`,`lightWarm`,`lightNature`,`lightCandle`,`lightCityNight`]},{groupKey:`frame`,chipKeys:[`frameRichDetails`,`frameSimpleBg`]},{groupKey:`atmosphere`,chipKeys:[`atmosphereMysterious`,`atmospherePeaceful`,`atmosphereHeartwarming`,`atmosphereVivid`,`atmosphereColorful`]}],$=`, `;function yn(e,t){let n=(e||``).trim();return n?n.includes(t)?n:`${n}${$}${t}`:t}function bn(e,t){if(!e||!t)return e||``;let n=[`${t}${$}`,`${$}${t}`,t],r=e;for(let e of n)if(r.includes(e)){r=r.replace(e,``);break}return r.replace(/(?:,\s*)+$/,``).replace(/^(?:,\s*)+/,``)}var xn=v({name:`InspirationPills`,components:{CloseIcon:he},computed:{prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return vn.flatMap(e=>e.chipKeys.map(e=>this.$t(`kling.inspiration.chip.${e}`)))},selected(){let e=this.prompt;if(!e)return[];let t=[];for(let n of this.allChipTexts){let r=e.indexOf(n);r!==-1&&t.push({text:n,idx:r})}return t.sort((e,t)=>e.idx-t.idx).map(e=>e.text)}},methods:{onRemove(e){let t=bn(this.prompt,e);this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:t})}}}),Sn={key:0,class:`pills`,role:`list`},Cn={class:`pill-text`},wn=[`aria-label`,`title`,`onClick`];function Tn(n,r,u,d,f,p){let m=l(`close-icon`);return n.selected.length>0?(g(),s(`div`,Sn,[(g(!0),s(c,null,h(n.selected,r=>(g(),s(`div`,{key:r,class:`pill`,role:`listitem`},[e(`span`,Cn,i(r),1),e(`button`,{type:`button`,class:`pill-remove`,"aria-label":n.$t(`kling.inspiration.removeChip`),title:n.$t(`kling.inspiration.removeChip`),onClick:t(e=>n.onRemove(r),[`stop`])},[a(m,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,wn)]))),128))])):o(``,!0)}var En=v({name:`PromptInput`,components:{IdeaIcon:ae,ElButton:L,PromptTextarea:oe,InspirationPills:z(xn,[[`render`,Tn],[`__scopeId`,`data-v-6be01bcf`]])},emits:[`open-inspiration`],computed:{prompt:{get(){return this.$store.state.kling?.config?.prompt},set(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Dn(e,t,n,o,s,c){let u=l(`idea-icon`),d=l(`el-button`),m=l(`inspiration-pills`),h=l(`prompt-textarea`);return g(),f(h,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||=t=>e.prompt=t,title:e.$t(`kling.name.prompt`),info:e.$t(`kling.description.prompt`),placeholder:e.$t(`kling.placeholder.prompt`)},{actions:p(()=>[a(d,{text:``,size:`small`,class:`inspiration-btn`,onClick:t[0]||=t=>e.$emit(`open-inspiration`)},{default:p(()=>[a(u,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(e.$t(`kling.inspiration.openButton`)),1)]),_:1})]),before:p(()=>[a(m)]),_:1},8,[`modelValue`,`title`,`info`,`placeholder`])}var On=z(En,[[`render`,Dn],[`__scopeId`,`data-v-5754ae54`]]),kn=v({name:`NegativePromptInput`,components:{ElInput:K,InfoIcon:X},computed:{prompt:{get(){return this.$store.state.kling?.config?.negative_prompt},set(e){console.debug(`set prompt`,e),this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,negative_prompt:e})}}},mounted(){this.prompt||=``}}),An={class:`field`},jn={class:`box`},Mn={class:`title font-bold`};function Nn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,An,[e(`div`,jn,[e(`h2`,Mn,i(t.$t(`kling.name.negativePrompt`)),1),a(d,{content:t.$t(`kling.description.negativePrompt`),class:`info`},null,8,[`content`])]),a(f,{modelValue:t.prompt,"onUpdate:modelValue":n[0]||=e=>t.prompt=e,rows:3,type:`textarea`,class:`prompt`,placeholder:t.$t(`kling.placeholder.negativePrompt`)},null,8,[`modelValue`,`placeholder`])])}var Pn=z(kn,[[`render`,Nn],[`__scopeId`,`data-v-de98cf01`]]),Fn=v({name:`InspirationDrawer`,components:{Close:he,IdeaIcon:ae,ElDrawer:O,ElButton:L},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`],data(){return{groups:vn}},computed:{visible:{get(){return this.modelValue},set(e){this.$emit(`update:modelValue`,e)}},drawerSize(){return window.innerWidth<768?`100%`:`380px`},prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return this.groups.flatMap(e=>e.chipKeys.map(e=>this.$t(`kling.inspiration.chip.${e}`)))},selectedCount(){return this.allChipTexts.filter(e=>this.isSelected(e)).length}},methods:{chipText(e){return this.$t(`kling.inspiration.chip.${e}`)},isSelected(e){return e?this.prompt.includes(e):!1},setPrompt(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:e})},onToggle(e){e&&(this.isSelected(e)?this.setPrompt(bn(this.prompt,e)):this.setPrompt(yn(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(let t of this.allChipTexts)for(;e.includes(t);)e=bn(e,t);this.setPrompt(e)}}}),In={class:`drawer-content`},Ln={class:`drawer-header`},Rn={class:`title-row`},zn={class:`title`},Bn={class:`hint`},Vn={key:0,class:`selected-bar`},Hn={class:`selected-text`},Un={class:`groups`},Wn={class:`group-title`},Gn={class:`chip-grid`},Kn=[`onClick`];function qn(t,u,d,m,_,v){let y=l(`idea-icon`),b=l(`close`),x=l(`el-button`),S=l(`el-drawer`);return g(),f(S,{modelValue:t.visible,"onUpdate:modelValue":u[1]||=e=>t.visible=e,direction:`rtl`,"with-header":!1,size:t.drawerSize,"custom-class":`kling-inspiration-drawer`,"destroy-on-close":!1},{default:p(()=>[e(`div`,In,[e(`div`,Ln,[e(`div`,Rn,[a(y,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,zn,i(t.$t(`kling.inspiration.title`)),1)]),a(x,{text:``,class:`close-btn`,"aria-label":t.$t(`common.button.close`),title:t.$t(`common.button.close`),onClick:u[0]||=e=>t.visible=!1},{default:p(()=>[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`])]),e(`div`,Bn,i(t.$t(`kling.inspiration.hint`)),1),t.selectedCount>0?(g(),s(`div`,Vn,[e(`span`,Hn,i(t.$t(`kling.inspiration.selectedSummary`,{count:t.selectedCount})),1),a(x,{text:``,size:`small`,class:`clear-btn`,onClick:t.onClearSelected},{default:p(()=>[r(i(t.$t(`kling.inspiration.clearSelected`)),1)]),_:1},8,[`onClick`])])):o(``,!0),e(`div`,Un,[(g(!0),s(c,null,h(t.groups,r=>(g(),s(`div`,{key:r.groupKey,class:`group`},[e(`div`,Wn,i(t.$t(`kling.inspiration.group.${r.groupKey}`)),1),e(`div`,Gn,[(g(!0),s(c,null,h(r.chipKeys,e=>(g(),s(`button`,{key:e,type:`button`,class:n({chip:!0,active:t.isSelected(t.chipText(e))}),onClick:n=>t.onToggle(t.chipText(e))},i(t.chipText(e)),11,Kn))),128))])]))),128))])])]),_:1},8,[`modelValue`,`size`])}var Jn=z(Fn,[[`render`,qn],[`__scopeId`,`data-v-8b2e6a5d`]]),Yn={"kling-v3":`v3`,"kling-v3-omni":`v3-Omni`,"kling-v2-6":`v2.6`,"kling-v2-5-turbo":`v2.5-Turbo`,"kling-v2-1-master":`v2.1-Master`,"kling-v2-master":`v2-Master`,"kling-v1-6":`v1.6`,"kling-v1":`v1`,"kling-o1":`Kling O1`},Xn={std:`720p`,pro:`1080p`,"4k":`4K`},Zn=v({name:`SummaryChip`,components:{AudioIcon:re},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){let e=this.config?.model||`kling-v2-5-turbo`;return Yn[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||``},modeLabel(){let e=this.config?.mode||`std`;return Xn[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),Qn={class:`summary-chip`},$n=[`title`],er=[`title`],tr=[`title`],nr=[`title`],rr=[`title`];function ir(t,n,r,c,u,d){let f=l(`audio-icon`);return g(),s(`div`,Qn,[e(`span`,{class:`part`,title:t.$t(`kling.name.model`)},i(t.modelLabel),9,$n),n[0]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.duration`)},i(t.durationLabel),9,er),n[1]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.ratio`)},i(t.aspectRatio||`16:9`),9,tr),n[2]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.mode`)},i(t.modeLabel),9,nr),t.generateAudio?(g(),s(`span`,{key:0,class:`audio`,title:t.$t(`kling.name.generateAudio`)},[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,rr)):o(``,!0)])}var ar=v({name:`ConfigPanel`,components:{MagicIcon:P,ElButton:L,Consumption:Y,PromptInput:On,NegativePromptInput:Pn,ModelSelector:Ve,ModeSelector:Je,DurationSelector:it,RatioSelector:dt,StartImage:vt,CfgScaleSelector:$t,GenerateAudioSelector:sn,CameraControlSelector:_n,InspirationDrawer:Jn,SummaryChip:z(Zn,[[`render`,ir],[`__scopeId`,`data-v-c800852a`]]),EndImage:Tt,ReferenceImages:Gt,ReferenceVideo:Lt},emits:[`generate`],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},capabilities(){return Z(this.config?.model,this.config?.mode,this.config?.duration)},omniActive(){return this.config?.model===`kling-o1`||!!(this.config?.image_list?.length||this.config?.video_list?.length)},consumption(){return pe(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),or={class:`flex flex-col h-full`},sr={class:`flex-1 overflow-y-auto p-5`},cr={class:`flex flex-col items-center justify-center px-5 pb-5`};function lr(t,n,c,u,d,m){let h=l(`prompt-input`),_=l(`model-selector`),v=l(`ratio-selector`),y=l(`reference-images`),b=l(`reference-video`),x=l(`start-image`),S=l(`end-image`),C=l(`duration-selector`),w=l(`mode-selector`),T=l(`generate-audio-selector`),E=l(`camera-control-selector`),D=l(`cfg-scale-selector`),O=l(`negative-prompt-input`),k=l(`summary-chip`),A=l(`consumption`),j=l(`magic-icon`),M=l(`el-button`),ee=l(`inspiration-drawer`);return g(),s(`div`,or,[e(`div`,sr,[a(h,{class:`mb-4`,onOpenInspiration:n[0]||=e=>t.inspirationOpen=!0}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),t.capabilities.referenceImages?(g(),f(y,{key:0,class:`mb-3`})):o(``,!0),t.capabilities.referenceVideo?(g(),f(b,{key:1,class:`mb-2`})):o(``,!0),a(x,{class:`mb-2`}),a(S,{class:`mb-2`}),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`}),t.omniActive?o(``,!0):(g(),f(E,{key:2,class:`mb-4`})),t.omniActive?o(``,!0):(g(),f(D,{key:3,class:`mb-4`})),t.omniActive?o(``,!0):(g(),f(O,{key:4,class:`mb-4`}))]),e(`div`,cr,[a(k),a(A,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),t.config?.video_url!==void 0||t.config?.custom?(g(),f(M,{key:0,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(j,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.extend`)),1)]),_:1},8,[`onClick`])):(g(),f(M,{key:1,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(j,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generate`)),1)]),_:1},8,[`onClick`]))]),a(ee,{modelValue:t.inspirationOpen,"onUpdate:modelValue":n[1]||=e=>t.inspirationOpen=e},null,8,[`modelValue`])])}var ur=z(ar,[[`render`,lr]]),dr=v({name:`MotionImage`,components:{UploadIcon:N,ElUpload:C,ElButton:L,InfoIcon:X,ImagePreview:J},mixins:[B,R],data(){return{fileList:[],uploadUrl:G()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetImageUrl()},methods:{onExceed(){H.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){H.error(this.$t(`kling.message.uploadReferencesError`))},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,image_url:void 0})},onSetImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,image_url:e})},async onSuccess(){this.onSetImageUrl()}}}),fr={class:`relative`},pr={class:`flex justify-between`},mr={class:`flex justify-start items-center`},hr={class:`text-sm font-bold`};function gr(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,fr,[e(`div`,pr,[e(`div`,mr,[e(`span`,hr,i(t.$t(`kling.name.motionImage`)),1),a(h,{content:t.$t(`kling.description.motionImage`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var _r=z(dr,[[`render`,gr],[`__scopeId`,`data-v-32f5471f`]]),vr=v({name:`MotionVideo`,components:{UploadIcon:N,ElUpload:C,ElButton:L,InfoIcon:X,FilePreview:ge},mixins:[R],data(){return{fileList:[],uploadUrl:G()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetVideoUrl()},methods:{onExceed(){H.warning(this.$t(`kling.message.uploadVideoExceed`))},onError(){H.error(this.$t(`kling.message.uploadVideoError`))},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,video_url:void 0})},beforeUpload(e){let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=e.size/1024/1024<100;return t?n?!0:(H.error(this.$t(`kling.message.uploadVideoSizeExceed`)),!1):(H.error(this.$t(`kling.message.uploadVideoTypeFailed`)),!1)},onSetVideoUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,video_url:e})},async onSuccess(){this.onSetVideoUrl()}}}),yr={class:`relative`},br={class:`flex justify-between`},xr={class:`flex justify-start items-center`},Sr={class:`text-sm font-bold`};function Cr(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,yr,[e(`div`,br,[e(`div`,xr,[e(`span`,Sr,i(t.$t(`kling.name.motionVideo`)),1),a(h,{content:t.$t(`kling.description.motionVideo`)},null,8,[`content`])])]),a(b,{"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4,.mov`,name:`file`,class:`value`,"show-file-list":!0,limit:1,multiple:!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.percentage===void 0?o(``,!0):(g(),f(_,{key:0,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadVideoUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var wr=z(vr,[[`render`,Cr],[`__scopeId`,`data-v-80320d94`]]),Tr=v({name:`MotionPromptInput`,components:{ElInput:K,InfoIcon:X},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||``},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),Er={class:`field`},Dr={class:`box`},Or={class:`title font-bold`};function kr(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,Er,[e(`div`,Dr,[e(`h2`,Or,i(t.$t(`kling.name.motionPrompt`)),1),a(d,{content:t.$t(`kling.description.motionPrompt`),class:`info`},null,8,[`content`])]),a(f,{modelValue:t.prompt,"onUpdate:modelValue":n[0]||=e=>t.prompt=e,rows:3,type:`textarea`,class:`prompt`,placeholder:t.$t(`kling.placeholder.motionPrompt`)},null,8,[`modelValue`,`placeholder`])])}var Ar=z(Tr,[[`render`,kr],[`__scopeId`,`data-v-ca9fdbe5`]]),jr=`video`,Mr=v({name:`CharacterOrientationSelector`,components:{ElRadioGroup:D,ElRadioButton:E,InfoIcon:X},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||jr},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,character_orientation:e})}}},mounted(){this.$store.state.kling?.motionConfig?.character_orientation||(this.value=jr)}}),Nr={class:`field`},Pr={class:`header`},Fr={class:`text-sm font-bold`};function Ir(t,n,o,c,u,d){let f=l(`info-icon`),m=l(`el-radio-button`),h=l(`el-radio-group`);return g(),s(`div`,Nr,[e(`div`,Pr,[e(`span`,Fr,i(t.$t(`kling.name.characterOrientation`)),1),a(f,{content:t.$t(`kling.description.characterOrientation`)},null,8,[`content`])]),a(h,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,size:`small`,class:`value`},{default:p(()=>[a(m,{label:`image`},{default:p(()=>[r(i(t.$t(`kling.name.orientationImage`)),1)]),_:1}),a(m,{label:`video`},{default:p(()=>[r(i(t.$t(`kling.name.orientationVideo`)),1)]),_:1})]),_:1},8,[`modelValue`])])}var Lr=z(Mr,[[`render`,Ir],[`__scopeId`,`data-v-7a91195b`]]),Rr=`kling-v2-6`,zr=v({name:`MotionModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:X},computed:{options(){return[{value:`kling-v2-6`,label:`Kling 2.6`},{value:`kling-v3`,label:`Kling 3.0`}]},value:{get(){return this.$store.state.kling?.motionConfig?.model_name||Rr},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,model_name:e})}}},mounted(){this.$store.state.kling?.motionConfig?.model_name||(this.value=Rr)}}),Br={class:`field`},Vr={class:`header`},Hr={class:`title font-bold`};function Ur(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Br,[e(`div`,Vr,[e(`h2`,Hr,i(t.$t(`kling.name.motionModel`)),1),a(m,{content:t.$t(`kling.description.motionModel`)},null,8,[`content`])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Wr=z(zr,[[`render`,Ur],[`__scopeId`,`data-v-480e8da2`]]),Gr=`std`,Kr=v({name:`MotionModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:X},computed:{options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`)},{value:`pro`,label:this.$t(`kling.name.modePro`)}]},value:{get(){return this.$store.state.kling?.motionConfig?.mode||Gr},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=Gr)}}),qr={class:`field`},Jr={class:`header`},Yr={class:`title font-bold`};function Xr(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,qr,[e(`div`,Jr,[e(`h2`,Yr,i(t.$t(`kling.name.mode`)),1),a(m,{content:t.$t(`kling.description.motionMode`)},null,8,[`content`])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Zr=z(Kr,[[`render`,Xr],[`__scopeId`,`data-v-1295688c`]]),Qr=v({name:`KeepOriginalSoundSelector`,components:{ElSwitch:j,InfoIcon:X},computed:{value:{get(){return(this.$store.state.kling?.motionConfig?.keep_original_sound??`yes`)===`yes`},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,keep_original_sound:e?`yes`:`no`})}}}}),$r={class:`relative`},ei={class:`flex justify-between items-center`},ti={class:`flex justify-start items-center`},ni={class:`text-sm font-bold`};function ri(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,$r,[e(`div`,ei,[e(`div`,ti,[e(`span`,ni,i(t.$t(`kling.name.keepOriginalSound`)),1),a(d,{content:t.$t(`kling.description.keepOriginalSound`)},null,8,[`content`])]),a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e},null,8,[`modelValue`])])])}var ii=v({name:`MotionPanel`,components:{MagicIcon:P,ElButton:L,Consumption:Y,MotionImage:_r,MotionVideo:wr,MotionPromptInput:Ar,CharacterOrientationSelector:Lr,MotionModelSelector:Wr,MotionModeSelector:Zr,KeepOriginalSoundSelector:z(Qr,[[`render`,ri]])},emits:[`generate`],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return pe({...this.motionConfig,duration:1},this.service?.cost)},service(){return this.$store.state.kling?.service},canGenerate(){let e=this.motionConfig;return!!(e?.image_url&&e?.video_url)}},methods:{onGenerate(){this.$emit(`generate`)}}}),ai={class:`flex flex-col h-full`},oi={class:`flex-1 overflow-y-auto p-5`},si={class:`flex flex-col items-center justify-center px-5 pb-5`};function ci(t,n,o,c,u,d){let f=l(`motion-image`),m=l(`motion-video`),h=l(`motion-prompt-input`),_=l(`character-orientation-selector`),v=l(`motion-model-selector`),y=l(`motion-mode-selector`),b=l(`keep-original-sound-selector`),x=l(`consumption`),S=l(`magic-icon`),C=l(`el-button`);return g(),s(`div`,ai,[e(`div`,oi,[a(f,{class:`mb-3`}),a(m,{class:`mb-3`}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`})]),e(`div`,si,[a(x,{value:t.consumption,service:t.service,"rate-unit":t.$t(`kling.name.perSecond`),note:t.$t(`kling.message.motionPricingNote`)},null,8,[`value`,`service`,`rate-unit`,`note`]),a(C,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(S,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generateMotion`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var li=z(ii,[[`render`,ci]]),ui=v({name:`KlingTabSwitcher`,components:{ElTabs:x,ElTabPane:S,ElTag:de},props:{modelValue:{type:String,default:`videos`}},emits:[`update:modelValue`],computed:{tabs(){return[{value:`videos`,label:this.$t(`kling.tab.videoGeneration`)},{value:`motion`,label:this.$t(`kling.tab.motionControl`)},{value:`talking-photo`,label:this.$t(`kling.tab.talkingPhoto`)}]}},methods:{onUpdate(e){this.$emit(`update:modelValue`,e)}}}),di=[`title`],fi={class:`text`};function pi(t,n,a,u,d,m){let _=l(`el-tag`),v=l(`el-tab-pane`),y=l(`el-tabs`);return g(),f(y,{"model-value":t.modelValue,class:`kling-tabs`,stretch:``,"onUpdate:modelValue":t.onUpdate},{default:p(()=>[(g(!0),s(c,null,h(t.tabs,t=>(g(),f(v,{key:t.value,name:t.value,disabled:t.disabled},{label:p(()=>[e(`span`,{class:`tab-label`,title:t.disabled?t.disabledReason:void 0},[e(`span`,fi,i(t.label),1),t.badge?(g(),f(_,{key:0,size:`small`,type:`warning`,class:`badge`},{default:p(()=>[r(i(t.badge),1)]),_:2},1024)):o(``,!0)],8,di)]),_:2},1032,[`name`,`disabled`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var mi=z(ui,[[`render`,pi],[`__scopeId`,`data-v-5dee42a1`]]),hi={"kling-v2-6":`v2.6`,"kling-v2-5-turbo":`v2.5-Turbo`,"kling-v2-1-master":`v2.1-Master`,"kling-v2-master":`v2-Master`,"kling-v1-6":`v1.6`,"kling-v1":`v1`},gi=v({name:`TalkingPhotoModelSelector`,components:{ElSelect:y,ElOption:b},data(){return{options:ce.map(e=>({value:e,label:hi[e]||e}))}},computed:{value:{get(){return this.$store.state.kling?.talkingPhotoConfig?.model||`kling-v2-1-master`},set(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.$store.state.kling?.talkingPhotoConfig,model:e})}}},mounted(){this.$store.state.kling?.talkingPhotoConfig?.model||(this.value=ue)}}),_i={class:`field`},vi={class:`title font-bold`};function yi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,_i,[e(`h2`,vi,i(t.$t(`kling.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var bi=z(gi,[[`render`,yi],[`__scopeId`,`data-v-cbc83d11`]]),xi=v({name:`TalkingPhotoModeSelector`,components:{ElSelect:y,ElOption:b},computed:{options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`)},{value:`pro`,label:this.$t(`kling.name.modePro`)}]},value:{get(){return this.$store.state.kling?.talkingPhotoConfig?.mode||`pro`},set(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.$store.state.kling?.talkingPhotoConfig,mode:e})}}},mounted(){this.$store.state.kling?.talkingPhotoConfig?.mode||(this.value=`pro`)}}),Si={class:`field`},Ci={class:`title font-bold`};function wi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Si,[e(`h2`,Ci,i(t.$t(`kling.name.mode`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Ti=v({name:`TalkingPhotoPanel`,components:{MagicIcon:P,UploadIcon:N,ElUpload:C,ElButton:L,ElInput:K,Consumption:Y,InfoIcon:X,ImagePreview:J,ModelSelector:bi,ModeSelector:z(xi,[[`render`,wi],[`__scopeId`,`data-v-92525a1d`]])},mixins:[R],emits:[`generate`],data(){return{imageFiles:[],audioFiles:[],uploadUrl:G()+`/api/v1/files/`}},computed:{config(){return this.$store.state.kling?.talkingPhotoConfig||{}},audioUrl(){return this.config.audio_url},headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},service(){return this.$store.state.kling?.service},consumption(){return pe({...this.config,action:`talking-photo`},this.service?.cost)},canGenerate(){return!!(this.config.image_url&&this.config.audio_url)}},methods:{commit(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.config,...e})},onPromptChange(e){this.commit({prompt:e})},onImageExceed(){H.warning(this.$t(`kling.message.uploadReferencesExceed`))},onImageError(){H.error(this.$t(`kling.message.uploadReferencesError`))},onImageSuccess(e){this.commit({image_url:e?.file_url})},onImageRemove(e){this.imageFiles.splice(this.imageFiles.indexOf(e),1),this.commit({image_url:void 0})},onAudioExceed(){H.warning(this.$t(`kling.message.uploadAudioExceed`))},onAudioError(){H.error(this.$t(`kling.message.uploadAudioError`))},onAudioSuccess(e){this.commit({audio_url:e?.file_url})},onAudioRemove(){this.commit({audio_url:void 0})},onGenerate(){this.$emit(`generate`)}}}),Ei={class:`flex flex-col h-full`},Di={class:`flex-1 overflow-y-auto p-5`},Oi={class:`relative mb-4`},ki={class:`flex justify-start items-center`},Ai={class:`text-sm font-bold`},ji={class:`relative mb-4`},Mi={class:`flex justify-start items-center`},Ni={class:`text-sm font-bold`},Pi=[`src`],Fi={class:`mb-4`},Ii={class:`flex justify-start items-center`},Li={class:`text-sm font-bold`},Ri={class:`flex flex-col items-center justify-center px-5 pb-5`};function zi(t,n,c,u,d,m){let h=l(`model-selector`),_=l(`mode-selector`),v=l(`info-icon`),y=l(`image-preview`),b=l(`upload-icon`),x=l(`el-button`),S=l(`el-upload`),C=l(`el-input`),w=l(`consumption`),T=l(`magic-icon`);return g(),s(`div`,Ei,[e(`div`,Di,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),e(`div`,Oi,[e(`div`,ki,[e(`span`,Ai,i(t.$t(`kling.name.talkingPhotoImage`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoImage`)},null,8,[`content`])]),a(S,{ref:`imageUploader`,"file-list":t.imageFiles,"onUpdate:fileList":n[0]||=e=>t.imageFiles=e,name:`file`,accept:`.png,.jpg,.jpeg,.webp,.bmp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,headers:t.headers,"on-exceed":t.onImageExceed,"on-error":t.onImageError,"on-success":t.onImageSuccess},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(y,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onImageRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(x,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(b,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`])]),e(`div`,ji,[e(`div`,Mi,[e(`span`,Ni,i(t.$t(`kling.name.talkingPhotoAudio`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoAudio`)},null,8,[`content`])]),a(S,{ref:`audioUploader`,"file-list":t.audioFiles,"onUpdate:fileList":n[1]||=e=>t.audioFiles=e,name:`file`,accept:`.mp3,.wav,.m4a,.aac`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,headers:t.headers,"on-exceed":t.onAudioExceed,"on-error":t.onAudioError,"on-success":t.onAudioSuccess,"on-remove":t.onAudioRemove},{default:p(()=>[a(x,{round:``,type:`primary`,size:`small`,class:`btn`},{default:p(()=>[a(b,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadAudio`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`,`on-remove`]),t.audioUrl?(g(),s(`audio`,{key:0,src:t.audioUrl,controls:``,class:`w-full mt-2`},null,8,Pi)):o(``,!0)]),e(`div`,Fi,[e(`div`,Ii,[e(`span`,Li,i(t.$t(`kling.name.talkingPhotoPrompt`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoPrompt`)},null,8,[`content`])]),a(C,{"model-value":t.config.prompt,type:`textarea`,rows:2,placeholder:t.$t(`kling.placeholder.talkingPhotoPrompt`),class:`mt-1`,"onUpdate:modelValue":t.onPromptChange},null,8,[`model-value`,`placeholder`,`onUpdate:modelValue`])])]),e(`div`,Ri,[a(w,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(x,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(T,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generateTalkingPhoto`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var Bi=z(Ti,[[`render`,zi],[`__scopeId`,`data-v-1cf65bf0`]]),Vi=v({name:`TaskPreview`,components:{ChannelIcon:ne,InfoIcon:ie,MagicIcon:P,TimeIcon:ee,WarningIcon:se,CopyToClipboard:te,ElAlert:T,VideoPlayer:be,ElTooltip:w,ElButton:L,ImagePreview:J,VideoPreview:Ce,AudioPreview:we,ApiCodeButton:xe},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},referenceImages(){let e=[],t=this.modelValue?.request?.start_image_url,n=this.modelValue?.request?.end_image_url,r=this.modelValue?.request?.image_url;return t&&e.push({url:t,name:`start-image`}),n&&e.push({url:n,name:`end-image`}),r&&e.push({url:r,name:`reference-image`}),e},referenceVideos(){let e=[],t=this.modelValue?.request?.video_url;t&&e.push({url:t,name:`reference-video`});let n=this.modelValue?.request?.video_list;return(Array.isArray(n)?n:[]).forEach((t,n)=>{t?.video_url&&e.push({url:t.video_url,name:`reference-video-${n+1}`})}),e},referenceAudios(){let e=this.modelValue?.request?.audio_url;return e?[{url:e,name:`reference-audio`}]:[]}},methods:{onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),Hi={class:`preview`},Ui={class:`left`},Wi={class:`main`},Gi={class:`bot`},Ki={class:`datetime`},qi={class:`info`},Ji={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Yi={key:1,class:`prompt mt-2`},Xi={key:0},Zi={key:1},Qi={key:0,class:n({content:!0,failed:!0})},$i={key:0,class:`mb-4`},ea={key:1,class:n({operations:!0,"mt-2":!0})},ta={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},na={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ra={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ia={key:1,class:n({content:!0})},aa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},oa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},sa={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ca={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},la={key:2,class:n({content:!0})},ua={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},da={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function fa(t,n,u,d,m,_){let v=l(`capability-presentation`),y=l(`image-preview`),b=l(`video-preview`),x=l(`audio-preview`),S=l(`video-player`),C=l(`el-button`),w=l(`el-tooltip`),T=l(`api-code-button`),E=l(`channel-icon`),D=l(`magic-icon`),O=l(`copy-to-clipboard`),k=l(`time-icon`),A=l(`el-alert`),j=l(`warning-icon`),M=l(`info-icon`);return g(),s(`div`,Hi,[e(`div`,Ui,[a(v,{capability:`kling`,part:`avatar`,class:`avatar`})]),e(`div`,Wi,[e(`div`,Gi,[a(v,{capability:`kling`,part:`name`}),e(`span`,Ki,i(t.$dayjs.format(``+new Date(parseFloat((t.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,qi,[t.referenceImages.length>0||t.referenceVideos.length>0||t.referenceAudios.length>0?(g(),s(`div`,Ji,[(g(!0),s(c,null,h(t.referenceImages,(e,t)=>(g(),f(y,{key:`image-${t}`,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(t.referenceVideos,(e,t)=>(g(),f(b,{key:`video-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(t.referenceAudios,(e,t)=>(g(),f(x,{key:`audio-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128))])):o(``,!0),t.modelValue?.request?.prompt?(g(),s(`p`,Yi,[r(i(t.modelValue?.request?.prompt)+` `,1),t.modelValue?.response?o(``,!0):(g(),s(`span`,Xi,` - (`+i(t.$t(`kling.status.pending`))+`) `,1)),t.modelValue?.response?.state===`submitted`||t.modelValue?.response?.state===`processing`||t.modelValue?.response?.state===`pending`||t.modelValue?.response?.state===`completed`?(g(),s(`span`,Zi,` - (`+i(t.$t(`kling.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),t.modelValue?.response?.success===!0?(g(),s(`div`,Qi,[t.modelValue?.response.video_url?(g(),s(`div`,$i,[a(S,{src:t.modelValue?.response.video_url},null,8,[`src`])])):o(``,!0),t.modelValue?.response.success?(g(),s(`div`,ea,[a(w,{class:`box-item`,effect:`dark`,content:t.$t(`kling.message.downloadVideo`),placement:`top-start`},{default:p(()=>[t.modelValue?.response.video_url?(g(),f(C,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:n[0]||=e=>t.onDownload(e,t.modelValue?.response.video_url)},{default:p(()=>[r(i(t.$t(`kling.button.download`)),1)]),_:1})):o(``,!0)]),_:1},8,[`content`]),a(T,{path:`/kling/videos`,body:t.modelValue?.request},null,8,[`body`])])):o(``,!0),a(A,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,ta,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.model`))+`: `+i(t.modelValue?.request?.model),1)]),e(`p`,na,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(O,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.elapsed?(g(),s(`p`,ra,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.elapsed`))+`: `+i(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),t.modelValue?.response?.success===!1?(g(),s(`div`,ia,[a(A,{closable:!1,class:`failure`},{template:p(()=>[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,aa,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(O,{content:t.modelValue?.id},null,8,[`content`])]),e(`p`,oa,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.failureReason`))+`: `+i(t.modelValue?.response?.error?.message)+` `,1),a(O,{content:t.modelValue?.response?.error?.message},null,8,[`content`])]),t.modelValue?.elapsed?(g(),s(`p`,sa,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.elapsed`))+`: `+i(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),t.modelValue?.response?.trace_id?(g(),s(`p`,ca,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.traceId`))+`: `+i(t.modelValue?.response?.trace_id)+` `,1),a(O,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),t.modelValue?.response?.success===void 0?(g(),s(`div`,la,[a(A,{closable:!1,class:`info`},{template:p(()=>[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,ua,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(O,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.response?.trace_id?(g(),s(`p`,da,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.traceId`))+`: `+i(t.modelValue?.response?.trace_id)+` `,1),a(O,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var pa=v({name:`RecentPanel`,components:{TaskPreview:z(Vi,[[`render`,fa],[`__scopeId`,`data-v-4806108b`]]),NoTasks:ve,BotPlaceholder:Se,ScrollList:_e},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.kling?.tasks,items:this.$store.state.kling?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),ma={key:0},ha={key:2,class:`w-full h-full flex items-center justify-center`};function ga(e,t,n,r,i,u){let d=l(`bot-placeholder`),m=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return g(),s(c,null,[e.tasks?.items===void 0?(g(),s(`div`,ma,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`h-full w-full overflow-y-auto tasks`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,e=>(g(),f(m,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,ha,[a(v)])):o(``,!0)],64)}var _a=v({name:`KlingIndex`,components:{ConfigPanel:ur,MotionPanel:li,TalkingPhotoPanel:Bi,TabSwitcher:mi,Layout:Ae,RecentPanel:z(pa,[[`render`,ga]])},mixins:[fe],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===me.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===me.Request||this.fetchingTasks},credential(){return this.$store.state.kling.credential},config(){return this.$store.state.kling.config},motionConfig(){return this.$store.state.kling.motionConfig},talkingPhotoConfig(){return this.$store.state.kling.talkingPhotoConfig},taskType(){return this.$store.state.kling.taskType||`videos`},tasks(){return this.$store.state.kling.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 ye({tasks: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(`kling/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`kling/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`kling/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!q(this.uploadTracker,e=>this.$t(e),e=>H.warning(e)))return;let{camera_control:e,...t}=this.config||{},n={...t,async:!0},r=Number(!!n.start_image_url)+Number(!!n.end_image_url),i=n.image_list?.length||0,a=n.video_list?.length?4:7;if(r+i>a){H.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:a}));return}if(n.video_list?.[0]?.refer_type===`base`&&(n.start_image_url||n.end_image_url||n.image_list?.some(({type:e})=>e))){H.warning(this.$t(`kling.message.baseVideoFrameConflict`));return}if(!n.video_id&&!t.video_url&&!n.start_image_url&&n.end_image_url){H.warning(this.$t(`kling.message.endImageRequiresStart`));return}if(n.action||(n.video_id||t.video_url?n.action=`extend`:n.start_image_url?n.action=`image2video`:n.action=`text2video`),n.action===`text2video`&&n.end_image_url&&delete n.end_image_url,e?.type&&(n.camera_control={type:e.type,...e.type===`simple`&&e.config?{config:Object.fromEntries(Object.entries(e.config).filter(([,e])=>e!=null))}:{}}),!I())return;let o=this.credential?.token;if(!o){console.error(`no token specified`);return}H.info(this.$t(`kling.message.startingTask`)),W(`kling`,V.generate(n,{token:o})).then(()=>{H.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?H.error(this.$t(`kling.message.usedUp`)):H.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},async onTabChange(e){e!==this.taskType&&(await this.$store.dispatch(`kling/setTaskType`,e),await this.onGetTasks(),await this.onScrollDown())},async onGenerateMotion(){if(!q(this.uploadTracker,e=>this.$t(e),e=>H.warning(e)))return;let e=this.motionConfig||{};if(!e.image_url||!e.video_url){H.warning(this.$t(`kling.message.motionMissingInputs`));return}let t={image_url:e.image_url,video_url:e.video_url,character_orientation:e.character_orientation||`video`,mode:e.mode||`std`,keep_original_sound:e.keep_original_sound??`yes`,...e.model_name?{model_name:e.model_name}:{},...e.prompt?{prompt:e.prompt}:{},async:!0};if(!I())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}H.info(this.$t(`kling.message.startingTask`)),W(`kling`,V.motion(t,{token:n})).then(()=>{H.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?H.error(this.$t(`kling.message.usedUp`)):H.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},async onGenerateTalkingPhoto(){if(!q(this.uploadTracker,e=>this.$t(e),e=>H.warning(e)))return;let e=this.talkingPhotoConfig||{};if(!e.image_url||!e.audio_url){H.warning(this.$t(`kling.message.talkingPhotoMissingInputs`));return}let t={image_url:e.image_url,audio_url:e.audio_url,model:e.model||`kling-v2-1-master`,mode:e.mode||`pro`,...e.prompt?{prompt:e.prompt}:{},...e.duration?{duration:e.duration}:{},async:!0};if(!I())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}H.info(this.$t(`kling.message.startingTask`)),W(`kling`,V.talkingPhoto(t,{token:n})).then(()=>{H.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?H.error(this.$t(`kling.message.usedUp`)):H.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),va={class:`flex flex-col h-full`},ya={class:`flex-1 min-h-0`};function ba(t,n,r,i,s,c){let u=l(`tab-switcher`),d=l(`config-panel`),m=l(`motion-panel`),h=l(`talking-photo-panel`),_=l(`recent-panel`),v=l(`layout`);return g(),f(v,null,{config:p(()=>[e(`div`,va,[a(u,{"model-value":t.taskType,"onUpdate:modelValue":t.onTabChange},null,8,[`model-value`,`onUpdate:modelValue`]),e(`div`,ya,[t.taskType===`videos`?(g(),f(d,{key:0,onGenerate:t.onGenerate},null,8,[`onGenerate`])):t.taskType===`motion`?(g(),f(m,{key:1,onGenerate:t.onGenerateMotion},null,8,[`onGenerate`])):t.taskType===`talking-photo`?(g(),f(h,{key:2,onGenerate:t.onGenerateTalkingPhoto},null,8,[`onGenerate`])):o(``,!0)])])]),result:p(()=>[a(_,{ref:`recentPanel`,loading:t.loadingMore,onReachTop:t.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var xa=z(_a,[[`render`,ba]]);export{xa as default};
@@ -1 +0,0 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,S as c,T as l,at as u,ht as d,it as f,j as p,mt as m,ot as h,rt as g,tt as _,x as v,z as y}from"./vendor-chart-Dw-P17PN.js";import{W as b}from"./use-deprecated-DjO24JGR.js";import{r as x,t as S}from"./select-DT9RB41V.js";import{n as C,t as w}from"./tabs-CR27Alo5.js";import{n as T,t as E}from"./form-Cw041a2Z.js";import{t as D}from"./upload-CwrIdcvB.js";import{t as O}from"./tooltip-BPoFx_0r.js";import{t as k}from"./avatar-yUP-HfhX.js";import{t as A}from"./checkbox-DLvBiGkW.js";import{n as j,r as M,t as N}from"./radio-B0Elgaw9.js";import{n as P,t as F}from"./collapse-DLomRoFE.js";import{t as I}from"./drawer-B3YqI23b.js";import{n as L,r as R,t as z}from"./dropdown-CMqex_tL.js";import{t as B}from"./input-number-ColumRcM.js";import{t as ee}from"./popover-CWDn0Yqb.js";import{t as te}from"./progress-BeEbKKvj.js";import{n as ne,t as re}from"./skeleton-BVbQKb45.js";import{t as ie}from"./slider-CRLZZmIa.js";import{t as ae}from"./switch-CyBT54Uh.js";import{t as oe}from"./arrow-down-wide-narrow-DzdoiI9L.js";import{n as se}from"./taskDrawerMixin-CjsoaGWg.js";import{i as ce,n as le,r as V,t as ue}from"./Player-DVwQKYQ5.js";import{t as de}from"./circle-check-Cjgr9Ugg.js";import{t as fe}from"./clock-bNJ1O4h8.js";import{n as pe}from"./CodeSnippet-zpA8z4M_.js";import{t as me}from"./download-Ct2jPsJB.js";import{t as he}from"./ellipsis-D6zla1fr.js";import{t as ge}from"./gauge-8OBRNfw2.js";import{t as _e}from"./headphones-CV5rXd3Z.js";import{t as ve}from"./image-OOgYSkAt.js";import{t as ye}from"./link-CuToP8s_.js";import{t as be}from"./loader-circle-q3hhAvQp.js";import{n as xe,t as Se}from"./PromptTextarea-Dhj4WJey.js";import{t as H}from"./mic-D59HeE8Q.js";import{t as Ce}from"./music-2-DqqiIX_j.js";import{t as we}from"./palette-BRHvysMf.js";import{t as Te}from"./pause-KEZ__Cmx.js";import{t as Ee}from"./pencil-LuRVBNP-.js";import{t as U}from"./play-CTiSUyyP.js";import{t as De}from"./plus-BgxTy_7g.js";import{t as Oe}from"./refresh-cw-DZq5AcuC.js";import{t as ke}from"./rotate-ccw-v9BtrxkO.js";import{t as Ae}from"./search-COWjz9ZH.js";import{t as je}from"./shuffle-YFtZhmWN.js";import{t as Me}from"./square-CTFZS-XR.js";import{t as Ne}from"./trash-2-DJ2DJzQE.js";import{t as Pe}from"./upload-B5dfYOVm.js";import{t as W}from"./wand-sparkles-RP6KkE1-.js";import{Zn as Fe}from"./constants-CqjLASsC.js";import{$t as Ie,Ai as G,Bt as Le,Dn as K,E as q,Vt as Re,Wt as ze,ei as J,gi as Y,hi as Be,mi as X,mr as Ve,ri as He,rn as Ue,sr as We,xi as Ge,yi as Z,zi as Q,zt as Ke}from"./index-BFeCxAir.js";import{t as qe}from"./Consumption-Byvcpogq.js";import{a as $,i as Je,n as Ye,r as Xe,t as Ze}from"./pagination-CB3471Sj.js";var Qe=X(`drum`,[[`path`,{d:`m2 2 8 8`,key:`1v6059`}],[`path`,{d:`m22 2-8 8`,key:`173r8a`}],[`ellipse`,{cx:`12`,cy:`9`,rx:`10`,ry:`5`,key:`liohsx`}],[`path`,{d:`M7 13.4v7.9`,key:`1yi6u9`}],[`path`,{d:`M12 14v8`,key:`1tn2tj`}],[`path`,{d:`M17 13.4v7.9`,key:`eqz2v3`}],[`path`,{d:`M2 9v8a10 5 0 0 0 20 0V9`,key:`1750ul`}]]),$e=X(`eraser`,[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]),et=X(`fast-forward`,[[`path`,{d:`M12 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 12 18z`,key:`b19h5q`}],[`path`,{d:`M2 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 2 18z`,key:`h7h5ge`}]]),tt=X(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),nt=X(`guitar`,[[`path`,{d:`m11.9 12.1 4.514-4.514`,key:`109xqo`}],[`path`,{d:`M20.1 2.3a1 1 0 0 0-1.4 0l-1.114 1.114A2 2 0 0 0 17 4.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 17.828 7h1.344a2 2 0 0 0 1.414-.586L21.7 5.3a1 1 0 0 0 0-1.4z`,key:`txyc8t`}],[`path`,{d:`m6 16 2 2`,key:`16qmzd`}],[`path`,{d:`M8.23 9.85A3 3 0 0 1 11 8a5 5 0 0 1 5 5 3 3 0 0 1-1.85 2.77l-.92.38A2 2 0 0 0 12 18a4 4 0 0 1-4 4 6 6 0 0 1-6-6 4 4 0 0 1 4-4 2 2 0 0 0 1.85-1.23z`,key:`1de1vg`}]]),rt=X(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),it=X(`scissors`,[[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M8.12 8.12 12 12`,key:`1alkpv`}],[`path`,{d:`M20 4 8.12 15.88`,key:`xgtan2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M14.8 14.8 20 20`,key:`ptml3r`}]]),at=X(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),ot=y({name:`LayoutSuno`,components:{MagicIcon:W,ElDrawer:I,ElButton:G},mixins:[se]}),st={class:`main flex flex-row flex-1`},ct={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},lt={class:`result h-full flex flex-col flex-1 min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`},ut={class:`preview h-full w-[300px] flex flex-col`};function dt(t,n,r,i,o,c){let l=u(`magic-icon`),p=u(`el-button`),h=u(`el-drawer`);return _(),s(`div`,st,[e(`div`,ct,[f(t.$slots,`config`,{},void 0,!0)]),e(`div`,lt,[f(t.$slots,`result`,{},void 0,!0)]),e(`div`,ut,[f(t.$slots,`preview`,{},void 0,!0)]),d(a(p,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:m(()=>[a(l,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[v,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer generator-drawer`},{default:m(()=>[f(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var ft=q(ot,[[`render`,dt],[`__scopeId`,`data-v-e3f41341`]]),pt=y({name:`TypeSelector`,components:{ElSelect:x,ElOption:S,ElSwitch:ae},data(){return{options:[{label:`v5.5`,value:`chirp-v5-5`,desc:this.$t(`suno.model.v55desc`)},{label:`v5`,value:`chirp-v5`,desc:this.$t(`suno.model.v5desc`)},{label:`v4.5+`,value:`chirp-v4-5-plus`,desc:this.$t(`suno.model.v45plusdesc`)},{label:`v4.5`,value:`chirp-v4-5`,desc:this.$t(`suno.model.v45desc`),dividerAfter:!0},{label:`v4`,value:`chirp-v4`,desc:this.$t(`suno.model.v4desc`)},{label:`v3.5`,value:`chirp-v3-5`,desc:this.$t(`suno.model.v35desc`)},{label:`v3`,value:`chirp-v3-0`,desc:this.$t(`suno.model.v3desc`)}]}},computed:{custom:{get(){return this.$store.state.suno?.config?.custom||!1},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,custom:e})}},instrumental:{get(){return this.$store.state.suno?.config?.instrumental||!1},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,instrumental:e})}},model:{get(){return this.$store.state.suno?.config?.model},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,model:e})}}},mounted(){this.model||=Fe}}),mt={class:`mb-3`},ht={class:`flex items-center mb-1`},gt={class:`text-sm font-bold`},_t={class:`model-option`},vt={class:`model-option-left`},yt={class:`model-option-name`},bt={class:`model-option-desc`},xt={key:0,class:`flex items-center justify-between mb-3`},St={class:`text-sm font-bold`};function Ct(t,r,c,d,f,h){let v=u(`el-option`),y=u(`el-select`),b=u(`el-switch`);return _(),s(`div`,null,[e(`div`,mt,[e(`div`,ht,[e(`span`,gt,i(t.$t(`suno.name.model`)),1)]),a(y,{modelValue:t.model,"onUpdate:modelValue":r[0]||=e=>t.model=e,class:`w-full model-select`,size:`default`,placeholder:t.$t(`suno.placeholder.select`)},{default:m(()=>[(_(!0),s(l,null,g(t.options,t=>(_(),p(v,{key:t.value,label:t.label,value:t.value,class:n({"model-option-divider":t.dividerAfter})},{default:m(()=>[e(`div`,_t,[e(`div`,vt,[e(`span`,yt,i(t.label),1)]),e(`span`,bt,i(t.desc),1)])]),_:2},1032,[`label`,`value`,`class`]))),128))]),_:1},8,[`modelValue`,`placeholder`])]),t.custom?(_(),s(`div`,xt,[e(`span`,St,i(t.$t(`suno.name.instrumental`)),1),a(b,{modelValue:t.instrumental,"onUpdate:modelValue":r[1]||=e=>t.instrumental=e},null,8,[`modelValue`])])):o(``,!0)])}var wt=q(pt,[[`render`,Ct],[`__scopeId`,`data-v-16e4d6fc`]]),Tt=y({name:`UploadAudio`,components:{MicrophoneIcon:H,StopIcon:Me,SuccessIcon:de,UndoIcon:ke,UploadIcon:Pe,ElUpload:D,ElButton:G,ElDialog:Ge,ElTabs:C,ElTabPane:w,InfoIcon:$,ElRadioGroup:M,ElRadioButton:j},mixins:[Le],emits:[`change`],data(){return{fileList:[],uploadUrl:He()+`/api/v1/files/`,dialogVisible:!1,activeTab:`browse`,recording:!1,recordedBlob:null,recordedAudioUrl:null,audioPreviewUrl:null,recordTimer:null,recordSeconds:0,mediaRecorder:null,mediaStream:null,recordedChunks:[],uploadingRecord:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},credential(){return this.$store.state.suno.credential},config(){return this.$store.state.suno.config},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.suno?.config?.audio_id},set(){}},hasUploadedAudio(){let e=this.$store.state.suno?.config?.action;return e===`upload_extend`||e===`upload_cover`},uploadAction:{get(){return this.$store.state.suno?.config?.action||`upload_extend`},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,action:e})}},formattedTime(){return`${Math.floor(this.recordSeconds/60).toString().padStart(2,`0`)}:${(this.recordSeconds%60).toString().padStart(2,`0`)}`}},watch:{urls:{handler(e){this.$emit(`change`,e)}}},beforeUnmount(){this.cleanupRecording()},methods:{onExceed(){Y.warning(this.$t(`suno.message.uploadReferencesExceed`))},onError(){Y.error(this.$t(`suno.message.uploadReferencesError`))},async onBrowseSuccess(){let e=this.urls?.[0];e&&(this.audioPreviewUrl=e,await this.onGenerateAudioId(e),this.dialogVisible=!1)},async onGenerateAudioId(e){let t={audio_url:e},n=this.credential?.token;if(!n){console.error(`no token specified`);return}Y.info(this.$t(`suno.message.startingUploadAudio`));try{let e=await K.upload(t,{token:n});console.debug(`get upload music success`,e.data);let r=e.data?.data.audio_id;this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,audio_id:r,action:`upload_extend`}),Y.success(this.$t(`suno.message.startUploadAudioSuccess`))}catch(e){Y.error(e?.response?.data?.error?.message||this.$t(`suno.message.startUploadAudioFailed`))}},async startRecording(){if(!navigator.mediaDevices?.getUserMedia||typeof MediaRecorder>`u`){Y.error(this.$t(`suno.message.recordingUnsupported`));return}try{this.mediaStream=await navigator.mediaDevices.getUserMedia({audio:!0}),this.recordedChunks=[],this.mediaRecorder=new MediaRecorder(this.mediaStream),this.mediaRecorder.ondataavailable=e=>{e.data&&e.data.size>0&&this.recordedChunks.push(e.data)},this.mediaRecorder.onstop=()=>{let e=new Blob(this.recordedChunks,{type:`audio/webm`});this.recordedBlob=e,this.recordedAudioUrl&&URL.revokeObjectURL(this.recordedAudioUrl),this.recordedAudioUrl=URL.createObjectURL(e),this.releaseStream()},this.mediaRecorder.start(),this.recording=!0,this.recordSeconds=0,this.recordTimer=window.setInterval(()=>{this.recordSeconds+=1,this.recordSeconds>=600&&this.stopRecording()},1e3)}catch(e){console.error(`record error`,e),Y.error(this.$t(`suno.message.recordingPermissionDenied`))}},stopRecording(){this.recordTimer&&=(window.clearInterval(this.recordTimer),null),this.mediaRecorder&&this.mediaRecorder.state!==`inactive`&&this.mediaRecorder.stop(),this.recording=!1},resetRecording(){this.recordedAudioUrl&&URL.revokeObjectURL(this.recordedAudioUrl),this.recordedBlob=null,this.recordedAudioUrl=null,this.recordSeconds=0},async uploadRecording(){if(this.recordedBlob){this.uploadingRecord=!0;try{let e=new FormData,t=`recording-${Date.now()}.webm`;e.append(`file`,this.recordedBlob,t);let n=await fetch(this.uploadUrl,{method:`POST`,headers:{Authorization:`Bearer ${this.$store.state.token.access}`},body:e});if(!n.ok)throw Error(`upload failed: ${n.status}`);let r=await n.json(),i=r?.file_url||r?.data?.file_url;if(!i)throw Error(`no file_url in response`);this.audioPreviewUrl=i,await this.onGenerateAudioId(i),this.dialogVisible=!1,this.resetRecording()}catch(e){console.error(e),Y.error(e?.message||this.$t(`suno.message.uploadReferencesError`))}finally{this.uploadingRecord=!1}}},releaseStream(){this.mediaStream&&=(this.mediaStream.getTracks().forEach(e=>e.stop()),null)},cleanupRecording(){this.recordTimer&&=(window.clearInterval(this.recordTimer),null),this.releaseStream(),this.recordedAudioUrl&&=(URL.revokeObjectURL(this.recordedAudioUrl),null)}}}),Et={class:`relative`},Dt={class:`flex justify-between items-center mb-2`},Ot={class:`flex justify-start items-center`},kt={class:`text-sm font-bold`},At={key:0,class:`mb-2`},jt=[`src`],Mt={key:1,class:`mt-2`},Nt={class:`py-4`},Pt={class:`text-center py-6`},Ft={class:`text-sm`},It={class:`text-xs text-gray-400 mt-1`},Lt={class:`py-4 text-center`},Rt={class:`recorder-display mb-4`},zt={key:0,class:`text-red-500 flex items-center justify-center gap-2`},Bt={class:`text-2xl font-mono`},Vt={key:1,class:`text-green-600`},Ht={key:2,class:`text-gray-400 text-2xl font-mono`},Ut={key:0,class:`mb-4`},Wt=[`src`],Gt={class:`flex justify-center gap-3`};function Kt(t,n,c,d,f,h){let g=u(`info-icon`),v=u(`el-button`),y=u(`el-radio-button`),b=u(`el-radio-group`),x=u(`upload-icon`),S=u(`el-upload`),C=u(`el-tab-pane`),w=u(`success-icon`),T=u(`microphone-icon`),E=u(`stop-icon`),D=u(`undo-icon`),O=u(`el-tabs`),k=u(`el-dialog`);return _(),s(`div`,Et,[e(`div`,Dt,[e(`div`,Ot,[e(`span`,kt,i(t.$t(`suno.name.referenceAudios`)),1),a(g,{content:t.$t(`suno.description.uploadAudios`)},null,8,[`content`])]),a(v,{round:``,type:`primary`,size:`small`,onClick:n[0]||=e=>t.dialogVisible=!0},{default:m(()=>[r(i(t.$t(`suno.button.addAudio`)),1)]),_:1})]),t.audioPreviewUrl?(_(),s(`div`,At,[e(`audio`,{src:t.audioPreviewUrl,controls:``,class:`w-full`},null,8,jt)])):o(``,!0),t.hasUploadedAudio?(_(),s(`div`,Mt,[a(b,{modelValue:t.uploadAction,"onUpdate:modelValue":n[1]||=e=>t.uploadAction=e,size:`small`},{default:m(()=>[a(y,{value:`upload_extend`},{default:m(()=>[r(i(t.$t(`suno.button.extend`)),1)]),_:1}),a(y,{value:`upload_cover`},{default:m(()=>[r(i(t.$t(`suno.button.upload_cover`)),1)]),_:1})]),_:1},8,[`modelValue`])])):o(``,!0),a(k,{modelValue:t.dialogVisible,"onUpdate:modelValue":n[4]||=e=>t.dialogVisible=e,title:t.$t(`suno.name.addAudio`),width:`520px`,"close-on-click-modal":!1,"append-to-body":``},{default:m(()=>[a(O,{modelValue:t.activeTab,"onUpdate:modelValue":n[3]||=e=>t.activeTab=e,class:`add-audio-tabs`},{default:m(()=>[a(C,{name:`browse`,label:t.$t(`suno.tab.browse`)},{default:m(()=>[e(`div`,Nt,[a(S,{"file-list":t.fileList,"onUpdate:fileList":n[2]||=e=>t.fileList=e,name:`file`,limit:1,class:`upload-wrapper`,action:t.uploadUrl,accept:`.mp3,.wav,.m4a,audio/*`,"show-file-list":!0,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onBrowseSuccess,headers:t.headers,drag:``},{default:m(()=>[e(`div`,Pt,[a(x,{class:`text-4xl text-gray-400 mb-3`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`div`,Ft,i(t.$t(`suno.description.dropAudioHere`)),1),e(`div`,It,i(t.$t(`suno.description.audioFormats`)),1)])]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])]),_:1},8,[`label`]),a(C,{name:`record`,label:t.$t(`suno.tab.record`)},{default:m(()=>[e(`div`,Lt,[e(`div`,Rt,[t.recording?(_(),s(`div`,zt,[n[5]||=e(`span`,{class:`recording-dot`},null,-1),e(`span`,Bt,i(t.formattedTime),1)])):t.recordedBlob?(_(),s(`div`,Vt,[a(w,{class:`text-2xl mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,i(t.$t(`suno.message.recordingReady`))+` (`+i(t.formattedTime)+`)`,1)])):(_(),s(`div`,Ht,`00:00`))]),t.recordedAudioUrl&&!t.recording?(_(),s(`div`,Ut,[e(`audio`,{src:t.recordedAudioUrl,controls:``,class:`w-full`},null,8,Wt)])):o(``,!0),e(`div`,Gt,[!t.recording&&!t.recordedBlob?(_(),p(v,{key:0,type:`primary`,round:``,onClick:t.startRecording},{default:m(()=>[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`suno.button.startRecord`)),1)]),_:1},8,[`onClick`])):o(``,!0),t.recording?(_(),p(v,{key:1,type:`danger`,round:``,onClick:t.stopRecording},{default:m(()=>[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`suno.button.stopRecord`)),1)]),_:1},8,[`onClick`])):o(``,!0),t.recordedBlob&&!t.recording?(_(),s(l,{key:2},[a(v,{round:``,onClick:t.resetRecording},{default:m(()=>[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`suno.button.reRecord`)),1)]),_:1},8,[`onClick`]),a(v,{type:`primary`,round:``,loading:t.uploadingRecord,onClick:t.uploadRecording},{default:m(()=>[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`suno.button.useRecording`)),1)]),_:1},8,[`loading`,`onClick`])],64)):o(``,!0)])])]),_:1},8,[`label`])]),_:1},8,[`modelValue`])]),_:1},8,[`modelValue`,`title`])])}var qt=q(Tt,[[`render`,Kt],[`__scopeId`,`data-v-0b4dff2c`]]),Jt=[{key:`lofi`,label:`🎧 Lo-fi Chill`,prompt:`a relaxing lo-fi hip hop beat for studying`},{key:`pop-love`,label:`💕 Pop Love Song`,prompt:`a catchy pop love song with sweet melodies`},{key:`rock-anthem`,label:`🎸 Rock Anthem`,prompt:`an energetic rock anthem with electric guitars`},{key:`jazz-night`,label:`🎷 Jazz Night`,prompt:`a smooth late-night jazz piece with saxophone`},{key:`edm-drop`,label:`⚡ EDM Drop`,prompt:`an intense EDM track with a massive drop`},{key:`folk-story`,label:`🪕 Folk Story`,prompt:`a warm folk song telling a story about traveling`},{key:`rnb-groove`,label:`🎤 R&B Groove`,prompt:`a smooth R&B groove with soulful vocals`},{key:`classical`,label:`🎻 Classical`,prompt:`an elegant classical piece for orchestra`},{key:`hip-hop`,label:`🎤 Hip Hop`,prompt:`a hard-hitting hip hop beat with bass`},{key:`country`,label:`🤠 Country`,prompt:`an upbeat country song with acoustic guitar and banjo`},{key:`reggae`,label:`🌴 Reggae`,prompt:`a laid-back reggae tune with island vibes`},{key:`latin`,label:`💃 Latin`,prompt:`a vibrant Latin dance track with percussion`},{key:`ambient`,label:`🌊 Ambient`,prompt:`a dreamy ambient soundscape for relaxation`},{key:`metal`,label:`🤘 Metal`,prompt:`a powerful metal song with heavy riffs and double bass drums`},{key:`soul`,label:`🎵 Soul`,prompt:`a heartfelt soul ballad with gospel harmonies`},{key:`synthwave`,label:`🌃 Synthwave`,prompt:`a retro synthwave track with 80s vibes`},{key:`kpop`,label:`🇰🇷 K-Pop`,prompt:`a catchy K-pop dance track with hook`},{key:`lullaby`,label:`🌙 Lullaby`,prompt:`a gentle lullaby for bedtime with soft piano`},{key:`cinematic`,label:`🎬 Cinematic`,prompt:`an epic cinematic orchestral score for a movie trailer`},{key:`blues`,label:`🎸 Blues`,prompt:`a soulful blues song with electric guitar bends`},{key:`disco`,label:`🕺 Disco`,prompt:`a funky disco track with groovy bassline`},{key:`punk`,label:`🔥 Punk Rock`,prompt:`a fast punk rock song with raw energy`},{key:`gospel`,label:`⛪ Gospel`,prompt:`an uplifting gospel choir song with piano`},{key:`trap`,label:`🔊 Trap`,prompt:`a dark trap beat with 808s and hi-hats`},{key:`bossa`,label:`☕ Bossa Nova`,prompt:`a gentle bossa nova with nylon guitar`},{key:`indie`,label:`🎶 Indie`,prompt:`a dreamy indie track with ethereal vocals`},{key:`cpop`,label:`🇨🇳 C-Pop`,prompt:`a beautiful Chinese pop ballad with emotional vocals`},{key:`jpop`,label:`🇯🇵 J-Pop`,prompt:`a cheerful J-pop song with anime vibes`},{key:`afrobeat`,label:`🥁 Afrobeat`,prompt:`a groovy Afrobeat track with layered percussion`},{key:`game`,label:`🎮 Game BGM`,prompt:`an adventurous video game background music`}],Yt=8;function Xt(e){let t=[...e];for(let e=t.length-1;e>0;e--){let n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}return t}var Zt=y({name:`PromptInput`,components:{RefreshIcon:Oe,PromptTextarea:Se},data(){return{shuffledTags:Xt(Jt)}},computed:{prompt:{get(){return this.$store.state.suno?.config?.prompt},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,prompt:e})}},visibleTags(){return this.shuffledTags.slice(0,Yt)}},mounted(){this.prompt||=``},methods:{onTagClick(e){this.prompt=e.prompt},onRefreshTags(){this.shuffledTags=Xt(Jt)}}}),Qt={class:`inspo-tags`},$t=[`onClick`],en=[`aria-label`,`title`];function tn(t,n,r,o,c,d){let f=u(`refresh-icon`),h=u(`prompt-textarea`);return _(),p(h,{modelValue:t.prompt,"onUpdate:modelValue":n[1]||=e=>t.prompt=e,title:t.$t(`suno.name.songDescription`),info:t.$t(`suno.description.prompt`),placeholder:t.$t(`suno.placeholder.prompt`),"min-rows":5,"max-rows":14},{after:m(()=>[e(`div`,Qt,[(_(!0),s(l,null,g(t.visibleTags,e=>(_(),s(`button`,{key:e.key,class:`inspo-tag`,onClick:n=>t.onTagClick(e)},i(e.label),9,$t))),128)),e(`button`,{class:`inspo-tag inspo-tag-refresh`,"aria-label":t.$t(`common.button.refresh`),title:t.$t(`common.button.refresh`),onClick:n[0]||=(...e)=>t.onRefreshTags&&t.onRefreshTags(...e)},[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,en)])]),_:1},8,[`modelValue`,`title`,`info`,`placeholder`])}var nn=q(Zt,[[`render`,tn],[`__scopeId`,`data-v-302bad6d`]]),rn=y({name:`LyricInput`,components:{ClearIcon:$e,FullscreenIcon:xe,MagicIcon:W,UndoIcon:ke,ElInput:Q,ElButton:G,ElTooltip:O,ElDialog:Ge,InfoIcon:$},data(){return{generatingLyrics:!1,enhancingLyrics:!1,enhancePrompt:``,lyricHistory:[],expanded:!1}},computed:{lyric:{get(){return this.$store.state.suno?.config?.lyric},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,lyric:e})}},config(){return this.$store.state.suno?.config},credential(){return this.$store.state.suno?.credential}},mounted(){this.lyric||=``},methods:{pushHistory(){this.lyric&&(this.lyricHistory.push(this.lyric),this.lyricHistory.length>20&&this.lyricHistory.shift())},onUndo(){let e=this.lyricHistory.pop();e!==void 0&&(this.lyric=e)},onClear(){this.pushHistory(),this.lyric=``},async onEnhanceLyrics(){let e=this.credential?.token;if(!(!e||!this.lyric||!this.enhancePrompt)){this.pushHistory(),this.enhancingLyrics=!0,Y.info(this.$t(`suno.message.enhancingLyrics`));try{let t=`${this.enhancePrompt}\n\nOriginal lyrics:\n${this.lyric}`,n=(await K.lyric({prompt:t},{token:e})).data?.data;n?.text&&(this.lyric=n.text,this.enhancePrompt=``,Y.success(this.$t(`suno.message.enhanceLyricsSuccess`)))}catch{Y.error(this.$t(`suno.message.enhanceLyricsFailed`))}finally{this.enhancingLyrics=!1}}},async onGenerateLyrics(){let e=this.credential?.token;if(!e)return;let t;try{t=((await Be.prompt(this.$t(`suno.message.lyricsThemePromptMessage`),this.$t(`suno.message.lyricsThemePromptTitle`),{confirmButtonText:this.$t(`common.button.confirm`),cancelButtonText:this.$t(`common.button.cancel`),inputPlaceholder:this.$t(`suno.placeholder.lyricsTheme`),inputValue:this.config?.title||``,inputType:`textarea`,inputValidator:e=>typeof e==`string`&&e.trim().length>0||this.$t(`suno.message.lyricsThemeRequired`)})).value||``).trim()}catch{return}if(t){this.pushHistory(),this.generatingLyrics=!0,Y.info(this.$t(`suno.message.generatingLyrics`));try{let n=(await K.lyric({prompt:t},{token:e})).data?.data;n?.text&&(this.lyric=n.text,n?.title&&!this.config?.title&&this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,lyric:n.text,title:n.title}),Y.success(this.$t(`suno.message.generateLyricsSuccess`)))}catch{Y.error(this.$t(`suno.message.generateLyricsFailed`))}finally{this.generatingLyrics=!1}}}}}),an={class:`field`},on={class:`flex items-center justify-between mb-1`},sn={class:`flex items-center`},cn={class:`text-sm font-bold`},ln={class:`flex items-center gap-1`},un={class:`relative`},dn={class:`text-xs text-right text-[var(--el-text-color-secondary)] mt-1`},fn={key:0,class:`enhance-bar`},pn={key:0,class:`enhance-bar mt-3`},mn={class:`flex items-center justify-between`},hn={class:`flex items-center gap-1`};function gn(t,n,l,d,f,h){let g=u(`info-icon`),v=u(`undo-icon`),y=u(`el-button`),b=u(`el-tooltip`),x=u(`clear-icon`),S=u(`fullscreen-icon`),C=u(`magic-icon`),w=u(`el-input`),T=u(`el-dialog`);return _(),s(`div`,an,[e(`div`,on,[e(`div`,sn,[e(`span`,cn,i(t.$t(`suno.name.lyrics`)),1),a(g,{content:t.$t(`suno.description.lyrics`)},null,8,[`content`])]),e(`div`,ln,[t.lyricHistory.length>0?(_(),p(b,{key:0,content:t.$t(`suno.button.undo`),placement:`top`},{default:m(()=>[a(y,{size:`small`,circle:``,"aria-label":t.$t(`suno.button.undo`),title:t.$t(`suno.button.undo`),onClick:t.onUndo},{default:m(()=>[a(v,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`,`onClick`])]),_:1},8,[`content`])):o(``,!0),t.lyric?(_(),p(b,{key:1,content:t.$t(`suno.button.clear_lyrics`),placement:`top`},{default:m(()=>[a(y,{size:`small`,circle:``,"aria-label":t.$t(`suno.button.clear_lyrics`),title:t.$t(`suno.button.clear_lyrics`),onClick:t.onClear},{default:m(()=>[a(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`,`onClick`])]),_:1},8,[`content`])):o(``,!0),a(b,{content:t.$t(`suno.button.expand_lyrics`),placement:`top`},{default:m(()=>[a(y,{size:`small`,circle:``,"aria-label":t.$t(`suno.button.expand_lyrics`),title:t.$t(`suno.button.expand_lyrics`),onClick:n[0]||=e=>t.expanded=!0},{default:m(()=>[a(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`])]),_:1},8,[`content`]),t.config?.action===`extend`?o(``,!0):(_(),p(y,{key:2,size:`small`,loading:t.generatingLyrics,round:``,onClick:t.onGenerateLyrics},{default:m(()=>[t.generatingLyrics?o(``,!0):(_(),p(C,{key:0,class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),r(` `+i(t.$t(`suno.button.generate_lyrics`)),1)]),_:1},8,[`loading`,`onClick`]))])]),e(`div`,un,[t.config?.action===`extend`?(_(),p(w,{key:1,modelValue:t.lyric,"onUpdate:modelValue":n[2]||=e=>t.lyric=e,rows:5,type:`textarea`,class:`lyrics`,placeholder:t.$t(`suno.placeholder.extend.lyrics`)},null,8,[`modelValue`,`placeholder`])):(_(),p(w,{key:0,modelValue:t.lyric,"onUpdate:modelValue":n[1]||=e=>t.lyric=e,rows:5,type:`textarea`,class:`lyrics`,placeholder:t.$t(`suno.placeholder.lyrics`)},null,8,[`modelValue`,`placeholder`])),e(`div`,dn,i(t.lyric?.length||0)+`/5000`,1)]),t.lyric&&t.config?.action!==`extend`?(_(),s(`div`,fn,[a(w,{modelValue:t.enhancePrompt,"onUpdate:modelValue":n[3]||=e=>t.enhancePrompt=e,size:`small`,placeholder:t.$t(`suno.placeholder.enhanceLyrics`),class:`enhance-input`,onKeyup:c(t.onEnhanceLyrics,[`enter`])},{append:m(()=>[a(y,{loading:t.enhancingLyrics,onClick:t.onEnhanceLyrics},{default:m(()=>[t.enhancingLyrics?o(``,!0):(_(),p(C,{key:0,class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),r(` `+i(t.$t(`suno.button.enhance_lyrics`)),1)]),_:1},8,[`loading`,`onClick`])]),_:1},8,[`modelValue`,`placeholder`,`onKeyup`])])):o(``,!0),a(T,{modelValue:t.expanded,"onUpdate:modelValue":n[7]||=e=>t.expanded=e,title:t.$t(`suno.name.lyrics`),width:`720px`,top:`5vh`,"close-on-click-modal":!1,class:`lyrics-expand-dialog`},{footer:m(()=>[e(`div`,mn,[e(`div`,hn,[t.lyricHistory.length>0?(_(),p(y,{key:0,size:`small`,onClick:t.onUndo},{default:m(()=>[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`suno.button.undo`)),1)]),_:1},8,[`onClick`])):o(``,!0),t.lyric?(_(),p(y,{key:1,size:`small`,onClick:t.onClear},{default:m(()=>[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`suno.button.clear_lyrics`)),1)]),_:1},8,[`onClick`])):o(``,!0),t.config?.action===`extend`?o(``,!0):(_(),p(y,{key:2,size:`small`,loading:t.generatingLyrics,onClick:t.onGenerateLyrics},{default:m(()=>[t.generatingLyrics?o(``,!0):(_(),p(C,{key:0,class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),r(` `+i(t.$t(`suno.button.generate_lyrics`)),1)]),_:1},8,[`loading`,`onClick`]))]),a(y,{type:`primary`,onClick:n[6]||=e=>t.expanded=!1},{default:m(()=>[r(i(t.$t(`common.button.confirm`)),1)]),_:1})])]),default:m(()=>[a(w,{modelValue:t.lyric,"onUpdate:modelValue":n[4]||=e=>t.lyric=e,type:`textarea`,rows:20,class:`lyrics-expanded`,placeholder:t.$t(`suno.placeholder.lyrics`),autofocus:``},null,8,[`modelValue`,`placeholder`]),t.config?.action===`extend`?o(``,!0):(_(),s(`div`,pn,[a(w,{modelValue:t.enhancePrompt,"onUpdate:modelValue":n[5]||=e=>t.enhancePrompt=e,size:`small`,placeholder:t.$t(`suno.placeholder.enhanceLyrics`),class:`enhance-input`,onKeyup:c(t.onEnhanceLyrics,[`enter`])},{append:m(()=>[a(y,{loading:t.enhancingLyrics,onClick:t.onEnhanceLyrics},{default:m(()=>[t.enhancingLyrics?o(``,!0):(_(),p(C,{key:0,class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),r(` `+i(t.$t(`suno.button.enhance_lyrics`)),1)]),_:1},8,[`loading`,`onClick`])]),_:1},8,[`modelValue`,`placeholder`,`onKeyup`])]))]),_:1},8,[`modelValue`,`title`])])}var _n=q(rn,[[`render`,gn],[`__scopeId`,`data-v-d537dc57`]]),vn=`Pop.Rock.Jazz.R&B.Hip Hop.Lo-fi.Electronic.Classical.Country.Blues.Folk.Reggae.Metal.Punk.Soul.Funk.Ambient.Indie.Latin.Acoustic.Dance.Disco.Gospel.K-Pop.J-Pop.C-Pop.Bossa Nova.Trap.Drill.House.Techno.Dubstep.Synthwave.Chill.Dreamy.Upbeat.Melancholic.Romantic.Epic.Cinematic.Orchestral.Piano.Guitar.Saxophone.Violin.Tribal.World Music.Afrobeat.Ska.Grunge`.split(`.`),yn=12;function bn(e){let t=[...e];for(let e=t.length-1;e>0;e--){let n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}return t}var xn=y({name:`StyleInput`,components:{MagicIcon:W,RefreshIcon:Oe,ElInput:Q,ElButton:G,InfoIcon:$},data(){return{optimizing:!1,shuffledTags:bn(vn)}},computed:{style:{get(){return this.$store.state.suno?.config?.style},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,style:e})}},credential(){return this.$store.state.suno?.credential},visibleTags(){return this.shuffledTags.slice(0,yn)}},methods:{onTagClick(e){let t=this.style||``;t.toLowerCase().includes(e.toLowerCase())||(this.style=t?`${t}, ${e}`:e)},onRefreshTags(){this.shuffledTags=bn(vn)},async onOptimizeStyle(){let e=this.credential?.token;if(!(!e||!this.style)){this.optimizing=!0,Y.info(this.$t(`suno.message.optimizingStyle`));try{let t=await K.style({prompt:this.style},{token:e}),n=t.data?.text||t.data?.data?.text;n&&(this.style=n,Y.success(this.$t(`suno.message.optimizeStyleSuccess`)))}catch{Y.error(this.$t(`suno.message.optimizeStyleFailed`))}finally{this.optimizing=!1}}}}}),Sn={class:`field`},Cn={class:`flex items-center justify-between mb-1`},wn={class:`flex items-center`},Tn={class:`text-sm font-bold`},En={class:`relative`},Dn={class:`text-xs text-right text-[var(--el-text-color-secondary)] mt-1`},On={class:`style-tags`},kn=[`onClick`],An=[`aria-label`,`title`];function jn(t,n,c,d,f,h){let v=u(`info-icon`),y=u(`magic-icon`),b=u(`el-button`),x=u(`el-input`),S=u(`refresh-icon`);return _(),s(`div`,Sn,[e(`div`,Cn,[e(`div`,wn,[e(`span`,Tn,i(t.$t(`suno.name.style`)),1),a(v,{content:t.$t(`suno.description.style`)},null,8,[`content`])]),a(b,{size:`small`,loading:t.optimizing,round:``,onClick:t.onOptimizeStyle},{default:m(()=>[t.optimizing?o(``,!0):(_(),p(y,{key:0,class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),r(` `+i(t.$t(`suno.button.optimize_style`)),1)]),_:1},8,[`loading`,`onClick`])]),e(`div`,En,[a(x,{modelValue:t.style,"onUpdate:modelValue":n[0]||=e=>t.style=e,rows:2,type:`textarea`,placeholder:t.$t(`suno.placeholder.style`)},null,8,[`modelValue`,`placeholder`]),e(`div`,Dn,i(t.style?.length||0)+`/1000`,1)]),e(`div`,On,[(_(!0),s(l,null,g(t.visibleTags,e=>(_(),s(`button`,{key:e,class:`style-tag`,onClick:n=>t.onTagClick(e)},i(e),9,kn))),128)),e(`button`,{class:`style-tag style-tag-refresh`,"aria-label":t.$t(`common.button.refresh`),title:t.$t(`common.button.refresh`),onClick:n[1]||=(...e)=>t.onRefreshTags&&t.onRefreshTags(...e)},[a(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,An)])])}var Mn=q(xn,[[`render`,jn],[`__scopeId`,`data-v-86037edb`]]),Nn=y({name:`TitleInput`,components:{ElInput:Q,InfoIcon:$},computed:{title:{get(){return this.$store.state.suno?.config?.title},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,title:e})}}}}),Pn={class:`field`},Fn={class:`flex items-center mb-1`},In={class:`text-sm font-bold`};function Ln(t,n,r,o,c,l){let d=u(`info-icon`),f=u(`el-input`);return _(),s(`div`,Pn,[e(`div`,Fn,[e(`span`,In,i(t.$t(`suno.name.title`)),1),a(d,{content:t.$t(`suno.description.title`)},null,8,[`content`])]),a(f,{modelValue:t.title,"onUpdate:modelValue":n[0]||=e=>t.title=e,placeholder:t.$t(`suno.placeholder.title`)},null,8,[`modelValue`,`placeholder`])])}var Rn=q(Nn,[[`render`,Ln]]),zn=y({name:`ExtendFromInput`,components:{ElImage:Z,ElIcon:b,ElInputNumber:B,VideoPlay:U,VideoPause:Te},data(){return{}},computed:{audio(){return this.$store.state.suno?.config?.audio},value:{get(){return this.$store.state.suno?.config?.continue_at},set(e){console.debug(`set continue_at`,e),this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,continue_at:e?parseInt(e):void 0})}}},mounted(){this.value||=void 0},methods:{handleChange(e){if(e===void 0){this.value=void 0;return}e<0?this.value=0:e>this.audio?.duration?this.value=this.audio?.duration:this.value=e},useFormatDuring:V,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})}}}),Bn={class:`field`},Vn={class:`box`},Hn={class:`title font-bold`},Un={class:`input-wrapper`},Wn={class:`task`},Gn={class:`left`},Kn=[`aria-label`,`title`],qn=[`aria-label`,`title`],Jn={key:2,class:`duration`},Yn={class:`info`},Xn={class:`title`},Zn={class:`style`};function Qn(n,r,l,f,p,g){let v=u(`el-input-number`),y=u(`el-image`),b=u(`video-pause`),x=u(`el-icon`),S=u(`video-play`),C=h(`loading`);return _(),s(`div`,Bn,[e(`div`,Vn,[e(`h2`,Hn,i(n.$t(`suno.name.extend`)),1),e(`div`,Un,[a(v,{modelValue:n.value,"onUpdate:modelValue":r[0]||=e=>n.value=e,class:`value`,min:0,max:n.audio?.duration,controls:!1,placeholder:n.$t(`suno.placeholder.extend.continue_at`),onChange:n.handleChange},null,8,[`modelValue`,`max`,`placeholder`,`onChange`])])]),e(`div`,Wn,[n.audio?(_(),s(`div`,{key:0,class:`audio`,onClick:r[7]||=e=>n.onClick(n.audio)},[d((_(),s(`div`,Gn,[a(y,{src:n.audio?.image_url,class:`cover`,fit:`cover`},null,8,[`src`]),n.audio?.audio_url&&n.$store.state?.suno?.audio?.id===n.audio.id&&n.$store.state?.suno?.audio?.state===`playing`?(_(),s(`div`,{key:0,class:`overlay`,role:`button`,tabindex:`0`,"aria-label":n.$t(`common.player.pause`),title:n.$t(`common.player.pause`),onClick:r[1]||=e=>n.onPause(n.audio),onKeydown:[r[2]||=c(t(e=>n.onPause(n.audio),[`stop`,`prevent`]),[`enter`]),r[3]||=c(t(e=>n.onPause(n.audio),[`stop`,`prevent`]),[`space`])]},[a(x,null,{default:m(()=>[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})],40,Kn)):o(``,!0),n.audio?.audio_url&&(n.$store.state?.suno?.audio?.id!==n.audio.id||n.$store.state?.suno?.audio?.id===n.audio.id&&n.$store.state?.suno?.audio?.state===`paused`)?(_(),s(`div`,{key:1,class:`overlay`,role:`button`,tabindex:`0`,"aria-label":n.$t(`common.player.play`),title:n.$t(`common.player.play`),onClick:r[4]||=e=>n.onPlay(n.audio),onKeydown:[r[5]||=c(t(e=>n.onPlay(n.audio),[`stop`,`prevent`]),[`enter`]),r[6]||=c(t(e=>n.onPlay(n.audio),[`stop`,`prevent`]),[`space`])]},[a(x,null,{default:m(()=>[a(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})],40,qn)):o(``,!0),n.audio?.duration?(_(),s(`div`,Jn,i(n.useFormatDuring(n.audio?.duration)),1)):o(``,!0)])),[[C,!n.audio?.audio_url]]),e(`div`,Yn,[e(`h2`,Xn,i(n.audio?.title),1),e(`p`,Zn,i(n.audio?.style),1)])])):o(``,!0)])])}var $n=q(zn,[[`render`,Qn],[`__scopeId`,`data-v-4600553c`]]),er=y({name:`CoverFromInput`,components:{ElImage:Z,ElIcon:b,VideoPlay:U,VideoPause:Te},data(){return{}},computed:{audio(){return this.$store.state.suno?.config?.audio},value:{get(){return this.$store.state.suno?.config?.continue_at},set(e){console.debug(`set continue_at`,e),this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,continue_at:e?parseInt(e):void 0})}}},mounted(){this.value||=void 0},methods:{handleChange(e){e<0?this.value=0:e>this.audio?.duration?this.value=this.audio?.duration:this.value=e},useFormatDuring:V,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})}}}),tr={class:`field`},nr={class:`box`},rr={class:`title font-bold`},ir={class:`task`},ar={class:`left`},or=[`aria-label`,`title`],sr=[`aria-label`,`title`],cr={key:2,class:`duration`},lr={class:`info`},ur={class:`title`},dr={class:`style`};function fr(n,r,l,f,p,g){let v=u(`el-image`),y=u(`video-pause`),b=u(`el-icon`),x=u(`video-play`),S=h(`loading`);return _(),s(`div`,tr,[e(`div`,nr,[e(`h2`,rr,i(n.$t(`suno.name.cover`)),1)]),e(`div`,ir,[n.audio?(_(),s(`div`,{key:0,class:`audio`,onClick:r[6]||=e=>n.onClick(n.audio)},[d((_(),s(`div`,ar,[a(v,{src:n.audio?.image_url,class:`cover`,fit:`cover`},null,8,[`src`]),n.audio?.audio_url&&n.$store.state?.suno?.audio?.id===n.audio.id&&n.$store.state?.suno?.audio?.state===`playing`?(_(),s(`div`,{key:0,class:`overlay`,role:`button`,tabindex:`0`,"aria-label":n.$t(`common.player.pause`),title:n.$t(`common.player.pause`),onClick:r[0]||=e=>n.onPause(n.audio),onKeydown:[r[1]||=c(t(e=>n.onPause(n.audio),[`stop`,`prevent`]),[`enter`]),r[2]||=c(t(e=>n.onPause(n.audio),[`stop`,`prevent`]),[`space`])]},[a(b,null,{default:m(()=>[a(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})],40,or)):o(``,!0),n.audio?.audio_url&&(n.$store.state?.suno?.audio?.id!==n.audio.id||n.$store.state?.suno?.audio?.id===n.audio.id&&n.$store.state?.suno?.audio?.state===`paused`)?(_(),s(`div`,{key:1,class:`overlay`,role:`button`,tabindex:`0`,"aria-label":n.$t(`common.player.play`),title:n.$t(`common.player.play`),onClick:r[3]||=e=>n.onPlay(n.audio),onKeydown:[r[4]||=c(t(e=>n.onPlay(n.audio),[`stop`,`prevent`]),[`enter`]),r[5]||=c(t(e=>n.onPlay(n.audio),[`stop`,`prevent`]),[`space`])]},[a(b,null,{default:m(()=>[a(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})],40,sr)):o(``,!0),n.audio?.duration?(_(),s(`div`,cr,i(n.useFormatDuring(n.audio?.duration)),1)):o(``,!0)])),[[S,!n.audio?.audio_url]]),e(`div`,lr,[e(`h2`,ur,i(n.audio?.title),1),e(`p`,dr,i(n.audio?.style),1)])])):o(``,!0)])])}var pr=q(er,[[`render`,fr],[`__scopeId`,`data-v-aa3e3b20`]]),mr=y({name:`VocalGenderSelector`,components:{ElRadioGroup:M,ElRadioButton:j,InfoIcon:$},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})}}}}),hr={class:`flex items-center mb-1`},gr={class:`text-sm font-bold`};function _r(t,n,o,c,l,d){let f=u(`info-icon`),p=u(`el-radio-button`),h=u(`el-radio-group`);return _(),s(`div`,null,[e(`div`,hr,[e(`span`,gr,i(t.$t(`suno.name.vocalGender`)),1),a(f,{content:t.$t(`suno.description.vocalGender`)},null,8,[`content`])]),a(h,{modelValue:t.vocalGender,"onUpdate:modelValue":n[0]||=e=>t.vocalGender=e,size:`small`},{default:m(()=>[a(p,{value:``},{default:m(()=>[r(i(t.$t(`suno.gender.auto`)),1)]),_:1}),a(p,{value:`f`},{default:m(()=>[r(i(t.$t(`suno.gender.female`)),1)]),_:1}),a(p,{value:`m`},{default:m(()=>[r(i(t.$t(`suno.gender.male`)),1)]),_:1})]),_:1},8,[`modelValue`])])}var vr=q(mr,[[`render`,_r]]),yr=y({name:`AdvancedParams`,components:{ElCollapse:F,ElCollapseItem:P,ElInput:Q,ElSlider:ie,ElRadioGroup:M,ElRadioButton:j},data(){return{activeNames:[]}},computed:{config(){return this.$store.state.suno?.config},isV5OrAbove(){let e=this.config?.model||``;return[`chirp-v5`,`chirp-v5-5`].includes(e)},styleNegative:{get(){return this.$store.state.suno?.config?.style_negative||``},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,style_negative:e||void 0})}},lyricPrompt:{get(){return this.$store.state.suno?.config?.lyric_prompt||``},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,lyric_prompt:e||void 0})}},weirdness:{get(){return this.$store.state.suno?.config?.weirdness??0},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,weirdness:e||void 0})}},styleInfluence:{get(){return this.$store.state.suno?.config?.style_influence??.5},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,style_influence:e})}},variationCategory:{get(){return this.$store.state.suno?.config?.variation_category||``},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,variation_category:e||void 0})}},audioWeight:{get(){return this.$store.state.suno?.config?.audio_weight??.5},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,audio_weight:e})}},lyricsMode:{get(){return this.$store.state.suno?.config?.lyrics_mode||`manual`},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,lyrics_mode:e})}}},mounted(){let e=this.$store.state.suno?.config;if(!e)return;let t={};typeof e.weirdness==`number`&&e.weirdness>1&&(t.weirdness=e.weirdness/100),typeof e.style_influence==`number`&&e.style_influence>1&&(t.style_influence=e.style_influence/100),typeof e.audio_weight==`number`&&e.audio_weight>1&&(t.audio_weight=e.audio_weight/100),Object.keys(t).length>0&&this.$store.commit(`suno/setConfig`,{...e,...t})}}),br={key:0,class:`mb-3`},xr={class:`flex items-center mb-1`},Sr={class:`text-xs font-bold`},Cr={key:1,class:`mb-3`},wr={class:`flex items-center mb-1`},Tr={class:`text-xs font-bold`},Er={key:2,class:`mb-3`},Dr={class:`flex items-center justify-between mb-1`},Or={class:`text-xs font-bold`},kr={class:`text-xs text-[var(--el-text-color-secondary)]`},Ar={key:3,class:`mb-3`},jr={class:`flex items-center justify-between mb-1`},Mr={class:`text-xs font-bold`},Nr={class:`text-xs text-[var(--el-text-color-secondary)]`},Pr={key:4,class:`mb-3`},Fr={class:`flex items-center mb-1`},Ir={class:`text-xs font-bold`},Lr={key:5,class:`mb-3`},Rr={class:`flex items-center justify-between mb-1`},zr={class:`text-xs font-bold`},Br={class:`text-xs text-[var(--el-text-color-secondary)]`},Vr={key:6,class:`mb-3`},Hr={class:`flex items-center mb-1`},Ur={class:`text-xs font-bold`};function Wr(t,n,c,l,d,f){let h=u(`el-input`),g=u(`el-slider`),v=u(`el-radio-button`),y=u(`el-radio-group`),b=u(`el-collapse-item`),x=u(`el-collapse`);return _(),p(x,{modelValue:t.activeNames,"onUpdate:modelValue":n[7]||=e=>t.activeNames=e,class:`advanced-collapse`},{default:m(()=>[a(b,{title:t.$t(`suno.name.advancedParams`),name:`advanced`},{default:m(()=>[t.config?.custom?(_(),s(`div`,br,[e(`div`,xr,[e(`span`,Sr,i(t.$t(`suno.name.styleNegative`)),1)]),a(h,{modelValue:t.styleNegative,"onUpdate:modelValue":n[0]||=e=>t.styleNegative=e,size:`small`,placeholder:t.$t(`suno.placeholder.styleNegative`)},null,8,[`modelValue`,`placeholder`])])):o(``,!0),t.config?.custom&&!t.config?.instrumental?(_(),s(`div`,Cr,[e(`div`,wr,[e(`span`,Tr,i(t.$t(`suno.name.lyricPrompt`)),1)]),a(h,{modelValue:t.lyricPrompt,"onUpdate:modelValue":n[1]||=e=>t.lyricPrompt=e,size:`small`,placeholder:t.$t(`suno.placeholder.lyricPrompt`)},null,8,[`modelValue`,`placeholder`])])):o(``,!0),t.config?.custom?(_(),s(`div`,Er,[e(`div`,Dr,[e(`span`,Or,i(t.$t(`suno.name.weirdness`)),1),e(`span`,kr,i(t.weirdness??0),1)]),a(g,{modelValue:t.weirdness,"onUpdate:modelValue":n[2]||=e=>t.weirdness=e,min:0,max:1,step:.01},null,8,[`modelValue`])])):o(``,!0),t.config?.custom?(_(),s(`div`,Ar,[e(`div`,jr,[e(`span`,Mr,i(t.$t(`suno.name.styleInfluence`)),1),e(`span`,Nr,i(t.styleInfluence??.5),1)]),a(g,{modelValue:t.styleInfluence,"onUpdate:modelValue":n[3]||=e=>t.styleInfluence=e,min:0,max:1,step:.01},null,8,[`modelValue`])])):o(``,!0),t.isV5OrAbove?(_(),s(`div`,Pr,[e(`div`,Fr,[e(`span`,Ir,i(t.$t(`suno.name.variationCategory`)),1)]),a(y,{modelValue:t.variationCategory,"onUpdate:modelValue":n[4]||=e=>t.variationCategory=e,size:`small`},{default:m(()=>[a(v,{value:``},{default:m(()=>[r(i(t.$t(`suno.gender.auto`)),1)]),_:1}),a(v,{value:`high`},{default:m(()=>[r(i(t.$t(`suno.variation.high`)),1)]),_:1}),a(v,{value:`low`},{default:m(()=>[r(i(t.$t(`suno.variation.low`)),1)]),_:1})]),_:1},8,[`modelValue`])])):o(``,!0),t.config?.action===`cover`?(_(),s(`div`,Lr,[e(`div`,Rr,[e(`span`,zr,i(t.$t(`suno.name.audioWeight`)),1),e(`span`,Br,i(t.audioWeight??.5),1)]),a(g,{modelValue:t.audioWeight,"onUpdate:modelValue":n[5]||=e=>t.audioWeight=e,min:0,max:1,step:.01},null,8,[`modelValue`])])):o(``,!0),t.config?.custom&&!t.config?.instrumental?(_(),s(`div`,Vr,[e(`div`,Hr,[e(`span`,Ur,i(t.$t(`suno.name.lyricsMode`)),1)]),a(y,{modelValue:t.lyricsMode,"onUpdate:modelValue":n[6]||=e=>t.lyricsMode=e,size:`small`},{default:m(()=>[a(v,{value:`manual`},{default:m(()=>[r(i(t.$t(`suno.lyricsMode.manual`)),1)]),_:1}),a(v,{value:`auto`},{default:m(()=>[r(i(t.$t(`suno.lyricsMode.auto`)),1)]),_:1})]),_:1},8,[`modelValue`])])):o(``,!0)]),_:1},8,[`title`])]),_:1},8,[`modelValue`])}var Gr=q(yr,[[`render`,Wr],[`__scopeId`,`data-v-363599d3`]]),Kr=y({name:`ReplaceSectionInput`,components:{ElInputNumber:B,ElImage:Z,InfoIcon:$},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`})}}}),qr={class:`field`},Jr={class:`flex items-center mb-2`},Yr={class:`text-sm font-bold m-0`},Xr={key:0,class:`task mb-2`},Zr={class:`left relative w-[50px] h-[50px] mr-3 flex-shrink-0`},Qr={class:`info flex-1 min-w-0`},$r={class:`text-sm font-bold m-0 truncate`},ei={class:`text-xs text-[var(--el-text-color-secondary)] m-0 truncate`},ti={class:`flex gap-2`};function ni(t,n,r,c,l,f){let p=u(`info-icon`),m=u(`el-image`),g=u(`el-input-number`),v=h(`loading`);return _(),s(`div`,qr,[e(`div`,Jr,[e(`h2`,Yr,i(t.$t(`suno.name.replaceSection`)),1),a(p,{content:t.$t(`suno.description.replaceSection`)},null,8,[`content`])]),t.audio?(_(),s(`div`,Xr,[e(`div`,{class:`audio flex items-center`,onClick:n[0]||=e=>t.onClick(t.audio)},[d((_(),s(`div`,Zr,[a(m,{src:t.audio?.image_url,class:`w-full h-full rounded`,fit:`cover`},null,8,[`src`])])),[[v,!t.audio?.audio_url]]),e(`div`,Qr,[e(`h2`,$r,i(t.audio?.title),1),e(`p`,ei,i(t.audio?.style),1)])])])):o(``,!0),e(`div`,ti,[a(g,{modelValue:t.replaceSectionStart,"onUpdate:modelValue":n[1]||=e=>t.replaceSectionStart=e,class:`flex-1`,min:0,max:t.audio?.duration,controls:!1,placeholder:t.$t(`suno.placeholder.replaceSectionStart`)},null,8,[`modelValue`,`max`,`placeholder`]),a(g,{modelValue:t.replaceSectionEnd,"onUpdate:modelValue":n[2]||=e=>t.replaceSectionEnd=e,class:`flex-1`,min:t.replaceSectionStart||0,max:t.audio?.duration,controls:!1,placeholder:t.$t(`suno.placeholder.replaceSectionEnd`)},null,8,[`modelValue`,`min`,`max`,`placeholder`])])])}var ri=q(Kr,[[`render`,ni]]),ii=y({name:`OverpaintingInput`,components:{ElInputNumber:B,ElImage:Z,InfoIcon:$},computed:{audio(){return this.$store.state.suno?.config?.audio},overpaintingStart:{get(){return this.$store.state.suno?.config?.overpainting_start},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,overpainting_start:e})}},overpaintingEnd:{get(){return this.$store.state.suno?.config?.overpainting_end},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,overpainting_end:e})}}},methods:{onClick(e){this.$store.dispatch(`suno/setAudio`,{...this.$store.state.suno.audio,...e,state:`playing`})}}}),ai={class:`field`},oi={class:`flex items-center mb-2`},si={class:`text-sm font-bold m-0`},ci={key:0,class:`task mb-2`},li={class:`left relative w-[50px] h-[50px] mr-3 flex-shrink-0`},ui={class:`info flex-1 min-w-0`},di={class:`text-sm font-bold m-0 truncate`},fi={class:`text-xs text-[var(--el-text-color-secondary)] m-0 truncate`},pi={class:`flex gap-2`};function mi(t,n,r,c,l,f){let p=u(`info-icon`),m=u(`el-image`),g=u(`el-input-number`),v=h(`loading`);return _(),s(`div`,ai,[e(`div`,oi,[e(`h2`,si,i(t.$t(`suno.name.overpaintingRange`)),1),a(p,{content:t.$t(`suno.description.overpainting`)},null,8,[`content`])]),t.audio?(_(),s(`div`,ci,[e(`div`,{class:`audio flex items-center`,onClick:n[0]||=e=>t.onClick(t.audio)},[d((_(),s(`div`,li,[a(m,{src:t.audio?.image_url,class:`w-full h-full rounded`,fit:`cover`},null,8,[`src`])])),[[v,!t.audio?.audio_url]]),e(`div`,ui,[e(`h2`,di,i(t.audio?.title),1),e(`p`,fi,i(t.audio?.style),1)])])])):o(``,!0),e(`div`,pi,[a(g,{modelValue:t.overpaintingStart,"onUpdate:modelValue":n[1]||=e=>t.overpaintingStart=e,class:`flex-1`,size:`small`,min:0,max:t.audio?.duration,controls:!1,placeholder:t.$t(`suno.placeholder.overpaintingStart`)},null,8,[`modelValue`,`max`,`placeholder`]),a(g,{modelValue:t.overpaintingEnd,"onUpdate:modelValue":n[2]||=e=>t.overpaintingEnd=e,class:`flex-1`,size:`small`,min:t.overpaintingStart||0,max:t.audio?.duration,controls:!1,placeholder:t.$t(`suno.placeholder.overpaintingEnd`)},null,8,[`modelValue`,`min`,`max`,`placeholder`])])])}var hi=q(ii,[[`render`,mi]]),gi=y({name:`UnderpaintingInput`,components:{ElInputNumber:B,ElImage:Z,InfoIcon:$},computed:{audio(){return this.$store.state.suno?.config?.audio},underpaintingStart:{get(){return this.$store.state.suno?.config?.underpainting_start},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,underpainting_start:e})}},underpaintingEnd:{get(){return this.$store.state.suno?.config?.underpainting_end},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,underpainting_end:e})}}},methods:{onClick(e){this.$store.dispatch(`suno/setAudio`,{...this.$store.state.suno.audio,...e,state:`playing`})}}}),_i={class:`field`},vi={class:`flex items-center mb-2`},yi={class:`text-sm font-bold m-0`},bi={key:0,class:`task mb-2`},xi={class:`left relative w-[50px] h-[50px] mr-3 flex-shrink-0`},Si={class:`info flex-1 min-w-0`},Ci={class:`text-sm font-bold m-0 truncate`},wi={class:`text-xs text-[var(--el-text-color-secondary)] m-0 truncate`},Ti={class:`flex gap-2`};function Ei(t,n,r,c,l,f){let p=u(`info-icon`),m=u(`el-image`),g=u(`el-input-number`),v=h(`loading`);return _(),s(`div`,_i,[e(`div`,vi,[e(`h2`,yi,i(t.$t(`suno.name.underpaintingRange`)),1),a(p,{content:t.$t(`suno.description.underpainting`)},null,8,[`content`])]),t.audio?(_(),s(`div`,bi,[e(`div`,{class:`audio flex items-center`,onClick:n[0]||=e=>t.onClick(t.audio)},[d((_(),s(`div`,xi,[a(m,{src:t.audio?.image_url,class:`w-full h-full rounded`,fit:`cover`},null,8,[`src`])])),[[v,!t.audio?.audio_url]]),e(`div`,Si,[e(`h2`,Ci,i(t.audio?.title),1),e(`p`,wi,i(t.audio?.style),1)])])])):o(``,!0),e(`div`,Ti,[a(g,{modelValue:t.underpaintingStart,"onUpdate:modelValue":n[1]||=e=>t.underpaintingStart=e,class:`flex-1`,size:`small`,min:0,max:t.audio?.duration,controls:!1,placeholder:t.$t(`suno.placeholder.underpaintingStart`)},null,8,[`modelValue`,`max`,`placeholder`]),a(g,{modelValue:t.underpaintingEnd,"onUpdate:modelValue":n[2]||=e=>t.underpaintingEnd=e,class:`flex-1`,size:`small`,min:t.underpaintingStart||0,max:t.audio?.duration,controls:!1,placeholder:t.$t(`suno.placeholder.underpaintingEnd`)},null,8,[`modelValue`,`min`,`max`,`placeholder`])])])}var Di=q(gi,[[`render`,Ei]]),Oi=y({name:`SamplesInput`,components:{ElInputNumber:B,ElImage:Z,InfoIcon:$},computed:{audio(){return this.$store.state.suno?.config?.audio},samplesStart:{get(){return this.$store.state.suno?.config?.samples_start},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,samples_start:e})}},samplesEnd:{get(){return this.$store.state.suno?.config?.samples_end},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,samples_end:e})}}},methods:{onClick(e){this.$store.dispatch(`suno/setAudio`,{...this.$store.state.suno.audio,...e,state:`playing`})}}}),ki={class:`field`},Ai={class:`flex items-center mb-2`},ji={class:`text-sm font-bold m-0`},Mi={key:0,class:`task mb-2`},Ni={class:`left relative w-[50px] h-[50px] mr-3 flex-shrink-0`},Pi={class:`info flex-1 min-w-0`},Fi={class:`text-sm font-bold m-0 truncate`},Ii={class:`text-xs text-[var(--el-text-color-secondary)] m-0 truncate`},Li={class:`flex gap-2`};function Ri(t,n,r,c,l,f){let p=u(`info-icon`),m=u(`el-image`),g=u(`el-input-number`),v=h(`loading`);return _(),s(`div`,ki,[e(`div`,Ai,[e(`h2`,ji,i(t.$t(`suno.name.samplesRange`)),1),a(p,{content:t.$t(`suno.description.samples`)},null,8,[`content`])]),t.audio?(_(),s(`div`,Mi,[e(`div`,{class:`audio flex items-center`,onClick:n[0]||=e=>t.onClick(t.audio)},[d((_(),s(`div`,Ni,[a(m,{src:t.audio?.image_url,class:`w-full h-full rounded`,fit:`cover`},null,8,[`src`])])),[[v,!t.audio?.audio_url]]),e(`div`,Pi,[e(`h2`,Fi,i(t.audio?.title),1),e(`p`,Ii,i(t.audio?.style),1)])])])):o(``,!0),e(`div`,Li,[a(g,{modelValue:t.samplesStart,"onUpdate:modelValue":n[1]||=e=>t.samplesStart=e,class:`flex-1`,size:`small`,min:0,max:t.audio?.duration,controls:!1,placeholder:t.$t(`suno.placeholder.samplesStart`)},null,8,[`modelValue`,`max`,`placeholder`]),a(g,{modelValue:t.samplesEnd,"onUpdate:modelValue":n[2]||=e=>t.samplesEnd=e,class:`flex-1`,size:`small`,min:t.samplesStart||0,max:t.audio?.duration,controls:!1,placeholder:t.$t(`suno.placeholder.samplesEnd`)},null,8,[`modelValue`,`min`,`max`,`placeholder`])])])}var zi=q(Oi,[[`render`,Ri]]),Bi=[.5,.75,1,1.25,1.5,2],Vi=y({name:`AdjustSpeedInput`,components:{ElRadioGroup:M,ElRadioButton:j,ElImage:Z,InfoIcon:$},data(){return{options:Bi}},computed:{audio(){return this.$store.state.suno?.config?.audio},speed:{get(){let e=this.$store.state.suno?.config?.speed;return typeof e==`number`?e:1},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,speed:e})}}},methods:{onClick(e){this.$store.dispatch(`suno/setAudio`,{...this.$store.state.suno.audio,...e,state:`playing`})}}}),Hi={class:`field`},Ui={class:`flex items-center mb-2`},Wi={class:`text-sm font-bold m-0`},Gi={key:0,class:`task mb-2`},Ki={class:`left relative w-[50px] h-[50px] mr-3 flex-shrink-0`},qi={class:`info flex-1 min-w-0`},Ji={class:`text-sm font-bold m-0 truncate`},Yi={class:`text-xs text-[var(--el-text-color-secondary)] m-0 truncate`};function Xi(t,n,c,f,v,y){let b=u(`info-icon`),x=u(`el-image`),S=u(`el-radio-button`),C=u(`el-radio-group`),w=h(`loading`);return _(),s(`div`,Hi,[e(`div`,Ui,[e(`h2`,Wi,i(t.$t(`suno.name.adjustSpeed`)),1),a(b,{content:t.$t(`suno.description.adjustSpeed`)},null,8,[`content`])]),t.audio?(_(),s(`div`,Gi,[e(`div`,{class:`audio flex items-center`,onClick:n[0]||=e=>t.onClick(t.audio)},[d((_(),s(`div`,Ki,[a(x,{src:t.audio?.image_url,class:`w-full h-full rounded`,fit:`cover`},null,8,[`src`])])),[[w,!t.audio?.audio_url]]),e(`div`,qi,[e(`h2`,Ji,i(t.audio?.title),1),e(`p`,Yi,i(t.audio?.style),1)])])])):o(``,!0),a(C,{modelValue:t.speed,"onUpdate:modelValue":n[1]||=e=>t.speed=e,size:`small`,class:`speed-group`},{default:m(()=>[(_(!0),s(l,null,g(t.options,e=>(_(),p(S,{key:e,value:e},{default:m(()=>[r(i(e)+`x`,1)]),_:2},1032,[`value`]))),128))]),_:1},8,[`modelValue`])])}var Zi=q(Vi,[[`render`,Xi],[`__scopeId`,`data-v-ba834628`]]),Qi=y({name:`VoiceCreateDialog`,components:{ElDialog:Ge,ElForm:E,ElFormItem:T,ElInput:Q,ElButton:G,ElRadioGroup:M,ElRadio:N},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`,`created`],data(){return{sourceType:`song`,form:{name:``,description:``,audio_id:``,audio_url:``},loading:!1}},computed:{visible:{get(){return this.modelValue},set(e){this.$emit(`update:modelValue`,e)}},token(){return this.$store.state.suno?.credential?.token},canSubmit(){return!(!this.form.name||this.sourceType===`song`&&!this.form.audio_id||this.sourceType===`upload`&&!this.form.audio_url)}},methods:{onClose(){this.visible=!1,this.resetForm()},resetForm(){this.form={name:``,description:``,audio_id:``,audio_url:``},this.sourceType=`song`},async onSubmit(){if(this.token){this.loading=!0;try{this.sourceType===`song`?await K.persona({audio_id:this.form.audio_id,name:this.form.name,description:this.form.description},{token:this.token}):await K.voices({audio_url:this.form.audio_url,name:this.form.name,description:this.form.description},{token:this.token}),Y.success(this.$t(`suno.voice.createSuccess`)),this.$emit(`created`),this.onClose()}catch{Y.error(this.$t(`suno.voice.createFailed`))}finally{this.loading=!1}}}}});function $i(e,t,n,s,c,l){let d=u(`el-input`),f=u(`el-form-item`),h=u(`el-radio`),g=u(`el-radio-group`),v=u(`el-form`),y=u(`el-button`),b=u(`el-dialog`);return _(),p(b,{modelValue:e.visible,"onUpdate:modelValue":t[5]||=t=>e.visible=t,title:e.$t(`suno.voice.createTitle`),width:`480px`,"close-on-click-modal":!1,onClose:e.onClose},{footer:m(()=>[a(y,{onClick:e.onClose},{default:m(()=>[r(i(e.$t(`common.button.cancel`)),1)]),_:1},8,[`onClick`]),a(y,{type:`primary`,loading:e.loading,disabled:!e.canSubmit,onClick:e.onSubmit},{default:m(()=>[r(i(e.$t(`suno.voice.create`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])]),default:m(()=>[a(v,{"label-position":`top`,class:`voice-create-form`},{default:m(()=>[a(f,{label:e.$t(`suno.voice.name`)},{default:m(()=>[a(d,{modelValue:e.form.name,"onUpdate:modelValue":t[0]||=t=>e.form.name=t,placeholder:e.$t(`suno.voice.namePlaceholder`),maxlength:`50`},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`label`]),a(f,{label:e.$t(`suno.voice.description`)},{default:m(()=>[a(d,{modelValue:e.form.description,"onUpdate:modelValue":t[1]||=t=>e.form.description=t,type:`textarea`,rows:2,placeholder:e.$t(`suno.voice.descriptionPlaceholder`),maxlength:`200`},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`label`]),a(f,{label:e.$t(`suno.voice.sourceType`)},{default:m(()=>[a(g,{modelValue:e.sourceType,"onUpdate:modelValue":t[2]||=t=>e.sourceType=t,class:`w-full`},{default:m(()=>[a(h,{value:`song`},{default:m(()=>[r(i(e.$t(`suno.voice.fromSong`)),1)]),_:1}),a(h,{value:`upload`},{default:m(()=>[r(i(e.$t(`suno.voice.fromUpload`)),1)]),_:1})]),_:1},8,[`modelValue`])]),_:1},8,[`label`]),e.sourceType===`song`?(_(),p(f,{key:0,label:e.$t(`suno.voice.audioId`)},{default:m(()=>[a(d,{modelValue:e.form.audio_id,"onUpdate:modelValue":t[3]||=t=>e.form.audio_id=t,placeholder:e.$t(`suno.voice.audioIdPlaceholder`)},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`label`])):o(``,!0),e.sourceType===`upload`?(_(),p(f,{key:1,label:e.$t(`suno.voice.audioUrl`)},{default:m(()=>[a(d,{modelValue:e.form.audio_url,"onUpdate:modelValue":t[4]||=t=>e.form.audio_url=t,placeholder:e.$t(`suno.voice.audioUrlPlaceholder`)},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`label`])):o(``,!0)]),_:1})]),_:1},8,[`modelValue`,`title`,`onClose`])}var ea=y({name:`VoiceManager`,components:{AddIcon:De,DeleteIcon:Ne,FavoriteIcon:at,ElButton:G,ElIcon:b,ElTabs:C,ElTabPane:w,ElTooltip:O,Loading:be,MicrophoneIcon:H,MusicIcon:Ce,VoiceCreateDialog:q(Qi,[[`render`,$i]])},data(){return{showCreateDialog:!1,loading:!1,deletingId:null,activeTab:`all`}},computed:{personas(){return this.$store.state.suno?.personas||[]},favoriteIds(){return this.$store.state.suno?.favoritePersonaIds||[]},favoritePersonas(){return this.personas.filter(e=>e.persona_id&&this.favoriteIds.includes(e.persona_id))},visiblePersonas(){return this.activeTab===`favorites`?this.favoritePersonas:this.personas},selectedPersonaId(){return this.$store.state.suno?.config?.persona_id}},watch:{"$store.state.suno.credential":{handler(){this.loadPersonas()},immediate:!0}},methods:{isFavorite(e){return!!e&&this.favoriteIds.includes(e)},onToggleFavorite(e){e.persona_id&&this.$store.commit(`suno/togglePersonaFavorite`,e.persona_id)},async loadPersonas(){if(this.$store.state.suno?.credential?.token){this.loading=!0;try{await this.$store.dispatch(`suno/getPersonas`)}finally{this.loading=!1}}},selectPersona(e){let t={...this.$store.state.suno?.config};t.persona_id===e.persona_id?t.persona_id=void 0:t.persona_id=e.persona_id,this.$store.dispatch(`suno/setConfig`,t)},async onDelete(e){try{await Be.confirm(this.$t(`suno.voice.confirmDelete`),this.$t(`suno.voice.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.confirm`),cancelButtonText:this.$t(`common.button.cancel`)})}catch{return}if(!e.persona_id)return;this.deletingId=e.persona_id;let t=await this.$store.dispatch(`suno/deletePersona`,e.persona_id);if(this.deletingId=null,t){if(Y.success(this.$t(`suno.voice.deleteSuccess`)),this.selectedPersonaId===e.persona_id){let e={...this.$store.state.suno?.config,persona_id:void 0};this.$store.dispatch(`suno/setConfig`,e)}this.favoriteIds.includes(e.persona_id)&&this.$store.commit(`suno/togglePersonaFavorite`,e.persona_id)}else Y.error(this.$t(`suno.voice.deleteFailed`))},async onCreated(){await this.loadPersonas()}}}),ta={class:`voice-manager`},na={class:`flex items-center justify-between mb-3`},ra={class:`text-sm font-medium`},ia={key:0,class:`text-center py-6`},aa={key:1,class:`text-center py-6 text-gray-400 text-sm`},oa={key:2,class:`voice-list`},sa=[`onClick`],ca={class:`flex-1 min-w-0`},la={class:`voice-name`},ua={key:0,class:`voice-desc`};function da(c,d,f,h,v,y){let b=u(`add-icon`),x=u(`el-button`),S=u(`el-tab-pane`),C=u(`el-tabs`),w=u(`loading`),T=u(`el-icon`),E=u(`microphone-icon`),D=u(`music-icon`),O=u(`favorite-icon`),k=u(`el-tooltip`),A=u(`delete-icon`),j=u(`voice-create-dialog`);return _(),s(`div`,ta,[e(`div`,na,[e(`span`,ra,i(c.$t(`suno.voice.title`)),1),a(x,{type:`primary`,size:`small`,onClick:d[0]||=e=>c.showCreateDialog=!0},{default:m(()=>[a(b,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`suno.voice.create`)),1)]),_:1})]),a(C,{modelValue:c.activeTab,"onUpdate:modelValue":d[1]||=e=>c.activeTab=e,class:`voice-tabs`,size:`small`},{default:m(()=>[a(S,{name:`all`,label:c.$t(`suno.voice.tabAll`)+` (`+(c.personas?.length||0)+`)`},null,8,[`label`]),a(S,{name:`favorites`,label:c.$t(`suno.voice.tabFavorites`)+` (`+c.favoritePersonas.length+`)`},null,8,[`label`])]),_:1},8,[`modelValue`]),c.loading?(_(),s(`div`,ia,[a(T,{class:`is-loading`},{default:m(()=>[a(w,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})])):c.visiblePersonas.length===0?(_(),s(`div`,aa,i(c.activeTab===`favorites`?c.$t(`suno.voice.emptyFavorites`):c.$t(`suno.voice.empty`)),1)):(_(),s(`div`,oa,[(_(!0),s(l,null,g(c.visiblePersonas,l=>(_(),s(`div`,{key:l.persona_id,class:n([`voice-item`,{active:c.selectedPersonaId===l.persona_id}]),onClick:e=>c.selectPersona(l)},[e(`div`,ca,[e(`div`,la,[l.source_type===`voice`?(_(),p(E,{key:0,class:`mr-1.5 text-xs opacity-60`,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(_(),p(D,{key:1,class:`mr-1.5 text-xs opacity-60`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),r(` `+i(l.name||l.persona_id),1)]),l.description?(_(),s(`div`,ua,i(l.description),1)):o(``,!0)]),e(`div`,{class:`voice-actions`,onClick:d[2]||=t(()=>{},[`stop`])},[a(k,{content:c.isFavorite(l.persona_id)?c.$t(`suno.voice.unfavorite`):c.$t(`suno.voice.favorite`),placement:`top`},{default:m(()=>[a(x,{size:`small`,text:``,class:n({"voice-fav-active":c.isFavorite(l.persona_id)}),"aria-label":c.isFavorite(l.persona_id)?c.$t(`suno.voice.unfavorite`):c.$t(`suno.voice.favorite`),title:c.isFavorite(l.persona_id)?c.$t(`suno.voice.unfavorite`):c.$t(`suno.voice.favorite`),onClick:e=>c.onToggleFavorite(l)},{default:m(()=>[a(O,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`class`,`aria-label`,`title`,`onClick`])]),_:2},1032,[`content`]),a(x,{type:`danger`,size:`small`,text:``,loading:c.deletingId===l.persona_id,"aria-label":c.$t(`common.button.delete`),title:c.$t(`common.button.delete`),onClick:e=>c.onDelete(l)},{default:m(()=>[a(A,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`loading`,`aria-label`,`title`,`onClick`])])],10,sa))),128))])),a(j,{modelValue:c.showCreateDialog,"onUpdate:modelValue":d[3]||=e=>c.showCreateDialog=e,onCreated:c.onCreated},null,8,[`modelValue`,`onCreated`])])}var fa=y({name:`PersonaInput`,components:{MicrophoneIcon:H,ElSelect:x,ElOption:S,ElButton:G,ElDrawer:I,InfoIcon:$,VoiceManager:q(ea,[[`render`,da],[`__scopeId`,`data-v-29070b80`]])},data(){return{showManager:!1}},computed:{personaId:{get(){return this.$store.state.suno?.config?.persona_id||``},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,persona_id:e||void 0})}},personas(){return this.$store.state.suno?.personas||[]}}}),pa={class:`field`},ma={class:`flex items-center justify-between mb-2`},ha={class:`flex items-center`},ga={class:`text-sm font-bold`},_a={class:`flex items-center justify-between w-full`},va={key:0,class:`text-xs text-gray-400 ml-2`};function ya(t,n,c,d,f,h){let v=u(`info-icon`),y=u(`microphone-icon`),b=u(`el-button`),x=u(`el-option`),S=u(`el-select`),C=u(`voice-manager`),w=u(`el-drawer`);return _(),s(`div`,pa,[e(`div`,ma,[e(`div`,ha,[e(`span`,ga,i(t.$t(`suno.name.persona`)),1),a(v,{content:t.$t(`suno.description.persona`)},null,8,[`content`])]),a(b,{size:`small`,round:``,onClick:n[0]||=e=>t.showManager=!0},{default:m(()=>[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`suno.voice.manage`)),1)]),_:1})]),a(S,{modelValue:t.personaId,"onUpdate:modelValue":n[1]||=e=>t.personaId=e,placeholder:t.$t(`suno.placeholder.personaId`),clearable:``,filterable:``,class:`w-full`},{default:m(()=>[(_(!0),s(l,null,g(t.personas,t=>(_(),p(x,{key:t.persona_id||``,value:t.persona_id||``,label:t.name||t.persona_id||``},{default:m(()=>[e(`div`,_a,[e(`span`,null,i(t.name||t.persona_id),1),t.source_type?(_(),s(`span`,va,i(t.source_type),1)):o(``,!0)])]),_:2},1032,[`value`,`label`]))),128))]),_:1},8,[`modelValue`,`placeholder`]),a(w,{modelValue:t.showManager,"onUpdate:modelValue":n[2]||=e=>t.showManager=e,title:t.$t(`suno.voice.title`),size:`380px`,direction:`rtl`},{default:m(()=>[a(C)]),_:1},8,[`modelValue`,`title`])])}var ba=y({name:`PresetPanel`,components:{CleanupIcon:ce,MagicIcon:W,TypeSelector:wt,PromptInput:nn,LyricInput:_n,StyleInput:Mn,TitleInput:Rn,ExtendFromInput:$n,CoverFromInput:pr,UploadAudio:qt,VocalGenderSelector:vr,AdvancedParams:Gr,ReplaceSectionInput:ri,OverpaintingInput:hi,UnderpaintingInput:Di,SamplesInput:zi,AdjustSpeedInput:Zi,PersonaInput:q(fa,[[`render`,ya]]),ElButton:G,ElTabs:C,ElTabPane:w,Consumption:qe},emits:[`generate`],computed:{config(){return this.$store.state.suno?.config},mode:{get(){return this.$store.state.suno?.config?.custom?`custom`:`simple`},set(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,custom:e===`custom`})}},consumption(){return ze(this.config,this.service?.cost)},service(){return this.$store.state.suno?.service},supportsVocalGender(){let e=this.config?.model||``;return[`chirp-v4-5-plus`,`chirp-v5`,`chirp-v5-5`].includes(e)},supportsPersona(){let e=this.config?.action;return!e||e===`generate`||e===`artist_consistency`||e===`artist_consistency_vox`},generateButtonText(){let e=this.config?.action;return e===`extend`?this.$t(`suno.button.extend`):e===`cover`?this.$t(`suno.button.cover_music`):e===`remaster`?this.$t(`suno.button.remaster`):e===`replace_section`?this.$t(`suno.button.replace_section`):e===`mashup`?this.$t(`suno.button.mashup`):e===`stems`?this.$t(`suno.button.get_stems`):e===`concat`?this.$t(`suno.button.concat_music`):e===`upload_cover`?this.$t(`suno.button.upload_cover`):e===`artist_consistency`?this.$t(`suno.button.artist_consistency`):e===`artist_consistency_vox`?this.$t(`suno.button.artist_consistency_vox`):e===`overpainting`?this.$t(`suno.button.overpainting`):e===`underpainting`?this.$t(`suno.button.underpainting`):e===`samples`?this.$t(`suno.button.samples`):e===`adjust_speed`?this.$t(`suno.button.adjust_speed`):this.$t(`suno.button.generate`)}},methods:{onGenerate(){this.$emit(`generate`)},onClearAll(){this.$store.commit(`suno/setConfig`,{custom:!1,sounds:!1,instrumental:!1,lyric:``,style:``,title:``,lyrics_mode:`manual`,model:this.$store.state.suno?.config?.model})}}}),xa={class:`flex flex-col h-full`},Sa={class:`flex-1 min-h-0 overflow-hidden`},Ca={class:`p-5`},wa={class:`p-5`},Ta={class:`flex flex-col items-center justify-center px-5 pb-5 gap-2`},Ea={class:`flex gap-2 w-full`};function Da(t,n,c,l,d,f){let h=u(`type-selector`),g=u(`upload-audio`),v=u(`prompt-input`),y=u(`extend-from-input`),b=u(`cover-from-input`),x=u(`replace-section-input`),S=u(`overpainting-input`),C=u(`underpainting-input`),w=u(`samples-input`),T=u(`adjust-speed-input`),E=u(`advanced-params`),D=u(`el-tab-pane`),O=u(`lyric-input`),k=u(`style-input`),A=u(`title-input`),j=u(`vocal-gender-selector`),M=u(`persona-input`),N=u(`el-tabs`),P=u(`consumption`),F=u(`cleanup-icon`),I=u(`el-button`),L=u(`magic-icon`);return _(),s(`div`,xa,[e(`div`,Sa,[a(N,{modelValue:t.mode,"onUpdate:modelValue":n[0]||=e=>t.mode=e,class:`suno-mode-tabs`,stretch:``},{default:m(()=>[a(D,{label:t.$t(`suno.mode.simple`),name:`simple`},{default:m(()=>[e(`div`,Ca,[a(h,{class:`mb-4`}),a(g,{class:`mb-4`}),a(v,{class:`mb-4`}),t.config?.action===`extend`?(_(),p(y,{key:0,class:`mb-4`})):o(``,!0),t.config?.action===`cover`?(_(),p(b,{key:1,class:`mb-4`})):o(``,!0),t.config?.action===`replace_section`?(_(),p(x,{key:2,class:`mb-4`})):o(``,!0),t.config?.action===`overpainting`?(_(),p(S,{key:3,class:`mb-4`})):o(``,!0),t.config?.action===`underpainting`?(_(),p(C,{key:4,class:`mb-4`})):o(``,!0),t.config?.action===`samples`?(_(),p(w,{key:5,class:`mb-4`})):o(``,!0),t.config?.action===`adjust_speed`?(_(),p(T,{key:6,class:`mb-4`})):o(``,!0),a(E,{class:`mb-4`})])]),_:1},8,[`label`]),a(D,{label:t.$t(`suno.mode.custom`),name:`custom`},{default:m(()=>[e(`div`,wa,[a(h,{class:`mb-4`}),a(g,{class:`mb-4`}),t.config?.instrumental?o(``,!0):(_(),p(O,{key:0,class:`mb-4`})),a(k,{class:`mb-4`}),a(A,{class:`mb-4`}),!t.config?.instrumental&&t.supportsVocalGender?(_(),p(j,{key:1,class:`mb-4`})):o(``,!0),t.supportsPersona?(_(),p(M,{key:2,class:`mb-4`})):o(``,!0),t.config?.action===`extend`?(_(),p(y,{key:3,class:`mb-4`})):o(``,!0),t.config?.action===`cover`?(_(),p(b,{key:4,class:`mb-4`})):o(``,!0),t.config?.action===`replace_section`?(_(),p(x,{key:5,class:`mb-4`})):o(``,!0),t.config?.action===`overpainting`?(_(),p(S,{key:6,class:`mb-4`})):o(``,!0),t.config?.action===`underpainting`?(_(),p(C,{key:7,class:`mb-4`})):o(``,!0),t.config?.action===`samples`?(_(),p(w,{key:8,class:`mb-4`})):o(``,!0),t.config?.action===`adjust_speed`?(_(),p(T,{key:9,class:`mb-4`})):o(``,!0),a(E,{class:`mb-4`})])]),_:1},8,[`label`])]),_:1},8,[`modelValue`])]),e(`div`,Ta,[a(P,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),e(`div`,Ea,[a(I,{class:`flex-1`,onClick:t.onClearAll},{default:m(()=>[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`suno.button.clear_all`)),1)]),_:1},8,[`onClick`]),a(I,{type:`primary`,class:`flex-1`,round:``,onClick:t.onGenerate},{default:m(()=>[a(L,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.generateButtonText),1)]),_:1},8,[`onClick`])])])])}var Oa=q(ba,[[`render`,Da],[`__scopeId`,`data-v-c9eacc4d`]]),ka=le(),Aa=y({name:`TaskPreview`,components:{AudioIcon:_e,CodeIcon:pe,CollectionIcon:rt,CutIcon:it,DeleteIcon:Ne,DownloadIcon:me,DrumIcon:Qe,EditIcon:Ee,FastForwardIcon:et,GuitarIcon:nt,LinkIcon:ye,MagicIcon:W,MicrophoneIcon:H,MoreIcon:he,MusicIcon:Ce,PaletteIcon:we,PerformanceIcon:ge,ShuffleIcon:je,SortIcon:oe,TimeIcon:fe,UndoIcon:ke,ElImage:Z,ElIcon:b,ElTooltip:O,VideoPlay:U,VideoPause:Te,ElDropdown:z,ElDropdownMenu:R,ElDropdownItem:L,ElInput:Q,ElProgress:te,ElCheckbox:A,Loading:be,ApiCodeDialog:Je},props:{modelValue:{type:Object,required:!0}},data(){return{isFetchingVideoUrl:!1,isFetchingWav:!1,isFetchingMidi:!1,editingAudioId:null,editingTitle:``,apiCodeVisible:!1,apiCodePath:`/suno/audios`,apiCodeBody:{}}},computed:{loading(){return this.$store.state.suno?.status?.getApplications===J.Request},showViewCode(){return Ue()},credential(){return this.$store.state.suno.credential},config(){return this.$store.state.suno.config},task(){return this.$store.state.suno?.tasks},audios(){let e=this.modelValue?.response?.data??[],t=this.modelValue?.request?.action;return t?e.map(e=>({...e,action:t})):e},application(){return this.$store.state.suno?.application},active(){return this.$store.state.suno?.tasks?.active},isMashupMode(){return this.$store.state.suno?.config?.action===`mashup`},mashupAudioIds(){return this.$store.state.suno?.config?.mashup_audio_ids||[]}},methods:{useFormatDuring:V,shortModel(e){let t=e?.model;if(!t)return``;let n=/v(\d+)(?:-(\d+))?(-plus)?/i.exec(t);if(!n)return t;let r=n[2]&&n[2]!==`0`?`.`+n[2]:``;return`v${n[1]}${r}${n[3]?`+`:``}`},onViewCode(){let e=this.modelValue?.request||{},t={};Object.entries(e).forEach(([e,n])=>{e===`application_id`||e===`callback_url`||n!=null&&(typeof n==`string`&&n===``||Array.isArray(n)&&n.length===0||(t[e]=n))}),this.apiCodeBody=t,this.apiCodePath=`/suno/audios`,this.apiCodeVisible=!0},onPlay(e){this.$store.dispatch(`suno/setAudio`,{...this.$store.state.suno.audio,...e,state:`playing`})},onPause(e){this.$store.dispatch(`suno/setAudio`,{...this.$store.state.suno.audio,...e,state:`paused`})},onClick(e){this.$store.state?.suno?.audio?.id!==e.id&&this.onPlay({...e,progress:0})},onExtend(e,t){e?.stopPropagation(),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();let n=new URL(t).pathname,r=n.substring(n.lastIndexOf(`/`)+1);fetch(t).then(e=>e.blob()).then(e=>{(0,ka.saveAs)(e,r)})},async handleVideoDownload(e){if(e.video_url){this.onDownload(null,e.video_url);return}if(!this.isFetchingVideoUrl)try{this.isFetchingVideoUrl=!0;let t=await this.fetchVideoUrlFromApi(e?.id);e.video_url=t,this.onDownload(null,t)}catch(e){console.error(`get videoUrl failed:`,e),Y.error(this.$t(`suno.message.getVideoUrlFailed`))}finally{this.isFetchingVideoUrl=!1}},async fetchVideoUrlFromApi(e){return new Promise((t,n)=>{let r={audio_id:e},i=this.credential?.token;if(!i){console.error(`no token specified`),n(Error(`No token specified`));return}K.mp4(r,{token:i}).then(e=>{let r=e.data?.data?.video_url;r?t(r):n(Error(`Video URL not found in response`))}).catch(e=>{n(e)})})},onPreview(e,t){e?.stopPropagation(),window.open(t,`_blank`)},async onGetStems(e){await this.onGenerateAudioUrl(`stems`,e)},onCover(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,model:e.model,custom:!0,instrumental:!1,style:e.style,action:`cover`,audio:e,audio_id:e.id})},async onConcatMusic(e){await this.onGenerateAudioUrl(`concat`,e)},async onRemaster(e){await this.onGenerateAudioUrl(`remaster`,e)},async onGetAllStems(e){await this.onGenerateAudioUrl(`all_stems`,e)},onReplaceSection(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,model:e.model,custom:!0,instrumental:!1,style:e.style,action:`replace_section`,audio:e,audio_id:e.id,replace_section_start:0,replace_section_end:Math.min(30,e.duration||30)})},onMashup(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:`mashup`,audio:e,audio_id:e.id,mashup_audio_ids:[e.id]})},onOverpainting(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:`overpainting`,audio:e,audio_id:e.id,overpainting_start:0,overpainting_end:Math.min(30,e.duration||30)})},onUnderpainting(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:`underpainting`,audio:e,audio_id:e.id,underpainting_start:0,underpainting_end:Math.min(30,e.duration||30)})},onSamples(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:`samples`,audio:e,audio_id:e.id,samples_start:0,samples_end:Math.min(30,e.duration||30)})},onArtistConsistency(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:`artist_consistency`,audio:e,audio_id:e.id})},onAdjustSpeed(e){this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:`adjust_speed`,audio:e,audio_id:e.id,speed:1})},onReusePrompt(e){let t=this.modelValue?.request??{};if(!(t.prompt||t.lyric||t.style||t.title||t.lyric_prompt||t.style_negative||t.persona_id)){Y.warning(this.$t(`suno.message.reusePromptEmpty`));return}this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,model:t.model??e.model,custom:t.custom??!1,instrumental:t.instrumental??!1,prompt:t.prompt??``,lyric:t.lyric??``,lyric_prompt:t.lyric_prompt??``,lyrics_mode:t.lyrics_mode??`manual`,title:t.title??``,style:t.style??``,style_negative:t.style_negative??``,vocal_gender:t.vocal_gender,weirdness:t.weirdness,style_influence:t.style_influence,variation_category:t.variation_category,audio_weight:t.audio_weight,persona_id:t.persona_id,action:void 0,audio:void 0,audio_id:void 0,mashup_audio_ids:void 0,continue_at:void 0,speed:void 0,replace_section_start:void 0,replace_section_end:void 0,overpainting_start:void 0,overpainting_end:void 0,underpainting_start:void 0,underpainting_end:void 0,samples_start:void 0,samples_end:void 0}),Y.success(this.$t(`suno.message.reusePromptSuccess`))},async onExtractVocals(e){let t=this.credential?.token;t&&(Y.info(this.$t(`suno.message.extractingVocals`)),K.vox({audio_id:e,async:!0},{token:t}).then(()=>{Y.success(this.$t(`suno.message.extractVocalsSuccess`))}).catch(e=>{Y.error(e?.response?.data?.error?.message||this.$t(`suno.message.extractVocalsFailed`))}).finally(async()=>{await this.onGetTasks(),await this.onScrollDown()}))},async onGetTiming(e){let t=this.credential?.token;t&&(Y.info(this.$t(`suno.message.fetchingTiming`)),K.timing({audio_id:e},{token:t}).then(()=>{Y.success(this.$t(`suno.message.fetchTimingSuccess`))}).catch(e=>{Y.error(e?.response?.data?.error?.message||this.$t(`suno.message.fetchTimingFailed`))}))},async handleWavDownload(e){if(!e?.id||this.isFetchingWav)return;let t=this.credential?.token;if(t)try{this.isFetchingWav=!0,Y.info(this.$t(`suno.message.fetchingWav`));let n=(await K.wav({audio_id:e.id},{token:t})).data?.data?.[0]?.file_url;n?this.onDownload(null,n):Y.error(this.$t(`suno.message.fetchWavFailed`))}catch(e){let t=e?.response?.data?.error?.message;Y.error(t||this.$t(`suno.message.fetchWavFailed`))}finally{this.isFetchingWav=!1}},async handleMidiDownload(e){if(!e?.id||this.isFetchingMidi)return;let t=this.credential?.token;if(t)try{this.isFetchingMidi=!0,Y.info(this.$t(`suno.message.fetchingMidi`));let n=(await K.midi({audio_id:e.id},{token:t})).data?.data;if(!n?.length){Y.error(this.$t(`suno.message.fetchMidiFailed`));return}let r=(e.title||e.id||`suno`).replace(/[^\w.-]+/g,`_`)+`.json`;(0,ka.saveAs)(new Blob([JSON.stringify(n,null,2)],{type:`application/json`}),r)}catch(e){let t=e?.response?.data?.error?.message;Y.error(t||this.$t(`suno.message.fetchMidiFailed`))}finally{this.isFetchingMidi=!1}},async onGenerateAudioUrl(e,t){let n={action:e,audio_id:t,async:!0},r=this.credential?.token;if(!r){console.error(`no token specified`);return}Y.info(this.$t(`suno.message.startingTask`)),K.audio(n,{token:r}).then(()=>{Y.success(this.$t(`suno.message.startTaskSuccess`))}).catch(e=>{Y.error(e?.response?.data?.error?.message||this.$t(`suno.message.startTaskFailed`))}).finally(async()=>{await this.onGetTasks(),await this.onScrollDown()})},isMashupSelected(e){return!!e.id&&this.mashupAudioIds.includes(e.id)},onToggleMashup(e){if(!e.id)return;let t=[...this.mashupAudioIds],n=t.indexOf(e.id);n===-1?t.push(e.id):t.splice(n,1),this.$store.commit(`suno/setConfig`,{...this.$store.state.suno?.config,mashup_audio_ids:t})},async onScrollDown(){setTimeout(()=>{let e=document.querySelector(`.tasks`);e&&(e.scrollTop=e.scrollHeight)},1e3)},onStartTitleEdit(e){this.editingAudioId=e.id??null,this.editingTitle=e.title||``,this.$nextTick(()=>{this.$refs.titleInput?.focus?.()})},onSaveTitleEdit(e){if(this.editingAudioId!==e.id)return;let t=this.editingTitle.trim();if(t&&t!==e.title){let n=this.$store.state.suno?.tasks;if(n?.items)for(let r of n.items){let n=(r?.response?.data??[]).find(t=>t.id===e.id);if(n){n.title=t;break}}}this.editingAudioId=null,this.editingTitle=``},onCancelTitleEdit(){this.editingAudioId=null,this.editingTitle=``},async onDelete(e){try{await Be.confirm(this.$t(`suno.message.confirmDelete`),{confirmButtonText:this.$t(`suno.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`})}catch{return}let t=this.$store.state.suno?.tasks;if(t?.items)for(let n of t.items){let r=n?.response?.data??[],i=r.findIndex(t=>t.id===e.id);if(i!==-1){if(r.splice(i,1),r.length===0){let e=t.items.indexOf(n);e!==-1&&t.items.splice(e,1)}break}}this.$store.state?.suno?.audio?.id===e.id&&this.$store.dispatch(`suno/setAudio`,null),Y.success(this.$t(`suno.message.deleteSuccess`))},async onGetTasks(){this.loading||await this.$store.dispatch(`suno/getTasks`,{limit:30,offset:0})}}}),ja={class:`task`},Ma=[`onClick`],Na=[`onClick`],Pa={class:`left`},Fa={key:0,class:`variation-badge`},Ia=[`aria-label`,`title`,`onClick`,`onKeydown`],La=[`aria-label`,`title`,`onClick`,`onKeydown`],Ra={key:3,class:`duration`},za={class:`info`},Ba={key:1,class:`title-row`},Va={class:`title`},Ha={key:0,class:`model-chip`},Ua=[`aria-label`,`title`,`onClick`],Wa={class:`style`},Ga={key:2,class:`progress-row`},Ka={class:`progress-text`},qa={class:`right`},Ja=[`aria-label`,`title`,`onClick`],Ya={class:`el-dropdown-link`},Xa={class:`flex items-center min-w-[120px]`},Za={class:`flex items-center min-w-[120px]`},Qa={class:`flex items-center min-w-[120px]`},$a={class:`el-dropdown-link`};function eo(f,v,y,b,x,S){let C=u(`el-checkbox`),w=u(`el-image`),T=u(`video-pause`),E=u(`el-icon`),D=u(`video-play`),O=u(`el-input`),k=u(`edit-icon`),A=u(`el-progress`),j=u(`fast-forward-icon`),M=u(`el-tooltip`),N=u(`download-icon`),P=u(`Loading`),F=u(`el-dropdown-item`),I=u(`el-dropdown-menu`),L=u(`el-dropdown`),R=u(`more-icon`),z=u(`music-icon`),B=u(`shuffle-icon`),ee=u(`link-icon`),te=u(`cut-icon`),ne=u(`microphone-icon`),re=u(`guitar-icon`),ie=u(`drum-icon`),ae=u(`collection-icon`),oe=u(`sort-icon`),se=u(`magic-icon`),ce=u(`audio-icon`),le=u(`palette-icon`),V=u(`performance-icon`),ue=u(`undo-icon`),de=u(`time-icon`),fe=u(`code-icon`),pe=u(`delete-icon`),me=u(`api-code-dialog`),he=h(`loading`);return _(),s(`div`,ja,[(_(!0),s(l,null,g(f.audios,(l,u)=>(_(),s(`div`,{key:l.id,class:n([`audio`,{"mashup-selected":f.isMashupSelected(l),active:f.$store.state?.suno?.audio?.id===l.id,generating:!l?.audio_url}]),onClick:t(e=>f.onClick(l),[`stop`])},[f.isMashupMode&&l?.audio_url?(_(),s(`div`,{key:0,class:`mashup-check`,onClick:t(e=>f.onToggleMashup(l),[`stop`])},[a(C,{"model-value":f.isMashupSelected(l),onClick:v[0]||=t(()=>{},[`stop`])},null,8,[`model-value`])],8,Na)):o(``,!0),d((_(),s(`div`,Pa,[a(w,{src:l?.image_url,class:`cover`,fit:`cover`,lazy:``},null,8,[`src`]),f.audios.length>1?(_(),s(`div`,Fa,i(u+1),1)):o(``,!0),l?.audio_url&&f.$store.state?.suno?.audio?.id===l.id&&f.$store.state?.suno?.audio?.state===`playing`?(_(),s(`div`,{key:1,class:`play-btn`,role:`button`,tabindex:`0`,"aria-label":f.$t(`common.player.pause`),title:f.$t(`common.player.pause`),onClick:t(e=>f.onPause(l),[`stop`]),onKeydown:[c(t(e=>f.onPause(l),[`stop`,`prevent`]),[`enter`]),c(t(e=>f.onPause(l),[`stop`,`prevent`]),[`space`])]},[a(E,null,{default:m(()=>[a(T,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})],40,Ia)):l?.audio_url?(_(),s(`div`,{key:2,class:`play-btn`,role:`button`,tabindex:`0`,"aria-label":f.$t(`common.player.play`),title:f.$t(`common.player.play`),onClick:t(e=>f.onPlay(l),[`stop`]),onKeydown:[c(t(e=>f.onPlay(l),[`stop`,`prevent`]),[`enter`]),c(t(e=>f.onPlay(l),[`stop`,`prevent`]),[`space`])]},[a(E,null,{default:m(()=>[a(D,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})],40,La)):o(``,!0),l?.duration?(_(),s(`div`,Ra,i(f.useFormatDuring(l?.duration)),1)):o(``,!0)])),[[he,!l?.audio_url]]),e(`div`,za,[f.editingAudioId===l.id?(_(),s(`div`,{key:0,class:`title-edit`,onClick:v[2]||=t(()=>{},[`stop`])},[a(O,{ref_for:!0,ref:`titleInput`,modelValue:f.editingTitle,"onUpdate:modelValue":v[1]||=e=>f.editingTitle=e,size:`small`,onKeyup:[c(e=>f.onSaveTitleEdit(l),[`enter`]),c(f.onCancelTitleEdit,[`escape`])],onBlur:e=>f.onSaveTitleEdit(l)},null,8,[`modelValue`,`onKeyup`,`onBlur`])])):(_(),s(`div`,Ba,[e(`h2`,Va,i(l?.title),1),f.shortModel(l)?(_(),s(`span`,Ha,i(f.shortModel(l)),1)):o(``,!0),l?.audio_url?(_(),s(`button`,{key:1,type:`button`,class:`icon-button edit-icon`,"aria-label":f.$t(`common.button.edit`),title:f.$t(`common.button.edit`),onClick:t(e=>f.onStartTitleEdit(l),[`stop`])},[a(k,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Ua)):o(``,!0)])),e(`p`,Wa,i(l?.style),1),!l?.audio_url&&l?.progress!=null&&l?.progress<100?(_(),s(`div`,Ga,[a(A,{percentage:Math.round(l.progress),"stroke-width":4,"show-text":!1,status:`warning`,class:`progress-bar`},null,8,[`percentage`]),e(`span`,Ka,i(f.$t(`suno.name.generating`))+` `+i(Math.round(l.progress))+`%`,1)])):o(``,!0)]),e(`div`,qa,[l?.audio_url?(_(),p(M,{key:0,effect:`dark`,content:f.$t(`suno.button.extend`),placement:`top`},{default:m(()=>[e(`button`,{type:`button`,class:`icon-button icon icon-extend`,"aria-label":f.$t(`suno.button.extend`),title:f.$t(`suno.button.extend`),onClick:t(e=>f.onExtend(e,l),[`stop`])},[a(j,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Ja)]),_:2},1032,[`content`])):o(``,!0),a(L,null,{dropdown:m(()=>[a(I,null,{default:m(()=>[a(F,{disabled:f.isFetchingVideoUrl,onClick:e=>f.handleVideoDownload(l)},{default:m(()=>[e(`div`,Xa,[f.isFetchingVideoUrl?(_(),p(E,{key:0,class:`is-loading mr-2`},{default:m(()=>[a(P,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})):o(``,!0),e(`span`,null,i(f.$t(`suno.button.download_video`)),1)])]),_:1},8,[`disabled`,`onClick`]),l?.audio_url?(_(),p(F,{key:0,onClick:t(e=>f.onDownload(e,l?.audio_url),[`stop`])},{default:m(()=>[r(i(f.$t(`suno.button.download_audio`)),1)]),_:1},8,[`onClick`])):o(``,!0),a(F,{disabled:f.isFetchingWav,onClick:e=>f.handleWavDownload(l)},{default:m(()=>[e(`div`,Za,[f.isFetchingWav?(_(),p(E,{key:0,class:`is-loading mr-2`},{default:m(()=>[a(P,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})):o(``,!0),e(`span`,null,i(f.$t(`suno.button.download_wav`)),1)])]),_:1},8,[`disabled`,`onClick`]),a(F,{disabled:f.isFetchingMidi,onClick:e=>f.handleMidiDownload(l)},{default:m(()=>[e(`div`,Qa,[f.isFetchingMidi?(_(),p(E,{key:0,class:`is-loading mr-2`},{default:m(()=>[a(P,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})):o(``,!0),e(`span`,null,i(f.$t(`suno.button.download_midi`)),1)])]),_:1},8,[`disabled`,`onClick`])]),_:2},1024)]),default:m(()=>[e(`span`,Ya,[a(M,{effect:`dark`,content:f.$t(`suno.button.download`),placement:`top`},{default:m(()=>[l?.audio_url||l?.video_url?(_(),p(N,{key:0,class:`icon icon-download`,size:`1em`,"aria-hidden":`true`,focusable:`false`})):o(``,!0)]),_:2},1032,[`content`])])]),_:2},1024),a(L,null,{dropdown:m(()=>[a(I,{class:`suno-action-menu`},{default:m(()=>[l?.audio_url?(_(),p(F,{key:0,onClick:t(e=>f.onExtend(e,l),[`stop`])},{default:m(()=>[a(j,{class:`menu-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(f.$t(`suno.button.extend`)),1)]),_:1},8,[`onClick`])):o(``,!0),a(F,{onClick:t(e=>f.onCover(l),[`stop`])},{default:m(()=>[a(z,{class:`menu-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(f.$t(`suno.button.cover_music`)),1)]),_:1},8,[`onClick`]),l?.id?(_(),p(F,{key:1,onClick:t(e=>f.onMashup(l),[`stop`])},{default:m(()=>[a(B,{class:`menu-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(f.$t(`suno.button.mashup`)),1)]),_:1},8,[`onClick`])):o(``,!0),l?.id&&l?.action===`extend`?(_(),p(F,{key:2,onClick:t(e=>f.onConcatMusic(l?.id),[`stop`])},{default:m(()=>[a(ee,{class:`menu-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(f.$t(`suno.button.concat_music`)),1)]),_:1},8,[`onClick`])):o(``,!0),v[4]||=e(`div`,{class:`menu-divider`},null,-1),l?.id?(_(),p(F,{key:3,onClick:t(e=>f.onReplaceSection(l),[`stop`])},{default:m(()=>[a(te,{class:`menu-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(f.$t(`suno.button.replace_section`)),1)]),_:1},8,[`onClick`])):o(``,!0),l?.id?(_(),p(F,{key:4,onClick:t(e=>f.onOverpainting(l),[`stop`])},{default:m(()=>[a(ne,{class:`menu-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(f.$t(`suno.button.overpainting`)),1)]),_:1},8,[`onClick`])):o(``,!0),l?.id?(_(),p(F,{key:5,onClick:t(e=>f.onUnderpainting(l),[`stop`])},{default:m(()=>[a(re,{class:`menu-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(f.$t(`suno.button.underpainting`)),1)]),_:1},8,[`onClick`])):o(``,!0),l?.id?(_(),p(F,{key:6,onClick:t(e=>f.onSamples(l),[`stop`])},{default:m(()=>[a(ie,{class:`menu-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(f.$t(`suno.button.samples`)),1)]),_:1},8,[`onClick`])):o(``,!0),v[5]||=e(`div`,{class:`menu-divider`},null,-1),l.id?(_(),p(F,{key:7,onClick:t(e=>f.onGetStems(l.id),[`stop`])},{default:m(()=>[a(ae,{class:`menu-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(f.$t(`suno.button.get_stems`)),1)]),_:1},8,[`onClick`])):o(``,!0),l.id?(_(),p(F,{key:8,onClick:t(e=>f.onGetAllStems(l.id),[`stop`])},{default:m(()=>[a(oe,{class:`menu-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(f.$t(`suno.button.all_stems`)),1)]),_:1},8,[`onClick`])):o(``,!0),l?.id?(_(),p(F,{key:9,onClick:t(e=>f.onRemaster(l.id),[`stop`])},{default:m(()=>[a(se,{class:`menu-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(f.$t(`suno.button.remaster`)),1)]),_:1},8,[`onClick`])):o(``,!0),l?.id?(_(),p(F,{key:10,onClick:t(e=>f.onExtractVocals(l.id),[`stop`])},{default:m(()=>[a(ce,{class:`menu-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(f.$t(`suno.button.extract_vocals`)),1)]),_:1},8,[`onClick`])):o(``,!0),l?.id?(_(),p(F,{key:11,onClick:t(e=>f.onArtistConsistency(l),[`stop`])},{default:m(()=>[a(le,{class:`menu-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(f.$t(`suno.button.artist_consistency`)),1)]),_:1},8,[`onClick`])):o(``,!0),l?.id?(_(),p(F,{key:12,onClick:t(e=>f.onAdjustSpeed(l),[`stop`])},{default:m(()=>[a(V,{class:`menu-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(f.$t(`suno.button.adjust_speed`)),1)]),_:1},8,[`onClick`])):o(``,!0),v[6]||=e(`div`,{class:`menu-divider`},null,-1),a(F,{onClick:t(e=>f.onReusePrompt(l),[`stop`])},{default:m(()=>[a(ue,{class:`menu-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(f.$t(`suno.button.reuse_prompt`)),1)]),_:1},8,[`onClick`]),l?.id?(_(),p(F,{key:13,onClick:t(e=>f.onGetTiming(l.id),[`stop`])},{default:m(()=>[a(de,{class:`menu-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(f.$t(`suno.button.get_timing`)),1)]),_:1},8,[`onClick`])):o(``,!0),f.showViewCode?(_(),p(F,{key:14,onClick:t(f.onViewCode,[`stop`])},{default:m(()=>[a(fe,{class:`menu-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(f.$t(`common.button.viewCode`)),1)]),_:1},8,[`onClick`])):o(``,!0),v[7]||=e(`div`,{class:`menu-divider`},null,-1),l?.id?(_(),p(F,{key:15,class:`delete-item`,onClick:t(e=>f.onDelete(l),[`stop`])},{default:m(()=>[a(pe,{class:`menu-icon delete-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(f.$t(`suno.button.delete`)),1)]),_:1},8,[`onClick`])):o(``,!0)]),_:2},1024)]),default:m(()=>[e(`span`,$a,[a(M,{effect:`dark`,content:f.$t(`suno.button.more`),placement:`top`},{default:m(()=>[l?.audio_url||l?.video_url?(_(),p(R,{key:0,class:`icon icon-ellipsis`,size:`1em`,"aria-hidden":`true`,focusable:`false`})):o(``,!0)]),_:2},1032,[`content`])])]),_:2},1024)])],10,Ma))),128)),a(me,{visible:f.apiCodeVisible,"onUpdate:visible":v[3]||=e=>f.apiCodeVisible=e,method:`POST`,path:f.apiCodePath,body:f.apiCodeBody,token:f.$store.state.suno?.credential?.token||``},null,8,[`visible`,`path`,`body`,`token`])])}var to=y({name:`RecentPanel`,components:{FilterIcon:tt,SearchIcon:Ae,SortIcon:oe,ElSkeletonItem:ne,ElSkeleton:re,ElInput:Q,ElButton:G,ElDropdown:z,ElDropdownMenu:R,ElDropdownItem:L,ElPopover:ee,ElRadioGroup:M,ElRadioButton:j,ElSelect:x,ElOption:S,ElIcon:b,Loading:be,TaskPreview:q(Aa,[[`render`,eo]]),Player:ue,NoTasks:Xe,ScrollList:Ye},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`,`load-all`],data(){return{job:0,searchQuery:``,historyRequested:!1,sortBy:`newest`,filterType:`all`,filterDuration:`all`,filterVideo:`all`,filterModel:`all`}},computed:{tasks(){return{...this.$store.state.suno?.tasks,items:this.$store.state.suno?.tasks?.items?.slice()}},sortLabel(){return this.sortBy===`newest`?this.$t(`suno.sort.newest`):this.$t(`suno.sort.oldest`)},activeFilterCount(){let e=0;return this.filterType!==`all`&&e++,this.filterDuration!==`all`&&e++,this.filterVideo!==`all`&&e++,this.filterModel&&this.filterModel!==`all`&&e++,e},availableModels(){let e=this.tasks?.items||[],t=new Set;for(let n of e){let e=n?.response?.data??[];for(let n of e)n.model&&t.add(n.model)}return Array.from(t).sort()},filteredTasks(){let e=this.tasks?.items||[];if(this.searchQuery){let t=this.searchQuery.toLowerCase();e=e.filter(e=>(e?.response?.data??[]).some(e=>e.title?.toLowerCase().includes(t)||e.style?.toLowerCase().includes(t)||e.prompt?.toLowerCase().includes(t)))}return this.activeFilterCount>0&&(e=e.filter(e=>{let t=e?.request??{},n=e?.response?.data??[];return this.filterType===`vocal`&&t.instrumental===!0||this.filterType===`instrumental`&&t.instrumental!==!0?!1:this.filterDuration!==`all`||this.filterVideo!==`all`||this.filterModel&&this.filterModel!==`all`?n.some(e=>!(this.filterDuration===`short`&&!(typeof e.duration==`number`&&e.duration<60)||this.filterDuration===`medium`&&!(typeof e.duration==`number`&&e.duration>=60&&e.duration<=180)||this.filterDuration===`long`&&!(typeof e.duration==`number`&&e.duration>180)||this.filterVideo===`with`&&!e.video_url||this.filterVideo===`without`&&e.video_url||this.filterModel&&this.filterModel!==`all`&&e.model!==this.filterModel)):!0})),this.sortBy===`oldest`&&(e=[...e].reverse()),e},visibleTracks(){let e=[];for(let t of this.filteredTasks)for(let n of t?.response?.data??[])n?.audio_url&&e.push(n);return e}},watch:{searchQuery(e){e&&this.requestFullHistory()},activeFilterCount(e){e>0&&this.requestFullHistory()}},methods:{requestFullHistory(){this.historyRequested||(this.historyRequested=!0,this.$emit(`load-all`))},onSortChange(e){this.sortBy=e},onResetFilters(){this.filterType=`all`,this.filterDuration=`all`,this.filterVideo=`all`,this.filterModel=`all`},getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),no={key:0,class:`tasks`},ro={class:`left w-[70px] p-[10px] flex items-center`},io={class:`main w-[calc(100%-70px)] flex-1 p-[10px]`},ao={key:0,class:`task-toolbar`},oo={key:0,class:`filter-badge`},so={class:`filter-popover`},co={class:`filter-row`},lo={class:`filter-label`},uo={class:`filter-row`},fo={class:`filter-label`},po={class:`filter-row`},mo={class:`filter-label`},ho={key:0,class:`filter-row`},go={class:`filter-label`},_o={class:`filter-actions`},vo={key:2,class:`w-full flex-1 flex items-center justify-center`},yo={class:`text-sm text-gray-400`},bo={key:3,class:`w-full flex-1 flex flex-col items-center justify-center gap-2`},xo={class:`text-sm text-gray-400`},So={key:4,class:`w-full flex-1 flex items-center justify-center`},Co={key:5,class:`w-full flex-1 flex items-center justify-center`},wo={class:`h-20`};function To(t,c,f,h,y,b){let x=u(`el-skeleton-item`),S=u(`el-skeleton`),C=u(`search-icon`),w=u(`el-input`),T=u(`sort-icon`),E=u(`el-button`),D=u(`el-dropdown-item`),O=u(`el-dropdown-menu`),k=u(`el-dropdown`),A=u(`filter-icon`),j=u(`el-radio-button`),M=u(`el-radio-group`),N=u(`el-option`),P=u(`el-select`),F=u(`el-popover`),I=u(`task-preview`),L=u(`scroll-list`),R=u(`loading`),z=u(`el-icon`),B=u(`no-tasks`),ee=u(`player`);return _(),s(l,null,[t.tasks?.items===void 0?(_(),s(`div`,no,[(_(),s(l,null,g(3,t=>e(`div`,{key:t,class:`flex`},[e(`div`,ro,[a(S,{animated:``},{template:m(()=>[a(x,{variant:`image`,class:`avatar w-[50px] h-[50px]`})]),_:1})]),e(`div`,io,[a(S,{animated:``},{template:m(()=>[a(x,{variant:`p`,class:`w-[200px] h-[15px] mb-[5px] mt-[10px]`}),a(x,{variant:`text`})]),_:1})])])),64))])):(_(),s(l,{key:1},[t.tasks?.items?.length?(_(),s(`div`,ao,[a(w,{modelValue:t.searchQuery,"onUpdate:modelValue":c[0]||=e=>t.searchQuery=e,size:`small`,placeholder:t.$t(`suno.placeholder.searchSongs`),clearable:``,class:`task-search`},{prefix:m(()=>[a(C,{class:`text-xs`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`modelValue`,`placeholder`]),a(k,{trigger:`click`,onCommand:t.onSortChange},{dropdown:m(()=>[a(O,null,{default:m(()=>[a(D,{command:`newest`,class:n({"is-active":t.sortBy===`newest`})},{default:m(()=>[r(i(t.$t(`suno.sort.newest`)),1)]),_:1},8,[`class`]),a(D,{command:`oldest`,class:n({"is-active":t.sortBy===`oldest`})},{default:m(()=>[r(i(t.$t(`suno.sort.oldest`)),1)]),_:1},8,[`class`])]),_:1})]),default:m(()=>[a(E,{size:`small`,round:``,class:`sort-btn`},{default:m(()=>[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.sortLabel),1)]),_:1})]),_:1},8,[`onCommand`]),a(F,{trigger:`click`,placement:`bottom-end`,width:260},{reference:m(()=>[a(E,{size:`small`,round:``,class:n([`filter-btn`,{"has-active-filter":t.activeFilterCount>0}])},{default:m(()=>[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`suno.filter.title`))+` `,1),t.activeFilterCount>0?(_(),s(`span`,oo,i(t.activeFilterCount),1)):o(``,!0)]),_:1},8,[`class`])]),default:m(()=>[e(`div`,so,[e(`div`,co,[e(`div`,lo,i(t.$t(`suno.filter.type`)),1),a(M,{modelValue:t.filterType,"onUpdate:modelValue":c[1]||=e=>t.filterType=e,size:`small`},{default:m(()=>[a(j,{value:`all`},{default:m(()=>[r(i(t.$t(`suno.filter.typeAll`)),1)]),_:1}),a(j,{value:`vocal`},{default:m(()=>[r(i(t.$t(`suno.filter.typeVocal`)),1)]),_:1}),a(j,{value:`instrumental`},{default:m(()=>[r(i(t.$t(`suno.filter.typeInstrumental`)),1)]),_:1})]),_:1},8,[`modelValue`])]),e(`div`,uo,[e(`div`,fo,i(t.$t(`suno.filter.duration`)),1),a(M,{modelValue:t.filterDuration,"onUpdate:modelValue":c[2]||=e=>t.filterDuration=e,size:`small`},{default:m(()=>[a(j,{value:`all`},{default:m(()=>[r(i(t.$t(`suno.filter.durationAll`)),1)]),_:1}),a(j,{value:`short`},{default:m(()=>[r(i(t.$t(`suno.filter.durationShort`)),1)]),_:1}),a(j,{value:`medium`},{default:m(()=>[r(i(t.$t(`suno.filter.durationMedium`)),1)]),_:1}),a(j,{value:`long`},{default:m(()=>[r(i(t.$t(`suno.filter.durationLong`)),1)]),_:1})]),_:1},8,[`modelValue`])]),e(`div`,po,[e(`div`,mo,i(t.$t(`suno.filter.video`)),1),a(M,{modelValue:t.filterVideo,"onUpdate:modelValue":c[3]||=e=>t.filterVideo=e,size:`small`},{default:m(()=>[a(j,{value:`all`},{default:m(()=>[r(i(t.$t(`suno.filter.videoAll`)),1)]),_:1}),a(j,{value:`with`},{default:m(()=>[r(i(t.$t(`suno.filter.videoWith`)),1)]),_:1}),a(j,{value:`without`},{default:m(()=>[r(i(t.$t(`suno.filter.videoWithout`)),1)]),_:1})]),_:1},8,[`modelValue`])]),t.availableModels.length>0?(_(),s(`div`,ho,[e(`div`,go,i(t.$t(`suno.filter.model`)),1),a(P,{modelValue:t.filterModel,"onUpdate:modelValue":c[4]||=e=>t.filterModel=e,size:`small`,placeholder:t.$t(`suno.filter.modelAll`),clearable:``},{default:m(()=>[a(N,{label:t.$t(`suno.filter.modelAll`),value:`all`},null,8,[`label`]),(_(!0),s(l,null,g(t.availableModels,e=>(_(),p(N,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])):o(``,!0),e(`div`,_o,[a(E,{size:`small`,text:``,onClick:t.onResetFilters},{default:m(()=>[r(i(t.$t(`suno.filter.reset`)),1)]),_:1},8,[`onClick`])])])]),_:1})])):o(``,!0),t.filteredTasks?.length>0?(_(),p(L,{key:1,ref:`scrollList`,class:`flex-1 w-full overflow-y-auto tasks p-2`,loading:t.loading,onReachTop:c[5]||=e=>t.$emit(`reach-top`)},{default:m(()=>[(_(!0),s(l,null,g(t.filteredTasks,(e,t)=>(_(),p(I,{key:t,"model-value":e,class:`preview`},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):!t.loading&&t.searchQuery&&t.tasks?.items?.length>0?(_(),s(`div`,vo,[e(`p`,yo,i(t.$t(`suno.message.noSearchResults`)),1)])):!t.loading&&t.activeFilterCount>0&&t.tasks?.items?.length>0?(_(),s(`div`,bo,[e(`p`,xo,i(t.$t(`suno.message.noFilterResults`)),1),a(E,{size:`small`,text:``,onClick:t.onResetFilters},{default:m(()=>[r(i(t.$t(`suno.filter.reset`)),1)]),_:1},8,[`onClick`])])):t.loading?(_(),s(`div`,So,[a(z,{class:`is-loading text-xl text-gray-400`},{default:m(()=>[a(R,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})])):t.tasks?.items?.length===0?(_(),s(`div`,Co,[a(B)])):o(``,!0)],64)),d(e(`div`,wo,[a(ee,{namespace:`suno`,tracks:t.visibleTracks},null,8,[`tracks`])],512),[[v,!!t.$store?.state?.suno?.audio?.object]])],64)}var Eo=q(to,[[`render`,To],[`__scopeId`,`data-v-06fc829c`]]),Do=y({name:`TaskPreview`,components:{IconPicture:ve,Headset:_e,ElImage:Z,ElAvatar:k,ElIcon:b},computed:{audio(){return this.$store.state.suno?.audio}}}),Oo={key:0,class:`size-full overflow-hidden`},ko={class:`relative h-[300px]`},Ao={class:`flex items-center justify-center size-full bg-[var(--el-bg-color)]`},jo={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`},Mo={class:`p-4`},No={class:`flex items-center font-bold mb-2`},Po={class:`text-[var(--el-text-color-regular)] mb-2`},Fo={class:`text-xs text-[var(--el-text-color-regular)]`},Io={class:`mt-4 text-sm leading-[25px] whitespace-pre-wrap`},Lo={key:1,class:`flex flex-col items-center justify-center w-full h-full text-[var(--el-text-color-placeholder)]`};function Ro(t,n,r,o,c,l){let d=u(`icon-picture`),f=u(`el-icon`),p=u(`el-image`),h=u(`el-avatar`),g=u(`headset`);return t.audio?.object?(_(),s(`div`,Oo,[e(`div`,ko,[a(p,{src:t.audio.image_url,fit:`cover`,class:`size-full`},{error:m(()=>[e(`div`,Ao,[a(f,{class:`text-3xl`},{default:m(()=>[a(d,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})])]),_:1},8,[`src`]),e(`h2`,jo,i(t.audio?.title),1)]),e(`div`,Mo,[e(`div`,No,[a(h,{size:30,src:t.audio?.image_url,class:`mr-2`},null,8,[`src`]),e(`span`,null,i(t.audio?.title),1)]),e(`p`,Po,i(t.audio?.style),1),e(`p`,Fo,i(t.$dayjs.format(t.audio?.created_at)),1),e(`div`,Io,[e(`p`,null,i(t.audio?.lyric),1)])])])):(_(),s(`div`,Lo,[a(f,{class:`text-5xl opacity-40`},{default:m(()=>[a(g,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})]))}var zo=y({name:`SunoIndex`,components:{Layout:ft,ConfigPanel:Oa,RecentPanel:Eo,PreviewPanel:q(Do,[[`render`,Ro]])},mixins:[Re],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,loadingAll:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.suno?.status?.getApplications===J.Request},tasksLoading(){return this.$store.state.suno?.status?.getTasks===J.Request||this.fetchingTasks},service(){return this.$store.state.suno.service},credential(){return this.$store.state.suno.credential},config(){return this.$store.state.suno.config},initializing(){return this.$store.state.suno.status.getApplications===J.Request},needApply(){return this.$store.state.suno.status.getApplications===J.Success&&!this.application},application(){return this.$store.state.suno.application},tasks(){return this.$store.state.suno.tasks},applications(){return this.$store.state.suno.applications}},watch:{tasks:{handler(e,t){e?.items?.length,t?.items?.length},deep:!0},initialized:{async handler(e){e&&(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 Ze({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 onLoadAll(){if(!this.loadingAll){this.loadingAll=!0;try{for(let e=0;e<100;e++){for(let e=0;(this.fetchingTasks||this.applicationsLoading)&&e<50;e++)await new Promise(e=>setTimeout(e,100));let e=this.tasks?.items??[],t=this.tasks?.total;if(t!==void 0&&e.length>=t)break;let n=e[0];if(!n?.created_at)break;let r=e.length;if(await this.onGetTasks({createdAtMax:n.created_at}),(this.tasks?.items?.length??0)<=r)break}}finally{this.loadingAll=!1}}},async onGetService(){await this.$store.dispatch(`suno/getService`)},async onGetApplication(){await this.$store.dispatch(`suno/getApplications`),await this.onGetTasks()},onApply(){We.create({application:this.application}).then(({data:e})=>{this.application=e,Y.success(this.$t(`application.message.applySuccessfully`))}).catch(e=>{e?.response?.data?.code===`duplication`&&Y.error(this.$t(`application.message.alreadyApplied`))})},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch(`suno/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerateAudio(){if(!Ke(this.uploadTracker,e=>this.$t(e),e=>Y.warning(e)))return;let e={...this.config,async:!0};if(!this.hasSunoInput(e)){Y.error(this.$t(`suno.message.promptRequired`));return}if(this.hasText(e.prompt)&&(e.prompt=e.prompt.trim()),!Ie())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}Y.info(this.$t(`suno.message.startingTask`)),Ve(`suno`,K.audio(e,{token:t})).then(()=>{Y.success(this.$t(`suno.message.startTaskSuccess`))}).catch(e=>{Y.error(e?.response?.data?.error?.message||this.$t(`suno.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},hasText(e){return typeof e==`string`&&e.trim().length>0},hasSunoInput(e){return[e.prompt,e.lyric,e.lyric_prompt,e.style,e.title].some(e=>this.hasText(e))||this.hasText(e.audio_id)||Array.isArray(e.mashup_audio_ids)&&e.mashup_audio_ids.length>0}}});function Bo(e,t,n,r,i,o){let s=u(`config-panel`),c=u(`recent-panel`),l=u(`preview-panel`),d=u(`layout`);return _(),p(d,null,{config:m(()=>[a(s,{onGenerate:e.onGenerateAudio},null,8,[`onGenerate`])]),result:m(()=>[a(c,{ref:`recentPanel`,class:`panel recent`,loading:e.loadingMore||e.loadingAll,onReachTop:e.onReachTop,onLoadAll:e.onLoadAll},null,8,[`loading`,`onReachTop`,`onLoadAll`])]),preview:m(()=>[a(l)]),_:1})}var Vo=q(zo,[[`render`,Bo],[`__scopeId`,`data-v-237ce3b7`]]);export{Vo as default};