@acedatacloud/nexior 3.133.0 → 3.134.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 (243) hide show
  1. package/dist/assets/{Auth-D_PQo3OB.js → Auth-Bw9xTLPV.js} +1 -1
  2. package/dist/assets/{BotPlaceholder-CnVO8Q0c.js → BotPlaceholder-DVC0W4uX.js} +1 -1
  3. package/dist/assets/{Callback-uDbMIJLQ.js → Callback-B5Lbvi1l.js} +1 -1
  4. package/dist/assets/{Console-yhbXo_Pt.js → Console-BTFo59E3.js} +1 -1
  5. package/dist/assets/{Consumption-BZ1Dt-cb.js → Consumption-CUldncy6.js} +1 -1
  6. package/dist/assets/{Conversation-DJz8BWwR.css → Conversation-yCwB8elG.css} +1 -1
  7. package/dist/assets/{Conversation-CLJjgZv-.js → Conversation-yGIsiKCb.js} +13 -13
  8. package/dist/assets/{CopyToClipboard-Bk4yijTq.js → CopyToClipboard-CPcOPXkP.js} +1 -1
  9. package/dist/assets/{Detail-CC1fRWXu.js → Detail-Dy17GWES.js} +2 -2
  10. package/dist/assets/{EditArray-RF6qw0OK.js → EditArray-BLyOwiwI.js} +1 -1
  11. package/dist/assets/{Extra-Bc6mTiIU.js → Extra-D_P8J7IL.js} +1 -1
  12. package/dist/assets/{FilePreview-BH1OExzV.js → FilePreview-1L8cpcvF.js} +1 -1
  13. package/dist/assets/{History-BqIihhN9.js → History-Bo-bSamF.js} +1 -1
  14. package/dist/assets/{IconPark.vue_vue_type_script_setup_true_lang-B4coH8oj.js → IconPark.vue_vue_type_script_setup_true_lang-R8fOJStw.js} +1 -1
  15. package/dist/assets/{ImagePreview-EH_qYPnG.js → ImagePreview-DANgdSKv.js} +1 -1
  16. package/dist/assets/{ImageWrapper-DmFaZfvA.js → ImageWrapper-CtrC-pbw.js} +1 -1
  17. package/dist/assets/{Index-Bw-DlPNO.js → Index-6-TqJLi2.js} +1 -1
  18. package/dist/assets/{Index-Dd-Ptccy.js → Index-B3YOw_UW.js} +1 -1
  19. package/dist/assets/{Index-BdqP5JU3.js → Index-B9jt_tcN.js} +1 -1
  20. package/dist/assets/{Index-8BXeVA8E.js → Index-BMbQQeU_.js} +1 -1
  21. package/dist/assets/{Index-DGLTKeWr.js → Index-BoqHR3X9.js} +1 -1
  22. package/dist/assets/{Index-Bk-AY3UE.js → Index-BrLN4vW6.js} +1 -1
  23. package/dist/assets/{Index-S818z2HZ.js → Index-Byfhv8nM.js} +1 -1
  24. package/dist/assets/{Index-CMLVj9L_.js → Index-CA_6Keza.js} +1 -1
  25. package/dist/assets/{Index-EeM7Y0ip.js → Index-CBXjiPnC.js} +1 -1
  26. package/dist/assets/{Index-DtDIU2Zk.js → Index-CLd28SmG.js} +1 -1
  27. package/dist/assets/{Index-DFiQxAvx.js → Index-CXnHQbHd.js} +1 -1
  28. package/dist/assets/{Index-DwjZFUXz.js → Index-CXyA2eMF.js} +1 -1
  29. package/dist/assets/{Index-DwzROc15.js → Index-D6I5dIDk.js} +1 -1
  30. package/dist/assets/{Index-H0lL56HN.js → Index-DA1n31m5.js} +1 -1
  31. package/dist/assets/{Index-C_zKHwpA.js → Index-DIWeuq4o.js} +1 -1
  32. package/dist/assets/{Index-DsiZa_Dn.js → Index-DSCtmRu1.js} +1 -1
  33. package/dist/assets/{Index-Byor85ED.js → Index-EGWSx9i3.js} +1 -1
  34. package/dist/assets/{Index-DERo31d3.js → Index-HBJHCcQ3.js} +1 -1
  35. package/dist/assets/{Index-CUO0TLJY.js → Index-HFaWyAIJ.js} +1 -1
  36. package/dist/assets/{Index-BmTEbqZW.js → Index-Jmag-A9-.js} +1 -1
  37. package/dist/assets/{Index-CkkoQqoX.js → Index-cGNDEGQN.js} +1 -1
  38. package/dist/assets/{Index-c6ufU9Hv.js → Index-p0Px9ptI.js} +1 -1
  39. package/dist/assets/{Index-COkW1sEY.js → Index-umWYlRln.js} +1 -1
  40. package/dist/assets/{Index-BOQ-Bd0n.js → Index-zAx6UCzA.js} +1 -1
  41. package/dist/assets/{Invitees-DgLWEOWr.js → Invitees-KvJOgzeP.js} +1 -1
  42. package/dist/assets/{List-D9p4VpuV.js → List-Bi6dLZ3s.js} +1 -1
  43. package/dist/assets/{List-5kRdI7mb.js → List-C6FhCiuu.js} +1 -1
  44. package/dist/assets/{List-BeYnkcuk.js → List-DqF5n-df.js} +1 -1
  45. package/dist/assets/{Main-ir8c_Ea1.js → Main-DeXGhpiA.js} +1 -1
  46. package/dist/assets/{Navigator-CRNnBN3c.js → Navigator-CgqqOPN8.js} +1 -1
  47. package/dist/assets/{NoTasks-B2i1NH2w.js → NoTasks-BafA5FPC.js} +1 -1
  48. package/dist/assets/{NotFound-CtySVegY.js → NotFound-CB61SWMZ.js} +1 -1
  49. package/dist/assets/{OAuthCallback-BJT7oMgU.js → OAuthCallback-BA0zAAOA.js} +1 -1
  50. package/dist/assets/{Pagination-gBd7H-2N.js → Pagination-C_ftOgXn.js} +1 -1
  51. package/dist/assets/{ScrollList-DOuthhHU.js → ScrollList-bxgGqvg5.js} +1 -1
  52. package/dist/assets/{Status-D-BeMN4c.js → Status-CMycWioC.js} +1 -1
  53. package/dist/assets/{Subscribe-D9xyh5K-.js → Subscribe-CsFNQ4ut.js} +1 -1
  54. package/dist/assets/{TransportWebHID-igIdQyG8.js → TransportWebHID-BJAHUyAp.js} +1 -1
  55. package/dist/assets/{VideoPlayer-Drcumi6z.js → VideoPlayer-D_k6XIe_.js} +1 -1
  56. package/dist/assets/{_Uint8Array-CSh_O3rU.js → _Uint8Array-CxCVqXtT.js} +1 -1
  57. package/dist/assets/{_baseClone-D8csUT6N.js → _baseClone-DP9c_05H.js} +1 -1
  58. package/dist/assets/{_baseIteratee-BF_69MFR.js → _baseIteratee-DWaEFucS.js} +1 -1
  59. package/dist/assets/{_initCloneObject-CpKLZJ5e.js → _initCloneObject-CVS8NsJG.js} +1 -1
  60. package/dist/assets/{add-BpMMOcXC.js → add-CdT9v8tT.js} +1 -1
  61. package/dist/assets/{all-wallets-CyAYb74k.js → all-wallets-MZvFreQE.js} +1 -1
  62. package/dist/assets/{app-store-DNTpoWys.js → app-store-DAc38hSo.js} +1 -1
  63. package/dist/assets/{apple-CLy-puWJ.js → apple-DXmTqEX0.js} +1 -1
  64. package/dist/assets/{arrow-bottom-circle-Q75KAHsq.js → arrow-bottom-circle-hW2_Y_cq.js} +1 -1
  65. package/dist/assets/{arrow-bottom-D5M2M9U2.js → arrow-bottom-sUskgQq0.js} +1 -1
  66. package/dist/assets/{arrow-left-BnjdlKOV.js → arrow-left-CSQVqn_B.js} +1 -1
  67. package/dist/assets/{arrow-right-w36cZ5gA.js → arrow-right-BR84S1t9.js} +1 -1
  68. package/dist/assets/{arrow-top-4d2dOg6D.js → arrow-top-CzUboFMw.js} +1 -1
  69. package/dist/assets/{avatar-DaTvPfMJ.js → avatar-D6hW9BcH.js} +1 -1
  70. package/dist/assets/{bank-DIMm9dZ-.js → bank-CATkVwB7.js} +1 -1
  71. package/dist/assets/{basic-CVGf4fST.js → basic-XyKlyifH.js} +1 -1
  72. package/dist/assets/{browser-DHkFW6Eu.js → browser-DDfKlw4r.js} +1 -1
  73. package/dist/assets/{byokCredential-BSSFx8KF.js → byokCredential-BikBxjzN.js} +1 -1
  74. package/dist/assets/{card-Duj6Jb5p.js → card-BCxDZC6T.js} +1 -1
  75. package/dist/assets/{castArray-nEBWukcG.js → castArray-DQxrz7K8.js} +1 -1
  76. package/dist/assets/{chat-C6iDBHOc.js → chat-OBbgqQcJ.js} +1 -1
  77. package/dist/assets/{checkmark-rN-CEwFm.js → checkmark-C8ZR-c-M.js} +1 -1
  78. package/dist/assets/{checkmark-bold-sWv-Fua1.js → checkmark-bold-CAYoJAVL.js} +1 -1
  79. package/dist/assets/{chevron-bottom-BPgHZvwP.js → chevron-bottom-xK8tTApf.js} +1 -1
  80. package/dist/assets/{chevron-left-Cezuh0ZM.js → chevron-left-CfkjlPqh.js} +1 -1
  81. package/dist/assets/{chevron-right-AwpO8EgR.js → chevron-right-D96WOtXX.js} +1 -1
  82. package/dist/assets/{chevron-top-BY_VUNd_.js → chevron-top-Cbaw7gFZ.js} +1 -1
  83. package/dist/assets/{chrome-store-0tDavS-i.js → chrome-store-Dkgv0IV1.js} +1 -1
  84. package/dist/assets/{clock-DIhrdFcu.js → clock-B_roetvV.js} +1 -1
  85. package/dist/assets/{close-DoozPnbx.js → close-CMfLH9NA.js} +1 -1
  86. package/dist/assets/{coinPlaceholder-Cp7zimi2.js → coinPlaceholder-DP7qeBEO.js} +1 -1
  87. package/dist/assets/{compass-Ibeuoe39.js → compass-B9wyFQZJ.js} +1 -1
  88. package/dist/assets/{copy-CavTCGwB.js → copy-BRMIj7tU.js} +1 -1
  89. package/dist/assets/{cursor-39l7Oiko.js → cursor-CHQWX3uv.js} +1 -1
  90. package/dist/assets/{cursor-transparent-BuSdXNGF.js → cursor-transparent-BFRknEPv.js} +1 -1
  91. package/dist/assets/{debounce-Dl6XTDwu.js → debounce-CGEoxqi1.js} +1 -1
  92. package/dist/assets/{desktop-DBlEpOYX.js → desktop-DRbqb-JO.js} +1 -1
  93. package/dist/assets/{disconnect-CyhOTJ9I.js → disconnect-BLT87XlT.js} +1 -1
  94. package/dist/assets/{discord-C2v6XtK_.js → discord-DF6Lsv5n.js} +1 -1
  95. package/dist/assets/{distribution-BS35coMM.js → distribution-DCvILUzy.js} +1 -1
  96. package/dist/assets/{dropdown-Du5Iy241.js → dropdown-ByS1CyHI.js} +1 -1
  97. package/dist/assets/{etherscan-CwfMKo9Y.js → etherscan-DCfvKQj6.js} +1 -1
  98. package/dist/assets/{exclamation-triangle-B99hxffE.js → exclamation-triangle-DimFS2Op.js} +1 -1
  99. package/dist/assets/{extension-DbGlqdlB.js → extension-uwZT7WvO.js} +1 -1
  100. package/dist/assets/{external-link-afBgepM7.js → external-link-c3JDHrGT.js} +1 -1
  101. package/dist/assets/{facebook-DJXaCsSW.js → facebook-BuBP9ZqR.js} +1 -1
  102. package/dist/assets/{farcaster-DA48mZEi.js → farcaster-1gl21Sav.js} +1 -1
  103. package/dist/assets/{filters-BBRn7ZBv.js → filters-Bajl3VTI.js} +1 -1
  104. package/dist/assets/{flux-CHkTiZ5b.js → flux-CrxplCtJ.js} +1 -1
  105. package/dist/assets/{github-B5lLy4Sm.js → github-Xm4gVEfg.js} +1 -1
  106. package/dist/assets/{google-C_ByEhQO.js → google-gGatAi0b.js} +1 -1
  107. package/dist/assets/{hailuo-DRUUz0PJ.js → hailuo-C--tiM8-.js} +1 -1
  108. package/dist/assets/{headshots-DDU7mUCR.js → headshots-CWX84Lvn.js} +1 -1
  109. package/dist/assets/{help-circle-B0tnjbH3.js → help-circle-C63Zh4PA.js} +1 -1
  110. package/dist/assets/{id-D5pkXkR2.js → id-B8wKPa-c.js} +1 -1
  111. package/dist/assets/{image-CSp6LMAi.js → image-BF_V7b7F.js} +1 -1
  112. package/dist/assets/{index-XuSy-t1G.js → index-3CkB10jt.js} +1 -1
  113. package/dist/assets/{index-CoOKzE4H.js → index-4UBoy_LI.js} +1 -1
  114. package/dist/assets/{index-Cn6louGt.js → index-7E_dl5ji.js} +6 -6
  115. package/dist/assets/{index-C5OZLrMF.js → index-9E31E00G.js} +1 -1
  116. package/dist/assets/{index-ie7tfEpI.js → index-B-7Sz7PX.js} +1 -1
  117. package/dist/assets/{index-pbL6e1hu.js → index-BBvtDo3a.js} +1 -1
  118. package/dist/assets/{index-BrkgdX_b.js → index-Bf9PIvnp.js} +1 -1
  119. package/dist/assets/{index-CaKJDuty.js → index-BghS-OLU.js} +1 -1
  120. package/dist/assets/{index-BZ-a_TeQ.js → index-BnIOBf_i.js} +1 -1
  121. package/dist/assets/{index-DOfQ5YQ4.js → index-Bofg95i1.js} +1 -1
  122. package/dist/assets/{index-Cy8X9G-e.js → index-Bogk4XJ6.js} +1 -1
  123. package/dist/assets/{index-D6yaKf0M.js → index-BrqLdzQB.js} +1 -1
  124. package/dist/assets/{index-Dc4hCp__.js → index-Bs58BkYp.js} +1 -1
  125. package/dist/assets/{index-BbsAVOZ_.js → index-By9oGU4E.js} +1 -1
  126. package/dist/assets/{index-DX-J6pr9.js → index-C-YyEjOK.js} +1 -1
  127. package/dist/assets/{index-DAct0mPZ.js → index-C0IZp5MX.js} +1 -1
  128. package/dist/assets/{index-DjwU9rTk.js → index-C0_EBvFj.js} +1 -1
  129. package/dist/assets/{index-D5Aqu4VK.js → index-C1zD7SJm.js} +1 -1
  130. package/dist/assets/{index-Ypw-t9F1.js → index-C96Gkhlw.js} +1 -1
  131. package/dist/assets/{index-EyAMvVts.js → index-CF5yTOfX.js} +1 -1
  132. package/dist/assets/{index-8yxsLBlz.js → index-CLDCbnoB.js} +1 -1
  133. package/dist/assets/{index-DB4Jz6wI.js → index-CODffKRB.js} +1 -1
  134. package/dist/assets/{index-T_HQcBMo.js → index-CYdF5zpB.js} +1 -1
  135. package/dist/assets/{index-BknwM9e8.js → index-CfI_vFdq.js} +1 -1
  136. package/dist/assets/{index-BLA_euBS.js → index-Cjs9Ygxu.js} +3 -3
  137. package/dist/assets/{index-OtQqw6QH.js → index-Ck2tnvcw.js} +1 -1
  138. package/dist/assets/{index-8EIv1asn.js → index-Cpscb1z9.js} +1 -1
  139. package/dist/assets/{index-Ia3tM0sZ.js → index-CthC0a0-.js} +1 -1
  140. package/dist/assets/{index-B4JEX6XV.js → index-CvgWqPkt.js} +1 -1
  141. package/dist/assets/{index-Cj-I7nKv.js → index-CziNXcax.js} +1 -1
  142. package/dist/assets/{index-8qPoVxw-.js → index-D01BPZ57.js} +1 -1
  143. package/dist/assets/{index-BrSKG7L1.js → index-D37M_pau.js} +1 -1
  144. package/dist/assets/{index-s_Q5UTE5.js → index-D8OgWJz0.js} +1 -1
  145. package/dist/assets/{index-DahfzQyk.js → index-DFaRNuuL.js} +1 -1
  146. package/dist/assets/{index-Cqa19Hxj.js → index-DMFnc2_t.js} +1 -1
  147. package/dist/assets/{index-BIBCqdUL.js → index-DPHfUUNn.js} +1 -1
  148. package/dist/assets/{index-CAbAJyFr.js → index-DUfT-ToC.js} +1 -1
  149. package/dist/assets/{index-DSQGgBKS.js → index-DUq0-4-2.js} +1 -1
  150. package/dist/assets/{index-TiNuwe__.js → index-DUz8Abwn.js} +1 -1
  151. package/dist/assets/{index-CHwCwaSW.js → index-DVPAiU59.js} +1 -1
  152. package/dist/assets/{index-BzAnjQcm.js → index-DgV4aL02.js} +1 -1
  153. package/dist/assets/{index-qubKta0-.js → index-Dh5g13xz.js} +1 -1
  154. package/dist/assets/{index-BrKPHVRd.js → index-Di87bERu.js} +1 -1
  155. package/dist/assets/{index-BQUmbWLp.js → index-Dn_CcntF.js} +1 -1
  156. package/dist/assets/{index-DycDJ2eZ.js → index-DpY-yQlz.js} +1 -1
  157. package/dist/assets/{index-Dkxi8Dfe.js → index-DqQE5t_f.js} +1 -1
  158. package/dist/assets/{index-D74kR9sB.js → index-DsXIVBQ0.js} +1 -1
  159. package/dist/assets/{index-l5-GT16I.js → index-DxH7_hDr.js} +1 -1
  160. package/dist/assets/{index-CkWN8ARZ.js → index-GeU0AnOU.js} +1 -1
  161. package/dist/assets/{index-C0r786G6.js → index-HQXOjs5W.js} +1 -1
  162. package/dist/assets/{index-xCG3aIBW.js → index-PzNhCjB3.js} +1 -1
  163. package/dist/assets/{index-CyaMdQDB.js → index-SzGWmBzk.js} +1 -1
  164. package/dist/assets/{index-DgEWXc7S.js → index-Yn8SZsAZ.js} +1 -1
  165. package/dist/assets/{index-oKrQnFx2.js → index-frKXGuoS.js} +1 -1
  166. package/dist/assets/{index-C0eB8IYR.js → index-gP6loNIt.js} +1 -1
  167. package/dist/assets/{index-DqImj4-b.js → index-gZqSePZ-.js} +1 -1
  168. package/dist/assets/{index-CjN_qE03.js → index-m6YTFcbo.js} +1 -1
  169. package/dist/assets/{index-CLjidAQE.js → index-ma8m8GLT.js} +1 -1
  170. package/dist/assets/{index-I7DQxl3L.js → index-tvJhcyip.js} +1 -1
  171. package/dist/assets/{index-BSs7ivqw.js → index-uG0cmkeI.js} +1 -1
  172. package/dist/assets/{index-BTlYBKez.js → index-uaiBAFRV.js} +1 -1
  173. package/dist/assets/{index-C_v1q0BD.js → index-zbbUR5es.js} +3 -3
  174. package/dist/assets/{index.browser.esm-CNdSg4Tx.js → index.browser.esm-CRnku21i.js} +1 -1
  175. package/dist/assets/{index.es-B8lllT8g.js → index.es-sH5Gh1j5.js} +1 -1
  176. package/dist/assets/{info-BCWWeFA4.js → info-CK2NlgLt.js} +1 -1
  177. package/dist/assets/{info-circle-BeZ9KHAv.js → info-circle-Bz7Ii06J.js} +1 -1
  178. package/dist/assets/{isEqual-C0Ho5H9R.js → isEqual-Bvy1Dbnl.js} +1 -1
  179. package/dist/assets/{isPlainObject-B_gEE3Vh.js → isPlainObject-kyM8sY1X.js} +1 -1
  180. package/dist/assets/{kling-BFjW7ZT6.js → kling-C4euvnyB.js} +1 -1
  181. package/dist/assets/{lightbulb-Dv03tHZX.js → lightbulb-Du3BydpL.js} +1 -1
  182. package/dist/assets/{luma-DK9RELzx.js → luma-CHMiplBw.js} +1 -1
  183. package/dist/assets/{mail-WVkkdKYK.js → mail-ZHeb-V3u.js} +1 -1
  184. package/dist/assets/{midjourney-BmuSrUHL.js → midjourney-BSXd4xvW.js} +1 -1
  185. package/dist/assets/{mobile-gnEN565F.js → mobile-BMMJZHPq.js} +1 -1
  186. package/dist/assets/{more-BD6G5Pv7.js → more-CLwIaAqO.js} +1 -1
  187. package/dist/assets/{nanobanana-CiI-hQ2s.js → nanobanana-CNhMV2Y_.js} +1 -1
  188. package/dist/assets/{network-placeholder-DCRfH7oh.js → network-placeholder-CngWDBel.js} +1 -1
  189. package/dist/assets/{nftPlaceholder-Tpg-xNAX.js → nftPlaceholder-OkubI9MP.js} +1 -1
  190. package/dist/assets/{off-BYDPjMuX.js → off-DnqOy-tT.js} +1 -1
  191. package/dist/assets/{openaiimage-BH2JDAOx.js → openaiimage-CZOKH8jX.js} +1 -1
  192. package/dist/assets/{order-GHku66Y8.js → order-Hqblb_Kw.js} +1 -1
  193. package/dist/assets/{pika-CKWyNORo.js → pika-CNBpPnOh.js} +1 -1
  194. package/dist/assets/{pixverse-CGl7IeE_.js → pixverse-ygFElX-y.js} +1 -1
  195. package/dist/assets/{play-store-BzpIqOfq.js → play-store-CIw_xtfn.js} +1 -1
  196. package/dist/assets/{plus-C7iooNS7.js → plus-F5KSEUyK.js} +1 -1
  197. package/dist/assets/{price-DCHXyooY.js → price-ZnUNDmOU.js} +1 -1
  198. package/dist/assets/{producer-DWIRLCIH.js → producer-_0CXWQQ3.js} +1 -1
  199. package/dist/assets/{qr-code-DMpIeTHv.js → qr-code-CNDqR5PB.js} +1 -1
  200. package/dist/assets/{qrart-CE0UBHm5.js → qrart-CnF0wll_.js} +1 -1
  201. package/dist/assets/{recycle-horizontal-C02utwRw.js → recycle-horizontal-g53_cDXc.js} +1 -1
  202. package/dist/assets/{refresh-Br9oR-07.js → refresh-CsbJ3Bj_.js} +1 -1
  203. package/dist/assets/{reown-logo-BW5a7b2_.js → reown-logo-Dv60MuXo.js} +1 -1
  204. package/dist/assets/{search-CoMO6uFv.js → search-iD-TihWI.js} +1 -1
  205. package/dist/assets/{secp256k1-BWMmh9tt.js → secp256k1-DBiwGckU.js} +1 -1
  206. package/dist/assets/{secp256k1-DwIDKrPb.js → secp256k1-x-tlFSvG.js} +1 -1
  207. package/dist/assets/{seedance-BQnLKG37.js → seedance-Be_8L1gy.js} +1 -1
  208. package/dist/assets/{seedream-BGm0jO7p.js → seedream-BMe8Cyll.js} +1 -1
  209. package/dist/assets/{send-2Q85SwfA.js → send-D8LqQ7DL.js} +1 -1
  210. package/dist/assets/{service-D58FXJb3.js → service-DhGTU1uC.js} +1 -1
  211. package/dist/assets/{solana-wallets-1MeOAlar.js → solana-wallets-CTdFYadg.js} +2 -2
  212. package/dist/assets/{solana-wallets-vue-DAv6XM0Z.js → solana-wallets-vue-D_02kcCW.js} +1 -1
  213. package/dist/assets/{solanaEmbed.esm-w57MHImb.js → solanaEmbed.esm-D-zSGzos.js} +1 -1
  214. package/dist/assets/{sora-BzcHSWt4.js → sora-CY8ULPDt.js} +1 -1
  215. package/dist/assets/{string_decoder-CzB0poUD.js → string_decoder-JoWwAuv9.js} +1 -1
  216. package/dist/assets/{suno-BAOHSLNl.js → suno-byn1Xq0O.js} +1 -1
  217. package/dist/assets/{swapHorizontal-Cp8bbrgY.js → swapHorizontal-iLQeI2vB.js} +1 -1
  218. package/dist/assets/{swapHorizontalBold-2dywLQQW.js → swapHorizontalBold-DpInXg2J.js} +1 -1
  219. package/dist/assets/{swapHorizontalMedium-RvI_dhHX.js → swapHorizontalMedium-N6bFKPkr.js} +1 -1
  220. package/dist/assets/{swapHorizontalRoundedBold-Cr2d9SWf.js → swapHorizontalRoundedBold-C7HRgWOd.js} +1 -1
  221. package/dist/assets/{swapVertical-BE140RXt.js → swapVertical-IUVRpC4j.js} +1 -1
  222. package/dist/assets/{telegram-DbdztOFH.js → telegram-CkYISoiY.js} +1 -1
  223. package/dist/assets/{three-dots-BQii4rAg.js → three-dots-CNRSSGHw.js} +1 -1
  224. package/dist/assets/{twitch-D9BepX7I.js → twitch-Co1w6t9k.js} +1 -1
  225. package/dist/assets/{twitterIcon-4GQ22ehP.js → twitterIcon-Bb1m3rEP.js} +1 -1
  226. package/dist/assets/{typescript-BUlvNdio.js → typescript-DgSJWeBe.js} +1 -1
  227. package/dist/assets/{use-form-item-C6oldTyX.js → use-form-item-DsrOsrL-.js} +1 -1
  228. package/dist/assets/validator-DkCt-_lu.js +1 -0
  229. package/dist/assets/{veo-CG-nx9Km.js → veo-CBc3CovE.js} +1 -1
  230. package/dist/assets/{verify-CoMjUtCA.js → verify-CnMQcVL0.js} +1 -1
  231. package/dist/assets/{verify-filled-CNaddT7H.js → verify-filled-BbmSuxTk.js} +1 -1
  232. package/dist/assets/{w3m-modal-Dvm2fd9C.js → w3m-modal-DBcgmtvx.js} +1 -1
  233. package/dist/assets/{wallet-Q4khLJ_g.js → wallet-CsG3G1Cy.js} +1 -1
  234. package/dist/assets/{wallet-placeholder-DUqcM23N.js → wallet-placeholder-1rMhf2Kk.js} +1 -1
  235. package/dist/assets/{walletconnect-DsrSpGL5.js → walletconnect-CdUiGKbO.js} +1 -1
  236. package/dist/assets/{wan-BV11cKlJ.js → wan-D88y51ht.js} +1 -1
  237. package/dist/assets/{warning-circle-DF6UJJOn.js → warning-circle-BzuB9oP7.js} +1 -1
  238. package/dist/assets/{web-CHNPi9SJ.js → web-CL2RE4K-.js} +1 -1
  239. package/dist/assets/{web-HF8FzLeI.js → web-Z5eqpP5Z.js} +1 -1
  240. package/dist/assets/{x-CraUbBKG.js → x-B04hTbku.js} +1 -1
  241. package/dist/index.html +1 -1
  242. package/package.json +1 -1
  243. package/dist/assets/validator-DT1fLCG4.js +0 -1
