@acedatacloud/nexior 3.371.6 → 3.371.7

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 (281) hide show
  1. package/dist/assets/{ApiCodeButton-C6FWrCva.js → ApiCodeButton-CueSlSNp.js} +1 -1
  2. package/dist/assets/{ApiCodeDialog-BSOAGpIl.js → ApiCodeDialog-CIuQSQFA.js} +1 -1
  3. package/dist/assets/{Artifacts-v6aQr948.js → Artifacts-B2jtY5CM.js} +1 -1
  4. package/dist/assets/{AskUserQuestionCard-B9r5PAWt.js → AskUserQuestionCard-Dp9aZs5C.js} +1 -1
  5. package/dist/assets/{AudioPreview-B8qr2QlT.js → AudioPreview-BJhkF5pn.js} +1 -1
  6. package/dist/assets/{Auth-Qz3S7RBz.js → Auth-DW8CbKQc.js} +1 -1
  7. package/dist/assets/{Bare-CyyL0_4R.js → Bare-DAeUdpi8.js} +1 -1
  8. package/dist/assets/{BotPlaceholder-CG-3N26i.js → BotPlaceholder-BNNaxOmO.js} +1 -1
  9. package/dist/assets/{BottomFooter-pZhbWjGC.js → BottomFooter-ruRybBld.js} +1 -1
  10. package/dist/assets/{BrowseConnectors-B6itmWFg.js → BrowseConnectors-Dn78fL20.js} +1 -1
  11. package/dist/assets/{BrowserPairingDialog-DSRNWzJg.js → BrowserPairingDialog-0rK7wu50.js} +1 -1
  12. package/dist/assets/{Callback-CZTWooWq.js → Callback--Zoz-4y_.js} +1 -1
  13. package/dist/assets/{CodeSnippet-DgcSbbsU.js → CodeSnippet-C-hn8yWQ.js} +1 -1
  14. package/dist/assets/{Console-BBxTJLSJ.js → Console-7eeB3W96.js} +1 -1
  15. package/dist/assets/{Conversation-Djf4TKT3.js → Conversation-CmKdAlGh.js} +1 -1
  16. package/dist/assets/{Conversation-CHN3U1zy.js → Conversation-Dwpsn-zz.js} +1 -1
  17. package/dist/assets/{CopyToClipboard-CnfP3j6K.js → CopyToClipboard-0lUT8Wjm.js} +1 -1
  18. package/dist/assets/{Detail-H6T_ACAo.js → Detail-2dCReTqu.js} +1 -1
  19. package/dist/assets/{Extra-N4bz_ynA.js → Extra-BS7Cvma7.js} +1 -1
  20. package/dist/assets/{FilePreview-3oibArLi.js → FilePreview-CcYI_Ioz.js} +1 -1
  21. package/dist/assets/{Hailuo-CzSCljMp.js → Hailuo-qs8VTD_5.js} +1 -1
  22. package/dist/assets/{History-DFUC7MI1.js → History-D-Kd5c4j.js} +1 -1
  23. package/dist/assets/{ImagePreview-CZs9JDgj.js → ImagePreview-Ct3FnzAf.js} +1 -1
  24. package/dist/assets/{ImageWrapper-BUBjCc4Y.js → ImageWrapper-DamzAUyR.js} +1 -1
  25. package/dist/assets/{Index-Dzw9vy2Q.js → Index--uj56PkD.js} +1 -1
  26. package/dist/assets/{Index-kV9B534Y.js → Index-B0mBw6rF.js} +1 -1
  27. package/dist/assets/{Index-D_72nyK6.js → Index-BBPA31r4.js} +1 -1
  28. package/dist/assets/{Index-QVhHmPeT.js → Index-BIUW6dWn.js} +1 -1
  29. package/dist/assets/{Index-yD08zqTo.js → Index-BIauBF1F.js} +1 -1
  30. package/dist/assets/{Index-DKLECQzD.js → Index-BchjkpL5.js} +1 -1
  31. package/dist/assets/{Index-BGgODwvs.js → Index-BlMj89oi.js} +1 -1
  32. package/dist/assets/{Index-DjOhuydQ.js → Index-BnCZy0Hc.js} +1 -1
  33. package/dist/assets/{Index-CLzix8gw.js → Index-BwSdRWZw.js} +1 -1
  34. package/dist/assets/{Index-Bl8zKfvm.js → Index-C55qgBGc.js} +1 -1
  35. package/dist/assets/{Index-DzuFr4ZN.js → Index-C5YnCOO7.js} +1 -1
  36. package/dist/assets/{Index-DcSYotGI.js → Index-CGkaYAlC.js} +1 -1
  37. package/dist/assets/{Index-DBJQPnv-.js → Index-COyOGGKu.js} +1 -1
  38. package/dist/assets/{Index-C8dz08xT.js → Index-CSP7AuHj.js} +1 -1
  39. package/dist/assets/{Index-7yAAcCnc.js → Index-CXQDIDVW.js} +1 -1
  40. package/dist/assets/{Index-D-9JExIN.js → Index-CaZR5s_m.js} +1 -1
  41. package/dist/assets/{Index-cA9Q2kHT.js → Index-Cd1mSTds.js} +1 -1
  42. package/dist/assets/{Index-CYb1uz3n.js → Index-CmKlVGZ_.js} +1 -1
  43. package/dist/assets/{Index-Ch0Xco0B2.js → Index-CzTNA3Ti2.js} +1 -1
  44. package/dist/assets/{Index-EbrrxMJp.js → Index-CzzIxAP6.js} +1 -1
  45. package/dist/assets/{Index-Ds72pk48.js → Index-D-_BQv6_.js} +1 -1
  46. package/dist/assets/{Index-pSZ8x4oA.js → Index-D0DXH1uQ.js} +1 -1
  47. package/dist/assets/{Index-CuX8wB-J.js → Index-D4L39IC7.js} +1 -1
  48. package/dist/assets/{Index-B83nU58S.js → Index-D53gi4SK.js} +1 -1
  49. package/dist/assets/Index-D5pPqmYY.css +1 -0
  50. package/dist/assets/{Index-BwOPPFrx.js → Index-DCS_LWoi.js} +1 -1
  51. package/dist/assets/{Index-nreUcrR7.js → Index-DF0Crxh-.js} +1 -1
  52. package/dist/assets/{Index-RLfIr6Wd.js → Index-DGtVLwA4.js} +1 -1
  53. package/dist/assets/{Index-BI7IvD_5.js → Index-DJ-vZYF4.js} +1 -1
  54. package/dist/assets/Index-DU_i6jEV.js +1 -0
  55. package/dist/assets/Index-DVMyYynd.js +1 -0
  56. package/dist/assets/{Index-C8ztBhDJ.js → Index-Dl05AkbT.js} +1 -1
  57. package/dist/assets/{Index-i4QVlQSj.js → Index-Dq4T8dJs.js} +1 -1
  58. package/dist/assets/{Index-Chf5wpzE.js → Index-DzJhrINP.js} +1 -1
  59. package/dist/assets/{Index-CedzRUkc.js → Index-DzjEQLxi.js} +1 -1
  60. package/dist/assets/{Index-CvbQ8pbZ.js → Index-Fp-dOpZU.js} +1 -1
  61. package/dist/assets/{Index-ChnzAzDM.js → Index-rjaCQ7xg.js} +1 -1
  62. package/dist/assets/{Invitees-tJhxy9gP.js → Invitees-8PScxBfb.js} +1 -1
  63. package/dist/assets/{List-k6GfD4W_.js → List-BsjwDtCw.js} +1 -1
  64. package/dist/assets/{List-JRCW-2v3.js → List-C3JoVowC.js} +1 -1
  65. package/dist/assets/{List-QYECvNlK.js → List-DkO6L8Jk.js} +1 -1
  66. package/dist/assets/{LocalTools-7PXxcEkm.js → LocalTools-CCl_1S0N.js} +1 -1
  67. package/dist/assets/{LocalTools-DdGKYdbA.js → LocalTools-CWcyfYGS.js} +1 -1
  68. package/dist/assets/{Logo-BenBX9Da.js → Logo-nudPgDJ9.js} +1 -1
  69. package/dist/assets/{Main-p2YgZplk.js → Main-BQ9bLyPE.js} +1 -1
  70. package/dist/assets/{Message-DqA6hbOr.js → Message-687CsSGv.js} +2 -2
  71. package/dist/assets/{Model-BSBuC_kq.js → Model-DRS01igX.js} +1 -1
  72. package/dist/assets/{Navigator-BOH7oW8Y.js → Navigator-BNKDhdrb.js} +3 -3
  73. package/dist/assets/{NotFound-RbxyL3Bn.js → NotFound-D5TjJxcM.js} +1 -1
  74. package/dist/assets/{PageHeader-BGawVup6.js → PageHeader-B4_DE0EK.js} +1 -1
  75. package/dist/assets/{Pay-HLlmauma.js → Pay-CBiow4Xf.js} +1 -1
  76. package/dist/assets/{Player-zfV2wET8.js → Player-CUoyYN8I.js} +1 -1
  77. package/dist/assets/{Poivelle-BQSiSpTp.js → Poivelle-jf4zh-nr.js} +1 -1
  78. package/dist/assets/{RealtimeCall-9erGXsm6.js → RealtimeCall-DJVXtgLP.js} +1 -1
  79. package/dist/assets/{ReportButton-B0ZDQxLy.js → ReportButton-Buh2UYVP.js} +1 -1
  80. package/dist/assets/{ReportDialog-C9Ed7KVo.js → ReportDialog-THoo9aeQ.js} +1 -1
  81. package/dist/assets/{ScenarioPaymentMode-BMC9eBkY.js → ScenarioPaymentMode-6HeW391z.js} +1 -1
  82. package/dist/assets/{ScheduledTasks-BGSPlhqV.js → ScheduledTasks-C-OCp5m-.js} +1 -1
  83. package/dist/assets/{ServicePricingSummary-CMOjp4_z.js → ServicePricingSummary-CnbM4r4S.js} +1 -1
  84. package/dist/assets/{ShowcaseGrid-Bi3bNMFN.js → ShowcaseGrid-9ZP473yD.js} +1 -1
  85. package/dist/assets/{ShowcaseResultTabs-Be1u7B7Y.js → ShowcaseResultTabs-BfyGy_mN.js} +1 -1
  86. package/dist/assets/{SolanaWalletPickerDialog-ZfFE4moG.js → SolanaWalletPickerDialog-DVkm-Ap5.js} +1 -1
  87. package/dist/assets/{Status-CjqISdkv.js → Status-VwSQVu1u.js} +1 -1
  88. package/dist/assets/{Subscribe-BNKvzM85.js → Subscribe-C7fZQ91A.js} +1 -1
  89. package/dist/assets/{TabSwitcher-C378mpaQ.js → TabSwitcher-BOUhJoNs.js} +1 -1
  90. package/dist/assets/{Tts-tiYmIS9F.js → Tts-DW49DrQE.js} +1 -1
  91. package/dist/assets/{VideoPlayer-DaI2iEuf.js → VideoPlayer-BacT8jS7.js} +1 -1
  92. package/dist/assets/{VideoPreview-iLfPvLl6.js → VideoPreview-CdskjP0J.js} +1 -1
  93. package/dist/assets/{airwallexCheckout-CX2POYmT.js → airwallexCheckout-BR1vNdKB.js} +1 -1
  94. package/dist/assets/arrow-down-D4c0wlZP.js +1 -0
  95. package/dist/assets/{arrow-down-wide-narrow-CONJ6MMS.js → arrow-down-wide-narrow-CeXKaQn9.js} +1 -1
  96. package/dist/assets/arrow-left-QPp_E3rj.js +1 -0
  97. package/dist/assets/arrow-right-mQ8OJtyU.js +1 -0
  98. package/dist/assets/arrow-up-DT1_F9aQ.js +1 -0
  99. package/dist/assets/{authorizeFlow-DA7_paQn.js → authorizeFlow-RdAw8wo1.js} +1 -1
  100. package/dist/assets/{avatar-B4_zPbI4.js → avatar-BGC08pHM.js} +1 -1
  101. package/dist/assets/{basic-DD2NrEBB.js → basic-DAGPh1_s.js} +1 -1
  102. package/dist/assets/{book-open-Cofs7E9U.js → book-open-B0Q_AYGA.js} +1 -1
  103. package/dist/assets/{box-B17UUMMH.js → box-w1oVo698.js} +1 -1
  104. package/dist/assets/{boxes-ZhcRrPKY.js → boxes-CKPG-5p8.js} +1 -1
  105. package/dist/assets/{brain-hlKyCeK7.js → brain-CkNC1r0a.js} +1 -1
  106. package/dist/assets/{chart-no-axes-combined-CIn_DbGn.js → chart-no-axes-combined-Bzp0_DV9.js} +1 -1
  107. package/dist/assets/{chat-D-bnMuYT.js → chat-BsDgMU6t.js} +1 -1
  108. package/dist/assets/check-B3fRI0SC.js +1 -0
  109. package/dist/assets/chevron-down-Pfd6qs5f.js +1 -0
  110. package/dist/assets/chevron-right-jD6ZxXC-.js +1 -0
  111. package/dist/assets/{circle-alert-DMhbkY9i.js → circle-alert-BS8R7zcL.js} +1 -1
  112. package/dist/assets/circle-check-CXZBkRdw.js +1 -0
  113. package/dist/assets/{circle-question-mark-C4awnefe.js → circle-question-mark-CyJOKAI_.js} +1 -1
  114. package/dist/assets/{clipboard-list-BtP8g_uG.js → clipboard-list-stOm0KGS.js} +1 -1
  115. package/dist/assets/clock-DA9WgC6k.js +1 -0
  116. package/dist/assets/code-DAH6H3gF.js +1 -0
  117. package/dist/assets/codingBridge-JQiapTb0.js +2 -0
  118. package/dist/assets/{codingBridgeNotify-Bs3sOsDi.js → codingBridgeNotify-eBZBQ4fW.js} +1 -1
  119. package/dist/assets/{coins-CGkvr3bq.js → coins-Bh8MNjpF.js} +1 -1
  120. package/dist/assets/{collapse-D4pqPjny.js → collapse-vXWDUVU2.js} +1 -1
  121. package/dist/assets/constants-CIlRvdtN.js +1 -0
  122. package/dist/assets/{copy-Bgq_Lt5F.js → copy-CqMcqh-f.js} +1 -1
  123. package/dist/assets/{createTaskActions-CgTN396G.js → createTaskActions-Dhh8XcOz.js} +1 -1
  124. package/dist/assets/{date-picker-CIVhQSq0.js → date-picker-JwQbpt4p.js} +1 -1
  125. package/dist/assets/{digitalhuman-1RfVeR5X.js → digitalhuman-BxPfmHIp.js} +1 -1
  126. package/dist/assets/{dollar-sign--zIyRxW2.js → dollar-sign-hRPSDYYU.js} +1 -1
  127. package/dist/assets/{download-BpXfjPLY.js → download-vEXKvcv0.js} +1 -1
  128. package/dist/assets/{drawer-DttMD3IQ.js → drawer-CC8UgYnL.js} +1 -1
  129. package/dist/assets/{dropdown-uDZzlyvc.js → dropdown-BsH9rQq9.js} +1 -1
  130. package/dist/assets/{dropdown-xvOpGXaf.js → dropdown-qmHfM44c.js} +1 -1
  131. package/dist/assets/{ellipsis-D-4XqsA_.js → ellipsis-DCWqwi_8.js} +1 -1
  132. package/dist/assets/{esm-BxnuLIIk.js → esm-CyzWxjDk.js} +2 -2
  133. package/dist/assets/{external-link-CfkUyibd.js → external-link-BFcKxFqa.js} +1 -1
  134. package/dist/assets/{eye-Dhb3D_OP.js → eye-X3ZIpJjb.js} +1 -1
  135. package/dist/assets/{file-BY8wxxW3.js → file-7dcZXbqk.js} +1 -1
  136. package/dist/assets/{file-output-CSH2H9Po.js → file-output-Bi1dOh0K.js} +1 -1
  137. package/dist/assets/{file-text-iEDL634w.js → file-text-DKIDV4sN.js} +1 -1
  138. package/dist/assets/{fish-7f57Y8Hh.js → fish-nT84YjIK.js} +1 -1
  139. package/dist/assets/{flux-Ca7x13EY.js → flux-DzJKSkA2.js} +1 -1
  140. package/dist/assets/{folder-BQwFHQqf.js → folder-CM2ANE3g.js} +1 -1
  141. package/dist/assets/gauge-BCNXQyPO.js +1 -0
  142. package/dist/assets/{generationInput-Tp6tVYL4.js → generationInput-D3ZEKlr_.js} +1 -1
  143. package/dist/assets/{globe-CeROj4EC.js → globe-Bms-WZJB.js} +1 -1
  144. package/dist/assets/{grokvideo-DBBElwKl.js → grokvideo-Duq7m-HZ.js} +1 -1
  145. package/dist/assets/{hailuo-DndOJa7m.js → hailuo-ihBSde0M.js} +1 -1
  146. package/dist/assets/{headphones-CFqTn-wN.js → headphones-DrrNBtEc.js} +1 -1
  147. package/dist/assets/{history-BRP3o6Xd.js → history-CE2tuUZM.js} +1 -1
  148. package/dist/assets/{house-BUpAjJMo.js → house-B4Orqnze.js} +1 -1
  149. package/dist/assets/{i18n-lmeSFJDq.js → i18n-BV9oUNh3.js} +1 -1
  150. package/dist/assets/{image-CfYTaFPL.js → image-DgIbuclQ.js} +1 -1
  151. package/dist/assets/{imageRequests-DkHCCRlh.js → imageRequests-BFI4kYs5.js} +1 -1
  152. package/dist/assets/index-DaMzkL_Z.js +572 -0
  153. package/dist/assets/{index.es-Chh6NaN3.js → index.es-Cn9Xaxu-.js} +1 -1
  154. package/dist/assets/{info-DbD2xHpS.js → info-B2JKZb31.js} +1 -1
  155. package/dist/assets/{input-number-CMFoxP_g.js → input-number-D7868Ezn.js} +1 -1
  156. package/dist/assets/{key-round-CIFO1AJb.js → key-round-BmsqjJoj.js} +1 -1
  157. package/dist/assets/{kling-BOhcy_Wh.js → kling-D2PX1IFq.js} +1 -1
  158. package/dist/assets/{languages-U21LtzrS.js → languages-Bx3oL0Vm.js} +1 -1
  159. package/dist/assets/{laptop-By9AaYDw.js → laptop-DXPIqgNW.js} +1 -1
  160. package/dist/assets/{lightbulb-Dmr-hP5L.js → lightbulb-2NqBb6Jr.js} +1 -1
  161. package/dist/assets/{link-m8jORFL0.js → link-DbilLMkL.js} +1 -1
  162. package/dist/assets/loader-circle-BH5LDkvD.js +1 -0
  163. package/dist/assets/{lock-ClNzLpGj.js → lock-DwDnxkgR.js} +1 -1
  164. package/dist/assets/{luma-Bbjxsp1K.js → luma-gqUNjUL_.js} +1 -1
  165. package/dist/assets/{maestro-3lYA-9TB.js → maestro-BA9ZpNkH.js} +1 -1
  166. package/dist/assets/{maestroLanguages-nCvoB59e.js → maestroLanguages-TUaJ8P-k.js} +1 -1
  167. package/dist/assets/{mail-t2bgiRlI.js → mail-DQIaP9kg.js} +1 -1
  168. package/dist/assets/{message-circle-BhkVaGxg.js → message-circle-DK6GzH1O.js} +1 -1
  169. package/dist/assets/{mic-C_oCRbvR.js → mic-CPlREHCF.js} +1 -1
  170. package/dist/assets/{midjourney-Du1OMPdL.js → midjourney-DFh-8EGI.js} +1 -1
  171. package/dist/assets/{minimax-Dt0kZ3Vo.js → minimax-BzrmfhMn.js} +1 -1
  172. package/dist/assets/{mobileLocalExec-Ce7U3Nmb.js → mobileLocalExec-B4w9pk3a.js} +1 -1
  173. package/dist/assets/{models-Cru5uJc2.js → models-D7oFDNXC.js} +1 -1
  174. package/dist/assets/{monitor-CNUuuIgl.js → monitor-CLW6zOcS.js} +1 -1
  175. package/dist/assets/{mouse-pointer-2-HsST9qMs.js → mouse-pointer-2-CTRPfCZp.js} +1 -1
  176. package/dist/assets/music-2-zJvAUvo6.js +1 -0
  177. package/dist/assets/{nanobanana-DiX5DuZY.js → nanobanana-cmam7ngV.js} +1 -1
  178. package/dist/assets/{omni-DJ2wmtaL.js → omni-D3REPctp.js} +1 -1
  179. package/dist/assets/{openaiimage-DiGQK-vZ.js → openaiimage-BCOWMe6j.js} +1 -1
  180. package/dist/assets/{openaiimage-C6c_JnqI.js → openaiimage-Bx-_gcGZ.js} +1 -1
  181. package/dist/assets/{openaiimage-pCmThaEj.js → openaiimage-C3NyItjU.js} +1 -1
  182. package/dist/assets/{openaiimage-D31IGt_l.js → openaiimage-C9I1FSao.js} +1 -1
  183. package/dist/assets/{openaiimage-C99BMPzr.js → openaiimage-CRU2SXEC.js} +1 -1
  184. package/dist/assets/{openaiimage-Ccy1A76U.js → openaiimage-CTLe_9cQ.js} +1 -1
  185. package/dist/assets/{openaiimage-DXJScwOs.js → openaiimage-Cbg7t8CV.js} +1 -1
  186. package/dist/assets/{openaiimage-Bv7qGbKM.js → openaiimage-DBrTmUJX.js} +1 -1
  187. package/dist/assets/{openaiimage-DJN2Ct9T.js → openaiimage-DLn1at9F.js} +1 -1
  188. package/dist/assets/{openaiimage-qTF1GUn3.js → openaiimage-HpiFh_h5.js} +1 -1
  189. package/dist/assets/{openaiimage-CQsujQnW.js → openaiimage-XlBhpvEL.js} +1 -1
  190. package/dist/assets/{openaiimage-BqvK74sh.js → openaiimage-ZIED_Qn6.js} +1 -1
  191. package/dist/assets/{openaiimage-BdSAUNcS.js → openaiimage-fbvglES0.js} +1 -1
  192. package/dist/assets/{pagination-B62agDTK.js → pagination-CaWpt6wz.js} +1 -1
  193. package/dist/assets/{pagination-B_nilV_t.js → pagination-CewoYikW.js} +1 -1
  194. package/dist/assets/{pagination-DEYlwTlL.js → pagination-i2w8oD74.js} +1 -1
  195. package/dist/assets/{palette-zKJYv6Zy.js → palette-4c1CqiDQ.js} +1 -1
  196. package/dist/assets/{paperclip-D0oNKYmJ.js → paperclip-DLrR7l6m.js} +1 -1
  197. package/dist/assets/{pause-U4QQSdVl.js → pause-kQiaZPDB.js} +1 -1
  198. package/dist/assets/{pencil-DHzOKEgq.js → pencil-Yu_nOvPd.js} +1 -1
  199. package/dist/assets/{pika-BbThRPIH.js → pika-Da-GWhgt.js} +1 -1
  200. package/dist/assets/{pixverse-C-ZGeFKf.js → pixverse-BlyA0tjA.js} +1 -1
  201. package/dist/assets/play-CWPhuVSv.js +1 -0
  202. package/dist/assets/{plug-D5dZg2UY.js → plug-BPIlb12f.js} +1 -1
  203. package/dist/assets/plus-B4vYbNlo.js +1 -0
  204. package/dist/assets/{poivelle-Ckaod8ZT.js → poivelle-CW8iU-eP.js} +1 -1
  205. package/dist/assets/{popover-D2p4u8-Q.js → popover-Bjwaimy-.js} +1 -1
  206. package/dist/assets/{producer-BbFTej8S.js → producer-C_OCWqxF.js} +1 -1
  207. package/dist/assets/{qrart-VBAjMw1M.js → qrart-CsrGD_0a.js} +1 -1
  208. package/dist/assets/{qwenimage-CuCAms4O.js → qwenimage-D-cS0xRz.js} +1 -1
  209. package/dist/assets/{realtime-B8R0_LhC.js → realtime-DzKbvOeZ.js} +1 -1
  210. package/dist/assets/{refresh-cw-Br21vEXT.js → refresh-cw-CGE2WK3R.js} +1 -1
  211. package/dist/assets/rotate-ccw-BBbZApKm.js +1 -0
  212. package/dist/assets/rotate-cw-BIEh5ep6.js +1 -0
  213. package/dist/assets/{row-DP0oDZAs.js → row-Dvcra4HC.js} +1 -1
  214. package/dist/assets/search-DblvSKJH.js +1 -0
  215. package/dist/assets/{seedance-hj8hoS13.js → seedance-kbp2AjPF.js} +1 -1
  216. package/dist/assets/{seedream-CaMAYFeC.js → seedream-QK98m4Ni.js} +1 -1
  217. package/dist/assets/{select-C_X0J3Ch.js → select-BtCyr5wB.js} +1 -1
  218. package/dist/assets/{serp-BCRB0Wv_.js → serp-CjS75T3v.js} +1 -1
  219. package/dist/assets/{shield-BJ2lOk1S.js → shield-95_8-rjI.js} +1 -1
  220. package/dist/assets/{showcase-BzFqOq7u.js → showcase-Cgjf-hCu.js} +1 -1
  221. package/dist/assets/{showcaseRecreateMixin-DyKdifmx.js → showcaseRecreateMixin-xVJ-0HiH.js} +1 -1
  222. package/dist/assets/{shuffle-DuAaOCLP.js → shuffle-Cz2-9OtK.js} +1 -1
  223. package/dist/assets/{siteHome-CubcvlzE.js → siteHome-Diw9Ig2p.js} +1 -1
  224. package/dist/assets/{slider-CdeLiUQL.js → slider-CLYvyYfm.js} +1 -1
  225. package/dist/assets/{solana-wallets-Ctt177Lt.js → solana-wallets-CelUe1S1.js} +2 -2
  226. package/dist/assets/{sora-CRRO9qcp.js → sora-DmX--AWu.js} +1 -1
  227. package/dist/assets/{sparkles-CKXe2q1X.js → sparkles-ByKHw8LZ.js} +1 -1
  228. package/dist/assets/square-Gtrr5FBZ.js +1 -0
  229. package/dist/assets/{store-DztoOndf.js → store-o6_CNvRt.js} +1 -1
  230. package/dist/assets/{suno-BPfVaq-I.js → suno-9uttJc95.js} +1 -1
  231. package/dist/assets/{switch-DyfMMvH-.js → switch-Cp97YOoB.js} +1 -1
  232. package/dist/assets/{table-BEiwdkro.js → table-VdpkKLcu.js} +1 -1
  233. package/dist/assets/{tabs-6hfO7ztL.js → tabs-mGC1bMGE.js} +1 -1
  234. package/dist/assets/{tag-mqM1JPuG.js → tag-YRLs2bdc.js} +1 -1
  235. package/dist/assets/{taskPolling-U8DOPUQy.js → taskPolling-C7ogi-ir.js} +1 -1
  236. package/dist/assets/terminal-CN5YC5j-.js +1 -0
  237. package/dist/assets/{time-picker-DgkXiE-7.js → time-picker-CraH3U9M.js} +1 -1
  238. package/dist/assets/{tooltip-OUJEXz3N.js → tooltip-DW5LR73p.js} +1 -1
  239. package/dist/assets/{trash-2-Cy68rO6n.js → trash-2-Dsd2VwfS.js} +1 -1
  240. package/dist/assets/{triangle-alert-CjbgCRoN.js → triangle-alert-DlyIYMuG.js} +1 -1
  241. package/dist/assets/{upload-vSq7Ihy4.js → upload-B7ks3vsv.js} +1 -1
  242. package/dist/assets/{upload-XPx0yx5g.js → upload-CQXERPyi.js} +1 -1
  243. package/dist/assets/user-C4i6ybDp.js +1 -0
  244. package/dist/assets/{veo-BEgEF3Oz.js → veo-CWrdDNhR.js} +1 -1
  245. package/dist/assets/{video-a0RDUv9h.js → video-CO2jL2Gw.js} +1 -1
  246. package/dist/assets/{volume-2-DGSpj-NH.js → volume-2-aXpinVqT.js} +1 -1
  247. package/dist/assets/{wallet-Ca1vgVzZ.js → wallet-DI-w2Uci.js} +1 -1
  248. package/dist/assets/{wan-iM8yvoVy.js → wan-BHpfpD8T.js} +1 -1
  249. package/dist/assets/{wand-sparkles-BLj6TbQF.js → wand-sparkles-DevqpoZK.js} +1 -1
  250. package/dist/assets/{web-D4sEVuy1.js → web-BMkHqIEe.js} +1 -1
  251. package/dist/assets/{webextrator-CppLRjXW.js → webextrator-DKotUBMm.js} +1 -1
  252. package/dist/assets/{zap-D95myyfC.js → zap-DMJmp3qC.js} +1 -1
  253. package/dist/index.html +4 -4
  254. package/package.json +1 -1
  255. package/dist/assets/Index-Bx51kak2.css +0 -1
  256. package/dist/assets/Index-CoUozD_X.js +0 -1
  257. package/dist/assets/Index-bdI4gOf7.js +0 -1
  258. package/dist/assets/arrow-down-ChqsQZig.js +0 -1
  259. package/dist/assets/arrow-left-Dtuf3L2j.js +0 -1
  260. package/dist/assets/arrow-right-Bqfb6t60.js +0 -1
  261. package/dist/assets/arrow-up-CSpz0srB.js +0 -1
  262. package/dist/assets/check-CTUDvagB.js +0 -1
  263. package/dist/assets/chevron-down-Ce5WWTJ4.js +0 -1
  264. package/dist/assets/chevron-right-CIFdBNP8.js +0 -1
  265. package/dist/assets/circle-check-C7raGFyE.js +0 -1
  266. package/dist/assets/clock-CxvQJYC5.js +0 -1
  267. package/dist/assets/code-DnoJmxOh.js +0 -1
  268. package/dist/assets/codingBridge-Cvwiwqe7.js +0 -2
  269. package/dist/assets/constants-CuuFtMEu.js +0 -1
  270. package/dist/assets/gauge-Cn1dy4QG.js +0 -1
  271. package/dist/assets/index-DVmeVwK7.js +0 -572
  272. package/dist/assets/loader-circle-b6njcpdq.js +0 -1
  273. package/dist/assets/music-2-JRU0Dy3p.js +0 -1
  274. package/dist/assets/play-CE4vLIhC.js +0 -1
  275. package/dist/assets/plus-CKVbpoNT.js +0 -1
  276. package/dist/assets/rotate-ccw-qPIu5GI_.js +0 -1
  277. package/dist/assets/rotate-cw-B7QEaCme.js +0 -1
  278. package/dist/assets/search-Ba7fFpK4.js +0 -1
  279. package/dist/assets/square-_WGgwmKd.js +0 -1
  280. package/dist/assets/terminal-Brg8gOCC.js +0 -1
  281. package/dist/assets/user-CbpGf9ep.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-C_X0J3Ch.js";import{n as x,t as S}from"./tabs-6hfO7ztL.js";import{t as C}from"./upload-XPx0yx5g.js";import{t as w}from"./tooltip-OUJEXz3N.js";import{t as T}from"./alert-BprQRUmf.js";import{h as E,v as D}from"./models-Cru5uJc2.js";import{n as O,r as k}from"./radio-BNhFzeBO.js";import{t as A}from"./drawer-DttMD3IQ.js";import{t as j}from"./input-number-CMFoxP_g.js";import{t as M}from"./slider-CdeLiUQL.js";import{t as N}from"./switch-DyfMMvH-.js";import{t as ee}from"./clock-CxvQJYC5.js";import{a as P,i as te,n as ne,r as re,s as ie,t as ae}from"./pagination-B62agDTK.js";import{t as oe}from"./headphones-CFqTn-wN.js";import{t as se}from"./info-DbD2xHpS.js";import{t as ce}from"./lightbulb-Dmr-hP5L.js";import{t as le}from"./trash-2-Cy68rO6n.js";import{t as ue}from"./triangle-alert-CjbgCRoN.js";import{t as F}from"./upload-vSq7Ihy4.js";import{t as I}from"./wand-sparkles-BLj6TbQF.js";import{Ai as de,Ei as fe,ji as pe,ki as me}from"./constants-CuuFtMEu.js";import{$a as he,A as L,Br as ge,Cn as R,La as z,Li as B,O as _e,Qi as ve,Va as V,Vi as ye,Vr as H,aa as be,at as U,ct as W,di as xe,et as Se,it as G,li as Ce,lo as K,nt as we,ot as Te,rt as Ee,st as q,to as J,tt as De,za as Oe,zi as Y,zr as ke}from"./index-DVmeVwK7.js";import{t as Ae}from"./CopyToClipboard-CnfP3j6K.js";import{t as je}from"./ReportButton-B0ZDQxLy.js";import{t as Me}from"./FilePreview-3oibArLi.js";import{t as X}from"./ImagePreview-CZs9JDgj.js";import{n as Ne}from"./taskDrawerMixin-DyAUhFEq.js";import{t as Pe}from"./ServicePricingSummary-CMOjp4_z.js";import{t as Fe}from"./AudioPreview-B8qr2QlT.js";import{t as Ie}from"./VideoPlayer-DaI2iEuf.js";import{t as Le}from"./VideoPreview-iLfPvLl6.js";import{t as Re}from"./ScenarioPaymentMode-BMC9eBkY.js";import{t as ze}from"./ApiCodeButton-C6FWrCva.js";import{t as Be}from"./BotPlaceholder-CG-3N26i.js";import{t as Ve}from"./taskPollingMixin-CcLxtz8z.js";import{t as He}from"./ShowcaseResultTabs-Be1u7B7Y.js";import{t as Ue}from"./showcaseRecreateMixin-DyKdifmx.js";import{n as We,t as Ge}from"./generationInput-Tp6tVYL4.js";var Ke=v({name:`LayoutKling`,components:{MagicIcon:I,ElDrawer:A,ElButton:J},mixins:[Ne]}),qe={class:`main flex flex-row flex-1 min-h-0`},Je={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)]`},Ye={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Xe(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,qe,[e(`div`,Je,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Ye,[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 Ze=L(Ke,[[`render`,Xe],[`__scopeId`,`data-v-f4b791b5`]]),Qe={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 Qe}}var Q=`<<<video_1>>>`,$e=/<<<image_\d+>>>/g;function et(e){return e?e.split(Q).join(` `).replace(/\s{2,}/g,` `).trim():``}function tt(e){return e?e.replace($e,` `).replace(/\s{2,}/g,` `).trim():``}function nt(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 rt(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=et(n.prompt)),e.field===`image_list`&&(n.image_list=void 0,n.prompt=tt(n.prompt));return n}var it=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(fe)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=nt(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await V.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=rt({...t,model:e},n);this.$store.commit(`kling/setConfig`,i),D.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})}}}),at={class:`field`},ot={class:`title font-bold`};function st(t,n,r,a,o,u){let d=l(`el-option`),m=l(`el-select`);return g(),s(`div`,at,[e(`h2`,ot,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 ct=L(it,[[`render`,st],[`__scopeId`,`data-v-a74e7f31`]]),lt=v({name:`ModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},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 pe.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=nt(t,{mode:e});if(n.length===0){this.applyMode(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await V.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=rt({...t,mode:e},n);this.$store.commit(`kling/setConfig`,i),D.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})}}}),ut={class:`field`},dt={class:`header`},ft={class:`title font-bold`},pt={key:0,class:`opt-tip`};function mt(t,r,u,d,m,_){let v=l(`info-icon`),y=l(`el-option`),b=l(`el-select`);return g(),s(`div`,ut,[e(`div`,dt,[e(`h2`,ft,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`,pt,i(t.disabledReason),1)):o(``,!0)]),_:2},1032,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var ht=L(lt,[[`render`,mt],[`__scopeId`,`data-v-9a8fa3c5`]]),gt=[3,5,8,10,12,15],_t=[5,10],vt=[5],yt=v({name:`DurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},isV3Model(){return pe.includes(this.selectedModel)},allowedDurations(){return this.selectedModel===`kling-o1`?vt:this.isV3Model?gt:_t},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=nt(t,{duration:e});if(n.length===0){this.applyDuration(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await V.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=rt({...t,duration:e},n);this.$store.commit(`kling/setConfig`,i),D.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})}}}),bt={class:`field`},xt={class:`control`},St={class:`label`},Ct={class:`title font-bold`};function wt(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,bt,[e(`div`,xt,[e(`div`,St,[e(`h2`,Ct,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 Tt=L(yt,[[`render`,wt],[`__scopeId`,`data-v-496bf31c`]]),Et=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`}}),Dt={class:`text-sm font-bold mb-2 block`},Ot={class:`items`},kt=[`onClick`],At={class:`name`};function jt(t,r,a,o,l,u){return g(),s(`div`,null,[e(`span`,Dt,i(t.$t(`kling.name.ratio`)),1),e(`div`,Ot,[(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`,At,i(r.label),1)],10,kt))),128))])])}var Mt=L(Et,[[`render`,jt],[`__scopeId`,`data-v-cdb14b2f`]]),Nt=v({name:`StartImage`,components:{UploadIcon:F,ElUpload:C,ElButton:J,ElTooltip:w,InfoIcon:P,ImagePreview:X},mixins:[W,q,U],emits:[`change`],data(){return{fileList:[],uploadUrl:z()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},value:{get(){return this.$store.state?.kling?.config?.start_image_url},set(){}}},watch:{value(e){!e&&this.fileList.length>0&&(this.fileList=[])}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.error(this.$t(`kling.message.uploadReferencesError`))},onBeforeUpload(){let e=this.$store.state.kling?.config||{};if(e.video_list?.[0]?.refer_type===`base`)return D.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?(D.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`},Ft={class:`flex min-h-8 items-center pr-20`},It={class:`flex justify-start items-center`},Lt={class:`text-sm font-bold`};function Rt(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`,Ft,[e(`div`,It,[e(`span`,Lt,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 zt=L(Nt,[[`render`,Rt],[`__scopeId`,`data-v-60844ac3`]]),Bt=v({name:`EndImage`,components:{UploadIcon:F,ElUpload:C,ElButton:J,ElTooltip:w,ImagePreview:X,InfoIcon:P},mixins:[W,q,U],data(){return{fileList:[],uploadUrl:z()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},klingConfig(){return this.$store.state?.kling?.config||{}},endImageSupported(){return 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 D.warning(this.$t(`kling.message.endImageNotSupported`)),!1;if(!this.hasStartImage)return D.warning(this.$t(`kling.message.endImageRequiresStart`)),!1;if(this.klingConfig.video_list?.[0]?.refer_type===`base`)return D.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?(D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:e})),!1):!0},onExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.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()}}}),Vt={class:`relative`},Ht={class:`flex min-h-8 items-center pr-20`},Ut={class:`flex justify-start items-center`},Wt={class:`text-sm font-bold`};function Gt(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`,Vt,[e(`div`,Ht,[e(`div`,Ut,[e(`span`,Wt,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 Kt=L(Bt,[[`render`,Gt],[`__scopeId`,`data-v-b286c4d0`]]),qt=v({name:`ReferenceVideo`,components:{ElUpload:C,ElButton:J,ElRadioButton:O,ElRadioGroup:k,ElSwitch:N,InfoIcon:P,FilePreview:Me,UploadIcon:F},mixins:[q,U],data(){return{fileList:[],uploadUrl:z()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},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(){D.warning(this.$t(`kling.message.referenceVideoExceed`))},onError(){D.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 D.error(this.$t(`kling.message.referenceVideoImageLimit`)),!1;let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=Ee(e.size);return t?n?!0:(D.error(this.$t(`kling.message.referenceVideoSizeExceed`,{max:we(De)})),!1):(D.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=et(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()}}}),Jt={class:`relative`},Yt={class:`flex min-h-8 items-center pr-20`},Xt={class:`flex justify-start items-center`},Zt={class:`text-sm font-bold`},Qt={key:0,class:`reference-options mt-3 flex flex-col gap-3`},$t={class:`flex flex-col items-stretch gap-2 sm:flex-row sm:items-center sm:justify-between`},en={class:`text-sm`},tn={class:`flex items-center justify-between gap-3`},nn={class:`text-sm`};function rn(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`,Jt,[e(`div`,Yt,[e(`div`,Xt,[e(`span`,Zt,i(t.$t(`kling.name.referenceVideo`)),1),a(h,{content:t.$t(`kling.description.omniReferenceVideo`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"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`,Qt,[e(`div`,$t,[e(`span`,en,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`,tn,[e(`span`,nn,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 an=L(qt,[[`render`,rn],[`__scopeId`,`data-v-e3a9dfab`]]),on=v({name:`KlingReferenceImages`,components:{ElButton:J,ElUpload:C,UploadIcon:F,ImagePreview:X,InfoIcon:P},mixins:[W,q,U],data(){return{fileList:[],uploadUrl:z()+`/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(){D.warning(this.$t(`kling.message.referenceImagesExceed`,{count:this.remainingSlots}))},onError(){D.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=[tt(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()}}}),sn={class:`relative`},cn={class:`flex justify-between items-center`},ln={class:`flex justify-start items-center`},un={class:`text-sm font-bold`},dn={key:0,class:`file-list flex flex-wrap gap-2 mt-2`};function fn(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`,sn,[e(`div`,cn,[e(`div`,ln,[e(`span`,un,i(t.$t(`kling.name.referenceImages`)),1),a(v,{content:t.$t(`kling.description.referenceImages`)},null,8,[`content`])]),a(x,{ref:`uploader`,"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`,dn,[(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 pn=L(on,[[`render`,fn]]),mn=v({name:`CfgScaleSelector`,components:{ElSlider:M,InfoIcon:P,ElInputNumber:j},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}}),hn={class:`flex justify-between`},gn={class:`flex justify-start items-center`},_n={class:`text-sm font-bold`},vn={class:`flex justify-end items-center`},yn={class:`w-full`};function bn(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`,hn,[e(`div`,gn,[e(`span`,_n,i(t.$t(`kling.name.cfgScale`)),1),a(d,{content:t.$t(`kling.description.cfgScale`)},null,8,[`content`])]),e(`div`,vn,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,yn,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:0,max:1,step:.1},null,8,[`modelValue`])])])}var xn=L(mn,[[`render`,bn]]),Sn=v({name:`GenerateAudioSelector`,components:{ElSwitch:N,InfoIcon:P},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},selectedMode(){return this.$store.state.kling?.config?.mode||``},supported(){return!!(pe.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})}}}),Cn={class:`relative`},wn={class:`flex justify-between items-center`},Tn={class:`flex justify-start items-center`},En={class:`text-sm font-bold`};function Dn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,Cn,[e(`div`,wn,[e(`div`,Tn,[e(`span`,En,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 On=L(Sn,[[`render`,Dn]]),kn=[`horizontal`,`vertical`,`pan`,`tilt`,`roll`,`zoom`],An=v({name:`CameraControlSelector`,components:{ElSelect:y,ElOption:b,ElSlider:M,ElInputNumber:j,InfoIcon:P},data(){return{configKeys:kn}},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)}}}),jn={class:`field`},Mn={class:`header`},Nn={class:`text-sm font-bold`},Pn={key:0,class:`config-grid`},Fn={class:`cfg-row-head`},In={class:`cfg-name`};function Ln(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`,jn,[e(`div`,Mn,[e(`span`,Nn,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`,Fn,[e(`span`,In,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 Rn=L(An,[[`render`,Ln],[`__scopeId`,`data-v-cd896060`]]),zn=[{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 Bn(e,t){let n=(e||``).trim();return n?n.includes(t)?n:`${n}${$}${t}`:t}function Vn(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 Hn=v({name:`InspirationPills`,components:{CloseIcon:Oe},computed:{prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return zn.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=Vn(this.prompt,e);this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:t})}}}),Un={key:0,class:`pills`,role:`list`},Wn={class:`pill-text`},Gn=[`aria-label`,`title`,`onClick`];function Kn(n,r,u,d,f,p){let m=l(`close-icon`);return n.selected.length>0?(g(),s(`div`,Un,[(g(!0),s(c,null,h(n.selected,r=>(g(),s(`div`,{key:r,class:`pill`,role:`listitem`},[e(`span`,Wn,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,Gn)]))),128))])):o(``,!0)}var qn=v({name:`PromptInput`,components:{IdeaIcon:ce,ElButton:J,PromptTextarea:te,InspirationPills:L(Hn,[[`render`,Kn],[`__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 Jn(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 Yn=L(qn,[[`render`,Jn],[`__scopeId`,`data-v-5754ae54`]]),Xn=v({name:`NegativePromptInput`,components:{ElInput:K,InfoIcon:P},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||=``}}),Zn={class:`field`},Qn={class:`box`},$n={class:`title font-bold`};function er(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,Zn,[e(`div`,Qn,[e(`h2`,$n,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 tr=L(Xn,[[`render`,er],[`__scopeId`,`data-v-de98cf01`]]),nr=v({name:`InspirationDrawer`,components:{Close:Oe,IdeaIcon:ce,ElDrawer:A,ElButton:J},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`],data(){return{groups:zn}},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(Vn(this.prompt,e)):this.setPrompt(Bn(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(let t of this.allChipTexts)for(;e.includes(t);)e=Vn(e,t);this.setPrompt(e)}}}),rr={class:`drawer-content`},ir={class:`drawer-header`},ar={class:`title-row`},or={class:`title`},sr={class:`hint`},cr={key:0,class:`selected-bar`},lr={class:`selected-text`},ur={class:`groups`},dr={class:`group-title`},fr={class:`chip-grid`},pr=[`onClick`];function mr(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`,rr,[e(`div`,ir,[e(`div`,ar,[a(y,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,or,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`,sr,i(t.$t(`kling.inspiration.hint`)),1),t.selectedCount>0?(g(),s(`div`,cr,[e(`span`,lr,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`,ur,[(g(!0),s(c,null,h(t.groups,r=>(g(),s(`div`,{key:r.groupKey,class:`group`},[e(`div`,dr,i(t.$t(`kling.inspiration.group.${r.groupKey}`)),1),e(`div`,fr,[(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,pr))),128))])]))),128))])])]),_:1},8,[`modelValue`,`size`])}var hr=L(nr,[[`render`,mr],[`__scopeId`,`data-v-8b2e6a5d`]]),gr={"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`},_r={std:`720p`,pro:`1080p`,"4k":`4K`},vr=v({name:`SummaryChip`,components:{AudioIcon:oe},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){let e=this.config?.model||`kling-v2-5-turbo`;return gr[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||``},modeLabel(){let e=this.config?.mode||`std`;return _r[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),yr={class:`summary-chip`},br=[`title`],xr=[`title`],Sr=[`title`],Cr=[`title`],wr=[`title`];function Tr(t,n,r,c,u,d){let f=l(`audio-icon`);return g(),s(`div`,yr,[e(`span`,{class:`part`,title:t.$t(`kling.name.model`)},i(t.modelLabel),9,br),n[0]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.duration`)},i(t.durationLabel),9,xr),n[1]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.ratio`)},i(t.aspectRatio||`16:9`),9,Sr),n[2]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.mode`)},i(t.modeLabel),9,Cr),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,wr)):o(``,!0)])}var Er=v({name:`ConfigPanel`,components:{MagicIcon:I,ElButton:J,ServicePricingSummary:Pe,PromptInput:Yn,NegativePromptInput:tr,ModelSelector:ct,ModeSelector:ht,DurationSelector:Tt,RatioSelector:Mt,StartImage:zt,CfgScaleSelector:xn,GenerateAudioSelector:On,CameraControlSelector:Rn,InspirationDrawer:hr,SummaryChip:L(vr,[[`render`,Tr],[`__scopeId`,`data-v-c800852a`]]),EndImage:Kt,ReferenceImages:pn,ReferenceVideo:an,ScenarioPaymentMode:Re},emits:[`generate`],data(){return{inspirationOpen:!1,quoteTimer:0,quoteRunId:0}},computed:{canGenerate(){return Ge(`kling`,ge(this.config))},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 R(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service},walletMode(){return B()&&Y(`kling`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=Y(`kling`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,350))},async refreshQuote(){if(!this.canGenerate)return;let e=Y(`kling`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await H.quote(ge(this.config));t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)}}}),Dr={class:`flex flex-col h-full`},Or={class:`flex-1 overflow-y-auto p-5`},kr={class:`flex flex-col items-center justify-center px-5 pb-5`};function Ar(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(`scenario-payment-mode`),j=l(`service-pricing-summary`),M=l(`magic-icon`),N=l(`el-button`),ee=l(`inspiration-drawer`);return g(),s(`div`,Dr,[e(`div`,Or,[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`,kr,[a(k),a(A,{scenario:`kling`}),t.walletMode?o(``,!0):(g(),f(j,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),t.config?.video_url!==void 0||t.config?.custom?(g(),f(N,{key:1,type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(M,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.extend`)),1)]),_:1},8,[`disabled`,`onClick`])):(g(),f(N,{key:2,type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(M,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`]))]),a(ee,{modelValue:t.inspirationOpen,"onUpdate:modelValue":n[1]||=e=>t.inspirationOpen=e},null,8,[`modelValue`])])}var jr=L(Er,[[`render`,Ar]]),Mr=v({name:`MotionImage`,components:{UploadIcon:F,ElUpload:C,ElButton:J,InfoIcon:P,ImagePreview:X},mixins:[W,q,U,Se],data(){return{fileList:[],uploadUrl:z()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetImageUrl()},methods:{onExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.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()}}}),Nr={class:`relative`},Pr={class:`flex justify-between`},Fr={class:`flex justify-start items-center`},Ir={class:`text-sm font-bold`};function Lr(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`,Nr,[e(`div`,Pr,[e(`div`,Fr,[e(`span`,Ir,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,"before-upload":t.beforeUploadSizeGuard,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`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Rr=L(Mr,[[`render`,Lr],[`__scopeId`,`data-v-4a95ef2c`]]),zr=v({name:`MotionVideo`,components:{UploadIcon:F,ElUpload:C,ElButton:J,InfoIcon:P,FilePreview:Me},mixins:[q,U],data(){return{fileList:[],uploadUrl:z()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetVideoUrl()},methods:{onExceed(){D.warning(this.$t(`kling.message.uploadVideoExceed`))},onError(){D.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:(D.error(this.$t(`kling.message.uploadVideoSizeExceed`)),!1):(D.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()}}}),Br={class:`relative`},Vr={class:`flex justify-between`},Hr={class:`flex justify-start items-center`},Ur={class:`text-sm font-bold`};function Wr(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`,Br,[e(`div`,Vr,[e(`div`,Hr,[e(`span`,Ur,i(t.$t(`kling.name.motionVideo`)),1),a(h,{content:t.$t(`kling.description.motionVideo`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"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 Gr=L(zr,[[`render`,Wr],[`__scopeId`,`data-v-630c4521`]]),Kr=v({name:`MotionPromptInput`,components:{ElInput:K,InfoIcon:P},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||``},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),qr={class:`field`},Jr={class:`box`},Yr={class:`title font-bold`};function Xr(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,qr,[e(`div`,Jr,[e(`h2`,Yr,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 Zr=L(Kr,[[`render`,Xr],[`__scopeId`,`data-v-ca9fdbe5`]]),Qr=`video`,$r=v({name:`CharacterOrientationSelector`,components:{ElRadioGroup:k,ElRadioButton:O,InfoIcon:P},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||Qr},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=Qr)}}),ei={class:`field`},ti={class:`header`},ni={class:`text-sm font-bold`};function ri(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`,ei,[e(`div`,ti,[e(`span`,ni,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 ii=L($r,[[`render`,ri],[`__scopeId`,`data-v-7a91195b`]]),ai=`kling-v2-6`,oi=v({name:`MotionModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},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||ai},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=ai)}}),si={class:`field`},ci={class:`header`},li={class:`title font-bold`};function ui(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,si,[e(`div`,ci,[e(`h2`,li,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 di=L(oi,[[`render`,ui],[`__scopeId`,`data-v-480e8da2`]]),fi=`std`,pi=v({name:`MotionModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},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||fi},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=fi)}}),mi={class:`field`},hi={class:`header`},gi={class:`title font-bold`};function _i(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,mi,[e(`div`,hi,[e(`h2`,gi,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 vi=L(pi,[[`render`,_i],[`__scopeId`,`data-v-1295688c`]]),yi=v({name:`KeepOriginalSoundSelector`,components:{ElSwitch:N,InfoIcon:P},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`})}}}}),bi={class:`relative`},xi={class:`flex justify-between items-center`},Si={class:`flex justify-start items-center`},Ci={class:`text-sm font-bold`};function wi(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,bi,[e(`div`,xi,[e(`div`,Si,[e(`span`,Ci,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 Ti=v({name:`MotionPanel`,components:{MagicIcon:I,ElButton:J,ServicePricingSummary:Pe,MotionImage:Rr,MotionVideo:Gr,MotionPromptInput:Zr,CharacterOrientationSelector:ii,MotionModelSelector:di,MotionModeSelector:vi,KeepOriginalSoundSelector:L(yi,[[`render`,wi]])},emits:[`generate`],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return R({...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`)}}}),Ei={class:`flex flex-col h-full`},Di={class:`flex-1 overflow-y-auto p-5`},Oi={class:`flex flex-col items-center justify-center px-5 pb-5`};function ki(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(`service-pricing-summary`),S=l(`magic-icon`),C=l(`el-button`);return g(),s(`div`,Ei,[e(`div`,Di,[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`,Oi,[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 Ai=L(Ti,[[`render`,ki]]),ji=v({name:`KlingTabSwitcher`,components:{ElTabs:x,ElTabPane:S,ElTag:he},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)}}}),Mi=[`title`],Ni={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`,"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`,Ni,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,Mi)]),_:2},1032,[`name`,`disabled`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var Fi=L(ji,[[`render`,Pi],[`__scopeId`,`data-v-e6a2bb26`]]),Ii={"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`},Li=v({name:`TalkingPhotoModelSelector`,components:{ElSelect:y,ElOption:b},data(){return{options:de.map(e=>({value:e,label:Ii[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=me)}}),Ri={class:`field`},zi={class:`title font-bold`};function Bi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Ri,[e(`h2`,zi,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 Vi=L(Li,[[`render`,Bi],[`__scopeId`,`data-v-cbc83d11`]]),Hi=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`)}}),Ui={class:`field`},Wi={class:`title font-bold`};function Gi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Ui,[e(`h2`,Wi,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 Ki=v({name:`TalkingPhotoPanel`,components:{MagicIcon:I,UploadIcon:F,ElUpload:C,ElButton:J,ElInput:K,ServicePricingSummary:Pe,InfoIcon:P,ImagePreview:X,ModelSelector:Vi,ModeSelector:L(Hi,[[`render`,Gi],[`__scopeId`,`data-v-92525a1d`]]),ScenarioPaymentMode:Re},mixins:[U,Se],emits:[`generate`],data(){return{imageFiles:[],audioFiles:[],uploadUrl:z()+`/api/v1/files/`,quoteTimer:0,quoteRunId:0}},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 R({...this.config,action:`talking-photo`},this.service?.cost)},canGenerate(){return!!(this.config.image_url&&this.config.audio_url)},walletMode(){return B()&&Y(`kling`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteTimer=window.setTimeout(this.refreshQuote,350)},async refreshQuote(){let e=Y(`kling`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await H.quoteTalkingPhoto(ke(this.config));t===this.quoteRunId&&e.mode===`wallet`&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},commit(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.config,...e})},onPromptChange(e){this.commit({prompt:e})},onImageExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onImageError(){D.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(){D.warning(this.$t(`kling.message.uploadAudioExceed`))},onAudioError(){D.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`)}}}),qi={class:`flex flex-col h-full`},Ji={class:`flex-1 overflow-y-auto p-5`},Yi={class:`relative mb-4`},Xi={class:`flex justify-start items-center`},Zi={class:`text-sm font-bold`},Qi={class:`relative mb-4`},$i={class:`flex justify-start items-center`},ea={class:`text-sm font-bold`},ta=[`src`],na={class:`mb-4`},ra={class:`flex justify-start items-center`},ia={class:`text-sm font-bold`},aa={class:`flex flex-col items-center justify-center px-5 pb-5`};function oa(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(`scenario-payment-mode`),T=l(`service-pricing-summary`),E=l(`magic-icon`);return g(),s(`div`,qi,[e(`div`,Ji,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),e(`div`,Yi,[e(`div`,Xi,[e(`span`,Zi,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,"before-upload":t.beforeUploadSizeGuard,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`,`before-upload`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`])]),e(`div`,Qi,[e(`div`,$i,[e(`span`,ea,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,"before-upload":t.beforeUploadSizeGuard,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`,`before-upload`,`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,ta)):o(``,!0)]),e(`div`,na,[e(`div`,ra,[e(`span`,ia,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`,aa,[a(w,{scenario:`kling`}),t.walletMode?o(``,!0):(g(),f(T,{key:0,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(E,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generateTalkingPhoto`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var sa=L(Ki,[[`render`,oa],[`__scopeId`,`data-v-46191f92`]]),ca=v({name:`TaskPreview`,components:{DeleteIcon:le,ChannelIcon:ie,InfoIcon:se,MagicIcon:I,TimeIcon:ee,WarningIcon:ue,CopyToClipboard:Ae,ElAlert:T,VideoPlayer:Ie,ElTooltip:w,ElButton:J,ImagePreview:X,VideoPreview:Le,AudioPreview:Fe,ApiCodeButton:ze,ReportButton:je},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},displayText(){return this.modelValue?.request?.prompt?.trim()||this.modelValue?.request?.text?.trim()||``},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:{async onDelete(){let e=this.modelValue?.id;if(e){try{await V.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`kling/deleteTask`,{id:e}),D.success(this.$t(`common.message.deleteTaskSuccess`))}catch{D.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),la={class:`preview`},ua={class:`left`},da={class:`main`},fa={class:`bot`},pa={class:`datetime`},ma=[`aria-label`],ha={key:0,class:`info`},ga={key:0,class:`request-media flex justify-start items-center gap-2 w-full overflow-x-auto`},_a={key:1,class:`prompt`},va={key:0},ya={key:1},ba={key:1,class:n({content:!0,failed:!0})},xa={key:0,class:`mb-4`},Sa={key:1,class:n({operations:!0,"mt-2":!0})},Ca={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},wa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ta={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Ea={key:2,class:n({content:!0})},Da={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Oa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ka={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Aa={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ja={key:3,class:n({content:!0})},Ma={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Na={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Pa(n,u,d,m,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`image-preview`),C=l(`video-preview`),w=l(`audio-preview`),T=l(`video-player`),E=l(`el-button`),D=l(`api-code-button`),O=l(`report-button`),k=l(`channel-icon`),A=l(`magic-icon`),j=l(`copy-to-clipboard`),M=l(`time-icon`),N=l(`el-alert`),ee=l(`warning-icon`),P=l(`info-icon`);return g(),s(`div`,la,[e(`div`,ua,[a(y,{capability:`kling`,part:`avatar`,class:`avatar`})]),e(`div`,da,[e(`div`,fa,[a(y,{capability:`kling`,part:`name`}),e(`span`,pa,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(x,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(g(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:u[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,ma)):o(``,!0)]),_:1},8,[`content`])]),n.referenceImages.length>0||n.referenceVideos.length>0||n.referenceAudios.length>0||n.displayText?(g(),s(`div`,ha,[n.referenceImages.length>0||n.referenceVideos.length>0||n.referenceAudios.length>0?(g(),s(`div`,ga,[(g(!0),s(c,null,h(n.referenceImages,(e,t)=>(g(),f(S,{key:`image-${t}`,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceVideos,(e,t)=>(g(),f(C,{key:`video-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceAudios,(e,t)=>(g(),f(w,{key:`audio-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128))])):o(``,!0),n.displayText?(g(),s(`p`,_a,[r(i(n.displayText)+` `,1),n.modelValue?.response?n.isWaiting?(g(),s(`span`,ya,` - (`+i(n.$t(`kling.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,va,` - (`+i(n.$t(`kling.status.pending`))+`) `,1))])):o(``,!0)])):o(``,!0),n.modelValue?.response?.success===!0&&!n.isFailure?(g(),s(`div`,ba,[n.modelValue?.response.video_url?(g(),s(`div`,xa,[a(T,{src:n.modelValue?.response.video_url},null,8,[`src`])])):o(``,!0),n.modelValue?.response.success?(g(),s(`div`,Sa,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`kling.message.downloadVideo`),placement:`top-start`},{default:p(()=>[n.modelValue?.response.video_url?(g(),f(E,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:u[1]||=e=>n.onDownload(e,n.modelValue?.response.video_url)},{default:p(()=>[r(i(n.$t(`kling.button.download`)),1)]),_:1})):o(``,!0)]),_:1},8,[`content`]),a(D,{path:`/kling/videos`,body:n.modelValue?.request},null,8,[`body`]),a(O,{service:`kling`,"target-id":n.modelValue?.id,snapshot:{prompt:n.displayText}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(N,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,Ca,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.model`))+`: `+i(n.modelValue?.request?.model),1)]),e(`p`,wa,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,Ta,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.isFailure?(g(),s(`div`,Ea,[a(N,{closable:!1,class:`failure`},{template:p(()=>[a(ee,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,Da,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,Oa,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(j,{content:n.modelValue?.response?.error?.message},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,ka,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Aa,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),n.isWaiting?(g(),s(`div`,ja,[a(N,{closable:!1,class:`info`},{template:p(()=>[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(n.modelValue?.response?`kling.status.processing`:`kling.status.pending`)),1)]),default:p(()=>[e(`p`,Ma,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.response?.trace_id?(g(),s(`p`,Na,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var Fa=v({name:`RecentPanel`,components:{TaskPreview:L(ca,[[`render`,Pa],[`__scopeId`,`data-v-73637147`]]),NoTasks:re,BotPlaceholder:Be,ScrollList:ne},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?.()}}}),Ia={key:0},La={key:2,class:`w-full h-full flex items-center justify-center`};function Ra(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`,Ia,[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`,La,[a(v)])):o(``,!0)],64)}var za=v({name:`KlingIndex`,components:{ConfigPanel:jr,MotionPanel:Ai,TalkingPhotoPanel:sa,TabSwitcher:Fi,Layout:Ze,RecentPanel:L(Fa,[[`render`,Ra]]),ShowcaseResultTabs:He},mixins:[Te,Ue(`kling`),Ve(`kling`)],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===E.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===E.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},walletMode(){return this.taskType!==`motion`&&B()&&Y(`kling`).mode===`wallet`}},watch:{taskType:{handler(e){ye(`kling`,e!==`motion`)},immediate:!0},walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`kling/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},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.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ae({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,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(){let e=ge(this.config),t=We(`kling`,e);if(t){D.error(this.$t(`common.message.${t}`));return}if(!G(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let n=Number(!!e.start_image_url)+Number(!!e.end_image_url),r=e.image_list?.length||0,i=e.video_list?.length?4:7;if(n+r>i){D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:i}));return}if(e.video_list?.[0]?.refer_type===`base`&&(e.start_image_url||e.end_image_url||e.image_list?.some(({type:e})=>e))){D.warning(this.$t(`kling.message.baseVideoFrameConflict`));return}if(!e.video_id&&!e.video_url&&!e.start_image_url&&e.end_image_url){D.warning(this.$t(`kling.message.endImageRequiresStart`));return}let a=this.createPaymentOperation(t=>H.generate(e,t));a&&(D.info(this.$t(`kling.message.startingTask`)),ve(`kling`,a).then(e=>{this.recordWalletTask(e),D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>this.handleGenerationError(e)).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)}))},createPaymentOperation(e){if(!this.walletMode){if(!be())return;let t=this.credential?.token;return t?e({token:t}):void 0}let t=this.getWalletContext();if(!t){D.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}return e({mode:`x402`,x402:{wallet:t,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})},recordWalletTask(e){let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t)},handleGenerationError(e){e instanceof Ce||_e(e,`kling`)||(this.walletMode?D.error(this.$t(`common.x402Scenario.paymentFailed`)):D.error(this.$t(`kling.message.startTaskFailed`)))},getWalletContext(){return xe(this.$wallet)},async confirmWalletPayment(e){return V.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},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(!G(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let e=this.motionConfig||{};if(!e.image_url||!e.video_url){D.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(!be())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}D.info(this.$t(`kling.message.startingTask`)),ve(`kling`,H.motion(t,{token:n})).then(()=>{D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{_e(e,`kling`)||D.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},async onGenerateTalkingPhoto(){if(!G(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let e=this.talkingPhotoConfig||{};if(!e.image_url||!e.audio_url){D.warning(this.$t(`kling.message.talkingPhotoMissingInputs`));return}let t=ke(e),n=this.createPaymentOperation(e=>H.talkingPhoto(t,e));n&&(D.info(this.$t(`kling.message.startingTask`)),ve(`kling`,n).then(e=>{this.recordWalletTask(e),D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>this.handleGenerationError(e)).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)}))}}}),Ba={class:`flex flex-col h-full`},Va={class:`flex-1 min-h-0`};function Ha(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(`showcase-result-tabs`),y=l(`layout`);return g(),f(y,null,{config:p(()=>[e(`div`,Ba,[a(u,{"model-value":t.taskType,"onUpdate:modelValue":t.onTabChange},null,8,[`model-value`,`onUpdate:modelValue`]),e(`div`,Va,[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(v,{service:`kling`},{tasks:p(()=>[a(_,{ref:`recentPanel`,loading:t.loadingMore,onReachTop:t.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})]),_:1})}var Ua=L(za,[[`render`,Ha]]);export{Ua 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-BtCyr5wB.js";import{n as x,t as S}from"./tabs-mGC1bMGE.js";import{t as C}from"./upload-CQXERPyi.js";import{t as w}from"./tooltip-DW5LR73p.js";import{t as T}from"./alert-BprQRUmf.js";import{h as E,v as D}from"./models-D7oFDNXC.js";import{n as O,r as k}from"./radio-BNhFzeBO.js";import{t as A}from"./drawer-CC8UgYnL.js";import{t as j}from"./input-number-D7868Ezn.js";import{t as M}from"./slider-CLYvyYfm.js";import{t as N}from"./switch-Cp97YOoB.js";import{t as ee}from"./clock-DA9WgC6k.js";import{a as P,i as te,n as ne,r as re,s as ie,t as ae}from"./pagination-CaWpt6wz.js";import{t as oe}from"./headphones-DrrNBtEc.js";import{t as se}from"./info-B2JKZb31.js";import{t as ce}from"./lightbulb-2NqBb6Jr.js";import{t as le}from"./trash-2-Dsd2VwfS.js";import{t as ue}from"./triangle-alert-DlyIYMuG.js";import{t as F}from"./upload-B7ks3vsv.js";import{t as I}from"./wand-sparkles-DevqpoZK.js";import{Mi as de,Ni as fe,Oi as pe,ji as me}from"./constants-CIlRvdtN.js";import{$a as he,A as L,Br as ge,Cn as R,La as z,Li as B,O as _e,Qi as ve,Va as V,Vi as ye,Vr as H,aa as be,at as U,ct as W,di as xe,et as Se,it as G,li as Ce,lo as K,nt as we,ot as Te,rt as Ee,st as q,to as J,tt as De,za as Oe,zi as Y,zr as ke}from"./index-DaMzkL_Z.js";import{t as Ae}from"./CopyToClipboard-0lUT8Wjm.js";import{t as je}from"./ReportButton-Buh2UYVP.js";import{t as Me}from"./FilePreview-CcYI_Ioz.js";import{t as X}from"./ImagePreview-Ct3FnzAf.js";import{n as Ne}from"./taskDrawerMixin-DyAUhFEq.js";import{t as Pe}from"./ServicePricingSummary-CnbM4r4S.js";import{t as Fe}from"./AudioPreview-BJhkF5pn.js";import{t as Ie}from"./VideoPlayer-BacT8jS7.js";import{t as Le}from"./VideoPreview-CdskjP0J.js";import{t as Re}from"./ScenarioPaymentMode-6HeW391z.js";import{t as ze}from"./ApiCodeButton-CueSlSNp.js";import{t as Be}from"./BotPlaceholder-BNNaxOmO.js";import{t as Ve}from"./taskPollingMixin-CcLxtz8z.js";import{t as He}from"./ShowcaseResultTabs-BfyGy_mN.js";import{t as Ue}from"./showcaseRecreateMixin-xVJ-0HiH.js";import{n as We,t as Ge}from"./generationInput-D3ZEKlr_.js";var Ke=v({name:`LayoutKling`,components:{MagicIcon:I,ElDrawer:A,ElButton:J},mixins:[Ne]}),qe={class:`main flex flex-row flex-1 min-h-0`},Je={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)]`},Ye={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Xe(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,qe,[e(`div`,Je,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Ye,[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 Ze=L(Ke,[[`render`,Xe],[`__scopeId`,`data-v-f4b791b5`]]),Qe={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 Qe}}var Q=`<<<video_1>>>`,$e=/<<<image_\d+>>>/g;function et(e){return e?e.split(Q).join(` `).replace(/\s{2,}/g,` `).trim():``}function tt(e){return e?e.replace($e,` `).replace(/\s{2,}/g,` `).trim():``}function nt(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 rt(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=et(n.prompt)),e.field===`image_list`&&(n.image_list=void 0,n.prompt=tt(n.prompt));return n}var it=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(pe)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=nt(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await V.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=rt({...t,model:e},n);this.$store.commit(`kling/setConfig`,i),D.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})}}}),at={class:`field`},ot={class:`title font-bold`};function st(t,n,r,a,o,u){let d=l(`el-option`),m=l(`el-select`);return g(),s(`div`,at,[e(`h2`,ot,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 ct=L(it,[[`render`,st],[`__scopeId`,`data-v-a74e7f31`]]),lt=v({name:`ModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},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 fe.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=nt(t,{mode:e});if(n.length===0){this.applyMode(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await V.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=rt({...t,mode:e},n);this.$store.commit(`kling/setConfig`,i),D.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})}}}),ut={class:`field`},dt={class:`header`},ft={class:`title font-bold`},pt={key:0,class:`opt-tip`};function mt(t,r,u,d,m,_){let v=l(`info-icon`),y=l(`el-option`),b=l(`el-select`);return g(),s(`div`,ut,[e(`div`,dt,[e(`h2`,ft,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`,pt,i(t.disabledReason),1)):o(``,!0)]),_:2},1032,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var ht=L(lt,[[`render`,mt],[`__scopeId`,`data-v-9a8fa3c5`]]),gt=[3,5,8,10,12,15],_t=[5,10],vt=[5],yt=v({name:`DurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},isV3Model(){return fe.includes(this.selectedModel)},allowedDurations(){return this.selectedModel===`kling-o1`?vt:this.isV3Model?gt:_t},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=nt(t,{duration:e});if(n.length===0){this.applyDuration(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await V.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=rt({...t,duration:e},n);this.$store.commit(`kling/setConfig`,i),D.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})}}}),bt={class:`field`},xt={class:`control`},St={class:`label`},Ct={class:`title font-bold`};function wt(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,bt,[e(`div`,xt,[e(`div`,St,[e(`h2`,Ct,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 Tt=L(yt,[[`render`,wt],[`__scopeId`,`data-v-496bf31c`]]),Et=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`}}),Dt={class:`text-sm font-bold mb-2 block`},Ot={class:`items`},kt=[`onClick`],At={class:`name`};function jt(t,r,a,o,l,u){return g(),s(`div`,null,[e(`span`,Dt,i(t.$t(`kling.name.ratio`)),1),e(`div`,Ot,[(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`,At,i(r.label),1)],10,kt))),128))])])}var Mt=L(Et,[[`render`,jt],[`__scopeId`,`data-v-cdb14b2f`]]),Nt=v({name:`StartImage`,components:{UploadIcon:F,ElUpload:C,ElButton:J,ElTooltip:w,InfoIcon:P,ImagePreview:X},mixins:[W,q,U],emits:[`change`],data(){return{fileList:[],uploadUrl:z()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},value:{get(){return this.$store.state?.kling?.config?.start_image_url},set(){}}},watch:{value(e){!e&&this.fileList.length>0&&(this.fileList=[])}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.error(this.$t(`kling.message.uploadReferencesError`))},onBeforeUpload(){let e=this.$store.state.kling?.config||{};if(e.video_list?.[0]?.refer_type===`base`)return D.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?(D.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`},Ft={class:`flex min-h-8 items-center pr-20`},It={class:`flex justify-start items-center`},Lt={class:`text-sm font-bold`};function Rt(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`,Ft,[e(`div`,It,[e(`span`,Lt,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 zt=L(Nt,[[`render`,Rt],[`__scopeId`,`data-v-60844ac3`]]),Bt=v({name:`EndImage`,components:{UploadIcon:F,ElUpload:C,ElButton:J,ElTooltip:w,ImagePreview:X,InfoIcon:P},mixins:[W,q,U],data(){return{fileList:[],uploadUrl:z()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},klingConfig(){return this.$store.state?.kling?.config||{}},endImageSupported(){return 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 D.warning(this.$t(`kling.message.endImageNotSupported`)),!1;if(!this.hasStartImage)return D.warning(this.$t(`kling.message.endImageRequiresStart`)),!1;if(this.klingConfig.video_list?.[0]?.refer_type===`base`)return D.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?(D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:e})),!1):!0},onExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.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()}}}),Vt={class:`relative`},Ht={class:`flex min-h-8 items-center pr-20`},Ut={class:`flex justify-start items-center`},Wt={class:`text-sm font-bold`};function Gt(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`,Vt,[e(`div`,Ht,[e(`div`,Ut,[e(`span`,Wt,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 Kt=L(Bt,[[`render`,Gt],[`__scopeId`,`data-v-b286c4d0`]]),qt=v({name:`ReferenceVideo`,components:{ElUpload:C,ElButton:J,ElRadioButton:O,ElRadioGroup:k,ElSwitch:N,InfoIcon:P,FilePreview:Me,UploadIcon:F},mixins:[q,U],data(){return{fileList:[],uploadUrl:z()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},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(){D.warning(this.$t(`kling.message.referenceVideoExceed`))},onError(){D.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 D.error(this.$t(`kling.message.referenceVideoImageLimit`)),!1;let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=Ee(e.size);return t?n?!0:(D.error(this.$t(`kling.message.referenceVideoSizeExceed`,{max:we(De)})),!1):(D.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=et(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()}}}),Jt={class:`relative`},Yt={class:`flex min-h-8 items-center pr-20`},Xt={class:`flex justify-start items-center`},Zt={class:`text-sm font-bold`},Qt={key:0,class:`reference-options mt-3 flex flex-col gap-3`},$t={class:`flex flex-col items-stretch gap-2 sm:flex-row sm:items-center sm:justify-between`},en={class:`text-sm`},tn={class:`flex items-center justify-between gap-3`},nn={class:`text-sm`};function rn(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`,Jt,[e(`div`,Yt,[e(`div`,Xt,[e(`span`,Zt,i(t.$t(`kling.name.referenceVideo`)),1),a(h,{content:t.$t(`kling.description.omniReferenceVideo`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"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`,Qt,[e(`div`,$t,[e(`span`,en,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`,tn,[e(`span`,nn,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 an=L(qt,[[`render`,rn],[`__scopeId`,`data-v-e3a9dfab`]]),on=v({name:`KlingReferenceImages`,components:{ElButton:J,ElUpload:C,UploadIcon:F,ImagePreview:X,InfoIcon:P},mixins:[W,q,U],data(){return{fileList:[],uploadUrl:z()+`/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(){D.warning(this.$t(`kling.message.referenceImagesExceed`,{count:this.remainingSlots}))},onError(){D.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=[tt(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()}}}),sn={class:`relative`},cn={class:`flex justify-between items-center`},ln={class:`flex justify-start items-center`},un={class:`text-sm font-bold`},dn={key:0,class:`file-list flex flex-wrap gap-2 mt-2`};function fn(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`,sn,[e(`div`,cn,[e(`div`,ln,[e(`span`,un,i(t.$t(`kling.name.referenceImages`)),1),a(v,{content:t.$t(`kling.description.referenceImages`)},null,8,[`content`])]),a(x,{ref:`uploader`,"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`,dn,[(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 pn=L(on,[[`render`,fn]]),mn=v({name:`CfgScaleSelector`,components:{ElSlider:M,InfoIcon:P,ElInputNumber:j},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}}),hn={class:`flex justify-between`},gn={class:`flex justify-start items-center`},_n={class:`text-sm font-bold`},vn={class:`flex justify-end items-center`},yn={class:`w-full`};function bn(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`,hn,[e(`div`,gn,[e(`span`,_n,i(t.$t(`kling.name.cfgScale`)),1),a(d,{content:t.$t(`kling.description.cfgScale`)},null,8,[`content`])]),e(`div`,vn,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,yn,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:0,max:1,step:.1},null,8,[`modelValue`])])])}var xn=L(mn,[[`render`,bn]]),Sn=v({name:`GenerateAudioSelector`,components:{ElSwitch:N,InfoIcon:P},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},selectedMode(){return this.$store.state.kling?.config?.mode||``},supported(){return!!(fe.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})}}}),Cn={class:`relative`},wn={class:`flex justify-between items-center`},Tn={class:`flex justify-start items-center`},En={class:`text-sm font-bold`};function Dn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,Cn,[e(`div`,wn,[e(`div`,Tn,[e(`span`,En,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 On=L(Sn,[[`render`,Dn]]),kn=[`horizontal`,`vertical`,`pan`,`tilt`,`roll`,`zoom`],An=v({name:`CameraControlSelector`,components:{ElSelect:y,ElOption:b,ElSlider:M,ElInputNumber:j,InfoIcon:P},data(){return{configKeys:kn}},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)}}}),jn={class:`field`},Mn={class:`header`},Nn={class:`text-sm font-bold`},Pn={key:0,class:`config-grid`},Fn={class:`cfg-row-head`},In={class:`cfg-name`};function Ln(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`,jn,[e(`div`,Mn,[e(`span`,Nn,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`,Fn,[e(`span`,In,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 Rn=L(An,[[`render`,Ln],[`__scopeId`,`data-v-cd896060`]]),zn=[{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 Bn(e,t){let n=(e||``).trim();return n?n.includes(t)?n:`${n}${$}${t}`:t}function Vn(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 Hn=v({name:`InspirationPills`,components:{CloseIcon:Oe},computed:{prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return zn.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=Vn(this.prompt,e);this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:t})}}}),Un={key:0,class:`pills`,role:`list`},Wn={class:`pill-text`},Gn=[`aria-label`,`title`,`onClick`];function Kn(n,r,u,d,f,p){let m=l(`close-icon`);return n.selected.length>0?(g(),s(`div`,Un,[(g(!0),s(c,null,h(n.selected,r=>(g(),s(`div`,{key:r,class:`pill`,role:`listitem`},[e(`span`,Wn,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,Gn)]))),128))])):o(``,!0)}var qn=v({name:`PromptInput`,components:{IdeaIcon:ce,ElButton:J,PromptTextarea:te,InspirationPills:L(Hn,[[`render`,Kn],[`__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 Jn(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 Yn=L(qn,[[`render`,Jn],[`__scopeId`,`data-v-5754ae54`]]),Xn=v({name:`NegativePromptInput`,components:{ElInput:K,InfoIcon:P},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||=``}}),Zn={class:`field`},Qn={class:`box`},$n={class:`title font-bold`};function er(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,Zn,[e(`div`,Qn,[e(`h2`,$n,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 tr=L(Xn,[[`render`,er],[`__scopeId`,`data-v-de98cf01`]]),nr=v({name:`InspirationDrawer`,components:{Close:Oe,IdeaIcon:ce,ElDrawer:A,ElButton:J},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`],data(){return{groups:zn}},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(Vn(this.prompt,e)):this.setPrompt(Bn(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(let t of this.allChipTexts)for(;e.includes(t);)e=Vn(e,t);this.setPrompt(e)}}}),rr={class:`drawer-content`},ir={class:`drawer-header`},ar={class:`title-row`},or={class:`title`},sr={class:`hint`},cr={key:0,class:`selected-bar`},lr={class:`selected-text`},ur={class:`groups`},dr={class:`group-title`},fr={class:`chip-grid`},pr=[`onClick`];function mr(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`,rr,[e(`div`,ir,[e(`div`,ar,[a(y,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,or,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`,sr,i(t.$t(`kling.inspiration.hint`)),1),t.selectedCount>0?(g(),s(`div`,cr,[e(`span`,lr,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`,ur,[(g(!0),s(c,null,h(t.groups,r=>(g(),s(`div`,{key:r.groupKey,class:`group`},[e(`div`,dr,i(t.$t(`kling.inspiration.group.${r.groupKey}`)),1),e(`div`,fr,[(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,pr))),128))])]))),128))])])]),_:1},8,[`modelValue`,`size`])}var hr=L(nr,[[`render`,mr],[`__scopeId`,`data-v-8b2e6a5d`]]),gr={"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`},_r={std:`720p`,pro:`1080p`,"4k":`4K`},vr=v({name:`SummaryChip`,components:{AudioIcon:oe},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){let e=this.config?.model||`kling-v2-5-turbo`;return gr[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||``},modeLabel(){let e=this.config?.mode||`std`;return _r[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),yr={class:`summary-chip`},br=[`title`],xr=[`title`],Sr=[`title`],Cr=[`title`],wr=[`title`];function Tr(t,n,r,c,u,d){let f=l(`audio-icon`);return g(),s(`div`,yr,[e(`span`,{class:`part`,title:t.$t(`kling.name.model`)},i(t.modelLabel),9,br),n[0]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.duration`)},i(t.durationLabel),9,xr),n[1]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.ratio`)},i(t.aspectRatio||`16:9`),9,Sr),n[2]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.mode`)},i(t.modeLabel),9,Cr),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,wr)):o(``,!0)])}var Er=v({name:`ConfigPanel`,components:{MagicIcon:I,ElButton:J,ServicePricingSummary:Pe,PromptInput:Yn,NegativePromptInput:tr,ModelSelector:ct,ModeSelector:ht,DurationSelector:Tt,RatioSelector:Mt,StartImage:zt,CfgScaleSelector:xn,GenerateAudioSelector:On,CameraControlSelector:Rn,InspirationDrawer:hr,SummaryChip:L(vr,[[`render`,Tr],[`__scopeId`,`data-v-c800852a`]]),EndImage:Kt,ReferenceImages:pn,ReferenceVideo:an,ScenarioPaymentMode:Re},emits:[`generate`],data(){return{inspirationOpen:!1,quoteTimer:0,quoteRunId:0}},computed:{canGenerate(){return Ge(`kling`,ge(this.config))},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 R(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service},walletMode(){return B()&&Y(`kling`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=Y(`kling`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,350))},async refreshQuote(){if(!this.canGenerate)return;let e=Y(`kling`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await H.quote(ge(this.config));t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)}}}),Dr={class:`flex flex-col h-full`},Or={class:`flex-1 overflow-y-auto p-5`},kr={class:`flex flex-col items-center justify-center px-5 pb-5`};function Ar(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(`scenario-payment-mode`),j=l(`service-pricing-summary`),M=l(`magic-icon`),N=l(`el-button`),ee=l(`inspiration-drawer`);return g(),s(`div`,Dr,[e(`div`,Or,[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`,kr,[a(k),a(A,{scenario:`kling`}),t.walletMode?o(``,!0):(g(),f(j,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),t.config?.video_url!==void 0||t.config?.custom?(g(),f(N,{key:1,type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(M,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.extend`)),1)]),_:1},8,[`disabled`,`onClick`])):(g(),f(N,{key:2,type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(M,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`]))]),a(ee,{modelValue:t.inspirationOpen,"onUpdate:modelValue":n[1]||=e=>t.inspirationOpen=e},null,8,[`modelValue`])])}var jr=L(Er,[[`render`,Ar]]),Mr=v({name:`MotionImage`,components:{UploadIcon:F,ElUpload:C,ElButton:J,InfoIcon:P,ImagePreview:X},mixins:[W,q,U,Se],data(){return{fileList:[],uploadUrl:z()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetImageUrl()},methods:{onExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.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()}}}),Nr={class:`relative`},Pr={class:`flex justify-between`},Fr={class:`flex justify-start items-center`},Ir={class:`text-sm font-bold`};function Lr(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`,Nr,[e(`div`,Pr,[e(`div`,Fr,[e(`span`,Ir,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,"before-upload":t.beforeUploadSizeGuard,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`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Rr=L(Mr,[[`render`,Lr],[`__scopeId`,`data-v-4a95ef2c`]]),zr=v({name:`MotionVideo`,components:{UploadIcon:F,ElUpload:C,ElButton:J,InfoIcon:P,FilePreview:Me},mixins:[q,U],data(){return{fileList:[],uploadUrl:z()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetVideoUrl()},methods:{onExceed(){D.warning(this.$t(`kling.message.uploadVideoExceed`))},onError(){D.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:(D.error(this.$t(`kling.message.uploadVideoSizeExceed`)),!1):(D.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()}}}),Br={class:`relative`},Vr={class:`flex justify-between`},Hr={class:`flex justify-start items-center`},Ur={class:`text-sm font-bold`};function Wr(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`,Br,[e(`div`,Vr,[e(`div`,Hr,[e(`span`,Ur,i(t.$t(`kling.name.motionVideo`)),1),a(h,{content:t.$t(`kling.description.motionVideo`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"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 Gr=L(zr,[[`render`,Wr],[`__scopeId`,`data-v-630c4521`]]),Kr=v({name:`MotionPromptInput`,components:{ElInput:K,InfoIcon:P},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||``},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),qr={class:`field`},Jr={class:`box`},Yr={class:`title font-bold`};function Xr(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,qr,[e(`div`,Jr,[e(`h2`,Yr,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 Zr=L(Kr,[[`render`,Xr],[`__scopeId`,`data-v-ca9fdbe5`]]),Qr=`video`,$r=v({name:`CharacterOrientationSelector`,components:{ElRadioGroup:k,ElRadioButton:O,InfoIcon:P},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||Qr},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=Qr)}}),ei={class:`field`},ti={class:`header`},ni={class:`text-sm font-bold`};function ri(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`,ei,[e(`div`,ti,[e(`span`,ni,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 ii=L($r,[[`render`,ri],[`__scopeId`,`data-v-7a91195b`]]),ai=`kling-v2-6`,oi=v({name:`MotionModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},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||ai},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=ai)}}),si={class:`field`},ci={class:`header`},li={class:`title font-bold`};function ui(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,si,[e(`div`,ci,[e(`h2`,li,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 di=L(oi,[[`render`,ui],[`__scopeId`,`data-v-480e8da2`]]),fi=`std`,pi=v({name:`MotionModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:P},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||fi},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=fi)}}),mi={class:`field`},hi={class:`header`},gi={class:`title font-bold`};function _i(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,mi,[e(`div`,hi,[e(`h2`,gi,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 vi=L(pi,[[`render`,_i],[`__scopeId`,`data-v-1295688c`]]),yi=v({name:`KeepOriginalSoundSelector`,components:{ElSwitch:N,InfoIcon:P},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`})}}}}),bi={class:`relative`},xi={class:`flex justify-between items-center`},Si={class:`flex justify-start items-center`},Ci={class:`text-sm font-bold`};function wi(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,bi,[e(`div`,xi,[e(`div`,Si,[e(`span`,Ci,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 Ti=v({name:`MotionPanel`,components:{MagicIcon:I,ElButton:J,ServicePricingSummary:Pe,MotionImage:Rr,MotionVideo:Gr,MotionPromptInput:Zr,CharacterOrientationSelector:ii,MotionModelSelector:di,MotionModeSelector:vi,KeepOriginalSoundSelector:L(yi,[[`render`,wi]])},emits:[`generate`],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return R({...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`)}}}),Ei={class:`flex flex-col h-full`},Di={class:`flex-1 overflow-y-auto p-5`},Oi={class:`flex flex-col items-center justify-center px-5 pb-5`};function ki(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(`service-pricing-summary`),S=l(`magic-icon`),C=l(`el-button`);return g(),s(`div`,Ei,[e(`div`,Di,[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`,Oi,[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 Ai=L(Ti,[[`render`,ki]]),ji=v({name:`KlingTabSwitcher`,components:{ElTabs:x,ElTabPane:S,ElTag:he},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)}}}),Mi=[`title`],Ni={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`,"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`,Ni,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,Mi)]),_:2},1032,[`name`,`disabled`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var Fi=L(ji,[[`render`,Pi],[`__scopeId`,`data-v-e6a2bb26`]]),Ii={"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`},Li=v({name:`TalkingPhotoModelSelector`,components:{ElSelect:y,ElOption:b},data(){return{options:de.map(e=>({value:e,label:Ii[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=me)}}),Ri={class:`field`},zi={class:`title font-bold`};function Bi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Ri,[e(`h2`,zi,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 Vi=L(Li,[[`render`,Bi],[`__scopeId`,`data-v-cbc83d11`]]),Hi=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`)}}),Ui={class:`field`},Wi={class:`title font-bold`};function Gi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Ui,[e(`h2`,Wi,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 Ki=v({name:`TalkingPhotoPanel`,components:{MagicIcon:I,UploadIcon:F,ElUpload:C,ElButton:J,ElInput:K,ServicePricingSummary:Pe,InfoIcon:P,ImagePreview:X,ModelSelector:Vi,ModeSelector:L(Hi,[[`render`,Gi],[`__scopeId`,`data-v-92525a1d`]]),ScenarioPaymentMode:Re},mixins:[U,Se],emits:[`generate`],data(){return{imageFiles:[],audioFiles:[],uploadUrl:z()+`/api/v1/files/`,quoteTimer:0,quoteRunId:0}},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 R({...this.config,action:`talking-photo`},this.service?.cost)},canGenerate(){return!!(this.config.image_url&&this.config.audio_url)},walletMode(){return B()&&Y(`kling`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteTimer=window.setTimeout(this.refreshQuote,350)},async refreshQuote(){let e=Y(`kling`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await H.quoteTalkingPhoto(ke(this.config));t===this.quoteRunId&&e.mode===`wallet`&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},commit(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.config,...e})},onPromptChange(e){this.commit({prompt:e})},onImageExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onImageError(){D.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(){D.warning(this.$t(`kling.message.uploadAudioExceed`))},onAudioError(){D.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`)}}}),qi={class:`flex flex-col h-full`},Ji={class:`flex-1 overflow-y-auto p-5`},Yi={class:`relative mb-4`},Xi={class:`flex justify-start items-center`},Zi={class:`text-sm font-bold`},Qi={class:`relative mb-4`},$i={class:`flex justify-start items-center`},ea={class:`text-sm font-bold`},ta=[`src`],na={class:`mb-4`},ra={class:`flex justify-start items-center`},ia={class:`text-sm font-bold`},aa={class:`flex flex-col items-center justify-center px-5 pb-5`};function oa(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(`scenario-payment-mode`),T=l(`service-pricing-summary`),E=l(`magic-icon`);return g(),s(`div`,qi,[e(`div`,Ji,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),e(`div`,Yi,[e(`div`,Xi,[e(`span`,Zi,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,"before-upload":t.beforeUploadSizeGuard,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`,`before-upload`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`])]),e(`div`,Qi,[e(`div`,$i,[e(`span`,ea,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,"before-upload":t.beforeUploadSizeGuard,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`,`before-upload`,`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,ta)):o(``,!0)]),e(`div`,na,[e(`div`,ra,[e(`span`,ia,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`,aa,[a(w,{scenario:`kling`}),t.walletMode?o(``,!0):(g(),f(T,{key:0,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(E,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generateTalkingPhoto`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var sa=L(Ki,[[`render`,oa],[`__scopeId`,`data-v-46191f92`]]),ca=v({name:`TaskPreview`,components:{DeleteIcon:le,ChannelIcon:ie,InfoIcon:se,MagicIcon:I,TimeIcon:ee,WarningIcon:ue,CopyToClipboard:Ae,ElAlert:T,VideoPlayer:Ie,ElTooltip:w,ElButton:J,ImagePreview:X,VideoPreview:Le,AudioPreview:Fe,ApiCodeButton:ze,ReportButton:je},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},displayText(){return this.modelValue?.request?.prompt?.trim()||this.modelValue?.request?.text?.trim()||``},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:{async onDelete(){let e=this.modelValue?.id;if(e){try{await V.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`kling/deleteTask`,{id:e}),D.success(this.$t(`common.message.deleteTaskSuccess`))}catch{D.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),la={class:`preview`},ua={class:`left`},da={class:`main`},fa={class:`bot`},pa={class:`datetime`},ma=[`aria-label`],ha={key:0,class:`info`},ga={key:0,class:`request-media flex justify-start items-center gap-2 w-full overflow-x-auto`},_a={key:1,class:`prompt`},va={key:0},ya={key:1},ba={key:1,class:n({content:!0,failed:!0})},xa={key:0,class:`mb-4`},Sa={key:1,class:n({operations:!0,"mt-2":!0})},Ca={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},wa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ta={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Ea={key:2,class:n({content:!0})},Da={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Oa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ka={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Aa={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ja={key:3,class:n({content:!0})},Ma={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Na={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Pa(n,u,d,m,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`image-preview`),C=l(`video-preview`),w=l(`audio-preview`),T=l(`video-player`),E=l(`el-button`),D=l(`api-code-button`),O=l(`report-button`),k=l(`channel-icon`),A=l(`magic-icon`),j=l(`copy-to-clipboard`),M=l(`time-icon`),N=l(`el-alert`),ee=l(`warning-icon`),P=l(`info-icon`);return g(),s(`div`,la,[e(`div`,ua,[a(y,{capability:`kling`,part:`avatar`,class:`avatar`})]),e(`div`,da,[e(`div`,fa,[a(y,{capability:`kling`,part:`name`}),e(`span`,pa,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(x,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(g(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:u[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,ma)):o(``,!0)]),_:1},8,[`content`])]),n.referenceImages.length>0||n.referenceVideos.length>0||n.referenceAudios.length>0||n.displayText?(g(),s(`div`,ha,[n.referenceImages.length>0||n.referenceVideos.length>0||n.referenceAudios.length>0?(g(),s(`div`,ga,[(g(!0),s(c,null,h(n.referenceImages,(e,t)=>(g(),f(S,{key:`image-${t}`,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceVideos,(e,t)=>(g(),f(C,{key:`video-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceAudios,(e,t)=>(g(),f(w,{key:`audio-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128))])):o(``,!0),n.displayText?(g(),s(`p`,_a,[r(i(n.displayText)+` `,1),n.modelValue?.response?n.isWaiting?(g(),s(`span`,ya,` - (`+i(n.$t(`kling.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,va,` - (`+i(n.$t(`kling.status.pending`))+`) `,1))])):o(``,!0)])):o(``,!0),n.modelValue?.response?.success===!0&&!n.isFailure?(g(),s(`div`,ba,[n.modelValue?.response.video_url?(g(),s(`div`,xa,[a(T,{src:n.modelValue?.response.video_url},null,8,[`src`])])):o(``,!0),n.modelValue?.response.success?(g(),s(`div`,Sa,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`kling.message.downloadVideo`),placement:`top-start`},{default:p(()=>[n.modelValue?.response.video_url?(g(),f(E,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:u[1]||=e=>n.onDownload(e,n.modelValue?.response.video_url)},{default:p(()=>[r(i(n.$t(`kling.button.download`)),1)]),_:1})):o(``,!0)]),_:1},8,[`content`]),a(D,{path:`/kling/videos`,body:n.modelValue?.request},null,8,[`body`]),a(O,{service:`kling`,"target-id":n.modelValue?.id,snapshot:{prompt:n.displayText}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(N,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,Ca,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.model`))+`: `+i(n.modelValue?.request?.model),1)]),e(`p`,wa,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,Ta,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.isFailure?(g(),s(`div`,Ea,[a(N,{closable:!1,class:`failure`},{template:p(()=>[a(ee,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,Da,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,Oa,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(j,{content:n.modelValue?.response?.error?.message},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,ka,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Aa,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),n.isWaiting?(g(),s(`div`,ja,[a(N,{closable:!1,class:`info`},{template:p(()=>[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(n.modelValue?.response?`kling.status.processing`:`kling.status.pending`)),1)]),default:p(()=>[e(`p`,Ma,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.response?.trace_id?(g(),s(`p`,Na,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var Fa=v({name:`RecentPanel`,components:{TaskPreview:L(ca,[[`render`,Pa],[`__scopeId`,`data-v-73637147`]]),NoTasks:re,BotPlaceholder:Be,ScrollList:ne},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?.()}}}),Ia={key:0},La={key:2,class:`w-full h-full flex items-center justify-center`};function Ra(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`,Ia,[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`,La,[a(v)])):o(``,!0)],64)}var za=v({name:`KlingIndex`,components:{ConfigPanel:jr,MotionPanel:Ai,TalkingPhotoPanel:sa,TabSwitcher:Fi,Layout:Ze,RecentPanel:L(Fa,[[`render`,Ra]]),ShowcaseResultTabs:He},mixins:[Te,Ue(`kling`),Ve(`kling`)],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===E.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===E.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},walletMode(){return this.taskType!==`motion`&&B()&&Y(`kling`).mode===`wallet`}},watch:{taskType:{handler(e){ye(`kling`,e!==`motion`)},immediate:!0},walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`kling/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},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.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ae({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,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(){let e=ge(this.config),t=We(`kling`,e);if(t){D.error(this.$t(`common.message.${t}`));return}if(!G(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let n=Number(!!e.start_image_url)+Number(!!e.end_image_url),r=e.image_list?.length||0,i=e.video_list?.length?4:7;if(n+r>i){D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:i}));return}if(e.video_list?.[0]?.refer_type===`base`&&(e.start_image_url||e.end_image_url||e.image_list?.some(({type:e})=>e))){D.warning(this.$t(`kling.message.baseVideoFrameConflict`));return}if(!e.video_id&&!e.video_url&&!e.start_image_url&&e.end_image_url){D.warning(this.$t(`kling.message.endImageRequiresStart`));return}let a=this.createPaymentOperation(t=>H.generate(e,t));a&&(D.info(this.$t(`kling.message.startingTask`)),ve(`kling`,a).then(e=>{this.recordWalletTask(e),D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>this.handleGenerationError(e)).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)}))},createPaymentOperation(e){if(!this.walletMode){if(!be())return;let t=this.credential?.token;return t?e({token:t}):void 0}let t=this.getWalletContext();if(!t){D.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}return e({mode:`x402`,x402:{wallet:t,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})},recordWalletTask(e){let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t)},handleGenerationError(e){e instanceof Ce||_e(e,`kling`)||(this.walletMode?D.error(this.$t(`common.x402Scenario.paymentFailed`)):D.error(this.$t(`kling.message.startTaskFailed`)))},getWalletContext(){return xe(this.$wallet)},async confirmWalletPayment(e){return V.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},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(!G(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let e=this.motionConfig||{};if(!e.image_url||!e.video_url){D.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(!be())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}D.info(this.$t(`kling.message.startingTask`)),ve(`kling`,H.motion(t,{token:n})).then(()=>{D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{_e(e,`kling`)||D.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},async onGenerateTalkingPhoto(){if(!G(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let e=this.talkingPhotoConfig||{};if(!e.image_url||!e.audio_url){D.warning(this.$t(`kling.message.talkingPhotoMissingInputs`));return}let t=ke(e),n=this.createPaymentOperation(e=>H.talkingPhoto(t,e));n&&(D.info(this.$t(`kling.message.startingTask`)),ve(`kling`,n).then(e=>{this.recordWalletTask(e),D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>this.handleGenerationError(e)).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)}))}}}),Ba={class:`flex flex-col h-full`},Va={class:`flex-1 min-h-0`};function Ha(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(`showcase-result-tabs`),y=l(`layout`);return g(),f(y,null,{config:p(()=>[e(`div`,Ba,[a(u,{"model-value":t.taskType,"onUpdate:modelValue":t.onTabChange},null,8,[`model-value`,`onUpdate:modelValue`]),e(`div`,Va,[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(v,{service:`kling`},{tasks:p(()=>[a(_,{ref:`recentPanel`,loading:t.loadingMore,onReachTop:t.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})]),_:1})}var Ua=L(za,[[`render`,Ha]]);export{Ua as default};