@acedatacloud/nexior 3.380.4 → 3.380.5

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 (319) hide show
  1. package/dist/assets/{ApiCodeButton-DSt2Pz0O.js → ApiCodeButton-DBR9tGBM.js} +1 -1
  2. package/dist/assets/{ApiCodeDialog-Byr4CPCS.js → ApiCodeDialog-CCg8lOq_.js} +2 -2
  3. package/dist/assets/{Artifacts-CwC_U4xA.js → Artifacts-w1CZhaPc.js} +1 -1
  4. package/dist/assets/{AskUserQuestionCard-D9fOfq80.js → AskUserQuestionCard-3OJbU7hp.js} +1 -1
  5. package/dist/assets/{AudioPreview-DbtJFAs7.js → AudioPreview-d8-NMxq_.js} +1 -1
  6. package/dist/assets/{Auth-b-NGU3Lu.js → Auth-CUD5XHGs.js} +1 -1
  7. package/dist/assets/{Bare-D0G3hFJE.js → Bare-DnWOFNQY.js} +1 -1
  8. package/dist/assets/{BotPlaceholder-BC8u-j84.js → BotPlaceholder-Cl_V5koZ.js} +1 -1
  9. package/dist/assets/{BottomFooter-CXPg4oia.js → BottomFooter-BY9m2ruR.js} +1 -1
  10. package/dist/assets/{BrowseConnectors-DS5nGp3i.js → BrowseConnectors-DAclKO9A.js} +1 -1
  11. package/dist/assets/{BrowserPairingDialog-NeyovLD-.js → BrowserPairingDialog-D_qGaX9S.js} +1 -1
  12. package/dist/assets/{Callback-DuZ9zjkR.js → Callback--vWw7wDq.js} +1 -1
  13. package/dist/assets/{CodeSnippet-Djz4eOTz.js → CodeSnippet-B4XBcVVB.js} +1 -1
  14. package/dist/assets/{Console-DcLA9Qt3.js → Console-BEN2f_7n.js} +1 -1
  15. package/dist/assets/{Conversation-O_Xv-6R6.js → Conversation-Bu85cN-Z.js} +1 -1
  16. package/dist/assets/{Conversation-BQ7kjoFg.js → Conversation-CvvQaGbk.js} +2 -2
  17. package/dist/assets/{CopyToClipboard-CQT78wob.js → CopyToClipboard-Dc_53C_9.js} +1 -1
  18. package/dist/assets/{Detail-BqVKPO9C.js → Detail-CP8XjrwP.js} +1 -1
  19. package/dist/assets/Extra-BzOxBC3f.js +1 -0
  20. package/dist/assets/{FilePreview-D640d7Cq.js → FilePreview-C0VlAjUT.js} +1 -1
  21. package/dist/assets/{Hailuo-ClYsc7Vc.js → Hailuo-CBlo8oMQ.js} +1 -1
  22. package/dist/assets/{History-DeAIxtE9.js → History-C_9oHSvo.js} +1 -1
  23. package/dist/assets/{ImagePreview-YXx0To-U.js → ImagePreview-QrO7VB3T.js} +1 -1
  24. package/dist/assets/{ImageWrapper-DH6OlBWC.js → ImageWrapper-D2sKN22b.js} +1 -1
  25. package/dist/assets/{Index-eY2m4uYt.js → Index--pdY-HXU.js} +1 -1
  26. package/dist/assets/Index-5JQ5PAph.js +2 -0
  27. package/dist/assets/{Index-VvE544ki.js → Index-B3zcmDVO.js} +1 -1
  28. package/dist/assets/{Index-CYJ4Mi3M.js → Index-BHxIkZ-a.js} +1 -1
  29. package/dist/assets/Index-Bp91Z4Nq.js +1 -0
  30. package/dist/assets/Index-Bv94reqL.js +1 -0
  31. package/dist/assets/Index-Bz5IEnOW.js +1 -0
  32. package/dist/assets/{Index-CjPN5GZr.js → Index-C5Mesekg.js} +1 -1
  33. package/dist/assets/Index-CCBr-lgF.js +1 -0
  34. package/dist/assets/{Index-DeE_gyAr.js → Index-CVKxg1nH.js} +1 -1
  35. package/dist/assets/{Index-GUuys43B.js → Index-ChES2Pak.js} +1 -1
  36. package/dist/assets/{Index-Cc2vUCVA.js → Index-Chl9pDC8.js} +1 -1
  37. package/dist/assets/{Index-Cuw-pJ0I.js → Index-Cm_sNblt.js} +1 -1
  38. package/dist/assets/{Index-BDNNQGYY.js → Index-Cqd_YqFI.js} +1 -1
  39. package/dist/assets/Index-CvMSByPg.js +1 -0
  40. package/dist/assets/{Index-B80CvBO0.js → Index-D9b419t3.js} +1 -1
  41. package/dist/assets/{Index-BHOeQ3H9.js → Index-DKmuO9HJ.js} +2 -2
  42. package/dist/assets/{Index-Chg7-uHY.js → Index-DTwqo9lt.js} +1 -1
  43. package/dist/assets/{Index-uBZSGiEh.js → Index-DVQTbl6Q.js} +1 -1
  44. package/dist/assets/{Index-DqwY22ln.js → Index-DWJoWMqg.js} +2 -2
  45. package/dist/assets/Index-DXJ-mdMu.js +1 -0
  46. package/dist/assets/{Index-DjMjXRYa.js → Index-DfFP79Ub.js} +1 -1
  47. package/dist/assets/{Index-De1b43q9.js → Index-DoKFeY1d.js} +1 -1
  48. package/dist/assets/Index-DrL4Kua7.js +1 -0
  49. package/dist/assets/{Index-CnknPEOW2.js → Index-DuKDKmH8.js} +1 -1
  50. package/dist/assets/Index-Dxg0HWdd.js +1 -0
  51. package/dist/assets/Index-DyowxMKL.js +1 -0
  52. package/dist/assets/Index-DzlQ8472.js +1 -0
  53. package/dist/assets/{Index-DK07tGm1.js → Index-EgwMAM87.js} +1 -1
  54. package/dist/assets/Index-HdBDAK282.js +1 -0
  55. package/dist/assets/{Index-7Lx1-FVY.js → Index-IOEjcrMN.js} +2 -2
  56. package/dist/assets/{Index-Bp-GjqgR.js → Index-TVvykHny.js} +1 -1
  57. package/dist/assets/Index-UHcGq0ot.css +1 -0
  58. package/dist/assets/{Index-uAG9GoTD.js → Index-jL6GyAo52.js} +1 -1
  59. package/dist/assets/Index-pygkRSdJ2.js +1 -0
  60. package/dist/assets/Index-t7wi6x-C.js +1 -0
  61. package/dist/assets/{Index-D0f6VCCu.js → Index-xPB2P_un.js} +1 -1
  62. package/dist/assets/{Invitees-DJE7UMCL.js → Invitees-CqoC6ZzI.js} +1 -1
  63. package/dist/assets/{List-B8wHqSvA.js → List-BKQsGfFn.js} +1 -1
  64. package/dist/assets/{List-DlT9iEAG.js → List-CJ0oDC8J.js} +1 -1
  65. package/dist/assets/{List-MtsKWkKG.js → List-Ca7YduxB.js} +1 -1
  66. package/dist/assets/{LocalTools-DlPjqmJb.js → LocalTools-Dj5qgU4Q.js} +1 -1
  67. package/dist/assets/LocalTools-Dk26D2gM.js +5 -0
  68. package/dist/assets/{Logo-BRsMoZUf.js → Logo-0tn3ckQt.js} +1 -1
  69. package/dist/assets/{Main-DkcDWNRf.js → Main-DZdJRNsj.js} +1 -1
  70. package/dist/assets/{Message-TyAQUCUU.js → Message-Dhxbifix.js} +2 -2
  71. package/dist/assets/{Model-DZqCeCtl.js → Model-BCLqf6xD.js} +1 -1
  72. package/dist/assets/{Navigator-DJR1Vv92.js → Navigator-D0to3R2l.js} +5 -5
  73. package/dist/assets/{NotFound-DCPalElg.js → NotFound-C1_UBaSi.js} +1 -1
  74. package/dist/assets/{PageHeader-DF-zuRdB.js → PageHeader-v-5kKXbh.js} +1 -1
  75. package/dist/assets/Pay-7EzYllB7.js +1 -0
  76. package/dist/assets/{Player-BofEgCOB.js → Player-DMEqEzbG.js} +1 -1
  77. package/dist/assets/{Poivelle-nb8MW5Qx.js → Poivelle-BPMERqNg.js} +1 -1
  78. package/dist/assets/{RealtimeCall-C9IB8DsU.js → RealtimeCall-YJoGDtET.js} +3 -3
  79. package/dist/assets/{ReportButton-B6G5OWJ0.js → ReportButton-BCWM_eUv.js} +1 -1
  80. package/dist/assets/{ReportDialog-C8ssbL5B.js → ReportDialog-C4nnqvVc.js} +1 -1
  81. package/dist/assets/{ScenarioPaymentMode-DRMdqOm9.js → ScenarioPaymentMode-DUv_xCgb.js} +1 -1
  82. package/dist/assets/{ScheduledTasks-BjZ3cZyb.js → ScheduledTasks-CGWohgpS.js} +2 -2
  83. package/dist/assets/{ServicePricingSummary-rLPlqY7R.js → ServicePricingSummary-BnnhtPm5.js} +1 -1
  84. package/dist/assets/{SharedMarkdown-BmNuEnIj.js → SharedMarkdown-DtzDZm3k.js} +1 -1
  85. package/dist/assets/{ShowcaseGrid-DOcNBb0W.js → ShowcaseGrid-CFbY09WG.js} +1 -1
  86. package/dist/assets/{ShowcaseResultTabs-CS9fv2h_.js → ShowcaseResultTabs-DoS1AGxi.js} +1 -1
  87. package/dist/assets/{SolanaWalletPickerDialog-zxd6nO8P.js → SolanaWalletPickerDialog-SPhdpzG5.js} +1 -1
  88. package/dist/assets/{Status-Pg6vKJcY.js → Status-D3X4rgdx.js} +1 -1
  89. package/dist/assets/{Subscribe-C5hDRcCw.js → Subscribe-CRjgaqCu.js} +1 -1
  90. package/dist/assets/{TabSwitcher-VfoHJIjb.js → TabSwitcher-DCp_o3dC.js} +1 -1
  91. package/dist/assets/{Tts-BaBl3ymq.js → Tts-BHWJBKlm.js} +1 -1
  92. package/dist/assets/{VideoPlayer-DuUSbT-p.js → VideoPlayer-Bt19ZgtM.js} +1 -1
  93. package/dist/assets/{VideoPreview-DiHzfmhx.js → VideoPreview-DbXtGsVJ.js} +1 -1
  94. package/dist/assets/{VueMarkdown-DX3n2_s6.js → VueMarkdown-xfBKJ0cL.js} +2 -2
  95. package/dist/assets/WriteSkillDialog-DEZTP_2V.js +1 -0
  96. package/dist/assets/{airwallexCheckout-DImF7qWM.js → airwallexCheckout-DG7dh0JD.js} +1 -1
  97. package/dist/assets/arrow-down-CCk6Sb03.js +1 -0
  98. package/dist/assets/arrow-left-CfzVpd8i.js +1 -0
  99. package/dist/assets/arrow-right-Dst44w5B.js +1 -0
  100. package/dist/assets/arrow-up-CvyTr6CH.js +1 -0
  101. package/dist/assets/{authorizeFlow-iv3I40NA.js → authorizeFlow-DJrWFBbA.js} +1 -1
  102. package/dist/assets/{avatar-Bk-KlfGF.js → avatar-C0t81PgD.js} +1 -1
  103. package/dist/assets/{back-navigation-DCnyH9QK.js → back-navigation-DsXpwk5c.js} +1 -1
  104. package/dist/assets/{basic-DhRe680f.js → basic-BtHDhrf8.js} +1 -1
  105. package/dist/assets/{book-open-EQsOnwpQ.js → book-open-VVs1gk2C.js} +1 -1
  106. package/dist/assets/{box-Eq7xsVMG.js → box-Bx0ypDsn.js} +1 -1
  107. package/dist/assets/{boxes-_p2gozxH.js → boxes-8WJI87Gu.js} +1 -1
  108. package/dist/assets/{brain-B3HPVkyt.js → brain-DYAdLxct.js} +1 -1
  109. package/dist/assets/{chart-no-axes-combined-wCOmZXlo.js → chart-no-axes-combined-Cc3WlsU6.js} +1 -1
  110. package/dist/assets/{chat-DlJM5HiQ.js → chat-Ci-R1f2k.js} +1 -1
  111. package/dist/assets/check-Bfb3v7Zr.js +1 -0
  112. package/dist/assets/chevron-down-BqX4KeBM.js +1 -0
  113. package/dist/assets/chevron-right-1mOXqXoj.js +1 -0
  114. package/dist/assets/{circle-alert-CudS64vb.js → circle-alert-DF1kIskJ.js} +1 -1
  115. package/dist/assets/circle-check-C6ll6g09.js +1 -0
  116. package/dist/assets/{circle-question-mark-CT3dP_S-.js → circle-question-mark-CNP_CdTe.js} +1 -1
  117. package/dist/assets/{clipboard-list-rh0gR3f-.js → clipboard-list-BhkjCno-.js} +1 -1
  118. package/dist/assets/clock-B6Xmh354.js +1 -0
  119. package/dist/assets/code-7YWrTdfy.js +1 -0
  120. package/dist/assets/codingBridge-CS16iqlt.js +2 -0
  121. package/dist/assets/{codingBridgeNotify-C68uE2gS.js → codingBridgeNotify-DQXmYQHs.js} +2 -2
  122. package/dist/assets/{coins-8GLEA8kx.js → coins-CVrCGMHa.js} +1 -1
  123. package/dist/assets/{collapse-Dwaru9dv.js → collapse-qfbCrPJN.js} +1 -1
  124. package/dist/assets/{constants-GmVIn7tC.js → constants-CVb0vrXj.js} +1 -1
  125. package/dist/assets/{copy-BIXUZXhN.js → copy-CP8f_ETR.js} +1 -1
  126. package/dist/assets/{createTaskActions-Bz2OI0ye.js → createTaskActions-DLJLKN-c.js} +1 -1
  127. package/dist/assets/{date-picker-qwrQLSa0.js → date-picker-BIwU4ojz.js} +1 -1
  128. package/dist/assets/{digitalhuman-EWWLamU7.js → digitalhuman-CfG_2-Wv.js} +1 -1
  129. package/dist/assets/{dollar-sign-3CctSein.js → dollar-sign-CFH1O621.js} +1 -1
  130. package/dist/assets/{download-0mLTP8WQ.js → download-aKoGQMz4.js} +1 -1
  131. package/dist/assets/{drawer-APcI0MuL.js → drawer-CF4BsAtW.js} +1 -1
  132. package/dist/assets/{dropdown-C1V-gXTG.js → dropdown-CLk44aHS.js} +1 -1
  133. package/dist/assets/{dropdown-BZ5uH0eb.js → dropdown-DzQEZ4Jy.js} +1 -1
  134. package/dist/assets/{ellipsis-DaK_tv_8.js → ellipsis-AczbhGQu.js} +1 -1
  135. package/dist/assets/{esm-CwuiP5gS.js → esm-Bq7l9xVL.js} +2 -2
  136. package/dist/assets/esm-Dc2aYU0J.js +1 -0
  137. package/dist/assets/{esm-DDwto2T_.js → esm-rGuxajaG.js} +2 -2
  138. package/dist/assets/{external-link-GS6joyO2.js → external-link-B5spIiHU.js} +1 -1
  139. package/dist/assets/{eye-BjqPsB38.js → eye-DOsuMFw9.js} +1 -1
  140. package/dist/assets/{file-DN0Fq1Cv.js → file-D5T6JpWA.js} +1 -1
  141. package/dist/assets/{file-output-CYRVDW3O.js → file-output-CAMglfrn.js} +1 -1
  142. package/dist/assets/{file-text-DLwLkvbZ.js → file-text-MxE-jd8A.js} +1 -1
  143. package/dist/assets/{fish-CuUidYqW.js → fish-mS1PJ3fj.js} +1 -1
  144. package/dist/assets/{flux-CkT5DOwc.js → flux-FQoAagDW.js} +1 -1
  145. package/dist/assets/{folder-DGjP5SDg.js → folder-Cbda4XN8.js} +1 -1
  146. package/dist/assets/gauge-DwHZCDNp.js +1 -0
  147. package/dist/assets/{generationInput--J_4Niw5.js → generationInput-jeoGp56s.js} +1 -1
  148. package/dist/assets/{globe-CfmQv6dc.js → globe-DZXgzAlm.js} +1 -1
  149. package/dist/assets/grokvideo-DISRpIM_.js +1 -0
  150. package/dist/assets/{luma-BnxSbH2s.js → hailuo-ZSUIO9UD.js} +1 -1
  151. package/dist/assets/{hash-GTQkcsQj.js → hash-BKpZIJo7.js} +1 -1
  152. package/dist/assets/{headphones-B8VUrUji.js → headphones--YKlJldO.js} +1 -1
  153. package/dist/assets/{history-BENBo59s.js → history-BYzfzIXf.js} +1 -1
  154. package/dist/assets/{house-WEmC14W_.js → house-DbXM7bV4.js} +1 -1
  155. package/dist/assets/{image-BEbYTJ0m.js → image-Dsh8h-Vr.js} +1 -1
  156. package/dist/assets/{imageRequests-BaQ60xKB.js → imageRequests-YA3-SUkx.js} +1 -1
  157. package/dist/assets/index-C643U2rX.js +572 -0
  158. package/dist/assets/{index.es-BADyL8Or.js → index.es-BS_qwYo-.js} +1 -1
  159. package/dist/assets/{info-PmX6OJ8X.js → info-CDs2D83H.js} +1 -1
  160. package/dist/assets/{input-number-CQyq1gfs.js → input-number-YpK_vIUu.js} +1 -1
  161. package/dist/assets/{kling-CSMDk42y.js → kling-BkuDhdIc.js} +1 -1
  162. package/dist/assets/{languages-D0-qojfd.js → languages-DFfBKj3V.js} +1 -1
  163. package/dist/assets/{laptop-CiCND6PE.js → laptop-DapobfQv.js} +1 -1
  164. package/dist/assets/{lightbulb-rCoLSMOl.js → lightbulb-D_g0yrw8.js} +1 -1
  165. package/dist/assets/{link-DfdSHXXz.js → link-DTTCfbSO.js} +1 -1
  166. package/dist/assets/loader-circle-BQqfluno.js +1 -0
  167. package/dist/assets/{qrart-PjwpBvHh.js → luma-C9imEL86.js} +1 -1
  168. package/dist/assets/maestro-BBLbhcdk.js +1 -0
  169. package/dist/assets/maestro-B_gsOOuc.js +1 -0
  170. package/dist/assets/maestro-BbjtdNWq.js +1 -0
  171. package/dist/assets/maestro-CI7kJGPZ.js +1 -0
  172. package/dist/assets/maestro-Cq-lw4mZ.js +1 -0
  173. package/dist/assets/maestro-CvrCSepF.js +1 -0
  174. package/dist/assets/maestro-DFNYslYD.js +1 -0
  175. package/dist/assets/maestro-DIk5m-7L.js +1 -0
  176. package/dist/assets/maestro-DuZPhVj-.js +1 -0
  177. package/dist/assets/maestro-Oxjr8OPC.js +1 -0
  178. package/dist/assets/maestro-VcPlmsOj.js +1 -0
  179. package/dist/assets/maestro-bsK4BW5L.js +1 -0
  180. package/dist/assets/maestro-h29lA6bR.js +1 -0
  181. package/dist/assets/{mail-LZDXgeS8.js → mail-C0_EFTNr.js} +1 -1
  182. package/dist/assets/{message-circle-VRo45xNQ.js → message-circle-DJ38XN8t.js} +1 -1
  183. package/dist/assets/{mic-x3pAaagI.js → mic-BYjF4A_x.js} +1 -1
  184. package/dist/assets/{midjourney-DiDJ_NAX.js → midjourney-DGnkUMtd.js} +1 -1
  185. package/dist/assets/{minimax-CezIM2Vc.js → minimax-ClPDICZU.js} +1 -1
  186. package/dist/assets/{mobileLocalExec-Ba06Ginw.js → mobileLocalExec-B_RtWm83.js} +2 -2
  187. package/dist/assets/{monitor-f-HdAnII.js → monitor-GBsAGWb5.js} +1 -1
  188. package/dist/assets/{mouse-pointer-2-D28_tEOD.js → mouse-pointer-2--BMykM3C.js} +1 -1
  189. package/dist/assets/music-2-DsnQPTru.js +1 -0
  190. package/dist/assets/{nanobanana-C47zn35Q.js → nanobanana-B80mlHG9.js} +1 -1
  191. package/dist/assets/{omni-BRhJ9p2L.js → omni-B15iT3Sl.js} +1 -1
  192. package/dist/assets/{openaiimage-DN5cekWI.js → openaiimage-DAuOj_l2.js} +1 -1
  193. package/dist/assets/{pagination-W-HQ78h5.js → pagination-BGnYVZvp.js} +1 -1
  194. package/dist/assets/{pagination-RVZs5Fps.js → pagination-BsPBo2WI.js} +1 -1
  195. package/dist/assets/{pagination-CkelWLyU.js → pagination-DqPdKWtk.js} +1 -1
  196. package/dist/assets/{palette-Bnao4N1E.js → palette-CSWZ3lMh.js} +1 -1
  197. package/dist/assets/{paperclip-BIrljPlV.js → paperclip-Ed5mDPx6.js} +1 -1
  198. package/dist/assets/{pause-B1oVLxPW.js → pause-BClTBQOr.js} +1 -1
  199. package/dist/assets/{pencil-tfoCLZ10.js → pencil-hdf5uaAO.js} +1 -1
  200. package/dist/assets/{pika-oMB8We5G.js → pika-Cx5cYUmj.js} +1 -1
  201. package/dist/assets/{pixverse-CrjkStpM.js → pixverse-WYyCcVn-.js} +1 -1
  202. package/dist/assets/play-BZy52WBc.js +1 -0
  203. package/dist/assets/{plug-CneJpKAI.js → plug-BrR77_0k.js} +1 -1
  204. package/dist/assets/plus-Cv4THF6Q.js +1 -0
  205. package/dist/assets/{poivelle-aDT78zU0.js → poivelle-B-fGy-mp.js} +1 -1
  206. package/dist/assets/{popover-CdWXDZ4Y.js → popover-DnGAvUIE.js} +1 -1
  207. package/dist/assets/{producer-Cmo7xf9M.js → producer-DKQI0Cq6.js} +1 -1
  208. package/dist/assets/{veo-BooE6Coe.js → qrart-BypAVHHT.js} +1 -1
  209. package/dist/assets/{qwenimage-DiCadgpU.js → qwenimage-Z73dnVux.js} +1 -1
  210. package/dist/assets/{realtime-cKmm03Gk.js → realtime-i4smTIH8.js} +1 -1
  211. package/dist/assets/{refresh-cw-Bx7-OW-L.js → refresh-cw-Dnm3KhKi.js} +1 -1
  212. package/dist/assets/rotate-ccw-CKzZLPvG.js +1 -0
  213. package/dist/assets/rotate-cw-CEoa6Gbp.js +1 -0
  214. package/dist/assets/{row-DNp_zRGz.js → row-BTg1B7Rq.js} +1 -1
  215. package/dist/assets/{scheduledTasks-DfyCRMUo.js → scheduledTasks-BKFHEZEq.js} +1 -1
  216. package/dist/assets/{scroll-text-BznQ-upq.js → scroll-text-11dAwBrb.js} +1 -1
  217. package/dist/assets/search-BWxJsKnb.js +1 -0
  218. package/dist/assets/{seedance-B5iHVffg.js → seedance-C7VjAFhT.js} +1 -1
  219. package/dist/assets/{seedream-BUCCanJU.js → seedream-BNeM6wGx.js} +1 -1
  220. package/dist/assets/{select-GALwUZll.js → select-Dxkn5fnG.js} +1 -1
  221. package/dist/assets/{serp-ByhpOEFk.js → serp-CxGGkmaS.js} +1 -1
  222. package/dist/assets/{shield-zOrEMlZR.js → shield-DgibaIqT.js} +1 -1
  223. package/dist/assets/{showcase-ClAsok_u.js → showcase-C7ITFcZN.js} +1 -1
  224. package/dist/assets/{showcaseRecreateMixin-Dhdr3T0y.js → showcaseRecreateMixin-BvSTHecE.js} +1 -1
  225. package/dist/assets/{shuffle-Bsn1YQVr.js → shuffle-BylmN-er.js} +1 -1
  226. package/dist/assets/{siteHome-DOZxDTUA.js → siteHome-Cryc_q93.js} +1 -1
  227. package/dist/assets/{slider-C8pY6U4o.js → slider-DyGvOBhi.js} +1 -1
  228. package/dist/assets/{solana-wallets-Cib8AJ2S.js → solana-wallets--z2A3Apa.js} +2 -2
  229. package/dist/assets/{sora-8X-omnaE.js → sora-D29KqrzE.js} +1 -1
  230. package/dist/assets/{sparkles-C1bLa319.js → sparkles-x66jEqTw.js} +1 -1
  231. package/dist/assets/square-84JHxm2_.js +1 -0
  232. package/dist/assets/{suno-DoUkooAP.js → suno-BtOeCZcQ.js} +1 -1
  233. package/dist/assets/{switch-4nC3Yz4b.js → switch-FNAnbKSR.js} +1 -1
  234. package/dist/assets/{table-CHg1iLS7.js → table-DcbbzgnI.js} +1 -1
  235. package/dist/assets/{tabs-8Um-YKWZ.js → tabs-0J-7r8zS.js} +1 -1
  236. package/dist/assets/{tag-ILhm5hh0.js → tag-DmliP9Ok.js} +1 -1
  237. package/dist/assets/{taskPolling-DfRWd0Q5.js → taskPolling-Bi1lm4L2.js} +1 -1
  238. package/dist/assets/terminal-fLAKhYLu.js +1 -0
  239. package/dist/assets/{time-picker-DqmuplAb.js → time-picker-DXRHL55A.js} +1 -1
  240. package/dist/assets/{tooltip-4w7ghPQM.js → tooltip-CsVgfK1f.js} +1 -1
  241. package/dist/assets/{trash-2-BkEkcSHv.js → trash-2-rtHpr3JN.js} +1 -1
  242. package/dist/assets/{triangle-alert-DBmpuUlm.js → triangle-alert-D_wd4w3Z.js} +1 -1
  243. package/dist/assets/{upload-Sju4DbiY.js → upload-ChEGBjQd.js} +1 -1
  244. package/dist/assets/{upload-DidTvyIg.js → upload-DoPPJ2yy.js} +1 -1
  245. package/dist/assets/user-bjnB3b4c.js +1 -0
  246. package/dist/assets/{hailuo-DaQVZPNi.js → veo-BueyYArF.js} +1 -1
  247. package/dist/assets/{video-DwVV0C_d.js → video-C2QohmLe.js} +1 -1
  248. package/dist/assets/{volume-2-CpkYjlNM.js → volume-2-BoZZadxh.js} +1 -1
  249. package/dist/assets/{vuex.esm-bundler-BV9tXD4i.js → vuex.esm-bundler-uM-kqbAF.js} +1 -1
  250. package/dist/assets/{wallet-CSEdeUVb.js → wallet-BtENm1mj.js} +1 -1
  251. package/dist/assets/{wan-NceqaOX8.js → wan-BxExpn0G.js} +1 -1
  252. package/dist/assets/{wand-sparkles-CwgjO5Gl.js → wand-sparkles-CReI7Ekg.js} +1 -1
  253. package/dist/assets/{web-ChTQtMOV.js → web-B_mNetg-.js} +1 -1
  254. package/dist/assets/{web-DR1td9xt.js → web-CwqQtLOY.js} +1 -1
  255. package/dist/assets/{web-CtwYyIHk.js → web-DHf2pHB5.js} +1 -1
  256. package/dist/assets/{web-DYYogIAJ.js → web-DSR3VOq9.js} +1 -1
  257. package/dist/assets/{web-Be7eYSTS.js → web-I_RIjvbu.js} +1 -1
  258. package/dist/assets/{webextrator-DcBVygf6.js → webextrator-eme27gPN.js} +1 -1
  259. package/dist/assets/{zap-5TJ16_7J.js → zap-BVQJGqe4.js} +1 -1
  260. package/dist/index.html +3 -3
  261. package/package.json +1 -1
  262. package/dist/assets/Extra-RTJPBXX1.js +0 -1
  263. package/dist/assets/Index-3enMEt0q.js +0 -1
  264. package/dist/assets/Index-4M6goWY5.js +0 -1
  265. package/dist/assets/Index-B0S_YnIQ.js +0 -1
  266. package/dist/assets/Index-B2mD07Ei.js +0 -1
  267. package/dist/assets/Index-BRky2LVx.js +0 -1
  268. package/dist/assets/Index-BjS0ggii.js +0 -2
  269. package/dist/assets/Index-Bm_JpxRb.css +0 -1
  270. package/dist/assets/Index-CyKGM7MD.js +0 -1
  271. package/dist/assets/Index-DTFPAlsp.js +0 -1
  272. package/dist/assets/Index-Dx52UhVA.js +0 -1
  273. package/dist/assets/Index-Mw1xrmbA.js +0 -1
  274. package/dist/assets/Index-NwESkz1G.js +0 -1
  275. package/dist/assets/Index-eXdcllSH.js +0 -1
  276. package/dist/assets/Index-jZMrIwYv.js +0 -1
  277. package/dist/assets/Index-uemFTdfN.js +0 -1
  278. package/dist/assets/LocalTools-C5elVqih.js +0 -5
  279. package/dist/assets/Pay-5sKP-5mn.js +0 -1
  280. package/dist/assets/WriteSkillDialog-B4lxIDJK.js +0 -1
  281. package/dist/assets/arrow-down-B7gY3qc0.js +0 -1
  282. package/dist/assets/arrow-left-D9PzI6lU.js +0 -1
  283. package/dist/assets/arrow-right-BZVVykF9.js +0 -1
  284. package/dist/assets/arrow-up-vjX6ESSZ.js +0 -1
  285. package/dist/assets/check-DEuTU4c8.js +0 -1
  286. package/dist/assets/chevron-down-CCvMOkAm.js +0 -1
  287. package/dist/assets/chevron-right-CMN7EUPl.js +0 -1
  288. package/dist/assets/circle-check-BzGCItgQ.js +0 -1
  289. package/dist/assets/clock-BooSG6zB.js +0 -1
  290. package/dist/assets/code-DyNs0diY.js +0 -1
  291. package/dist/assets/codingBridge-D5m47vOt.js +0 -2
  292. package/dist/assets/esm-Czt26omG.js +0 -1
  293. package/dist/assets/gauge-DRD3bzzD.js +0 -1
  294. package/dist/assets/grokvideo-jylBR3ej.js +0 -1
  295. package/dist/assets/index-Dr2ooWnm.js +0 -572
  296. package/dist/assets/loader-circle-DlDNc4da.js +0 -1
  297. package/dist/assets/maestro-BZjKR3qb.js +0 -1
  298. package/dist/assets/maestro-BseWpiuj.js +0 -1
  299. package/dist/assets/maestro-C1SfpTGL.js +0 -1
  300. package/dist/assets/maestro-C3qz5VUl.js +0 -1
  301. package/dist/assets/maestro-CA9H8dEG.js +0 -1
  302. package/dist/assets/maestro-CEEx8qvF.js +0 -1
  303. package/dist/assets/maestro-CZsW3Nlk.js +0 -1
  304. package/dist/assets/maestro-ChDcMauc.js +0 -1
  305. package/dist/assets/maestro-CsqrFYgi.js +0 -1
  306. package/dist/assets/maestro-DM9tDnMK.js +0 -1
  307. package/dist/assets/maestro-DdTH473R.js +0 -1
  308. package/dist/assets/maestro-ZR8sSyLR.js +0 -1
  309. package/dist/assets/maestro-lQnNR9WV.js +0 -1
  310. package/dist/assets/maestroLanguages-BCseVxSx.js +0 -1
  311. package/dist/assets/music-2-DimqlZ0P.js +0 -1
  312. package/dist/assets/play-CKD5ICgk.js +0 -1
  313. package/dist/assets/plus-B_fnUe1I.js +0 -1
  314. package/dist/assets/rotate-ccw-DxSDeWPl.js +0 -1
  315. package/dist/assets/rotate-cw-ZIUqlSwU.js +0 -1
  316. package/dist/assets/search-CgyxhhlQ.js +0 -1
  317. package/dist/assets/square-CT3nJzJZ.js +0 -1
  318. package/dist/assets/terminal-B0UFZK-h.js +0 -1
  319. package/dist/assets/user-D8eTVZ1t.js +0 -1
