@acedatacloud/nexior 3.329.48 → 3.329.50

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 (232) hide show
  1. package/dist/assets/{ApiCodeButton-CUd4TC1Q.js → ApiCodeButton-BQdstZ9o.js} +1 -1
  2. package/dist/assets/{Artifacts-C6tJd1rJ.js → Artifacts-BXx9uaT7.js} +1 -1
  3. package/dist/assets/{AskUserQuestionCard-BAk3vrry.js → AskUserQuestionCard-Cj3nY_7c.js} +1 -1
  4. package/dist/assets/{AudioPreview-B79qsQPJ.js → AudioPreview-4VgTsOeE.js} +1 -1
  5. package/dist/assets/{Auth-DTmylYTe.js → Auth-BMD_NYVt.js} +1 -1
  6. package/dist/assets/{Bare-BJDGc32N.js → Bare-6aTD3lUo.js} +1 -1
  7. package/dist/assets/{BotPlaceholder-BOpg76Oi.js → BotPlaceholder-Ck1mjnMM.js} +1 -1
  8. package/dist/assets/{BottomFooter-RMwOJXSt.js → BottomFooter-B3N8NY2w.js} +1 -1
  9. package/dist/assets/{Callback-3nPgcXDz.js → Callback-BbUWB7Qq.js} +1 -1
  10. package/dist/assets/{CodeSnippet-0Kb5PVy-.js → CodeSnippet-B2MmQK0Q.js} +1 -1
  11. package/dist/assets/{Console-Rxv19dQs.js → Console-CmINe76B.js} +1 -1
  12. package/dist/assets/{Consumption-CbSuHo-B.js → Consumption-CqnV6zKQ.js} +1 -1
  13. package/dist/assets/{Conversation-T41QcOYi.js → Conversation-Bq-nAp6V.js} +1 -1
  14. package/dist/assets/{Conversation-BKNU0Jp5.js → Conversation-BsiJIV_u.js} +1 -1
  15. package/dist/assets/{CopyToClipboard-DksVZ0H5.js → CopyToClipboard-rmORTzYc.js} +1 -1
  16. package/dist/assets/{Detail-YFjJT26d.js → Detail-CZtz-Wcz.js} +2 -2
  17. package/dist/assets/{Extra-B568Ycam.js → Extra-B1YqTXxc.js} +1 -1
  18. package/dist/assets/{FilePreview-kw-4u9Eq.js → FilePreview-CZc1NuMc.js} +1 -1
  19. package/dist/assets/{Hailuo-CoRkX3p_.js → Hailuo-78HzK7nv.js} +1 -1
  20. package/dist/assets/{History-D3FmC_PH.js → History-zRWsHwHR.js} +1 -1
  21. package/dist/assets/{ImagePreview-CMBKb-1b.js → ImagePreview-C_BsIyhE.js} +1 -1
  22. package/dist/assets/{ImageWrapper-ZRo3oVgf.js → ImageWrapper-DP_qfnZ_.js} +1 -1
  23. package/dist/assets/{Index-SNaausRB.js → Index-4Hwq3yoh.js} +1 -1
  24. package/dist/assets/{Index-DfWd9rzk.js → Index-BBWWYUZ1.js} +1 -1
  25. package/dist/assets/{Index-Cjlk9fby.js → Index-BCqxX3h7.js} +1 -1
  26. package/dist/assets/{Index-CnOpDNO7.js → Index-BHjSVnXl.js} +1 -1
  27. package/dist/assets/{Index-BOse1S2w.js → Index-BIogE1eS.js} +1 -1
  28. package/dist/assets/{Index-z4iIqNcQ.js → Index-BZ5yUtOl.js} +1 -1
  29. package/dist/assets/{Index-DgNnjtEb.js → Index-BgRh-iCb.js} +1 -1
  30. package/dist/assets/{Index-CJL2dVdR.js → Index-Bhkm_Q20.js} +1 -1
  31. package/dist/assets/{Index-DUpUmEwQ.js → Index-BwTiAV-E.js} +1 -1
  32. package/dist/assets/{Index-CDP6SULR.js → Index-BwWnMfeg.js} +1 -1
  33. package/dist/assets/{Index-DlxsUpUf.css → Index-C0qrnEHX.css} +1 -1
  34. package/dist/assets/{Index-Bq4Z8Lbg.js → Index-CAlqNXz8.js} +1 -1
  35. package/dist/assets/{Index-zWGsOUdx.js → Index-CVgTp_7R.js} +1 -1
  36. package/dist/assets/{Index-Dr8eRKiz.js → Index-Ccfg9u6M.js} +1 -1
  37. package/dist/assets/{Index-Bc_cAHcc.js → Index-Cg8eVS8s.js} +1 -1
  38. package/dist/assets/{Index-BY56E9wv.js → Index-CgMihG4b.js} +1 -1
  39. package/dist/assets/{Index-m_oLdH4j.js → Index-Cp9ocM8P.js} +1 -1
  40. package/dist/assets/{Index-97Ht0gLO.js → Index-CvbVThSE.js} +1 -1
  41. package/dist/assets/{Index-DKsOjaVB.js → Index-D1aPk8iT.js} +1 -1
  42. package/dist/assets/{Index-BV7_-jIc.js → Index-DCWOzRNM.js} +1 -1
  43. package/dist/assets/{Index-CgMnnBPg.js → Index-DHVxf1gH.js} +1 -1
  44. package/dist/assets/{Index-BnJqhsiA.css → Index-DQYsJlw6.css} +1 -1
  45. package/dist/assets/Index-DRLwa_7m.js +1 -0
  46. package/dist/assets/{Index-aGsKYlRu.js → Index-DWjZp31p.js} +1 -1
  47. package/dist/assets/{Index-DporlAKp.js → Index-Dl8LX5Vd.js} +1 -1
  48. package/dist/assets/{Index-DTa_wwWT.js → Index-DnBgBblJ.js} +1 -1
  49. package/dist/assets/{Index-ErXi8zLF.js → Index-DxoeQdsk.js} +1 -1
  50. package/dist/assets/{Index-Cv-ZIV7e.js → Index-E_S3tTFO.js} +1 -1
  51. package/dist/assets/{Index-DPjlDjX_.js → Index-TU-sLpQv.js} +1 -1
  52. package/dist/assets/{Index-DsSJB2bN.css → Index-Y-iZg6hM.css} +1 -1
  53. package/dist/assets/{Index-BwudR60x.js → Index-gwmFRkye.js} +1 -1
  54. package/dist/assets/{Index-Cm9atCUl.js → Index-jbctdNGA.js} +1 -1
  55. package/dist/assets/{Invitees-B1MEzafV.js → Invitees-pcLaY6el.js} +1 -1
  56. package/dist/assets/{List-CjNAVR6Y.js → List-BVEGFvMm.js} +1 -1
  57. package/dist/assets/{List-BspjYhhX.js → List-CQ7FyJVe.js} +1 -1
  58. package/dist/assets/{List-D2VYnD70.js → List-RubkIktz.js} +1 -1
  59. package/dist/assets/{LocalTools-Cn6y81Dt.js → LocalTools-BEtyOdPc.js} +1 -1
  60. package/dist/assets/{LocalTools-BlvIiyES.js → LocalTools-CKMMkNof.js} +1 -1
  61. package/dist/assets/{Main-DCVEjQlX.js → Main-BRG3fgFT.js} +1 -1
  62. package/dist/assets/{Message-p-0ZaZ3D.js → Message-h9svHwcT.js} +1 -1
  63. package/dist/assets/{Model-CSt9IxHH.js → Model-Buv5RDTA.js} +1 -1
  64. package/dist/assets/{Navigator-mrUaF5Xu.js → Navigator-CDn1-zJX.js} +3 -3
  65. package/dist/assets/{NotFound-ebgMmCMf.js → NotFound-B9buoNpm.js} +1 -1
  66. package/dist/assets/{Pay-BLwY_ZgY.js → Pay-D2XzBXBl.js} +1 -1
  67. package/dist/assets/{Player-CKf4KxUi.js → Player-CF2KaNMU.js} +1 -1
  68. package/dist/assets/{PromptTextarea-BKlwJ34c.js → PromptTextarea-DbxCyFDP.js} +1 -1
  69. package/dist/assets/{RealtimeCall-Dibrova3.js → RealtimeCall-BBBq2XHw.js} +1 -1
  70. package/dist/assets/{ScheduledTasks-CCgDV0mI.js → ScheduledTasks-CqO1-HAJ.js} +1 -1
  71. package/dist/assets/{Status-CyNJSpU-.js → Status-cFY4YqIR.js} +1 -1
  72. package/dist/assets/{Subscribe-BIGEu9ci.js → Subscribe-EP-3GWh9.js} +1 -1
  73. package/dist/assets/{TabSwitcher-BhrQkSUX.js → TabSwitcher-B99C8gb3.js} +1 -1
  74. package/dist/assets/{Tts-CKa0tK3j.js → Tts-qDiiNvEW.js} +1 -1
  75. package/dist/assets/{VideoPlayer-CChGJzkB.js → VideoPlayer-BYVFHaXG.js} +1 -1
  76. package/dist/assets/{alert-DqN2o6YF.js → alert-x8mYlhuj.js} +1 -1
  77. package/dist/assets/arrow-down-D8ZQ5fMG.js +1 -0
  78. package/dist/assets/{arrow-down-wide-narrow-Buoufpkp.js → arrow-down-wide-narrow-Kp7dCPTK.js} +1 -1
  79. package/dist/assets/arrow-left-B9DAQ5Lp.js +1 -0
  80. package/dist/assets/arrow-right-CY4eAHGV.js +1 -0
  81. package/dist/assets/arrow-up-BoWYVqpg.js +1 -0
  82. package/dist/assets/{avatar-C67xeXe2.js → avatar-xY62EGRe.js} +1 -1
  83. package/dist/assets/{basic-mfZYbhPD.js → basic-Bg9zZwJ6.js} +1 -1
  84. package/dist/assets/{box-vQGTyK9k.js → box-BEZ5ejlY.js} +1 -1
  85. package/dist/assets/{boxes-CJUZpl0g.js → boxes-DDscYXMD.js} +1 -1
  86. package/dist/assets/{brain-2ACSFiZj.js → brain-B939VD09.js} +1 -1
  87. package/dist/assets/{chart-no-axes-combined-CuDdWnPI.js → chart-no-axes-combined-CpGOEj7A.js} +1 -1
  88. package/dist/assets/{chat-C-VJhlQg.js → chat-Rfajry4H.js} +1 -1
  89. package/dist/assets/check-By7SyT1y.js +1 -0
  90. package/dist/assets/chevron-down-D_HKprqu.js +1 -0
  91. package/dist/assets/chevron-right-BIDd1rZo.js +1 -0
  92. package/dist/assets/circle-check-CxdRmME4.js +1 -0
  93. package/dist/assets/clock-C4q08wwy.js +1 -0
  94. package/dist/assets/{codingBridge-DQeEu9WX.js → codingBridge-EBF8j-ix.js} +1 -1
  95. package/dist/assets/{codingBridgeNotify-B5fAwLEm.js → codingBridgeNotify-CXm1OPK1.js} +2 -2
  96. package/dist/assets/{coins-BhXlFnOf.js → coins-BTu5thzB.js} +1 -1
  97. package/dist/assets/{collapse-Dy8fIdv6.js → collapse-Dr4wi752.js} +1 -1
  98. package/dist/assets/{createTaskActions-DJGgfJN0.js → createTaskActions-CT0k2Xot.js} +1 -1
  99. package/dist/assets/{digitalhuman-Dc3Gk5rX.js → digitalhuman-OXBSy9dw.js} +1 -1
  100. package/dist/assets/{dollar-sign-DiY9-ZBQ.js → dollar-sign-BkrT7-Sj.js} +1 -1
  101. package/dist/assets/{download-CI5Jd4FJ.js → download-DVE_LhWD.js} +1 -1
  102. package/dist/assets/{drawer-Bu5U_TlI.js → drawer-D6k00NQl.js} +1 -1
  103. package/dist/assets/{dropdown-69AAWB19.js → dropdown-CLTki_ih.js} +1 -1
  104. package/dist/assets/{dropdown-CuFpphV8.js → dropdown-VHkvYoL4.js} +1 -1
  105. package/dist/assets/{ellipsis-uGl7Jieg.js → ellipsis-Cob9XmBW.js} +1 -1
  106. package/dist/assets/{esm-C2Ej_bhP.js → esm-BUfIiLZD.js} +1 -1
  107. package/dist/assets/{esm-DLnqcqcl.js → esm-CY9pk-jr.js} +3 -3
  108. package/dist/assets/{esm-CSjv2Pg2.js → esm-CqCk5Tda.js} +1 -1
  109. package/dist/assets/{esm-BO6NqMVn.js → esm-DAm7ZZSK.js} +2 -2
  110. package/dist/assets/{esm-BGcapq40.js → esm-EEjikD0b.js} +2 -2
  111. package/dist/assets/{esm-i-VNWaST.js → esm-Ml658jQt.js} +1 -1
  112. package/dist/assets/esm-veBslxpk.js +1 -0
  113. package/dist/assets/{external-link-iO9U5G_p.js → external-link-RIX3x3j6.js} +1 -1
  114. package/dist/assets/{eye-KPLUUK_j.js → eye-KUfFEUJZ.js} +1 -1
  115. package/dist/assets/{file-output-BOWkai4z.js → file-output-BHblcI1H.js} +1 -1
  116. package/dist/assets/{file-text-GbKKvGZq.js → file-text-DtBp2Tgm.js} +1 -1
  117. package/dist/assets/{fish-CJjBkxHA.js → fish-KFRHkqIm.js} +1 -1
  118. package/dist/assets/{flux-MU-Twzwq.js → flux-CrBEaL-w.js} +1 -1
  119. package/dist/assets/{folder-WCye0Ois.js → folder-DhGoROwY.js} +1 -1
  120. package/dist/assets/gauge-CCJDsVbm.js +1 -0
  121. package/dist/assets/{globe-gky47OHr.js → globe-Cr0XXyWC.js} +1 -1
  122. package/dist/assets/{grokvideo-CD4qvucx.js → grokvideo-CFWGzqnP.js} +1 -1
  123. package/dist/assets/{hailuo-B8E1zt6U.js → hailuo-CQgBvRrN.js} +1 -1
  124. package/dist/assets/{headphones-DY1Xvny6.js → headphones-DjCXtWtW.js} +1 -1
  125. package/dist/assets/{history-BkkJL8mx.js → history-D7t11VI6.js} +1 -1
  126. package/dist/assets/{image-acE7lpK-.js → image-D9hVe2An.js} +1 -1
  127. package/dist/assets/{index-C16Hj9CP.js → index-h4BcqHjk.js} +3 -3
  128. package/dist/assets/{index.browser.esm-D6T-JSJl.js → index.browser.esm-Cj1UsO96.js} +1 -1
  129. package/dist/assets/{index.es-zdAKJtm2.js → index.es-Cbeh0C71.js} +1 -1
  130. package/dist/assets/{info-xDtf26MC.js → info-7QlewFBX.js} +1 -1
  131. package/dist/assets/{input-number-sKcZZmDs.js → input-number-CZgZJsF5.js} +1 -1
  132. package/dist/assets/{key-round-DNrwciWi.js → key-round-4vLoXXxg.js} +1 -1
  133. package/dist/assets/{kling-IgC9Uc_D.js → kling-DQuSLQvP.js} +1 -1
  134. package/dist/assets/{languages-BlC_iryL.js → languages-yHenK2uT.js} +1 -1
  135. package/dist/assets/{laptop-STm5xUdN.js → laptop-DI_e4ODd.js} +1 -1
  136. package/dist/assets/{lightbulb-DOomeZMy.js → lightbulb-Cbx7aB6y.js} +1 -1
  137. package/dist/assets/{link-W5DEJ7Uk.js → link-HE8UnMl5.js} +1 -1
  138. package/dist/assets/loader-circle-HkqnQLcn.js +1 -0
  139. package/dist/assets/{luma-wGSGreEF.js → luma-D7DLk-Ge.js} +1 -1
  140. package/dist/assets/{maestro-CZu9r2f7.js → maestro-C5srumVZ.js} +1 -1
  141. package/dist/assets/{mail-CBnj3cVy.js → mail-Dg-OWp-W.js} +1 -1
  142. package/dist/assets/{message-circle-UEvfGSS-.js → message-circle-_lAyr9pO.js} +1 -1
  143. package/dist/assets/{mic-CsONQRhm.js → mic-BwlJidQk.js} +1 -1
  144. package/dist/assets/{midjourney-BYA7_uqE.js → midjourney-BGP9e45v.js} +1 -1
  145. package/dist/assets/{mobileLocalExec-B6PSMW1Q.js → mobileLocalExec-D_TlyyLb.js} +2 -2
  146. package/dist/assets/{mouse-pointer-2-B9t6O3Gg.js → mouse-pointer-2-9NtAMIrw.js} +1 -1
  147. package/dist/assets/music-2-vR9_vMzq.js +1 -0
  148. package/dist/assets/{nanobanana-Y1Z-gHXw.js → nanobanana-BP0ebcOC.js} +1 -1
  149. package/dist/assets/{omni-DUL7IPNp.js → omni-Y3pm7jFq.js} +1 -1
  150. package/dist/assets/{openaiimage-5wEFa5-C.js → openaiimage-DiJr8Nvu.js} +1 -1
  151. package/dist/assets/{pagination-bKCTJxMn.js → pagination-Dj04WTpX.js} +1 -1
  152. package/dist/assets/{pagination-Bx8kvO1A.js → pagination-jAKTlMGg.js} +1 -1
  153. package/dist/assets/{palette-ZBmOOf30.js → palette-C3ujZ8BC.js} +1 -1
  154. package/dist/assets/{paperclip-BbionhTy.js → paperclip-B0nw-Qaf.js} +1 -1
  155. package/dist/assets/{pause-D1NbBC3F.js → pause-CG0UDByu.js} +1 -1
  156. package/dist/assets/{pencil-BK6Gy5V2.js → pencil-nTiWk3T7.js} +1 -1
  157. package/dist/assets/{pika-gcoIcs7I.js → pika-CoPaIOh6.js} +1 -1
  158. package/dist/assets/{pixverse-Ce74efEs.js → pixverse-CxqpkBPT.js} +1 -1
  159. package/dist/assets/play-tg4PKtQy.js +1 -0
  160. package/dist/assets/plus-BCeJVIcm.js +1 -0
  161. package/dist/assets/{popover-CktFYVov.js → popover-Dmn1Ifdn.js} +1 -1
  162. package/dist/assets/{producer-B4Cod3RR.js → producer-oNZVnb-3.js} +1 -1
  163. package/dist/assets/{qrart-BXdJvg5k.js → qrart-ISCRU-QQ.js} +1 -1
  164. package/dist/assets/{realtime-BU-yTh0g.js → realtime-COGDAX4r.js} +1 -1
  165. package/dist/assets/{refresh-cw-B14q5VI2.js → refresh-cw-CJowjzuP.js} +1 -1
  166. package/dist/assets/rotate-ccw-Bvzx9o_5.js +1 -0
  167. package/dist/assets/rotate-cw-BUhTjOZ5.js +1 -0
  168. package/dist/assets/{row-SUcM9Qp5.js → row-Dbo9j6N1.js} +1 -1
  169. package/dist/assets/search-DvJzLqVd.js +1 -0
  170. package/dist/assets/{seedance-DK6IFr-i.js → seedance-CamZk3VW.js} +1 -1
  171. package/dist/assets/{seedream-D7SB4_Cd.js → seedream-B7oXMpvP.js} +1 -1
  172. package/dist/assets/{select-DZCaWKok.js → select-DuspBjxM.js} +1 -1
  173. package/dist/assets/{serp-CmkITspi.js → serp-CdhyW3n_.js} +1 -1
  174. package/dist/assets/{shield-CirL9rYD.js → shield-DN9xtQPd.js} +1 -1
  175. package/dist/assets/{shuffle-DbGtBwoV.js → shuffle-CzWQZh64.js} +1 -1
  176. package/dist/assets/{slider-CpiDxKBE.js → slider-D13c5Wz0.js} +1 -1
  177. package/dist/assets/{sliders-horizontal-DsxTazyi.js → sliders-horizontal-CR4fCrO-.js} +1 -1
  178. package/dist/assets/{solana-wallets-a1MC468A.js → solana-wallets-BoX5DsoZ.js} +2 -2
  179. package/dist/assets/{solana-wallets-vue-CfTx3YZk.js → solana-wallets-vue-uxxHunFw.js} +1 -1
  180. package/dist/assets/{sora-iw8M6y1-.js → sora-COeAT6jk.js} +1 -1
  181. package/dist/assets/square-CLPs_q8l.js +1 -0
  182. package/dist/assets/{suno-CWtgvby0.js → suno-BB2-8ySl.js} +1 -1
  183. package/dist/assets/{switch-CjwwXJJ-.js → switch-DGjAGv1c.js} +1 -1
  184. package/dist/assets/{table-CLwvS0sW.js → table-C4lekjnN.js} +1 -1
  185. package/dist/assets/{tabs-8UTEJ0Bg.js → tabs-CYLrPpdu.js} +1 -1
  186. package/dist/assets/{tag-C4dI4B-9.js → tag-DvqDd89_.js} +1 -1
  187. package/dist/assets/{taskDrawerMixin-CrFn6ABi.js → taskDrawerMixin-D23gnPya.js} +1 -1
  188. package/dist/assets/terminal-BUNlX6R9.js +1 -0
  189. package/dist/assets/{time-picker-CXAZNY2Q.js → time-picker-cYF7587-.js} +1 -1
  190. package/dist/assets/{tooltip-CI4l4DOg.js → tooltip-O0jUmp8_.js} +1 -1
  191. package/dist/assets/{trash-2-GVGOLvcA.js → trash-2-D-aX1rGS.js} +1 -1
  192. package/dist/assets/{triangle-alert-DPU3gv8f.js → triangle-alert-BC93Xt4w.js} +1 -1
  193. package/dist/assets/{upload-DOmU-ynH.js → upload-BNaHShNL.js} +1 -1
  194. package/dist/assets/{upload-CbGx0SCQ.js → upload-CP3jRoVn.js} +1 -1
  195. package/dist/assets/user-B7nRG0YD.js +1 -0
  196. package/dist/assets/{veo-Bf28OHSd.js → veo-qk8-WnH2.js} +1 -1
  197. package/dist/assets/{video-CFaTzy2y.js → video-PsDBoU-r.js} +1 -1
  198. package/dist/assets/{volume-2-Cbn1UYkN.js → volume-2-B2MwCpKu.js} +1 -1
  199. package/dist/assets/{wallet-DVK5OHZ5.js → wallet-DbeMlRJW.js} +1 -1
  200. package/dist/assets/{wan-VUasMXOX.js → wan-AEsiNRwZ.js} +1 -1
  201. package/dist/assets/{wand-sparkles-pGeyau5p.js → wand-sparkles-Cfgyd-ZM.js} +1 -1
  202. package/dist/assets/{web-BdgXwNzm.js → web-8xFFHy8W.js} +1 -1
  203. package/dist/assets/{web-B37ni2dJ.js → web-Bmmi65iA.js} +1 -1
  204. package/dist/assets/{web-BaDJ-1i-.js → web-C96dukF7.js} +1 -1
  205. package/dist/assets/{web-CrbPOLY_.js → web-CgBdBzkx.js} +1 -1
  206. package/dist/assets/{web-BWqgHW3j.js → web-VFMYFBBk.js} +1 -1
  207. package/dist/assets/{webextrator-DbNwwNvU.js → webextrator-WsM58C2G.js} +1 -1
  208. package/dist/assets/{zap-B_H9Zf2S.js → zap-Cnylgx57.js} +1 -1
  209. package/dist/index.html +1 -1
  210. package/package.json +1 -1
  211. package/dist/assets/Index-tJcqojay.js +0 -1
  212. package/dist/assets/arrow-down-DUIM87dr.js +0 -1
  213. package/dist/assets/arrow-left-Bk7Iz8yw.js +0 -1
  214. package/dist/assets/arrow-right-DSS0Q7Mo.js +0 -1
  215. package/dist/assets/arrow-up-3Qhg_QJg.js +0 -1
  216. package/dist/assets/check-C0Gs-lfy.js +0 -1
  217. package/dist/assets/chevron-down-BBmFbMp3.js +0 -1
  218. package/dist/assets/chevron-right-DCcsG5ir.js +0 -1
  219. package/dist/assets/circle-check-DHZcjMim.js +0 -1
  220. package/dist/assets/clock-C90hJcW0.js +0 -1
  221. package/dist/assets/esm-DAugeQPl.js +0 -1
  222. package/dist/assets/gauge-Cufmm3HO.js +0 -1
  223. package/dist/assets/loader-circle-BAN1HyBA.js +0 -1
  224. package/dist/assets/music-2-CWMjS73t.js +0 -1
  225. package/dist/assets/play-umucbTo-.js +0 -1
  226. package/dist/assets/plus-DCYr1oKd.js +0 -1
  227. package/dist/assets/rotate-ccw-DYfFyP6x.js +0 -1
  228. package/dist/assets/rotate-cw-Bx7w_ZpJ.js +0 -1
  229. package/dist/assets/search-CriN9waJ.js +0 -1
  230. package/dist/assets/square-DLpzzDVj.js +0 -1
  231. package/dist/assets/terminal-CRSsf52D.js +0 -1
  232. package/dist/assets/user-C4S922yU.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{r as y,t as b}from"./select-DZCaWKok.js";import{n as x,t as S}from"./tabs-8UTEJ0Bg.js";import{t as C}from"./upload-DOmU-ynH.js";import{t as w}from"./tooltip-CI4l4DOg.js";import{t as T}from"./alert-DqN2o6YF.js";import{n as E,r as D}from"./radio-B0Elgaw9.js";import{t as O}from"./drawer-Bu5U_TlI.js";import{t as k}from"./input-number-sKcZZmDs.js";import{t as A}from"./slider-CpiDxKBE.js";import{t as j}from"./switch-CjwwXJJ-.js";import{n as M}from"./taskDrawerMixin-CrFn6ABi.js";import{t as ee}from"./clock-C90hJcW0.js";import{t as te}from"./CopyToClipboard-DksVZ0H5.js";import{r as ne,t as re}from"./PromptTextarea-BKlwJ34c.js";import{t as ie}from"./headphones-DY1Xvny6.js";import{t as ae}from"./info-xDtf26MC.js";import{t as oe}from"./lightbulb-DOomeZMy.js";import{t as se}from"./triangle-alert-DPU3gv8f.js";import{t as N}from"./upload-CbGx0SCQ.js";import{t as P}from"./wand-sparkles-pGeyau5p.js";import{ci as ce,ii as le,li as F,si as ue}from"./constants-D-3QKDN1.js";import{$t as I,Ai as L,Bt as R,E as z,Ht as B,Oi as de,Vn as V,Vt as fe,Wt as pe,ei as me,gi as H,hi as U,mr as W,pi as he,ri as G,zi as K,zt as q}from"./index-C16Hj9CP.js";import{t as ge}from"./FilePreview-kw-4u9Eq.js";import{t as J}from"./ImagePreview-CMBKb-1b.js";import{t as Y}from"./Consumption-CbSuHo-B.js";import{a as X,n as _e,r as ve,t as ye}from"./pagination-Bx8kvO1A.js";import{t as be}from"./VideoPlayer-CChGJzkB.js";import{t as xe}from"./ApiCodeButton-CUd4TC1Q.js";import{t as Se}from"./BotPlaceholder-BOpg76Oi.js";import{n as Ce,t as we}from"./AudioPreview-B79qsQPJ.js";var Te=v({name:`LayoutKling`,components:{MagicIcon:P,ElDrawer:O,ElButton:L},mixins:[M]}),Ee={class:`main flex flex-row flex-1 min-h-0`},De={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},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(`magic-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`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Ae=z(Te,[[`render`,ke],[`__scopeId`,`data-v-2d826924`]]),je={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};function Z(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,referenceVideo:!1,referenceImages:!1};case`kling-v1-6`:case`kling-v2-5-turbo`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v2-6`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:r===`pro`,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v2-master`:case`kling-v2-1-master`:return{text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v3`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:r!==`4k`,referenceVideo:!1,referenceImages:!1};case`kling-v3-omni`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:!1,referenceVideo:!0,referenceImages:!0};case`kling-o1`:return{text2video:!0,image2video:!0,endImage:!0,audio:!1,motionControl:!1,referenceVideo:!0,referenceImages:!0};default:return je}}var Q=`<<<video_1>>>`,Me=/<<<image_\d+>>>/g;function Ne(e){return e?e.split(Q).join(` `).replace(/\s{2,}/g,` `).trim():``}function Pe(e){return e?e.replace(Me,` `).replace(/\s{2,}/g,` `).trim():``}function Fe(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=Z(n,r,i),o=[];e.end_image_url&&!a.endImage&&o.push({field:`end_image_url`,i18nLabel:`kling.name.endImage`}),e.generate_audio&&!a.audio&&o.push({field:`generate_audio`,i18nLabel:`kling.name.generateAudio`}),e.camera_control?.type&&(!a.motionControl||e.start_image_url)&&o.push({field:`camera_control`,i18nLabel:`kling.name.cameraControl`}),e.video_list?.length&&!a.referenceVideo&&o.push({field:`video_list`,i18nLabel:`kling.name.referenceVideo`}),e.image_list?.length&&!a.referenceImages&&o.push({field:`image_list`,i18nLabel:`kling.name.referenceImages`});let s=n===`kling-o1`||!!(e.image_list?.length||e.video_list?.length);return s&&e.cfg_scale!==void 0&&o.push({field:`cfg_scale`,i18nLabel:`kling.name.cfgScale`}),s&&e.negative_prompt&&o.push({field:`negative_prompt`,i18nLabel:`kling.name.negativePrompt`}),o}function Ie(e,t){let n={...e};for(let e of t)e.field===`end_image_url`&&(n.end_image_url=void 0),e.field===`generate_audio`&&(n.generate_audio=!1),e.field===`camera_control`&&(n.camera_control=void 0),e.field===`cfg_scale`&&(n.cfg_scale=void 0),e.field===`negative_prompt`&&(n.negative_prompt=void 0),e.field===`video_list`&&(n.video_list=void 0,n.prompt=Ne(n.prompt)),e.field===`image_list`&&(n.image_list=void 0,n.prompt=Pe(n.prompt));return n}var Le=v({name:`ModelSelector`,components:{ElSelect:y,ElOption:b},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{revertKey:0,options:[{value:`kling-v3`,label:`v3`},{value:`kling-v3-omni`,label:`v3-Omni`},{value:`kling-v2-6`,label:`v2.6`},{value:`kling-v2-5-turbo`,label:`v2.5-Turbo`},{value:`kling-v2-1-master`,label:`v2.1-Master`},{value:`kling-v2-master`,label:`v2-Master`},{value:`kling-v1-6`,label:`v1.6`},{value:`kling-v1`,label:`v1`},{value:`kling-o1`,label:`Kling O1`}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(le)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=Fe(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await U.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=Ie({...t,model:e},n);this.$store.commit(`kling/setConfig`,i),H.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})}}}),Re={class:`field`},ze={class:`title font-bold`};function Be(t,n,r,a,o,u){let d=l(`el-option`),m=l(`el-select`);return g(),s(`div`,Re,[e(`h2`,ze,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 Ve=z(Le,[[`render`,Be],[`__scopeId`,`data-v-a74e7f31`]]),He=v({name:`ModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:X},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},cameraControlSet(){return!!this.$store.state.kling?.config?.camera_control?.type},fourKReason(){return F.includes(this.selectedModel)?this.cameraControlSet?this.$t(`kling.description.mode4kIncompatibleCamera`):``:this.$t(`kling.description.mode4kRequiresV3`)},options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`),disabled:!1,disabledReason:``},{value:`pro`,label:this.$t(`kling.name.modePro`),disabled:!1,disabledReason:``},{value:`4k`,label:this.$t(`kling.name.mode4k`),disabled:!!this.fourKReason,disabledReason:this.fourKReason}]},value(){return this.$store.state.kling?.config?.mode}},watch:{fourKReason(e){e&&this.value===`4k`&&this.applyMode(`std`)}},mounted(){this.value||this.applyMode(`std`)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=Fe(t,{mode:e});if(n.length===0){this.applyMode(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await U.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=Ie({...t,mode:e},n);this.$store.commit(`kling/setConfig`,i),H.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})}}}),Ue={class:`field`},We={class:`header`},Ge={class:`title font-bold`},Ke={key:0,class:`opt-tip`};function qe(t,r,u,d,m,_){let v=l(`info-icon`),y=l(`el-option`),b=l(`el-select`);return g(),s(`div`,Ue,[e(`div`,We,[e(`h2`,Ge,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`,Ke,i(t.disabledReason),1)):o(``,!0)]),_:2},1032,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var Je=z(He,[[`render`,qe],[`__scopeId`,`data-v-9a8fa3c5`]]),Ye=[3,5,8,10,12,15],Xe=[5,10],Ze=[5],Qe=v({name:`DurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:X},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},isV3Model(){return F.includes(this.selectedModel)},allowedDurations(){return this.selectedModel===`kling-o1`?Ze:this.isV3Model?Ye:Xe},value(){return this.$store.state.kling?.config?.duration??5},selectValue(){let e=this.allowedDurations;return e.includes(this.value)?this.value:e.includes(5)?5:e[0]}},watch:{selectedModel(){this.allowedDurations.includes(this.value)||this.applyDuration(5)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(5)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=Fe(t,{duration:e});if(n.length===0){this.applyDuration(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await U.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=Ie({...t,duration:e},n);this.$store.commit(`kling/setConfig`,i),H.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})}}}),$e={class:`field`},et={class:`control`},tt={class:`label`},nt={class:`title font-bold`};function rt(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,$e,[e(`div`,et,[e(`div`,tt,[e(`h2`,nt,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 it=z(Qe,[[`render`,rt],[`__scopeId`,`data-v-496bf31c`]]),at=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`}}),ot={class:`text-sm font-bold mb-2 block`},st={class:`items`},ct=[`onClick`],lt={class:`name`};function ut(t,r,a,o,l,u){return g(),s(`div`,null,[e(`span`,ot,i(t.$t(`kling.name.ratio`)),1),e(`div`,st,[(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`,lt,i(r.label),1)],10,ct))),128))])])}var dt=z(at,[[`render`,ut],[`__scopeId`,`data-v-cdb14b2f`]]),ft=v({name:`StartImage`,components:{UploadIcon:N,ElUpload:C,ElButton:L,ElTooltip:w,InfoIcon:X,ImagePreview:J},mixins:[B,R],emits:[`change`],data(){return{fileList:[],uploadUrl:G()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},value:{get(){return this.$store.state?.kling?.config?.start_image_url},set(){}}},watch:{value(e){!e&&this.fileList.length>0&&(this.fileList=[])}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){H.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){H.error(this.$t(`kling.message.uploadReferencesError`))},onBeforeUpload(){let e=this.$store.state.kling?.config||{};if(e.video_list?.[0]?.refer_type===`base`)return H.warning(this.$t(`kling.message.baseVideoFrameConflict`)),!1;let t=e.video_list?.length?4:7;return(e.image_list?.length||0)+Number(!!e.end_image_url)+1>t?(H.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:t})),!1):!0},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetStartImageUrl()}}}),pt={class:`relative`},mt={class:`flex min-h-8 items-center pr-20`},ht={class:`flex justify-start items-center`},gt={class:`text-sm font-bold`};function _t(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,pt,[e(`div`,mt,[e(`div`,ht,[e(`span`,gt,i(t.$t(`kling.name.startImage`)),1),a(h,{content:t.$t(`kling.description.uploadStartImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,disabled:t.reachedLimit,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"before-upload":t.onBeforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.$t(`kling.message.uploadReferencesExceed`),disabled:!t.reachedLimit,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.reachedLimit},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`disabled`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var vt=z(ft,[[`render`,_t],[`__scopeId`,`data-v-0220ed34`]]),yt=v({name:`EndImage`,components:{UploadIcon:N,ElUpload:C,ElButton:L,ElTooltip:w,ImagePreview:J,InfoIcon:X},mixins:[B,R],data(){return{fileList:[],uploadUrl:G()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},klingConfig(){return this.$store.state?.kling?.config||{}},endImageSupported(){return Z(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},hasStartImage(){return!!this.klingConfig.start_image_url},uploadDisabled(){return this.reachedLimit||!this.endImageSupported||!this.hasStartImage},uploadTooltip(){return this.endImageSupported?this.hasStartImage?this.reachedLimit?this.$t(`kling.message.uploadReferencesExceed`):``:this.$t(`kling.message.endImageRequiresStart`):this.$t(`kling.message.endImageNotSupported`)},storeValue(){return this.klingConfig.end_image_url},value:{get(){return this.storeValue},set(){}}},watch:{storeValue(e){!e&&this.fileList.length>0&&(this.fileList=[])},hasStartImage(e){!e&&this.storeValue&&(this.fileList=[],this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,end_image_url:void 0}))}},mounted(){this.value||=void 0,this.onSetEndImageUrl()},methods:{onBeforeUpload(){if(!this.endImageSupported)return H.warning(this.$t(`kling.message.endImageNotSupported`)),!1;if(!this.hasStartImage)return H.warning(this.$t(`kling.message.endImageRequiresStart`)),!1;if(this.klingConfig.video_list?.[0]?.refer_type===`base`)return H.warning(this.$t(`kling.message.baseVideoFrameConflict`)),!1;let e=this.klingConfig.video_list?.length?4:7;return(this.klingConfig.image_list?.length||0)+2>e?(H.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:e})),!1):!0},onExceed(){H.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){H.error(this.$t(`kling.message.uploadReferencesError`))},onSetEndImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetEndImageUrl()}}}),bt={class:`relative`},xt={class:`flex min-h-8 items-center pr-20`},St={class:`flex justify-start items-center`},Ct={class:`text-sm font-bold`};function wt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,bt,[e(`div`,xt,[e(`div`,St,[e(`span`,Ct,i(t.$t(`kling.name.endImage`)),1),a(h,{content:t.$t(`kling.description.uploadEndImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,disabled:t.uploadDisabled,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"before-upload":t.onBeforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`disabled`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Tt=z(yt,[[`render`,wt],[`__scopeId`,`data-v-b2eaa919`]]),Et=v({name:`ReferenceVideo`,components:{ElUpload:C,ElButton:L,ElRadioButton:E,ElRadioGroup:D,ElSwitch:j,InfoIcon:X,FilePreview:ge,UploadIcon:N},mixins:[R],data(){return{fileList:[],uploadUrl:G()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},config(){return this.$store.state.kling?.config||{}},hasVideo(){return!!this.urls?.[0]},referenceType:{get(){return this.config.video_list?.[0]?.refer_type||`feature`},set(e){this.updateVideoOptions(e,this.keepOriginalSound)}},keepOriginalSound:{get(){return this.config.video_list?.[0]?.keep_original_sound===`yes`},set(e){this.updateVideoOptions(this.referenceType,e)}}},methods:{onExceed(){H.warning(this.$t(`kling.message.referenceVideoExceed`))},onError(){H.error(this.$t(`kling.message.referenceVideoError`))},beforeUpload(e){if((this.config.image_list?.length||0)+Number(!!this.config.start_image_url)+Number(!!this.config.end_image_url)>4)return H.error(this.$t(`kling.message.referenceVideoImageLimit`)),!1;let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=e.size/1024/1024<200;return t?n?!0:(H.error(this.$t(`kling.message.referenceVideoSizeExceed`)),!1):(H.error(this.$t(`kling.message.referenceVideoTypeFailed`)),!1)},ensurePromptToken(e){let t=this.$store.state.kling?.config,n=t?.prompt||``,r=n.includes(Q),i;if(e&&!r)i=n?`${n} ${Q}`:Q;else if(!e&&r)i=Ne(n);else return;this.$store.commit(`kling/setConfig`,{...t,prompt:i})},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,video_list:void 0}),this.ensurePromptToken(!1)},onSetVideoList(){let e=this.urls?.[0],t=e?[{video_url:e,refer_type:this.referenceType,keep_original_sound:this.keepOriginalSound?`yes`:`no`}]:void 0;this.$store.commit(`kling/setConfig`,{...this.config,video_list:t,generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0}),this.ensurePromptToken(!!e)},updateVideoOptions(e,t){let n=this.urls?.[0];n&&this.$store.commit(`kling/setConfig`,{...this.config,video_list:[{video_url:n,refer_type:e,keep_original_sound:t?`yes`:`no`}],...e===`base`?{start_image_url:void 0,end_image_url:void 0}:{},generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0})},async onSuccess(){this.onSetVideoList()}}}),Dt={class:`relative`},Ot={class:`flex min-h-8 items-center pr-20`},kt={class:`flex justify-start items-center`},At={class:`text-sm font-bold`},jt={key:0,class:`reference-options mt-3 flex flex-col gap-3`},Mt={class:`flex flex-col items-stretch gap-2 sm:flex-row sm:items-center sm:justify-between`},Nt={class:`text-sm`},Pt={class:`flex items-center justify-between gap-3`},Ft={class:`text-sm`};function It(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`),x=l(`el-radio-button`),S=l(`el-radio-group`),C=l(`el-switch`);return g(),s(`div`,Dt,[e(`div`,Ot,[e(`div`,kt,[e(`span`,At,i(t.$t(`kling.name.referenceVideo`)),1),a(h,{content:t.$t(`kling.description.omniReferenceVideo`)},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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferenceVideo`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`]),t.hasVideo?(g(),s(`div`,jt,[e(`div`,Mt,[e(`span`,Nt,i(t.$t(`kling.name.referenceVideoType`)),1),a(S,{modelValue:t.referenceType,"onUpdate:modelValue":n[1]||=e=>t.referenceType=e,size:`small`},{default:p(()=>[a(x,{value:`feature`},{default:p(()=>[r(i(t.$t(`kling.name.referenceVideoFeature`)),1)]),_:1}),a(x,{value:`base`},{default:p(()=>[r(i(t.$t(`kling.name.referenceVideoBase`)),1)]),_:1})]),_:1},8,[`modelValue`])]),e(`div`,Pt,[e(`span`,Ft,i(t.$t(`kling.name.keepOriginalSound`)),1),a(C,{modelValue:t.keepOriginalSound,"onUpdate:modelValue":n[2]||=e=>t.keepOriginalSound=e},null,8,[`modelValue`])])])):o(``,!0)])}var Lt=z(Et,[[`render`,It],[`__scopeId`,`data-v-7bb04cb4`]]),Rt=v({name:`KlingReferenceImages`,components:{ElButton:L,ElUpload:C,UploadIcon:N,ImagePreview:J,InfoIcon:X},mixins:[B,R],data(){return{fileList:[],uploadUrl:G()+`/api/v1/files/`}},computed:{config(){return this.$store.state.kling?.config||{}},headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},frameCount(){return Number(!!this.config.start_image_url)+Number(!!this.config.end_image_url)},maxImages(){return this.config.video_list?.length?4:7},referenceLimit(){return Math.max(0,this.maxImages-this.frameCount)},remainingSlots(){return Math.max(0,this.referenceLimit-this.urls.length)},urls(){return this.fileList.map(e=>e.response?.file_url||e.url).filter(Boolean)},storeImages(){return this.config.image_list}},watch:{frameCount(){this.syncPromptTokens()},storeImages(e){!e?.length&&this.fileList.length>0&&(this.fileList=[])}},methods:{beforeUpload(){return this.remainingSlots===0?(this.onExceed(),!1):!0},onExceed(){H.warning(this.$t(`kling.message.referenceImagesExceed`,{count:this.remainingSlots}))},onError(){H.error(this.$t(`kling.message.referenceImagesError`))},clearOmniConflicts(e){return{...e,generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0}},syncPromptTokens(e){let t=e||this.config,n=[Pe(t.prompt),...this.urls.map((e,t)=>`<<<image_${this.frameCount+t+1}>>>`)].filter(Boolean).join(` `);n!==t.prompt&&this.$store.commit(`kling/setConfig`,{...t,prompt:n})},syncConfig(){let e=this.urls.length?this.urls.map(e=>({image_url:e})):void 0,t=this.clearOmniConflicts({...this.config,image_list:e});this.$store.commit(`kling/setConfig`,t),this.syncPromptTokens(t)},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.syncConfig()},onRemove(e,t){this.fileList.splice(e,1),t.url?.startsWith(`blob:`)&&URL.revokeObjectURL(t.url),this.syncConfig()}}}),zt={class:`relative`},Bt={class:`flex justify-between items-center`},Vt={class:`flex justify-start items-center`},Ht={class:`text-sm font-bold`},Ut={key:0,class:`file-list flex flex-wrap gap-2 mt-2`};function Wt(t,n,u,d,m,_){let v=l(`info-icon`),y=l(`UploadIcon`),b=l(`el-button`),x=l(`el-upload`),S=l(`image-preview`);return g(),s(`div`,zt,[e(`div`,Bt,[e(`div`,Vt,[e(`span`,Ht,i(t.$t(`kling.name.referenceImages`)),1),a(v,{content:t.$t(`kling.description.referenceImages`)},null,8,[`content`])]),a(x,{"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg`,name:`file`,limit:t.referenceLimit,multiple:!0,"show-file-list":!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{default:p(()=>[a(b,{round:``,type:`primary`,size:`small`,disabled:t.remainingSlots===0},{default:p(()=>[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferenceImages`)),1)]),_:1},8,[`disabled`])]),_:1},8,[`file-list`,`limit`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])]),t.fileList.length?(g(),s(`div`,Ut,[(g(!0),s(c,null,h(t.fileList,(e,n)=>(g(),f(S,{key:e.uid||e.url||n,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemove(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])):o(``,!0)])}var Gt=z(Rt,[[`render`,Wt]]),Kt=v({name:`CfgScaleSelector`,components:{ElSlider:A,InfoIcon:X,ElInputNumber:k},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}}),qt={class:`flex justify-between`},Jt={class:`flex justify-start items-center`},Yt={class:`text-sm font-bold`},Xt={class:`flex justify-end items-center`},Zt={class:`w-full`};function Qt(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`,qt,[e(`div`,Jt,[e(`span`,Yt,i(t.$t(`kling.name.cfgScale`)),1),a(d,{content:t.$t(`kling.description.cfgScale`)},null,8,[`content`])]),e(`div`,Xt,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,Zt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:0,max:1,step:.1},null,8,[`modelValue`])])])}var $t=z(Kt,[[`render`,Qt]]),en=v({name:`GenerateAudioSelector`,components:{ElSwitch:j,InfoIcon:X},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},selectedMode(){return this.$store.state.kling?.config?.mode||``},supported(){return!!(F.includes(this.selectedModel)||this.selectedModel===`kling-v2-6`&&this.selectedMode===`pro`)},tooltipContent(){return this.supported?this.$t(`kling.description.generateAudio`):this.$t(`kling.description.generateAudioUnsupported`)},value:{get(){return this.supported?this.$store.state.kling?.config?.generate_audio??!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})}}}),tn={class:`relative`},nn={class:`flex justify-between items-center`},rn={class:`flex justify-start items-center`},an={class:`text-sm font-bold`};function on(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,tn,[e(`div`,nn,[e(`div`,rn,[e(`span`,an,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 sn=z(en,[[`render`,on]]),cn=[`horizontal`,`vertical`,`pan`,`tilt`,`roll`,`zoom`],ln=v({name:`CameraControlSelector`,components:{ElSelect:y,ElOption:b,ElSlider:A,ElInputNumber:k,InfoIcon:X},data(){return{configKeys:cn}},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 Z(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)}}}),un={class:`field`},dn={class:`header`},fn={class:`text-sm font-bold`},pn={key:0,class:`config-grid`},mn={class:`cfg-row-head`},hn={class:`cfg-name`};function gn(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`,un,[e(`div`,dn,[e(`span`,fn,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`,pn,[(g(!0),s(c,null,h(t.configKeys,n=>(g(),s(`div`,{key:n,class:`cfg-row`},[e(`div`,mn,[e(`span`,hn,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 _n=z(ln,[[`render`,gn],[`__scopeId`,`data-v-cd896060`]]),vn=[{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`]}],$=`, `;function yn(e,t){let n=(e||``).trim();return n?n.includes(t)?n:`${n}${$}${t}`:t}function bn(e,t){if(!e||!t)return e||``;let n=[`${t}${$}`,`${$}${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 xn=v({name:`InspirationPills`,components:{CloseIcon:he},computed:{prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return vn.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=bn(this.prompt,e);this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:t})}}}),Sn={key:0,class:`pills`,role:`list`},Cn={class:`pill-text`},wn=[`aria-label`,`title`,`onClick`];function Tn(n,r,u,d,f,p){let m=l(`close-icon`);return n.selected.length>0?(g(),s(`div`,Sn,[(g(!0),s(c,null,h(n.selected,r=>(g(),s(`div`,{key:r,class:`pill`,role:`listitem`},[e(`span`,Cn,i(r),1),e(`button`,{type:`button`,class:`pill-remove`,"aria-label":n.$t(`kling.inspiration.removeChip`),title:n.$t(`kling.inspiration.removeChip`),onClick:t(e=>n.onRemove(r),[`stop`])},[a(m,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,wn)]))),128))])):o(``,!0)}var En=v({name:`PromptInput`,components:{IdeaIcon:oe,ElButton:L,PromptTextarea:re,InspirationPills:z(xn,[[`render`,Tn],[`__scopeId`,`data-v-6be01bcf`]])},emits:[`open-inspiration`],computed:{prompt:{get(){return this.$store.state.kling?.config?.prompt},set(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Dn(e,t,n,o,s,c){let u=l(`idea-icon`),d=l(`el-button`),m=l(`inspiration-pills`),h=l(`prompt-textarea`);return g(),f(h,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||=t=>e.prompt=t,title:e.$t(`kling.name.prompt`),info:e.$t(`kling.description.prompt`),placeholder:e.$t(`kling.placeholder.prompt`)},{actions:p(()=>[a(d,{text:``,size:`small`,class:`inspiration-btn`,onClick:t[0]||=t=>e.$emit(`open-inspiration`)},{default:p(()=>[a(u,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(e.$t(`kling.inspiration.openButton`)),1)]),_:1})]),before:p(()=>[a(m)]),_:1},8,[`modelValue`,`title`,`info`,`placeholder`])}var On=z(En,[[`render`,Dn],[`__scopeId`,`data-v-5754ae54`]]),kn=v({name:`NegativePromptInput`,components:{ElInput:K,InfoIcon:X},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||=``}}),An={class:`field`},jn={class:`box`},Mn={class:`title font-bold`};function Nn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,An,[e(`div`,jn,[e(`h2`,Mn,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 Pn=z(kn,[[`render`,Nn],[`__scopeId`,`data-v-de98cf01`]]),Fn=v({name:`InspirationDrawer`,components:{Close:he,IdeaIcon:oe,ElDrawer:O,ElButton:L},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`],data(){return{groups:vn}},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(bn(this.prompt,e)):this.setPrompt(yn(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(let t of this.allChipTexts)for(;e.includes(t);)e=bn(e,t);this.setPrompt(e)}}}),In={class:`drawer-content`},Ln={class:`drawer-header`},Rn={class:`title-row`},zn={class:`title`},Bn={class:`hint`},Vn={key:0,class:`selected-bar`},Hn={class:`selected-text`},Un={class:`groups`},Wn={class:`group-title`},Gn={class:`chip-grid`},Kn=[`onClick`];function qn(t,u,d,m,_,v){let y=l(`idea-icon`),b=l(`close`),x=l(`el-button`),S=l(`el-drawer`);return g(),f(S,{modelValue:t.visible,"onUpdate:modelValue":u[1]||=e=>t.visible=e,direction:`rtl`,"with-header":!1,size:t.drawerSize,"custom-class":`kling-inspiration-drawer`,"destroy-on-close":!1},{default:p(()=>[e(`div`,In,[e(`div`,Ln,[e(`div`,Rn,[a(y,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,zn,i(t.$t(`kling.inspiration.title`)),1)]),a(x,{text:``,class:`close-btn`,"aria-label":t.$t(`common.button.close`),title:t.$t(`common.button.close`),onClick:u[0]||=e=>t.visible=!1},{default:p(()=>[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`])]),e(`div`,Bn,i(t.$t(`kling.inspiration.hint`)),1),t.selectedCount>0?(g(),s(`div`,Vn,[e(`span`,Hn,i(t.$t(`kling.inspiration.selectedSummary`,{count:t.selectedCount})),1),a(x,{text:``,size:`small`,class:`clear-btn`,onClick:t.onClearSelected},{default:p(()=>[r(i(t.$t(`kling.inspiration.clearSelected`)),1)]),_:1},8,[`onClick`])])):o(``,!0),e(`div`,Un,[(g(!0),s(c,null,h(t.groups,r=>(g(),s(`div`,{key:r.groupKey,class:`group`},[e(`div`,Wn,i(t.$t(`kling.inspiration.group.${r.groupKey}`)),1),e(`div`,Gn,[(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,Kn))),128))])]))),128))])])]),_:1},8,[`modelValue`,`size`])}var Jn=z(Fn,[[`render`,qn],[`__scopeId`,`data-v-8b2e6a5d`]]),Yn={"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-o1":`Kling O1`},Xn={std:`720p`,pro:`1080p`,"4k":`4K`},Zn=v({name:`SummaryChip`,components:{AudioIcon:ie},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){let e=this.config?.model||`kling-v2-5-turbo`;return Yn[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||``},modeLabel(){let e=this.config?.mode||`std`;return Xn[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),Qn={class:`summary-chip`},$n=[`title`],er=[`title`],tr=[`title`],nr=[`title`],rr=[`title`];function ir(t,n,r,c,u,d){let f=l(`audio-icon`);return g(),s(`div`,Qn,[e(`span`,{class:`part`,title:t.$t(`kling.name.model`)},i(t.modelLabel),9,$n),n[0]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.duration`)},i(t.durationLabel),9,er),n[1]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.ratio`)},i(t.aspectRatio||`16:9`),9,tr),n[2]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.mode`)},i(t.modeLabel),9,nr),t.generateAudio?(g(),s(`span`,{key:0,class:`audio`,title:t.$t(`kling.name.generateAudio`)},[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,rr)):o(``,!0)])}var ar=v({name:`ConfigPanel`,components:{MagicIcon:P,ElButton:L,Consumption:Y,PromptInput:On,NegativePromptInput:Pn,ModelSelector:Ve,ModeSelector:Je,DurationSelector:it,RatioSelector:dt,StartImage:vt,CfgScaleSelector:$t,GenerateAudioSelector:sn,CameraControlSelector:_n,InspirationDrawer:Jn,SummaryChip:z(Zn,[[`render`,ir],[`__scopeId`,`data-v-c800852a`]]),EndImage:Tt,ReferenceImages:Gt,ReferenceVideo:Lt},emits:[`generate`],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},capabilities(){return Z(this.config?.model,this.config?.mode,this.config?.duration)},omniActive(){return this.config?.model===`kling-o1`||!!(this.config?.image_list?.length||this.config?.video_list?.length)},consumption(){return pe(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),or={class:`flex flex-col h-full`},sr={class:`flex-1 overflow-y-auto p-5`},cr={class:`flex flex-col items-center justify-center px-5 pb-5`};function lr(t,n,c,u,d,m){let h=l(`prompt-input`),_=l(`model-selector`),v=l(`ratio-selector`),y=l(`reference-images`),b=l(`reference-video`),x=l(`start-image`),S=l(`end-image`),C=l(`duration-selector`),w=l(`mode-selector`),T=l(`generate-audio-selector`),E=l(`camera-control-selector`),D=l(`cfg-scale-selector`),O=l(`negative-prompt-input`),k=l(`summary-chip`),A=l(`consumption`),j=l(`magic-icon`),M=l(`el-button`),ee=l(`inspiration-drawer`);return g(),s(`div`,or,[e(`div`,sr,[a(h,{class:`mb-4`,onOpenInspiration:n[0]||=e=>t.inspirationOpen=!0}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),t.capabilities.referenceImages?(g(),f(y,{key:0,class:`mb-3`})):o(``,!0),t.capabilities.referenceVideo?(g(),f(b,{key:1,class:`mb-4`})):o(``,!0),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`}),t.omniActive?o(``,!0):(g(),f(E,{key:2,class:`mb-4`})),t.omniActive?o(``,!0):(g(),f(D,{key:3,class:`mb-4`})),t.omniActive?o(``,!0):(g(),f(O,{key:4,class:`mb-4`}))]),e(`div`,cr,[a(k),a(A,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),t.config?.video_url!==void 0||t.config?.custom?(g(),f(M,{key:0,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(j,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.extend`)),1)]),_:1},8,[`onClick`])):(g(),f(M,{key:1,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(j,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generate`)),1)]),_:1},8,[`onClick`]))]),a(ee,{modelValue:t.inspirationOpen,"onUpdate:modelValue":n[1]||=e=>t.inspirationOpen=e},null,8,[`modelValue`])])}var ur=z(ar,[[`render`,lr]]),dr=v({name:`MotionImage`,components:{UploadIcon:N,ElUpload:C,ElButton:L,InfoIcon:X,ImagePreview:J},mixins:[B,R],data(){return{fileList:[],uploadUrl:G()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetImageUrl()},methods:{onExceed(){H.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){H.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()}}}),fr={class:`relative`},pr={class:`flex justify-between`},mr={class:`flex justify-start items-center`},hr={class:`text-sm font-bold`};function gr(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,fr,[e(`div`,pr,[e(`div`,mr,[e(`span`,hr,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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var _r=z(dr,[[`render`,gr],[`__scopeId`,`data-v-32f5471f`]]),vr=v({name:`MotionVideo`,components:{UploadIcon:N,ElUpload:C,ElButton:L,InfoIcon:X,FilePreview:ge},mixins:[R],data(){return{fileList:[],uploadUrl:G()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetVideoUrl()},methods:{onExceed(){H.warning(this.$t(`kling.message.uploadVideoExceed`))},onError(){H.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:(H.error(this.$t(`kling.message.uploadVideoSizeExceed`)),!1):(H.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()}}}),yr={class:`relative`},br={class:`flex justify-between`},xr={class:`flex justify-start items-center`},Sr={class:`text-sm font-bold`};function Cr(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,yr,[e(`div`,br,[e(`div`,xr,[e(`span`,Sr,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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadVideoUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var wr=z(vr,[[`render`,Cr],[`__scopeId`,`data-v-80320d94`]]),Tr=v({name:`MotionPromptInput`,components:{ElInput:K,InfoIcon:X},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||``},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),Er={class:`field`},Dr={class:`box`},Or={class:`title font-bold`};function kr(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,Er,[e(`div`,Dr,[e(`h2`,Or,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 Ar=z(Tr,[[`render`,kr],[`__scopeId`,`data-v-ca9fdbe5`]]),jr=`video`,Mr=v({name:`CharacterOrientationSelector`,components:{ElRadioGroup:D,ElRadioButton:E,InfoIcon:X},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||jr},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=jr)}}),Nr={class:`field`},Pr={class:`header`},Fr={class:`text-sm font-bold`};function Ir(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`,Nr,[e(`div`,Pr,[e(`span`,Fr,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 Lr=z(Mr,[[`render`,Ir],[`__scopeId`,`data-v-7a91195b`]]),Rr=`kling-v2-6`,zr=v({name:`MotionModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:X},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||Rr},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=Rr)}}),Br={class:`field`},Vr={class:`header`},Hr={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`,Br,[e(`div`,Vr,[e(`h2`,Hr,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 Wr=z(zr,[[`render`,Ur],[`__scopeId`,`data-v-480e8da2`]]),Gr=`std`,Kr=v({name:`MotionModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon: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?.motionConfig?.mode||Gr},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=Gr)}}),qr={class:`field`},Jr={class:`header`},Yr={class:`title font-bold`};function Xr(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,qr,[e(`div`,Jr,[e(`h2`,Yr,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 Zr=z(Kr,[[`render`,Xr],[`__scopeId`,`data-v-1295688c`]]),Qr=v({name:`KeepOriginalSoundSelector`,components:{ElSwitch:j,InfoIcon:X},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`})}}}}),$r={class:`relative`},ei={class:`flex justify-between items-center`},ti={class:`flex justify-start items-center`},ni={class:`text-sm font-bold`};function ri(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,$r,[e(`div`,ei,[e(`div`,ti,[e(`span`,ni,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 ii=v({name:`MotionPanel`,components:{MagicIcon:P,ElButton:L,Consumption:Y,MotionImage:_r,MotionVideo:wr,MotionPromptInput:Ar,CharacterOrientationSelector:Lr,MotionModelSelector:Wr,MotionModeSelector:Zr,KeepOriginalSoundSelector:z(Qr,[[`render`,ri]])},emits:[`generate`],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return pe({...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`)}}}),ai={class:`flex flex-col h-full`},oi={class:`flex-1 overflow-y-auto p-5`},si={class:`flex flex-col items-center justify-center px-5 pb-5`};function ci(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(`magic-icon`),C=l(`el-button`);return g(),s(`div`,ai,[e(`div`,oi,[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`,si,[a(x,{value:t.consumption,service:t.service,"rate-unit":t.$t(`kling.name.perSecond`),note:t.$t(`kling.message.motionPricingNote`)},null,8,[`value`,`service`,`rate-unit`,`note`]),a(C,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(S,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generateMotion`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var li=z(ii,[[`render`,ci]]),ui=v({name:`KlingTabSwitcher`,components:{ElTabs:x,ElTabPane:S,ElTag:de},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)}}}),di=[`title`],fi={class:`text`};function pi(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 scenario-tabs scenario-tabs--divided`,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`,fi,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,di)]),_:2},1032,[`name`,`disabled`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var mi=z(ui,[[`render`,pi],[`__scopeId`,`data-v-4c7b6046`]]),hi={"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`},gi=v({name:`TalkingPhotoModelSelector`,components:{ElSelect:y,ElOption:b},data(){return{options:ce.map(e=>({value:e,label:hi[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=ue)}}),_i={class:`field`},vi={class:`title font-bold`};function yi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,_i,[e(`h2`,vi,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 bi=z(gi,[[`render`,yi],[`__scopeId`,`data-v-cbc83d11`]]),xi=v({name:`TalkingPhotoModeSelector`,components:{ElSelect:y,ElOption:b},computed:{options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`)},{value:`pro`,label:this.$t(`kling.name.modePro`)}]},value:{get(){return this.$store.state.kling?.talkingPhotoConfig?.mode||`pro`},set(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.$store.state.kling?.talkingPhotoConfig,mode:e})}}},mounted(){this.$store.state.kling?.talkingPhotoConfig?.mode||(this.value=`pro`)}}),Si={class:`field`},Ci={class:`title font-bold`};function wi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Si,[e(`h2`,Ci,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 Ti=v({name:`TalkingPhotoPanel`,components:{MagicIcon:P,UploadIcon:N,ElUpload:C,ElButton:L,ElInput:K,Consumption:Y,InfoIcon:X,ImagePreview:J,ModelSelector:bi,ModeSelector:z(xi,[[`render`,wi],[`__scopeId`,`data-v-92525a1d`]])},mixins:[R],emits:[`generate`],data(){return{imageFiles:[],audioFiles:[],uploadUrl:G()+`/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 pe({...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(){H.warning(this.$t(`kling.message.uploadReferencesExceed`))},onImageError(){H.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(){H.warning(this.$t(`kling.message.uploadAudioExceed`))},onAudioError(){H.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`)}}}),Ei={class:`flex flex-col h-full`},Di={class:`flex-1 overflow-y-auto p-5`},Oi={class:`relative mb-4`},ki={class:`flex justify-start items-center`},Ai={class:`text-sm font-bold`},ji={class:`relative mb-4`},Mi={class:`flex justify-start items-center`},Ni={class:`text-sm font-bold`},Pi=[`src`],Fi={class:`mb-4`},Ii={class:`flex justify-start items-center`},Li={class:`text-sm font-bold`},Ri={class:`flex flex-col items-center justify-center px-5 pb-5`};function zi(t,n,c,u,d,m){let h=l(`model-selector`),_=l(`mode-selector`),v=l(`info-icon`),y=l(`image-preview`),b=l(`upload-icon`),x=l(`el-button`),S=l(`el-upload`),C=l(`el-input`),w=l(`consumption`),T=l(`magic-icon`);return g(),s(`div`,Ei,[e(`div`,Di,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),e(`div`,Oi,[e(`div`,ki,[e(`span`,Ai,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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`])]),e(`div`,ji,[e(`div`,Mi,[e(`span`,Ni,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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),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,Pi)):o(``,!0)]),e(`div`,Fi,[e(`div`,Ii,[e(`span`,Li,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`,Ri,[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(T,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generateTalkingPhoto`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var Bi=z(Ti,[[`render`,zi],[`__scopeId`,`data-v-1cf65bf0`]]),Vi=v({name:`TaskPreview`,components:{ChannelIcon:ne,InfoIcon:ae,MagicIcon:P,TimeIcon:ee,WarningIcon:se,CopyToClipboard:te,ElAlert:T,VideoPlayer:be,ElTooltip:w,ElButton:L,ImagePreview:J,VideoPreview:Ce,AudioPreview:we,ApiCodeButton:xe},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{isFailure(){let e=this.modelValue?.response;return e?.success===!1||!!e?.error||e?.state===`failed`||e?.state===`cancelled`},isWaiting(){let e=this.modelValue?.response;return!e||!this.isFailure&&e.success!==!0&&!e.video_url},application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},referenceImages(){let e=[],t=this.modelValue?.request?.start_image_url,n=this.modelValue?.request?.end_image_url,r=this.modelValue?.request?.image_url;return t&&e.push({url:t,name:`start-image`}),n&&e.push({url:n,name:`end-image`}),r&&e.push({url:r,name:`reference-image`}),e},referenceVideos(){let e=[],t=this.modelValue?.request?.video_url;t&&e.push({url:t,name:`reference-video`});let n=this.modelValue?.request?.video_list;return(Array.isArray(n)?n:[]).forEach((t,n)=>{t?.video_url&&e.push({url:t.video_url,name:`reference-video-${n+1}`})}),e},referenceAudios(){let e=this.modelValue?.request?.audio_url;return e?[{url:e,name:`reference-audio`}]:[]}},methods:{onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),Hi={class:`preview`},Ui={class:`left`},Wi={class:`main`},Gi={class:`bot`},Ki={class:`datetime`},qi={class:`info`},Ji={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Yi={key:1,class:`prompt mt-2`},Xi={key:0},Zi={key:1},Qi={key:0,class:n({content:!0,failed:!0})},$i={key:0,class:`mb-4`},ea={key:1,class:n({operations:!0,"mt-2":!0})},ta={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},na={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ra={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ia={key:1,class:n({content:!0})},aa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},oa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},sa={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ca={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},la={key:2,class:n({content:!0})},ua={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},da={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function fa(t,n,u,d,m,_){let v=l(`capability-presentation`),y=l(`image-preview`),b=l(`video-preview`),x=l(`audio-preview`),S=l(`video-player`),C=l(`el-button`),w=l(`el-tooltip`),T=l(`api-code-button`),E=l(`channel-icon`),D=l(`magic-icon`),O=l(`copy-to-clipboard`),k=l(`time-icon`),A=l(`el-alert`),j=l(`warning-icon`),M=l(`info-icon`);return g(),s(`div`,Hi,[e(`div`,Ui,[a(v,{capability:`kling`,part:`avatar`,class:`avatar`})]),e(`div`,Wi,[e(`div`,Gi,[a(v,{capability:`kling`,part:`name`}),e(`span`,Ki,i(t.$dayjs.format(``+new Date(parseFloat((t.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,qi,[t.referenceImages.length>0||t.referenceVideos.length>0||t.referenceAudios.length>0?(g(),s(`div`,Ji,[(g(!0),s(c,null,h(t.referenceImages,(e,t)=>(g(),f(y,{key:`image-${t}`,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(t.referenceVideos,(e,t)=>(g(),f(b,{key:`video-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(t.referenceAudios,(e,t)=>(g(),f(x,{key:`audio-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128))])):o(``,!0),t.modelValue?.request?.prompt?(g(),s(`p`,Yi,[r(i(t.modelValue?.request?.prompt)+` `,1),t.modelValue?.response?t.isWaiting?(g(),s(`span`,Zi,` - (`+i(t.$t(`kling.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,Xi,` - (`+i(t.$t(`kling.status.pending`))+`) `,1))])):o(``,!0)]),t.modelValue?.response?.success===!0&&!t.isFailure?(g(),s(`div`,Qi,[t.modelValue?.response.video_url?(g(),s(`div`,$i,[a(S,{src:t.modelValue?.response.video_url},null,8,[`src`])])):o(``,!0),t.modelValue?.response.success?(g(),s(`div`,ea,[a(w,{class:`box-item`,effect:`dark`,content:t.$t(`kling.message.downloadVideo`),placement:`top-start`},{default:p(()=>[t.modelValue?.response.video_url?(g(),f(C,{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(T,{path:`/kling/videos`,body:t.modelValue?.request},null,8,[`body`])])):o(``,!0),a(A,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,ta,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.model`))+`: `+i(t.modelValue?.request?.model),1)]),e(`p`,na,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(O,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.elapsed?(g(),s(`p`,ra,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.elapsed`))+`: `+i(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),t.isFailure?(g(),s(`div`,ia,[a(A,{closable:!1,class:`failure`},{template:p(()=>[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,aa,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(O,{content:t.modelValue?.id},null,8,[`content`])]),e(`p`,oa,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.failureReason`))+`: `+i(t.modelValue?.response?.error?.message)+` `,1),a(O,{content:t.modelValue?.response?.error?.message},null,8,[`content`])]),t.modelValue?.elapsed?(g(),s(`p`,sa,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),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`,ca,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.traceId`))+`: `+i(t.modelValue?.response?.trace_id)+` `,1),a(O,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),t.isWaiting?(g(),s(`div`,la,[a(A,{closable:!1,class:`info`},{template:p(()=>[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(t.modelValue?.response?`kling.status.processing`:`kling.status.pending`)),1)]),default:p(()=>[e(`p`,ua,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(O,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.response?.trace_id?(g(),s(`p`,da,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.traceId`))+`: `+i(t.modelValue?.response?.trace_id)+` `,1),a(O,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var pa=v({name:`RecentPanel`,components:{TaskPreview:z(Vi,[[`render`,fa],[`__scopeId`,`data-v-d5f75276`]]),NoTasks:ve,BotPlaceholder:Se,ScrollList:_e},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?.()}}}),ma={key:0},ha={key:2,class:`w-full h-full flex items-center justify-center`};function ga(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`,ma,[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`,ha,[a(v)])):o(``,!0)],64)}var _a=v({name:`KlingIndex`,components:{ConfigPanel:ur,MotionPanel:li,TalkingPhotoPanel:Bi,TabSwitcher:mi,Layout:Ae,RecentPanel:z(pa,[[`render`,ga]])},mixins:[fe],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===me.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===me.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 ye({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(!q(this.uploadTracker,e=>this.$t(e),e=>H.warning(e)))return;let{camera_control:e,...t}=this.config||{},n={...t,async:!0},r=Number(!!n.start_image_url)+Number(!!n.end_image_url),i=n.image_list?.length||0,a=n.video_list?.length?4:7;if(r+i>a){H.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:a}));return}if(n.video_list?.[0]?.refer_type===`base`&&(n.start_image_url||n.end_image_url||n.image_list?.some(({type:e})=>e))){H.warning(this.$t(`kling.message.baseVideoFrameConflict`));return}if(!n.video_id&&!t.video_url&&!n.start_image_url&&n.end_image_url){H.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 o=this.credential?.token;if(!o){console.error(`no token specified`);return}H.info(this.$t(`kling.message.startingTask`)),W(`kling`,V.generate(n,{token:o})).then(()=>{H.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?H.error(this.$t(`kling.message.usedUp`)):H.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(!q(this.uploadTracker,e=>this.$t(e),e=>H.warning(e)))return;let e=this.motionConfig||{};if(!e.image_url||!e.video_url){H.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}H.info(this.$t(`kling.message.startingTask`)),W(`kling`,V.motion(t,{token:n})).then(()=>{H.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?H.error(this.$t(`kling.message.usedUp`)):H.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},async onGenerateTalkingPhoto(){if(!q(this.uploadTracker,e=>this.$t(e),e=>H.warning(e)))return;let e=this.talkingPhotoConfig||{};if(!e.image_url||!e.audio_url){H.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}H.info(this.$t(`kling.message.startingTask`)),W(`kling`,V.talkingPhoto(t,{token:n})).then(()=>{H.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?H.error(this.$t(`kling.message.usedUp`)):H.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),va={class:`flex flex-col h-full`},ya={class:`flex-1 min-h-0`};function ba(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`,va,[a(u,{"model-value":t.taskType,"onUpdate:modelValue":t.onTabChange},null,8,[`model-value`,`onUpdate:modelValue`]),e(`div`,ya,[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 xa=z(_a,[[`render`,ba]]);export{xa 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-DuspBjxM.js";import{n as x,t as S}from"./tabs-CYLrPpdu.js";import{t as C}from"./upload-BNaHShNL.js";import{t as w}from"./tooltip-O0jUmp8_.js";import{t as T}from"./alert-x8mYlhuj.js";import{n as E,r as D}from"./radio-B0Elgaw9.js";import{t as O}from"./drawer-D6k00NQl.js";import{t as k}from"./input-number-CZgZJsF5.js";import{t as A}from"./slider-D13c5Wz0.js";import{t as j}from"./switch-DGjAGv1c.js";import{n as M}from"./taskDrawerMixin-D23gnPya.js";import{t as ee}from"./clock-C4q08wwy.js";import{t as te}from"./CopyToClipboard-rmORTzYc.js";import{r as ne,t as re}from"./PromptTextarea-DbxCyFDP.js";import{t as ie}from"./headphones-DjCXtWtW.js";import{t as ae}from"./info-7QlewFBX.js";import{t as oe}from"./lightbulb-Cbx7aB6y.js";import{t as se}from"./triangle-alert-BC93Xt4w.js";import{t as N}from"./upload-CP3jRoVn.js";import{t as P}from"./wand-sparkles-Cfgyd-ZM.js";import{ci as ce,ii as le,li as F,si as ue}from"./constants-D-3QKDN1.js";import{$t as I,Ai as L,Bt as R,E as z,Ht as B,Oi as de,Vn as V,Vt as fe,Wt as pe,ei as me,gi as H,hi as U,mr as W,pi as he,ri as G,zi as K,zt as q}from"./index-h4BcqHjk.js";import{t as ge}from"./FilePreview-CZc1NuMc.js";import{t as J}from"./ImagePreview-C_BsIyhE.js";import{t as Y}from"./Consumption-CqnV6zKQ.js";import{a as X,n as _e,r as ve,t as ye}from"./pagination-jAKTlMGg.js";import{t as be}from"./VideoPlayer-BYVFHaXG.js";import{t as xe}from"./ApiCodeButton-BQdstZ9o.js";import{t as Se}from"./BotPlaceholder-Ck1mjnMM.js";import{n as Ce,t as we}from"./AudioPreview-4VgTsOeE.js";var Te=v({name:`LayoutKling`,components:{MagicIcon:P,ElDrawer:O,ElButton:L},mixins:[M]}),Ee={class:`main flex flex-row flex-1 min-h-0`},De={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},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(`magic-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`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Ae=z(Te,[[`render`,ke],[`__scopeId`,`data-v-2d826924`]]),je={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};function Z(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,referenceVideo:!1,referenceImages:!1};case`kling-v1-6`:case`kling-v2-5-turbo`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v2-6`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:r===`pro`,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v2-master`:case`kling-v2-1-master`:return{text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v3`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:r!==`4k`,referenceVideo:!1,referenceImages:!1};case`kling-v3-omni`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:!1,referenceVideo:!0,referenceImages:!0};case`kling-o1`:return{text2video:!0,image2video:!0,endImage:!0,audio:!1,motionControl:!1,referenceVideo:!0,referenceImages:!0};default:return je}}var Q=`<<<video_1>>>`,Me=/<<<image_\d+>>>/g;function Ne(e){return e?e.split(Q).join(` `).replace(/\s{2,}/g,` `).trim():``}function Pe(e){return e?e.replace(Me,` `).replace(/\s{2,}/g,` `).trim():``}function Fe(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=Z(n,r,i),o=[];e.end_image_url&&!a.endImage&&o.push({field:`end_image_url`,i18nLabel:`kling.name.endImage`}),e.generate_audio&&!a.audio&&o.push({field:`generate_audio`,i18nLabel:`kling.name.generateAudio`}),e.camera_control?.type&&(!a.motionControl||e.start_image_url)&&o.push({field:`camera_control`,i18nLabel:`kling.name.cameraControl`}),e.video_list?.length&&!a.referenceVideo&&o.push({field:`video_list`,i18nLabel:`kling.name.referenceVideo`}),e.image_list?.length&&!a.referenceImages&&o.push({field:`image_list`,i18nLabel:`kling.name.referenceImages`});let s=n===`kling-o1`||!!(e.image_list?.length||e.video_list?.length);return s&&e.cfg_scale!==void 0&&o.push({field:`cfg_scale`,i18nLabel:`kling.name.cfgScale`}),s&&e.negative_prompt&&o.push({field:`negative_prompt`,i18nLabel:`kling.name.negativePrompt`}),o}function Ie(e,t){let n={...e};for(let e of t)e.field===`end_image_url`&&(n.end_image_url=void 0),e.field===`generate_audio`&&(n.generate_audio=!1),e.field===`camera_control`&&(n.camera_control=void 0),e.field===`cfg_scale`&&(n.cfg_scale=void 0),e.field===`negative_prompt`&&(n.negative_prompt=void 0),e.field===`video_list`&&(n.video_list=void 0,n.prompt=Ne(n.prompt)),e.field===`image_list`&&(n.image_list=void 0,n.prompt=Pe(n.prompt));return n}var Le=v({name:`ModelSelector`,components:{ElSelect:y,ElOption:b},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{revertKey:0,options:[{value:`kling-v3`,label:`v3`},{value:`kling-v3-omni`,label:`v3-Omni`},{value:`kling-v2-6`,label:`v2.6`},{value:`kling-v2-5-turbo`,label:`v2.5-Turbo`},{value:`kling-v2-1-master`,label:`v2.1-Master`},{value:`kling-v2-master`,label:`v2-Master`},{value:`kling-v1-6`,label:`v1.6`},{value:`kling-v1`,label:`v1`},{value:`kling-o1`,label:`Kling O1`}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(le)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=Fe(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await U.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=Ie({...t,model:e},n);this.$store.commit(`kling/setConfig`,i),H.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})}}}),Re={class:`field`},ze={class:`title font-bold`};function Be(t,n,r,a,o,u){let d=l(`el-option`),m=l(`el-select`);return g(),s(`div`,Re,[e(`h2`,ze,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 Ve=z(Le,[[`render`,Be],[`__scopeId`,`data-v-a74e7f31`]]),He=v({name:`ModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:X},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},cameraControlSet(){return!!this.$store.state.kling?.config?.camera_control?.type},fourKReason(){return F.includes(this.selectedModel)?this.cameraControlSet?this.$t(`kling.description.mode4kIncompatibleCamera`):``:this.$t(`kling.description.mode4kRequiresV3`)},options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`),disabled:!1,disabledReason:``},{value:`pro`,label:this.$t(`kling.name.modePro`),disabled:!1,disabledReason:``},{value:`4k`,label:this.$t(`kling.name.mode4k`),disabled:!!this.fourKReason,disabledReason:this.fourKReason}]},value(){return this.$store.state.kling?.config?.mode}},watch:{fourKReason(e){e&&this.value===`4k`&&this.applyMode(`std`)}},mounted(){this.value||this.applyMode(`std`)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=Fe(t,{mode:e});if(n.length===0){this.applyMode(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await U.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=Ie({...t,mode:e},n);this.$store.commit(`kling/setConfig`,i),H.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})}}}),Ue={class:`field`},We={class:`header`},Ge={class:`title font-bold`},Ke={key:0,class:`opt-tip`};function qe(t,r,u,d,m,_){let v=l(`info-icon`),y=l(`el-option`),b=l(`el-select`);return g(),s(`div`,Ue,[e(`div`,We,[e(`h2`,Ge,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`,Ke,i(t.disabledReason),1)):o(``,!0)]),_:2},1032,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var Je=z(He,[[`render`,qe],[`__scopeId`,`data-v-9a8fa3c5`]]),Ye=[3,5,8,10,12,15],Xe=[5,10],Ze=[5],Qe=v({name:`DurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:X},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},isV3Model(){return F.includes(this.selectedModel)},allowedDurations(){return this.selectedModel===`kling-o1`?Ze:this.isV3Model?Ye:Xe},value(){return this.$store.state.kling?.config?.duration??5},selectValue(){let e=this.allowedDurations;return e.includes(this.value)?this.value:e.includes(5)?5:e[0]}},watch:{selectedModel(){this.allowedDurations.includes(this.value)||this.applyDuration(5)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(5)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=Fe(t,{duration:e});if(n.length===0){this.applyDuration(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await U.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=Ie({...t,duration:e},n);this.$store.commit(`kling/setConfig`,i),H.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})}}}),$e={class:`field`},et={class:`control`},tt={class:`label`},nt={class:`title font-bold`};function rt(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,$e,[e(`div`,et,[e(`div`,tt,[e(`h2`,nt,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 it=z(Qe,[[`render`,rt],[`__scopeId`,`data-v-496bf31c`]]),at=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`}}),ot={class:`text-sm font-bold mb-2 block`},st={class:`items`},ct=[`onClick`],lt={class:`name`};function ut(t,r,a,o,l,u){return g(),s(`div`,null,[e(`span`,ot,i(t.$t(`kling.name.ratio`)),1),e(`div`,st,[(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`,lt,i(r.label),1)],10,ct))),128))])])}var dt=z(at,[[`render`,ut],[`__scopeId`,`data-v-cdb14b2f`]]),ft=v({name:`StartImage`,components:{UploadIcon:N,ElUpload:C,ElButton:L,ElTooltip:w,InfoIcon:X,ImagePreview:J},mixins:[B,R],emits:[`change`],data(){return{fileList:[],uploadUrl:G()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},value:{get(){return this.$store.state?.kling?.config?.start_image_url},set(){}}},watch:{value(e){!e&&this.fileList.length>0&&(this.fileList=[])}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){H.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){H.error(this.$t(`kling.message.uploadReferencesError`))},onBeforeUpload(){let e=this.$store.state.kling?.config||{};if(e.video_list?.[0]?.refer_type===`base`)return H.warning(this.$t(`kling.message.baseVideoFrameConflict`)),!1;let t=e.video_list?.length?4:7;return(e.image_list?.length||0)+Number(!!e.end_image_url)+1>t?(H.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:t})),!1):!0},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetStartImageUrl()}}}),pt={class:`relative`},mt={class:`flex min-h-8 items-center pr-20`},ht={class:`flex justify-start items-center`},gt={class:`text-sm font-bold`};function _t(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,pt,[e(`div`,mt,[e(`div`,ht,[e(`span`,gt,i(t.$t(`kling.name.startImage`)),1),a(h,{content:t.$t(`kling.description.uploadStartImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,disabled:t.reachedLimit,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"before-upload":t.onBeforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.$t(`kling.message.uploadReferencesExceed`),disabled:!t.reachedLimit,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.reachedLimit},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`disabled`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var vt=z(ft,[[`render`,_t],[`__scopeId`,`data-v-0220ed34`]]),yt=v({name:`EndImage`,components:{UploadIcon:N,ElUpload:C,ElButton:L,ElTooltip:w,ImagePreview:J,InfoIcon:X},mixins:[B,R],data(){return{fileList:[],uploadUrl:G()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},klingConfig(){return this.$store.state?.kling?.config||{}},endImageSupported(){return Z(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},hasStartImage(){return!!this.klingConfig.start_image_url},uploadDisabled(){return this.reachedLimit||!this.endImageSupported||!this.hasStartImage},uploadTooltip(){return this.endImageSupported?this.hasStartImage?this.reachedLimit?this.$t(`kling.message.uploadReferencesExceed`):``:this.$t(`kling.message.endImageRequiresStart`):this.$t(`kling.message.endImageNotSupported`)},storeValue(){return this.klingConfig.end_image_url},value:{get(){return this.storeValue},set(){}}},watch:{storeValue(e){!e&&this.fileList.length>0&&(this.fileList=[])},hasStartImage(e){!e&&this.storeValue&&(this.fileList=[],this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,end_image_url:void 0}))}},mounted(){this.value||=void 0,this.onSetEndImageUrl()},methods:{onBeforeUpload(){if(!this.endImageSupported)return H.warning(this.$t(`kling.message.endImageNotSupported`)),!1;if(!this.hasStartImage)return H.warning(this.$t(`kling.message.endImageRequiresStart`)),!1;if(this.klingConfig.video_list?.[0]?.refer_type===`base`)return H.warning(this.$t(`kling.message.baseVideoFrameConflict`)),!1;let e=this.klingConfig.video_list?.length?4:7;return(this.klingConfig.image_list?.length||0)+2>e?(H.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:e})),!1):!0},onExceed(){H.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){H.error(this.$t(`kling.message.uploadReferencesError`))},onSetEndImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetEndImageUrl()}}}),bt={class:`relative`},xt={class:`flex min-h-8 items-center pr-20`},St={class:`flex justify-start items-center`},Ct={class:`text-sm font-bold`};function wt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,bt,[e(`div`,xt,[e(`div`,St,[e(`span`,Ct,i(t.$t(`kling.name.endImage`)),1),a(h,{content:t.$t(`kling.description.uploadEndImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,disabled:t.uploadDisabled,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"before-upload":t.onBeforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`disabled`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Tt=z(yt,[[`render`,wt],[`__scopeId`,`data-v-b2eaa919`]]),Et=v({name:`ReferenceVideo`,components:{ElUpload:C,ElButton:L,ElRadioButton:E,ElRadioGroup:D,ElSwitch:j,InfoIcon:X,FilePreview:ge,UploadIcon:N},mixins:[R],data(){return{fileList:[],uploadUrl:G()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},config(){return this.$store.state.kling?.config||{}},hasVideo(){return!!this.urls?.[0]},referenceType:{get(){return this.config.video_list?.[0]?.refer_type||`feature`},set(e){this.updateVideoOptions(e,this.keepOriginalSound)}},keepOriginalSound:{get(){return this.config.video_list?.[0]?.keep_original_sound===`yes`},set(e){this.updateVideoOptions(this.referenceType,e)}}},methods:{onExceed(){H.warning(this.$t(`kling.message.referenceVideoExceed`))},onError(){H.error(this.$t(`kling.message.referenceVideoError`))},beforeUpload(e){if((this.config.image_list?.length||0)+Number(!!this.config.start_image_url)+Number(!!this.config.end_image_url)>4)return H.error(this.$t(`kling.message.referenceVideoImageLimit`)),!1;let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=e.size/1024/1024<200;return t?n?!0:(H.error(this.$t(`kling.message.referenceVideoSizeExceed`)),!1):(H.error(this.$t(`kling.message.referenceVideoTypeFailed`)),!1)},ensurePromptToken(e){let t=this.$store.state.kling?.config,n=t?.prompt||``,r=n.includes(Q),i;if(e&&!r)i=n?`${n} ${Q}`:Q;else if(!e&&r)i=Ne(n);else return;this.$store.commit(`kling/setConfig`,{...t,prompt:i})},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,video_list:void 0}),this.ensurePromptToken(!1)},onSetVideoList(){let e=this.urls?.[0],t=e?[{video_url:e,refer_type:this.referenceType,keep_original_sound:this.keepOriginalSound?`yes`:`no`}]:void 0;this.$store.commit(`kling/setConfig`,{...this.config,video_list:t,generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0}),this.ensurePromptToken(!!e)},updateVideoOptions(e,t){let n=this.urls?.[0];n&&this.$store.commit(`kling/setConfig`,{...this.config,video_list:[{video_url:n,refer_type:e,keep_original_sound:t?`yes`:`no`}],...e===`base`?{start_image_url:void 0,end_image_url:void 0}:{},generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0})},async onSuccess(){this.onSetVideoList()}}}),Dt={class:`relative`},Ot={class:`flex min-h-8 items-center pr-20`},kt={class:`flex justify-start items-center`},At={class:`text-sm font-bold`},jt={key:0,class:`reference-options mt-3 flex flex-col gap-3`},Mt={class:`flex flex-col items-stretch gap-2 sm:flex-row sm:items-center sm:justify-between`},Nt={class:`text-sm`},Pt={class:`flex items-center justify-between gap-3`},Ft={class:`text-sm`};function It(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`),x=l(`el-radio-button`),S=l(`el-radio-group`),C=l(`el-switch`);return g(),s(`div`,Dt,[e(`div`,Ot,[e(`div`,kt,[e(`span`,At,i(t.$t(`kling.name.referenceVideo`)),1),a(h,{content:t.$t(`kling.description.omniReferenceVideo`)},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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferenceVideo`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`]),t.hasVideo?(g(),s(`div`,jt,[e(`div`,Mt,[e(`span`,Nt,i(t.$t(`kling.name.referenceVideoType`)),1),a(S,{modelValue:t.referenceType,"onUpdate:modelValue":n[1]||=e=>t.referenceType=e,size:`small`},{default:p(()=>[a(x,{value:`feature`},{default:p(()=>[r(i(t.$t(`kling.name.referenceVideoFeature`)),1)]),_:1}),a(x,{value:`base`},{default:p(()=>[r(i(t.$t(`kling.name.referenceVideoBase`)),1)]),_:1})]),_:1},8,[`modelValue`])]),e(`div`,Pt,[e(`span`,Ft,i(t.$t(`kling.name.keepOriginalSound`)),1),a(C,{modelValue:t.keepOriginalSound,"onUpdate:modelValue":n[2]||=e=>t.keepOriginalSound=e},null,8,[`modelValue`])])])):o(``,!0)])}var Lt=z(Et,[[`render`,It],[`__scopeId`,`data-v-7bb04cb4`]]),Rt=v({name:`KlingReferenceImages`,components:{ElButton:L,ElUpload:C,UploadIcon:N,ImagePreview:J,InfoIcon:X},mixins:[B,R],data(){return{fileList:[],uploadUrl:G()+`/api/v1/files/`}},computed:{config(){return this.$store.state.kling?.config||{}},headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},frameCount(){return Number(!!this.config.start_image_url)+Number(!!this.config.end_image_url)},maxImages(){return this.config.video_list?.length?4:7},referenceLimit(){return Math.max(0,this.maxImages-this.frameCount)},remainingSlots(){return Math.max(0,this.referenceLimit-this.urls.length)},urls(){return this.fileList.map(e=>e.response?.file_url||e.url).filter(Boolean)},storeImages(){return this.config.image_list}},watch:{frameCount(){this.syncPromptTokens()},storeImages(e){!e?.length&&this.fileList.length>0&&(this.fileList=[])}},methods:{beforeUpload(){return this.remainingSlots===0?(this.onExceed(),!1):!0},onExceed(){H.warning(this.$t(`kling.message.referenceImagesExceed`,{count:this.remainingSlots}))},onError(){H.error(this.$t(`kling.message.referenceImagesError`))},clearOmniConflicts(e){return{...e,generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0}},syncPromptTokens(e){let t=e||this.config,n=[Pe(t.prompt),...this.urls.map((e,t)=>`<<<image_${this.frameCount+t+1}>>>`)].filter(Boolean).join(` `);n!==t.prompt&&this.$store.commit(`kling/setConfig`,{...t,prompt:n})},syncConfig(){let e=this.urls.length?this.urls.map(e=>({image_url:e})):void 0,t=this.clearOmniConflicts({...this.config,image_list:e});this.$store.commit(`kling/setConfig`,t),this.syncPromptTokens(t)},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.syncConfig()},onRemove(e,t){this.fileList.splice(e,1),t.url?.startsWith(`blob:`)&&URL.revokeObjectURL(t.url),this.syncConfig()}}}),zt={class:`relative`},Bt={class:`flex justify-between items-center`},Vt={class:`flex justify-start items-center`},Ht={class:`text-sm font-bold`},Ut={key:0,class:`file-list flex flex-wrap gap-2 mt-2`};function Wt(t,n,u,d,m,_){let v=l(`info-icon`),y=l(`UploadIcon`),b=l(`el-button`),x=l(`el-upload`),S=l(`image-preview`);return g(),s(`div`,zt,[e(`div`,Bt,[e(`div`,Vt,[e(`span`,Ht,i(t.$t(`kling.name.referenceImages`)),1),a(v,{content:t.$t(`kling.description.referenceImages`)},null,8,[`content`])]),a(x,{"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg`,name:`file`,limit:t.referenceLimit,multiple:!0,"show-file-list":!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{default:p(()=>[a(b,{round:``,type:`primary`,size:`small`,disabled:t.remainingSlots===0},{default:p(()=>[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferenceImages`)),1)]),_:1},8,[`disabled`])]),_:1},8,[`file-list`,`limit`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])]),t.fileList.length?(g(),s(`div`,Ut,[(g(!0),s(c,null,h(t.fileList,(e,n)=>(g(),f(S,{key:e.uid||e.url||n,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemove(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])):o(``,!0)])}var Gt=z(Rt,[[`render`,Wt]]),Kt=v({name:`CfgScaleSelector`,components:{ElSlider:A,InfoIcon:X,ElInputNumber:k},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}}),qt={class:`flex justify-between`},Jt={class:`flex justify-start items-center`},Yt={class:`text-sm font-bold`},Xt={class:`flex justify-end items-center`},Zt={class:`w-full`};function Qt(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`,qt,[e(`div`,Jt,[e(`span`,Yt,i(t.$t(`kling.name.cfgScale`)),1),a(d,{content:t.$t(`kling.description.cfgScale`)},null,8,[`content`])]),e(`div`,Xt,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,Zt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:0,max:1,step:.1},null,8,[`modelValue`])])])}var $t=z(Kt,[[`render`,Qt]]),en=v({name:`GenerateAudioSelector`,components:{ElSwitch:j,InfoIcon:X},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},selectedMode(){return this.$store.state.kling?.config?.mode||``},supported(){return!!(F.includes(this.selectedModel)||this.selectedModel===`kling-v2-6`&&this.selectedMode===`pro`)},tooltipContent(){return this.supported?this.$t(`kling.description.generateAudio`):this.$t(`kling.description.generateAudioUnsupported`)},value:{get(){return this.supported?this.$store.state.kling?.config?.generate_audio??!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})}}}),tn={class:`relative`},nn={class:`flex justify-between items-center`},rn={class:`flex justify-start items-center`},an={class:`text-sm font-bold`};function on(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,tn,[e(`div`,nn,[e(`div`,rn,[e(`span`,an,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 sn=z(en,[[`render`,on]]),cn=[`horizontal`,`vertical`,`pan`,`tilt`,`roll`,`zoom`],ln=v({name:`CameraControlSelector`,components:{ElSelect:y,ElOption:b,ElSlider:A,ElInputNumber:k,InfoIcon:X},data(){return{configKeys:cn}},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 Z(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)}}}),un={class:`field`},dn={class:`header`},fn={class:`text-sm font-bold`},pn={key:0,class:`config-grid`},mn={class:`cfg-row-head`},hn={class:`cfg-name`};function gn(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`,un,[e(`div`,dn,[e(`span`,fn,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`,pn,[(g(!0),s(c,null,h(t.configKeys,n=>(g(),s(`div`,{key:n,class:`cfg-row`},[e(`div`,mn,[e(`span`,hn,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 _n=z(ln,[[`render`,gn],[`__scopeId`,`data-v-cd896060`]]),vn=[{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`]}],$=`, `;function yn(e,t){let n=(e||``).trim();return n?n.includes(t)?n:`${n}${$}${t}`:t}function bn(e,t){if(!e||!t)return e||``;let n=[`${t}${$}`,`${$}${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 xn=v({name:`InspirationPills`,components:{CloseIcon:he},computed:{prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return vn.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=bn(this.prompt,e);this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:t})}}}),Sn={key:0,class:`pills`,role:`list`},Cn={class:`pill-text`},wn=[`aria-label`,`title`,`onClick`];function Tn(n,r,u,d,f,p){let m=l(`close-icon`);return n.selected.length>0?(g(),s(`div`,Sn,[(g(!0),s(c,null,h(n.selected,r=>(g(),s(`div`,{key:r,class:`pill`,role:`listitem`},[e(`span`,Cn,i(r),1),e(`button`,{type:`button`,class:`pill-remove`,"aria-label":n.$t(`kling.inspiration.removeChip`),title:n.$t(`kling.inspiration.removeChip`),onClick:t(e=>n.onRemove(r),[`stop`])},[a(m,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,wn)]))),128))])):o(``,!0)}var En=v({name:`PromptInput`,components:{IdeaIcon:oe,ElButton:L,PromptTextarea:re,InspirationPills:z(xn,[[`render`,Tn],[`__scopeId`,`data-v-6be01bcf`]])},emits:[`open-inspiration`],computed:{prompt:{get(){return this.$store.state.kling?.config?.prompt},set(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Dn(e,t,n,o,s,c){let u=l(`idea-icon`),d=l(`el-button`),m=l(`inspiration-pills`),h=l(`prompt-textarea`);return g(),f(h,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||=t=>e.prompt=t,title:e.$t(`kling.name.prompt`),info:e.$t(`kling.description.prompt`),placeholder:e.$t(`kling.placeholder.prompt`)},{actions:p(()=>[a(d,{text:``,size:`small`,class:`inspiration-btn`,onClick:t[0]||=t=>e.$emit(`open-inspiration`)},{default:p(()=>[a(u,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(e.$t(`kling.inspiration.openButton`)),1)]),_:1})]),before:p(()=>[a(m)]),_:1},8,[`modelValue`,`title`,`info`,`placeholder`])}var On=z(En,[[`render`,Dn],[`__scopeId`,`data-v-5754ae54`]]),kn=v({name:`NegativePromptInput`,components:{ElInput:K,InfoIcon:X},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||=``}}),An={class:`field`},jn={class:`box`},Mn={class:`title font-bold`};function Nn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,An,[e(`div`,jn,[e(`h2`,Mn,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 Pn=z(kn,[[`render`,Nn],[`__scopeId`,`data-v-de98cf01`]]),Fn=v({name:`InspirationDrawer`,components:{Close:he,IdeaIcon:oe,ElDrawer:O,ElButton:L},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`],data(){return{groups:vn}},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(bn(this.prompt,e)):this.setPrompt(yn(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(let t of this.allChipTexts)for(;e.includes(t);)e=bn(e,t);this.setPrompt(e)}}}),In={class:`drawer-content`},Ln={class:`drawer-header`},Rn={class:`title-row`},zn={class:`title`},Bn={class:`hint`},Vn={key:0,class:`selected-bar`},Hn={class:`selected-text`},Un={class:`groups`},Wn={class:`group-title`},Gn={class:`chip-grid`},Kn=[`onClick`];function qn(t,u,d,m,_,v){let y=l(`idea-icon`),b=l(`close`),x=l(`el-button`),S=l(`el-drawer`);return g(),f(S,{modelValue:t.visible,"onUpdate:modelValue":u[1]||=e=>t.visible=e,direction:`rtl`,"with-header":!1,size:t.drawerSize,"custom-class":`kling-inspiration-drawer`,"destroy-on-close":!1},{default:p(()=>[e(`div`,In,[e(`div`,Ln,[e(`div`,Rn,[a(y,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,zn,i(t.$t(`kling.inspiration.title`)),1)]),a(x,{text:``,class:`close-btn`,"aria-label":t.$t(`common.button.close`),title:t.$t(`common.button.close`),onClick:u[0]||=e=>t.visible=!1},{default:p(()=>[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`])]),e(`div`,Bn,i(t.$t(`kling.inspiration.hint`)),1),t.selectedCount>0?(g(),s(`div`,Vn,[e(`span`,Hn,i(t.$t(`kling.inspiration.selectedSummary`,{count:t.selectedCount})),1),a(x,{text:``,size:`small`,class:`clear-btn`,onClick:t.onClearSelected},{default:p(()=>[r(i(t.$t(`kling.inspiration.clearSelected`)),1)]),_:1},8,[`onClick`])])):o(``,!0),e(`div`,Un,[(g(!0),s(c,null,h(t.groups,r=>(g(),s(`div`,{key:r.groupKey,class:`group`},[e(`div`,Wn,i(t.$t(`kling.inspiration.group.${r.groupKey}`)),1),e(`div`,Gn,[(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,Kn))),128))])]))),128))])])]),_:1},8,[`modelValue`,`size`])}var Jn=z(Fn,[[`render`,qn],[`__scopeId`,`data-v-8b2e6a5d`]]),Yn={"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-o1":`Kling O1`},Xn={std:`720p`,pro:`1080p`,"4k":`4K`},Zn=v({name:`SummaryChip`,components:{AudioIcon:ie},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){let e=this.config?.model||`kling-v2-5-turbo`;return Yn[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||``},modeLabel(){let e=this.config?.mode||`std`;return Xn[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),Qn={class:`summary-chip`},$n=[`title`],er=[`title`],tr=[`title`],nr=[`title`],rr=[`title`];function ir(t,n,r,c,u,d){let f=l(`audio-icon`);return g(),s(`div`,Qn,[e(`span`,{class:`part`,title:t.$t(`kling.name.model`)},i(t.modelLabel),9,$n),n[0]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.duration`)},i(t.durationLabel),9,er),n[1]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.ratio`)},i(t.aspectRatio||`16:9`),9,tr),n[2]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.mode`)},i(t.modeLabel),9,nr),t.generateAudio?(g(),s(`span`,{key:0,class:`audio`,title:t.$t(`kling.name.generateAudio`)},[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,rr)):o(``,!0)])}var ar=v({name:`ConfigPanel`,components:{MagicIcon:P,ElButton:L,Consumption:Y,PromptInput:On,NegativePromptInput:Pn,ModelSelector:Ve,ModeSelector:Je,DurationSelector:it,RatioSelector:dt,StartImage:vt,CfgScaleSelector:$t,GenerateAudioSelector:sn,CameraControlSelector:_n,InspirationDrawer:Jn,SummaryChip:z(Zn,[[`render`,ir],[`__scopeId`,`data-v-c800852a`]]),EndImage:Tt,ReferenceImages:Gt,ReferenceVideo:Lt},emits:[`generate`],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},capabilities(){return Z(this.config?.model,this.config?.mode,this.config?.duration)},omniActive(){return this.config?.model===`kling-o1`||!!(this.config?.image_list?.length||this.config?.video_list?.length)},consumption(){return pe(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),or={class:`flex flex-col h-full`},sr={class:`flex-1 overflow-y-auto p-5`},cr={class:`flex flex-col items-center justify-center px-5 pb-5`};function lr(t,n,c,u,d,m){let h=l(`prompt-input`),_=l(`model-selector`),v=l(`ratio-selector`),y=l(`reference-images`),b=l(`reference-video`),x=l(`start-image`),S=l(`end-image`),C=l(`duration-selector`),w=l(`mode-selector`),T=l(`generate-audio-selector`),E=l(`camera-control-selector`),D=l(`cfg-scale-selector`),O=l(`negative-prompt-input`),k=l(`summary-chip`),A=l(`consumption`),j=l(`magic-icon`),M=l(`el-button`),ee=l(`inspiration-drawer`);return g(),s(`div`,or,[e(`div`,sr,[a(h,{class:`mb-4`,onOpenInspiration:n[0]||=e=>t.inspirationOpen=!0}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),t.capabilities.referenceImages?(g(),f(y,{key:0,class:`mb-3`})):o(``,!0),t.capabilities.referenceVideo?(g(),f(b,{key:1,class:`mb-4`})):o(``,!0),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`}),t.omniActive?o(``,!0):(g(),f(E,{key:2,class:`mb-4`})),t.omniActive?o(``,!0):(g(),f(D,{key:3,class:`mb-4`})),t.omniActive?o(``,!0):(g(),f(O,{key:4,class:`mb-4`}))]),e(`div`,cr,[a(k),a(A,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),t.config?.video_url!==void 0||t.config?.custom?(g(),f(M,{key:0,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(j,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.extend`)),1)]),_:1},8,[`onClick`])):(g(),f(M,{key:1,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(j,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generate`)),1)]),_:1},8,[`onClick`]))]),a(ee,{modelValue:t.inspirationOpen,"onUpdate:modelValue":n[1]||=e=>t.inspirationOpen=e},null,8,[`modelValue`])])}var ur=z(ar,[[`render`,lr]]),dr=v({name:`MotionImage`,components:{UploadIcon:N,ElUpload:C,ElButton:L,InfoIcon:X,ImagePreview:J},mixins:[B,R],data(){return{fileList:[],uploadUrl:G()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetImageUrl()},methods:{onExceed(){H.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){H.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()}}}),fr={class:`relative`},pr={class:`flex justify-between`},mr={class:`flex justify-start items-center`},hr={class:`text-sm font-bold`};function gr(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,fr,[e(`div`,pr,[e(`div`,mr,[e(`span`,hr,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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var _r=z(dr,[[`render`,gr],[`__scopeId`,`data-v-32f5471f`]]),vr=v({name:`MotionVideo`,components:{UploadIcon:N,ElUpload:C,ElButton:L,InfoIcon:X,FilePreview:ge},mixins:[R],data(){return{fileList:[],uploadUrl:G()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetVideoUrl()},methods:{onExceed(){H.warning(this.$t(`kling.message.uploadVideoExceed`))},onError(){H.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:(H.error(this.$t(`kling.message.uploadVideoSizeExceed`)),!1):(H.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()}}}),yr={class:`relative`},br={class:`flex justify-between`},xr={class:`flex justify-start items-center`},Sr={class:`text-sm font-bold`};function Cr(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,yr,[e(`div`,br,[e(`div`,xr,[e(`span`,Sr,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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadVideoUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var wr=z(vr,[[`render`,Cr],[`__scopeId`,`data-v-80320d94`]]),Tr=v({name:`MotionPromptInput`,components:{ElInput:K,InfoIcon:X},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||``},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),Er={class:`field`},Dr={class:`box`},Or={class:`title font-bold`};function kr(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,Er,[e(`div`,Dr,[e(`h2`,Or,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 Ar=z(Tr,[[`render`,kr],[`__scopeId`,`data-v-ca9fdbe5`]]),jr=`video`,Mr=v({name:`CharacterOrientationSelector`,components:{ElRadioGroup:D,ElRadioButton:E,InfoIcon:X},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||jr},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=jr)}}),Nr={class:`field`},Pr={class:`header`},Fr={class:`text-sm font-bold`};function Ir(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`,Nr,[e(`div`,Pr,[e(`span`,Fr,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 Lr=z(Mr,[[`render`,Ir],[`__scopeId`,`data-v-7a91195b`]]),Rr=`kling-v2-6`,zr=v({name:`MotionModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:X},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||Rr},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=Rr)}}),Br={class:`field`},Vr={class:`header`},Hr={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`,Br,[e(`div`,Vr,[e(`h2`,Hr,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 Wr=z(zr,[[`render`,Ur],[`__scopeId`,`data-v-480e8da2`]]),Gr=`std`,Kr=v({name:`MotionModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon: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?.motionConfig?.mode||Gr},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=Gr)}}),qr={class:`field`},Jr={class:`header`},Yr={class:`title font-bold`};function Xr(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,qr,[e(`div`,Jr,[e(`h2`,Yr,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 Zr=z(Kr,[[`render`,Xr],[`__scopeId`,`data-v-1295688c`]]),Qr=v({name:`KeepOriginalSoundSelector`,components:{ElSwitch:j,InfoIcon:X},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`})}}}}),$r={class:`relative`},ei={class:`flex justify-between items-center`},ti={class:`flex justify-start items-center`},ni={class:`text-sm font-bold`};function ri(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,$r,[e(`div`,ei,[e(`div`,ti,[e(`span`,ni,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 ii=v({name:`MotionPanel`,components:{MagicIcon:P,ElButton:L,Consumption:Y,MotionImage:_r,MotionVideo:wr,MotionPromptInput:Ar,CharacterOrientationSelector:Lr,MotionModelSelector:Wr,MotionModeSelector:Zr,KeepOriginalSoundSelector:z(Qr,[[`render`,ri]])},emits:[`generate`],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return pe({...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`)}}}),ai={class:`flex flex-col h-full`},oi={class:`flex-1 overflow-y-auto p-5`},si={class:`flex flex-col items-center justify-center px-5 pb-5`};function ci(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(`magic-icon`),C=l(`el-button`);return g(),s(`div`,ai,[e(`div`,oi,[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`,si,[a(x,{value:t.consumption,service:t.service,"rate-unit":t.$t(`kling.name.perSecond`),note:t.$t(`kling.message.motionPricingNote`)},null,8,[`value`,`service`,`rate-unit`,`note`]),a(C,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(S,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generateMotion`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var li=z(ii,[[`render`,ci]]),ui=v({name:`KlingTabSwitcher`,components:{ElTabs:x,ElTabPane:S,ElTag:de},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)}}}),di=[`title`],fi={class:`text`};function pi(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 scenario-tabs scenario-tabs--divided`,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`,fi,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,di)]),_:2},1032,[`name`,`disabled`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var mi=z(ui,[[`render`,pi],[`__scopeId`,`data-v-4c7b6046`]]),hi={"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`},gi=v({name:`TalkingPhotoModelSelector`,components:{ElSelect:y,ElOption:b},data(){return{options:ce.map(e=>({value:e,label:hi[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=ue)}}),_i={class:`field`},vi={class:`title font-bold`};function yi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,_i,[e(`h2`,vi,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 bi=z(gi,[[`render`,yi],[`__scopeId`,`data-v-cbc83d11`]]),xi=v({name:`TalkingPhotoModeSelector`,components:{ElSelect:y,ElOption:b},computed:{options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`)},{value:`pro`,label:this.$t(`kling.name.modePro`)}]},value:{get(){return this.$store.state.kling?.talkingPhotoConfig?.mode||`pro`},set(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.$store.state.kling?.talkingPhotoConfig,mode:e})}}},mounted(){this.$store.state.kling?.talkingPhotoConfig?.mode||(this.value=`pro`)}}),Si={class:`field`},Ci={class:`title font-bold`};function wi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Si,[e(`h2`,Ci,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 Ti=v({name:`TalkingPhotoPanel`,components:{MagicIcon:P,UploadIcon:N,ElUpload:C,ElButton:L,ElInput:K,Consumption:Y,InfoIcon:X,ImagePreview:J,ModelSelector:bi,ModeSelector:z(xi,[[`render`,wi],[`__scopeId`,`data-v-92525a1d`]])},mixins:[R],emits:[`generate`],data(){return{imageFiles:[],audioFiles:[],uploadUrl:G()+`/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 pe({...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(){H.warning(this.$t(`kling.message.uploadReferencesExceed`))},onImageError(){H.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(){H.warning(this.$t(`kling.message.uploadAudioExceed`))},onAudioError(){H.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`)}}}),Ei={class:`flex flex-col h-full`},Di={class:`flex-1 overflow-y-auto p-5`},Oi={class:`relative mb-4`},ki={class:`flex justify-start items-center`},Ai={class:`text-sm font-bold`},ji={class:`relative mb-4`},Mi={class:`flex justify-start items-center`},Ni={class:`text-sm font-bold`},Pi=[`src`],Fi={class:`mb-4`},Ii={class:`flex justify-start items-center`},Li={class:`text-sm font-bold`},Ri={class:`flex flex-col items-center justify-center px-5 pb-5`};function zi(t,n,c,u,d,m){let h=l(`model-selector`),_=l(`mode-selector`),v=l(`info-icon`),y=l(`image-preview`),b=l(`upload-icon`),x=l(`el-button`),S=l(`el-upload`),C=l(`el-input`),w=l(`consumption`),T=l(`magic-icon`);return g(),s(`div`,Ei,[e(`div`,Di,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),e(`div`,Oi,[e(`div`,ki,[e(`span`,Ai,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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`])]),e(`div`,ji,[e(`div`,Mi,[e(`span`,Ni,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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),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,Pi)):o(``,!0)]),e(`div`,Fi,[e(`div`,Ii,[e(`span`,Li,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`,Ri,[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(T,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generateTalkingPhoto`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var Bi=z(Ti,[[`render`,zi],[`__scopeId`,`data-v-1cf65bf0`]]),Vi=v({name:`TaskPreview`,components:{ChannelIcon:ne,InfoIcon:ae,MagicIcon:P,TimeIcon:ee,WarningIcon:se,CopyToClipboard:te,ElAlert:T,VideoPlayer:be,ElTooltip:w,ElButton:L,ImagePreview:J,VideoPreview:Ce,AudioPreview:we,ApiCodeButton:xe},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{isFailure(){let e=this.modelValue?.response;return e?.success===!1||!!e?.error||e?.state===`failed`||e?.state===`cancelled`},isWaiting(){let e=this.modelValue?.response;return!e||!this.isFailure&&e.success!==!0&&!e.video_url},application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},referenceImages(){let e=[],t=this.modelValue?.request?.start_image_url,n=this.modelValue?.request?.end_image_url,r=this.modelValue?.request?.image_url;return t&&e.push({url:t,name:`start-image`}),n&&e.push({url:n,name:`end-image`}),r&&e.push({url:r,name:`reference-image`}),e},referenceVideos(){let e=[],t=this.modelValue?.request?.video_url;t&&e.push({url:t,name:`reference-video`});let n=this.modelValue?.request?.video_list;return(Array.isArray(n)?n:[]).forEach((t,n)=>{t?.video_url&&e.push({url:t.video_url,name:`reference-video-${n+1}`})}),e},referenceAudios(){let e=this.modelValue?.request?.audio_url;return e?[{url:e,name:`reference-audio`}]:[]}},methods:{onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),Hi={class:`preview`},Ui={class:`left`},Wi={class:`main`},Gi={class:`bot`},Ki={class:`datetime`},qi={class:`info`},Ji={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Yi={key:1,class:`prompt mt-2`},Xi={key:0},Zi={key:1},Qi={key:0,class:n({content:!0,failed:!0})},$i={key:0,class:`mb-4`},ea={key:1,class:n({operations:!0,"mt-2":!0})},ta={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},na={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ra={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ia={key:1,class:n({content:!0})},aa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},oa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},sa={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ca={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},la={key:2,class:n({content:!0})},ua={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},da={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function fa(t,n,u,d,m,_){let v=l(`capability-presentation`),y=l(`image-preview`),b=l(`video-preview`),x=l(`audio-preview`),S=l(`video-player`),C=l(`el-button`),w=l(`el-tooltip`),T=l(`api-code-button`),E=l(`channel-icon`),D=l(`magic-icon`),O=l(`copy-to-clipboard`),k=l(`time-icon`),A=l(`el-alert`),j=l(`warning-icon`),M=l(`info-icon`);return g(),s(`div`,Hi,[e(`div`,Ui,[a(v,{capability:`kling`,part:`avatar`,class:`avatar`})]),e(`div`,Wi,[e(`div`,Gi,[a(v,{capability:`kling`,part:`name`}),e(`span`,Ki,i(t.$dayjs.format(``+new Date(parseFloat((t.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,qi,[t.referenceImages.length>0||t.referenceVideos.length>0||t.referenceAudios.length>0?(g(),s(`div`,Ji,[(g(!0),s(c,null,h(t.referenceImages,(e,t)=>(g(),f(y,{key:`image-${t}`,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(t.referenceVideos,(e,t)=>(g(),f(b,{key:`video-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(t.referenceAudios,(e,t)=>(g(),f(x,{key:`audio-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128))])):o(``,!0),t.modelValue?.request?.prompt?(g(),s(`p`,Yi,[r(i(t.modelValue?.request?.prompt)+` `,1),t.modelValue?.response?t.isWaiting?(g(),s(`span`,Zi,` - (`+i(t.$t(`kling.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,Xi,` - (`+i(t.$t(`kling.status.pending`))+`) `,1))])):o(``,!0)]),t.modelValue?.response?.success===!0&&!t.isFailure?(g(),s(`div`,Qi,[t.modelValue?.response.video_url?(g(),s(`div`,$i,[a(S,{src:t.modelValue?.response.video_url},null,8,[`src`])])):o(``,!0),t.modelValue?.response.success?(g(),s(`div`,ea,[a(w,{class:`box-item`,effect:`dark`,content:t.$t(`kling.message.downloadVideo`),placement:`top-start`},{default:p(()=>[t.modelValue?.response.video_url?(g(),f(C,{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(T,{path:`/kling/videos`,body:t.modelValue?.request},null,8,[`body`])])):o(``,!0),a(A,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,ta,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.model`))+`: `+i(t.modelValue?.request?.model),1)]),e(`p`,na,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(O,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.elapsed?(g(),s(`p`,ra,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.elapsed`))+`: `+i(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),t.isFailure?(g(),s(`div`,ia,[a(A,{closable:!1,class:`failure`},{template:p(()=>[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,aa,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(O,{content:t.modelValue?.id},null,8,[`content`])]),e(`p`,oa,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.failureReason`))+`: `+i(t.modelValue?.response?.error?.message)+` `,1),a(O,{content:t.modelValue?.response?.error?.message},null,8,[`content`])]),t.modelValue?.elapsed?(g(),s(`p`,sa,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),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`,ca,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.traceId`))+`: `+i(t.modelValue?.response?.trace_id)+` `,1),a(O,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),t.isWaiting?(g(),s(`div`,la,[a(A,{closable:!1,class:`info`},{template:p(()=>[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(t.modelValue?.response?`kling.status.processing`:`kling.status.pending`)),1)]),default:p(()=>[e(`p`,ua,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(O,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.response?.trace_id?(g(),s(`p`,da,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.traceId`))+`: `+i(t.modelValue?.response?.trace_id)+` `,1),a(O,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var pa=v({name:`RecentPanel`,components:{TaskPreview:z(Vi,[[`render`,fa],[`__scopeId`,`data-v-d5f75276`]]),NoTasks:ve,BotPlaceholder:Se,ScrollList:_e},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?.()}}}),ma={key:0},ha={key:2,class:`w-full h-full flex items-center justify-center`};function ga(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`,ma,[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`,ha,[a(v)])):o(``,!0)],64)}var _a=v({name:`KlingIndex`,components:{ConfigPanel:ur,MotionPanel:li,TalkingPhotoPanel:Bi,TabSwitcher:mi,Layout:Ae,RecentPanel:z(pa,[[`render`,ga]])},mixins:[fe],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===me.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===me.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 ye({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(!q(this.uploadTracker,e=>this.$t(e),e=>H.warning(e)))return;let{camera_control:e,...t}=this.config||{},n={...t,async:!0},r=Number(!!n.start_image_url)+Number(!!n.end_image_url),i=n.image_list?.length||0,a=n.video_list?.length?4:7;if(r+i>a){H.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:a}));return}if(n.video_list?.[0]?.refer_type===`base`&&(n.start_image_url||n.end_image_url||n.image_list?.some(({type:e})=>e))){H.warning(this.$t(`kling.message.baseVideoFrameConflict`));return}if(!n.video_id&&!t.video_url&&!n.start_image_url&&n.end_image_url){H.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 o=this.credential?.token;if(!o){console.error(`no token specified`);return}H.info(this.$t(`kling.message.startingTask`)),W(`kling`,V.generate(n,{token:o})).then(()=>{H.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?H.error(this.$t(`kling.message.usedUp`)):H.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(!q(this.uploadTracker,e=>this.$t(e),e=>H.warning(e)))return;let e=this.motionConfig||{};if(!e.image_url||!e.video_url){H.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}H.info(this.$t(`kling.message.startingTask`)),W(`kling`,V.motion(t,{token:n})).then(()=>{H.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?H.error(this.$t(`kling.message.usedUp`)):H.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},async onGenerateTalkingPhoto(){if(!q(this.uploadTracker,e=>this.$t(e),e=>H.warning(e)))return;let e=this.talkingPhotoConfig||{};if(!e.image_url||!e.audio_url){H.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}H.info(this.$t(`kling.message.startingTask`)),W(`kling`,V.talkingPhoto(t,{token:n})).then(()=>{H.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?H.error(this.$t(`kling.message.usedUp`)):H.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),va={class:`flex flex-col h-full`},ya={class:`flex-1 min-h-0`};function ba(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`,va,[a(u,{"model-value":t.taskType,"onUpdate:modelValue":t.onTabChange},null,8,[`model-value`,`onUpdate:modelValue`]),e(`div`,ya,[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 xa=z(_a,[[`render`,ba]]);export{xa as default};
@@ -1 +1 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{n as v,r as y,t as b}from"./select-DZCaWKok.js";import{t as x}from"./upload-DOmU-ynH.js";import{t as S}from"./tooltip-CI4l4DOg.js";import{t as C}from"./alert-DqN2o6YF.js";import{t as w}from"./drawer-Bu5U_TlI.js";import{t as T}from"./input-number-sKcZZmDs.js";import{n as E}from"./taskDrawerMixin-CrFn6ABi.js";import{t as D}from"./box-vQGTyK9k.js";import{t as O}from"./clock-C90hJcW0.js";import{t as k}from"./CopyToClipboard-DksVZ0H5.js";import{r as A,t as j}from"./PromptTextarea-BKlwJ34c.js";import{t as M}from"./image-acE7lpK-.js";import{t as N}from"./info-xDtf26MC.js";import{t as P}from"./triangle-alert-DPU3gv8f.js";import{t as F}from"./upload-CbGx0SCQ.js";import{t as I}from"./wand-sparkles-pGeyau5p.js";import{t as ee}from"./zap-B_H9Zf2S.js";import{Cn as te,En as L,Sn as ne,Tn as re,_n as R,bn as z,gn as B,mn as V,pn as ie,vn as H,xn as U,yn as W}from"./constants-D-3QKDN1.js";import{$t as ae,Ai as G,Bt as oe,Cn as se,E as K,Ht as ce,Vt as le,Wt as ue,ei as q,gi as J,hi as de,mr as fe,ri as pe,zt as me}from"./index-C16Hj9CP.js";import{t as Y}from"./ImagePreview-CMBKb-1b.js";import{t as he}from"./Consumption-CbSuHo-B.js";import{a as X,n as ge,r as _e,t as ve}from"./pagination-Bx8kvO1A.js";import{t as ye}from"./ApiCodeButton-CUd4TC1Q.js";import{t as be}from"./BotPlaceholder-BOpg76Oi.js";import{t as xe}from"./ImageWrapper-ZRo3oVgf.js";var Se=_({name:`LayoutSeedream`,components:{MagicIcon:I,ElDrawer:w,ElButton:G},mixins:[E]}),Ce={class:`main flex flex-row flex-1`},we={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Te={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ee(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,Ce,[e(`div`,we,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Te,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[g,!t.tasksEmpty]]),a(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var De=K(Se,[[`render`,Ee],[`__scopeId`,`data-v-c10167d0`]]),Oe=_({name:`SeedreamPromptInput`,components:{PromptTextarea:j},computed:{prompt:{get(){return this.$store.state.seedream?.config?.prompt},set(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,prompt:e})}}},mounted(){this.prompt||=``}});function ke(e,t,n,r,i,a){let o=l(`prompt-textarea`);return h(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`seedream.name.prompt`),info:e.$t(`seedream.description.prompt`),placeholder:e.$t(`seedream.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ae=K(Oe,[[`render`,ke]]),je={image:!0,imageRequired:!1,sizeTiers:[`1K`,`2K`,`3K`,`4K`],sizeAdaptive:!0,sizePixel:!0,sizePixelDefault:void 0,groupGeneration:!1,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};function Z(e){switch(e){case z:return{image:!0,imageRequired:!1,sizeTiers:[`1K`,`2K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!1,seed:!1,guidanceScale:!1,outputFormat:!0,tools:!1};case W:return{image:!0,imageRequired:!1,sizeTiers:[`2K`,`3K`,`4K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!0,tools:!0};case H:return{image:!0,imageRequired:!1,sizeTiers:[`2K`,`4K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};case R:return{image:!0,imageRequired:!1,sizeTiers:[`1K`,`2K`,`4K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};case B:return{image:!1,imageRequired:!1,sizeTiers:[],sizeAdaptive:!1,sizePixel:!0,sizePixelDefault:`1024x1024`,groupGeneration:!1,seed:!0,guidanceScale:!0,guidanceScaleDefault:V[B],outputFormat:!1,tools:!1};case U:return{image:!0,imageRequired:!0,sizeTiers:[],sizeAdaptive:!1,sizePixel:!0,sizePixelDefault:`1024x1024`,groupGeneration:!1,seed:!1,guidanceScale:!0,guidanceScaleDefault:V[U],outputFormat:!1,tools:!1};default:return je}}function Q(e,t){let n=Z(e);return n.imageRequired||n.image&&t?.length?`edit`:`generate`}var Me=[`1K`,`2K`,`3K`,`4K`];function Ne(e,t){if(!e)return[];let n=t.model??e.model;if(!n)return[];let r=Z(n),i=[];Array.isArray(e.image)&&e.image.length>0&&!r.image&&i.push({field:`image`,i18nLabel:`seedream.name.imageUrls`});let a=typeof e.size==`string`?e.size:void 0;if(a){let e=a.toUpperCase();(Me.includes(e)&&!r.sizeTiers.includes(e)||a===`adaptive`&&!r.sizeAdaptive)&&i.push({field:`size`,i18nLabel:`seedream.name.size`})}return e.sequential_image_generation===`auto`&&!r.groupGeneration&&i.push({field:`sequential_image_generation`,i18nLabel:`seedream.name.maxImages`}),e.seed!==void 0&&e.seed!==null&&!r.seed&&i.push({field:`seed`,i18nLabel:`seedream.name.seed`}),e.guidance_scale!==void 0&&e.guidance_scale!==null&&!r.guidanceScale&&i.push({field:`guidance_scale`,i18nLabel:`seedream.name.guidanceScale`}),e.output_format&&!r.outputFormat&&i.push({field:`output_format`,i18nLabel:`seedream.name.outputFormat`}),Array.isArray(e.tools)&&e.tools.length>0&&!r.tools&&i.push({field:`tools`,i18nLabel:`seedream.name.tools`}),i}function Pe(e,t,n){let r={...e},i=Z(n.model??e.model);for(let e of t)switch(e.field){case`image`:delete r.image;break;case`size`:i.sizePixelDefault?r.size=i.sizePixelDefault:delete r.size;break;case`sequential_image_generation`:r.sequential_image_generation=`disabled`,delete r.sequential_image_generation_options;break;case`seed`:delete r.seed;break;case`guidance_scale`:delete r.guidance_scale;break;case`output_format`:delete r.output_format;break;case`tools`:delete r.tools;break}return r}var Fe=_({name:`SeedreamImageInput`,components:{UploadIcon:F,ElUpload:x,ElButton:G,InfoIcon:X,ImagePreview:Y},mixins:[ce,oe],data(){return{fileList:[],uploadUrl:pe()+`/api/v1/files/`,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.seedream?.config?.image},model(){return this.$store.state.seedream?.config?.model},supported(){return Z(this.model).image}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){let e=(this.fileList||[]).filter(e=>!e?.response?.file_url);this.fileList=e.length?e:[];return}let t=[];e.forEach(e=>{let n=this.fileList.find(t=>t?.response?.file_url===e||t?.url===e);n?t.push(n):t.push({name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}})}),(this.fileList||[]).filter(e=>!e?.response?.file_url).forEach(e=>{t.some(t=>t===e||t?.url===e?.url||t?.response?.file_url===e?.response?.file_url)||t.push(e)}),this.fileList=t}}},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url==`string`&&e.url.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImages()},onExceed(){J.warning(this.$t(`seedream.message.uploadImageExceed`))},onError(){J.error(this.$t(`seedream.message.uploadImageError`))},onSetImages(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,image:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImages()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImages()}}}),Ie={key:0},Le={class:`field`},Re={class:`label`},ze={class:`box`},Be={class:`title font-bold`},Ve={class:`value`},He={class:`file-list mt-2 flex flex-wrap gap-[10px]`};function Ue(t,n,u,d,g,_){let v=l(`info-icon`),y=l(`upload-icon`),b=l(`el-button`),x=l(`el-upload`),S=l(`image-preview`);return t.supported?(h(),s(`div`,Ie,[e(`div`,Le,[e(`div`,Re,[e(`div`,ze,[e(`h2`,Be,i(t.$t(`seedream.name.imageUrls`)),1),a(v,{content:t.$t(`seedream.description.imageUrls`),class:`info`},null,8,[`content`])])]),e(`div`,Ve,[a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,limit:14,multiple:!0,"show-file-list":!1,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-change":t.onChange,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(b,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedream.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])])]),e(`div`,He,[(h(!0),s(c,null,m(t.fileList,(e,n)=>(h(),f(S,{key:e.uid||e?.response?.file_url||e.url||n,url:e.url||e?.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemovePreview(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])])):o(``,!0)}var We=K(Fe,[[`render`,Ue],[`__scopeId`,`data-v-ac071e59`]]),Ge=_({name:`SeedreamModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:X},data(){return{revertKey:0,options:[{value:z,label:this.$t(`seedream.model.seedream50pro`)},{value:W,label:this.$t(`seedream.model.seedream50`)},{value:H,label:this.$t(`seedream.model.seedream45`)},{value:R,label:this.$t(`seedream.model.seedream40`)},{value:B,label:this.$t(`seedream.model.seedream30t2i`)},{value:U,label:this.$t(`seedream.model.seededit30i2i`)}]}},computed:{value(){return this.$store.state.seedream?.config?.model}},mounted(){this.value||this.applyModel(ie)},methods:{async onChange(e){let t=this.$store.state.seedream?.config||{},n=Ne(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await de.confirm(this.$t(`seedream.message.featureNotSupportedBody`,{fields:r}),this.$t(`seedream.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`seedream.button.confirmContinue`),cancelButtonText:this.$t(`seedream.button.cancelSwitch`),type:`warning`});let i=Pe({...t,model:e},n,{model:e});this.$store.commit(`seedream/setConfig`,i),J.success(this.$t(`seedream.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,model:e})}}}),Ke={class:`field`},qe={class:`label`},Je={class:`box`},Ye={class:`title font-bold`};function Xe(t,n,r,o,u,d){let g=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return h(),s(`div`,Ke,[e(`div`,qe,[e(`div`,Je,[e(`h2`,Ye,i(t.$t(`seedream.name.model`)),1),a(g,{content:t.$t(`seedream.description.model`),class:`info`},null,8,[`content`])])]),(h(),f(v,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`seedream.placeholder.select`),onChange:t.onChange},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var Ze=K(Ge,[[`render`,Xe],[`__scopeId`,`data-v-6413c179`]]),Qe=_({name:`SeedreamSizeSelector`,components:{ElSelect:y,ElOption:b,ElOptionGroup:v,InfoIcon:X},data(){return{SEEDREAM_SIZE_ADAPTIVE:re,pixelOptions:te}},computed:{model(){return this.$store.state.seedream?.config?.model},capabilities(){return Z(this.model)},value:{get(){return this.$store.state.seedream?.config?.size},set(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,size:e})}}},watch:{model:{immediate:!0,handler(){if(this.value)return;let e=this.capabilities;e.sizeTiers.length?this.value=e.sizeTiers.includes(`2K`)?`2K`:e.sizeTiers[0]:e.sizePixelDefault&&(this.value=e.sizePixelDefault)}}}}),$e={class:`field`},et={class:`label`},tt={class:`box`},nt={class:`title font-bold`};function rt(t,n,r,u,d,g){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-option-group`),b=l(`el-select`);return h(),s(`div`,$e,[e(`div`,et,[e(`div`,tt,[e(`h2`,nt,i(t.$t(`seedream.name.size`)),1),a(_,{content:t.$t(`seedream.description.size`),class:`info`},null,8,[`content`])])]),a(b,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedream.placeholder.size`),filterable:``,"allow-create":``,"default-first-option":``},{default:p(()=>[t.capabilities.sizeTiers.length?(h(),f(y,{key:0,label:t.$t(`seedream.size.group.tier`)},{default:p(()=>[(h(!0),s(c,null,m(t.capabilities.sizeTiers,e=>(h(),f(v,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`label`])):o(``,!0),t.capabilities.sizeAdaptive?(h(),f(y,{key:1,label:t.$t(`seedream.size.group.adaptive`)},{default:p(()=>[(h(),f(v,{key:t.SEEDREAM_SIZE_ADAPTIVE,label:t.$t(`seedream.size.adaptive`),value:t.SEEDREAM_SIZE_ADAPTIVE},null,8,[`label`,`value`]))]),_:1},8,[`label`])):o(``,!0),a(y,{label:t.$t(`seedream.size.group.pixel`)},{default:p(()=>[(h(!0),s(c,null,m(t.pixelOptions,e=>(h(),f(v,{key:e.value,label:`${e.value} (${e.ratio})`,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`label`])]),_:1},8,[`modelValue`,`placeholder`])])}var it=K(Qe,[[`render`,rt],[`__scopeId`,`data-v-dd7bd021`]]),at=_({name:`SeedreamMaxImagesSelector`,components:{ElInputNumber:T,InfoIcon:X},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Z(this.config?.model).groupGeneration},referenceImageCount(){let e=this.config?.image;return Array.isArray(e)?e.length:0},effectiveMax(){let e=15-this.referenceImageCount;return Math.max(1,Math.min(15,e))},value:{get(){let e=this.config?.sequential_image_generation_options?.max_images;return typeof e==`number`&&e>=1?e:1},set(e){let t={...this.config||{}},n=Math.max(1,Math.min(this.effectiveMax,Math.floor(e||1)));n>1?(t.sequential_image_generation=`auto`,t.sequential_image_generation_options={...t.sequential_image_generation_options||{},max_images:n}):(t.sequential_image_generation=`disabled`,t.sequential_image_generation_options&&delete t.sequential_image_generation_options),this.$store.commit(`seedream/setConfig`,t)}}},watch:{effectiveMax(e){this.value>e&&(this.value=e)}}}),ot={key:0,class:`field`},st={class:`label`},ct={class:`box`},lt={class:`title font-bold`},ut={class:`value`};function dt(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-input-number`);return t.supported?(h(),s(`div`,ot,[e(`div`,st,[e(`div`,ct,[e(`h2`,lt,i(t.$t(`seedream.name.maxImages`)),1),a(f,{content:t.$t(`seedream.description.maxImages`),class:`info`},null,8,[`content`])])]),e(`div`,ut,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:1,max:t.effectiveMax,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`,`max`])])])):o(``,!0)}var ft=K(at,[[`render`,dt],[`__scopeId`,`data-v-f079fd20`]]),pt=_({name:`SeedreamOutputFormatSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:X},data(){return{options:[...ne]}},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Z(this.config?.model).outputFormat},value:{get(){return this.config?.output_format},set(e){let t={...this.config||{}};t.output_format=e,this.$store.commit(`seedream/setConfig`,t)}}}}),mt={key:0,class:`field`},ht={class:`label`},gt={class:`box`},_t={class:`title font-bold`};function vt(t,n,r,u,d,g){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-select`);return t.supported?(h(),s(`div`,mt,[e(`div`,ht,[e(`div`,gt,[e(`h2`,_t,i(t.$t(`seedream.name.outputFormat`)),1),a(_,{content:t.$t(`seedream.description.outputFormat`),class:`info`},null,8,[`content`])])]),a(y,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedream.placeholder.select`)},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(v,{key:e,label:e.toUpperCase(),value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])):o(``,!0)}var yt=K(pt,[[`render`,vt],[`__scopeId`,`data-v-69ea4c07`]]),bt=_({name:`SeedreamSeedInput`,components:{ElInputNumber:T,InfoIcon:X},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Z(this.config?.model).seed},value:{get(){let e=this.config?.seed;return typeof e==`number`?e:-1},set(e){let t={...this.config||{}};t.seed=typeof e==`number`&&Number.isInteger(e)?e:-1,this.$store.commit(`seedream/setConfig`,t)}}}}),xt={key:0,class:`field`},St={class:`label`},Ct={class:`box`},wt={class:`title font-bold`},Tt={class:`value`};function Et(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-input-number`);return t.supported?(h(),s(`div`,xt,[e(`div`,St,[e(`div`,Ct,[e(`h2`,wt,i(t.$t(`seedream.name.seed`)),1),a(f,{content:t.$t(`seedream.description.seed`),class:`info`},null,8,[`content`])])]),e(`div`,Tt,[a(p,{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`])])])):o(``,!0)}var Dt=K(bt,[[`render`,Et],[`__scopeId`,`data-v-10cdc1e0`]]),Ot=_({name:`SeedreamGuidanceScaleInput`,components:{ElInputNumber:T,InfoIcon:X},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Z(this.config?.model).guidanceScale},defaultValue(){return Z(this.config?.model).guidanceScaleDefault??2.5},value:{get(){let e=this.config?.guidance_scale;return typeof e==`number`?e:this.defaultValue},set(e){let t={...this.config||{}};t.guidance_scale=typeof e==`number`&&e>=1&&e<=10?e:this.defaultValue,this.$store.commit(`seedream/setConfig`,t)}}}}),kt={key:0,class:`field`},At={class:`label`},jt={class:`box`},Mt={class:`title font-bold`},Nt={class:`value`};function Pt(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-input-number`);return t.supported?(h(),s(`div`,kt,[e(`div`,At,[e(`div`,jt,[e(`h2`,Mt,i(t.$t(`seedream.name.guidanceScale`)),1),a(f,{content:t.$t(`seedream.description.guidanceScale`),class:`info`},null,8,[`content`])])]),e(`div`,Nt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:1,max:10,step:.1,precision:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])):o(``,!0)}var Ft=K(Ot,[[`render`,Pt],[`__scopeId`,`data-v-7386f064`]]),$=e=>{let t={...e||{}},n=Q(t.model,t.image);return delete t.action,t.watermark=!1,(n!==`edit`||!t.image?.length)&&delete t.image,t.size||delete t.size,t.sequential_image_generation!==`auto`&&delete t.sequential_image_generation_options,{...t,async:!0}},It=_({name:`SeedreamConfigPanel`,components:{MagicIcon:I,ElButton:G,PromptInput:Ae,Consumption:he,ImageInput:We,ModelSelector:Ze,SizeSelector:it,MaxImagesSelector:ft,OutputFormatSelector:yt,SeedInput:Dt,GuidanceScaleInput:Ft},emits:[`generate`],computed:{action(){return Q(this.config?.model,this.config?.image)},capabilities(){return Z(this.config?.model)},config(){return this.$store.state.seedream?.config},consumption(){let e=$(this.config),t=e.sequential_image_generation===`auto`?Math.max(1,Math.floor(e.sequential_image_generation_options?.max_images||1)):1;return ue({...e,action:this.action,model:L(e.model),input_image_count:e.image?.length||0,count:t},this.service?.cost)},service(){return this.$store.state.seedream?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),Lt={class:`flex flex-col h-full`},Rt={class:`flex-1 overflow-y-auto p-5`},zt={class:`flex flex-col items-center justify-center px-5 pb-5`};function Bt(t,n,c,u,d,m){let g=l(`model-selector`),_=l(`size-selector`),v=l(`max-images-selector`),y=l(`output-format-selector`),b=l(`seed-input`),x=l(`guidance-scale-input`),S=l(`prompt-input`),C=l(`image-input`),w=l(`consumption`),T=l(`magic-icon`),E=l(`el-button`);return h(),s(`div`,Lt,[e(`div`,Rt,[a(g,{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`}),t.capabilities.image?(h(),f(C,{key:0,class:`mb-4`})):o(``,!0)]),e(`div`,zt,[a(w,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(E,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(T,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedream.button.generate`)),1)]),_:1},8,[`onClick`])])])}var Vt=K(It,[[`render`,Bt]]),Ht=_({name:`SeedreamTaskPreview`,components:{ApplicationIcon:D,ChannelIcon:A,ImageIcon:M,InfoIcon:N,LightningIcon:ee,MagicIcon:I,TimeIcon:O,WarningIcon:P,CopyToClipboard:k,ElAlert:C,ImageWrapper:xe,ElButton:G,ElTooltip:S,ImagePreview:Y,ApiCodeButton:ye},props:{modelValue:{type:Object,required:!0}},computed:{apiRequest(){return $(this.modelValue?.request)},isEdit(){return Array.isArray(this.modelValue?.request?.image)&&(this.modelValue?.request?.image?.length||0)>0},images(){let e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{e.push(t)}),e}},methods:{shortModel(e){return L(e)||e},onEdit(e){if(!e)return;console.debug(`Edit image:`,e);let t={...this.$store.state.seedream?.config||{}};t.image=[e],this.$store.commit(`seedream/setConfig`,t)}}}),Ut={class:`preview`},Wt={class:`left`},Gt={class:`main`},Kt={class:`bot`},qt={class:`datetime`},Jt={class:`info`},Yt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Xt={key:1,class:`prompt mt-2`},Zt={key:0},Qt={key:0,class:n({content:!0})},$t={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},en={key:1,class:n({content:!0,failed:!0})},tn={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},nn={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},rn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},an={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},on={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},sn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},cn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ln={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},un={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},dn={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},fn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},pn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},mn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},hn={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},gn={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},_n={key:3,class:n({content:!0})},vn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},yn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function bn(u,d,g,_,v,y){let b=l(`capability-presentation`),x=l(`image-preview`),S=l(`time-icon`),C=l(`magic-icon`),w=l(`copy-to-clipboard`),T=l(`el-alert`),E=l(`image-wrapper`),D=l(`el-button`),O=l(`el-tooltip`),k=l(`api-code-button`),A=l(`application-icon`),j=l(`image-icon`),M=l(`lightning-icon`),N=l(`channel-icon`),P=l(`warning-icon`),F=l(`info-icon`);return h(),s(`div`,Ut,[e(`div`,Wt,[a(b,{capability:`seedream`,part:`avatar`,class:`avatar`})]),e(`div`,Gt,[e(`div`,Kt,[a(b,{capability:`seedream`,part:`name`}),e(`span`,qt,i(u.$dayjs.format(``+new Date(parseFloat((u.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,Jt,[Array.isArray(u.modelValue?.request?.image)&&u.modelValue?.request?.image.length>0?(h(),s(`div`,Yt,[(h(!0),s(c,null,m(u.modelValue?.request?.image,(e,t)=>(h(),f(x,{key:t,url:e,name:`image-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),u.modelValue?.request?.prompt?(h(),s(`p`,Xt,[r(i(u.modelValue?.request?.prompt)+` `,1),u.modelValue?.response?o(``,!0):(h(),s(`span`,Zt,` - (`+i(u.$t(`seedream.status.pending`))+`) `,1))])):o(``,!0)]),u.modelValue?.response?u.modelValue?.response?.success===!0?(h(),s(`div`,en,[e(`div`,tn,[(h(!0),s(c,null,m(u.images,(e,t)=>(h(),f(E,{key:t,src:e?.image_url,"raw-src":e?.image_url},null,8,[`src`,`raw-src`]))),128))]),e(`div`,nn,[a(O,{class:`box-item`,effect:`dark`,content:u.$t(`common.button.edit`),placement:`top-start`},{default:p(()=>[a(D,{type:`info`,size:`small`,class:`btn-action`,onClick:d[0]||=t(e=>u.onEdit(u.images?.[0]?.image_url),[`stop`])},{default:p(()=>[r(i(u.$t(`common.button.edit`)),1)]),_:1})]),_:1},8,[`content`]),a(k,{path:`/seedream/images`,body:u.apiRequest},null,8,[`body`])]),a(T,{closable:!1,class:`mt-2 success`},{default:p(()=>[u.modelValue?.request?.model?(h(),s(`p`,rn,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.model`))+`: `+i(u.shortModel(u.modelValue?.request?.model)),1)])):o(``,!0),u.modelValue?.request?.size?(h(),s(`p`,an,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.size`))+`: `+i(u.modelValue?.request?.size),1)])):o(``,!0),e(`p`,on,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.task`))+`: `+i(u.isEdit?u.$t(`seedream.name.edits`):u.$t(`seedream.name.generate`)),1)]),e(`p`,sn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.taskId`))+`: `+i(u.modelValue?.id)+` `,1),a(w,{content:u.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),u.modelValue?.elapsed?(h(),s(`p`,cn,[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.elapsed`))+`: `+i(u.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),u.modelValue?.response?.trace_id?(h(),s(`p`,ln,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.traceId`))+`: `+i(u.modelValue?.response?.trace_id)+` `,1),a(w,{content:u.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):u.modelValue?.response?.success===!1?(h(),s(`div`,{key:2,class:n({content:!0,"mt-[15px]":!u.modelValue?.request?.prompt})},[a(T,{closable:!1,class:`failure`},{template:p(()=>[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.failure`)),1)]),default:p(()=>[u.modelValue?.request?.model?(h(),s(`p`,un,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.model`))+`: `+i(u.shortModel(u.modelValue?.request?.model)),1)])):o(``,!0),u.modelValue?.request?.size?(h(),s(`p`,dn,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.size`))+`: `+i(u.modelValue?.request?.size),1)])):o(``,!0),e(`p`,fn,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.task`))+`: `+i(u.isEdit?u.$t(`seedream.name.edits`):u.$t(`seedream.name.generate`)),1)]),e(`p`,pn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.taskId`))+`: `+i(u.modelValue?.id)+` `,1),a(w,{content:u.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),u.modelValue?.response?.error?.message?(h(),s(`p`,mn,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.failureReason`))+`: `+i(u.modelValue?.response?.error?.message)+` `,1),a(w,{content:u.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])])):o(``,!0),u.modelValue?.elapsed?(h(),s(`p`,hn,[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.elapsed`))+`: `+i(u.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),u.modelValue?.response?.trace_id?(h(),s(`p`,gn,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.traceId`))+`: `+i(u.modelValue?.response?.trace_id)+` `,1),a(w,{content:u.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})],2)):(h(),s(`div`,_n,[a(T,{closable:!1,class:`info`},{template:p(()=>[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.status`)),1)]),default:p(()=>[e(`p`,vn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.taskId`))+`: `+i(u.modelValue?.id)+` `,1),a(w,{content:u.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),u.modelValue?.response?.trace_id?(h(),s(`p`,yn,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.traceId`))+`: `+i(u.modelValue?.response?.trace_id)+` `,1),a(w,{content:u.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(h(),s(`div`,Qt,[a(T,{closable:!1,class:`info`},{template:p(()=>[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.status.pending`)),1)]),default:p(()=>[e(`p`,$t,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.taskId`))+`: `+i(u.modelValue?.id)+` `,1),a(w,{content:u.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})]))])])}var xn=_({name:`SeedreamRecentPanel`,components:{TaskPreview:K(Ht,[[`render`,bn],[`__scopeId`,`data-v-9c8af4df`]]),BotPlaceholder:be,NoTasks:_e,ScrollList:ge},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.seedream?.tasks,items:this.$store.state.seedream?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Sn={key:0},Cn={key:2,class:`w-full h-full flex items-center justify-center`};function wn(e,t,n,r,i,u){let d=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return h(),s(c,null,[e.tasks?.items===void 0?(h(),s(`div`,Sn,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),f(_,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(h(!0),s(c,null,m(e.tasks?.items,e=>(h(),f(g,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(h(),s(`div`,Cn,[a(v)])):o(``,!0)],64)}var Tn=_({name:`SeedreamIndex`,components:{ConfigPanel:Vt,Layout:De,RecentPanel:K(xn,[[`render`,wn]])},mixins:[le],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.seedream?.status?.getApplications===q.Request},tasksLoading(){return this.$store.state.seedream?.status?.getTasks===q.Request},credential(){return this.$store.state.seedream?.credential},config(){return this.$store.state.seedream?.config},application(){return this.$store.state.seedream?.application},tasks(){return this.$store.state.seedream?.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ve({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loading,setLoading:e=>this.loading=e,isBlocked:()=>this.tasksLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`seedream/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`seedream/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.tasksLoading){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=20,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),await this.$store.dispatch(`seedream/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})},async onGenerate(){if(!me(this.uploadTracker,e=>this.$t(e),e=>J.warning(e)))return;if(Z(this.config?.model).imageRequired&&!this.config?.image?.length){J.warning(this.$t(`seedream.message.referenceImageRequired`));return}let e=$(this.config);if(!ae())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}J.info(this.$t(`seedream.message.startingTask`)),fe(`seedream`,se.generate(e,{token:t})).then(()=>{J.success(this.$t(`seedream.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?J.error(this.$t(`seedream.message.usedUp`)):J.error(this.$t(`seedream.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function En(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return h(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loading,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Dn=K(Tn,[[`render`,En]]);export{Dn as default};
1
+ import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{n as v,r as y,t as b}from"./select-DuspBjxM.js";import{t as x}from"./upload-BNaHShNL.js";import{t as S}from"./tooltip-O0jUmp8_.js";import{t as C}from"./alert-x8mYlhuj.js";import{t as w}from"./drawer-D6k00NQl.js";import{t as T}from"./input-number-CZgZJsF5.js";import{n as E}from"./taskDrawerMixin-D23gnPya.js";import{t as D}from"./box-BEZ5ejlY.js";import{t as O}from"./clock-C4q08wwy.js";import{t as k}from"./CopyToClipboard-rmORTzYc.js";import{r as A,t as j}from"./PromptTextarea-DbxCyFDP.js";import{t as M}from"./image-D9hVe2An.js";import{t as N}from"./info-7QlewFBX.js";import{t as P}from"./triangle-alert-BC93Xt4w.js";import{t as F}from"./upload-CP3jRoVn.js";import{t as I}from"./wand-sparkles-Cfgyd-ZM.js";import{t as ee}from"./zap-Cnylgx57.js";import{Cn as te,En as L,Sn as ne,Tn as re,_n as R,bn as z,gn as B,mn as V,pn as ie,vn as H,xn as U,yn as W}from"./constants-D-3QKDN1.js";import{$t as ae,Ai as G,Bt as oe,Cn as se,E as K,Ht as ce,Vt as le,Wt as ue,ei as q,gi as J,hi as de,mr as fe,ri as pe,zt as me}from"./index-h4BcqHjk.js";import{t as Y}from"./ImagePreview-C_BsIyhE.js";import{t as he}from"./Consumption-CqnV6zKQ.js";import{a as X,n as ge,r as _e,t as ve}from"./pagination-jAKTlMGg.js";import{t as ye}from"./ApiCodeButton-BQdstZ9o.js";import{t as be}from"./BotPlaceholder-Ck1mjnMM.js";import{t as xe}from"./ImageWrapper-DP_qfnZ_.js";var Se=_({name:`LayoutSeedream`,components:{MagicIcon:I,ElDrawer:w,ElButton:G},mixins:[E]}),Ce={class:`main flex flex-row flex-1`},we={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Te={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ee(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,Ce,[e(`div`,we,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Te,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[g,!t.tasksEmpty]]),a(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var De=K(Se,[[`render`,Ee],[`__scopeId`,`data-v-c10167d0`]]),Oe=_({name:`SeedreamPromptInput`,components:{PromptTextarea:j},computed:{prompt:{get(){return this.$store.state.seedream?.config?.prompt},set(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,prompt:e})}}},mounted(){this.prompt||=``}});function ke(e,t,n,r,i,a){let o=l(`prompt-textarea`);return h(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`seedream.name.prompt`),info:e.$t(`seedream.description.prompt`),placeholder:e.$t(`seedream.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ae=K(Oe,[[`render`,ke]]),je={image:!0,imageRequired:!1,sizeTiers:[`1K`,`2K`,`3K`,`4K`],sizeAdaptive:!0,sizePixel:!0,sizePixelDefault:void 0,groupGeneration:!1,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};function Z(e){switch(e){case z:return{image:!0,imageRequired:!1,sizeTiers:[`1K`,`2K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!1,seed:!1,guidanceScale:!1,outputFormat:!0,tools:!1};case W:return{image:!0,imageRequired:!1,sizeTiers:[`2K`,`3K`,`4K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!0,tools:!0};case H:return{image:!0,imageRequired:!1,sizeTiers:[`2K`,`4K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};case R:return{image:!0,imageRequired:!1,sizeTiers:[`1K`,`2K`,`4K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};case B:return{image:!1,imageRequired:!1,sizeTiers:[],sizeAdaptive:!1,sizePixel:!0,sizePixelDefault:`1024x1024`,groupGeneration:!1,seed:!0,guidanceScale:!0,guidanceScaleDefault:V[B],outputFormat:!1,tools:!1};case U:return{image:!0,imageRequired:!0,sizeTiers:[],sizeAdaptive:!1,sizePixel:!0,sizePixelDefault:`1024x1024`,groupGeneration:!1,seed:!1,guidanceScale:!0,guidanceScaleDefault:V[U],outputFormat:!1,tools:!1};default:return je}}function Q(e,t){let n=Z(e);return n.imageRequired||n.image&&t?.length?`edit`:`generate`}var Me=[`1K`,`2K`,`3K`,`4K`];function Ne(e,t){if(!e)return[];let n=t.model??e.model;if(!n)return[];let r=Z(n),i=[];Array.isArray(e.image)&&e.image.length>0&&!r.image&&i.push({field:`image`,i18nLabel:`seedream.name.imageUrls`});let a=typeof e.size==`string`?e.size:void 0;if(a){let e=a.toUpperCase();(Me.includes(e)&&!r.sizeTiers.includes(e)||a===`adaptive`&&!r.sizeAdaptive)&&i.push({field:`size`,i18nLabel:`seedream.name.size`})}return e.sequential_image_generation===`auto`&&!r.groupGeneration&&i.push({field:`sequential_image_generation`,i18nLabel:`seedream.name.maxImages`}),e.seed!==void 0&&e.seed!==null&&!r.seed&&i.push({field:`seed`,i18nLabel:`seedream.name.seed`}),e.guidance_scale!==void 0&&e.guidance_scale!==null&&!r.guidanceScale&&i.push({field:`guidance_scale`,i18nLabel:`seedream.name.guidanceScale`}),e.output_format&&!r.outputFormat&&i.push({field:`output_format`,i18nLabel:`seedream.name.outputFormat`}),Array.isArray(e.tools)&&e.tools.length>0&&!r.tools&&i.push({field:`tools`,i18nLabel:`seedream.name.tools`}),i}function Pe(e,t,n){let r={...e},i=Z(n.model??e.model);for(let e of t)switch(e.field){case`image`:delete r.image;break;case`size`:i.sizePixelDefault?r.size=i.sizePixelDefault:delete r.size;break;case`sequential_image_generation`:r.sequential_image_generation=`disabled`,delete r.sequential_image_generation_options;break;case`seed`:delete r.seed;break;case`guidance_scale`:delete r.guidance_scale;break;case`output_format`:delete r.output_format;break;case`tools`:delete r.tools;break}return r}var Fe=_({name:`SeedreamImageInput`,components:{UploadIcon:F,ElUpload:x,ElButton:G,InfoIcon:X,ImagePreview:Y},mixins:[ce,oe],data(){return{fileList:[],uploadUrl:pe()+`/api/v1/files/`,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.seedream?.config?.image},model(){return this.$store.state.seedream?.config?.model},supported(){return Z(this.model).image}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){let e=(this.fileList||[]).filter(e=>!e?.response?.file_url);this.fileList=e.length?e:[];return}let t=[];e.forEach(e=>{let n=this.fileList.find(t=>t?.response?.file_url===e||t?.url===e);n?t.push(n):t.push({name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}})}),(this.fileList||[]).filter(e=>!e?.response?.file_url).forEach(e=>{t.some(t=>t===e||t?.url===e?.url||t?.response?.file_url===e?.response?.file_url)||t.push(e)}),this.fileList=t}}},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url==`string`&&e.url.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImages()},onExceed(){J.warning(this.$t(`seedream.message.uploadImageExceed`))},onError(){J.error(this.$t(`seedream.message.uploadImageError`))},onSetImages(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,image:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImages()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImages()}}}),Ie={key:0},Le={class:`field`},Re={class:`label`},ze={class:`box`},Be={class:`title font-bold`},Ve={class:`value`},He={class:`file-list mt-2 flex flex-wrap gap-[10px]`};function Ue(t,n,u,d,g,_){let v=l(`info-icon`),y=l(`upload-icon`),b=l(`el-button`),x=l(`el-upload`),S=l(`image-preview`);return t.supported?(h(),s(`div`,Ie,[e(`div`,Le,[e(`div`,Re,[e(`div`,ze,[e(`h2`,Be,i(t.$t(`seedream.name.imageUrls`)),1),a(v,{content:t.$t(`seedream.description.imageUrls`),class:`info`},null,8,[`content`])])]),e(`div`,Ve,[a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,limit:14,multiple:!0,"show-file-list":!1,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-change":t.onChange,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(b,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedream.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])])]),e(`div`,He,[(h(!0),s(c,null,m(t.fileList,(e,n)=>(h(),f(S,{key:e.uid||e?.response?.file_url||e.url||n,url:e.url||e?.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemovePreview(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])])):o(``,!0)}var We=K(Fe,[[`render`,Ue],[`__scopeId`,`data-v-ac071e59`]]),Ge=_({name:`SeedreamModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:X},data(){return{revertKey:0,options:[{value:z,label:this.$t(`seedream.model.seedream50pro`)},{value:W,label:this.$t(`seedream.model.seedream50`)},{value:H,label:this.$t(`seedream.model.seedream45`)},{value:R,label:this.$t(`seedream.model.seedream40`)},{value:B,label:this.$t(`seedream.model.seedream30t2i`)},{value:U,label:this.$t(`seedream.model.seededit30i2i`)}]}},computed:{value(){return this.$store.state.seedream?.config?.model}},mounted(){this.value||this.applyModel(ie)},methods:{async onChange(e){let t=this.$store.state.seedream?.config||{},n=Ne(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await de.confirm(this.$t(`seedream.message.featureNotSupportedBody`,{fields:r}),this.$t(`seedream.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`seedream.button.confirmContinue`),cancelButtonText:this.$t(`seedream.button.cancelSwitch`),type:`warning`});let i=Pe({...t,model:e},n,{model:e});this.$store.commit(`seedream/setConfig`,i),J.success(this.$t(`seedream.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,model:e})}}}),Ke={class:`field`},qe={class:`label`},Je={class:`box`},Ye={class:`title font-bold`};function Xe(t,n,r,o,u,d){let g=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return h(),s(`div`,Ke,[e(`div`,qe,[e(`div`,Je,[e(`h2`,Ye,i(t.$t(`seedream.name.model`)),1),a(g,{content:t.$t(`seedream.description.model`),class:`info`},null,8,[`content`])])]),(h(),f(v,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`seedream.placeholder.select`),onChange:t.onChange},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var Ze=K(Ge,[[`render`,Xe],[`__scopeId`,`data-v-6413c179`]]),Qe=_({name:`SeedreamSizeSelector`,components:{ElSelect:y,ElOption:b,ElOptionGroup:v,InfoIcon:X},data(){return{SEEDREAM_SIZE_ADAPTIVE:re,pixelOptions:te}},computed:{model(){return this.$store.state.seedream?.config?.model},capabilities(){return Z(this.model)},value:{get(){return this.$store.state.seedream?.config?.size},set(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,size:e})}}},watch:{model:{immediate:!0,handler(){if(this.value)return;let e=this.capabilities;e.sizeTiers.length?this.value=e.sizeTiers.includes(`2K`)?`2K`:e.sizeTiers[0]:e.sizePixelDefault&&(this.value=e.sizePixelDefault)}}}}),$e={class:`field`},et={class:`label`},tt={class:`box`},nt={class:`title font-bold`};function rt(t,n,r,u,d,g){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-option-group`),b=l(`el-select`);return h(),s(`div`,$e,[e(`div`,et,[e(`div`,tt,[e(`h2`,nt,i(t.$t(`seedream.name.size`)),1),a(_,{content:t.$t(`seedream.description.size`),class:`info`},null,8,[`content`])])]),a(b,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedream.placeholder.size`),filterable:``,"allow-create":``,"default-first-option":``},{default:p(()=>[t.capabilities.sizeTiers.length?(h(),f(y,{key:0,label:t.$t(`seedream.size.group.tier`)},{default:p(()=>[(h(!0),s(c,null,m(t.capabilities.sizeTiers,e=>(h(),f(v,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`label`])):o(``,!0),t.capabilities.sizeAdaptive?(h(),f(y,{key:1,label:t.$t(`seedream.size.group.adaptive`)},{default:p(()=>[(h(),f(v,{key:t.SEEDREAM_SIZE_ADAPTIVE,label:t.$t(`seedream.size.adaptive`),value:t.SEEDREAM_SIZE_ADAPTIVE},null,8,[`label`,`value`]))]),_:1},8,[`label`])):o(``,!0),a(y,{label:t.$t(`seedream.size.group.pixel`)},{default:p(()=>[(h(!0),s(c,null,m(t.pixelOptions,e=>(h(),f(v,{key:e.value,label:`${e.value} (${e.ratio})`,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`label`])]),_:1},8,[`modelValue`,`placeholder`])])}var it=K(Qe,[[`render`,rt],[`__scopeId`,`data-v-dd7bd021`]]),at=_({name:`SeedreamMaxImagesSelector`,components:{ElInputNumber:T,InfoIcon:X},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Z(this.config?.model).groupGeneration},referenceImageCount(){let e=this.config?.image;return Array.isArray(e)?e.length:0},effectiveMax(){let e=15-this.referenceImageCount;return Math.max(1,Math.min(15,e))},value:{get(){let e=this.config?.sequential_image_generation_options?.max_images;return typeof e==`number`&&e>=1?e:1},set(e){let t={...this.config||{}},n=Math.max(1,Math.min(this.effectiveMax,Math.floor(e||1)));n>1?(t.sequential_image_generation=`auto`,t.sequential_image_generation_options={...t.sequential_image_generation_options||{},max_images:n}):(t.sequential_image_generation=`disabled`,t.sequential_image_generation_options&&delete t.sequential_image_generation_options),this.$store.commit(`seedream/setConfig`,t)}}},watch:{effectiveMax(e){this.value>e&&(this.value=e)}}}),ot={key:0,class:`field`},st={class:`label`},ct={class:`box`},lt={class:`title font-bold`},ut={class:`value`};function dt(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-input-number`);return t.supported?(h(),s(`div`,ot,[e(`div`,st,[e(`div`,ct,[e(`h2`,lt,i(t.$t(`seedream.name.maxImages`)),1),a(f,{content:t.$t(`seedream.description.maxImages`),class:`info`},null,8,[`content`])])]),e(`div`,ut,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:1,max:t.effectiveMax,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`,`max`])])])):o(``,!0)}var ft=K(at,[[`render`,dt],[`__scopeId`,`data-v-f079fd20`]]),pt=_({name:`SeedreamOutputFormatSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:X},data(){return{options:[...ne]}},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Z(this.config?.model).outputFormat},value:{get(){return this.config?.output_format},set(e){let t={...this.config||{}};t.output_format=e,this.$store.commit(`seedream/setConfig`,t)}}}}),mt={key:0,class:`field`},ht={class:`label`},gt={class:`box`},_t={class:`title font-bold`};function vt(t,n,r,u,d,g){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-select`);return t.supported?(h(),s(`div`,mt,[e(`div`,ht,[e(`div`,gt,[e(`h2`,_t,i(t.$t(`seedream.name.outputFormat`)),1),a(_,{content:t.$t(`seedream.description.outputFormat`),class:`info`},null,8,[`content`])])]),a(y,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedream.placeholder.select`)},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(v,{key:e,label:e.toUpperCase(),value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])):o(``,!0)}var yt=K(pt,[[`render`,vt],[`__scopeId`,`data-v-69ea4c07`]]),bt=_({name:`SeedreamSeedInput`,components:{ElInputNumber:T,InfoIcon:X},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Z(this.config?.model).seed},value:{get(){let e=this.config?.seed;return typeof e==`number`?e:-1},set(e){let t={...this.config||{}};t.seed=typeof e==`number`&&Number.isInteger(e)?e:-1,this.$store.commit(`seedream/setConfig`,t)}}}}),xt={key:0,class:`field`},St={class:`label`},Ct={class:`box`},wt={class:`title font-bold`},Tt={class:`value`};function Et(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-input-number`);return t.supported?(h(),s(`div`,xt,[e(`div`,St,[e(`div`,Ct,[e(`h2`,wt,i(t.$t(`seedream.name.seed`)),1),a(f,{content:t.$t(`seedream.description.seed`),class:`info`},null,8,[`content`])])]),e(`div`,Tt,[a(p,{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`])])])):o(``,!0)}var Dt=K(bt,[[`render`,Et],[`__scopeId`,`data-v-10cdc1e0`]]),Ot=_({name:`SeedreamGuidanceScaleInput`,components:{ElInputNumber:T,InfoIcon:X},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Z(this.config?.model).guidanceScale},defaultValue(){return Z(this.config?.model).guidanceScaleDefault??2.5},value:{get(){let e=this.config?.guidance_scale;return typeof e==`number`?e:this.defaultValue},set(e){let t={...this.config||{}};t.guidance_scale=typeof e==`number`&&e>=1&&e<=10?e:this.defaultValue,this.$store.commit(`seedream/setConfig`,t)}}}}),kt={key:0,class:`field`},At={class:`label`},jt={class:`box`},Mt={class:`title font-bold`},Nt={class:`value`};function Pt(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-input-number`);return t.supported?(h(),s(`div`,kt,[e(`div`,At,[e(`div`,jt,[e(`h2`,Mt,i(t.$t(`seedream.name.guidanceScale`)),1),a(f,{content:t.$t(`seedream.description.guidanceScale`),class:`info`},null,8,[`content`])])]),e(`div`,Nt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:1,max:10,step:.1,precision:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])):o(``,!0)}var Ft=K(Ot,[[`render`,Pt],[`__scopeId`,`data-v-7386f064`]]),$=e=>{let t={...e||{}},n=Q(t.model,t.image);return delete t.action,t.watermark=!1,(n!==`edit`||!t.image?.length)&&delete t.image,t.size||delete t.size,t.sequential_image_generation!==`auto`&&delete t.sequential_image_generation_options,{...t,async:!0}},It=_({name:`SeedreamConfigPanel`,components:{MagicIcon:I,ElButton:G,PromptInput:Ae,Consumption:he,ImageInput:We,ModelSelector:Ze,SizeSelector:it,MaxImagesSelector:ft,OutputFormatSelector:yt,SeedInput:Dt,GuidanceScaleInput:Ft},emits:[`generate`],computed:{action(){return Q(this.config?.model,this.config?.image)},capabilities(){return Z(this.config?.model)},config(){return this.$store.state.seedream?.config},consumption(){let e=$(this.config),t=e.sequential_image_generation===`auto`?Math.max(1,Math.floor(e.sequential_image_generation_options?.max_images||1)):1;return ue({...e,action:this.action,model:L(e.model),input_image_count:e.image?.length||0,count:t},this.service?.cost)},service(){return this.$store.state.seedream?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),Lt={class:`flex flex-col h-full`},Rt={class:`flex-1 overflow-y-auto p-5`},zt={class:`flex flex-col items-center justify-center px-5 pb-5`};function Bt(t,n,c,u,d,m){let g=l(`model-selector`),_=l(`size-selector`),v=l(`max-images-selector`),y=l(`output-format-selector`),b=l(`seed-input`),x=l(`guidance-scale-input`),S=l(`prompt-input`),C=l(`image-input`),w=l(`consumption`),T=l(`magic-icon`),E=l(`el-button`);return h(),s(`div`,Lt,[e(`div`,Rt,[a(g,{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`}),t.capabilities.image?(h(),f(C,{key:0,class:`mb-4`})):o(``,!0)]),e(`div`,zt,[a(w,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(E,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(T,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedream.button.generate`)),1)]),_:1},8,[`onClick`])])])}var Vt=K(It,[[`render`,Bt]]),Ht=_({name:`SeedreamTaskPreview`,components:{ApplicationIcon:D,ChannelIcon:A,ImageIcon:M,InfoIcon:N,LightningIcon:ee,MagicIcon:I,TimeIcon:O,WarningIcon:P,CopyToClipboard:k,ElAlert:C,ImageWrapper:xe,ElButton:G,ElTooltip:S,ImagePreview:Y,ApiCodeButton:ye},props:{modelValue:{type:Object,required:!0}},computed:{apiRequest(){return $(this.modelValue?.request)},isEdit(){return Array.isArray(this.modelValue?.request?.image)&&(this.modelValue?.request?.image?.length||0)>0},images(){let e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{e.push(t)}),e}},methods:{shortModel(e){return L(e)||e},onEdit(e){if(!e)return;console.debug(`Edit image:`,e);let t={...this.$store.state.seedream?.config||{}};t.image=[e],this.$store.commit(`seedream/setConfig`,t)}}}),Ut={class:`preview`},Wt={class:`left`},Gt={class:`main`},Kt={class:`bot`},qt={class:`datetime`},Jt={class:`info`},Yt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Xt={key:1,class:`prompt mt-2`},Zt={key:0},Qt={key:0,class:n({content:!0})},$t={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},en={key:1,class:n({content:!0,failed:!0})},tn={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},nn={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},rn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},an={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},on={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},sn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},cn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ln={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},un={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},dn={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},fn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},pn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},mn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},hn={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},gn={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},_n={key:3,class:n({content:!0})},vn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},yn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function bn(u,d,g,_,v,y){let b=l(`capability-presentation`),x=l(`image-preview`),S=l(`time-icon`),C=l(`magic-icon`),w=l(`copy-to-clipboard`),T=l(`el-alert`),E=l(`image-wrapper`),D=l(`el-button`),O=l(`el-tooltip`),k=l(`api-code-button`),A=l(`application-icon`),j=l(`image-icon`),M=l(`lightning-icon`),N=l(`channel-icon`),P=l(`warning-icon`),F=l(`info-icon`);return h(),s(`div`,Ut,[e(`div`,Wt,[a(b,{capability:`seedream`,part:`avatar`,class:`avatar`})]),e(`div`,Gt,[e(`div`,Kt,[a(b,{capability:`seedream`,part:`name`}),e(`span`,qt,i(u.$dayjs.format(``+new Date(parseFloat((u.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,Jt,[Array.isArray(u.modelValue?.request?.image)&&u.modelValue?.request?.image.length>0?(h(),s(`div`,Yt,[(h(!0),s(c,null,m(u.modelValue?.request?.image,(e,t)=>(h(),f(x,{key:t,url:e,name:`image-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),u.modelValue?.request?.prompt?(h(),s(`p`,Xt,[r(i(u.modelValue?.request?.prompt)+` `,1),u.modelValue?.response?o(``,!0):(h(),s(`span`,Zt,` - (`+i(u.$t(`seedream.status.pending`))+`) `,1))])):o(``,!0)]),u.modelValue?.response?u.modelValue?.response?.success===!0?(h(),s(`div`,en,[e(`div`,tn,[(h(!0),s(c,null,m(u.images,(e,t)=>(h(),f(E,{key:t,src:e?.image_url,"raw-src":e?.image_url},null,8,[`src`,`raw-src`]))),128))]),e(`div`,nn,[a(O,{class:`box-item`,effect:`dark`,content:u.$t(`common.button.edit`),placement:`top-start`},{default:p(()=>[a(D,{type:`info`,size:`small`,class:`btn-action`,onClick:d[0]||=t(e=>u.onEdit(u.images?.[0]?.image_url),[`stop`])},{default:p(()=>[r(i(u.$t(`common.button.edit`)),1)]),_:1})]),_:1},8,[`content`]),a(k,{path:`/seedream/images`,body:u.apiRequest},null,8,[`body`])]),a(T,{closable:!1,class:`mt-2 success`},{default:p(()=>[u.modelValue?.request?.model?(h(),s(`p`,rn,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.model`))+`: `+i(u.shortModel(u.modelValue?.request?.model)),1)])):o(``,!0),u.modelValue?.request?.size?(h(),s(`p`,an,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.size`))+`: `+i(u.modelValue?.request?.size),1)])):o(``,!0),e(`p`,on,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.task`))+`: `+i(u.isEdit?u.$t(`seedream.name.edits`):u.$t(`seedream.name.generate`)),1)]),e(`p`,sn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.taskId`))+`: `+i(u.modelValue?.id)+` `,1),a(w,{content:u.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),u.modelValue?.elapsed?(h(),s(`p`,cn,[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.elapsed`))+`: `+i(u.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),u.modelValue?.response?.trace_id?(h(),s(`p`,ln,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.traceId`))+`: `+i(u.modelValue?.response?.trace_id)+` `,1),a(w,{content:u.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):u.modelValue?.response?.success===!1?(h(),s(`div`,{key:2,class:n({content:!0,"mt-[15px]":!u.modelValue?.request?.prompt})},[a(T,{closable:!1,class:`failure`},{template:p(()=>[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.failure`)),1)]),default:p(()=>[u.modelValue?.request?.model?(h(),s(`p`,un,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.model`))+`: `+i(u.shortModel(u.modelValue?.request?.model)),1)])):o(``,!0),u.modelValue?.request?.size?(h(),s(`p`,dn,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.size`))+`: `+i(u.modelValue?.request?.size),1)])):o(``,!0),e(`p`,fn,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.task`))+`: `+i(u.isEdit?u.$t(`seedream.name.edits`):u.$t(`seedream.name.generate`)),1)]),e(`p`,pn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.taskId`))+`: `+i(u.modelValue?.id)+` `,1),a(w,{content:u.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),u.modelValue?.response?.error?.message?(h(),s(`p`,mn,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.failureReason`))+`: `+i(u.modelValue?.response?.error?.message)+` `,1),a(w,{content:u.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])])):o(``,!0),u.modelValue?.elapsed?(h(),s(`p`,hn,[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.elapsed`))+`: `+i(u.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),u.modelValue?.response?.trace_id?(h(),s(`p`,gn,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.traceId`))+`: `+i(u.modelValue?.response?.trace_id)+` `,1),a(w,{content:u.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})],2)):(h(),s(`div`,_n,[a(T,{closable:!1,class:`info`},{template:p(()=>[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.status`)),1)]),default:p(()=>[e(`p`,vn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.taskId`))+`: `+i(u.modelValue?.id)+` `,1),a(w,{content:u.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),u.modelValue?.response?.trace_id?(h(),s(`p`,yn,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.traceId`))+`: `+i(u.modelValue?.response?.trace_id)+` `,1),a(w,{content:u.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(h(),s(`div`,Qt,[a(T,{closable:!1,class:`info`},{template:p(()=>[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.status.pending`)),1)]),default:p(()=>[e(`p`,$t,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.taskId`))+`: `+i(u.modelValue?.id)+` `,1),a(w,{content:u.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})]))])])}var xn=_({name:`SeedreamRecentPanel`,components:{TaskPreview:K(Ht,[[`render`,bn],[`__scopeId`,`data-v-9c8af4df`]]),BotPlaceholder:be,NoTasks:_e,ScrollList:ge},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.seedream?.tasks,items:this.$store.state.seedream?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Sn={key:0},Cn={key:2,class:`w-full h-full flex items-center justify-center`};function wn(e,t,n,r,i,u){let d=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return h(),s(c,null,[e.tasks?.items===void 0?(h(),s(`div`,Sn,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),f(_,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(h(!0),s(c,null,m(e.tasks?.items,e=>(h(),f(g,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(h(),s(`div`,Cn,[a(v)])):o(``,!0)],64)}var Tn=_({name:`SeedreamIndex`,components:{ConfigPanel:Vt,Layout:De,RecentPanel:K(xn,[[`render`,wn]])},mixins:[le],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.seedream?.status?.getApplications===q.Request},tasksLoading(){return this.$store.state.seedream?.status?.getTasks===q.Request},credential(){return this.$store.state.seedream?.credential},config(){return this.$store.state.seedream?.config},application(){return this.$store.state.seedream?.application},tasks(){return this.$store.state.seedream?.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ve({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loading,setLoading:e=>this.loading=e,isBlocked:()=>this.tasksLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`seedream/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`seedream/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.tasksLoading){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=20,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),await this.$store.dispatch(`seedream/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})},async onGenerate(){if(!me(this.uploadTracker,e=>this.$t(e),e=>J.warning(e)))return;if(Z(this.config?.model).imageRequired&&!this.config?.image?.length){J.warning(this.$t(`seedream.message.referenceImageRequired`));return}let e=$(this.config);if(!ae())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}J.info(this.$t(`seedream.message.startingTask`)),fe(`seedream`,se.generate(e,{token:t})).then(()=>{J.success(this.$t(`seedream.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?J.error(this.$t(`seedream.message.usedUp`)):J.error(this.$t(`seedream.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function En(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return h(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loading,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Dn=K(Tn,[[`render`,En]]);export{Dn as default};