@@ -1 +1 @@
1
- import{F as E}from"./index.es-B8lllT8g.js";import{E as L}from"./index-CLjidAQE.js";import{E as me}from"./index-BQUmbWLp.js";import{d as b,H as m,E as i,z as j,C as n,y as h,D as o,q as l,F as r,x as V,O as T,N as I,Q as R,J as k,R as ye,I as w,M as we}from"./vendor-vue-NSDaktjZ.js";import{E as y,b7 as A,a0 as Ce,F as Ve,cd as te,aw as oe}from"./index-C_v1q0BD.js";import{b as Se,c as ne,d as F,e as N,f as Te,g as Ie,h as Ee}from"./kling-CtoPhhA9.js";import{E as P,a as D}from"./index-DqImj4-b.js";import{E as q}from"./index-CaKJDuty.js";import{E as C}from"./index-BrkgdX_b.js";import{I as S,S as Le}from"./ScrollList-DOuthhHU.js";import{E as H}from"./index-DjwU9rTk.js";import{p as W}from"./pasteUploadMixin-BurWbGNQ.js";import{I as G}from"./ImagePreview-EH_qYPnG.js";import{E as J}from"./index-Dkxi8Dfe.js";import{E as K}from"./index-D74kR9sB.js";import{C as pe}from"./Consumption-BZ1Dt-cb.js";import{E as ue}from"./index-qubKta0-.js";import{E as ge}from"./index-BIBCqdUL.js";import{E as Q}from"./index-pbL6e1hu.js";import{a as fe}from"./price-DCHXyooY.js";import{F as Me}from"./FilePreview-BH1OExzV.js";import{E as Ue,a as Re}from"./index-BrSKG7L1.js";import{E as Ae,a as Pe}from"./index-l5-GT16I.js";import{b as se}from"./errorCode-Cqj9Td_Z.js";import{k as ie}from"./kling-BFjW7ZT6.js";import{C as De}from"./CopyToClipboard-Bk4yijTq.js";import{V as Ge}from"./VideoPlayer-Drcumi6z.js";import{E as Ke}from"./index-DX-J6pr9.js";import{E as Oe}from"./index-Ypw-t9F1.js";import{B as je}from"./BotPlaceholder-CnVO8Q0c.js";import{N as Ne}from"./NoTasks-B2i1NH2w.js";import{l as Be}from"./pagination-Cnc6Oeyx.js";import"./use-form-item-C6oldTyX.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-Cvgzdobq.js";import"./vendor-vue-router-Kg6s1a65.js";import"./index-xCG3aIBW.js";import"./typescript-BUlvNdio.js";import"./index-Ia3tM0sZ.js";import"./strings-beZM2Y-f.js";import"./isEqual-C0Ho5H9R.js";import"./_Uint8Array-CSh_O3rU.js";import"./castArray-nEBWukcG.js";import"./debounce-Dl6XTDwu.js";import"./_baseIteratee-BF_69MFR.js";import"./index-Dc4hCp__.js";import"./validator-DT1fLCG4.js";import"./index-CoOKzE4H.js";import"./_baseClone-D8csUT6N.js";import"./_initCloneObject-CpKLZJ5e.js";import"./index-Cu41y2Fl.js";import"./index-BTlYBKez.js";import"./isPlainObject-B_gEE3Vh.js";import"./vue-plyr-BO2nlN4c.js";import"./index-C5OZLrMF.js";const ze=b({name:"LayoutKling",components:{ElDrawer:me,ElButton:L,FontAwesomeIcon:E},data(){return{drawer:!1}}}),Fe={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)]"},He={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function We(e,t,s,a,u,$){const c=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),m("div",Fe,[i("div",qe,[j(e.$slots,"config",{},void 0,!0)]),i("div",He,[j(e.$slots,"result",{},void 0,!0)]),n(p,{circle:"",class:"menu",onClick:t[0]||(t[0]=d=>e.drawer=!0)},{default:h(()=>[n(c,{icon:"fa-solid fa-magic"})]),_:1}),n(f,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=d=>e.drawer=d),direction:"ltr","with-header":!1,size:"350px"},{default:h(()=>[j(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Je=y(ze,[["render",We],["__scopeId","data-v-8fa7523c"]]),Qe={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function he(e,t,s){const a=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:a==="pro",audio:!1,motionControl:!1};case"kling-v2-6":return{text2video:!0,image2video:!0,endImage:a==="pro",audio:a==="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:a!=="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 Qe}}function Y(e,t){if(!e)return[];const s=t.model??e.model,a=t.mode??e.mode,u=t.duration??e.duration;if(!s)return[];const $=he(s,a,u),c=[];return e.end_image_url&&!$.endImage&&c.push({field:"end_image_url",i18nLabel:"kling.name.endImage"}),e.generate_audio&&!$.audio&&c.push({field:"generate_audio",i18nLabel:"kling.name.generateAudio"}),e.camera_control?.type&&!$.motionControl&&c.push({field:"camera_control",i18nLabel:"kling.name.cameraControl"}),c}function X(e,t){const s={...e};for(const a of t)a.field==="end_image_url"&&(s.end_image_url=void 0),a.field==="generate_audio"&&(s.generate_audio=!1),a.field==="camera_control"&&(s.camera_control=void 0);return s}const Ye=b({name:"ModelSelector",components:{ElSelect:D,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(Se)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Y(t,{model:e});if(s.length===0){this.applyModel(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=X({...t,model:e},s);this.$store.commit("kling/setConfig",u),C.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,model:e})}}}),Xe={class:"field"},Ze={class:"title font-bold"};function xe(e,t,s,a,u,$){const c=o("el-option"),p=o("el-select");return l(),m("div",Xe,[i("h2",Ze,r(e.$t("pika.name.model")),1),(l(),V(p,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("pika.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),m(T,null,I(e.options,f=>(l(),V(c,{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const et=y(Ye,[["render",xe],["__scopeId","data-v-04059875"]]),tt=b({name:"ModeSelector",components:{ElSelect:D,ElOption:P,InfoIcon:S},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},cameraControlSet(){return!!this.$store.state.kling?.config?.camera_control?.type},fourKReason(){return F.includes(this.selectedModel)?this.cameraControlSet?this.$t("kling.description.mode4kIncompatibleCamera"):"":this.$t("kling.description.mode4kRequiresV3")},options(){return[{value:"std",label:this.$t("kling.name.modeStd"),disabled:!1,disabledReason:""},{value:"pro",label:this.$t("kling.name.modePro"),disabled:!1,disabledReason:""},{value:"4k",label:this.$t("kling.name.mode4k"),disabled:!!this.fourKReason,disabledReason:this.fourKReason}]},value(){return this.$store.state.kling?.config?.mode}},watch:{fourKReason(e){e&&this.value==="4k"&&this.applyMode(ne)}},mounted(){this.value||this.applyMode(ne)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Y(t,{mode:e});if(s.length===0){this.applyMode(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=X({...t,mode:e},s);this.$store.commit("kling/setConfig",u),C.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyMode(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,mode:e})}}}),ot={class:"field"},nt={class:"header"},st={class:"title font-bold"},it={key:0,class:"opt-tip"};function lt(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),m("div",ot,[i("div",nt,[i("h2",st,r(e.$t("kling.name.mode")),1),n(c,{content:e.$t("kling.description.mode"),class:"info-icon"},null,8,["content"])]),(l(),V(f,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("kling.placeholder.select"),clearable:!0,onChange:e.onChange},{default:h(()=>[(l(!0),m(T,null,I(e.options,d=>(l(),V(p,{key:d.value,label:d.label,value:d.value,disabled:d.disabled},{default:h(()=>[i("span",{class:R({"opt-disabled":d.disabled})},r(d.label),3),d.disabled&&d.disabledReason?(l(),m("span",it,r(d.disabledReason),1)):k("",!0)]),_:2},1032,["label","value","disabled"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const at=y(tt,[["render",lt],["__scopeId","data-v-9a8fa3c5"]]),le=[3,5,8,10,12,15],ae=[5,10],rt=b({name:"DurationSelector",components:{ElSlider:H,InfoIcon:S},props:{modelValue:{type:Number,default:void 0}},emits:["update:modelValue"],data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},isV3Model(){return F.includes(this.selectedModel)},sliderMin(){return this.isV3Model?3:5},sliderMax(){return this.isV3Model?15:10},sliderStep(){return this.isV3Model?1:5},marks(){const e=this.isV3Model?le:ae,t={};for(const s of e)t[s]=`${s}s`;return t},value(){return this.$store.state.kling?.config?.duration??N},sliderValue(){const e=this.value;return e<this.sliderMin?this.sliderMin:e>this.sliderMax?this.sliderMax:e}},watch:{isV3Model(e){(this.isV3Model?le:ae).includes(this.value)||this.applyDuration(N)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(N)},methods:{async onChange(e){const t=Array.isArray(e)?e[0]:e,s=this.$store.state.kling?.config||{},a=Y(s,{duration:t});if(a.length===0){this.applyDuration(t);return}const u=a.map($=>this.$t($.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:u}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const $=X({...s,duration:t},a);this.$store.commit("kling/setConfig",$),C.success(this.$t("kling.message.featureRemovedNotice",{fields:u}))}catch{this.revertKey+=1}},applyDuration(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,duration:e})}}}),ct={class:"field"},dt={class:"header"},mt={class:"title font-bold"},pt={class:"value-display"};function ut(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-slider");return l(),m("div",ct,[i("div",dt,[i("h2",mt,r(e.$t("kling.name.duration")),1),n(c,{content:e.$t("kling.description.duration"),class:"info-icon ml-1"},null,8,["content"]),i("span",pt,r(e.value)+"s",1)]),(l(),V(p,{key:e.revertKey,"model-value":e.sliderValue,class:"slider",min:e.sliderMin,max:e.sliderMax,step:e.sliderStep,marks:e.marks,"show-tooltip":!1,onChange:e.onChange},null,8,["model-value","min","max","step","marks","onChange"]))])}const gt=y(rt,[["render",ut],["__scopeId","data-v-aa1a22a1"]]),ft=b({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)}}),ht={class:"text-sm font-bold mb-2 block"},_t={class:"items"},$t=["onClick"],vt={class:"name"};function kt(e,t,s,a,u,$){return l(),m("div",null,[i("span",ht,r(e.$t("kling.name.ratio")),1),i("div",_t,[(l(!0),m(T,null,I(e.options,(c,p)=>(l(),m("div",{key:p,class:R({active:e.active===p,item:!0}),onClick:f=>e.value=c.value},[i("div",{class:R(["preview",c.label])},[i("div",{class:"rect",style:ye({width:c.width+"px",height:c.height+"px"})},null,4)],2),i("p",vt,r(c.label),1)],10,$t))),128))])])}const bt=y(ft,[["render",kt],["__scopeId","data-v-cdb14b2f"]]),yt=b({name:"StartImage",components:{ElUpload:K,ElButton:L,ElTooltip:J,InfoIcon:S,FontAwesomeIcon:E,ImagePreview:G},mixins:[W],emits:["change"],data(){return{fileList:[],uploadUrl:A()+"/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(){C.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){C.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()}}}),wt={class:"relative"},Ct={class:"flex justify-between"},Vt={class:"flex justify-start items-center"},St={class:"text-sm font-bold"};function Tt(e,t,s,a,u,$){const c=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),d=o("el-button"),v=o("el-tooltip"),g=o("el-upload");return l(),m("div",wt,[i("div",Ct,[i("div",Vt,[i("span",St,r(e.$t("kling.name.startImage")),1),n(c,{content:e.$t("kling.description.uploadStartImage")},null,8,["content"])])]),n(g,{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:h(({file:_})=>[_.url&&_.percentage!==void 0?(l(),V(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(v,{content:e.$t("kling.message.uploadReferencesExceed"),disabled:!e.reachedLimit,placement:"top"},{default:h(()=>[i("span",null,[n(d,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.reachedLimit},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+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 It=y(yt,[["render",Tt],["__scopeId","data-v-40832274"]]),Et=b({name:"EndImage",components:{ElUpload:K,ElButton:L,ElTooltip:J,ImagePreview:G,InfoIcon:S,FontAwesomeIcon:E},mixins:[W],data(){return{fileList:[],uploadUrl:A()+"/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 he(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},uploadDisabled(){return this.reachedLimit||!this.endImageSupported},uploadTooltip(){return this.endImageSupported?this.reachedLimit?this.$t("kling.message.uploadReferencesExceed"):"":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=[])}},mounted(){this.value||(this.value=void 0),this.onSetEndImageUrl()},methods:{onBeforeUpload(){return this.endImageSupported?!0:(C.warning(this.$t("kling.message.endImageNotSupported")),!1)},onExceed(){C.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){C.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()}}}),Lt={class:"relative"},Mt={class:"flex justify-between"},Ut={class:"flex justify-start items-center"},Rt={class:"text-sm font-bold"};function At(e,t,s,a,u,$){const c=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),d=o("el-button"),v=o("el-tooltip"),g=o("el-upload");return l(),m("div",Lt,[i("div",Mt,[i("div",Ut,[i("span",Rt,r(e.$t("kling.name.endImage")),1),n(c,{content:e.$t("kling.description.uploadEndImage")},null,8,["content"])])]),n(g,{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:h(({file:_})=>[_.url&&_.percentage!==void 0?(l(),V(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(v,{content:e.uploadTooltip,disabled:!e.uploadDisabled,placement:"top"},{default:h(()=>[i("span",null,[n(d,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.uploadDisabled},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+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 Pt=y(Et,[["render",At],["__scopeId","data-v-6959ad44"]]),Dt=b({name:"CfgScaleSelector",components:{ElSlider:H,InfoIcon:S,ElInputNumber:ue},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=Ie)}}),Gt={class:"flex justify-between"},Kt={class:"flex justify-start items-center"},Ot={class:"text-sm font-bold"},jt={class:"flex justify-end items-center"},Nt={class:"w-full"};function Bt(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-input-number"),f=o("el-slider");return l(),m("div",null,[i("div",Gt,[i("div",Kt,[i("span",Ot,r(e.$t("kling.name.cfgScale")),1),n(c,{content:e.$t("kling.description.cfgScale")},null,8,["content"])]),i("div",jt,[n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),"controls-position":"right"},null,8,["modelValue"])])]),i("div",Nt,[n(f,{modelValue:e.value,"onUpdate:modelValue":t[1]||(t[1]=d=>e.value=d),min:0,max:1,step:.1},null,8,["modelValue"])])])}const zt=y(Dt,[["render",Bt]]),Ft=b({name:"GenerateAudioSelector",components:{ElSwitch:ge,InfoIcon:S},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},selectedMode(){return this.$store.state.kling?.config?.mode||""},supported(){return!!(F.includes(this.selectedModel)||this.selectedModel==="kling-v2-6"&&this.selectedMode==="pro")},tooltipContent(){return this.supported?this.$t("kling.description.generateAudio"):this.$t("kling.description.generateAudioUnsupported")},value:{get(){return this.supported?this.$store.state.kling?.config?.generate_audio??Ee:!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})}}}),qt={class:"relative"},Ht={class:"flex justify-between items-center"},Wt={class:"flex justify-start items-center"},Jt={class:"text-sm font-bold"};function Qt(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-switch");return l(),m("div",qt,[i("div",Ht,[i("div",Wt,[i("span",Jt,r(e.$t("kling.name.generateAudio")),1),n(c,{content:e.tooltipContent},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=f=>e.value=f),class:"value",disabled:!e.supported},null,8,["modelValue","disabled"])])])}const Yt=y(Ft,[["render",Qt]]),Xt=["horizontal","vertical","pan","tilt","roll","zoom"],Zt=b({name:"CameraControlSelector",components:{ElSelect:D,ElOption:P,ElSlider:H,ElInputNumber:ue,InfoIcon:S},data(){return{configKeys:Xt}},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||""},disabled(){return this.selectedMode==="4k"},tooltipContent(){return this.disabled?this.$t("kling.description.cameraControlDisabled4k"):this.$t("kling.description.cameraControl")},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 a={...t};delete a.camera_control,this.$store.commit("kling/setConfig",a);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||{},a=s.camera_control||{type:"simple"},u={...a.config||{}};t==null?delete u[e]:u[e]=t,this.$store.commit("kling/setConfig",{...s,camera_control:{...a,type:"simple",config:u}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),xt={class:"field"},eo={class:"header"},to={class:"text-sm font-bold"},oo={key:0,class:"config-grid"},no={class:"cfg-row-head"},so={class:"cfg-name"};function io(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-option"),f=o("el-select"),d=o("el-input-number"),v=o("el-slider");return l(),m("div",xt,[i("div",eo,[i("span",to,r(e.$t("kling.name.cameraControl")),1),n(c,{content:e.tooltipContent},null,8,["content"])]),n(f,{modelValue:e.selectedTypeRaw,"onUpdate:modelValue":t[0]||(t[0]=g=>e.selectedTypeRaw=g),class:"value",placeholder:e.$t("kling.placeholder.cameraType"),clearable:!0,disabled:e.disabled},{default:h(()=>[(l(!0),m(T,null,I(e.typeOptions,g=>(l(),V(p,{key:g.value,label:g.label,value:g.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","disabled"]),e.selectedType==="simple"&&!e.disabled?(l(),m("div",oo,[(l(!0),m(T,null,I(e.configKeys,g=>(l(),m("div",{key:g,class:"cfg-row"},[i("div",no,[i("span",so,r(e.$t(`kling.name.cc_${g}`)),1),n(d,{modelValue:e.configValues[g],"onUpdate:modelValue":_=>e.configValues[g]=_,min:-1,max:1,step:.1,precision:1,"controls-position":"right",size:"small",class:"cfg-num",onChange:_=>e.onNumberChange(g,_)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),n(v,{"model-value":e.configValues[g]??0,min:-1,max:1,step:.1,onInput:_=>e.onSliderChange(g,_)},null,8,["model-value","onInput"])]))),128))])):k("",!0)])}const lo=y(Zt,[["render",io],["__scopeId","data-v-fb7b34d0"]]),_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"]}],B=", ";function ao(e,t){const s=(e||"").trim();return s?s.includes(t)?s:`${s}${B}${t}`:t}function z(e,t){if(!e||!t)return e||"";const s=[`${t}${B}`,`${B}${t}`,t];let a=e;for(const u of s)if(a.includes(u)){a=a.replace(u,"");break}return a.replace(/(?:,\s*)+$/,"").replace(/^(?:,\s*)+/,"")}const ro=b({name:"InspirationPills",components:{FontAwesomeIcon:E},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 a=e.indexOf(s);a!==-1&&t.push({text:s,idx:a})}return t.sort((s,a)=>s.idx-a.idx).map(s=>s.text)}},methods:{onRemove(e){const t=z(this.prompt,e);this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:t})}}}),co={key:0,class:"pills",role:"list"},mo={class:"pill-text"},po=["aria-label","onClick"];function uo(e,t,s,a,u,$){const c=o("font-awesome-icon");return e.selected.length>0?(l(),m("div",co,[(l(!0),m(T,null,I(e.selected,p=>(l(),m("div",{key:p,class:"pill",role:"listitem"},[i("span",mo,r(p),1),i("button",{type:"button",class:"pill-remove","aria-label":e.$t("kling.inspiration.removeChip"),onClick:we(f=>e.onRemove(p),["stop"])},[n(c,{icon:"fa-solid fa-xmark"})],8,po)]))),128))])):k("",!0)}const go=y(ro,[["render",uo],["__scopeId","data-v-5fc4fa65"]]),fo="",ho=b({name:"PromptInput",components:{ElInput:Q,ElButton:L,FontAwesomeIcon:E,InfoIcon:S,InspirationPills:go},emits:["open-inspiration"],computed:{prompt:{get(){return this.$store.state.kling?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=fo)}}),_o={class:"field"},$o={class:"box"},vo={class:"title font-bold"},ko={class:"actions"};function bo(e,t,s,a,u,$){const c=o("font-awesome-icon"),p=o("el-button"),f=o("info-icon"),d=o("inspiration-pills"),v=o("el-input");return l(),m("div",_o,[i("div",$o,[i("h2",vo,r(e.$t("kling.name.prompt")),1),i("div",ko,[n(p,{text:"",size:"small",class:"inspiration-btn",onClick:t[0]||(t[0]=g=>e.$emit("open-inspiration"))},{default:h(()=>[n(c,{icon:"fa-regular fa-lightbulb",class:"mr-1"}),w(" "+r(e.$t("kling.inspiration.openButton")),1)]),_:1}),n(f,{content:e.$t("kling.description.prompt"),class:"info"},null,8,["content"])])]),n(d),n(v,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||(t[1]=g=>e.prompt=g),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const yo=y(ho,[["render",bo],["__scopeId","data-v-0a5c57b8"]]),wo="",Co=b({name:"NegativePromptInput",components:{ElInput:Q,InfoIcon:S},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=wo)}}),Vo={class:"field"},So={class:"box"},To={class:"title font-bold"};function Io(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-input");return l(),m("div",Vo,[i("div",So,[i("h2",To,r(e.$t("kling.name.negativePrompt")),1),n(c,{content:e.$t("kling.description.negativePrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=f=>e.prompt=f),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.negativePrompt")},null,8,["modelValue","placeholder"])])}const Eo=y(Co,[["render",Io],["__scopeId","data-v-de98cf01"]]),Lo=b({name:"InspirationDrawer",components:{ElDrawer:me,ElButton:L,FontAwesomeIcon:E},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(z(this.prompt,e)):this.setPrompt(ao(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(const t of this.allChipTexts)for(;e.includes(t);)e=z(e,t);this.setPrompt(e)}}}),Mo={class:"drawer-content"},Uo={class:"drawer-header"},Ro={class:"title-row"},Ao={class:"title"},Po={class:"hint"},Do={key:0,class:"selected-bar"},Go={class:"selected-text"},Ko={class:"groups"},Oo={class:"group-title"},jo={class:"chip-grid"},No=["onClick"];function Bo(e,t,s,a,u,$){const c=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),V(f,{modelValue:e.visible,"onUpdate:modelValue":t[1]||(t[1]=d=>e.visible=d),direction:"rtl","with-header":!1,size:e.drawerSize,"custom-class":"kling-inspiration-drawer","destroy-on-close":!1},{default:h(()=>[i("div",Mo,[i("div",Uo,[i("div",Ro,[n(c,{icon:"fa-regular fa-lightbulb",class:"mr-2"}),i("span",Ao,r(e.$t("kling.inspiration.title")),1)]),n(p,{text:"",icon:e.Close,class:"close-btn",onClick:t[0]||(t[0]=d=>e.visible=!1)},null,8,["icon"])]),i("div",Po,r(e.$t("kling.inspiration.hint")),1),e.selectedCount>0?(l(),m("div",Do,[i("span",Go,r(e.$t("kling.inspiration.selectedSummary",{count:e.selectedCount})),1),n(p,{text:"",size:"small",class:"clear-btn",onClick:e.onClearSelected},{default:h(()=>[w(r(e.$t("kling.inspiration.clearSelected")),1)]),_:1},8,["onClick"])])):k("",!0),i("div",Ko,[(l(!0),m(T,null,I(e.groups,d=>(l(),m("div",{key:d.groupKey,class:"group"},[i("div",Oo,r(e.$t(`kling.inspiration.group.${d.groupKey}`)),1),i("div",jo,[(l(!0),m(T,null,I(d.chipKeys,v=>(l(),m("button",{key:v,type:"button",class:R({chip:!0,active:e.isSelected(e.chipText(v))}),onClick:g=>e.onToggle(e.chipText(v))},r(e.chipText(v)),11,No))),128))])]))),128))])])]),_:1},8,["modelValue","size"])}const zo=y(Lo,[["render",Bo],["__scopeId","data-v-7d457a69"]]),Fo={"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"},qo={std:"720p",pro:"1080p","4k":"4K"},Ho=b({name:"SummaryChip",components:{FontAwesomeIcon:E},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){const e=this.config?.model||"kling-v2-5-turbo";return Fo[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||""},modeLabel(){const e=this.config?.mode||"std";return qo[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),Wo={class:"summary-chip"},Jo=["title"],Qo=["title"],Yo=["title"],Xo=["title"],Zo=["title"];function xo(e,t,s,a,u,$){const c=o("font-awesome-icon");return l(),m("div",Wo,[i("span",{class:"part",title:e.$t("kling.name.model")},r(e.modelLabel),9,Jo),t[0]||(t[0]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.duration")},r(e.durationLabel),9,Qo),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,Yo),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?(l(),m("span",{key:0,class:"audio",title:e.$t("kling.name.generateAudio")},[n(c,{icon:"fa-solid fa-headphones"})],8,Zo)):k("",!0)])}const en=y(Ho,[["render",xo],["__scopeId","data-v-418a6733"]]),tn=b({name:"ConfigPanel",components:{ElButton:L,Consumption:pe,FontAwesomeIcon:E,PromptInput:yo,NegativePromptInput:Eo,ModelSelector:et,ModeSelector:at,DurationSelector:gt,RatioSelector:bt,StartImage:It,CfgScaleSelector:zt,GenerateAudioSelector:Yt,CameraControlSelector:lo,InspirationDrawer:zo,SummaryChip:en,EndImage:Pt},emits:["generate"],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},consumption(){return fe(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit("generate")}}}),on={class:"flex flex-col h-full"},nn={class:"flex-1 overflow-y-auto p-5"},sn={class:"flex flex-col items-center justify-center px-5 pb-5"};function ln(e,t,s,a,u,$){const c=o("prompt-input"),p=o("model-selector"),f=o("ratio-selector"),d=o("start-image"),v=o("end-image"),g=o("duration-selector"),_=o("mode-selector"),M=o("generate-audio-selector"),U=o("camera-control-selector"),O=o("cfg-scale-selector"),$e=o("negative-prompt-input"),ve=o("summary-chip"),ke=o("consumption"),Z=o("font-awesome-icon"),x=o("el-button"),be=o("inspiration-drawer");return l(),m("div",on,[i("div",nn,[n(c,{class:"mb-4",onOpenInspiration:t[0]||(t[0]=ee=>e.inspirationOpen=!0)}),n(p,{class:"mb-4"}),n(f,{class:"mb-4"}),n(d,{class:"mb-2"}),n(v,{class:"mb-2"}),n(g,{class:"mb-4"}),n(_,{class:"mb-4"}),n(M,{class:"mb-4"}),n(U,{class:"mb-4"}),n(O,{class:"mb-4"}),n($e,{class:"mb-4"})]),i("div",sn,[n(ve),n(ke,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(l(),V(x,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(Z,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.extend")),1)]),_:1},8,["onClick"])):(l(),V(x,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(Z,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.generate")),1)]),_:1},8,["onClick"]))]),n(be,{modelValue:e.inspirationOpen,"onUpdate:modelValue":t[1]||(t[1]=ee=>e.inspirationOpen=ee)},null,8,["modelValue"])])}const an=y(tn,[["render",ln]]),rn=b({name:"MotionImage",components:{ElUpload:K,ElButton:L,InfoIcon:S,FontAwesomeIcon:E,ImagePreview:G},mixins:[W],data(){return{fileList:[],uploadUrl:A()+"/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(){C.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){C.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()}}}),cn={class:"relative"},dn={class:"flex justify-between"},mn={class:"flex justify-start items-center"},pn={class:"text-sm font-bold"};function un(e,t,s,a,u,$){const c=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),d=o("el-button"),v=o("el-upload");return l(),m("div",cn,[i("div",dn,[i("div",mn,[i("span",pn,r(e.$t("kling.name.motionImage")),1),n(c,{content:e.$t("kling.description.motionImage")},null,8,["content"])])]),n(v,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=g=>e.fileList=g),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:h(({file:g})=>[g.url&&g.percentage!==void 0?(l(),V(p,{key:0,url:g.url,name:g.name,percentage:g.percentage,onRemove:_=>e.onRemove(g)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(d,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$t("kling.button.uploadReferences")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const gn=y(rn,[["render",un],["__scopeId","data-v-37d42da7"]]),fn=b({name:"MotionVideo",components:{ElUpload:K,ElButton:L,InfoIcon:S,FilePreview:Me,FontAwesomeIcon:E},data(){return{fileList:[],uploadUrl:A()+"/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(){C.warning(this.$t("kling.message.uploadVideoExceed"))},onError(){C.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:(C.error(this.$t("kling.message.uploadVideoSizeExceed")),!1):(C.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()}}}),hn={class:"relative"},_n={class:"flex justify-between"},$n={class:"flex justify-start items-center"},vn={class:"text-sm font-bold"};function kn(e,t,s,a,u,$){const c=o("info-icon"),p=o("file-preview"),f=o("font-awesome-icon"),d=o("el-button"),v=o("el-upload");return l(),m("div",hn,[i("div",_n,[i("div",$n,[i("span",vn,r(e.$t("kling.name.motionVideo")),1),n(c,{content:e.$t("kling.description.motionVideo")},null,8,["content"])])]),n(v,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=g=>e.fileList=g),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:h(({file:g})=>[g.percentage!==void 0?(l(),V(p,{key:0,url:g.url||g.response?.file_url,name:g.name,percentage:g.percentage,onRemove:_=>e.onRemove(g)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(d,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$t("kling.button.uploadVideoUrl")),1)]),_:1})]),_:1},8,["file-list","action","before-upload","on-exceed","on-error","on-success","headers"])])}const bn=y(fn,[["render",kn],["__scopeId","data-v-5cf93212"]]),yn=b({name:"MotionPromptInput",components:{ElInput:Q,InfoIcon:S},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||""},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),wn={class:"field"},Cn={class:"box"},Vn={class:"title font-bold"};function Sn(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-input");return l(),m("div",wn,[i("div",Cn,[i("h2",Vn,r(e.$t("kling.name.motionPrompt")),1),n(c,{content:e.$t("kling.description.motionPrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=f=>e.prompt=f),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.motionPrompt")},null,8,["modelValue","placeholder"])])}const Tn=y(yn,[["render",Sn],["__scopeId","data-v-ca9fdbe5"]]),re="video",In=b({name:"CharacterOrientationSelector",components:{ElRadioGroup:Re,ElRadioButton:Ue,InfoIcon:S},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)}}),En={class:"field"},Ln={class:"header"},Mn={class:"text-sm font-bold"};function Un(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-radio-button"),f=o("el-radio-group");return l(),m("div",En,[i("div",Ln,[i("span",Mn,r(e.$t("kling.name.characterOrientation")),1),n(c,{content:e.$t("kling.description.characterOrientation")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),size:"small",class:"value"},{default:h(()=>[n(p,{label:"image"},{default:h(()=>[w(r(e.$t("kling.name.orientationImage")),1)]),_:1}),n(p,{label:"video"},{default:h(()=>[w(r(e.$t("kling.name.orientationVideo")),1)]),_:1})]),_:1},8,["modelValue"])])}const Rn=y(In,[["render",Un],["__scopeId","data-v-7a91195b"]]),ce="std",An=b({name:"MotionModeSelector",components:{ElSelect:D,ElOption:P,InfoIcon:S},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)}}),Pn={class:"field"},Dn={class:"header"},Gn={class:"title font-bold"};function Kn(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),m("div",Pn,[i("div",Dn,[i("h2",Gn,r(e.$t("kling.name.mode")),1),n(c,{content:e.$t("kling.description.motionMode")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),class:"value",placeholder:e.$t("kling.placeholder.select")},{default:h(()=>[(l(!0),m(T,null,I(e.options,d=>(l(),V(p,{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const On=y(An,[["render",Kn],["__scopeId","data-v-1295688c"]]),jn=b({name:"KeepOriginalSoundSelector",components:{ElSwitch:ge,InfoIcon:S},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"})}}}}),Nn={class:"relative"},Bn={class:"flex justify-between items-center"},zn={class:"flex justify-start items-center"},Fn={class:"text-sm font-bold"};function qn(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-switch");return l(),m("div",Nn,[i("div",Bn,[i("div",zn,[i("span",Fn,r(e.$t("kling.name.keepOriginalSound")),1),n(c,{content:e.$t("kling.description.keepOriginalSound")},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=f=>e.value=f)},null,8,["modelValue"])])])}const Hn=y(jn,[["render",qn]]),Wn=b({name:"MotionPanel",components:{ElButton:L,FontAwesomeIcon:E,Consumption:pe,MotionImage:gn,MotionVideo:bn,MotionPromptInput:Tn,CharacterOrientationSelector:Rn,MotionModeSelector:On,KeepOriginalSoundSelector:Hn},emits:["generate"],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return fe(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")}}}),Jn={class:"flex flex-col h-full"},Qn={class:"flex-1 overflow-y-auto p-5"},Yn={class:"flex flex-col items-center justify-center px-5 pb-5"};function Xn(e,t,s,a,u,$){const c=o("motion-image"),p=o("motion-video"),f=o("motion-prompt-input"),d=o("character-orientation-selector"),v=o("motion-mode-selector"),g=o("keep-original-sound-selector"),_=o("consumption"),M=o("font-awesome-icon"),U=o("el-button");return l(),m("div",Jn,[i("div",Qn,[n(c,{class:"mb-3"}),n(p,{class:"mb-3"}),n(f,{class:"mb-4"}),n(d,{class:"mb-4"}),n(v,{class:"mb-4"}),n(g,{class:"mb-4"})]),i("div",Yn,[n(_,{value:e.consumption,service:e.service},null,8,["value","service"]),n(U,{type:"primary",class:"btn w-full",round:"",disabled:!e.canGenerate,onClick:e.onGenerate},{default:h(()=>[n(M,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.generateMotion")),1)]),_:1},8,["disabled","onClick"])])])}const Zn=y(Wn,[["render",Xn]]),xn=b({name:"KlingTabSwitcher",components:{ElTabs:Pe,ElTabPane:Ae,ElTag:Ve},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)}}}),es=["title"],ts={class:"text"};function os(e,t,s,a,u,$){const c=o("el-tag"),p=o("el-tab-pane"),f=o("el-tabs");return l(),V(f,{"model-value":e.modelValue,class:"kling-tabs",stretch:"","onUpdate:modelValue":e.onUpdate},{default:h(()=>[(l(!0),m(T,null,I(e.tabs,d=>(l(),V(p,{key:d.value,name:d.value,disabled:d.disabled},{label:h(()=>[i("span",{class:"tab-label",title:d.disabled?d.disabledReason:void 0},[i("span",ts,r(d.label),1),d.badge?(l(),V(c,{key:0,size:"small",type:"warning",class:"badge"},{default:h(()=>[w(r(d.badge),1)]),_:2},1024)):k("",!0)],8,es)]),_:2},1032,["name","disabled"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])}const ns=y(xn,[["render",os],["__scopeId","data-v-bf00c27e"]]),ss=b({name:"TaskPreview",components:{ElImage:Oe,CopyToClipboard:De,FontAwesomeIcon:E,ElAlert:Ke,VideoPlayer:Ge,ElTooltip:J,ElButton:L,ImagePreview:G},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")}}}),is={class:"preview"},ls={class:"left"},as={class:"main"},rs={class:"bot"},cs={class:"datetime"},ds={class:"info"},ms={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},ps={key:1,class:"prompt mt-2"},us={key:0},gs={key:1},fs={key:0,class:R({content:!0,failed:!0})},hs={key:0,class:"mb-4"},_s={key:1,class:R({operations:!0,"mt-2":!0})},$s={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},vs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ks={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},bs={key:1,class:R({content:!0})},ys={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ws={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Cs={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Vs={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Ss={key:2,class:R({content:!0})},Ts={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Is={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Es(e,t,s,a,u,$){const c=o("el-image"),p=o("image-preview"),f=o("video-player"),d=o("el-button"),v=o("el-tooltip"),g=o("font-awesome-icon"),_=o("copy-to-clipboard"),M=o("el-alert");return l(),m("div",is,[i("div",ls,[n(c,{src:"https://cdn.acedata.cloud/qpbbbb.jpg",class:"avatar"})]),i("div",as,[i("div",rs,[w(r(e.$t("kling.name.klingBot"))+" ",1),i("span",cs,r(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),i("div",ds,[e.referenceImages.length>0?(l(),m("div",ms,[(l(!0),m(T,null,I(e.referenceImages,(U,O)=>(l(),V(p,{key:O,url:U.url,name:U.name,closable:!1},null,8,["url","name"]))),128))])):k("",!0),e.modelValue?.request?.prompt?(l(),m("p",ps,[w(r(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?k("",!0):(l(),m("span",us," - ("+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"?(l(),m("span",gs," - ("+r(e.$t("kling.status.processing"))+") ",1)):k("",!0)])):k("",!0)]),e.modelValue?.response?.success===!0?(l(),m("div",fs,[e.modelValue?.response.video_url?(l(),m("div",hs,[n(f,{src:e.modelValue?.response.video_url},null,8,["src"])])):k("",!0),e.modelValue?.response.success?(l(),m("div",_s,[n(v,{class:"box-item",effect:"dark",content:e.$t("kling.message.downloadVideo"),placement:"top-start"},{default:h(()=>[e.modelValue?.response.video_url?(l(),V(d,{key:0,type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=U=>e.onDownload(U,e.modelValue?.response.video_url))},{default:h(()=>[w(r(e.$t("kling.button.download")),1)]),_:1})):k("",!0)]),_:1},8,["content"])])):k("",!0),n(M,{closable:!1,class:"mt-2 success"},{default:h(()=>[i("p",$s,[n(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.model"))+": "+r(e.modelValue?.request?.model),1)]),i("p",vs,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(l(),m("p",ks,[n(g,{icon:"fa-solid fa-clock",class:"mr-1"}),w(" "+r(e.$t("kling.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):k("",!0)]),_:1})])):k("",!0),e.modelValue?.response?.success===!1?(l(),m("div",bs,[n(M,{closable:!1,class:"failure"},{template:h(()=>[n(g,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),w(" "+r(e.$t("kling.name.failure")),1)]),default:h(()=>[i("p",ys,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),i("p",ws,[n(g,{icon:"fa-solid fa-circle-info",class:"mr-1"}),w(" "+r(e.$t("kling.name.failureReason"))+": "+r(e.modelValue?.response?.error?.message)+" ",1),n(_,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(l(),m("p",Cs,[n(g,{icon:"fa-solid fa-clock",class:"mr-1"}),w(" "+r(e.$t("kling.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):k("",!0),e.modelValue?.response?.trace_id?(l(),m("p",Vs,[n(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(_,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):k("",!0)]),_:1})])):k("",!0),e.modelValue?.response?.success===void 0?(l(),m("div",Ss,[n(M,{closable:!1,class:"info"},{template:h(()=>[n(g,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),w(" "+r(e.$t("kling.name.failure")),1)]),default:h(()=>[i("p",Ts,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.response?.trace_id?(l(),m("p",Is,[n(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(_,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):k("",!0)]),_:1})])):k("",!0)])])}const Ls=y(ss,[["render",Es],["__scopeId","data-v-e8e87659"]]),Ms=b({name:"RecentPanel",components:{TaskPreview:Ls,NoTasks:Ne,BotPlaceholder:je,ScrollList:Le},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?.()}}}),Us={key:0},Rs={key:2,class:"w-full h-full flex items-center justify-center"};function As(e,t,s,a,u,$){const c=o("bot-placeholder"),p=o("task-preview"),f=o("scroll-list"),d=o("no-tasks");return l(),m(T,null,[e.tasks?.items===void 0?(l(),m("div",Us,[n(c)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(l(),V(f,{key:1,ref:"scrollList",class:"h-full w-full overflow-y-auto tasks",loading:e.loading,onReachTop:t[0]||(t[0]=v=>e.$emit("reach-top"))},{default:h(()=>[(l(!0),m(T,null,I(e.tasks?.items,v=>(l(),V(p,{key:v.id,"model-value":v},null,8,["model-value"]))),128))]),_:1},8,["loading"])):k("",!0),e.tasks?.items?.length===0?(l(),m("div",Rs,[n(d)])):k("",!0)],64)}const Ps=y(Ms,[["render",As]]),de="https://webhook.acedata.cloud/kling",Ds=b({name:"KlingIndex",components:{ConfigPanel:an,MotionPanel:Zn,TabSwitcher:ns,Layout:Je,RecentPanel:Ps},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===oe.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===oe.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 Be({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:a}=e||{};console.debug("limit",t,"createdAtMin",s,"createdAtMax",a),this.fetchingTasks=!0;try{await this.$store.dispatch("kling/getTasks",{limit:t,createdAtMin:s,createdAtMax:a})}finally{this.fetchingTasks=!1}},async onGenerate(){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){C.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 a=this.credential?.token;if(!a){console.error("no token specified");return}C.info(this.$t("kling.message.startingTask")),te("kling",ie.generate(s,{token:a})).then(()=>{C.success(this.$t("kling.message.startTaskSuccess"))}).catch(u=>{u?.response?.data?.error?.code===se?C.error(this.$t("kling.message.usedUp")):C.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(){const e=this.motionConfig||{};if(!e.image_url||!e.video_url){C.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}C.info(this.$t("kling.message.startingTask")),te("kling",ie.motion(t,{token:s})).then(()=>{C.success(this.$t("kling.message.startTaskSuccess"))}).catch(a=>{a?.response?.data?.error?.code===se?C.error(this.$t("kling.message.usedUp")):C.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),Gs={class:"flex flex-col h-full"},Ks={class:"flex-1 min-h-0"};function Os(e,t,s,a,u,$){const c=o("tab-switcher"),p=o("config-panel"),f=o("motion-panel"),d=o("recent-panel"),v=o("layout");return l(),V(v,null,{config:h(()=>[i("div",Gs,[n(c,{"model-value":e.taskType,"onUpdate:modelValue":e.onTabChange},null,8,["model-value","onUpdate:modelValue"]),i("div",Ks,[e.taskType==="videos"?(l(),V(p,{key:0,onGenerate:e.onGenerate},null,8,["onGenerate"])):e.taskType==="motion"?(l(),V(f,{key:1,onGenerate:e.onGenerateMotion},null,8,["onGenerate"])):k("",!0)])])]),result:h(()=>[n(d,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Bi=y(Ds,[["render",Os]]);export{Bi as default};
1
+ import{F as E}from"./index.es-sH5Gh1j5.js";import{E as L}from"./index-ma8m8GLT.js";import{E as me}from"./index-Dn_CcntF.js";import{d as b,H as m,E as i,z as j,C as n,y as h,D as o,q as l,F as r,x as V,O as T,N as I,Q as R,J as k,R as ye,I as w,M as we}from"./vendor-vue-NSDaktjZ.js";import{E as y,b7 as A,a0 as Ce,F as Ve,cd as te,aw as oe}from"./index-zbbUR5es.js";import{b as Se,c as ne,d as F,e as N,f as Te,g as Ie,h as Ee}from"./kling-CtoPhhA9.js";import{E as P,a as D}from"./index-gZqSePZ-.js";import{E as q}from"./index-BghS-OLU.js";import{E as C}from"./index-Bf9PIvnp.js";import{I as S,S as Le}from"./ScrollList-bxgGqvg5.js";import{E as H}from"./index-C0_EBvFj.js";import{p as W}from"./pasteUploadMixin-BurWbGNQ.js";import{I as G}from"./ImagePreview-DANgdSKv.js";import{E as J}from"./index-DqQE5t_f.js";import{E as K}from"./index-DsXIVBQ0.js";import{C as pe}from"./Consumption-CUldncy6.js";import{E as ue}from"./index-Dh5g13xz.js";import{E as ge}from"./index-DPHfUUNn.js";import{E as Q}from"./index-BBvtDo3a.js";import{a as fe}from"./price-ZnUNDmOU.js";import{F as Me}from"./FilePreview-1L8cpcvF.js";import{E as Ue,a as Re}from"./index-D37M_pau.js";import{E as Ae,a as Pe}from"./index-DxH7_hDr.js";import{b as se}from"./errorCode-Cqj9Td_Z.js";import{k as ie}from"./kling-C4euvnyB.js";import{C as De}from"./CopyToClipboard-CPcOPXkP.js";import{V as Ge}from"./VideoPlayer-D_k6XIe_.js";import{E as Ke}from"./index-C-YyEjOK.js";import{E as Oe}from"./index-C96Gkhlw.js";import{B as je}from"./BotPlaceholder-DVC0W4uX.js";import{N as Ne}from"./NoTasks-BafA5FPC.js";import{l as Be}from"./pagination-Cnc6Oeyx.js";import"./use-form-item-DsrOsrL-.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-Cvgzdobq.js";import"./vendor-vue-router-Kg6s1a65.js";import"./index-PzNhCjB3.js";import"./typescript-DgSJWeBe.js";import"./index-CthC0a0-.js";import"./strings-beZM2Y-f.js";import"./isEqual-Bvy1Dbnl.js";import"./_Uint8Array-CxCVqXtT.js";import"./castArray-DQxrz7K8.js";import"./debounce-CGEoxqi1.js";import"./_baseIteratee-DWaEFucS.js";import"./index-Bs58BkYp.js";import"./validator-DkCt-_lu.js";import"./index-4UBoy_LI.js";import"./_baseClone-DP9c_05H.js";import"./_initCloneObject-CVS8NsJG.js";import"./index-Cu41y2Fl.js";import"./index-uaiBAFRV.js";import"./isPlainObject-kyM8sY1X.js";import"./vue-plyr-BO2nlN4c.js";import"./index-9E31E00G.js";const ze=b({name:"LayoutKling",components:{ElDrawer:me,ElButton:L,FontAwesomeIcon:E},data(){return{drawer:!1}}}),Fe={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)]"},He={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function We(e,t,s,a,u,$){const c=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),m("div",Fe,[i("div",qe,[j(e.$slots,"config",{},void 0,!0)]),i("div",He,[j(e.$slots,"result",{},void 0,!0)]),n(p,{circle:"",class:"menu",onClick:t[0]||(t[0]=d=>e.drawer=!0)},{default:h(()=>[n(c,{icon:"fa-solid fa-magic"})]),_:1}),n(f,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=d=>e.drawer=d),direction:"ltr","with-header":!1,size:"350px"},{default:h(()=>[j(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Je=y(ze,[["render",We],["__scopeId","data-v-8fa7523c"]]),Qe={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function he(e,t,s){const a=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:a==="pro",audio:!1,motionControl:!1};case"kling-v2-6":return{text2video:!0,image2video:!0,endImage:a==="pro",audio:a==="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:a!=="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 Qe}}function Y(e,t){if(!e)return[];const s=t.model??e.model,a=t.mode??e.mode,u=t.duration??e.duration;if(!s)return[];const $=he(s,a,u),c=[];return e.end_image_url&&!$.endImage&&c.push({field:"end_image_url",i18nLabel:"kling.name.endImage"}),e.generate_audio&&!$.audio&&c.push({field:"generate_audio",i18nLabel:"kling.name.generateAudio"}),e.camera_control?.type&&!$.motionControl&&c.push({field:"camera_control",i18nLabel:"kling.name.cameraControl"}),c}function X(e,t){const s={...e};for(const a of t)a.field==="end_image_url"&&(s.end_image_url=void 0),a.field==="generate_audio"&&(s.generate_audio=!1),a.field==="camera_control"&&(s.camera_control=void 0);return s}const Ye=b({name:"ModelSelector",components:{ElSelect:D,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(Se)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Y(t,{model:e});if(s.length===0){this.applyModel(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=X({...t,model:e},s);this.$store.commit("kling/setConfig",u),C.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,model:e})}}}),Xe={class:"field"},Ze={class:"title font-bold"};function xe(e,t,s,a,u,$){const c=o("el-option"),p=o("el-select");return l(),m("div",Xe,[i("h2",Ze,r(e.$t("pika.name.model")),1),(l(),V(p,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("pika.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),m(T,null,I(e.options,f=>(l(),V(c,{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const et=y(Ye,[["render",xe],["__scopeId","data-v-04059875"]]),tt=b({name:"ModeSelector",components:{ElSelect:D,ElOption:P,InfoIcon:S},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},cameraControlSet(){return!!this.$store.state.kling?.config?.camera_control?.type},fourKReason(){return F.includes(this.selectedModel)?this.cameraControlSet?this.$t("kling.description.mode4kIncompatibleCamera"):"":this.$t("kling.description.mode4kRequiresV3")},options(){return[{value:"std",label:this.$t("kling.name.modeStd"),disabled:!1,disabledReason:""},{value:"pro",label:this.$t("kling.name.modePro"),disabled:!1,disabledReason:""},{value:"4k",label:this.$t("kling.name.mode4k"),disabled:!!this.fourKReason,disabledReason:this.fourKReason}]},value(){return this.$store.state.kling?.config?.mode}},watch:{fourKReason(e){e&&this.value==="4k"&&this.applyMode(ne)}},mounted(){this.value||this.applyMode(ne)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Y(t,{mode:e});if(s.length===0){this.applyMode(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=X({...t,mode:e},s);this.$store.commit("kling/setConfig",u),C.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyMode(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,mode:e})}}}),ot={class:"field"},nt={class:"header"},st={class:"title font-bold"},it={key:0,class:"opt-tip"};function lt(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),m("div",ot,[i("div",nt,[i("h2",st,r(e.$t("kling.name.mode")),1),n(c,{content:e.$t("kling.description.mode"),class:"info-icon"},null,8,["content"])]),(l(),V(f,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("kling.placeholder.select"),clearable:!0,onChange:e.onChange},{default:h(()=>[(l(!0),m(T,null,I(e.options,d=>(l(),V(p,{key:d.value,label:d.label,value:d.value,disabled:d.disabled},{default:h(()=>[i("span",{class:R({"opt-disabled":d.disabled})},r(d.label),3),d.disabled&&d.disabledReason?(l(),m("span",it,r(d.disabledReason),1)):k("",!0)]),_:2},1032,["label","value","disabled"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const at=y(tt,[["render",lt],["__scopeId","data-v-9a8fa3c5"]]),le=[3,5,8,10,12,15],ae=[5,10],rt=b({name:"DurationSelector",components:{ElSlider:H,InfoIcon:S},props:{modelValue:{type:Number,default:void 0}},emits:["update:modelValue"],data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},isV3Model(){return F.includes(this.selectedModel)},sliderMin(){return this.isV3Model?3:5},sliderMax(){return this.isV3Model?15:10},sliderStep(){return this.isV3Model?1:5},marks(){const e=this.isV3Model?le:ae,t={};for(const s of e)t[s]=`${s}s`;return t},value(){return this.$store.state.kling?.config?.duration??N},sliderValue(){const e=this.value;return e<this.sliderMin?this.sliderMin:e>this.sliderMax?this.sliderMax:e}},watch:{isV3Model(e){(this.isV3Model?le:ae).includes(this.value)||this.applyDuration(N)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(N)},methods:{async onChange(e){const t=Array.isArray(e)?e[0]:e,s=this.$store.state.kling?.config||{},a=Y(s,{duration:t});if(a.length===0){this.applyDuration(t);return}const u=a.map($=>this.$t($.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:u}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const $=X({...s,duration:t},a);this.$store.commit("kling/setConfig",$),C.success(this.$t("kling.message.featureRemovedNotice",{fields:u}))}catch{this.revertKey+=1}},applyDuration(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,duration:e})}}}),ct={class:"field"},dt={class:"header"},mt={class:"title font-bold"},pt={class:"value-display"};function ut(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-slider");return l(),m("div",ct,[i("div",dt,[i("h2",mt,r(e.$t("kling.name.duration")),1),n(c,{content:e.$t("kling.description.duration"),class:"info-icon ml-1"},null,8,["content"]),i("span",pt,r(e.value)+"s",1)]),(l(),V(p,{key:e.revertKey,"model-value":e.sliderValue,class:"slider",min:e.sliderMin,max:e.sliderMax,step:e.sliderStep,marks:e.marks,"show-tooltip":!1,onChange:e.onChange},null,8,["model-value","min","max","step","marks","onChange"]))])}const gt=y(rt,[["render",ut],["__scopeId","data-v-aa1a22a1"]]),ft=b({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)}}),ht={class:"text-sm font-bold mb-2 block"},_t={class:"items"},$t=["onClick"],vt={class:"name"};function kt(e,t,s,a,u,$){return l(),m("div",null,[i("span",ht,r(e.$t("kling.name.ratio")),1),i("div",_t,[(l(!0),m(T,null,I(e.options,(c,p)=>(l(),m("div",{key:p,class:R({active:e.active===p,item:!0}),onClick:f=>e.value=c.value},[i("div",{class:R(["preview",c.label])},[i("div",{class:"rect",style:ye({width:c.width+"px",height:c.height+"px"})},null,4)],2),i("p",vt,r(c.label),1)],10,$t))),128))])])}const bt=y(ft,[["render",kt],["__scopeId","data-v-cdb14b2f"]]),yt=b({name:"StartImage",components:{ElUpload:K,ElButton:L,ElTooltip:J,InfoIcon:S,FontAwesomeIcon:E,ImagePreview:G},mixins:[W],emits:["change"],data(){return{fileList:[],uploadUrl:A()+"/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(){C.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){C.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()}}}),wt={class:"relative"},Ct={class:"flex justify-between"},Vt={class:"flex justify-start items-center"},St={class:"text-sm font-bold"};function Tt(e,t,s,a,u,$){const c=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),d=o("el-button"),v=o("el-tooltip"),g=o("el-upload");return l(),m("div",wt,[i("div",Ct,[i("div",Vt,[i("span",St,r(e.$t("kling.name.startImage")),1),n(c,{content:e.$t("kling.description.uploadStartImage")},null,8,["content"])])]),n(g,{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:h(({file:_})=>[_.url&&_.percentage!==void 0?(l(),V(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(v,{content:e.$t("kling.message.uploadReferencesExceed"),disabled:!e.reachedLimit,placement:"top"},{default:h(()=>[i("span",null,[n(d,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.reachedLimit},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+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 It=y(yt,[["render",Tt],["__scopeId","data-v-40832274"]]),Et=b({name:"EndImage",components:{ElUpload:K,ElButton:L,ElTooltip:J,ImagePreview:G,InfoIcon:S,FontAwesomeIcon:E},mixins:[W],data(){return{fileList:[],uploadUrl:A()+"/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 he(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},uploadDisabled(){return this.reachedLimit||!this.endImageSupported},uploadTooltip(){return this.endImageSupported?this.reachedLimit?this.$t("kling.message.uploadReferencesExceed"):"":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=[])}},mounted(){this.value||(this.value=void 0),this.onSetEndImageUrl()},methods:{onBeforeUpload(){return this.endImageSupported?!0:(C.warning(this.$t("kling.message.endImageNotSupported")),!1)},onExceed(){C.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){C.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()}}}),Lt={class:"relative"},Mt={class:"flex justify-between"},Ut={class:"flex justify-start items-center"},Rt={class:"text-sm font-bold"};function At(e,t,s,a,u,$){const c=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),d=o("el-button"),v=o("el-tooltip"),g=o("el-upload");return l(),m("div",Lt,[i("div",Mt,[i("div",Ut,[i("span",Rt,r(e.$t("kling.name.endImage")),1),n(c,{content:e.$t("kling.description.uploadEndImage")},null,8,["content"])])]),n(g,{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:h(({file:_})=>[_.url&&_.percentage!==void 0?(l(),V(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(v,{content:e.uploadTooltip,disabled:!e.uploadDisabled,placement:"top"},{default:h(()=>[i("span",null,[n(d,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.uploadDisabled},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+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 Pt=y(Et,[["render",At],["__scopeId","data-v-6959ad44"]]),Dt=b({name:"CfgScaleSelector",components:{ElSlider:H,InfoIcon:S,ElInputNumber:ue},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=Ie)}}),Gt={class:"flex justify-between"},Kt={class:"flex justify-start items-center"},Ot={class:"text-sm font-bold"},jt={class:"flex justify-end items-center"},Nt={class:"w-full"};function Bt(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-input-number"),f=o("el-slider");return l(),m("div",null,[i("div",Gt,[i("div",Kt,[i("span",Ot,r(e.$t("kling.name.cfgScale")),1),n(c,{content:e.$t("kling.description.cfgScale")},null,8,["content"])]),i("div",jt,[n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),"controls-position":"right"},null,8,["modelValue"])])]),i("div",Nt,[n(f,{modelValue:e.value,"onUpdate:modelValue":t[1]||(t[1]=d=>e.value=d),min:0,max:1,step:.1},null,8,["modelValue"])])])}const zt=y(Dt,[["render",Bt]]),Ft=b({name:"GenerateAudioSelector",components:{ElSwitch:ge,InfoIcon:S},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},selectedMode(){return this.$store.state.kling?.config?.mode||""},supported(){return!!(F.includes(this.selectedModel)||this.selectedModel==="kling-v2-6"&&this.selectedMode==="pro")},tooltipContent(){return this.supported?this.$t("kling.description.generateAudio"):this.$t("kling.description.generateAudioUnsupported")},value:{get(){return this.supported?this.$store.state.kling?.config?.generate_audio??Ee:!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})}}}),qt={class:"relative"},Ht={class:"flex justify-between items-center"},Wt={class:"flex justify-start items-center"},Jt={class:"text-sm font-bold"};function Qt(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-switch");return l(),m("div",qt,[i("div",Ht,[i("div",Wt,[i("span",Jt,r(e.$t("kling.name.generateAudio")),1),n(c,{content:e.tooltipContent},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=f=>e.value=f),class:"value",disabled:!e.supported},null,8,["modelValue","disabled"])])])}const Yt=y(Ft,[["render",Qt]]),Xt=["horizontal","vertical","pan","tilt","roll","zoom"],Zt=b({name:"CameraControlSelector",components:{ElSelect:D,ElOption:P,ElSlider:H,ElInputNumber:ue,InfoIcon:S},data(){return{configKeys:Xt}},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||""},disabled(){return this.selectedMode==="4k"},tooltipContent(){return this.disabled?this.$t("kling.description.cameraControlDisabled4k"):this.$t("kling.description.cameraControl")},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 a={...t};delete a.camera_control,this.$store.commit("kling/setConfig",a);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||{},a=s.camera_control||{type:"simple"},u={...a.config||{}};t==null?delete u[e]:u[e]=t,this.$store.commit("kling/setConfig",{...s,camera_control:{...a,type:"simple",config:u}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),xt={class:"field"},eo={class:"header"},to={class:"text-sm font-bold"},oo={key:0,class:"config-grid"},no={class:"cfg-row-head"},so={class:"cfg-name"};function io(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-option"),f=o("el-select"),d=o("el-input-number"),v=o("el-slider");return l(),m("div",xt,[i("div",eo,[i("span",to,r(e.$t("kling.name.cameraControl")),1),n(c,{content:e.tooltipContent},null,8,["content"])]),n(f,{modelValue:e.selectedTypeRaw,"onUpdate:modelValue":t[0]||(t[0]=g=>e.selectedTypeRaw=g),class:"value",placeholder:e.$t("kling.placeholder.cameraType"),clearable:!0,disabled:e.disabled},{default:h(()=>[(l(!0),m(T,null,I(e.typeOptions,g=>(l(),V(p,{key:g.value,label:g.label,value:g.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","disabled"]),e.selectedType==="simple"&&!e.disabled?(l(),m("div",oo,[(l(!0),m(T,null,I(e.configKeys,g=>(l(),m("div",{key:g,class:"cfg-row"},[i("div",no,[i("span",so,r(e.$t(`kling.name.cc_${g}`)),1),n(d,{modelValue:e.configValues[g],"onUpdate:modelValue":_=>e.configValues[g]=_,min:-1,max:1,step:.1,precision:1,"controls-position":"right",size:"small",class:"cfg-num",onChange:_=>e.onNumberChange(g,_)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),n(v,{"model-value":e.configValues[g]??0,min:-1,max:1,step:.1,onInput:_=>e.onSliderChange(g,_)},null,8,["model-value","onInput"])]))),128))])):k("",!0)])}const lo=y(Zt,[["render",io],["__scopeId","data-v-fb7b34d0"]]),_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"]}],B=", ";function ao(e,t){const s=(e||"").trim();return s?s.includes(t)?s:`${s}${B}${t}`:t}function z(e,t){if(!e||!t)return e||"";const s=[`${t}${B}`,`${B}${t}`,t];let a=e;for(const u of s)if(a.includes(u)){a=a.replace(u,"");break}return a.replace(/(?:,\s*)+$/,"").replace(/^(?:,\s*)+/,"")}const ro=b({name:"InspirationPills",components:{FontAwesomeIcon:E},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 a=e.indexOf(s);a!==-1&&t.push({text:s,idx:a})}return t.sort((s,a)=>s.idx-a.idx).map(s=>s.text)}},methods:{onRemove(e){const t=z(this.prompt,e);this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:t})}}}),co={key:0,class:"pills",role:"list"},mo={class:"pill-text"},po=["aria-label","onClick"];function uo(e,t,s,a,u,$){const c=o("font-awesome-icon");return e.selected.length>0?(l(),m("div",co,[(l(!0),m(T,null,I(e.selected,p=>(l(),m("div",{key:p,class:"pill",role:"listitem"},[i("span",mo,r(p),1),i("button",{type:"button",class:"pill-remove","aria-label":e.$t("kling.inspiration.removeChip"),onClick:we(f=>e.onRemove(p),["stop"])},[n(c,{icon:"fa-solid fa-xmark"})],8,po)]))),128))])):k("",!0)}const go=y(ro,[["render",uo],["__scopeId","data-v-5fc4fa65"]]),fo="",ho=b({name:"PromptInput",components:{ElInput:Q,ElButton:L,FontAwesomeIcon:E,InfoIcon:S,InspirationPills:go},emits:["open-inspiration"],computed:{prompt:{get(){return this.$store.state.kling?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=fo)}}),_o={class:"field"},$o={class:"box"},vo={class:"title font-bold"},ko={class:"actions"};function bo(e,t,s,a,u,$){const c=o("font-awesome-icon"),p=o("el-button"),f=o("info-icon"),d=o("inspiration-pills"),v=o("el-input");return l(),m("div",_o,[i("div",$o,[i("h2",vo,r(e.$t("kling.name.prompt")),1),i("div",ko,[n(p,{text:"",size:"small",class:"inspiration-btn",onClick:t[0]||(t[0]=g=>e.$emit("open-inspiration"))},{default:h(()=>[n(c,{icon:"fa-regular fa-lightbulb",class:"mr-1"}),w(" "+r(e.$t("kling.inspiration.openButton")),1)]),_:1}),n(f,{content:e.$t("kling.description.prompt"),class:"info"},null,8,["content"])])]),n(d),n(v,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||(t[1]=g=>e.prompt=g),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const yo=y(ho,[["render",bo],["__scopeId","data-v-0a5c57b8"]]),wo="",Co=b({name:"NegativePromptInput",components:{ElInput:Q,InfoIcon:S},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=wo)}}),Vo={class:"field"},So={class:"box"},To={class:"title font-bold"};function Io(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-input");return l(),m("div",Vo,[i("div",So,[i("h2",To,r(e.$t("kling.name.negativePrompt")),1),n(c,{content:e.$t("kling.description.negativePrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=f=>e.prompt=f),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.negativePrompt")},null,8,["modelValue","placeholder"])])}const Eo=y(Co,[["render",Io],["__scopeId","data-v-de98cf01"]]),Lo=b({name:"InspirationDrawer",components:{ElDrawer:me,ElButton:L,FontAwesomeIcon:E},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(z(this.prompt,e)):this.setPrompt(ao(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(const t of this.allChipTexts)for(;e.includes(t);)e=z(e,t);this.setPrompt(e)}}}),Mo={class:"drawer-content"},Uo={class:"drawer-header"},Ro={class:"title-row"},Ao={class:"title"},Po={class:"hint"},Do={key:0,class:"selected-bar"},Go={class:"selected-text"},Ko={class:"groups"},Oo={class:"group-title"},jo={class:"chip-grid"},No=["onClick"];function Bo(e,t,s,a,u,$){const c=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),V(f,{modelValue:e.visible,"onUpdate:modelValue":t[1]||(t[1]=d=>e.visible=d),direction:"rtl","with-header":!1,size:e.drawerSize,"custom-class":"kling-inspiration-drawer","destroy-on-close":!1},{default:h(()=>[i("div",Mo,[i("div",Uo,[i("div",Ro,[n(c,{icon:"fa-regular fa-lightbulb",class:"mr-2"}),i("span",Ao,r(e.$t("kling.inspiration.title")),1)]),n(p,{text:"",icon:e.Close,class:"close-btn",onClick:t[0]||(t[0]=d=>e.visible=!1)},null,8,["icon"])]),i("div",Po,r(e.$t("kling.inspiration.hint")),1),e.selectedCount>0?(l(),m("div",Do,[i("span",Go,r(e.$t("kling.inspiration.selectedSummary",{count:e.selectedCount})),1),n(p,{text:"",size:"small",class:"clear-btn",onClick:e.onClearSelected},{default:h(()=>[w(r(e.$t("kling.inspiration.clearSelected")),1)]),_:1},8,["onClick"])])):k("",!0),i("div",Ko,[(l(!0),m(T,null,I(e.groups,d=>(l(),m("div",{key:d.groupKey,class:"group"},[i("div",Oo,r(e.$t(`kling.inspiration.group.${d.groupKey}`)),1),i("div",jo,[(l(!0),m(T,null,I(d.chipKeys,v=>(l(),m("button",{key:v,type:"button",class:R({chip:!0,active:e.isSelected(e.chipText(v))}),onClick:g=>e.onToggle(e.chipText(v))},r(e.chipText(v)),11,No))),128))])]))),128))])])]),_:1},8,["modelValue","size"])}const zo=y(Lo,[["render",Bo],["__scopeId","data-v-7d457a69"]]),Fo={"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"},qo={std:"720p",pro:"1080p","4k":"4K"},Ho=b({name:"SummaryChip",components:{FontAwesomeIcon:E},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){const e=this.config?.model||"kling-v2-5-turbo";return Fo[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||""},modeLabel(){const e=this.config?.mode||"std";return qo[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),Wo={class:"summary-chip"},Jo=["title"],Qo=["title"],Yo=["title"],Xo=["title"],Zo=["title"];function xo(e,t,s,a,u,$){const c=o("font-awesome-icon");return l(),m("div",Wo,[i("span",{class:"part",title:e.$t("kling.name.model")},r(e.modelLabel),9,Jo),t[0]||(t[0]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.duration")},r(e.durationLabel),9,Qo),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,Yo),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?(l(),m("span",{key:0,class:"audio",title:e.$t("kling.name.generateAudio")},[n(c,{icon:"fa-solid fa-headphones"})],8,Zo)):k("",!0)])}const en=y(Ho,[["render",xo],["__scopeId","data-v-418a6733"]]),tn=b({name:"ConfigPanel",components:{ElButton:L,Consumption:pe,FontAwesomeIcon:E,PromptInput:yo,NegativePromptInput:Eo,ModelSelector:et,ModeSelector:at,DurationSelector:gt,RatioSelector:bt,StartImage:It,CfgScaleSelector:zt,GenerateAudioSelector:Yt,CameraControlSelector:lo,InspirationDrawer:zo,SummaryChip:en,EndImage:Pt},emits:["generate"],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},consumption(){return fe(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit("generate")}}}),on={class:"flex flex-col h-full"},nn={class:"flex-1 overflow-y-auto p-5"},sn={class:"flex flex-col items-center justify-center px-5 pb-5"};function ln(e,t,s,a,u,$){const c=o("prompt-input"),p=o("model-selector"),f=o("ratio-selector"),d=o("start-image"),v=o("end-image"),g=o("duration-selector"),_=o("mode-selector"),M=o("generate-audio-selector"),U=o("camera-control-selector"),O=o("cfg-scale-selector"),$e=o("negative-prompt-input"),ve=o("summary-chip"),ke=o("consumption"),Z=o("font-awesome-icon"),x=o("el-button"),be=o("inspiration-drawer");return l(),m("div",on,[i("div",nn,[n(c,{class:"mb-4",onOpenInspiration:t[0]||(t[0]=ee=>e.inspirationOpen=!0)}),n(p,{class:"mb-4"}),n(f,{class:"mb-4"}),n(d,{class:"mb-2"}),n(v,{class:"mb-2"}),n(g,{class:"mb-4"}),n(_,{class:"mb-4"}),n(M,{class:"mb-4"}),n(U,{class:"mb-4"}),n(O,{class:"mb-4"}),n($e,{class:"mb-4"})]),i("div",sn,[n(ve),n(ke,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(l(),V(x,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(Z,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.extend")),1)]),_:1},8,["onClick"])):(l(),V(x,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(Z,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.generate")),1)]),_:1},8,["onClick"]))]),n(be,{modelValue:e.inspirationOpen,"onUpdate:modelValue":t[1]||(t[1]=ee=>e.inspirationOpen=ee)},null,8,["modelValue"])])}const an=y(tn,[["render",ln]]),rn=b({name:"MotionImage",components:{ElUpload:K,ElButton:L,InfoIcon:S,FontAwesomeIcon:E,ImagePreview:G},mixins:[W],data(){return{fileList:[],uploadUrl:A()+"/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(){C.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){C.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()}}}),cn={class:"relative"},dn={class:"flex justify-between"},mn={class:"flex justify-start items-center"},pn={class:"text-sm font-bold"};function un(e,t,s,a,u,$){const c=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),d=o("el-button"),v=o("el-upload");return l(),m("div",cn,[i("div",dn,[i("div",mn,[i("span",pn,r(e.$t("kling.name.motionImage")),1),n(c,{content:e.$t("kling.description.motionImage")},null,8,["content"])])]),n(v,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=g=>e.fileList=g),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:h(({file:g})=>[g.url&&g.percentage!==void 0?(l(),V(p,{key:0,url:g.url,name:g.name,percentage:g.percentage,onRemove:_=>e.onRemove(g)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(d,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$t("kling.button.uploadReferences")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const gn=y(rn,[["render",un],["__scopeId","data-v-37d42da7"]]),fn=b({name:"MotionVideo",components:{ElUpload:K,ElButton:L,InfoIcon:S,FilePreview:Me,FontAwesomeIcon:E},data(){return{fileList:[],uploadUrl:A()+"/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(){C.warning(this.$t("kling.message.uploadVideoExceed"))},onError(){C.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:(C.error(this.$t("kling.message.uploadVideoSizeExceed")),!1):(C.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()}}}),hn={class:"relative"},_n={class:"flex justify-between"},$n={class:"flex justify-start items-center"},vn={class:"text-sm font-bold"};function kn(e,t,s,a,u,$){const c=o("info-icon"),p=o("file-preview"),f=o("font-awesome-icon"),d=o("el-button"),v=o("el-upload");return l(),m("div",hn,[i("div",_n,[i("div",$n,[i("span",vn,r(e.$t("kling.name.motionVideo")),1),n(c,{content:e.$t("kling.description.motionVideo")},null,8,["content"])])]),n(v,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=g=>e.fileList=g),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:h(({file:g})=>[g.percentage!==void 0?(l(),V(p,{key:0,url:g.url||g.response?.file_url,name:g.name,percentage:g.percentage,onRemove:_=>e.onRemove(g)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(d,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$t("kling.button.uploadVideoUrl")),1)]),_:1})]),_:1},8,["file-list","action","before-upload","on-exceed","on-error","on-success","headers"])])}const bn=y(fn,[["render",kn],["__scopeId","data-v-5cf93212"]]),yn=b({name:"MotionPromptInput",components:{ElInput:Q,InfoIcon:S},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||""},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),wn={class:"field"},Cn={class:"box"},Vn={class:"title font-bold"};function Sn(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-input");return l(),m("div",wn,[i("div",Cn,[i("h2",Vn,r(e.$t("kling.name.motionPrompt")),1),n(c,{content:e.$t("kling.description.motionPrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=f=>e.prompt=f),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.motionPrompt")},null,8,["modelValue","placeholder"])])}const Tn=y(yn,[["render",Sn],["__scopeId","data-v-ca9fdbe5"]]),re="video",In=b({name:"CharacterOrientationSelector",components:{ElRadioGroup:Re,ElRadioButton:Ue,InfoIcon:S},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)}}),En={class:"field"},Ln={class:"header"},Mn={class:"text-sm font-bold"};function Un(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-radio-button"),f=o("el-radio-group");return l(),m("div",En,[i("div",Ln,[i("span",Mn,r(e.$t("kling.name.characterOrientation")),1),n(c,{content:e.$t("kling.description.characterOrientation")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),size:"small",class:"value"},{default:h(()=>[n(p,{label:"image"},{default:h(()=>[w(r(e.$t("kling.name.orientationImage")),1)]),_:1}),n(p,{label:"video"},{default:h(()=>[w(r(e.$t("kling.name.orientationVideo")),1)]),_:1})]),_:1},8,["modelValue"])])}const Rn=y(In,[["render",Un],["__scopeId","data-v-7a91195b"]]),ce="std",An=b({name:"MotionModeSelector",components:{ElSelect:D,ElOption:P,InfoIcon:S},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)}}),Pn={class:"field"},Dn={class:"header"},Gn={class:"title font-bold"};function Kn(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),m("div",Pn,[i("div",Dn,[i("h2",Gn,r(e.$t("kling.name.mode")),1),n(c,{content:e.$t("kling.description.motionMode")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),class:"value",placeholder:e.$t("kling.placeholder.select")},{default:h(()=>[(l(!0),m(T,null,I(e.options,d=>(l(),V(p,{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const On=y(An,[["render",Kn],["__scopeId","data-v-1295688c"]]),jn=b({name:"KeepOriginalSoundSelector",components:{ElSwitch:ge,InfoIcon:S},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"})}}}}),Nn={class:"relative"},Bn={class:"flex justify-between items-center"},zn={class:"flex justify-start items-center"},Fn={class:"text-sm font-bold"};function qn(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-switch");return l(),m("div",Nn,[i("div",Bn,[i("div",zn,[i("span",Fn,r(e.$t("kling.name.keepOriginalSound")),1),n(c,{content:e.$t("kling.description.keepOriginalSound")},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=f=>e.value=f)},null,8,["modelValue"])])])}const Hn=y(jn,[["render",qn]]),Wn=b({name:"MotionPanel",components:{ElButton:L,FontAwesomeIcon:E,Consumption:pe,MotionImage:gn,MotionVideo:bn,MotionPromptInput:Tn,CharacterOrientationSelector:Rn,MotionModeSelector:On,KeepOriginalSoundSelector:Hn},emits:["generate"],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return fe(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")}}}),Jn={class:"flex flex-col h-full"},Qn={class:"flex-1 overflow-y-auto p-5"},Yn={class:"flex flex-col items-center justify-center px-5 pb-5"};function Xn(e,t,s,a,u,$){const c=o("motion-image"),p=o("motion-video"),f=o("motion-prompt-input"),d=o("character-orientation-selector"),v=o("motion-mode-selector"),g=o("keep-original-sound-selector"),_=o("consumption"),M=o("font-awesome-icon"),U=o("el-button");return l(),m("div",Jn,[i("div",Qn,[n(c,{class:"mb-3"}),n(p,{class:"mb-3"}),n(f,{class:"mb-4"}),n(d,{class:"mb-4"}),n(v,{class:"mb-4"}),n(g,{class:"mb-4"})]),i("div",Yn,[n(_,{value:e.consumption,service:e.service},null,8,["value","service"]),n(U,{type:"primary",class:"btn w-full",round:"",disabled:!e.canGenerate,onClick:e.onGenerate},{default:h(()=>[n(M,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.generateMotion")),1)]),_:1},8,["disabled","onClick"])])])}const Zn=y(Wn,[["render",Xn]]),xn=b({name:"KlingTabSwitcher",components:{ElTabs:Pe,ElTabPane:Ae,ElTag:Ve},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)}}}),es=["title"],ts={class:"text"};function os(e,t,s,a,u,$){const c=o("el-tag"),p=o("el-tab-pane"),f=o("el-tabs");return l(),V(f,{"model-value":e.modelValue,class:"kling-tabs",stretch:"","onUpdate:modelValue":e.onUpdate},{default:h(()=>[(l(!0),m(T,null,I(e.tabs,d=>(l(),V(p,{key:d.value,name:d.value,disabled:d.disabled},{label:h(()=>[i("span",{class:"tab-label",title:d.disabled?d.disabledReason:void 0},[i("span",ts,r(d.label),1),d.badge?(l(),V(c,{key:0,size:"small",type:"warning",class:"badge"},{default:h(()=>[w(r(d.badge),1)]),_:2},1024)):k("",!0)],8,es)]),_:2},1032,["name","disabled"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])}const ns=y(xn,[["render",os],["__scopeId","data-v-bf00c27e"]]),ss=b({name:"TaskPreview",components:{ElImage:Oe,CopyToClipboard:De,FontAwesomeIcon:E,ElAlert:Ke,VideoPlayer:Ge,ElTooltip:J,ElButton:L,ImagePreview:G},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")}}}),is={class:"preview"},ls={class:"left"},as={class:"main"},rs={class:"bot"},cs={class:"datetime"},ds={class:"info"},ms={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},ps={key:1,class:"prompt mt-2"},us={key:0},gs={key:1},fs={key:0,class:R({content:!0,failed:!0})},hs={key:0,class:"mb-4"},_s={key:1,class:R({operations:!0,"mt-2":!0})},$s={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},vs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ks={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},bs={key:1,class:R({content:!0})},ys={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ws={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Cs={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Vs={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Ss={key:2,class:R({content:!0})},Ts={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Is={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Es(e,t,s,a,u,$){const c=o("el-image"),p=o("image-preview"),f=o("video-player"),d=o("el-button"),v=o("el-tooltip"),g=o("font-awesome-icon"),_=o("copy-to-clipboard"),M=o("el-alert");return l(),m("div",is,[i("div",ls,[n(c,{src:"https://cdn.acedata.cloud/qpbbbb.jpg",class:"avatar"})]),i("div",as,[i("div",rs,[w(r(e.$t("kling.name.klingBot"))+" ",1),i("span",cs,r(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),i("div",ds,[e.referenceImages.length>0?(l(),m("div",ms,[(l(!0),m(T,null,I(e.referenceImages,(U,O)=>(l(),V(p,{key:O,url:U.url,name:U.name,closable:!1},null,8,["url","name"]))),128))])):k("",!0),e.modelValue?.request?.prompt?(l(),m("p",ps,[w(r(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?k("",!0):(l(),m("span",us," - ("+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"?(l(),m("span",gs," - ("+r(e.$t("kling.status.processing"))+") ",1)):k("",!0)])):k("",!0)]),e.modelValue?.response?.success===!0?(l(),m("div",fs,[e.modelValue?.response.video_url?(l(),m("div",hs,[n(f,{src:e.modelValue?.response.video_url},null,8,["src"])])):k("",!0),e.modelValue?.response.success?(l(),m("div",_s,[n(v,{class:"box-item",effect:"dark",content:e.$t("kling.message.downloadVideo"),placement:"top-start"},{default:h(()=>[e.modelValue?.response.video_url?(l(),V(d,{key:0,type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=U=>e.onDownload(U,e.modelValue?.response.video_url))},{default:h(()=>[w(r(e.$t("kling.button.download")),1)]),_:1})):k("",!0)]),_:1},8,["content"])])):k("",!0),n(M,{closable:!1,class:"mt-2 success"},{default:h(()=>[i("p",$s,[n(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.model"))+": "+r(e.modelValue?.request?.model),1)]),i("p",vs,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(l(),m("p",ks,[n(g,{icon:"fa-solid fa-clock",class:"mr-1"}),w(" "+r(e.$t("kling.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):k("",!0)]),_:1})])):k("",!0),e.modelValue?.response?.success===!1?(l(),m("div",bs,[n(M,{closable:!1,class:"failure"},{template:h(()=>[n(g,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),w(" "+r(e.$t("kling.name.failure")),1)]),default:h(()=>[i("p",ys,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),i("p",ws,[n(g,{icon:"fa-solid fa-circle-info",class:"mr-1"}),w(" "+r(e.$t("kling.name.failureReason"))+": "+r(e.modelValue?.response?.error?.message)+" ",1),n(_,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(l(),m("p",Cs,[n(g,{icon:"fa-solid fa-clock",class:"mr-1"}),w(" "+r(e.$t("kling.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):k("",!0),e.modelValue?.response?.trace_id?(l(),m("p",Vs,[n(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(_,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):k("",!0)]),_:1})])):k("",!0),e.modelValue?.response?.success===void 0?(l(),m("div",Ss,[n(M,{closable:!1,class:"info"},{template:h(()=>[n(g,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),w(" "+r(e.$t("kling.name.failure")),1)]),default:h(()=>[i("p",Ts,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.response?.trace_id?(l(),m("p",Is,[n(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(_,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):k("",!0)]),_:1})])):k("",!0)])])}const Ls=y(ss,[["render",Es],["__scopeId","data-v-e8e87659"]]),Ms=b({name:"RecentPanel",components:{TaskPreview:Ls,NoTasks:Ne,BotPlaceholder:je,ScrollList:Le},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?.()}}}),Us={key:0},Rs={key:2,class:"w-full h-full flex items-center justify-center"};function As(e,t,s,a,u,$){const c=o("bot-placeholder"),p=o("task-preview"),f=o("scroll-list"),d=o("no-tasks");return l(),m(T,null,[e.tasks?.items===void 0?(l(),m("div",Us,[n(c)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(l(),V(f,{key:1,ref:"scrollList",class:"h-full w-full overflow-y-auto tasks",loading:e.loading,onReachTop:t[0]||(t[0]=v=>e.$emit("reach-top"))},{default:h(()=>[(l(!0),m(T,null,I(e.tasks?.items,v=>(l(),V(p,{key:v.id,"model-value":v},null,8,["model-value"]))),128))]),_:1},8,["loading"])):k("",!0),e.tasks?.items?.length===0?(l(),m("div",Rs,[n(d)])):k("",!0)],64)}const Ps=y(Ms,[["render",As]]),de="https://webhook.acedata.cloud/kling",Ds=b({name:"KlingIndex",components:{ConfigPanel:an,MotionPanel:Zn,TabSwitcher:ns,Layout:Je,RecentPanel:Ps},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===oe.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===oe.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 Be({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:a}=e||{};console.debug("limit",t,"createdAtMin",s,"createdAtMax",a),this.fetchingTasks=!0;try{await this.$store.dispatch("kling/getTasks",{limit:t,createdAtMin:s,createdAtMax:a})}finally{this.fetchingTasks=!1}},async onGenerate(){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){C.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 a=this.credential?.token;if(!a){console.error("no token specified");return}C.info(this.$t("kling.message.startingTask")),te("kling",ie.generate(s,{token:a})).then(()=>{C.success(this.$t("kling.message.startTaskSuccess"))}).catch(u=>{u?.response?.data?.error?.code===se?C.error(this.$t("kling.message.usedUp")):C.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(){const e=this.motionConfig||{};if(!e.image_url||!e.video_url){C.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}C.info(this.$t("kling.message.startingTask")),te("kling",ie.motion(t,{token:s})).then(()=>{C.success(this.$t("kling.message.startTaskSuccess"))}).catch(a=>{a?.response?.data?.error?.code===se?C.error(this.$t("kling.message.usedUp")):C.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),Gs={class:"flex flex-col h-full"},Ks={class:"flex-1 min-h-0"};function Os(e,t,s,a,u,$){const c=o("tab-switcher"),p=o("config-panel"),f=o("motion-panel"),d=o("recent-panel"),v=o("layout");return l(),V(v,null,{config:h(()=>[i("div",Gs,[n(c,{"model-value":e.taskType,"onUpdate:modelValue":e.onTabChange},null,8,["model-value","onUpdate:modelValue"]),i("div",Ks,[e.taskType==="videos"?(l(),V(p,{key:0,onGenerate:e.onGenerate},null,8,["onGenerate"])):e.taskType==="motion"?(l(),V(f,{key:1,onGenerate:e.onGenerateMotion},null,8,["onGenerate"])):k("",!0)])])]),result:h(()=>[n(d,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Bi=y(Ds,[["render",Os]]);export{Bi as default};
@@ -1 +1 @@
1
- import{F as C}from"./index.es-B8lllT8g.js";import{E as D}from"./index-CLjidAQE.js";import{E as H}from"./index-BQUmbWLp.js";import{d as E,H as i,E as l,z as q,C as s,y as g,D as n,q as a,F as o,I as u,O as y,N as V,x as w,J as $,M as W,Q as A}from"./vendor-vue-NSDaktjZ.js";import{E as k,b7 as K,cA as Z,cB as J,cC as X,cD as Q,cE as Y,cF as ee,cG as te,cH as z,cI as G,cJ as U,cK as P,cL as se,cM as O,cN as oe,cO as F,cd as ae,aw as j}from"./index-C_v1q0BD.js";import{I as L,S as ne}from"./ScrollList-DOuthhHU.js";import{E as re}from"./index-pbL6e1hu.js";import{p as le}from"./pasteUploadMixin-BurWbGNQ.js";import{I as B}from"./ImagePreview-EH_qYPnG.js";import{E as ie}from"./index-D74kR9sB.js";import{E as I}from"./index-BrkgdX_b.js";import{C as ce}from"./Consumption-BZ1Dt-cb.js";import{a as me}from"./price-DCHXyooY.js";import{E as x,a as N}from"./index-DqImj4-b.js";import{E as de}from"./index-qubKta0-.js";import{b as ue}from"./errorCode-Cqj9Td_Z.js";import{s as pe}from"./seedream-BGm0jO7p.js";import{C as fe}from"./CopyToClipboard-Bk4yijTq.js";import{I as _e}from"./ImageWrapper-DmFaZfvA.js";import{E as he}from"./index-Dkxi8Dfe.js";import{E as ge}from"./index-DX-J6pr9.js";import{E as $e}from"./index-Ypw-t9F1.js";import{B as ve}from"./BotPlaceholder-CnVO8Q0c.js";import{N as be}from"./NoTasks-B2i1NH2w.js";import"./use-form-item-C6oldTyX.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-Cvgzdobq.js";import"./vendor-vue-router-Kg6s1a65.js";import"./typescript-BUlvNdio.js";import"./index-Ia3tM0sZ.js";import"./index-BTlYBKez.js";import"./index-CoOKzE4H.js";import"./_baseClone-D8csUT6N.js";import"./_Uint8Array-CSh_O3rU.js";import"./_initCloneObject-CpKLZJ5e.js";import"./isEqual-C0Ho5H9R.js";import"./index-xCG3aIBW.js";import"./strings-beZM2Y-f.js";import"./castArray-nEBWukcG.js";import"./debounce-Dl6XTDwu.js";import"./_baseIteratee-BF_69MFR.js";import"./index-Dc4hCp__.js";import"./index-Cu41y2Fl.js";import"./index-C5OZLrMF.js";const Ee=E({name:"LayoutSeedream",components:{ElDrawer:H,ElButton:D,FontAwesomeIcon:C},data(){return{drawer:!1}}}),ke={class:"main flex flex-row flex-1"},ye={class:"config w-[320px] h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},we={class:"result h-full p-6 flex-1 flex flex-col bg-[var(--app-content-bg)]"};function Se(e,t,d,c,p,f){const _=n("font-awesome-icon"),h=n("el-button"),r=n("el-drawer");return a(),i("div",ke,[l("div",ye,[q(e.$slots,"config",{},void 0,!0)]),l("div",we,[q(e.$slots,"result",{},void 0,!0)]),s(h,{circle:"",class:"menu",onClick:t[0]||(t[0]=m=>e.drawer=!0)},{default:g(()=>[s(_,{icon:"fa-solid fa-magic"})]),_:1}),s(r,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=m=>e.drawer=m),direction:"ltr","with-header":!1,size:"340px",class:"drawer"},{default:g(()=>[q(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Ie=k(Ee,[["render",Se],["__scopeId","data-v-5ff0c320"]]),Ve="",Me=E({name:"SeedreamPromptInput",components:{ElInput:re,InfoIcon:L},computed:{prompt:{get(){return this.$store.state.seedream?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=Ve)}}),Ae={class:"field"},Le={class:"box"},Re={class:"title font-bold"};function Te(e,t,d,c,p,f){const _=n("info-icon"),h=n("el-input");return a(),i("div",Ae,[l("div",Le,[l("h2",Re,o(e.$t("seedream.name.prompt")),1),s(_,{content:e.$t("seedream.description.prompt"),class:"info"},null,8,["content"])]),s(h,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=r=>e.prompt=r),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("seedream.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const Ce=k(Me,[["render",Te],["__scopeId","data-v-5559520a"]]),De=E({name:"SeedreamImageInput",components:{ElUpload:ie,ElButton:D,InfoIcon:L,ImagePreview:B,FontAwesomeIcon:C},mixins:[le],data(){return{fileList:[],uploadUrl:K()+"/api/v1/files/",suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.seedream?.config?.image}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){const c=(this.fileList||[]).filter(p=>!p?.response?.file_url);this.fileList=c.length?c:[];return}const t=[];e.forEach(c=>{const p=this.fileList.find(f=>f?.response?.file_url===c||f?.url===c);p?t.push(p):t.push({name:c.split("/").pop()||c,url:c,status:"success",percentage:100,response:{file_url:c}})}),(this.fileList||[]).filter(c=>!c?.response?.file_url).forEach(c=>{t.some(f=>f===c||f?.url===c?.url||f?.response?.file_url===c?.response?.file_url)||t.push(c)}),this.fileList=t}}},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url=="string"&&e.url.startsWith("blob:"))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImages()},onExceed(){I.warning(this.$t("seedream.message.uploadImageExceed"))},onError(){I.error(this.$t("seedream.message.uploadImageError"))},onSetImages(){const e=this.urls;this.suppressWatch=!0,this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,image:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImages()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url=="string"&&t.url.startsWith("blob:"))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImages()}}}),qe={class:"field"},ze={class:"label"},Ge={class:"box"},Ue={class:"title font-bold"},Pe={class:"value"},Oe={class:"file-list mt-2 flex flex-wrap gap-[10px]"};function je(e,t,d,c,p,f){const _=n("info-icon"),h=n("font-awesome-icon"),r=n("el-button"),m=n("el-upload"),b=n("image-preview");return a(),i(y,null,[l("div",qe,[l("div",ze,[l("div",Ge,[l("h2",Ue,o(e.$t("seedream.name.imageUrls")),1),s(_,{content:e.$t("seedream.description.imageUrls"),class:"info"},null,8,["content"])])]),l("div",Pe,[s(m,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=v=>e.fileList=v),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",limit:14,multiple:!0,"show-file-list":!1,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,"on-change":e.onChange,"on-remove":e.onRemove,headers:e.headers},{default:g(()=>[s(r,{size:"small",type:"primary",round:""},{default:g(()=>[s(h,{icon:"fa-solid fa-upload",class:"mr-1"}),u(" "+o(e.$t("seedream.button.uploadImageUrls")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","on-change","on-remove","headers"])])]),l("div",Oe,[(a(!0),i(y,null,V(e.fileList,(v,S)=>(a(),w(b,{key:v.uid||v?.response?.file_url||v.url||S,url:v.url||v?.response?.file_url,name:v.name,percentage:v.percentage,onRemove:R=>e.onRemovePreview(S,v)},null,8,["url","name","percentage","onRemove"]))),128))])],64)}const Fe=k(De,[["render",je],["__scopeId","data-v-dc18c674"]]),Be=E({name:"SeedreamModelSelector",components:{ElSelect:N,ElOption:x,InfoIcon:L},data(){return{options:[{value:J,label:this.$t("seedream.model.seedream50")},{value:X,label:this.$t("seedream.model.seedream45")},{value:Q,label:this.$t("seedream.model.seedream40")},{value:Y,label:this.$t("seedream.model.seedream30t2i")},{value:ee,label:this.$t("seedream.model.seededit30i2i")}]}},computed:{value:{get(){return this.$store.state.seedream?.config?.model},set(e){this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,model:e})}}},mounted(){this.value||(this.value=Z)}}),xe={class:"field"},Ne={class:"label"},He={class:"box"},We={class:"title font-bold"};function Ke(e,t,d,c,p,f){const _=n("info-icon"),h=n("el-option"),r=n("el-select");return a(),i("div",xe,[l("div",Ne,[l("div",He,[l("h2",We,o(e.$t("seedream.name.model")),1),s(_,{content:e.$t("seedream.description.model"),class:"info"},null,8,["content"])])]),s(r,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=m=>e.value=m),class:"value",placeholder:e.$t("seedream.placeholder.select")},{default:g(()=>[(a(!0),i(y,null,V(e.options,m=>(a(),w(h,{key:m.value,label:m.label,value:m.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Ze=k(Be,[["render",Ke],["__scopeId","data-v-609ade55"]]),Je=E({name:"SeedreamSizeSelector",components:{ElSelect:N,ElOption:x,InfoIcon:L},data(){return{options:[{value:z,label:z},{value:G,label:G},{value:U,label:U},{value:P,label:P}]}},computed:{value:{get(){return this.$store.state.seedream?.config?.size},set(e){this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,size:e})}}},mounted(){this.value||(this.value=te)}}),Xe={class:"field"},Qe={class:"label"},Ye={class:"box"},et={class:"title font-bold"};function tt(e,t,d,c,p,f){const _=n("info-icon"),h=n("el-option"),r=n("el-select");return a(),i("div",Xe,[l("div",Qe,[l("div",Ye,[l("h2",et,o(e.$t("seedream.name.size")),1),s(_,{content:e.$t("seedream.description.size"),class:"info"},null,8,["content"])])]),s(r,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=m=>e.value=m),class:"value",placeholder:e.$t("seedream.placeholder.select"),filterable:"","allow-create":"","default-first-option":""},{default:g(()=>[(a(!0),i(y,null,V(e.options,m=>(a(),w(h,{key:m.value,label:m.label,value:m.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const st=k(Je,[["render",tt],["__scopeId","data-v-44d5c9d9"]]),ot=E({name:"SeedreamMaxImagesSelector",components:{ElInputNumber:de,InfoIcon:L},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return oe(this.config?.model)},referenceImageCount(){const e=this.config?.image;return Array.isArray(e)?e.length:0},effectiveMax(){const e=O-this.referenceImageCount;return Math.max(1,Math.min(O,e))},value:{get(){const e=this.config?.sequential_image_generation_options?.max_images;return typeof e=="number"&&e>=1?e:se},set(e){const t={...this.config||{}},d=Math.max(1,Math.min(this.effectiveMax,Math.floor(e||1)));d>1?(t.sequential_image_generation="auto",t.sequential_image_generation_options={...t.sequential_image_generation_options||{},max_images:d}):(t.sequential_image_generation="disabled",t.sequential_image_generation_options&&delete t.sequential_image_generation_options),this.$store.commit("seedream/setConfig",t)}}},watch:{supported:{immediate:!0,handler(e){if(e)return;const t={...this.config||{}};let d=!1;t.sequential_image_generation&&(delete t.sequential_image_generation,d=!0),t.sequential_image_generation_options&&(delete t.sequential_image_generation_options,d=!0),d&&this.$store.commit("seedream/setConfig",t)}},effectiveMax(e){this.value>e&&(this.value=e)}}}),at={key:0,class:"field"},nt={class:"label"},rt={class:"box"},lt={class:"title font-bold"},it={class:"value"};function ct(e,t,d,c,p,f){const _=n("info-icon"),h=n("el-input-number");return e.supported?(a(),i("div",at,[l("div",nt,[l("div",rt,[l("h2",lt,o(e.$t("seedream.name.maxImages")),1),s(_,{content:e.$t("seedream.description.maxImages"),class:"info"},null,8,["content"])])]),l("div",it,[s(h,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=r=>e.value=r),min:1,max:e.effectiveMax,step:1,size:"default","controls-position":"right",class:"counter"},null,8,["modelValue","max"])])])):$("",!0)}const mt=k(ot,[["render",ct],["__scopeId","data-v-17ef8d1a"]]),dt=E({name:"SeedreamConfigPanel",components:{ElButton:D,FontAwesomeIcon:C,PromptInput:Ce,Consumption:ce,ImageInput:Fe,ModelSelector:Ze,SizeSelector:st,MaxImagesSelector:mt},emits:["generate"],computed:{config(){return this.$store.state.seedream?.config},consumption(){const e={...this.config||{}},t=Array.isArray(e?.image)&&e.image.length>0,d=e?.sequential_image_generation==="auto"?Math.max(1,Math.floor(e?.sequential_image_generation_options?.max_images||1)):1;return me({...e,action:t?"edit":"generate",model:F(e?.model),count:d},this.service?.cost)},service(){return this.$store.state.seedream?.service}},methods:{onGenerate(){this.$emit("generate")}}}),ut={class:"flex flex-col h-full"},pt={class:"flex-1 overflow-y-auto p-5"},ft={class:"flex flex-col items-center justify-center px-5 pb-5"};function _t(e,t,d,c,p,f){const _=n("model-selector"),h=n("size-selector"),r=n("max-images-selector"),m=n("prompt-input"),b=n("image-input"),v=n("consumption"),S=n("font-awesome-icon"),R=n("el-button");return a(),i("div",ut,[l("div",pt,[s(_,{class:"mb-4"}),s(h,{class:"mb-4"}),s(r,{class:"mb-4"}),s(m,{class:"mb-4"}),s(b,{class:"mb-4"})]),l("div",ft,[s(v,{value:e.consumption,service:e.service},null,8,["value","service"]),s(R,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:g(()=>[s(S,{icon:"fa-solid fa-magic",class:"mr-2"}),u(" "+o(e.$t("seedream.button.generate")),1)]),_:1},8,["onClick"])])])}const ht=k(dt,[["render",_t]]),gt=E({name:"SeedreamTaskPreview",components:{ElImage:$e,CopyToClipboard:fe,FontAwesomeIcon:C,ElAlert:ge,ImageWrapper:_e,ElButton:D,ElTooltip:he,ImagePreview:B},props:{modelValue:{type:Object,required:!0}},computed:{isEdit(){return Array.isArray(this.modelValue?.request?.image)&&(this.modelValue?.request?.image?.length||0)>0},images(){const e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{e.push(t)}),e}},methods:{shortModel(e){return F(e)||e},onEdit(e){if(!e)return;console.debug("Edit image:",e);const t={...this.$store.state.seedream?.config||{}};t.image=[e],this.$store.commit("seedream/setConfig",t)}}}),$t={class:"preview"},vt={class:"left"},bt={class:"main"},Et={class:"bot"},kt={class:"datetime"},yt={class:"info"},wt={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},St={key:1,class:"prompt mt-2"},It={key:0},Vt={key:0,class:A({content:!0})},Mt={class:"text-[var(--el-text-color-regular)] text-xs mb-0"},At={key:1,class:A({content:!0,failed:!0})},Lt={class:"flex justify-start items-center gap-4 w-full overflow-x-auto"},Rt={class:A({operations:!0,"mt-2":!0,"mb-2":!0})},Tt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ct={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Dt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},qt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},zt={key:2,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Gt={key:3,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Ut={key:2,class:A({content:!0})},Pt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ot={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},jt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ft={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Bt={key:2,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},xt={key:3,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Nt={key:4,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Ht={key:3,class:A({content:!0})},Wt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Kt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Zt(e,t,d,c,p,f){const _=n("el-image"),h=n("image-preview"),r=n("font-awesome-icon"),m=n("copy-to-clipboard"),b=n("el-alert"),v=n("image-wrapper"),S=n("el-button"),R=n("el-tooltip");return a(),i("div",$t,[l("div",vt,[s(_,{src:"https://cdn.acedata.cloud/9egrbn.png",class:"avatar"})]),l("div",bt,[l("div",Et,[u(o(e.$t("seedream.name.seedreamBot"))+" ",1),l("span",kt,o(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),l("div",yt,[Array.isArray(e.modelValue?.request?.image)&&e.modelValue?.request?.image.length>0?(a(),i("div",wt,[(a(!0),i(y,null,V(e.modelValue?.request?.image,(M,T)=>(a(),w(h,{key:T,url:M,name:`image-${T+1}`,closable:!1},null,8,["url","name"]))),128))])):$("",!0),e.modelValue?.request?.prompt?(a(),i("p",St,[u(o(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?$("",!0):(a(),i("span",It," - ("+o(e.$t("seedream.status.pending"))+") ",1))])):$("",!0)]),e.modelValue?.response?e.modelValue?.response?.success===!0?(a(),i("div",At,[l("div",Lt,[(a(!0),i(y,null,V(e.images,(M,T)=>(a(),w(v,{key:T,src:M?.image_url,"raw-src":M?.image_url},null,8,["src","raw-src"]))),128))]),l("div",Rt,[s(R,{class:"box-item",effect:"dark",content:e.$t("common.button.edit"),placement:"top-start"},{default:g(()=>[s(S,{type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=W(M=>e.onEdit(e.images?.[0]?.image_url),["stop"]))},{default:g(()=>[u(o(e.$t("common.button.edit")),1)]),_:1})]),_:1},8,["content"])]),s(b,{closable:!1,class:"mt-2 success"},{default:g(()=>[e.modelValue?.request?.model?(a(),i("p",Tt,[s(r,{icon:"fa-solid fa-cube",class:"mr-1"}),u(" "+o(e.$t("seedream.name.model"))+": "+o(e.shortModel(e.modelValue?.request?.model)),1)])):$("",!0),e.modelValue?.request?.size?(a(),i("p",Ct,[s(r,{icon:"fa-solid fa-image",class:"mr-1"}),u(" "+o(e.$t("seedream.name.size"))+": "+o(e.modelValue?.request?.size),1)])):$("",!0),l("p",Dt,[s(r,{icon:"fa-solid fa-bolt",class:"mr-1"}),u(" "+o(e.$t("seedream.name.task"))+": "+o(e.isEdit?e.$t("seedream.name.edits"):e.$t("seedream.name.generate")),1)]),l("p",qt,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])]),e.modelValue?.elapsed?(a(),i("p",zt,[s(r,{icon:"fa-solid fa-clock",class:"mr-1"}),u(" "+o(e.$t("seedream.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0),e.modelValue?.response?.trace_id?(a(),i("p",Gt,[s(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),u(" "+o(e.$t("seedream.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),s(m,{content:e.modelValue?.response?.trace_id,class:"btn-copy inline-block"},null,8,["content"])])):$("",!0)]),_:1})])):e.modelValue?.response?.success===!1?(a(),i("div",Ut,[s(b,{closable:!1,class:"failure"},{template:g(()=>[s(r,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),u(" "+o(e.$t("seedream.name.failure")),1)]),default:g(()=>[e.modelValue?.request?.model?(a(),i("p",Pt,[s(r,{icon:"fa-solid fa-cube",class:"mr-1"}),u(" "+o(e.$t("seedream.name.model"))+": "+o(e.shortModel(e.modelValue?.request?.model)),1)])):$("",!0),e.modelValue?.request?.size?(a(),i("p",Ot,[s(r,{icon:"fa-solid fa-image",class:"mr-1"}),u(" "+o(e.$t("seedream.name.size"))+": "+o(e.modelValue?.request?.size),1)])):$("",!0),l("p",jt,[s(r,{icon:"fa-solid fa-bolt",class:"mr-1"}),u(" "+o(e.$t("seedream.name.task"))+": "+o(e.isEdit?e.$t("seedream.name.edits"):e.$t("seedream.name.generate")),1)]),l("p",Ft,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.response?.error?.message?(a(),i("p",Bt,[s(r,{icon:"fa-solid fa-circle-info",class:"mr-1"}),u(" "+o(e.$t("seedream.name.failureReason"))+": "+o(e.modelValue?.response?.error?.message)+" ",1),s(m,{content:e.modelValue?.response?.error?.message,class:"btn-copy"},null,8,["content"])])):$("",!0),e.modelValue?.elapsed?(a(),i("p",xt,[s(r,{icon:"fa-solid fa-clock",class:"mr-1"}),u(" "+o(e.$t("seedream.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0),e.modelValue?.response?.trace_id?(a(),i("p",Nt,[s(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),u(" "+o(e.$t("seedream.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),s(m,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])):$("",!0)]),_:1})])):(a(),i("div",Ht,[s(b,{closable:!1,class:"info"},{template:g(()=>[s(r,{icon:"fa-solid fa-circle-info",class:"mr-1"}),u(" "+o(e.$t("seedream.name.status")),1)]),default:g(()=>[l("p",Wt,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.response?.trace_id?(a(),i("p",Kt,[s(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),u(" "+o(e.$t("seedream.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),s(m,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])):$("",!0)]),_:1})])):(a(),i("div",Vt,[s(b,{closable:!1,class:"info"},{template:g(()=>[s(r,{icon:"fa-regular fa-clock",class:"mr-1"}),u(" "+o(e.$t("seedream.status.pending")),1)]),default:g(()=>[l("p",Mt,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])])]),_:1})]))])])}const Jt=k(gt,[["render",Zt],["__scopeId","data-v-0dfc6a09"]]),Xt=E({name:"SeedreamRecentPanel",components:{TaskPreview:Jt,BotPlaceholder:ve,NoTasks:be,ScrollList:ne},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],computed:{tasks(){return{...this.$store.state.seedream?.tasks,items:this.$store.state.seedream?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Qt={key:0},Yt={key:2,class:"w-full h-full flex items-center justify-center"};function es(e,t,d,c,p,f){const _=n("bot-placeholder"),h=n("task-preview"),r=n("scroll-list"),m=n("no-tasks");return a(),i(y,null,[e.tasks?.items===void 0?(a(),i("div",Qt,[s(_)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(a(),w(r,{key:1,ref:"scrollList",class:"tasks h-full w-full overflow-y-auto",loading:e.loading,onReachTop:t[0]||(t[0]=b=>e.$emit("reach-top"))},{default:g(()=>[(a(!0),i(y,null,V(e.tasks?.items,b=>(a(),w(h,{key:b.id,"model-value":b},null,8,["model-value"]))),128))]),_:1},8,["loading"])):$("",!0),e.tasks?.items?.length===0?(a(),i("div",Yt,[s(m)])):$("",!0)],64)}const ts=k(Xt,[["render",es]]),ss="https://webhook.acedata.cloud/seedream",os=E({name:"SeedreamIndex",components:{ConfigPanel:ht,Layout:Ie,RecentPanel:ts},inject:["initialized"],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.seedream?.status?.getApplications===j.Request},tasksLoading(){return this.$store.state.seedream?.status?.getTasks===j.Request},credential(){return this.$store.state.seedream?.credential},config(){return this.$store.state.seedream?.config},application(){return this.$store.state.seedream?.application},tasks(){return this.$store.state.seedream?.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(){if(console.debug("reached top"),this.loading||this.tasksLoading)return;const e=this.tasks?.total,t=this.tasks?.items?.length||0;if(e!==void 0&&e<=t)return;const d=this.tasks?.items?.[0];if(!d?.created_at)return;const p=this.$refs.recentPanel?.getScrollElement?.(),f=p?.scrollHeight||0,_=p?.scrollTop||0;this.loading=!0;try{if(await this.onGetTasks({createdAtMax:d.created_at}),await this.$nextTick(),p){const h=p.scrollHeight;p.scrollTop=h-f+_}}finally{this.loading=!1}},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("seedream/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("seedream/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.tasksLoading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=20,createdAtMin:d,createdAtMax:c}=e||{};console.debug("limit",t,"createdAtMin",d,"createdAtMax",c),await this.$store.dispatch("seedream/getTasks",{limit:t,createdAtMin:d,createdAtMax:c})},async onGenerate(){const e={...this.config||{}};!(Array.isArray(e?.image)&&e.image.length>0)&&"image"in e&&delete e.image,e?.size||delete e.size;const d={...e,callback_url:ss},c=this.credential?.token;if(!c){console.error("no token specified");return}I.info(this.$t("seedream.message.startingTask")),ae("seedream",pe.generate(d,{token:c})).then(()=>{I.success(this.$t("seedream.message.startTaskSuccess"))}).catch(p=>{const f=p?.response?.data;f?.error?.code===ue?I.error(this.$t("seedream.message.usedUp")):I.error(this.$t("seedream.message.startTaskFailed")+(f?.error?.message||""))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function as(e,t,d,c,p,f){const _=n("config-panel"),h=n("recent-panel"),r=n("layout");return a(),w(r,null,{config:g(()=>[s(_,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:g(()=>[s(h,{ref:"recentPanel",loading:e.loading,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Js=k(os,[["render",as]]);export{Js as default};
1
+ import{F as C}from"./index.es-sH5Gh1j5.js";import{E as D}from"./index-ma8m8GLT.js";import{E as H}from"./index-Dn_CcntF.js";import{d as E,H as i,E as l,z as q,C as s,y as g,D as n,q as a,F as o,I as u,O as y,N as V,x as w,J as $,M as W,Q as A}from"./vendor-vue-NSDaktjZ.js";import{E as k,b7 as K,cA as Z,cB as J,cC as X,cD as Q,cE as Y,cF as ee,cG as te,cH as z,cI as G,cJ as U,cK as P,cL as se,cM as O,cN as oe,cO as F,cd as ae,aw as j}from"./index-zbbUR5es.js";import{I as L,S as ne}from"./ScrollList-bxgGqvg5.js";import{E as re}from"./index-BBvtDo3a.js";import{p as le}from"./pasteUploadMixin-BurWbGNQ.js";import{I as B}from"./ImagePreview-DANgdSKv.js";import{E as ie}from"./index-DsXIVBQ0.js";import{E as I}from"./index-Bf9PIvnp.js";import{C as ce}from"./Consumption-CUldncy6.js";import{a as me}from"./price-ZnUNDmOU.js";import{E as x,a as N}from"./index-gZqSePZ-.js";import{E as de}from"./index-Dh5g13xz.js";import{b as ue}from"./errorCode-Cqj9Td_Z.js";import{s as pe}from"./seedream-BMe8Cyll.js";import{C as fe}from"./CopyToClipboard-CPcOPXkP.js";import{I as _e}from"./ImageWrapper-CtrC-pbw.js";import{E as he}from"./index-DqQE5t_f.js";import{E as ge}from"./index-C-YyEjOK.js";import{E as $e}from"./index-C96Gkhlw.js";import{B as ve}from"./BotPlaceholder-DVC0W4uX.js";import{N as be}from"./NoTasks-BafA5FPC.js";import"./use-form-item-DsrOsrL-.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-Cvgzdobq.js";import"./vendor-vue-router-Kg6s1a65.js";import"./typescript-DgSJWeBe.js";import"./index-CthC0a0-.js";import"./index-uaiBAFRV.js";import"./index-4UBoy_LI.js";import"./_baseClone-DP9c_05H.js";import"./_Uint8Array-CxCVqXtT.js";import"./_initCloneObject-CVS8NsJG.js";import"./isEqual-Bvy1Dbnl.js";import"./index-PzNhCjB3.js";import"./strings-beZM2Y-f.js";import"./castArray-DQxrz7K8.js";import"./debounce-CGEoxqi1.js";import"./_baseIteratee-DWaEFucS.js";import"./index-Bs58BkYp.js";import"./index-Cu41y2Fl.js";import"./index-9E31E00G.js";const Ee=E({name:"LayoutSeedream",components:{ElDrawer:H,ElButton:D,FontAwesomeIcon:C},data(){return{drawer:!1}}}),ke={class:"main flex flex-row flex-1"},ye={class:"config w-[320px] h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},we={class:"result h-full p-6 flex-1 flex flex-col bg-[var(--app-content-bg)]"};function Se(e,t,d,c,p,f){const _=n("font-awesome-icon"),h=n("el-button"),r=n("el-drawer");return a(),i("div",ke,[l("div",ye,[q(e.$slots,"config",{},void 0,!0)]),l("div",we,[q(e.$slots,"result",{},void 0,!0)]),s(h,{circle:"",class:"menu",onClick:t[0]||(t[0]=m=>e.drawer=!0)},{default:g(()=>[s(_,{icon:"fa-solid fa-magic"})]),_:1}),s(r,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=m=>e.drawer=m),direction:"ltr","with-header":!1,size:"340px",class:"drawer"},{default:g(()=>[q(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Ie=k(Ee,[["render",Se],["__scopeId","data-v-5ff0c320"]]),Ve="",Me=E({name:"SeedreamPromptInput",components:{ElInput:re,InfoIcon:L},computed:{prompt:{get(){return this.$store.state.seedream?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=Ve)}}),Ae={class:"field"},Le={class:"box"},Re={class:"title font-bold"};function Te(e,t,d,c,p,f){const _=n("info-icon"),h=n("el-input");return a(),i("div",Ae,[l("div",Le,[l("h2",Re,o(e.$t("seedream.name.prompt")),1),s(_,{content:e.$t("seedream.description.prompt"),class:"info"},null,8,["content"])]),s(h,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=r=>e.prompt=r),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("seedream.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const Ce=k(Me,[["render",Te],["__scopeId","data-v-5559520a"]]),De=E({name:"SeedreamImageInput",components:{ElUpload:ie,ElButton:D,InfoIcon:L,ImagePreview:B,FontAwesomeIcon:C},mixins:[le],data(){return{fileList:[],uploadUrl:K()+"/api/v1/files/",suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.seedream?.config?.image}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){const c=(this.fileList||[]).filter(p=>!p?.response?.file_url);this.fileList=c.length?c:[];return}const t=[];e.forEach(c=>{const p=this.fileList.find(f=>f?.response?.file_url===c||f?.url===c);p?t.push(p):t.push({name:c.split("/").pop()||c,url:c,status:"success",percentage:100,response:{file_url:c}})}),(this.fileList||[]).filter(c=>!c?.response?.file_url).forEach(c=>{t.some(f=>f===c||f?.url===c?.url||f?.response?.file_url===c?.response?.file_url)||t.push(c)}),this.fileList=t}}},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url=="string"&&e.url.startsWith("blob:"))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImages()},onExceed(){I.warning(this.$t("seedream.message.uploadImageExceed"))},onError(){I.error(this.$t("seedream.message.uploadImageError"))},onSetImages(){const e=this.urls;this.suppressWatch=!0,this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,image:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImages()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url=="string"&&t.url.startsWith("blob:"))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImages()}}}),qe={class:"field"},ze={class:"label"},Ge={class:"box"},Ue={class:"title font-bold"},Pe={class:"value"},Oe={class:"file-list mt-2 flex flex-wrap gap-[10px]"};function je(e,t,d,c,p,f){const _=n("info-icon"),h=n("font-awesome-icon"),r=n("el-button"),m=n("el-upload"),b=n("image-preview");return a(),i(y,null,[l("div",qe,[l("div",ze,[l("div",Ge,[l("h2",Ue,o(e.$t("seedream.name.imageUrls")),1),s(_,{content:e.$t("seedream.description.imageUrls"),class:"info"},null,8,["content"])])]),l("div",Pe,[s(m,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=v=>e.fileList=v),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",limit:14,multiple:!0,"show-file-list":!1,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,"on-change":e.onChange,"on-remove":e.onRemove,headers:e.headers},{default:g(()=>[s(r,{size:"small",type:"primary",round:""},{default:g(()=>[s(h,{icon:"fa-solid fa-upload",class:"mr-1"}),u(" "+o(e.$t("seedream.button.uploadImageUrls")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","on-change","on-remove","headers"])])]),l("div",Oe,[(a(!0),i(y,null,V(e.fileList,(v,S)=>(a(),w(b,{key:v.uid||v?.response?.file_url||v.url||S,url:v.url||v?.response?.file_url,name:v.name,percentage:v.percentage,onRemove:R=>e.onRemovePreview(S,v)},null,8,["url","name","percentage","onRemove"]))),128))])],64)}const Fe=k(De,[["render",je],["__scopeId","data-v-dc18c674"]]),Be=E({name:"SeedreamModelSelector",components:{ElSelect:N,ElOption:x,InfoIcon:L},data(){return{options:[{value:J,label:this.$t("seedream.model.seedream50")},{value:X,label:this.$t("seedream.model.seedream45")},{value:Q,label:this.$t("seedream.model.seedream40")},{value:Y,label:this.$t("seedream.model.seedream30t2i")},{value:ee,label:this.$t("seedream.model.seededit30i2i")}]}},computed:{value:{get(){return this.$store.state.seedream?.config?.model},set(e){this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,model:e})}}},mounted(){this.value||(this.value=Z)}}),xe={class:"field"},Ne={class:"label"},He={class:"box"},We={class:"title font-bold"};function Ke(e,t,d,c,p,f){const _=n("info-icon"),h=n("el-option"),r=n("el-select");return a(),i("div",xe,[l("div",Ne,[l("div",He,[l("h2",We,o(e.$t("seedream.name.model")),1),s(_,{content:e.$t("seedream.description.model"),class:"info"},null,8,["content"])])]),s(r,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=m=>e.value=m),class:"value",placeholder:e.$t("seedream.placeholder.select")},{default:g(()=>[(a(!0),i(y,null,V(e.options,m=>(a(),w(h,{key:m.value,label:m.label,value:m.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Ze=k(Be,[["render",Ke],["__scopeId","data-v-609ade55"]]),Je=E({name:"SeedreamSizeSelector",components:{ElSelect:N,ElOption:x,InfoIcon:L},data(){return{options:[{value:z,label:z},{value:G,label:G},{value:U,label:U},{value:P,label:P}]}},computed:{value:{get(){return this.$store.state.seedream?.config?.size},set(e){this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,size:e})}}},mounted(){this.value||(this.value=te)}}),Xe={class:"field"},Qe={class:"label"},Ye={class:"box"},et={class:"title font-bold"};function tt(e,t,d,c,p,f){const _=n("info-icon"),h=n("el-option"),r=n("el-select");return a(),i("div",Xe,[l("div",Qe,[l("div",Ye,[l("h2",et,o(e.$t("seedream.name.size")),1),s(_,{content:e.$t("seedream.description.size"),class:"info"},null,8,["content"])])]),s(r,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=m=>e.value=m),class:"value",placeholder:e.$t("seedream.placeholder.select"),filterable:"","allow-create":"","default-first-option":""},{default:g(()=>[(a(!0),i(y,null,V(e.options,m=>(a(),w(h,{key:m.value,label:m.label,value:m.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const st=k(Je,[["render",tt],["__scopeId","data-v-44d5c9d9"]]),ot=E({name:"SeedreamMaxImagesSelector",components:{ElInputNumber:de,InfoIcon:L},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return oe(this.config?.model)},referenceImageCount(){const e=this.config?.image;return Array.isArray(e)?e.length:0},effectiveMax(){const e=O-this.referenceImageCount;return Math.max(1,Math.min(O,e))},value:{get(){const e=this.config?.sequential_image_generation_options?.max_images;return typeof e=="number"&&e>=1?e:se},set(e){const t={...this.config||{}},d=Math.max(1,Math.min(this.effectiveMax,Math.floor(e||1)));d>1?(t.sequential_image_generation="auto",t.sequential_image_generation_options={...t.sequential_image_generation_options||{},max_images:d}):(t.sequential_image_generation="disabled",t.sequential_image_generation_options&&delete t.sequential_image_generation_options),this.$store.commit("seedream/setConfig",t)}}},watch:{supported:{immediate:!0,handler(e){if(e)return;const t={...this.config||{}};let d=!1;t.sequential_image_generation&&(delete t.sequential_image_generation,d=!0),t.sequential_image_generation_options&&(delete t.sequential_image_generation_options,d=!0),d&&this.$store.commit("seedream/setConfig",t)}},effectiveMax(e){this.value>e&&(this.value=e)}}}),at={key:0,class:"field"},nt={class:"label"},rt={class:"box"},lt={class:"title font-bold"},it={class:"value"};function ct(e,t,d,c,p,f){const _=n("info-icon"),h=n("el-input-number");return e.supported?(a(),i("div",at,[l("div",nt,[l("div",rt,[l("h2",lt,o(e.$t("seedream.name.maxImages")),1),s(_,{content:e.$t("seedream.description.maxImages"),class:"info"},null,8,["content"])])]),l("div",it,[s(h,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=r=>e.value=r),min:1,max:e.effectiveMax,step:1,size:"default","controls-position":"right",class:"counter"},null,8,["modelValue","max"])])])):$("",!0)}const mt=k(ot,[["render",ct],["__scopeId","data-v-17ef8d1a"]]),dt=E({name:"SeedreamConfigPanel",components:{ElButton:D,FontAwesomeIcon:C,PromptInput:Ce,Consumption:ce,ImageInput:Fe,ModelSelector:Ze,SizeSelector:st,MaxImagesSelector:mt},emits:["generate"],computed:{config(){return this.$store.state.seedream?.config},consumption(){const e={...this.config||{}},t=Array.isArray(e?.image)&&e.image.length>0,d=e?.sequential_image_generation==="auto"?Math.max(1,Math.floor(e?.sequential_image_generation_options?.max_images||1)):1;return me({...e,action:t?"edit":"generate",model:F(e?.model),count:d},this.service?.cost)},service(){return this.$store.state.seedream?.service}},methods:{onGenerate(){this.$emit("generate")}}}),ut={class:"flex flex-col h-full"},pt={class:"flex-1 overflow-y-auto p-5"},ft={class:"flex flex-col items-center justify-center px-5 pb-5"};function _t(e,t,d,c,p,f){const _=n("model-selector"),h=n("size-selector"),r=n("max-images-selector"),m=n("prompt-input"),b=n("image-input"),v=n("consumption"),S=n("font-awesome-icon"),R=n("el-button");return a(),i("div",ut,[l("div",pt,[s(_,{class:"mb-4"}),s(h,{class:"mb-4"}),s(r,{class:"mb-4"}),s(m,{class:"mb-4"}),s(b,{class:"mb-4"})]),l("div",ft,[s(v,{value:e.consumption,service:e.service},null,8,["value","service"]),s(R,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:g(()=>[s(S,{icon:"fa-solid fa-magic",class:"mr-2"}),u(" "+o(e.$t("seedream.button.generate")),1)]),_:1},8,["onClick"])])])}const ht=k(dt,[["render",_t]]),gt=E({name:"SeedreamTaskPreview",components:{ElImage:$e,CopyToClipboard:fe,FontAwesomeIcon:C,ElAlert:ge,ImageWrapper:_e,ElButton:D,ElTooltip:he,ImagePreview:B},props:{modelValue:{type:Object,required:!0}},computed:{isEdit(){return Array.isArray(this.modelValue?.request?.image)&&(this.modelValue?.request?.image?.length||0)>0},images(){const e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{e.push(t)}),e}},methods:{shortModel(e){return F(e)||e},onEdit(e){if(!e)return;console.debug("Edit image:",e);const t={...this.$store.state.seedream?.config||{}};t.image=[e],this.$store.commit("seedream/setConfig",t)}}}),$t={class:"preview"},vt={class:"left"},bt={class:"main"},Et={class:"bot"},kt={class:"datetime"},yt={class:"info"},wt={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},St={key:1,class:"prompt mt-2"},It={key:0},Vt={key:0,class:A({content:!0})},Mt={class:"text-[var(--el-text-color-regular)] text-xs mb-0"},At={key:1,class:A({content:!0,failed:!0})},Lt={class:"flex justify-start items-center gap-4 w-full overflow-x-auto"},Rt={class:A({operations:!0,"mt-2":!0,"mb-2":!0})},Tt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ct={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Dt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},qt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},zt={key:2,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Gt={key:3,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Ut={key:2,class:A({content:!0})},Pt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ot={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},jt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ft={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Bt={key:2,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},xt={key:3,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Nt={key:4,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Ht={key:3,class:A({content:!0})},Wt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Kt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Zt(e,t,d,c,p,f){const _=n("el-image"),h=n("image-preview"),r=n("font-awesome-icon"),m=n("copy-to-clipboard"),b=n("el-alert"),v=n("image-wrapper"),S=n("el-button"),R=n("el-tooltip");return a(),i("div",$t,[l("div",vt,[s(_,{src:"https://cdn.acedata.cloud/9egrbn.png",class:"avatar"})]),l("div",bt,[l("div",Et,[u(o(e.$t("seedream.name.seedreamBot"))+" ",1),l("span",kt,o(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),l("div",yt,[Array.isArray(e.modelValue?.request?.image)&&e.modelValue?.request?.image.length>0?(a(),i("div",wt,[(a(!0),i(y,null,V(e.modelValue?.request?.image,(M,T)=>(a(),w(h,{key:T,url:M,name:`image-${T+1}`,closable:!1},null,8,["url","name"]))),128))])):$("",!0),e.modelValue?.request?.prompt?(a(),i("p",St,[u(o(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?$("",!0):(a(),i("span",It," - ("+o(e.$t("seedream.status.pending"))+") ",1))])):$("",!0)]),e.modelValue?.response?e.modelValue?.response?.success===!0?(a(),i("div",At,[l("div",Lt,[(a(!0),i(y,null,V(e.images,(M,T)=>(a(),w(v,{key:T,src:M?.image_url,"raw-src":M?.image_url},null,8,["src","raw-src"]))),128))]),l("div",Rt,[s(R,{class:"box-item",effect:"dark",content:e.$t("common.button.edit"),placement:"top-start"},{default:g(()=>[s(S,{type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=W(M=>e.onEdit(e.images?.[0]?.image_url),["stop"]))},{default:g(()=>[u(o(e.$t("common.button.edit")),1)]),_:1})]),_:1},8,["content"])]),s(b,{closable:!1,class:"mt-2 success"},{default:g(()=>[e.modelValue?.request?.model?(a(),i("p",Tt,[s(r,{icon:"fa-solid fa-cube",class:"mr-1"}),u(" "+o(e.$t("seedream.name.model"))+": "+o(e.shortModel(e.modelValue?.request?.model)),1)])):$("",!0),e.modelValue?.request?.size?(a(),i("p",Ct,[s(r,{icon:"fa-solid fa-image",class:"mr-1"}),u(" "+o(e.$t("seedream.name.size"))+": "+o(e.modelValue?.request?.size),1)])):$("",!0),l("p",Dt,[s(r,{icon:"fa-solid fa-bolt",class:"mr-1"}),u(" "+o(e.$t("seedream.name.task"))+": "+o(e.isEdit?e.$t("seedream.name.edits"):e.$t("seedream.name.generate")),1)]),l("p",qt,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])]),e.modelValue?.elapsed?(a(),i("p",zt,[s(r,{icon:"fa-solid fa-clock",class:"mr-1"}),u(" "+o(e.$t("seedream.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0),e.modelValue?.response?.trace_id?(a(),i("p",Gt,[s(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),u(" "+o(e.$t("seedream.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),s(m,{content:e.modelValue?.response?.trace_id,class:"btn-copy inline-block"},null,8,["content"])])):$("",!0)]),_:1})])):e.modelValue?.response?.success===!1?(a(),i("div",Ut,[s(b,{closable:!1,class:"failure"},{template:g(()=>[s(r,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),u(" "+o(e.$t("seedream.name.failure")),1)]),default:g(()=>[e.modelValue?.request?.model?(a(),i("p",Pt,[s(r,{icon:"fa-solid fa-cube",class:"mr-1"}),u(" "+o(e.$t("seedream.name.model"))+": "+o(e.shortModel(e.modelValue?.request?.model)),1)])):$("",!0),e.modelValue?.request?.size?(a(),i("p",Ot,[s(r,{icon:"fa-solid fa-image",class:"mr-1"}),u(" "+o(e.$t("seedream.name.size"))+": "+o(e.modelValue?.request?.size),1)])):$("",!0),l("p",jt,[s(r,{icon:"fa-solid fa-bolt",class:"mr-1"}),u(" "+o(e.$t("seedream.name.task"))+": "+o(e.isEdit?e.$t("seedream.name.edits"):e.$t("seedream.name.generate")),1)]),l("p",Ft,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.response?.error?.message?(a(),i("p",Bt,[s(r,{icon:"fa-solid fa-circle-info",class:"mr-1"}),u(" "+o(e.$t("seedream.name.failureReason"))+": "+o(e.modelValue?.response?.error?.message)+" ",1),s(m,{content:e.modelValue?.response?.error?.message,class:"btn-copy"},null,8,["content"])])):$("",!0),e.modelValue?.elapsed?(a(),i("p",xt,[s(r,{icon:"fa-solid fa-clock",class:"mr-1"}),u(" "+o(e.$t("seedream.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0),e.modelValue?.response?.trace_id?(a(),i("p",Nt,[s(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),u(" "+o(e.$t("seedream.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),s(m,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])):$("",!0)]),_:1})])):(a(),i("div",Ht,[s(b,{closable:!1,class:"info"},{template:g(()=>[s(r,{icon:"fa-solid fa-circle-info",class:"mr-1"}),u(" "+o(e.$t("seedream.name.status")),1)]),default:g(()=>[l("p",Wt,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.response?.trace_id?(a(),i("p",Kt,[s(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),u(" "+o(e.$t("seedream.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),s(m,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])):$("",!0)]),_:1})])):(a(),i("div",Vt,[s(b,{closable:!1,class:"info"},{template:g(()=>[s(r,{icon:"fa-regular fa-clock",class:"mr-1"}),u(" "+o(e.$t("seedream.status.pending")),1)]),default:g(()=>[l("p",Mt,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])])]),_:1})]))])])}const Jt=k(gt,[["render",Zt],["__scopeId","data-v-0dfc6a09"]]),Xt=E({name:"SeedreamRecentPanel",components:{TaskPreview:Jt,BotPlaceholder:ve,NoTasks:be,ScrollList:ne},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],computed:{tasks(){return{...this.$store.state.seedream?.tasks,items:this.$store.state.seedream?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Qt={key:0},Yt={key:2,class:"w-full h-full flex items-center justify-center"};function es(e,t,d,c,p,f){const _=n("bot-placeholder"),h=n("task-preview"),r=n("scroll-list"),m=n("no-tasks");return a(),i(y,null,[e.tasks?.items===void 0?(a(),i("div",Qt,[s(_)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(a(),w(r,{key:1,ref:"scrollList",class:"tasks h-full w-full overflow-y-auto",loading:e.loading,onReachTop:t[0]||(t[0]=b=>e.$emit("reach-top"))},{default:g(()=>[(a(!0),i(y,null,V(e.tasks?.items,b=>(a(),w(h,{key:b.id,"model-value":b},null,8,["model-value"]))),128))]),_:1},8,["loading"])):$("",!0),e.tasks?.items?.length===0?(a(),i("div",Yt,[s(m)])):$("",!0)],64)}const ts=k(Xt,[["render",es]]),ss="https://webhook.acedata.cloud/seedream",os=E({name:"SeedreamIndex",components:{ConfigPanel:ht,Layout:Ie,RecentPanel:ts},inject:["initialized"],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.seedream?.status?.getApplications===j.Request},tasksLoading(){return this.$store.state.seedream?.status?.getTasks===j.Request},credential(){return this.$store.state.seedream?.credential},config(){return this.$store.state.seedream?.config},application(){return this.$store.state.seedream?.application},tasks(){return this.$store.state.seedream?.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(){if(console.debug("reached top"),this.loading||this.tasksLoading)return;const e=this.tasks?.total,t=this.tasks?.items?.length||0;if(e!==void 0&&e<=t)return;const d=this.tasks?.items?.[0];if(!d?.created_at)return;const p=this.$refs.recentPanel?.getScrollElement?.(),f=p?.scrollHeight||0,_=p?.scrollTop||0;this.loading=!0;try{if(await this.onGetTasks({createdAtMax:d.created_at}),await this.$nextTick(),p){const h=p.scrollHeight;p.scrollTop=h-f+_}}finally{this.loading=!1}},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("seedream/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("seedream/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.tasksLoading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=20,createdAtMin:d,createdAtMax:c}=e||{};console.debug("limit",t,"createdAtMin",d,"createdAtMax",c),await this.$store.dispatch("seedream/getTasks",{limit:t,createdAtMin:d,createdAtMax:c})},async onGenerate(){const e={...this.config||{}};!(Array.isArray(e?.image)&&e.image.length>0)&&"image"in e&&delete e.image,e?.size||delete e.size;const d={...e,callback_url:ss},c=this.credential?.token;if(!c){console.error("no token specified");return}I.info(this.$t("seedream.message.startingTask")),ae("seedream",pe.generate(d,{token:c})).then(()=>{I.success(this.$t("seedream.message.startTaskSuccess"))}).catch(p=>{const f=p?.response?.data;f?.error?.code===ue?I.error(this.$t("seedream.message.usedUp")):I.error(this.$t("seedream.message.startTaskFailed")+(f?.error?.message||""))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function as(e,t,d,c,p,f){const _=n("config-panel"),h=n("recent-panel"),r=n("layout");return a(),w(r,null,{config:g(()=>[s(_,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:g(()=>[s(h,{ref:"recentPanel",loading:e.loading,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Js=k(os,[["render",as]]);export{Js as default};