@acedatacloud/nexior 3.327.11 → 3.327.13

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 (208) hide show
  1. package/dist/assets/{ApiCodeButton-BOIv_zXn.js → ApiCodeButton-B6ugqxDK.js} +1 -1
  2. package/dist/assets/{Artifacts-CfGzNrhx.js → Artifacts-ChxHYL6P.js} +1 -1
  3. package/dist/assets/{AskUserQuestionCard-BicQQUds.js → AskUserQuestionCard-MLoMFQkY.js} +2 -2
  4. package/dist/assets/{Auth-BYpB1MBu.js → Auth-wpaFPrgr.js} +1 -1
  5. package/dist/assets/{Bare-rte5pyp9.js → Bare-DwmWAX-H.js} +1 -1
  6. package/dist/assets/{BotPlaceholder-CWWfEeRX.js → BotPlaceholder-DwMB-nyu.js} +1 -1
  7. package/dist/assets/{BottomFooter-D9TV4vct.js → BottomFooter-jejtxfth.js} +1 -1
  8. package/dist/assets/{Callback-DVMhJixN.js → Callback-D75_4ess.js} +1 -1
  9. package/dist/assets/{CodeSnippet-BZSIsugZ.js → CodeSnippet-Dh3rolbK.js} +1 -1
  10. package/dist/assets/{Console-DHSp3QyC.js → Console-u92zISr-.js} +1 -1
  11. package/dist/assets/{Consumption-C3ZK4cM5.js → Consumption-_nwRhH83.js} +1 -1
  12. package/dist/assets/{Conversation-2zTl95Cq.js → Conversation-DA7fmunS.js} +1 -1
  13. package/dist/assets/{Conversation-BwlRCH7K.js → Conversation-DKkhgqPd.js} +1 -1
  14. package/dist/assets/{CopyToClipboard-rXAbbH4m.js → CopyToClipboard-BQ2Ei1sV.js} +1 -1
  15. package/dist/assets/{Detail-CuujiKxv.js → Detail-CyZi7ogE.js} +2 -2
  16. package/dist/assets/Extra-D5li270u.js +1 -0
  17. package/dist/assets/{FilePreview-DGwVB2pg.js → FilePreview-BSviFDi1.js} +1 -1
  18. package/dist/assets/{Hailuo-Uhsw8iNC.js → Hailuo-Dbc-B9Te.js} +1 -1
  19. package/dist/assets/{History-DbSujzeq.js → History-dVoPykWo.js} +1 -1
  20. package/dist/assets/{ImagePreview-DKaradFQ.js → ImagePreview-DKkz6u_p.js} +1 -1
  21. package/dist/assets/{ImageWrapper-CzCa4TRI.js → ImageWrapper-BRTUYofN.js} +1 -1
  22. package/dist/assets/Index--zSMebgV.js +1 -0
  23. package/dist/assets/Index-4cqh_kOu.js +1 -0
  24. package/dist/assets/{Index-DqNVUNJ_.js → Index-B7FqCu9b.js} +1 -1
  25. package/dist/assets/{Index-bDXQ7LRn.js → Index-B8hTEerD.js} +2 -2
  26. package/dist/assets/{Index-BFr_QIAl.js → Index-BB098AsY.js} +1 -1
  27. package/dist/assets/{Index-BowgHWZ5.js → Index-BF1k8B8X.js} +1 -1
  28. package/dist/assets/{Index-3nUk5_--.js → Index-BL75lfg_.js} +1 -1
  29. package/dist/assets/Index-BpGgY_Ek.js +1 -0
  30. package/dist/assets/Index-Bsjmz52S.js +1 -0
  31. package/dist/assets/Index-BuNpeQrj.js +1 -0
  32. package/dist/assets/Index-CE770V6G.js +1 -0
  33. package/dist/assets/{Index-DLH3Dnjz.js → Index-CGpLsRmt.js} +1 -1
  34. package/dist/assets/{Index-C0IrYwrZ.js → Index-CY9x2seG.js} +1 -1
  35. package/dist/assets/{Index-CdVscrYg.js → Index-C_qRrGdK.js} +1 -1
  36. package/dist/assets/Index-Crl1Sw0g.js +1 -0
  37. package/dist/assets/{Index-Ck6AZbjI.js → Index-Csd8_Agb.js} +1 -1
  38. package/dist/assets/{Index-ChOK44L7.js → Index-CuNZ5VPo.js} +1 -1
  39. package/dist/assets/Index-D5NWlMH3.js +1 -0
  40. package/dist/assets/Index-DQelOaCE.js +1 -0
  41. package/dist/assets/{Index-DJPhiMrL.js → Index-Dg4BOluo.js} +1 -1
  42. package/dist/assets/{Index-BEE-BkJI.js → Index-DiZwqyMw.js} +1 -1
  43. package/dist/assets/{Index-xQ9btOkX.js → Index-DlbG_DmZ.js} +1 -1
  44. package/dist/assets/{Index-B1Os0sUo.js → Index-JzdZ0TPa.js} +1 -1
  45. package/dist/assets/{Index-BlwA1LWz.js → Index-P3j5DwyI.js} +1 -1
  46. package/dist/assets/Index-SjzgrV03.js +1 -0
  47. package/dist/assets/Index-_lLCY_Ea.js +1 -0
  48. package/dist/assets/{Index-CWnNdnry.js → Index-a1CjJGW4.js} +1 -1
  49. package/dist/assets/{Index-BfvhZJlt.js → Index-dlLiKtTD.js} +1 -1
  50. package/dist/assets/{Index-BmQNpy-v.js → Index-fJfUyzuW.js} +1 -1
  51. package/dist/assets/{Invitees-DFGfNna_.js → Invitees-Vc7QeWfZ.js} +1 -1
  52. package/dist/assets/{List-C1TashD1.js → List-BHaLjNnq.js} +1 -1
  53. package/dist/assets/List-C2HCkQAI.js +1 -0
  54. package/dist/assets/List-CcWcnbv9.js +1 -0
  55. package/dist/assets/{LocalTools-BJYdpxMm.js → LocalTools-BRuz7qWE.js} +3 -3
  56. package/dist/assets/{LocalTools-DL1aNHuA.js → LocalTools-C-v6Bz-r.js} +1 -1
  57. package/dist/assets/{Main-BwtcrBpz.js → Main-DNwm8rcq.js} +1 -1
  58. package/dist/assets/{Message-DG436-a_.js → Message-s5Ec1YQm.js} +2 -2
  59. package/dist/assets/Model-7P_UY2Dy.js +1 -0
  60. package/dist/assets/{Navigator-9m6DICsQ.css → Navigator-BcIKh2P4.css} +1 -1
  61. package/dist/assets/Navigator-DHT_Wtqn.js +8 -0
  62. package/dist/assets/{NoTasks-DA2uJz0D.js → NoTasks-Q9DDa660.js} +1 -1
  63. package/dist/assets/{NotFound-CJ2vmzSG.js → NotFound-Ob-yzf2H.js} +1 -1
  64. package/dist/assets/{Pay-DfXzA-aM.js → Pay-NytSoqqM.js} +1 -1
  65. package/dist/assets/{Player-CEb5e_e0.js → Player-BrnX8xA-.js} +1 -1
  66. package/dist/assets/{PromptTextarea-DD5-6B1R.js → PromptTextarea-5oMvhem7.js} +1 -1
  67. package/dist/assets/{RealtimeCall-CK-xryR-.js → RealtimeCall-CEGYhfJe.js} +1 -1
  68. package/dist/assets/{ScheduledTasks-CrmGq9_Y.js → ScheduledTasks-CA_-ym45.js} +2 -2
  69. package/dist/assets/{Status-DBBAweRv.js → Status-BqztxI8Z.js} +1 -1
  70. package/dist/assets/{Subscribe-CwGuW1xv.js → Subscribe-D55UOtOX.js} +1 -1
  71. package/dist/assets/{TabSwitcher-D6ACYGai.js → TabSwitcher-s8FxHO7f.js} +1 -1
  72. package/dist/assets/{Tts-Ds5qfPbA.js → Tts-5Zt3ZHoX.js} +1 -1
  73. package/dist/assets/{VideoPlayer-BekTLAwb.js → VideoPlayer-ikSJRkQv.js} +1 -1
  74. package/dist/assets/{VideoPreview-j7KQrVdN.js → VideoPreview-CZrENuKu.js} +1 -1
  75. package/dist/assets/{alert-D6tngQg7.js → alert-BfCyDcWO.js} +1 -1
  76. package/dist/assets/avatar-CPDZqBps.js +1 -0
  77. package/dist/assets/{basic-MzSnpC3U.js → basic-Cm345FYj.js} +1 -1
  78. package/dist/assets/{chat-DFrsa6xg.js → chat-DpFWauZx.js} +1 -1
  79. package/dist/assets/{codingBridge-4fhVPF52.js → codingBridge-CbaTU1_7.js} +2 -2
  80. package/dist/assets/{codingBridgeNotify-CoDhT0BC.js → codingBridgeNotify-DIzHGoeo.js} +2 -2
  81. package/dist/assets/{collapse-BjXJZHhQ.js → collapse-Ccqa0VVu.js} +1 -1
  82. package/dist/assets/{constants-B_ksgMZ4.js → constants-BWAHKQ-e.js} +1 -1
  83. package/dist/assets/{createTaskActions-4AdkKzHs.js → createTaskActions-utz_xWYm.js} +1 -1
  84. package/dist/assets/{date-picker-I2SHLHk3.js → date-picker-B1Aj1P6O.js} +1 -1
  85. package/dist/assets/{digitalhuman-BMbQmId5.js → digitalhuman-6sBkCXbF.js} +1 -1
  86. package/dist/assets/{drawer-Cp4thqzF.js → drawer-GII5N0kH.js} +1 -1
  87. package/dist/assets/{dropdown-B8tFAqea.js → dropdown-BAiD4dmf.js} +1 -1
  88. package/dist/assets/{dropdown-nIyxt3x2.js → dropdown-NCWhNhmE.js} +1 -1
  89. package/dist/assets/esm-B2GYLCJK.js +1 -0
  90. package/dist/assets/{esm-C25Y89-H.js → esm-B3u8lUhu.js} +3 -3
  91. package/dist/assets/{esm-EXng9G0D.js → esm-B4Mv9hnp.js} +2 -2
  92. package/dist/assets/{esm-Blk4FYWO.js → esm-BFDzwz7H.js} +1 -1
  93. package/dist/assets/{esm-mDf-8v0G.js → esm-BlbK3YWA.js} +2 -2
  94. package/dist/assets/{esm-DuTvDBWB.js → esm-CQTOhOd1.js} +1 -1
  95. package/dist/assets/{esm-BdZ60Qwk.js → esm-enNlsZ6P.js} +1 -1
  96. package/dist/assets/{fish-6sWKvP1_.js → fish-FcW2RIKk.js} +1 -1
  97. package/dist/assets/{flux-D0nDaMMw.js → flux-C_uoEh9t.js} +1 -1
  98. package/dist/assets/{grokvideo-DageWykl.js → grokvideo-5JqcID1e.js} +1 -1
  99. package/dist/assets/{pixverse-DxnE9C4W.js → hailuo-BnOVDYIb.js} +1 -1
  100. package/dist/assets/{headshots-DT9DNRQV.js → headshots-rog-taw5.js} +1 -1
  101. package/dist/assets/{i18n-DIXqZj1s.js → i18n-BDMAD7Em.js} +1 -1
  102. package/dist/assets/image-DdozYzas.js +1 -0
  103. package/dist/assets/{index-Ds_KzrLo.js → index-m0B4VH-l.js} +16 -16
  104. package/dist/assets/{index.browser.esm-CSuOTLdQ.js → index.browser.esm-CkOw7Di7.js} +1 -1
  105. package/dist/assets/{index.es-CU4g6R5J.js → index.es-DVFB1iVe.js} +1 -1
  106. package/dist/assets/{input-number-42kKySdV.js → input-number-BZftuN2C.js} +1 -1
  107. package/dist/assets/{kling-Bdon9puV.js → kling-Bfb08rFf.js} +1 -1
  108. package/dist/assets/{luma-C-_sKsnS.js → luma-12kArsfq.js} +1 -1
  109. package/dist/assets/{maestro-BRd-eAR8.js → maestro-BE7pVrHS.js} +1 -1
  110. package/dist/assets/{maestro-Di34uD2R.js → maestro-Bm9wS8_g.js} +1 -1
  111. package/dist/assets/{midjourney--CPZ4jOs.js → midjourney-CYvKJLtX.js} +1 -1
  112. package/dist/assets/{mobileLocalExec-DZLSzQv_.js → mobileLocalExec-Cyxow5dP.js} +2 -2
  113. package/dist/assets/{nanobanana-DLIDv2C8.js → nanobanana-BUcG4Gxe.js} +1 -1
  114. package/dist/assets/{openaiimage-CxBqv6eJ.js → openaiimage-CZjkzjCL.js} +1 -1
  115. package/dist/assets/{pagination-dMRyONbD.js → pagination-DiZdmGxW.js} +1 -1
  116. package/dist/assets/{pagination-ZQWSP4gt.js → pagination-OQ6Csuu1.js} +2 -2
  117. package/dist/assets/{pika-BZMTdap2.js → pika-CzipPX7M.js} +1 -1
  118. package/dist/assets/{hailuo-Bx5hOq1K.js → pixverse-CSS6SWUh.js} +1 -1
  119. package/dist/assets/{popover-DAClEa8g.js → popover-DPOFggKQ.js} +1 -1
  120. package/dist/assets/{producer-B_D88HYo.js → producer-Ck_R-Q2x.js} +1 -1
  121. package/dist/assets/{qrart-DM_e2zz-.js → qrart-CEksb0cO.js} +1 -1
  122. package/dist/assets/realtime-Dy4DX0gx.js +1 -0
  123. package/dist/assets/{row-DPdAp5_1.js → row-BMPJJqEZ.js} +1 -1
  124. package/dist/assets/{seedance-DNTP6E8d.js → seedance-YJeq02mp.js} +1 -1
  125. package/dist/assets/{seedream-DCCkVWx1.js → seedream-CC08j83p.js} +1 -1
  126. package/dist/assets/{select-B_-3KyEB.js → select-Dimm3cl1.js} +1 -1
  127. package/dist/assets/serp-CTs8RmbM.js +1 -0
  128. package/dist/assets/site-B4Qxe0b-.js +1 -0
  129. package/dist/assets/site-BTVkwGVK.js +1 -0
  130. package/dist/assets/site-BUr9RRoX.js +1 -0
  131. package/dist/assets/site-BsNurGSN.js +1 -0
  132. package/dist/assets/site-C9dazjPG.js +1 -0
  133. package/dist/assets/site-CBKXn3KO.js +1 -0
  134. package/dist/assets/site-CN8w8ijV.js +1 -0
  135. package/dist/assets/site-C_RYXYN-.js +1 -0
  136. package/dist/assets/site-CbPRCfX9.js +1 -0
  137. package/dist/assets/site-ChqMx-6j.js +1 -0
  138. package/dist/assets/site-D2-W77ov.js +1 -0
  139. package/dist/assets/site-DQQb3bI1.js +1 -0
  140. package/dist/assets/site-DZ8F25F7.js +1 -0
  141. package/dist/assets/site-D_9RL6F3.js +1 -0
  142. package/dist/assets/site-DjRjbQ9V.js +1 -0
  143. package/dist/assets/site-I8VgtXJr.js +1 -0
  144. package/dist/assets/site-JgjLH-R2.js +1 -0
  145. package/dist/assets/site-ceDyUW4a.js +1 -0
  146. package/dist/assets/{slider-BytBKhYZ.js → slider-DmQjyRiW.js} +1 -1
  147. package/dist/assets/{solana-wallets-4PsG-iTN.js → solana-wallets-Bqu9jRXB.js} +2 -2
  148. package/dist/assets/{solana-wallets-vue-BwQpQBbB.js → solana-wallets-vue-DjANhE7q.js} +1 -1
  149. package/dist/assets/sora-2-T3sx-Y.js +1 -0
  150. package/dist/assets/{suno-k7mZZu1Q.js → suno-ZdLhI-cJ.js} +1 -1
  151. package/dist/assets/{switch-Q2akgFXQ.js → switch-D94Z7hOB.js} +1 -1
  152. package/dist/assets/{table-CcmCqDqh.js → table-CKTQXDS9.js} +1 -1
  153. package/dist/assets/{tabs-Bgj_gvrO.js → tabs-CoQ1qOZt.js} +1 -1
  154. package/dist/assets/{time-picker-YACe8MM5.js → time-picker-B8u2NouX.js} +1 -1
  155. package/dist/assets/{tooltip-ksHy3iJa.js → tooltip-CRloPYoS.js} +1 -1
  156. package/dist/assets/{upload-Ds4fmX2d.js → upload-BQXdf3I1.js} +1 -1
  157. package/dist/assets/{veo-Hsbz92m0.js → veo-AOvqIips.js} +1 -1
  158. package/dist/assets/wan-C0EjXerf.js +1 -0
  159. package/dist/assets/{web-CLARICbN.js → web-Bey0K1H_.js} +1 -1
  160. package/dist/assets/{web-mGn1Dwtw.js → web-Bg7DToey.js} +1 -1
  161. package/dist/assets/{web-BG3a-lis.js → web-CP12_Eue.js} +1 -1
  162. package/dist/assets/{web-C7mY3Dri.js → web-CxtaLiec.js} +1 -1
  163. package/dist/assets/{web-DXUCNExu.js → web-GSeS6qM4.js} +1 -1
  164. package/dist/assets/webextrator-BD3AJOUe.js +1 -0
  165. package/dist/index.html +3 -3
  166. package/package.json +1 -1
  167. package/dist/assets/Extra-DJVNgNel.js +0 -1
  168. package/dist/assets/Index-33ARKUsx.js +0 -1
  169. package/dist/assets/Index-67JmDvMe.js +0 -1
  170. package/dist/assets/Index-By7sRfF_.js +0 -1
  171. package/dist/assets/Index-CDkUyMB2.js +0 -1
  172. package/dist/assets/Index-CHrYgzzE.js +0 -1
  173. package/dist/assets/Index-CRXF2_xg.js +0 -1
  174. package/dist/assets/Index-DK4k7oa4.js +0 -1
  175. package/dist/assets/Index-DTzRnRd6.js +0 -1
  176. package/dist/assets/Index-DdQW_ztG.js +0 -1
  177. package/dist/assets/Index-Dr8BlRrG.js +0 -1
  178. package/dist/assets/Index-DsmCjrfk.js +0 -1
  179. package/dist/assets/List-Cfv_bvg5.js +0 -1
  180. package/dist/assets/List-lnMISj_a.js +0 -1
  181. package/dist/assets/Model-BevZlhix.js +0 -1
  182. package/dist/assets/Navigator-bmuYFEEh.js +0 -5
  183. package/dist/assets/avatar-BQo-Cf5n.js +0 -1
  184. package/dist/assets/esm-DFlQdGh_.js +0 -1
  185. package/dist/assets/image-6n1LQxCR.js +0 -1
  186. package/dist/assets/realtime-CkW4dxX8.js +0 -1
  187. package/dist/assets/serp-DCDFRX8C.js +0 -1
  188. package/dist/assets/site-1g12z5Qp.js +0 -1
  189. package/dist/assets/site-B5JOSS5l.js +0 -1
  190. package/dist/assets/site-BMgsexTz.js +0 -1
  191. package/dist/assets/site-BrZYFX_C.js +0 -1
  192. package/dist/assets/site-Bw9zxSQr.js +0 -1
  193. package/dist/assets/site-C-KIwJqk.js +0 -1
  194. package/dist/assets/site-CDJQidJ7.js +0 -1
  195. package/dist/assets/site-CFkvTzOx.js +0 -1
  196. package/dist/assets/site-CkT6cSKU.js +0 -1
  197. package/dist/assets/site-Cxybs_Ch.js +0 -1
  198. package/dist/assets/site-DBXOOFCA.js +0 -1
  199. package/dist/assets/site-DCIvaILC.js +0 -1
  200. package/dist/assets/site-DLPwbsnq.js +0 -1
  201. package/dist/assets/site-DNmoYIIP.js +0 -1
  202. package/dist/assets/site-DmRfcNqH.js +0 -1
  203. package/dist/assets/site-c6PTeGO4.js +0 -1
  204. package/dist/assets/site-rNkc5Tpj.js +0 -1
  205. package/dist/assets/site-vkGhb9Zi.js +0 -1
  206. package/dist/assets/sora-LLWHXJ7v.js +0 -1
  207. package/dist/assets/wan-b-IUzD8n.js +0 -1
  208. package/dist/assets/webextrator-BBVkNAQk.js +0 -1
