@acedatacloud/nexior 3.247.0 → 3.248.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (268) hide show
  1. package/dist/assets/{ApiCodeButton-BxWrNlio.js → ApiCodeButton-CsgRae2o.js} +1 -1
  2. package/dist/assets/{Auth-DBgApWcC.js → Auth-D39vFQfy.js} +1 -1
  3. package/dist/assets/{BotPlaceholder-DpiZEQow.js → BotPlaceholder-B-UqCz8R.js} +1 -1
  4. package/dist/assets/{Callback-BEG7BeIC.js → Callback-BWCD3rTH.js} +1 -1
  5. package/dist/assets/{Console-BS1DHQK9.js → Console-DvfzR97a.js} +1 -1
  6. package/dist/assets/{Consumption-B3cgN_uS.js → Consumption-BoW8Yj1Z.js} +1 -1
  7. package/dist/assets/{Conversation-HlTR345-.js → Conversation-C1fxnual.js} +1 -1
  8. package/dist/assets/{CopyToClipboard-g4vBpWAA.js → CopyToClipboard-Ih2qsYgN.js} +1 -1
  9. package/dist/assets/{Detail-BBxS4o_n.js → Detail-D5m92Hja.js} +2 -2
  10. package/dist/assets/{Extra-BaFnbhmW.js → Extra-BPHm1V_3.js} +1 -1
  11. package/dist/assets/{FilePreview-CgjWf7IZ.js → FilePreview-DFWVNwz_.js} +1 -1
  12. package/dist/assets/{Hailuo-BsGaxbRH.js → Hailuo-BxxRf4bb.js} +1 -1
  13. package/dist/assets/{History-C3WsQvhF.js → History-ylxLuWND.js} +1 -1
  14. package/dist/assets/{ImagePreview-D-9EFWby.js → ImagePreview-DeNxw7C3.js} +1 -1
  15. package/dist/assets/{ImageWrapper-B3cbnI5h.js → ImageWrapper-BvFBUaIt.js} +1 -1
  16. package/dist/assets/{Index-9lvutSUo.js → Index-1ADsBPjF.js} +1 -1
  17. package/dist/assets/{Index-Bim8xkOC.js → Index-42qOVFD_.js} +1 -1
  18. package/dist/assets/{Index-B7wx6DnV.js → Index-4JCiMyP1.js} +1 -1
  19. package/dist/assets/{Index-CiZpMegP.js → Index-8Yn6qcKT.js} +1 -1
  20. package/dist/assets/{Index-Lg4tO5s-.js → Index-B27tQkpP.js} +1 -1
  21. package/dist/assets/{Index-BRvAWYnK.js → Index-B6Ls62IP.js} +1 -1
  22. package/dist/assets/{Index-pTthfWKC.js → Index-BIu85wjj.js} +1 -1
  23. package/dist/assets/{Index-DLIiVbGX.js → Index-BKH138yc.js} +1 -1
  24. package/dist/assets/{Index-bYW9icdw.js → Index-BlF-P0t4.js} +1 -1
  25. package/dist/assets/{Index-aMnEeK_G.js → Index-BnEYTHw0.js} +1 -1
  26. package/dist/assets/{Index-DRfc7-DW.js → Index-BxxDhF-X.js} +1 -1
  27. package/dist/assets/{Index-CGK17mp3.js → Index-C8colaGu.js} +1 -1
  28. package/dist/assets/{Index-x4VIk-M0.js → Index-CE-T_vEC.js} +1 -1
  29. package/dist/assets/{Index-GfH7ORBW.js → Index-CPRu7nTu.js} +1 -1
  30. package/dist/assets/{Index-As22PRJ8.js → Index-CgcmGBAm.js} +1 -1
  31. package/dist/assets/{Index-G-eiLZof.js → Index-CvbFcVln.js} +1 -1
  32. package/dist/assets/{Index-DH5LlwfI.js → Index-D8HN16Kg.js} +1 -1
  33. package/dist/assets/{Index-VmyhabIi.js → Index-D9Zf7USO.js} +1 -1
  34. package/dist/assets/{Index-CtEwAjzb.js → Index-DMXFEBbF.js} +1 -1
  35. package/dist/assets/{Index-D9ONlvtJ.js → Index-Du4BEkbn.js} +1 -1
  36. package/dist/assets/{Index-PFxzES9c.js → Index-Dw8I5m-D.js} +1 -1
  37. package/dist/assets/{Index-DxsapMg5.js → Index-N31lJtmb.js} +1 -1
  38. package/dist/assets/{Index-BBsPsMNE.js → Index-Y311Iokk.js} +1 -1
  39. package/dist/assets/{Index-wIVXmRng.js → Index-qEaOyPFJ.js} +1 -1
  40. package/dist/assets/{Index-oMr5qDpE.js → Index-xFJZlzEv.js} +1 -1
  41. package/dist/assets/{Invitees-DM2PtM2B.js → Invitees-BIsPj-vQ.js} +1 -1
  42. package/dist/assets/{List-B9PWtOVg.js → List--vQqmENx.js} +1 -1
  43. package/dist/assets/{List-CFNRyup6.js → List-BH-D5zL-.js} +1 -1
  44. package/dist/assets/{List-BI2uISLt.js → List-DdSCo-VU.js} +1 -1
  45. package/dist/assets/{Main-DvCFH-w5.js → Main-bt_58gJ5.js} +1 -1
  46. package/dist/assets/{Model-BaFunQUx.js → Model-DJ-HECzw.js} +1 -1
  47. package/dist/assets/{Navigator-C90p8IJf.js → Navigator-ilndlwmM.js} +1 -1
  48. package/dist/assets/{NoTasks-C9fjzpt-.js → NoTasks-CBf4UVlo.js} +1 -1
  49. package/dist/assets/{NotFound-D3DVTX79.js → NotFound-9_7Ar3e7.js} +1 -1
  50. package/dist/assets/{Pagination-BS1m7SpE.js → Pagination-jQVkoh--.js} +1 -1
  51. package/dist/assets/{Player.vue_vue_type_script_setup_true_lang-VsHNDvNV.js → Player.vue_vue_type_script_setup_true_lang-DqV0BSsX.js} +1 -1
  52. package/dist/assets/{Status-CUQyGBNT.js → Status-CBQ5PLv2.js} +1 -1
  53. package/dist/assets/{Subscribe-DX33tT74.js → Subscribe-BbwzEfz5.js} +1 -1
  54. package/dist/assets/{TabSwitcher-2PjIQYYE.js → TabSwitcher-D84M8GkF.js} +1 -1
  55. package/dist/assets/{Tts-R9wDfVRw.js → Tts-BfypN4Ze.js} +1 -1
  56. package/dist/assets/{VideoPlayer-D2Gk8iOW.js → VideoPlayer-2W03rLFF.js} +1 -1
  57. package/dist/assets/{_Uint8Array-pk5G6DXb.js → _Uint8Array-Cj-LmGzx.js} +1 -1
  58. package/dist/assets/{_baseClone-BEl0SBVQ.js → _baseClone-CD4xkhO5.js} +1 -1
  59. package/dist/assets/{_baseIteratee-DKwNed0n.js → _baseIteratee-BcXwWZMY.js} +1 -1
  60. package/dist/assets/{_initCloneObject-7jYqtSMb.js → _initCloneObject-CIlwXpy7.js} +1 -1
  61. package/dist/assets/{add-DTKL_ZFS.js → add-BalBfSNC.js} +1 -1
  62. package/dist/assets/{all-wallets-C5MLoAFb.js → all-wallets-B5cxIWft.js} +1 -1
  63. package/dist/assets/{app-store-DCQDZXe0.js → app-store-CPPDtNxC.js} +1 -1
  64. package/dist/assets/{apple-C3iyqXrR.js → apple-Lyxd7bJJ.js} +1 -1
  65. package/dist/assets/{arrow-bottom-BMZap5Cj.js → arrow-bottom-D41EVk1z.js} +1 -1
  66. package/dist/assets/{arrow-bottom-circle-4MFN_8UE.js → arrow-bottom-circle-BB53yKrq.js} +1 -1
  67. package/dist/assets/{arrow-left-Bm5c9N7C.js → arrow-left-CO27SOAw.js} +1 -1
  68. package/dist/assets/{arrow-right-hZ9Tp0uq.js → arrow-right-MWjfhSEn.js} +1 -1
  69. package/dist/assets/{arrow-top-BuD5nEdS.js → arrow-top-DPABL4cq.js} +1 -1
  70. package/dist/assets/{avatar-jh__YkZL.js → avatar-x4dsHW7W.js} +1 -1
  71. package/dist/assets/{bank-B4h9ar-t.js → bank-DncyfpIj.js} +1 -1
  72. package/dist/assets/{basic-DOcMcTjN.js → basic-BXJ5AuNC.js} +1 -1
  73. package/dist/assets/{browser-hlzvWCr4.js → browser-DOcoChNZ.js} +1 -1
  74. package/dist/assets/{byokCredential-Co3C1RWX.js → byokCredential-DhmvNEV5.js} +1 -1
  75. package/dist/assets/{card-CsqKf5wo.js → card-BsSCLVt0.js} +1 -1
  76. package/dist/assets/{castArray-tmh9kbwO.js → castArray-9ufFSW5u.js} +1 -1
  77. package/dist/assets/chat-B_HOcIld.js +1 -0
  78. package/dist/assets/chat-BmceIzis.js +1 -0
  79. package/dist/assets/chat-BmyGGxp8.js +1 -0
  80. package/dist/assets/chat-COZaceBe.js +1 -0
  81. package/dist/assets/chat-Cg7w1tLG.js +1 -0
  82. package/dist/assets/chat-Ch5QN39P.js +1 -0
  83. package/dist/assets/chat-CoVVUBUU.js +1 -0
  84. package/dist/assets/chat-Cwzia3WL.js +1 -0
  85. package/dist/assets/chat-D2g6mCbx.js +1 -0
  86. package/dist/assets/chat-D5y4o62r.js +1 -0
  87. package/dist/assets/chat-D9ufeoXV.js +1 -0
  88. package/dist/assets/chat-DIKm4lJF.js +1 -0
  89. package/dist/assets/chat-DJe220pZ.js +1 -0
  90. package/dist/assets/chat-DWx8DmVN.js +1 -0
  91. package/dist/assets/chat-Dg2XzkIa.js +1 -0
  92. package/dist/assets/chat-DytLYjfu.js +1 -0
  93. package/dist/assets/{chat-CpcSRbD2.js → chat-DyuRDrR2.js} +1 -1
  94. package/dist/assets/chat-rKPL6Bq2.js +1 -0
  95. package/dist/assets/chat-t0vRxpFl.js +1 -0
  96. package/dist/assets/{checkmark-CzYmi1Yz.js → checkmark-CkpMJm4d.js} +1 -1
  97. package/dist/assets/{checkmark-bold-DPgXxVBu.js → checkmark-bold-BCDV5X0-.js} +1 -1
  98. package/dist/assets/{chevron-bottom-Cy--pI3I.js → chevron-bottom-CAXcvThb.js} +1 -1
  99. package/dist/assets/{chevron-left-S6GJjIbX.js → chevron-left-Bg1Am-f6.js} +1 -1
  100. package/dist/assets/{chevron-right-dJvtWEQO.js → chevron-right-Dzcv24St.js} +1 -1
  101. package/dist/assets/{chevron-top-Cq9z70-e.js → chevron-top-DMIRMmDX.js} +1 -1
  102. package/dist/assets/{chrome-store-zZ0uWv1q.js → chrome-store-DWj8xFro.js} +1 -1
  103. package/dist/assets/{clock-BnJfjms8.js → clock-C3pBpJSh.js} +1 -1
  104. package/dist/assets/{close-BVSkmDiZ.js → close-BD4gl98l.js} +1 -1
  105. package/dist/assets/{coinPlaceholder-G8fFe1gL.js → coinPlaceholder-Ci5GY26z.js} +1 -1
  106. package/dist/assets/{compass-DQbcnfzc.js → compass-BwsaSpWM.js} +1 -1
  107. package/dist/assets/{copy-Cmh57Ey0.js → copy-gAWigFZh.js} +1 -1
  108. package/dist/assets/{createTaskActions-P-2DmrOh.js → createTaskActions-D7Z85jNw.js} +1 -1
  109. package/dist/assets/{cursor-DkvrzDna.js → cursor-C2PRo4vA.js} +1 -1
  110. package/dist/assets/{cursor-transparent-CNsg0hrQ.js → cursor-transparent-BVXelCvm.js} +1 -1
  111. package/dist/assets/{debounce-DBeMKn11.js → debounce-zyhh1kFW.js} +1 -1
  112. package/dist/assets/{desktop-DYouJkvo.js → desktop-jCWSCn8z.js} +1 -1
  113. package/dist/assets/{disconnect-pnM6foVl.js → disconnect-CbpuKDT6.js} +1 -1
  114. package/dist/assets/{discord-CoWlEeWJ.js → discord-C8ajtmWf.js} +1 -1
  115. package/dist/assets/{distribution-CJcqbitH.js → distribution-3BQ7CTZO.js} +1 -1
  116. package/dist/assets/{dropdown-CjQKMXq9.js → dropdown-D2lPdiU3.js} +1 -1
  117. package/dist/assets/{etherscan-Ctc0-KXt.js → etherscan-CZafqnoh.js} +1 -1
  118. package/dist/assets/{exclamation-triangle-CLxSQi9H.js → exclamation-triangle-wxNgK7PY.js} +1 -1
  119. package/dist/assets/{extension-3Ftw9iYz.js → extension-Bk4_azOL.js} +1 -1
  120. package/dist/assets/{external-link-DWzDSdHd.js → external-link-Cqpda3PZ.js} +1 -1
  121. package/dist/assets/{facebook-P_yhQXYh.js → facebook-D68jkLNm.js} +1 -1
  122. package/dist/assets/{farcaster-C6D-Y9Ja.js → farcaster-CCQhcLCI.js} +1 -1
  123. package/dist/assets/{filters-da1DF9Fp.js → filters-Fmk3MdsS.js} +1 -1
  124. package/dist/assets/{github-IwtJuUZ4.js → github-YUft1BRX.js} +1 -1
  125. package/dist/assets/{google-DjH6KSZW.js → google-D8WDx1KI.js} +1 -1
  126. package/dist/assets/{help-circle-DLiOYVb2.js → help-circle-CVpQTNC8.js} +1 -1
  127. package/dist/assets/{highlight-BIVpqebW.js → highlight-CYeIx3eC.js} +1 -1
  128. package/dist/assets/{id-B7sbtS1G.js → id-B5K1HBmc.js} +1 -1
  129. package/dist/assets/{image-0AU68zRr.js → image-DHXmKgFb.js} +1 -1
  130. package/dist/assets/{index-DizoYeO3.js → index-6tKWZwSV.js} +1 -1
  131. package/dist/assets/{index-BwIwFxoe.js → index-7YuxLUYH.js} +1 -1
  132. package/dist/assets/{index-D3Pn_CC4.js → index-B3XMfsr2.js} +1 -1
  133. package/dist/assets/{index-Bop7QJNZ.js → index-BILgzrZ9.js} +1 -1
  134. package/dist/assets/{index-bs2QXOh6.js → index-BOikF7Vg.js} +1 -1
  135. package/dist/assets/{index-qgWZ4gIq.js → index-BPVVKogl.js} +1 -1
  136. package/dist/assets/{index-ukLW3UKB.js → index-BVMK7LIJ.js} +1 -1
  137. package/dist/assets/{index-BjAmTjb2.js → index-Bdx-E-Cj.js} +1 -1
  138. package/dist/assets/{index-L0hmNNaW.js → index-BfT8NvTD.js} +1 -1
  139. package/dist/assets/{index-CYaLupkJ.js → index-Bi6VpZAJ.js} +1 -1
  140. package/dist/assets/{index-V-c9hDuN.js → index-BiSfH4hc.js} +1 -1
  141. package/dist/assets/{index-B5jo7NY3.js → index-BizFhdaE.js} +1 -1
  142. package/dist/assets/{index-CLzy2i_E.js → index-BlZKDgtS.js} +1 -1
  143. package/dist/assets/{index-DxHihOCA.js → index-BlwvWwLR.js} +1 -1
  144. package/dist/assets/{index-dItq9AaI.js → index-Bo5vqu5t.js} +1 -1
  145. package/dist/assets/{index-Tga9YfTB.js → index-BsWkCEVF.js} +1 -1
  146. package/dist/assets/{index-CstN7RKM.js → index-BuYvz3xq.js} +1 -1
  147. package/dist/assets/{index-CzL5AhXP.js → index-ByCbBTje.js} +1 -1
  148. package/dist/assets/{index-BaIOFWVN.js → index-C-LQAwn0.js} +1 -1
  149. package/dist/assets/{index-D04OE6ZP.js → index-C28h9Bo9.js} +1 -1
  150. package/dist/assets/{index-DmI0irY_.js → index-CAxhlh39.js} +3 -3
  151. package/dist/assets/{index-DKF6p7_t.js → index-CBlw8dKJ.js} +1 -1
  152. package/dist/assets/{index-2sob-pDv.js → index-CEcR89i7.js} +1 -1
  153. package/dist/assets/{index-CKchCVfL.js → index-CKq6CGXs.js} +2 -2
  154. package/dist/assets/{index-DVPxXPIi.js → index-CLOxJQ_9.js} +1 -1
  155. package/dist/assets/{index-ndgg4Xx-.js → index-CUJWzrdP.js} +1 -1
  156. package/dist/assets/{index-B5267oqA.js → index-CVH6GWSn.js} +14 -14
  157. package/dist/assets/{index-CR6ve8Ck.js → index-CbPrULOR.js} +1 -1
  158. package/dist/assets/{index-BfvgCRfu.js → index-CeFL2poq.js} +1 -1
  159. package/dist/assets/{index-DQecjVoC.js → index-CgP5_PId.js} +1 -1
  160. package/dist/assets/{index-D8Cs8xk3.js → index-Cgu8wTIs.js} +1 -1
  161. package/dist/assets/{index-CCwWrfc4.js → index-CisFWmyE.js} +1 -1
  162. package/dist/assets/{index-Bt0OiCSI.js → index-D76ebHrC.js} +1 -1
  163. package/dist/assets/{index-68NaTtAT.js → index-DAZIhRrh.js} +1 -1
  164. package/dist/assets/{index-CG7pBdX7.js → index-DBWF3Lxz.js} +1 -1
  165. package/dist/assets/{index-DKT4kT0z.js → index-DEd6Cfa8.js} +1 -1
  166. package/dist/assets/{index-i3zVFahC.js → index-DFmUO6xF.js} +1 -1
  167. package/dist/assets/{index-C09FcKq9.js → index-DJjyFLlw.js} +1 -1
  168. package/dist/assets/{index-DfAn9V8y.js → index-DMefWGOk.js} +1 -1
  169. package/dist/assets/{index-C9CBkm3J.js → index-D_FrsVa-.js} +1 -1
  170. package/dist/assets/{index-ekq_L-ma.js → index-DbNDw8nS.js} +1 -1
  171. package/dist/assets/{index-YHAd10KH.js → index-Dbz6Whu6.js} +1 -1
  172. package/dist/assets/{index-DaJgo_ZX.js → index-Dja9rj_K.js} +1 -1
  173. package/dist/assets/{index-C11T6v8N.js → index-DkIf_ple.js} +1 -1
  174. package/dist/assets/{index-C294PRIl.js → index-Do9Df4CM.js} +1 -1
  175. package/dist/assets/{index-DbBDYLLC.js → index-DpLV-Pq9.js} +1 -1
  176. package/dist/assets/{index-BvL_bkhW.js → index-DpUw2nds.js} +5 -5
  177. package/dist/assets/{index-h72lxwun.js → index-Du5AFIP4.js} +1 -1
  178. package/dist/assets/{index-C94_tKkM.js → index-Dw6ZevFg.js} +1 -1
  179. package/dist/assets/{index-DD8o6SGh.js → index-Dweaf6GL.js} +1 -1
  180. package/dist/assets/{index-CV49VNqG.js → index-Dz3Pj6U7.js} +1 -1
  181. package/dist/assets/{index-CQayeKqY.js → index-EBzcwoVz.js} +1 -1
  182. package/dist/assets/{index-Dh_hemGT.js → index-JCNQBsk6.js} +1 -1
  183. package/dist/assets/{index-C7rmhYmL.js → index-L5jgsIq7.js} +1 -1
  184. package/dist/assets/{index-C2Ef9ZKY.js → index-X7rR0bV_.js} +1 -1
  185. package/dist/assets/{index-BQc3ELHV.js → index-XXhfzQt9.js} +1 -1
  186. package/dist/assets/{index-_dbDaWih.js → index-aLp30AbD.js} +1 -1
  187. package/dist/assets/{index-Bf3A60rN.js → index-br52C4yM.js} +1 -1
  188. package/dist/assets/{index-0u4YGGTa.js → index-faFCZsic.js} +1 -1
  189. package/dist/assets/{index-Bg3fpyty.js → index-kjxsq5CZ.js} +1 -1
  190. package/dist/assets/{index-2vry-0Si.js → index-o8lT9clY.js} +1 -1
  191. package/dist/assets/{index-C3qZe6wM.js → index-pKQl0t5U.js} +1 -1
  192. package/dist/assets/{index-BM3sPBDY.js → index-rn5VBDzX.js} +1 -1
  193. package/dist/assets/{index.browser.esm-BjveNakI.js → index.browser.esm-CHlxecDj.js} +1 -1
  194. package/dist/assets/{index.es-D8MU6eMk.js → index.es-CLQR2iBw.js} +1 -1
  195. package/dist/assets/{info-dOvxF9_k.js → info-DuVw5mzG.js} +1 -1
  196. package/dist/assets/{info-circle-B_ptqPDa.js → info-circle-C6GHZLcW.js} +1 -1
  197. package/dist/assets/{isEqual-Dh50OCem.js → isEqual-CWBDsFs3.js} +1 -1
  198. package/dist/assets/{isPlainObject-dMdaxYmL.js → isPlainObject-Bsj5BOyI.js} +1 -1
  199. package/dist/assets/{lightbulb-D8KE_ZIV.js → lightbulb-CnLBNdvj.js} +1 -1
  200. package/dist/assets/{mail-DT7Oj5pA.js → mail-DTqpstTi.js} +1 -1
  201. package/dist/assets/{midjourney-DLKHed76.js → midjourney-BDsYzL3n.js} +1 -1
  202. package/dist/assets/{mobile-AVtFisqT.js → mobile-BFGzUche.js} +1 -1
  203. package/dist/assets/{more-DRhObOpy.js → more-BP58hcCv.js} +1 -1
  204. package/dist/assets/{network-placeholder-B_FWgMxk.js → network-placeholder-DGmpeLqB.js} +1 -1
  205. package/dist/assets/{nftPlaceholder-_di0fXLf.js → nftPlaceholder-BbN-ReOL.js} +1 -1
  206. package/dist/assets/{off-COt_i6CT.js → off-CuDhLkD6.js} +1 -1
  207. package/dist/assets/{order-CJX0GN2m.js → order-BkfVszSt.js} +1 -1
  208. package/dist/assets/{pagination-BlJ6xPMo.js → pagination-DiGyJEay.js} +1 -1
  209. package/dist/assets/{play-store-Cedel5kB.js → play-store-CuatSCMT.js} +1 -1
  210. package/dist/assets/{plus-Cuj7YYtp.js → plus-D9SjxQQI.js} +1 -1
  211. package/dist/assets/{price-BDO9ZXFV.js → price-B1xKQHsz.js} +1 -1
  212. package/dist/assets/{producer-MVbu9J-a.js → producer-DlXwdcbI.js} +1 -1
  213. package/dist/assets/{qr-code-BDZGQJwb.js → qr-code-w1eMa2kp.js} +1 -1
  214. package/dist/assets/{recycle-horizontal-C5WjUkxr.js → recycle-horizontal-cMqL1NnA.js} +1 -1
  215. package/dist/assets/{refresh-CbTpfLPL.js → refresh-e8l0YQDq.js} +1 -1
  216. package/dist/assets/{reown-logo-BXupsXS3.js → reown-logo-B7RaG0y6.js} +1 -1
  217. package/dist/assets/{search-Bsphe-gu.js → search-DqfT7unL.js} +1 -1
  218. package/dist/assets/{secp256k1-DSvuYwWr.js → secp256k1-COspyfWe.js} +1 -1
  219. package/dist/assets/{secp256k1-gBDfF4Ck.js → secp256k1-kYCozA5T.js} +1 -1
  220. package/dist/assets/{seedream-C7eDwzou.js → seedream-gFX5-V03.js} +1 -1
  221. package/dist/assets/{send-DTG8ft4a.js → send-Csm63skG.js} +1 -1
  222. package/dist/assets/{service-b1ACOrhy.js → service-WJQge7QR.js} +1 -1
  223. package/dist/assets/{solana-wallets-YBA_Z6os.js → solana-wallets-CYfOS7UQ.js} +2 -2
  224. package/dist/assets/{solana-wallets-vue-SsomcTKH.js → solana-wallets-vue-Bscgfmr7.js} +1 -1
  225. package/dist/assets/{suno-BOOKvePt.js → suno-BL7d1IKw.js} +1 -1
  226. package/dist/assets/{swapHorizontal-CgIZOiup.js → swapHorizontal-yYNnzyqc.js} +1 -1
  227. package/dist/assets/{swapHorizontalBold-B1U0OJbS.js → swapHorizontalBold-Y1mQ7Tez.js} +1 -1
  228. package/dist/assets/{swapHorizontalMedium-BvL_ktn0.js → swapHorizontalMedium-DGx_6f7N.js} +1 -1
  229. package/dist/assets/{swapHorizontalRoundedBold-DmBo86OS.js → swapHorizontalRoundedBold-C3C2ADWX.js} +1 -1
  230. package/dist/assets/{swapVertical-CwUQpp6D.js → swapVertical-CPtbqeHO.js} +1 -1
  231. package/dist/assets/{telegram-CgkGRZUZ.js → telegram-Dzq8EJiJ.js} +1 -1
  232. package/dist/assets/{three-dots-L8Alh1LI.js → three-dots-w_sA-jaR.js} +1 -1
  233. package/dist/assets/{twitch-tqDRvo5X.js → twitch-B0AyZCOx.js} +1 -1
  234. package/dist/assets/{twitterIcon-m-I-o48i.js → twitterIcon-VjusQ2hO.js} +1 -1
  235. package/dist/assets/{typescript-GHEyAG9P.js → typescript-BXdqla6u.js} +1 -1
  236. package/dist/assets/{use-form-item-CAmCDDpm.js → use-form-item-BV_L9kB7.js} +1 -1
  237. package/dist/assets/validator-C6fRYUzr.js +1 -0
  238. package/dist/assets/{verify-DYX5GAvx.js → verify-DCNYYOD8.js} +1 -1
  239. package/dist/assets/{verify-filled-Bd1KVQgm.js → verify-filled-DGrdV_-Z.js} +1 -1
  240. package/dist/assets/{w3m-modal-CUDhwQSo.js → w3m-modal-DziCVLQh.js} +1 -1
  241. package/dist/assets/{wallet-fqHipSqw.js → wallet-BVhzYpZk.js} +1 -1
  242. package/dist/assets/{wallet-placeholder-BNss7V7Y.js → wallet-placeholder-CNSpuUe_.js} +1 -1
  243. package/dist/assets/{walletconnect-Dd02hoMz.js → walletconnect-D-F4V5Hy.js} +1 -1
  244. package/dist/assets/{warning-circle-Bq66iBvQ.js → warning-circle-BGUzvH8t.js} +1 -1
  245. package/dist/assets/{web-By0Q0OWp.js → web-BA2ijAeV.js} +1 -1
  246. package/dist/assets/{web-biVkl97I.js → web-BqISh1Og.js} +1 -1
  247. package/dist/assets/{x-CGbk18ka.js → x-BJuco_wc.js} +1 -1
  248. package/dist/index.html +1 -1
  249. package/package.json +1 -1
  250. package/dist/assets/chat-BFvmXnGq.js +0 -1
  251. package/dist/assets/chat-BJ1O-acr.js +0 -1
  252. package/dist/assets/chat-BVnywm8V.js +0 -1
  253. package/dist/assets/chat-Bg5nzR2s.js +0 -1
  254. package/dist/assets/chat-Bi9bSam4.js +0 -1
  255. package/dist/assets/chat-BiKeApIc.js +0 -1
  256. package/dist/assets/chat-C6a-XWNv.js +0 -1
  257. package/dist/assets/chat-CcBdBoIQ.js +0 -1
  258. package/dist/assets/chat-DA19T0N-.js +0 -1
  259. package/dist/assets/chat-DDwlXTRr.js +0 -1
  260. package/dist/assets/chat-D_ldAckE.js +0 -1
  261. package/dist/assets/chat-Dh1tEg2g.js +0 -1
  262. package/dist/assets/chat-DktNImx9.js +0 -1
  263. package/dist/assets/chat-J4Z-vAUt.js +0 -1
  264. package/dist/assets/chat-UZtzKTY5.js +0 -1
  265. package/dist/assets/chat-VonUfVbJ.js +0 -1
  266. package/dist/assets/chat-mrd8Uqt-.js +0 -1
  267. package/dist/assets/chat-n5ursQ4V.js +0 -1
  268. package/dist/assets/validator-BY6D6xjR.js +0 -1