@@ -0,0 +1 @@
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-Dxkn5fnG.js";import{n as x,t as S}from"./tabs-0J-7r8zS.js";import{t as C}from"./upload-ChEGBjQd.js";import{t as w}from"./tooltip-CsVgfK1f.js";import{t as T}from"./alert-BprQRUmf.js";import{_ as E,v as D}from"./vuex.esm-bundler-uM-kqbAF.js";import{n as O,r as k}from"./radio-BNhFzeBO.js";import{t as A}from"./drawer-CF4BsAtW.js";import{t as j}from"./input-number-YpK_vIUu.js";import{t as M}from"./slider-DyGvOBhi.js";import{t as N}from"./switch-FNAnbKSR.js";import{t as ee}from"./clock-B6Xmh354.js";import{t as te}from"./hash-BKpZIJo7.js";import{t as ne}from"./headphones--YKlJldO.js";import{t as re}from"./info-CDs2D83H.js";import{t as ie}from"./lightbulb-D_g0yrw8.js";import{a as P,i as ae,n as oe,r as se,t as ce}from"./pagination-BGnYVZvp.js";import{t as le}from"./trash-2-rtHpr3JN.js";import{t as ue}from"./triangle-alert-D_wd4w3Z.js";import{t as F}from"./upload-DoPPJ2yy.js";import{t as I}from"./wand-sparkles-CReI7Ekg.js";import{Ai as de,Fi as L,Ni as fe,Pi as pe}from"./constants-CVb0vrXj.js";import{Ba as me,D as R,Fi as he,Ha as z,Ia as B,Ir as ge,Li as V,Lr as H,Ra as _e,Rr as U,T as ve,Tn as ye,Xi as W,at as G,ct as K,ia as be,it as xe,li as Se,lo as q,lt as J,nt as Ce,oi as we,ot as Y,rt as Te,st as Ee,to as X,tt as De,zi as Oe}from"./index-C643U2rX.js";import{t as ke}from"./CopyToClipboard-Dc_53C_9.js";import{t as Ae}from"./ReportButton-BCWM_eUv.js";import{t as je}from"./FilePreview-C0VlAjUT.js";import{t as Z}from"./ImagePreview-QrO7VB3T.js";import{n as Me}from"./taskDrawerMixin-DyAUhFEq.js";import{t as Ne}from"./ServicePricingSummary-BnnhtPm5.js";import{t as Pe}from"./AudioPreview-d8-NMxq_.js";import{t as Fe}from"./VideoPlayer-Bt19ZgtM.js";import{t as Ie}from"./VideoPreview-DbXtGsVJ.js";import{t as Le}from"./ScenarioPaymentMode-DUv_xCgb.js";import{t as Re}from"./ApiCodeButton-DBR9tGBM.js";import{t as ze}from"./BotPlaceholder-Cl_V5koZ.js";import{t as Be}from"./taskPollingMixin-CcLxtz8z.js";import{t as Ve}from"./ShowcaseResultTabs-DoS1AGxi.js";import{t as He}from"./showcaseRecreateMixin-BvSTHecE.js";import{n as Ue,t as We}from"./generationInput-jeoGp56s.js";var Ge=v({name:`LayoutKling`,components:{MagicIcon:I,ElDrawer:A,ElButton:X},mixins:[Me]}),Ke={class:`main flex flex-row flex-1 min-h-0`},qe={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)]`},Je={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ye(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Ke,[e(`div`,qe,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Je,[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 Xe=R(Ge,[[`render`,Ye],[`__scopeId`,`data-v-f4b791b5`]]),Ze={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};function Q(e,t,n){let r=t||`std`,i=n??5;switch(e){case`kling-v3-turbo`:return{...Ze,audio:!0};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 Ze}}var $=`<<<video_1>>>`,Qe=/<<<image_\d+>>>/g;function $e(e){return e?e.split($).join(` `).replace(/\s{2,}/g,` `).trim():``}function et(e){return e?e.replace(Qe,` `).replace(/\s{2,}/g,` `).trim():``}function tt(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=Q(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=[`kling-o1`,`kling-v3-omni`,`kling-v3-turbo`].includes(n)||!!(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 nt(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=$e(n.prompt)),e.field===`image_list`&&(n.image_list=void 0,n.prompt=et(n.prompt));return n}var rt=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-turbo`,label:`v3-Turbo`},{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(de)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=tt(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await z.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=nt({...t,model:e},n);this.$store.commit(`kling/setConfig`,i),D.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})}}}),it={class:`field`},at={class:`title font-bold`};function ot(t,n,r,a,o,u){let d=l(`el-option`),m=l(`el-select`);return g(),s(`div`,it,[e(`h2`,at,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 st=R(rt,[[`render`,ot],[`__scopeId`,`data-v-d3faca05`]]),ct=v({name:`ModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},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 L.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=tt(t,{mode:e});if(n.length===0){this.applyMode(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await z.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=nt({...t,mode:e},n);this.$store.commit(`kling/setConfig`,i),D.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})}}}),lt={class:`field`},ut={class:`header`},dt={class:`title font-bold`},ft={key:0,class:`opt-tip`};function pt(t,r,u,d,m,_){let v=l(`info-icon`),y=l(`el-option`),b=l(`el-select`);return g(),s(`div`,lt,[e(`div`,ut,[e(`h2`,dt,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`,ft,i(t.disabledReason),1)):o(``,!0)]),_:2},1032,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var mt=R(ct,[[`render`,pt],[`__scopeId`,`data-v-9a8fa3c5`]]),ht=Array.from({length:13},(e,t)=>t+3),gt=[5,10],_t=[5],vt=v({name:`DurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},isV3Model(){return this.selectedModel===`kling-v3-turbo`||L.includes(this.selectedModel)},allowedDurations(){return this.selectedModel===`kling-o1`?_t:this.isV3Model?ht:gt},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=tt(t,{duration:e});if(n.length===0){this.applyDuration(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await z.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=nt({...t,duration:e},n);this.$store.commit(`kling/setConfig`,i),D.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})}}}),yt={class:`field`},bt={class:`control`},xt={class:`label`},St={class:`title font-bold`};function Ct(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,yt,[e(`div`,bt,[e(`div`,xt,[e(`h2`,St,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 wt=R(vt,[[`render`,Ct],[`__scopeId`,`data-v-9051ec82`]]),Tt=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`}}),Et={class:`text-sm font-bold mb-2 block`},Dt={class:`items`},Ot=[`onClick`],kt={class:`name`};function At(t,r,a,o,l,u){return g(),s(`div`,null,[e(`span`,Et,i(t.$t(`kling.name.ratio`)),1),e(`div`,Dt,[(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`,kt,i(r.label),1)],10,Ot))),128))])])}var jt=R(Tt,[[`render`,At],[`__scopeId`,`data-v-cdb14b2f`]]),Mt=v({name:`StartImage`,components:{UploadIcon:F,ElUpload:C,ElButton:X,ElTooltip:w,InfoIcon:P,ImagePreview:Z},mixins:[J,K,Y],emits:[`change`],data(){return{fileList:[],uploadUrl:B()+`/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(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.error(this.$t(`kling.message.uploadReferencesError`))},onBeforeUpload(){let e=this.$store.state.kling?.config||{};if(e.video_list?.[0]?.refer_type===`base`)return D.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?(D.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()}}}),Nt={class:`relative`},Pt={class:`flex min-h-8 items-center pr-20`},Ft={class:`flex justify-start items-center`},It={class:`text-sm font-bold`};function Lt(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`,Nt,[e(`div`,Pt,[e(`div`,Ft,[e(`span`,It,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 Rt=R(Mt,[[`render`,Lt],[`__scopeId`,`data-v-60844ac3`]]),zt=v({name:`EndImage`,components:{UploadIcon:F,ElUpload:C,ElButton:X,ElTooltip:w,ImagePreview:Z,InfoIcon:P},mixins:[J,K,Y],data(){return{fileList:[],uploadUrl:B()+`/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 Q(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 D.warning(this.$t(`kling.message.endImageNotSupported`)),!1;if(!this.hasStartImage)return D.warning(this.$t(`kling.message.endImageRequiresStart`)),!1;if(this.klingConfig.video_list?.[0]?.refer_type===`base`)return D.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?(D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:e})),!1):!0},onExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.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`},Vt={class:`flex min-h-8 items-center pr-20`},Ht={class:`flex justify-start items-center`},Ut={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`,Vt,[e(`div`,Ht,[e(`span`,Ut,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 Gt=R(zt,[[`render`,Wt],[`__scopeId`,`data-v-b286c4d0`]]),Kt=v({name:`ReferenceVideo`,components:{ElUpload:C,ElButton:X,ElRadioButton:O,ElRadioGroup:k,ElSwitch:N,InfoIcon:P,FilePreview:je,UploadIcon:F},mixins:[K,Y],data(){return{fileList:[],uploadUrl:B()+`/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(){D.warning(this.$t(`kling.message.referenceVideoExceed`))},onError(){D.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 D.error(this.$t(`kling.message.referenceVideoImageLimit`)),!1;let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=xe(e.size);return t?n?!0:(D.error(this.$t(`kling.message.referenceVideoSizeExceed`,{max:Te(Ce)})),!1):(D.error(this.$t(`kling.message.referenceVideoTypeFailed`)),!1)},ensurePromptToken(e){let t=this.$store.state.kling?.config,n=t?.prompt||``,r=n.includes($),i;if(e&&!r)i=n?`${n} ${$}`:$;else if(!e&&r)i=$e(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()}}}),qt={class:`relative`},Jt={class:`flex min-h-8 items-center pr-20`},Yt={class:`flex justify-start items-center`},Xt={class:`text-sm font-bold`},Zt={key:0,class:`reference-options mt-3 flex flex-col gap-3`},Qt={class:`flex flex-col items-stretch gap-2 sm:flex-row sm:items-center sm:justify-between`},$t={class:`text-sm`},en={class:`flex items-center justify-between gap-3`},tn={class:`text-sm`};function nn(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`,qt,[e(`div`,Jt,[e(`div`,Yt,[e(`span`,Xt,i(t.$t(`kling.name.referenceVideo`)),1),a(h,{content:t.$t(`kling.description.omniReferenceVideo`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"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`,Zt,[e(`div`,Qt,[e(`span`,$t,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`,en,[e(`span`,tn,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 rn=R(Kt,[[`render`,nn],[`__scopeId`,`data-v-e3a9dfab`]]),an=v({name:`KlingReferenceImages`,components:{ElButton:X,ElUpload:C,UploadIcon:F,ImagePreview:Z,InfoIcon:P},mixins:[J,K,Y],data(){return{fileList:[],uploadUrl:B()+`/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(){D.warning(this.$t(`kling.message.referenceImagesExceed`,{count:this.remainingSlots}))},onError(){D.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=[et(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()}}}),on={class:`relative`},sn={class:`flex justify-between items-center`},cn={class:`flex justify-start items-center`},ln={class:`text-sm font-bold`},un={key:0,class:`file-list flex flex-wrap gap-2 mt-2`};function dn(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`,on,[e(`div`,sn,[e(`div`,cn,[e(`span`,ln,i(t.$t(`kling.name.referenceImages`)),1),a(v,{content:t.$t(`kling.description.referenceImages`)},null,8,[`content`])]),a(x,{ref:`uploader`,"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`,un,[(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 fn=R(an,[[`render`,dn]]),pn=v({name:`CfgScaleSelector`,components:{ElSlider:M,InfoIcon:P,ElInputNumber:j},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}}),mn={class:`flex justify-between`},hn={class:`flex justify-start items-center`},gn={class:`text-sm font-bold`},_n={class:`flex justify-end items-center`},vn={class:`w-full`};function yn(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`,mn,[e(`div`,hn,[e(`span`,gn,i(t.$t(`kling.name.cfgScale`)),1),a(d,{content:t.$t(`kling.description.cfgScale`)},null,8,[`content`])]),e(`div`,_n,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,vn,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:0,max:1,step:.1},null,8,[`modelValue`])])])}var bn=R(pn,[[`render`,yn]]),xn=v({name:`GenerateAudioSelector`,components:{ElSwitch:N,InfoIcon:P},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},selectedMode(){return this.$store.state.kling?.config?.mode||``},fixedAudio(){return this.selectedModel===`kling-v3-turbo`},supported(){return!!(this.fixedAudio||L.includes(this.selectedModel)||this.selectedModel===`kling-v2-6`&&this.selectedMode===`pro`)},tooltipContent(){return this.fixedAudio?this.$t(`kling.description.generateAudioIncluded`):this.supported?this.$t(`kling.description.generateAudio`):this.$t(`kling.description.generateAudioUnsupported`)},value:{get(){return this.fixedAudio?!0: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})}}}),Sn={class:`relative`},Cn={class:`flex justify-between items-center`},wn={class:`flex justify-start items-center`},Tn={class:`text-sm font-bold`};function En(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,Sn,[e(`div`,Cn,[e(`div`,wn,[e(`span`,Tn,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||t.fixedAudio},null,8,[`modelValue`,`disabled`])])])}var Dn=R(xn,[[`render`,En]]),On=[`horizontal`,`vertical`,`pan`,`tilt`,`roll`,`zoom`],kn=v({name:`CameraControlSelector`,components:{ElSelect:y,ElOption:b,ElSlider:M,ElInputNumber:j,InfoIcon:P},data(){return{configKeys:On}},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 Q(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)}}}),An={class:`field`},jn={class:`header`},Mn={class:`text-sm font-bold`},Nn={key:0,class:`config-grid`},Pn={class:`cfg-row-head`},Fn={class:`cfg-name`};function In(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`,An,[e(`div`,jn,[e(`span`,Mn,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`,Nn,[(g(!0),s(c,null,h(t.configKeys,n=>(g(),s(`div`,{key:n,class:`cfg-row`},[e(`div`,Pn,[e(`span`,Fn,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 Ln=R(kn,[[`render`,In],[`__scopeId`,`data-v-cd896060`]]),Rn=[{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`]}],zn=`, `;function Bn(e,t){let n=(e||``).trim();return n?n.includes(t)?n:`${n}${zn}${t}`:t}function Vn(e,t){if(!e||!t)return e||``;let n=[`${t}${zn}`,`${zn}${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 Hn=v({name:`InspirationPills`,components:{CloseIcon:me},computed:{prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return Rn.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=Vn(this.prompt,e);this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:t})}}}),Un={key:0,class:`pills`,role:`list`},Wn={class:`pill-text`},Gn=[`aria-label`,`title`,`onClick`];function Kn(n,r,u,d,f,p){let m=l(`close-icon`);return n.selected.length>0?(g(),s(`div`,Un,[(g(!0),s(c,null,h(n.selected,r=>(g(),s(`div`,{key:r,class:`pill`,role:`listitem`},[e(`span`,Wn,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,Gn)]))),128))])):o(``,!0)}var qn=v({name:`PromptInput`,components:{IdeaIcon:ie,ElButton:X,PromptTextarea:ae,InspirationPills:R(Hn,[[`render`,Kn],[`__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 Jn(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 Yn=R(qn,[[`render`,Jn],[`__scopeId`,`data-v-5754ae54`]]),Xn=v({name:`NegativePromptInput`,components:{ElInput:q,InfoIcon:P},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||=``}}),Zn={class:`field`},Qn={class:`box`},$n={class:`title font-bold`};function er(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,Zn,[e(`div`,Qn,[e(`h2`,$n,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 tr=R(Xn,[[`render`,er],[`__scopeId`,`data-v-de98cf01`]]),nr=v({name:`InspirationDrawer`,components:{Close:me,IdeaIcon:ie,ElDrawer:A,ElButton:X},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`],data(){return{groups:Rn}},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(Vn(this.prompt,e)):this.setPrompt(Bn(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(let t of this.allChipTexts)for(;e.includes(t);)e=Vn(e,t);this.setPrompt(e)}}}),rr={class:`drawer-content`},ir={class:`drawer-header`},ar={class:`title-row`},or={class:`title`},sr={class:`hint`},cr={key:0,class:`selected-bar`},lr={class:`selected-text`},ur={class:`groups`},dr={class:`group-title`},fr={class:`chip-grid`},pr=[`onClick`];function mr(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`,rr,[e(`div`,ir,[e(`div`,ar,[a(y,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,or,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`,sr,i(t.$t(`kling.inspiration.hint`)),1),t.selectedCount>0?(g(),s(`div`,cr,[e(`span`,lr,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`,ur,[(g(!0),s(c,null,h(t.groups,r=>(g(),s(`div`,{key:r.groupKey,class:`group`},[e(`div`,dr,i(t.$t(`kling.inspiration.group.${r.groupKey}`)),1),e(`div`,fr,[(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,pr))),128))])]))),128))])])]),_:1},8,[`modelValue`,`size`])}var hr=R(nr,[[`render`,mr],[`__scopeId`,`data-v-8b2e6a5d`]]),gr={"kling-v3":`v3`,"kling-v3-turbo":`v3-Turbo`,"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`},_r={std:`720p`,pro:`1080p`,"4k":`4K`},vr=v({name:`SummaryChip`,components:{AudioIcon:ne},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){let e=this.config?.model||`kling-v2-5-turbo`;return gr[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||``},modeLabel(){let e=this.config?.mode||`std`;return _r[e]||e},generateAudio(){return this.config?.model===`kling-v3-turbo`||!!this.config?.generate_audio}}}),yr={class:`summary-chip`},br=[`title`],xr=[`title`],Sr=[`title`],Cr=[`title`],wr=[`title`];function Tr(t,n,r,c,u,d){let f=l(`audio-icon`);return g(),s(`div`,yr,[e(`span`,{class:`part`,title:t.$t(`kling.name.model`)},i(t.modelLabel),9,br),n[0]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.duration`)},i(t.durationLabel),9,xr),n[1]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.ratio`)},i(t.aspectRatio||`16:9`),9,Sr),n[2]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.mode`)},i(t.modeLabel),9,Cr),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,wr)):o(``,!0)])}var Er=v({name:`ConfigPanel`,components:{MagicIcon:I,ElButton:X,ServicePricingSummary:Ne,PromptInput:Yn,NegativePromptInput:tr,ModelSelector:st,ModeSelector:mt,DurationSelector:wt,RatioSelector:jt,StartImage:Rt,CfgScaleSelector:bn,GenerateAudioSelector:Dn,CameraControlSelector:Ln,InspirationDrawer:hr,SummaryChip:R(vr,[[`render`,Tr],[`__scopeId`,`data-v-f59e4d1f`]]),EndImage:Gt,ReferenceImages:fn,ReferenceVideo:rn,ScenarioPaymentMode:Le},emits:[`generate`],data(){return{inspirationOpen:!1,quoteTimer:0,quoteRunId:0}},computed:{canGenerate(){return We(`kling`,H(this.config))},config(){return this.$store.state.kling?.config},capabilities(){return Q(this.config?.model,this.config?.mode,this.config?.duration)},restrictedControls(){return[`kling-o1`,`kling-v3-omni`,`kling-v3-turbo`].includes(this.config?.model||``)||!!(this.config?.image_list?.length||this.config?.video_list?.length)},consumption(){return ye(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service},walletMode(){return he()&&V(`kling`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=V(`kling`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,350))},async refreshQuote(){if(!this.canGenerate)return;let e=V(`kling`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await U.quote(H(this.config));t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)}}}),Dr={class:`flex flex-col h-full`},Or={class:`flex-1 overflow-y-auto p-5`},kr={class:`flex flex-col items-center justify-center px-5 pb-5`};function Ar(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(`scenario-payment-mode`),j=l(`service-pricing-summary`),M=l(`magic-icon`),N=l(`el-button`),ee=l(`inspiration-drawer`);return g(),s(`div`,Dr,[e(`div`,Or,[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-4`})):o(``,!0),a(x,{class:`mb-4`}),t.config?.model===`kling-v3-turbo`?o(``,!0):(g(),f(S,{key:2,class:`mb-4`})),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`}),t.restrictedControls?o(``,!0):(g(),f(E,{key:3,class:`mb-4`})),t.restrictedControls?o(``,!0):(g(),f(D,{key:4,class:`mb-4`})),t.restrictedControls?o(``,!0):(g(),f(O,{key:5,class:`mb-4`}))]),e(`div`,kr,[a(k),a(A,{scenario:`kling`}),t.walletMode?o(``,!0):(g(),f(j,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),t.config?.video_url!==void 0||t.config?.custom?(g(),f(N,{key:1,type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(M,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.extend`)),1)]),_:1},8,[`disabled`,`onClick`])):(g(),f(N,{key:2,type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(M,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`]))]),a(ee,{modelValue:t.inspirationOpen,"onUpdate:modelValue":n[1]||=e=>t.inspirationOpen=e},null,8,[`modelValue`])])}var jr=R(Er,[[`render`,Ar]]),Mr=v({name:`MotionImage`,components:{UploadIcon:F,ElUpload:C,ElButton:X,InfoIcon:P,ImagePreview:Z},mixins:[J,K,Y,De],data(){return{fileList:[],uploadUrl:B()+`/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(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.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()}}}),Nr={class:`relative`},Pr={class:`flex justify-between`},Fr={class:`flex justify-start items-center`},Ir={class:`text-sm font-bold`};function Lr(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`,Nr,[e(`div`,Pr,[e(`div`,Fr,[e(`span`,Ir,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,"before-upload":t.beforeUploadSizeGuard,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`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Rr=R(Mr,[[`render`,Lr],[`__scopeId`,`data-v-4a95ef2c`]]),zr=v({name:`MotionVideo`,components:{UploadIcon:F,ElUpload:C,ElButton:X,InfoIcon:P,FilePreview:je},mixins:[K,Y],data(){return{fileList:[],uploadUrl:B()+`/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(){D.warning(this.$t(`kling.message.uploadVideoExceed`))},onError(){D.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:(D.error(this.$t(`kling.message.uploadVideoSizeExceed`)),!1):(D.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()}}}),Br={class:`relative`},Vr={class:`flex justify-between`},Hr={class:`flex justify-start items-center`},Ur={class:`text-sm font-bold`};function Wr(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`,Br,[e(`div`,Vr,[e(`div`,Hr,[e(`span`,Ur,i(t.$t(`kling.name.motionVideo`)),1),a(h,{content:t.$t(`kling.description.motionVideo`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"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 Gr=R(zr,[[`render`,Wr],[`__scopeId`,`data-v-630c4521`]]),Kr=v({name:`MotionPromptInput`,components:{ElInput:q,InfoIcon:P},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||``},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),qr={class:`field`},Jr={class:`box`},Yr={class:`title font-bold`};function Xr(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,qr,[e(`div`,Jr,[e(`h2`,Yr,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 Zr=R(Kr,[[`render`,Xr],[`__scopeId`,`data-v-ca9fdbe5`]]),Qr=`video`,$r=v({name:`CharacterOrientationSelector`,components:{ElRadioGroup:k,ElRadioButton:O,InfoIcon:P},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||Qr},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=Qr)}}),ei={class:`field`},ti={class:`header`},ni={class:`text-sm font-bold`};function ri(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`,ei,[e(`div`,ti,[e(`span`,ni,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 ii=R($r,[[`render`,ri],[`__scopeId`,`data-v-7a91195b`]]),ai=`kling-v2-6`,oi=v({name:`MotionModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},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||ai},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=ai)}}),si={class:`field`},ci={class:`header`},li={class:`title font-bold`};function ui(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,si,[e(`div`,ci,[e(`h2`,li,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 di=R(oi,[[`render`,ui],[`__scopeId`,`data-v-480e8da2`]]),fi=`std`,pi=v({name:`MotionModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},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||fi},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=fi)}}),mi={class:`field`},hi={class:`header`},gi={class:`title font-bold`};function _i(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,mi,[e(`div`,hi,[e(`h2`,gi,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 vi=R(pi,[[`render`,_i],[`__scopeId`,`data-v-1295688c`]]),yi=v({name:`KeepOriginalSoundSelector`,components:{ElSwitch:N,InfoIcon:P},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`})}}}}),bi={class:`relative`},xi={class:`flex justify-between items-center`},Si={class:`flex justify-start items-center`},Ci={class:`text-sm font-bold`};function wi(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,bi,[e(`div`,xi,[e(`div`,Si,[e(`span`,Ci,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 Ti=v({name:`MotionPanel`,components:{MagicIcon:I,ElButton:X,ServicePricingSummary:Ne,MotionImage:Rr,MotionVideo:Gr,MotionPromptInput:Zr,CharacterOrientationSelector:ii,MotionModelSelector:di,MotionModeSelector:vi,KeepOriginalSoundSelector:R(yi,[[`render`,wi]])},emits:[`generate`],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return ye({...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`)}}}),Ei={class:`flex flex-col h-full`},Di={class:`flex-1 overflow-y-auto p-5`},Oi={class:`flex flex-col items-center justify-center px-5 pb-5`};function ki(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(`service-pricing-summary`),S=l(`magic-icon`),C=l(`el-button`);return g(),s(`div`,Ei,[e(`div`,Di,[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`,Oi,[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 Ai=R(Ti,[[`render`,ki]]),ji=v({name:`KlingTabSwitcher`,components:{MetaTag:_e,ElTabs:x,ElTabPane:S},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)}}}),Mi=[`title`],Ni={class:`text`};function Pi(t,n,a,u,d,m){let _=l(`meta-tag`),v=l(`el-tab-pane`),y=l(`el-tabs`);return g(),f(y,{"model-value":t.modelValue,class:`kling-tabs scenario-tabs scenario-tabs--divided`,"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`,Ni,i(t.label),1),t.badge?(g(),f(_,{key:0,tone:`warning`,class:`badge`,density:`compact`},{default:p(()=>[r(i(t.badge),1)]),_:2},1024)):o(``,!0)],8,Mi)]),_:2},1032,[`name`,`disabled`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var Fi=R(ji,[[`render`,Pi],[`__scopeId`,`data-v-24ca66ec`]]),Ii={"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`},Li=v({name:`TalkingPhotoModelSelector`,components:{ElSelect:y,ElOption:b},data(){return{options:pe.map(e=>({value:e,label:Ii[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=fe)}}),Ri={class:`field`},zi={class:`title font-bold`};function Bi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Ri,[e(`h2`,zi,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 Vi=R(Li,[[`render`,Bi],[`__scopeId`,`data-v-cbc83d11`]]),Hi=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`)}}),Ui={class:`field`},Wi={class:`title font-bold`};function Gi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Ui,[e(`h2`,Wi,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 Ki=v({name:`TalkingPhotoPanel`,components:{MagicIcon:I,UploadIcon:F,ElUpload:C,ElButton:X,ElInput:q,ServicePricingSummary:Ne,InfoIcon:P,ImagePreview:Z,ModelSelector:Vi,ModeSelector:R(Hi,[[`render`,Gi],[`__scopeId`,`data-v-92525a1d`]]),ScenarioPaymentMode:Le},mixins:[Y,De],emits:[`generate`],data(){return{imageFiles:[],audioFiles:[],uploadUrl:B()+`/api/v1/files/`,quoteTimer:0,quoteRunId:0}},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 ye({...this.config,action:`talking-photo`},this.service?.cost)},canGenerate(){return!!(this.config.image_url&&this.config.audio_url)},walletMode(){return he()&&V(`kling`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteTimer=window.setTimeout(this.refreshQuote,350)},async refreshQuote(){let e=V(`kling`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await U.quoteTalkingPhoto(ge(this.config));t===this.quoteRunId&&e.mode===`wallet`&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},commit(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.config,...e})},onPromptChange(e){this.commit({prompt:e})},onImageExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onImageError(){D.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(){D.warning(this.$t(`kling.message.uploadAudioExceed`))},onAudioError(){D.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`)}}}),qi={class:`flex flex-col h-full`},Ji={class:`flex-1 overflow-y-auto p-5`},Yi={class:`relative mb-4`},Xi={class:`flex justify-start items-center`},Zi={class:`text-sm font-bold`},Qi={class:`relative mb-4`},$i={class:`flex justify-start items-center`},ea={class:`text-sm font-bold`},ta=[`src`],na={class:`mb-4`},ra={class:`flex justify-start items-center`},ia={class:`text-sm font-bold`},aa={class:`flex flex-col items-center justify-center px-5 pb-5`};function oa(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(`scenario-payment-mode`),T=l(`service-pricing-summary`),E=l(`magic-icon`);return g(),s(`div`,qi,[e(`div`,Ji,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),e(`div`,Yi,[e(`div`,Xi,[e(`span`,Zi,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,"before-upload":t.beforeUploadSizeGuard,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`,`before-upload`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`])]),e(`div`,Qi,[e(`div`,$i,[e(`span`,ea,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,"before-upload":t.beforeUploadSizeGuard,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`,`before-upload`,`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,ta)):o(``,!0)]),e(`div`,na,[e(`div`,ra,[e(`span`,ia,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`,aa,[a(w,{scenario:`kling`}),t.walletMode?o(``,!0):(g(),f(T,{key:0,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(E,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generateTalkingPhoto`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var sa=R(Ki,[[`render`,oa],[`__scopeId`,`data-v-46191f92`]]),ca=v({name:`TaskPreview`,components:{DeleteIcon:le,ChannelIcon:te,InfoIcon:re,MagicIcon:I,TimeIcon:ee,WarningIcon:ue,CopyToClipboard:ke,ElAlert:T,VideoPlayer:Fe,ElTooltip:w,ElButton:X,ImagePreview:Z,VideoPreview:Ie,AudioPreview:Pe,ApiCodeButton:Re,ReportButton:Ae},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{isFailure(){let e=this.modelValue?.response;return e?.success===!1||!!e?.error||e?.state===`failed`||e?.state===`cancelled`},isWaiting(){let e=this.modelValue?.response;return!e||!this.isFailure&&e.success!==!0&&!e.video_url},application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},displayText(){return this.modelValue?.request?.prompt?.trim()||this.modelValue?.request?.text?.trim()||``},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:{async onDelete(){let e=this.modelValue?.id;if(e){try{await z.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`kling/deleteTask`,{id:e}),D.success(this.$t(`common.message.deleteTaskSuccess`))}catch{D.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),la={class:`preview`},ua={class:`left`},da={class:`main`},fa={class:`bot`},pa={class:`datetime`},ma=[`aria-label`],ha={key:0,class:`info`},ga={key:0,class:`request-media flex justify-start items-center gap-2 w-full overflow-x-auto`},_a={key:1,class:`prompt`},va={key:0},ya={key:1},ba={key:1,class:n({content:!0,failed:!0})},xa={key:0,class:`mb-4`},Sa={key:1,class:n({operations:!0,"mt-2":!0})},Ca={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},wa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ta={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Ea={key:2,class:n({content:!0})},Da={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Oa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ka={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Aa={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ja={key:3,class:n({content:!0})},Ma={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Na={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Pa(n,u,d,m,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`image-preview`),C=l(`video-preview`),w=l(`audio-preview`),T=l(`video-player`),E=l(`el-button`),D=l(`api-code-button`),O=l(`report-button`),k=l(`channel-icon`),A=l(`magic-icon`),j=l(`copy-to-clipboard`),M=l(`time-icon`),N=l(`el-alert`),ee=l(`warning-icon`),te=l(`info-icon`);return g(),s(`div`,la,[e(`div`,ua,[a(y,{capability:`kling`,part:`avatar`,class:`avatar`})]),e(`div`,da,[e(`div`,fa,[a(y,{capability:`kling`,part:`name`}),e(`span`,pa,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(x,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(g(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:u[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,ma)):o(``,!0)]),_:1},8,[`content`])]),n.referenceImages.length>0||n.referenceVideos.length>0||n.referenceAudios.length>0||n.displayText?(g(),s(`div`,ha,[n.referenceImages.length>0||n.referenceVideos.length>0||n.referenceAudios.length>0?(g(),s(`div`,ga,[(g(!0),s(c,null,h(n.referenceImages,(e,t)=>(g(),f(S,{key:`image-${t}`,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceVideos,(e,t)=>(g(),f(C,{key:`video-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceAudios,(e,t)=>(g(),f(w,{key:`audio-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128))])):o(``,!0),n.displayText?(g(),s(`p`,_a,[r(i(n.displayText)+` `,1),n.modelValue?.response?n.isWaiting?(g(),s(`span`,ya,` - (`+i(n.$t(`kling.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,va,` - (`+i(n.$t(`kling.status.pending`))+`) `,1))])):o(``,!0)])):o(``,!0),n.modelValue?.response?.success===!0&&!n.isFailure?(g(),s(`div`,ba,[n.modelValue?.response.video_url?(g(),s(`div`,xa,[a(T,{src:n.modelValue?.response.video_url},null,8,[`src`])])):o(``,!0),n.modelValue?.response.success?(g(),s(`div`,Sa,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`kling.message.downloadVideo`),placement:`top-start`},{default:p(()=>[n.modelValue?.response.video_url?(g(),f(E,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:u[1]||=e=>n.onDownload(e,n.modelValue?.response.video_url)},{default:p(()=>[r(i(n.$t(`kling.button.download`)),1)]),_:1})):o(``,!0)]),_:1},8,[`content`]),a(D,{path:`/kling/videos`,body:n.modelValue?.request},null,8,[`body`]),a(O,{service:`kling`,"target-id":n.modelValue?.id,snapshot:{prompt:n.displayText}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(N,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,Ca,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.model`))+`: `+i(n.modelValue?.request?.model),1)]),e(`p`,wa,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,Ta,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.isFailure?(g(),s(`div`,Ea,[a(N,{closable:!1,class:`failure`},{template:p(()=>[a(ee,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,Da,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,Oa,[a(te,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(j,{content:n.modelValue?.response?.error?.message},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,ka,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Aa,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),n.isWaiting?(g(),s(`div`,ja,[a(N,{closable:!1,class:`info`},{template:p(()=>[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(n.modelValue?.response?`kling.status.processing`:`kling.status.pending`)),1)]),default:p(()=>[e(`p`,Ma,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.response?.trace_id?(g(),s(`p`,Na,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var Fa=v({name:`RecentPanel`,components:{TaskPreview:R(ca,[[`render`,Pa],[`__scopeId`,`data-v-73637147`]]),NoTasks:se,BotPlaceholder:ze,ScrollList:oe},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?.()}}}),Ia={key:0},La={key:2,class:`w-full h-full flex items-center justify-center`};function Ra(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`,Ia,[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`,La,[a(v)])):o(``,!0)],64)}var za=v({name:`KlingIndex`,components:{ConfigPanel:jr,MotionPanel:Ai,TalkingPhotoPanel:sa,TabSwitcher:Fi,Layout:Xe,RecentPanel:R(Fa,[[`render`,Ra]]),ShowcaseResultTabs:Ve},mixins:[Ee,He(`kling`),Be(`kling`)],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===E.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===E.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},walletMode(){return this.taskType!==`motion`&&he()&&V(`kling`).mode===`wallet`}},watch:{taskType:{handler(e){Oe(`kling`,e!==`motion`)},immediate:!0},walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`kling/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},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.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ce({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,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(){let e=H(this.config),t=Ue(`kling`,e);if(t){D.error(this.$t(`common.message.${t}`));return}if(!G(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let n=Number(!!e.start_image_url)+Number(!!e.end_image_url),r=e.image_list?.length||0,i=e.video_list?.length?4:7;if(n+r>i){D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:i}));return}if(e.video_list?.[0]?.refer_type===`base`&&(e.start_image_url||e.end_image_url||e.image_list?.some(({type:e})=>e))){D.warning(this.$t(`kling.message.baseVideoFrameConflict`));return}if(!e.video_id&&!e.video_url&&!e.start_image_url&&e.end_image_url){D.warning(this.$t(`kling.message.endImageRequiresStart`));return}let a=this.createPaymentOperation(t=>U.generate(e,t));a&&(D.info(this.$t(`kling.message.startingTask`)),W(`kling`,a).then(e=>{this.recordWalletTask(e),D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>this.handleGenerationError(e)).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)}))},createPaymentOperation(e){if(!this.walletMode){if(!be())return;let t=this.credential?.token;return t?e({token:t}):void 0}let t=this.getWalletContext();if(!t){D.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}return e({mode:`x402`,x402:{wallet:t,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})},recordWalletTask(e){let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t)},handleGenerationError(e){e instanceof we||ve(e,`kling`)||(this.walletMode?D.error(this.$t(`common.x402Scenario.paymentFailed`)):D.error(this.$t(`kling.message.startTaskFailed`)))},getWalletContext(){return Se(this.$wallet)},async confirmWalletPayment(e){return z.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},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(!G(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let e=this.motionConfig||{};if(!e.image_url||!e.video_url){D.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(!be())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}D.info(this.$t(`kling.message.startingTask`)),W(`kling`,U.motion(t,{token:n})).then(()=>{D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{ve(e,`kling`)||D.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},async onGenerateTalkingPhoto(){if(!G(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let e=this.talkingPhotoConfig||{};if(!e.image_url||!e.audio_url){D.warning(this.$t(`kling.message.talkingPhotoMissingInputs`));return}let t=ge(e),n=this.createPaymentOperation(e=>U.talkingPhoto(t,e));n&&(D.info(this.$t(`kling.message.startingTask`)),W(`kling`,n).then(e=>{this.recordWalletTask(e),D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>this.handleGenerationError(e)).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)}))}}}),Ba={class:`flex flex-col h-full`},Va={class:`flex-1 min-h-0`};function Ha(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(`showcase-result-tabs`),y=l(`layout`);return g(),f(y,null,{config:p(()=>[e(`div`,Ba,[a(u,{"model-value":t.taskType,"onUpdate:modelValue":t.onTabChange},null,8,[`model-value`,`onUpdate:modelValue`]),e(`div`,Va,[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(v,{service:`kling`},{tasks:p(()=>[a(_,{ref:`recentPanel`,loading:t.loadingMore,onReachTop:t.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})]),_:1})}var Ua=R(za,[[`render`,Ha]]);export{Ua as default};
@@ -1 +1 @@
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,j as u,mt as d,rt as f,tt as p,z as m}from"./vendor-chart-Dw-P17PN.js";import{r as h,t as g}from"./select-GALwUZll.js";import{t as _}from"./upload-Sju4DbiY.js";import{t as v}from"./tooltip-4w7ghPQM.js";import{t as y}from"./alert-BprQRUmf.js";import{_ as b,v as x}from"./vuex.esm-bundler-BV9tXD4i.js";import{t as S}from"./clock-BooSG6zB.js";import{t as C}from"./hash-GTQkcsQj.js";import{t as w}from"./info-PmX6OJ8X.js";import{a as T,i as E,n as D,r as O,t as k}from"./pagination-W-HQ78h5.js";import{t as A}from"./trash-2-BkEkcSHv.js";import{t as j}from"./triangle-alert-DBmpuUlm.js";import{t as M}from"./wand-sparkles-CwgjO5Gl.js";import{kr as N}from"./constants-GmVIn7tC.js";import{D as P,Mi as F,Na as I,Pi as L,Qa as R,T as ee,Tn as te,at as z,ct as B,fr as V,lt as H,oi as U,ot as W,pr as G,qi as K,ri as q,st as J,ta as Y,tt as X,za as Z}from"./index-Dr2ooWnm.js";import{t as Q}from"./CopyToClipboard-CQT78wob.js";import{t as ne}from"./ReportButton-B6G5OWJ0.js";import{t as re}from"./ImagePreview-YXx0To-U.js";import{t as ie}from"./ServicePricingSummary-rLPlqY7R.js";import{t as ae}from"./VideoPlayer-DuUSbT-p.js";import{t as oe}from"./ScenarioPaymentMode-DRMdqOm9.js";import{t as se}from"./ApiCodeButton-DSt2Pz0O.js";import{t as ce}from"./BotPlaceholder-BC8u-j84.js";import{t as le}from"./taskPollingMixin-CcLxtz8z.js";import{t as ue}from"./Hailuo-ClYsc7Vc.js";import{n as de,t as fe}from"./generationInput--J_4Niw5.js";var pe=m({name:`ModelSelector`,components:{ElSelect:h,ElOption:g},data(){return{}},computed:{options(){return[{value:`minimax-t2v`,label:this.$t(`hailuo.button.model1`)},{value:`minimax-i2v`,label:this.$t(`hailuo.button.model2`)},{value:`minimax-i2v-director`,label:this.$t(`hailuo.button.model3`)}]},value:{get(){return this.$store.state.hailuo?.config?.model},set(e){this.$store.commit(`hailuo/setConfig`,{...this.$store.state.hailuo?.config,model:e})}}},mounted(){this.value||=N}}),me={class:`field`},he={class:`title font-bold`},ge={class:`float-left`};function _e(t,n,r,o,m,h){let g=l(`el-option`),_=l(`el-select`);return p(),s(`div`,me,[e(`h2`,he,i(t.$t(`hailuo.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`hailuo.placeholder.select`),clearable:``},{default:d(()=>[(p(!0),s(c,null,f(t.options,t=>(p(),u(g,{key:t.value,label:t.label,value:t.value},{default:d(()=>[e(`span`,ge,i(t.label),1)]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var ve=P(pe,[[`render`,_e],[`__scopeId`,`data-v-a768fbd9`]]),ye=m({name:`StartImageUrlInput`,components:{ElUpload:_,ElButton:R,InfoIcon:T,ImagePreview:re},mixins:[H,B,W,X],data(){return{fileList:[],uploadUrl:I()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e.url).filter(e=>e!==void 0)},value:{get(){return this.$store.state.hailuo?.config?.first_image_url},set(){let e=this.urls?.[0];this.$store.commit(`hailuo/setConfig`,{...this.$store.state.hailuo?.config,first_image_url:e})}}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){x.warning(this.$t(`hailuo.message.uploadStartImageExceed`))},onError(){x.error(this.$t(`hailuo.message.uploadStartImageError`))},async onRemove(){x.error(this.$t(`hailuo.message.uploadStartImageError`))},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`hailuo/setConfig`,{...this.$store.state.hailuo?.config,first_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),be={class:`relative`},xe={class:`flex justify-between`},Se={class:`flex justify-start items-center`},Ce={class:`text-sm font-bold`};function we(t,n,c,f,m,h){let g=l(`info-icon`),_=l(`image-preview`),v=l(`el-button`),y=l(`el-upload`);return p(),s(`div`,be,[e(`div`,xe,[e(`div`,Se,[e(`span`,Ce,i(t.$t(`hailuo.name.startImageUrl`)),1),a(g,{content:t.$t(`hailuo.description.startImageUrl`),class:`info`},null,8,[`content`])])]),a(y,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,"show-file-list":!0,limit:1,multiple:!1,"list-type":`picture`,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-remove":t.onRemove,"on-success":t.onSuccess,headers:t.headers},{file:d(({file:e})=>[e.url&&e.percentage!==void 0?(p(),u(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:d(()=>[a(v,{size:`small`,type:`primary`,class:`btn btn-upload`,round:``},{default:d(()=>[r(i(t.$t(`hailuo.button.uploadStartImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-remove`,`on-success`,`headers`])])}var Te=P(ye,[[`render`,we],[`__scopeId`,`data-v-322d7e4c`]]),Ee=m({name:`PromptInput`,components:{PromptTextarea:E},computed:{prompt:{get(){return this.$store.state.hailuo?.config?.prompt},set(e){this.$store.commit(`hailuo/setConfig`,{...this.$store.state.hailuo?.config,prompt:e})}}},mounted(){this.prompt||=``}});function De(e,t,n,r,i,a){let o=l(`prompt-textarea`);return p(),u(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`hailuo.name.prompt`),info:e.$t(`hailuo.description.prompt`),placeholder:e.$t(`hailuo.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Oe=m({name:`PresetPanel`,components:{MagicIcon:M,ElButton:R,PromptInput:P(Ee,[[`render`,De]]),StartImageUrlInput:Te,ModelSelector:ve,ServicePricingSummary:ie,ScenarioPaymentMode:oe},emits:[`generate`],data(){return{quoteTimer:0,quoteRunId:0}},computed:{canGenerate(){return fe(`hailuo`,V(this.config))},config(){return this.$store.state.hailuo?.config},consumption(){return te(this.config,this.service?.cost)},service(){return this.$store.state.hailuo?.service},walletMode(){return F()&&L(`hailuo`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=L(`hailuo`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,350))},async refreshQuote(){if(!this.canGenerate)return;let e=L(`hailuo`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await G.quote(V(this.config));t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)}}}),ke={class:`flex flex-col h-full`},Ae={class:`flex-1 overflow-y-auto p-5`},je={class:`flex flex-col items-center justify-center px-5 pb-5`};function Me(t,n,c,f,m,h){let g=l(`prompt-input`),_=l(`model-selector`),v=l(`start-image-url-input`),y=l(`scenario-payment-mode`),b=l(`service-pricing-summary`),x=l(`magic-icon`),S=l(`el-button`);return p(),s(`div`,ke,[e(`div`,Ae,[a(g,{class:`mb-4`}),a(_,{class:`mb-4`}),t.config?.model===`minimax-i2v`?(p(),u(v,{key:0,class:`mb-4`})):o(``,!0)]),e(`div`,je,[a(y,{scenario:`hailuo`}),t.walletMode?o(``,!0):(p(),u(b,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),t.config?.video_url!==void 0||t.config?.custom?(p(),u(S,{key:1,type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:d(()=>[a(x,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`hailuo.button.extend`)),1)]),_:1},8,[`disabled`,`onClick`])):(p(),u(S,{key:2,type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:d(()=>[a(x,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`hailuo.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`]))])])}var Ne=P(Oe,[[`render`,Me]]),Pe=m({name:`TaskPreview`,components:{DeleteIcon:A,ChannelIcon:C,InfoIcon:w,MagicIcon:M,TimeIcon:S,WarningIcon:j,CopyToClipboard:Q,ElAlert:y,VideoPlayer:ae,ElTooltip:v,ElButton:R,ApiCodeButton:se,ReportButton:ne},props:{modelValue:{type:Object,required:!0}},computed:{isFailure(){let e=this.modelValue?.response;return e?.success===!1||!!e?.error||this.video?.state===`failed`||this.video?.state===`cancelled`},isWaiting(){return!this.modelValue?.response||!this.isFailure&&[`queued`,`pending`,`processing`,`running`].includes(this.video?.state||``)},application(){return this.$store.state.hailuo?.application},config(){return this.$store.state.hailuo?.config},video(){return this.modelValue?.response?.data?.[0]}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await Z.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`hailuo/deleteTask`,{id:e}),x.success(this.$t(`common.message.deleteTaskSuccess`))}catch{x.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e){console.debug(`on download hailuo video`,e),window.open(e,`_blank`)}}}),Fe={class:`preview`},Ie={class:`left`},Le={class:`main`},Re={class:`bot`},ze={class:`datetime`},Be=[`aria-label`],Ve={class:`info`},He={key:0,class:`prompt mt-2`},Ue={key:0},We={key:1},Ge={key:0,class:n({content:!0,failed:!0})},Ke={key:0,class:`mb-4`},qe={key:1,class:n({operations:!0,"mt-2":!0})},Je={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ye={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Xe={key:1,class:n({content:!0})},Ze={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Qe={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$e={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},et={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},tt={key:2,class:n({content:!0})},nt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function rt(n,c,f,m,h,g){let _=l(`capability-presentation`),v=l(`delete-icon`),y=l(`el-tooltip`),b=l(`video-player`),x=l(`el-button`),S=l(`api-code-button`),C=l(`report-button`),w=l(`channel-icon`),T=l(`copy-to-clipboard`),E=l(`magic-icon`),D=l(`time-icon`),O=l(`el-alert`),k=l(`warning-icon`),A=l(`info-icon`);return p(),s(`div`,Fe,[e(`div`,Ie,[a(_,{capability:`hailuo`,part:`avatar`,class:`avatar`})]),e(`div`,Le,[e(`div`,Re,[a(_,{capability:`hailuo`,part:`name`}),e(`span`,ze,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(y,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:d(()=>[n.modelValue?.id?(p(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:c[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(v,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Be)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Ve,[n.modelValue?.request?.prompt?(p(),s(`p`,He,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(p(),s(`span`,Ue,` - (`+i(n.$t(`hailuo.status.pending`))+`) `,1)),n.modelValue?.response&&n.isWaiting?(p(),s(`span`,We,` - (`+i(n.$t(`hailuo.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),n.modelValue?.response?.success===!0&&!n.isFailure&&!n.isWaiting?(p(),s(`div`,Ge,[n.video?.video_url?(p(),s(`div`,Ke,[a(b,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?(p(),s(`div`,qe,[a(y,{class:`box-item`,effect:`dark`,content:n.$t(`hailuo.message.downloadVideo`),placement:`top-start`},{default:d(()=>[n.video?.video_url?(p(),u(x,{key:0,type:`info`,size:`small`,class:`mb-2`,onClick:c[1]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:d(()=>[r(i(n.$t(`hailuo.button.download`)),1)]),_:1})):o(``,!0)]),_:1},8,[`content`]),a(S,{path:`/hailuo/videos`,body:n.modelValue?.request},null,8,[`body`]),a(C,{service:`hailuo`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(O,{closable:!1,class:`mt-2 success`},{default:d(()=>[n.modelValue?.request?.model?(p(),s(`p`,Je,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.model`))+`: `+i(n.modelValue?.request?.model)+` `,1),a(T,{content:n.modelValue?.id},null,8,[`content`])])):o(``,!0),e(`p`,$,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(p(),s(`p`,Ye,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.isFailure?(p(),s(`div`,Xe,[a(O,{closable:!1,class:`failure`},{template:d(()=>[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.failure`)),1)]),default:d(()=>[e(`p`,Ze,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,Qe,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(T,{content:n.modelValue?.response?.error?.message},null,8,[`content`])]),n.modelValue?.elapsed?(p(),s(`p`,$e,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),e(`p`,et,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(T,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])]),_:1})])):o(``,!0),n.isWaiting?(p(),s(`div`,tt,[a(O,{closable:!1,class:`info`},{template:d(()=>[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(n.modelValue?.response?`hailuo.status.processing`:`hailuo.status.pending`)),1)]),default:d(()=>[e(`p`,nt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})])):o(``,!0)])])}var it=m({name:`RecentPanel`,components:{TaskPreview:P(Pe,[[`render`,rt],[`__scopeId`,`data-v-f8835e7e`]]),BotPlaceholder:ce,NoTasks:O,ScrollList:D},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.hailuo?.tasks,items:this.$store.state.hailuo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),at={key:0},ot={key:2,class:`w-full h-full flex items-center justify-center`};function st(e,t,n,r,i,m){let h=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return p(),s(c,null,[e.tasks?.items===void 0?(p(),s(`div`,at,[a(h)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(p(),u(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:d(()=>[(p(!0),s(c,null,f(e.tasks?.items,e=>(p(),u(g,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(p(),s(`div`,ot,[a(v)])):o(``,!0)],64)}var ct=m({name:`HailuoIndex`,components:{ConfigPanel:Ne,Layout:ue,RecentPanel:P(it,[[`render`,st]])},mixins:[J,le(`hailuo`)],inject:[`initialized`],data(){return{task:void 0,job:0,timer:void 0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.hailuo?.status?.getApplications===b.Request},tasksLoading(){return this.$store.state.hailuo?.status?.getTasks===b.Request||this.fetchingTasks},credential(){return this.$store.state.hailuo.credential},config(){return this.$store.state.hailuo.config},application(){return this.$store.state.hailuo.application},tasks(){return this.$store.state.hailuo.tasks},walletMode(){return F()&&L(`hailuo`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`hailuo/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},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.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await k({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`hailuo/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`hailuo/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();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(`hailuo/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(){let e=V(this.config),t=de(`hailuo`,e);if(t){x.error(this.$t(`common.message.${t}`));return}if(!z(this.uploadTracker,e=>this.$t(e),e=>x.warning(e)))return;let n;if(this.walletMode){let t=this.getWalletContext();if(!t){x.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}n=G.generate(e,{mode:`x402`,x402:{wallet:t,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!Y())return;let t=this.credential?.token;if(!t)return;n=G.generate(e,{token:t})}x.info(this.$t(`hailuo.message.startingTask`)),K(`hailuo`,n).then(e=>{let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),x.success(this.$t(`hailuo.message.startTaskSuccess`))}).catch(e=>{e instanceof q||ee(e,`hailuo`)||(this.walletMode?x.error(this.$t(`common.x402Scenario.paymentFailed`)):x.error(this.$t(`hailuo.message.startTaskFailed`)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return U(this.$wallet)},async confirmWalletPayment(e){return Z.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function lt(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),f=l(`layout`);return p(),u(f,null,{config:d(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:d(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var ut=P(ct,[[`render`,lt]]);export{ut as default};
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,j as u,mt as d,rt as f,tt as p,z as m}from"./vendor-chart-Dw-P17PN.js";import{r as h,t as g}from"./select-Dxkn5fnG.js";import{t as _}from"./upload-ChEGBjQd.js";import{t as v}from"./tooltip-CsVgfK1f.js";import{t as y}from"./alert-BprQRUmf.js";import{_ as b,v as x}from"./vuex.esm-bundler-uM-kqbAF.js";import{t as S}from"./clock-B6Xmh354.js";import{t as C}from"./hash-BKpZIJo7.js";import{t as w}from"./info-CDs2D83H.js";import{a as T,i as E,n as D,r as O,t as k}from"./pagination-BGnYVZvp.js";import{t as A}from"./trash-2-rtHpr3JN.js";import{t as j}from"./triangle-alert-D_wd4w3Z.js";import{t as M}from"./wand-sparkles-CReI7Ekg.js";import{kr as N}from"./constants-CVb0vrXj.js";import{D as P,Fi as F,Ha as I,Ia as L,Li as R,T as ee,Tn as te,Xi as z,at as B,ct as V,fr as H,ia as U,li as W,lt as G,oi as K,ot as q,pr as J,st as Y,to as X,tt as Z}from"./index-C643U2rX.js";import{t as Q}from"./CopyToClipboard-Dc_53C_9.js";import{t as ne}from"./ReportButton-BCWM_eUv.js";import{t as re}from"./ImagePreview-QrO7VB3T.js";import{t as ie}from"./ServicePricingSummary-BnnhtPm5.js";import{t as ae}from"./VideoPlayer-Bt19ZgtM.js";import{t as oe}from"./ScenarioPaymentMode-DUv_xCgb.js";import{t as se}from"./ApiCodeButton-DBR9tGBM.js";import{t as ce}from"./BotPlaceholder-Cl_V5koZ.js";import{t as le}from"./taskPollingMixin-CcLxtz8z.js";import{t as ue}from"./Hailuo-CBlo8oMQ.js";import{n as de,t as fe}from"./generationInput-jeoGp56s.js";var pe=m({name:`ModelSelector`,components:{ElSelect:h,ElOption:g},data(){return{}},computed:{options(){return[{value:`minimax-t2v`,label:this.$t(`hailuo.button.model1`)},{value:`minimax-i2v`,label:this.$t(`hailuo.button.model2`)},{value:`minimax-i2v-director`,label:this.$t(`hailuo.button.model3`)}]},value:{get(){return this.$store.state.hailuo?.config?.model},set(e){this.$store.commit(`hailuo/setConfig`,{...this.$store.state.hailuo?.config,model:e})}}},mounted(){this.value||=N}}),me={class:`field`},he={class:`title font-bold`},ge={class:`float-left`};function _e(t,n,r,o,m,h){let g=l(`el-option`),_=l(`el-select`);return p(),s(`div`,me,[e(`h2`,he,i(t.$t(`hailuo.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`hailuo.placeholder.select`),clearable:``},{default:d(()=>[(p(!0),s(c,null,f(t.options,t=>(p(),u(g,{key:t.value,label:t.label,value:t.value},{default:d(()=>[e(`span`,ge,i(t.label),1)]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var ve=P(pe,[[`render`,_e],[`__scopeId`,`data-v-a768fbd9`]]),ye=m({name:`StartImageUrlInput`,components:{ElUpload:_,ElButton:X,InfoIcon:T,ImagePreview:re},mixins:[G,V,q,Z],data(){return{fileList:[],uploadUrl:L()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e.url).filter(e=>e!==void 0)},value:{get(){return this.$store.state.hailuo?.config?.first_image_url},set(){let e=this.urls?.[0];this.$store.commit(`hailuo/setConfig`,{...this.$store.state.hailuo?.config,first_image_url:e})}}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){x.warning(this.$t(`hailuo.message.uploadStartImageExceed`))},onError(){x.error(this.$t(`hailuo.message.uploadStartImageError`))},async onRemove(){x.error(this.$t(`hailuo.message.uploadStartImageError`))},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`hailuo/setConfig`,{...this.$store.state.hailuo?.config,first_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),be={class:`relative`},xe={class:`flex justify-between`},Se={class:`flex justify-start items-center`},Ce={class:`text-sm font-bold`};function we(t,n,c,f,m,h){let g=l(`info-icon`),_=l(`image-preview`),v=l(`el-button`),y=l(`el-upload`);return p(),s(`div`,be,[e(`div`,xe,[e(`div`,Se,[e(`span`,Ce,i(t.$t(`hailuo.name.startImageUrl`)),1),a(g,{content:t.$t(`hailuo.description.startImageUrl`),class:`info`},null,8,[`content`])])]),a(y,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,"show-file-list":!0,limit:1,multiple:!1,"list-type":`picture`,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-remove":t.onRemove,"on-success":t.onSuccess,headers:t.headers},{file:d(({file:e})=>[e.url&&e.percentage!==void 0?(p(),u(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:d(()=>[a(v,{size:`small`,type:`primary`,class:`btn btn-upload`,round:``},{default:d(()=>[r(i(t.$t(`hailuo.button.uploadStartImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-remove`,`on-success`,`headers`])])}var Te=P(ye,[[`render`,we],[`__scopeId`,`data-v-322d7e4c`]]),Ee=m({name:`PromptInput`,components:{PromptTextarea:E},computed:{prompt:{get(){return this.$store.state.hailuo?.config?.prompt},set(e){this.$store.commit(`hailuo/setConfig`,{...this.$store.state.hailuo?.config,prompt:e})}}},mounted(){this.prompt||=``}});function De(e,t,n,r,i,a){let o=l(`prompt-textarea`);return p(),u(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`hailuo.name.prompt`),info:e.$t(`hailuo.description.prompt`),placeholder:e.$t(`hailuo.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Oe=m({name:`PresetPanel`,components:{MagicIcon:M,ElButton:X,PromptInput:P(Ee,[[`render`,De]]),StartImageUrlInput:Te,ModelSelector:ve,ServicePricingSummary:ie,ScenarioPaymentMode:oe},emits:[`generate`],data(){return{quoteTimer:0,quoteRunId:0}},computed:{canGenerate(){return fe(`hailuo`,H(this.config))},config(){return this.$store.state.hailuo?.config},consumption(){return te(this.config,this.service?.cost)},service(){return this.$store.state.hailuo?.service},walletMode(){return F()&&R(`hailuo`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=R(`hailuo`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,350))},async refreshQuote(){if(!this.canGenerate)return;let e=R(`hailuo`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await J.quote(H(this.config));t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)}}}),ke={class:`flex flex-col h-full`},Ae={class:`flex-1 overflow-y-auto p-5`},je={class:`flex flex-col items-center justify-center px-5 pb-5`};function Me(t,n,c,f,m,h){let g=l(`prompt-input`),_=l(`model-selector`),v=l(`start-image-url-input`),y=l(`scenario-payment-mode`),b=l(`service-pricing-summary`),x=l(`magic-icon`),S=l(`el-button`);return p(),s(`div`,ke,[e(`div`,Ae,[a(g,{class:`mb-4`}),a(_,{class:`mb-4`}),t.config?.model===`minimax-i2v`?(p(),u(v,{key:0,class:`mb-4`})):o(``,!0)]),e(`div`,je,[a(y,{scenario:`hailuo`}),t.walletMode?o(``,!0):(p(),u(b,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),t.config?.video_url!==void 0||t.config?.custom?(p(),u(S,{key:1,type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:d(()=>[a(x,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`hailuo.button.extend`)),1)]),_:1},8,[`disabled`,`onClick`])):(p(),u(S,{key:2,type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:d(()=>[a(x,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`hailuo.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`]))])])}var Ne=P(Oe,[[`render`,Me]]),Pe=m({name:`TaskPreview`,components:{DeleteIcon:A,ChannelIcon:C,InfoIcon:w,MagicIcon:M,TimeIcon:S,WarningIcon:j,CopyToClipboard:Q,ElAlert:y,VideoPlayer:ae,ElTooltip:v,ElButton:X,ApiCodeButton:se,ReportButton:ne},props:{modelValue:{type:Object,required:!0}},computed:{isFailure(){let e=this.modelValue?.response;return e?.success===!1||!!e?.error||this.video?.state===`failed`||this.video?.state===`cancelled`},isWaiting(){return!this.modelValue?.response||!this.isFailure&&[`queued`,`pending`,`processing`,`running`].includes(this.video?.state||``)},application(){return this.$store.state.hailuo?.application},config(){return this.$store.state.hailuo?.config},video(){return this.modelValue?.response?.data?.[0]}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await I.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`hailuo/deleteTask`,{id:e}),x.success(this.$t(`common.message.deleteTaskSuccess`))}catch{x.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e){console.debug(`on download hailuo video`,e),window.open(e,`_blank`)}}}),Fe={class:`preview`},Ie={class:`left`},Le={class:`main`},Re={class:`bot`},ze={class:`datetime`},Be=[`aria-label`],Ve={class:`info`},He={key:0,class:`prompt mt-2`},Ue={key:0},We={key:1},Ge={key:0,class:n({content:!0,failed:!0})},Ke={key:0,class:`mb-4`},qe={key:1,class:n({operations:!0,"mt-2":!0})},Je={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ye={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Xe={key:1,class:n({content:!0})},Ze={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Qe={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$e={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},et={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},tt={key:2,class:n({content:!0})},nt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function rt(n,c,f,m,h,g){let _=l(`capability-presentation`),v=l(`delete-icon`),y=l(`el-tooltip`),b=l(`video-player`),x=l(`el-button`),S=l(`api-code-button`),C=l(`report-button`),w=l(`channel-icon`),T=l(`copy-to-clipboard`),E=l(`magic-icon`),D=l(`time-icon`),O=l(`el-alert`),k=l(`warning-icon`),A=l(`info-icon`);return p(),s(`div`,Fe,[e(`div`,Ie,[a(_,{capability:`hailuo`,part:`avatar`,class:`avatar`})]),e(`div`,Le,[e(`div`,Re,[a(_,{capability:`hailuo`,part:`name`}),e(`span`,ze,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(y,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:d(()=>[n.modelValue?.id?(p(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:c[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(v,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Be)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Ve,[n.modelValue?.request?.prompt?(p(),s(`p`,He,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(p(),s(`span`,Ue,` - (`+i(n.$t(`hailuo.status.pending`))+`) `,1)),n.modelValue?.response&&n.isWaiting?(p(),s(`span`,We,` - (`+i(n.$t(`hailuo.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),n.modelValue?.response?.success===!0&&!n.isFailure&&!n.isWaiting?(p(),s(`div`,Ge,[n.video?.video_url?(p(),s(`div`,Ke,[a(b,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?(p(),s(`div`,qe,[a(y,{class:`box-item`,effect:`dark`,content:n.$t(`hailuo.message.downloadVideo`),placement:`top-start`},{default:d(()=>[n.video?.video_url?(p(),u(x,{key:0,type:`info`,size:`small`,class:`mb-2`,onClick:c[1]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:d(()=>[r(i(n.$t(`hailuo.button.download`)),1)]),_:1})):o(``,!0)]),_:1},8,[`content`]),a(S,{path:`/hailuo/videos`,body:n.modelValue?.request},null,8,[`body`]),a(C,{service:`hailuo`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(O,{closable:!1,class:`mt-2 success`},{default:d(()=>[n.modelValue?.request?.model?(p(),s(`p`,Je,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.model`))+`: `+i(n.modelValue?.request?.model)+` `,1),a(T,{content:n.modelValue?.id},null,8,[`content`])])):o(``,!0),e(`p`,$,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(p(),s(`p`,Ye,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.isFailure?(p(),s(`div`,Xe,[a(O,{closable:!1,class:`failure`},{template:d(()=>[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.failure`)),1)]),default:d(()=>[e(`p`,Ze,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,Qe,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(T,{content:n.modelValue?.response?.error?.message},null,8,[`content`])]),n.modelValue?.elapsed?(p(),s(`p`,$e,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),e(`p`,et,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(T,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])]),_:1})])):o(``,!0),n.isWaiting?(p(),s(`div`,tt,[a(O,{closable:!1,class:`info`},{template:d(()=>[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(n.modelValue?.response?`hailuo.status.processing`:`hailuo.status.pending`)),1)]),default:d(()=>[e(`p`,nt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})])):o(``,!0)])])}var it=m({name:`RecentPanel`,components:{TaskPreview:P(Pe,[[`render`,rt],[`__scopeId`,`data-v-f8835e7e`]]),BotPlaceholder:ce,NoTasks:O,ScrollList:D},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.hailuo?.tasks,items:this.$store.state.hailuo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),at={key:0},ot={key:2,class:`w-full h-full flex items-center justify-center`};function st(e,t,n,r,i,m){let h=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return p(),s(c,null,[e.tasks?.items===void 0?(p(),s(`div`,at,[a(h)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(p(),u(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:d(()=>[(p(!0),s(c,null,f(e.tasks?.items,e=>(p(),u(g,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(p(),s(`div`,ot,[a(v)])):o(``,!0)],64)}var ct=m({name:`HailuoIndex`,components:{ConfigPanel:Ne,Layout:ue,RecentPanel:P(it,[[`render`,st]])},mixins:[Y,le(`hailuo`)],inject:[`initialized`],data(){return{task:void 0,job:0,timer:void 0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.hailuo?.status?.getApplications===b.Request},tasksLoading(){return this.$store.state.hailuo?.status?.getTasks===b.Request||this.fetchingTasks},credential(){return this.$store.state.hailuo.credential},config(){return this.$store.state.hailuo.config},application(){return this.$store.state.hailuo.application},tasks(){return this.$store.state.hailuo.tasks},walletMode(){return F()&&R(`hailuo`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`hailuo/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},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.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await k({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`hailuo/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`hailuo/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();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(`hailuo/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(){let e=H(this.config),t=de(`hailuo`,e);if(t){x.error(this.$t(`common.message.${t}`));return}if(!B(this.uploadTracker,e=>this.$t(e),e=>x.warning(e)))return;let n;if(this.walletMode){let t=this.getWalletContext();if(!t){x.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}n=J.generate(e,{mode:`x402`,x402:{wallet:t,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!U())return;let t=this.credential?.token;if(!t)return;n=J.generate(e,{token:t})}x.info(this.$t(`hailuo.message.startingTask`)),z(`hailuo`,n).then(e=>{let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),x.success(this.$t(`hailuo.message.startTaskSuccess`))}).catch(e=>{e instanceof K||ee(e,`hailuo`)||(this.walletMode?x.error(this.$t(`common.x402Scenario.paymentFailed`)):x.error(this.$t(`hailuo.message.startTaskFailed`)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return W(this.$wallet)},async confirmWalletPayment(e){return I.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function lt(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),f=l(`layout`);return p(),u(f,null,{config:d(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:d(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var ut=P(ct,[[`render`,lt]]);export{ut as default};
@@ -1 +1 @@
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,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{t as v}from"./upload-Sju4DbiY.js";import{t as y}from"./tooltip-4w7ghPQM.js";import{t as b}from"./alert-BprQRUmf.js";import{_ as x,v as S}from"./vuex.esm-bundler-BV9tXD4i.js";import{t as C}from"./drawer-APcI0MuL.js";import{t as w}from"./switch-4nC3Yz4b.js";import{t as T}from"./clock-BooSG6zB.js";import{t as E}from"./hash-GTQkcsQj.js";import{t as D}from"./info-PmX6OJ8X.js";import{a as O,i as k,n as A,r as j,t as ee}from"./pagination-W-HQ78h5.js";import{t as te}from"./trash-2-BkEkcSHv.js";import{t as ne}from"./triangle-alert-DBmpuUlm.js";import{t as M}from"./upload-DidTvyIg.js";import{t as N}from"./wand-sparkles-CwgjO5Gl.js";import"./constants-GmVIn7tC.js";import{D as P,Mi as F,Na as I,Pi as L,Qa as R,Rr as z,T as re,Tn as ie,at as ae,ct as B,lt as V,oi as H,ot as U,qi as W,ri as G,st as K,ta as q,tt as J,za as Y,zr as X}from"./index-Dr2ooWnm.js";import{t as oe}from"./CopyToClipboard-CQT78wob.js";import{t as se}from"./ReportButton-B6G5OWJ0.js";import{t as ce}from"./FilePreview-D640d7Cq.js";import{t as Z}from"./ImagePreview-YXx0To-U.js";import{n as le}from"./taskDrawerMixin-DyAUhFEq.js";import{t as ue}from"./ServicePricingSummary-rLPlqY7R.js";import{t as Q}from"./VideoPlayer-DuUSbT-p.js";import{t as de}from"./ScenarioPaymentMode-DRMdqOm9.js";import{t as fe}from"./ApiCodeButton-DSt2Pz0O.js";import{t as pe}from"./BotPlaceholder-BC8u-j84.js";import{t as me}from"./taskPollingMixin-CcLxtz8z.js";var he=_({name:`LayoutLuma`,components:{MagicIcon:N,ElDrawer:C,ElButton:R},mixins:[le]}),ge={class:`main flex flex-row flex-1`},_e={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)]`},ve={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function ye(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,ge,[e(`div`,_e,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,ve,[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`]),[[g,!t.tasksEmpty]]),a(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var be=P(he,[[`render`,ye],[`__scopeId`,`data-v-4ab11479`]]),xe=_({name:`EnhancementSelector`,components:{ElSwitch:w,InfoIcon:O},computed:{value:{get(){return this.$store.state.luma?.config?.enhancement},set(e){console.debug(`set enhancement`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,enhancement:e})}}},mounted(){this.value===void 0&&(this.value=!0)}}),Se={class:`relative`},Ce={class:`flex justify-between`},we={class:`flex justify-start items-center`},Te={class:`text-sm font-bold`},Ee={class:`flex justify-end items-center`};function De(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,Se,[e(`div`,Ce,[e(`div`,we,[e(`span`,Te,i(t.$t(`luma.name.enhancement`)),1),a(d,{content:t.$t(`luma.description.enhancement`)},null,8,[`content`])]),e(`div`,Ee,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var Oe=P(xe,[[`render`,De]]),ke=_({name:`CustomSelector`,components:{ElSwitch:w,InfoIcon:O},computed:{value:{get(){return this.$store.state.luma?.config?.custom},set(e){console.debug(`set custom`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,custom:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),Ae={class:`relative`},je={class:`flex justify-between`},Me={class:`flex justify-start items-center`},Ne={class:`text-sm font-bold`},Pe={class:`flex justify-end items-center`};function Fe(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,Ae,[e(`div`,je,[e(`div`,Me,[e(`span`,Ne,i(t.$t(`luma.name.custom`)),1),a(d,{content:t.$t(`luma.description.custom`)},null,8,[`content`])]),e(`div`,Pe,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var Ie=P(ke,[[`render`,Fe]]),Le=_({name:`LoopSelector`,components:{ElSwitch:w,InfoIcon:O},computed:{value:{get(){return this.$store.state.luma?.config?.loop},set(e){console.debug(`set loop`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,loop:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),Re={class:`relative`},ze={class:`flex justify-between`},Be={class:`flex justify-start items-center`},Ve={class:`text-sm font-bold`},He={class:`flex justify-end items-center`};function Ue(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,Re,[e(`div`,ze,[e(`div`,Be,[e(`span`,Ve,i(t.$t(`luma.name.loop`)),1),a(d,{content:t.$t(`luma.description.loop`)},null,8,[`content`])]),e(`div`,He,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var We=P(Le,[[`render`,Ue]]),Ge=_({name:`EndImage`,components:{UploadIcon:M,ElUpload:v,ElButton:R,ImagePreview:Z,InfoIcon:O},mixins:[V,B,U,J],data(){return{fileList:[],uploadUrl:I()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.luma?.config?.start_image_url},set(){}}},mounted(){this.value||=void 0,this.onSetEndImageUrl()},methods:{onExceed(){S.warning(this.$t(`luma.message.uploadReferencesExceed`))},onError(){S.error(this.$t(`luma.message.uploadReferencesError`))},onSetEndImageUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),Ke={class:`relative`},qe={class:`flex justify-between`},Je={class:`flex justify-start items-center`},Ye={class:`text-sm font-bold`};function Xe(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,Ke,[e(`div`,qe,[e(`div`,Je,[e(`span`,Ye,i(t.$t(`luma.name.endImageUrl`)),1),a(g,{content:t.$t(`luma.description.endImageUrl`)},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:5,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,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?(h(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},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(`luma.button.uploadEndImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Ze=P(Ge,[[`render`,Xe],[`__scopeId`,`data-v-04c461bb`]]),Qe=_({name:`StartImage`,components:{UploadIcon:M,ElUpload:v,ElButton:R,ImagePreview:Z,InfoIcon:O},mixins:[V,B,U,J],data(){return{fileList:[],uploadUrl:I()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.luma?.config?.start_image_url},set(){}}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){S.warning(this.$t(`luma.message.uploadReferencesExceed`))},onError(){S.error(this.$t(`luma.message.uploadReferencesError`))},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),$e={class:`relative`},et={class:`flex justify-between`},tt={class:`flex justify-start items-center`},nt={class:`text-sm font-bold`};function rt(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,$e,[e(`div`,et,[e(`div`,tt,[e(`span`,nt,i(t.$t(`luma.name.startImageUrl`)),1),a(g,{content:t.$t(`luma.description.startImageUrl`)},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:5,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,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.percentage==null?o(``,!0):(h(),f(_,{key:0,url:e.url||e.response.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},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(`luma.button.uploadStartImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var it=P(Qe,[[`render`,rt],[`__scopeId`,`data-v-31c07a19`]]),at=_({name:`UploadVideo`,components:{UploadIcon:M,ElUpload:v,ElButton:R,InfoIcon:O,FilePreview:ce},mixins:[B,U],data(){return{fileList:[],uploadUrl:I()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.luma?.config?.video_url},set(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_url:e})}}},mounted(){this.value||=void 0},methods:{onExceed(){S.warning(this.$t(`luma.message.uploadVideoExceed`))},onError(){S.error(this.$t(`luma.message.uploadVideoError`))},beforeUpload(e){let t=e.type===`video/mp4`,n=e.size/1024/1024<10;return t?n?!0:(S.error(this.$t(`luma.message.uploadVideoSizeExceed`)),!1):(S.error(this.$t(`luma.message.uploadVideoTypeFailed`)),!1)},onSetVideoUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_url:e,action:`extend`})},async onSuccess(){this.onSetVideoUrl()}}}),ot={class:`relative`},st={class:`flex justify-between`},ct={class:`flex justify-start items-center`},lt={class:`text-sm font-bold`};function ut(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,ot,[e(`div`,st,[e(`div`,ct,[e(`span`,lt,i(t.$t(`luma.name.videoUrl`)),1),a(g,{content:t.$t(`luma.description.videoUrl`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4`,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==null?o(``,!0):(h(),f(_,{key:0,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},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(`luma.button.uploadVideoUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var dt=P(at,[[`render`,ut],[`__scopeId`,`data-v-2189fc52`]]),ft=_({name:`PromptInput`,components:{PromptTextarea:k},computed:{prompt:{get(){return this.$store.state.luma?.config?.prompt},set(e){this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,prompt:e})}}},mounted(){this.prompt||=``}});function pt(e,t,n,r,i,a){let o=l(`prompt-textarea`);return h(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`luma.name.prompt`),info:e.$t(`luma.description.prompt`),placeholder:e.$t(`luma.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var mt=P(ft,[[`render`,pt]]),ht=_({name:`ExtendFromInput`,components:{VideoPlayer:Q},props:{modelValue:{type:Object,required:!1,default:void 0}},data(){return{options:{quality:{default:`1080p`}}}},computed:{config(){return this.$store.state.luma?.config}}}),gt={class:`relative`},_t={class:`flex mb-2`},vt={class:`text-sm font-bold`};function yt(t,n,r,a,c,u){let d=l(`video-player`);return h(),s(`div`,gt,[e(`div`,_t,[e(`span`,vt,i(t.$t(`luma.name.extend`)),1)]),e(`div`,null,[t.config?.video_url?(h(),f(d,{key:0,src:t.config?.video_url},null,8,[`src`])):o(``,!0)])])}var bt=_({name:`ConfigPanel`,components:{MagicIcon:N,LoopSelector:We,StartImageInput:it,EndImageInput:Ze,EnhancementSelector:Oe,ElButton:R,PromptInput:mt,ExtendFromInput:P(ht,[[`render`,yt]]),CustomSelector:Ie,UploadVideo:dt,ServicePricingSummary:ue,ScenarioPaymentMode:de},emits:[`generate`],data(){return{quoteTimer:0,quoteRunId:0}},computed:{config(){return this.$store.state.luma?.config},consumption(){return ie(this.config,this.service?.cost)},service(){return this.$store.state.luma?.service},walletMode(){return F()&&L(`luma`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteTimer=window.setTimeout(this.refreshQuote,350)},async refreshQuote(){let e=L(`luma`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await X.quote(z(this.config));t===this.quoteRunId&&e.mode===`wallet`&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)}}}),xt={class:`flex flex-col h-full`},St={class:`flex-1 overflow-y-auto p-5`},Ct={class:`flex flex-col items-center justify-center px-5 pb-5`};function wt(t,n,c,u,d,m){let g=l(`extend-from-input`),_=l(`prompt-input`),v=l(`custom-selector`),y=l(`upload-video`),b=l(`start-image-input`),x=l(`end-image-input`),S=l(`enhancement-selector`),C=l(`loop-selector`),w=l(`scenario-payment-mode`),T=l(`service-pricing-summary`),E=l(`magic-icon`),D=l(`el-button`);return h(),s(`div`,xt,[e(`div`,St,[t.config?.video_id||t.config?.video_url?(h(),f(g,{key:0,class:`mb-4`})):o(``,!0),a(_,{class:`mb-4`}),t.config?.video_id?o(``,!0):(h(),f(v,{key:1,class:`mb-4`})),t.config?.custom?(h(),f(y,{key:2,class:`mb-4`})):o(``,!0),!(t.config?.video_id||t.config?.video_url)&&!t.config?.custom?(h(),f(b,{key:3,class:`mb-4`})):o(``,!0),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`})]),e(`div`,Ct,[a(w,{scenario:`luma`}),t.walletMode?o(``,!0):(h(),f(T,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),t.config?.video_url!==void 0||t.config?.custom?(h(),f(D,{key:1,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(E,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.extend`)),1)]),_:1},8,[`onClick`])):(h(),f(D,{key:2,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(E,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.generate`)),1)]),_:1},8,[`onClick`]))])])}var Tt=P(bt,[[`render`,wt]]),Et=_({name:`TaskPreview`,components:{DeleteIcon:te,ChannelIcon:E,InfoIcon:D,MagicIcon:N,TimeIcon:T,WarningIcon:ne,CopyToClipboard:oe,ElAlert:b,VideoPlayer:Q,ElTooltip:y,ElButton:R,ApiCodeButton:fe,ReportButton:se},props:{modelValue:{type:Object,required:!0}},emits:[`extend`],data(){return{}},computed:{application(){return this.$store.state.luma?.application},config(){return this.$store.state.luma?.config}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await Y.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`luma/deleteTask`,{id:e}),S.success(this.$t(`common.message.deleteTaskSuccess`))}catch{S.error(this.$t(`common.message.deleteTaskFailed`))}}},onExtend(e,t){console.debug(`set config`,t),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_id:t.video_id,prompt:t.prompt,action:`extend`,thumbnail_url:t.thumbnail_url,video_url:t.video_url}),this.$emit(`extend`)},onDownload(e){window.open(e,`_blank`)}}}),Dt={class:`preview`},Ot={class:`left`},kt={class:`main`},At={class:`bot`},jt={class:`datetime`},Mt=[`aria-label`],Nt={class:`info`},Pt={key:0,class:`prompt mt-2`},Ft={key:0},It={key:1},Lt={key:0,class:n({content:!0,failed:!0})},Rt={key:0,class:`mb-4`},zt={key:1,class:n({operations:!0,"mt-2":!0,"mb-4":!0})},Bt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Vt={key:1,class:n({content:!0})},Ht={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ut={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Wt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Gt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Kt={key:2,class:n({content:!0})},qt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Jt(n,c,u,d,f,m){let g=l(`capability-presentation`),_=l(`delete-icon`),v=l(`el-tooltip`),y=l(`video-player`),b=l(`el-button`),x=l(`api-code-button`),S=l(`report-button`),C=l(`magic-icon`),w=l(`copy-to-clipboard`),T=l(`time-icon`),E=l(`el-alert`),D=l(`warning-icon`),O=l(`info-icon`),k=l(`channel-icon`);return h(),s(`div`,Dt,[e(`div`,Ot,[a(g,{capability:`luma`,part:`avatar`,class:`avatar`})]),e(`div`,kt,[e(`div`,At,[a(g,{capability:`luma`,part:`name`}),e(`span`,jt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(v,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(h(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:c[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(_,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Mt)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Nt,[n.modelValue?.request?.prompt?(h(),s(`p`,Pt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,Ft,` - (`+i(n.$t(`luma.status.pending`))+`) `,1)),n.modelValue?.response?.state===`processing`||n.modelValue?.response?.state===`pending`?(h(),s(`span`,It,` - (`+i(n.$t(`luma.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),n.modelValue?.response?.success===!0?(h(),s(`div`,Lt,[n.modelValue.response.video_url?(h(),s(`div`,Rt,[a(y,{src:n.modelValue.response.video_url},null,8,[`src`])])):o(``,!0),n.modelValue?.response&&!n.config?.custom?(h(),s(`div`,zt,[a(v,{class:`box-item`,effect:`dark`,content:n.$t(`luma.message.extendVideo`),placement:`top-start`},{default:p(()=>[a(b,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=t(e=>n.onExtend(e,n.modelValue?.response),[`stop`])},{default:p(()=>[r(i(n.$t(`luma.button.extend`)),1)]),_:1})]),_:1},8,[`content`]),a(v,{class:`box-item`,effect:`dark`,content:n.$t(`luma.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(b,{type:`info`,size:`small`,class:`btn-action`,onClick:c[2]||=t(e=>n.onDownload(n.modelValue?.response?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`luma.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(x,{path:`/luma/videos`,body:n.modelValue?.request},null,8,[`body`]),a(S,{service:`luma`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(E,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,Bt,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,$,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.modelValue?.response?.state===`failed`||n.modelValue?.response?.success===!1?(h(),s(`div`,Vt,[a(E,{closable:!1,class:`failure`},{template:p(()=>[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.failure`)),1)]),default:p(()=>[e(`p`,Ht,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,Ut,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(w,{content:n.modelValue?.response?.error?.message},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,Wt,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),e(`p`,Gt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.traceId`))+`: `+i(n.modelValue?.trace_id)+` `,1),a(w,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])]),_:1})])):o(``,!0),!n.modelValue?.response||n.modelValue?.response?.state===`processing`||n.modelValue?.response?.state===`pending`?(h(),s(`div`,Kt,[a(E,{closable:!1,class:`info`},{template:p(()=>[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(n.modelValue?.response?`luma.status.processing`:`luma.status.pending`)),1)]),default:p(()=>[e(`p`,qt,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})])):o(``,!0)])])}var Yt=_({name:`RecentPanel`,components:{BotPlaceholder:pe,TaskPreview:P(Et,[[`render`,Jt],[`__scopeId`,`data-v-46a32bda`]]),NoTasks:j,ScrollList:A},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`,`extend`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.luma?.tasks,items:this.$store.state.luma?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Xt={key:0},Zt={key:2,class:`w-full h-full flex items-center justify-center`};function Qt(e,t,n,r,i,u){let d=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return h(),s(c,null,[e.tasks?.items===void 0?(h(),s(`div`,Xt,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),f(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[1]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(h(!0),s(c,null,m(e.tasks?.items,n=>(h(),f(g,{key:n.id,"model-value":n,onExtend:t[0]||=t=>e.$emit(`extend`)},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(h(),s(`div`,Zt,[a(v)])):o(``,!0)],64)}var $t=_({name:`LumaIndex`,components:{ConfigPanel:Tt,Layout:be,RecentPanel:P(Yt,[[`render`,Qt]])},mixins:[K,me(`luma`)],inject:[`initialized`],emits:[`extend`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.luma?.status?.getApplications===x.Request},tasksLoading(){return this.$store.state.luma?.status?.getTasks===x.Request||this.fetchingTasks},credential(){return this.$store.state.luma.credential},config(){return this.$store.state.luma.config},application(){return this.$store.state.luma.application},tasks(){return this.$store.state.luma.tasks},walletMode(){return F()&&L(`luma`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`luma/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},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.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ee({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`luma/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`luma/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){console.debug(`scrolling down`),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(`luma/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!ae(this.uploadTracker,e=>this.$t(e),e=>S.warning(e)))return;let e=z(this.config);if(!this.hasText(e.prompt)){S.error(this.$t(`luma.message.promptRequired`));return}e.prompt=e.prompt?.trim();let t;if(this.walletMode){let n=this.getWalletContext();if(!n){S.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}t=X.generate(e,{mode:`x402`,x402:{wallet:n,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!q())return;let n=this.credential?.token;if(!n)return;t=X.generate(e,{token:n})}S.info(this.$t(`luma.message.startingTask`)),W(`luma`,t).then(e=>{let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),S.success(this.$t(`luma.message.startTaskSuccess`))}).catch(e=>{e instanceof G||re(e,`luma`)||(this.walletMode?S.error(this.$t(`common.x402Scenario.paymentFailed`)):S.error(this.$t(`luma.message.startTaskFailed`)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return H(this.$wallet)},async confirmWalletPayment(e){return Y.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},hasText(e){return typeof e==`string`&&e.trim().length>0}}});function en(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return h(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop,onExtend:t[0]||=t=>e.$emit(`extend`)},null,8,[`loading`,`onReachTop`])]),_:1})}var tn=P($t,[[`render`,en]]);export{tn as default};
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,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{t as v}from"./upload-ChEGBjQd.js";import{t as y}from"./tooltip-CsVgfK1f.js";import{t as b}from"./alert-BprQRUmf.js";import{_ as x,v as S}from"./vuex.esm-bundler-uM-kqbAF.js";import{t as C}from"./drawer-CF4BsAtW.js";import{t as w}from"./switch-FNAnbKSR.js";import{t as T}from"./clock-B6Xmh354.js";import{t as E}from"./hash-BKpZIJo7.js";import{t as D}from"./info-CDs2D83H.js";import{a as O,i as k,n as A,r as j,t as ee}from"./pagination-BGnYVZvp.js";import{t as te}from"./trash-2-rtHpr3JN.js";import{t as M}from"./triangle-alert-D_wd4w3Z.js";import{t as N}from"./upload-DoPPJ2yy.js";import{t as P}from"./wand-sparkles-CReI7Ekg.js";import"./constants-CVb0vrXj.js";import{D as F,Fi as I,Ha as L,Hr as R,Ia as z,Li as B,T as ne,Tn as re,Vr as V,Xi as ie,at as ae,ct as H,ia as U,li as W,lt as G,oi as K,ot as q,st as J,to as Y,tt as X}from"./index-C643U2rX.js";import{t as oe}from"./CopyToClipboard-Dc_53C_9.js";import{t as se}from"./ReportButton-BCWM_eUv.js";import{t as ce}from"./FilePreview-C0VlAjUT.js";import{t as Z}from"./ImagePreview-QrO7VB3T.js";import{n as le}from"./taskDrawerMixin-DyAUhFEq.js";import{t as ue}from"./ServicePricingSummary-BnnhtPm5.js";import{t as Q}from"./VideoPlayer-Bt19ZgtM.js";import{t as de}from"./ScenarioPaymentMode-DUv_xCgb.js";import{t as fe}from"./ApiCodeButton-DBR9tGBM.js";import{t as pe}from"./BotPlaceholder-Cl_V5koZ.js";import{t as me}from"./taskPollingMixin-CcLxtz8z.js";var he=_({name:`LayoutLuma`,components:{MagicIcon:P,ElDrawer:C,ElButton:Y},mixins:[le]}),ge={class:`main flex flex-row flex-1`},_e={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)]`},ve={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function ye(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,ge,[e(`div`,_e,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,ve,[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`]),[[g,!t.tasksEmpty]]),a(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var be=F(he,[[`render`,ye],[`__scopeId`,`data-v-4ab11479`]]),xe=_({name:`EnhancementSelector`,components:{ElSwitch:w,InfoIcon:O},computed:{value:{get(){return this.$store.state.luma?.config?.enhancement},set(e){console.debug(`set enhancement`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,enhancement:e})}}},mounted(){this.value===void 0&&(this.value=!0)}}),Se={class:`relative`},Ce={class:`flex justify-between`},we={class:`flex justify-start items-center`},Te={class:`text-sm font-bold`},Ee={class:`flex justify-end items-center`};function De(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,Se,[e(`div`,Ce,[e(`div`,we,[e(`span`,Te,i(t.$t(`luma.name.enhancement`)),1),a(d,{content:t.$t(`luma.description.enhancement`)},null,8,[`content`])]),e(`div`,Ee,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var Oe=F(xe,[[`render`,De]]),ke=_({name:`CustomSelector`,components:{ElSwitch:w,InfoIcon:O},computed:{value:{get(){return this.$store.state.luma?.config?.custom},set(e){console.debug(`set custom`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,custom:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),Ae={class:`relative`},je={class:`flex justify-between`},Me={class:`flex justify-start items-center`},Ne={class:`text-sm font-bold`},Pe={class:`flex justify-end items-center`};function Fe(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,Ae,[e(`div`,je,[e(`div`,Me,[e(`span`,Ne,i(t.$t(`luma.name.custom`)),1),a(d,{content:t.$t(`luma.description.custom`)},null,8,[`content`])]),e(`div`,Pe,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var Ie=F(ke,[[`render`,Fe]]),Le=_({name:`LoopSelector`,components:{ElSwitch:w,InfoIcon:O},computed:{value:{get(){return this.$store.state.luma?.config?.loop},set(e){console.debug(`set loop`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,loop:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),Re={class:`relative`},ze={class:`flex justify-between`},Be={class:`flex justify-start items-center`},Ve={class:`text-sm font-bold`},He={class:`flex justify-end items-center`};function Ue(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,Re,[e(`div`,ze,[e(`div`,Be,[e(`span`,Ve,i(t.$t(`luma.name.loop`)),1),a(d,{content:t.$t(`luma.description.loop`)},null,8,[`content`])]),e(`div`,He,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var We=F(Le,[[`render`,Ue]]),Ge=_({name:`EndImage`,components:{UploadIcon:N,ElUpload:v,ElButton:Y,ImagePreview:Z,InfoIcon:O},mixins:[G,H,q,X],data(){return{fileList:[],uploadUrl:z()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.luma?.config?.start_image_url},set(){}}},mounted(){this.value||=void 0,this.onSetEndImageUrl()},methods:{onExceed(){S.warning(this.$t(`luma.message.uploadReferencesExceed`))},onError(){S.error(this.$t(`luma.message.uploadReferencesError`))},onSetEndImageUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),Ke={class:`relative`},qe={class:`flex justify-between`},Je={class:`flex justify-start items-center`},Ye={class:`text-sm font-bold`};function Xe(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,Ke,[e(`div`,qe,[e(`div`,Je,[e(`span`,Ye,i(t.$t(`luma.name.endImageUrl`)),1),a(g,{content:t.$t(`luma.description.endImageUrl`)},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:5,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,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?(h(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},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(`luma.button.uploadEndImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Ze=F(Ge,[[`render`,Xe],[`__scopeId`,`data-v-04c461bb`]]),Qe=_({name:`StartImage`,components:{UploadIcon:N,ElUpload:v,ElButton:Y,ImagePreview:Z,InfoIcon:O},mixins:[G,H,q,X],data(){return{fileList:[],uploadUrl:z()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.luma?.config?.start_image_url},set(){}}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){S.warning(this.$t(`luma.message.uploadReferencesExceed`))},onError(){S.error(this.$t(`luma.message.uploadReferencesError`))},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),$e={class:`relative`},et={class:`flex justify-between`},tt={class:`flex justify-start items-center`},nt={class:`text-sm font-bold`};function rt(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,$e,[e(`div`,et,[e(`div`,tt,[e(`span`,nt,i(t.$t(`luma.name.startImageUrl`)),1),a(g,{content:t.$t(`luma.description.startImageUrl`)},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:5,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,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.percentage==null?o(``,!0):(h(),f(_,{key:0,url:e.url||e.response.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},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(`luma.button.uploadStartImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var it=F(Qe,[[`render`,rt],[`__scopeId`,`data-v-31c07a19`]]),at=_({name:`UploadVideo`,components:{UploadIcon:N,ElUpload:v,ElButton:Y,InfoIcon:O,FilePreview:ce},mixins:[H,q],data(){return{fileList:[],uploadUrl:z()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.luma?.config?.video_url},set(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_url:e})}}},mounted(){this.value||=void 0},methods:{onExceed(){S.warning(this.$t(`luma.message.uploadVideoExceed`))},onError(){S.error(this.$t(`luma.message.uploadVideoError`))},beforeUpload(e){let t=e.type===`video/mp4`,n=e.size/1024/1024<10;return t?n?!0:(S.error(this.$t(`luma.message.uploadVideoSizeExceed`)),!1):(S.error(this.$t(`luma.message.uploadVideoTypeFailed`)),!1)},onSetVideoUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_url:e,action:`extend`})},async onSuccess(){this.onSetVideoUrl()}}}),ot={class:`relative`},st={class:`flex justify-between`},ct={class:`flex justify-start items-center`},lt={class:`text-sm font-bold`};function ut(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,ot,[e(`div`,st,[e(`div`,ct,[e(`span`,lt,i(t.$t(`luma.name.videoUrl`)),1),a(g,{content:t.$t(`luma.description.videoUrl`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4`,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==null?o(``,!0):(h(),f(_,{key:0,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},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(`luma.button.uploadVideoUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var dt=F(at,[[`render`,ut],[`__scopeId`,`data-v-2189fc52`]]),ft=_({name:`PromptInput`,components:{PromptTextarea:k},computed:{prompt:{get(){return this.$store.state.luma?.config?.prompt},set(e){this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,prompt:e})}}},mounted(){this.prompt||=``}});function pt(e,t,n,r,i,a){let o=l(`prompt-textarea`);return h(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`luma.name.prompt`),info:e.$t(`luma.description.prompt`),placeholder:e.$t(`luma.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var mt=F(ft,[[`render`,pt]]),ht=_({name:`ExtendFromInput`,components:{VideoPlayer:Q},props:{modelValue:{type:Object,required:!1,default:void 0}},data(){return{options:{quality:{default:`1080p`}}}},computed:{config(){return this.$store.state.luma?.config}}}),gt={class:`relative`},_t={class:`flex mb-2`},vt={class:`text-sm font-bold`};function yt(t,n,r,a,c,u){let d=l(`video-player`);return h(),s(`div`,gt,[e(`div`,_t,[e(`span`,vt,i(t.$t(`luma.name.extend`)),1)]),e(`div`,null,[t.config?.video_url?(h(),f(d,{key:0,src:t.config?.video_url},null,8,[`src`])):o(``,!0)])])}var bt=_({name:`ConfigPanel`,components:{MagicIcon:P,LoopSelector:We,StartImageInput:it,EndImageInput:Ze,EnhancementSelector:Oe,ElButton:Y,PromptInput:mt,ExtendFromInput:F(ht,[[`render`,yt]]),CustomSelector:Ie,UploadVideo:dt,ServicePricingSummary:ue,ScenarioPaymentMode:de},emits:[`generate`],data(){return{quoteTimer:0,quoteRunId:0}},computed:{config(){return this.$store.state.luma?.config},consumption(){return re(this.config,this.service?.cost)},service(){return this.$store.state.luma?.service},walletMode(){return I()&&B(`luma`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteTimer=window.setTimeout(this.refreshQuote,350)},async refreshQuote(){let e=B(`luma`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await R.quote(V(this.config));t===this.quoteRunId&&e.mode===`wallet`&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)}}}),xt={class:`flex flex-col h-full`},St={class:`flex-1 overflow-y-auto p-5`},Ct={class:`flex flex-col items-center justify-center px-5 pb-5`};function wt(t,n,c,u,d,m){let g=l(`extend-from-input`),_=l(`prompt-input`),v=l(`custom-selector`),y=l(`upload-video`),b=l(`start-image-input`),x=l(`end-image-input`),S=l(`enhancement-selector`),C=l(`loop-selector`),w=l(`scenario-payment-mode`),T=l(`service-pricing-summary`),E=l(`magic-icon`),D=l(`el-button`);return h(),s(`div`,xt,[e(`div`,St,[t.config?.video_id||t.config?.video_url?(h(),f(g,{key:0,class:`mb-4`})):o(``,!0),a(_,{class:`mb-4`}),t.config?.video_id?o(``,!0):(h(),f(v,{key:1,class:`mb-4`})),t.config?.custom?(h(),f(y,{key:2,class:`mb-4`})):o(``,!0),!(t.config?.video_id||t.config?.video_url)&&!t.config?.custom?(h(),f(b,{key:3,class:`mb-4`})):o(``,!0),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`})]),e(`div`,Ct,[a(w,{scenario:`luma`}),t.walletMode?o(``,!0):(h(),f(T,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),t.config?.video_url!==void 0||t.config?.custom?(h(),f(D,{key:1,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(E,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.extend`)),1)]),_:1},8,[`onClick`])):(h(),f(D,{key:2,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(E,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.generate`)),1)]),_:1},8,[`onClick`]))])])}var Tt=F(bt,[[`render`,wt]]),Et=_({name:`TaskPreview`,components:{DeleteIcon:te,ChannelIcon:E,InfoIcon:D,MagicIcon:P,TimeIcon:T,WarningIcon:M,CopyToClipboard:oe,ElAlert:b,VideoPlayer:Q,ElTooltip:y,ElButton:Y,ApiCodeButton:fe,ReportButton:se},props:{modelValue:{type:Object,required:!0}},emits:[`extend`],data(){return{}},computed:{application(){return this.$store.state.luma?.application},config(){return this.$store.state.luma?.config}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await L.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`luma/deleteTask`,{id:e}),S.success(this.$t(`common.message.deleteTaskSuccess`))}catch{S.error(this.$t(`common.message.deleteTaskFailed`))}}},onExtend(e,t){console.debug(`set config`,t),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_id:t.video_id,prompt:t.prompt,action:`extend`,thumbnail_url:t.thumbnail_url,video_url:t.video_url}),this.$emit(`extend`)},onDownload(e){window.open(e,`_blank`)}}}),Dt={class:`preview`},Ot={class:`left`},kt={class:`main`},At={class:`bot`},jt={class:`datetime`},Mt=[`aria-label`],Nt={class:`info`},Pt={key:0,class:`prompt mt-2`},Ft={key:0},It={key:1},Lt={key:0,class:n({content:!0,failed:!0})},Rt={key:0,class:`mb-4`},zt={key:1,class:n({operations:!0,"mt-2":!0,"mb-4":!0})},Bt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Vt={key:1,class:n({content:!0})},Ht={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ut={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Wt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Gt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Kt={key:2,class:n({content:!0})},qt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Jt(n,c,u,d,f,m){let g=l(`capability-presentation`),_=l(`delete-icon`),v=l(`el-tooltip`),y=l(`video-player`),b=l(`el-button`),x=l(`api-code-button`),S=l(`report-button`),C=l(`magic-icon`),w=l(`copy-to-clipboard`),T=l(`time-icon`),E=l(`el-alert`),D=l(`warning-icon`),O=l(`info-icon`),k=l(`channel-icon`);return h(),s(`div`,Dt,[e(`div`,Ot,[a(g,{capability:`luma`,part:`avatar`,class:`avatar`})]),e(`div`,kt,[e(`div`,At,[a(g,{capability:`luma`,part:`name`}),e(`span`,jt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(v,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(h(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:c[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(_,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Mt)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Nt,[n.modelValue?.request?.prompt?(h(),s(`p`,Pt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,Ft,` - (`+i(n.$t(`luma.status.pending`))+`) `,1)),n.modelValue?.response?.state===`processing`||n.modelValue?.response?.state===`pending`?(h(),s(`span`,It,` - (`+i(n.$t(`luma.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),n.modelValue?.response?.success===!0?(h(),s(`div`,Lt,[n.modelValue.response.video_url?(h(),s(`div`,Rt,[a(y,{src:n.modelValue.response.video_url},null,8,[`src`])])):o(``,!0),n.modelValue?.response&&!n.config?.custom?(h(),s(`div`,zt,[a(v,{class:`box-item`,effect:`dark`,content:n.$t(`luma.message.extendVideo`),placement:`top-start`},{default:p(()=>[a(b,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=t(e=>n.onExtend(e,n.modelValue?.response),[`stop`])},{default:p(()=>[r(i(n.$t(`luma.button.extend`)),1)]),_:1})]),_:1},8,[`content`]),a(v,{class:`box-item`,effect:`dark`,content:n.$t(`luma.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(b,{type:`info`,size:`small`,class:`btn-action`,onClick:c[2]||=t(e=>n.onDownload(n.modelValue?.response?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`luma.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(x,{path:`/luma/videos`,body:n.modelValue?.request},null,8,[`body`]),a(S,{service:`luma`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(E,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,Bt,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,$,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.modelValue?.response?.state===`failed`||n.modelValue?.response?.success===!1?(h(),s(`div`,Vt,[a(E,{closable:!1,class:`failure`},{template:p(()=>[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.failure`)),1)]),default:p(()=>[e(`p`,Ht,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,Ut,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(w,{content:n.modelValue?.response?.error?.message},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,Wt,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),e(`p`,Gt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.traceId`))+`: `+i(n.modelValue?.trace_id)+` `,1),a(w,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])]),_:1})])):o(``,!0),!n.modelValue?.response||n.modelValue?.response?.state===`processing`||n.modelValue?.response?.state===`pending`?(h(),s(`div`,Kt,[a(E,{closable:!1,class:`info`},{template:p(()=>[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(n.modelValue?.response?`luma.status.processing`:`luma.status.pending`)),1)]),default:p(()=>[e(`p`,qt,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})])):o(``,!0)])])}var Yt=_({name:`RecentPanel`,components:{BotPlaceholder:pe,TaskPreview:F(Et,[[`render`,Jt],[`__scopeId`,`data-v-46a32bda`]]),NoTasks:j,ScrollList:A},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`,`extend`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.luma?.tasks,items:this.$store.state.luma?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Xt={key:0},Zt={key:2,class:`w-full h-full flex items-center justify-center`};function Qt(e,t,n,r,i,u){let d=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return h(),s(c,null,[e.tasks?.items===void 0?(h(),s(`div`,Xt,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),f(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[1]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(h(!0),s(c,null,m(e.tasks?.items,n=>(h(),f(g,{key:n.id,"model-value":n,onExtend:t[0]||=t=>e.$emit(`extend`)},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(h(),s(`div`,Zt,[a(v)])):o(``,!0)],64)}var $t=_({name:`LumaIndex`,components:{ConfigPanel:Tt,Layout:be,RecentPanel:F(Yt,[[`render`,Qt]])},mixins:[J,me(`luma`)],inject:[`initialized`],emits:[`extend`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.luma?.status?.getApplications===x.Request},tasksLoading(){return this.$store.state.luma?.status?.getTasks===x.Request||this.fetchingTasks},credential(){return this.$store.state.luma.credential},config(){return this.$store.state.luma.config},application(){return this.$store.state.luma.application},tasks(){return this.$store.state.luma.tasks},walletMode(){return I()&&B(`luma`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`luma/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},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.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ee({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`luma/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`luma/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){console.debug(`scrolling down`),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(`luma/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!ae(this.uploadTracker,e=>this.$t(e),e=>S.warning(e)))return;let e=V(this.config);if(!this.hasText(e.prompt)){S.error(this.$t(`luma.message.promptRequired`));return}e.prompt=e.prompt?.trim();let t;if(this.walletMode){let n=this.getWalletContext();if(!n){S.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}t=R.generate(e,{mode:`x402`,x402:{wallet:n,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!U())return;let n=this.credential?.token;if(!n)return;t=R.generate(e,{token:n})}S.info(this.$t(`luma.message.startingTask`)),ie(`luma`,t).then(e=>{let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),S.success(this.$t(`luma.message.startTaskSuccess`))}).catch(e=>{e instanceof K||ne(e,`luma`)||(this.walletMode?S.error(this.$t(`common.x402Scenario.paymentFailed`)):S.error(this.$t(`luma.message.startTaskFailed`)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return W(this.$wallet)},async confirmWalletPayment(e){return L.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},hasText(e){return typeof e==`string`&&e.trim().length>0}}});function en(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return h(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop,onExtend:t[0]||=t=>e.$emit(`extend`)},null,8,[`loading`,`onReachTop`])]),_:1})}var tn=F($t,[[`render`,en]]);export{tn as default};
@@ -0,0 +1 @@
1
+ import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,I as n,Jt as r,L as i,M as a,N as o,S as s,T as c,at as l,ht as u,it as d,j as f,mt as p,ot as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{F as y}from"./icon-CDmWyIgD.js";import{r as b,t as x}from"./select-Dxkn5fnG.js";import{n as S,t as C}from"./tabs-0J-7r8zS.js";import{t as w}from"./upload-ChEGBjQd.js";import{t as T}from"./tooltip-CsVgfK1f.js";import{t as E}from"./alert-BprQRUmf.js";import{_ as D,v as O}from"./vuex.esm-bundler-uM-kqbAF.js";import{t as k}from"./avatar-DEN_WCPo.js";import{n as A,r as j}from"./radio-BNhFzeBO.js";import{n as M,t as N}from"./collapse-qfbCrPJN.js";import{t as P}from"./drawer-CF4BsAtW.js";import{n as F,r as ee,t as I}from"./dropdown-CLk44aHS.js";import{t as L}from"./input-number-YpK_vIUu.js";import{n as te,t as ne}from"./skeleton-Dj_a_iIP.js";import{t as re}from"./slider-DyGvOBhi.js";import{t as ie}from"./switch-FNAnbKSR.js";import{i as ae,n as oe,r as R,t as se}from"./Player-DMEqEzbG.js";import{t as ce}from"./code-7YWrTdfy.js";import{t as le}from"./download-aKoGQMz4.js";import{t as ue}from"./ellipsis-AczbhGQu.js";import{t as de}from"./hash-BKpZIJo7.js";import{t as fe}from"./image-Dsh8h-Vr.js";import{t as pe}from"./info-CDs2D83H.js";import{t as me}from"./loader-circle-BQqfluno.js";import{a as z,i as he,n as ge,r as _e,t as ve}from"./pagination-BGnYVZvp.js";import{t as B}from"./pause-BClTBQOr.js";import{t as V}from"./play-BZy52WBc.js";import{t as ye}from"./triangle-alert-D_wd4w3Z.js";import{t as be}from"./upload-DoPPJ2yy.js";import{t as H}from"./wand-sparkles-CReI7Ekg.js";import{Ka as xe,xr as Se}from"./constants-CVb0vrXj.js";import{$n as U,D as W,Fi as G,Ga as K,Ha as q,Ia as Ce,Ki as we,Li as J,Tn as Te,Xi as Ee,at as De,ct as Oe,er as Y,ia as ke,li as X,lo as Z,oi as Q,ot as Ae,st as je,to as $,tt as Me}from"./index-C643U2rX.js";import{t as Ne}from"./CopyToClipboard-Dc_53C_9.js";import{t as Pe}from"./ReportDialog-C4nnqvVc.js";import{n as Fe}from"./taskDrawerMixin-DyAUhFEq.js";import{t as Ie}from"./ServicePricingSummary-BnnhtPm5.js";import{t as Le}from"./ScenarioPaymentMode-DUv_xCgb.js";import{t as Re}from"./ApiCodeDialog-CCg8lOq_.js";import{t as ze}from"./taskPollingMixin-CcLxtz8z.js";import{t as Be}from"./showcaseRecreateMixin-BvSTHecE.js";import{n as Ve,t as He}from"./generationInput-jeoGp56s.js";var Ue=v({name:`LayoutProducer`,components:{MagicIcon:H,ElDrawer:P,ElButton:$},mixins:[Fe],data(){return{preview:!1}},computed:{}}),We={class:`main flex flex-row flex-1`},Ge={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)]`},Ke={class:`result h-full flex flex-col flex-1 min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`},qe={class:`preview h-full w-[300px] flex flex-col`};function Je(t,n,r,a,s,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),o(`div`,We,[e(`div`,Ge,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Ke,[d(t.$slots,`result`,{},void 0,!0)]),e(`div`,qe,[d(t.$slots,`preview`,{},void 0,!0)]),u(i(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(()=>[i(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[_,!t.tasksEmpty]]),i(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Ye=W(Ue,[[`render`,Je],[`__scopeId`,`data-v-6461643a`]]),Xe=v({name:`TypeSelector`,components:{ElSelect:b,ElOption:x,ElSwitch:ie,InfoIcon:z},data(){return{options:[{label:`FUZZ-2.0 Pro`,value:`FUZZ-2.0 Pro`,desc:this.$t(`producer.model.fuzz20proDesc`)},{label:`FUZZ-2.0`,value:`FUZZ-2.0`,desc:this.$t(`producer.model.fuzz20desc`)},{label:`FUZZ-2.0 Raw`,value:`FUZZ-2.0 Raw`,desc:this.$t(`producer.model.fuzz20rawDesc`)},{label:`FUZZ-1.1 Pro`,value:`FUZZ-1.1 Pro`,desc:this.$t(`producer.model.fuzz11proDesc`)},{label:`FUZZ-1.1`,value:`FUZZ-1.1`,desc:this.$t(`producer.model.fuzz11desc`)},{label:`FUZZ-1.0 Pro`,value:`FUZZ-1.0 Pro`,desc:this.$t(`producer.model.fuzz10proDesc`)},{label:`FUZZ-1.0`,value:`FUZZ-1.0`,desc:this.$t(`producer.model.fuzz10desc`)},{label:`FUZZ-0.8`,value:`FUZZ-0.8`,desc:this.$t(`producer.model.fuzz08desc`)}]}},computed:{custom:{get(){return this.$store.state.producer?.config?.custom||!1},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,custom:e})}},instrumental:{get(){return this.$store.state.producer?.config?.instrumental||!1},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,instrumental:e})}},model:{get(){return this.$store.state.producer?.config?.model},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,model:e})}}},mounted(){this.model||=Se}}),Ze={class:`mb-3`},Qe={class:`flex items-center mb-1`},$e={class:`text-sm font-bold`},et={class:`model-option`},tt={class:`model-option-name`},nt={class:`model-option-desc`},rt={key:0,class:`flex items-center justify-between mb-3`},it={class:`flex items-center`},at={class:`text-sm font-bold`};function ot(t,n,s,u,d,m){let _=l(`el-option`),v=l(`el-select`),y=l(`info-icon`),b=l(`el-switch`);return g(),o(`div`,null,[e(`div`,Ze,[e(`div`,Qe,[e(`span`,$e,r(t.$t(`producer.name.model`)),1)]),i(v,{modelValue:t.model,"onUpdate:modelValue":n[0]||=e=>t.model=e,class:`w-full model-select`,size:`default`,placeholder:t.$t(`producer.placeholder.select`)},{default:p(()=>[(g(!0),o(c,null,h(t.options,t=>(g(),f(_,{key:t.value,label:t.label,value:t.value},{default:p(()=>[e(`div`,et,[e(`span`,tt,r(t.label),1),e(`span`,nt,r(t.desc),1)])]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])]),t.custom?(g(),o(`div`,rt,[e(`div`,it,[e(`span`,at,r(t.$t(`producer.name.instrumental`)),1),i(y,{content:t.$t(`producer.description.instrumental`)},null,8,[`content`])]),i(b,{modelValue:t.instrumental,"onUpdate:modelValue":n[1]||=e=>t.instrumental=e},null,8,[`modelValue`])])):a(``,!0)])}var st=W(Xe,[[`render`,ot],[`__scopeId`,`data-v-42496b9a`]]),ct=v({name:`UploadAudio`,components:{UploadIcon:be,ElUpload:w,ElButton:$,ElRadioGroup:j,ElRadioButton:A,InfoIcon:z},mixins:[Oe,Ae,Me],emits:[`change`],data(){return{fileList:[],uploadUrl:Ce()+`/api/v1/files/`,audioPreviewUrl:null,uploading:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},credential(){return this.$store.state.producer.credential},config(){return this.$store.state.producer.config},urls(){return this.fileList.map(e=>e?.response?.file_url)},hasUploadedAudio(){let e=this.$store.state.producer?.config?.action;return e===`upload_extend`||e===`upload_cover`},uploadAction:{get(){return this.$store.state.producer?.config?.action||`upload_extend`},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,action:e})}}},watch:{urls:{handler(e){this.$emit(`change`,e)}}},methods:{onExceed(){O.warning(this.$t(`producer.message.uploadReferencesExceed`))},onError(){this.uploading=!1,O.error(this.$t(`producer.message.uploadReferencesError`))},async onSuccess(){let e=this.urls?.[0];if(!e){this.uploading=!1;return}this.audioPreviewUrl=e,await this.onGenerateAudioId(e)},async onGenerateAudioId(e){let t={audio_url:e},n=this.credential?.token;if(!n){console.error(`no token specified`),this.uploading=!1;return}this.uploading=!0,O.info(this.$t(`producer.message.startingUploadAudio`));try{let e=(await Y.upload(t,{token:n})).data?.data.audio_id;this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,audio_id:e,action:`upload_extend`}),O.success(this.$t(`producer.message.startUploadAudioSuccess`))}catch(e){O.error(e?.response?.data?.error?.message||this.$t(`producer.message.startUploadAudioFailed`))}finally{this.uploading=!1}}}}),lt={class:`relative`},ut={class:`flex justify-between items-center mb-2`},dt={class:`flex justify-start items-center`},ft={class:`text-sm font-bold`},pt={key:0,class:`mb-2`},mt=[`src`],ht={key:1,class:`mt-1`};function gt(t,s,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-upload`),y=l(`el-radio-button`),b=l(`el-radio-group`);return g(),o(`div`,lt,[e(`div`,ut,[e(`div`,dt,[e(`span`,ft,r(t.$t(`producer.name.referenceAudios`)),1),i(m,{content:t.$t(`producer.description.uploadAudios`)},null,8,[`content`])]),i(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":s[0]||=e=>t.fileList=e,name:`file`,limit:1,class:`upload-wrapper inline-upload`,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,accept:`.mp3,.wav,.m4a,audio/*`,"show-file-list":!1,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{default:p(()=>[i(_,{round:``,type:`primary`,size:`small`,loading:t.uploading},{default:p(()=>[i(h,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`producer.button.uploadAudios`)),1)]),_:1},8,[`loading`])]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])]),t.audioPreviewUrl?(g(),o(`div`,pt,[e(`audio`,{src:t.audioPreviewUrl,controls:``,class:`w-full`},null,8,mt)])):a(``,!0),t.hasUploadedAudio?(g(),o(`div`,ht,[i(b,{modelValue:t.uploadAction,"onUpdate:modelValue":s[1]||=e=>t.uploadAction=e,size:`small`},{default:p(()=>[i(y,{value:`upload_extend`},{default:p(()=>[n(r(t.$t(`producer.button.extend`)),1)]),_:1}),i(y,{value:`upload_cover`},{default:p(()=>[n(r(t.$t(`producer.button.cover_music`)),1)]),_:1})]),_:1},8,[`modelValue`])])):a(``,!0)])}var _t=W(ct,[[`render`,gt],[`__scopeId`,`data-v-3938abc2`]]),vt=v({name:`PromptInput`,components:{PromptTextarea:he},computed:{prompt:{get(){return this.$store.state.producer?.config?.prompt},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,prompt:e})}}},mounted(){this.prompt||=``}});function yt(e,t,n,r,i,a){let o=l(`prompt-textarea`);return g(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`producer.name.songDescription`),info:e.$t(`producer.description.prompt`),placeholder:e.$t(`producer.placeholder.prompt`),"min-rows":5,"max-rows":14},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var bt=W(vt,[[`render`,yt]]),xt=v({name:`LyricInput`,components:{MagicIcon:H,ElInput:Z,ElButton:$,InfoIcon:z},data(){return{generatingLyrics:!1}},computed:{lyric:{get(){return this.$store.state.producer?.config?.lyric},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,lyric:e})}},config(){return this.$store.state.producer?.config},credential(){return this.$store.state.producer?.credential},walletMode(){return G()&&J(`producer`).mode===`wallet`}},mounted(){this.lyric||=``},methods:{paymentOptions(){if(!this.walletMode){let e=this.credential?.token;return e?{token:e}:void 0}let e=this.getWalletContext();if(!e){O.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}return{mode:`x402`,x402:{wallet:e,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}}},async onGenerateLyrics(){let e=this.paymentOptions();if(!e)return;let t=this.config?.style||this.config?.title||`a beautiful song`;this.generatingLyrics=!0,O.info(this.$t(`producer.message.generatingLyrics`));try{let n=(await Y.lyric({prompt:t},e)).data?.data;n?.text&&(this.lyric=n.text,n?.title&&!this.config?.title&&this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,lyric:n.text,title:n.title}),O.success(this.$t(`producer.message.generateLyricsSuccess`)))}catch(e){if(e instanceof Q)return;O.error(this.$t(`producer.message.generateLyricsFailed`))}finally{this.generatingLyrics=!1}},getWalletContext(){return X(this.$wallet)},async confirmWalletPayment(e){return q.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)}}}),St={class:`field`},Ct={class:`flex items-center justify-between mb-1`},wt={class:`flex items-center`},Tt={class:`text-sm font-bold`};function Et(t,s,c,u,d,m){let h=l(`info-icon`),_=l(`magic-icon`),v=l(`el-button`),y=l(`el-input`);return g(),o(`div`,St,[e(`div`,Ct,[e(`div`,wt,[e(`span`,Tt,r(t.$t(`producer.name.lyrics`)),1),i(h,{content:t.$t(`producer.description.lyrics`)},null,8,[`content`])]),t.config?.action===`extend`?a(``,!0):(g(),f(v,{key:0,size:`small`,loading:t.generatingLyrics,round:``,onClick:t.onGenerateLyrics},{default:p(()=>[t.generatingLyrics?a(``,!0):(g(),f(_,{key:0,class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),n(` `+r(t.$t(`producer.button.generate_lyrics`)),1)]),_:1},8,[`loading`,`onClick`]))]),t.config?.action===`extend`?(g(),f(y,{key:1,modelValue:t.lyric,"onUpdate:modelValue":s[1]||=e=>t.lyric=e,rows:5,type:`textarea`,class:`lyrics`,placeholder:t.$t(`producer.placeholder.extend.lyrics`)},null,8,[`modelValue`,`placeholder`])):(g(),f(y,{key:0,modelValue:t.lyric,"onUpdate:modelValue":s[0]||=e=>t.lyric=e,rows:5,type:`textarea`,class:`lyrics`,placeholder:t.$t(`producer.placeholder.lyrics`)},null,8,[`modelValue`,`placeholder`]))])}var Dt=W(xt,[[`render`,Et],[`__scopeId`,`data-v-548b9253`]]),Ot=v({name:`StyleInput`,components:{ElInput:Z,InfoIcon:z},computed:{style:{get(){return this.$store.state.producer?.config?.style},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,style:e})}}}}),kt={class:`field`},At={class:`flex items-center justify-between mb-1`},jt={class:`flex items-center`},Mt={class:`text-sm font-bold`};function Nt(t,n,a,s,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),o(`div`,kt,[e(`div`,At,[e(`div`,jt,[e(`span`,Mt,r(t.$t(`producer.name.style`)),1),i(d,{content:t.$t(`producer.description.style`)},null,8,[`content`])])]),i(f,{modelValue:t.style,"onUpdate:modelValue":n[0]||=e=>t.style=e,rows:2,type:`textarea`,placeholder:t.$t(`producer.placeholder.style`)},null,8,[`modelValue`,`placeholder`])])}var Pt=W(Ot,[[`render`,Nt]]),Ft=v({name:`TitleInput`,components:{ElInput:Z,InfoIcon:z},computed:{title:{get(){return this.$store.state.producer?.config?.title},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,title:e})}}}}),It={class:`field`},Lt={class:`flex items-center mb-1`},Rt={class:`text-sm font-bold`};function zt(t,n,a,s,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),o(`div`,It,[e(`div`,Lt,[e(`span`,Rt,r(t.$t(`producer.name.title`)),1),i(d,{content:t.$t(`producer.description.title`)},null,8,[`content`])]),i(f,{modelValue:t.title,"onUpdate:modelValue":n[0]||=e=>t.title=e,placeholder:t.$t(`producer.placeholder.title`)},null,8,[`modelValue`,`placeholder`])])}var Bt=W(Ft,[[`render`,zt]]),Vt=v({name:`ExtendFromInput`,components:{ElImage:K,ElIcon:y,ElInputNumber:L,VideoPlay:V,VideoPause:B},data(){return{}},computed:{audio(){return this.$store.state.producer?.config?.audio},value:{get(){return this.$store.state.producer?.config?.continue_at},set(e){console.debug(`set continue_at`,e),this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,continue_at:e?parseInt(e):void 0})}}},mounted(){this.value||=void 0},methods:{handleChange(e){if(e===void 0){this.value=void 0;return}e<0?this.value=0:e>this.audio?.duration?this.value=this.audio?.duration:this.value=e},useFormatDuring:R,onPlay(e){this.$store.dispatch(`producer/setAudio`,{...this.$store.state.producer.audio,...e,state:`playing`}),console.log(`on play`)},onPause(e){this.$store.dispatch(`producer/setAudio`,{...this.$store.state.producer.audio,...e,state:`paused`}),console.log(`on pause`)},onClick(e){this.$store.state?.producer?.audio?.id!==e.id&&this.onPlay({...e,progress:0})}}}),Ht={class:`field`},Ut={class:`box`},Wt={class:`title font-bold`},Gt={class:`input-wrapper`},Kt={class:`task`},qt={class:`left`},Jt=[`aria-label`,`title`],Yt=[`aria-label`,`title`],Xt={key:2,class:`duration`},Zt={class:`info`},Qt={class:`title`},$t={class:`style`};function en(n,c,d,f,h,_){let v=l(`el-input-number`),y=l(`el-image`),b=l(`video-pause`),x=l(`el-icon`),S=l(`video-play`),C=m(`loading`);return g(),o(`div`,Ht,[e(`div`,Ut,[e(`h2`,Wt,r(n.$t(`producer.name.extend`)),1),e(`div`,Gt,[i(v,{modelValue:n.value,"onUpdate:modelValue":c[0]||=e=>n.value=e,class:`value`,min:0,max:n.audio?.duration,controls:!1,placeholder:n.$t(`producer.placeholder.extend.continue_at`),onChange:n.handleChange},null,8,[`modelValue`,`max`,`placeholder`,`onChange`])])]),e(`div`,Kt,[n.audio?(g(),o(`div`,{key:0,class:`audio`,onClick:c[7]||=e=>n.onClick(n.audio)},[u((g(),o(`div`,qt,[i(y,{src:n.audio?.image_url,class:`cover`,fit:`cover`},null,8,[`src`]),n.audio?.audio_url&&n.$store.state?.producer?.audio?.id===n.audio.id&&n.$store.state?.producer?.audio?.state===`playing`?(g(),o(`div`,{key:0,class:`overlay`,role:`button`,tabindex:`0`,"aria-label":n.$t(`common.player.pause`),title:n.$t(`common.player.pause`),onClick:c[1]||=e=>n.onPause(n.audio),onKeydown:[c[2]||=s(t(e=>n.onPause(n.audio),[`stop`,`prevent`]),[`enter`]),c[3]||=s(t(e=>n.onPause(n.audio),[`stop`,`prevent`]),[`space`])]},[i(x,null,{default:p(()=>[i(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})],40,Jt)):a(``,!0),n.audio?.audio_url&&(n.$store.state?.producer?.audio?.id!==n.audio.id||n.$store.state?.producer?.audio?.id===n.audio.id&&n.$store.state?.producer?.audio?.state===`paused`)?(g(),o(`div`,{key:1,class:`overlay`,role:`button`,tabindex:`0`,"aria-label":n.$t(`common.player.play`),title:n.$t(`common.player.play`),onClick:c[4]||=e=>n.onPlay(n.audio),onKeydown:[c[5]||=s(t(e=>n.onPlay(n.audio),[`stop`,`prevent`]),[`enter`]),c[6]||=s(t(e=>n.onPlay(n.audio),[`stop`,`prevent`]),[`space`])]},[i(x,null,{default:p(()=>[i(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})],40,Yt)):a(``,!0),n.audio?.duration?(g(),o(`div`,Xt,r(n.useFormatDuring(n.audio?.duration)),1)):a(``,!0)])),[[C,!n.audio?.audio_url]]),e(`div`,Zt,[e(`h2`,Qt,r(n.audio?.title),1),e(`p`,$t,r(n.audio?.style),1)])])):a(``,!0)])])}var tn=W(Vt,[[`render`,en],[`__scopeId`,`data-v-96005bd8`]]),nn=v({name:`CoverFromInput`,components:{ElImage:K,ElIcon:y,VideoPlay:V,VideoPause:B},data(){return{}},computed:{audio(){return this.$store.state.producer?.config?.audio},value:{get(){return this.$store.state.producer?.config?.continue_at},set(e){console.debug(`set continue_at`,e),this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,continue_at:e?parseInt(e):void 0})}}},mounted(){this.value||=void 0},methods:{handleChange(e){e<0?this.value=0:e>this.audio?.duration?this.value=this.audio?.duration:this.value=e},useFormatDuring:R,onPlay(e){this.$store.dispatch(`producer/setAudio`,{...this.$store.state.producer.audio,...e,state:`playing`}),console.log(`on play`)},onPause(e){this.$store.dispatch(`producer/setAudio`,{...this.$store.state.producer.audio,...e,state:`paused`}),console.log(`on pause`)},onClick(e){this.$store.state?.producer?.audio?.id!==e.id&&this.onPlay({...e,progress:0})}}}),rn={class:`field`},an={class:`box`},on={class:`title font-bold`},sn={class:`task`},cn={class:`left`},ln=[`aria-label`,`title`],un=[`aria-label`,`title`],dn={key:2,class:`duration`},fn={class:`info`},pn={class:`title`},mn={class:`style`};function hn(n,c,d,f,h,_){let v=l(`el-image`),y=l(`video-pause`),b=l(`el-icon`),x=l(`video-play`),S=m(`loading`);return g(),o(`div`,rn,[e(`div`,an,[e(`h2`,on,r(n.$t(`producer.name.cover`)),1)]),e(`div`,sn,[n.audio?(g(),o(`div`,{key:0,class:`audio`,onClick:c[6]||=e=>n.onClick(n.audio)},[u((g(),o(`div`,cn,[i(v,{src:n.audio?.image_url,class:`cover`,fit:`cover`},null,8,[`src`]),n.audio?.audio_url&&n.$store.state?.producer?.audio?.id===n.audio.id&&n.$store.state?.producer?.audio?.state===`playing`?(g(),o(`div`,{key:0,class:`overlay`,role:`button`,tabindex:`0`,"aria-label":n.$t(`common.player.pause`),title:n.$t(`common.player.pause`),onClick:c[0]||=e=>n.onPause(n.audio),onKeydown:[c[1]||=s(t(e=>n.onPause(n.audio),[`stop`,`prevent`]),[`enter`]),c[2]||=s(t(e=>n.onPause(n.audio),[`stop`,`prevent`]),[`space`])]},[i(b,null,{default:p(()=>[i(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})],40,ln)):a(``,!0),n.audio?.audio_url&&(n.$store.state?.producer?.audio?.id!==n.audio.id||n.$store.state?.producer?.audio?.id===n.audio.id&&n.$store.state?.producer?.audio?.state===`paused`)?(g(),o(`div`,{key:1,class:`overlay`,role:`button`,tabindex:`0`,"aria-label":n.$t(`common.player.play`),title:n.$t(`common.player.play`),onClick:c[3]||=e=>n.onPlay(n.audio),onKeydown:[c[4]||=s(t(e=>n.onPlay(n.audio),[`stop`,`prevent`]),[`enter`]),c[5]||=s(t(e=>n.onPlay(n.audio),[`stop`,`prevent`]),[`space`])]},[i(b,null,{default:p(()=>[i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})],40,un)):a(``,!0),n.audio?.duration?(g(),o(`div`,dn,r(n.useFormatDuring(n.audio?.duration)),1)):a(``,!0)])),[[S,!n.audio?.audio_url]]),e(`div`,fn,[e(`h2`,pn,r(n.audio?.title),1),e(`p`,mn,r(n.audio?.style),1)])])):a(``,!0)])])}var gn=W(nn,[[`render`,hn],[`__scopeId`,`data-v-9a4b0b16`]]),_n=v({name:`VocalGenderSelector`,components:{ElRadioGroup:j,ElRadioButton:A,InfoIcon:z},computed:{vocalGender:{get(){return this.$store.state.producer?.config?.vocal_gender||``},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,vocal_gender:e||void 0})}}}}),vn={class:`mb-2`},yn={class:`flex items-center mb-1`},bn={class:`text-sm font-bold`};function xn(t,a,s,c,u,d){let f=l(`info-icon`),m=l(`el-radio-button`),h=l(`el-radio-group`);return g(),o(`div`,vn,[e(`div`,yn,[e(`span`,bn,r(t.$t(`producer.name.vocalGender`)),1),i(f,{content:t.$t(`producer.description.vocalGender`)},null,8,[`content`])]),i(h,{modelValue:t.vocalGender,"onUpdate:modelValue":a[0]||=e=>t.vocalGender=e},{default:p(()=>[i(m,{value:``},{default:p(()=>[n(r(t.$t(`producer.gender.auto`)),1)]),_:1}),i(m,{value:`f`},{default:p(()=>[n(r(t.$t(`producer.gender.female`)),1)]),_:1}),i(m,{value:`m`},{default:p(()=>[n(r(t.$t(`producer.gender.male`)),1)]),_:1})]),_:1},8,[`modelValue`])])}var Sn=W(_n,[[`render`,xn]]),Cn=v({name:`AdvancedParams`,components:{ElCollapse:N,ElCollapseItem:M,ElInput:Z,ElSlider:re,ElInputNumber:L,InfoIcon:z},data(){return{activeNames:[]}},computed:{config(){return this.$store.state.producer?.config},styleNegative:{get(){return this.$store.state.producer?.config?.style_negative||``},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,style_negative:e||void 0})}},lyricPrompt:{get(){return this.$store.state.producer?.config?.lyric_prompt||``},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,lyric_prompt:e||void 0})}},weirdness:{get(){return this.$store.state.producer?.config?.weirdness??.5},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,weirdness:e})}},soundStrength:{get(){return this.$store.state.producer?.config?.sound_strength??.7},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,sound_strength:e})}},lyricsStrength:{get(){return this.$store.state.producer?.config?.lyrics_strength??.7},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,lyrics_strength:e})}},seed:{get(){return this.$store.state.producer?.config?.seed},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,seed:e})}}},mounted(){let e=this.$store.state.producer?.config;if(!e)return;let t={};typeof e.weirdness==`number`&&e.weirdness>1&&(t.weirdness=e.weirdness/100),typeof e.sound_strength==`number`&&e.sound_strength>1&&(t.sound_strength=e.sound_strength/100),typeof e.lyrics_strength==`number`&&e.lyrics_strength>1&&(t.lyrics_strength=e.lyrics_strength/100),Object.keys(t).length>0&&this.$store.commit(`producer/setConfig`,{...e,...t})}}),wn={key:0,class:`mb-3`},Tn={class:`flex items-center mb-1`},En={class:`text-xs font-bold`},Dn={key:1,class:`mb-3`},On={class:`flex items-center mb-1`},kn={class:`text-xs font-bold`},An={class:`mb-3`},jn={class:`flex items-center justify-between mb-1`},Mn={class:`flex items-center`},Nn={class:`text-xs font-bold`},Pn={class:`text-xs text-[var(--el-text-color-secondary)]`},Fn={class:`mb-3`},In={class:`flex items-center justify-between mb-1`},Ln={class:`flex items-center`},Rn={class:`text-xs font-bold`},zn={class:`text-xs text-[var(--el-text-color-secondary)]`},Bn={key:2,class:`mb-3`},Vn={class:`flex items-center justify-between mb-1`},Hn={class:`flex items-center`},Un={class:`text-xs font-bold`},Wn={class:`text-xs text-[var(--el-text-color-secondary)]`},Gn={class:`mb-3`},Kn={class:`flex items-center mb-1`},qn={class:`text-xs font-bold`};function Jn(t,n,s,c,u,d){let m=l(`info-icon`),h=l(`el-input`),_=l(`el-slider`),v=l(`el-input-number`),y=l(`el-collapse-item`),b=l(`el-collapse`);return g(),f(b,{modelValue:t.activeNames,"onUpdate:modelValue":n[6]||=e=>t.activeNames=e,class:`advanced-collapse`},{default:p(()=>[i(y,{title:t.$t(`producer.name.advancedParams`),name:`advanced`},{default:p(()=>[t.config?.custom?(g(),o(`div`,wn,[e(`div`,Tn,[e(`span`,En,r(t.$t(`producer.name.styleNegative`)),1),i(m,{content:t.$t(`producer.description.styleNegative`)},null,8,[`content`])]),i(h,{modelValue:t.styleNegative,"onUpdate:modelValue":n[0]||=e=>t.styleNegative=e,size:`small`,placeholder:t.$t(`producer.placeholder.styleNegative`)},null,8,[`modelValue`,`placeholder`])])):a(``,!0),t.config?.custom&&!t.config?.instrumental?(g(),o(`div`,Dn,[e(`div`,On,[e(`span`,kn,r(t.$t(`producer.name.lyricPrompt`)),1),i(m,{content:t.$t(`producer.description.lyricPrompt`)},null,8,[`content`])]),i(h,{modelValue:t.lyricPrompt,"onUpdate:modelValue":n[1]||=e=>t.lyricPrompt=e,size:`small`,placeholder:t.$t(`producer.placeholder.lyricPrompt`)},null,8,[`modelValue`,`placeholder`])])):a(``,!0),e(`div`,An,[e(`div`,jn,[e(`div`,Mn,[e(`span`,Nn,r(t.$t(`producer.name.weirdness`)),1),i(m,{content:t.$t(`producer.description.weirdness`)},null,8,[`content`])]),e(`span`,Pn,r(t.weirdness??.5),1)]),i(_,{modelValue:t.weirdness,"onUpdate:modelValue":n[2]||=e=>t.weirdness=e,min:0,max:1,step:.01},null,8,[`modelValue`])]),e(`div`,Fn,[e(`div`,In,[e(`div`,Ln,[e(`span`,Rn,r(t.$t(`producer.name.soundStrength`)),1),i(m,{content:t.$t(`producer.description.soundStrength`)},null,8,[`content`])]),e(`span`,zn,r(t.soundStrength??.7),1)]),i(_,{modelValue:t.soundStrength,"onUpdate:modelValue":n[3]||=e=>t.soundStrength=e,min:.2,max:1,step:.01},null,8,[`modelValue`])]),t.config?.custom&&!t.config?.instrumental?(g(),o(`div`,Bn,[e(`div`,Vn,[e(`div`,Hn,[e(`span`,Un,r(t.$t(`producer.name.lyricsStrength`)),1),i(m,{content:t.$t(`producer.description.lyricsStrength`)},null,8,[`content`])]),e(`span`,Wn,r(t.lyricsStrength??.7),1)]),i(_,{modelValue:t.lyricsStrength,"onUpdate:modelValue":n[4]||=e=>t.lyricsStrength=e,min:0,max:1,step:.01},null,8,[`modelValue`])])):a(``,!0),e(`div`,Gn,[e(`div`,Kn,[e(`span`,qn,r(t.$t(`producer.name.seed`)),1),i(m,{content:t.$t(`producer.description.seed`)},null,8,[`content`])]),i(v,{modelValue:t.seed,"onUpdate:modelValue":n[5]||=e=>t.seed=e,min:0,controls:!1,size:`small`,placeholder:t.$t(`producer.placeholder.seed`),class:`w-full`},null,8,[`modelValue`,`placeholder`])])]),_:1},8,[`title`])]),_:1},8,[`modelValue`])}var Yn=W(Cn,[[`render`,Jn],[`__scopeId`,`data-v-f9296888`]]),Xn=v({name:`ReplaceSectionInput`,components:{ElInputNumber:L,ElImage:K,InfoIcon:z},computed:{audio(){return this.$store.state.producer?.config?.audio},replaceSectionStart:{get(){return this.$store.state.producer?.config?.replace_section_start},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,replace_section_start:e})}},replaceSectionEnd:{get(){return this.$store.state.producer?.config?.replace_section_end},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,replace_section_end:e})}}},methods:{onClick(e){this.$store.dispatch(`producer/setAudio`,{...this.$store.state.producer.audio,...e,state:`playing`})}}}),Zn={class:`field`},Qn={class:`flex items-center mb-2`},$n={class:`text-sm font-bold m-0`},er={key:0,class:`task mb-2`},tr={class:`left relative w-[50px] h-[50px] mr-3 flex-shrink-0`},nr={class:`info flex-1 min-w-0`},rr={class:`text-sm font-bold m-0 truncate`},ir={class:`text-xs text-[var(--el-text-color-secondary)] m-0 truncate`},ar={class:`flex gap-2`};function or(t,n,s,c,d,f){let p=l(`info-icon`),h=l(`el-image`),_=l(`el-input-number`),v=m(`loading`);return g(),o(`div`,Zn,[e(`div`,Qn,[e(`h2`,$n,r(t.$t(`producer.name.replaceSection`)),1),i(p,{content:t.$t(`producer.description.replaceSection`)},null,8,[`content`])]),t.audio?(g(),o(`div`,er,[e(`div`,{class:`audio flex items-center`,onClick:n[0]||=e=>t.onClick(t.audio)},[u((g(),o(`div`,tr,[i(h,{src:t.audio?.image_url,class:`w-full h-full rounded`,fit:`cover`},null,8,[`src`])])),[[v,!t.audio?.audio_url]]),e(`div`,nr,[e(`h2`,rr,r(t.audio?.title),1),e(`p`,ir,r(t.audio?.style),1)])])])):a(``,!0),e(`div`,ar,[i(_,{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(`producer.placeholder.replaceSectionStart`)},null,8,[`modelValue`,`max`,`placeholder`]),i(_,{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(`producer.placeholder.replaceSectionEnd`)},null,8,[`modelValue`,`min`,`max`,`placeholder`])])])}var sr=v({name:`PresetPanel`,components:{CleanupIcon:ae,MagicIcon:H,TypeSelector:st,PromptInput:bt,LyricInput:Dt,StyleInput:Pt,TitleInput:Bt,ExtendFromInput:tn,CoverFromInput:gn,UploadAudio:_t,VocalGenderSelector:Sn,AdvancedParams:Yn,ReplaceSectionInput:W(Xn,[[`render`,or]]),ElButton:$,ElTabs:S,ElTabPane:C,ServicePricingSummary:Ie,ScenarioPaymentMode:Le},emits:[`generate`],data(){return{quoteTimer:0,quoteRunId:0}},computed:{canGenerate(){return He(`producer`,U(this.config))},config(){return this.$store.state.producer?.config},mode:{get(){return this.$store.state.producer?.config?.custom?`custom`:`simple`},set(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,custom:e===`custom`})}},consumption(){return Te(this.config,this.service?.cost)},service(){return this.$store.state.producer?.service},walletMode(){return G()&&J(`producer`).mode===`wallet`},generateButtonText(){let e=this.config?.action;return e===`extend`||e===`upload_extend`?this.$t(`producer.button.extend`):e===`cover`||e===`upload_cover`?this.$t(`producer.button.cover_music`):e===`variation`?this.$t(`producer.button.variation`):e===`replace_section`?this.$t(`producer.button.replace_section`):e===`stems`?this.$t(`producer.button.get_stems`):e===`swap_vocals`?this.$t(`producer.button.swap_vocals`):e===`swap_instrumentals`?this.$t(`producer.button.swap_instrumentals`):this.$t(`producer.button.generate`)}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=J(`producer`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,350))},async refreshQuote(){if(!this.canGenerate)return;let e=J(`producer`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await Y.quoteAudio(U(this.config));t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)},onClearAll(){this.$store.commit(`producer/setConfig`,{custom:this.$store.state.producer?.config?.custom||!1,instrumental:!1,prompt:``,lyric:``,style:``,title:``,model:this.$store.state.producer?.config?.model})}}}),cr={class:`flex flex-col h-full`},lr={class:`flex-1 min-h-0 overflow-hidden`},ur={class:`p-5`},dr={class:`p-5`},fr={class:`flex flex-col items-center justify-center px-5 pb-5 gap-2`},pr={class:`flex gap-2 w-full`};function mr(t,s,c,u,d,m){let h=l(`type-selector`),_=l(`upload-audio`),v=l(`prompt-input`),y=l(`extend-from-input`),b=l(`cover-from-input`),x=l(`replace-section-input`),S=l(`advanced-params`),C=l(`el-tab-pane`),w=l(`lyric-input`),T=l(`style-input`),E=l(`title-input`),D=l(`vocal-gender-selector`),O=l(`el-tabs`),k=l(`scenario-payment-mode`),A=l(`service-pricing-summary`),j=l(`cleanup-icon`),M=l(`el-button`),N=l(`magic-icon`);return g(),o(`div`,cr,[e(`div`,lr,[i(O,{modelValue:t.mode,"onUpdate:modelValue":s[0]||=e=>t.mode=e,class:`producer-mode-tabs scenario-tabs scenario-tabs--scrollable scenario-tabs--divided`},{default:p(()=>[i(C,{label:t.$t(`producer.mode.simple`),name:`simple`},{default:p(()=>[e(`div`,ur,[i(h,{class:`mb-4`}),i(_,{class:`mb-4`}),i(v,{class:`mb-4`}),t.config?.action===`extend`?(g(),f(y,{key:0,class:`mb-4`})):a(``,!0),t.config?.action===`cover`?(g(),f(b,{key:1,class:`mb-4`})):a(``,!0),t.config?.action===`replace_section`?(g(),f(x,{key:2,class:`mb-4`})):a(``,!0),i(S,{class:`mb-4`})])]),_:1},8,[`label`]),i(C,{label:t.$t(`producer.mode.custom`),name:`custom`},{default:p(()=>[e(`div`,dr,[i(h,{class:`mb-4`}),i(_,{class:`mb-4`}),t.config?.instrumental?a(``,!0):(g(),f(w,{key:0,class:`mb-4`})),i(T,{class:`mb-4`}),i(E,{class:`mb-4`}),t.config?.instrumental?a(``,!0):(g(),f(D,{key:1,class:`mb-4`})),t.config?.action===`extend`?(g(),f(y,{key:2,class:`mb-4`})):a(``,!0),t.config?.action===`cover`?(g(),f(b,{key:3,class:`mb-4`})):a(``,!0),t.config?.action===`replace_section`?(g(),f(x,{key:4,class:`mb-4`})):a(``,!0),i(S,{class:`mb-4`})])]),_:1},8,[`label`])]),_:1},8,[`modelValue`])]),e(`div`,fr,[i(k,{scenario:`producer`}),t.walletMode?a(``,!0):(g(),f(A,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),e(`div`,pr,[i(M,{class:`flex-1`,onClick:t.onClearAll},{default:p(()=>[i(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`producer.button.clear_all`)),1)]),_:1},8,[`onClick`]),i(M,{type:`primary`,class:`flex-1`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[i(N,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.generateButtonText),1)]),_:1},8,[`disabled`,`onClick`])])])])}var hr=W(sr,[[`render`,mr],[`__scopeId`,`data-v-647162cb`]]),gr=oe(),_r=v({name:`TaskPreview`,components:{ChannelIcon:de,CodeIcon:ce,DownloadIcon:le,InfoIcon:pe,MagicIcon:H,MoreIcon:ue,WarningIcon:ye,ElAlert:E,ElImage:K,ElIcon:y,ElTooltip:T,VideoPlay:V,VideoPause:B,ElDropdown:I,ElDropdownMenu:ee,ElDropdownItem:F,Loading:me,ApiCodeDialog:Re,ReportDialog:Pe,CopyToClipboard:Ne},props:{modelValue:{type:Object,required:!0}},emits:[`wallet-task`],data(){return{isFetchingVideoUrl:!1,isFetchingWav:!1,apiCodeVisible:!1,reportVisible:!1,reportTargetId:``,reportSnapshot:void 0,apiCodePath:`/producer/audios`,apiCodeBody:{}}},computed:{loading(){return this.$store.state.producer?.status?.getApplications===D.Request},showViewCode(){return xe()},credential(){return this.$store.state.producer.credential},walletMode(){return G()&&J(`producer`).mode===`wallet`},config(){return this.$store.state.producer.config},task(){return this.$store.state.producer?.tasks},audios(){let e=this.modelValue?.response?.data??[],t=this.modelValue?.request?.action;return t?e.map(e=>({...e,action:t})):e},isFailure(){return this.audios.length===0&&(this.modelValue?.response?.success===!1||!!this.modelValue?.response?.error)},failureReason(){let e=this.modelValue?.response?.error;return typeof e==`string`?e:e?.message},traceId(){return this.modelValue?.response?.trace_id||this.modelValue?.trace_id},application(){return this.$store.state.producer?.application},active(){return this.$store.state.producer?.tasks?.active}},methods:{paymentOptions(){if(!this.walletMode){let e=this.credential?.token;return e?{token:e}:void 0}let e=this.getWalletContext();if(!e){O.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}return{mode:`x402`,x402:{wallet:e,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}}},getWalletContext(){return X(this.$wallet)},async confirmWalletPayment(e){return q.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},onReport(e){this.reportTargetId=e?.id||``,this.reportSnapshot={prompt:e?.prompt,title:e?.title},this.reportVisible=!0},useFormatDuring:R,onViewCode(){let e=this.modelValue?.request||{},t={};Object.entries(e).forEach(([e,n])=>{e===`application_id`||e===`callback_url`||n!=null&&(typeof n==`string`&&n===``||Array.isArray(n)&&n.length===0||(t[e]=n))}),this.apiCodeBody=t,this.apiCodePath=`/producer/audios`,this.apiCodeVisible=!0},onPlay(e){this.$store.dispatch(`producer/setAudio`,{...this.$store.state.producer.audio,...e,state:`playing`}),console.log(`on play`)},onPause(e){this.$store.dispatch(`producer/setAudio`,{...this.$store.state.producer.audio,...e,state:`paused`}),console.log(`on pause`)},onClick(e){this.$store.state?.producer?.audio?.id!==e.id&&this.onPlay({...e,progress:0})},onExtend(e,t){e?.stopPropagation(),console.debug(`set config`,t),this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,model:t.model,custom:!0,instrumental:!1,style:t.style,action:`extend`,audio:t,audio_id:t.id,continue_at:t.duration})},onDownload(e,t){e&&e?.stopPropagation();let n=new URL(t).pathname,r=n.substring(n.lastIndexOf(`/`)+1);fetch(t).then(e=>e.blob()).then(e=>{(0,gr.saveAs)(e,r)})},async handleVideoDownload(e){if(e.video_url){this.onDownload(null,e.video_url);return}if(!this.isFetchingVideoUrl)try{this.isFetchingVideoUrl=!0;let t=await this.fetchVideoUrlFromApi(e?.id);console.log(`get videoUrl: ${t}`),e.video_url=t,this.onDownload(null,t)}catch(e){if(e instanceof Q)return;console.error(`get videoUrl failed:`,e),O.error(this.$t(`producer.message.getVideoUrlFailed`))}finally{this.isFetchingVideoUrl=!1}},async fetchVideoUrlFromApi(e){return new Promise((t,n)=>{let r={audio_id:e},i=this.paymentOptions();if(!i)return n(new Q);Y.video(r,i).then(e=>{let r=e.data?.data?.video_url;r?t(r):n(Error(`Video URL not found in response`))}).catch(e=>{n(e)})})},onPreview(e,t){e?.stopPropagation(),window.open(t,`_blank`)},async onGetStems(e){await this.onGenerateAudioUrl(`stems`,e)},onCover(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,model:e.model,custom:!0,instrumental:!1,style:e.style,action:`cover`,audio:e,audio_id:e.id})},onVariation(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,model:e.model,custom:!0,style:e.style,action:`variation`,audio:e,audio_id:e.id})},async onSwapVocals(e){await this.onGenerateAudioUrl(`swap_vocals`,e)},async onSwapInstrumentals(e){await this.onGenerateAudioUrl(`swap_instrumentals`,e)},async onGetAllStems(e){await this.onGenerateAudioUrl(`all_stems`,e)},onReplaceSection(e){this.$store.commit(`producer/setConfig`,{...this.$store.state.producer?.config,model:e.model,custom:!0,instrumental:!1,style:e.style,action:`replace_section`,audio:e,audio_id:e.id,replace_section_start:0,replace_section_end:Math.min(30,e.duration||30)})},async handleWavDownload(e){if(!e?.id||this.isFetchingWav)return;let t=this.paymentOptions();if(t)try{this.isFetchingWav=!0,O.info(this.$t(`producer.message.fetchingWav`));let n=(await Y.wav({audio_id:e.id},t)).data?.data,r=Array.isArray(n)?n[0]?.file_url:n?.file_url||n?.audio_url;r?this.onDownload(null,r):O.error(this.$t(`producer.message.fetchWavFailed`))}catch(e){if(e instanceof Q)return;O.error(this.$t(`producer.message.fetchWavFailed`))}finally{this.isFetchingWav=!1}},async onGenerateAudioUrl(e,t){let n={action:e,audio_id:t,async:!0},r=this.paymentOptions();r&&(O.info(this.$t(`producer.message.startingTask`)),Y.audio(n,r).then(e=>{let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&this.$emit(`wallet-task`,t),O.success(this.$t(`producer.message.startTaskSuccess`))}).catch(e=>{e instanceof Q||O.error(e?.response?.data?.error?.message||this.$t(`producer.message.startTaskFailed`))}))},async onScrollDown(){setTimeout(()=>{let e=document.querySelector(`.tasks`);e&&(e.scrollTop=e.scrollHeight)},1e3)},async onGetTasks(){if(this.loading){console.debug(`loading`);return}await this.$store.dispatch(`producer/getTasks`,{limit:30,offset:0})}}}),vr={class:`task`},yr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},br={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},xr={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Sr=[`onClick`],Cr={class:`left`},wr=[`aria-label`,`title`,`onClick`,`onKeydown`],Tr=[`aria-label`,`title`,`onClick`,`onKeydown`],Er={key:2,class:`duration`},Dr={class:`info`},Or={class:`title`},kr={class:`style`},Ar={class:`right`},jr={class:`el-dropdown-link`},Mr={class:`flex items-center min-w-[120px]`},Nr={class:`flex items-center min-w-[120px]`},Pr={class:`el-dropdown-link`};function Fr(d,_,v,y,b,x){let S=l(`warning-icon`),C=l(`magic-icon`),w=l(`copy-to-clipboard`),T=l(`info-icon`),E=l(`channel-icon`),D=l(`el-alert`),O=l(`el-image`),k=l(`video-pause`),A=l(`el-icon`),j=l(`video-play`),M=l(`download-icon`),N=l(`el-tooltip`),P=l(`Loading`),F=l(`el-dropdown-item`),ee=l(`el-dropdown-menu`),I=l(`el-dropdown`),L=l(`more-icon`),te=l(`code-icon`),ne=l(`api-code-dialog`),re=l(`report-dialog`),ie=m(`loading`);return g(),o(`div`,vr,[d.isFailure?(g(),f(D,{key:0,closable:!1,class:`task-failure`},{title:p(()=>[i(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(d.$t(`producer.name.failure`)),1)]),default:p(()=>[e(`p`,yr,[i(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(d.$t(`producer.name.taskId`))+`: `+r(d.modelValue?.id)+` `,1),i(w,{content:d.modelValue?.id},null,8,[`content`])]),d.failureReason?(g(),o(`p`,br,[i(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(d.$t(`producer.name.failureReason`))+`: `+r(d.failureReason)+` `,1),i(w,{content:d.failureReason},null,8,[`content`])])):a(``,!0),d.traceId?(g(),o(`p`,xr,[i(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(d.$t(`producer.name.traceId`))+`: `+r(d.traceId)+` `,1),i(w,{content:d.traceId},null,8,[`content`])])):a(``,!0)]),_:1})):a(``,!0),(g(!0),o(c,null,h(d.audios,c=>(g(),o(`div`,{key:c.id,class:`audio`,onClick:t(e=>d.onClick(c),[`stop`])},[u((g(),o(`div`,Cr,[i(O,{src:c?.image_url,class:`cover`,fit:`cover`,lazy:``},null,8,[`src`]),c?.audio_url&&d.$store.state?.producer?.audio?.id===c.id&&d.$store.state?.producer?.audio?.state===`playing`?(g(),o(`div`,{key:0,class:`overlay`,role:`button`,tabindex:`0`,"aria-label":d.$t(`common.player.pause`),title:d.$t(`common.player.pause`),onClick:t(e=>d.onPause(c),[`stop`]),onKeydown:[s(t(e=>d.onPause(c),[`stop`,`prevent`]),[`enter`]),s(t(e=>d.onPause(c),[`stop`,`prevent`]),[`space`])]},[i(A,null,{default:p(()=>[i(k,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})],40,wr)):a(``,!0),c?.audio_url&&(d.$store.state?.producer?.audio?.id!==c.id||d.$store.state?.producer?.audio?.id===c.id&&d.$store.state?.producer?.audio?.state===`paused`)?(g(),o(`div`,{key:1,class:`overlay`,role:`button`,tabindex:`0`,"aria-label":d.$t(`common.player.play`),title:d.$t(`common.player.play`),onClick:t(e=>d.onPlay(c),[`stop`]),onKeydown:[s(t(e=>d.onPlay(c),[`stop`,`prevent`]),[`enter`]),s(t(e=>d.onPlay(c),[`stop`,`prevent`]),[`space`])]},[i(A,null,{default:p(()=>[i(j,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})],40,Tr)):a(``,!0),c?.duration?(g(),o(`div`,Er,r(d.useFormatDuring(c?.duration)),1)):a(``,!0)])),[[ie,!c?.audio_url]]),e(`div`,Dr,[e(`h2`,Or,r(c?.title),1),e(`p`,kr,r(c?.style),1)]),e(`div`,Ar,[i(I,null,{dropdown:p(()=>[i(ee,null,{default:p(()=>[i(F,{disabled:d.isFetchingVideoUrl,onClick:e=>d.handleVideoDownload(c)},{default:p(()=>[e(`div`,Mr,[d.isFetchingVideoUrl?(g(),f(A,{key:0,class:`is-loading mr-2`},{default:p(()=>[i(P,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})):a(``,!0),e(`span`,null,r(d.$t(`producer.button.download_video`)),1)])]),_:1},8,[`disabled`,`onClick`]),c?.audio_url?(g(),f(F,{key:0,onClick:t(e=>d.onDownload(e,c?.audio_url),[`stop`])},{default:p(()=>[n(r(d.$t(`producer.button.download_audio`)),1)]),_:1},8,[`onClick`])):a(``,!0),i(F,{disabled:d.isFetchingWav,onClick:e=>d.handleWavDownload(c)},{default:p(()=>[e(`div`,Nr,[d.isFetchingWav?(g(),f(A,{key:0,class:`is-loading mr-2`},{default:p(()=>[i(P,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})):a(``,!0),e(`span`,null,r(d.$t(`producer.button.download_wav`)),1)])]),_:1},8,[`disabled`,`onClick`])]),_:2},1024)]),default:p(()=>[e(`span`,jr,[i(N,{effect:`dark`,content:d.$t(`common.button.download`),placement:`top`},{default:p(()=>[c?.audio_url||c?.video_url?(g(),f(M,{key:0,class:`icon icon-download`,size:`1em`,"aria-hidden":`true`,focusable:`false`})):a(``,!0)]),_:2},1032,[`content`])])]),_:2},1024),i(I,null,{dropdown:p(()=>[i(ee,null,{default:p(()=>[c?.audio_url?(g(),f(F,{key:0,onClick:t(e=>d.onExtend(e,c),[`stop`])},{default:p(()=>[n(r(d.$t(`producer.button.extend`)),1)]),_:1},8,[`onClick`])):a(``,!0),c.id?(g(),f(F,{key:1,onClick:t(e=>d.onGetStems(c.id),[`stop`])},{default:p(()=>[n(r(d.$t(`producer.button.get_stems`)),1)]),_:1},8,[`onClick`])):a(``,!0),c.id?(g(),f(F,{key:2,onClick:t(e=>d.onGetAllStems(c.id),[`stop`])},{default:p(()=>[n(r(d.$t(`producer.button.all_stems`)),1)]),_:1},8,[`onClick`])):a(``,!0),i(F,{onClick:t(e=>d.onCover(c),[`stop`])},{default:p(()=>[n(r(d.$t(`producer.button.cover_music`)),1)]),_:1},8,[`onClick`]),c?.id?(g(),f(F,{key:3,onClick:t(e=>d.onVariation(c),[`stop`])},{default:p(()=>[n(r(d.$t(`producer.button.variation`)),1)]),_:1},8,[`onClick`])):a(``,!0),c?.id?(g(),f(F,{key:4,onClick:t(e=>d.onSwapVocals(c.id),[`stop`])},{default:p(()=>[n(r(d.$t(`producer.button.swap_vocals`)),1)]),_:1},8,[`onClick`])):a(``,!0),c?.id?(g(),f(F,{key:5,onClick:t(e=>d.onSwapInstrumentals(c.id),[`stop`])},{default:p(()=>[n(r(d.$t(`producer.button.swap_instrumentals`)),1)]),_:1},8,[`onClick`])):a(``,!0),c?.id?(g(),f(F,{key:6,onClick:t(e=>d.onReplaceSection(c),[`stop`])},{default:p(()=>[n(r(d.$t(`producer.button.replace_section`)),1)]),_:1},8,[`onClick`])):a(``,!0),d.showViewCode?(g(),f(F,{key:7,onClick:t(d.onViewCode,[`stop`])},{default:p(()=>[i(te,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(d.$t(`common.button.viewCode`)),1)]),_:1},8,[`onClick`])):a(``,!0),c?.id?(g(),f(F,{key:8,onClick:t(e=>d.onReport(c),[`stop`])},{default:p(()=>[i(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(d.$t(`common.button.report`)),1)]),_:1},8,[`onClick`])):a(``,!0)]),_:2},1024)]),default:p(()=>[e(`span`,Pr,[i(N,{effect:`dark`,content:d.$t(`producer.button.more`),placement:`top`},{default:p(()=>[c?.audio_url||c?.video_url?(g(),f(L,{key:0,class:`icon icon-ellipsis`,size:`1em`,"aria-hidden":`true`,focusable:`false`})):a(``,!0)]),_:2},1032,[`content`])])]),_:2},1024)])],8,Sr))),128)),i(ne,{visible:d.apiCodeVisible,"onUpdate:visible":_[0]||=e=>d.apiCodeVisible=e,method:`POST`,path:d.apiCodePath,body:d.apiCodeBody,token:d.$store.state.producer?.credential?.token||``},null,8,[`visible`,`path`,`body`,`token`]),i(re,{visible:d.reportVisible,"onUpdate:visible":_[1]||=e=>d.reportVisible=e,service:`producer`,"target-id":d.reportTargetId,snapshot:d.reportSnapshot},null,8,[`visible`,`target-id`,`snapshot`])])}var Ir=v({name:`RecentPanel`,components:{ElSkeletonItem:te,ElSkeleton:ne,TaskPreview:W(_r,[[`render`,Fr]]),Player:se,NoTasks:_e,ScrollList:ge},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`,`wallet-task`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.producer?.tasks,items:this.$store.state.producer?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Lr={key:0,class:`tasks`},Rr={class:`left w-[70px] p-[10px] flex items-center`},zr={class:`main w-[calc(100%-70px)] flex-1 p-[10px]`},Br={key:2,class:`w-full flex-1 flex items-center justify-center`},Vr={class:`h-20`};function Hr(t,n,r,s,d,m){let v=l(`el-skeleton-item`),y=l(`el-skeleton`),b=l(`task-preview`),x=l(`scroll-list`),S=l(`no-tasks`),C=l(`player`);return g(),o(c,null,[t.tasks?.items===void 0?(g(),o(`div`,Lr,[(g(),o(c,null,h(3,t=>e(`div`,{key:t,class:`flex`},[e(`div`,Rr,[i(y,{animated:``},{template:p(()=>[i(v,{variant:`image`,class:`avatar w-[50px] h-[50px]`})]),_:1})]),e(`div`,zr,[i(y,{animated:``},{template:p(()=>[i(v,{variant:`p`,class:`w-[200px] h-[15px] mb-[5px] mt-[10px]`}),i(v,{variant:`text`})]),_:1})])])),64))])):t.tasks?.items?.length&&t.tasks?.items?.length>0?(g(),f(x,{key:1,ref:`scrollList`,class:`flex-1 w-full overflow-y-auto tasks p-2`,loading:t.loading,onReachTop:n[1]||=e=>t.$emit(`reach-top`)},{default:p(()=>[(g(!0),o(c,null,h(t.tasks?.items,(e,r)=>(g(),f(b,{key:r,"model-value":e,class:`preview`,onWalletTask:n[0]||=e=>t.$emit(`wallet-task`,e)},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):a(``,!0),t.tasks?.items?.length===0?(g(),o(`div`,Br,[i(S)])):a(``,!0),u(e(`div`,Vr,[i(C,{namespace:`producer`})],512),[[_,!!t.$store?.state?.producer?.audio?.object]])],64)}var Ur=W(Ir,[[`render`,Hr]]),Wr=v({name:`TaskPreview`,components:{IconPicture:fe,ElImage:K,ElAvatar:k,ElIcon:y},computed:{audio(){return this.$store.state.producer?.audio}}}),Gr={key:0,class:`size-full overflow-hidden`},Kr={class:`relative h-[300px]`},qr={class:`flex items-center justify-center size-full bg-[var(--el-bg-color)]`},Jr={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`},Yr={class:`p-4`},Xr={class:`flex items-center font-bold mb-2`},Zr={class:`text-[var(--el-text-color-regular)] mb-2`},Qr={class:`text-xs text-[var(--el-text-color-regular)]`},$r={class:`mt-4 text-sm leading-[25px] whitespace-pre-wrap`},ei={key:1,class:`w-full h-full`};function ti(t,n,a,s,c,u){let d=l(`icon-picture`),f=l(`el-icon`),m=l(`el-image`),h=l(`el-avatar`);return t.audio?.object?(g(),o(`div`,Gr,[e(`div`,Kr,[i(m,{src:t.audio.image_url,fit:`cover`,class:`size-full`},{error:p(()=>[e(`div`,qr,[i(f,{class:`text-3xl`},{default:p(()=>[i(d,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})])]),_:1},8,[`src`]),e(`h2`,Jr,r(t.audio?.title),1)]),e(`div`,Yr,[e(`div`,Xr,[i(h,{size:30,src:t.audio?.image_url,class:`mr-2`},null,8,[`src`]),e(`span`,null,r(t.audio?.title),1)]),e(`p`,Zr,r(t.audio?.style),1),e(`p`,Qr,r(t.$dayjs.format(t.audio?.created_at)),1),e(`div`,$r,[e(`p`,null,r(t.audio?.lyric),1)])])])):(g(),o(`div`,ei))}var ni=v({name:`ProducerIndex`,components:{Layout:Ye,ConfigPanel:hr,RecentPanel:Ur,PreviewPanel:W(Wr,[[`render`,ti]])},mixins:[je,Be(`producer`),ze(`producer`)],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.producer?.status?.getApplications===D.Request},tasksLoading(){return this.$store.state.producer?.status?.getTasks===D.Request||this.fetchingTasks},service(){return this.$store.state.producer.service},credential(){return this.$store.state.producer.credential},config(){return this.$store.state.producer.config},initializing(){return this.$store.state.producer.status.getApplications===D.Request},needApply(){return this.$store.state.producer.status.getApplications===D.Success&&!this.application},application(){return this.$store.state.producer.application},tasks(){return this.$store.state.producer.tasks},applications(){return this.$store.state.producer.applications},walletMode(){return G()&&J(`producer`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`producer/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},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.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ve({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`producer/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplications`),await this.$store.dispatch(`producer/getApplications`),console.debug(`end onGetApplications`),await this.onGetTasks()},onApply(){we.create({application:this.application}).then(({data:e})=>{this.application=e,O.success(this.$t(`application.message.applySuccessfully`))}).catch(e=>{e?.response?.data?.code===`duplication`&&O.error(this.$t(`application.message.alreadyApplied`))})},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`producer/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerateAudio(){let e=U(this.config),t=Ve(`producer`,e);if(t){O.error(this.$t(`common.message.${t}`));return}if(!De(this.uploadTracker,e=>this.$t(e),e=>O.warning(e)))return;let n=this.createPaymentOperation(t=>Y.audio(e,t));if(n){O.info(this.$t(`producer.message.startingTask`));try{let e=await Ee(`producer`,n);this.recordWalletTask(e),O.success(this.$t(`producer.message.startTaskSuccess`))}catch(e){this.handlePaymentError(e)}finally{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)}}},createPaymentOperation(e){if(!this.walletMode){if(!ke())return;let t=this.credential?.token;return t?e({token:t}):void 0}let t=this.getWalletContext();if(!t){O.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}return e({mode:`x402`,x402:{wallet:t,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})},recordWalletTask(e){this.onWalletTask(e?.data?.task_id)},onWalletTask(e){this.walletMode&&!this.credential?.token&&e&&!this.walletTaskIds.includes(e)&&this.walletTaskIds.unshift(e)},handlePaymentError(e){e instanceof Q||(this.walletMode?O.error(this.$t(`common.x402Scenario.paymentFailed`)):O.error(e?.response?.data?.error?.message||this.$t(`producer.message.startTaskFailed`)))},getWalletContext(){return X(this.$wallet)},async confirmWalletPayment(e){return q.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function ri(e,t,n,r,a,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`preview-panel`),d=l(`layout`);return g(),f(d,null,{config:p(()=>[i(s,{onGenerate:e.onGenerateAudio},null,8,[`onGenerate`])]),result:p(()=>[i(c,{ref:`recentPanel`,class:`panel recent`,loading:e.loadingMore,onReachTop:e.onReachTop,onWalletTask:e.onWalletTask},null,8,[`loading`,`onReachTop`,`onWalletTask`])]),preview:p(()=>[i(u)]),_:1})}var ii=W(ni,[[`render`,ri],[`__scopeId`,`data-v-ae7b5900`]]);export{ii as default};