@acedatacloud/nexior 3.199.0 → 3.201.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 (237) hide show
  1. package/dist/assets/{Auth-Bxu6lPJs.js → Auth-P9-Y2I27.js} +1 -1
  2. package/dist/assets/{BotPlaceholder-qj2YLdAp.js → BotPlaceholder-oG7ygyok.js} +1 -1
  3. package/dist/assets/{Callback-BDBW_46X.js → Callback-BLBOX9sb.js} +1 -1
  4. package/dist/assets/Console-BZJya_fb.css +1 -0
  5. package/dist/assets/{Console-Cxf3qaXE.js → Console-DKsBuO-z.js} +1 -1
  6. package/dist/assets/{Consumption-D1DmjLsj.js → Consumption-BKf_KS7X.js} +1 -1
  7. package/dist/assets/{Conversation-DVRyMjZO.js → Conversation-CHAHqep6.js} +1 -1
  8. package/dist/assets/{CopyToClipboard-BS0IZ5vm.js → CopyToClipboard-CIRw6WL5.js} +1 -1
  9. package/dist/assets/{Detail-CPKHwE0p.js → Detail-ZWAGWrwd.js} +2 -2
  10. package/dist/assets/{Extra-Ca79F0MR.js → Extra-Cw9_80mD.js} +1 -1
  11. package/dist/assets/{FilePreview-D62u9I_n.js → FilePreview-CnGQ7pAL.js} +1 -1
  12. package/dist/assets/{History-fu6-tYtn.js → History-x5wON19B.js} +1 -1
  13. package/dist/assets/{IconPark.vue_vue_type_script_setup_true_lang-DcudsKh_.js → IconPark.vue_vue_type_script_setup_true_lang-Dyd7AMaP.js} +1 -1
  14. package/dist/assets/{ImagePreview-8xggEAtd.js → ImagePreview-CUVXtH2l.js} +1 -1
  15. package/dist/assets/{ImageWrapper-JCiqYITj.js → ImageWrapper-CuWjkp9m.js} +1 -1
  16. package/dist/assets/{Index-tu2qhy29.js → Index-B6oXbfed.js} +1 -1
  17. package/dist/assets/{Index-BqkPugf_.js → Index-B8XQ3aun.js} +1 -1
  18. package/dist/assets/Index-BErAVvL4.js +1 -0
  19. package/dist/assets/{Index-DlnzVCW0.js → Index-BPXVoXMC.js} +1 -1
  20. package/dist/assets/{Index-l2sz3kZe.js → Index-BdBMhDZm.js} +1 -1
  21. package/dist/assets/{Index-D-Aw5cLX.js → Index-BsraZW6D.js} +1 -1
  22. package/dist/assets/{Index-yNvxuOZ-.js → Index-CEycpOOD.js} +1 -1
  23. package/dist/assets/{Index-C5i12gfd.js → Index-CHdRMrwV.js} +1 -1
  24. package/dist/assets/{Index-oYrxdv5B.js → Index-CIXypFiG.js} +1 -1
  25. package/dist/assets/{Index-aOGN9YGk.js → Index-CLA0XmOz.js} +1 -1
  26. package/dist/assets/{Index-zJAUpNDF.js → Index-CPl2ntR0.js} +1 -1
  27. package/dist/assets/{Index-ZAqosxvD.js → Index-CQqQDBLi.js} +1 -1
  28. package/dist/assets/{Index-BH1V1Iqn.js → Index-CRLMJ1ab.js} +1 -1
  29. package/dist/assets/{Index-VBGiy2BZ.css → Index-CSv0dYm3.css} +1 -1
  30. package/dist/assets/{Index-BoZaR7aV.js → Index-CZNXcq6C.js} +1 -1
  31. package/dist/assets/{Index-KONl-gyR.js → Index-Csp3mEbl.js} +1 -1
  32. package/dist/assets/{Index-CSTXd8gx.js → Index-D5BTU0ZY.js} +2 -2
  33. package/dist/assets/{Index-6_CHK7EV.js → Index-DEqFybWX.js} +1 -1
  34. package/dist/assets/{Index-CN6Cr1o2.js → Index-DHX7oXEA.js} +1 -1
  35. package/dist/assets/{Index-CKjKdeA3.js → Index-DLAgZvuT.js} +1 -1
  36. package/dist/assets/{Index-BHrhLWTN.js → Index-DX3DQjl0.js} +1 -1
  37. package/dist/assets/{Index-CalCfUQZ.js → Index-Df6dDwUo.js} +1 -1
  38. package/dist/assets/{Index-BMZlZqhB.js → Index-X7Xtwp4E.js} +1 -1
  39. package/dist/assets/{Index-BDw62a42.js → Index-hamJD74q.js} +1 -1
  40. package/dist/assets/{Index-iy2_zNpb.js → Index-q01PDwBe.js} +1 -1
  41. package/dist/assets/{Invitees-ASRNDHIx.js → Invitees-BlMDbMOA.js} +1 -1
  42. package/dist/assets/List-DOK3S7GX.js +1 -0
  43. package/dist/assets/{List-DF6W0AJb.js → List-DkQR_5pA.js} +1 -1
  44. package/dist/assets/{List-CquVIuWA.js → List-VfhD8xQP.js} +1 -1
  45. package/dist/assets/List-zFbDrkil.css +1 -0
  46. package/dist/assets/{Main-B4HQop2H.js → Main-uL4w-VWn.js} +1 -1
  47. package/dist/assets/{Navigator-Bvklo3Gd.js → Navigator-Vb9U_Tkm.js} +1 -1
  48. package/dist/assets/{NoTasks-YcewaUb5.js → NoTasks-9iEEhsIS.js} +1 -1
  49. package/dist/assets/{NotFound-D9X7oxaR.js → NotFound-KugwnfTR.js} +1 -1
  50. package/dist/assets/{OAuthCallback-B-dbQ38J.js → OAuthCallback-BOSLZDKl.js} +1 -1
  51. package/dist/assets/{Pagination-n5DVrOdP.js → Pagination-UjYkBaAw.js} +1 -1
  52. package/dist/assets/{Status-C26fA_fP.js → Status-ek_-Lp6a.js} +1 -1
  53. package/dist/assets/{Subscribe-BtqjcFEx.js → Subscribe-DeB1wbxC.js} +1 -1
  54. package/dist/assets/{VideoPlayer-CndCLmxS.js → VideoPlayer-CXT39jg2.js} +1 -1
  55. package/dist/assets/{_Uint8Array-4l3jEroS.js → _Uint8Array-yhuF-6h2.js} +1 -1
  56. package/dist/assets/{_baseClone-Db65SBvG.js → _baseClone-Ccji6pFO.js} +1 -1
  57. package/dist/assets/{_baseIteratee-CJ9W-nbE.js → _baseIteratee-CTMClKxb.js} +1 -1
  58. package/dist/assets/{_initCloneObject-C7XzV3eb.js → _initCloneObject-D2UisHWT.js} +1 -1
  59. package/dist/assets/{add-CIHMDKxi.js → add-Bu_OdUwZ.js} +1 -1
  60. package/dist/assets/{all-wallets-D7C3_H-n.js → all-wallets-B4A8C78S.js} +1 -1
  61. package/dist/assets/{app-store-CPrYPJvx.js → app-store-qURYjH2L.js} +1 -1
  62. package/dist/assets/{apple-B8Tg1DiO.js → apple-Cy9D_M7F.js} +1 -1
  63. package/dist/assets/{arrow-bottom-DRCbehPe.js → arrow-bottom-CW3b5IMC.js} +1 -1
  64. package/dist/assets/{arrow-bottom-circle-BxECh6Zt.js → arrow-bottom-circle-UphuU3is.js} +1 -1
  65. package/dist/assets/{arrow-left-CbzqvYhx.js → arrow-left-BVxZn0NZ.js} +1 -1
  66. package/dist/assets/{arrow-right-BBruSVMi.js → arrow-right-BQGlYIq9.js} +1 -1
  67. package/dist/assets/{arrow-top-B7u4UMuv.js → arrow-top-DV16ibkR.js} +1 -1
  68. package/dist/assets/{avatar-HrHY9X2h.js → avatar-POvkw2fC.js} +1 -1
  69. package/dist/assets/{bank-BMz1T24_.js → bank-BNjUFqiV.js} +1 -1
  70. package/dist/assets/{basic-CcCFvU6g.js → basic-Crh0aODM.js} +1 -1
  71. package/dist/assets/{browser-7joAQpWW.js → browser-CDLJDWE0.js} +1 -1
  72. package/dist/assets/{byokCredential-B4dKziVQ.js → byokCredential-BEnC2ib3.js} +1 -1
  73. package/dist/assets/{card-BHSdgUM6.js → card-DVSu3L2D.js} +1 -1
  74. package/dist/assets/{castArray-FN0qIC-F.js → castArray-B2mZnC5U.js} +1 -1
  75. package/dist/assets/{chat-RH2FHz84.js → chat-CQYnVX2z.js} +1 -1
  76. package/dist/assets/{checkmark-Bys9SwiQ.js → checkmark-CslPX2Yy.js} +1 -1
  77. package/dist/assets/{checkmark-bold-DdZpUzBt.js → checkmark-bold-BHBVYyR5.js} +1 -1
  78. package/dist/assets/{chevron-bottom-lsWoscTx.js → chevron-bottom-fQSKtlqe.js} +1 -1
  79. package/dist/assets/{chevron-left-BEg6k_CD.js → chevron-left-Ca-aYmE7.js} +1 -1
  80. package/dist/assets/{chevron-right-D6_BF5Q4.js → chevron-right-BeCDhv4-.js} +1 -1
  81. package/dist/assets/{chevron-top-BjdcG2gi.js → chevron-top-DtcNqUFz.js} +1 -1
  82. package/dist/assets/{chrome-store-CtCOe48X.js → chrome-store-CqU1zMmU.js} +1 -1
  83. package/dist/assets/{clock-DETEJMl3.js → clock-D7NLSyIk.js} +1 -1
  84. package/dist/assets/{close-CylhswCm.js → close-jNIKLmHe.js} +1 -1
  85. package/dist/assets/{coinPlaceholder-C3axsC5g.js → coinPlaceholder-CK7Zf23d.js} +1 -1
  86. package/dist/assets/{compass-CtsJBqp1.js → compass-DtBu8ANv.js} +1 -1
  87. package/dist/assets/{copy-CLxNORXC.js → copy-BvlFTEKQ.js} +1 -1
  88. package/dist/assets/{createTaskActions-BJSdKH5s.js → createTaskActions-R7aRvJKd.js} +1 -1
  89. package/dist/assets/{cursor-z-aIOLqV.js → cursor-CbMskyVX.js} +1 -1
  90. package/dist/assets/{cursor-transparent-DZTyR1zU.js → cursor-transparent-Cl95jNm6.js} +1 -1
  91. package/dist/assets/{debounce-CqzxdC1T.js → debounce-C18vO1_Z.js} +1 -1
  92. package/dist/assets/{desktop-TrodT5we.js → desktop-CD1xL_HB.js} +1 -1
  93. package/dist/assets/{disconnect-BeEQ7qs9.js → disconnect-R1Cqi78x.js} +1 -1
  94. package/dist/assets/{discord-CwrEZrCT.js → discord-B-bU5cxh.js} +1 -1
  95. package/dist/assets/{distribution-CCQeOooB.js → distribution-QDcM3Yzv.js} +1 -1
  96. package/dist/assets/{dropdown-QVVKiQqM.js → dropdown-CTLcBpRe.js} +1 -1
  97. package/dist/assets/{etherscan-WV8NdF0k.js → etherscan-Dt1Ys1Sc.js} +1 -1
  98. package/dist/assets/{exclamation-triangle-DdbSNzRo.js → exclamation-triangle-1zW8Ikyk.js} +1 -1
  99. package/dist/assets/{extension-CuHkDgHC.js → extension-Cn6aATmd.js} +1 -1
  100. package/dist/assets/{external-link-BgTmHYmG.js → external-link-CXg7XYn0.js} +1 -1
  101. package/dist/assets/{facebook-8nr_Km5Y.js → facebook-IoRWb49C.js} +1 -1
  102. package/dist/assets/{farcaster-3NnaB9KF.js → farcaster-C73_LFCH.js} +1 -1
  103. package/dist/assets/{filters-CerERAFS.js → filters-BOUlQhA1.js} +1 -1
  104. package/dist/assets/{github-CmiBvNun.js → github-DSWdNEuE.js} +1 -1
  105. package/dist/assets/{google-WIulaWE1.js → google-0ZvzJ_rg.js} +1 -1
  106. package/dist/assets/{help-circle-2X23TR3c.js → help-circle-BdcnDRxZ.js} +1 -1
  107. package/dist/assets/{id-vaj7mgsv.js → id-D0bB32vi.js} +1 -1
  108. package/dist/assets/{image-Cvm5qKfH.js → image-CKJr4QvL.js} +1 -1
  109. package/dist/assets/{index-6R6Zq-bb.js → index-8Tcs72Am.js} +1 -1
  110. package/dist/assets/{index-DGwqRoPm.js → index-B-l7vsCb.js} +1 -1
  111. package/dist/assets/{index-cN8cftWM.js → index-B5Z3EZrb.js} +1 -1
  112. package/dist/assets/{index-DqqEEM06.js → index-BHmSF5c7.js} +1 -1
  113. package/dist/assets/{index-IXbBFLGc.js → index-BJecxE7v.js} +1 -1
  114. package/dist/assets/{index-B21ZeSrS.js → index-BKHSCugF.js} +1 -1
  115. package/dist/assets/{index-D2XWlSUE.css → index-BRqmY-RG.css} +1 -1
  116. package/dist/assets/{index-QEi2VXNo.js → index-BULPgnOG.js} +1 -1
  117. package/dist/assets/{index-D1Pp1_Ct.js → index-BdbTMZQG.js} +1 -1
  118. package/dist/assets/{index-CLmaAujN.js → index-BqsKk8tF.js} +1 -1
  119. package/dist/assets/{index-BwAF5fMP.js → index-C-dy1Xao.js} +1 -1
  120. package/dist/assets/{index-_jMWnoRc.js → index-CBVbWfMh.js} +1 -1
  121. package/dist/assets/{index-B2vTKKd_.js → index-CCBjpDl1.js} +1 -1
  122. package/dist/assets/{index-B6QiYIzW.js → index-CFJyFNtJ.js} +1 -1
  123. package/dist/assets/{index-B-vHnqyE.js → index-CGBK8gn9.js} +1 -1
  124. package/dist/assets/{index-BcuAI9DN.js → index-CH8027H5.js} +1 -1
  125. package/dist/assets/{index-CP6llfLN.js → index-CKceOzxT.js} +1 -1
  126. package/dist/assets/{index-pQFvUXd3.js → index-CSLM8oj_.js} +1 -1
  127. package/dist/assets/{index-DsGtRLSG.js → index-CTq_XQ_O.js} +1 -1
  128. package/dist/assets/{index-BiC7KGb5.js → index-CWdAzE8_.js} +1 -1
  129. package/dist/assets/{index-BOBhPDDF.js → index-CXZga4TM.js} +1 -1
  130. package/dist/assets/{index-CiGGgTh3.js → index-CYibZiPb.js} +1 -1
  131. package/dist/assets/{index-CrU_5pwG.js → index-Cb-1HmSl.js} +2 -2
  132. package/dist/assets/{index-ViGPRpNP.js → index-Cd_qWETX.js} +1 -1
  133. package/dist/assets/{index-Dk-srZzW.js → index-CeL66X7b.js} +1 -1
  134. package/dist/assets/{index-CIPeqHrT.js → index-CfDWdmmt.js} +1 -1
  135. package/dist/assets/{index-B0dINqQs.js → index-CkENdWhT.js} +1 -1
  136. package/dist/assets/{index-DLAA8qBO.js → index-Cn6FLrhe.js} +1 -1
  137. package/dist/assets/{index-CQTjuF73.js → index-Cn6q7R8u.js} +1 -1
  138. package/dist/assets/{index-Czz4_hx0.js → index-Cq7DVAGu.js} +1 -1
  139. package/dist/assets/{index-DmgFbW9M.js → index-CsGFFE61.js} +1 -1
  140. package/dist/assets/{index-zQkXvP4I.js → index-CtbJ8jTa.js} +1 -1
  141. package/dist/assets/{index-BbL_4E9w.js → index-CvMqNkLv.js} +1 -1
  142. package/dist/assets/{index-DA818bne.js → index-Cw9yMd7y.js} +1 -1
  143. package/dist/assets/{index-BF3jvRlG.js → index-D-4JF5KB.js} +1 -1
  144. package/dist/assets/{index-CEeMrgcF.js → index-D5GD9sYJ.js} +1 -1
  145. package/dist/assets/{index-BE6qZqmD.js → index-D8TyI7GI.js} +1 -1
  146. package/dist/assets/{index-Bcs3v7-e.js → index-DHxm4Mt3.js} +1 -1
  147. package/dist/assets/{index-DvlZSfpu.js → index-DMHXbvDD.js} +1 -1
  148. package/dist/assets/{index-D52tsFhQ.js → index-DOaSgJ1K.js} +1 -1
  149. package/dist/assets/{index-NUBO-MwK.js → index-DR__Oj5B.js} +1 -1
  150. package/dist/assets/{index-DTeoj4TD.js → index-DTTXVFKN.js} +1 -1
  151. package/dist/assets/{index-B7lLMdzb.js → index-DVUMZ05r.js} +4 -4
  152. package/dist/assets/{index-CBlv28h_.js → index-DX4qnWEq.js} +3 -3
  153. package/dist/assets/{index-DmDrzBI8.js → index-Dh9zo6zc.js} +1 -1
  154. package/dist/assets/{index-ByRqtdbl.js → index-DilHy9ov.js} +1 -1
  155. package/dist/assets/{index-CCnNhz-4.js → index-Doov4lRg.js} +1 -1
  156. package/dist/assets/{index-DuW5L2r7.js → index-DrLf4K3A.js} +1 -1
  157. package/dist/assets/{index-BT22Q2er.js → index-DsLfL_UZ.js} +1 -1
  158. package/dist/assets/{index-CYh_OAtL.js → index-DtFDyBeG.js} +1 -1
  159. package/dist/assets/{index-D2DtLStx.js → index-Dvg07LsC.js} +5 -5
  160. package/dist/assets/{index-CbH6hylr.js → index-GfS1QM00.js} +1 -1
  161. package/dist/assets/{index-BnYAc5a2.js → index-INXD4z_7.js} +1 -1
  162. package/dist/assets/{index-Cke3Ztbn.js → index-NAYAb2EN.js} +1 -1
  163. package/dist/assets/{index-CqFUQRch.js → index-bI3kDgo-.js} +1 -1
  164. package/dist/assets/{index-C9b_9myH.js → index-dU0falwS.js} +1 -1
  165. package/dist/assets/{index-Dw3SeELD.js → index-eWlKuNNN.js} +1 -1
  166. package/dist/assets/{index-BEIVh6R9.js → index-hCU6Gi_N.js} +1 -1
  167. package/dist/assets/{index-CGiBnpqk.js → index-jyz6xleX.js} +1 -1
  168. package/dist/assets/{index-2P6neM4R.js → index-r007Lgz_.js} +1 -1
  169. package/dist/assets/{index-D4F0oixT.js → index-t6HfS0_5.js} +1 -1
  170. package/dist/assets/{index.browser.esm-BC4h3Ej2.js → index.browser.esm-DH1v7uQU.js} +1 -1
  171. package/dist/assets/{index.es-BGvCJe-W.js → index.es-f2R6ubO6.js} +1 -1
  172. package/dist/assets/{info-circle-DCijtL4A.js → info-circle-OpeIg_vK.js} +1 -1
  173. package/dist/assets/{info-ClrQ6-BU.js → info-p1qBqqby.js} +1 -1
  174. package/dist/assets/{isEqual-CfmBLeOp.js → isEqual-B1Z_z-Zf.js} +1 -1
  175. package/dist/assets/{isPlainObject-DrfMRQvm.js → isPlainObject-CmiP43ac.js} +1 -1
  176. package/dist/assets/{lightbulb-Dr1hMBEr.js → lightbulb-CR2nBiZK.js} +1 -1
  177. package/dist/assets/{luma-1KHYlP4B.js → luma-BSTzveKD.js} +1 -1
  178. package/dist/assets/{luma-BD2KKbxW.js → luma-CmQgYMjm.js} +1 -1
  179. package/dist/assets/{mail-CiRR9yzg.js → mail-C4CN8lug.js} +1 -1
  180. package/dist/assets/{midjourney-BHg-HxhG.js → midjourney-DtKSn_55.js} +1 -1
  181. package/dist/assets/{mobile-BAK6nsfE.js → mobile-D6DhWeG9.js} +1 -1
  182. package/dist/assets/{more-D70nXESH.js → more-BIFonLRO.js} +1 -1
  183. package/dist/assets/{network-placeholder-D6q_3JhL.js → network-placeholder-CQoXEWHp.js} +1 -1
  184. package/dist/assets/{nftPlaceholder-Cq73MyuY.js → nftPlaceholder-DzJB0cAU.js} +1 -1
  185. package/dist/assets/{off-Du8xNMQV.js → off-DcYnxUwZ.js} +1 -1
  186. package/dist/assets/{openaiimage-CjUeKUKV.js → openaiimage-BxAXhLbK.js} +1 -1
  187. package/dist/assets/{openaiimage-B7etoC6T.js → openaiimage-DUKFo3_F.js} +1 -1
  188. package/dist/assets/{order-B9IiXfkW.js → order-BkOrE4fx.js} +1 -1
  189. package/dist/assets/{pagination-DSYOIV_9.js → pagination-BIv0I4gk.js} +1 -1
  190. package/dist/assets/{play-store-CMM7iXUy.js → play-store-elgh3FWw.js} +1 -1
  191. package/dist/assets/{plus-jARqHv_C.js → plus-b50-SlO3.js} +1 -1
  192. package/dist/assets/{price-BoiEmiVd.js → price-3Bxyzfub.js} +1 -1
  193. package/dist/assets/{producer-BFn8w39f.js → producer-_ZheEQHj.js} +1 -1
  194. package/dist/assets/{qr-code-DzsFURK2.js → qr-code-0-lOMzDS.js} +1 -1
  195. package/dist/assets/{recycle-horizontal-W2KoV8vw.js → recycle-horizontal-0Lxer4ur.js} +1 -1
  196. package/dist/assets/{refresh-WSaLf8VP.js → refresh-B3-cUONr.js} +1 -1
  197. package/dist/assets/{reown-logo-CEd6ZM8R.js → reown-logo-BIkSMGt2.js} +1 -1
  198. package/dist/assets/{search-ClPkoGZw.js → search-BOg2kbkO.js} +1 -1
  199. package/dist/assets/{secp256k1-DCotto4o.js → secp256k1-B-b9J87u.js} +1 -1
  200. package/dist/assets/{secp256k1-CY7zvKPZ.js → secp256k1-YaViWuM0.js} +1 -1
  201. package/dist/assets/{seedream-B_0r5a5d.js → seedream-DuSeYUSK.js} +1 -1
  202. package/dist/assets/{send-hXw22QVp.js → send-Cb0G2YYi.js} +1 -1
  203. package/dist/assets/{service-D6MwIonb.js → service-s-VOFKDX.js} +1 -1
  204. package/dist/assets/{solana-wallets-D5IXk2C6.js → solana-wallets-BLRSmzvy.js} +2 -2
  205. package/dist/assets/{solana-wallets-vue-CiR9_161.js → solana-wallets-vue-C6Q6-Ct3.js} +1 -1
  206. package/dist/assets/{suno-Bk-Q7Yhc.js → suno-BKRXQ0xj.js} +1 -1
  207. package/dist/assets/{suno-BrgQ_BvV.js → suno-BO6DMqls.js} +1 -1
  208. package/dist/assets/{suno-CnYkQ41d.js → suno-DEP8hfiJ.js} +1 -1
  209. package/dist/assets/{swapHorizontal-C4OATJHV.js → swapHorizontal-KMx0NnVD.js} +1 -1
  210. package/dist/assets/{swapHorizontalBold-BcZ8qUBM.js → swapHorizontalBold-D98Bopio.js} +1 -1
  211. package/dist/assets/{swapHorizontalMedium-DmOnPuPj.js → swapHorizontalMedium-BTPM2ekk.js} +1 -1
  212. package/dist/assets/{swapHorizontalRoundedBold-aCMw7dgZ.js → swapHorizontalRoundedBold-CUB98ewQ.js} +1 -1
  213. package/dist/assets/{swapVertical-DCJHigd7.js → swapVertical-DDhGOeMB.js} +1 -1
  214. package/dist/assets/{telegram-B8hG-ceH.js → telegram-BRZ5559p.js} +1 -1
  215. package/dist/assets/{three-dots-3PfhBNIb.js → three-dots-DK7xpckE.js} +1 -1
  216. package/dist/assets/{twitch-DGLW5dTV.js → twitch-DsDp5f8i.js} +1 -1
  217. package/dist/assets/{twitterIcon-D9shlJUo.js → twitterIcon-CQebQN_n.js} +1 -1
  218. package/dist/assets/{typescript-Bj1ijDQ6.js → typescript-qAIJ13Qr.js} +1 -1
  219. package/dist/assets/{use-form-item-DZgxCtXL.js → use-form-item-DhMXJI5q.js} +1 -1
  220. package/dist/assets/validator-C_MCdjOG.js +1 -0
  221. package/dist/assets/{verify-f7CMRkUd.js → verify--masYrMj.js} +1 -1
  222. package/dist/assets/{verify-filled-D-i_lal-.js → verify-filled-BynRjqu9.js} +1 -1
  223. package/dist/assets/{w3m-modal-Bg36HOCY.js → w3m-modal-Dnk11rKj.js} +1 -1
  224. package/dist/assets/{wallet-CWYcFf4q.js → wallet-DDuyKcqZ.js} +1 -1
  225. package/dist/assets/{wallet-placeholder-CP4xtpLb.js → wallet-placeholder-6f-BSK3t.js} +1 -1
  226. package/dist/assets/{walletconnect-CswCYXjf.js → walletconnect-Fg96-X5C.js} +1 -1
  227. package/dist/assets/{warning-circle-Cy5pvqsS.js → warning-circle-CO_d6TcS.js} +1 -1
  228. package/dist/assets/{web-CrK-XaC6.js → web-DVHNX4-S.js} +1 -1
  229. package/dist/assets/{web-BvZo9FTy.js → web-dgsvqJXd.js} +1 -1
  230. package/dist/assets/{x-B-62v0eX.js → x-DLmg-6Gn.js} +1 -1
  231. package/dist/index.html +2 -2
  232. package/package.json +1 -1
  233. package/dist/assets/Console-D-SOK-Bo.css +0 -1
  234. package/dist/assets/Index-tX7U6ka9.js +0 -1
  235. package/dist/assets/List-CFBrpGZ3.js +0 -1
  236. package/dist/assets/List-Cj4e77Gx.css +0 -1
  237. package/dist/assets/validator-2sHPIwNN.js +0 -1