@@ -1 +1 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{E as y}from"./use-deprecated-B-uvyrTL.js";import{r as b,t as x}from"./select-B_-3KyEB.js";import{n as S,t as C}from"./tabs-Bgj_gvrO.js";import{t as w}from"./upload-Ds4fmX2d.js";import{t as T}from"./tooltip-ksHy3iJa.js";import{t as E}from"./image-6n1LQxCR.js";import{t as ee}from"./alert-D6tngQg7.js";import{n as D,r as O}from"./radio-Bj0tEwH8.js";import{t as k}from"./drawer-Cp4thqzF.js";import{t as A}from"./input-number-42kKySdV.js";import{t as te}from"./slider-BytBKhYZ.js";import{t as ne}from"./switch-Q2akgFXQ.js";import{$r as re,Xr as ie,ei as ae,ti as j}from"./constants-B_ksgMZ4.js";import{Ci as M,Fi as N,G as P,Ni as oe,Wi as F,hn as I,in as L,nn as R,on as z,pi as B,rn as se,tn as V,tr as H,ui as ce,wi as U,wr as W}from"./index-Ds_KzrLo.js";import{t as G}from"./index.es-CU4g6R5J.js";import{t as le}from"./CopyToClipboard-rXAbbH4m.js";import{t as ue}from"./FilePreview-DGwVB2pg.js";import{t as K}from"./ImagePreview-DKaradFQ.js";import{n as de}from"./taskDrawerMixin-DyAUhFEq.js";import{t as q}from"./Consumption-C3ZK4cM5.js";import{i as J,n as fe,t as pe}from"./pagination-ZQWSP4gt.js";import{t as me}from"./VideoPlayer-BekTLAwb.js";import{t as he}from"./ApiCodeButton-BOIv_zXn.js";import{t as ge}from"./BotPlaceholder-CWWfEeRX.js";import{t as _e}from"./NoTasks-DA2uJz0D.js";import{t as ve}from"./PromptTextarea-DD5-6B1R.js";var ye=v({name:`LayoutKling`,components:{ElDrawer:k,ElButton:N,FontAwesomeIcon:G},mixins:[de]}),be={class:`main flex flex-row flex-1 min-h-0`},xe={class:`config w-[320px] flex-none h-full flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Se={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ce(t,n,r,i,o,c){let f=l(`font-awesome-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,be,[e(`div`,xe,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Se,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{icon:`fa-solid fa-magic`})]),_:1},512),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`350px`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var we=P(ye,[[`render`,Ce],[`__scopeId`,`data-v-b87958dc`]]),Te={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function Y(e,t,n){let r=t||`std`,i=n??5;switch(e){case`kling-v1`:return{text2video:!0,image2video:!0,endImage:i===5,audio:!1,motionControl:i===5};case`kling-v1-6`:case`kling-v2-5-turbo`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:!1,motionControl:!1};case`kling-v2-6`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:r===`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:r!==`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 Te}}function X(e,t){if(!e)return[];let n=t.model??e.model,r=t.mode??e.mode,i=t.duration??e.duration;if(!n)return[];let a=Y(n,r,i),o=[];return e.end_image_url&&!a.endImage&&o.push({field:`end_image_url`,i18nLabel:`kling.name.endImage`}),e.generate_audio&&!a.audio&&o.push({field:`generate_audio`,i18nLabel:`kling.name.generateAudio`}),e.camera_control?.type&&(!a.motionControl||e.start_image_url)&&o.push({field:`camera_control`,i18nLabel:`kling.name.cameraControl`}),o}function Z(e,t){let n={...e};for(let e of t)e.field===`end_image_url`&&(n.end_image_url=void 0),e.field===`generate_audio`&&(n.generate_audio=!1),e.field===`camera_control`&&(n.camera_control=void 0);return n}var Ee=v({name:`ModelSelector`,components:{ElSelect:b,ElOption:x},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{revertKey:0,options:[{value:`kling-v3`,label:`v3`},{value:`kling-v3-omni`,label:`v3-Omni`},{value:`kling-v2-6`,label:`v2.6`},{value:`kling-v2-5-turbo`,label:`v2.5-Turbo`},{value:`kling-v2-1-master`,label:`v2.1-Master`},{value:`kling-v2-master`,label:`v2-Master`},{value:`kling-v1-6`,label:`v1.6`},{value:`kling-v1`,label:`v1`},{value:`kling-video-o1`,label:`Video-o1`}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(ie)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=X(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await M.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=Z({...t,model:e},n);this.$store.commit(`kling/setConfig`,i),U.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,model:e})}}}),De={class:`field`},Oe={class:`title font-bold`};function ke(t,n,r,a,o,u){let d=l(`el-option`),m=l(`el-select`);return g(),s(`div`,De,[e(`h2`,Oe,i(t.$t(`pika.name.model`)),1),(g(),f(m,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`pika.placeholder.select`),onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(d,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var Ae=P(Ee,[[`render`,ke],[`__scopeId`,`data-v-04059875`]]),je=v({name:`ModeSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:J},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 j.includes(this.selectedModel)?this.cameraControlSet?this.$t(`kling.description.mode4kIncompatibleCamera`):``:this.$t(`kling.description.mode4kRequiresV3`)},options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`),disabled:!1,disabledReason:``},{value:`pro`,label:this.$t(`kling.name.modePro`),disabled:!1,disabledReason:``},{value:`4k`,label:this.$t(`kling.name.mode4k`),disabled:!!this.fourKReason,disabledReason:this.fourKReason}]},value(){return this.$store.state.kling?.config?.mode}},watch:{fourKReason(e){e&&this.value===`4k`&&this.applyMode(`std`)}},mounted(){this.value||this.applyMode(`std`)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=X(t,{mode:e});if(n.length===0){this.applyMode(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await M.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=Z({...t,mode:e},n);this.$store.commit(`kling/setConfig`,i),U.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyMode(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,mode:e})}}}),Me={class:`field`},Ne={class:`header`},Pe={class:`title font-bold`},Fe={key:0,class:`opt-tip`};function Ie(t,r,u,d,m,_){let v=l(`info-icon`),y=l(`el-option`),b=l(`el-select`);return g(),s(`div`,Me,[e(`div`,Ne,[e(`h2`,Pe,i(t.$t(`kling.name.mode`)),1),a(v,{content:t.$t(`kling.description.mode`),class:`info-icon`},null,8,[`content`])]),(g(),f(b,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`kling.placeholder.select`),clearable:!0,onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.options,t=>(g(),f(y,{key:t.value,label:t.label,value:t.value,disabled:t.disabled},{default:p(()=>[e(`span`,{class:n({"opt-disabled":t.disabled})},i(t.label),3),t.disabled&&t.disabledReason?(g(),s(`span`,Fe,i(t.disabledReason),1)):o(``,!0)]),_:2},1032,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var Le=P(je,[[`render`,Ie],[`__scopeId`,`data-v-9a8fa3c5`]]),Re=[3,5,8,10,12,15],ze=[5,10],Be=v({name:`DurationSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:J},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},isV3Model(){return j.includes(this.selectedModel)},allowedDurations(){return this.isV3Model?Re:ze},value(){return this.$store.state.kling?.config?.duration??5},selectValue(){let e=this.allowedDurations;return e.includes(this.value)?this.value:e.includes(5)?5:e[0]}},watch:{isV3Model(){this.allowedDurations.includes(this.value)||this.applyDuration(5)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(5)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=X(t,{duration:e});if(n.length===0){this.applyDuration(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await M.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=Z({...t,duration:e},n);this.$store.commit(`kling/setConfig`,i),U.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyDuration(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,duration:e})}}}),Ve={class:`field`},He={class:`control`},Ue={class:`label`},We={class:`title font-bold`};function Ge(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Ve,[e(`div`,He,[e(`div`,Ue,[e(`h2`,We,i(t.$t(`kling.name.duration`)),1),a(m,{content:t.$t(`kling.description.duration`),class:`info-icon ml-1`},null,8,[`content`])]),(g(),f(v,{key:t.revertKey,"model-value":t.selectValue,class:`value`,placeholder:t.$t(`kling.placeholder.select`),onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.allowedDurations,e=>(g(),f(_,{key:e,label:`${e}s`,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])])}var Ke=P(Be,[[`render`,Ge],[`__scopeId`,`data-v-5ae55e28`]]),qe=v({name:`RatioSelector`,data(){return{options:[{value:`1:1`,label:`1:1`,width:20,height:20},{value:`16:9`,label:`16:9`,width:25,height:13},{value:`9:16`,label:`9:16`,width:13,height:25}]}},computed:{active(){return this.options.findIndex(e=>e.value===this.value)||0},value:{get(){return this.$store.state?.kling?.config?.aspect_ratio},set(e){console.debug(`set ratio`,e),this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,aspect_ratio:e})}}},mounted(){this.value||=`1:1`}}),Je={class:`text-sm font-bold mb-2 block`},Ye={class:`items`},Xe=[`onClick`],Ze={class:`name`};function Qe(t,r,a,o,l,u){return g(),s(`div`,null,[e(`span`,Je,i(t.$t(`kling.name.ratio`)),1),e(`div`,Ye,[(g(!0),s(c,null,h(t.options,(r,a)=>(g(),s(`div`,{key:a,class:n({active:t.active===a,item:!0}),onClick:e=>t.value=r.value},[e(`div`,{class:n([`preview`,r.label])},[e(`div`,{class:`rect`,style:m({width:r.width+`px`,height:r.height+`px`})},null,4)],2),e(`p`,Ze,i(r.label),1)],10,Xe))),128))])])}var $e=P(qe,[[`render`,Qe],[`__scopeId`,`data-v-cdb14b2f`]]),et=v({name:`StartImage`,components:{ElUpload:w,ElButton:N,ElTooltip:T,InfoIcon:J,FontAwesomeIcon:G,ImagePreview:K},mixins:[L,R],emits:[`change`],data(){return{fileList:[],uploadUrl:B()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},value:{get(){return this.$store.state?.kling?.config?.start_image_url},set(){}}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){U.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){U.error(this.$t(`kling.message.uploadReferencesError`))},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),tt={class:`relative`},nt={class:`flex justify-between`},rt={class:`flex justify-start items-center`},it={class:`text-sm font-bold`};function at(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,tt,[e(`div`,nt,[e(`div`,rt,[e(`span`,it,i(t.$t(`kling.name.startImage`)),1),a(h,{content:t.$t(`kling.description.uploadStartImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,disabled:t.reachedLimit,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.$t(`kling.message.uploadReferencesExceed`),disabled:!t.reachedLimit,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.reachedLimit},{default:p(()=>[a(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$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`])])}var ot=P(et,[[`render`,at],[`__scopeId`,`data-v-756dc269`]]),st=v({name:`EndImage`,components:{ElUpload:w,ElButton:N,ElTooltip:T,ImagePreview:K,InfoIcon:J,FontAwesomeIcon:G},mixins:[L,R],data(){return{fileList:[],uploadUrl:B()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},klingConfig(){return this.$store.state?.kling?.config||{}},endImageSupported(){return Y(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},hasStartImage(){return!!this.klingConfig.start_image_url},uploadDisabled(){return this.reachedLimit||!this.endImageSupported||!this.hasStartImage},uploadTooltip(){return this.endImageSupported?this.hasStartImage?this.reachedLimit?this.$t(`kling.message.uploadReferencesExceed`):``:this.$t(`kling.message.endImageRequiresStart`):this.$t(`kling.message.endImageNotSupported`)},storeValue(){return this.klingConfig.end_image_url},value:{get(){return this.storeValue},set(){}}},watch:{storeValue(e){!e&&this.fileList.length>0&&(this.fileList=[])},hasStartImage(e){!e&&this.storeValue&&(this.fileList=[],this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,end_image_url:void 0}))}},mounted(){this.value||=void 0,this.onSetEndImageUrl()},methods:{onBeforeUpload(){return this.endImageSupported?this.hasStartImage?!0:(U.warning(this.$t(`kling.message.endImageRequiresStart`)),!1):(U.warning(this.$t(`kling.message.endImageNotSupported`)),!1)},onExceed(){U.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){U.error(this.$t(`kling.message.uploadReferencesError`))},onSetEndImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),ct={class:`relative`},lt={class:`flex justify-between`},ut={class:`flex justify-start items-center`},dt={class:`text-sm font-bold`};function ft(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,ct,[e(`div`,lt,[e(`div`,ut,[e(`span`,dt,i(t.$t(`kling.name.endImage`)),1),a(h,{content:t.$t(`kling.description.uploadEndImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,disabled:t.uploadDisabled,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"before-upload":t.onBeforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`disabled`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var pt=P(st,[[`render`,ft],[`__scopeId`,`data-v-c1b257e5`]]),mt=v({name:`CfgScaleSelector`,components:{ElSlider:te,InfoIcon:J,ElInputNumber:A},computed:{value:{get(){return this.$store.state?.kling?.config?.cfg_scale},set(e){console.debug(`set cfg_scale`,e),this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,cfg_scale:e})}}},mounted(){this.value||=0}}),ht={class:`flex justify-between`},gt={class:`flex justify-start items-center`},_t={class:`text-sm font-bold`},vt={class:`flex justify-end items-center`},yt={class:`w-full`};function bt(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input-number`),p=l(`el-slider`);return g(),s(`div`,null,[e(`div`,ht,[e(`div`,gt,[e(`span`,_t,i(t.$t(`kling.name.cfgScale`)),1),a(d,{content:t.$t(`kling.description.cfgScale`)},null,8,[`content`])]),e(`div`,vt,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,yt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:0,max:1,step:.1},null,8,[`modelValue`])])])}var xt=P(mt,[[`render`,bt]]),St=v({name:`GenerateAudioSelector`,components:{ElSwitch:ne,InfoIcon:J},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},selectedMode(){return this.$store.state.kling?.config?.mode||``},supported(){return!!(j.includes(this.selectedModel)||this.selectedModel===`kling-v2-6`&&this.selectedMode===`pro`)},tooltipContent(){return this.supported?this.$t(`kling.description.generateAudio`):this.$t(`kling.description.generateAudioUnsupported`)},value:{get(){return this.supported?this.$store.state.kling?.config?.generate_audio??!1:!1},set(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,generate_audio:e})}}},watch:{supported(e){!e&&this.$store.state.kling?.config?.generate_audio&&this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,generate_audio:!1})}}}),Ct={class:`relative`},wt={class:`flex justify-between items-center`},Tt={class:`flex justify-start items-center`},Et={class:`text-sm font-bold`};function Dt(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,Ct,[e(`div`,wt,[e(`div`,Tt,[e(`span`,Et,i(t.$t(`kling.name.generateAudio`)),1),a(d,{content:t.tooltipContent},null,8,[`content`])]),a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,disabled:!t.supported},null,8,[`modelValue`,`disabled`])])])}var Ot=P(St,[[`render`,Dt]]),kt=[`horizontal`,`vertical`,`pan`,`tilt`,`roll`,`zoom`],At=v({name:`CameraControlSelector`,components:{ElSelect:b,ElOption:x,ElSlider:te,ElInputNumber:A,InfoIcon:J},data(){return{configKeys:kt}},computed:{typeOptions(){return[{value:``,label:this.$t(`kling.name.cameraTypeNone`)},{value:`simple`,label:this.$t(`kling.name.cameraTypeSimple`)},{value:`down_back`,label:this.$t(`kling.name.cameraTypeDownBack`)},{value:`forward_up`,label:this.$t(`kling.name.cameraTypeForwardUp`)},{value:`left_turn_forward`,label:this.$t(`kling.name.cameraTypeLeftTurnForward`)},{value:`right_turn_forward`,label:this.$t(`kling.name.cameraTypeRightTurnForward`)}]},selectedMode(){return this.$store.state.kling?.config?.mode||``},selectedModel(){return this.$store.state.kling?.config?.model||``},selectedDuration(){return this.$store.state.kling?.config?.duration},motionControlSupported(){return Y(this.selectedModel,this.selectedMode,this.selectedDuration).motionControl},hasStartImage(){return!!this.$store.state.kling?.config?.start_image_url},disabled(){return!this.motionControlSupported||this.hasStartImage},tooltipContent(){return this.motionControlSupported?this.hasStartImage?this.$t(`kling.description.cameraControlDisabledImage2Video`):this.$t(`kling.description.cameraControl`):this.$t(`kling.description.cameraControlNotSupported`)},selectedType(){return this.$store.state.kling?.config?.camera_control?.type},selectedTypeRaw:{get(){return this.selectedType??``},set(e){let t=this.$store.state.kling?.config||{};if(!e){let e={...t};delete e.camera_control,this.$store.commit(`kling/setConfig`,e);return}let n=e;this.$store.commit(`kling/setConfig`,{...t,camera_control:{type:n,config:n===`simple`?t.camera_control?.config||{}:void 0}})}},configValues(){return this.$store.state.kling?.config?.camera_control?.config||{}}},watch:{disabled(e){e&&this.selectedType!==void 0&&(this.selectedTypeRaw=``)}},methods:{writeConfig(e,t){let n=this.$store.state.kling?.config||{},r=n.camera_control||{type:`simple`},i={...r.config||{}};t==null?delete i[e]:i[e]=t,this.$store.commit(`kling/setConfig`,{...n,camera_control:{...r,type:`simple`,config:i}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),jt={class:`field`},Mt={class:`header`},Nt={class:`text-sm font-bold`},Pt={key:0,class:`config-grid`},Ft={class:`cfg-row-head`},It={class:`cfg-name`};function Lt(t,n,r,u,d,m){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-select`),b=l(`el-input-number`),x=l(`el-slider`);return g(),s(`div`,jt,[e(`div`,Mt,[e(`span`,Nt,i(t.$t(`kling.name.cameraControl`)),1),a(_,{content:t.tooltipContent},null,8,[`content`])]),a(y,{modelValue:t.selectedTypeRaw,"onUpdate:modelValue":n[0]||=e=>t.selectedTypeRaw=e,class:`value`,placeholder:t.$t(`kling.placeholder.cameraType`),clearable:!0,disabled:t.disabled},{default:p(()=>[(g(!0),s(c,null,h(t.typeOptions,e=>(g(),f(v,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`]),t.selectedType===`simple`&&!t.disabled?(g(),s(`div`,Pt,[(g(!0),s(c,null,h(t.configKeys,n=>(g(),s(`div`,{key:n,class:`cfg-row`},[e(`div`,Ft,[e(`span`,It,i(t.$t(`kling.name.cc_${n}`)),1),a(b,{modelValue:t.configValues[n],"onUpdate:modelValue":e=>t.configValues[n]=e,min:-1,max:1,step:.1,precision:1,"controls-position":`right`,size:`small`,class:`cfg-num`,onChange:e=>t.onNumberChange(n,e)},null,8,[`modelValue`,`onUpdate:modelValue`,`onChange`])]),a(x,{"model-value":t.configValues[n]??0,min:-1,max:1,step:.1,onInput:e=>t.onSliderChange(n,e)},null,8,[`model-value`,`onInput`])]))),128))])):o(``,!0)])}var Rt=P(At,[[`render`,Lt],[`__scopeId`,`data-v-cd896060`]]),zt=[{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`]}],Q=`, `;function Bt(e,t){let n=(e||``).trim();return n?n.includes(t)?n:`${n}${Q}${t}`:t}function $(e,t){if(!e||!t)return e||``;let n=[`${t}${Q}`,`${Q}${t}`,t],r=e;for(let e of n)if(r.includes(e)){r=r.replace(e,``);break}return r.replace(/(?:,\s*)+$/,``).replace(/^(?:,\s*)+/,``)}var Vt=v({name:`InspirationPills`,components:{FontAwesomeIcon:G},computed:{prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return zt.flatMap(e=>e.chipKeys.map(e=>this.$t(`kling.inspiration.chip.${e}`)))},selected(){let e=this.prompt;if(!e)return[];let t=[];for(let n of this.allChipTexts){let r=e.indexOf(n);r!==-1&&t.push({text:n,idx:r})}return t.sort((e,t)=>e.idx-t.idx).map(e=>e.text)}},methods:{onRemove(e){let t=$(this.prompt,e);this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:t})}}}),Ht={key:0,class:`pills`,role:`list`},Ut={class:`pill-text`},Wt=[`aria-label`,`onClick`];function Gt(n,r,u,d,f,p){let m=l(`font-awesome-icon`);return n.selected.length>0?(g(),s(`div`,Ht,[(g(!0),s(c,null,h(n.selected,r=>(g(),s(`div`,{key:r,class:`pill`,role:`listitem`},[e(`span`,Ut,i(r),1),e(`button`,{type:`button`,class:`pill-remove`,"aria-label":n.$t(`kling.inspiration.removeChip`),onClick:t(e=>n.onRemove(r),[`stop`])},[a(m,{icon:`fa-solid fa-xmark`})],8,Wt)]))),128))])):o(``,!0)}var Kt=v({name:`PromptInput`,components:{ElButton:N,FontAwesomeIcon:G,PromptTextarea:ve,InspirationPills:P(Vt,[[`render`,Gt],[`__scopeId`,`data-v-5fc4fa65`]])},emits:[`open-inspiration`],computed:{prompt:{get(){return this.$store.state.kling?.config?.prompt},set(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:e})}}},mounted(){this.prompt||=``}});function qt(e,t,n,o,s,c){let u=l(`font-awesome-icon`),d=l(`el-button`),m=l(`inspiration-pills`),h=l(`prompt-textarea`);return g(),f(h,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||=t=>e.prompt=t,title:e.$t(`kling.name.prompt`),info:e.$t(`kling.description.prompt`),placeholder:e.$t(`kling.placeholder.prompt`)},{actions:p(()=>[a(d,{text:``,size:`small`,class:`inspiration-btn`,onClick:t[0]||=t=>e.$emit(`open-inspiration`)},{default:p(()=>[a(u,{icon:`fa-regular fa-lightbulb`,class:`mr-1`}),r(` `+i(e.$t(`kling.inspiration.openButton`)),1)]),_:1})]),before:p(()=>[a(m)]),_:1},8,[`modelValue`,`title`,`info`,`placeholder`])}var Jt=P(Kt,[[`render`,qt],[`__scopeId`,`data-v-c01fc1a6`]]),Yt=v({name:`NegativePromptInput`,components:{ElInput:F,InfoIcon:J},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||=``}}),Xt={class:`field`},Zt={class:`box`},Qt={class:`title font-bold`};function $t(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,Xt,[e(`div`,Zt,[e(`h2`,Qt,i(t.$t(`kling.name.negativePrompt`)),1),a(d,{content:t.$t(`kling.description.negativePrompt`),class:`info`},null,8,[`content`])]),a(f,{modelValue:t.prompt,"onUpdate:modelValue":n[0]||=e=>t.prompt=e,rows:3,type:`textarea`,class:`prompt`,placeholder:t.$t(`kling.placeholder.negativePrompt`)},null,8,[`modelValue`,`placeholder`])])}var en=P(Yt,[[`render`,$t],[`__scopeId`,`data-v-de98cf01`]]),tn=v({name:`InspirationDrawer`,components:{ElDrawer:k,ElButton:N,FontAwesomeIcon:G},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`],data(){return{groups:zt,Close:y}},computed:{visible:{get(){return this.modelValue},set(e){this.$emit(`update:modelValue`,e)}},drawerSize(){return window.innerWidth<768?`100%`:`380px`},prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return this.groups.flatMap(e=>e.chipKeys.map(e=>this.$t(`kling.inspiration.chip.${e}`)))},selectedCount(){return this.allChipTexts.filter(e=>this.isSelected(e)).length}},methods:{chipText(e){return this.$t(`kling.inspiration.chip.${e}`)},isSelected(e){return e?this.prompt.includes(e):!1},setPrompt(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:e})},onToggle(e){e&&(this.isSelected(e)?this.setPrompt($(this.prompt,e)):this.setPrompt(Bt(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(let t of this.allChipTexts)for(;e.includes(t);)e=$(e,t);this.setPrompt(e)}}}),nn={class:`drawer-content`},rn={class:`drawer-header`},an={class:`title-row`},on={class:`title`},sn={class:`hint`},cn={key:0,class:`selected-bar`},ln={class:`selected-text`},un={class:`groups`},dn={class:`group-title`},fn={class:`chip-grid`},pn=[`onClick`];function mn(t,u,d,m,_,v){let y=l(`font-awesome-icon`),b=l(`el-button`),x=l(`el-drawer`);return g(),f(x,{modelValue:t.visible,"onUpdate:modelValue":u[1]||=e=>t.visible=e,direction:`rtl`,"with-header":!1,size:t.drawerSize,"custom-class":`kling-inspiration-drawer`,"destroy-on-close":!1},{default:p(()=>[e(`div`,nn,[e(`div`,rn,[e(`div`,an,[a(y,{icon:`fa-regular fa-lightbulb`,class:`mr-2`}),e(`span`,on,i(t.$t(`kling.inspiration.title`)),1)]),a(b,{text:``,icon:t.Close,class:`close-btn`,onClick:u[0]||=e=>t.visible=!1},null,8,[`icon`])]),e(`div`,sn,i(t.$t(`kling.inspiration.hint`)),1),t.selectedCount>0?(g(),s(`div`,cn,[e(`span`,ln,i(t.$t(`kling.inspiration.selectedSummary`,{count:t.selectedCount})),1),a(b,{text:``,size:`small`,class:`clear-btn`,onClick:t.onClearSelected},{default:p(()=>[r(i(t.$t(`kling.inspiration.clearSelected`)),1)]),_:1},8,[`onClick`])])):o(``,!0),e(`div`,un,[(g(!0),s(c,null,h(t.groups,r=>(g(),s(`div`,{key:r.groupKey,class:`group`},[e(`div`,dn,i(t.$t(`kling.inspiration.group.${r.groupKey}`)),1),e(`div`,fn,[(g(!0),s(c,null,h(r.chipKeys,e=>(g(),s(`button`,{key:e,type:`button`,class:n({chip:!0,active:t.isSelected(t.chipText(e))}),onClick:n=>t.onToggle(t.chipText(e))},i(t.chipText(e)),11,pn))),128))])]))),128))])])]),_:1},8,[`modelValue`,`size`])}var hn=P(tn,[[`render`,mn],[`__scopeId`,`data-v-7d457a69`]]),gn={"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`},_n={std:`720p`,pro:`1080p`,"4k":`4K`},vn=v({name:`SummaryChip`,components:{FontAwesomeIcon:G},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){let e=this.config?.model||`kling-v2-5-turbo`;return gn[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||``},modeLabel(){let e=this.config?.mode||`std`;return _n[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),yn={class:`summary-chip`},bn=[`title`],xn=[`title`],Sn=[`title`],Cn=[`title`],wn=[`title`];function Tn(t,n,r,c,u,d){let f=l(`font-awesome-icon`);return g(),s(`div`,yn,[e(`span`,{class:`part`,title:t.$t(`kling.name.model`)},i(t.modelLabel),9,bn),n[0]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.duration`)},i(t.durationLabel),9,xn),n[1]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.ratio`)},i(t.aspectRatio||`16:9`),9,Sn),n[2]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.mode`)},i(t.modeLabel),9,Cn),t.generateAudio?(g(),s(`span`,{key:0,class:`audio`,title:t.$t(`kling.name.generateAudio`)},[a(f,{icon:`fa-solid fa-headphones`})],8,wn)):o(``,!0)])}var En=v({name:`ConfigPanel`,components:{ElButton:N,Consumption:q,FontAwesomeIcon:G,PromptInput:Jt,NegativePromptInput:en,ModelSelector:Ae,ModeSelector:Le,DurationSelector:Ke,RatioSelector:$e,StartImage:ot,CfgScaleSelector:xt,GenerateAudioSelector:Ot,CameraControlSelector:Rt,InspirationDrawer:hn,SummaryChip:P(vn,[[`render`,Tn],[`__scopeId`,`data-v-418a6733`]]),EndImage:pt},emits:[`generate`],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},consumption(){return z(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),Dn={class:`flex flex-col h-full`},On={class:`flex-1 overflow-y-auto p-5`},kn={class:`flex flex-col items-center justify-center px-5 pb-5`};function An(t,n,o,c,u,d){let m=l(`prompt-input`),h=l(`model-selector`),_=l(`ratio-selector`),v=l(`start-image`),y=l(`end-image`),b=l(`duration-selector`),x=l(`mode-selector`),S=l(`generate-audio-selector`),C=l(`camera-control-selector`),w=l(`cfg-scale-selector`),T=l(`negative-prompt-input`),E=l(`summary-chip`),ee=l(`consumption`),D=l(`font-awesome-icon`),O=l(`el-button`),k=l(`inspiration-drawer`);return g(),s(`div`,Dn,[e(`div`,On,[a(m,{class:`mb-4`,onOpenInspiration:n[0]||=e=>t.inspirationOpen=!0}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-2`}),a(y,{class:`mb-2`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`})]),e(`div`,kn,[a(E),a(ee,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),t.config?.video_url!==void 0||t.config?.custom?(g(),f(O,{key:0,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(D,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.extend`)),1)]),_:1},8,[`onClick`])):(g(),f(O,{key:1,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(D,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.generate`)),1)]),_:1},8,[`onClick`]))]),a(k,{modelValue:t.inspirationOpen,"onUpdate:modelValue":n[1]||=e=>t.inspirationOpen=e},null,8,[`modelValue`])])}var jn=P(En,[[`render`,An]]),Mn=v({name:`MotionImage`,components:{ElUpload:w,ElButton:N,InfoIcon:J,FontAwesomeIcon:G,ImagePreview:K},mixins:[L,R],data(){return{fileList:[],uploadUrl:B()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetImageUrl()},methods:{onExceed(){U.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){U.error(this.$t(`kling.message.uploadReferencesError`))},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,image_url:void 0})},onSetImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,image_url:e})},async onSuccess(){this.onSetImageUrl()}}}),Nn={class:`relative`},Pn={class:`flex justify-between`},Fn={class:`flex justify-start items-center`},In={class:`text-sm font-bold`};function Ln(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,Nn,[e(`div`,Pn,[e(`div`,Fn,[e(`span`,In,i(t.$t(`kling.name.motionImage`)),1),a(h,{content:t.$t(`kling.description.motionImage`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Rn=P(Mn,[[`render`,Ln],[`__scopeId`,`data-v-e52eaf2f`]]),zn=v({name:`MotionVideo`,components:{ElUpload:w,ElButton:N,InfoIcon:J,FilePreview:ue,FontAwesomeIcon:G},mixins:[R],data(){return{fileList:[],uploadUrl:B()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetVideoUrl()},methods:{onExceed(){U.warning(this.$t(`kling.message.uploadVideoExceed`))},onError(){U.error(this.$t(`kling.message.uploadVideoError`))},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,video_url:void 0})},beforeUpload(e){let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=e.size/1024/1024<100;return t?n?!0:(U.error(this.$t(`kling.message.uploadVideoSizeExceed`)),!1):(U.error(this.$t(`kling.message.uploadVideoTypeFailed`)),!1)},onSetVideoUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,video_url:e})},async onSuccess(){this.onSetVideoUrl()}}}),Bn={class:`relative`},Vn={class:`flex justify-between`},Hn={class:`flex justify-start items-center`},Un={class:`text-sm font-bold`};function Wn(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,Bn,[e(`div`,Vn,[e(`div`,Hn,[e(`span`,Un,i(t.$t(`kling.name.motionVideo`)),1),a(h,{content:t.$t(`kling.description.motionVideo`)},null,8,[`content`])])]),a(b,{"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4,.mov`,name:`file`,class:`value`,"show-file-list":!0,limit:1,multiple:!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.percentage===void 0?o(``,!0):(g(),f(_,{key:0,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadVideoUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Gn=P(zn,[[`render`,Wn],[`__scopeId`,`data-v-7019a8d2`]]),Kn=v({name:`MotionPromptInput`,components:{ElInput:F,InfoIcon:J},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||``},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),qn={class:`field`},Jn={class:`box`},Yn={class:`title font-bold`};function Xn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,qn,[e(`div`,Jn,[e(`h2`,Yn,i(t.$t(`kling.name.motionPrompt`)),1),a(d,{content:t.$t(`kling.description.motionPrompt`),class:`info`},null,8,[`content`])]),a(f,{modelValue:t.prompt,"onUpdate:modelValue":n[0]||=e=>t.prompt=e,rows:3,type:`textarea`,class:`prompt`,placeholder:t.$t(`kling.placeholder.motionPrompt`)},null,8,[`modelValue`,`placeholder`])])}var Zn=P(Kn,[[`render`,Xn],[`__scopeId`,`data-v-ca9fdbe5`]]),Qn=`video`,$n=v({name:`CharacterOrientationSelector`,components:{ElRadioGroup:O,ElRadioButton:D,InfoIcon:J},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||Qn},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=Qn)}}),er={class:`field`},tr={class:`header`},nr={class:`text-sm font-bold`};function rr(t,n,o,c,u,d){let f=l(`info-icon`),m=l(`el-radio-button`),h=l(`el-radio-group`);return g(),s(`div`,er,[e(`div`,tr,[e(`span`,nr,i(t.$t(`kling.name.characterOrientation`)),1),a(f,{content:t.$t(`kling.description.characterOrientation`)},null,8,[`content`])]),a(h,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,size:`small`,class:`value`},{default:p(()=>[a(m,{label:`image`},{default:p(()=>[r(i(t.$t(`kling.name.orientationImage`)),1)]),_:1}),a(m,{label:`video`},{default:p(()=>[r(i(t.$t(`kling.name.orientationVideo`)),1)]),_:1})]),_:1},8,[`modelValue`])])}var ir=P($n,[[`render`,rr],[`__scopeId`,`data-v-7a91195b`]]),ar=`kling-v2-6`,or=v({name:`MotionModelSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:J},computed:{options(){return[{value:`kling-v2-6`,label:`Kling 2.6`},{value:`kling-v3`,label:`Kling 3.0`}]},value:{get(){return this.$store.state.kling?.motionConfig?.model_name||ar},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,model_name:e})}}},mounted(){this.$store.state.kling?.motionConfig?.model_name||(this.value=ar)}}),sr={class:`field`},cr={class:`header`},lr={class:`title font-bold`};function ur(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,sr,[e(`div`,cr,[e(`h2`,lr,i(t.$t(`kling.name.motionModel`)),1),a(m,{content:t.$t(`kling.description.motionModel`)},null,8,[`content`])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var dr=P(or,[[`render`,ur],[`__scopeId`,`data-v-480e8da2`]]),fr=`std`,pr=v({name:`MotionModeSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:J},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||fr},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=fr)}}),mr={class:`field`},hr={class:`header`},gr={class:`title font-bold`};function _r(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,mr,[e(`div`,hr,[e(`h2`,gr,i(t.$t(`kling.name.mode`)),1),a(m,{content:t.$t(`kling.description.motionMode`)},null,8,[`content`])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var vr=P(pr,[[`render`,_r],[`__scopeId`,`data-v-1295688c`]]),yr=v({name:`KeepOriginalSoundSelector`,components:{ElSwitch:ne,InfoIcon:J},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`})}}}}),br={class:`relative`},xr={class:`flex justify-between items-center`},Sr={class:`flex justify-start items-center`},Cr={class:`text-sm font-bold`};function wr(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,br,[e(`div`,xr,[e(`div`,Sr,[e(`span`,Cr,i(t.$t(`kling.name.keepOriginalSound`)),1),a(d,{content:t.$t(`kling.description.keepOriginalSound`)},null,8,[`content`])]),a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e},null,8,[`modelValue`])])])}var Tr=v({name:`MotionPanel`,components:{ElButton:N,FontAwesomeIcon:G,Consumption:q,MotionImage:Rn,MotionVideo:Gn,MotionPromptInput:Zn,CharacterOrientationSelector:ir,MotionModelSelector:dr,MotionModeSelector:vr,KeepOriginalSoundSelector:P(yr,[[`render`,wr]])},emits:[`generate`],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return z({...this.motionConfig,duration:1},this.service?.cost)},service(){return this.$store.state.kling?.service},canGenerate(){let e=this.motionConfig;return!!(e?.image_url&&e?.video_url)}},methods:{onGenerate(){this.$emit(`generate`)}}}),Er={class:`flex flex-col h-full`},Dr={class:`flex-1 overflow-y-auto p-5`},Or={class:`flex flex-col items-center justify-center px-5 pb-5`};function kr(t,n,o,c,u,d){let f=l(`motion-image`),m=l(`motion-video`),h=l(`motion-prompt-input`),_=l(`character-orientation-selector`),v=l(`motion-model-selector`),y=l(`motion-mode-selector`),b=l(`keep-original-sound-selector`),x=l(`consumption`),S=l(`font-awesome-icon`),C=l(`el-button`);return g(),s(`div`,Er,[e(`div`,Dr,[a(f,{class:`mb-3`}),a(m,{class:`mb-3`}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`})]),e(`div`,Or,[a(x,{value:t.consumption,service:t.service,"rate-unit":t.$t(`kling.name.perSecond`),note:t.$t(`kling.message.motionPricingNote`)},null,8,[`value`,`service`,`rate-unit`,`note`]),a(C,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(S,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.generateMotion`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var Ar=P(Tr,[[`render`,kr]]),jr=v({name:`KlingTabSwitcher`,components:{ElTabs:S,ElTabPane:C,ElTag:oe},props:{modelValue:{type:String,default:`videos`}},emits:[`update:modelValue`],computed:{tabs(){return[{value:`videos`,label:this.$t(`kling.tab.videoGeneration`)},{value:`motion`,label:this.$t(`kling.tab.motionControl`)},{value:`talking-photo`,label:this.$t(`kling.tab.talkingPhoto`)}]}},methods:{onUpdate(e){this.$emit(`update:modelValue`,e)}}}),Mr=[`title`],Nr={class:`text`};function Pr(t,n,a,u,d,m){let _=l(`el-tag`),v=l(`el-tab-pane`),y=l(`el-tabs`);return g(),f(y,{"model-value":t.modelValue,class:`kling-tabs`,stretch:``,"onUpdate:modelValue":t.onUpdate},{default:p(()=>[(g(!0),s(c,null,h(t.tabs,t=>(g(),f(v,{key:t.value,name:t.value,disabled:t.disabled},{label:p(()=>[e(`span`,{class:`tab-label`,title:t.disabled?t.disabledReason:void 0},[e(`span`,Nr,i(t.label),1),t.badge?(g(),f(_,{key:0,size:`small`,type:`warning`,class:`badge`},{default:p(()=>[r(i(t.badge),1)]),_:2},1024)):o(``,!0)],8,Mr)]),_:2},1032,[`name`,`disabled`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var Fr=P(jr,[[`render`,Pr],[`__scopeId`,`data-v-fda33e4c`]]),Ir={"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`},Lr=v({name:`TalkingPhotoModelSelector`,components:{ElSelect:b,ElOption:x},data(){return{options:ae.map(e=>({value:e,label:Ir[e]||e}))}},computed:{value:{get(){return this.$store.state.kling?.talkingPhotoConfig?.model||`kling-v2-1-master`},set(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.$store.state.kling?.talkingPhotoConfig,model:e})}}},mounted(){this.$store.state.kling?.talkingPhotoConfig?.model||(this.value=re)}}),Rr={class:`field`},zr={class:`title font-bold`};function Br(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Rr,[e(`h2`,zr,i(t.$t(`kling.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Vr=P(Lr,[[`render`,Br],[`__scopeId`,`data-v-cbc83d11`]]),Hr=v({name:`TalkingPhotoModeSelector`,components:{ElSelect:b,ElOption:x},computed:{options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`)},{value:`pro`,label:this.$t(`kling.name.modePro`)}]},value:{get(){return this.$store.state.kling?.talkingPhotoConfig?.mode||`pro`},set(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.$store.state.kling?.talkingPhotoConfig,mode:e})}}},mounted(){this.$store.state.kling?.talkingPhotoConfig?.mode||(this.value=`pro`)}}),Ur={class:`field`},Wr={class:`title font-bold`};function Gr(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Ur,[e(`h2`,Wr,i(t.$t(`kling.name.mode`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Kr=v({name:`TalkingPhotoPanel`,components:{ElUpload:w,ElButton:N,ElInput:F,FontAwesomeIcon:G,Consumption:q,InfoIcon:J,ImagePreview:K,ModelSelector:Vr,ModeSelector:P(Hr,[[`render`,Gr],[`__scopeId`,`data-v-92525a1d`]])},mixins:[R],emits:[`generate`],data(){return{imageFiles:[],audioFiles:[],uploadUrl:B()+`/api/v1/files/`}},computed:{config(){return this.$store.state.kling?.talkingPhotoConfig||{}},audioUrl(){return this.config.audio_url},headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},service(){return this.$store.state.kling?.service},consumption(){return z({...this.config,action:`talking-photo`},this.service?.cost)},canGenerate(){return!!(this.config.image_url&&this.config.audio_url)}},methods:{commit(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.config,...e})},onPromptChange(e){this.commit({prompt:e})},onImageExceed(){U.warning(this.$t(`kling.message.uploadReferencesExceed`))},onImageError(){U.error(this.$t(`kling.message.uploadReferencesError`))},onImageSuccess(e){this.commit({image_url:e?.file_url})},onImageRemove(e){this.imageFiles.splice(this.imageFiles.indexOf(e),1),this.commit({image_url:void 0})},onAudioExceed(){U.warning(this.$t(`kling.message.uploadAudioExceed`))},onAudioError(){U.error(this.$t(`kling.message.uploadAudioError`))},onAudioSuccess(e){this.commit({audio_url:e?.file_url})},onAudioRemove(){this.commit({audio_url:void 0})},onGenerate(){this.$emit(`generate`)}}}),qr={class:`flex flex-col h-full`},Jr={class:`flex-1 overflow-y-auto p-5`},Yr={class:`relative mb-4`},Xr={class:`flex justify-start items-center`},Zr={class:`text-sm font-bold`},Qr={class:`relative mb-4`},$r={class:`flex justify-start items-center`},ei={class:`text-sm font-bold`},ti=[`src`],ni={class:`mb-4`},ri={class:`flex justify-start items-center`},ii={class:`text-sm font-bold`},ai={class:`flex flex-col items-center justify-center px-5 pb-5`};function oi(t,n,c,u,d,m){let h=l(`model-selector`),_=l(`mode-selector`),v=l(`info-icon`),y=l(`image-preview`),b=l(`font-awesome-icon`),x=l(`el-button`),S=l(`el-upload`),C=l(`el-input`),w=l(`consumption`);return g(),s(`div`,qr,[e(`div`,Jr,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),e(`div`,Yr,[e(`div`,Xr,[e(`span`,Zr,i(t.$t(`kling.name.talkingPhotoImage`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoImage`)},null,8,[`content`])]),a(S,{ref:`imageUploader`,"file-list":t.imageFiles,"onUpdate:fileList":n[0]||=e=>t.imageFiles=e,name:`file`,accept:`.png,.jpg,.jpeg,.webp,.bmp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,headers:t.headers,"on-exceed":t.onImageExceed,"on-error":t.onImageError,"on-success":t.onImageSuccess},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(y,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onImageRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(x,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(b,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`])]),e(`div`,Qr,[e(`div`,$r,[e(`span`,ei,i(t.$t(`kling.name.talkingPhotoAudio`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoAudio`)},null,8,[`content`])]),a(S,{ref:`audioUploader`,"file-list":t.audioFiles,"onUpdate:fileList":n[1]||=e=>t.audioFiles=e,name:`file`,accept:`.mp3,.wav,.m4a,.aac`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,headers:t.headers,"on-exceed":t.onAudioExceed,"on-error":t.onAudioError,"on-success":t.onAudioSuccess,"on-remove":t.onAudioRemove},{default:p(()=>[a(x,{round:``,type:`primary`,size:`small`,class:`btn`},{default:p(()=>[a(b,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadAudio`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`,`on-remove`]),t.audioUrl?(g(),s(`audio`,{key:0,src:t.audioUrl,controls:``,class:`w-full mt-2`},null,8,ti)):o(``,!0)]),e(`div`,ni,[e(`div`,ri,[e(`span`,ii,i(t.$t(`kling.name.talkingPhotoPrompt`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoPrompt`)},null,8,[`content`])]),a(C,{"model-value":t.config.prompt,type:`textarea`,rows:2,placeholder:t.$t(`kling.placeholder.talkingPhotoPrompt`),class:`mt-1`,"onUpdate:modelValue":t.onPromptChange},null,8,[`model-value`,`placeholder`,`onUpdate:modelValue`])])]),e(`div`,ai,[a(w,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(x,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(b,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.generateTalkingPhoto`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var si=P(Kr,[[`render`,oi],[`__scopeId`,`data-v-27261e35`]]),ci=v({name:`TaskPreview`,components:{ElImage:E,CopyToClipboard:le,FontAwesomeIcon:G,ElAlert:ee,VideoPlayer:me,ElTooltip:T,ElButton:N,ImagePreview:K,ApiCodeButton:he},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},referenceImages(){let e=[],t=this.modelValue?.request?.start_image_url,n=this.modelValue?.request?.end_image_url;return t&&e.push({url:t,name:`start-image`}),n&&e.push({url:n,name:`end-image`}),e}},methods:{onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),li={class:`preview`},ui={class:`left`},di={class:`main`},fi={class:`bot`},pi={class:`datetime`},mi={class:`info`},hi={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},gi={key:1,class:`prompt mt-2`},_i={key:0},vi={key:1},yi={key:0,class:n({content:!0,failed:!0})},bi={key:0,class:`mb-4`},xi={key:1,class:n({operations:!0,"mt-2":!0})},Si={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ci={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},wi={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Ti={key:1,class:n({content:!0})},Ei={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Di={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Oi={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ki={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Ai={key:2,class:n({content:!0})},ji={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Mi={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Ni(t,n,u,d,m,_){let v=l(`el-image`),y=l(`image-preview`),b=l(`video-player`),x=l(`el-button`),S=l(`el-tooltip`),C=l(`api-code-button`),w=l(`font-awesome-icon`),T=l(`copy-to-clipboard`),E=l(`el-alert`);return g(),s(`div`,li,[e(`div`,ui,[a(v,{src:`https://cdn.acedata.cloud/qpbbbb.jpg`,class:`avatar`})]),e(`div`,di,[e(`div`,fi,[r(i(t.$t(`kling.name.klingBot`))+` `,1),e(`span`,pi,i(t.$dayjs.format(``+new Date(parseFloat((t.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,mi,[t.referenceImages.length>0?(g(),s(`div`,hi,[(g(!0),s(c,null,h(t.referenceImages,(e,t)=>(g(),f(y,{key:t,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),t.modelValue?.request?.prompt?(g(),s(`p`,gi,[r(i(t.modelValue?.request?.prompt)+` `,1),t.modelValue?.response?o(``,!0):(g(),s(`span`,_i,` - (`+i(t.$t(`kling.status.pending`))+`) `,1)),t.modelValue?.response?.state===`submitted`||t.modelValue?.response?.state===`processing`||t.modelValue?.response?.state===`pending`||t.modelValue?.response?.state===`completed`?(g(),s(`span`,vi,` - (`+i(t.$t(`kling.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),t.modelValue?.response?.success===!0?(g(),s(`div`,yi,[t.modelValue?.response.video_url?(g(),s(`div`,bi,[a(b,{src:t.modelValue?.response.video_url},null,8,[`src`])])):o(``,!0),t.modelValue?.response.success?(g(),s(`div`,xi,[a(S,{class:`box-item`,effect:`dark`,content:t.$t(`kling.message.downloadVideo`),placement:`top-start`},{default:p(()=>[t.modelValue?.response.video_url?(g(),f(x,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:n[0]||=e=>t.onDownload(e,t.modelValue?.response.video_url)},{default:p(()=>[r(i(t.$t(`kling.button.download`)),1)]),_:1})):o(``,!0)]),_:1},8,[`content`]),a(C,{path:`/kling/videos`,body:t.modelValue?.request},null,8,[`body`])])):o(``,!0),a(E,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,Si,[a(w,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.model`))+`: `+i(t.modelValue?.request?.model),1)]),e(`p`,Ci,[a(w,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(T,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.elapsed?(g(),s(`p`,wi,[a(w,{icon:`fa-solid fa-clock`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.elapsed`))+`: `+i(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),t.modelValue?.response?.success===!1?(g(),s(`div`,Ti,[a(E,{closable:!1,class:`failure`},{template:p(()=>[a(w,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,Ei,[a(w,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(T,{content:t.modelValue?.id},null,8,[`content`])]),e(`p`,Di,[a(w,{icon:`fa-solid fa-circle-info`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.failureReason`))+`: `+i(t.modelValue?.response?.error?.message)+` `,1),a(T,{content:t.modelValue?.response?.error?.message},null,8,[`content`])]),t.modelValue?.elapsed?(g(),s(`p`,Oi,[a(w,{icon:`fa-solid fa-clock`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.elapsed`))+`: `+i(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),t.modelValue?.response?.trace_id?(g(),s(`p`,ki,[a(w,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.traceId`))+`: `+i(t.modelValue?.response?.trace_id)+` `,1),a(T,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),t.modelValue?.response?.success===void 0?(g(),s(`div`,Ai,[a(E,{closable:!1,class:`info`},{template:p(()=>[a(w,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,ji,[a(w,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(T,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.response?.trace_id?(g(),s(`p`,Mi,[a(w,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.traceId`))+`: `+i(t.modelValue?.response?.trace_id)+` `,1),a(T,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var Pi=v({name:`RecentPanel`,components:{TaskPreview:P(ci,[[`render`,Ni],[`__scopeId`,`data-v-c36bfd7f`]]),NoTasks:_e,BotPlaceholder:ge,ScrollList:fe},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?.()}}}),Fi={key:0},Ii={key:2,class:`w-full h-full flex items-center justify-center`};function Li(e,t,n,r,i,u){let d=l(`bot-placeholder`),m=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return g(),s(c,null,[e.tasks?.items===void 0?(g(),s(`div`,Fi,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`h-full w-full overflow-y-auto tasks`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,e=>(g(),f(m,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,Ii,[a(v)])):o(``,!0)],64)}var Ri=v({name:`KlingIndex`,components:{ConfigPanel:jn,MotionPanel:Ar,TalkingPhotoPanel:si,TabSwitcher:Fr,Layout:we,RecentPanel:P(Pi,[[`render`,Li]])},mixins:[se],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===ce.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===ce.Request||this.fetchingTasks},credential(){return this.$store.state.kling.credential},config(){return this.$store.state.kling.config},motionConfig(){return this.$store.state.kling.motionConfig},talkingPhotoConfig(){return this.$store.state.kling.talkingPhotoConfig},taskType(){return this.$store.state.kling.taskType||`videos`},tasks(){return this.$store.state.kling.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await pe({tasks:this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`kling/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`kling/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`kling/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!V(this.uploadTracker,e=>this.$t(e),e=>U.warning(e)))return;let{camera_control:e,...t}=this.config||{},n={...t,async:!0};if(!n.video_id&&!t.video_url&&!n.start_image_url&&n.end_image_url){U.warning(this.$t(`kling.message.endImageRequiresStart`));return}if(n.action||(n.video_id||t.video_url?n.action=`extend`:n.start_image_url?n.action=`image2video`:n.action=`text2video`),n.action===`text2video`&&n.end_image_url&&delete n.end_image_url,e?.type&&(n.camera_control={type:e.type,...e.type===`simple`&&e.config?{config:Object.fromEntries(Object.entries(e.config).filter(([,e])=>e!=null))}:{}}),!I())return;let r=this.credential?.token;if(!r){console.error(`no token specified`);return}U.info(this.$t(`kling.message.startingTask`)),W(`kling`,H.generate(n,{token:r})).then(()=>{U.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?U.error(this.$t(`kling.message.usedUp`)):U.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},async onTabChange(e){e!==this.taskType&&(await this.$store.dispatch(`kling/setTaskType`,e),await this.onGetTasks(),await this.onScrollDown())},async onGenerateMotion(){if(!V(this.uploadTracker,e=>this.$t(e),e=>U.warning(e)))return;let e=this.motionConfig||{};if(!e.image_url||!e.video_url){U.warning(this.$t(`kling.message.motionMissingInputs`));return}let t={image_url:e.image_url,video_url:e.video_url,character_orientation:e.character_orientation||`video`,mode:e.mode||`std`,keep_original_sound:e.keep_original_sound??`yes`,...e.model_name?{model_name:e.model_name}:{},...e.prompt?{prompt:e.prompt}:{},async:!0};if(!I())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}U.info(this.$t(`kling.message.startingTask`)),W(`kling`,H.motion(t,{token:n})).then(()=>{U.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?U.error(this.$t(`kling.message.usedUp`)):U.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},async onGenerateTalkingPhoto(){if(!V(this.uploadTracker,e=>this.$t(e),e=>U.warning(e)))return;let e=this.talkingPhotoConfig||{};if(!e.image_url||!e.audio_url){U.warning(this.$t(`kling.message.talkingPhotoMissingInputs`));return}let t={image_url:e.image_url,audio_url:e.audio_url,model:e.model||`kling-v2-1-master`,mode:e.mode||`pro`,...e.prompt?{prompt:e.prompt}:{},...e.duration?{duration:e.duration}:{},async:!0};if(!I())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}U.info(this.$t(`kling.message.startingTask`)),W(`kling`,H.talkingPhoto(t,{token:n})).then(()=>{U.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?U.error(this.$t(`kling.message.usedUp`)):U.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),zi={class:`flex flex-col h-full`},Bi={class:`flex-1 min-h-0`};function Vi(t,n,r,i,s,c){let u=l(`tab-switcher`),d=l(`config-panel`),m=l(`motion-panel`),h=l(`talking-photo-panel`),_=l(`recent-panel`),v=l(`layout`);return g(),f(v,null,{config:p(()=>[e(`div`,zi,[a(u,{"model-value":t.taskType,"onUpdate:modelValue":t.onTabChange},null,8,[`model-value`,`onUpdate:modelValue`]),e(`div`,Bi,[t.taskType===`videos`?(g(),f(d,{key:0,onGenerate:t.onGenerate},null,8,[`onGenerate`])):t.taskType===`motion`?(g(),f(m,{key:1,onGenerate:t.onGenerateMotion},null,8,[`onGenerate`])):t.taskType===`talking-photo`?(g(),f(h,{key:2,onGenerate:t.onGenerateTalkingPhoto},null,8,[`onGenerate`])):o(``,!0)])])]),result:p(()=>[a(_,{ref:`recentPanel`,loading:t.loadingMore,onReachTop:t.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Hi=P(Ri,[[`render`,Vi]]);export{Hi as default};
1
+ import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{E as y}from"./use-deprecated-B-uvyrTL.js";import{r as b,t as x}from"./select-Dimm3cl1.js";import{n as S,t as C}from"./tabs-CoQ1qOZt.js";import{t as w}from"./upload-BQXdf3I1.js";import{t as T}from"./tooltip-CRloPYoS.js";import{t as E}from"./image-DdozYzas.js";import{t as ee}from"./alert-BfCyDcWO.js";import{n as D,r as O}from"./radio-Bj0tEwH8.js";import{t as k}from"./drawer-GII5N0kH.js";import{t as A}from"./input-number-BZftuN2C.js";import{t as te}from"./slider-DmQjyRiW.js";import{t as ne}from"./switch-D94Z7hOB.js";import{$r as re,Xr as ie,ei as ae,ti as j}from"./constants-BWAHKQ-e.js";import{G as M,Gi as N,Ii as P,Pi as oe,Ti as F,Tr as I,di as se,hn as L,in as R,mi as z,nn as B,nr as V,on as H,rn as ce,tn as U,wi as W}from"./index-m0B4VH-l.js";import{t as G}from"./index.es-DVFB1iVe.js";import{t as le}from"./CopyToClipboard-BQ2Ei1sV.js";import{t as ue}from"./FilePreview-BSviFDi1.js";import{t as K}from"./ImagePreview-DKkz6u_p.js";import{n as de}from"./taskDrawerMixin-DyAUhFEq.js";import{t as q}from"./Consumption-_nwRhH83.js";import{i as J,n as fe,t as pe}from"./pagination-OQ6Csuu1.js";import{t as me}from"./VideoPlayer-ikSJRkQv.js";import{t as he}from"./ApiCodeButton-B6ugqxDK.js";import{t as ge}from"./BotPlaceholder-DwMB-nyu.js";import{t as _e}from"./NoTasks-Q9DDa660.js";import{t as ve}from"./PromptTextarea-5oMvhem7.js";var ye=v({name:`LayoutKling`,components:{ElDrawer:k,ElButton:P,FontAwesomeIcon:G},mixins:[de]}),be={class:`main flex flex-row flex-1 min-h-0`},xe={class:`config w-[320px] flex-none h-full flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Se={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ce(t,n,r,i,o,c){let f=l(`font-awesome-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,be,[e(`div`,xe,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Se,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{icon:`fa-solid fa-magic`})]),_:1},512),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`350px`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var we=M(ye,[[`render`,Ce],[`__scopeId`,`data-v-b87958dc`]]),Te={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function Y(e,t,n){let r=t||`std`,i=n??5;switch(e){case`kling-v1`:return{text2video:!0,image2video:!0,endImage:i===5,audio:!1,motionControl:i===5};case`kling-v1-6`:case`kling-v2-5-turbo`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:!1,motionControl:!1};case`kling-v2-6`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:r===`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:r!==`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 Te}}function X(e,t){if(!e)return[];let n=t.model??e.model,r=t.mode??e.mode,i=t.duration??e.duration;if(!n)return[];let a=Y(n,r,i),o=[];return e.end_image_url&&!a.endImage&&o.push({field:`end_image_url`,i18nLabel:`kling.name.endImage`}),e.generate_audio&&!a.audio&&o.push({field:`generate_audio`,i18nLabel:`kling.name.generateAudio`}),e.camera_control?.type&&(!a.motionControl||e.start_image_url)&&o.push({field:`camera_control`,i18nLabel:`kling.name.cameraControl`}),o}function Z(e,t){let n={...e};for(let e of t)e.field===`end_image_url`&&(n.end_image_url=void 0),e.field===`generate_audio`&&(n.generate_audio=!1),e.field===`camera_control`&&(n.camera_control=void 0);return n}var Ee=v({name:`ModelSelector`,components:{ElSelect:b,ElOption:x},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{revertKey:0,options:[{value:`kling-v3`,label:`v3`},{value:`kling-v3-omni`,label:`v3-Omni`},{value:`kling-v2-6`,label:`v2.6`},{value:`kling-v2-5-turbo`,label:`v2.5-Turbo`},{value:`kling-v2-1-master`,label:`v2.1-Master`},{value:`kling-v2-master`,label:`v2-Master`},{value:`kling-v1-6`,label:`v1.6`},{value:`kling-v1`,label:`v1`},{value:`kling-video-o1`,label:`Video-o1`}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(ie)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=X(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await W.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=Z({...t,model:e},n);this.$store.commit(`kling/setConfig`,i),F.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,model:e})}}}),De={class:`field`},Oe={class:`title font-bold`};function ke(t,n,r,a,o,u){let d=l(`el-option`),m=l(`el-select`);return g(),s(`div`,De,[e(`h2`,Oe,i(t.$t(`pika.name.model`)),1),(g(),f(m,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`pika.placeholder.select`),onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(d,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var Ae=M(Ee,[[`render`,ke],[`__scopeId`,`data-v-04059875`]]),je=v({name:`ModeSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:J},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 j.includes(this.selectedModel)?this.cameraControlSet?this.$t(`kling.description.mode4kIncompatibleCamera`):``:this.$t(`kling.description.mode4kRequiresV3`)},options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`),disabled:!1,disabledReason:``},{value:`pro`,label:this.$t(`kling.name.modePro`),disabled:!1,disabledReason:``},{value:`4k`,label:this.$t(`kling.name.mode4k`),disabled:!!this.fourKReason,disabledReason:this.fourKReason}]},value(){return this.$store.state.kling?.config?.mode}},watch:{fourKReason(e){e&&this.value===`4k`&&this.applyMode(`std`)}},mounted(){this.value||this.applyMode(`std`)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=X(t,{mode:e});if(n.length===0){this.applyMode(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await W.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=Z({...t,mode:e},n);this.$store.commit(`kling/setConfig`,i),F.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyMode(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,mode:e})}}}),Me={class:`field`},Ne={class:`header`},Pe={class:`title font-bold`},Fe={key:0,class:`opt-tip`};function Ie(t,r,u,d,m,_){let v=l(`info-icon`),y=l(`el-option`),b=l(`el-select`);return g(),s(`div`,Me,[e(`div`,Ne,[e(`h2`,Pe,i(t.$t(`kling.name.mode`)),1),a(v,{content:t.$t(`kling.description.mode`),class:`info-icon`},null,8,[`content`])]),(g(),f(b,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`kling.placeholder.select`),clearable:!0,onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.options,t=>(g(),f(y,{key:t.value,label:t.label,value:t.value,disabled:t.disabled},{default:p(()=>[e(`span`,{class:n({"opt-disabled":t.disabled})},i(t.label),3),t.disabled&&t.disabledReason?(g(),s(`span`,Fe,i(t.disabledReason),1)):o(``,!0)]),_:2},1032,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var Le=M(je,[[`render`,Ie],[`__scopeId`,`data-v-9a8fa3c5`]]),Re=[3,5,8,10,12,15],ze=[5,10],Be=v({name:`DurationSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:J},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},isV3Model(){return j.includes(this.selectedModel)},allowedDurations(){return this.isV3Model?Re:ze},value(){return this.$store.state.kling?.config?.duration??5},selectValue(){let e=this.allowedDurations;return e.includes(this.value)?this.value:e.includes(5)?5:e[0]}},watch:{isV3Model(){this.allowedDurations.includes(this.value)||this.applyDuration(5)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(5)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=X(t,{duration:e});if(n.length===0){this.applyDuration(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await W.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=Z({...t,duration:e},n);this.$store.commit(`kling/setConfig`,i),F.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyDuration(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,duration:e})}}}),Ve={class:`field`},He={class:`control`},Ue={class:`label`},We={class:`title font-bold`};function Ge(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Ve,[e(`div`,He,[e(`div`,Ue,[e(`h2`,We,i(t.$t(`kling.name.duration`)),1),a(m,{content:t.$t(`kling.description.duration`),class:`info-icon ml-1`},null,8,[`content`])]),(g(),f(v,{key:t.revertKey,"model-value":t.selectValue,class:`value`,placeholder:t.$t(`kling.placeholder.select`),onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.allowedDurations,e=>(g(),f(_,{key:e,label:`${e}s`,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])])}var Ke=M(Be,[[`render`,Ge],[`__scopeId`,`data-v-5ae55e28`]]),qe=v({name:`RatioSelector`,data(){return{options:[{value:`1:1`,label:`1:1`,width:20,height:20},{value:`16:9`,label:`16:9`,width:25,height:13},{value:`9:16`,label:`9:16`,width:13,height:25}]}},computed:{active(){return this.options.findIndex(e=>e.value===this.value)||0},value:{get(){return this.$store.state?.kling?.config?.aspect_ratio},set(e){console.debug(`set ratio`,e),this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,aspect_ratio:e})}}},mounted(){this.value||=`1:1`}}),Je={class:`text-sm font-bold mb-2 block`},Ye={class:`items`},Xe=[`onClick`],Ze={class:`name`};function Qe(t,r,a,o,l,u){return g(),s(`div`,null,[e(`span`,Je,i(t.$t(`kling.name.ratio`)),1),e(`div`,Ye,[(g(!0),s(c,null,h(t.options,(r,a)=>(g(),s(`div`,{key:a,class:n({active:t.active===a,item:!0}),onClick:e=>t.value=r.value},[e(`div`,{class:n([`preview`,r.label])},[e(`div`,{class:`rect`,style:m({width:r.width+`px`,height:r.height+`px`})},null,4)],2),e(`p`,Ze,i(r.label),1)],10,Xe))),128))])])}var $e=M(qe,[[`render`,Qe],[`__scopeId`,`data-v-cdb14b2f`]]),et=v({name:`StartImage`,components:{ElUpload:w,ElButton:P,ElTooltip:T,InfoIcon:J,FontAwesomeIcon:G,ImagePreview:K},mixins:[R,B],emits:[`change`],data(){return{fileList:[],uploadUrl:z()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},value:{get(){return this.$store.state?.kling?.config?.start_image_url},set(){}}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){F.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){F.error(this.$t(`kling.message.uploadReferencesError`))},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),tt={class:`relative`},nt={class:`flex justify-between`},rt={class:`flex justify-start items-center`},it={class:`text-sm font-bold`};function at(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,tt,[e(`div`,nt,[e(`div`,rt,[e(`span`,it,i(t.$t(`kling.name.startImage`)),1),a(h,{content:t.$t(`kling.description.uploadStartImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,disabled:t.reachedLimit,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.$t(`kling.message.uploadReferencesExceed`),disabled:!t.reachedLimit,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.reachedLimit},{default:p(()=>[a(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$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`])])}var ot=M(et,[[`render`,at],[`__scopeId`,`data-v-756dc269`]]),st=v({name:`EndImage`,components:{ElUpload:w,ElButton:P,ElTooltip:T,ImagePreview:K,InfoIcon:J,FontAwesomeIcon:G},mixins:[R,B],data(){return{fileList:[],uploadUrl:z()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},klingConfig(){return this.$store.state?.kling?.config||{}},endImageSupported(){return Y(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},hasStartImage(){return!!this.klingConfig.start_image_url},uploadDisabled(){return this.reachedLimit||!this.endImageSupported||!this.hasStartImage},uploadTooltip(){return this.endImageSupported?this.hasStartImage?this.reachedLimit?this.$t(`kling.message.uploadReferencesExceed`):``:this.$t(`kling.message.endImageRequiresStart`):this.$t(`kling.message.endImageNotSupported`)},storeValue(){return this.klingConfig.end_image_url},value:{get(){return this.storeValue},set(){}}},watch:{storeValue(e){!e&&this.fileList.length>0&&(this.fileList=[])},hasStartImage(e){!e&&this.storeValue&&(this.fileList=[],this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,end_image_url:void 0}))}},mounted(){this.value||=void 0,this.onSetEndImageUrl()},methods:{onBeforeUpload(){return this.endImageSupported?this.hasStartImage?!0:(F.warning(this.$t(`kling.message.endImageRequiresStart`)),!1):(F.warning(this.$t(`kling.message.endImageNotSupported`)),!1)},onExceed(){F.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){F.error(this.$t(`kling.message.uploadReferencesError`))},onSetEndImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),ct={class:`relative`},lt={class:`flex justify-between`},ut={class:`flex justify-start items-center`},dt={class:`text-sm font-bold`};function ft(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,ct,[e(`div`,lt,[e(`div`,ut,[e(`span`,dt,i(t.$t(`kling.name.endImage`)),1),a(h,{content:t.$t(`kling.description.uploadEndImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,disabled:t.uploadDisabled,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"before-upload":t.onBeforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`disabled`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var pt=M(st,[[`render`,ft],[`__scopeId`,`data-v-c1b257e5`]]),mt=v({name:`CfgScaleSelector`,components:{ElSlider:te,InfoIcon:J,ElInputNumber:A},computed:{value:{get(){return this.$store.state?.kling?.config?.cfg_scale},set(e){console.debug(`set cfg_scale`,e),this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,cfg_scale:e})}}},mounted(){this.value||=0}}),ht={class:`flex justify-between`},gt={class:`flex justify-start items-center`},_t={class:`text-sm font-bold`},vt={class:`flex justify-end items-center`},yt={class:`w-full`};function bt(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input-number`),p=l(`el-slider`);return g(),s(`div`,null,[e(`div`,ht,[e(`div`,gt,[e(`span`,_t,i(t.$t(`kling.name.cfgScale`)),1),a(d,{content:t.$t(`kling.description.cfgScale`)},null,8,[`content`])]),e(`div`,vt,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,yt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:0,max:1,step:.1},null,8,[`modelValue`])])])}var xt=M(mt,[[`render`,bt]]),St=v({name:`GenerateAudioSelector`,components:{ElSwitch:ne,InfoIcon:J},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},selectedMode(){return this.$store.state.kling?.config?.mode||``},supported(){return!!(j.includes(this.selectedModel)||this.selectedModel===`kling-v2-6`&&this.selectedMode===`pro`)},tooltipContent(){return this.supported?this.$t(`kling.description.generateAudio`):this.$t(`kling.description.generateAudioUnsupported`)},value:{get(){return this.supported?this.$store.state.kling?.config?.generate_audio??!1:!1},set(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,generate_audio:e})}}},watch:{supported(e){!e&&this.$store.state.kling?.config?.generate_audio&&this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,generate_audio:!1})}}}),Ct={class:`relative`},wt={class:`flex justify-between items-center`},Tt={class:`flex justify-start items-center`},Et={class:`text-sm font-bold`};function Dt(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,Ct,[e(`div`,wt,[e(`div`,Tt,[e(`span`,Et,i(t.$t(`kling.name.generateAudio`)),1),a(d,{content:t.tooltipContent},null,8,[`content`])]),a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,disabled:!t.supported},null,8,[`modelValue`,`disabled`])])])}var Ot=M(St,[[`render`,Dt]]),kt=[`horizontal`,`vertical`,`pan`,`tilt`,`roll`,`zoom`],At=v({name:`CameraControlSelector`,components:{ElSelect:b,ElOption:x,ElSlider:te,ElInputNumber:A,InfoIcon:J},data(){return{configKeys:kt}},computed:{typeOptions(){return[{value:``,label:this.$t(`kling.name.cameraTypeNone`)},{value:`simple`,label:this.$t(`kling.name.cameraTypeSimple`)},{value:`down_back`,label:this.$t(`kling.name.cameraTypeDownBack`)},{value:`forward_up`,label:this.$t(`kling.name.cameraTypeForwardUp`)},{value:`left_turn_forward`,label:this.$t(`kling.name.cameraTypeLeftTurnForward`)},{value:`right_turn_forward`,label:this.$t(`kling.name.cameraTypeRightTurnForward`)}]},selectedMode(){return this.$store.state.kling?.config?.mode||``},selectedModel(){return this.$store.state.kling?.config?.model||``},selectedDuration(){return this.$store.state.kling?.config?.duration},motionControlSupported(){return Y(this.selectedModel,this.selectedMode,this.selectedDuration).motionControl},hasStartImage(){return!!this.$store.state.kling?.config?.start_image_url},disabled(){return!this.motionControlSupported||this.hasStartImage},tooltipContent(){return this.motionControlSupported?this.hasStartImage?this.$t(`kling.description.cameraControlDisabledImage2Video`):this.$t(`kling.description.cameraControl`):this.$t(`kling.description.cameraControlNotSupported`)},selectedType(){return this.$store.state.kling?.config?.camera_control?.type},selectedTypeRaw:{get(){return this.selectedType??``},set(e){let t=this.$store.state.kling?.config||{};if(!e){let e={...t};delete e.camera_control,this.$store.commit(`kling/setConfig`,e);return}let n=e;this.$store.commit(`kling/setConfig`,{...t,camera_control:{type:n,config:n===`simple`?t.camera_control?.config||{}:void 0}})}},configValues(){return this.$store.state.kling?.config?.camera_control?.config||{}}},watch:{disabled(e){e&&this.selectedType!==void 0&&(this.selectedTypeRaw=``)}},methods:{writeConfig(e,t){let n=this.$store.state.kling?.config||{},r=n.camera_control||{type:`simple`},i={...r.config||{}};t==null?delete i[e]:i[e]=t,this.$store.commit(`kling/setConfig`,{...n,camera_control:{...r,type:`simple`,config:i}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),jt={class:`field`},Mt={class:`header`},Nt={class:`text-sm font-bold`},Pt={key:0,class:`config-grid`},Ft={class:`cfg-row-head`},It={class:`cfg-name`};function Lt(t,n,r,u,d,m){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-select`),b=l(`el-input-number`),x=l(`el-slider`);return g(),s(`div`,jt,[e(`div`,Mt,[e(`span`,Nt,i(t.$t(`kling.name.cameraControl`)),1),a(_,{content:t.tooltipContent},null,8,[`content`])]),a(y,{modelValue:t.selectedTypeRaw,"onUpdate:modelValue":n[0]||=e=>t.selectedTypeRaw=e,class:`value`,placeholder:t.$t(`kling.placeholder.cameraType`),clearable:!0,disabled:t.disabled},{default:p(()=>[(g(!0),s(c,null,h(t.typeOptions,e=>(g(),f(v,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`]),t.selectedType===`simple`&&!t.disabled?(g(),s(`div`,Pt,[(g(!0),s(c,null,h(t.configKeys,n=>(g(),s(`div`,{key:n,class:`cfg-row`},[e(`div`,Ft,[e(`span`,It,i(t.$t(`kling.name.cc_${n}`)),1),a(b,{modelValue:t.configValues[n],"onUpdate:modelValue":e=>t.configValues[n]=e,min:-1,max:1,step:.1,precision:1,"controls-position":`right`,size:`small`,class:`cfg-num`,onChange:e=>t.onNumberChange(n,e)},null,8,[`modelValue`,`onUpdate:modelValue`,`onChange`])]),a(x,{"model-value":t.configValues[n]??0,min:-1,max:1,step:.1,onInput:e=>t.onSliderChange(n,e)},null,8,[`model-value`,`onInput`])]))),128))])):o(``,!0)])}var Rt=M(At,[[`render`,Lt],[`__scopeId`,`data-v-cd896060`]]),zt=[{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`]}],Q=`, `;function Bt(e,t){let n=(e||``).trim();return n?n.includes(t)?n:`${n}${Q}${t}`:t}function $(e,t){if(!e||!t)return e||``;let n=[`${t}${Q}`,`${Q}${t}`,t],r=e;for(let e of n)if(r.includes(e)){r=r.replace(e,``);break}return r.replace(/(?:,\s*)+$/,``).replace(/^(?:,\s*)+/,``)}var Vt=v({name:`InspirationPills`,components:{FontAwesomeIcon:G},computed:{prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return zt.flatMap(e=>e.chipKeys.map(e=>this.$t(`kling.inspiration.chip.${e}`)))},selected(){let e=this.prompt;if(!e)return[];let t=[];for(let n of this.allChipTexts){let r=e.indexOf(n);r!==-1&&t.push({text:n,idx:r})}return t.sort((e,t)=>e.idx-t.idx).map(e=>e.text)}},methods:{onRemove(e){let t=$(this.prompt,e);this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:t})}}}),Ht={key:0,class:`pills`,role:`list`},Ut={class:`pill-text`},Wt=[`aria-label`,`onClick`];function Gt(n,r,u,d,f,p){let m=l(`font-awesome-icon`);return n.selected.length>0?(g(),s(`div`,Ht,[(g(!0),s(c,null,h(n.selected,r=>(g(),s(`div`,{key:r,class:`pill`,role:`listitem`},[e(`span`,Ut,i(r),1),e(`button`,{type:`button`,class:`pill-remove`,"aria-label":n.$t(`kling.inspiration.removeChip`),onClick:t(e=>n.onRemove(r),[`stop`])},[a(m,{icon:`fa-solid fa-xmark`})],8,Wt)]))),128))])):o(``,!0)}var Kt=v({name:`PromptInput`,components:{ElButton:P,FontAwesomeIcon:G,PromptTextarea:ve,InspirationPills:M(Vt,[[`render`,Gt],[`__scopeId`,`data-v-5fc4fa65`]])},emits:[`open-inspiration`],computed:{prompt:{get(){return this.$store.state.kling?.config?.prompt},set(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:e})}}},mounted(){this.prompt||=``}});function qt(e,t,n,o,s,c){let u=l(`font-awesome-icon`),d=l(`el-button`),m=l(`inspiration-pills`),h=l(`prompt-textarea`);return g(),f(h,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||=t=>e.prompt=t,title:e.$t(`kling.name.prompt`),info:e.$t(`kling.description.prompt`),placeholder:e.$t(`kling.placeholder.prompt`)},{actions:p(()=>[a(d,{text:``,size:`small`,class:`inspiration-btn`,onClick:t[0]||=t=>e.$emit(`open-inspiration`)},{default:p(()=>[a(u,{icon:`fa-regular fa-lightbulb`,class:`mr-1`}),r(` `+i(e.$t(`kling.inspiration.openButton`)),1)]),_:1})]),before:p(()=>[a(m)]),_:1},8,[`modelValue`,`title`,`info`,`placeholder`])}var Jt=M(Kt,[[`render`,qt],[`__scopeId`,`data-v-c01fc1a6`]]),Yt=v({name:`NegativePromptInput`,components:{ElInput:N,InfoIcon:J},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||=``}}),Xt={class:`field`},Zt={class:`box`},Qt={class:`title font-bold`};function $t(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,Xt,[e(`div`,Zt,[e(`h2`,Qt,i(t.$t(`kling.name.negativePrompt`)),1),a(d,{content:t.$t(`kling.description.negativePrompt`),class:`info`},null,8,[`content`])]),a(f,{modelValue:t.prompt,"onUpdate:modelValue":n[0]||=e=>t.prompt=e,rows:3,type:`textarea`,class:`prompt`,placeholder:t.$t(`kling.placeholder.negativePrompt`)},null,8,[`modelValue`,`placeholder`])])}var en=M(Yt,[[`render`,$t],[`__scopeId`,`data-v-de98cf01`]]),tn=v({name:`InspirationDrawer`,components:{ElDrawer:k,ElButton:P,FontAwesomeIcon:G},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`],data(){return{groups:zt,Close:y}},computed:{visible:{get(){return this.modelValue},set(e){this.$emit(`update:modelValue`,e)}},drawerSize(){return window.innerWidth<768?`100%`:`380px`},prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return this.groups.flatMap(e=>e.chipKeys.map(e=>this.$t(`kling.inspiration.chip.${e}`)))},selectedCount(){return this.allChipTexts.filter(e=>this.isSelected(e)).length}},methods:{chipText(e){return this.$t(`kling.inspiration.chip.${e}`)},isSelected(e){return e?this.prompt.includes(e):!1},setPrompt(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:e})},onToggle(e){e&&(this.isSelected(e)?this.setPrompt($(this.prompt,e)):this.setPrompt(Bt(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(let t of this.allChipTexts)for(;e.includes(t);)e=$(e,t);this.setPrompt(e)}}}),nn={class:`drawer-content`},rn={class:`drawer-header`},an={class:`title-row`},on={class:`title`},sn={class:`hint`},cn={key:0,class:`selected-bar`},ln={class:`selected-text`},un={class:`groups`},dn={class:`group-title`},fn={class:`chip-grid`},pn=[`onClick`];function mn(t,u,d,m,_,v){let y=l(`font-awesome-icon`),b=l(`el-button`),x=l(`el-drawer`);return g(),f(x,{modelValue:t.visible,"onUpdate:modelValue":u[1]||=e=>t.visible=e,direction:`rtl`,"with-header":!1,size:t.drawerSize,"custom-class":`kling-inspiration-drawer`,"destroy-on-close":!1},{default:p(()=>[e(`div`,nn,[e(`div`,rn,[e(`div`,an,[a(y,{icon:`fa-regular fa-lightbulb`,class:`mr-2`}),e(`span`,on,i(t.$t(`kling.inspiration.title`)),1)]),a(b,{text:``,icon:t.Close,class:`close-btn`,onClick:u[0]||=e=>t.visible=!1},null,8,[`icon`])]),e(`div`,sn,i(t.$t(`kling.inspiration.hint`)),1),t.selectedCount>0?(g(),s(`div`,cn,[e(`span`,ln,i(t.$t(`kling.inspiration.selectedSummary`,{count:t.selectedCount})),1),a(b,{text:``,size:`small`,class:`clear-btn`,onClick:t.onClearSelected},{default:p(()=>[r(i(t.$t(`kling.inspiration.clearSelected`)),1)]),_:1},8,[`onClick`])])):o(``,!0),e(`div`,un,[(g(!0),s(c,null,h(t.groups,r=>(g(),s(`div`,{key:r.groupKey,class:`group`},[e(`div`,dn,i(t.$t(`kling.inspiration.group.${r.groupKey}`)),1),e(`div`,fn,[(g(!0),s(c,null,h(r.chipKeys,e=>(g(),s(`button`,{key:e,type:`button`,class:n({chip:!0,active:t.isSelected(t.chipText(e))}),onClick:n=>t.onToggle(t.chipText(e))},i(t.chipText(e)),11,pn))),128))])]))),128))])])]),_:1},8,[`modelValue`,`size`])}var hn=M(tn,[[`render`,mn],[`__scopeId`,`data-v-7d457a69`]]),gn={"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`},_n={std:`720p`,pro:`1080p`,"4k":`4K`},vn=v({name:`SummaryChip`,components:{FontAwesomeIcon:G},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){let e=this.config?.model||`kling-v2-5-turbo`;return gn[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||``},modeLabel(){let e=this.config?.mode||`std`;return _n[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),yn={class:`summary-chip`},bn=[`title`],xn=[`title`],Sn=[`title`],Cn=[`title`],wn=[`title`];function Tn(t,n,r,c,u,d){let f=l(`font-awesome-icon`);return g(),s(`div`,yn,[e(`span`,{class:`part`,title:t.$t(`kling.name.model`)},i(t.modelLabel),9,bn),n[0]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.duration`)},i(t.durationLabel),9,xn),n[1]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.ratio`)},i(t.aspectRatio||`16:9`),9,Sn),n[2]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.mode`)},i(t.modeLabel),9,Cn),t.generateAudio?(g(),s(`span`,{key:0,class:`audio`,title:t.$t(`kling.name.generateAudio`)},[a(f,{icon:`fa-solid fa-headphones`})],8,wn)):o(``,!0)])}var En=v({name:`ConfigPanel`,components:{ElButton:P,Consumption:q,FontAwesomeIcon:G,PromptInput:Jt,NegativePromptInput:en,ModelSelector:Ae,ModeSelector:Le,DurationSelector:Ke,RatioSelector:$e,StartImage:ot,CfgScaleSelector:xt,GenerateAudioSelector:Ot,CameraControlSelector:Rt,InspirationDrawer:hn,SummaryChip:M(vn,[[`render`,Tn],[`__scopeId`,`data-v-418a6733`]]),EndImage:pt},emits:[`generate`],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},consumption(){return H(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),Dn={class:`flex flex-col h-full`},On={class:`flex-1 overflow-y-auto p-5`},kn={class:`flex flex-col items-center justify-center px-5 pb-5`};function An(t,n,o,c,u,d){let m=l(`prompt-input`),h=l(`model-selector`),_=l(`ratio-selector`),v=l(`start-image`),y=l(`end-image`),b=l(`duration-selector`),x=l(`mode-selector`),S=l(`generate-audio-selector`),C=l(`camera-control-selector`),w=l(`cfg-scale-selector`),T=l(`negative-prompt-input`),E=l(`summary-chip`),ee=l(`consumption`),D=l(`font-awesome-icon`),O=l(`el-button`),k=l(`inspiration-drawer`);return g(),s(`div`,Dn,[e(`div`,On,[a(m,{class:`mb-4`,onOpenInspiration:n[0]||=e=>t.inspirationOpen=!0}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-2`}),a(y,{class:`mb-2`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`})]),e(`div`,kn,[a(E),a(ee,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),t.config?.video_url!==void 0||t.config?.custom?(g(),f(O,{key:0,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(D,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.extend`)),1)]),_:1},8,[`onClick`])):(g(),f(O,{key:1,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(D,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.generate`)),1)]),_:1},8,[`onClick`]))]),a(k,{modelValue:t.inspirationOpen,"onUpdate:modelValue":n[1]||=e=>t.inspirationOpen=e},null,8,[`modelValue`])])}var jn=M(En,[[`render`,An]]),Mn=v({name:`MotionImage`,components:{ElUpload:w,ElButton:P,InfoIcon:J,FontAwesomeIcon:G,ImagePreview:K},mixins:[R,B],data(){return{fileList:[],uploadUrl:z()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetImageUrl()},methods:{onExceed(){F.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){F.error(this.$t(`kling.message.uploadReferencesError`))},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,image_url:void 0})},onSetImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,image_url:e})},async onSuccess(){this.onSetImageUrl()}}}),Nn={class:`relative`},Pn={class:`flex justify-between`},Fn={class:`flex justify-start items-center`},In={class:`text-sm font-bold`};function Ln(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,Nn,[e(`div`,Pn,[e(`div`,Fn,[e(`span`,In,i(t.$t(`kling.name.motionImage`)),1),a(h,{content:t.$t(`kling.description.motionImage`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Rn=M(Mn,[[`render`,Ln],[`__scopeId`,`data-v-e52eaf2f`]]),zn=v({name:`MotionVideo`,components:{ElUpload:w,ElButton:P,InfoIcon:J,FilePreview:ue,FontAwesomeIcon:G},mixins:[B],data(){return{fileList:[],uploadUrl:z()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetVideoUrl()},methods:{onExceed(){F.warning(this.$t(`kling.message.uploadVideoExceed`))},onError(){F.error(this.$t(`kling.message.uploadVideoError`))},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,video_url:void 0})},beforeUpload(e){let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=e.size/1024/1024<100;return t?n?!0:(F.error(this.$t(`kling.message.uploadVideoSizeExceed`)),!1):(F.error(this.$t(`kling.message.uploadVideoTypeFailed`)),!1)},onSetVideoUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,video_url:e})},async onSuccess(){this.onSetVideoUrl()}}}),Bn={class:`relative`},Vn={class:`flex justify-between`},Hn={class:`flex justify-start items-center`},Un={class:`text-sm font-bold`};function Wn(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,Bn,[e(`div`,Vn,[e(`div`,Hn,[e(`span`,Un,i(t.$t(`kling.name.motionVideo`)),1),a(h,{content:t.$t(`kling.description.motionVideo`)},null,8,[`content`])])]),a(b,{"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4,.mov`,name:`file`,class:`value`,"show-file-list":!0,limit:1,multiple:!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.percentage===void 0?o(``,!0):(g(),f(_,{key:0,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadVideoUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Gn=M(zn,[[`render`,Wn],[`__scopeId`,`data-v-7019a8d2`]]),Kn=v({name:`MotionPromptInput`,components:{ElInput:N,InfoIcon:J},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||``},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),qn={class:`field`},Jn={class:`box`},Yn={class:`title font-bold`};function Xn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,qn,[e(`div`,Jn,[e(`h2`,Yn,i(t.$t(`kling.name.motionPrompt`)),1),a(d,{content:t.$t(`kling.description.motionPrompt`),class:`info`},null,8,[`content`])]),a(f,{modelValue:t.prompt,"onUpdate:modelValue":n[0]||=e=>t.prompt=e,rows:3,type:`textarea`,class:`prompt`,placeholder:t.$t(`kling.placeholder.motionPrompt`)},null,8,[`modelValue`,`placeholder`])])}var Zn=M(Kn,[[`render`,Xn],[`__scopeId`,`data-v-ca9fdbe5`]]),Qn=`video`,$n=v({name:`CharacterOrientationSelector`,components:{ElRadioGroup:O,ElRadioButton:D,InfoIcon:J},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||Qn},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=Qn)}}),er={class:`field`},tr={class:`header`},nr={class:`text-sm font-bold`};function rr(t,n,o,c,u,d){let f=l(`info-icon`),m=l(`el-radio-button`),h=l(`el-radio-group`);return g(),s(`div`,er,[e(`div`,tr,[e(`span`,nr,i(t.$t(`kling.name.characterOrientation`)),1),a(f,{content:t.$t(`kling.description.characterOrientation`)},null,8,[`content`])]),a(h,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,size:`small`,class:`value`},{default:p(()=>[a(m,{label:`image`},{default:p(()=>[r(i(t.$t(`kling.name.orientationImage`)),1)]),_:1}),a(m,{label:`video`},{default:p(()=>[r(i(t.$t(`kling.name.orientationVideo`)),1)]),_:1})]),_:1},8,[`modelValue`])])}var ir=M($n,[[`render`,rr],[`__scopeId`,`data-v-7a91195b`]]),ar=`kling-v2-6`,or=v({name:`MotionModelSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:J},computed:{options(){return[{value:`kling-v2-6`,label:`Kling 2.6`},{value:`kling-v3`,label:`Kling 3.0`}]},value:{get(){return this.$store.state.kling?.motionConfig?.model_name||ar},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,model_name:e})}}},mounted(){this.$store.state.kling?.motionConfig?.model_name||(this.value=ar)}}),sr={class:`field`},cr={class:`header`},lr={class:`title font-bold`};function ur(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,sr,[e(`div`,cr,[e(`h2`,lr,i(t.$t(`kling.name.motionModel`)),1),a(m,{content:t.$t(`kling.description.motionModel`)},null,8,[`content`])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var dr=M(or,[[`render`,ur],[`__scopeId`,`data-v-480e8da2`]]),fr=`std`,pr=v({name:`MotionModeSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:J},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||fr},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=fr)}}),mr={class:`field`},hr={class:`header`},gr={class:`title font-bold`};function _r(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,mr,[e(`div`,hr,[e(`h2`,gr,i(t.$t(`kling.name.mode`)),1),a(m,{content:t.$t(`kling.description.motionMode`)},null,8,[`content`])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var vr=M(pr,[[`render`,_r],[`__scopeId`,`data-v-1295688c`]]),yr=v({name:`KeepOriginalSoundSelector`,components:{ElSwitch:ne,InfoIcon:J},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`})}}}}),br={class:`relative`},xr={class:`flex justify-between items-center`},Sr={class:`flex justify-start items-center`},Cr={class:`text-sm font-bold`};function wr(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,br,[e(`div`,xr,[e(`div`,Sr,[e(`span`,Cr,i(t.$t(`kling.name.keepOriginalSound`)),1),a(d,{content:t.$t(`kling.description.keepOriginalSound`)},null,8,[`content`])]),a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e},null,8,[`modelValue`])])])}var Tr=v({name:`MotionPanel`,components:{ElButton:P,FontAwesomeIcon:G,Consumption:q,MotionImage:Rn,MotionVideo:Gn,MotionPromptInput:Zn,CharacterOrientationSelector:ir,MotionModelSelector:dr,MotionModeSelector:vr,KeepOriginalSoundSelector:M(yr,[[`render`,wr]])},emits:[`generate`],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return H({...this.motionConfig,duration:1},this.service?.cost)},service(){return this.$store.state.kling?.service},canGenerate(){let e=this.motionConfig;return!!(e?.image_url&&e?.video_url)}},methods:{onGenerate(){this.$emit(`generate`)}}}),Er={class:`flex flex-col h-full`},Dr={class:`flex-1 overflow-y-auto p-5`},Or={class:`flex flex-col items-center justify-center px-5 pb-5`};function kr(t,n,o,c,u,d){let f=l(`motion-image`),m=l(`motion-video`),h=l(`motion-prompt-input`),_=l(`character-orientation-selector`),v=l(`motion-model-selector`),y=l(`motion-mode-selector`),b=l(`keep-original-sound-selector`),x=l(`consumption`),S=l(`font-awesome-icon`),C=l(`el-button`);return g(),s(`div`,Er,[e(`div`,Dr,[a(f,{class:`mb-3`}),a(m,{class:`mb-3`}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`})]),e(`div`,Or,[a(x,{value:t.consumption,service:t.service,"rate-unit":t.$t(`kling.name.perSecond`),note:t.$t(`kling.message.motionPricingNote`)},null,8,[`value`,`service`,`rate-unit`,`note`]),a(C,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(S,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.generateMotion`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var Ar=M(Tr,[[`render`,kr]]),jr=v({name:`KlingTabSwitcher`,components:{ElTabs:S,ElTabPane:C,ElTag:oe},props:{modelValue:{type:String,default:`videos`}},emits:[`update:modelValue`],computed:{tabs(){return[{value:`videos`,label:this.$t(`kling.tab.videoGeneration`)},{value:`motion`,label:this.$t(`kling.tab.motionControl`)},{value:`talking-photo`,label:this.$t(`kling.tab.talkingPhoto`)}]}},methods:{onUpdate(e){this.$emit(`update:modelValue`,e)}}}),Mr=[`title`],Nr={class:`text`};function Pr(t,n,a,u,d,m){let _=l(`el-tag`),v=l(`el-tab-pane`),y=l(`el-tabs`);return g(),f(y,{"model-value":t.modelValue,class:`kling-tabs`,stretch:``,"onUpdate:modelValue":t.onUpdate},{default:p(()=>[(g(!0),s(c,null,h(t.tabs,t=>(g(),f(v,{key:t.value,name:t.value,disabled:t.disabled},{label:p(()=>[e(`span`,{class:`tab-label`,title:t.disabled?t.disabledReason:void 0},[e(`span`,Nr,i(t.label),1),t.badge?(g(),f(_,{key:0,size:`small`,type:`warning`,class:`badge`},{default:p(()=>[r(i(t.badge),1)]),_:2},1024)):o(``,!0)],8,Mr)]),_:2},1032,[`name`,`disabled`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var Fr=M(jr,[[`render`,Pr],[`__scopeId`,`data-v-fda33e4c`]]),Ir={"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`},Lr=v({name:`TalkingPhotoModelSelector`,components:{ElSelect:b,ElOption:x},data(){return{options:ae.map(e=>({value:e,label:Ir[e]||e}))}},computed:{value:{get(){return this.$store.state.kling?.talkingPhotoConfig?.model||`kling-v2-1-master`},set(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.$store.state.kling?.talkingPhotoConfig,model:e})}}},mounted(){this.$store.state.kling?.talkingPhotoConfig?.model||(this.value=re)}}),Rr={class:`field`},zr={class:`title font-bold`};function Br(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Rr,[e(`h2`,zr,i(t.$t(`kling.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Vr=M(Lr,[[`render`,Br],[`__scopeId`,`data-v-cbc83d11`]]),Hr=v({name:`TalkingPhotoModeSelector`,components:{ElSelect:b,ElOption:x},computed:{options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`)},{value:`pro`,label:this.$t(`kling.name.modePro`)}]},value:{get(){return this.$store.state.kling?.talkingPhotoConfig?.mode||`pro`},set(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.$store.state.kling?.talkingPhotoConfig,mode:e})}}},mounted(){this.$store.state.kling?.talkingPhotoConfig?.mode||(this.value=`pro`)}}),Ur={class:`field`},Wr={class:`title font-bold`};function Gr(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Ur,[e(`h2`,Wr,i(t.$t(`kling.name.mode`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Kr=v({name:`TalkingPhotoPanel`,components:{ElUpload:w,ElButton:P,ElInput:N,FontAwesomeIcon:G,Consumption:q,InfoIcon:J,ImagePreview:K,ModelSelector:Vr,ModeSelector:M(Hr,[[`render`,Gr],[`__scopeId`,`data-v-92525a1d`]])},mixins:[B],emits:[`generate`],data(){return{imageFiles:[],audioFiles:[],uploadUrl:z()+`/api/v1/files/`}},computed:{config(){return this.$store.state.kling?.talkingPhotoConfig||{}},audioUrl(){return this.config.audio_url},headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},service(){return this.$store.state.kling?.service},consumption(){return H({...this.config,action:`talking-photo`},this.service?.cost)},canGenerate(){return!!(this.config.image_url&&this.config.audio_url)}},methods:{commit(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.config,...e})},onPromptChange(e){this.commit({prompt:e})},onImageExceed(){F.warning(this.$t(`kling.message.uploadReferencesExceed`))},onImageError(){F.error(this.$t(`kling.message.uploadReferencesError`))},onImageSuccess(e){this.commit({image_url:e?.file_url})},onImageRemove(e){this.imageFiles.splice(this.imageFiles.indexOf(e),1),this.commit({image_url:void 0})},onAudioExceed(){F.warning(this.$t(`kling.message.uploadAudioExceed`))},onAudioError(){F.error(this.$t(`kling.message.uploadAudioError`))},onAudioSuccess(e){this.commit({audio_url:e?.file_url})},onAudioRemove(){this.commit({audio_url:void 0})},onGenerate(){this.$emit(`generate`)}}}),qr={class:`flex flex-col h-full`},Jr={class:`flex-1 overflow-y-auto p-5`},Yr={class:`relative mb-4`},Xr={class:`flex justify-start items-center`},Zr={class:`text-sm font-bold`},Qr={class:`relative mb-4`},$r={class:`flex justify-start items-center`},ei={class:`text-sm font-bold`},ti=[`src`],ni={class:`mb-4`},ri={class:`flex justify-start items-center`},ii={class:`text-sm font-bold`},ai={class:`flex flex-col items-center justify-center px-5 pb-5`};function oi(t,n,c,u,d,m){let h=l(`model-selector`),_=l(`mode-selector`),v=l(`info-icon`),y=l(`image-preview`),b=l(`font-awesome-icon`),x=l(`el-button`),S=l(`el-upload`),C=l(`el-input`),w=l(`consumption`);return g(),s(`div`,qr,[e(`div`,Jr,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),e(`div`,Yr,[e(`div`,Xr,[e(`span`,Zr,i(t.$t(`kling.name.talkingPhotoImage`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoImage`)},null,8,[`content`])]),a(S,{ref:`imageUploader`,"file-list":t.imageFiles,"onUpdate:fileList":n[0]||=e=>t.imageFiles=e,name:`file`,accept:`.png,.jpg,.jpeg,.webp,.bmp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,headers:t.headers,"on-exceed":t.onImageExceed,"on-error":t.onImageError,"on-success":t.onImageSuccess},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(y,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onImageRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(x,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(b,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`])]),e(`div`,Qr,[e(`div`,$r,[e(`span`,ei,i(t.$t(`kling.name.talkingPhotoAudio`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoAudio`)},null,8,[`content`])]),a(S,{ref:`audioUploader`,"file-list":t.audioFiles,"onUpdate:fileList":n[1]||=e=>t.audioFiles=e,name:`file`,accept:`.mp3,.wav,.m4a,.aac`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,headers:t.headers,"on-exceed":t.onAudioExceed,"on-error":t.onAudioError,"on-success":t.onAudioSuccess,"on-remove":t.onAudioRemove},{default:p(()=>[a(x,{round:``,type:`primary`,size:`small`,class:`btn`},{default:p(()=>[a(b,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadAudio`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`,`on-remove`]),t.audioUrl?(g(),s(`audio`,{key:0,src:t.audioUrl,controls:``,class:`w-full mt-2`},null,8,ti)):o(``,!0)]),e(`div`,ni,[e(`div`,ri,[e(`span`,ii,i(t.$t(`kling.name.talkingPhotoPrompt`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoPrompt`)},null,8,[`content`])]),a(C,{"model-value":t.config.prompt,type:`textarea`,rows:2,placeholder:t.$t(`kling.placeholder.talkingPhotoPrompt`),class:`mt-1`,"onUpdate:modelValue":t.onPromptChange},null,8,[`model-value`,`placeholder`,`onUpdate:modelValue`])])]),e(`div`,ai,[a(w,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(x,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(b,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.generateTalkingPhoto`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var si=M(Kr,[[`render`,oi],[`__scopeId`,`data-v-27261e35`]]),ci=v({name:`TaskPreview`,components:{ElImage:E,CopyToClipboard:le,FontAwesomeIcon:G,ElAlert:ee,VideoPlayer:me,ElTooltip:T,ElButton:P,ImagePreview:K,ApiCodeButton:he},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},referenceImages(){let e=[],t=this.modelValue?.request?.start_image_url,n=this.modelValue?.request?.end_image_url;return t&&e.push({url:t,name:`start-image`}),n&&e.push({url:n,name:`end-image`}),e}},methods:{onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),li={class:`preview`},ui={class:`left`},di={class:`main`},fi={class:`bot`},pi={class:`datetime`},mi={class:`info`},hi={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},gi={key:1,class:`prompt mt-2`},_i={key:0},vi={key:1},yi={key:0,class:n({content:!0,failed:!0})},bi={key:0,class:`mb-4`},xi={key:1,class:n({operations:!0,"mt-2":!0})},Si={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ci={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},wi={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Ti={key:1,class:n({content:!0})},Ei={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Di={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Oi={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ki={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Ai={key:2,class:n({content:!0})},ji={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Mi={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Ni(t,n,u,d,m,_){let v=l(`el-image`),y=l(`image-preview`),b=l(`video-player`),x=l(`el-button`),S=l(`el-tooltip`),C=l(`api-code-button`),w=l(`font-awesome-icon`),T=l(`copy-to-clipboard`),E=l(`el-alert`);return g(),s(`div`,li,[e(`div`,ui,[a(v,{src:`https://cdn.acedata.cloud/qpbbbb.jpg`,class:`avatar`})]),e(`div`,di,[e(`div`,fi,[r(i(t.$t(`kling.name.klingBot`))+` `,1),e(`span`,pi,i(t.$dayjs.format(``+new Date(parseFloat((t.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,mi,[t.referenceImages.length>0?(g(),s(`div`,hi,[(g(!0),s(c,null,h(t.referenceImages,(e,t)=>(g(),f(y,{key:t,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),t.modelValue?.request?.prompt?(g(),s(`p`,gi,[r(i(t.modelValue?.request?.prompt)+` `,1),t.modelValue?.response?o(``,!0):(g(),s(`span`,_i,` - (`+i(t.$t(`kling.status.pending`))+`) `,1)),t.modelValue?.response?.state===`submitted`||t.modelValue?.response?.state===`processing`||t.modelValue?.response?.state===`pending`||t.modelValue?.response?.state===`completed`?(g(),s(`span`,vi,` - (`+i(t.$t(`kling.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),t.modelValue?.response?.success===!0?(g(),s(`div`,yi,[t.modelValue?.response.video_url?(g(),s(`div`,bi,[a(b,{src:t.modelValue?.response.video_url},null,8,[`src`])])):o(``,!0),t.modelValue?.response.success?(g(),s(`div`,xi,[a(S,{class:`box-item`,effect:`dark`,content:t.$t(`kling.message.downloadVideo`),placement:`top-start`},{default:p(()=>[t.modelValue?.response.video_url?(g(),f(x,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:n[0]||=e=>t.onDownload(e,t.modelValue?.response.video_url)},{default:p(()=>[r(i(t.$t(`kling.button.download`)),1)]),_:1})):o(``,!0)]),_:1},8,[`content`]),a(C,{path:`/kling/videos`,body:t.modelValue?.request},null,8,[`body`])])):o(``,!0),a(E,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,Si,[a(w,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.model`))+`: `+i(t.modelValue?.request?.model),1)]),e(`p`,Ci,[a(w,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(T,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.elapsed?(g(),s(`p`,wi,[a(w,{icon:`fa-solid fa-clock`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.elapsed`))+`: `+i(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),t.modelValue?.response?.success===!1?(g(),s(`div`,Ti,[a(E,{closable:!1,class:`failure`},{template:p(()=>[a(w,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,Ei,[a(w,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(T,{content:t.modelValue?.id},null,8,[`content`])]),e(`p`,Di,[a(w,{icon:`fa-solid fa-circle-info`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.failureReason`))+`: `+i(t.modelValue?.response?.error?.message)+` `,1),a(T,{content:t.modelValue?.response?.error?.message},null,8,[`content`])]),t.modelValue?.elapsed?(g(),s(`p`,Oi,[a(w,{icon:`fa-solid fa-clock`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.elapsed`))+`: `+i(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),t.modelValue?.response?.trace_id?(g(),s(`p`,ki,[a(w,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.traceId`))+`: `+i(t.modelValue?.response?.trace_id)+` `,1),a(T,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),t.modelValue?.response?.success===void 0?(g(),s(`div`,Ai,[a(E,{closable:!1,class:`info`},{template:p(()=>[a(w,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,ji,[a(w,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(T,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.response?.trace_id?(g(),s(`p`,Mi,[a(w,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.traceId`))+`: `+i(t.modelValue?.response?.trace_id)+` `,1),a(T,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var Pi=v({name:`RecentPanel`,components:{TaskPreview:M(ci,[[`render`,Ni],[`__scopeId`,`data-v-c36bfd7f`]]),NoTasks:_e,BotPlaceholder:ge,ScrollList:fe},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?.()}}}),Fi={key:0},Ii={key:2,class:`w-full h-full flex items-center justify-center`};function Li(e,t,n,r,i,u){let d=l(`bot-placeholder`),m=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return g(),s(c,null,[e.tasks?.items===void 0?(g(),s(`div`,Fi,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`h-full w-full overflow-y-auto tasks`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,e=>(g(),f(m,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,Ii,[a(v)])):o(``,!0)],64)}var Ri=v({name:`KlingIndex`,components:{ConfigPanel:jn,MotionPanel:Ar,TalkingPhotoPanel:si,TabSwitcher:Fr,Layout:we,RecentPanel:M(Pi,[[`render`,Li]])},mixins:[ce],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===se.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===se.Request||this.fetchingTasks},credential(){return this.$store.state.kling.credential},config(){return this.$store.state.kling.config},motionConfig(){return this.$store.state.kling.motionConfig},talkingPhotoConfig(){return this.$store.state.kling.talkingPhotoConfig},taskType(){return this.$store.state.kling.taskType||`videos`},tasks(){return this.$store.state.kling.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await pe({tasks:this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`kling/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`kling/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`kling/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!U(this.uploadTracker,e=>this.$t(e),e=>F.warning(e)))return;let{camera_control:e,...t}=this.config||{},n={...t,async:!0};if(!n.video_id&&!t.video_url&&!n.start_image_url&&n.end_image_url){F.warning(this.$t(`kling.message.endImageRequiresStart`));return}if(n.action||(n.video_id||t.video_url?n.action=`extend`:n.start_image_url?n.action=`image2video`:n.action=`text2video`),n.action===`text2video`&&n.end_image_url&&delete n.end_image_url,e?.type&&(n.camera_control={type:e.type,...e.type===`simple`&&e.config?{config:Object.fromEntries(Object.entries(e.config).filter(([,e])=>e!=null))}:{}}),!L())return;let r=this.credential?.token;if(!r){console.error(`no token specified`);return}F.info(this.$t(`kling.message.startingTask`)),I(`kling`,V.generate(n,{token:r})).then(()=>{F.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?F.error(this.$t(`kling.message.usedUp`)):F.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},async onTabChange(e){e!==this.taskType&&(await this.$store.dispatch(`kling/setTaskType`,e),await this.onGetTasks(),await this.onScrollDown())},async onGenerateMotion(){if(!U(this.uploadTracker,e=>this.$t(e),e=>F.warning(e)))return;let e=this.motionConfig||{};if(!e.image_url||!e.video_url){F.warning(this.$t(`kling.message.motionMissingInputs`));return}let t={image_url:e.image_url,video_url:e.video_url,character_orientation:e.character_orientation||`video`,mode:e.mode||`std`,keep_original_sound:e.keep_original_sound??`yes`,...e.model_name?{model_name:e.model_name}:{},...e.prompt?{prompt:e.prompt}:{},async:!0};if(!L())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}F.info(this.$t(`kling.message.startingTask`)),I(`kling`,V.motion(t,{token:n})).then(()=>{F.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?F.error(this.$t(`kling.message.usedUp`)):F.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},async onGenerateTalkingPhoto(){if(!U(this.uploadTracker,e=>this.$t(e),e=>F.warning(e)))return;let e=this.talkingPhotoConfig||{};if(!e.image_url||!e.audio_url){F.warning(this.$t(`kling.message.talkingPhotoMissingInputs`));return}let t={image_url:e.image_url,audio_url:e.audio_url,model:e.model||`kling-v2-1-master`,mode:e.mode||`pro`,...e.prompt?{prompt:e.prompt}:{},...e.duration?{duration:e.duration}:{},async:!0};if(!L())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}F.info(this.$t(`kling.message.startingTask`)),I(`kling`,V.talkingPhoto(t,{token:n})).then(()=>{F.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?F.error(this.$t(`kling.message.usedUp`)):F.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),zi={class:`flex flex-col h-full`},Bi={class:`flex-1 min-h-0`};function Vi(t,n,r,i,s,c){let u=l(`tab-switcher`),d=l(`config-panel`),m=l(`motion-panel`),h=l(`talking-photo-panel`),_=l(`recent-panel`),v=l(`layout`);return g(),f(v,null,{config:p(()=>[e(`div`,zi,[a(u,{"model-value":t.taskType,"onUpdate:modelValue":t.onTabChange},null,8,[`model-value`,`onUpdate:modelValue`]),e(`div`,Bi,[t.taskType===`videos`?(g(),f(d,{key:0,onGenerate:t.onGenerate},null,8,[`onGenerate`])):t.taskType===`motion`?(g(),f(m,{key:1,onGenerate:t.onGenerateMotion},null,8,[`onGenerate`])):t.taskType===`talking-photo`?(g(),f(h,{key:2,onGenerate:t.onGenerateTalkingPhoto},null,8,[`onGenerate`])):o(``,!0)])])]),result:p(()=>[a(_,{ref:`recentPanel`,loading:t.loadingMore,onReachTop:t.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Hi=M(Ri,[[`render`,Vi]]);export{Hi as default};
@@ -1 +1 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{r as y,t as b}from"./select-B_-3KyEB.js";import{t as x}from"./upload-Ds4fmX2d.js";import{t as S}from"./tooltip-ksHy3iJa.js";import{t as C}from"./image-6n1LQxCR.js";import{t as w}from"./alert-D6tngQg7.js";import{t as T}from"./drawer-Cp4thqzF.js";import{t as E}from"./input-number-42kKySdV.js";import{t as D}from"./switch-Q2akgFXQ.js";import{$t as O,Bt as k,Gt as A,Ht as ee,It as te,Jt as ne,Kt as j,Lt as M,Qt as N,Ut as P,Vt as re,Wt as ie,Xt as ae,Yt as oe,Zt as se,en as F,qt as ce,rn as I,tn as L,zt as R}from"./constants-B_ksgMZ4.js";import{Fi as z,G as B,Ln as V,hn as H,in as U,nn as W,on as G,pi as K,rn as le,tn as ue,ui as q,wi as J,wr as de}from"./index-Ds_KzrLo.js";import{t as Y}from"./index.es-CU4g6R5J.js";import{t as fe}from"./CopyToClipboard-rXAbbH4m.js";import{t as X}from"./ImagePreview-DKaradFQ.js";import{n as pe}from"./taskDrawerMixin-DyAUhFEq.js";import{t as me}from"./Consumption-C3ZK4cM5.js";import{i as Z,n as he,t as ge}from"./pagination-ZQWSP4gt.js";import{t as _e}from"./VideoPlayer-BekTLAwb.js";import{t as ve}from"./ApiCodeButton-BOIv_zXn.js";import{t as ye}from"./BotPlaceholder-CWWfEeRX.js";import{t as be}from"./NoTasks-DA2uJz0D.js";import{t as xe}from"./PromptTextarea-DD5-6B1R.js";import{t as Se}from"./ImageWrapper-CzCa4TRI.js";import{n as Ce,t as we}from"./VideoPreview-j7KQrVdN.js";var Te=v({name:`LayoutSeedance`,components:{ElDrawer:T,ElButton:z,FontAwesomeIcon:Y},mixins:[pe]}),Ee={class:`main flex flex-row flex-1`},De={class:`config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Oe={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function ke(t,n,r,i,o,c){let f=l(`font-awesome-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Ee,[e(`div`,De,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Oe,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{icon:`fa-solid fa-magic`})]),_:1},512),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`350px`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Ae=B(Te,[[`render`,ke],[`__scopeId`,`data-v-ec312952`]]),je=v({name:`SeedancePromptInput`,components:{PromptTextarea:xe},computed:{prompt:{get(){return this.$store.state.seedance?.config?.prompt},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Me(e,t,n,r,i,a){let o=l(`prompt-textarea`);return g(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`seedance.name.prompt`),info:e.$t(`seedance.description.prompt`),placeholder:e.$t(`seedance.placeholder.prompt`),"min-rows":5},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ne=B(je,[[`render`,Me]]),Pe=v({name:`SeedanceModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Z},data(){return{options:[{value:A,label:this.$t(`seedance.model.seedance20`)},{value:j,label:this.$t(`seedance.model.seedance20Fast`)},{value:ce,label:this.$t(`seedance.model.seedance20Mini`)},{value:ie,label:this.$t(`seedance.model.seedance15pro`)},{value:ee,label:this.$t(`seedance.model.seedance10pro`)},{value:P,label:this.$t(`seedance.model.seedance10proFast`)},{value:re,label:this.$t(`seedance.model.seedance10liteT2v`)},{value:k,label:this.$t(`seedance.model.seedance10liteI2v`)}]}},computed:{value:{get(){return this.$store.state.seedance?.config?.model},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,model:e})}}},mounted(){this.value||=te}}),Fe={class:`field`},Ie={class:`label`},Le={class:`box`},Re={class:`title font-bold`};function ze(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Fe,[e(`div`,Ie,[e(`div`,Le,[e(`h2`,Re,i(t.$t(`seedance.name.model`)),1),a(m,{content:t.$t(`seedance.description.model`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedance.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Be=B(Pe,[[`render`,ze],[`__scopeId`,`data-v-deb4c429`]]),Ve=v({name:`SeedanceDurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Z},computed:{model(){return this.$store.state.seedance?.config?.model},capability(){return I(this.model)},options(){let e=[];this.capability.supportsAutoDuration&&e.push({value:-1,label:`${this.$t(`seedance.placeholder.seed`)} (-1)`});for(let t=this.capability.minDuration;t<=this.capability.maxDuration;t++)e.push({value:t,label:`${t}s`});return e},value:{get(){return this.$store.state.seedance?.config?.duration},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,duration:e})}}},watch:{model(){this.clampValue()}},mounted(){this.value?this.clampValue():this.value=5},methods:{clampValue(){let e=this.value;e!==void 0&&!(e===-1&&this.capability.supportsAutoDuration)&&(e<this.capability.minDuration||e>this.capability.maxDuration)&&(this.value=5)}}}),He={class:`field`},Ue={class:`label`},We={class:`box`},Ge={class:`title font-bold`};function Ke(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,He,[e(`div`,Ue,[e(`div`,We,[e(`h2`,Ge,i(t.$t(`seedance.name.duration`)),1),a(m,{content:t.$t(`seedance.description.duration`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedance.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var qe=B(Ve,[[`render`,Ke],[`__scopeId`,`data-v-d61cc21b`]]),Q={[F]:0,[L]:1,[O]:2,"4k":3},Je=v({name:`SeedanceResolutionSelector`,components:{InfoIcon:Z,ElTooltip:S},computed:{model(){return this.$store.state.seedance?.config?.model},capability(){return I(this.model)},options(){let e=[{value:F,label:`480p`},{value:L,label:`720p`},{value:O,label:`1080p`},{value:`4k`,label:`4k`}],t=Q[this.capability.maxResolution]??Q[`1080p`];return e.map(e=>({...e,disabled:Q[e.value]>t}))},value:{get(){return this.$store.state.seedance?.config?.resolution},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,resolution:e})}}},watch:{model(){this.clampValue()}},mounted(){this.value?this.clampValue():this.value=this.capability.defaultResolution||`720p`},methods:{onSelect(e){e.disabled||(this.value=e.value)},clampValue(){let e=this.value,t=this.options.find(t=>t.value===e);(!e||t&&t.disabled)&&(this.value=this.capability.defaultResolution||`720p`)}}}),Ye={class:`resolution`},Xe={class:`header`},Ze={class:`title font-bold`},Qe={class:`items`},$e=[`onClick`];function et(t,r,o,u,d,m){let _=l(`info-icon`),v=l(`el-tooltip`);return g(),s(`div`,Ye,[e(`div`,Xe,[e(`h2`,Ze,i(t.$t(`seedance.name.resolution`)),1),a(_,{content:t.$t(`seedance.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,Qe,[(g(!0),s(c,null,h(t.options,r=>(g(),f(v,{key:r.value,content:t.$t(`seedance.message.resolutionNotSupported`),disabled:!r.disabled,placement:`top`},{default:p(()=>[e(`div`,{class:n([`item`,{active:t.value===r.value,disabled:r.disabled}]),onClick:e=>t.onSelect(r)},i(r.label),11,$e)]),_:2},1032,[`content`,`disabled`]))),128))])])}var tt=B(Je,[[`render`,et],[`__scopeId`,`data-v-db7e8aff`]]),nt=v({name:`SeedanceRatioSelector`,components:{InfoIcon:Z},computed:{options(){return[{value:oe,label:`16:9`,w:32,h:18},{value:se,label:`9:16`,w:18,h:32},{value:`4:3`,label:`4:3`,w:28,h:21},{value:`3:4`,label:`3:4`,w:21,h:28},{value:`1:1`,label:`1:1`,w:24,h:24},{value:ae,label:`21:9`,w:34,h:14},{value:N,label:this.$t(`seedance.ratio.adaptive`),w:0,h:0}]},value:{get(){return this.$store.state.seedance?.config?.ratio},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,ratio:e})}}},mounted(){this.value||=M}}),rt={class:`ratio`},it={class:`header`},at={class:`title font-bold`},ot={class:`items`},st=[`onClick`],ct={class:`preview`},lt={key:1,class:`rect rect-auto`},ut={class:`name`};function dt(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,rt,[e(`div`,it,[e(`h2`,at,i(t.$t(`seedance.name.ratio`)),1),a(p,{content:t.$t(`seedance.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,ot,[(g(!0),s(c,null,h(t.options,r=>(g(),s(`div`,{key:r.value,class:n([`item`,{active:t.value===r.value}]),onClick:e=>t.value=r.value},[e(`div`,ct,[r.w&&r.h?(g(),s(`div`,{key:0,class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)):(g(),s(`div`,lt,`A`))]),e(`div`,ut,i(r.label),1)],10,st))),128))])])}var ft=B(nt,[[`render`,dt],[`__scopeId`,`data-v-8ddec2dd`]]),pt=v({name:`SeedanceGenerateAudioSwitch`,components:{ElSwitch:D,InfoIcon:Z},computed:{isSupported(){let e=this.$store.state.seedance?.config?.model;return I(e).acceptsAudio},value:{get(){return this.$store.state.seedance?.config?.generate_audio??!1},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,generate_audio:e})}}},watch:{isSupported(e){!e&&this.value&&(this.value=!1)}},mounted(){this.value===void 0&&(this.value=!1)}}),mt={key:0,class:`field`},ht={class:`label`},gt={class:`box`},_t={class:`title font-bold`},vt={class:`value`};function yt(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,mt,[e(`div`,ht,[e(`div`,gt,[e(`h2`,_t,i(t.$t(`seedance.name.generateAudio`)),1),a(f,{content:t.$t(`seedance.description.generateAudio`),class:`info`},null,8,[`content`])])]),e(`div`,vt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])):o(``,!0)}var bt=B(pt,[[`render`,yt],[`__scopeId`,`data-v-df51dfbd`]]),xt=v({name:`SeedanceCameraFixedSwitch`,components:{ElSwitch:D,InfoIcon:Z},computed:{value:{get(){return this.$store.state.seedance?.config?.camerafixed??!1},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,camerafixed:e})}}},mounted(){this.$store.state.seedance?.config?.camerafixed===void 0&&(this.value=!1)}}),St={class:`field`},Ct={class:`label`},wt={class:`box`},Tt={class:`title font-bold`},Et={class:`value`};function Dt(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,St,[e(`div`,Ct,[e(`div`,wt,[e(`h2`,Tt,i(t.$t(`seedance.name.cameraFixed`)),1),a(d,{content:t.$t(`seedance.description.cameraFixed`),class:`info`},null,8,[`content`])])]),e(`div`,Et,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])}var Ot=B(xt,[[`render`,Dt],[`__scopeId`,`data-v-ae777d61`]]),kt=v({name:`SeedanceFirstFrameImage`,components:{ElUpload:x,ElButton:z,InfoIcon:Z,FontAwesomeIcon:Y,ImagePreview:X},mixins:[U,W],data(){return{fileList:[],uploadUrl:K()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return I(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsImage"(e){e||(this.fileList=[],this.onSetFirstFrameUrl())}},methods:{onExceed(){J.warning(this.$t(`seedance.message.uploadExceed`))},onError(){J.error(this.$t(`seedance.message.uploadError`))},onSetFirstFrameUrl(){let e=this.urls?.[0],t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`first_frame`);e&&t.push({url:e,role:`first_frame`}),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetFirstFrameUrl()},async onRemove(){this.onSetFirstFrameUrl()}}}),At={key:0,class:`relative`},jt={class:`flex justify-between`},Mt={class:`flex justify-start items-center`},Nt={class:`text-sm font-bold`},Pt={key:0,class:`required-badge`};function Ft(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-upload`);return t.capability.acceptsImage?(g(),s(`div`,At,[e(`div`,jt,[e(`div`,Mt,[e(`span`,Nt,i(t.$t(`seedance.name.firstFrame`)),1),t.capability.requiresImage?(g(),s(`span`,Pt,i(t.$t(`seedance.name.required`)),1)):o(``,!0),a(h,{content:t.$t(`seedance.description.firstFrame`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var It=B(kt,[[`render`,Ft],[`__scopeId`,`data-v-e2597f23`]]),Lt=v({name:`SeedanceLastFrameImage`,components:{ElUpload:x,ElButton:z,ImagePreview:X,InfoIcon:Z,FontAwesomeIcon:Y},mixins:[U,W],data(){return{fileList:[],uploadUrl:K()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return I(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsLastFrame"(e){e||(this.fileList=[],this.onSetLastFrameUrl())}},methods:{onExceed(){J.warning(this.$t(`seedance.message.uploadExceed`))},onError(){J.error(this.$t(`seedance.message.uploadError`))},onSetLastFrameUrl(){let e=this.urls?.[0],t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`last_frame`);e&&t.push({url:e,role:`last_frame`}),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetLastFrameUrl()},async onRemove(){this.onSetLastFrameUrl()}}}),Rt={key:0,class:`relative`},zt={class:`flex justify-between`},Bt={class:`flex justify-start items-center`},Vt={class:`text-sm font-bold`};function Ht(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-upload`);return t.capability.acceptsLastFrame?(g(),s(`div`,Rt,[e(`div`,zt,[e(`div`,Bt,[e(`span`,Vt,i(t.$t(`seedance.name.lastFrame`)),1),a(h,{content:t.$t(`seedance.description.lastFrame`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var Ut=B(Lt,[[`render`,Ht],[`__scopeId`,`data-v-3a191e51`]]),Wt=v({name:`SeedanceReferenceImage`,components:{ElUpload:x,ElButton:z,InfoIcon:Z,FontAwesomeIcon:Y,ImagePreview:X},mixins:[U,W],data(){return{fileList:[],uploadUrl:K()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return I(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceImage"(e){e||(this.fileList=[],this.onSetReferenceImageUrls())}},methods:{onExceed(){J.warning(this.$t(`seedance.message.uploadExceed`))},onError(){J.error(this.$t(`seedance.message.uploadError`))},onSetReferenceImageUrls(){let e=(this.urls||[]).filter(Boolean),t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`reference_image`);e.forEach(e=>t.push({url:e,role:`reference_image`})),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetReferenceImageUrls()},async onRemove(){this.onSetReferenceImageUrls()}}}),Gt={key:0,class:`relative`},Kt={class:`flex justify-between`},qt={class:`flex justify-start items-center`},Jt={class:`text-sm font-bold`};function Yt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-upload`);return t.capability.acceptsReferenceImage?(g(),s(`div`,Gt,[e(`div`,Kt,[e(`div`,qt,[e(`span`,Jt,i(t.$t(`seedance.name.referenceImage`)),1),a(h,{content:t.$t(`seedance.description.referenceImage`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var Xt=B(Wt,[[`render`,Yt],[`__scopeId`,`data-v-230a67f6`]]),Zt=v({name:`SeedanceReferenceAudio`,components:{ElUpload:x,ElButton:z,InfoIcon:Z,FontAwesomeIcon:Y},mixins:[W],data(){return{fileList:[],uploadUrl:K()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return I(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceAudio"(e){e||(this.fileList=[],this.onSetReferenceAudios())}},methods:{onExceed(){J.warning(this.$t(`seedance.message.uploadExceed`))},onError(){J.error(this.$t(`seedance.message.uploadError`))},onSetReferenceAudios(){let e=(this.urls||[]).filter(Boolean);this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,audios:e.length>0?e.map(e=>({url:e})):void 0})},async onSuccess(){this.onSetReferenceAudios()},async onRemove(){this.onSetReferenceAudios()}}}),Qt={key:0,class:`relative`},$t={class:`flex justify-between`},en={class:`flex justify-start items-center`},tn={class:`text-sm font-bold`};function nn(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`font-awesome-icon`),_=l(`el-button`),v=l(`el-upload`);return t.capability.acceptsReferenceAudio?(g(),s(`div`,Qt,[e(`div`,$t,[e(`div`,en,[e(`span`,tn,i(t.$t(`seedance.name.referenceAudio`)),1),a(m,{content:t.$t(`seedance.description.referenceAudio`)},null,8,[`content`])])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp3,.wav,.m4a,.aac,.ogg,.flac`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`text`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(h,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var rn=B(Zt,[[`render`,nn],[`__scopeId`,`data-v-49515675`]]),an=v({name:`SeedanceReferenceVideo`,components:{ElUpload:x,ElButton:z,InfoIcon:Z,FontAwesomeIcon:Y},mixins:[W],data(){return{fileList:[],uploadUrl:K()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return I(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceVideo"(e){e||(this.fileList=[],this.onSetReferenceVideos())}},methods:{onExceed(){J.warning(this.$t(`seedance.message.uploadExceed`))},onError(){J.error(this.$t(`seedance.message.uploadError`))},onSetReferenceVideos(){let e=(this.urls||[]).filter(Boolean);this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,videos:e.length>0?e.map(e=>({url:e})):void 0})},async onSuccess(){this.onSetReferenceVideos()},async onRemove(){this.onSetReferenceVideos()}}}),on={key:0,class:`relative`},sn={class:`flex justify-between`},cn={class:`flex justify-start items-center`},ln={class:`text-sm font-bold`};function un(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`font-awesome-icon`),_=l(`el-button`),v=l(`el-upload`);return t.capability.acceptsReferenceVideo?(g(),s(`div`,on,[e(`div`,sn,[e(`div`,cn,[e(`span`,ln,i(t.$t(`seedance.name.referenceVideo`)),1),a(m,{content:t.$t(`seedance.description.referenceVideo`)},null,8,[`content`])])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp4,.mov,.webm,.mkv,.avi`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`text`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(h,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var dn=B(an,[[`render`,un],[`__scopeId`,`data-v-b212c474`]]),fn=v({name:`SeedanceReturnLastFrameSwitch`,components:{ElSwitch:D,InfoIcon:Z},computed:{model(){return this.$store.state.seedance?.config?.model},isSupported(){return I(this.model).acceptsReturnLastFrame},value:{get(){return this.$store.state.seedance?.config?.return_last_frame},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,return_last_frame:e})}}},watch:{isSupported(e){!e&&this.value&&(this.value=!1)}},mounted(){this.value===void 0&&(this.value=!1)}}),pn={key:0,class:`field`},mn={class:`label`},hn={class:`box`},gn={class:`title font-bold`},_n={class:`value`};function vn(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,pn,[e(`div`,mn,[e(`div`,hn,[e(`h2`,gn,i(t.$t(`seedance.name.returnLastFrame`)),1),a(f,{content:t.$t(`seedance.description.returnLastFrame`),class:`info`},null,8,[`content`])])]),e(`div`,_n,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])):o(``,!0)}var yn=B(fn,[[`render`,vn],[`__scopeId`,`data-v-edea5451`]]),bn=v({name:`SeedanceSeedInput`,components:{ElInputNumber:E,InfoIcon:Z},computed:{value:{get(){let e=this.$store.state.seedance?.config?.seed;return typeof e==`number`?e:-1},set(e){let t={...this.$store.state.seedance?.config||{}};t.seed=typeof e==`number`&&Number.isInteger(e)?e:-1,this.$store.commit(`seedance/setConfig`,t)}}}}),xn={class:`field`},Sn={class:`label`},Cn={class:`box`},wn={class:`title font-bold`},Tn={class:`value`};function En(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input-number`);return g(),s(`div`,xn,[e(`div`,Sn,[e(`div`,Cn,[e(`h2`,wn,i(t.$t(`seedance.name.seed`)),1),a(d,{content:t.$t(`seedance.description.seed`),class:`info`},null,8,[`content`])])]),e(`div`,Tn,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:-1,max:2147483647,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])}var Dn=v({name:`SeedanceConfigPanel`,components:{ElButton:z,FontAwesomeIcon:Y,PromptInput:Ne,ModelSelector:Be,DurationSelector:qe,ResolutionSelector:tt,RatioSelector:ft,GenerateAudioSwitch:bt,CameraFixedSwitch:Ot,ReturnLastFrameSwitch:yn,SeedInput:B(bn,[[`render`,En],[`__scopeId`,`data-v-685a9869`]]),FirstFrameImage:It,LastFrameImage:Ut,ReferenceImage:Xt,ReferenceAudio:rn,ReferenceVideo:dn,Consumption:me},emits:[`generate`],computed:{config(){return this.$store.state.seedance?.config},consumption(){return G(this.config,this.service?.cost)},service(){return this.$store.state.seedance?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),On={class:`flex flex-col h-full`},kn={class:`flex-1 overflow-y-auto p-5`},An={class:`flex flex-col items-center justify-center px-5 pb-5`};function jn(t,n,o,c,u,d){let f=l(`prompt-input`),m=l(`model-selector`),h=l(`ratio-selector`),_=l(`resolution-selector`),v=l(`duration-selector`),y=l(`generate-audio-switch`),b=l(`camera-fixed-switch`),x=l(`return-last-frame-switch`),S=l(`seed-input`),C=l(`first-frame-image`),w=l(`last-frame-image`),T=l(`reference-image`),E=l(`reference-audio`),D=l(`reference-video`),O=l(`consumption`),k=l(`font-awesome-icon`),A=l(`el-button`);return g(),s(`div`,On,[e(`div`,kn,[a(f,{class:`mb-4`}),a(m,{class:`mb-4`}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-2`}),a(w,{class:`mb-2`}),a(T,{class:`mb-2`}),a(E,{class:`mb-2`}),a(D,{class:`mb-2`})]),e(`div`,An,[a(O,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(A,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(k,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`seedance.button.generate`)),1)]),_:1},8,[`onClick`])])])}var Mn=B(Dn,[[`render`,jn]]),Nn=v({name:`SeedanceTaskPreview`,components:{ElImage:C,CopyToClipboard:fe,FontAwesomeIcon:Y,ElAlert:w,VideoPlayer:_e,ElTooltip:S,ElButton:z,ImageWrapper:Se,ImagePreview:X,AudioPreview:Ce,VideoPreview:we,ApiCodeButton:ve},props:{modelValue:{type:Object,required:!0}},data(){return{seedanceLogo:R}},computed:{video(){return this.modelValue?.response?.data},apiCodeBody(){let e=this.modelValue?.request;if(!e)return e;let{service_tier:t,...n}=e;return n},promptText(){let e=this.modelValue?.request;if(e?.prompt)return e.prompt;let t=e?.content?.find(e=>e?.type===`text`&&e?.text);return t?.text?t.text:this.video?.prompt},referenceImages(){let e=this.collectImages();if(e.length===0)return[];let t=[],n=e.find(e=>e?.role===`first_frame`);n?.url&&t.push({url:n.url,name:`first-frame`});let r=e.find(e=>e?.role===`last_frame`);return r?.url&&t.push({url:r.url,name:`last-frame`}),e.forEach((e,n)=>{e?.url&&e.role!==`first_frame`&&e.role!==`last_frame`&&t.push({url:e.url,name:e.role||`image-${n}`})}),t},referenceAudios(){let e=this.modelValue?.request,t=(e?.audios??[]).map(e=>e?.url).filter(Boolean);return(e?.content??[]).forEach(e=>{e?.type===`audio_url`&&e?.audio_url?.url&&t.push(e.audio_url.url)}),t},referenceVideos(){let e=this.modelValue?.request,t=(e?.videos??[]).map(e=>e?.url).filter(Boolean);return(e?.content??[]).forEach(e=>{e?.type===`video_url`&&e?.video_url?.url&&t.push(e.video_url.url)}),t}},methods:{collectImages(){let e=this.modelValue?.request,t=Array.isArray(e?.images)?[...e.images]:[];return(e?.content??[]).forEach(e=>{e?.type===`image_url`&&e?.image_url?.url&&t.push({url:e.image_url.url,role:e.role})}),t},onDownload(e){window.open(e,`_blank`)}}}),Pn={class:`preview`},Fn={class:`left`},In={class:`main`},Ln={class:`bot`},Rn={class:`datetime`},zn={class:`info`},Bn={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Vn={key:1,class:`prompt mt-2`},Hn={key:0},Un={key:1},Wn={key:0,class:n({content:!0})},Gn={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Kn={key:1,class:n({content:!0})},qn={key:0,class:`mb-4`},Jn={key:1,class:`mb-4`},Yn={key:2,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Xn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Zn={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Qn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$n={key:0},er={key:1},$={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},tr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},nr={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},rr={key:5,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ir={key:2,class:n({content:!0})},ar={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},or={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},sr={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},cr={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},lr={key:3,class:n({content:!0})},ur={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},dr={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function fr(n,u,d,m,_,v){let y=l(`el-image`),b=l(`image-preview`),x=l(`audio-preview`),S=l(`video-preview`),C=l(`font-awesome-icon`),w=l(`copy-to-clipboard`),T=l(`el-alert`),E=l(`video-player`),D=l(`image-wrapper`),O=l(`el-button`),k=l(`el-tooltip`),A=l(`api-code-button`);return g(),s(`div`,Pn,[e(`div`,Fn,[a(y,{src:n.seedanceLogo,class:`avatar`},null,8,[`src`])]),e(`div`,In,[e(`div`,Ln,[r(i(n.$t(`seedance.name.seedanceBot`))+` `,1),e(`span`,Rn,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,zn,[n.referenceImages.length>0||n.referenceAudios.length>0||n.referenceVideos.length>0?(g(),s(`div`,Bn,[(g(!0),s(c,null,h(n.referenceImages,(e,t)=>(g(),f(b,{key:`image-${t}`,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceAudios,(e,t)=>(g(),f(x,{key:`audio-${t}`,url:e,name:`audio-${t+1}`},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceVideos,(e,t)=>(g(),f(S,{key:`video-${t}`,url:e,name:`video-${t+1}`},null,8,[`url`,`name`]))),128))])):o(``,!0),n.promptText?(g(),s(`p`,Vn,[r(i(n.promptText)+` `,1),n.modelValue?.response?n.video?.status===`processing`||n.video?.status===`pending`?(g(),s(`span`,Un,` - (`+i(n.$t(`seedance.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,Hn,` - (`+i(n.$t(`seedance.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,Kn,[n.video?.video_url?(g(),s(`div`,qn,[a(E,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.last_frame_url?(g(),s(`div`,Jn,[a(D,{src:n.video?.last_frame_url,"raw-src":n.video?.last_frame_url},null,8,[`src`,`raw-src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,Yn,[a(k,{class:`box-item`,effect:`dark`,content:n.$t(`seedance.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(O,{type:`info`,size:`small`,class:`btn-action`,onClick:u[0]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`seedance.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(A,{path:`/seedance/videos`,body:n.apiCodeBody},null,8,[`body`])])):o(``,!0),a(T,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,Xn,[a(C,{icon:`fa-solid fa-cube`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.video?.duration?(g(),s(`p`,Zn,[a(C,{icon:`fa-solid fa-clock`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.duration`))+`: `+i(n.video?.duration)+`s `,1)])):o(``,!0),n.video?.resolution?(g(),s(`p`,Qn,[a(C,{icon:`fa-solid fa-expand`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.resolution`))+`: `+i(n.video?.resolution)+` `,1),n.video?.ratio?(g(),s(`span`,$n,` · `+i(n.video?.ratio),1)):o(``,!0),n.video?.framespersecond?(g(),s(`span`,er,` · `+i(n.video?.framespersecond)+`fps`,1)):o(``,!0)])):o(``,!0),n.modelValue?.request?.generate_audio?(g(),s(`p`,$,[a(C,{icon:`fa-solid fa-volume-up`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.generateAudio`))+`: `+i(n.$t(`seedance.button.on`)),1)])):o(``,!0),e(`p`,tr,[a(C,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,nr,[a(C,{icon:`fa-solid fa-clock`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,rr,[a(C,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(w,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(g(),s(`div`,ir,[a(T,{closable:!1,class:`failure`},{template:p(()=>[a(C,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.failure`)),1)]),default:p(()=>[e(`p`,ar,[a(C,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(g(),s(`p`,or,[a(C,{icon:`fa-solid fa-circle-info`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(w,{content:n.modelValue?.response?.error?.message,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(g(),s(`p`,sr,[a(C,{icon:`fa-solid fa-clock`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,cr,[a(C,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(w,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,lr,[a(T,{closable:!1,class:`info`},{template:p(()=>[a(C,{icon:`fa-solid fa-circle-info`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.status`)),1)]),default:p(()=>[e(`p`,ur,[a(C,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.trace_id?(g(),s(`p`,dr,[a(C,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(w,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,Wn,[a(T,{closable:!1,class:`info`},{template:p(()=>[a(C,{icon:`fa-regular fa-clock`,class:`mr-1`}),r(` `+i(n.$t(`seedance.status.pending`)),1)]),default:p(()=>[e(`p`,Gn,[a(C,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})]))])])}var pr=v({name:`SeedanceRecentPanel`,components:{TaskPreview:B(Nn,[[`render`,fr],[`__scopeId`,`data-v-f340ebf6`]]),BotPlaceholder:ye,NoTasks:be,ScrollList:he},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.seedance?.tasks,items:this.$store.state.seedance?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),mr={key:0},hr={key:2,class:`w-full h-full flex items-center justify-center`};function gr(e,t,n,r,i,u){let d=l(`bot-placeholder`),m=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return g(),s(c,null,[e.tasks?.items===void 0?(g(),s(`div`,mr,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,e=>(g(),f(m,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,hr,[a(v)])):o(``,!0)],64)}var _r=v({name:`SeedanceIndex`,components:{ConfigPanel:Mn,Layout:Ae,RecentPanel:B(pr,[[`render`,gr]])},mixins:[le],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.seedance?.status?.getApplications===q.Request},tasksLoading(){return this.$store.state.seedance?.status?.getTasks===q.Request||this.fetchingTasks},credential(){return this.$store.state.seedance?.credential},config(){return this.$store.state.seedance?.config},tasks(){return this.$store.state.seedance?.tasks}},watch:{initialized:{async handler(e){e&&(await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ge({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(){await this.$store.dispatch(`seedance/getService`)},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch(`seedance/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!ue(this.uploadTracker,e=>this.$t(e),e=>J.warning(e)))return;let e={...this.config||{}};if(typeof e?.prompt==`string`&&(e.prompt=e.prompt.trim(),e.prompt||delete e.prompt),Array.isArray(e?.images)){e.images=e.images.filter(e=>!!e?.url);let t=e.images.some(e=>e?.role===`first_frame`),n=e.images.some(e=>e?.role===`last_frame`);!t&&n&&(e.images=e.images.map(e=>e?.role===`last_frame`?{...e,role:`first_frame`}:e))}let t=Array.isArray(e?.images)&&e.images.length>0;if(!t&&`images`in e&&delete e.images,`service_tier`in e&&delete e.service_tier,e?.model&&!ne[e.model]){J.warning(this.$t(`seedance.message.modelUnsupported`));return}let n=I(e?.model);if(n.requiresImage&&!t){J.warning(this.$t(`seedance.message.modelRequiresImage`));return}if(!n.acceptsImage&&t){J.warning(this.$t(`seedance.message.modelRejectsImage`));return}if(!n.acceptsText&&!t){J.warning(this.$t(`seedance.message.modelRequiresImage`));return}!n.acceptsAudio&&e.generate_audio&&(e.generate_audio=!1),!n.acceptsReturnLastFrame&&e.return_last_frame&&(e.return_last_frame=!1),!n.acceptsLastFrame&&t&&(e.images=e.images.filter(e=>e?.role!==`last_frame`)),n.acceptsReferenceAudio&&Array.isArray(e?.audios)&&(e.audios=e.audios.filter(e=>e?.url)),(!n.acceptsReferenceAudio||!Array.isArray(e?.audios)||e.audios.length===0)&&delete e.audios,n.acceptsReferenceVideo&&Array.isArray(e?.videos)&&(e.videos=e.videos.filter(e=>e?.url)),(!n.acceptsReferenceVideo||!Array.isArray(e?.videos)||e.videos.length===0)&&delete e.videos,!n.acceptsReferenceImage&&Array.isArray(e?.images)&&(e.images=e.images.filter(e=>e?.role!==`reference_image`),e.images.length===0&&delete e.images);let r=Array.isArray(e?.images)&&e.images.some(e=>e?.role===`reference_image`);if(Array.isArray(e?.audios)&&e.audios.length>0&&!r){J.warning(this.$t(`seedance.message.audioRequiresReferenceImage`));return}let i={...e,async:!0};if(!H())return;let a=this.credential?.token;if(!a){console.error(`no token specified`);return}J.info(this.$t(`seedance.message.startingTask`)),de(`seedance`,V.generate(i,{token:a})).then(()=>{J.success(this.$t(`seedance.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?J.error(this.$t(`seedance.message.usedUp`)):J.error(this.$t(`seedance.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function vr(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return g(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var yr=B(_r,[[`render`,vr]]);export{yr as default};
1
+ import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{r as y,t as b}from"./select-Dimm3cl1.js";import{t as x}from"./upload-BQXdf3I1.js";import{t as S}from"./tooltip-CRloPYoS.js";import{t as C}from"./image-DdozYzas.js";import{t as w}from"./alert-BfCyDcWO.js";import{t as T}from"./drawer-GII5N0kH.js";import{t as E}from"./input-number-BZftuN2C.js";import{t as D}from"./switch-D94Z7hOB.js";import{$t as O,Bt as k,Gt as A,Ht as ee,It as te,Jt as ne,Kt as j,Lt as M,Qt as N,Ut as P,Vt as re,Wt as ie,Xt as ae,Yt as oe,Zt as se,en as F,qt as ce,rn as I,tn as L,zt as R}from"./constants-BWAHKQ-e.js";import{G as z,Ii as B,Ln as V,Ti as H,Tr as U,di as W,hn as G,in as K,mi as q,nn as J,on as le,rn as ue,tn as de}from"./index-m0B4VH-l.js";import{t as Y}from"./index.es-DVFB1iVe.js";import{t as fe}from"./CopyToClipboard-BQ2Ei1sV.js";import{t as X}from"./ImagePreview-DKkz6u_p.js";import{n as pe}from"./taskDrawerMixin-DyAUhFEq.js";import{t as me}from"./Consumption-_nwRhH83.js";import{i as Z,n as he,t as ge}from"./pagination-OQ6Csuu1.js";import{t as _e}from"./VideoPlayer-ikSJRkQv.js";import{t as ve}from"./ApiCodeButton-B6ugqxDK.js";import{t as ye}from"./BotPlaceholder-DwMB-nyu.js";import{t as be}from"./NoTasks-Q9DDa660.js";import{t as xe}from"./PromptTextarea-5oMvhem7.js";import{t as Se}from"./ImageWrapper-BRTUYofN.js";import{n as Ce,t as we}from"./VideoPreview-CZrENuKu.js";var Te=v({name:`LayoutSeedance`,components:{ElDrawer:T,ElButton:B,FontAwesomeIcon:Y},mixins:[pe]}),Ee={class:`main flex flex-row flex-1`},De={class:`config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Oe={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function ke(t,n,r,i,o,c){let f=l(`font-awesome-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Ee,[e(`div`,De,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Oe,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{icon:`fa-solid fa-magic`})]),_:1},512),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`350px`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Ae=z(Te,[[`render`,ke],[`__scopeId`,`data-v-ec312952`]]),je=v({name:`SeedancePromptInput`,components:{PromptTextarea:xe},computed:{prompt:{get(){return this.$store.state.seedance?.config?.prompt},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Me(e,t,n,r,i,a){let o=l(`prompt-textarea`);return g(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`seedance.name.prompt`),info:e.$t(`seedance.description.prompt`),placeholder:e.$t(`seedance.placeholder.prompt`),"min-rows":5},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ne=z(je,[[`render`,Me]]),Pe=v({name:`SeedanceModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Z},data(){return{options:[{value:A,label:this.$t(`seedance.model.seedance20`)},{value:j,label:this.$t(`seedance.model.seedance20Fast`)},{value:ce,label:this.$t(`seedance.model.seedance20Mini`)},{value:ie,label:this.$t(`seedance.model.seedance15pro`)},{value:ee,label:this.$t(`seedance.model.seedance10pro`)},{value:P,label:this.$t(`seedance.model.seedance10proFast`)},{value:re,label:this.$t(`seedance.model.seedance10liteT2v`)},{value:k,label:this.$t(`seedance.model.seedance10liteI2v`)}]}},computed:{value:{get(){return this.$store.state.seedance?.config?.model},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,model:e})}}},mounted(){this.value||=te}}),Fe={class:`field`},Ie={class:`label`},Le={class:`box`},Re={class:`title font-bold`};function ze(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Fe,[e(`div`,Ie,[e(`div`,Le,[e(`h2`,Re,i(t.$t(`seedance.name.model`)),1),a(m,{content:t.$t(`seedance.description.model`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedance.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Be=z(Pe,[[`render`,ze],[`__scopeId`,`data-v-deb4c429`]]),Ve=v({name:`SeedanceDurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Z},computed:{model(){return this.$store.state.seedance?.config?.model},capability(){return I(this.model)},options(){let e=[];this.capability.supportsAutoDuration&&e.push({value:-1,label:`${this.$t(`seedance.placeholder.seed`)} (-1)`});for(let t=this.capability.minDuration;t<=this.capability.maxDuration;t++)e.push({value:t,label:`${t}s`});return e},value:{get(){return this.$store.state.seedance?.config?.duration},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,duration:e})}}},watch:{model(){this.clampValue()}},mounted(){this.value?this.clampValue():this.value=5},methods:{clampValue(){let e=this.value;e!==void 0&&!(e===-1&&this.capability.supportsAutoDuration)&&(e<this.capability.minDuration||e>this.capability.maxDuration)&&(this.value=5)}}}),He={class:`field`},Ue={class:`label`},We={class:`box`},Ge={class:`title font-bold`};function Ke(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,He,[e(`div`,Ue,[e(`div`,We,[e(`h2`,Ge,i(t.$t(`seedance.name.duration`)),1),a(m,{content:t.$t(`seedance.description.duration`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedance.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var qe=z(Ve,[[`render`,Ke],[`__scopeId`,`data-v-d61cc21b`]]),Q={[F]:0,[L]:1,[O]:2,"4k":3},Je=v({name:`SeedanceResolutionSelector`,components:{InfoIcon:Z,ElTooltip:S},computed:{model(){return this.$store.state.seedance?.config?.model},capability(){return I(this.model)},options(){let e=[{value:F,label:`480p`},{value:L,label:`720p`},{value:O,label:`1080p`},{value:`4k`,label:`4k`}],t=Q[this.capability.maxResolution]??Q[`1080p`];return e.map(e=>({...e,disabled:Q[e.value]>t}))},value:{get(){return this.$store.state.seedance?.config?.resolution},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,resolution:e})}}},watch:{model(){this.clampValue()}},mounted(){this.value?this.clampValue():this.value=this.capability.defaultResolution||`720p`},methods:{onSelect(e){e.disabled||(this.value=e.value)},clampValue(){let e=this.value,t=this.options.find(t=>t.value===e);(!e||t&&t.disabled)&&(this.value=this.capability.defaultResolution||`720p`)}}}),Ye={class:`resolution`},Xe={class:`header`},Ze={class:`title font-bold`},Qe={class:`items`},$e=[`onClick`];function et(t,r,o,u,d,m){let _=l(`info-icon`),v=l(`el-tooltip`);return g(),s(`div`,Ye,[e(`div`,Xe,[e(`h2`,Ze,i(t.$t(`seedance.name.resolution`)),1),a(_,{content:t.$t(`seedance.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,Qe,[(g(!0),s(c,null,h(t.options,r=>(g(),f(v,{key:r.value,content:t.$t(`seedance.message.resolutionNotSupported`),disabled:!r.disabled,placement:`top`},{default:p(()=>[e(`div`,{class:n([`item`,{active:t.value===r.value,disabled:r.disabled}]),onClick:e=>t.onSelect(r)},i(r.label),11,$e)]),_:2},1032,[`content`,`disabled`]))),128))])])}var tt=z(Je,[[`render`,et],[`__scopeId`,`data-v-db7e8aff`]]),nt=v({name:`SeedanceRatioSelector`,components:{InfoIcon:Z},computed:{options(){return[{value:oe,label:`16:9`,w:32,h:18},{value:se,label:`9:16`,w:18,h:32},{value:`4:3`,label:`4:3`,w:28,h:21},{value:`3:4`,label:`3:4`,w:21,h:28},{value:`1:1`,label:`1:1`,w:24,h:24},{value:ae,label:`21:9`,w:34,h:14},{value:N,label:this.$t(`seedance.ratio.adaptive`),w:0,h:0}]},value:{get(){return this.$store.state.seedance?.config?.ratio},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,ratio:e})}}},mounted(){this.value||=M}}),rt={class:`ratio`},it={class:`header`},at={class:`title font-bold`},ot={class:`items`},st=[`onClick`],ct={class:`preview`},lt={key:1,class:`rect rect-auto`},ut={class:`name`};function dt(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,rt,[e(`div`,it,[e(`h2`,at,i(t.$t(`seedance.name.ratio`)),1),a(p,{content:t.$t(`seedance.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,ot,[(g(!0),s(c,null,h(t.options,r=>(g(),s(`div`,{key:r.value,class:n([`item`,{active:t.value===r.value}]),onClick:e=>t.value=r.value},[e(`div`,ct,[r.w&&r.h?(g(),s(`div`,{key:0,class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)):(g(),s(`div`,lt,`A`))]),e(`div`,ut,i(r.label),1)],10,st))),128))])])}var ft=z(nt,[[`render`,dt],[`__scopeId`,`data-v-8ddec2dd`]]),pt=v({name:`SeedanceGenerateAudioSwitch`,components:{ElSwitch:D,InfoIcon:Z},computed:{isSupported(){let e=this.$store.state.seedance?.config?.model;return I(e).acceptsAudio},value:{get(){return this.$store.state.seedance?.config?.generate_audio??!1},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,generate_audio:e})}}},watch:{isSupported(e){!e&&this.value&&(this.value=!1)}},mounted(){this.value===void 0&&(this.value=!1)}}),mt={key:0,class:`field`},ht={class:`label`},gt={class:`box`},_t={class:`title font-bold`},vt={class:`value`};function yt(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,mt,[e(`div`,ht,[e(`div`,gt,[e(`h2`,_t,i(t.$t(`seedance.name.generateAudio`)),1),a(f,{content:t.$t(`seedance.description.generateAudio`),class:`info`},null,8,[`content`])])]),e(`div`,vt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])):o(``,!0)}var bt=z(pt,[[`render`,yt],[`__scopeId`,`data-v-df51dfbd`]]),xt=v({name:`SeedanceCameraFixedSwitch`,components:{ElSwitch:D,InfoIcon:Z},computed:{value:{get(){return this.$store.state.seedance?.config?.camerafixed??!1},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,camerafixed:e})}}},mounted(){this.$store.state.seedance?.config?.camerafixed===void 0&&(this.value=!1)}}),St={class:`field`},Ct={class:`label`},wt={class:`box`},Tt={class:`title font-bold`},Et={class:`value`};function Dt(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,St,[e(`div`,Ct,[e(`div`,wt,[e(`h2`,Tt,i(t.$t(`seedance.name.cameraFixed`)),1),a(d,{content:t.$t(`seedance.description.cameraFixed`),class:`info`},null,8,[`content`])])]),e(`div`,Et,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])}var Ot=z(xt,[[`render`,Dt],[`__scopeId`,`data-v-ae777d61`]]),kt=v({name:`SeedanceFirstFrameImage`,components:{ElUpload:x,ElButton:B,InfoIcon:Z,FontAwesomeIcon:Y,ImagePreview:X},mixins:[K,J],data(){return{fileList:[],uploadUrl:q()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return I(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsImage"(e){e||(this.fileList=[],this.onSetFirstFrameUrl())}},methods:{onExceed(){H.warning(this.$t(`seedance.message.uploadExceed`))},onError(){H.error(this.$t(`seedance.message.uploadError`))},onSetFirstFrameUrl(){let e=this.urls?.[0],t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`first_frame`);e&&t.push({url:e,role:`first_frame`}),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetFirstFrameUrl()},async onRemove(){this.onSetFirstFrameUrl()}}}),At={key:0,class:`relative`},jt={class:`flex justify-between`},Mt={class:`flex justify-start items-center`},Nt={class:`text-sm font-bold`},Pt={key:0,class:`required-badge`};function Ft(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-upload`);return t.capability.acceptsImage?(g(),s(`div`,At,[e(`div`,jt,[e(`div`,Mt,[e(`span`,Nt,i(t.$t(`seedance.name.firstFrame`)),1),t.capability.requiresImage?(g(),s(`span`,Pt,i(t.$t(`seedance.name.required`)),1)):o(``,!0),a(h,{content:t.$t(`seedance.description.firstFrame`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var It=z(kt,[[`render`,Ft],[`__scopeId`,`data-v-e2597f23`]]),Lt=v({name:`SeedanceLastFrameImage`,components:{ElUpload:x,ElButton:B,ImagePreview:X,InfoIcon:Z,FontAwesomeIcon:Y},mixins:[K,J],data(){return{fileList:[],uploadUrl:q()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return I(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsLastFrame"(e){e||(this.fileList=[],this.onSetLastFrameUrl())}},methods:{onExceed(){H.warning(this.$t(`seedance.message.uploadExceed`))},onError(){H.error(this.$t(`seedance.message.uploadError`))},onSetLastFrameUrl(){let e=this.urls?.[0],t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`last_frame`);e&&t.push({url:e,role:`last_frame`}),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetLastFrameUrl()},async onRemove(){this.onSetLastFrameUrl()}}}),Rt={key:0,class:`relative`},zt={class:`flex justify-between`},Bt={class:`flex justify-start items-center`},Vt={class:`text-sm font-bold`};function Ht(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-upload`);return t.capability.acceptsLastFrame?(g(),s(`div`,Rt,[e(`div`,zt,[e(`div`,Bt,[e(`span`,Vt,i(t.$t(`seedance.name.lastFrame`)),1),a(h,{content:t.$t(`seedance.description.lastFrame`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var Ut=z(Lt,[[`render`,Ht],[`__scopeId`,`data-v-3a191e51`]]),Wt=v({name:`SeedanceReferenceImage`,components:{ElUpload:x,ElButton:B,InfoIcon:Z,FontAwesomeIcon:Y,ImagePreview:X},mixins:[K,J],data(){return{fileList:[],uploadUrl:q()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return I(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceImage"(e){e||(this.fileList=[],this.onSetReferenceImageUrls())}},methods:{onExceed(){H.warning(this.$t(`seedance.message.uploadExceed`))},onError(){H.error(this.$t(`seedance.message.uploadError`))},onSetReferenceImageUrls(){let e=(this.urls||[]).filter(Boolean),t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`reference_image`);e.forEach(e=>t.push({url:e,role:`reference_image`})),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetReferenceImageUrls()},async onRemove(){this.onSetReferenceImageUrls()}}}),Gt={key:0,class:`relative`},Kt={class:`flex justify-between`},qt={class:`flex justify-start items-center`},Jt={class:`text-sm font-bold`};function Yt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-upload`);return t.capability.acceptsReferenceImage?(g(),s(`div`,Gt,[e(`div`,Kt,[e(`div`,qt,[e(`span`,Jt,i(t.$t(`seedance.name.referenceImage`)),1),a(h,{content:t.$t(`seedance.description.referenceImage`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var Xt=z(Wt,[[`render`,Yt],[`__scopeId`,`data-v-230a67f6`]]),Zt=v({name:`SeedanceReferenceAudio`,components:{ElUpload:x,ElButton:B,InfoIcon:Z,FontAwesomeIcon:Y},mixins:[J],data(){return{fileList:[],uploadUrl:q()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return I(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceAudio"(e){e||(this.fileList=[],this.onSetReferenceAudios())}},methods:{onExceed(){H.warning(this.$t(`seedance.message.uploadExceed`))},onError(){H.error(this.$t(`seedance.message.uploadError`))},onSetReferenceAudios(){let e=(this.urls||[]).filter(Boolean);this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,audios:e.length>0?e.map(e=>({url:e})):void 0})},async onSuccess(){this.onSetReferenceAudios()},async onRemove(){this.onSetReferenceAudios()}}}),Qt={key:0,class:`relative`},$t={class:`flex justify-between`},en={class:`flex justify-start items-center`},tn={class:`text-sm font-bold`};function nn(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`font-awesome-icon`),_=l(`el-button`),v=l(`el-upload`);return t.capability.acceptsReferenceAudio?(g(),s(`div`,Qt,[e(`div`,$t,[e(`div`,en,[e(`span`,tn,i(t.$t(`seedance.name.referenceAudio`)),1),a(m,{content:t.$t(`seedance.description.referenceAudio`)},null,8,[`content`])])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp3,.wav,.m4a,.aac,.ogg,.flac`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`text`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(h,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var rn=z(Zt,[[`render`,nn],[`__scopeId`,`data-v-49515675`]]),an=v({name:`SeedanceReferenceVideo`,components:{ElUpload:x,ElButton:B,InfoIcon:Z,FontAwesomeIcon:Y},mixins:[J],data(){return{fileList:[],uploadUrl:q()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return I(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceVideo"(e){e||(this.fileList=[],this.onSetReferenceVideos())}},methods:{onExceed(){H.warning(this.$t(`seedance.message.uploadExceed`))},onError(){H.error(this.$t(`seedance.message.uploadError`))},onSetReferenceVideos(){let e=(this.urls||[]).filter(Boolean);this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,videos:e.length>0?e.map(e=>({url:e})):void 0})},async onSuccess(){this.onSetReferenceVideos()},async onRemove(){this.onSetReferenceVideos()}}}),on={key:0,class:`relative`},sn={class:`flex justify-between`},cn={class:`flex justify-start items-center`},ln={class:`text-sm font-bold`};function un(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`font-awesome-icon`),_=l(`el-button`),v=l(`el-upload`);return t.capability.acceptsReferenceVideo?(g(),s(`div`,on,[e(`div`,sn,[e(`div`,cn,[e(`span`,ln,i(t.$t(`seedance.name.referenceVideo`)),1),a(m,{content:t.$t(`seedance.description.referenceVideo`)},null,8,[`content`])])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp4,.mov,.webm,.mkv,.avi`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`text`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(h,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var dn=z(an,[[`render`,un],[`__scopeId`,`data-v-b212c474`]]),fn=v({name:`SeedanceReturnLastFrameSwitch`,components:{ElSwitch:D,InfoIcon:Z},computed:{model(){return this.$store.state.seedance?.config?.model},isSupported(){return I(this.model).acceptsReturnLastFrame},value:{get(){return this.$store.state.seedance?.config?.return_last_frame},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,return_last_frame:e})}}},watch:{isSupported(e){!e&&this.value&&(this.value=!1)}},mounted(){this.value===void 0&&(this.value=!1)}}),pn={key:0,class:`field`},mn={class:`label`},hn={class:`box`},gn={class:`title font-bold`},_n={class:`value`};function vn(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,pn,[e(`div`,mn,[e(`div`,hn,[e(`h2`,gn,i(t.$t(`seedance.name.returnLastFrame`)),1),a(f,{content:t.$t(`seedance.description.returnLastFrame`),class:`info`},null,8,[`content`])])]),e(`div`,_n,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])):o(``,!0)}var yn=z(fn,[[`render`,vn],[`__scopeId`,`data-v-edea5451`]]),bn=v({name:`SeedanceSeedInput`,components:{ElInputNumber:E,InfoIcon:Z},computed:{value:{get(){let e=this.$store.state.seedance?.config?.seed;return typeof e==`number`?e:-1},set(e){let t={...this.$store.state.seedance?.config||{}};t.seed=typeof e==`number`&&Number.isInteger(e)?e:-1,this.$store.commit(`seedance/setConfig`,t)}}}}),xn={class:`field`},Sn={class:`label`},Cn={class:`box`},wn={class:`title font-bold`},Tn={class:`value`};function En(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input-number`);return g(),s(`div`,xn,[e(`div`,Sn,[e(`div`,Cn,[e(`h2`,wn,i(t.$t(`seedance.name.seed`)),1),a(d,{content:t.$t(`seedance.description.seed`),class:`info`},null,8,[`content`])])]),e(`div`,Tn,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:-1,max:2147483647,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])}var Dn=v({name:`SeedanceConfigPanel`,components:{ElButton:B,FontAwesomeIcon:Y,PromptInput:Ne,ModelSelector:Be,DurationSelector:qe,ResolutionSelector:tt,RatioSelector:ft,GenerateAudioSwitch:bt,CameraFixedSwitch:Ot,ReturnLastFrameSwitch:yn,SeedInput:z(bn,[[`render`,En],[`__scopeId`,`data-v-685a9869`]]),FirstFrameImage:It,LastFrameImage:Ut,ReferenceImage:Xt,ReferenceAudio:rn,ReferenceVideo:dn,Consumption:me},emits:[`generate`],computed:{config(){return this.$store.state.seedance?.config},consumption(){return le(this.config,this.service?.cost)},service(){return this.$store.state.seedance?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),On={class:`flex flex-col h-full`},kn={class:`flex-1 overflow-y-auto p-5`},An={class:`flex flex-col items-center justify-center px-5 pb-5`};function jn(t,n,o,c,u,d){let f=l(`prompt-input`),m=l(`model-selector`),h=l(`ratio-selector`),_=l(`resolution-selector`),v=l(`duration-selector`),y=l(`generate-audio-switch`),b=l(`camera-fixed-switch`),x=l(`return-last-frame-switch`),S=l(`seed-input`),C=l(`first-frame-image`),w=l(`last-frame-image`),T=l(`reference-image`),E=l(`reference-audio`),D=l(`reference-video`),O=l(`consumption`),k=l(`font-awesome-icon`),A=l(`el-button`);return g(),s(`div`,On,[e(`div`,kn,[a(f,{class:`mb-4`}),a(m,{class:`mb-4`}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-2`}),a(w,{class:`mb-2`}),a(T,{class:`mb-2`}),a(E,{class:`mb-2`}),a(D,{class:`mb-2`})]),e(`div`,An,[a(O,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(A,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(k,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`seedance.button.generate`)),1)]),_:1},8,[`onClick`])])])}var Mn=z(Dn,[[`render`,jn]]),Nn=v({name:`SeedanceTaskPreview`,components:{ElImage:C,CopyToClipboard:fe,FontAwesomeIcon:Y,ElAlert:w,VideoPlayer:_e,ElTooltip:S,ElButton:B,ImageWrapper:Se,ImagePreview:X,AudioPreview:Ce,VideoPreview:we,ApiCodeButton:ve},props:{modelValue:{type:Object,required:!0}},data(){return{seedanceLogo:R}},computed:{video(){return this.modelValue?.response?.data},apiCodeBody(){let e=this.modelValue?.request;if(!e)return e;let{service_tier:t,...n}=e;return n},promptText(){let e=this.modelValue?.request;if(e?.prompt)return e.prompt;let t=e?.content?.find(e=>e?.type===`text`&&e?.text);return t?.text?t.text:this.video?.prompt},referenceImages(){let e=this.collectImages();if(e.length===0)return[];let t=[],n=e.find(e=>e?.role===`first_frame`);n?.url&&t.push({url:n.url,name:`first-frame`});let r=e.find(e=>e?.role===`last_frame`);return r?.url&&t.push({url:r.url,name:`last-frame`}),e.forEach((e,n)=>{e?.url&&e.role!==`first_frame`&&e.role!==`last_frame`&&t.push({url:e.url,name:e.role||`image-${n}`})}),t},referenceAudios(){let e=this.modelValue?.request,t=(e?.audios??[]).map(e=>e?.url).filter(Boolean);return(e?.content??[]).forEach(e=>{e?.type===`audio_url`&&e?.audio_url?.url&&t.push(e.audio_url.url)}),t},referenceVideos(){let e=this.modelValue?.request,t=(e?.videos??[]).map(e=>e?.url).filter(Boolean);return(e?.content??[]).forEach(e=>{e?.type===`video_url`&&e?.video_url?.url&&t.push(e.video_url.url)}),t}},methods:{collectImages(){let e=this.modelValue?.request,t=Array.isArray(e?.images)?[...e.images]:[];return(e?.content??[]).forEach(e=>{e?.type===`image_url`&&e?.image_url?.url&&t.push({url:e.image_url.url,role:e.role})}),t},onDownload(e){window.open(e,`_blank`)}}}),Pn={class:`preview`},Fn={class:`left`},In={class:`main`},Ln={class:`bot`},Rn={class:`datetime`},zn={class:`info`},Bn={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Vn={key:1,class:`prompt mt-2`},Hn={key:0},Un={key:1},Wn={key:0,class:n({content:!0})},Gn={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Kn={key:1,class:n({content:!0})},qn={key:0,class:`mb-4`},Jn={key:1,class:`mb-4`},Yn={key:2,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Xn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Zn={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Qn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$n={key:0},er={key:1},$={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},tr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},nr={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},rr={key:5,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ir={key:2,class:n({content:!0})},ar={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},or={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},sr={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},cr={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},lr={key:3,class:n({content:!0})},ur={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},dr={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function fr(n,u,d,m,_,v){let y=l(`el-image`),b=l(`image-preview`),x=l(`audio-preview`),S=l(`video-preview`),C=l(`font-awesome-icon`),w=l(`copy-to-clipboard`),T=l(`el-alert`),E=l(`video-player`),D=l(`image-wrapper`),O=l(`el-button`),k=l(`el-tooltip`),A=l(`api-code-button`);return g(),s(`div`,Pn,[e(`div`,Fn,[a(y,{src:n.seedanceLogo,class:`avatar`},null,8,[`src`])]),e(`div`,In,[e(`div`,Ln,[r(i(n.$t(`seedance.name.seedanceBot`))+` `,1),e(`span`,Rn,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,zn,[n.referenceImages.length>0||n.referenceAudios.length>0||n.referenceVideos.length>0?(g(),s(`div`,Bn,[(g(!0),s(c,null,h(n.referenceImages,(e,t)=>(g(),f(b,{key:`image-${t}`,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceAudios,(e,t)=>(g(),f(x,{key:`audio-${t}`,url:e,name:`audio-${t+1}`},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceVideos,(e,t)=>(g(),f(S,{key:`video-${t}`,url:e,name:`video-${t+1}`},null,8,[`url`,`name`]))),128))])):o(``,!0),n.promptText?(g(),s(`p`,Vn,[r(i(n.promptText)+` `,1),n.modelValue?.response?n.video?.status===`processing`||n.video?.status===`pending`?(g(),s(`span`,Un,` - (`+i(n.$t(`seedance.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,Hn,` - (`+i(n.$t(`seedance.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,Kn,[n.video?.video_url?(g(),s(`div`,qn,[a(E,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.last_frame_url?(g(),s(`div`,Jn,[a(D,{src:n.video?.last_frame_url,"raw-src":n.video?.last_frame_url},null,8,[`src`,`raw-src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,Yn,[a(k,{class:`box-item`,effect:`dark`,content:n.$t(`seedance.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(O,{type:`info`,size:`small`,class:`btn-action`,onClick:u[0]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`seedance.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(A,{path:`/seedance/videos`,body:n.apiCodeBody},null,8,[`body`])])):o(``,!0),a(T,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,Xn,[a(C,{icon:`fa-solid fa-cube`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.video?.duration?(g(),s(`p`,Zn,[a(C,{icon:`fa-solid fa-clock`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.duration`))+`: `+i(n.video?.duration)+`s `,1)])):o(``,!0),n.video?.resolution?(g(),s(`p`,Qn,[a(C,{icon:`fa-solid fa-expand`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.resolution`))+`: `+i(n.video?.resolution)+` `,1),n.video?.ratio?(g(),s(`span`,$n,` · `+i(n.video?.ratio),1)):o(``,!0),n.video?.framespersecond?(g(),s(`span`,er,` · `+i(n.video?.framespersecond)+`fps`,1)):o(``,!0)])):o(``,!0),n.modelValue?.request?.generate_audio?(g(),s(`p`,$,[a(C,{icon:`fa-solid fa-volume-up`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.generateAudio`))+`: `+i(n.$t(`seedance.button.on`)),1)])):o(``,!0),e(`p`,tr,[a(C,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,nr,[a(C,{icon:`fa-solid fa-clock`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,rr,[a(C,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(w,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(g(),s(`div`,ir,[a(T,{closable:!1,class:`failure`},{template:p(()=>[a(C,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.failure`)),1)]),default:p(()=>[e(`p`,ar,[a(C,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(g(),s(`p`,or,[a(C,{icon:`fa-solid fa-circle-info`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(w,{content:n.modelValue?.response?.error?.message,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(g(),s(`p`,sr,[a(C,{icon:`fa-solid fa-clock`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,cr,[a(C,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(w,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,lr,[a(T,{closable:!1,class:`info`},{template:p(()=>[a(C,{icon:`fa-solid fa-circle-info`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.status`)),1)]),default:p(()=>[e(`p`,ur,[a(C,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.trace_id?(g(),s(`p`,dr,[a(C,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(w,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,Wn,[a(T,{closable:!1,class:`info`},{template:p(()=>[a(C,{icon:`fa-regular fa-clock`,class:`mr-1`}),r(` `+i(n.$t(`seedance.status.pending`)),1)]),default:p(()=>[e(`p`,Gn,[a(C,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})]))])])}var pr=v({name:`SeedanceRecentPanel`,components:{TaskPreview:z(Nn,[[`render`,fr],[`__scopeId`,`data-v-f340ebf6`]]),BotPlaceholder:ye,NoTasks:be,ScrollList:he},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.seedance?.tasks,items:this.$store.state.seedance?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),mr={key:0},hr={key:2,class:`w-full h-full flex items-center justify-center`};function gr(e,t,n,r,i,u){let d=l(`bot-placeholder`),m=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return g(),s(c,null,[e.tasks?.items===void 0?(g(),s(`div`,mr,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,e=>(g(),f(m,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,hr,[a(v)])):o(``,!0)],64)}var _r=v({name:`SeedanceIndex`,components:{ConfigPanel:Mn,Layout:Ae,RecentPanel:z(pr,[[`render`,gr]])},mixins:[ue],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.seedance?.status?.getApplications===W.Request},tasksLoading(){return this.$store.state.seedance?.status?.getTasks===W.Request||this.fetchingTasks},credential(){return this.$store.state.seedance?.credential},config(){return this.$store.state.seedance?.config},tasks(){return this.$store.state.seedance?.tasks}},watch:{initialized:{async handler(e){e&&(await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ge({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(){await this.$store.dispatch(`seedance/getService`)},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch(`seedance/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!de(this.uploadTracker,e=>this.$t(e),e=>H.warning(e)))return;let e={...this.config||{}};if(typeof e?.prompt==`string`&&(e.prompt=e.prompt.trim(),e.prompt||delete e.prompt),Array.isArray(e?.images)){e.images=e.images.filter(e=>!!e?.url);let t=e.images.some(e=>e?.role===`first_frame`),n=e.images.some(e=>e?.role===`last_frame`);!t&&n&&(e.images=e.images.map(e=>e?.role===`last_frame`?{...e,role:`first_frame`}:e))}let t=Array.isArray(e?.images)&&e.images.length>0;if(!t&&`images`in e&&delete e.images,`service_tier`in e&&delete e.service_tier,e?.model&&!ne[e.model]){H.warning(this.$t(`seedance.message.modelUnsupported`));return}let n=I(e?.model);if(n.requiresImage&&!t){H.warning(this.$t(`seedance.message.modelRequiresImage`));return}if(!n.acceptsImage&&t){H.warning(this.$t(`seedance.message.modelRejectsImage`));return}if(!n.acceptsText&&!t){H.warning(this.$t(`seedance.message.modelRequiresImage`));return}!n.acceptsAudio&&e.generate_audio&&(e.generate_audio=!1),!n.acceptsReturnLastFrame&&e.return_last_frame&&(e.return_last_frame=!1),!n.acceptsLastFrame&&t&&(e.images=e.images.filter(e=>e?.role!==`last_frame`)),n.acceptsReferenceAudio&&Array.isArray(e?.audios)&&(e.audios=e.audios.filter(e=>e?.url)),(!n.acceptsReferenceAudio||!Array.isArray(e?.audios)||e.audios.length===0)&&delete e.audios,n.acceptsReferenceVideo&&Array.isArray(e?.videos)&&(e.videos=e.videos.filter(e=>e?.url)),(!n.acceptsReferenceVideo||!Array.isArray(e?.videos)||e.videos.length===0)&&delete e.videos,!n.acceptsReferenceImage&&Array.isArray(e?.images)&&(e.images=e.images.filter(e=>e?.role!==`reference_image`),e.images.length===0&&delete e.images);let r=Array.isArray(e?.images)&&e.images.some(e=>e?.role===`reference_image`);if(Array.isArray(e?.audios)&&e.audios.length>0&&!r){H.warning(this.$t(`seedance.message.audioRequiresReferenceImage`));return}let i={...e,async:!0};if(!G())return;let a=this.credential?.token;if(!a){console.error(`no token specified`);return}H.info(this.$t(`seedance.message.startingTask`)),U(`seedance`,V.generate(i,{token:a})).then(()=>{H.success(this.$t(`seedance.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?H.error(this.$t(`seedance.message.usedUp`)):H.error(this.$t(`seedance.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function vr(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return g(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var yr=z(_r,[[`render`,vr]]);export{yr as default};
@@ -0,0 +1 @@
1
+ import"./rolldown-runtime--c01j_DQ.js";import{A as e,I as t,Jt as n,L as r,M as i,N as a,T as o,at as s,j as ee,mt as c,rt as l,tt as u,z as d}from"./vendor-chart-Dw-P17PN.js";import{t as f}from"./image-DdozYzas.js";import{t as te}from"./card-D-4S-l7a.js";import{n as p,t as m}from"./row-BMPJJqEZ.js";import{G as ne,Ii as h}from"./index-m0B4VH-l.js";import{t as g}from"./index.es-DVFB1iVe.js";var _=[{key:`chat`,titleKey:`index.title.chat`,subtitleKey:`index.subtitle.chat`,icon:`fa-regular fa-comment`,features:[[`chatgpt`,`/chatgpt`]]},{key:`image`,titleKey:`index.title.midjourney`,subtitleKey:`index.subtitle.midjourney`,icon:`fa-solid fa-palette`,features:[[`midjourney`,`/midjourney`],[`nanobanana`,`/nanobanana`],[`seedream`,`/seedream`],[`flux`,`/flux`],[`openaiimage`,`/openai-image`],[`qrart`,`/qrart`]]},{key:`music`,titleKey:`index.title.suno`,subtitleKey:`index.subtitle.suno`,icon:`fa-solid fa-music`,features:[[`suno`,`/suno`],[`producer`,`/producer`]]},{key:`video`,titleKey:`index.title.luma`,subtitleKey:`index.subtitle.luma`,icon:`fa-solid fa-film`,features:[[`luma`,`/luma`],[`veo`,`/veo`],[`sora`,`/sora`],[`kling`,`/kling`],[`hailuo`,`/hailuo`],[`seedance`,`/seedance`]]}],v=d({name:`Index`,components:{ElButton:h,ElRow:m,ElCol:p,ElCard:te,ElImage:f,FontAwesomeIcon:g},data(){return{comments:[{avatar:`https://cdn.acedata.cloud/avatar1.png`,name:this.$t(`index.customers.name1`),job:this.$t(`index.customers.job1`),content:this.$t(`index.customers.comment1`)},{avatar:`https://cdn.acedata.cloud/avatar2.png`,name:this.$t(`index.customers.name2`),job:this.$t(`index.customers.job2`),content:this.$t(`index.customers.comment2`)},{avatar:`https://cdn.acedata.cloud/avatar3.png`,name:this.$t(`index.customers.name3`),job:this.$t(`index.customers.job3`),content:this.$t(`index.customers.comment3`)}],models:[`ChatGPT`,`Claude`,`Gemini`,`Grok`,`DeepSeek`,`Kimi`,`Midjourney`,`Flux`,`Nano Banana`,`Seedream`,`GPT Image`,`Suno`,`Veo`,`Sora`,`Kling`,`Luma`,`Hailuo`,`Seedance`]}},computed:{site(){return this.$store.state.site},capabilities(){let e=this.site?.features??{},t=[];for(let n of _){let r=n.features.find(([t])=>e[t]?.enabled);r&&t.push({key:n.key,title:this.$t(n.titleKey),subtitle:this.$t(n.subtitleKey),icon:n.icon,path:r[1]})}return t},primaryPath(){return this.capabilities[0]?.path??`/chatgpt`}},methods:{onClickCapability(e){this.$router.push(e.path)},onStart(){this.$router.push({path:this.primaryPath})},scrollToServices(){document.getElementById(`introduction`)?.scrollIntoView({behavior:`smooth`,block:`start`})}}}),y={class:`wrapper`},b={id:`banner`},x={class:`container`},S={class:`info`},C={class:`badge-new`},w={class:`title`},T={class:`subtitle`},E={class:`tagline`},D={class:`operations`},O={id:`introduction`},k={class:`container`},A={class:`title`},j={class:`subtitle`},M={class:`icon-wrapper`},N={class:`title`},P={class:`subtitle`},F={key:0,id:`chat`,class:`block`},I={class:`container`},L=[`alt`],R={class:`title`},z={class:`subtitle`},B={key:1,id:`midjourney`,class:`block`},V={class:`container`},H={class:`title`},U={class:`subtitle`},W=[`alt`],re={key:2,id:`qrart`,class:`block`},G={class:`container`},K=[`alt`],q={class:`title`},J={class:`subtitle`},Y={key:3,id:`suno`,class:`block`},X={class:`container`},ie={class:`title`},ae={class:`subtitle`},oe=[`alt`],se={key:4,id:`luma`,class:`block`},ce={class:`container`},le=[`alt`],ue={class:`title`},de={class:`subtitle`},fe={key:5,id:`headshots`,class:`block`},pe={class:`container`},me={class:`title`},he={class:`subtitle`},Z=[`alt`],ge={id:`models`,class:`models`},_e={class:`container`},ve={class:`section-title`},ye={class:`section-subtitle`},be={class:`model-wall`},xe={id:`cta`,class:`cta`},Se={class:`container`},Ce={class:`cta__title`},we={class:`cta__subtitle`};function Q(d,f,te,p,m,ne){let h=s(`el-button`),g=s(`el-col`),_=s(`el-image`),v=s(`el-row`),Q=s(`font-awesome-icon`),$=s(`el-card`);return u(),a(`div`,y,[e(`div`,b,[e(`div`,x,[r(v,null,{default:c(()=>[r(g,{md:12,xs:24,class:`left`},{default:c(()=>[e(`div`,S,[e(`span`,C,n(d.$t(`index.badge.hero`)),1),e(`h1`,w,n(d.site?.title),1),e(`h3`,T,n(d.$t(`index.subtitle.banner`)),1),e(`p`,E,n(d.$t(`index.subtitle.hero`)),1),e(`div`,D,[r(h,{type:`primary`,round:``,class:`btn-apply`,onClick:d.onStart},{default:c(()=>[t(n(d.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),r(h,{round:``,class:`btn-explore`,onClick:d.scrollToServices},{default:c(()=>[t(n(d.$t(`index.button.explore`)),1)]),_:1},8,[`onClick`])])])]),_:1}),r(g,{md:12,xs:24,class:`right`},{default:c(()=>[r(_,{src:`https://cdn.acedata.cloud/illustration1.png`,class:`brand`,alt:d.site?.title,fit:`contain`},null,8,[`alt`])]),_:1})]),_:1})])]),e(`div`,O,[e(`div`,k,[r(v,{class:`mb-6`},{default:c(()=>[r(g,{span:24},{default:c(()=>[e(`h2`,A,n(d.$t(`index.title.introduction`)),1),e(`h5`,j,n(d.$t(`index.subtitle.introduction`)),1)]),_:1})]),_:1}),r(v,{gutter:15},{default:c(()=>[(u(!0),a(o,null,l(d.capabilities,(t,i)=>(u(),ee(g,{key:i,md:6,xs:24,class:`mb-4`},{default:c(()=>[r($,{class:`info text-center`,shadow:`hover`,onClick:e=>d.onClickCapability(t)},{default:c(()=>[e(`div`,M,[r(Q,{icon:t.icon,class:`icon`},null,8,[`icon`])]),e(`h2`,N,n(t.title),1),e(`p`,P,n(t.subtitle),1)]),_:2},1032,[`onClick`])]),_:2},1024))),128))]),_:1})])]),d.site?.features?.chatgpt?.enabled?(u(),a(`div`,F,[e(`div`,I,[r(v,null,{default:c(()=>[r(g,{md:16,xs:24,class:`preview`},{default:c(()=>[e(`img`,{src:`https://cdn.acedata.cloud/axynds.png`,class:`image desktop`,alt:d.$t(`index.title.chat`),loading:`lazy`,decoding:`async`},null,8,L),f[6]||=e(`img`,{src:`https://cdn.acedata.cloud/vds4i3.png`,class:`image mobile`,alt:``,loading:`lazy`,decoding:`async`},null,-1)]),_:1}),r(g,{md:8,xs:24,class:`info`},{default:c(()=>[e(`h2`,R,n(d.$t(`index.title.chat`)),1),e(`p`,z,n(d.$t(`index.subtitle.chat`)),1),r(h,{type:`primary`,round:``,class:`btn-try`,onClick:f[0]||=e=>d.$router.push({path:`/chatgpt`})},{default:c(()=>[t(n(d.$t(`index.button.try`)),1)]),_:1})]),_:1})]),_:1})])])):i(``,!0),d.site?.features?.midjourney?.enabled?(u(),a(`div`,B,[e(`div`,V,[r(v,null,{default:c(()=>[r(g,{md:8,xs:24,class:`info`},{default:c(()=>[e(`h2`,H,n(d.$t(`index.title.midjourney`)),1),e(`p`,U,n(d.$t(`index.subtitle.midjourney`)),1),r(h,{type:`primary`,round:``,class:`btn-try`,onClick:f[1]||=e=>d.$router.push({path:`/midjourney`})},{default:c(()=>[t(n(d.$t(`index.button.try`)),1)]),_:1})]),_:1}),r(g,{md:16,xs:24,class:`preview`},{default:c(()=>[e(`img`,{src:`https://cdn.acedata.cloud/uk86mz.png`,class:`image desktop`,alt:d.$t(`index.title.midjourney`),loading:`lazy`,decoding:`async`},null,8,W),f[7]||=e(`img`,{src:`https://cdn.acedata.cloud/rvelwm.png`,class:`image mobile`,alt:``,loading:`lazy`,decoding:`async`},null,-1)]),_:1})]),_:1})])])):i(``,!0),d.site?.features?.qrart?.enabled?(u(),a(`div`,re,[e(`div`,G,[r(v,null,{default:c(()=>[r(g,{md:16,xs:24,class:`preview`},{default:c(()=>[e(`img`,{src:`https://cdn.acedata.cloud/gyogar.png`,class:`image desktop`,alt:d.$t(`index.title.qrart`),loading:`lazy`,decoding:`async`},null,8,K),f[8]||=e(`img`,{src:`https://cdn.acedata.cloud/5kunm0.png`,class:`image mobile`,alt:``,loading:`lazy`,decoding:`async`},null,-1)]),_:1}),r(g,{md:8,xs:24,class:`info`},{default:c(()=>[e(`h2`,q,n(d.$t(`index.title.qrart`)),1),e(`p`,J,n(d.$t(`index.subtitle.qrart`)),1),r(h,{type:`primary`,round:``,class:`btn-try`,onClick:f[2]||=e=>d.$router.push({path:`/qrart`})},{default:c(()=>[t(n(d.$t(`index.button.try`)),1)]),_:1})]),_:1})]),_:1})])])):i(``,!0),d.site?.features?.suno?.enabled?(u(),a(`div`,Y,[e(`div`,X,[r(v,null,{default:c(()=>[r(g,{md:8,xs:24,class:`info`},{default:c(()=>[e(`h2`,ie,n(d.$t(`index.title.suno`)),1),e(`p`,ae,n(d.$t(`index.subtitle.suno`)),1),r(h,{type:`primary`,round:``,class:`btn-try`,onClick:f[3]||=e=>d.$router.push({path:`/suno`})},{default:c(()=>[t(n(d.$t(`index.button.try`)),1)]),_:1})]),_:1}),r(g,{md:16,xs:24,class:`preview`},{default:c(()=>[e(`img`,{src:`https://cdn.acedata.cloud/2m8fn.png`,class:`image desktop`,alt:d.$t(`index.title.suno`),loading:`lazy`,decoding:`async`},null,8,oe),f[9]||=e(`img`,{src:`https://cdn.acedata.cloud/23knvs.png`,class:`image mobile`,alt:``,loading:`lazy`,decoding:`async`},null,-1)]),_:1})]),_:1})])])):i(``,!0),d.site?.features?.luma?.enabled?(u(),a(`div`,se,[e(`div`,ce,[r(v,null,{default:c(()=>[r(g,{md:16,xs:24,class:`preview`},{default:c(()=>[e(`img`,{src:`https://cdn.acedata.cloud/6kop1g.png`,class:`image desktop`,alt:d.$t(`index.title.luma`),loading:`lazy`,decoding:`async`},null,8,le),f[10]||=e(`img`,{src:`https://cdn.acedata.cloud/3kcjny.png`,class:`image mobile`,alt:``,loading:`lazy`,decoding:`async`},null,-1)]),_:1}),r(g,{md:8,xs:24,class:`info`},{default:c(()=>[e(`h2`,ue,n(d.$t(`index.title.luma`)),1),e(`p`,de,n(d.$t(`index.subtitle.luma`)),1),r(h,{type:`primary`,round:``,class:`btn-try`,onClick:f[4]||=e=>d.$router.push({path:`/luma`})},{default:c(()=>[t(n(d.$t(`index.button.try`)),1)]),_:1})]),_:1})]),_:1})])])):i(``,!0),d.site?.features?.headshots?.enabled?(u(),a(`div`,fe,[e(`div`,pe,[r(v,null,{default:c(()=>[r(g,{md:8,xs:24,class:`info`},{default:c(()=>[e(`h2`,me,n(d.$t(`index.title.headshots`)),1),e(`p`,he,n(d.$t(`index.subtitle.headshots`)),1),r(h,{type:`primary`,round:``,class:`btn-try`,onClick:f[5]||=e=>d.$router.push({path:`/headshots`})},{default:c(()=>[t(n(d.$t(`index.button.try`)),1)]),_:1})]),_:1}),r(g,{md:16,xs:24,class:`preview`},{default:c(()=>[e(`img`,{src:`https://cdn.acedata.cloud/zlyshj.png`,class:`image desktop`,alt:d.$t(`index.title.headshots`),loading:`lazy`,decoding:`async`},null,8,Z),f[11]||=e(`img`,{src:`https://cdn.acedata.cloud/8as0cx.png`,class:`image mobile`,alt:``,loading:`lazy`,decoding:`async`},null,-1)]),_:1})]),_:1})])])):i(``,!0),i(``,!0),e(`div`,ge,[e(`div`,_e,[e(`h2`,ve,n(d.$t(`index.title.models`)),1),e(`h5`,ye,n(d.$t(`index.subtitle.models`)),1),e(`div`,be,[(u(!0),a(o,null,l(d.models,(e,t)=>(u(),a(`span`,{key:t,class:`model-chip`},n(e),1))),128))])])]),e(`div`,xe,[e(`div`,Se,[e(`h2`,Ce,n(d.$t(`index.title.cta`)),1),e(`p`,we,n(d.$t(`index.subtitle.cta`)),1),r(h,{type:`primary`,round:``,class:`cta__btn`,onClick:d.onStart},{default:c(()=>[t(n(d.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`])])])])}var $=ne(v,[[`render`,Q],[`__scopeId`,`data-v-2699cde4`]]);export{$ as default};