@@ -1 +1 @@
1
- import{F as L}from"./index.es-D8MU6eMk.js";import{E as M}from"./index-DbBDYLLC.js";import{E as ue}from"./index-C09FcKq9.js";import{d as y,H as m,E as i,z,C as n,y as f,D as o,q as a,F as r,x as S,O as V,N as T,Q as U,J as v,R as ye,I as C,M as we}from"./vendor-vue-NSDaktjZ.js";import{H as w,bp as K,ah as Ce,I as Se,cs as oe,aI as ne,S as se,ct as Ve}from"./index-B5267oqA.js";import{a as Ie,b as ie,c as H,d as D,e as Te,f as Ee,g as Le}from"./kling-DwJwIwVI.js";import{E as P,a as G}from"./index-h72lxwun.js";import{E as W}from"./index-BQc3ELHV.js";import{E as b}from"./index-CCwWrfc4.js";import{I,S as Me,l as Ue}from"./pagination-BlJ6xPMo.js";import{p as J}from"./pasteUploadMixin-BurWbGNQ.js";import{u as O,a as Re,e as ae}from"./uploadTrackerMixin--N-yU8Tl.js";import{I as j}from"./ImagePreview-D-9EFWby.js";import{E as Q}from"./index-CzL5AhXP.js";import{E as N}from"./index-bs2QXOh6.js";import{C as me}from"./Consumption-B3cgN_uS.js";import{E as pe}from"./index-ukLW3UKB.js";import{E as ge}from"./index-Bop7QJNZ.js";import{E as fe}from"./index-D3Pn_CC4.js";import{P as Ae,N as De}from"./NoTasks-C9fjzpt-.js";import{E as he}from"./index-CQayeKqY.js";import{a as _e}from"./price-BDO9ZXFV.js";import{F as Pe}from"./FilePreview-CgjWf7IZ.js";import{E as Ge,a as Ke}from"./index-DfAn9V8y.js";import{E as Oe,a as je}from"./index-BM3sPBDY.js";import{b as le}from"./errorCode-Cqj9Td_Z.js";import{C as Ne}from"./CopyToClipboard-g4vBpWAA.js";import{V as Be}from"./VideoPlayer-D2Gk8iOW.js";import{A as ze}from"./ApiCodeButton-BxWrNlio.js";import{E as Fe}from"./index-B5jo7NY3.js";import{E as qe}from"./index-Bf3A60rN.js";import{B as He}from"./BotPlaceholder-DpiZEQow.js";import"./use-form-item-CAmCDDpm.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Df5ITouH.js";import"./index-V-c9hDuN.js";import"./typescript-GHEyAG9P.js";import"./index-C94_tKkM.js";import"./strings-beZM2Y-f.js";import"./isEqual-Dh50OCem.js";import"./_Uint8Array-pk5G6DXb.js";import"./castArray-tmh9kbwO.js";import"./debounce-DBeMKn11.js";import"./_baseIteratee-DKwNed0n.js";import"./index-YHAd10KH.js";import"./validator-BY6D6xjR.js";import"./highlight-BIVpqebW.js";import"./index-BLjywj98.js";import"./vendor-highlight-lEWW1Jxd.js";import"./index-Tga9YfTB.js";import"./_baseClone-BEl0SBVQ.js";import"./_initCloneObject-7jYqtSMb.js";import"./index-Cu41y2Fl.js";import"./index-DVPxXPIi.js";import"./isPlainObject-dMdaxYmL.js";import"./vue-plyr-BO2nlN4c.js";import"./index-68NaTtAT.js";const We=y({name:"LayoutKling",components:{ElDrawer:ue,ElButton:M,FontAwesomeIcon:L},data(){return{drawer:!1}}}),Je={class:"main flex flex-row flex-1 min-h-0"},Qe={class:"config w-[320px] flex-none h-full flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},Ye={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function Xe(e,t,s,l,u,$){const d=o("font-awesome-icon"),p=o("el-button"),g=o("el-drawer");return a(),m("div",Je,[i("div",Qe,[z(e.$slots,"config",{},void 0,!0)]),i("div",Ye,[z(e.$slots,"result",{},void 0,!0)]),n(p,{circle:"",class:"menu",onClick:t[0]||(t[0]=c=>e.drawer=!0)},{default:f(()=>[n(d,{icon:"fa-solid fa-magic"})]),_:1}),n(g,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=c=>e.drawer=c),direction:"ltr","with-header":!1,size:"350px"},{default:f(()=>[z(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Ze=w(We,[["render",Xe],["__scopeId","data-v-be4bb0df"]]),xe={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function Y(e,t,s){const l=t||"std",u=s??5;switch(e){case"kling-v1":return{text2video:!0,image2video:!0,endImage:u===5,audio:!1,motionControl:u===5};case"kling-v1-6":case"kling-v2-5-turbo":return{text2video:!0,image2video:!0,endImage:l==="pro",audio:!1,motionControl:!1};case"kling-v2-6":return{text2video:!0,image2video:!0,endImage:l==="pro",audio:l==="pro",motionControl:!1};case"kling-v2-master":case"kling-v2-1-master":return{text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};case"kling-v3":return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:l!=="4k"};case"kling-v3-omni":return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:!1};case"kling-video-o1":return{text2video:!0,image2video:!0,endImage:!0,audio:!1,motionControl:!1};default:return xe}}function X(e,t){if(!e)return[];const s=t.model??e.model,l=t.mode??e.mode,u=t.duration??e.duration;if(!s)return[];const $=Y(s,l,u),d=[];return e.end_image_url&&!$.endImage&&d.push({field:"end_image_url",i18nLabel:"kling.name.endImage"}),e.generate_audio&&!$.audio&&d.push({field:"generate_audio",i18nLabel:"kling.name.generateAudio"}),e.camera_control?.type&&(!$.motionControl||e.start_image_url)&&d.push({field:"camera_control",i18nLabel:"kling.name.cameraControl"}),d}function Z(e,t){const s={...e};for(const l of t)l.field==="end_image_url"&&(s.end_image_url=void 0),l.field==="generate_audio"&&(s.generate_audio=!1),l.field==="camera_control"&&(s.camera_control=void 0);return s}const et=y({name:"ModelSelector",components:{ElSelect:G,ElOption:P},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{revertKey:0,options:[{value:"kling-v3",label:"v3"},{value:"kling-v3-omni",label:"v3-Omni"},{value:"kling-v2-6",label:"v2.6"},{value:"kling-v2-5-turbo",label:"v2.5-Turbo"},{value:"kling-v2-1-master",label:"v2.1-Master"},{value:"kling-v2-master",label:"v2-Master"},{value:"kling-v1-6",label:"v1.6"},{value:"kling-v1",label:"v1"},{value:"kling-video-o1",label:"Video-o1"}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(Ie)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=X(t,{model:e});if(s.length===0){this.applyModel(e);return}const l=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await W.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:l}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=Z({...t,model:e},s);this.$store.commit("kling/setConfig",u),b.success(this.$t("kling.message.featureRemovedNotice",{fields:l}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,model:e})}}}),tt={class:"field"},ot={class:"title font-bold"};function nt(e,t,s,l,u,$){const d=o("el-option"),p=o("el-select");return a(),m("div",tt,[i("h2",ot,r(e.$t("pika.name.model")),1),(a(),S(p,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("pika.placeholder.select"),onChange:e.onChange},{default:f(()=>[(a(!0),m(V,null,T(e.options,g=>(a(),S(d,{key:g.value,label:g.label,value:g.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const st=w(et,[["render",nt],["__scopeId","data-v-04059875"]]),it=y({name:"ModeSelector",components:{ElSelect:G,ElOption:P,InfoIcon:I},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 H.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(ie)}},mounted(){this.value||this.applyMode(ie)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=X(t,{mode:e});if(s.length===0){this.applyMode(e);return}const l=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await W.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:l}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=Z({...t,mode:e},s);this.$store.commit("kling/setConfig",u),b.success(this.$t("kling.message.featureRemovedNotice",{fields:l}))}catch{this.revertKey+=1}},applyMode(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,mode:e})}}}),at={class:"field"},lt={class:"header"},rt={class:"title font-bold"},ct={key:0,class:"opt-tip"};function dt(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-option"),g=o("el-select");return a(),m("div",at,[i("div",lt,[i("h2",rt,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.mode"),class:"info-icon"},null,8,["content"])]),(a(),S(g,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("kling.placeholder.select"),clearable:!0,onChange:e.onChange},{default:f(()=>[(a(!0),m(V,null,T(e.options,c=>(a(),S(p,{key:c.value,label:c.label,value:c.value,disabled:c.disabled},{default:f(()=>[i("span",{class:U({"opt-disabled":c.disabled})},r(c.label),3),c.disabled&&c.disabledReason?(a(),m("span",ct,r(c.disabledReason),1)):v("",!0)]),_:2},1032,["label","value","disabled"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const ut=w(it,[["render",dt],["__scopeId","data-v-9a8fa3c5"]]),mt=[3,5,8,10,12,15],pt=[5,10],gt=y({name:"DurationSelector",components:{ElSelect:G,ElOption:P,InfoIcon:I},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},isV3Model(){return H.includes(this.selectedModel)},allowedDurations(){return this.isV3Model?mt:pt},value(){return this.$store.state.kling?.config?.duration??D},selectValue(){const e=this.allowedDurations;return e.includes(this.value)?this.value:e.includes(D)?D:e[0]}},watch:{isV3Model(){this.allowedDurations.includes(this.value)||this.applyDuration(D)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(D)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=X(t,{duration:e});if(s.length===0){this.applyDuration(e);return}const l=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await W.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:l}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=Z({...t,duration:e},s);this.$store.commit("kling/setConfig",u),b.success(this.$t("kling.message.featureRemovedNotice",{fields:l}))}catch{this.revertKey+=1}},applyDuration(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,duration:e})}}}),ft={class:"field"},ht={class:"control"},_t={class:"label"},$t={class:"title font-bold"};function kt(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-option"),g=o("el-select");return a(),m("div",ft,[i("div",ht,[i("div",_t,[i("h2",$t,r(e.$t("kling.name.duration")),1),n(d,{content:e.$t("kling.description.duration"),class:"info-icon ml-1"},null,8,["content"])]),(a(),S(g,{key:e.revertKey,"model-value":e.selectValue,class:"value",placeholder:e.$t("kling.placeholder.select"),onChange:e.onChange},{default:f(()=>[(a(!0),m(V,null,T(e.allowedDurations,c=>(a(),S(p,{key:c,label:`${c}s`,value:c},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])])}const vt=w(gt,[["render",kt],["__scopeId","data-v-5ae55e28"]]),bt=y({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||(this.value=Te)}}),yt={class:"text-sm font-bold mb-2 block"},wt={class:"items"},Ct=["onClick"],St={class:"name"};function Vt(e,t,s,l,u,$){return a(),m("div",null,[i("span",yt,r(e.$t("kling.name.ratio")),1),i("div",wt,[(a(!0),m(V,null,T(e.options,(d,p)=>(a(),m("div",{key:p,class:U({active:e.active===p,item:!0}),onClick:g=>e.value=d.value},[i("div",{class:U(["preview",d.label])},[i("div",{class:"rect",style:ye({width:d.width+"px",height:d.height+"px"})},null,4)],2),i("p",St,r(d.label),1)],10,Ct))),128))])])}const It=w(bt,[["render",Vt],["__scopeId","data-v-cdb14b2f"]]),Tt=y({name:"StartImage",components:{ElUpload:N,ElButton:M,ElTooltip:Q,InfoIcon:I,FontAwesomeIcon:L,ImagePreview:j},mixins:[J,O],emits:["change"],data(){return{fileList:[],uploadUrl:K()+"/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(){}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){b.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){b.error(this.$t("kling.message.uploadReferencesError"))},onSetStartImageUrl(){const e=this.urls?.[0];this.$store.commit("kling/setConfig",{...this.$store.state?.kling?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),Et={class:"relative"},Lt={class:"flex justify-between"},Mt={class:"flex justify-start items-center"},Ut={class:"text-sm font-bold"};function Rt(e,t,s,l,u,$){const d=o("info-icon"),p=o("image-preview"),g=o("font-awesome-icon"),c=o("el-button"),k=o("el-tooltip"),h=o("el-upload");return a(),m("div",Et,[i("div",Lt,[i("div",Mt,[i("span",Ut,r(e.$t("kling.name.startImage")),1),n(d,{content:e.$t("kling.description.uploadStartImage")},null,8,["content"])])]),n(h,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,disabled:e.reachedLimit,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:f(({file:_})=>[_.url&&_.percentage!==void 0?(a(),S(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:E=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:f(()=>[n(k,{content:e.$t("kling.message.uploadReferencesExceed"),disabled:!e.reachedLimit,placement:"top"},{default:f(()=>[i("span",null,[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.reachedLimit},{default:f(()=>[n(g,{icon:"fa-solid fa-upload",class:"icon mr-1"}),C(" "+r(e.$t("kling.button.uploadReferences")),1)]),_:1},8,["disabled"])])]),_:1},8,["content","disabled"])]),_:1},8,["file-list","disabled","action","on-exceed","on-error","on-success","headers"])])}const At=w(Tt,[["render",Rt],["__scopeId","data-v-756dc269"]]),Dt=y({name:"EndImage",components:{ElUpload:N,ElButton:M,ElTooltip:Q,ImagePreview:j,InfoIcon:I,FontAwesomeIcon:L},mixins:[J,O],data(){return{fileList:[],uploadUrl:K()+"/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 Y(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||(this.value=void 0),this.onSetEndImageUrl()},methods:{onBeforeUpload(){return this.endImageSupported?this.hasStartImage?!0:(b.warning(this.$t("kling.message.endImageRequiresStart")),!1):(b.warning(this.$t("kling.message.endImageNotSupported")),!1)},onExceed(){b.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){b.error(this.$t("kling.message.uploadReferencesError"))},onSetEndImageUrl(){const e=this.urls?.[0];this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),Pt={class:"relative"},Gt={class:"flex justify-between"},Kt={class:"flex justify-start items-center"},Ot={class:"text-sm font-bold"};function jt(e,t,s,l,u,$){const d=o("info-icon"),p=o("image-preview"),g=o("font-awesome-icon"),c=o("el-button"),k=o("el-tooltip"),h=o("el-upload");return a(),m("div",Pt,[i("div",Gt,[i("div",Kt,[i("span",Ot,r(e.$t("kling.name.endImage")),1),n(d,{content:e.$t("kling.description.uploadEndImage")},null,8,["content"])])]),n(h,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,disabled:e.uploadDisabled,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","before-upload":e.onBeforeUpload,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:f(({file:_})=>[_.url&&_.percentage!==void 0?(a(),S(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:E=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:f(()=>[n(k,{content:e.uploadTooltip,disabled:!e.uploadDisabled,placement:"top"},{default:f(()=>[i("span",null,[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.uploadDisabled},{default:f(()=>[n(g,{icon:"fa-solid fa-upload",class:"icon mr-1"}),C(" "+r(e.$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"])])}const Nt=w(Dt,[["render",jt],["__scopeId","data-v-c1b257e5"]]),Bt=y({name:"CfgScaleSelector",components:{ElSlider:ge,InfoIcon:I,ElInputNumber:pe},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||(this.value=Ee)}}),zt={class:"flex justify-between"},Ft={class:"flex justify-start items-center"},qt={class:"text-sm font-bold"},Ht={class:"flex justify-end items-center"},Wt={class:"w-full"};function Jt(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-input-number"),g=o("el-slider");return a(),m("div",null,[i("div",zt,[i("div",Ft,[i("span",qt,r(e.$t("kling.name.cfgScale")),1),n(d,{content:e.$t("kling.description.cfgScale")},null,8,["content"])]),i("div",Ht,[n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),"controls-position":"right"},null,8,["modelValue"])])]),i("div",Wt,[n(g,{modelValue:e.value,"onUpdate:modelValue":t[1]||(t[1]=c=>e.value=c),min:0,max:1,step:.1},null,8,["modelValue"])])])}const Qt=w(Bt,[["render",Jt]]),Yt=y({name:"GenerateAudioSelector",components:{ElSwitch:fe,InfoIcon:I},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},selectedMode(){return this.$store.state.kling?.config?.mode||""},supported(){return!!(H.includes(this.selectedModel)||this.selectedModel==="kling-v2-6"&&this.selectedMode==="pro")},tooltipContent(){return this.supported?this.$t("kling.description.generateAudio"):this.$t("kling.description.generateAudioUnsupported")},value:{get(){return this.supported?this.$store.state.kling?.config?.generate_audio??Le:!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})}}}),Xt={class:"relative"},Zt={class:"flex justify-between items-center"},xt={class:"flex justify-start items-center"},eo={class:"text-sm font-bold"};function to(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-switch");return a(),m("div",Xt,[i("div",Zt,[i("div",xt,[i("span",eo,r(e.$t("kling.name.generateAudio")),1),n(d,{content:e.tooltipContent},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=g=>e.value=g),class:"value",disabled:!e.supported},null,8,["modelValue","disabled"])])])}const oo=w(Yt,[["render",to]]),no=["horizontal","vertical","pan","tilt","roll","zoom"],so=y({name:"CameraControlSelector",components:{ElSelect:G,ElOption:P,ElSlider:ge,ElInputNumber:pe,InfoIcon:I},data(){return{configKeys:no}},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 Y(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){const t=this.$store.state.kling?.config||{};if(!e){const l={...t};delete l.camera_control,this.$store.commit("kling/setConfig",l);return}const s=e;this.$store.commit("kling/setConfig",{...t,camera_control:{type:s,config:s==="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){const s=this.$store.state.kling?.config||{},l=s.camera_control||{type:"simple"},u={...l.config||{}};t==null?delete u[e]:u[e]=t,this.$store.commit("kling/setConfig",{...s,camera_control:{...l,type:"simple",config:u}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),io={class:"field"},ao={class:"header"},lo={class:"text-sm font-bold"},ro={key:0,class:"config-grid"},co={class:"cfg-row-head"},uo={class:"cfg-name"};function mo(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-option"),g=o("el-select"),c=o("el-input-number"),k=o("el-slider");return a(),m("div",io,[i("div",ao,[i("span",lo,r(e.$t("kling.name.cameraControl")),1),n(d,{content:e.tooltipContent},null,8,["content"])]),n(g,{modelValue:e.selectedTypeRaw,"onUpdate:modelValue":t[0]||(t[0]=h=>e.selectedTypeRaw=h),class:"value",placeholder:e.$t("kling.placeholder.cameraType"),clearable:!0,disabled:e.disabled},{default:f(()=>[(a(!0),m(V,null,T(e.typeOptions,h=>(a(),S(p,{key:h.value,label:h.label,value:h.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","disabled"]),e.selectedType==="simple"&&!e.disabled?(a(),m("div",ro,[(a(!0),m(V,null,T(e.configKeys,h=>(a(),m("div",{key:h,class:"cfg-row"},[i("div",co,[i("span",uo,r(e.$t(`kling.name.cc_${h}`)),1),n(c,{modelValue:e.configValues[h],"onUpdate:modelValue":_=>e.configValues[h]=_,min:-1,max:1,step:.1,precision:1,"controls-position":"right",size:"small",class:"cfg-num",onChange:_=>e.onNumberChange(h,_)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),n(k,{"model-value":e.configValues[h]??0,min:-1,max:1,step:.1,onInput:_=>e.onSliderChange(h,_)},null,8,["model-value","onInput"])]))),128))])):v("",!0)])}const po=w(so,[["render",mo],["__scopeId","data-v-cd896060"]]),$e=[{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"]}],F=", ";function go(e,t){const s=(e||"").trim();return s?s.includes(t)?s:`${s}${F}${t}`:t}function q(e,t){if(!e||!t)return e||"";const s=[`${t}${F}`,`${F}${t}`,t];let l=e;for(const u of s)if(l.includes(u)){l=l.replace(u,"");break}return l.replace(/(?:,\s*)+$/,"").replace(/^(?:,\s*)+/,"")}const fo=y({name:"InspirationPills",components:{FontAwesomeIcon:L},computed:{prompt(){return this.$store.state.kling?.config?.prompt||""},allChipTexts(){return $e.flatMap(e=>e.chipKeys.map(t=>this.$t(`kling.inspiration.chip.${t}`)))},selected(){const e=this.prompt;if(!e)return[];const t=[];for(const s of this.allChipTexts){const l=e.indexOf(s);l!==-1&&t.push({text:s,idx:l})}return t.sort((s,l)=>s.idx-l.idx).map(s=>s.text)}},methods:{onRemove(e){const t=q(this.prompt,e);this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:t})}}}),ho={key:0,class:"pills",role:"list"},_o={class:"pill-text"},$o=["aria-label","onClick"];function ko(e,t,s,l,u,$){const d=o("font-awesome-icon");return e.selected.length>0?(a(),m("div",ho,[(a(!0),m(V,null,T(e.selected,p=>(a(),m("div",{key:p,class:"pill",role:"listitem"},[i("span",_o,r(p),1),i("button",{type:"button",class:"pill-remove","aria-label":e.$t("kling.inspiration.removeChip"),onClick:we(g=>e.onRemove(p),["stop"])},[n(d,{icon:"fa-solid fa-xmark"})],8,$o)]))),128))])):v("",!0)}const vo=w(fo,[["render",ko],["__scopeId","data-v-5fc4fa65"]]),bo="",yo=y({name:"PromptInput",components:{ElButton:M,FontAwesomeIcon:L,PromptTextarea:Ae,InspirationPills:vo},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||(this.prompt=bo)}});function wo(e,t,s,l,u,$){const d=o("font-awesome-icon"),p=o("el-button"),g=o("inspiration-pills"),c=o("prompt-textarea");return a(),S(c,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||(t[1]=k=>e.prompt=k),title:e.$t("kling.name.prompt"),info:e.$t("kling.description.prompt"),placeholder:e.$t("kling.placeholder.prompt")},{actions:f(()=>[n(p,{text:"",size:"small",class:"inspiration-btn",onClick:t[0]||(t[0]=k=>e.$emit("open-inspiration"))},{default:f(()=>[n(d,{icon:"fa-regular fa-lightbulb",class:"mr-1"}),C(" "+r(e.$t("kling.inspiration.openButton")),1)]),_:1})]),before:f(()=>[n(g)]),_:1},8,["modelValue","title","info","placeholder"])}const Co=w(yo,[["render",wo],["__scopeId","data-v-c01fc1a6"]]),So="",Vo=y({name:"NegativePromptInput",components:{ElInput:he,InfoIcon:I},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||(this.prompt=So)}}),Io={class:"field"},To={class:"box"},Eo={class:"title font-bold"};function Lo(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-input");return a(),m("div",Io,[i("div",To,[i("h2",Eo,r(e.$t("kling.name.negativePrompt")),1),n(d,{content:e.$t("kling.description.negativePrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=g=>e.prompt=g),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.negativePrompt")},null,8,["modelValue","placeholder"])])}const Mo=w(Vo,[["render",Lo],["__scopeId","data-v-de98cf01"]]),Uo=y({name:"InspirationDrawer",components:{ElDrawer:ue,ElButton:M,FontAwesomeIcon:L},props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],data(){return{groups:$e,Close:Ce}},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(t=>this.$t(`kling.inspiration.chip.${t}`)))},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(q(this.prompt,e)):this.setPrompt(go(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(const t of this.allChipTexts)for(;e.includes(t);)e=q(e,t);this.setPrompt(e)}}}),Ro={class:"drawer-content"},Ao={class:"drawer-header"},Do={class:"title-row"},Po={class:"title"},Go={class:"hint"},Ko={key:0,class:"selected-bar"},Oo={class:"selected-text"},jo={class:"groups"},No={class:"group-title"},Bo={class:"chip-grid"},zo=["onClick"];function Fo(e,t,s,l,u,$){const d=o("font-awesome-icon"),p=o("el-button"),g=o("el-drawer");return a(),S(g,{modelValue:e.visible,"onUpdate:modelValue":t[1]||(t[1]=c=>e.visible=c),direction:"rtl","with-header":!1,size:e.drawerSize,"custom-class":"kling-inspiration-drawer","destroy-on-close":!1},{default:f(()=>[i("div",Ro,[i("div",Ao,[i("div",Do,[n(d,{icon:"fa-regular fa-lightbulb",class:"mr-2"}),i("span",Po,r(e.$t("kling.inspiration.title")),1)]),n(p,{text:"",icon:e.Close,class:"close-btn",onClick:t[0]||(t[0]=c=>e.visible=!1)},null,8,["icon"])]),i("div",Go,r(e.$t("kling.inspiration.hint")),1),e.selectedCount>0?(a(),m("div",Ko,[i("span",Oo,r(e.$t("kling.inspiration.selectedSummary",{count:e.selectedCount})),1),n(p,{text:"",size:"small",class:"clear-btn",onClick:e.onClearSelected},{default:f(()=>[C(r(e.$t("kling.inspiration.clearSelected")),1)]),_:1},8,["onClick"])])):v("",!0),i("div",jo,[(a(!0),m(V,null,T(e.groups,c=>(a(),m("div",{key:c.groupKey,class:"group"},[i("div",No,r(e.$t(`kling.inspiration.group.${c.groupKey}`)),1),i("div",Bo,[(a(!0),m(V,null,T(c.chipKeys,k=>(a(),m("button",{key:k,type:"button",class:U({chip:!0,active:e.isSelected(e.chipText(k))}),onClick:h=>e.onToggle(e.chipText(k))},r(e.chipText(k)),11,zo))),128))])]))),128))])])]),_:1},8,["modelValue","size"])}const qo=w(Uo,[["render",Fo],["__scopeId","data-v-7d457a69"]]),Ho={"kling-v3":"v3","kling-v3-omni":"v3-Omni","kling-v2-6":"v2.6","kling-v2-5-turbo":"v2.5-Turbo","kling-v2-1-master":"v2.1-Master","kling-v2-master":"v2-Master","kling-v1-6":"v1.6","kling-v1":"v1","kling-video-o1":"Video-o1"},Wo={std:"720p",pro:"1080p","4k":"4K"},Jo=y({name:"SummaryChip",components:{FontAwesomeIcon:L},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){const e=this.config?.model||"kling-v2-5-turbo";return Ho[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||""},modeLabel(){const e=this.config?.mode||"std";return Wo[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),Qo={class:"summary-chip"},Yo=["title"],Xo=["title"],Zo=["title"],xo=["title"],en=["title"];function tn(e,t,s,l,u,$){const d=o("font-awesome-icon");return a(),m("div",Qo,[i("span",{class:"part",title:e.$t("kling.name.model")},r(e.modelLabel),9,Yo),t[0]||(t[0]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.duration")},r(e.durationLabel),9,Xo),t[1]||(t[1]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.ratio")},r(e.aspectRatio||"16:9"),9,Zo),t[2]||(t[2]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.mode")},r(e.modeLabel),9,xo),e.generateAudio?(a(),m("span",{key:0,class:"audio",title:e.$t("kling.name.generateAudio")},[n(d,{icon:"fa-solid fa-headphones"})],8,en)):v("",!0)])}const on=w(Jo,[["render",tn],["__scopeId","data-v-418a6733"]]),nn=y({name:"ConfigPanel",components:{ElButton:M,Consumption:me,FontAwesomeIcon:L,PromptInput:Co,NegativePromptInput:Mo,ModelSelector:st,ModeSelector:ut,DurationSelector:vt,RatioSelector:It,StartImage:At,CfgScaleSelector:Qt,GenerateAudioSelector:oo,CameraControlSelector:po,InspirationDrawer:qo,SummaryChip:on,EndImage:Nt},emits:["generate"],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},consumption(){return _e(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit("generate")}}}),sn={class:"flex flex-col h-full"},an={class:"flex-1 overflow-y-auto p-5"},ln={class:"flex flex-col items-center justify-center px-5 pb-5"};function rn(e,t,s,l,u,$){const d=o("prompt-input"),p=o("model-selector"),g=o("ratio-selector"),c=o("start-image"),k=o("end-image"),h=o("duration-selector"),_=o("mode-selector"),E=o("generate-audio-selector"),R=o("camera-control-selector"),A=o("cfg-scale-selector"),B=o("negative-prompt-input"),ke=o("summary-chip"),ve=o("consumption"),x=o("font-awesome-icon"),ee=o("el-button"),be=o("inspiration-drawer");return a(),m("div",sn,[i("div",an,[n(d,{class:"mb-4",onOpenInspiration:t[0]||(t[0]=te=>e.inspirationOpen=!0)}),n(p,{class:"mb-4"}),n(g,{class:"mb-4"}),n(c,{class:"mb-2"}),n(k,{class:"mb-2"}),n(h,{class:"mb-4"}),n(_,{class:"mb-4"}),n(E,{class:"mb-4"}),n(R,{class:"mb-4"}),n(A,{class:"mb-4"}),n(B,{class:"mb-4"})]),i("div",ln,[n(ke),n(ve,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(a(),S(ee,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:f(()=>[n(x,{icon:"fa-solid fa-magic",class:"mr-2"}),C(" "+r(e.$t("kling.button.extend")),1)]),_:1},8,["onClick"])):(a(),S(ee,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:f(()=>[n(x,{icon:"fa-solid fa-magic",class:"mr-2"}),C(" "+r(e.$t("kling.button.generate")),1)]),_:1},8,["onClick"]))]),n(be,{modelValue:e.inspirationOpen,"onUpdate:modelValue":t[1]||(t[1]=te=>e.inspirationOpen=te)},null,8,["modelValue"])])}const cn=w(nn,[["render",rn]]),dn=y({name:"MotionImage",components:{ElUpload:N,ElButton:M,InfoIcon:I,FontAwesomeIcon:L,ImagePreview:j},mixins:[J,O],data(){return{fileList:[],uploadUrl:K()+"/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(){b.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){b.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(){const e=this.urls?.[0];this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,image_url:e})},async onSuccess(){this.onSetImageUrl()}}}),un={class:"relative"},mn={class:"flex justify-between"},pn={class:"flex justify-start items-center"},gn={class:"text-sm font-bold"};function fn(e,t,s,l,u,$){const d=o("info-icon"),p=o("image-preview"),g=o("font-awesome-icon"),c=o("el-button"),k=o("el-upload");return a(),m("div",un,[i("div",mn,[i("div",pn,[i("span",gn,r(e.$t("kling.name.motionImage")),1),n(d,{content:e.$t("kling.description.motionImage")},null,8,["content"])])]),n(k,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=h=>e.fileList=h),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:f(({file:h})=>[h.url&&h.percentage!==void 0?(a(),S(p,{key:0,url:h.url,name:h.name,percentage:h.percentage,onRemove:_=>e.onRemove(h)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:f(()=>[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:f(()=>[n(g,{icon:"fa-solid fa-upload",class:"icon mr-1"}),C(" "+r(e.$t("kling.button.uploadReferences")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const hn=w(dn,[["render",fn],["__scopeId","data-v-e52eaf2f"]]),_n=y({name:"MotionVideo",components:{ElUpload:N,ElButton:M,InfoIcon:I,FilePreview:Pe,FontAwesomeIcon:L},mixins:[O],data(){return{fileList:[],uploadUrl:K()+"/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(){b.warning(this.$t("kling.message.uploadVideoExceed"))},onError(){b.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){const t=e.type==="video/mp4"||e.type==="video/quicktime",s=e.size/1024/1024<100;return t?s?!0:(b.error(this.$t("kling.message.uploadVideoSizeExceed")),!1):(b.error(this.$t("kling.message.uploadVideoTypeFailed")),!1)},onSetVideoUrl(){const e=this.urls?.[0];this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,video_url:e})},async onSuccess(){this.onSetVideoUrl()}}}),$n={class:"relative"},kn={class:"flex justify-between"},vn={class:"flex justify-start items-center"},bn={class:"text-sm font-bold"};function yn(e,t,s,l,u,$){const d=o("info-icon"),p=o("file-preview"),g=o("font-awesome-icon"),c=o("el-button"),k=o("el-upload");return a(),m("div",$n,[i("div",kn,[i("div",vn,[i("span",bn,r(e.$t("kling.name.motionVideo")),1),n(d,{content:e.$t("kling.description.motionVideo")},null,8,["content"])])]),n(k,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=h=>e.fileList=h),accept:".mp4,.mov",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"before-upload":e.beforeUpload,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:f(({file:h})=>[h.percentage!==void 0?(a(),S(p,{key:0,url:h.url||h.response?.file_url,name:h.name,percentage:h.percentage,onRemove:_=>e.onRemove(h)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:f(()=>[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:f(()=>[n(g,{icon:"fa-solid fa-upload",class:"icon mr-1"}),C(" "+r(e.$t("kling.button.uploadVideoUrl")),1)]),_:1})]),_:1},8,["file-list","action","before-upload","on-exceed","on-error","on-success","headers"])])}const wn=w(_n,[["render",yn],["__scopeId","data-v-7019a8d2"]]),Cn=y({name:"MotionPromptInput",components:{ElInput:he,InfoIcon:I},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||""},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),Sn={class:"field"},Vn={class:"box"},In={class:"title font-bold"};function Tn(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-input");return a(),m("div",Sn,[i("div",Vn,[i("h2",In,r(e.$t("kling.name.motionPrompt")),1),n(d,{content:e.$t("kling.description.motionPrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=g=>e.prompt=g),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.motionPrompt")},null,8,["modelValue","placeholder"])])}const En=w(Cn,[["render",Tn],["__scopeId","data-v-ca9fdbe5"]]),re="video",Ln=y({name:"CharacterOrientationSelector",components:{ElRadioGroup:Ke,ElRadioButton:Ge,InfoIcon:I},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||re},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=re)}}),Mn={class:"field"},Un={class:"header"},Rn={class:"text-sm font-bold"};function An(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-radio-button"),g=o("el-radio-group");return a(),m("div",Mn,[i("div",Un,[i("span",Rn,r(e.$t("kling.name.characterOrientation")),1),n(d,{content:e.$t("kling.description.characterOrientation")},null,8,["content"])]),n(g,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),size:"small",class:"value"},{default:f(()=>[n(p,{label:"image"},{default:f(()=>[C(r(e.$t("kling.name.orientationImage")),1)]),_:1}),n(p,{label:"video"},{default:f(()=>[C(r(e.$t("kling.name.orientationVideo")),1)]),_:1})]),_:1},8,["modelValue"])])}const Dn=w(Ln,[["render",An],["__scopeId","data-v-7a91195b"]]),ce="std",Pn=y({name:"MotionModeSelector",components:{ElSelect:G,ElOption:P,InfoIcon:I},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||ce},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=ce)}}),Gn={class:"field"},Kn={class:"header"},On={class:"title font-bold"};function jn(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-option"),g=o("el-select");return a(),m("div",Gn,[i("div",Kn,[i("h2",On,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.motionMode")},null,8,["content"])]),n(g,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),class:"value",placeholder:e.$t("kling.placeholder.select")},{default:f(()=>[(a(!0),m(V,null,T(e.options,c=>(a(),S(p,{key:c.value,label:c.label,value:c.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Nn=w(Pn,[["render",jn],["__scopeId","data-v-1295688c"]]),Bn=y({name:"KeepOriginalSoundSelector",components:{ElSwitch:fe,InfoIcon:I},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"})}}}}),zn={class:"relative"},Fn={class:"flex justify-between items-center"},qn={class:"flex justify-start items-center"},Hn={class:"text-sm font-bold"};function Wn(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-switch");return a(),m("div",zn,[i("div",Fn,[i("div",qn,[i("span",Hn,r(e.$t("kling.name.keepOriginalSound")),1),n(d,{content:e.$t("kling.description.keepOriginalSound")},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=g=>e.value=g)},null,8,["modelValue"])])])}const Jn=w(Bn,[["render",Wn]]),Qn=y({name:"MotionPanel",components:{ElButton:M,FontAwesomeIcon:L,Consumption:me,MotionImage:hn,MotionVideo:wn,MotionPromptInput:En,CharacterOrientationSelector:Dn,MotionModeSelector:Nn,KeepOriginalSoundSelector:Jn},emits:["generate"],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return _e(this.motionConfig,this.service?.cost)},service(){return this.$store.state.kling?.service},canGenerate(){const e=this.motionConfig;return!!(e?.image_url&&e?.video_url)}},methods:{onGenerate(){this.$emit("generate")}}}),Yn={class:"flex flex-col h-full"},Xn={class:"flex-1 overflow-y-auto p-5"},Zn={class:"flex flex-col items-center justify-center px-5 pb-5"};function xn(e,t,s,l,u,$){const d=o("motion-image"),p=o("motion-video"),g=o("motion-prompt-input"),c=o("character-orientation-selector"),k=o("motion-mode-selector"),h=o("keep-original-sound-selector"),_=o("consumption"),E=o("font-awesome-icon"),R=o("el-button");return a(),m("div",Yn,[i("div",Xn,[n(d,{class:"mb-3"}),n(p,{class:"mb-3"}),n(g,{class:"mb-4"}),n(c,{class:"mb-4"}),n(k,{class:"mb-4"}),n(h,{class:"mb-4"})]),i("div",Zn,[n(_,{value:e.consumption,service:e.service},null,8,["value","service"]),n(R,{type:"primary",class:"btn w-full",round:"",disabled:!e.canGenerate,onClick:e.onGenerate},{default:f(()=>[n(E,{icon:"fa-solid fa-magic",class:"mr-2"}),C(" "+r(e.$t("kling.button.generateMotion")),1)]),_:1},8,["disabled","onClick"])])])}const es=w(Qn,[["render",xn]]),ts=y({name:"KlingTabSwitcher",components:{ElTabs:je,ElTabPane:Oe,ElTag:Se},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")}]}},methods:{onUpdate(e){this.$emit("update:modelValue",e)}}}),os=["title"],ns={class:"text"};function ss(e,t,s,l,u,$){const d=o("el-tag"),p=o("el-tab-pane"),g=o("el-tabs");return a(),S(g,{"model-value":e.modelValue,class:"kling-tabs",stretch:"","onUpdate:modelValue":e.onUpdate},{default:f(()=>[(a(!0),m(V,null,T(e.tabs,c=>(a(),S(p,{key:c.value,name:c.value,disabled:c.disabled},{label:f(()=>[i("span",{class:"tab-label",title:c.disabled?c.disabledReason:void 0},[i("span",ns,r(c.label),1),c.badge?(a(),S(d,{key:0,size:"small",type:"warning",class:"badge"},{default:f(()=>[C(r(c.badge),1)]),_:2},1024)):v("",!0)],8,os)]),_:2},1032,["name","disabled"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])}const is=w(ts,[["render",ss],["__scopeId","data-v-bf00c27e"]]),as=y({name:"TaskPreview",components:{ElImage:qe,CopyToClipboard:Ne,FontAwesomeIcon:L,ElAlert:Fe,VideoPlayer:Be,ElTooltip:Q,ElButton:M,ImagePreview:j,ApiCodeButton:ze},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},referenceImages(){const e=[],t=this.modelValue?.request?.start_image_url,s=this.modelValue?.request?.end_image_url;return t&&e.push({url:t,name:"start-image"}),s&&e.push({url:s,name:"end-image"}),e}},methods:{onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onOpenVideo(e){window.open(e,"_blank")}}}),ls={class:"preview"},rs={class:"left"},cs={class:"main"},ds={class:"bot"},us={class:"datetime"},ms={class:"info"},ps={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},gs={key:1,class:"prompt mt-2"},fs={key:0},hs={key:1},_s={key:0,class:U({content:!0,failed:!0})},$s={key:0,class:"mb-4"},ks={key:1,class:U({operations:!0,"mt-2":!0})},vs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},bs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ys={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},ws={key:1,class:U({content:!0})},Cs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ss={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Vs={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Is={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Ts={key:2,class:U({content:!0})},Es={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ls={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Ms(e,t,s,l,u,$){const d=o("el-image"),p=o("image-preview"),g=o("video-player"),c=o("el-button"),k=o("el-tooltip"),h=o("api-code-button"),_=o("font-awesome-icon"),E=o("copy-to-clipboard"),R=o("el-alert");return a(),m("div",ls,[i("div",rs,[n(d,{src:"https://cdn.acedata.cloud/qpbbbb.jpg",class:"avatar"})]),i("div",cs,[i("div",ds,[C(r(e.$t("kling.name.klingBot"))+" ",1),i("span",us,r(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),i("div",ms,[e.referenceImages.length>0?(a(),m("div",ps,[(a(!0),m(V,null,T(e.referenceImages,(A,B)=>(a(),S(p,{key:B,url:A.url,name:A.name,closable:!1},null,8,["url","name"]))),128))])):v("",!0),e.modelValue?.request?.prompt?(a(),m("p",gs,[C(r(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?v("",!0):(a(),m("span",fs," - ("+r(e.$t("kling.status.pending"))+") ",1)),e.modelValue?.response?.state==="submitted"||e.modelValue?.response?.state==="processing"||e.modelValue?.response?.state==="pending"||e.modelValue?.response?.state==="completed"?(a(),m("span",hs," - ("+r(e.$t("kling.status.processing"))+") ",1)):v("",!0)])):v("",!0)]),e.modelValue?.response?.success===!0?(a(),m("div",_s,[e.modelValue?.response.video_url?(a(),m("div",$s,[n(g,{src:e.modelValue?.response.video_url},null,8,["src"])])):v("",!0),e.modelValue?.response.success?(a(),m("div",ks,[n(k,{class:"box-item",effect:"dark",content:e.$t("kling.message.downloadVideo"),placement:"top-start"},{default:f(()=>[e.modelValue?.response.video_url?(a(),S(c,{key:0,type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=A=>e.onDownload(A,e.modelValue?.response.video_url))},{default:f(()=>[C(r(e.$t("kling.button.download")),1)]),_:1})):v("",!0)]),_:1},8,["content"]),n(h,{path:"/kling/videos",body:e.modelValue?.request},null,8,["body"])])):v("",!0),n(R,{closable:!1,class:"mt-2 success"},{default:f(()=>[i("p",vs,[n(_,{icon:"fa-solid fa-hashtag",class:"mr-1"}),C(" "+r(e.$t("kling.name.model"))+": "+r(e.modelValue?.request?.model),1)]),i("p",bs,[n(_,{icon:"fa-solid fa-magic",class:"mr-1"}),C(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(E,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(a(),m("p",ys,[n(_,{icon:"fa-solid fa-clock",class:"mr-1"}),C(" "+r(e.$t("kling.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):v("",!0)]),_:1})])):v("",!0),e.modelValue?.response?.success===!1?(a(),m("div",ws,[n(R,{closable:!1,class:"failure"},{template:f(()=>[n(_,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),C(" "+r(e.$t("kling.name.failure")),1)]),default:f(()=>[i("p",Cs,[n(_,{icon:"fa-solid fa-magic",class:"mr-1"}),C(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(E,{content:e.modelValue?.id},null,8,["content"])]),i("p",Ss,[n(_,{icon:"fa-solid fa-circle-info",class:"mr-1"}),C(" "+r(e.$t("kling.name.failureReason"))+": "+r(e.modelValue?.response?.error?.message)+" ",1),n(E,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(a(),m("p",Vs,[n(_,{icon:"fa-solid fa-clock",class:"mr-1"}),C(" "+r(e.$t("kling.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):v("",!0),e.modelValue?.response?.trace_id?(a(),m("p",Is,[n(_,{icon:"fa-solid fa-hashtag",class:"mr-1"}),C(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(E,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):v("",!0)]),_:1})])):v("",!0),e.modelValue?.response?.success===void 0?(a(),m("div",Ts,[n(R,{closable:!1,class:"info"},{template:f(()=>[n(_,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),C(" "+r(e.$t("kling.name.failure")),1)]),default:f(()=>[i("p",Es,[n(_,{icon:"fa-solid fa-magic",class:"mr-1"}),C(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(E,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.response?.trace_id?(a(),m("p",Ls,[n(_,{icon:"fa-solid fa-hashtag",class:"mr-1"}),C(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(E,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):v("",!0)]),_:1})])):v("",!0)])])}const Us=w(as,[["render",Ms],["__scopeId","data-v-422e2570"]]),Rs=y({name:"RecentPanel",components:{TaskPreview:Us,NoTasks:De,BotPlaceholder:He,ScrollList:Me},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?.()}}}),As={key:0},Ds={key:2,class:"w-full h-full flex items-center justify-center"};function Ps(e,t,s,l,u,$){const d=o("bot-placeholder"),p=o("task-preview"),g=o("scroll-list"),c=o("no-tasks");return a(),m(V,null,[e.tasks?.items===void 0?(a(),m("div",As,[n(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(a(),S(g,{key:1,ref:"scrollList",class:"h-full w-full overflow-y-auto tasks",loading:e.loading,onReachTop:t[0]||(t[0]=k=>e.$emit("reach-top"))},{default:f(()=>[(a(!0),m(V,null,T(e.tasks?.items,k=>(a(),S(p,{key:k.id,"model-value":k},null,8,["model-value"]))),128))]),_:1},8,["loading"])):v("",!0),e.tasks?.items?.length===0?(a(),m("div",Ds,[n(c)])):v("",!0)],64)}const Gs=w(Rs,[["render",Ps]]),de=Ve("kling"),Ks=y({name:"KlingIndex",components:{ConfigPanel:cn,MotionPanel:es,TabSwitcher:is,Layout:Ze,RecentPanel:Gs},mixins:[Re],inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===se.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===se.Request||this.fetchingTasks},credential(){return this.$store.state.kling.credential},config(){return this.$store.state.kling.config},motionConfig(){return this.$store.state.kling.motionConfig},taskType(){return this.$store.state.kling.taskType||"videos"},tasks(){return this.$store.state.kling.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await Ue({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();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:s,createdAtMax:l}=e||{};console.debug("limit",t,"createdAtMin",s,"createdAtMax",l),this.fetchingTasks=!0;try{await this.$store.dispatch("kling/getTasks",{limit:t,createdAtMin:s,createdAtMax:l})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!ae(this.uploadTracker,u=>this.$t(u),u=>b.warning(u)))return;const{camera_control:e,...t}=this.config||{},s={...t,callback_url:de};if(!s.video_id&&!t.video_url&&!s.start_image_url&&s.end_image_url){b.warning(this.$t("kling.message.endImageRequiresStart"));return}s.action||(s.video_id||t.video_url?s.action="extend":s.start_image_url?s.action="image2video":s.action="text2video"),s.action==="text2video"&&s.end_image_url&&delete s.end_image_url,e?.type&&(s.camera_control={type:e.type,...e.type==="simple"&&e.config?{config:Object.fromEntries(Object.entries(e.config).filter(([,u])=>u!=null))}:{}});const l=this.credential?.token;if(!l){console.error("no token specified");return}b.info(this.$t("kling.message.startingTask")),oe("kling",ne.generate(s,{token:l})).then(()=>{b.success(this.$t("kling.message.startTaskSuccess"))}).catch(u=>{u?.response?.data?.error?.code===le?b.error(this.$t("kling.message.usedUp")):b.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},async onTabChange(e){e!==this.taskType&&(await this.$store.dispatch("kling/setTaskType",e),await this.onGetTasks(),await this.onScrollDown())},async onGenerateMotion(){if(!ae(this.uploadTracker,l=>this.$t(l),l=>b.warning(l)))return;const e=this.motionConfig||{};if(!e.image_url||!e.video_url){b.warning(this.$t("kling.message.motionMissingInputs"));return}const 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.prompt?{prompt:e.prompt}:{},callback_url:de},s=this.credential?.token;if(!s){console.error("no token specified");return}b.info(this.$t("kling.message.startingTask")),oe("kling",ne.motion(t,{token:s})).then(()=>{b.success(this.$t("kling.message.startTaskSuccess"))}).catch(l=>{l?.response?.data?.error?.code===le?b.error(this.$t("kling.message.usedUp")):b.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),Os={class:"flex flex-col h-full"},js={class:"flex-1 min-h-0"};function Ns(e,t,s,l,u,$){const d=o("tab-switcher"),p=o("config-panel"),g=o("motion-panel"),c=o("recent-panel"),k=o("layout");return a(),S(k,null,{config:f(()=>[i("div",Os,[n(d,{"model-value":e.taskType,"onUpdate:modelValue":e.onTabChange},null,8,["model-value","onUpdate:modelValue"]),i("div",js,[e.taskType==="videos"?(a(),S(p,{key:0,onGenerate:e.onGenerate},null,8,["onGenerate"])):e.taskType==="motion"?(a(),S(g,{key:1,onGenerate:e.onGenerateMotion},null,8,["onGenerate"])):v("",!0)])])]),result:f(()=>[n(c,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Wi=w(Ks,[["render",Ns]]);export{Wi as default};
1
+ import{F as L}from"./index.es-CLQR2iBw.js";import{E as M}from"./index-DpLV-Pq9.js";import{E as ue}from"./index-DJjyFLlw.js";import{d as y,H as m,E as i,z,C as n,y as f,D as o,q as a,F as r,x as S,O as V,N as T,Q as U,J as v,R as ye,I as C,M as we}from"./vendor-vue-NSDaktjZ.js";import{H as w,bp as K,ah as Ce,I as Se,cs as oe,aI as ne,S as se,ct as Ve}from"./index-CVH6GWSn.js";import{a as Ie,b as ie,c as H,d as D,e as Te,f as Ee,g as Le}from"./kling-DwJwIwVI.js";import{E as P,a as G}from"./index-Du5AFIP4.js";import{E as W}from"./index-XXhfzQt9.js";import{E as b}from"./index-CisFWmyE.js";import{I,S as Me,l as Ue}from"./pagination-DiGyJEay.js";import{p as J}from"./pasteUploadMixin-BurWbGNQ.js";import{u as O,a as Re,e as ae}from"./uploadTrackerMixin--N-yU8Tl.js";import{I as j}from"./ImagePreview-DeNxw7C3.js";import{E as Q}from"./index-ByCbBTje.js";import{E as N}from"./index-BOikF7Vg.js";import{C as me}from"./Consumption-BoW8Yj1Z.js";import{E as pe}from"./index-BVMK7LIJ.js";import{E as ge}from"./index-BILgzrZ9.js";import{E as fe}from"./index-B3XMfsr2.js";import{P as Ae,N as De}from"./NoTasks-CBf4UVlo.js";import{E as he}from"./index-EBzcwoVz.js";import{a as _e}from"./price-B1xKQHsz.js";import{F as Pe}from"./FilePreview-DFWVNwz_.js";import{E as Ge,a as Ke}from"./index-DMefWGOk.js";import{E as Oe,a as je}from"./index-rn5VBDzX.js";import{b as le}from"./errorCode-Cqj9Td_Z.js";import{C as Ne}from"./CopyToClipboard-Ih2qsYgN.js";import{V as Be}from"./VideoPlayer-2W03rLFF.js";import{A as ze}from"./ApiCodeButton-CsgRae2o.js";import{E as Fe}from"./index-BizFhdaE.js";import{E as qe}from"./index-br52C4yM.js";import{B as He}from"./BotPlaceholder-B-UqCz8R.js";import"./use-form-item-BV_L9kB7.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Df5ITouH.js";import"./index-BiSfH4hc.js";import"./typescript-BXdqla6u.js";import"./index-Dw6ZevFg.js";import"./strings-beZM2Y-f.js";import"./isEqual-CWBDsFs3.js";import"./_Uint8Array-Cj-LmGzx.js";import"./castArray-9ufFSW5u.js";import"./debounce-zyhh1kFW.js";import"./_baseIteratee-BcXwWZMY.js";import"./index-Dbz6Whu6.js";import"./validator-C6fRYUzr.js";import"./highlight-CYeIx3eC.js";import"./index-BLjywj98.js";import"./vendor-highlight-lEWW1Jxd.js";import"./index-BsWkCEVF.js";import"./_baseClone-CD4xkhO5.js";import"./_initCloneObject-CIlwXpy7.js";import"./index-Cu41y2Fl.js";import"./index-CLOxJQ_9.js";import"./isPlainObject-Bsj5BOyI.js";import"./vue-plyr-BO2nlN4c.js";import"./index-DAZIhRrh.js";const We=y({name:"LayoutKling",components:{ElDrawer:ue,ElButton:M,FontAwesomeIcon:L},data(){return{drawer:!1}}}),Je={class:"main flex flex-row flex-1 min-h-0"},Qe={class:"config w-[320px] flex-none h-full flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},Ye={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function Xe(e,t,s,l,u,$){const d=o("font-awesome-icon"),p=o("el-button"),g=o("el-drawer");return a(),m("div",Je,[i("div",Qe,[z(e.$slots,"config",{},void 0,!0)]),i("div",Ye,[z(e.$slots,"result",{},void 0,!0)]),n(p,{circle:"",class:"menu",onClick:t[0]||(t[0]=c=>e.drawer=!0)},{default:f(()=>[n(d,{icon:"fa-solid fa-magic"})]),_:1}),n(g,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=c=>e.drawer=c),direction:"ltr","with-header":!1,size:"350px"},{default:f(()=>[z(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Ze=w(We,[["render",Xe],["__scopeId","data-v-be4bb0df"]]),xe={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function Y(e,t,s){const l=t||"std",u=s??5;switch(e){case"kling-v1":return{text2video:!0,image2video:!0,endImage:u===5,audio:!1,motionControl:u===5};case"kling-v1-6":case"kling-v2-5-turbo":return{text2video:!0,image2video:!0,endImage:l==="pro",audio:!1,motionControl:!1};case"kling-v2-6":return{text2video:!0,image2video:!0,endImage:l==="pro",audio:l==="pro",motionControl:!1};case"kling-v2-master":case"kling-v2-1-master":return{text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};case"kling-v3":return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:l!=="4k"};case"kling-v3-omni":return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:!1};case"kling-video-o1":return{text2video:!0,image2video:!0,endImage:!0,audio:!1,motionControl:!1};default:return xe}}function X(e,t){if(!e)return[];const s=t.model??e.model,l=t.mode??e.mode,u=t.duration??e.duration;if(!s)return[];const $=Y(s,l,u),d=[];return e.end_image_url&&!$.endImage&&d.push({field:"end_image_url",i18nLabel:"kling.name.endImage"}),e.generate_audio&&!$.audio&&d.push({field:"generate_audio",i18nLabel:"kling.name.generateAudio"}),e.camera_control?.type&&(!$.motionControl||e.start_image_url)&&d.push({field:"camera_control",i18nLabel:"kling.name.cameraControl"}),d}function Z(e,t){const s={...e};for(const l of t)l.field==="end_image_url"&&(s.end_image_url=void 0),l.field==="generate_audio"&&(s.generate_audio=!1),l.field==="camera_control"&&(s.camera_control=void 0);return s}const et=y({name:"ModelSelector",components:{ElSelect:G,ElOption:P},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{revertKey:0,options:[{value:"kling-v3",label:"v3"},{value:"kling-v3-omni",label:"v3-Omni"},{value:"kling-v2-6",label:"v2.6"},{value:"kling-v2-5-turbo",label:"v2.5-Turbo"},{value:"kling-v2-1-master",label:"v2.1-Master"},{value:"kling-v2-master",label:"v2-Master"},{value:"kling-v1-6",label:"v1.6"},{value:"kling-v1",label:"v1"},{value:"kling-video-o1",label:"Video-o1"}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(Ie)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=X(t,{model:e});if(s.length===0){this.applyModel(e);return}const l=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await W.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:l}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=Z({...t,model:e},s);this.$store.commit("kling/setConfig",u),b.success(this.$t("kling.message.featureRemovedNotice",{fields:l}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,model:e})}}}),tt={class:"field"},ot={class:"title font-bold"};function nt(e,t,s,l,u,$){const d=o("el-option"),p=o("el-select");return a(),m("div",tt,[i("h2",ot,r(e.$t("pika.name.model")),1),(a(),S(p,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("pika.placeholder.select"),onChange:e.onChange},{default:f(()=>[(a(!0),m(V,null,T(e.options,g=>(a(),S(d,{key:g.value,label:g.label,value:g.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const st=w(et,[["render",nt],["__scopeId","data-v-04059875"]]),it=y({name:"ModeSelector",components:{ElSelect:G,ElOption:P,InfoIcon:I},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 H.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(ie)}},mounted(){this.value||this.applyMode(ie)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=X(t,{mode:e});if(s.length===0){this.applyMode(e);return}const l=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await W.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:l}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=Z({...t,mode:e},s);this.$store.commit("kling/setConfig",u),b.success(this.$t("kling.message.featureRemovedNotice",{fields:l}))}catch{this.revertKey+=1}},applyMode(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,mode:e})}}}),at={class:"field"},lt={class:"header"},rt={class:"title font-bold"},ct={key:0,class:"opt-tip"};function dt(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-option"),g=o("el-select");return a(),m("div",at,[i("div",lt,[i("h2",rt,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.mode"),class:"info-icon"},null,8,["content"])]),(a(),S(g,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("kling.placeholder.select"),clearable:!0,onChange:e.onChange},{default:f(()=>[(a(!0),m(V,null,T(e.options,c=>(a(),S(p,{key:c.value,label:c.label,value:c.value,disabled:c.disabled},{default:f(()=>[i("span",{class:U({"opt-disabled":c.disabled})},r(c.label),3),c.disabled&&c.disabledReason?(a(),m("span",ct,r(c.disabledReason),1)):v("",!0)]),_:2},1032,["label","value","disabled"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const ut=w(it,[["render",dt],["__scopeId","data-v-9a8fa3c5"]]),mt=[3,5,8,10,12,15],pt=[5,10],gt=y({name:"DurationSelector",components:{ElSelect:G,ElOption:P,InfoIcon:I},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},isV3Model(){return H.includes(this.selectedModel)},allowedDurations(){return this.isV3Model?mt:pt},value(){return this.$store.state.kling?.config?.duration??D},selectValue(){const e=this.allowedDurations;return e.includes(this.value)?this.value:e.includes(D)?D:e[0]}},watch:{isV3Model(){this.allowedDurations.includes(this.value)||this.applyDuration(D)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(D)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=X(t,{duration:e});if(s.length===0){this.applyDuration(e);return}const l=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await W.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:l}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=Z({...t,duration:e},s);this.$store.commit("kling/setConfig",u),b.success(this.$t("kling.message.featureRemovedNotice",{fields:l}))}catch{this.revertKey+=1}},applyDuration(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,duration:e})}}}),ft={class:"field"},ht={class:"control"},_t={class:"label"},$t={class:"title font-bold"};function kt(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-option"),g=o("el-select");return a(),m("div",ft,[i("div",ht,[i("div",_t,[i("h2",$t,r(e.$t("kling.name.duration")),1),n(d,{content:e.$t("kling.description.duration"),class:"info-icon ml-1"},null,8,["content"])]),(a(),S(g,{key:e.revertKey,"model-value":e.selectValue,class:"value",placeholder:e.$t("kling.placeholder.select"),onChange:e.onChange},{default:f(()=>[(a(!0),m(V,null,T(e.allowedDurations,c=>(a(),S(p,{key:c,label:`${c}s`,value:c},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])])}const vt=w(gt,[["render",kt],["__scopeId","data-v-5ae55e28"]]),bt=y({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||(this.value=Te)}}),yt={class:"text-sm font-bold mb-2 block"},wt={class:"items"},Ct=["onClick"],St={class:"name"};function Vt(e,t,s,l,u,$){return a(),m("div",null,[i("span",yt,r(e.$t("kling.name.ratio")),1),i("div",wt,[(a(!0),m(V,null,T(e.options,(d,p)=>(a(),m("div",{key:p,class:U({active:e.active===p,item:!0}),onClick:g=>e.value=d.value},[i("div",{class:U(["preview",d.label])},[i("div",{class:"rect",style:ye({width:d.width+"px",height:d.height+"px"})},null,4)],2),i("p",St,r(d.label),1)],10,Ct))),128))])])}const It=w(bt,[["render",Vt],["__scopeId","data-v-cdb14b2f"]]),Tt=y({name:"StartImage",components:{ElUpload:N,ElButton:M,ElTooltip:Q,InfoIcon:I,FontAwesomeIcon:L,ImagePreview:j},mixins:[J,O],emits:["change"],data(){return{fileList:[],uploadUrl:K()+"/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(){}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){b.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){b.error(this.$t("kling.message.uploadReferencesError"))},onSetStartImageUrl(){const e=this.urls?.[0];this.$store.commit("kling/setConfig",{...this.$store.state?.kling?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),Et={class:"relative"},Lt={class:"flex justify-between"},Mt={class:"flex justify-start items-center"},Ut={class:"text-sm font-bold"};function Rt(e,t,s,l,u,$){const d=o("info-icon"),p=o("image-preview"),g=o("font-awesome-icon"),c=o("el-button"),k=o("el-tooltip"),h=o("el-upload");return a(),m("div",Et,[i("div",Lt,[i("div",Mt,[i("span",Ut,r(e.$t("kling.name.startImage")),1),n(d,{content:e.$t("kling.description.uploadStartImage")},null,8,["content"])])]),n(h,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,disabled:e.reachedLimit,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:f(({file:_})=>[_.url&&_.percentage!==void 0?(a(),S(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:E=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:f(()=>[n(k,{content:e.$t("kling.message.uploadReferencesExceed"),disabled:!e.reachedLimit,placement:"top"},{default:f(()=>[i("span",null,[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.reachedLimit},{default:f(()=>[n(g,{icon:"fa-solid fa-upload",class:"icon mr-1"}),C(" "+r(e.$t("kling.button.uploadReferences")),1)]),_:1},8,["disabled"])])]),_:1},8,["content","disabled"])]),_:1},8,["file-list","disabled","action","on-exceed","on-error","on-success","headers"])])}const At=w(Tt,[["render",Rt],["__scopeId","data-v-756dc269"]]),Dt=y({name:"EndImage",components:{ElUpload:N,ElButton:M,ElTooltip:Q,ImagePreview:j,InfoIcon:I,FontAwesomeIcon:L},mixins:[J,O],data(){return{fileList:[],uploadUrl:K()+"/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 Y(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||(this.value=void 0),this.onSetEndImageUrl()},methods:{onBeforeUpload(){return this.endImageSupported?this.hasStartImage?!0:(b.warning(this.$t("kling.message.endImageRequiresStart")),!1):(b.warning(this.$t("kling.message.endImageNotSupported")),!1)},onExceed(){b.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){b.error(this.$t("kling.message.uploadReferencesError"))},onSetEndImageUrl(){const e=this.urls?.[0];this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),Pt={class:"relative"},Gt={class:"flex justify-between"},Kt={class:"flex justify-start items-center"},Ot={class:"text-sm font-bold"};function jt(e,t,s,l,u,$){const d=o("info-icon"),p=o("image-preview"),g=o("font-awesome-icon"),c=o("el-button"),k=o("el-tooltip"),h=o("el-upload");return a(),m("div",Pt,[i("div",Gt,[i("div",Kt,[i("span",Ot,r(e.$t("kling.name.endImage")),1),n(d,{content:e.$t("kling.description.uploadEndImage")},null,8,["content"])])]),n(h,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,disabled:e.uploadDisabled,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","before-upload":e.onBeforeUpload,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:f(({file:_})=>[_.url&&_.percentage!==void 0?(a(),S(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:E=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:f(()=>[n(k,{content:e.uploadTooltip,disabled:!e.uploadDisabled,placement:"top"},{default:f(()=>[i("span",null,[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.uploadDisabled},{default:f(()=>[n(g,{icon:"fa-solid fa-upload",class:"icon mr-1"}),C(" "+r(e.$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"])])}const Nt=w(Dt,[["render",jt],["__scopeId","data-v-c1b257e5"]]),Bt=y({name:"CfgScaleSelector",components:{ElSlider:ge,InfoIcon:I,ElInputNumber:pe},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||(this.value=Ee)}}),zt={class:"flex justify-between"},Ft={class:"flex justify-start items-center"},qt={class:"text-sm font-bold"},Ht={class:"flex justify-end items-center"},Wt={class:"w-full"};function Jt(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-input-number"),g=o("el-slider");return a(),m("div",null,[i("div",zt,[i("div",Ft,[i("span",qt,r(e.$t("kling.name.cfgScale")),1),n(d,{content:e.$t("kling.description.cfgScale")},null,8,["content"])]),i("div",Ht,[n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),"controls-position":"right"},null,8,["modelValue"])])]),i("div",Wt,[n(g,{modelValue:e.value,"onUpdate:modelValue":t[1]||(t[1]=c=>e.value=c),min:0,max:1,step:.1},null,8,["modelValue"])])])}const Qt=w(Bt,[["render",Jt]]),Yt=y({name:"GenerateAudioSelector",components:{ElSwitch:fe,InfoIcon:I},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},selectedMode(){return this.$store.state.kling?.config?.mode||""},supported(){return!!(H.includes(this.selectedModel)||this.selectedModel==="kling-v2-6"&&this.selectedMode==="pro")},tooltipContent(){return this.supported?this.$t("kling.description.generateAudio"):this.$t("kling.description.generateAudioUnsupported")},value:{get(){return this.supported?this.$store.state.kling?.config?.generate_audio??Le:!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})}}}),Xt={class:"relative"},Zt={class:"flex justify-between items-center"},xt={class:"flex justify-start items-center"},eo={class:"text-sm font-bold"};function to(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-switch");return a(),m("div",Xt,[i("div",Zt,[i("div",xt,[i("span",eo,r(e.$t("kling.name.generateAudio")),1),n(d,{content:e.tooltipContent},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=g=>e.value=g),class:"value",disabled:!e.supported},null,8,["modelValue","disabled"])])])}const oo=w(Yt,[["render",to]]),no=["horizontal","vertical","pan","tilt","roll","zoom"],so=y({name:"CameraControlSelector",components:{ElSelect:G,ElOption:P,ElSlider:ge,ElInputNumber:pe,InfoIcon:I},data(){return{configKeys:no}},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 Y(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){const t=this.$store.state.kling?.config||{};if(!e){const l={...t};delete l.camera_control,this.$store.commit("kling/setConfig",l);return}const s=e;this.$store.commit("kling/setConfig",{...t,camera_control:{type:s,config:s==="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){const s=this.$store.state.kling?.config||{},l=s.camera_control||{type:"simple"},u={...l.config||{}};t==null?delete u[e]:u[e]=t,this.$store.commit("kling/setConfig",{...s,camera_control:{...l,type:"simple",config:u}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),io={class:"field"},ao={class:"header"},lo={class:"text-sm font-bold"},ro={key:0,class:"config-grid"},co={class:"cfg-row-head"},uo={class:"cfg-name"};function mo(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-option"),g=o("el-select"),c=o("el-input-number"),k=o("el-slider");return a(),m("div",io,[i("div",ao,[i("span",lo,r(e.$t("kling.name.cameraControl")),1),n(d,{content:e.tooltipContent},null,8,["content"])]),n(g,{modelValue:e.selectedTypeRaw,"onUpdate:modelValue":t[0]||(t[0]=h=>e.selectedTypeRaw=h),class:"value",placeholder:e.$t("kling.placeholder.cameraType"),clearable:!0,disabled:e.disabled},{default:f(()=>[(a(!0),m(V,null,T(e.typeOptions,h=>(a(),S(p,{key:h.value,label:h.label,value:h.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","disabled"]),e.selectedType==="simple"&&!e.disabled?(a(),m("div",ro,[(a(!0),m(V,null,T(e.configKeys,h=>(a(),m("div",{key:h,class:"cfg-row"},[i("div",co,[i("span",uo,r(e.$t(`kling.name.cc_${h}`)),1),n(c,{modelValue:e.configValues[h],"onUpdate:modelValue":_=>e.configValues[h]=_,min:-1,max:1,step:.1,precision:1,"controls-position":"right",size:"small",class:"cfg-num",onChange:_=>e.onNumberChange(h,_)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),n(k,{"model-value":e.configValues[h]??0,min:-1,max:1,step:.1,onInput:_=>e.onSliderChange(h,_)},null,8,["model-value","onInput"])]))),128))])):v("",!0)])}const po=w(so,[["render",mo],["__scopeId","data-v-cd896060"]]),$e=[{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"]}],F=", ";function go(e,t){const s=(e||"").trim();return s?s.includes(t)?s:`${s}${F}${t}`:t}function q(e,t){if(!e||!t)return e||"";const s=[`${t}${F}`,`${F}${t}`,t];let l=e;for(const u of s)if(l.includes(u)){l=l.replace(u,"");break}return l.replace(/(?:,\s*)+$/,"").replace(/^(?:,\s*)+/,"")}const fo=y({name:"InspirationPills",components:{FontAwesomeIcon:L},computed:{prompt(){return this.$store.state.kling?.config?.prompt||""},allChipTexts(){return $e.flatMap(e=>e.chipKeys.map(t=>this.$t(`kling.inspiration.chip.${t}`)))},selected(){const e=this.prompt;if(!e)return[];const t=[];for(const s of this.allChipTexts){const l=e.indexOf(s);l!==-1&&t.push({text:s,idx:l})}return t.sort((s,l)=>s.idx-l.idx).map(s=>s.text)}},methods:{onRemove(e){const t=q(this.prompt,e);this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:t})}}}),ho={key:0,class:"pills",role:"list"},_o={class:"pill-text"},$o=["aria-label","onClick"];function ko(e,t,s,l,u,$){const d=o("font-awesome-icon");return e.selected.length>0?(a(),m("div",ho,[(a(!0),m(V,null,T(e.selected,p=>(a(),m("div",{key:p,class:"pill",role:"listitem"},[i("span",_o,r(p),1),i("button",{type:"button",class:"pill-remove","aria-label":e.$t("kling.inspiration.removeChip"),onClick:we(g=>e.onRemove(p),["stop"])},[n(d,{icon:"fa-solid fa-xmark"})],8,$o)]))),128))])):v("",!0)}const vo=w(fo,[["render",ko],["__scopeId","data-v-5fc4fa65"]]),bo="",yo=y({name:"PromptInput",components:{ElButton:M,FontAwesomeIcon:L,PromptTextarea:Ae,InspirationPills:vo},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||(this.prompt=bo)}});function wo(e,t,s,l,u,$){const d=o("font-awesome-icon"),p=o("el-button"),g=o("inspiration-pills"),c=o("prompt-textarea");return a(),S(c,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||(t[1]=k=>e.prompt=k),title:e.$t("kling.name.prompt"),info:e.$t("kling.description.prompt"),placeholder:e.$t("kling.placeholder.prompt")},{actions:f(()=>[n(p,{text:"",size:"small",class:"inspiration-btn",onClick:t[0]||(t[0]=k=>e.$emit("open-inspiration"))},{default:f(()=>[n(d,{icon:"fa-regular fa-lightbulb",class:"mr-1"}),C(" "+r(e.$t("kling.inspiration.openButton")),1)]),_:1})]),before:f(()=>[n(g)]),_:1},8,["modelValue","title","info","placeholder"])}const Co=w(yo,[["render",wo],["__scopeId","data-v-c01fc1a6"]]),So="",Vo=y({name:"NegativePromptInput",components:{ElInput:he,InfoIcon:I},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||(this.prompt=So)}}),Io={class:"field"},To={class:"box"},Eo={class:"title font-bold"};function Lo(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-input");return a(),m("div",Io,[i("div",To,[i("h2",Eo,r(e.$t("kling.name.negativePrompt")),1),n(d,{content:e.$t("kling.description.negativePrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=g=>e.prompt=g),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.negativePrompt")},null,8,["modelValue","placeholder"])])}const Mo=w(Vo,[["render",Lo],["__scopeId","data-v-de98cf01"]]),Uo=y({name:"InspirationDrawer",components:{ElDrawer:ue,ElButton:M,FontAwesomeIcon:L},props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],data(){return{groups:$e,Close:Ce}},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(t=>this.$t(`kling.inspiration.chip.${t}`)))},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(q(this.prompt,e)):this.setPrompt(go(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(const t of this.allChipTexts)for(;e.includes(t);)e=q(e,t);this.setPrompt(e)}}}),Ro={class:"drawer-content"},Ao={class:"drawer-header"},Do={class:"title-row"},Po={class:"title"},Go={class:"hint"},Ko={key:0,class:"selected-bar"},Oo={class:"selected-text"},jo={class:"groups"},No={class:"group-title"},Bo={class:"chip-grid"},zo=["onClick"];function Fo(e,t,s,l,u,$){const d=o("font-awesome-icon"),p=o("el-button"),g=o("el-drawer");return a(),S(g,{modelValue:e.visible,"onUpdate:modelValue":t[1]||(t[1]=c=>e.visible=c),direction:"rtl","with-header":!1,size:e.drawerSize,"custom-class":"kling-inspiration-drawer","destroy-on-close":!1},{default:f(()=>[i("div",Ro,[i("div",Ao,[i("div",Do,[n(d,{icon:"fa-regular fa-lightbulb",class:"mr-2"}),i("span",Po,r(e.$t("kling.inspiration.title")),1)]),n(p,{text:"",icon:e.Close,class:"close-btn",onClick:t[0]||(t[0]=c=>e.visible=!1)},null,8,["icon"])]),i("div",Go,r(e.$t("kling.inspiration.hint")),1),e.selectedCount>0?(a(),m("div",Ko,[i("span",Oo,r(e.$t("kling.inspiration.selectedSummary",{count:e.selectedCount})),1),n(p,{text:"",size:"small",class:"clear-btn",onClick:e.onClearSelected},{default:f(()=>[C(r(e.$t("kling.inspiration.clearSelected")),1)]),_:1},8,["onClick"])])):v("",!0),i("div",jo,[(a(!0),m(V,null,T(e.groups,c=>(a(),m("div",{key:c.groupKey,class:"group"},[i("div",No,r(e.$t(`kling.inspiration.group.${c.groupKey}`)),1),i("div",Bo,[(a(!0),m(V,null,T(c.chipKeys,k=>(a(),m("button",{key:k,type:"button",class:U({chip:!0,active:e.isSelected(e.chipText(k))}),onClick:h=>e.onToggle(e.chipText(k))},r(e.chipText(k)),11,zo))),128))])]))),128))])])]),_:1},8,["modelValue","size"])}const qo=w(Uo,[["render",Fo],["__scopeId","data-v-7d457a69"]]),Ho={"kling-v3":"v3","kling-v3-omni":"v3-Omni","kling-v2-6":"v2.6","kling-v2-5-turbo":"v2.5-Turbo","kling-v2-1-master":"v2.1-Master","kling-v2-master":"v2-Master","kling-v1-6":"v1.6","kling-v1":"v1","kling-video-o1":"Video-o1"},Wo={std:"720p",pro:"1080p","4k":"4K"},Jo=y({name:"SummaryChip",components:{FontAwesomeIcon:L},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){const e=this.config?.model||"kling-v2-5-turbo";return Ho[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||""},modeLabel(){const e=this.config?.mode||"std";return Wo[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),Qo={class:"summary-chip"},Yo=["title"],Xo=["title"],Zo=["title"],xo=["title"],en=["title"];function tn(e,t,s,l,u,$){const d=o("font-awesome-icon");return a(),m("div",Qo,[i("span",{class:"part",title:e.$t("kling.name.model")},r(e.modelLabel),9,Yo),t[0]||(t[0]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.duration")},r(e.durationLabel),9,Xo),t[1]||(t[1]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.ratio")},r(e.aspectRatio||"16:9"),9,Zo),t[2]||(t[2]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.mode")},r(e.modeLabel),9,xo),e.generateAudio?(a(),m("span",{key:0,class:"audio",title:e.$t("kling.name.generateAudio")},[n(d,{icon:"fa-solid fa-headphones"})],8,en)):v("",!0)])}const on=w(Jo,[["render",tn],["__scopeId","data-v-418a6733"]]),nn=y({name:"ConfigPanel",components:{ElButton:M,Consumption:me,FontAwesomeIcon:L,PromptInput:Co,NegativePromptInput:Mo,ModelSelector:st,ModeSelector:ut,DurationSelector:vt,RatioSelector:It,StartImage:At,CfgScaleSelector:Qt,GenerateAudioSelector:oo,CameraControlSelector:po,InspirationDrawer:qo,SummaryChip:on,EndImage:Nt},emits:["generate"],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},consumption(){return _e(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit("generate")}}}),sn={class:"flex flex-col h-full"},an={class:"flex-1 overflow-y-auto p-5"},ln={class:"flex flex-col items-center justify-center px-5 pb-5"};function rn(e,t,s,l,u,$){const d=o("prompt-input"),p=o("model-selector"),g=o("ratio-selector"),c=o("start-image"),k=o("end-image"),h=o("duration-selector"),_=o("mode-selector"),E=o("generate-audio-selector"),R=o("camera-control-selector"),A=o("cfg-scale-selector"),B=o("negative-prompt-input"),ke=o("summary-chip"),ve=o("consumption"),x=o("font-awesome-icon"),ee=o("el-button"),be=o("inspiration-drawer");return a(),m("div",sn,[i("div",an,[n(d,{class:"mb-4",onOpenInspiration:t[0]||(t[0]=te=>e.inspirationOpen=!0)}),n(p,{class:"mb-4"}),n(g,{class:"mb-4"}),n(c,{class:"mb-2"}),n(k,{class:"mb-2"}),n(h,{class:"mb-4"}),n(_,{class:"mb-4"}),n(E,{class:"mb-4"}),n(R,{class:"mb-4"}),n(A,{class:"mb-4"}),n(B,{class:"mb-4"})]),i("div",ln,[n(ke),n(ve,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(a(),S(ee,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:f(()=>[n(x,{icon:"fa-solid fa-magic",class:"mr-2"}),C(" "+r(e.$t("kling.button.extend")),1)]),_:1},8,["onClick"])):(a(),S(ee,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:f(()=>[n(x,{icon:"fa-solid fa-magic",class:"mr-2"}),C(" "+r(e.$t("kling.button.generate")),1)]),_:1},8,["onClick"]))]),n(be,{modelValue:e.inspirationOpen,"onUpdate:modelValue":t[1]||(t[1]=te=>e.inspirationOpen=te)},null,8,["modelValue"])])}const cn=w(nn,[["render",rn]]),dn=y({name:"MotionImage",components:{ElUpload:N,ElButton:M,InfoIcon:I,FontAwesomeIcon:L,ImagePreview:j},mixins:[J,O],data(){return{fileList:[],uploadUrl:K()+"/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(){b.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){b.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(){const e=this.urls?.[0];this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,image_url:e})},async onSuccess(){this.onSetImageUrl()}}}),un={class:"relative"},mn={class:"flex justify-between"},pn={class:"flex justify-start items-center"},gn={class:"text-sm font-bold"};function fn(e,t,s,l,u,$){const d=o("info-icon"),p=o("image-preview"),g=o("font-awesome-icon"),c=o("el-button"),k=o("el-upload");return a(),m("div",un,[i("div",mn,[i("div",pn,[i("span",gn,r(e.$t("kling.name.motionImage")),1),n(d,{content:e.$t("kling.description.motionImage")},null,8,["content"])])]),n(k,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=h=>e.fileList=h),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:f(({file:h})=>[h.url&&h.percentage!==void 0?(a(),S(p,{key:0,url:h.url,name:h.name,percentage:h.percentage,onRemove:_=>e.onRemove(h)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:f(()=>[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:f(()=>[n(g,{icon:"fa-solid fa-upload",class:"icon mr-1"}),C(" "+r(e.$t("kling.button.uploadReferences")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const hn=w(dn,[["render",fn],["__scopeId","data-v-e52eaf2f"]]),_n=y({name:"MotionVideo",components:{ElUpload:N,ElButton:M,InfoIcon:I,FilePreview:Pe,FontAwesomeIcon:L},mixins:[O],data(){return{fileList:[],uploadUrl:K()+"/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(){b.warning(this.$t("kling.message.uploadVideoExceed"))},onError(){b.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){const t=e.type==="video/mp4"||e.type==="video/quicktime",s=e.size/1024/1024<100;return t?s?!0:(b.error(this.$t("kling.message.uploadVideoSizeExceed")),!1):(b.error(this.$t("kling.message.uploadVideoTypeFailed")),!1)},onSetVideoUrl(){const e=this.urls?.[0];this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,video_url:e})},async onSuccess(){this.onSetVideoUrl()}}}),$n={class:"relative"},kn={class:"flex justify-between"},vn={class:"flex justify-start items-center"},bn={class:"text-sm font-bold"};function yn(e,t,s,l,u,$){const d=o("info-icon"),p=o("file-preview"),g=o("font-awesome-icon"),c=o("el-button"),k=o("el-upload");return a(),m("div",$n,[i("div",kn,[i("div",vn,[i("span",bn,r(e.$t("kling.name.motionVideo")),1),n(d,{content:e.$t("kling.description.motionVideo")},null,8,["content"])])]),n(k,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=h=>e.fileList=h),accept:".mp4,.mov",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"before-upload":e.beforeUpload,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:f(({file:h})=>[h.percentage!==void 0?(a(),S(p,{key:0,url:h.url||h.response?.file_url,name:h.name,percentage:h.percentage,onRemove:_=>e.onRemove(h)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:f(()=>[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:f(()=>[n(g,{icon:"fa-solid fa-upload",class:"icon mr-1"}),C(" "+r(e.$t("kling.button.uploadVideoUrl")),1)]),_:1})]),_:1},8,["file-list","action","before-upload","on-exceed","on-error","on-success","headers"])])}const wn=w(_n,[["render",yn],["__scopeId","data-v-7019a8d2"]]),Cn=y({name:"MotionPromptInput",components:{ElInput:he,InfoIcon:I},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||""},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),Sn={class:"field"},Vn={class:"box"},In={class:"title font-bold"};function Tn(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-input");return a(),m("div",Sn,[i("div",Vn,[i("h2",In,r(e.$t("kling.name.motionPrompt")),1),n(d,{content:e.$t("kling.description.motionPrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=g=>e.prompt=g),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.motionPrompt")},null,8,["modelValue","placeholder"])])}const En=w(Cn,[["render",Tn],["__scopeId","data-v-ca9fdbe5"]]),re="video",Ln=y({name:"CharacterOrientationSelector",components:{ElRadioGroup:Ke,ElRadioButton:Ge,InfoIcon:I},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||re},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=re)}}),Mn={class:"field"},Un={class:"header"},Rn={class:"text-sm font-bold"};function An(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-radio-button"),g=o("el-radio-group");return a(),m("div",Mn,[i("div",Un,[i("span",Rn,r(e.$t("kling.name.characterOrientation")),1),n(d,{content:e.$t("kling.description.characterOrientation")},null,8,["content"])]),n(g,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),size:"small",class:"value"},{default:f(()=>[n(p,{label:"image"},{default:f(()=>[C(r(e.$t("kling.name.orientationImage")),1)]),_:1}),n(p,{label:"video"},{default:f(()=>[C(r(e.$t("kling.name.orientationVideo")),1)]),_:1})]),_:1},8,["modelValue"])])}const Dn=w(Ln,[["render",An],["__scopeId","data-v-7a91195b"]]),ce="std",Pn=y({name:"MotionModeSelector",components:{ElSelect:G,ElOption:P,InfoIcon:I},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||ce},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=ce)}}),Gn={class:"field"},Kn={class:"header"},On={class:"title font-bold"};function jn(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-option"),g=o("el-select");return a(),m("div",Gn,[i("div",Kn,[i("h2",On,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.motionMode")},null,8,["content"])]),n(g,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),class:"value",placeholder:e.$t("kling.placeholder.select")},{default:f(()=>[(a(!0),m(V,null,T(e.options,c=>(a(),S(p,{key:c.value,label:c.label,value:c.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Nn=w(Pn,[["render",jn],["__scopeId","data-v-1295688c"]]),Bn=y({name:"KeepOriginalSoundSelector",components:{ElSwitch:fe,InfoIcon:I},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"})}}}}),zn={class:"relative"},Fn={class:"flex justify-between items-center"},qn={class:"flex justify-start items-center"},Hn={class:"text-sm font-bold"};function Wn(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-switch");return a(),m("div",zn,[i("div",Fn,[i("div",qn,[i("span",Hn,r(e.$t("kling.name.keepOriginalSound")),1),n(d,{content:e.$t("kling.description.keepOriginalSound")},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=g=>e.value=g)},null,8,["modelValue"])])])}const Jn=w(Bn,[["render",Wn]]),Qn=y({name:"MotionPanel",components:{ElButton:M,FontAwesomeIcon:L,Consumption:me,MotionImage:hn,MotionVideo:wn,MotionPromptInput:En,CharacterOrientationSelector:Dn,MotionModeSelector:Nn,KeepOriginalSoundSelector:Jn},emits:["generate"],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return _e(this.motionConfig,this.service?.cost)},service(){return this.$store.state.kling?.service},canGenerate(){const e=this.motionConfig;return!!(e?.image_url&&e?.video_url)}},methods:{onGenerate(){this.$emit("generate")}}}),Yn={class:"flex flex-col h-full"},Xn={class:"flex-1 overflow-y-auto p-5"},Zn={class:"flex flex-col items-center justify-center px-5 pb-5"};function xn(e,t,s,l,u,$){const d=o("motion-image"),p=o("motion-video"),g=o("motion-prompt-input"),c=o("character-orientation-selector"),k=o("motion-mode-selector"),h=o("keep-original-sound-selector"),_=o("consumption"),E=o("font-awesome-icon"),R=o("el-button");return a(),m("div",Yn,[i("div",Xn,[n(d,{class:"mb-3"}),n(p,{class:"mb-3"}),n(g,{class:"mb-4"}),n(c,{class:"mb-4"}),n(k,{class:"mb-4"}),n(h,{class:"mb-4"})]),i("div",Zn,[n(_,{value:e.consumption,service:e.service},null,8,["value","service"]),n(R,{type:"primary",class:"btn w-full",round:"",disabled:!e.canGenerate,onClick:e.onGenerate},{default:f(()=>[n(E,{icon:"fa-solid fa-magic",class:"mr-2"}),C(" "+r(e.$t("kling.button.generateMotion")),1)]),_:1},8,["disabled","onClick"])])])}const es=w(Qn,[["render",xn]]),ts=y({name:"KlingTabSwitcher",components:{ElTabs:je,ElTabPane:Oe,ElTag:Se},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")}]}},methods:{onUpdate(e){this.$emit("update:modelValue",e)}}}),os=["title"],ns={class:"text"};function ss(e,t,s,l,u,$){const d=o("el-tag"),p=o("el-tab-pane"),g=o("el-tabs");return a(),S(g,{"model-value":e.modelValue,class:"kling-tabs",stretch:"","onUpdate:modelValue":e.onUpdate},{default:f(()=>[(a(!0),m(V,null,T(e.tabs,c=>(a(),S(p,{key:c.value,name:c.value,disabled:c.disabled},{label:f(()=>[i("span",{class:"tab-label",title:c.disabled?c.disabledReason:void 0},[i("span",ns,r(c.label),1),c.badge?(a(),S(d,{key:0,size:"small",type:"warning",class:"badge"},{default:f(()=>[C(r(c.badge),1)]),_:2},1024)):v("",!0)],8,os)]),_:2},1032,["name","disabled"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])}const is=w(ts,[["render",ss],["__scopeId","data-v-bf00c27e"]]),as=y({name:"TaskPreview",components:{ElImage:qe,CopyToClipboard:Ne,FontAwesomeIcon:L,ElAlert:Fe,VideoPlayer:Be,ElTooltip:Q,ElButton:M,ImagePreview:j,ApiCodeButton:ze},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},referenceImages(){const e=[],t=this.modelValue?.request?.start_image_url,s=this.modelValue?.request?.end_image_url;return t&&e.push({url:t,name:"start-image"}),s&&e.push({url:s,name:"end-image"}),e}},methods:{onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onOpenVideo(e){window.open(e,"_blank")}}}),ls={class:"preview"},rs={class:"left"},cs={class:"main"},ds={class:"bot"},us={class:"datetime"},ms={class:"info"},ps={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},gs={key:1,class:"prompt mt-2"},fs={key:0},hs={key:1},_s={key:0,class:U({content:!0,failed:!0})},$s={key:0,class:"mb-4"},ks={key:1,class:U({operations:!0,"mt-2":!0})},vs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},bs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ys={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},ws={key:1,class:U({content:!0})},Cs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ss={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Vs={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Is={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Ts={key:2,class:U({content:!0})},Es={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ls={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Ms(e,t,s,l,u,$){const d=o("el-image"),p=o("image-preview"),g=o("video-player"),c=o("el-button"),k=o("el-tooltip"),h=o("api-code-button"),_=o("font-awesome-icon"),E=o("copy-to-clipboard"),R=o("el-alert");return a(),m("div",ls,[i("div",rs,[n(d,{src:"https://cdn.acedata.cloud/qpbbbb.jpg",class:"avatar"})]),i("div",cs,[i("div",ds,[C(r(e.$t("kling.name.klingBot"))+" ",1),i("span",us,r(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),i("div",ms,[e.referenceImages.length>0?(a(),m("div",ps,[(a(!0),m(V,null,T(e.referenceImages,(A,B)=>(a(),S(p,{key:B,url:A.url,name:A.name,closable:!1},null,8,["url","name"]))),128))])):v("",!0),e.modelValue?.request?.prompt?(a(),m("p",gs,[C(r(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?v("",!0):(a(),m("span",fs," - ("+r(e.$t("kling.status.pending"))+") ",1)),e.modelValue?.response?.state==="submitted"||e.modelValue?.response?.state==="processing"||e.modelValue?.response?.state==="pending"||e.modelValue?.response?.state==="completed"?(a(),m("span",hs," - ("+r(e.$t("kling.status.processing"))+") ",1)):v("",!0)])):v("",!0)]),e.modelValue?.response?.success===!0?(a(),m("div",_s,[e.modelValue?.response.video_url?(a(),m("div",$s,[n(g,{src:e.modelValue?.response.video_url},null,8,["src"])])):v("",!0),e.modelValue?.response.success?(a(),m("div",ks,[n(k,{class:"box-item",effect:"dark",content:e.$t("kling.message.downloadVideo"),placement:"top-start"},{default:f(()=>[e.modelValue?.response.video_url?(a(),S(c,{key:0,type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=A=>e.onDownload(A,e.modelValue?.response.video_url))},{default:f(()=>[C(r(e.$t("kling.button.download")),1)]),_:1})):v("",!0)]),_:1},8,["content"]),n(h,{path:"/kling/videos",body:e.modelValue?.request},null,8,["body"])])):v("",!0),n(R,{closable:!1,class:"mt-2 success"},{default:f(()=>[i("p",vs,[n(_,{icon:"fa-solid fa-hashtag",class:"mr-1"}),C(" "+r(e.$t("kling.name.model"))+": "+r(e.modelValue?.request?.model),1)]),i("p",bs,[n(_,{icon:"fa-solid fa-magic",class:"mr-1"}),C(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(E,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(a(),m("p",ys,[n(_,{icon:"fa-solid fa-clock",class:"mr-1"}),C(" "+r(e.$t("kling.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):v("",!0)]),_:1})])):v("",!0),e.modelValue?.response?.success===!1?(a(),m("div",ws,[n(R,{closable:!1,class:"failure"},{template:f(()=>[n(_,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),C(" "+r(e.$t("kling.name.failure")),1)]),default:f(()=>[i("p",Cs,[n(_,{icon:"fa-solid fa-magic",class:"mr-1"}),C(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(E,{content:e.modelValue?.id},null,8,["content"])]),i("p",Ss,[n(_,{icon:"fa-solid fa-circle-info",class:"mr-1"}),C(" "+r(e.$t("kling.name.failureReason"))+": "+r(e.modelValue?.response?.error?.message)+" ",1),n(E,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(a(),m("p",Vs,[n(_,{icon:"fa-solid fa-clock",class:"mr-1"}),C(" "+r(e.$t("kling.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):v("",!0),e.modelValue?.response?.trace_id?(a(),m("p",Is,[n(_,{icon:"fa-solid fa-hashtag",class:"mr-1"}),C(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(E,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):v("",!0)]),_:1})])):v("",!0),e.modelValue?.response?.success===void 0?(a(),m("div",Ts,[n(R,{closable:!1,class:"info"},{template:f(()=>[n(_,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),C(" "+r(e.$t("kling.name.failure")),1)]),default:f(()=>[i("p",Es,[n(_,{icon:"fa-solid fa-magic",class:"mr-1"}),C(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(E,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.response?.trace_id?(a(),m("p",Ls,[n(_,{icon:"fa-solid fa-hashtag",class:"mr-1"}),C(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(E,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):v("",!0)]),_:1})])):v("",!0)])])}const Us=w(as,[["render",Ms],["__scopeId","data-v-422e2570"]]),Rs=y({name:"RecentPanel",components:{TaskPreview:Us,NoTasks:De,BotPlaceholder:He,ScrollList:Me},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?.()}}}),As={key:0},Ds={key:2,class:"w-full h-full flex items-center justify-center"};function Ps(e,t,s,l,u,$){const d=o("bot-placeholder"),p=o("task-preview"),g=o("scroll-list"),c=o("no-tasks");return a(),m(V,null,[e.tasks?.items===void 0?(a(),m("div",As,[n(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(a(),S(g,{key:1,ref:"scrollList",class:"h-full w-full overflow-y-auto tasks",loading:e.loading,onReachTop:t[0]||(t[0]=k=>e.$emit("reach-top"))},{default:f(()=>[(a(!0),m(V,null,T(e.tasks?.items,k=>(a(),S(p,{key:k.id,"model-value":k},null,8,["model-value"]))),128))]),_:1},8,["loading"])):v("",!0),e.tasks?.items?.length===0?(a(),m("div",Ds,[n(c)])):v("",!0)],64)}const Gs=w(Rs,[["render",Ps]]),de=Ve("kling"),Ks=y({name:"KlingIndex",components:{ConfigPanel:cn,MotionPanel:es,TabSwitcher:is,Layout:Ze,RecentPanel:Gs},mixins:[Re],inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===se.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===se.Request||this.fetchingTasks},credential(){return this.$store.state.kling.credential},config(){return this.$store.state.kling.config},motionConfig(){return this.$store.state.kling.motionConfig},taskType(){return this.$store.state.kling.taskType||"videos"},tasks(){return this.$store.state.kling.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await Ue({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();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:s,createdAtMax:l}=e||{};console.debug("limit",t,"createdAtMin",s,"createdAtMax",l),this.fetchingTasks=!0;try{await this.$store.dispatch("kling/getTasks",{limit:t,createdAtMin:s,createdAtMax:l})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!ae(this.uploadTracker,u=>this.$t(u),u=>b.warning(u)))return;const{camera_control:e,...t}=this.config||{},s={...t,callback_url:de};if(!s.video_id&&!t.video_url&&!s.start_image_url&&s.end_image_url){b.warning(this.$t("kling.message.endImageRequiresStart"));return}s.action||(s.video_id||t.video_url?s.action="extend":s.start_image_url?s.action="image2video":s.action="text2video"),s.action==="text2video"&&s.end_image_url&&delete s.end_image_url,e?.type&&(s.camera_control={type:e.type,...e.type==="simple"&&e.config?{config:Object.fromEntries(Object.entries(e.config).filter(([,u])=>u!=null))}:{}});const l=this.credential?.token;if(!l){console.error("no token specified");return}b.info(this.$t("kling.message.startingTask")),oe("kling",ne.generate(s,{token:l})).then(()=>{b.success(this.$t("kling.message.startTaskSuccess"))}).catch(u=>{u?.response?.data?.error?.code===le?b.error(this.$t("kling.message.usedUp")):b.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},async onTabChange(e){e!==this.taskType&&(await this.$store.dispatch("kling/setTaskType",e),await this.onGetTasks(),await this.onScrollDown())},async onGenerateMotion(){if(!ae(this.uploadTracker,l=>this.$t(l),l=>b.warning(l)))return;const e=this.motionConfig||{};if(!e.image_url||!e.video_url){b.warning(this.$t("kling.message.motionMissingInputs"));return}const 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.prompt?{prompt:e.prompt}:{},callback_url:de},s=this.credential?.token;if(!s){console.error("no token specified");return}b.info(this.$t("kling.message.startingTask")),oe("kling",ne.motion(t,{token:s})).then(()=>{b.success(this.$t("kling.message.startTaskSuccess"))}).catch(l=>{l?.response?.data?.error?.code===le?b.error(this.$t("kling.message.usedUp")):b.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),Os={class:"flex flex-col h-full"},js={class:"flex-1 min-h-0"};function Ns(e,t,s,l,u,$){const d=o("tab-switcher"),p=o("config-panel"),g=o("motion-panel"),c=o("recent-panel"),k=o("layout");return a(),S(k,null,{config:f(()=>[i("div",Os,[n(d,{"model-value":e.taskType,"onUpdate:modelValue":e.onTabChange},null,8,["model-value","onUpdate:modelValue"]),i("div",js,[e.taskType==="videos"?(a(),S(p,{key:0,onGenerate:e.onGenerate},null,8,["onGenerate"])):e.taskType==="motion"?(a(),S(g,{key:1,onGenerate:e.onGenerateMotion},null,8,["onGenerate"])):v("",!0)])])]),result:f(()=>[n(c,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Wi=w(Ks,[["render",Ns]]);export{Wi as default};
@@ -1 +1 @@
1
- import{F as U}from"./index.es-D8MU6eMk.js";import{E as L}from"./index-DbBDYLLC.js";import{E as Y}from"./index-C09FcKq9.js";import{d as g,H as i,E as c,z as j,C as a,y as p,D as s,q as t,F as l,O as w,N as S,x as m,Q as A,R as J,J as d,I as h}from"./vendor-vue-NSDaktjZ.js";import{H as b,bp as K,cs as Q,aK as W,S as R,ct as Z}from"./index-B5267oqA.js";import{a as x,b as ee,c as oe,d as te,e as se,f as ne,g as M,h as ae,i as le,j as ie}from"./veo-Dg8Zhpd-.js";import{E as P,a as O}from"./index-h72lxwun.js";import{I as G,S as re,l as ce}from"./pagination-BlJ6xPMo.js";import{E as de}from"./index-D3Pn_CC4.js";import{V as D}from"./VideoPlayer-D2Gk8iOW.js";import{E as N}from"./index-CQayeKqY.js";import{p as ue}from"./pasteUploadMixin-BurWbGNQ.js";import{u as pe,a as me,e as ve}from"./uploadTrackerMixin--N-yU8Tl.js";import{I as fe}from"./ImagePreview-D-9EFWby.js";import{E as _e}from"./index-bs2QXOh6.js";import{E as I}from"./index-CCwWrfc4.js";import{C as he}from"./Consumption-B3cgN_uS.js";import{P as $e,N as ge}from"./NoTasks-C9fjzpt-.js";import{a as be}from"./price-BDO9ZXFV.js";import{b as ke}from"./errorCode-Cqj9Td_Z.js";import{C as ye}from"./CopyToClipboard-g4vBpWAA.js";import{A as Ve}from"./ApiCodeButton-BxWrNlio.js";import{E as we}from"./index-CzL5AhXP.js";import{E as Ee}from"./index-B5jo7NY3.js";import{E as Te}from"./index-Bf3A60rN.js";import{B as Ie}from"./BotPlaceholder-DpiZEQow.js";import"./use-form-item-CAmCDDpm.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Df5ITouH.js";import"./index-V-c9hDuN.js";import"./typescript-GHEyAG9P.js";import"./index-C94_tKkM.js";import"./strings-beZM2Y-f.js";import"./isEqual-Dh50OCem.js";import"./_Uint8Array-pk5G6DXb.js";import"./castArray-tmh9kbwO.js";import"./debounce-DBeMKn11.js";import"./_baseIteratee-DKwNed0n.js";import"./index-YHAd10KH.js";import"./highlight-BIVpqebW.js";import"./index-BLjywj98.js";import"./vendor-highlight-lEWW1Jxd.js";import"./validator-BY6D6xjR.js";import"./vue-plyr-BO2nlN4c.js";import"./index-DVPxXPIi.js";import"./index-Tga9YfTB.js";import"./_baseClone-BEl0SBVQ.js";import"./_initCloneObject-7jYqtSMb.js";import"./index-68NaTtAT.js";const Se=g({name:"LayoutVeo",components:{ElDrawer:Y,ElButton:L,FontAwesomeIcon:U},data(){return{drawer:!1}}}),Ae={class:"main flex flex-row flex-1"},Ce={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},Pe={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function Oe(e,o,v,_,k,y){const r=s("font-awesome-icon"),u=s("el-button"),n=s("el-drawer");return t(),i("div",Ae,[c("div",Ce,[j(e.$slots,"config",{},void 0,!0)]),c("div",Pe,[j(e.$slots,"result",{},void 0,!0)]),a(u,{circle:"",class:"menu",onClick:o[0]||(o[0]=V=>e.drawer=!0)},{default:p(()=>[a(r,{icon:"fa-solid fa-magic"})]),_:1}),a(n,{modelValue:e.drawer,"onUpdate:modelValue":o[1]||(o[1]=V=>e.drawer=V),direction:"ltr","with-header":!1,size:"350px"},{default:p(()=>[j(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Ue=b(Se,[["render",Oe],["__scopeId","data-v-9b26d591"]]),Le=g({name:"ModelSelector",components:{ElSelect:O,ElOption:P},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{options:[{value:"veo2",label:"veo2"},{value:"veo2-fast",label:"veo2-fast"},{value:"veo3",label:"veo3"},{value:"veo3-fast",label:"veo3-fast"},{value:"veo31-fast",label:"veo31-fast"},{value:"veo31",label:"veo31"},{value:"veo31-fast-ingredients",label:"veo31-fast-ingredients"}]}},computed:{value:{get(){return this.$store.state.veo?.config?.model},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,model:e})}}},mounted(){this.value||(this.value=x)}}),je={class:"field"},Re={class:"title font-bold"};function Me(e,o,v,_,k,y){const r=s("el-option"),u=s("el-select");return t(),i("div",je,[c("h2",Re,l(e.$t("veo.name.model")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=n=>e.value=n),class:"value",placeholder:e.$t("veo.placeholder.select")},{default:p(()=>[(t(!0),i(w,null,S(e.options,n=>(t(),m(r,{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Ge=b(Le,[["render",Me],["__scopeId","data-v-a59d89c9"]]),De=g({name:"ActionSelector",components:{ElSelect:O,ElOption:P},data(){return{}},computed:{options(){return[{value:"text2video",label:this.$t("veo.button.action1")},{value:"image2video",label:this.$t("veo.button.action2")},{value:"ingredients2video",label:this.$t("veo.button.actionIngredients")},{value:"upsample",label:this.$t("veo.button.actionUpsample")},{value:"extend",label:this.$t("veo.button.actionExtend")},{value:"reshoot",label:this.$t("veo.button.actionReshoot")},{value:"object_insert",label:this.$t("veo.button.actionObjectInsert")},{value:"object_remove",label:this.$t("veo.button.actionObjectRemove")}]},value:{get(){return this.$store.state.veo?.config?.action},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,action:e})}}},mounted(){this.value||(this.value=ee)}}),Ne={class:"field"},Fe={class:"title font-bold"},ze={class:"float-left"};function Be(e,o,v,_,k,y){const r=s("el-option"),u=s("el-select");return t(),i("div",Ne,[c("h2",Fe,l(e.$t("veo.name.action")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=n=>e.value=n),class:"value",placeholder:e.$t("veo.placeholder.select"),clearable:""},{default:p(()=>[(t(!0),i(w,null,S(e.options,n=>(t(),m(r,{key:n.value,label:n.label,value:n.value},{default:p(()=>[c("span",ze,l(n.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const qe=b(De,[["render",Be],["__scopeId","data-v-f4d8785c"]]),He=g({name:"TranslationSelector",components:{ElSwitch:de,InfoIcon:G},computed:{value:{get(){return this.$store.state.veo?.config?.translation},set(e){console.debug("set translation",e),this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,translation:e})}}},mounted(){this.value===void 0&&(this.value=oe)}}),Xe={class:"relative"},Ye={class:"flex justify-between"},Je={class:"flex justify-start items-center"},Ke={class:"text-sm font-bold"},Qe={class:"flex justify-end items-center"};function We(e,o,v,_,k,y){const r=s("info-icon"),u=s("el-switch");return t(),i("div",Xe,[c("div",Ye,[c("div",Je,[c("span",Ke,l(e.$t("veo.name.translation")),1),a(r,{content:e.$t("veo.description.translation")},null,8,["content"])]),c("div",Qe,[a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=n=>e.value=n),class:"value"},null,8,["modelValue"])])])])}const Ze=b(He,[["render",We]]),xe=g({name:"AspectRatioSelector",data(){return{options:[{value:"1:1",label:"1:1",width:20,height:20},{value:"4:3",label:"4:3",width:20,height:15},{value:"3:4",label:"3:4",width:15,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.veo?.config?.aspect_ratio},set(e){console.debug("set aspect_ratio",e),this.$store.commit("veo/setConfig",{...this.$store.state?.veo?.config,aspect_ratio:e})}}},mounted(){this.value||(this.value=te)}}),eo={class:"text-sm font-bold mb-2 block"},oo={class:"items"},to=["onClick"],so={class:"name"};function no(e,o,v,_,k,y){return t(),i("div",null,[c("span",eo,l(e.$t("veo.name.ratio")),1),c("div",oo,[(t(!0),i(w,null,S(e.options,(r,u)=>(t(),i("div",{key:u,class:A({active:e.active===u,item:!0}),onClick:n=>e.value=r.value},[c("div",{class:A(["preview",r.label])},[c("div",{class:"rect",style:J({width:r.width+"px",height:r.height+"px"})},null,4)],2),c("p",so,l(r.label),1)],10,to))),128))])])}const ao=b(xe,[["render",no],["__scopeId","data-v-0f16be77"]]),lo=g({name:"VideoFromInput",components:{VideoPlayer:D},props:{modelValue:{type:Object,required:!1,default:void 0}},data(){return{options:{quality:{default:"1080p"}}}},computed:{config(){return this.$store.state.veo?.config}}}),io={class:"relative"},ro={class:"flex mb-2"},co={class:"text-sm font-bold"};function uo(e,o,v,_,k,y){const r=s("video-player");return t(),i("div",io,[c("div",ro,[c("span",co,l(e.$t("veo.name.action3")),1)]),c("div",null,[e.config?.video_url?(t(),m(r,{key:0,src:e.config?.video_url},null,8,["src"])):d("",!0)])])}const po=b(lo,[["render",uo]]),mo=g({name:"VideoIdInput",components:{ElInput:N},computed:{value:{get(){return this.$store.state.veo?.config?.video_id},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,video_id:e})}}}}),vo={class:"field"},fo={class:"title font-bold"};function _o(e,o,v,_,k,y){const r=s("el-input");return t(),i("div",vo,[c("h2",fo,l(e.$t("veo.name.videoId")),1),a(r,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=u=>e.value=u),class:"value",type:"text",placeholder:e.$t("veo.placeholder.videoId"),clearable:""},null,8,["modelValue","placeholder"])])}const ho=b(mo,[["render",_o],["__scopeId","data-v-6eba4026"]]),$o=g({name:"StartEndImage",components:{ElUpload:_e,ElButton:L,InfoIcon:G,FontAwesomeIcon:U,ImagePreview:fe},mixins:[ue,pe],emits:["change"],data(){return{fileList:[],uploadUrl:K()+"/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?.veo?.config?.image_urls},set(){}}},mounted(){this.value||(this.value=void 0),this.onSetStartEndImageUrl()},methods:{onExceed(){I.warning(this.$t("veo.message.uploadReferencesExceed"))},onError(){I.error(this.$t("veo.message.uploadReferencesError"))},onSetStartEndImageUrl(){const e=this.urls;this.$store.commit("veo/setConfig",{...this.$store.state?.veo?.config,image_urls:e})},async onSuccess(){this.onSetStartEndImageUrl()}}}),go={class:"relative"},bo={class:"flex justify-between"},ko={class:"flex justify-start items-center"},yo={class:"text-sm font-bold"};function Vo(e,o,v,_,k,y){const r=s("info-icon"),u=s("image-preview"),n=s("font-awesome-icon"),V=s("el-button"),T=s("el-upload");return t(),i("div",go,[c("div",bo,[c("div",ko,[c("span",yo,l(e.$t("veo.name.startEndImage")),1),a(r,{content:e.$t("veo.description.uploadStartEndImage")},null,8,["content"])])]),a(T,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":o[0]||(o[0]=f=>e.fileList=f),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:2,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:p(({file:f})=>[f.url&&f.percentage!==void 0?(t(),m(u,{key:0,url:f.url,name:f.name,percentage:f.percentage,onRemove:E=>e.fileList.splice(e.fileList.indexOf(f),1)},null,8,["url","name","percentage","onRemove"])):d("",!0)]),default:p(()=>[a(V,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:p(()=>[a(n,{icon:"fa-solid fa-upload",class:"icon mr-1"}),h(" "+l(e.$t("veo.button.uploadReferences")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const wo=b($o,[["render",Vo],["__scopeId","data-v-f9a79b4a"]]),Eo=g({name:"UpsampleActionSelector",components:{ElSelect:O,ElOption:P},computed:{options(){return ne.map(e=>({value:e,label:e}))},value:{get(){return this.$store.state.veo?.config?.upsample_action},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,upsample_action:e})}}},mounted(){this.value||(this.value=se)}}),To={class:"field"},Io={class:"title font-bold"};function So(e,o,v,_,k,y){const r=s("el-option"),u=s("el-select");return t(),i("div",To,[c("h2",Io,l(e.$t("veo.name.upsampleAction")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=n=>e.value=n),class:"value",placeholder:e.$t("veo.placeholder.select")},{default:p(()=>[(t(!0),i(w,null,S(e.options,n=>(t(),m(r,{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Ao=b(Eo,[["render",So],["__scopeId","data-v-8b74a7ae"]]),Co=g({name:"ExtendModelSelector",components:{ElSelect:O,ElOption:P},computed:{options(){return M.map(e=>({value:e,label:e}))},value:{get(){return this.$store.state.veo?.config?.model},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,model:e})}}},mounted(){(!this.value||!M.includes(this.value))&&(this.value=ae)}}),Po={class:"field"},Oo={class:"title font-bold"};function Uo(e,o,v,_,k,y){const r=s("el-option"),u=s("el-select");return t(),i("div",Po,[c("h2",Oo,l(e.$t("veo.name.model")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=n=>e.value=n),class:"value",placeholder:e.$t("veo.placeholder.select")},{default:p(()=>[(t(!0),i(w,null,S(e.options,n=>(t(),m(r,{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Lo=b(Co,[["render",Uo],["__scopeId","data-v-cc3f9355"]]),jo=g({name:"MotionTypeSelector",components:{ElSelect:O,ElOption:P},computed:{options(){return ie.map(e=>({value:e,label:e}))},value:{get(){return this.$store.state.veo?.config?.motion_type},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,motion_type:e})}}},mounted(){this.value||(this.value=le)}}),Ro={class:"field"},Mo={class:"title font-bold"};function Go(e,o,v,_,k,y){const r=s("el-option"),u=s("el-select");return t(),i("div",Ro,[c("h2",Mo,l(e.$t("veo.name.motionType")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=n=>e.value=n),class:"value",placeholder:e.$t("veo.placeholder.select"),filterable:""},{default:p(()=>[(t(!0),i(w,null,S(e.options,n=>(t(),m(r,{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Do=b(jo,[["render",Go],["__scopeId","data-v-3affff3c"]]),No=g({name:"ImageMaskInput",components:{ElInput:N},computed:{value:{get(){return this.$store.state.veo?.config?.image_mask},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,image_mask:e})}}}}),Fo={class:"field"},zo={class:"title font-bold"};function Bo(e,o,v,_,k,y){const r=s("el-input");return t(),i("div",Fo,[c("h2",zo,l(e.$t("veo.name.imageMask")),1),a(r,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=u=>e.value=u),class:"value",type:"text",placeholder:e.$t("veo.placeholder.imageMask"),clearable:""},null,8,["modelValue","placeholder"])])}const qo=b(No,[["render",Bo],["__scopeId","data-v-6cc27c68"]]),Ho="",Xo=g({name:"PromptInput",components:{PromptTextarea:$e},computed:{prompt:{get(){return this.$store.state.veo?.config?.prompt},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=Ho)}});function Yo(e,o,v,_,k,y){const r=s("prompt-textarea");return t(),m(r,{modelValue:e.prompt,"onUpdate:modelValue":o[0]||(o[0]=u=>e.prompt=u),title:e.$t("veo.name.prompt"),info:e.$t("veo.description.prompt"),placeholder:e.$t("veo.placeholder.prompt")},null,8,["modelValue","title","info","placeholder"])}const Jo=b(Xo,[["render",Yo]]),Ko=["upsample","extend","reshoot","object_insert","object_remove","get1080p"],Qo=["text2video","image2video","ingredients2video"],Wo=g({name:"ConfigPanel",components:{ElButton:L,Consumption:he,FontAwesomeIcon:U,PromptInput:Jo,ModelSelector:Ge,StartEndImage:wo,ActionSelector:qe,VideoFromInput:po,VideoIdInput:ho,UpsampleActionSelector:Ao,ExtendModelSelector:Lo,MotionTypeSelector:Do,ImageMaskInput:qo,TranslationSelector:Ze,AspectRatioSelector:ao},emits:["generate"],computed:{config(){return this.$store.state.veo?.config},consumption(){return be(this.config,this.service?.cost)},service(){return this.$store.state.veo?.service},isPostProcessing(){return Ko.includes(this.config?.action??"")},isGeneration(){return Qo.includes(this.config?.action??"")}},methods:{onGenerate(){this.$emit("generate")}}}),Zo={class:"flex flex-col h-full"},xo={class:"flex-1 overflow-y-auto p-5"},et={class:"flex flex-col items-center justify-center px-5 pb-5"};function ot(e,o,v,_,k,y){const r=s("action-selector"),u=s("video-from-input"),n=s("video-id-input"),V=s("upsample-action-selector"),T=s("extend-model-selector"),f=s("prompt-input"),E=s("motion-type-selector"),C=s("image-mask-input"),$=s("translation-selector"),F=s("aspect-ratio-selector"),z=s("model-selector"),B=s("start-end-image"),q=s("consumption"),H=s("font-awesome-icon"),X=s("el-button");return t(),i("div",Zo,[c("div",xo,[a(r,{class:"mb-4"}),e.isPostProcessing?(t(),i(w,{key:0},[e.config?.video_url?(t(),m(u,{key:0,class:"mb-4"})):d("",!0),a(n,{class:"mb-4"})],64)):d("",!0),e.config?.action==="upsample"?(t(),m(V,{key:1,class:"mb-4"})):d("",!0),e.config?.action==="extend"?(t(),m(T,{key:2,class:"mb-4"})):d("",!0),e.config?.action==="extend"?(t(),m(f,{key:3,class:"mb-4"})):d("",!0),e.config?.action==="reshoot"?(t(),m(E,{key:4,class:"mb-4"})):d("",!0),e.config?.action==="object_insert"?(t(),m(f,{key:5,class:"mb-4"})):d("",!0),e.config?.action==="object_insert"||e.config?.action==="object_remove"?(t(),m(C,{key:6,class:"mb-4"})):d("",!0),e.config?.action==="object_remove"?(t(),m(f,{key:7,class:"mb-4"})):d("",!0),e.isGeneration?(t(),i(w,{key:8},[a($,{class:"mb-4"}),a(F,{class:"mb-4"}),a(f,{class:"mb-4"}),e.config?.action!=="ingredients2video"?(t(),m(z,{key:0,class:"mb-4"})):d("",!0),e.config?.action==="image2video"||e.config?.action==="ingredients2video"?(t(),m(B,{key:1,class:"mb-2"})):d("",!0)],64)):d("",!0)]),c("div",et,[a(q,{value:e.consumption,service:e.service},null,8,["value","service"]),a(X,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:p(()=>[a(H,{icon:"fa-solid fa-magic",class:"mr-2"}),h(" "+l(e.$t("veo.button.generate")),1)]),_:1},8,["onClick"])])])}const tt=b(Wo,[["render",ot]]),st=g({name:"TaskPreview",components:{ElImage:Te,CopyToClipboard:ye,FontAwesomeIcon:U,ElAlert:Ee,VideoPlayer:D,ElTooltip:we,ElButton:L,ApiCodeButton:Ve},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.veo?.application},config(){return this.$store.state.veo?.config}},methods:{onPickAction(e,o,v,_){console.debug("seed config from preview",{action:v,upsampleAction:_,response:o}),this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,action:v,video_id:o?.data?.[0]?.id,video_url:o?.data?.[0]?.video_url,..._?{upsample_action:_}:{}})},onDownload(e,o){e.stopPropagation(),console.log("on download"),window.open(o,"_blank")},onOpenVideo(e){window.open(e,"_blank")}}}),nt={class:"preview"},at={class:"left"},lt={class:"main"},it={class:"bot"},rt={class:"datetime"},ct={class:"info"},dt={key:0,class:"prompt mt-2"},ut={key:0},pt={key:1},mt={key:0,class:A({content:!0,failed:!0})},vt={key:0,class:"mb-4"},ft={key:1,class:A({operations:!0,"mt-2":!0})},_t={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ht={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},$t={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},gt={key:1,class:A({content:!0})},bt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},kt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},yt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Vt={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},wt={key:2,class:A({content:!0})},Et={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Tt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function It(e,o,v,_,k,y){const r=s("el-image"),u=s("video-player"),n=s("el-button"),V=s("el-tooltip"),T=s("api-code-button"),f=s("font-awesome-icon"),E=s("copy-to-clipboard"),C=s("el-alert");return t(),i("div",nt,[c("div",at,[a(r,{src:"https://cdn.acedata.cloud/8nxyy9.jpg",class:"avatar"})]),c("div",lt,[c("div",it,[h(l(e.$t("veo.name.veoBot"))+" ",1),c("span",rt,l(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),c("div",ct,[e.modelValue?.request?.prompt?(t(),i("p",dt,[h(l(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?d("",!0):(t(),i("span",ut," - ("+l(e.$t("veo.status.pending"))+") ",1)),Array.isArray(e.modelValue?.response?.data)&&e.modelValue?.response?.data[0]?.state==="running"?(t(),i("span",pt," - ("+l(e.$t("veo.status.processing"))+") ",1)):d("",!0)])):d("",!0)]),e.modelValue?.response?.success===!0&&e.modelValue?.response?.data?(t(),i("div",mt,[e.modelValue?.response?.data[0]?.video_url?(t(),i("div",vt,[a(u,{src:e.modelValue?.response?.data[0]?.video_url},null,8,["src"])])):d("",!0),e.modelValue?.response.success?(t(),i("div",ft,[e.modelValue?.response?.data[0]?.video_url?(t(),m(n,{key:0,type:"info",size:"small",class:"btn-action",onClick:o[0]||(o[0]=$=>e.onPickAction($,e.modelValue?.response,"upsample","1080p"))},{default:p(()=>[h(l(e.$t("veo.button.actionUpsample1080p")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(n,{key:1,type:"info",size:"small",class:"btn-action",onClick:o[1]||(o[1]=$=>e.onPickAction($,e.modelValue?.response,"upsample","4k"))},{default:p(()=>[h(l(e.$t("veo.button.actionUpsample4k")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(n,{key:2,type:"info",size:"small",class:"btn-action",onClick:o[2]||(o[2]=$=>e.onPickAction($,e.modelValue?.response,"upsample","gif"))},{default:p(()=>[h(l(e.$t("veo.button.actionUpsampleGif")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(n,{key:3,type:"info",size:"small",class:"btn-action",onClick:o[3]||(o[3]=$=>e.onPickAction($,e.modelValue?.response,"extend"))},{default:p(()=>[h(l(e.$t("veo.button.actionExtend")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(n,{key:4,type:"info",size:"small",class:"btn-action",onClick:o[4]||(o[4]=$=>e.onPickAction($,e.modelValue?.response,"reshoot"))},{default:p(()=>[h(l(e.$t("veo.button.actionReshoot")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(n,{key:5,type:"info",size:"small",class:"btn-action",onClick:o[5]||(o[5]=$=>e.onPickAction($,e.modelValue?.response,"object_insert"))},{default:p(()=>[h(l(e.$t("veo.button.actionObjectInsert")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(n,{key:6,type:"info",size:"small",class:"btn-action",onClick:o[6]||(o[6]=$=>e.onPickAction($,e.modelValue?.response,"object_remove"))},{default:p(()=>[h(l(e.$t("veo.button.actionObjectRemove")),1)]),_:1})):d("",!0),a(V,{class:"box-item",effect:"dark",content:e.$t("veo.message.downloadVideo"),placement:"top-start"},{default:p(()=>[e.modelValue?.response?.data[0]?.video_url?(t(),m(n,{key:0,type:"info",size:"small",class:"btn-action",onClick:o[7]||(o[7]=$=>e.onDownload($,e.modelValue?.response?.data[0]?.video_url))},{default:p(()=>[h(l(e.$t("veo.button.download")),1)]),_:1})):d("",!0)]),_:1},8,["content"]),a(T,{path:"/veo/videos",body:e.modelValue?.request},null,8,["body"])])):d("",!0),a(C,{closable:!1,class:"mt-2 success"},{default:p(()=>[c("p",_t,[a(f,{icon:"fa-solid fa-hashtag",class:"mr-1"}),h(" "+l(e.$t("veo.name.model"))+": "+l(e.modelValue?.request?.model),1)]),c("p",ht,[a(f,{icon:"fa-solid fa-magic",class:"mr-1"}),h(" "+l(e.$t("veo.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),a(E,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(t(),i("p",$t,[a(f,{icon:"fa-solid fa-clock",class:"mr-1"}),h(" "+l(e.$t("veo.name.elapsed"))+": "+l(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):d("",!0)]),_:1})])):d("",!0),e.modelValue?.response?.success===!1?(t(),i("div",gt,[a(C,{closable:!1,class:"failure"},{template:p(()=>[a(f,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),h(" "+l(e.$t("veo.name.failure")),1)]),default:p(()=>[c("p",bt,[a(f,{icon:"fa-solid fa-magic",class:"mr-1"}),h(" "+l(e.$t("veo.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),a(E,{content:e.modelValue?.id},null,8,["content"])]),c("p",kt,[a(f,{icon:"fa-solid fa-circle-info",class:"mr-1"}),h(" "+l(e.$t("veo.name.failureReason"))+": "+l(e.modelValue?.response?.error?.message)+" ",1),a(E,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(t(),i("p",yt,[a(f,{icon:"fa-solid fa-clock",class:"mr-1"}),h(" "+l(e.$t("veo.name.elapsed"))+": "+l(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):d("",!0),e.modelValue?.response?.trace_id?(t(),i("p",Vt,[a(f,{icon:"fa-solid fa-hashtag",class:"mr-1"}),h(" "+l(e.$t("veo.name.traceId"))+": "+l(e.modelValue?.response?.trace_id)+" ",1),a(E,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):d("",!0)]),_:1})])):d("",!0),e.modelValue?.response?.success===void 0?(t(),i("div",wt,[a(C,{closable:!1,class:"info"},{template:p(()=>[a(f,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),h(" "+l(e.$t("veo.name.failure")),1)]),default:p(()=>[c("p",Et,[a(f,{icon:"fa-solid fa-magic",class:"mr-1"}),h(" "+l(e.$t("veo.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),a(E,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.response?.trace_id?(t(),i("p",Tt,[a(f,{icon:"fa-solid fa-hashtag",class:"mr-1"}),h(" "+l(e.$t("veo.name.traceId"))+": "+l(e.modelValue?.response?.trace_id)+" ",1),a(E,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):d("",!0)]),_:1})])):d("",!0)])])}const St=b(st,[["render",It],["__scopeId","data-v-912779c9"]]),At=g({name:"RecentPanel",components:{TaskPreview:St,NoTasks:ge,BotPlaceholder:Ie,ScrollList:re},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.veo?.tasks,items:this.$store.state.veo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Ct={key:0},Pt={key:2,class:"w-full h-full flex items-center justify-center"};function Ot(e,o,v,_,k,y){const r=s("bot-placeholder"),u=s("task-preview"),n=s("scroll-list"),V=s("no-tasks");return t(),i(w,null,[e.tasks?.items===void 0?(t(),i("div",Ct,[a(r)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(t(),m(n,{key:1,ref:"scrollList",class:"tasks h-full w-full overflow-y-auto",loading:e.loading,onReachTop:o[0]||(o[0]=T=>e.$emit("reach-top"))},{default:p(()=>[(t(!0),i(w,null,S(e.tasks?.items,(T,f)=>(t(),m(u,{key:f,"model-value":T},null,8,["model-value"]))),128))]),_:1},8,["loading"])):d("",!0),e.tasks?.items?.length===0?(t(),i("div",Pt,[a(V)])):d("",!0)],64)}const Ut=b(At,[["render",Ot]]),Lt=Z("veo"),jt=g({name:"VeoIndex",components:{ConfigPanel:tt,Layout:Ue,RecentPanel:Ut},mixins:[me],inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.veo?.status?.getApplications===R.Request},tasksLoading(){return this.$store.state.veo?.status?.getTasks===R.Request||this.fetchingTasks},credential(){return this.$store.state.veo.credential},config(){return this.$store.state.veo.config},tasks(){return this.$store.state.veo.tasks}},watch:{tasks:{handler(e,o){e?.items?.length>o?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ce({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("veo/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("veo/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:o=5,createdAtMin:v,createdAtMax:_}=e||{};console.debug("limit",o,"createdAtMin",v,"createdAtMax",_),this.fetchingTasks=!0;try{await this.$store.dispatch("veo/getTasks",{limit:o,createdAtMin:v,createdAtMax:_})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!ve(this.uploadTracker,v=>this.$t(v),v=>I.warning(v)))return;const e={...this.config,callback_url:Lt},o=this.credential?.token;if(!o){console.error("no token specified");return}if(e.action==="image2video"&&!(e.image_urls&&e.image_urls.length>0)){I.warning(this.$t("veo.message.imageRequired"));return}(!e.image_urls||e.image_urls.length===0)&&delete e.image_urls,I.info(this.$t("veo.message.startingTask")),Q("veo",W.generate(e,{token:o})).then(()=>{I.success(this.$t("veo.message.startTaskSuccess"))}).catch(v=>{v?.response?.data?.error?.code===ke?I.error(this.$t("veo.message.usedUp")):I.error(this.$t("veo.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Rt(e,o,v,_,k,y){const r=s("config-panel"),u=s("recent-panel"),n=s("layout");return t(),m(n,null,{config:p(()=>[a(r,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:p(()=>[a(u,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Ls=b(jt,[["render",Rt]]);export{Ls as default};
1
+ import{F as U}from"./index.es-CLQR2iBw.js";import{E as L}from"./index-DpLV-Pq9.js";import{E as Y}from"./index-DJjyFLlw.js";import{d as g,H as i,E as c,z as j,C as a,y as p,D as s,q as t,F as l,O as w,N as S,x as m,Q as A,R as J,J as d,I as h}from"./vendor-vue-NSDaktjZ.js";import{H as b,bp as K,cs as Q,aK as W,S as R,ct as Z}from"./index-CVH6GWSn.js";import{a as x,b as ee,c as oe,d as te,e as se,f as ne,g as M,h as ae,i as le,j as ie}from"./veo-Dg8Zhpd-.js";import{E as P,a as O}from"./index-Du5AFIP4.js";import{I as G,S as re,l as ce}from"./pagination-DiGyJEay.js";import{E as de}from"./index-B3XMfsr2.js";import{V as D}from"./VideoPlayer-2W03rLFF.js";import{E as N}from"./index-EBzcwoVz.js";import{p as ue}from"./pasteUploadMixin-BurWbGNQ.js";import{u as pe,a as me,e as ve}from"./uploadTrackerMixin--N-yU8Tl.js";import{I as fe}from"./ImagePreview-DeNxw7C3.js";import{E as _e}from"./index-BOikF7Vg.js";import{E as I}from"./index-CisFWmyE.js";import{C as he}from"./Consumption-BoW8Yj1Z.js";import{P as $e,N as ge}from"./NoTasks-CBf4UVlo.js";import{a as be}from"./price-B1xKQHsz.js";import{b as ke}from"./errorCode-Cqj9Td_Z.js";import{C as ye}from"./CopyToClipboard-Ih2qsYgN.js";import{A as Ve}from"./ApiCodeButton-CsgRae2o.js";import{E as we}from"./index-ByCbBTje.js";import{E as Ee}from"./index-BizFhdaE.js";import{E as Te}from"./index-br52C4yM.js";import{B as Ie}from"./BotPlaceholder-B-UqCz8R.js";import"./use-form-item-BV_L9kB7.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Df5ITouH.js";import"./index-BiSfH4hc.js";import"./typescript-BXdqla6u.js";import"./index-Dw6ZevFg.js";import"./strings-beZM2Y-f.js";import"./isEqual-CWBDsFs3.js";import"./_Uint8Array-Cj-LmGzx.js";import"./castArray-9ufFSW5u.js";import"./debounce-zyhh1kFW.js";import"./_baseIteratee-BcXwWZMY.js";import"./index-Dbz6Whu6.js";import"./highlight-CYeIx3eC.js";import"./index-BLjywj98.js";import"./vendor-highlight-lEWW1Jxd.js";import"./validator-C6fRYUzr.js";import"./vue-plyr-BO2nlN4c.js";import"./index-CLOxJQ_9.js";import"./index-BsWkCEVF.js";import"./_baseClone-CD4xkhO5.js";import"./_initCloneObject-CIlwXpy7.js";import"./index-DAZIhRrh.js";const Se=g({name:"LayoutVeo",components:{ElDrawer:Y,ElButton:L,FontAwesomeIcon:U},data(){return{drawer:!1}}}),Ae={class:"main flex flex-row flex-1"},Ce={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},Pe={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function Oe(e,o,v,_,k,y){const r=s("font-awesome-icon"),u=s("el-button"),n=s("el-drawer");return t(),i("div",Ae,[c("div",Ce,[j(e.$slots,"config",{},void 0,!0)]),c("div",Pe,[j(e.$slots,"result",{},void 0,!0)]),a(u,{circle:"",class:"menu",onClick:o[0]||(o[0]=V=>e.drawer=!0)},{default:p(()=>[a(r,{icon:"fa-solid fa-magic"})]),_:1}),a(n,{modelValue:e.drawer,"onUpdate:modelValue":o[1]||(o[1]=V=>e.drawer=V),direction:"ltr","with-header":!1,size:"350px"},{default:p(()=>[j(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Ue=b(Se,[["render",Oe],["__scopeId","data-v-9b26d591"]]),Le=g({name:"ModelSelector",components:{ElSelect:O,ElOption:P},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{options:[{value:"veo2",label:"veo2"},{value:"veo2-fast",label:"veo2-fast"},{value:"veo3",label:"veo3"},{value:"veo3-fast",label:"veo3-fast"},{value:"veo31-fast",label:"veo31-fast"},{value:"veo31",label:"veo31"},{value:"veo31-fast-ingredients",label:"veo31-fast-ingredients"}]}},computed:{value:{get(){return this.$store.state.veo?.config?.model},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,model:e})}}},mounted(){this.value||(this.value=x)}}),je={class:"field"},Re={class:"title font-bold"};function Me(e,o,v,_,k,y){const r=s("el-option"),u=s("el-select");return t(),i("div",je,[c("h2",Re,l(e.$t("veo.name.model")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=n=>e.value=n),class:"value",placeholder:e.$t("veo.placeholder.select")},{default:p(()=>[(t(!0),i(w,null,S(e.options,n=>(t(),m(r,{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Ge=b(Le,[["render",Me],["__scopeId","data-v-a59d89c9"]]),De=g({name:"ActionSelector",components:{ElSelect:O,ElOption:P},data(){return{}},computed:{options(){return[{value:"text2video",label:this.$t("veo.button.action1")},{value:"image2video",label:this.$t("veo.button.action2")},{value:"ingredients2video",label:this.$t("veo.button.actionIngredients")},{value:"upsample",label:this.$t("veo.button.actionUpsample")},{value:"extend",label:this.$t("veo.button.actionExtend")},{value:"reshoot",label:this.$t("veo.button.actionReshoot")},{value:"object_insert",label:this.$t("veo.button.actionObjectInsert")},{value:"object_remove",label:this.$t("veo.button.actionObjectRemove")}]},value:{get(){return this.$store.state.veo?.config?.action},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,action:e})}}},mounted(){this.value||(this.value=ee)}}),Ne={class:"field"},Fe={class:"title font-bold"},ze={class:"float-left"};function Be(e,o,v,_,k,y){const r=s("el-option"),u=s("el-select");return t(),i("div",Ne,[c("h2",Fe,l(e.$t("veo.name.action")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=n=>e.value=n),class:"value",placeholder:e.$t("veo.placeholder.select"),clearable:""},{default:p(()=>[(t(!0),i(w,null,S(e.options,n=>(t(),m(r,{key:n.value,label:n.label,value:n.value},{default:p(()=>[c("span",ze,l(n.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const qe=b(De,[["render",Be],["__scopeId","data-v-f4d8785c"]]),He=g({name:"TranslationSelector",components:{ElSwitch:de,InfoIcon:G},computed:{value:{get(){return this.$store.state.veo?.config?.translation},set(e){console.debug("set translation",e),this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,translation:e})}}},mounted(){this.value===void 0&&(this.value=oe)}}),Xe={class:"relative"},Ye={class:"flex justify-between"},Je={class:"flex justify-start items-center"},Ke={class:"text-sm font-bold"},Qe={class:"flex justify-end items-center"};function We(e,o,v,_,k,y){const r=s("info-icon"),u=s("el-switch");return t(),i("div",Xe,[c("div",Ye,[c("div",Je,[c("span",Ke,l(e.$t("veo.name.translation")),1),a(r,{content:e.$t("veo.description.translation")},null,8,["content"])]),c("div",Qe,[a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=n=>e.value=n),class:"value"},null,8,["modelValue"])])])])}const Ze=b(He,[["render",We]]),xe=g({name:"AspectRatioSelector",data(){return{options:[{value:"1:1",label:"1:1",width:20,height:20},{value:"4:3",label:"4:3",width:20,height:15},{value:"3:4",label:"3:4",width:15,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.veo?.config?.aspect_ratio},set(e){console.debug("set aspect_ratio",e),this.$store.commit("veo/setConfig",{...this.$store.state?.veo?.config,aspect_ratio:e})}}},mounted(){this.value||(this.value=te)}}),eo={class:"text-sm font-bold mb-2 block"},oo={class:"items"},to=["onClick"],so={class:"name"};function no(e,o,v,_,k,y){return t(),i("div",null,[c("span",eo,l(e.$t("veo.name.ratio")),1),c("div",oo,[(t(!0),i(w,null,S(e.options,(r,u)=>(t(),i("div",{key:u,class:A({active:e.active===u,item:!0}),onClick:n=>e.value=r.value},[c("div",{class:A(["preview",r.label])},[c("div",{class:"rect",style:J({width:r.width+"px",height:r.height+"px"})},null,4)],2),c("p",so,l(r.label),1)],10,to))),128))])])}const ao=b(xe,[["render",no],["__scopeId","data-v-0f16be77"]]),lo=g({name:"VideoFromInput",components:{VideoPlayer:D},props:{modelValue:{type:Object,required:!1,default:void 0}},data(){return{options:{quality:{default:"1080p"}}}},computed:{config(){return this.$store.state.veo?.config}}}),io={class:"relative"},ro={class:"flex mb-2"},co={class:"text-sm font-bold"};function uo(e,o,v,_,k,y){const r=s("video-player");return t(),i("div",io,[c("div",ro,[c("span",co,l(e.$t("veo.name.action3")),1)]),c("div",null,[e.config?.video_url?(t(),m(r,{key:0,src:e.config?.video_url},null,8,["src"])):d("",!0)])])}const po=b(lo,[["render",uo]]),mo=g({name:"VideoIdInput",components:{ElInput:N},computed:{value:{get(){return this.$store.state.veo?.config?.video_id},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,video_id:e})}}}}),vo={class:"field"},fo={class:"title font-bold"};function _o(e,o,v,_,k,y){const r=s("el-input");return t(),i("div",vo,[c("h2",fo,l(e.$t("veo.name.videoId")),1),a(r,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=u=>e.value=u),class:"value",type:"text",placeholder:e.$t("veo.placeholder.videoId"),clearable:""},null,8,["modelValue","placeholder"])])}const ho=b(mo,[["render",_o],["__scopeId","data-v-6eba4026"]]),$o=g({name:"StartEndImage",components:{ElUpload:_e,ElButton:L,InfoIcon:G,FontAwesomeIcon:U,ImagePreview:fe},mixins:[ue,pe],emits:["change"],data(){return{fileList:[],uploadUrl:K()+"/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?.veo?.config?.image_urls},set(){}}},mounted(){this.value||(this.value=void 0),this.onSetStartEndImageUrl()},methods:{onExceed(){I.warning(this.$t("veo.message.uploadReferencesExceed"))},onError(){I.error(this.$t("veo.message.uploadReferencesError"))},onSetStartEndImageUrl(){const e=this.urls;this.$store.commit("veo/setConfig",{...this.$store.state?.veo?.config,image_urls:e})},async onSuccess(){this.onSetStartEndImageUrl()}}}),go={class:"relative"},bo={class:"flex justify-between"},ko={class:"flex justify-start items-center"},yo={class:"text-sm font-bold"};function Vo(e,o,v,_,k,y){const r=s("info-icon"),u=s("image-preview"),n=s("font-awesome-icon"),V=s("el-button"),T=s("el-upload");return t(),i("div",go,[c("div",bo,[c("div",ko,[c("span",yo,l(e.$t("veo.name.startEndImage")),1),a(r,{content:e.$t("veo.description.uploadStartEndImage")},null,8,["content"])])]),a(T,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":o[0]||(o[0]=f=>e.fileList=f),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:2,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:p(({file:f})=>[f.url&&f.percentage!==void 0?(t(),m(u,{key:0,url:f.url,name:f.name,percentage:f.percentage,onRemove:E=>e.fileList.splice(e.fileList.indexOf(f),1)},null,8,["url","name","percentage","onRemove"])):d("",!0)]),default:p(()=>[a(V,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:p(()=>[a(n,{icon:"fa-solid fa-upload",class:"icon mr-1"}),h(" "+l(e.$t("veo.button.uploadReferences")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const wo=b($o,[["render",Vo],["__scopeId","data-v-f9a79b4a"]]),Eo=g({name:"UpsampleActionSelector",components:{ElSelect:O,ElOption:P},computed:{options(){return ne.map(e=>({value:e,label:e}))},value:{get(){return this.$store.state.veo?.config?.upsample_action},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,upsample_action:e})}}},mounted(){this.value||(this.value=se)}}),To={class:"field"},Io={class:"title font-bold"};function So(e,o,v,_,k,y){const r=s("el-option"),u=s("el-select");return t(),i("div",To,[c("h2",Io,l(e.$t("veo.name.upsampleAction")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=n=>e.value=n),class:"value",placeholder:e.$t("veo.placeholder.select")},{default:p(()=>[(t(!0),i(w,null,S(e.options,n=>(t(),m(r,{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Ao=b(Eo,[["render",So],["__scopeId","data-v-8b74a7ae"]]),Co=g({name:"ExtendModelSelector",components:{ElSelect:O,ElOption:P},computed:{options(){return M.map(e=>({value:e,label:e}))},value:{get(){return this.$store.state.veo?.config?.model},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,model:e})}}},mounted(){(!this.value||!M.includes(this.value))&&(this.value=ae)}}),Po={class:"field"},Oo={class:"title font-bold"};function Uo(e,o,v,_,k,y){const r=s("el-option"),u=s("el-select");return t(),i("div",Po,[c("h2",Oo,l(e.$t("veo.name.model")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=n=>e.value=n),class:"value",placeholder:e.$t("veo.placeholder.select")},{default:p(()=>[(t(!0),i(w,null,S(e.options,n=>(t(),m(r,{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Lo=b(Co,[["render",Uo],["__scopeId","data-v-cc3f9355"]]),jo=g({name:"MotionTypeSelector",components:{ElSelect:O,ElOption:P},computed:{options(){return ie.map(e=>({value:e,label:e}))},value:{get(){return this.$store.state.veo?.config?.motion_type},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,motion_type:e})}}},mounted(){this.value||(this.value=le)}}),Ro={class:"field"},Mo={class:"title font-bold"};function Go(e,o,v,_,k,y){const r=s("el-option"),u=s("el-select");return t(),i("div",Ro,[c("h2",Mo,l(e.$t("veo.name.motionType")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=n=>e.value=n),class:"value",placeholder:e.$t("veo.placeholder.select"),filterable:""},{default:p(()=>[(t(!0),i(w,null,S(e.options,n=>(t(),m(r,{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Do=b(jo,[["render",Go],["__scopeId","data-v-3affff3c"]]),No=g({name:"ImageMaskInput",components:{ElInput:N},computed:{value:{get(){return this.$store.state.veo?.config?.image_mask},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,image_mask:e})}}}}),Fo={class:"field"},zo={class:"title font-bold"};function Bo(e,o,v,_,k,y){const r=s("el-input");return t(),i("div",Fo,[c("h2",zo,l(e.$t("veo.name.imageMask")),1),a(r,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=u=>e.value=u),class:"value",type:"text",placeholder:e.$t("veo.placeholder.imageMask"),clearable:""},null,8,["modelValue","placeholder"])])}const qo=b(No,[["render",Bo],["__scopeId","data-v-6cc27c68"]]),Ho="",Xo=g({name:"PromptInput",components:{PromptTextarea:$e},computed:{prompt:{get(){return this.$store.state.veo?.config?.prompt},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=Ho)}});function Yo(e,o,v,_,k,y){const r=s("prompt-textarea");return t(),m(r,{modelValue:e.prompt,"onUpdate:modelValue":o[0]||(o[0]=u=>e.prompt=u),title:e.$t("veo.name.prompt"),info:e.$t("veo.description.prompt"),placeholder:e.$t("veo.placeholder.prompt")},null,8,["modelValue","title","info","placeholder"])}const Jo=b(Xo,[["render",Yo]]),Ko=["upsample","extend","reshoot","object_insert","object_remove","get1080p"],Qo=["text2video","image2video","ingredients2video"],Wo=g({name:"ConfigPanel",components:{ElButton:L,Consumption:he,FontAwesomeIcon:U,PromptInput:Jo,ModelSelector:Ge,StartEndImage:wo,ActionSelector:qe,VideoFromInput:po,VideoIdInput:ho,UpsampleActionSelector:Ao,ExtendModelSelector:Lo,MotionTypeSelector:Do,ImageMaskInput:qo,TranslationSelector:Ze,AspectRatioSelector:ao},emits:["generate"],computed:{config(){return this.$store.state.veo?.config},consumption(){return be(this.config,this.service?.cost)},service(){return this.$store.state.veo?.service},isPostProcessing(){return Ko.includes(this.config?.action??"")},isGeneration(){return Qo.includes(this.config?.action??"")}},methods:{onGenerate(){this.$emit("generate")}}}),Zo={class:"flex flex-col h-full"},xo={class:"flex-1 overflow-y-auto p-5"},et={class:"flex flex-col items-center justify-center px-5 pb-5"};function ot(e,o,v,_,k,y){const r=s("action-selector"),u=s("video-from-input"),n=s("video-id-input"),V=s("upsample-action-selector"),T=s("extend-model-selector"),f=s("prompt-input"),E=s("motion-type-selector"),C=s("image-mask-input"),$=s("translation-selector"),F=s("aspect-ratio-selector"),z=s("model-selector"),B=s("start-end-image"),q=s("consumption"),H=s("font-awesome-icon"),X=s("el-button");return t(),i("div",Zo,[c("div",xo,[a(r,{class:"mb-4"}),e.isPostProcessing?(t(),i(w,{key:0},[e.config?.video_url?(t(),m(u,{key:0,class:"mb-4"})):d("",!0),a(n,{class:"mb-4"})],64)):d("",!0),e.config?.action==="upsample"?(t(),m(V,{key:1,class:"mb-4"})):d("",!0),e.config?.action==="extend"?(t(),m(T,{key:2,class:"mb-4"})):d("",!0),e.config?.action==="extend"?(t(),m(f,{key:3,class:"mb-4"})):d("",!0),e.config?.action==="reshoot"?(t(),m(E,{key:4,class:"mb-4"})):d("",!0),e.config?.action==="object_insert"?(t(),m(f,{key:5,class:"mb-4"})):d("",!0),e.config?.action==="object_insert"||e.config?.action==="object_remove"?(t(),m(C,{key:6,class:"mb-4"})):d("",!0),e.config?.action==="object_remove"?(t(),m(f,{key:7,class:"mb-4"})):d("",!0),e.isGeneration?(t(),i(w,{key:8},[a($,{class:"mb-4"}),a(F,{class:"mb-4"}),a(f,{class:"mb-4"}),e.config?.action!=="ingredients2video"?(t(),m(z,{key:0,class:"mb-4"})):d("",!0),e.config?.action==="image2video"||e.config?.action==="ingredients2video"?(t(),m(B,{key:1,class:"mb-2"})):d("",!0)],64)):d("",!0)]),c("div",et,[a(q,{value:e.consumption,service:e.service},null,8,["value","service"]),a(X,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:p(()=>[a(H,{icon:"fa-solid fa-magic",class:"mr-2"}),h(" "+l(e.$t("veo.button.generate")),1)]),_:1},8,["onClick"])])])}const tt=b(Wo,[["render",ot]]),st=g({name:"TaskPreview",components:{ElImage:Te,CopyToClipboard:ye,FontAwesomeIcon:U,ElAlert:Ee,VideoPlayer:D,ElTooltip:we,ElButton:L,ApiCodeButton:Ve},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.veo?.application},config(){return this.$store.state.veo?.config}},methods:{onPickAction(e,o,v,_){console.debug("seed config from preview",{action:v,upsampleAction:_,response:o}),this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,action:v,video_id:o?.data?.[0]?.id,video_url:o?.data?.[0]?.video_url,..._?{upsample_action:_}:{}})},onDownload(e,o){e.stopPropagation(),console.log("on download"),window.open(o,"_blank")},onOpenVideo(e){window.open(e,"_blank")}}}),nt={class:"preview"},at={class:"left"},lt={class:"main"},it={class:"bot"},rt={class:"datetime"},ct={class:"info"},dt={key:0,class:"prompt mt-2"},ut={key:0},pt={key:1},mt={key:0,class:A({content:!0,failed:!0})},vt={key:0,class:"mb-4"},ft={key:1,class:A({operations:!0,"mt-2":!0})},_t={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ht={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},$t={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},gt={key:1,class:A({content:!0})},bt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},kt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},yt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Vt={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},wt={key:2,class:A({content:!0})},Et={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Tt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function It(e,o,v,_,k,y){const r=s("el-image"),u=s("video-player"),n=s("el-button"),V=s("el-tooltip"),T=s("api-code-button"),f=s("font-awesome-icon"),E=s("copy-to-clipboard"),C=s("el-alert");return t(),i("div",nt,[c("div",at,[a(r,{src:"https://cdn.acedata.cloud/8nxyy9.jpg",class:"avatar"})]),c("div",lt,[c("div",it,[h(l(e.$t("veo.name.veoBot"))+" ",1),c("span",rt,l(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),c("div",ct,[e.modelValue?.request?.prompt?(t(),i("p",dt,[h(l(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?d("",!0):(t(),i("span",ut," - ("+l(e.$t("veo.status.pending"))+") ",1)),Array.isArray(e.modelValue?.response?.data)&&e.modelValue?.response?.data[0]?.state==="running"?(t(),i("span",pt," - ("+l(e.$t("veo.status.processing"))+") ",1)):d("",!0)])):d("",!0)]),e.modelValue?.response?.success===!0&&e.modelValue?.response?.data?(t(),i("div",mt,[e.modelValue?.response?.data[0]?.video_url?(t(),i("div",vt,[a(u,{src:e.modelValue?.response?.data[0]?.video_url},null,8,["src"])])):d("",!0),e.modelValue?.response.success?(t(),i("div",ft,[e.modelValue?.response?.data[0]?.video_url?(t(),m(n,{key:0,type:"info",size:"small",class:"btn-action",onClick:o[0]||(o[0]=$=>e.onPickAction($,e.modelValue?.response,"upsample","1080p"))},{default:p(()=>[h(l(e.$t("veo.button.actionUpsample1080p")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(n,{key:1,type:"info",size:"small",class:"btn-action",onClick:o[1]||(o[1]=$=>e.onPickAction($,e.modelValue?.response,"upsample","4k"))},{default:p(()=>[h(l(e.$t("veo.button.actionUpsample4k")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(n,{key:2,type:"info",size:"small",class:"btn-action",onClick:o[2]||(o[2]=$=>e.onPickAction($,e.modelValue?.response,"upsample","gif"))},{default:p(()=>[h(l(e.$t("veo.button.actionUpsampleGif")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(n,{key:3,type:"info",size:"small",class:"btn-action",onClick:o[3]||(o[3]=$=>e.onPickAction($,e.modelValue?.response,"extend"))},{default:p(()=>[h(l(e.$t("veo.button.actionExtend")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(n,{key:4,type:"info",size:"small",class:"btn-action",onClick:o[4]||(o[4]=$=>e.onPickAction($,e.modelValue?.response,"reshoot"))},{default:p(()=>[h(l(e.$t("veo.button.actionReshoot")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(n,{key:5,type:"info",size:"small",class:"btn-action",onClick:o[5]||(o[5]=$=>e.onPickAction($,e.modelValue?.response,"object_insert"))},{default:p(()=>[h(l(e.$t("veo.button.actionObjectInsert")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(n,{key:6,type:"info",size:"small",class:"btn-action",onClick:o[6]||(o[6]=$=>e.onPickAction($,e.modelValue?.response,"object_remove"))},{default:p(()=>[h(l(e.$t("veo.button.actionObjectRemove")),1)]),_:1})):d("",!0),a(V,{class:"box-item",effect:"dark",content:e.$t("veo.message.downloadVideo"),placement:"top-start"},{default:p(()=>[e.modelValue?.response?.data[0]?.video_url?(t(),m(n,{key:0,type:"info",size:"small",class:"btn-action",onClick:o[7]||(o[7]=$=>e.onDownload($,e.modelValue?.response?.data[0]?.video_url))},{default:p(()=>[h(l(e.$t("veo.button.download")),1)]),_:1})):d("",!0)]),_:1},8,["content"]),a(T,{path:"/veo/videos",body:e.modelValue?.request},null,8,["body"])])):d("",!0),a(C,{closable:!1,class:"mt-2 success"},{default:p(()=>[c("p",_t,[a(f,{icon:"fa-solid fa-hashtag",class:"mr-1"}),h(" "+l(e.$t("veo.name.model"))+": "+l(e.modelValue?.request?.model),1)]),c("p",ht,[a(f,{icon:"fa-solid fa-magic",class:"mr-1"}),h(" "+l(e.$t("veo.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),a(E,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(t(),i("p",$t,[a(f,{icon:"fa-solid fa-clock",class:"mr-1"}),h(" "+l(e.$t("veo.name.elapsed"))+": "+l(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):d("",!0)]),_:1})])):d("",!0),e.modelValue?.response?.success===!1?(t(),i("div",gt,[a(C,{closable:!1,class:"failure"},{template:p(()=>[a(f,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),h(" "+l(e.$t("veo.name.failure")),1)]),default:p(()=>[c("p",bt,[a(f,{icon:"fa-solid fa-magic",class:"mr-1"}),h(" "+l(e.$t("veo.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),a(E,{content:e.modelValue?.id},null,8,["content"])]),c("p",kt,[a(f,{icon:"fa-solid fa-circle-info",class:"mr-1"}),h(" "+l(e.$t("veo.name.failureReason"))+": "+l(e.modelValue?.response?.error?.message)+" ",1),a(E,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(t(),i("p",yt,[a(f,{icon:"fa-solid fa-clock",class:"mr-1"}),h(" "+l(e.$t("veo.name.elapsed"))+": "+l(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):d("",!0),e.modelValue?.response?.trace_id?(t(),i("p",Vt,[a(f,{icon:"fa-solid fa-hashtag",class:"mr-1"}),h(" "+l(e.$t("veo.name.traceId"))+": "+l(e.modelValue?.response?.trace_id)+" ",1),a(E,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):d("",!0)]),_:1})])):d("",!0),e.modelValue?.response?.success===void 0?(t(),i("div",wt,[a(C,{closable:!1,class:"info"},{template:p(()=>[a(f,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),h(" "+l(e.$t("veo.name.failure")),1)]),default:p(()=>[c("p",Et,[a(f,{icon:"fa-solid fa-magic",class:"mr-1"}),h(" "+l(e.$t("veo.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),a(E,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.response?.trace_id?(t(),i("p",Tt,[a(f,{icon:"fa-solid fa-hashtag",class:"mr-1"}),h(" "+l(e.$t("veo.name.traceId"))+": "+l(e.modelValue?.response?.trace_id)+" ",1),a(E,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):d("",!0)]),_:1})])):d("",!0)])])}const St=b(st,[["render",It],["__scopeId","data-v-912779c9"]]),At=g({name:"RecentPanel",components:{TaskPreview:St,NoTasks:ge,BotPlaceholder:Ie,ScrollList:re},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.veo?.tasks,items:this.$store.state.veo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Ct={key:0},Pt={key:2,class:"w-full h-full flex items-center justify-center"};function Ot(e,o,v,_,k,y){const r=s("bot-placeholder"),u=s("task-preview"),n=s("scroll-list"),V=s("no-tasks");return t(),i(w,null,[e.tasks?.items===void 0?(t(),i("div",Ct,[a(r)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(t(),m(n,{key:1,ref:"scrollList",class:"tasks h-full w-full overflow-y-auto",loading:e.loading,onReachTop:o[0]||(o[0]=T=>e.$emit("reach-top"))},{default:p(()=>[(t(!0),i(w,null,S(e.tasks?.items,(T,f)=>(t(),m(u,{key:f,"model-value":T},null,8,["model-value"]))),128))]),_:1},8,["loading"])):d("",!0),e.tasks?.items?.length===0?(t(),i("div",Pt,[a(V)])):d("",!0)],64)}const Ut=b(At,[["render",Ot]]),Lt=Z("veo"),jt=g({name:"VeoIndex",components:{ConfigPanel:tt,Layout:Ue,RecentPanel:Ut},mixins:[me],inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.veo?.status?.getApplications===R.Request},tasksLoading(){return this.$store.state.veo?.status?.getTasks===R.Request||this.fetchingTasks},credential(){return this.$store.state.veo.credential},config(){return this.$store.state.veo.config},tasks(){return this.$store.state.veo.tasks}},watch:{tasks:{handler(e,o){e?.items?.length>o?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ce({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("veo/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("veo/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:o=5,createdAtMin:v,createdAtMax:_}=e||{};console.debug("limit",o,"createdAtMin",v,"createdAtMax",_),this.fetchingTasks=!0;try{await this.$store.dispatch("veo/getTasks",{limit:o,createdAtMin:v,createdAtMax:_})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!ve(this.uploadTracker,v=>this.$t(v),v=>I.warning(v)))return;const e={...this.config,callback_url:Lt},o=this.credential?.token;if(!o){console.error("no token specified");return}if(e.action==="image2video"&&!(e.image_urls&&e.image_urls.length>0)){I.warning(this.$t("veo.message.imageRequired"));return}(!e.image_urls||e.image_urls.length===0)&&delete e.image_urls,I.info(this.$t("veo.message.startingTask")),Q("veo",W.generate(e,{token:o})).then(()=>{I.success(this.$t("veo.message.startTaskSuccess"))}).catch(v=>{v?.response?.data?.error?.code===ke?I.error(this.$t("veo.message.usedUp")):I.error(this.$t("veo.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Rt(e,o,v,_,k,y){const r=s("config-panel"),u=s("recent-panel"),n=s("layout");return t(),m(n,null,{config:p(()=>[a(r,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:p(()=>[a(u,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Ls=b(jt,[["render",Rt]]);export{Ls as default};