@@ -1 +1 @@
1
- import{F as E}from"./index.es-BGvCJe-W.js";import{E as L}from"./index-BF3jvRlG.js";import{E as ce}from"./index-CP6llfLN.js";import{d as b,H as u,E as i,z as N,C as n,y as h,D as o,q as l,F as r,x as S,O as I,N as T,Q as U,J as k,R as ke,I as w,M as be}from"./vendor-vue-NSDaktjZ.js";import{G as y,bj as G,ag as ye,H as we,co as te,aF as oe,S as ne,cp as Ce}from"./index-B7lLMdzb.js";import{b as Se,c as se,d as F,e as D,f as Ve,g as Ie,h as Te}from"./kling-CtoPhhA9.js";import{E as A,a as P}from"./index-B21ZeSrS.js";import{E as q}from"./index-B2vTKKd_.js";import{E as C}from"./index-DmgFbW9M.js";import{I as V,S as Ee,l as Le}from"./pagination-DSYOIV_9.js";import{p as H}from"./pasteUploadMixin-BurWbGNQ.js";import{I as K}from"./ImagePreview-8xggEAtd.js";import{E as W}from"./index-BiC7KGb5.js";import{E as O}from"./index-2P6neM4R.js";import{C as de}from"./Consumption-D1DmjLsj.js";import{E as ue}from"./index-Cke3Ztbn.js";import{E as me}from"./index-BT22Q2er.js";import{E as pe}from"./index-DvlZSfpu.js";import{E as J}from"./index-zQkXvP4I.js";import{a as ge}from"./price-BoiEmiVd.js";import{F as Me}from"./FilePreview-D62u9I_n.js";import{E as Re,a as Ue}from"./index-CLmaAujN.js";import{E as De,a as Ae}from"./index-QEi2VXNo.js";import{b as ie}from"./errorCode-Cqj9Td_Z.js";import{C as Pe}from"./CopyToClipboard-BS0IZ5vm.js";import{V as Ge}from"./VideoPlayer-CndCLmxS.js";import{E as Ke}from"./index-ViGPRpNP.js";import{E as Oe}from"./index-DuW5L2r7.js";import{B as je}from"./BotPlaceholder-qj2YLdAp.js";import{N as Ne}from"./NoTasks-YcewaUb5.js";import"./use-form-item-DZgxCtXL.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Df5ITouH.js";import"./index-CGiBnpqk.js";import"./typescript-Bj1ijDQ6.js";import"./index-cN8cftWM.js";import"./strings-beZM2Y-f.js";import"./isEqual-CfmBLeOp.js";import"./_Uint8Array-4l3jEroS.js";import"./castArray-FN0qIC-F.js";import"./debounce-CqzxdC1T.js";import"./_baseIteratee-CJ9W-nbE.js";import"./index-CbH6hylr.js";import"./validator-2sHPIwNN.js";import"./index-Dw3SeELD.js";import"./_baseClone-Db65SBvG.js";import"./_initCloneObject-C7XzV3eb.js";import"./index-Cu41y2Fl.js";import"./index-pQFvUXd3.js";import"./isPlainObject-DrfMRQvm.js";import"./vue-plyr-BO2nlN4c.js";import"./index-B-vHnqyE.js";const Be=b({name:"LayoutKling",components:{ElDrawer:ce,ElButton:L,FontAwesomeIcon:E},data(){return{drawer:!1}}}),ze={class:"main flex flex-row flex-1 min-h-0"},Fe={class:"config w-[320px] flex-none h-full flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},qe={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function He(e,t,s,a,m,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),u("div",ze,[i("div",Fe,[N(e.$slots,"config",{},void 0,!0)]),i("div",qe,[N(e.$slots,"result",{},void 0,!0)]),n(p,{circle:"",class:"menu",onClick:t[0]||(t[0]=c=>e.drawer=!0)},{default:h(()=>[n(d,{icon:"fa-solid fa-magic"})]),_:1}),n(f,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=c=>e.drawer=c),direction:"ltr","with-header":!1,size:"350px"},{default:h(()=>[N(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const We=y(Be,[["render",He],["__scopeId","data-v-be4bb0df"]]),Je={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function Q(e,t,s){const a=t||"std",m=s??5;switch(e){case"kling-v1":return{text2video:!0,image2video:!0,endImage:m===5,audio:!1,motionControl:m===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 Je}}function Y(e,t){if(!e)return[];const s=t.model??e.model,a=t.mode??e.mode,m=t.duration??e.duration;if(!s)return[];const $=Q(s,a,m),d=[];return e.end_image_url&&!$.endImage&&d.push({field:"end_image_url",i18nLabel:"kling.name.endImage"}),e.generate_audio&&!$.audio&&d.push({field:"generate_audio",i18nLabel:"kling.name.generateAudio"}),e.camera_control?.type&&(!$.motionControl||e.start_image_url)&&d.push({field:"camera_control",i18nLabel:"kling.name.cameraControl"}),d}function 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 Qe=b({name:"ModelSelector",components:{ElSelect:P,ElOption:A},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(m=>this.$t(m.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 m=X({...t,model:e},s);this.$store.commit("kling/setConfig",m),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})}}}),Ye={class:"field"},Xe={class:"title font-bold"};function Ze(e,t,s,a,m,$){const d=o("el-option"),p=o("el-select");return l(),u("div",Ye,[i("h2",Xe,r(e.$t("pika.name.model")),1),(l(),S(p,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("pika.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),u(I,null,T(e.options,f=>(l(),S(d,{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const xe=y(Qe,[["render",Ze],["__scopeId","data-v-04059875"]]),et=b({name:"ModeSelector",components:{ElSelect:P,ElOption:A,InfoIcon:V},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(se)}},mounted(){this.value||this.applyMode(se)},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(m=>this.$t(m.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 m=X({...t,mode:e},s);this.$store.commit("kling/setConfig",m),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})}}}),tt={class:"field"},ot={class:"header"},nt={class:"title font-bold"},st={key:0,class:"opt-tip"};function it(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),u("div",tt,[i("div",ot,[i("h2",nt,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.mode"),class:"info-icon"},null,8,["content"])]),(l(),S(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),u(I,null,T(e.options,c=>(l(),S(p,{key:c.value,label:c.label,value:c.value,disabled:c.disabled},{default:h(()=>[i("span",{class:U({"opt-disabled":c.disabled})},r(c.label),3),c.disabled&&c.disabledReason?(l(),u("span",st,r(c.disabledReason),1)):k("",!0)]),_:2},1032,["label","value","disabled"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const lt=y(et,[["render",it],["__scopeId","data-v-9a8fa3c5"]]),at=[3,5,8,10,12,15],rt=[5,10],ct=b({name:"DurationSelector",components:{ElSelect:P,ElOption:A,InfoIcon:V},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},isV3Model(){return F.includes(this.selectedModel)},allowedDurations(){return this.isV3Model?at:rt},value(){return this.$store.state.kling?.config?.duration??D},selectValue(){const e=this.allowedDurations;return e.includes(this.value)?this.value:e.includes(D)?D:e[0]}},watch:{isV3Model(){this.allowedDurations.includes(this.value)||this.applyDuration(D)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(D)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Y(t,{duration:e});if(s.length===0){this.applyDuration(e);return}const a=s.map(m=>this.$t(m.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 m=X({...t,duration:e},s);this.$store.commit("kling/setConfig",m),C.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyDuration(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,duration:e})}}}),dt={class:"field"},ut={class:"control"},mt={class:"label"},pt={class:"title font-bold"};function gt(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),u("div",dt,[i("div",ut,[i("div",mt,[i("h2",pt,r(e.$t("kling.name.duration")),1),n(d,{content:e.$t("kling.description.duration"),class:"info-icon ml-1"},null,8,["content"])]),(l(),S(f,{key:e.revertKey,"model-value":e.selectValue,class:"value",placeholder:e.$t("kling.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),u(I,null,T(e.allowedDurations,c=>(l(),S(p,{key:c,label:`${c}s`,value:c},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])])}const ft=y(ct,[["render",gt],["__scopeId","data-v-5ae55e28"]]),ht=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=Ve)}}),_t={class:"text-sm font-bold mb-2 block"},$t={class:"items"},vt=["onClick"],kt={class:"name"};function bt(e,t,s,a,m,$){return l(),u("div",null,[i("span",_t,r(e.$t("kling.name.ratio")),1),i("div",$t,[(l(!0),u(I,null,T(e.options,(d,p)=>(l(),u("div",{key:p,class:U({active:e.active===p,item:!0}),onClick:f=>e.value=d.value},[i("div",{class:U(["preview",d.label])},[i("div",{class:"rect",style:ke({width:d.width+"px",height:d.height+"px"})},null,4)],2),i("p",kt,r(d.label),1)],10,vt))),128))])])}const yt=y(ht,[["render",bt],["__scopeId","data-v-cdb14b2f"]]),wt=b({name:"StartImage",components:{ElUpload:O,ElButton:L,ElTooltip:W,InfoIcon:V,FontAwesomeIcon:E,ImagePreview:K},mixins:[H],emits:["change"],data(){return{fileList:[],uploadUrl:G()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},value:{get(){return this.$store.state?.kling?.config?.start_image_url},set(){}}},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()}}}),Ct={class:"relative"},St={class:"flex justify-between"},Vt={class:"flex justify-start items-center"},It={class:"text-sm font-bold"};function Tt(e,t,s,a,m,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),v=o("el-tooltip"),g=o("el-upload");return l(),u("div",Ct,[i("div",St,[i("div",Vt,[i("span",It,r(e.$t("kling.name.startImage")),1),n(d,{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(),S(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(c,{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 Et=y(wt,[["render",Tt],["__scopeId","data-v-68cf38f5"]]),Lt=b({name:"EndImage",components:{ElUpload:O,ElButton:L,ElTooltip:W,ImagePreview:K,InfoIcon:V,FontAwesomeIcon:E},mixins:[H],data(){return{fileList:[],uploadUrl:G()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},klingConfig(){return this.$store.state?.kling?.config||{}},endImageSupported(){return Q(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},hasStartImage(){return!!this.klingConfig.start_image_url},uploadDisabled(){return this.reachedLimit||!this.endImageSupported||!this.hasStartImage},uploadTooltip(){return this.endImageSupported?this.hasStartImage?this.reachedLimit?this.$t("kling.message.uploadReferencesExceed"):"":this.$t("kling.message.endImageRequiresStart"):this.$t("kling.message.endImageNotSupported")},storeValue(){return this.klingConfig.end_image_url},value:{get(){return this.storeValue},set(){}}},watch:{storeValue(e){!e&&this.fileList.length>0&&(this.fileList=[])},hasStartImage(e){!e&&this.storeValue&&(this.fileList=[],this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,end_image_url:void 0}))}},mounted(){this.value||(this.value=void 0),this.onSetEndImageUrl()},methods:{onBeforeUpload(){return this.endImageSupported?this.hasStartImage?!0:(C.warning(this.$t("kling.message.endImageRequiresStart")),!1):(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()}}}),Mt={class:"relative"},Rt={class:"flex justify-between"},Ut={class:"flex justify-start items-center"},Dt={class:"text-sm font-bold"};function At(e,t,s,a,m,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),v=o("el-tooltip"),g=o("el-upload");return l(),u("div",Mt,[i("div",Rt,[i("div",Ut,[i("span",Dt,r(e.$t("kling.name.endImage")),1),n(d,{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(),S(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(c,{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(Lt,[["render",At],["__scopeId","data-v-593c3bde"]]),Gt=b({name:"CfgScaleSelector",components:{ElSlider:me,InfoIcon:V,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)}}),Kt={class:"flex justify-between"},Ot={class:"flex justify-start items-center"},jt={class:"text-sm font-bold"},Nt={class:"flex justify-end items-center"},Bt={class:"w-full"};function zt(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-input-number"),f=o("el-slider");return l(),u("div",null,[i("div",Kt,[i("div",Ot,[i("span",jt,r(e.$t("kling.name.cfgScale")),1),n(d,{content:e.$t("kling.description.cfgScale")},null,8,["content"])]),i("div",Nt,[n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),"controls-position":"right"},null,8,["modelValue"])])]),i("div",Bt,[n(f,{modelValue:e.value,"onUpdate:modelValue":t[1]||(t[1]=c=>e.value=c),min:0,max:1,step:.1},null,8,["modelValue"])])])}const Ft=y(Gt,[["render",zt]]),qt=b({name:"GenerateAudioSelector",components:{ElSwitch:pe,InfoIcon:V},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??Te:!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})}}}),Ht={class:"relative"},Wt={class:"flex justify-between items-center"},Jt={class:"flex justify-start items-center"},Qt={class:"text-sm font-bold"};function Yt(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-switch");return l(),u("div",Ht,[i("div",Wt,[i("div",Jt,[i("span",Qt,r(e.$t("kling.name.generateAudio")),1),n(d,{content:e.tooltipContent},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=f=>e.value=f),class:"value",disabled:!e.supported},null,8,["modelValue","disabled"])])])}const Xt=y(qt,[["render",Yt]]),Zt=["horizontal","vertical","pan","tilt","roll","zoom"],xt=b({name:"CameraControlSelector",components:{ElSelect:P,ElOption:A,ElSlider:me,ElInputNumber:ue,InfoIcon:V},data(){return{configKeys:Zt}},computed:{typeOptions(){return[{value:"",label:this.$t("kling.name.cameraTypeNone")},{value:"simple",label:this.$t("kling.name.cameraTypeSimple")},{value:"down_back",label:this.$t("kling.name.cameraTypeDownBack")},{value:"forward_up",label:this.$t("kling.name.cameraTypeForwardUp")},{value:"left_turn_forward",label:this.$t("kling.name.cameraTypeLeftTurnForward")},{value:"right_turn_forward",label:this.$t("kling.name.cameraTypeRightTurnForward")}]},selectedMode(){return this.$store.state.kling?.config?.mode||""},selectedModel(){return this.$store.state.kling?.config?.model||""},selectedDuration(){return this.$store.state.kling?.config?.duration},motionControlSupported(){return Q(this.selectedModel,this.selectedMode,this.selectedDuration).motionControl},hasStartImage(){return!!this.$store.state.kling?.config?.start_image_url},disabled(){return!this.motionControlSupported||this.hasStartImage},tooltipContent(){return this.motionControlSupported?this.hasStartImage?this.$t("kling.description.cameraControlDisabledImage2Video"):this.$t("kling.description.cameraControl"):this.$t("kling.description.cameraControlNotSupported")},selectedType(){return this.$store.state.kling?.config?.camera_control?.type},selectedTypeRaw:{get(){return this.selectedType??""},set(e){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"},m={...a.config||{}};t==null?delete m[e]:m[e]=t,this.$store.commit("kling/setConfig",{...s,camera_control:{...a,type:"simple",config:m}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),eo={class:"field"},to={class:"header"},oo={class:"text-sm font-bold"},no={key:0,class:"config-grid"},so={class:"cfg-row-head"},io={class:"cfg-name"};function lo(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select"),c=o("el-input-number"),v=o("el-slider");return l(),u("div",eo,[i("div",to,[i("span",oo,r(e.$t("kling.name.cameraControl")),1),n(d,{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),u(I,null,T(e.typeOptions,g=>(l(),S(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(),u("div",no,[(l(!0),u(I,null,T(e.configKeys,g=>(l(),u("div",{key:g,class:"cfg-row"},[i("div",so,[i("span",io,r(e.$t(`kling.name.cc_${g}`)),1),n(c,{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 ao=y(xt,[["render",lo],["__scopeId","data-v-cd896060"]]),fe=[{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 ro(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 m of s)if(a.includes(m)){a=a.replace(m,"");break}return a.replace(/(?:,\s*)+$/,"").replace(/^(?:,\s*)+/,"")}const co=b({name:"InspirationPills",components:{FontAwesomeIcon:E},computed:{prompt(){return this.$store.state.kling?.config?.prompt||""},allChipTexts(){return fe.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})}}}),uo={key:0,class:"pills",role:"list"},mo={class:"pill-text"},po=["aria-label","onClick"];function go(e,t,s,a,m,$){const d=o("font-awesome-icon");return e.selected.length>0?(l(),u("div",uo,[(l(!0),u(I,null,T(e.selected,p=>(l(),u("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:be(f=>e.onRemove(p),["stop"])},[n(d,{icon:"fa-solid fa-xmark"})],8,po)]))),128))])):k("",!0)}const fo=y(co,[["render",go],["__scopeId","data-v-5fc4fa65"]]),ho="",_o=b({name:"PromptInput",components:{ElInput:J,ElButton:L,FontAwesomeIcon:E,InfoIcon:V,InspirationPills:fo},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=ho)}}),$o={class:"field"},vo={class:"box"},ko={class:"title font-bold"},bo={class:"actions"};function yo(e,t,s,a,m,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("info-icon"),c=o("inspiration-pills"),v=o("el-input");return l(),u("div",$o,[i("div",vo,[i("h2",ko,r(e.$t("kling.name.prompt")),1),i("div",bo,[n(p,{text:"",size:"small",class:"inspiration-btn",onClick:t[0]||(t[0]=g=>e.$emit("open-inspiration"))},{default:h(()=>[n(d,{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(c),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 wo=y(_o,[["render",yo],["__scopeId","data-v-0a5c57b8"]]),Co="",So=b({name:"NegativePromptInput",components:{ElInput:J,InfoIcon:V},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=Co)}}),Vo={class:"field"},Io={class:"box"},To={class:"title font-bold"};function Eo(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-input");return l(),u("div",Vo,[i("div",Io,[i("h2",To,r(e.$t("kling.name.negativePrompt")),1),n(d,{content:e.$t("kling.description.negativePrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=f=>e.prompt=f),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.negativePrompt")},null,8,["modelValue","placeholder"])])}const Lo=y(So,[["render",Eo],["__scopeId","data-v-de98cf01"]]),Mo=b({name:"InspirationDrawer",components:{ElDrawer:ce,ElButton:L,FontAwesomeIcon:E},props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],data(){return{groups:fe,Close:ye}},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(ro(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)}}}),Ro={class:"drawer-content"},Uo={class:"drawer-header"},Do={class:"title-row"},Ao={class:"title"},Po={class:"hint"},Go={key:0,class:"selected-bar"},Ko={class:"selected-text"},Oo={class:"groups"},jo={class:"group-title"},No={class:"chip-grid"},Bo=["onClick"];function zo(e,t,s,a,m,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),S(f,{modelValue:e.visible,"onUpdate:modelValue":t[1]||(t[1]=c=>e.visible=c),direction:"rtl","with-header":!1,size:e.drawerSize,"custom-class":"kling-inspiration-drawer","destroy-on-close":!1},{default:h(()=>[i("div",Ro,[i("div",Uo,[i("div",Do,[n(d,{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]=c=>e.visible=!1)},null,8,["icon"])]),i("div",Po,r(e.$t("kling.inspiration.hint")),1),e.selectedCount>0?(l(),u("div",Go,[i("span",Ko,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",Oo,[(l(!0),u(I,null,T(e.groups,c=>(l(),u("div",{key:c.groupKey,class:"group"},[i("div",jo,r(e.$t(`kling.inspiration.group.${c.groupKey}`)),1),i("div",No,[(l(!0),u(I,null,T(c.chipKeys,v=>(l(),u("button",{key:v,type:"button",class:U({chip:!0,active:e.isSelected(e.chipText(v))}),onClick:g=>e.onToggle(e.chipText(v))},r(e.chipText(v)),11,Bo))),128))])]))),128))])])]),_:1},8,["modelValue","size"])}const Fo=y(Mo,[["render",zo],["__scopeId","data-v-7d457a69"]]),qo={"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"},Ho={std:"720p",pro:"1080p","4k":"4K"},Wo=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 qo[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||""},modeLabel(){const e=this.config?.mode||"std";return Ho[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),Jo={class:"summary-chip"},Qo=["title"],Yo=["title"],Xo=["title"],Zo=["title"],xo=["title"];function en(e,t,s,a,m,$){const d=o("font-awesome-icon");return l(),u("div",Jo,[i("span",{class:"part",title:e.$t("kling.name.model")},r(e.modelLabel),9,Qo),t[0]||(t[0]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.duration")},r(e.durationLabel),9,Yo),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,Xo),t[2]||(t[2]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.mode")},r(e.modeLabel),9,Zo),e.generateAudio?(l(),u("span",{key:0,class:"audio",title:e.$t("kling.name.generateAudio")},[n(d,{icon:"fa-solid fa-headphones"})],8,xo)):k("",!0)])}const tn=y(Wo,[["render",en],["__scopeId","data-v-418a6733"]]),on=b({name:"ConfigPanel",components:{ElButton:L,Consumption:de,FontAwesomeIcon:E,PromptInput:wo,NegativePromptInput:Lo,ModelSelector:xe,ModeSelector:lt,DurationSelector:ft,RatioSelector:yt,StartImage:Et,CfgScaleSelector:Ft,GenerateAudioSelector:Xt,CameraControlSelector:ao,InspirationDrawer:Fo,SummaryChip:tn,EndImage:Pt},emits:["generate"],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},consumption(){return ge(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit("generate")}}}),nn={class:"flex flex-col h-full"},sn={class:"flex-1 overflow-y-auto p-5"},ln={class:"flex flex-col items-center justify-center px-5 pb-5"};function an(e,t,s,a,m,$){const d=o("prompt-input"),p=o("model-selector"),f=o("ratio-selector"),c=o("start-image"),v=o("end-image"),g=o("duration-selector"),_=o("mode-selector"),M=o("generate-audio-selector"),R=o("camera-control-selector"),j=o("cfg-scale-selector"),he=o("negative-prompt-input"),_e=o("summary-chip"),$e=o("consumption"),Z=o("font-awesome-icon"),x=o("el-button"),ve=o("inspiration-drawer");return l(),u("div",nn,[i("div",sn,[n(d,{class:"mb-4",onOpenInspiration:t[0]||(t[0]=ee=>e.inspirationOpen=!0)}),n(p,{class:"mb-4"}),n(f,{class:"mb-4"}),n(c,{class:"mb-2"}),n(v,{class:"mb-2"}),n(g,{class:"mb-4"}),n(_,{class:"mb-4"}),n(M,{class:"mb-4"}),n(R,{class:"mb-4"}),n(j,{class:"mb-4"}),n(he,{class:"mb-4"})]),i("div",ln,[n(_e),n($e,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(l(),S(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(),S(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(ve,{modelValue:e.inspirationOpen,"onUpdate:modelValue":t[1]||(t[1]=ee=>e.inspirationOpen=ee)},null,8,["modelValue"])])}const rn=y(on,[["render",an]]),cn=b({name:"MotionImage",components:{ElUpload:O,ElButton:L,InfoIcon:V,FontAwesomeIcon:E,ImagePreview:K},mixins:[H],data(){return{fileList:[],uploadUrl:G()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetImageUrl()},methods:{onExceed(){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()}}}),dn={class:"relative"},un={class:"flex justify-between"},mn={class:"flex justify-start items-center"},pn={class:"text-sm font-bold"};function gn(e,t,s,a,m,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),v=o("el-upload");return l(),u("div",dn,[i("div",un,[i("div",mn,[i("span",pn,r(e.$t("kling.name.motionImage")),1),n(d,{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(),S(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(c,{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 fn=y(cn,[["render",gn],["__scopeId","data-v-37d42da7"]]),hn=b({name:"MotionVideo",components:{ElUpload:O,ElButton:L,InfoIcon:V,FilePreview:Me,FontAwesomeIcon:E},data(){return{fileList:[],uploadUrl:G()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetVideoUrl()},methods:{onExceed(){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()}}}),_n={class:"relative"},$n={class:"flex justify-between"},vn={class:"flex justify-start items-center"},kn={class:"text-sm font-bold"};function bn(e,t,s,a,m,$){const d=o("info-icon"),p=o("file-preview"),f=o("font-awesome-icon"),c=o("el-button"),v=o("el-upload");return l(),u("div",_n,[i("div",$n,[i("div",vn,[i("span",kn,r(e.$t("kling.name.motionVideo")),1),n(d,{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(),S(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(c,{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 yn=y(hn,[["render",bn],["__scopeId","data-v-5cf93212"]]),wn=b({name:"MotionPromptInput",components:{ElInput:J,InfoIcon:V},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||""},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),Cn={class:"field"},Sn={class:"box"},Vn={class:"title font-bold"};function In(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-input");return l(),u("div",Cn,[i("div",Sn,[i("h2",Vn,r(e.$t("kling.name.motionPrompt")),1),n(d,{content:e.$t("kling.description.motionPrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=f=>e.prompt=f),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.motionPrompt")},null,8,["modelValue","placeholder"])])}const Tn=y(wn,[["render",In],["__scopeId","data-v-ca9fdbe5"]]),le="video",En=b({name:"CharacterOrientationSelector",components:{ElRadioGroup:Ue,ElRadioButton:Re,InfoIcon:V},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||le},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=le)}}),Ln={class:"field"},Mn={class:"header"},Rn={class:"text-sm font-bold"};function Un(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-radio-button"),f=o("el-radio-group");return l(),u("div",Ln,[i("div",Mn,[i("span",Rn,r(e.$t("kling.name.characterOrientation")),1),n(d,{content:e.$t("kling.description.characterOrientation")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),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 Dn=y(En,[["render",Un],["__scopeId","data-v-7a91195b"]]),ae="std",An=b({name:"MotionModeSelector",components:{ElSelect:P,ElOption:A,InfoIcon:V},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||ae},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=ae)}}),Pn={class:"field"},Gn={class:"header"},Kn={class:"title font-bold"};function On(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),u("div",Pn,[i("div",Gn,[i("h2",Kn,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.motionMode")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),class:"value",placeholder:e.$t("kling.placeholder.select")},{default:h(()=>[(l(!0),u(I,null,T(e.options,c=>(l(),S(p,{key:c.value,label:c.label,value:c.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const jn=y(An,[["render",On],["__scopeId","data-v-1295688c"]]),Nn=b({name:"KeepOriginalSoundSelector",components:{ElSwitch:pe,InfoIcon:V},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"})}}}}),Bn={class:"relative"},zn={class:"flex justify-between items-center"},Fn={class:"flex justify-start items-center"},qn={class:"text-sm font-bold"};function Hn(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-switch");return l(),u("div",Bn,[i("div",zn,[i("div",Fn,[i("span",qn,r(e.$t("kling.name.keepOriginalSound")),1),n(d,{content:e.$t("kling.description.keepOriginalSound")},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=f=>e.value=f)},null,8,["modelValue"])])])}const Wn=y(Nn,[["render",Hn]]),Jn=b({name:"MotionPanel",components:{ElButton:L,FontAwesomeIcon:E,Consumption:de,MotionImage:fn,MotionVideo:yn,MotionPromptInput:Tn,CharacterOrientationSelector:Dn,MotionModeSelector:jn,KeepOriginalSoundSelector:Wn},emits:["generate"],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return ge(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")}}}),Qn={class:"flex flex-col h-full"},Yn={class:"flex-1 overflow-y-auto p-5"},Xn={class:"flex flex-col items-center justify-center px-5 pb-5"};function Zn(e,t,s,a,m,$){const d=o("motion-image"),p=o("motion-video"),f=o("motion-prompt-input"),c=o("character-orientation-selector"),v=o("motion-mode-selector"),g=o("keep-original-sound-selector"),_=o("consumption"),M=o("font-awesome-icon"),R=o("el-button");return l(),u("div",Qn,[i("div",Yn,[n(d,{class:"mb-3"}),n(p,{class:"mb-3"}),n(f,{class:"mb-4"}),n(c,{class:"mb-4"}),n(v,{class:"mb-4"}),n(g,{class:"mb-4"})]),i("div",Xn,[n(_,{value:e.consumption,service:e.service},null,8,["value","service"]),n(R,{type:"primary",class:"btn w-full",round:"",disabled:!e.canGenerate,onClick:e.onGenerate},{default:h(()=>[n(M,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.generateMotion")),1)]),_:1},8,["disabled","onClick"])])])}const xn=y(Jn,[["render",Zn]]),es=b({name:"KlingTabSwitcher",components:{ElTabs:Ae,ElTabPane:De,ElTag:we},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)}}}),ts=["title"],os={class:"text"};function ns(e,t,s,a,m,$){const d=o("el-tag"),p=o("el-tab-pane"),f=o("el-tabs");return l(),S(f,{"model-value":e.modelValue,class:"kling-tabs",stretch:"","onUpdate:modelValue":e.onUpdate},{default:h(()=>[(l(!0),u(I,null,T(e.tabs,c=>(l(),S(p,{key:c.value,name:c.value,disabled:c.disabled},{label:h(()=>[i("span",{class:"tab-label",title:c.disabled?c.disabledReason:void 0},[i("span",os,r(c.label),1),c.badge?(l(),S(d,{key:0,size:"small",type:"warning",class:"badge"},{default:h(()=>[w(r(c.badge),1)]),_:2},1024)):k("",!0)],8,ts)]),_:2},1032,["name","disabled"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])}const ss=y(es,[["render",ns],["__scopeId","data-v-bf00c27e"]]),is=b({name:"TaskPreview",components:{ElImage:Oe,CopyToClipboard:Pe,FontAwesomeIcon:E,ElAlert:Ke,VideoPlayer:Ge,ElTooltip:W,ElButton:L,ImagePreview:K},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},referenceImages(){const e=[],t=this.modelValue?.request?.start_image_url,s=this.modelValue?.request?.end_image_url;return t&&e.push({url:t,name:"start-image"}),s&&e.push({url:s,name:"end-image"}),e}},methods:{onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onOpenVideo(e){window.open(e,"_blank")}}}),ls={class:"preview"},as={class:"left"},rs={class:"main"},cs={class:"bot"},ds={class:"datetime"},us={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"},gs={key:0},fs={key:1},hs={key:0,class:U({content:!0,failed:!0})},_s={key:0,class:"mb-4"},$s={key:1,class:U({operations:!0,"mt-2":!0})},vs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ks={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},bs={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},ys={key:1,class:U({content:!0})},ws={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Cs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ss={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"},Is={key:2,class:U({content:!0})},Ts={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Es={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Ls(e,t,s,a,m,$){const d=o("el-image"),p=o("image-preview"),f=o("video-player"),c=o("el-button"),v=o("el-tooltip"),g=o("font-awesome-icon"),_=o("copy-to-clipboard"),M=o("el-alert");return l(),u("div",ls,[i("div",as,[n(d,{src:"https://cdn.acedata.cloud/qpbbbb.jpg",class:"avatar"})]),i("div",rs,[i("div",cs,[w(r(e.$t("kling.name.klingBot"))+" ",1),i("span",ds,r(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),i("div",us,[e.referenceImages.length>0?(l(),u("div",ms,[(l(!0),u(I,null,T(e.referenceImages,(R,j)=>(l(),S(p,{key:j,url:R.url,name:R.name,closable:!1},null,8,["url","name"]))),128))])):k("",!0),e.modelValue?.request?.prompt?(l(),u("p",ps,[w(r(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?k("",!0):(l(),u("span",gs," - ("+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(),u("span",fs," - ("+r(e.$t("kling.status.processing"))+") ",1)):k("",!0)])):k("",!0)]),e.modelValue?.response?.success===!0?(l(),u("div",hs,[e.modelValue?.response.video_url?(l(),u("div",_s,[n(f,{src:e.modelValue?.response.video_url},null,8,["src"])])):k("",!0),e.modelValue?.response.success?(l(),u("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(),S(c,{key:0,type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=R=>e.onDownload(R,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",vs,[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",ks,[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(),u("p",bs,[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(),u("div",ys,[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",ws,[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",Cs,[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(),u("p",Ss,[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(),u("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(),u("div",Is,[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(),u("p",Es,[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 Ms=y(is,[["render",Ls],["__scopeId","data-v-e8e87659"]]),Rs=b({name:"RecentPanel",components:{TaskPreview:Ms,NoTasks:Ne,BotPlaceholder:je,ScrollList:Ee},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},Ds={key:2,class:"w-full h-full flex items-center justify-center"};function As(e,t,s,a,m,$){const d=o("bot-placeholder"),p=o("task-preview"),f=o("scroll-list"),c=o("no-tasks");return l(),u(I,null,[e.tasks?.items===void 0?(l(),u("div",Us,[n(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(l(),S(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),u(I,null,T(e.tasks?.items,v=>(l(),S(p,{key:v.id,"model-value":v},null,8,["model-value"]))),128))]),_:1},8,["loading"])):k("",!0),e.tasks?.items?.length===0?(l(),u("div",Ds,[n(c)])):k("",!0)],64)}const Ps=y(Rs,[["render",As]]),re=Ce("kling"),Gs=b({name:"KlingIndex",components:{ConfigPanel:rn,MotionPanel:xn,TabSwitcher:ss,Layout:We,RecentPanel:Ps},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===ne.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===ne.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 Le({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:re};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(([,m])=>m!=null))}:{}});const a=this.credential?.token;if(!a){console.error("no token specified");return}C.info(this.$t("kling.message.startingTask")),te("kling",oe.generate(s,{token:a})).then(()=>{C.success(this.$t("kling.message.startTaskSuccess"))}).catch(m=>{m?.response?.data?.error?.code===ie?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:re},s=this.credential?.token;if(!s){console.error("no token specified");return}C.info(this.$t("kling.message.startingTask")),te("kling",oe.motion(t,{token:s})).then(()=>{C.success(this.$t("kling.message.startTaskSuccess"))}).catch(a=>{a?.response?.data?.error?.code===ie?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)})}}}),Ks={class:"flex flex-col h-full"},Os={class:"flex-1 min-h-0"};function js(e,t,s,a,m,$){const d=o("tab-switcher"),p=o("config-panel"),f=o("motion-panel"),c=o("recent-panel"),v=o("layout");return l(),S(v,null,{config:h(()=>[i("div",Ks,[n(d,{"model-value":e.taskType,"onUpdate:modelValue":e.onTabChange},null,8,["model-value","onUpdate:modelValue"]),i("div",Os,[e.taskType==="videos"?(l(),S(p,{key:0,onGenerate:e.onGenerate},null,8,["onGenerate"])):e.taskType==="motion"?(l(),S(f,{key:1,onGenerate:e.onGenerateMotion},null,8,["onGenerate"])):k("",!0)])])]),result:h(()=>[n(c,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Ni=y(Gs,[["render",js]]);export{Ni as default};
1
+ import{F as E}from"./index.es-f2R6ubO6.js";import{E as L}from"./index-D-4JF5KB.js";import{E as ce}from"./index-CKceOzxT.js";import{d as b,H as u,E as i,z as N,C as n,y as h,D as o,q as l,F as r,x as S,O as I,N as T,Q as U,J as k,R as ke,I as w,M as be}from"./vendor-vue-NSDaktjZ.js";import{G as y,bj as G,ag as ye,H as we,co as te,aF as oe,S as ne,cp as Ce}from"./index-DVUMZ05r.js";import{b as Se,c as se,d as F,e as D,f as Ve,g as Ie,h as Te}from"./kling-CtoPhhA9.js";import{E as A,a as P}from"./index-BKHSCugF.js";import{E as q}from"./index-CCBjpDl1.js";import{E as C}from"./index-CsGFFE61.js";import{I as V,S as Ee,l as Le}from"./pagination-BIv0I4gk.js";import{p as H}from"./pasteUploadMixin-BurWbGNQ.js";import{I as K}from"./ImagePreview-CUVXtH2l.js";import{E as W}from"./index-CWdAzE8_.js";import{E as O}from"./index-r007Lgz_.js";import{C as de}from"./Consumption-BKf_KS7X.js";import{E as ue}from"./index-NAYAb2EN.js";import{E as me}from"./index-DsLfL_UZ.js";import{E as pe}from"./index-DMHXbvDD.js";import{E as J}from"./index-CtbJ8jTa.js";import{a as ge}from"./price-3Bxyzfub.js";import{F as Me}from"./FilePreview-CnGQ7pAL.js";import{E as Re,a as Ue}from"./index-BqsKk8tF.js";import{E as De,a as Ae}from"./index-BULPgnOG.js";import{b as ie}from"./errorCode-Cqj9Td_Z.js";import{C as Pe}from"./CopyToClipboard-CIRw6WL5.js";import{V as Ge}from"./VideoPlayer-CXT39jg2.js";import{E as Ke}from"./index-Cd_qWETX.js";import{E as Oe}from"./index-DrLf4K3A.js";import{B as je}from"./BotPlaceholder-oG7ygyok.js";import{N as Ne}from"./NoTasks-9iEEhsIS.js";import"./use-form-item-DhMXJI5q.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Df5ITouH.js";import"./index-jyz6xleX.js";import"./typescript-qAIJ13Qr.js";import"./index-B5Z3EZrb.js";import"./strings-beZM2Y-f.js";import"./isEqual-B1Z_z-Zf.js";import"./_Uint8Array-yhuF-6h2.js";import"./castArray-B2mZnC5U.js";import"./debounce-C18vO1_Z.js";import"./_baseIteratee-CTMClKxb.js";import"./index-GfS1QM00.js";import"./validator-C_MCdjOG.js";import"./index-eWlKuNNN.js";import"./_baseClone-Ccji6pFO.js";import"./_initCloneObject-D2UisHWT.js";import"./index-Cu41y2Fl.js";import"./index-CSLM8oj_.js";import"./isPlainObject-CmiP43ac.js";import"./vue-plyr-BO2nlN4c.js";import"./index-CGBK8gn9.js";const Be=b({name:"LayoutKling",components:{ElDrawer:ce,ElButton:L,FontAwesomeIcon:E},data(){return{drawer:!1}}}),ze={class:"main flex flex-row flex-1 min-h-0"},Fe={class:"config w-[320px] flex-none h-full flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},qe={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function He(e,t,s,a,m,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),u("div",ze,[i("div",Fe,[N(e.$slots,"config",{},void 0,!0)]),i("div",qe,[N(e.$slots,"result",{},void 0,!0)]),n(p,{circle:"",class:"menu",onClick:t[0]||(t[0]=c=>e.drawer=!0)},{default:h(()=>[n(d,{icon:"fa-solid fa-magic"})]),_:1}),n(f,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=c=>e.drawer=c),direction:"ltr","with-header":!1,size:"350px"},{default:h(()=>[N(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const We=y(Be,[["render",He],["__scopeId","data-v-be4bb0df"]]),Je={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function Q(e,t,s){const a=t||"std",m=s??5;switch(e){case"kling-v1":return{text2video:!0,image2video:!0,endImage:m===5,audio:!1,motionControl:m===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 Je}}function Y(e,t){if(!e)return[];const s=t.model??e.model,a=t.mode??e.mode,m=t.duration??e.duration;if(!s)return[];const $=Q(s,a,m),d=[];return e.end_image_url&&!$.endImage&&d.push({field:"end_image_url",i18nLabel:"kling.name.endImage"}),e.generate_audio&&!$.audio&&d.push({field:"generate_audio",i18nLabel:"kling.name.generateAudio"}),e.camera_control?.type&&(!$.motionControl||e.start_image_url)&&d.push({field:"camera_control",i18nLabel:"kling.name.cameraControl"}),d}function 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 Qe=b({name:"ModelSelector",components:{ElSelect:P,ElOption:A},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(m=>this.$t(m.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 m=X({...t,model:e},s);this.$store.commit("kling/setConfig",m),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})}}}),Ye={class:"field"},Xe={class:"title font-bold"};function Ze(e,t,s,a,m,$){const d=o("el-option"),p=o("el-select");return l(),u("div",Ye,[i("h2",Xe,r(e.$t("pika.name.model")),1),(l(),S(p,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("pika.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),u(I,null,T(e.options,f=>(l(),S(d,{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const xe=y(Qe,[["render",Ze],["__scopeId","data-v-04059875"]]),et=b({name:"ModeSelector",components:{ElSelect:P,ElOption:A,InfoIcon:V},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(se)}},mounted(){this.value||this.applyMode(se)},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(m=>this.$t(m.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 m=X({...t,mode:e},s);this.$store.commit("kling/setConfig",m),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})}}}),tt={class:"field"},ot={class:"header"},nt={class:"title font-bold"},st={key:0,class:"opt-tip"};function it(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),u("div",tt,[i("div",ot,[i("h2",nt,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.mode"),class:"info-icon"},null,8,["content"])]),(l(),S(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),u(I,null,T(e.options,c=>(l(),S(p,{key:c.value,label:c.label,value:c.value,disabled:c.disabled},{default:h(()=>[i("span",{class:U({"opt-disabled":c.disabled})},r(c.label),3),c.disabled&&c.disabledReason?(l(),u("span",st,r(c.disabledReason),1)):k("",!0)]),_:2},1032,["label","value","disabled"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const lt=y(et,[["render",it],["__scopeId","data-v-9a8fa3c5"]]),at=[3,5,8,10,12,15],rt=[5,10],ct=b({name:"DurationSelector",components:{ElSelect:P,ElOption:A,InfoIcon:V},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},isV3Model(){return F.includes(this.selectedModel)},allowedDurations(){return this.isV3Model?at:rt},value(){return this.$store.state.kling?.config?.duration??D},selectValue(){const e=this.allowedDurations;return e.includes(this.value)?this.value:e.includes(D)?D:e[0]}},watch:{isV3Model(){this.allowedDurations.includes(this.value)||this.applyDuration(D)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(D)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Y(t,{duration:e});if(s.length===0){this.applyDuration(e);return}const a=s.map(m=>this.$t(m.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 m=X({...t,duration:e},s);this.$store.commit("kling/setConfig",m),C.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyDuration(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,duration:e})}}}),dt={class:"field"},ut={class:"control"},mt={class:"label"},pt={class:"title font-bold"};function gt(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),u("div",dt,[i("div",ut,[i("div",mt,[i("h2",pt,r(e.$t("kling.name.duration")),1),n(d,{content:e.$t("kling.description.duration"),class:"info-icon ml-1"},null,8,["content"])]),(l(),S(f,{key:e.revertKey,"model-value":e.selectValue,class:"value",placeholder:e.$t("kling.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),u(I,null,T(e.allowedDurations,c=>(l(),S(p,{key:c,label:`${c}s`,value:c},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])])}const ft=y(ct,[["render",gt],["__scopeId","data-v-5ae55e28"]]),ht=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=Ve)}}),_t={class:"text-sm font-bold mb-2 block"},$t={class:"items"},vt=["onClick"],kt={class:"name"};function bt(e,t,s,a,m,$){return l(),u("div",null,[i("span",_t,r(e.$t("kling.name.ratio")),1),i("div",$t,[(l(!0),u(I,null,T(e.options,(d,p)=>(l(),u("div",{key:p,class:U({active:e.active===p,item:!0}),onClick:f=>e.value=d.value},[i("div",{class:U(["preview",d.label])},[i("div",{class:"rect",style:ke({width:d.width+"px",height:d.height+"px"})},null,4)],2),i("p",kt,r(d.label),1)],10,vt))),128))])])}const yt=y(ht,[["render",bt],["__scopeId","data-v-cdb14b2f"]]),wt=b({name:"StartImage",components:{ElUpload:O,ElButton:L,ElTooltip:W,InfoIcon:V,FontAwesomeIcon:E,ImagePreview:K},mixins:[H],emits:["change"],data(){return{fileList:[],uploadUrl:G()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},value:{get(){return this.$store.state?.kling?.config?.start_image_url},set(){}}},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()}}}),Ct={class:"relative"},St={class:"flex justify-between"},Vt={class:"flex justify-start items-center"},It={class:"text-sm font-bold"};function Tt(e,t,s,a,m,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),v=o("el-tooltip"),g=o("el-upload");return l(),u("div",Ct,[i("div",St,[i("div",Vt,[i("span",It,r(e.$t("kling.name.startImage")),1),n(d,{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(),S(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(c,{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 Et=y(wt,[["render",Tt],["__scopeId","data-v-68cf38f5"]]),Lt=b({name:"EndImage",components:{ElUpload:O,ElButton:L,ElTooltip:W,ImagePreview:K,InfoIcon:V,FontAwesomeIcon:E},mixins:[H],data(){return{fileList:[],uploadUrl:G()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},klingConfig(){return this.$store.state?.kling?.config||{}},endImageSupported(){return Q(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},hasStartImage(){return!!this.klingConfig.start_image_url},uploadDisabled(){return this.reachedLimit||!this.endImageSupported||!this.hasStartImage},uploadTooltip(){return this.endImageSupported?this.hasStartImage?this.reachedLimit?this.$t("kling.message.uploadReferencesExceed"):"":this.$t("kling.message.endImageRequiresStart"):this.$t("kling.message.endImageNotSupported")},storeValue(){return this.klingConfig.end_image_url},value:{get(){return this.storeValue},set(){}}},watch:{storeValue(e){!e&&this.fileList.length>0&&(this.fileList=[])},hasStartImage(e){!e&&this.storeValue&&(this.fileList=[],this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,end_image_url:void 0}))}},mounted(){this.value||(this.value=void 0),this.onSetEndImageUrl()},methods:{onBeforeUpload(){return this.endImageSupported?this.hasStartImage?!0:(C.warning(this.$t("kling.message.endImageRequiresStart")),!1):(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()}}}),Mt={class:"relative"},Rt={class:"flex justify-between"},Ut={class:"flex justify-start items-center"},Dt={class:"text-sm font-bold"};function At(e,t,s,a,m,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),v=o("el-tooltip"),g=o("el-upload");return l(),u("div",Mt,[i("div",Rt,[i("div",Ut,[i("span",Dt,r(e.$t("kling.name.endImage")),1),n(d,{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(),S(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(c,{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(Lt,[["render",At],["__scopeId","data-v-593c3bde"]]),Gt=b({name:"CfgScaleSelector",components:{ElSlider:me,InfoIcon:V,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)}}),Kt={class:"flex justify-between"},Ot={class:"flex justify-start items-center"},jt={class:"text-sm font-bold"},Nt={class:"flex justify-end items-center"},Bt={class:"w-full"};function zt(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-input-number"),f=o("el-slider");return l(),u("div",null,[i("div",Kt,[i("div",Ot,[i("span",jt,r(e.$t("kling.name.cfgScale")),1),n(d,{content:e.$t("kling.description.cfgScale")},null,8,["content"])]),i("div",Nt,[n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),"controls-position":"right"},null,8,["modelValue"])])]),i("div",Bt,[n(f,{modelValue:e.value,"onUpdate:modelValue":t[1]||(t[1]=c=>e.value=c),min:0,max:1,step:.1},null,8,["modelValue"])])])}const Ft=y(Gt,[["render",zt]]),qt=b({name:"GenerateAudioSelector",components:{ElSwitch:pe,InfoIcon:V},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??Te:!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})}}}),Ht={class:"relative"},Wt={class:"flex justify-between items-center"},Jt={class:"flex justify-start items-center"},Qt={class:"text-sm font-bold"};function Yt(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-switch");return l(),u("div",Ht,[i("div",Wt,[i("div",Jt,[i("span",Qt,r(e.$t("kling.name.generateAudio")),1),n(d,{content:e.tooltipContent},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=f=>e.value=f),class:"value",disabled:!e.supported},null,8,["modelValue","disabled"])])])}const Xt=y(qt,[["render",Yt]]),Zt=["horizontal","vertical","pan","tilt","roll","zoom"],xt=b({name:"CameraControlSelector",components:{ElSelect:P,ElOption:A,ElSlider:me,ElInputNumber:ue,InfoIcon:V},data(){return{configKeys:Zt}},computed:{typeOptions(){return[{value:"",label:this.$t("kling.name.cameraTypeNone")},{value:"simple",label:this.$t("kling.name.cameraTypeSimple")},{value:"down_back",label:this.$t("kling.name.cameraTypeDownBack")},{value:"forward_up",label:this.$t("kling.name.cameraTypeForwardUp")},{value:"left_turn_forward",label:this.$t("kling.name.cameraTypeLeftTurnForward")},{value:"right_turn_forward",label:this.$t("kling.name.cameraTypeRightTurnForward")}]},selectedMode(){return this.$store.state.kling?.config?.mode||""},selectedModel(){return this.$store.state.kling?.config?.model||""},selectedDuration(){return this.$store.state.kling?.config?.duration},motionControlSupported(){return Q(this.selectedModel,this.selectedMode,this.selectedDuration).motionControl},hasStartImage(){return!!this.$store.state.kling?.config?.start_image_url},disabled(){return!this.motionControlSupported||this.hasStartImage},tooltipContent(){return this.motionControlSupported?this.hasStartImage?this.$t("kling.description.cameraControlDisabledImage2Video"):this.$t("kling.description.cameraControl"):this.$t("kling.description.cameraControlNotSupported")},selectedType(){return this.$store.state.kling?.config?.camera_control?.type},selectedTypeRaw:{get(){return this.selectedType??""},set(e){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"},m={...a.config||{}};t==null?delete m[e]:m[e]=t,this.$store.commit("kling/setConfig",{...s,camera_control:{...a,type:"simple",config:m}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),eo={class:"field"},to={class:"header"},oo={class:"text-sm font-bold"},no={key:0,class:"config-grid"},so={class:"cfg-row-head"},io={class:"cfg-name"};function lo(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select"),c=o("el-input-number"),v=o("el-slider");return l(),u("div",eo,[i("div",to,[i("span",oo,r(e.$t("kling.name.cameraControl")),1),n(d,{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),u(I,null,T(e.typeOptions,g=>(l(),S(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(),u("div",no,[(l(!0),u(I,null,T(e.configKeys,g=>(l(),u("div",{key:g,class:"cfg-row"},[i("div",so,[i("span",io,r(e.$t(`kling.name.cc_${g}`)),1),n(c,{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 ao=y(xt,[["render",lo],["__scopeId","data-v-cd896060"]]),fe=[{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 ro(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 m of s)if(a.includes(m)){a=a.replace(m,"");break}return a.replace(/(?:,\s*)+$/,"").replace(/^(?:,\s*)+/,"")}const co=b({name:"InspirationPills",components:{FontAwesomeIcon:E},computed:{prompt(){return this.$store.state.kling?.config?.prompt||""},allChipTexts(){return fe.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})}}}),uo={key:0,class:"pills",role:"list"},mo={class:"pill-text"},po=["aria-label","onClick"];function go(e,t,s,a,m,$){const d=o("font-awesome-icon");return e.selected.length>0?(l(),u("div",uo,[(l(!0),u(I,null,T(e.selected,p=>(l(),u("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:be(f=>e.onRemove(p),["stop"])},[n(d,{icon:"fa-solid fa-xmark"})],8,po)]))),128))])):k("",!0)}const fo=y(co,[["render",go],["__scopeId","data-v-5fc4fa65"]]),ho="",_o=b({name:"PromptInput",components:{ElInput:J,ElButton:L,FontAwesomeIcon:E,InfoIcon:V,InspirationPills:fo},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=ho)}}),$o={class:"field"},vo={class:"box"},ko={class:"title font-bold"},bo={class:"actions"};function yo(e,t,s,a,m,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("info-icon"),c=o("inspiration-pills"),v=o("el-input");return l(),u("div",$o,[i("div",vo,[i("h2",ko,r(e.$t("kling.name.prompt")),1),i("div",bo,[n(p,{text:"",size:"small",class:"inspiration-btn",onClick:t[0]||(t[0]=g=>e.$emit("open-inspiration"))},{default:h(()=>[n(d,{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(c),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 wo=y(_o,[["render",yo],["__scopeId","data-v-0a5c57b8"]]),Co="",So=b({name:"NegativePromptInput",components:{ElInput:J,InfoIcon:V},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=Co)}}),Vo={class:"field"},Io={class:"box"},To={class:"title font-bold"};function Eo(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-input");return l(),u("div",Vo,[i("div",Io,[i("h2",To,r(e.$t("kling.name.negativePrompt")),1),n(d,{content:e.$t("kling.description.negativePrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=f=>e.prompt=f),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.negativePrompt")},null,8,["modelValue","placeholder"])])}const Lo=y(So,[["render",Eo],["__scopeId","data-v-de98cf01"]]),Mo=b({name:"InspirationDrawer",components:{ElDrawer:ce,ElButton:L,FontAwesomeIcon:E},props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],data(){return{groups:fe,Close:ye}},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(ro(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)}}}),Ro={class:"drawer-content"},Uo={class:"drawer-header"},Do={class:"title-row"},Ao={class:"title"},Po={class:"hint"},Go={key:0,class:"selected-bar"},Ko={class:"selected-text"},Oo={class:"groups"},jo={class:"group-title"},No={class:"chip-grid"},Bo=["onClick"];function zo(e,t,s,a,m,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),S(f,{modelValue:e.visible,"onUpdate:modelValue":t[1]||(t[1]=c=>e.visible=c),direction:"rtl","with-header":!1,size:e.drawerSize,"custom-class":"kling-inspiration-drawer","destroy-on-close":!1},{default:h(()=>[i("div",Ro,[i("div",Uo,[i("div",Do,[n(d,{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]=c=>e.visible=!1)},null,8,["icon"])]),i("div",Po,r(e.$t("kling.inspiration.hint")),1),e.selectedCount>0?(l(),u("div",Go,[i("span",Ko,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",Oo,[(l(!0),u(I,null,T(e.groups,c=>(l(),u("div",{key:c.groupKey,class:"group"},[i("div",jo,r(e.$t(`kling.inspiration.group.${c.groupKey}`)),1),i("div",No,[(l(!0),u(I,null,T(c.chipKeys,v=>(l(),u("button",{key:v,type:"button",class:U({chip:!0,active:e.isSelected(e.chipText(v))}),onClick:g=>e.onToggle(e.chipText(v))},r(e.chipText(v)),11,Bo))),128))])]))),128))])])]),_:1},8,["modelValue","size"])}const Fo=y(Mo,[["render",zo],["__scopeId","data-v-7d457a69"]]),qo={"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"},Ho={std:"720p",pro:"1080p","4k":"4K"},Wo=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 qo[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||""},modeLabel(){const e=this.config?.mode||"std";return Ho[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),Jo={class:"summary-chip"},Qo=["title"],Yo=["title"],Xo=["title"],Zo=["title"],xo=["title"];function en(e,t,s,a,m,$){const d=o("font-awesome-icon");return l(),u("div",Jo,[i("span",{class:"part",title:e.$t("kling.name.model")},r(e.modelLabel),9,Qo),t[0]||(t[0]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.duration")},r(e.durationLabel),9,Yo),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,Xo),t[2]||(t[2]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.mode")},r(e.modeLabel),9,Zo),e.generateAudio?(l(),u("span",{key:0,class:"audio",title:e.$t("kling.name.generateAudio")},[n(d,{icon:"fa-solid fa-headphones"})],8,xo)):k("",!0)])}const tn=y(Wo,[["render",en],["__scopeId","data-v-418a6733"]]),on=b({name:"ConfigPanel",components:{ElButton:L,Consumption:de,FontAwesomeIcon:E,PromptInput:wo,NegativePromptInput:Lo,ModelSelector:xe,ModeSelector:lt,DurationSelector:ft,RatioSelector:yt,StartImage:Et,CfgScaleSelector:Ft,GenerateAudioSelector:Xt,CameraControlSelector:ao,InspirationDrawer:Fo,SummaryChip:tn,EndImage:Pt},emits:["generate"],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},consumption(){return ge(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit("generate")}}}),nn={class:"flex flex-col h-full"},sn={class:"flex-1 overflow-y-auto p-5"},ln={class:"flex flex-col items-center justify-center px-5 pb-5"};function an(e,t,s,a,m,$){const d=o("prompt-input"),p=o("model-selector"),f=o("ratio-selector"),c=o("start-image"),v=o("end-image"),g=o("duration-selector"),_=o("mode-selector"),M=o("generate-audio-selector"),R=o("camera-control-selector"),j=o("cfg-scale-selector"),he=o("negative-prompt-input"),_e=o("summary-chip"),$e=o("consumption"),Z=o("font-awesome-icon"),x=o("el-button"),ve=o("inspiration-drawer");return l(),u("div",nn,[i("div",sn,[n(d,{class:"mb-4",onOpenInspiration:t[0]||(t[0]=ee=>e.inspirationOpen=!0)}),n(p,{class:"mb-4"}),n(f,{class:"mb-4"}),n(c,{class:"mb-2"}),n(v,{class:"mb-2"}),n(g,{class:"mb-4"}),n(_,{class:"mb-4"}),n(M,{class:"mb-4"}),n(R,{class:"mb-4"}),n(j,{class:"mb-4"}),n(he,{class:"mb-4"})]),i("div",ln,[n(_e),n($e,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(l(),S(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(),S(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(ve,{modelValue:e.inspirationOpen,"onUpdate:modelValue":t[1]||(t[1]=ee=>e.inspirationOpen=ee)},null,8,["modelValue"])])}const rn=y(on,[["render",an]]),cn=b({name:"MotionImage",components:{ElUpload:O,ElButton:L,InfoIcon:V,FontAwesomeIcon:E,ImagePreview:K},mixins:[H],data(){return{fileList:[],uploadUrl:G()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetImageUrl()},methods:{onExceed(){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()}}}),dn={class:"relative"},un={class:"flex justify-between"},mn={class:"flex justify-start items-center"},pn={class:"text-sm font-bold"};function gn(e,t,s,a,m,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),v=o("el-upload");return l(),u("div",dn,[i("div",un,[i("div",mn,[i("span",pn,r(e.$t("kling.name.motionImage")),1),n(d,{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(),S(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(c,{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 fn=y(cn,[["render",gn],["__scopeId","data-v-37d42da7"]]),hn=b({name:"MotionVideo",components:{ElUpload:O,ElButton:L,InfoIcon:V,FilePreview:Me,FontAwesomeIcon:E},data(){return{fileList:[],uploadUrl:G()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetVideoUrl()},methods:{onExceed(){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()}}}),_n={class:"relative"},$n={class:"flex justify-between"},vn={class:"flex justify-start items-center"},kn={class:"text-sm font-bold"};function bn(e,t,s,a,m,$){const d=o("info-icon"),p=o("file-preview"),f=o("font-awesome-icon"),c=o("el-button"),v=o("el-upload");return l(),u("div",_n,[i("div",$n,[i("div",vn,[i("span",kn,r(e.$t("kling.name.motionVideo")),1),n(d,{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(),S(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(c,{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 yn=y(hn,[["render",bn],["__scopeId","data-v-5cf93212"]]),wn=b({name:"MotionPromptInput",components:{ElInput:J,InfoIcon:V},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||""},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),Cn={class:"field"},Sn={class:"box"},Vn={class:"title font-bold"};function In(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-input");return l(),u("div",Cn,[i("div",Sn,[i("h2",Vn,r(e.$t("kling.name.motionPrompt")),1),n(d,{content:e.$t("kling.description.motionPrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=f=>e.prompt=f),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.motionPrompt")},null,8,["modelValue","placeholder"])])}const Tn=y(wn,[["render",In],["__scopeId","data-v-ca9fdbe5"]]),le="video",En=b({name:"CharacterOrientationSelector",components:{ElRadioGroup:Ue,ElRadioButton:Re,InfoIcon:V},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||le},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=le)}}),Ln={class:"field"},Mn={class:"header"},Rn={class:"text-sm font-bold"};function Un(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-radio-button"),f=o("el-radio-group");return l(),u("div",Ln,[i("div",Mn,[i("span",Rn,r(e.$t("kling.name.characterOrientation")),1),n(d,{content:e.$t("kling.description.characterOrientation")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),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 Dn=y(En,[["render",Un],["__scopeId","data-v-7a91195b"]]),ae="std",An=b({name:"MotionModeSelector",components:{ElSelect:P,ElOption:A,InfoIcon:V},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||ae},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=ae)}}),Pn={class:"field"},Gn={class:"header"},Kn={class:"title font-bold"};function On(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),u("div",Pn,[i("div",Gn,[i("h2",Kn,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.motionMode")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),class:"value",placeholder:e.$t("kling.placeholder.select")},{default:h(()=>[(l(!0),u(I,null,T(e.options,c=>(l(),S(p,{key:c.value,label:c.label,value:c.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const jn=y(An,[["render",On],["__scopeId","data-v-1295688c"]]),Nn=b({name:"KeepOriginalSoundSelector",components:{ElSwitch:pe,InfoIcon:V},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"})}}}}),Bn={class:"relative"},zn={class:"flex justify-between items-center"},Fn={class:"flex justify-start items-center"},qn={class:"text-sm font-bold"};function Hn(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-switch");return l(),u("div",Bn,[i("div",zn,[i("div",Fn,[i("span",qn,r(e.$t("kling.name.keepOriginalSound")),1),n(d,{content:e.$t("kling.description.keepOriginalSound")},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=f=>e.value=f)},null,8,["modelValue"])])])}const Wn=y(Nn,[["render",Hn]]),Jn=b({name:"MotionPanel",components:{ElButton:L,FontAwesomeIcon:E,Consumption:de,MotionImage:fn,MotionVideo:yn,MotionPromptInput:Tn,CharacterOrientationSelector:Dn,MotionModeSelector:jn,KeepOriginalSoundSelector:Wn},emits:["generate"],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return ge(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")}}}),Qn={class:"flex flex-col h-full"},Yn={class:"flex-1 overflow-y-auto p-5"},Xn={class:"flex flex-col items-center justify-center px-5 pb-5"};function Zn(e,t,s,a,m,$){const d=o("motion-image"),p=o("motion-video"),f=o("motion-prompt-input"),c=o("character-orientation-selector"),v=o("motion-mode-selector"),g=o("keep-original-sound-selector"),_=o("consumption"),M=o("font-awesome-icon"),R=o("el-button");return l(),u("div",Qn,[i("div",Yn,[n(d,{class:"mb-3"}),n(p,{class:"mb-3"}),n(f,{class:"mb-4"}),n(c,{class:"mb-4"}),n(v,{class:"mb-4"}),n(g,{class:"mb-4"})]),i("div",Xn,[n(_,{value:e.consumption,service:e.service},null,8,["value","service"]),n(R,{type:"primary",class:"btn w-full",round:"",disabled:!e.canGenerate,onClick:e.onGenerate},{default:h(()=>[n(M,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.generateMotion")),1)]),_:1},8,["disabled","onClick"])])])}const xn=y(Jn,[["render",Zn]]),es=b({name:"KlingTabSwitcher",components:{ElTabs:Ae,ElTabPane:De,ElTag:we},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)}}}),ts=["title"],os={class:"text"};function ns(e,t,s,a,m,$){const d=o("el-tag"),p=o("el-tab-pane"),f=o("el-tabs");return l(),S(f,{"model-value":e.modelValue,class:"kling-tabs",stretch:"","onUpdate:modelValue":e.onUpdate},{default:h(()=>[(l(!0),u(I,null,T(e.tabs,c=>(l(),S(p,{key:c.value,name:c.value,disabled:c.disabled},{label:h(()=>[i("span",{class:"tab-label",title:c.disabled?c.disabledReason:void 0},[i("span",os,r(c.label),1),c.badge?(l(),S(d,{key:0,size:"small",type:"warning",class:"badge"},{default:h(()=>[w(r(c.badge),1)]),_:2},1024)):k("",!0)],8,ts)]),_:2},1032,["name","disabled"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])}const ss=y(es,[["render",ns],["__scopeId","data-v-bf00c27e"]]),is=b({name:"TaskPreview",components:{ElImage:Oe,CopyToClipboard:Pe,FontAwesomeIcon:E,ElAlert:Ke,VideoPlayer:Ge,ElTooltip:W,ElButton:L,ImagePreview:K},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},referenceImages(){const e=[],t=this.modelValue?.request?.start_image_url,s=this.modelValue?.request?.end_image_url;return t&&e.push({url:t,name:"start-image"}),s&&e.push({url:s,name:"end-image"}),e}},methods:{onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onOpenVideo(e){window.open(e,"_blank")}}}),ls={class:"preview"},as={class:"left"},rs={class:"main"},cs={class:"bot"},ds={class:"datetime"},us={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"},gs={key:0},fs={key:1},hs={key:0,class:U({content:!0,failed:!0})},_s={key:0,class:"mb-4"},$s={key:1,class:U({operations:!0,"mt-2":!0})},vs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ks={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},bs={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},ys={key:1,class:U({content:!0})},ws={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Cs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ss={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"},Is={key:2,class:U({content:!0})},Ts={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Es={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Ls(e,t,s,a,m,$){const d=o("el-image"),p=o("image-preview"),f=o("video-player"),c=o("el-button"),v=o("el-tooltip"),g=o("font-awesome-icon"),_=o("copy-to-clipboard"),M=o("el-alert");return l(),u("div",ls,[i("div",as,[n(d,{src:"https://cdn.acedata.cloud/qpbbbb.jpg",class:"avatar"})]),i("div",rs,[i("div",cs,[w(r(e.$t("kling.name.klingBot"))+" ",1),i("span",ds,r(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),i("div",us,[e.referenceImages.length>0?(l(),u("div",ms,[(l(!0),u(I,null,T(e.referenceImages,(R,j)=>(l(),S(p,{key:j,url:R.url,name:R.name,closable:!1},null,8,["url","name"]))),128))])):k("",!0),e.modelValue?.request?.prompt?(l(),u("p",ps,[w(r(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?k("",!0):(l(),u("span",gs," - ("+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(),u("span",fs," - ("+r(e.$t("kling.status.processing"))+") ",1)):k("",!0)])):k("",!0)]),e.modelValue?.response?.success===!0?(l(),u("div",hs,[e.modelValue?.response.video_url?(l(),u("div",_s,[n(f,{src:e.modelValue?.response.video_url},null,8,["src"])])):k("",!0),e.modelValue?.response.success?(l(),u("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(),S(c,{key:0,type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=R=>e.onDownload(R,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",vs,[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",ks,[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(),u("p",bs,[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(),u("div",ys,[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",ws,[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",Cs,[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(),u("p",Ss,[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(),u("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(),u("div",Is,[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(),u("p",Es,[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 Ms=y(is,[["render",Ls],["__scopeId","data-v-e8e87659"]]),Rs=b({name:"RecentPanel",components:{TaskPreview:Ms,NoTasks:Ne,BotPlaceholder:je,ScrollList:Ee},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},Ds={key:2,class:"w-full h-full flex items-center justify-center"};function As(e,t,s,a,m,$){const d=o("bot-placeholder"),p=o("task-preview"),f=o("scroll-list"),c=o("no-tasks");return l(),u(I,null,[e.tasks?.items===void 0?(l(),u("div",Us,[n(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(l(),S(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),u(I,null,T(e.tasks?.items,v=>(l(),S(p,{key:v.id,"model-value":v},null,8,["model-value"]))),128))]),_:1},8,["loading"])):k("",!0),e.tasks?.items?.length===0?(l(),u("div",Ds,[n(c)])):k("",!0)],64)}const Ps=y(Rs,[["render",As]]),re=Ce("kling"),Gs=b({name:"KlingIndex",components:{ConfigPanel:rn,MotionPanel:xn,TabSwitcher:ss,Layout:We,RecentPanel:Ps},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===ne.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===ne.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 Le({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:re};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(([,m])=>m!=null))}:{}});const a=this.credential?.token;if(!a){console.error("no token specified");return}C.info(this.$t("kling.message.startingTask")),te("kling",oe.generate(s,{token:a})).then(()=>{C.success(this.$t("kling.message.startTaskSuccess"))}).catch(m=>{m?.response?.data?.error?.code===ie?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:re},s=this.credential?.token;if(!s){console.error("no token specified");return}C.info(this.$t("kling.message.startingTask")),te("kling",oe.motion(t,{token:s})).then(()=>{C.success(this.$t("kling.message.startTaskSuccess"))}).catch(a=>{a?.response?.data?.error?.code===ie?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)})}}}),Ks={class:"flex flex-col h-full"},Os={class:"flex-1 min-h-0"};function js(e,t,s,a,m,$){const d=o("tab-switcher"),p=o("config-panel"),f=o("motion-panel"),c=o("recent-panel"),v=o("layout");return l(),S(v,null,{config:h(()=>[i("div",Ks,[n(d,{"model-value":e.taskType,"onUpdate:modelValue":e.onTabChange},null,8,["model-value","onUpdate:modelValue"]),i("div",Os,[e.taskType==="videos"?(l(),S(p,{key:0,onGenerate:e.onGenerate},null,8,["onGenerate"])):e.taskType==="motion"?(l(),S(f,{key:1,onGenerate:e.onGenerateMotion},null,8,["onGenerate"])):k("",!0)])])]),result:h(()=>[n(c,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Ni=y(Gs,[["render",js]]);export{Ni as default};
@@ -0,0 +1 @@
1
+ import{F as U}from"./index.es-f2R6ubO6.js";import{E as L}from"./index-D-4JF5KB.js";import{E as N}from"./index-CKceOzxT.js";import{d as k,H as c,E as n,z as C,C as t,y as m,D as s,q as a,F as l,I as h,x as v,J as f,M,Q as T,O as F,N as H}from"./vendor-vue-NSDaktjZ.js";import{G as w,bj as j,co as x,aB as J,S as z,cp as K}from"./index-DVUMZ05r.js";import{a as Q,b as W,c as X}from"./luma-DcySqBv2.js";import{I as S,S as Y,l as Z}from"./pagination-BIv0I4gk.js";import{E as R}from"./index-DMHXbvDD.js";import{p as B}from"./pasteUploadMixin-BurWbGNQ.js";import{I as D}from"./ImagePreview-CUVXtH2l.js";import{E as A}from"./index-r007Lgz_.js";import{E as b}from"./index-CsGFFE61.js";import{F as ee}from"./FilePreview-CnGQ7pAL.js";import{E as te}from"./index-CtbJ8jTa.js";import{V as O}from"./VideoPlayer-CXT39jg2.js";import{C as oe}from"./Consumption-BKf_KS7X.js";import{a as se}from"./price-3Bxyzfub.js";import{b as ne}from"./errorCode-Cqj9Td_Z.js";import{C as ae}from"./CopyToClipboard-CIRw6WL5.js";import{E as le}from"./index-CWdAzE8_.js";import{E as ie}from"./index-Cd_qWETX.js";import{E as re}from"./index-DrLf4K3A.js";import{B as ce}from"./BotPlaceholder-oG7ygyok.js";import{N as me}from"./NoTasks-9iEEhsIS.js";import"./use-form-item-DhMXJI5q.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Df5ITouH.js";import"./validator-C_MCdjOG.js";import"./index-B5Z3EZrb.js";import"./index-eWlKuNNN.js";import"./typescript-qAIJ13Qr.js";import"./_baseClone-Ccji6pFO.js";import"./_Uint8Array-yhuF-6h2.js";import"./_initCloneObject-D2UisHWT.js";import"./isEqual-B1Z_z-Zf.js";import"./index-CSLM8oj_.js";import"./vue-plyr-BO2nlN4c.js";import"./debounce-C18vO1_Z.js";import"./index-CGBK8gn9.js";const ue=k({name:"LayoutLuma",components:{ElDrawer:N,ElButton:L,FontAwesomeIcon:U},data(){return{drawer:!1}}}),de={class:"main flex flex-row flex-1"},pe={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},fe={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function _e(e,o,_,g,y,E){const r=s("font-awesome-icon"),d=s("el-button"),u=s("el-drawer");return a(),c("div",de,[n("div",pe,[C(e.$slots,"config",{},void 0,!0)]),n("div",fe,[C(e.$slots,"result",{},void 0,!0)]),t(d,{circle:"",class:"menu",onClick:o[0]||(o[0]=$=>e.drawer=!0)},{default:m(()=>[t(r,{icon:"fa-solid fa-magic"})]),_:1}),t(u,{modelValue:e.drawer,"onUpdate:modelValue":o[1]||(o[1]=$=>e.drawer=$),direction:"ltr","with-header":!1,size:"350px",class:"drawer"},{default:m(()=>[C(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const he=w(ue,[["render",_e],["__scopeId","data-v-fdc8f36b"]]),ge=k({name:"EnhancementSelector",components:{ElSwitch:R,InfoIcon:S},computed:{value:{get(){return this.$store.state.luma?.config?.enhancement},set(e){console.debug("set enhancement",e),this.$store.commit("luma/setConfig",{...this.$store.state.luma?.config,enhancement:e})}}},mounted(){this.value===void 0&&(this.value=Q)}}),$e={class:"relative"},ve={class:"flex justify-between"},be={class:"flex justify-start items-center"},ke={class:"text-sm font-bold"},we={class:"flex justify-end items-center"};function ye(e,o,_,g,y,E){const r=s("info-icon"),d=s("el-switch");return a(),c("div",$e,[n("div",ve,[n("div",be,[n("span",ke,l(e.$t("luma.name.enhancement")),1),t(r,{content:e.$t("luma.description.enhancement")},null,8,["content"])]),n("div",we,[t(d,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=u=>e.value=u),class:"value"},null,8,["modelValue"])])])])}const Ee=w(ge,[["render",ye]]),Ve=k({name:"CustomSelector",components:{ElSwitch:R,InfoIcon:S},computed:{value:{get(){return this.$store.state.luma?.config?.custom},set(e){console.debug("set custom",e),this.$store.commit("luma/setConfig",{...this.$store.state.luma?.config,custom:e})}}},mounted(){this.value===void 0&&(this.value=W)}}),Se={class:"relative"},Ue={class:"flex justify-between"},Le={class:"flex justify-start items-center"},Ie={class:"text-sm font-bold"},Te={class:"flex justify-end items-center"};function Ce(e,o,_,g,y,E){const r=s("info-icon"),d=s("el-switch");return a(),c("div",Se,[n("div",Ue,[n("div",Le,[n("span",Ie,l(e.$t("luma.name.custom")),1),t(r,{content:e.$t("luma.description.custom")},null,8,["content"])]),n("div",Te,[t(d,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=u=>e.value=u),class:"value"},null,8,["modelValue"])])])])}const je=w(Ve,[["render",Ce]]),Re=k({name:"LoopSelector",components:{ElSwitch:R,InfoIcon:S},computed:{value:{get(){return this.$store.state.luma?.config?.loop},set(e){console.debug("set loop",e),this.$store.commit("luma/setConfig",{...this.$store.state.luma?.config,loop:e})}}},mounted(){this.value===void 0&&(this.value=X)}}),Ae={class:"relative"},Ge={class:"flex justify-between"},Pe={class:"flex justify-start items-center"},Me={class:"text-sm font-bold"},Fe={class:"flex justify-end items-center"};function ze(e,o,_,g,y,E){const r=s("info-icon"),d=s("el-switch");return a(),c("div",Ae,[n("div",Ge,[n("div",Pe,[n("span",Me,l(e.$t("luma.name.loop")),1),t(r,{content:e.$t("luma.description.loop")},null,8,["content"])]),n("div",Fe,[t(d,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=u=>e.value=u),class:"value"},null,8,["modelValue"])])])])}const Be=w(Re,[["render",ze]]),De=k({name:"EndImage",components:{ElUpload:A,ElButton:L,ImagePreview:D,InfoIcon:S,FontAwesomeIcon:U},mixins:[B],data(){return{fileList:[],uploadUrl:j()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.luma?.config?.start_image_url},set(){}}},mounted(){this.value||(this.value=void 0),this.onSetEndImageUrl()},methods:{onExceed(){b.warning(this.$t("luma.message.uploadReferencesExceed"))},onError(){b.error(this.$t("luma.message.uploadReferencesError"))},onSetEndImageUrl(){const e=this.urls?.[0];this.$store.commit("luma/setConfig",{...this.$store.state.luma?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),Oe={class:"relative"},qe={class:"flex justify-between"},Ne={class:"flex justify-start items-center"},He={class:"text-sm font-bold"};function xe(e,o,_,g,y,E){const r=s("info-icon"),d=s("image-preview"),u=s("font-awesome-icon"),$=s("el-button"),p=s("el-upload");return a(),c("div",Oe,[n("div",qe,[n("div",Ne,[n("span",He,l(e.$t("luma.name.endImageUrl")),1),t(r,{content:e.$t("luma.description.endImageUrl")},null,8,["content"])])]),t(p,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":o[0]||(o[0]=i=>e.fileList=i),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:5,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:m(({file:i})=>[i.url&&i.percentage!==void 0?(a(),v(d,{key:0,url:i.url,name:i.name,percentage:i.percentage,onRemove:V=>e.fileList.splice(e.fileList.indexOf(i),1)},null,8,["url","name","percentage","onRemove"])):f("",!0)]),default:m(()=>[t($,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:m(()=>[t(u,{icon:"fa-solid fa-upload",class:"icon mr-1"}),h(" "+l(e.$t("luma.button.uploadEndImageUrl")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const Je=w(De,[["render",xe],["__scopeId","data-v-7a787b4d"]]),Ke=k({name:"StartImage",components:{ElUpload:A,ElButton:L,ImagePreview:D,InfoIcon:S,FontAwesomeIcon:U},mixins:[B],data(){return{fileList:[],uploadUrl:j()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.luma?.config?.start_image_url},set(){}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){b.warning(this.$t("luma.message.uploadReferencesExceed"))},onError(){b.error(this.$t("luma.message.uploadReferencesError"))},onSetStartImageUrl(){const e=this.urls?.[0];this.$store.commit("luma/setConfig",{...this.$store.state.luma?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),Qe={class:"relative"},We={class:"flex justify-between"},Xe={class:"flex justify-start items-center"},Ye={class:"text-sm font-bold"};function Ze(e,o,_,g,y,E){const r=s("info-icon"),d=s("image-preview"),u=s("font-awesome-icon"),$=s("el-button"),p=s("el-upload");return a(),c("div",Qe,[n("div",We,[n("div",Xe,[n("span",Ye,l(e.$t("luma.name.startImageUrl")),1),t(r,{content:e.$t("luma.description.startImageUrl")},null,8,["content"])])]),t(p,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":o[0]||(o[0]=i=>e.fileList=i),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:5,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:m(({file:i})=>[i.percentage!=null?(a(),v(d,{key:0,url:i.url||i.response.file_url,name:i.name,percentage:i.percentage,onRemove:V=>e.fileList.splice(e.fileList.indexOf(i),1)},null,8,["url","name","percentage","onRemove"])):f("",!0)]),default:m(()=>[t($,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:m(()=>[t(u,{icon:"fa-solid fa-upload",class:"icon mr-1"}),h(" "+l(e.$t("luma.button.uploadStartImageUrl")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const et=w(Ke,[["render",Ze],["__scopeId","data-v-8c5cfe84"]]),tt=k({name:"UploadVideo",components:{ElUpload:A,ElButton:L,InfoIcon:S,FilePreview:ee,FontAwesomeIcon:U},data(){return{fileList:[],uploadUrl:j()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.luma?.config?.video_url},set(){const e=this.urls?.[0];this.$store.commit("luma/setConfig",{...this.$store.state.luma?.config,video_url:e})}}},mounted(){this.value||(this.value=void 0)},methods:{onExceed(){b.warning(this.$t("luma.message.uploadVideoExceed"))},onError(){b.error(this.$t("luma.message.uploadVideoError"))},beforeUpload(e){const o=e.type==="video/mp4",_=e.size/1024/1024<10;return o?_?!0:(b.error(this.$t("luma.message.uploadVideoSizeExceed")),!1):(b.error(this.$t("luma.message.uploadVideoTypeFailed")),!1)},onSetVideoUrl(){const e=this.urls?.[0];this.$store.commit("luma/setConfig",{...this.$store.state.luma?.config,video_url:e,action:"extend"})},async onSuccess(){this.onSetVideoUrl()}}}),ot={class:"relative"},st={class:"flex justify-between"},nt={class:"flex justify-start items-center"},at={class:"text-sm font-bold"};function lt(e,o,_,g,y,E){const r=s("info-icon"),d=s("file-preview"),u=s("font-awesome-icon"),$=s("el-button"),p=s("el-upload");return a(),c("div",ot,[n("div",st,[n("div",nt,[n("span",at,l(e.$t("luma.name.videoUrl")),1),t(r,{content:e.$t("luma.description.videoUrl")},null,8,["content"])])]),t(p,{"file-list":e.fileList,"onUpdate:fileList":o[0]||(o[0]=i=>e.fileList=i),accept:".mp4",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:m(({file:i})=>[i.percentage!=null?(a(),v(d,{key:0,url:i.url||i.response?.file_url,name:i.name,percentage:i.percentage,onRemove:V=>e.fileList.splice(e.fileList.indexOf(i),1)},null,8,["url","name","percentage","onRemove"])):f("",!0)]),default:m(()=>[t($,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:m(()=>[t(u,{icon:"fa-solid fa-upload",class:"icon mr-1"}),h(" "+l(e.$t("luma.button.uploadVideoUrl")),1)]),_:1})]),_:1},8,["file-list","action","before-upload","on-exceed","on-error","on-success","headers"])])}const it=w(tt,[["render",lt],["__scopeId","data-v-74e51526"]]),rt="",ct=k({name:"PromptInput",components:{ElInput:te,InfoIcon:S},computed:{prompt:{get(){return this.$store.state.luma?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("luma/setConfig",{...this.$store.state.luma?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=rt)}}),mt={class:"field"},ut={class:"box"},dt={class:"title font-bold"};function pt(e,o,_,g,y,E){const r=s("info-icon"),d=s("el-input");return a(),c("div",mt,[n("div",ut,[n("h2",dt,l(e.$t("luma.name.prompt")),1),t(r,{content:e.$t("luma.description.prompt"),class:"info"},null,8,["content"])]),t(d,{modelValue:e.prompt,"onUpdate:modelValue":o[0]||(o[0]=u=>e.prompt=u),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("luma.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const ft=w(ct,[["render",pt],["__scopeId","data-v-281baab8"]]),_t=k({name:"ExtendFromInput",components:{VideoPlayer:O},props:{modelValue:{type:Object,required:!1,default:void 0}},data(){return{options:{quality:{default:"1080p"}}}},computed:{config(){return this.$store.state.luma?.config}}}),ht={class:"relative"},gt={class:"flex mb-2"},$t={class:"text-sm font-bold"};function vt(e,o,_,g,y,E){const r=s("video-player");return a(),c("div",ht,[n("div",gt,[n("span",$t,l(e.$t("luma.name.extend")),1)]),n("div",null,[e.config?.video_url?(a(),v(r,{key:0,src:e.config?.video_url},null,8,["src"])):f("",!0)])])}const bt=w(_t,[["render",vt]]),kt=k({name:"ConfigPanel",components:{LoopSelector:Be,StartImageInput:et,EndImageInput:Je,EnhancementSelector:Ee,ElButton:L,FontAwesomeIcon:U,PromptInput:ft,ExtendFromInput:bt,CustomSelector:je,UploadVideo:it,Consumption:oe},emits:["generate"],computed:{config(){return this.$store.state.luma?.config},consumption(){return se(this.config,this.service?.cost)},service(){return this.$store.state.luma?.service}},methods:{onGenerate(){this.$emit("generate")}}}),wt={class:"flex flex-col h-full"},yt={class:"flex-1 overflow-y-auto p-5"},Et={class:"flex flex-col items-center justify-center px-5 pb-5"};function Vt(e,o,_,g,y,E){const r=s("extend-from-input"),d=s("prompt-input"),u=s("custom-selector"),$=s("upload-video"),p=s("start-image-input"),i=s("end-image-input"),V=s("enhancement-selector"),I=s("loop-selector"),q=s("consumption"),G=s("font-awesome-icon"),P=s("el-button");return a(),c("div",wt,[n("div",yt,[e.config?.video_id||e.config?.video_url?(a(),v(r,{key:0,class:"mb-4"})):f("",!0),t(d,{class:"mb-4"}),e.config?.video_id?f("",!0):(a(),v(u,{key:1,class:"mb-4"})),e.config?.custom?(a(),v($,{key:2,class:"mb-4"})):f("",!0),!(e.config?.video_id||e.config?.video_url)&&!e.config?.custom?(a(),v(p,{key:3,class:"mb-4"})):f("",!0),t(i,{class:"mb-4"}),t(V,{class:"mb-4"}),t(I,{class:"mb-4"})]),n("div",Et,[t(q,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(a(),v(P,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:m(()=>[t(G,{icon:"fa-solid fa-magic",class:"mr-2"}),h(" "+l(e.$t("luma.button.extend")),1)]),_:1},8,["onClick"])):(a(),v(P,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:m(()=>[t(G,{icon:"fa-solid fa-magic",class:"mr-2"}),h(" "+l(e.$t("luma.button.generate")),1)]),_:1},8,["onClick"]))])])}const St=w(kt,[["render",Vt]]),Ut=k({name:"TaskPreview",components:{ElImage:re,CopyToClipboard:ae,FontAwesomeIcon:U,ElAlert:ie,VideoPlayer:O,ElTooltip:le,ElButton:L},props:{modelValue:{type:Object,required:!0}},emits:["extend"],data(){return{}},computed:{application(){return this.$store.state.luma?.application},config(){return this.$store.state.luma?.config}},methods:{onExtend(e,o){console.debug("set config",o),this.$store.commit("luma/setConfig",{...this.$store.state.luma?.config,video_id:o.video_id,prompt:o.prompt,action:"extend",thumbnail_url:o.thumbnail_url,video_url:o.video_url}),this.$emit("extend")},onDownload(e){window.open(e,"_blank")}}}),Lt={class:"preview"},It={class:"left"},Tt={class:"main"},Ct={class:"bot"},jt={class:"datetime"},Rt={class:"info"},At={key:0,class:"prompt mt-2"},Gt={key:0},Pt={key:1},Mt={key:0,class:T({content:!0,failed:!0})},Ft={key:0,class:"mb-4"},zt={key:1,class:T({operations:!0,"mt-2":!0,"mb-4":!0})},Bt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Dt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Ot={key:1,class:T({content:!0})},qt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Nt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ht={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},xt={class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Jt={key:2,class:T({content:!0})},Kt={class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Qt(e,o,_,g,y,E){const r=s("el-image"),d=s("video-player"),u=s("el-button"),$=s("el-tooltip"),p=s("font-awesome-icon"),i=s("copy-to-clipboard"),V=s("el-alert");return a(),c("div",Lt,[n("div",It,[t(r,{src:"https://cdn.acedata.cloud/ahjfwi.png",class:"avatar"})]),n("div",Tt,[n("div",Ct,[h(l(e.$t("luma.name.lumaBot"))+" ",1),n("span",jt,l(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),n("div",Rt,[e.modelValue?.request?.prompt?(a(),c("p",At,[h(l(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?f("",!0):(a(),c("span",Gt," - ("+l(e.$t("luma.status.pending"))+") ",1)),e.modelValue?.response?.state==="processing"||e.modelValue?.response?.state==="pending"?(a(),c("span",Pt," - ("+l(e.$t("luma.status.processing"))+") ",1)):f("",!0)])):f("",!0)]),e.modelValue?.response?.success===!0?(a(),c("div",Mt,[e.modelValue.response.video_url?(a(),c("div",Ft,[t(d,{src:e.modelValue.response.video_url},null,8,["src"])])):f("",!0),e.modelValue?.response&&!e.config?.custom?(a(),c("div",zt,[t($,{class:"box-item",effect:"dark",content:e.$t("luma.message.extendVideo"),placement:"top-start"},{default:m(()=>[t(u,{type:"info",size:"small",class:"btn-action",onClick:o[0]||(o[0]=M(I=>e.onExtend(I,e.modelValue?.response),["stop"]))},{default:m(()=>[h(l(e.$t("luma.button.extend")),1)]),_:1})]),_:1},8,["content"]),t($,{class:"box-item",effect:"dark",content:e.$t("luma.message.downloadVideo"),placement:"top-start"},{default:m(()=>[t(u,{type:"info",size:"small",class:"btn-action",onClick:o[1]||(o[1]=M(I=>e.onDownload(e.modelValue?.response?.video_url),["stop"]))},{default:m(()=>[h(l(e.$t("luma.button.download")),1)]),_:1})]),_:1},8,["content"])])):f("",!0),t(V,{closable:!1,class:"mt-2 success"},{default:m(()=>[n("p",Bt,[t(p,{icon:"fa-solid fa-magic",class:"mr-1"}),h(" "+l(e.$t("luma.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),t(i,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(a(),c("p",Dt,[t(p,{icon:"fa-solid fa-clock",class:"mr-1"}),h(" "+l(e.$t("luma.name.elapsed"))+": "+l(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):f("",!0)]),_:1})])):f("",!0),e.modelValue?.response?.state==="failed"||e.modelValue?.response?.success===!1?(a(),c("div",Ot,[t(V,{closable:!1,class:"failure"},{template:m(()=>[t(p,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),h(" "+l(e.$t("luma.name.failure")),1)]),default:m(()=>[n("p",qt,[t(p,{icon:"fa-solid fa-magic",class:"mr-1"}),h(" "+l(e.$t("luma.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),t(i,{content:e.modelValue?.id},null,8,["content"])]),n("p",Nt,[t(p,{icon:"fa-solid fa-circle-info",class:"mr-1"}),h(" "+l(e.$t("luma.name.failureReason"))+": "+l(e.modelValue?.response?.error?.message)+" ",1),t(i,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(a(),c("p",Ht,[t(p,{icon:"fa-solid fa-clock",class:"mr-1"}),h(" "+l(e.$t("luma.name.elapsed"))+": "+l(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):f("",!0),n("p",xt,[t(p,{icon:"fa-solid fa-hashtag",class:"mr-1"}),h(" "+l(e.$t("luma.name.traceId"))+": "+l(e.modelValue?.trace_id)+" ",1),t(i,{content:e.modelValue?.response?.trace_id},null,8,["content"])])]),_:1})])):f("",!0),!e.modelValue?.response||e.modelValue?.response?.state==="processing"||e.modelValue?.response?.state==="pending"?(a(),c("div",Jt,[t(V,{closable:!1,class:"info"},{template:m(()=>[t(p,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),h(" "+l(e.$t("luma.name.failure")),1)]),default:m(()=>[n("p",Kt,[t(p,{icon:"fa-solid fa-magic",class:"mr-1"}),h(" "+l(e.$t("luma.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),t(i,{content:e.modelValue?.id},null,8,["content"])])]),_:1})])):f("",!0)])])}const Wt=w(Ut,[["render",Qt],["__scopeId","data-v-bcbb3d1c"]]),Xt=k({name:"RecentPanel",components:{BotPlaceholder:ce,TaskPreview:Wt,NoTasks:me,ScrollList:Y},props:{loading:{type:Boolean,default:!1}},emits:["reach-top","extend"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.luma?.tasks,items:this.$store.state.luma?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Yt={key:0},Zt={key:2,class:"w-full h-full flex items-center justify-center"};function eo(e,o,_,g,y,E){const r=s("bot-placeholder"),d=s("task-preview"),u=s("scroll-list"),$=s("no-tasks");return a(),c(F,null,[e.tasks?.items===void 0?(a(),c("div",Yt,[t(r)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(a(),v(u,{key:1,ref:"scrollList",class:"tasks w-full h-full overflow-y-auto",loading:e.loading,onReachTop:o[1]||(o[1]=p=>e.$emit("reach-top"))},{default:m(()=>[(a(!0),c(F,null,H(e.tasks?.items,p=>(a(),v(d,{key:p.id,"model-value":p,onExtend:o[0]||(o[0]=i=>e.$emit("extend"))},null,8,["model-value"]))),128))]),_:1},8,["loading"])):f("",!0),e.tasks?.items?.length===0?(a(),c("div",Zt,[t($)])):f("",!0)],64)}const to=w(Xt,[["render",eo]]),oo=K("luma"),so=k({name:"LumaIndex",components:{ConfigPanel:St,Layout:he,RecentPanel:to},inject:["initialized"],emits:["extend"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.luma?.status?.getApplications===z.Request},tasksLoading(){return this.$store.state.luma?.status?.getTasks===z.Request||this.fetchingTasks},credential(){return this.$store.state.luma.credential},config(){return this.$store.state.luma.config},application(){return this.$store.state.luma.application},tasks(){return this.$store.state.luma.tasks}},watch:{tasks:{handler(e,o){e?.items?.length>o?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await Z({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("luma/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("luma/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},async onScrollDown(){console.debug("scrolling down"),await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:o=5,createdAtMin:_,createdAtMax:g}=e||{};console.debug("limit",o,"createdAtMin",_,"createdAtMax",g),this.fetchingTasks=!0;try{await this.$store.dispatch("luma/getTasks",{limit:o,createdAtMin:_,createdAtMax:g})}finally{this.fetchingTasks=!1}},async onGenerate(){const e={...this.config,callback_url:oo};if(!this.hasText(e.prompt)){b.error(this.$t("luma.message.promptRequired"));return}e.prompt=e.prompt?.trim();const o=this.credential?.token;if(!o){console.error("no token specified");return}b.info(this.$t("luma.message.startingTask")),x("luma",J.generate(e,{token:o})).then(()=>{b.success(this.$t("luma.message.startTaskSuccess"))}).catch(_=>{_?.response?.data?.error?.code===ne?b.error(this.$t("luma.message.usedUp")):b.error(this.$t("luma.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},hasText(e){return typeof e=="string"&&e.trim().length>0}}});function no(e,o,_,g,y,E){const r=s("config-panel"),d=s("recent-panel"),u=s("layout");return a(),v(u,null,{config:m(()=>[t(r,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:m(()=>[t(d,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop,onExtend:o[0]||(o[0]=$=>e.$emit("extend"))},null,8,["loading","onReachTop"])]),_:1})}const Jo=w(so,[["render",no]]);export{Jo as default};