@acedatacloud/nexior 3.247.0 → 3.249.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ApiCodeButton-BxWrNlio.js → ApiCodeButton-DbBsqIvO.js} +1 -1
- package/dist/assets/{Auth-DBgApWcC.js → Auth-eIryMm0b.js} +1 -1
- package/dist/assets/{BotPlaceholder-DpiZEQow.js → BotPlaceholder-CurzhF4I.js} +1 -1
- package/dist/assets/{Callback-BEG7BeIC.js → Callback-DYg1TPrv.js} +1 -1
- package/dist/assets/{Console-BS1DHQK9.js → Console-DKkdQsH-.js} +1 -1
- package/dist/assets/{Consumption-B3cgN_uS.js → Consumption-C3jg3b7m.js} +1 -1
- package/dist/assets/{Conversation-HlTR345-.js → Conversation-DbmZ8sUn.js} +1 -1
- package/dist/assets/{CopyToClipboard-g4vBpWAA.js → CopyToClipboard-D8319xRo.js} +1 -1
- package/dist/assets/{Detail-6rh4qrUH.css → Detail-C39hIHXk.css} +1 -1
- package/dist/assets/Detail-C3FWzIRm.js +2 -0
- package/dist/assets/{Extra-BaFnbhmW.js → Extra-MJ9K-tYN.js} +1 -1
- package/dist/assets/{FilePreview-CgjWf7IZ.js → FilePreview-BQxO2UWY.js} +1 -1
- package/dist/assets/{Hailuo-BsGaxbRH.js → Hailuo-BFNi-hGz.js} +1 -1
- package/dist/assets/{History-C3WsQvhF.js → History-DejyoqrI.js} +1 -1
- package/dist/assets/{ImagePreview-D-9EFWby.js → ImagePreview-Dw054CSM.js} +1 -1
- package/dist/assets/{ImageWrapper-B3cbnI5h.js → ImageWrapper-Df56pj51.js} +1 -1
- package/dist/assets/{Index-As22PRJ8.js → Index-B6rgTQV-.js} +1 -1
- package/dist/assets/{Index-Bim8xkOC.js → Index-BAmCtzd0.js} +1 -1
- package/dist/assets/{Index-9lvutSUo.js → Index-BIQomM9E.js} +1 -1
- package/dist/assets/{Index-DRfc7-DW.js → Index-BUhGKA5K.js} +1 -1
- package/dist/assets/{Index-VmyhabIi.js → Index-BVQCcJ75.js} +1 -1
- package/dist/assets/{Index-DLIiVbGX.js → Index-C2bZZAN6.js} +1 -1
- package/dist/assets/{Index-Lg4tO5s-.js → Index-CRR7YiVD.js} +1 -1
- package/dist/assets/{Index-CiZpMegP.js → Index-CswRcEdF.js} +1 -1
- package/dist/assets/{Index-D9ONlvtJ.js → Index-D13zgBEW.js} +1 -1
- package/dist/assets/{Index-DxsapMg5.js → Index-D34elpAw.js} +1 -1
- package/dist/assets/{Index-PFxzES9c.js → Index-D5J7PnsD.js} +1 -1
- package/dist/assets/{Index-x4VIk-M0.js → Index-DBIFFElk.js} +1 -1
- package/dist/assets/{Index-pTthfWKC.js → Index-DFdGGK00.js} +1 -1
- package/dist/assets/{Index-BRvAWYnK.js → Index-DH1HTjOF.js} +1 -1
- package/dist/assets/{Index-G-eiLZof.js → Index-Dk4rSH5S.js} +1 -1
- package/dist/assets/{Index-aMnEeK_G.js → Index-Dn6Z7nST.js} +1 -1
- package/dist/assets/{Index-CGK17mp3.js → Index-O5e1Bivs.js} +1 -1
- package/dist/assets/{Index-wIVXmRng.js → Index-OkRHSwV1.js} +1 -1
- package/dist/assets/{Index-bYW9icdw.js → Index-ZqM4Tn1f.js} +1 -1
- package/dist/assets/{Index-oMr5qDpE.js → Index-c9Tg3C6I.js} +1 -1
- package/dist/assets/{Index-B7wx6DnV.js → Index-eXfv9Wbm.js} +1 -1
- package/dist/assets/{Index-BBsPsMNE.js → Index-fOuxXwWE.js} +1 -1
- package/dist/assets/{Index-DH5LlwfI.js → Index-grwysYt0.js} +1 -1
- package/dist/assets/{Index-CtEwAjzb.js → Index-maLCUqiN.js} +1 -1
- package/dist/assets/{Index-GfH7ORBW.js → Index-pCEVEtzZ.js} +1 -1
- package/dist/assets/{Invitees-DM2PtM2B.js → Invitees-B6QgR_N-.js} +1 -1
- package/dist/assets/{List-B9PWtOVg.js → List-BKbkP5dh.js} +1 -1
- package/dist/assets/{List-CFNRyup6.js → List-DQWMNNV5.js} +1 -1
- package/dist/assets/{List-BI2uISLt.js → List-DVZZxgmr.js} +1 -1
- package/dist/assets/{Main-DvCFH-w5.js → Main-DyJAcnTu.js} +1 -1
- package/dist/assets/{Model-BaFunQUx.js → Model-BDV5jpZM.js} +1 -1
- package/dist/assets/{Navigator-C90p8IJf.js → Navigator-DV6JjI7i.js} +1 -1
- package/dist/assets/{NoTasks-C9fjzpt-.js → NoTasks-D5RXiO5t.js} +1 -1
- package/dist/assets/{NotFound-D3DVTX79.js → NotFound-DsGUQyn2.js} +1 -1
- package/dist/assets/{Pagination-BS1m7SpE.js → Pagination-DlR9ZaBc.js} +1 -1
- package/dist/assets/{Player.vue_vue_type_script_setup_true_lang-VsHNDvNV.js → Player.vue_vue_type_script_setup_true_lang-Ca7X4w0l.js} +1 -1
- package/dist/assets/{Status-CUQyGBNT.js → Status-D5L_4PIo.js} +1 -1
- package/dist/assets/{Subscribe-DX33tT74.js → Subscribe-GhxRxhEb.js} +1 -1
- package/dist/assets/{TabSwitcher-2PjIQYYE.js → TabSwitcher-B8s_FoVg.js} +1 -1
- package/dist/assets/{Tts-R9wDfVRw.js → Tts-ByJ7vyc_.js} +1 -1
- package/dist/assets/{VideoPlayer-D2Gk8iOW.js → VideoPlayer-Bbn9KAtz.js} +1 -1
- package/dist/assets/{_Uint8Array-pk5G6DXb.js → _Uint8Array-CPbtsK4f.js} +1 -1
- package/dist/assets/{_baseClone-BEl0SBVQ.js → _baseClone-XRiJGh2W.js} +1 -1
- package/dist/assets/{_baseIteratee-DKwNed0n.js → _baseIteratee-DisFYsdP.js} +1 -1
- package/dist/assets/{_initCloneObject-7jYqtSMb.js → _initCloneObject-CugDqvBf.js} +1 -1
- package/dist/assets/{add-DTKL_ZFS.js → add-B6LijcBD.js} +1 -1
- package/dist/assets/{all-wallets-C5MLoAFb.js → all-wallets-BvwKirXz.js} +1 -1
- package/dist/assets/{app-store-DCQDZXe0.js → app-store-De9gMOz2.js} +1 -1
- package/dist/assets/{apple-C3iyqXrR.js → apple-2AT6uzpa.js} +1 -1
- package/dist/assets/{arrow-bottom-BMZap5Cj.js → arrow-bottom-CwsKnKQ3.js} +1 -1
- package/dist/assets/{arrow-bottom-circle-4MFN_8UE.js → arrow-bottom-circle-CNOsWgMd.js} +1 -1
- package/dist/assets/{arrow-left-Bm5c9N7C.js → arrow-left-BC5pEZUW.js} +1 -1
- package/dist/assets/{arrow-right-hZ9Tp0uq.js → arrow-right-CjFr-GEK.js} +1 -1
- package/dist/assets/{arrow-top-BuD5nEdS.js → arrow-top-Bc3R1Von.js} +1 -1
- package/dist/assets/{avatar-jh__YkZL.js → avatar-CVH_0g-o.js} +1 -1
- package/dist/assets/{bank-B4h9ar-t.js → bank-CZ3ADKc9.js} +1 -1
- package/dist/assets/{basic-DOcMcTjN.js → basic-COn3QV-i.js} +1 -1
- package/dist/assets/{browser-hlzvWCr4.js → browser-BaJN0Isi.js} +1 -1
- package/dist/assets/{byokCredential-Co3C1RWX.js → byokCredential-CkwICkBi.js} +1 -1
- package/dist/assets/{card-CsqKf5wo.js → card-tSOzScJw.js} +1 -1
- package/dist/assets/{castArray-tmh9kbwO.js → castArray-CJc4u1FY.js} +1 -1
- package/dist/assets/chat-B_HOcIld.js +1 -0
- package/dist/assets/chat-BmceIzis.js +1 -0
- package/dist/assets/chat-BmyGGxp8.js +1 -0
- package/dist/assets/chat-COZaceBe.js +1 -0
- package/dist/assets/chat-Cg7w1tLG.js +1 -0
- package/dist/assets/chat-Ch5QN39P.js +1 -0
- package/dist/assets/chat-CoVVUBUU.js +1 -0
- package/dist/assets/chat-Cwzia3WL.js +1 -0
- package/dist/assets/chat-D2g6mCbx.js +1 -0
- package/dist/assets/chat-D5y4o62r.js +1 -0
- package/dist/assets/chat-D9ufeoXV.js +1 -0
- package/dist/assets/chat-DIKm4lJF.js +1 -0
- package/dist/assets/chat-DJe220pZ.js +1 -0
- package/dist/assets/chat-DWx8DmVN.js +1 -0
- package/dist/assets/chat-Dg2XzkIa.js +1 -0
- package/dist/assets/chat-DytLYjfu.js +1 -0
- package/dist/assets/{chat-CpcSRbD2.js → chat-MbUQidaz.js} +1 -1
- package/dist/assets/chat-rKPL6Bq2.js +1 -0
- package/dist/assets/chat-t0vRxpFl.js +1 -0
- package/dist/assets/{checkmark-CzYmi1Yz.js → checkmark-C53Z2iHu.js} +1 -1
- package/dist/assets/{checkmark-bold-DPgXxVBu.js → checkmark-bold-C84STdsg.js} +1 -1
- package/dist/assets/{chevron-bottom-Cy--pI3I.js → chevron-bottom-BNAjAgvk.js} +1 -1
- package/dist/assets/{chevron-left-S6GJjIbX.js → chevron-left-DjBRN5ZV.js} +1 -1
- package/dist/assets/{chevron-right-dJvtWEQO.js → chevron-right-DvIJ1Yht.js} +1 -1
- package/dist/assets/{chevron-top-Cq9z70-e.js → chevron-top-CePuI6fA.js} +1 -1
- package/dist/assets/{chrome-store-zZ0uWv1q.js → chrome-store-rzutBFhX.js} +1 -1
- package/dist/assets/{clock-BnJfjms8.js → clock-DhuqPBbA.js} +1 -1
- package/dist/assets/{close-BVSkmDiZ.js → close-Cywqgt7J.js} +1 -1
- package/dist/assets/{coinPlaceholder-G8fFe1gL.js → coinPlaceholder-BCqLDMno.js} +1 -1
- package/dist/assets/{compass-DQbcnfzc.js → compass-DJ2YTOl_.js} +1 -1
- package/dist/assets/{copy-Cmh57Ey0.js → copy-BRBb0CZe.js} +1 -1
- package/dist/assets/{createTaskActions-P-2DmrOh.js → createTaskActions-Fe9rLKdc.js} +1 -1
- package/dist/assets/{cursor-DkvrzDna.js → cursor-DdxhqJs0.js} +1 -1
- package/dist/assets/{cursor-transparent-CNsg0hrQ.js → cursor-transparent-DA-xsjwH.js} +1 -1
- package/dist/assets/{debounce-DBeMKn11.js → debounce-Cix8aYnY.js} +1 -1
- package/dist/assets/{desktop-DYouJkvo.js → desktop-BkTwkckK.js} +1 -1
- package/dist/assets/{disconnect-pnM6foVl.js → disconnect-DVtktXJS.js} +1 -1
- package/dist/assets/{discord-CoWlEeWJ.js → discord-Dryj4IvG.js} +1 -1
- package/dist/assets/{distribution-CJcqbitH.js → distribution-Bn2NtDww.js} +1 -1
- package/dist/assets/{dropdown-CjQKMXq9.js → dropdown-BaCIY_hc.js} +1 -1
- package/dist/assets/{etherscan-Ctc0-KXt.js → etherscan-2dURw77t.js} +1 -1
- package/dist/assets/{exclamation-triangle-CLxSQi9H.js → exclamation-triangle-BE3cOw73.js} +1 -1
- package/dist/assets/{extension-3Ftw9iYz.js → extension-PBBiodic.js} +1 -1
- package/dist/assets/{external-link-DWzDSdHd.js → external-link-D7CmbrJZ.js} +1 -1
- package/dist/assets/{facebook-P_yhQXYh.js → facebook-Bjfk1BsH.js} +1 -1
- package/dist/assets/{farcaster-C6D-Y9Ja.js → farcaster-MEgZO9fU.js} +1 -1
- package/dist/assets/{filters-da1DF9Fp.js → filters-D4u5cv7h.js} +1 -1
- package/dist/assets/{github-IwtJuUZ4.js → github-D0hFNlO5.js} +1 -1
- package/dist/assets/{google-DjH6KSZW.js → google-D58B-3U3.js} +1 -1
- package/dist/assets/{help-circle-DLiOYVb2.js → help-circle-Bz87Zz8o.js} +1 -1
- package/dist/assets/{highlight-BIVpqebW.js → highlight-DRPB0jUE.js} +1 -1
- package/dist/assets/{id-B7sbtS1G.js → id-hdK5sydD.js} +1 -1
- package/dist/assets/{image-0AU68zRr.js → image-BBDZhMu1.js} +1 -1
- package/dist/assets/{index-ukLW3UKB.js → index-4sGswbzA.js} +1 -1
- package/dist/assets/{index-dItq9AaI.js → index-99I3SCyr.js} +1 -1
- package/dist/assets/{index-BwIwFxoe.js → index-9N7ZEIpV.js} +1 -1
- package/dist/assets/{index-CCwWrfc4.js → index-B7TkhThA.js} +1 -1
- package/dist/assets/{index-DbBDYLLC.js → index-BGH0IgYz.js} +1 -1
- package/dist/assets/{index-DaJgo_ZX.js → index-BHqFxtOF.js} +1 -1
- package/dist/assets/{index-68NaTtAT.js → index-BIE-c4ov.js} +1 -1
- package/dist/assets/{index-BaIOFWVN.js → index-BKzGnx5F.js} +1 -1
- package/dist/assets/{index-DKT4kT0z.js → index-BN-UQoD0.js} +1 -1
- package/dist/assets/{index-CG7pBdX7.js → index-BNgbhBBj.js} +1 -1
- package/dist/assets/{index-V-c9hDuN.js → index-BZzjVj6a.js} +1 -1
- package/dist/assets/{index-B5jo7NY3.js → index-BeLJU121.js} +1 -1
- package/dist/assets/{index-C09FcKq9.js → index-BsyPjG1u.js} +1 -1
- package/dist/assets/{index-C2Ef9ZKY.js → index-BtT61g2y.js} +1 -1
- package/dist/assets/{index-_dbDaWih.js → index-C-lycVhr.js} +1 -1
- package/dist/assets/{index-Bt0OiCSI.js → index-C-onEgM4.js} +1 -1
- package/dist/assets/{index-YHAd10KH.js → index-C1eN8oxJ.js} +1 -1
- package/dist/assets/{index-DmI0irY_.js → index-C56irszs.js} +3 -3
- package/dist/assets/{index-CstN7RKM.js → index-C6O_SREA.js} +1 -1
- package/dist/assets/{index-BM3sPBDY.js → index-C6maAFlu.js} +1 -1
- package/dist/assets/{index-CQayeKqY.js → index-CEDF6g8f.js} +1 -1
- package/dist/assets/{index-Bg3fpyty.js → index-COGZbOvJ.js} +1 -1
- package/dist/assets/{index-C9CBkm3J.js → index-CQi5y1tA.js} +1 -1
- package/dist/assets/{index-BfvgCRfu.js → index-CU9x1Nwa.js} +1 -1
- package/dist/assets/{index-bs2QXOh6.js → index-CV7E7mDR.js} +1 -1
- package/dist/assets/{index-D04OE6ZP.js → index-CVkYz1Je.js} +1 -1
- package/dist/assets/{index-C11T6v8N.js → index-CW3U7Kji.js} +1 -1
- package/dist/assets/{index-C294PRIl.js → index-CWeDD789.js} +1 -1
- package/dist/assets/{index-CR6ve8Ck.js → index-CbmTFzvh.js} +1 -1
- package/dist/assets/{index-Dh_hemGT.js → index-CiCm-EwM.js} +1 -1
- package/dist/assets/{index-Tga9YfTB.js → index-ClZhoIFv.js} +1 -1
- package/dist/assets/{index-CV49VNqG.js → index-ClkTqs0M.js} +1 -1
- package/dist/assets/{index-ndgg4Xx-.js → index-ClyBp32W.js} +1 -1
- package/dist/assets/{index-BQc3ELHV.js → index-Cpx6uL0j.js} +1 -1
- package/dist/assets/{index-0u4YGGTa.js → index-Cq3fb6MA.js} +1 -1
- package/dist/assets/{index-DizoYeO3.js → index-CxEpAWwz.js} +1 -1
- package/dist/assets/{index-B5267oqA.js → index-D4JEvBET.js} +14 -14
- package/dist/assets/{index-2vry-0Si.js → index-D65GaJCy.js} +1 -1
- package/dist/assets/{index-C3qZe6wM.js → index-D6U1lzhK.js} +1 -1
- package/dist/assets/{index-DKF6p7_t.js → index-D6zsD92V.js} +1 -1
- package/dist/assets/{index-C94_tKkM.js → index-DAQQMQN_.js} +1 -1
- package/dist/assets/{index-DfAn9V8y.js → index-DC-SxuPE.js} +1 -1
- package/dist/assets/{index-Bop7QJNZ.js → index-DE1_SThE.js} +1 -1
- package/dist/assets/{index-DVPxXPIi.js → index-DGOShBRo.js} +1 -1
- package/dist/assets/{index-Bf3A60rN.js → index-DHCVQU69.js} +1 -1
- package/dist/assets/{index-DxHihOCA.js → index-DJQzWCYu.js} +1 -1
- package/dist/assets/{index-CzL5AhXP.js → index-DKUx2sg9.js} +1 -1
- package/dist/assets/{index-D8Cs8xk3.js → index-DMkA3tXo.js} +1 -1
- package/dist/assets/{index-D3Pn_CC4.js → index-DPatKvBa.js} +1 -1
- package/dist/assets/{index-qgWZ4gIq.js → index-DQBhHeqp.js} +1 -1
- package/dist/assets/{index-DD8o6SGh.js → index-DY3r2qc9.js} +1 -1
- package/dist/assets/{index-DQecjVoC.js → index-DZ90dRtr.js} +1 -1
- package/dist/assets/{index-i3zVFahC.js → index-Do2szyvJ.js} +1 -1
- package/dist/assets/{index-BjAmTjb2.js → index-DoKIsuyR.js} +1 -1
- package/dist/assets/{index-CLzy2i_E.js → index-DpeMrIQR.js} +1 -1
- package/dist/assets/{index-2sob-pDv.js → index-DwBEVukg.js} +1 -1
- package/dist/assets/{index-BvL_bkhW.js → index-Orv8G0Z8.js} +5 -5
- package/dist/assets/{index-L0hmNNaW.js → index-bgkP0YPJ.js} +1 -1
- package/dist/assets/{index-h72lxwun.js → index-cFJ_-B0U.js} +1 -1
- package/dist/assets/{index-CKchCVfL.js → index-f17Qof3T.js} +2 -2
- package/dist/assets/{index-ekq_L-ma.js → index-me6-hkZE.js} +1 -1
- package/dist/assets/{index-CYaLupkJ.js → index-vutD85zq.js} +1 -1
- package/dist/assets/{index-C7rmhYmL.js → index-xXBUae2L.js} +1 -1
- package/dist/assets/{index.browser.esm-BjveNakI.js → index.browser.esm-KHap9qRA.js} +1 -1
- package/dist/assets/{index.es-D8MU6eMk.js → index.es-Dz2WW0mO.js} +1 -1
- package/dist/assets/{info-dOvxF9_k.js → info-BMBHzUdl.js} +1 -1
- package/dist/assets/{info-circle-B_ptqPDa.js → info-circle-CWWGZOCr.js} +1 -1
- package/dist/assets/{isEqual-Dh50OCem.js → isEqual-CCMJAc_b.js} +1 -1
- package/dist/assets/{isPlainObject-dMdaxYmL.js → isPlainObject-woldJKog.js} +1 -1
- package/dist/assets/{lightbulb-D8KE_ZIV.js → lightbulb-9DrbxaGj.js} +1 -1
- package/dist/assets/{mail-DT7Oj5pA.js → mail-DnvzaUPW.js} +1 -1
- package/dist/assets/{midjourney-DLKHed76.js → midjourney-n93X9HRa.js} +1 -1
- package/dist/assets/{mobile-AVtFisqT.js → mobile-CIUznWtG.js} +1 -1
- package/dist/assets/{more-DRhObOpy.js → more-CF8WbsV3.js} +1 -1
- package/dist/assets/{network-placeholder-B_FWgMxk.js → network-placeholder-lFNe1_Iu.js} +1 -1
- package/dist/assets/{nftPlaceholder-_di0fXLf.js → nftPlaceholder-BROyitps.js} +1 -1
- package/dist/assets/{off-COt_i6CT.js → off-nf74n16e.js} +1 -1
- package/dist/assets/order-03apkk4w.js +1 -0
- package/dist/assets/order-Bo-tnXB3.js +1 -0
- package/dist/assets/order-C94zB2DA.js +1 -0
- package/dist/assets/order-CdpPmQpG.js +1 -0
- package/dist/assets/order-CnCQGMJh.js +1 -0
- package/dist/assets/order-CwX_tpSV.js +1 -0
- package/dist/assets/order-CzIgaSX4.js +1 -0
- package/dist/assets/order-D2XQBvdp.js +1 -0
- package/dist/assets/order-D97e7T7u.js +1 -0
- package/dist/assets/order-DCTvXGft.js +1 -0
- package/dist/assets/order-DZurK8Ek.js +1 -0
- package/dist/assets/order-DamR_aAT.js +1 -0
- package/dist/assets/order-Dc0Ec8sh.js +1 -0
- package/dist/assets/order-DcR5etPG.js +1 -0
- package/dist/assets/order-Dh3F9166.js +1 -0
- package/dist/assets/order-DhEagMXF.js +1 -0
- package/dist/assets/{order-CJX0GN2m.js → order-DnaVR88n.js} +1 -1
- package/dist/assets/order-JbPHacDg.js +1 -0
- package/dist/assets/order-rAaEPzDi.js +1 -0
- package/dist/assets/{pagination-BlJ6xPMo.js → pagination-33HYpCcx.js} +1 -1
- package/dist/assets/{play-store-Cedel5kB.js → play-store-BHBDgqwO.js} +1 -1
- package/dist/assets/{plus-Cuj7YYtp.js → plus-Cnp3h-UB.js} +1 -1
- package/dist/assets/{price-BDO9ZXFV.js → price-BkNDLX8f.js} +1 -1
- package/dist/assets/{producer-MVbu9J-a.js → producer-OM4OaxrK.js} +1 -1
- package/dist/assets/{qr-code-BDZGQJwb.js → qr-code--H2rGKc3.js} +1 -1
- package/dist/assets/{recycle-horizontal-C5WjUkxr.js → recycle-horizontal-DAPYyBK6.js} +1 -1
- package/dist/assets/{refresh-CbTpfLPL.js → refresh-Cpormqbd.js} +1 -1
- package/dist/assets/{reown-logo-BXupsXS3.js → reown-logo-uiFznOv3.js} +1 -1
- package/dist/assets/{search-Bsphe-gu.js → search-DzypqzMg.js} +1 -1
- package/dist/assets/{secp256k1-DSvuYwWr.js → secp256k1-B8zf7T5h.js} +1 -1
- package/dist/assets/{secp256k1-gBDfF4Ck.js → secp256k1-CQQaQtRy.js} +1 -1
- package/dist/assets/{seedream-C7eDwzou.js → seedream-BZ76h4dp.js} +1 -1
- package/dist/assets/{send-DTG8ft4a.js → send-BmPxjhzI.js} +1 -1
- package/dist/assets/{service-b1ACOrhy.js → service-CIke8-FE.js} +1 -1
- package/dist/assets/{solana-wallets-YBA_Z6os.js → solana-wallets-p4EdxnrZ.js} +2 -2
- package/dist/assets/{solana-wallets-vue-SsomcTKH.js → solana-wallets-vue-C0jzrnoD.js} +1 -1
- package/dist/assets/{suno-BOOKvePt.js → suno-CFKtOQa-.js} +1 -1
- package/dist/assets/{swapHorizontal-CgIZOiup.js → swapHorizontal-0jiHNEf4.js} +1 -1
- package/dist/assets/{swapHorizontalBold-B1U0OJbS.js → swapHorizontalBold-L-wxJM6w.js} +1 -1
- package/dist/assets/{swapHorizontalMedium-BvL_ktn0.js → swapHorizontalMedium-B0c7ziuy.js} +1 -1
- package/dist/assets/{swapHorizontalRoundedBold-DmBo86OS.js → swapHorizontalRoundedBold-Kz6JG3ZD.js} +1 -1
- package/dist/assets/{swapVertical-CwUQpp6D.js → swapVertical-C_vYpKkw.js} +1 -1
- package/dist/assets/{telegram-CgkGRZUZ.js → telegram-Cc9j7RGO.js} +1 -1
- package/dist/assets/{three-dots-L8Alh1LI.js → three-dots-Cl25bRBi.js} +1 -1
- package/dist/assets/{twitch-tqDRvo5X.js → twitch-DiHnIZi9.js} +1 -1
- package/dist/assets/{twitterIcon-m-I-o48i.js → twitterIcon-BEXhaJss.js} +1 -1
- package/dist/assets/{typescript-GHEyAG9P.js → typescript-BxdtUEmf.js} +1 -1
- package/dist/assets/{use-form-item-CAmCDDpm.js → use-form-item-CfxgrMhy.js} +1 -1
- package/dist/assets/validator-Bz8-M2lh.js +1 -0
- package/dist/assets/{verify-DYX5GAvx.js → verify-IBoQliqN.js} +1 -1
- package/dist/assets/{verify-filled-Bd1KVQgm.js → verify-filled-D1vtEftV.js} +1 -1
- package/dist/assets/{w3m-modal-CUDhwQSo.js → w3m-modal-DMimRYmp.js} +1 -1
- package/dist/assets/{wallet-fqHipSqw.js → wallet-DhhnjbJl.js} +1 -1
- package/dist/assets/{wallet-placeholder-BNss7V7Y.js → wallet-placeholder-CnZA6Ely.js} +1 -1
- package/dist/assets/{walletconnect-Dd02hoMz.js → walletconnect-Dh6c2kvm.js} +1 -1
- package/dist/assets/{warning-circle-Bq66iBvQ.js → warning-circle-DsaE8s5E.js} +1 -1
- package/dist/assets/{web-By0Q0OWp.js → web-DSxsGFNi.js} +1 -1
- package/dist/assets/{web-biVkl97I.js → web-DvU4BZks.js} +1 -1
- package/dist/assets/{x-CGbk18ka.js → x-BfhZUH9w.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/Detail-BBxS4o_n.js +0 -2
- package/dist/assets/chat-BFvmXnGq.js +0 -1
- package/dist/assets/chat-BJ1O-acr.js +0 -1
- package/dist/assets/chat-BVnywm8V.js +0 -1
- package/dist/assets/chat-Bg5nzR2s.js +0 -1
- package/dist/assets/chat-Bi9bSam4.js +0 -1
- package/dist/assets/chat-BiKeApIc.js +0 -1
- package/dist/assets/chat-C6a-XWNv.js +0 -1
- package/dist/assets/chat-CcBdBoIQ.js +0 -1
- package/dist/assets/chat-DA19T0N-.js +0 -1
- package/dist/assets/chat-DDwlXTRr.js +0 -1
- package/dist/assets/chat-D_ldAckE.js +0 -1
- package/dist/assets/chat-Dh1tEg2g.js +0 -1
- package/dist/assets/chat-DktNImx9.js +0 -1
- package/dist/assets/chat-J4Z-vAUt.js +0 -1
- package/dist/assets/chat-UZtzKTY5.js +0 -1
- package/dist/assets/chat-VonUfVbJ.js +0 -1
- package/dist/assets/chat-mrd8Uqt-.js +0 -1
- package/dist/assets/chat-n5ursQ4V.js +0 -1
- package/dist/assets/order-1qJ3GxaX.js +0 -1
- package/dist/assets/order-B8dtxAZ2.js +0 -1
- package/dist/assets/order-BDzghU3p.js +0 -1
- package/dist/assets/order-BI5MxfoB.js +0 -1
- package/dist/assets/order-BfoUTh90.js +0 -1
- package/dist/assets/order-BigJZUm-.js +0 -1
- package/dist/assets/order-BulQDrR-.js +0 -1
- package/dist/assets/order-CCmLKKdB.js +0 -1
- package/dist/assets/order-CSpGh4Zz.js +0 -1
- package/dist/assets/order-CVHCRSWI.js +0 -1
- package/dist/assets/order-CerH81Qp.js +0 -1
- package/dist/assets/order-CgCnV8Wc.js +0 -1
- package/dist/assets/order-D8IX-Cp2.js +0 -1
- package/dist/assets/order-D8kStYHA.js +0 -1
- package/dist/assets/order-DNR8D2Y8.js +0 -1
- package/dist/assets/order-EP4isp-N.js +0 -1
- package/dist/assets/order-ReEYaOWl.js +0 -1
- package/dist/assets/order-XdBUMXLb.js +0 -1
- package/dist/assets/validator-BY6D6xjR.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as L}from"./index.es-D8MU6eMk.js";import{E as M}from"./index-DbBDYLLC.js";import{E as ue}from"./index-C09FcKq9.js";import{d as y,H as m,E as i,z,C as n,y as f,D as o,q as a,F as r,x as S,O as V,N as T,Q as U,J as v,R as ye,I as C,M as we}from"./vendor-vue-NSDaktjZ.js";import{H as w,bp as K,ah as Ce,I as Se,cs as oe,aI as ne,S as se,ct as Ve}from"./index-B5267oqA.js";import{a as Ie,b as ie,c as H,d as D,e as Te,f as Ee,g as Le}from"./kling-DwJwIwVI.js";import{E as P,a as G}from"./index-h72lxwun.js";import{E as W}from"./index-BQc3ELHV.js";import{E as b}from"./index-CCwWrfc4.js";import{I,S as Me,l as Ue}from"./pagination-BlJ6xPMo.js";import{p as J}from"./pasteUploadMixin-BurWbGNQ.js";import{u as O,a as Re,e as ae}from"./uploadTrackerMixin--N-yU8Tl.js";import{I as j}from"./ImagePreview-D-9EFWby.js";import{E as Q}from"./index-CzL5AhXP.js";import{E as N}from"./index-bs2QXOh6.js";import{C as me}from"./Consumption-B3cgN_uS.js";import{E as pe}from"./index-ukLW3UKB.js";import{E as ge}from"./index-Bop7QJNZ.js";import{E as fe}from"./index-D3Pn_CC4.js";import{P as Ae,N as De}from"./NoTasks-C9fjzpt-.js";import{E as he}from"./index-CQayeKqY.js";import{a as _e}from"./price-BDO9ZXFV.js";import{F as Pe}from"./FilePreview-CgjWf7IZ.js";import{E as Ge,a as Ke}from"./index-DfAn9V8y.js";import{E as Oe,a as je}from"./index-BM3sPBDY.js";import{b as le}from"./errorCode-Cqj9Td_Z.js";import{C as Ne}from"./CopyToClipboard-g4vBpWAA.js";import{V as Be}from"./VideoPlayer-D2Gk8iOW.js";import{A as ze}from"./ApiCodeButton-BxWrNlio.js";import{E as Fe}from"./index-B5jo7NY3.js";import{E as qe}from"./index-Bf3A60rN.js";import{B as He}from"./BotPlaceholder-DpiZEQow.js";import"./use-form-item-CAmCDDpm.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Df5ITouH.js";import"./index-V-c9hDuN.js";import"./typescript-GHEyAG9P.js";import"./index-C94_tKkM.js";import"./strings-beZM2Y-f.js";import"./isEqual-Dh50OCem.js";import"./_Uint8Array-pk5G6DXb.js";import"./castArray-tmh9kbwO.js";import"./debounce-DBeMKn11.js";import"./_baseIteratee-DKwNed0n.js";import"./index-YHAd10KH.js";import"./validator-BY6D6xjR.js";import"./highlight-BIVpqebW.js";import"./index-BLjywj98.js";import"./vendor-highlight-lEWW1Jxd.js";import"./index-Tga9YfTB.js";import"./_baseClone-BEl0SBVQ.js";import"./_initCloneObject-7jYqtSMb.js";import"./index-Cu41y2Fl.js";import"./index-DVPxXPIi.js";import"./isPlainObject-dMdaxYmL.js";import"./vue-plyr-BO2nlN4c.js";import"./index-68NaTtAT.js";const We=y({name:"LayoutKling",components:{ElDrawer:ue,ElButton:M,FontAwesomeIcon:L},data(){return{drawer:!1}}}),Je={class:"main flex flex-row flex-1 min-h-0"},Qe={class:"config w-[320px] flex-none h-full flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},Ye={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function Xe(e,t,s,l,u,$){const d=o("font-awesome-icon"),p=o("el-button"),g=o("el-drawer");return a(),m("div",Je,[i("div",Qe,[z(e.$slots,"config",{},void 0,!0)]),i("div",Ye,[z(e.$slots,"result",{},void 0,!0)]),n(p,{circle:"",class:"menu",onClick:t[0]||(t[0]=c=>e.drawer=!0)},{default:f(()=>[n(d,{icon:"fa-solid fa-magic"})]),_:1}),n(g,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=c=>e.drawer=c),direction:"ltr","with-header":!1,size:"350px"},{default:f(()=>[z(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Ze=w(We,[["render",Xe],["__scopeId","data-v-be4bb0df"]]),xe={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function Y(e,t,s){const l=t||"std",u=s??5;switch(e){case"kling-v1":return{text2video:!0,image2video:!0,endImage:u===5,audio:!1,motionControl:u===5};case"kling-v1-6":case"kling-v2-5-turbo":return{text2video:!0,image2video:!0,endImage:l==="pro",audio:!1,motionControl:!1};case"kling-v2-6":return{text2video:!0,image2video:!0,endImage:l==="pro",audio:l==="pro",motionControl:!1};case"kling-v2-master":case"kling-v2-1-master":return{text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};case"kling-v3":return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:l!=="4k"};case"kling-v3-omni":return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:!1};case"kling-video-o1":return{text2video:!0,image2video:!0,endImage:!0,audio:!1,motionControl:!1};default:return xe}}function X(e,t){if(!e)return[];const s=t.model??e.model,l=t.mode??e.mode,u=t.duration??e.duration;if(!s)return[];const $=Y(s,l,u),d=[];return e.end_image_url&&!$.endImage&&d.push({field:"end_image_url",i18nLabel:"kling.name.endImage"}),e.generate_audio&&!$.audio&&d.push({field:"generate_audio",i18nLabel:"kling.name.generateAudio"}),e.camera_control?.type&&(!$.motionControl||e.start_image_url)&&d.push({field:"camera_control",i18nLabel:"kling.name.cameraControl"}),d}function Z(e,t){const s={...e};for(const l of t)l.field==="end_image_url"&&(s.end_image_url=void 0),l.field==="generate_audio"&&(s.generate_audio=!1),l.field==="camera_control"&&(s.camera_control=void 0);return s}const et=y({name:"ModelSelector",components:{ElSelect:G,ElOption:P},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{revertKey:0,options:[{value:"kling-v3",label:"v3"},{value:"kling-v3-omni",label:"v3-Omni"},{value:"kling-v2-6",label:"v2.6"},{value:"kling-v2-5-turbo",label:"v2.5-Turbo"},{value:"kling-v2-1-master",label:"v2.1-Master"},{value:"kling-v2-master",label:"v2-Master"},{value:"kling-v1-6",label:"v1.6"},{value:"kling-v1",label:"v1"},{value:"kling-video-o1",label:"Video-o1"}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(Ie)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=X(t,{model:e});if(s.length===0){this.applyModel(e);return}const l=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await W.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:l}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=Z({...t,model:e},s);this.$store.commit("kling/setConfig",u),b.success(this.$t("kling.message.featureRemovedNotice",{fields:l}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,model:e})}}}),tt={class:"field"},ot={class:"title font-bold"};function nt(e,t,s,l,u,$){const d=o("el-option"),p=o("el-select");return a(),m("div",tt,[i("h2",ot,r(e.$t("pika.name.model")),1),(a(),S(p,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("pika.placeholder.select"),onChange:e.onChange},{default:f(()=>[(a(!0),m(V,null,T(e.options,g=>(a(),S(d,{key:g.value,label:g.label,value:g.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const st=w(et,[["render",nt],["__scopeId","data-v-04059875"]]),it=y({name:"ModeSelector",components:{ElSelect:G,ElOption:P,InfoIcon:I},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 H.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(ie)}},mounted(){this.value||this.applyMode(ie)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=X(t,{mode:e});if(s.length===0){this.applyMode(e);return}const l=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await W.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:l}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=Z({...t,mode:e},s);this.$store.commit("kling/setConfig",u),b.success(this.$t("kling.message.featureRemovedNotice",{fields:l}))}catch{this.revertKey+=1}},applyMode(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,mode:e})}}}),at={class:"field"},lt={class:"header"},rt={class:"title font-bold"},ct={key:0,class:"opt-tip"};function dt(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-option"),g=o("el-select");return a(),m("div",at,[i("div",lt,[i("h2",rt,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.mode"),class:"info-icon"},null,8,["content"])]),(a(),S(g,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("kling.placeholder.select"),clearable:!0,onChange:e.onChange},{default:f(()=>[(a(!0),m(V,null,T(e.options,c=>(a(),S(p,{key:c.value,label:c.label,value:c.value,disabled:c.disabled},{default:f(()=>[i("span",{class:U({"opt-disabled":c.disabled})},r(c.label),3),c.disabled&&c.disabledReason?(a(),m("span",ct,r(c.disabledReason),1)):v("",!0)]),_:2},1032,["label","value","disabled"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const ut=w(it,[["render",dt],["__scopeId","data-v-9a8fa3c5"]]),mt=[3,5,8,10,12,15],pt=[5,10],gt=y({name:"DurationSelector",components:{ElSelect:G,ElOption:P,InfoIcon:I},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},isV3Model(){return H.includes(this.selectedModel)},allowedDurations(){return this.isV3Model?mt:pt},value(){return this.$store.state.kling?.config?.duration??D},selectValue(){const e=this.allowedDurations;return e.includes(this.value)?this.value:e.includes(D)?D:e[0]}},watch:{isV3Model(){this.allowedDurations.includes(this.value)||this.applyDuration(D)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(D)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=X(t,{duration:e});if(s.length===0){this.applyDuration(e);return}const l=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await W.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:l}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=Z({...t,duration:e},s);this.$store.commit("kling/setConfig",u),b.success(this.$t("kling.message.featureRemovedNotice",{fields:l}))}catch{this.revertKey+=1}},applyDuration(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,duration:e})}}}),ft={class:"field"},ht={class:"control"},_t={class:"label"},$t={class:"title font-bold"};function kt(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-option"),g=o("el-select");return a(),m("div",ft,[i("div",ht,[i("div",_t,[i("h2",$t,r(e.$t("kling.name.duration")),1),n(d,{content:e.$t("kling.description.duration"),class:"info-icon ml-1"},null,8,["content"])]),(a(),S(g,{key:e.revertKey,"model-value":e.selectValue,class:"value",placeholder:e.$t("kling.placeholder.select"),onChange:e.onChange},{default:f(()=>[(a(!0),m(V,null,T(e.allowedDurations,c=>(a(),S(p,{key:c,label:`${c}s`,value:c},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])])}const vt=w(gt,[["render",kt],["__scopeId","data-v-5ae55e28"]]),bt=y({name:"RatioSelector",data(){return{options:[{value:"1:1",label:"1:1",width:20,height:20},{value:"16:9",label:"16:9",width:25,height:13},{value:"9:16",label:"9:16",width:13,height:25}]}},computed:{active(){return this.options.findIndex(e=>e.value===this.value)||0},value:{get(){return this.$store.state?.kling?.config?.aspect_ratio},set(e){console.debug("set ratio",e),this.$store.commit("kling/setConfig",{...this.$store.state?.kling?.config,aspect_ratio:e})}}},mounted(){this.value||(this.value=Te)}}),yt={class:"text-sm font-bold mb-2 block"},wt={class:"items"},Ct=["onClick"],St={class:"name"};function Vt(e,t,s,l,u,$){return a(),m("div",null,[i("span",yt,r(e.$t("kling.name.ratio")),1),i("div",wt,[(a(!0),m(V,null,T(e.options,(d,p)=>(a(),m("div",{key:p,class:U({active:e.active===p,item:!0}),onClick:g=>e.value=d.value},[i("div",{class:U(["preview",d.label])},[i("div",{class:"rect",style:ye({width:d.width+"px",height:d.height+"px"})},null,4)],2),i("p",St,r(d.label),1)],10,Ct))),128))])])}const It=w(bt,[["render",Vt],["__scopeId","data-v-cdb14b2f"]]),Tt=y({name:"StartImage",components:{ElUpload:N,ElButton:M,ElTooltip:Q,InfoIcon:I,FontAwesomeIcon:L,ImagePreview:j},mixins:[J,O],emits:["change"],data(){return{fileList:[],uploadUrl:K()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},value:{get(){return this.$store.state?.kling?.config?.start_image_url},set(){}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){b.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){b.error(this.$t("kling.message.uploadReferencesError"))},onSetStartImageUrl(){const e=this.urls?.[0];this.$store.commit("kling/setConfig",{...this.$store.state?.kling?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),Et={class:"relative"},Lt={class:"flex justify-between"},Mt={class:"flex justify-start items-center"},Ut={class:"text-sm font-bold"};function Rt(e,t,s,l,u,$){const d=o("info-icon"),p=o("image-preview"),g=o("font-awesome-icon"),c=o("el-button"),k=o("el-tooltip"),h=o("el-upload");return a(),m("div",Et,[i("div",Lt,[i("div",Mt,[i("span",Ut,r(e.$t("kling.name.startImage")),1),n(d,{content:e.$t("kling.description.uploadStartImage")},null,8,["content"])])]),n(h,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,disabled:e.reachedLimit,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:f(({file:_})=>[_.url&&_.percentage!==void 0?(a(),S(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:E=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:f(()=>[n(k,{content:e.$t("kling.message.uploadReferencesExceed"),disabled:!e.reachedLimit,placement:"top"},{default:f(()=>[i("span",null,[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.reachedLimit},{default:f(()=>[n(g,{icon:"fa-solid fa-upload",class:"icon mr-1"}),C(" "+r(e.$t("kling.button.uploadReferences")),1)]),_:1},8,["disabled"])])]),_:1},8,["content","disabled"])]),_:1},8,["file-list","disabled","action","on-exceed","on-error","on-success","headers"])])}const At=w(Tt,[["render",Rt],["__scopeId","data-v-756dc269"]]),Dt=y({name:"EndImage",components:{ElUpload:N,ElButton:M,ElTooltip:Q,ImagePreview:j,InfoIcon:I,FontAwesomeIcon:L},mixins:[J,O],data(){return{fileList:[],uploadUrl:K()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},klingConfig(){return this.$store.state?.kling?.config||{}},endImageSupported(){return Y(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},hasStartImage(){return!!this.klingConfig.start_image_url},uploadDisabled(){return this.reachedLimit||!this.endImageSupported||!this.hasStartImage},uploadTooltip(){return this.endImageSupported?this.hasStartImage?this.reachedLimit?this.$t("kling.message.uploadReferencesExceed"):"":this.$t("kling.message.endImageRequiresStart"):this.$t("kling.message.endImageNotSupported")},storeValue(){return this.klingConfig.end_image_url},value:{get(){return this.storeValue},set(){}}},watch:{storeValue(e){!e&&this.fileList.length>0&&(this.fileList=[])},hasStartImage(e){!e&&this.storeValue&&(this.fileList=[],this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,end_image_url:void 0}))}},mounted(){this.value||(this.value=void 0),this.onSetEndImageUrl()},methods:{onBeforeUpload(){return this.endImageSupported?this.hasStartImage?!0:(b.warning(this.$t("kling.message.endImageRequiresStart")),!1):(b.warning(this.$t("kling.message.endImageNotSupported")),!1)},onExceed(){b.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){b.error(this.$t("kling.message.uploadReferencesError"))},onSetEndImageUrl(){const e=this.urls?.[0];this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),Pt={class:"relative"},Gt={class:"flex justify-between"},Kt={class:"flex justify-start items-center"},Ot={class:"text-sm font-bold"};function jt(e,t,s,l,u,$){const d=o("info-icon"),p=o("image-preview"),g=o("font-awesome-icon"),c=o("el-button"),k=o("el-tooltip"),h=o("el-upload");return a(),m("div",Pt,[i("div",Gt,[i("div",Kt,[i("span",Ot,r(e.$t("kling.name.endImage")),1),n(d,{content:e.$t("kling.description.uploadEndImage")},null,8,["content"])])]),n(h,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,disabled:e.uploadDisabled,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","before-upload":e.onBeforeUpload,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:f(({file:_})=>[_.url&&_.percentage!==void 0?(a(),S(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:E=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:f(()=>[n(k,{content:e.uploadTooltip,disabled:!e.uploadDisabled,placement:"top"},{default:f(()=>[i("span",null,[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.uploadDisabled},{default:f(()=>[n(g,{icon:"fa-solid fa-upload",class:"icon mr-1"}),C(" "+r(e.$t("kling.button.uploadReferences")),1)]),_:1},8,["disabled"])])]),_:1},8,["content","disabled"])]),_:1},8,["file-list","disabled","action","before-upload","on-exceed","on-error","on-success","headers"])])}const Nt=w(Dt,[["render",jt],["__scopeId","data-v-c1b257e5"]]),Bt=y({name:"CfgScaleSelector",components:{ElSlider:ge,InfoIcon:I,ElInputNumber:pe},computed:{value:{get(){return this.$store.state?.kling?.config?.cfg_scale},set(e){console.debug("set cfg_scale",e),this.$store.commit("kling/setConfig",{...this.$store.state?.kling?.config,cfg_scale:e})}}},mounted(){this.value||(this.value=Ee)}}),zt={class:"flex justify-between"},Ft={class:"flex justify-start items-center"},qt={class:"text-sm font-bold"},Ht={class:"flex justify-end items-center"},Wt={class:"w-full"};function Jt(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-input-number"),g=o("el-slider");return a(),m("div",null,[i("div",zt,[i("div",Ft,[i("span",qt,r(e.$t("kling.name.cfgScale")),1),n(d,{content:e.$t("kling.description.cfgScale")},null,8,["content"])]),i("div",Ht,[n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),"controls-position":"right"},null,8,["modelValue"])])]),i("div",Wt,[n(g,{modelValue:e.value,"onUpdate:modelValue":t[1]||(t[1]=c=>e.value=c),min:0,max:1,step:.1},null,8,["modelValue"])])])}const Qt=w(Bt,[["render",Jt]]),Yt=y({name:"GenerateAudioSelector",components:{ElSwitch:fe,InfoIcon:I},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},selectedMode(){return this.$store.state.kling?.config?.mode||""},supported(){return!!(H.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??Le:!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})}}}),Xt={class:"relative"},Zt={class:"flex justify-between items-center"},xt={class:"flex justify-start items-center"},eo={class:"text-sm font-bold"};function to(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-switch");return a(),m("div",Xt,[i("div",Zt,[i("div",xt,[i("span",eo,r(e.$t("kling.name.generateAudio")),1),n(d,{content:e.tooltipContent},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=g=>e.value=g),class:"value",disabled:!e.supported},null,8,["modelValue","disabled"])])])}const oo=w(Yt,[["render",to]]),no=["horizontal","vertical","pan","tilt","roll","zoom"],so=y({name:"CameraControlSelector",components:{ElSelect:G,ElOption:P,ElSlider:ge,ElInputNumber:pe,InfoIcon:I},data(){return{configKeys:no}},computed:{typeOptions(){return[{value:"",label:this.$t("kling.name.cameraTypeNone")},{value:"simple",label:this.$t("kling.name.cameraTypeSimple")},{value:"down_back",label:this.$t("kling.name.cameraTypeDownBack")},{value:"forward_up",label:this.$t("kling.name.cameraTypeForwardUp")},{value:"left_turn_forward",label:this.$t("kling.name.cameraTypeLeftTurnForward")},{value:"right_turn_forward",label:this.$t("kling.name.cameraTypeRightTurnForward")}]},selectedMode(){return this.$store.state.kling?.config?.mode||""},selectedModel(){return this.$store.state.kling?.config?.model||""},selectedDuration(){return this.$store.state.kling?.config?.duration},motionControlSupported(){return Y(this.selectedModel,this.selectedMode,this.selectedDuration).motionControl},hasStartImage(){return!!this.$store.state.kling?.config?.start_image_url},disabled(){return!this.motionControlSupported||this.hasStartImage},tooltipContent(){return this.motionControlSupported?this.hasStartImage?this.$t("kling.description.cameraControlDisabledImage2Video"):this.$t("kling.description.cameraControl"):this.$t("kling.description.cameraControlNotSupported")},selectedType(){return this.$store.state.kling?.config?.camera_control?.type},selectedTypeRaw:{get(){return this.selectedType??""},set(e){const t=this.$store.state.kling?.config||{};if(!e){const l={...t};delete l.camera_control,this.$store.commit("kling/setConfig",l);return}const s=e;this.$store.commit("kling/setConfig",{...t,camera_control:{type:s,config:s==="simple"?t.camera_control?.config||{}:void 0}})}},configValues(){return this.$store.state.kling?.config?.camera_control?.config||{}}},watch:{disabled(e){e&&this.selectedType!==void 0&&(this.selectedTypeRaw="")}},methods:{writeConfig(e,t){const s=this.$store.state.kling?.config||{},l=s.camera_control||{type:"simple"},u={...l.config||{}};t==null?delete u[e]:u[e]=t,this.$store.commit("kling/setConfig",{...s,camera_control:{...l,type:"simple",config:u}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),io={class:"field"},ao={class:"header"},lo={class:"text-sm font-bold"},ro={key:0,class:"config-grid"},co={class:"cfg-row-head"},uo={class:"cfg-name"};function mo(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-option"),g=o("el-select"),c=o("el-input-number"),k=o("el-slider");return a(),m("div",io,[i("div",ao,[i("span",lo,r(e.$t("kling.name.cameraControl")),1),n(d,{content:e.tooltipContent},null,8,["content"])]),n(g,{modelValue:e.selectedTypeRaw,"onUpdate:modelValue":t[0]||(t[0]=h=>e.selectedTypeRaw=h),class:"value",placeholder:e.$t("kling.placeholder.cameraType"),clearable:!0,disabled:e.disabled},{default:f(()=>[(a(!0),m(V,null,T(e.typeOptions,h=>(a(),S(p,{key:h.value,label:h.label,value:h.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","disabled"]),e.selectedType==="simple"&&!e.disabled?(a(),m("div",ro,[(a(!0),m(V,null,T(e.configKeys,h=>(a(),m("div",{key:h,class:"cfg-row"},[i("div",co,[i("span",uo,r(e.$t(`kling.name.cc_${h}`)),1),n(c,{modelValue:e.configValues[h],"onUpdate:modelValue":_=>e.configValues[h]=_,min:-1,max:1,step:.1,precision:1,"controls-position":"right",size:"small",class:"cfg-num",onChange:_=>e.onNumberChange(h,_)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),n(k,{"model-value":e.configValues[h]??0,min:-1,max:1,step:.1,onInput:_=>e.onSliderChange(h,_)},null,8,["model-value","onInput"])]))),128))])):v("",!0)])}const po=w(so,[["render",mo],["__scopeId","data-v-cd896060"]]),$e=[{groupKey:"cameraMovements",chipKeys:["rotateAround","stationary","handheld","zoomOut","zoomIn","follow","panRight","tiltUp","tiltDown","orbit"]},{groupKey:"cameraSpeed",chipKeys:["speedSlow","speedMedium","speedFast"]},{groupKey:"shotType",chipKeys:["shotClose","shotMedium","shotLong","shotLowAngle","shotHighAngle","shotShallowDof","shotFront","shotProfile","shotCloseUp","shotDrone"]},{groupKey:"light",chipKeys:["lightSunlight","lightSoft","lightNeon","lightWarm","lightNature","lightCandle","lightCityNight"]},{groupKey:"frame",chipKeys:["frameRichDetails","frameSimpleBg"]},{groupKey:"atmosphere",chipKeys:["atmosphereMysterious","atmospherePeaceful","atmosphereHeartwarming","atmosphereVivid","atmosphereColorful"]}],F=", ";function go(e,t){const s=(e||"").trim();return s?s.includes(t)?s:`${s}${F}${t}`:t}function q(e,t){if(!e||!t)return e||"";const s=[`${t}${F}`,`${F}${t}`,t];let l=e;for(const u of s)if(l.includes(u)){l=l.replace(u,"");break}return l.replace(/(?:,\s*)+$/,"").replace(/^(?:,\s*)+/,"")}const fo=y({name:"InspirationPills",components:{FontAwesomeIcon:L},computed:{prompt(){return this.$store.state.kling?.config?.prompt||""},allChipTexts(){return $e.flatMap(e=>e.chipKeys.map(t=>this.$t(`kling.inspiration.chip.${t}`)))},selected(){const e=this.prompt;if(!e)return[];const t=[];for(const s of this.allChipTexts){const l=e.indexOf(s);l!==-1&&t.push({text:s,idx:l})}return t.sort((s,l)=>s.idx-l.idx).map(s=>s.text)}},methods:{onRemove(e){const t=q(this.prompt,e);this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:t})}}}),ho={key:0,class:"pills",role:"list"},_o={class:"pill-text"},$o=["aria-label","onClick"];function ko(e,t,s,l,u,$){const d=o("font-awesome-icon");return e.selected.length>0?(a(),m("div",ho,[(a(!0),m(V,null,T(e.selected,p=>(a(),m("div",{key:p,class:"pill",role:"listitem"},[i("span",_o,r(p),1),i("button",{type:"button",class:"pill-remove","aria-label":e.$t("kling.inspiration.removeChip"),onClick:we(g=>e.onRemove(p),["stop"])},[n(d,{icon:"fa-solid fa-xmark"})],8,$o)]))),128))])):v("",!0)}const vo=w(fo,[["render",ko],["__scopeId","data-v-5fc4fa65"]]),bo="",yo=y({name:"PromptInput",components:{ElButton:M,FontAwesomeIcon:L,PromptTextarea:Ae,InspirationPills:vo},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||(this.prompt=bo)}});function wo(e,t,s,l,u,$){const d=o("font-awesome-icon"),p=o("el-button"),g=o("inspiration-pills"),c=o("prompt-textarea");return a(),S(c,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||(t[1]=k=>e.prompt=k),title:e.$t("kling.name.prompt"),info:e.$t("kling.description.prompt"),placeholder:e.$t("kling.placeholder.prompt")},{actions:f(()=>[n(p,{text:"",size:"small",class:"inspiration-btn",onClick:t[0]||(t[0]=k=>e.$emit("open-inspiration"))},{default:f(()=>[n(d,{icon:"fa-regular fa-lightbulb",class:"mr-1"}),C(" "+r(e.$t("kling.inspiration.openButton")),1)]),_:1})]),before:f(()=>[n(g)]),_:1},8,["modelValue","title","info","placeholder"])}const Co=w(yo,[["render",wo],["__scopeId","data-v-c01fc1a6"]]),So="",Vo=y({name:"NegativePromptInput",components:{ElInput:he,InfoIcon:I},computed:{prompt:{get(){return this.$store.state.kling?.config?.negative_prompt},set(e){console.debug("set prompt",e),this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,negative_prompt:e})}}},mounted(){this.prompt||(this.prompt=So)}}),Io={class:"field"},To={class:"box"},Eo={class:"title font-bold"};function Lo(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-input");return a(),m("div",Io,[i("div",To,[i("h2",Eo,r(e.$t("kling.name.negativePrompt")),1),n(d,{content:e.$t("kling.description.negativePrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=g=>e.prompt=g),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.negativePrompt")},null,8,["modelValue","placeholder"])])}const Mo=w(Vo,[["render",Lo],["__scopeId","data-v-de98cf01"]]),Uo=y({name:"InspirationDrawer",components:{ElDrawer:ue,ElButton:M,FontAwesomeIcon:L},props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],data(){return{groups:$e,Close:Ce}},computed:{visible:{get(){return this.modelValue},set(e){this.$emit("update:modelValue",e)}},drawerSize(){return window.innerWidth<768?"100%":"380px"},prompt(){return this.$store.state.kling?.config?.prompt||""},allChipTexts(){return this.groups.flatMap(e=>e.chipKeys.map(t=>this.$t(`kling.inspiration.chip.${t}`)))},selectedCount(){return this.allChipTexts.filter(e=>this.isSelected(e)).length}},methods:{chipText(e){return this.$t(`kling.inspiration.chip.${e}`)},isSelected(e){return e?this.prompt.includes(e):!1},setPrompt(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:e})},onToggle(e){e&&(this.isSelected(e)?this.setPrompt(q(this.prompt,e)):this.setPrompt(go(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(const t of this.allChipTexts)for(;e.includes(t);)e=q(e,t);this.setPrompt(e)}}}),Ro={class:"drawer-content"},Ao={class:"drawer-header"},Do={class:"title-row"},Po={class:"title"},Go={class:"hint"},Ko={key:0,class:"selected-bar"},Oo={class:"selected-text"},jo={class:"groups"},No={class:"group-title"},Bo={class:"chip-grid"},zo=["onClick"];function Fo(e,t,s,l,u,$){const d=o("font-awesome-icon"),p=o("el-button"),g=o("el-drawer");return a(),S(g,{modelValue:e.visible,"onUpdate:modelValue":t[1]||(t[1]=c=>e.visible=c),direction:"rtl","with-header":!1,size:e.drawerSize,"custom-class":"kling-inspiration-drawer","destroy-on-close":!1},{default:f(()=>[i("div",Ro,[i("div",Ao,[i("div",Do,[n(d,{icon:"fa-regular fa-lightbulb",class:"mr-2"}),i("span",Po,r(e.$t("kling.inspiration.title")),1)]),n(p,{text:"",icon:e.Close,class:"close-btn",onClick:t[0]||(t[0]=c=>e.visible=!1)},null,8,["icon"])]),i("div",Go,r(e.$t("kling.inspiration.hint")),1),e.selectedCount>0?(a(),m("div",Ko,[i("span",Oo,r(e.$t("kling.inspiration.selectedSummary",{count:e.selectedCount})),1),n(p,{text:"",size:"small",class:"clear-btn",onClick:e.onClearSelected},{default:f(()=>[C(r(e.$t("kling.inspiration.clearSelected")),1)]),_:1},8,["onClick"])])):v("",!0),i("div",jo,[(a(!0),m(V,null,T(e.groups,c=>(a(),m("div",{key:c.groupKey,class:"group"},[i("div",No,r(e.$t(`kling.inspiration.group.${c.groupKey}`)),1),i("div",Bo,[(a(!0),m(V,null,T(c.chipKeys,k=>(a(),m("button",{key:k,type:"button",class:U({chip:!0,active:e.isSelected(e.chipText(k))}),onClick:h=>e.onToggle(e.chipText(k))},r(e.chipText(k)),11,zo))),128))])]))),128))])])]),_:1},8,["modelValue","size"])}const qo=w(Uo,[["render",Fo],["__scopeId","data-v-7d457a69"]]),Ho={"kling-v3":"v3","kling-v3-omni":"v3-Omni","kling-v2-6":"v2.6","kling-v2-5-turbo":"v2.5-Turbo","kling-v2-1-master":"v2.1-Master","kling-v2-master":"v2-Master","kling-v1-6":"v1.6","kling-v1":"v1","kling-video-o1":"Video-o1"},Wo={std:"720p",pro:"1080p","4k":"4K"},Jo=y({name:"SummaryChip",components:{FontAwesomeIcon:L},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){const e=this.config?.model||"kling-v2-5-turbo";return Ho[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||""},modeLabel(){const e=this.config?.mode||"std";return Wo[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),Qo={class:"summary-chip"},Yo=["title"],Xo=["title"],Zo=["title"],xo=["title"],en=["title"];function tn(e,t,s,l,u,$){const d=o("font-awesome-icon");return a(),m("div",Qo,[i("span",{class:"part",title:e.$t("kling.name.model")},r(e.modelLabel),9,Yo),t[0]||(t[0]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.duration")},r(e.durationLabel),9,Xo),t[1]||(t[1]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.ratio")},r(e.aspectRatio||"16:9"),9,Zo),t[2]||(t[2]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.mode")},r(e.modeLabel),9,xo),e.generateAudio?(a(),m("span",{key:0,class:"audio",title:e.$t("kling.name.generateAudio")},[n(d,{icon:"fa-solid fa-headphones"})],8,en)):v("",!0)])}const on=w(Jo,[["render",tn],["__scopeId","data-v-418a6733"]]),nn=y({name:"ConfigPanel",components:{ElButton:M,Consumption:me,FontAwesomeIcon:L,PromptInput:Co,NegativePromptInput:Mo,ModelSelector:st,ModeSelector:ut,DurationSelector:vt,RatioSelector:It,StartImage:At,CfgScaleSelector:Qt,GenerateAudioSelector:oo,CameraControlSelector:po,InspirationDrawer:qo,SummaryChip:on,EndImage:Nt},emits:["generate"],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},consumption(){return _e(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit("generate")}}}),sn={class:"flex flex-col h-full"},an={class:"flex-1 overflow-y-auto p-5"},ln={class:"flex flex-col items-center justify-center px-5 pb-5"};function rn(e,t,s,l,u,$){const d=o("prompt-input"),p=o("model-selector"),g=o("ratio-selector"),c=o("start-image"),k=o("end-image"),h=o("duration-selector"),_=o("mode-selector"),E=o("generate-audio-selector"),R=o("camera-control-selector"),A=o("cfg-scale-selector"),B=o("negative-prompt-input"),ke=o("summary-chip"),ve=o("consumption"),x=o("font-awesome-icon"),ee=o("el-button"),be=o("inspiration-drawer");return a(),m("div",sn,[i("div",an,[n(d,{class:"mb-4",onOpenInspiration:t[0]||(t[0]=te=>e.inspirationOpen=!0)}),n(p,{class:"mb-4"}),n(g,{class:"mb-4"}),n(c,{class:"mb-2"}),n(k,{class:"mb-2"}),n(h,{class:"mb-4"}),n(_,{class:"mb-4"}),n(E,{class:"mb-4"}),n(R,{class:"mb-4"}),n(A,{class:"mb-4"}),n(B,{class:"mb-4"})]),i("div",ln,[n(ke),n(ve,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(a(),S(ee,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:f(()=>[n(x,{icon:"fa-solid fa-magic",class:"mr-2"}),C(" "+r(e.$t("kling.button.extend")),1)]),_:1},8,["onClick"])):(a(),S(ee,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:f(()=>[n(x,{icon:"fa-solid fa-magic",class:"mr-2"}),C(" "+r(e.$t("kling.button.generate")),1)]),_:1},8,["onClick"]))]),n(be,{modelValue:e.inspirationOpen,"onUpdate:modelValue":t[1]||(t[1]=te=>e.inspirationOpen=te)},null,8,["modelValue"])])}const cn=w(nn,[["render",rn]]),dn=y({name:"MotionImage",components:{ElUpload:N,ElButton:M,InfoIcon:I,FontAwesomeIcon:L,ImagePreview:j},mixins:[J,O],data(){return{fileList:[],uploadUrl:K()+"/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(){b.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){b.error(this.$t("kling.message.uploadReferencesError"))},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,image_url:void 0})},onSetImageUrl(){const e=this.urls?.[0];this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,image_url:e})},async onSuccess(){this.onSetImageUrl()}}}),un={class:"relative"},mn={class:"flex justify-between"},pn={class:"flex justify-start items-center"},gn={class:"text-sm font-bold"};function fn(e,t,s,l,u,$){const d=o("info-icon"),p=o("image-preview"),g=o("font-awesome-icon"),c=o("el-button"),k=o("el-upload");return a(),m("div",un,[i("div",mn,[i("div",pn,[i("span",gn,r(e.$t("kling.name.motionImage")),1),n(d,{content:e.$t("kling.description.motionImage")},null,8,["content"])])]),n(k,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=h=>e.fileList=h),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:f(({file:h})=>[h.url&&h.percentage!==void 0?(a(),S(p,{key:0,url:h.url,name:h.name,percentage:h.percentage,onRemove:_=>e.onRemove(h)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:f(()=>[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:f(()=>[n(g,{icon:"fa-solid fa-upload",class:"icon mr-1"}),C(" "+r(e.$t("kling.button.uploadReferences")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const hn=w(dn,[["render",fn],["__scopeId","data-v-e52eaf2f"]]),_n=y({name:"MotionVideo",components:{ElUpload:N,ElButton:M,InfoIcon:I,FilePreview:Pe,FontAwesomeIcon:L},mixins:[O],data(){return{fileList:[],uploadUrl:K()+"/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(){b.warning(this.$t("kling.message.uploadVideoExceed"))},onError(){b.error(this.$t("kling.message.uploadVideoError"))},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,video_url:void 0})},beforeUpload(e){const t=e.type==="video/mp4"||e.type==="video/quicktime",s=e.size/1024/1024<100;return t?s?!0:(b.error(this.$t("kling.message.uploadVideoSizeExceed")),!1):(b.error(this.$t("kling.message.uploadVideoTypeFailed")),!1)},onSetVideoUrl(){const e=this.urls?.[0];this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,video_url:e})},async onSuccess(){this.onSetVideoUrl()}}}),$n={class:"relative"},kn={class:"flex justify-between"},vn={class:"flex justify-start items-center"},bn={class:"text-sm font-bold"};function yn(e,t,s,l,u,$){const d=o("info-icon"),p=o("file-preview"),g=o("font-awesome-icon"),c=o("el-button"),k=o("el-upload");return a(),m("div",$n,[i("div",kn,[i("div",vn,[i("span",bn,r(e.$t("kling.name.motionVideo")),1),n(d,{content:e.$t("kling.description.motionVideo")},null,8,["content"])])]),n(k,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=h=>e.fileList=h),accept:".mp4,.mov",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"before-upload":e.beforeUpload,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:f(({file:h})=>[h.percentage!==void 0?(a(),S(p,{key:0,url:h.url||h.response?.file_url,name:h.name,percentage:h.percentage,onRemove:_=>e.onRemove(h)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:f(()=>[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:f(()=>[n(g,{icon:"fa-solid fa-upload",class:"icon mr-1"}),C(" "+r(e.$t("kling.button.uploadVideoUrl")),1)]),_:1})]),_:1},8,["file-list","action","before-upload","on-exceed","on-error","on-success","headers"])])}const wn=w(_n,[["render",yn],["__scopeId","data-v-7019a8d2"]]),Cn=y({name:"MotionPromptInput",components:{ElInput:he,InfoIcon:I},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||""},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),Sn={class:"field"},Vn={class:"box"},In={class:"title font-bold"};function Tn(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-input");return a(),m("div",Sn,[i("div",Vn,[i("h2",In,r(e.$t("kling.name.motionPrompt")),1),n(d,{content:e.$t("kling.description.motionPrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=g=>e.prompt=g),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.motionPrompt")},null,8,["modelValue","placeholder"])])}const En=w(Cn,[["render",Tn],["__scopeId","data-v-ca9fdbe5"]]),re="video",Ln=y({name:"CharacterOrientationSelector",components:{ElRadioGroup:Ke,ElRadioButton:Ge,InfoIcon:I},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||re},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,character_orientation:e})}}},mounted(){this.$store.state.kling?.motionConfig?.character_orientation||(this.value=re)}}),Mn={class:"field"},Un={class:"header"},Rn={class:"text-sm font-bold"};function An(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-radio-button"),g=o("el-radio-group");return a(),m("div",Mn,[i("div",Un,[i("span",Rn,r(e.$t("kling.name.characterOrientation")),1),n(d,{content:e.$t("kling.description.characterOrientation")},null,8,["content"])]),n(g,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),size:"small",class:"value"},{default:f(()=>[n(p,{label:"image"},{default:f(()=>[C(r(e.$t("kling.name.orientationImage")),1)]),_:1}),n(p,{label:"video"},{default:f(()=>[C(r(e.$t("kling.name.orientationVideo")),1)]),_:1})]),_:1},8,["modelValue"])])}const Dn=w(Ln,[["render",An],["__scopeId","data-v-7a91195b"]]),ce="std",Pn=y({name:"MotionModeSelector",components:{ElSelect:G,ElOption:P,InfoIcon:I},computed:{options(){return[{value:"std",label:this.$t("kling.name.modeStd")},{value:"pro",label:this.$t("kling.name.modePro")}]},value:{get(){return this.$store.state.kling?.motionConfig?.mode||ce},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=ce)}}),Gn={class:"field"},Kn={class:"header"},On={class:"title font-bold"};function jn(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-option"),g=o("el-select");return a(),m("div",Gn,[i("div",Kn,[i("h2",On,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.motionMode")},null,8,["content"])]),n(g,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),class:"value",placeholder:e.$t("kling.placeholder.select")},{default:f(()=>[(a(!0),m(V,null,T(e.options,c=>(a(),S(p,{key:c.value,label:c.label,value:c.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Nn=w(Pn,[["render",jn],["__scopeId","data-v-1295688c"]]),Bn=y({name:"KeepOriginalSoundSelector",components:{ElSwitch:fe,InfoIcon:I},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"})}}}}),zn={class:"relative"},Fn={class:"flex justify-between items-center"},qn={class:"flex justify-start items-center"},Hn={class:"text-sm font-bold"};function Wn(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-switch");return a(),m("div",zn,[i("div",Fn,[i("div",qn,[i("span",Hn,r(e.$t("kling.name.keepOriginalSound")),1),n(d,{content:e.$t("kling.description.keepOriginalSound")},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=g=>e.value=g)},null,8,["modelValue"])])])}const Jn=w(Bn,[["render",Wn]]),Qn=y({name:"MotionPanel",components:{ElButton:M,FontAwesomeIcon:L,Consumption:me,MotionImage:hn,MotionVideo:wn,MotionPromptInput:En,CharacterOrientationSelector:Dn,MotionModeSelector:Nn,KeepOriginalSoundSelector:Jn},emits:["generate"],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return _e(this.motionConfig,this.service?.cost)},service(){return this.$store.state.kling?.service},canGenerate(){const e=this.motionConfig;return!!(e?.image_url&&e?.video_url)}},methods:{onGenerate(){this.$emit("generate")}}}),Yn={class:"flex flex-col h-full"},Xn={class:"flex-1 overflow-y-auto p-5"},Zn={class:"flex flex-col items-center justify-center px-5 pb-5"};function xn(e,t,s,l,u,$){const d=o("motion-image"),p=o("motion-video"),g=o("motion-prompt-input"),c=o("character-orientation-selector"),k=o("motion-mode-selector"),h=o("keep-original-sound-selector"),_=o("consumption"),E=o("font-awesome-icon"),R=o("el-button");return a(),m("div",Yn,[i("div",Xn,[n(d,{class:"mb-3"}),n(p,{class:"mb-3"}),n(g,{class:"mb-4"}),n(c,{class:"mb-4"}),n(k,{class:"mb-4"}),n(h,{class:"mb-4"})]),i("div",Zn,[n(_,{value:e.consumption,service:e.service},null,8,["value","service"]),n(R,{type:"primary",class:"btn w-full",round:"",disabled:!e.canGenerate,onClick:e.onGenerate},{default:f(()=>[n(E,{icon:"fa-solid fa-magic",class:"mr-2"}),C(" "+r(e.$t("kling.button.generateMotion")),1)]),_:1},8,["disabled","onClick"])])])}const es=w(Qn,[["render",xn]]),ts=y({name:"KlingTabSwitcher",components:{ElTabs:je,ElTabPane:Oe,ElTag:Se},props:{modelValue:{type:String,default:"videos"}},emits:["update:modelValue"],computed:{tabs(){return[{value:"videos",label:this.$t("kling.tab.videoGeneration")},{value:"motion",label:this.$t("kling.tab.motionControl")}]}},methods:{onUpdate(e){this.$emit("update:modelValue",e)}}}),os=["title"],ns={class:"text"};function ss(e,t,s,l,u,$){const d=o("el-tag"),p=o("el-tab-pane"),g=o("el-tabs");return a(),S(g,{"model-value":e.modelValue,class:"kling-tabs",stretch:"","onUpdate:modelValue":e.onUpdate},{default:f(()=>[(a(!0),m(V,null,T(e.tabs,c=>(a(),S(p,{key:c.value,name:c.value,disabled:c.disabled},{label:f(()=>[i("span",{class:"tab-label",title:c.disabled?c.disabledReason:void 0},[i("span",ns,r(c.label),1),c.badge?(a(),S(d,{key:0,size:"small",type:"warning",class:"badge"},{default:f(()=>[C(r(c.badge),1)]),_:2},1024)):v("",!0)],8,os)]),_:2},1032,["name","disabled"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])}const is=w(ts,[["render",ss],["__scopeId","data-v-bf00c27e"]]),as=y({name:"TaskPreview",components:{ElImage:qe,CopyToClipboard:Ne,FontAwesomeIcon:L,ElAlert:Fe,VideoPlayer:Be,ElTooltip:Q,ElButton:M,ImagePreview:j,ApiCodeButton:ze},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},referenceImages(){const e=[],t=this.modelValue?.request?.start_image_url,s=this.modelValue?.request?.end_image_url;return t&&e.push({url:t,name:"start-image"}),s&&e.push({url:s,name:"end-image"}),e}},methods:{onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onOpenVideo(e){window.open(e,"_blank")}}}),ls={class:"preview"},rs={class:"left"},cs={class:"main"},ds={class:"bot"},us={class:"datetime"},ms={class:"info"},ps={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},gs={key:1,class:"prompt mt-2"},fs={key:0},hs={key:1},_s={key:0,class:U({content:!0,failed:!0})},$s={key:0,class:"mb-4"},ks={key:1,class:U({operations:!0,"mt-2":!0})},vs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},bs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ys={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},ws={key:1,class:U({content:!0})},Cs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ss={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Vs={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Is={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Ts={key:2,class:U({content:!0})},Es={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ls={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Ms(e,t,s,l,u,$){const d=o("el-image"),p=o("image-preview"),g=o("video-player"),c=o("el-button"),k=o("el-tooltip"),h=o("api-code-button"),_=o("font-awesome-icon"),E=o("copy-to-clipboard"),R=o("el-alert");return a(),m("div",ls,[i("div",rs,[n(d,{src:"https://cdn.acedata.cloud/qpbbbb.jpg",class:"avatar"})]),i("div",cs,[i("div",ds,[C(r(e.$t("kling.name.klingBot"))+" ",1),i("span",us,r(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),i("div",ms,[e.referenceImages.length>0?(a(),m("div",ps,[(a(!0),m(V,null,T(e.referenceImages,(A,B)=>(a(),S(p,{key:B,url:A.url,name:A.name,closable:!1},null,8,["url","name"]))),128))])):v("",!0),e.modelValue?.request?.prompt?(a(),m("p",gs,[C(r(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?v("",!0):(a(),m("span",fs," - ("+r(e.$t("kling.status.pending"))+") ",1)),e.modelValue?.response?.state==="submitted"||e.modelValue?.response?.state==="processing"||e.modelValue?.response?.state==="pending"||e.modelValue?.response?.state==="completed"?(a(),m("span",hs," - ("+r(e.$t("kling.status.processing"))+") ",1)):v("",!0)])):v("",!0)]),e.modelValue?.response?.success===!0?(a(),m("div",_s,[e.modelValue?.response.video_url?(a(),m("div",$s,[n(g,{src:e.modelValue?.response.video_url},null,8,["src"])])):v("",!0),e.modelValue?.response.success?(a(),m("div",ks,[n(k,{class:"box-item",effect:"dark",content:e.$t("kling.message.downloadVideo"),placement:"top-start"},{default:f(()=>[e.modelValue?.response.video_url?(a(),S(c,{key:0,type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=A=>e.onDownload(A,e.modelValue?.response.video_url))},{default:f(()=>[C(r(e.$t("kling.button.download")),1)]),_:1})):v("",!0)]),_:1},8,["content"]),n(h,{path:"/kling/videos",body:e.modelValue?.request},null,8,["body"])])):v("",!0),n(R,{closable:!1,class:"mt-2 success"},{default:f(()=>[i("p",vs,[n(_,{icon:"fa-solid fa-hashtag",class:"mr-1"}),C(" "+r(e.$t("kling.name.model"))+": "+r(e.modelValue?.request?.model),1)]),i("p",bs,[n(_,{icon:"fa-solid fa-magic",class:"mr-1"}),C(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(E,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(a(),m("p",ys,[n(_,{icon:"fa-solid fa-clock",class:"mr-1"}),C(" "+r(e.$t("kling.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):v("",!0)]),_:1})])):v("",!0),e.modelValue?.response?.success===!1?(a(),m("div",ws,[n(R,{closable:!1,class:"failure"},{template:f(()=>[n(_,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),C(" "+r(e.$t("kling.name.failure")),1)]),default:f(()=>[i("p",Cs,[n(_,{icon:"fa-solid fa-magic",class:"mr-1"}),C(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(E,{content:e.modelValue?.id},null,8,["content"])]),i("p",Ss,[n(_,{icon:"fa-solid fa-circle-info",class:"mr-1"}),C(" "+r(e.$t("kling.name.failureReason"))+": "+r(e.modelValue?.response?.error?.message)+" ",1),n(E,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(a(),m("p",Vs,[n(_,{icon:"fa-solid fa-clock",class:"mr-1"}),C(" "+r(e.$t("kling.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):v("",!0),e.modelValue?.response?.trace_id?(a(),m("p",Is,[n(_,{icon:"fa-solid fa-hashtag",class:"mr-1"}),C(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(E,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):v("",!0)]),_:1})])):v("",!0),e.modelValue?.response?.success===void 0?(a(),m("div",Ts,[n(R,{closable:!1,class:"info"},{template:f(()=>[n(_,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),C(" "+r(e.$t("kling.name.failure")),1)]),default:f(()=>[i("p",Es,[n(_,{icon:"fa-solid fa-magic",class:"mr-1"}),C(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(E,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.response?.trace_id?(a(),m("p",Ls,[n(_,{icon:"fa-solid fa-hashtag",class:"mr-1"}),C(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(E,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):v("",!0)]),_:1})])):v("",!0)])])}const Us=w(as,[["render",Ms],["__scopeId","data-v-422e2570"]]),Rs=y({name:"RecentPanel",components:{TaskPreview:Us,NoTasks:De,BotPlaceholder:He,ScrollList:Me},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?.()}}}),As={key:0},Ds={key:2,class:"w-full h-full flex items-center justify-center"};function Ps(e,t,s,l,u,$){const d=o("bot-placeholder"),p=o("task-preview"),g=o("scroll-list"),c=o("no-tasks");return a(),m(V,null,[e.tasks?.items===void 0?(a(),m("div",As,[n(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(a(),S(g,{key:1,ref:"scrollList",class:"h-full w-full overflow-y-auto tasks",loading:e.loading,onReachTop:t[0]||(t[0]=k=>e.$emit("reach-top"))},{default:f(()=>[(a(!0),m(V,null,T(e.tasks?.items,k=>(a(),S(p,{key:k.id,"model-value":k},null,8,["model-value"]))),128))]),_:1},8,["loading"])):v("",!0),e.tasks?.items?.length===0?(a(),m("div",Ds,[n(c)])):v("",!0)],64)}const Gs=w(Rs,[["render",Ps]]),de=Ve("kling"),Ks=y({name:"KlingIndex",components:{ConfigPanel:cn,MotionPanel:es,TabSwitcher:is,Layout:Ze,RecentPanel:Gs},mixins:[Re],inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===se.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===se.Request||this.fetchingTasks},credential(){return this.$store.state.kling.credential},config(){return this.$store.state.kling.config},motionConfig(){return this.$store.state.kling.motionConfig},taskType(){return this.$store.state.kling.taskType||"videos"},tasks(){return this.$store.state.kling.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await Ue({tasks:this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("kling/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("kling/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:s,createdAtMax:l}=e||{};console.debug("limit",t,"createdAtMin",s,"createdAtMax",l),this.fetchingTasks=!0;try{await this.$store.dispatch("kling/getTasks",{limit:t,createdAtMin:s,createdAtMax:l})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!ae(this.uploadTracker,u=>this.$t(u),u=>b.warning(u)))return;const{camera_control:e,...t}=this.config||{},s={...t,callback_url:de};if(!s.video_id&&!t.video_url&&!s.start_image_url&&s.end_image_url){b.warning(this.$t("kling.message.endImageRequiresStart"));return}s.action||(s.video_id||t.video_url?s.action="extend":s.start_image_url?s.action="image2video":s.action="text2video"),s.action==="text2video"&&s.end_image_url&&delete s.end_image_url,e?.type&&(s.camera_control={type:e.type,...e.type==="simple"&&e.config?{config:Object.fromEntries(Object.entries(e.config).filter(([,u])=>u!=null))}:{}});const l=this.credential?.token;if(!l){console.error("no token specified");return}b.info(this.$t("kling.message.startingTask")),oe("kling",ne.generate(s,{token:l})).then(()=>{b.success(this.$t("kling.message.startTaskSuccess"))}).catch(u=>{u?.response?.data?.error?.code===le?b.error(this.$t("kling.message.usedUp")):b.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},async onTabChange(e){e!==this.taskType&&(await this.$store.dispatch("kling/setTaskType",e),await this.onGetTasks(),await this.onScrollDown())},async onGenerateMotion(){if(!ae(this.uploadTracker,l=>this.$t(l),l=>b.warning(l)))return;const e=this.motionConfig||{};if(!e.image_url||!e.video_url){b.warning(this.$t("kling.message.motionMissingInputs"));return}const t={image_url:e.image_url,video_url:e.video_url,character_orientation:e.character_orientation||"video",mode:e.mode||"std",keep_original_sound:e.keep_original_sound??"yes",...e.prompt?{prompt:e.prompt}:{},callback_url:de},s=this.credential?.token;if(!s){console.error("no token specified");return}b.info(this.$t("kling.message.startingTask")),oe("kling",ne.motion(t,{token:s})).then(()=>{b.success(this.$t("kling.message.startTaskSuccess"))}).catch(l=>{l?.response?.data?.error?.code===le?b.error(this.$t("kling.message.usedUp")):b.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),Os={class:"flex flex-col h-full"},js={class:"flex-1 min-h-0"};function Ns(e,t,s,l,u,$){const d=o("tab-switcher"),p=o("config-panel"),g=o("motion-panel"),c=o("recent-panel"),k=o("layout");return a(),S(k,null,{config:f(()=>[i("div",Os,[n(d,{"model-value":e.taskType,"onUpdate:modelValue":e.onTabChange},null,8,["model-value","onUpdate:modelValue"]),i("div",js,[e.taskType==="videos"?(a(),S(p,{key:0,onGenerate:e.onGenerate},null,8,["onGenerate"])):e.taskType==="motion"?(a(),S(g,{key:1,onGenerate:e.onGenerateMotion},null,8,["onGenerate"])):v("",!0)])])]),result:f(()=>[n(c,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Wi=w(Ks,[["render",Ns]]);export{Wi as default};
|
|
1
|
+
import{F as L}from"./index.es-Dz2WW0mO.js";import{E as M}from"./index-BGH0IgYz.js";import{E as ue}from"./index-BsyPjG1u.js";import{d as y,H as m,E as i,z,C as n,y as f,D as o,q as a,F as r,x as S,O as V,N as T,Q as U,J as v,R as ye,I as C,M as we}from"./vendor-vue-NSDaktjZ.js";import{H as w,bp as K,ah as Ce,I as Se,cs as oe,aI as ne,S as se,ct as Ve}from"./index-D4JEvBET.js";import{a as Ie,b as ie,c as H,d as D,e as Te,f as Ee,g as Le}from"./kling-DwJwIwVI.js";import{E as P,a as G}from"./index-cFJ_-B0U.js";import{E as W}from"./index-Cpx6uL0j.js";import{E as b}from"./index-B7TkhThA.js";import{I,S as Me,l as Ue}from"./pagination-33HYpCcx.js";import{p as J}from"./pasteUploadMixin-BurWbGNQ.js";import{u as O,a as Re,e as ae}from"./uploadTrackerMixin--N-yU8Tl.js";import{I as j}from"./ImagePreview-Dw054CSM.js";import{E as Q}from"./index-DKUx2sg9.js";import{E as N}from"./index-CV7E7mDR.js";import{C as me}from"./Consumption-C3jg3b7m.js";import{E as pe}from"./index-4sGswbzA.js";import{E as ge}from"./index-DE1_SThE.js";import{E as fe}from"./index-DPatKvBa.js";import{P as Ae,N as De}from"./NoTasks-D5RXiO5t.js";import{E as he}from"./index-CEDF6g8f.js";import{a as _e}from"./price-BkNDLX8f.js";import{F as Pe}from"./FilePreview-BQxO2UWY.js";import{E as Ge,a as Ke}from"./index-DC-SxuPE.js";import{E as Oe,a as je}from"./index-C6maAFlu.js";import{b as le}from"./errorCode-Cqj9Td_Z.js";import{C as Ne}from"./CopyToClipboard-D8319xRo.js";import{V as Be}from"./VideoPlayer-Bbn9KAtz.js";import{A as ze}from"./ApiCodeButton-DbBsqIvO.js";import{E as Fe}from"./index-BeLJU121.js";import{E as qe}from"./index-DHCVQU69.js";import{B as He}from"./BotPlaceholder-CurzhF4I.js";import"./use-form-item-CfxgrMhy.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Df5ITouH.js";import"./index-BZzjVj6a.js";import"./typescript-BxdtUEmf.js";import"./index-DAQQMQN_.js";import"./strings-beZM2Y-f.js";import"./isEqual-CCMJAc_b.js";import"./_Uint8Array-CPbtsK4f.js";import"./castArray-CJc4u1FY.js";import"./debounce-Cix8aYnY.js";import"./_baseIteratee-DisFYsdP.js";import"./index-C1eN8oxJ.js";import"./validator-Bz8-M2lh.js";import"./highlight-DRPB0jUE.js";import"./index-BLjywj98.js";import"./vendor-highlight-lEWW1Jxd.js";import"./index-ClZhoIFv.js";import"./_baseClone-XRiJGh2W.js";import"./_initCloneObject-CugDqvBf.js";import"./index-Cu41y2Fl.js";import"./index-DGOShBRo.js";import"./isPlainObject-woldJKog.js";import"./vue-plyr-BO2nlN4c.js";import"./index-BIE-c4ov.js";const We=y({name:"LayoutKling",components:{ElDrawer:ue,ElButton:M,FontAwesomeIcon:L},data(){return{drawer:!1}}}),Je={class:"main flex flex-row flex-1 min-h-0"},Qe={class:"config w-[320px] flex-none h-full flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},Ye={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function Xe(e,t,s,l,u,$){const d=o("font-awesome-icon"),p=o("el-button"),g=o("el-drawer");return a(),m("div",Je,[i("div",Qe,[z(e.$slots,"config",{},void 0,!0)]),i("div",Ye,[z(e.$slots,"result",{},void 0,!0)]),n(p,{circle:"",class:"menu",onClick:t[0]||(t[0]=c=>e.drawer=!0)},{default:f(()=>[n(d,{icon:"fa-solid fa-magic"})]),_:1}),n(g,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=c=>e.drawer=c),direction:"ltr","with-header":!1,size:"350px"},{default:f(()=>[z(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Ze=w(We,[["render",Xe],["__scopeId","data-v-be4bb0df"]]),xe={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function Y(e,t,s){const l=t||"std",u=s??5;switch(e){case"kling-v1":return{text2video:!0,image2video:!0,endImage:u===5,audio:!1,motionControl:u===5};case"kling-v1-6":case"kling-v2-5-turbo":return{text2video:!0,image2video:!0,endImage:l==="pro",audio:!1,motionControl:!1};case"kling-v2-6":return{text2video:!0,image2video:!0,endImage:l==="pro",audio:l==="pro",motionControl:!1};case"kling-v2-master":case"kling-v2-1-master":return{text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};case"kling-v3":return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:l!=="4k"};case"kling-v3-omni":return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:!1};case"kling-video-o1":return{text2video:!0,image2video:!0,endImage:!0,audio:!1,motionControl:!1};default:return xe}}function X(e,t){if(!e)return[];const s=t.model??e.model,l=t.mode??e.mode,u=t.duration??e.duration;if(!s)return[];const $=Y(s,l,u),d=[];return e.end_image_url&&!$.endImage&&d.push({field:"end_image_url",i18nLabel:"kling.name.endImage"}),e.generate_audio&&!$.audio&&d.push({field:"generate_audio",i18nLabel:"kling.name.generateAudio"}),e.camera_control?.type&&(!$.motionControl||e.start_image_url)&&d.push({field:"camera_control",i18nLabel:"kling.name.cameraControl"}),d}function Z(e,t){const s={...e};for(const l of t)l.field==="end_image_url"&&(s.end_image_url=void 0),l.field==="generate_audio"&&(s.generate_audio=!1),l.field==="camera_control"&&(s.camera_control=void 0);return s}const et=y({name:"ModelSelector",components:{ElSelect:G,ElOption:P},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{revertKey:0,options:[{value:"kling-v3",label:"v3"},{value:"kling-v3-omni",label:"v3-Omni"},{value:"kling-v2-6",label:"v2.6"},{value:"kling-v2-5-turbo",label:"v2.5-Turbo"},{value:"kling-v2-1-master",label:"v2.1-Master"},{value:"kling-v2-master",label:"v2-Master"},{value:"kling-v1-6",label:"v1.6"},{value:"kling-v1",label:"v1"},{value:"kling-video-o1",label:"Video-o1"}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(Ie)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=X(t,{model:e});if(s.length===0){this.applyModel(e);return}const l=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await W.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:l}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=Z({...t,model:e},s);this.$store.commit("kling/setConfig",u),b.success(this.$t("kling.message.featureRemovedNotice",{fields:l}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,model:e})}}}),tt={class:"field"},ot={class:"title font-bold"};function nt(e,t,s,l,u,$){const d=o("el-option"),p=o("el-select");return a(),m("div",tt,[i("h2",ot,r(e.$t("pika.name.model")),1),(a(),S(p,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("pika.placeholder.select"),onChange:e.onChange},{default:f(()=>[(a(!0),m(V,null,T(e.options,g=>(a(),S(d,{key:g.value,label:g.label,value:g.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const st=w(et,[["render",nt],["__scopeId","data-v-04059875"]]),it=y({name:"ModeSelector",components:{ElSelect:G,ElOption:P,InfoIcon:I},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 H.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(ie)}},mounted(){this.value||this.applyMode(ie)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=X(t,{mode:e});if(s.length===0){this.applyMode(e);return}const l=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await W.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:l}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=Z({...t,mode:e},s);this.$store.commit("kling/setConfig",u),b.success(this.$t("kling.message.featureRemovedNotice",{fields:l}))}catch{this.revertKey+=1}},applyMode(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,mode:e})}}}),at={class:"field"},lt={class:"header"},rt={class:"title font-bold"},ct={key:0,class:"opt-tip"};function dt(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-option"),g=o("el-select");return a(),m("div",at,[i("div",lt,[i("h2",rt,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.mode"),class:"info-icon"},null,8,["content"])]),(a(),S(g,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("kling.placeholder.select"),clearable:!0,onChange:e.onChange},{default:f(()=>[(a(!0),m(V,null,T(e.options,c=>(a(),S(p,{key:c.value,label:c.label,value:c.value,disabled:c.disabled},{default:f(()=>[i("span",{class:U({"opt-disabled":c.disabled})},r(c.label),3),c.disabled&&c.disabledReason?(a(),m("span",ct,r(c.disabledReason),1)):v("",!0)]),_:2},1032,["label","value","disabled"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const ut=w(it,[["render",dt],["__scopeId","data-v-9a8fa3c5"]]),mt=[3,5,8,10,12,15],pt=[5,10],gt=y({name:"DurationSelector",components:{ElSelect:G,ElOption:P,InfoIcon:I},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},isV3Model(){return H.includes(this.selectedModel)},allowedDurations(){return this.isV3Model?mt:pt},value(){return this.$store.state.kling?.config?.duration??D},selectValue(){const e=this.allowedDurations;return e.includes(this.value)?this.value:e.includes(D)?D:e[0]}},watch:{isV3Model(){this.allowedDurations.includes(this.value)||this.applyDuration(D)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(D)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=X(t,{duration:e});if(s.length===0){this.applyDuration(e);return}const l=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await W.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:l}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=Z({...t,duration:e},s);this.$store.commit("kling/setConfig",u),b.success(this.$t("kling.message.featureRemovedNotice",{fields:l}))}catch{this.revertKey+=1}},applyDuration(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,duration:e})}}}),ft={class:"field"},ht={class:"control"},_t={class:"label"},$t={class:"title font-bold"};function kt(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-option"),g=o("el-select");return a(),m("div",ft,[i("div",ht,[i("div",_t,[i("h2",$t,r(e.$t("kling.name.duration")),1),n(d,{content:e.$t("kling.description.duration"),class:"info-icon ml-1"},null,8,["content"])]),(a(),S(g,{key:e.revertKey,"model-value":e.selectValue,class:"value",placeholder:e.$t("kling.placeholder.select"),onChange:e.onChange},{default:f(()=>[(a(!0),m(V,null,T(e.allowedDurations,c=>(a(),S(p,{key:c,label:`${c}s`,value:c},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])])}const vt=w(gt,[["render",kt],["__scopeId","data-v-5ae55e28"]]),bt=y({name:"RatioSelector",data(){return{options:[{value:"1:1",label:"1:1",width:20,height:20},{value:"16:9",label:"16:9",width:25,height:13},{value:"9:16",label:"9:16",width:13,height:25}]}},computed:{active(){return this.options.findIndex(e=>e.value===this.value)||0},value:{get(){return this.$store.state?.kling?.config?.aspect_ratio},set(e){console.debug("set ratio",e),this.$store.commit("kling/setConfig",{...this.$store.state?.kling?.config,aspect_ratio:e})}}},mounted(){this.value||(this.value=Te)}}),yt={class:"text-sm font-bold mb-2 block"},wt={class:"items"},Ct=["onClick"],St={class:"name"};function Vt(e,t,s,l,u,$){return a(),m("div",null,[i("span",yt,r(e.$t("kling.name.ratio")),1),i("div",wt,[(a(!0),m(V,null,T(e.options,(d,p)=>(a(),m("div",{key:p,class:U({active:e.active===p,item:!0}),onClick:g=>e.value=d.value},[i("div",{class:U(["preview",d.label])},[i("div",{class:"rect",style:ye({width:d.width+"px",height:d.height+"px"})},null,4)],2),i("p",St,r(d.label),1)],10,Ct))),128))])])}const It=w(bt,[["render",Vt],["__scopeId","data-v-cdb14b2f"]]),Tt=y({name:"StartImage",components:{ElUpload:N,ElButton:M,ElTooltip:Q,InfoIcon:I,FontAwesomeIcon:L,ImagePreview:j},mixins:[J,O],emits:["change"],data(){return{fileList:[],uploadUrl:K()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},value:{get(){return this.$store.state?.kling?.config?.start_image_url},set(){}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){b.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){b.error(this.$t("kling.message.uploadReferencesError"))},onSetStartImageUrl(){const e=this.urls?.[0];this.$store.commit("kling/setConfig",{...this.$store.state?.kling?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),Et={class:"relative"},Lt={class:"flex justify-between"},Mt={class:"flex justify-start items-center"},Ut={class:"text-sm font-bold"};function Rt(e,t,s,l,u,$){const d=o("info-icon"),p=o("image-preview"),g=o("font-awesome-icon"),c=o("el-button"),k=o("el-tooltip"),h=o("el-upload");return a(),m("div",Et,[i("div",Lt,[i("div",Mt,[i("span",Ut,r(e.$t("kling.name.startImage")),1),n(d,{content:e.$t("kling.description.uploadStartImage")},null,8,["content"])])]),n(h,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,disabled:e.reachedLimit,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:f(({file:_})=>[_.url&&_.percentage!==void 0?(a(),S(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:E=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:f(()=>[n(k,{content:e.$t("kling.message.uploadReferencesExceed"),disabled:!e.reachedLimit,placement:"top"},{default:f(()=>[i("span",null,[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.reachedLimit},{default:f(()=>[n(g,{icon:"fa-solid fa-upload",class:"icon mr-1"}),C(" "+r(e.$t("kling.button.uploadReferences")),1)]),_:1},8,["disabled"])])]),_:1},8,["content","disabled"])]),_:1},8,["file-list","disabled","action","on-exceed","on-error","on-success","headers"])])}const At=w(Tt,[["render",Rt],["__scopeId","data-v-756dc269"]]),Dt=y({name:"EndImage",components:{ElUpload:N,ElButton:M,ElTooltip:Q,ImagePreview:j,InfoIcon:I,FontAwesomeIcon:L},mixins:[J,O],data(){return{fileList:[],uploadUrl:K()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},klingConfig(){return this.$store.state?.kling?.config||{}},endImageSupported(){return Y(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},hasStartImage(){return!!this.klingConfig.start_image_url},uploadDisabled(){return this.reachedLimit||!this.endImageSupported||!this.hasStartImage},uploadTooltip(){return this.endImageSupported?this.hasStartImage?this.reachedLimit?this.$t("kling.message.uploadReferencesExceed"):"":this.$t("kling.message.endImageRequiresStart"):this.$t("kling.message.endImageNotSupported")},storeValue(){return this.klingConfig.end_image_url},value:{get(){return this.storeValue},set(){}}},watch:{storeValue(e){!e&&this.fileList.length>0&&(this.fileList=[])},hasStartImage(e){!e&&this.storeValue&&(this.fileList=[],this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,end_image_url:void 0}))}},mounted(){this.value||(this.value=void 0),this.onSetEndImageUrl()},methods:{onBeforeUpload(){return this.endImageSupported?this.hasStartImage?!0:(b.warning(this.$t("kling.message.endImageRequiresStart")),!1):(b.warning(this.$t("kling.message.endImageNotSupported")),!1)},onExceed(){b.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){b.error(this.$t("kling.message.uploadReferencesError"))},onSetEndImageUrl(){const e=this.urls?.[0];this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),Pt={class:"relative"},Gt={class:"flex justify-between"},Kt={class:"flex justify-start items-center"},Ot={class:"text-sm font-bold"};function jt(e,t,s,l,u,$){const d=o("info-icon"),p=o("image-preview"),g=o("font-awesome-icon"),c=o("el-button"),k=o("el-tooltip"),h=o("el-upload");return a(),m("div",Pt,[i("div",Gt,[i("div",Kt,[i("span",Ot,r(e.$t("kling.name.endImage")),1),n(d,{content:e.$t("kling.description.uploadEndImage")},null,8,["content"])])]),n(h,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,disabled:e.uploadDisabled,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","before-upload":e.onBeforeUpload,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:f(({file:_})=>[_.url&&_.percentage!==void 0?(a(),S(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:E=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:f(()=>[n(k,{content:e.uploadTooltip,disabled:!e.uploadDisabled,placement:"top"},{default:f(()=>[i("span",null,[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.uploadDisabled},{default:f(()=>[n(g,{icon:"fa-solid fa-upload",class:"icon mr-1"}),C(" "+r(e.$t("kling.button.uploadReferences")),1)]),_:1},8,["disabled"])])]),_:1},8,["content","disabled"])]),_:1},8,["file-list","disabled","action","before-upload","on-exceed","on-error","on-success","headers"])])}const Nt=w(Dt,[["render",jt],["__scopeId","data-v-c1b257e5"]]),Bt=y({name:"CfgScaleSelector",components:{ElSlider:ge,InfoIcon:I,ElInputNumber:pe},computed:{value:{get(){return this.$store.state?.kling?.config?.cfg_scale},set(e){console.debug("set cfg_scale",e),this.$store.commit("kling/setConfig",{...this.$store.state?.kling?.config,cfg_scale:e})}}},mounted(){this.value||(this.value=Ee)}}),zt={class:"flex justify-between"},Ft={class:"flex justify-start items-center"},qt={class:"text-sm font-bold"},Ht={class:"flex justify-end items-center"},Wt={class:"w-full"};function Jt(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-input-number"),g=o("el-slider");return a(),m("div",null,[i("div",zt,[i("div",Ft,[i("span",qt,r(e.$t("kling.name.cfgScale")),1),n(d,{content:e.$t("kling.description.cfgScale")},null,8,["content"])]),i("div",Ht,[n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),"controls-position":"right"},null,8,["modelValue"])])]),i("div",Wt,[n(g,{modelValue:e.value,"onUpdate:modelValue":t[1]||(t[1]=c=>e.value=c),min:0,max:1,step:.1},null,8,["modelValue"])])])}const Qt=w(Bt,[["render",Jt]]),Yt=y({name:"GenerateAudioSelector",components:{ElSwitch:fe,InfoIcon:I},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},selectedMode(){return this.$store.state.kling?.config?.mode||""},supported(){return!!(H.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??Le:!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})}}}),Xt={class:"relative"},Zt={class:"flex justify-between items-center"},xt={class:"flex justify-start items-center"},eo={class:"text-sm font-bold"};function to(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-switch");return a(),m("div",Xt,[i("div",Zt,[i("div",xt,[i("span",eo,r(e.$t("kling.name.generateAudio")),1),n(d,{content:e.tooltipContent},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=g=>e.value=g),class:"value",disabled:!e.supported},null,8,["modelValue","disabled"])])])}const oo=w(Yt,[["render",to]]),no=["horizontal","vertical","pan","tilt","roll","zoom"],so=y({name:"CameraControlSelector",components:{ElSelect:G,ElOption:P,ElSlider:ge,ElInputNumber:pe,InfoIcon:I},data(){return{configKeys:no}},computed:{typeOptions(){return[{value:"",label:this.$t("kling.name.cameraTypeNone")},{value:"simple",label:this.$t("kling.name.cameraTypeSimple")},{value:"down_back",label:this.$t("kling.name.cameraTypeDownBack")},{value:"forward_up",label:this.$t("kling.name.cameraTypeForwardUp")},{value:"left_turn_forward",label:this.$t("kling.name.cameraTypeLeftTurnForward")},{value:"right_turn_forward",label:this.$t("kling.name.cameraTypeRightTurnForward")}]},selectedMode(){return this.$store.state.kling?.config?.mode||""},selectedModel(){return this.$store.state.kling?.config?.model||""},selectedDuration(){return this.$store.state.kling?.config?.duration},motionControlSupported(){return Y(this.selectedModel,this.selectedMode,this.selectedDuration).motionControl},hasStartImage(){return!!this.$store.state.kling?.config?.start_image_url},disabled(){return!this.motionControlSupported||this.hasStartImage},tooltipContent(){return this.motionControlSupported?this.hasStartImage?this.$t("kling.description.cameraControlDisabledImage2Video"):this.$t("kling.description.cameraControl"):this.$t("kling.description.cameraControlNotSupported")},selectedType(){return this.$store.state.kling?.config?.camera_control?.type},selectedTypeRaw:{get(){return this.selectedType??""},set(e){const t=this.$store.state.kling?.config||{};if(!e){const l={...t};delete l.camera_control,this.$store.commit("kling/setConfig",l);return}const s=e;this.$store.commit("kling/setConfig",{...t,camera_control:{type:s,config:s==="simple"?t.camera_control?.config||{}:void 0}})}},configValues(){return this.$store.state.kling?.config?.camera_control?.config||{}}},watch:{disabled(e){e&&this.selectedType!==void 0&&(this.selectedTypeRaw="")}},methods:{writeConfig(e,t){const s=this.$store.state.kling?.config||{},l=s.camera_control||{type:"simple"},u={...l.config||{}};t==null?delete u[e]:u[e]=t,this.$store.commit("kling/setConfig",{...s,camera_control:{...l,type:"simple",config:u}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),io={class:"field"},ao={class:"header"},lo={class:"text-sm font-bold"},ro={key:0,class:"config-grid"},co={class:"cfg-row-head"},uo={class:"cfg-name"};function mo(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-option"),g=o("el-select"),c=o("el-input-number"),k=o("el-slider");return a(),m("div",io,[i("div",ao,[i("span",lo,r(e.$t("kling.name.cameraControl")),1),n(d,{content:e.tooltipContent},null,8,["content"])]),n(g,{modelValue:e.selectedTypeRaw,"onUpdate:modelValue":t[0]||(t[0]=h=>e.selectedTypeRaw=h),class:"value",placeholder:e.$t("kling.placeholder.cameraType"),clearable:!0,disabled:e.disabled},{default:f(()=>[(a(!0),m(V,null,T(e.typeOptions,h=>(a(),S(p,{key:h.value,label:h.label,value:h.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","disabled"]),e.selectedType==="simple"&&!e.disabled?(a(),m("div",ro,[(a(!0),m(V,null,T(e.configKeys,h=>(a(),m("div",{key:h,class:"cfg-row"},[i("div",co,[i("span",uo,r(e.$t(`kling.name.cc_${h}`)),1),n(c,{modelValue:e.configValues[h],"onUpdate:modelValue":_=>e.configValues[h]=_,min:-1,max:1,step:.1,precision:1,"controls-position":"right",size:"small",class:"cfg-num",onChange:_=>e.onNumberChange(h,_)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),n(k,{"model-value":e.configValues[h]??0,min:-1,max:1,step:.1,onInput:_=>e.onSliderChange(h,_)},null,8,["model-value","onInput"])]))),128))])):v("",!0)])}const po=w(so,[["render",mo],["__scopeId","data-v-cd896060"]]),$e=[{groupKey:"cameraMovements",chipKeys:["rotateAround","stationary","handheld","zoomOut","zoomIn","follow","panRight","tiltUp","tiltDown","orbit"]},{groupKey:"cameraSpeed",chipKeys:["speedSlow","speedMedium","speedFast"]},{groupKey:"shotType",chipKeys:["shotClose","shotMedium","shotLong","shotLowAngle","shotHighAngle","shotShallowDof","shotFront","shotProfile","shotCloseUp","shotDrone"]},{groupKey:"light",chipKeys:["lightSunlight","lightSoft","lightNeon","lightWarm","lightNature","lightCandle","lightCityNight"]},{groupKey:"frame",chipKeys:["frameRichDetails","frameSimpleBg"]},{groupKey:"atmosphere",chipKeys:["atmosphereMysterious","atmospherePeaceful","atmosphereHeartwarming","atmosphereVivid","atmosphereColorful"]}],F=", ";function go(e,t){const s=(e||"").trim();return s?s.includes(t)?s:`${s}${F}${t}`:t}function q(e,t){if(!e||!t)return e||"";const s=[`${t}${F}`,`${F}${t}`,t];let l=e;for(const u of s)if(l.includes(u)){l=l.replace(u,"");break}return l.replace(/(?:,\s*)+$/,"").replace(/^(?:,\s*)+/,"")}const fo=y({name:"InspirationPills",components:{FontAwesomeIcon:L},computed:{prompt(){return this.$store.state.kling?.config?.prompt||""},allChipTexts(){return $e.flatMap(e=>e.chipKeys.map(t=>this.$t(`kling.inspiration.chip.${t}`)))},selected(){const e=this.prompt;if(!e)return[];const t=[];for(const s of this.allChipTexts){const l=e.indexOf(s);l!==-1&&t.push({text:s,idx:l})}return t.sort((s,l)=>s.idx-l.idx).map(s=>s.text)}},methods:{onRemove(e){const t=q(this.prompt,e);this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:t})}}}),ho={key:0,class:"pills",role:"list"},_o={class:"pill-text"},$o=["aria-label","onClick"];function ko(e,t,s,l,u,$){const d=o("font-awesome-icon");return e.selected.length>0?(a(),m("div",ho,[(a(!0),m(V,null,T(e.selected,p=>(a(),m("div",{key:p,class:"pill",role:"listitem"},[i("span",_o,r(p),1),i("button",{type:"button",class:"pill-remove","aria-label":e.$t("kling.inspiration.removeChip"),onClick:we(g=>e.onRemove(p),["stop"])},[n(d,{icon:"fa-solid fa-xmark"})],8,$o)]))),128))])):v("",!0)}const vo=w(fo,[["render",ko],["__scopeId","data-v-5fc4fa65"]]),bo="",yo=y({name:"PromptInput",components:{ElButton:M,FontAwesomeIcon:L,PromptTextarea:Ae,InspirationPills:vo},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||(this.prompt=bo)}});function wo(e,t,s,l,u,$){const d=o("font-awesome-icon"),p=o("el-button"),g=o("inspiration-pills"),c=o("prompt-textarea");return a(),S(c,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||(t[1]=k=>e.prompt=k),title:e.$t("kling.name.prompt"),info:e.$t("kling.description.prompt"),placeholder:e.$t("kling.placeholder.prompt")},{actions:f(()=>[n(p,{text:"",size:"small",class:"inspiration-btn",onClick:t[0]||(t[0]=k=>e.$emit("open-inspiration"))},{default:f(()=>[n(d,{icon:"fa-regular fa-lightbulb",class:"mr-1"}),C(" "+r(e.$t("kling.inspiration.openButton")),1)]),_:1})]),before:f(()=>[n(g)]),_:1},8,["modelValue","title","info","placeholder"])}const Co=w(yo,[["render",wo],["__scopeId","data-v-c01fc1a6"]]),So="",Vo=y({name:"NegativePromptInput",components:{ElInput:he,InfoIcon:I},computed:{prompt:{get(){return this.$store.state.kling?.config?.negative_prompt},set(e){console.debug("set prompt",e),this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,negative_prompt:e})}}},mounted(){this.prompt||(this.prompt=So)}}),Io={class:"field"},To={class:"box"},Eo={class:"title font-bold"};function Lo(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-input");return a(),m("div",Io,[i("div",To,[i("h2",Eo,r(e.$t("kling.name.negativePrompt")),1),n(d,{content:e.$t("kling.description.negativePrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=g=>e.prompt=g),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.negativePrompt")},null,8,["modelValue","placeholder"])])}const Mo=w(Vo,[["render",Lo],["__scopeId","data-v-de98cf01"]]),Uo=y({name:"InspirationDrawer",components:{ElDrawer:ue,ElButton:M,FontAwesomeIcon:L},props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],data(){return{groups:$e,Close:Ce}},computed:{visible:{get(){return this.modelValue},set(e){this.$emit("update:modelValue",e)}},drawerSize(){return window.innerWidth<768?"100%":"380px"},prompt(){return this.$store.state.kling?.config?.prompt||""},allChipTexts(){return this.groups.flatMap(e=>e.chipKeys.map(t=>this.$t(`kling.inspiration.chip.${t}`)))},selectedCount(){return this.allChipTexts.filter(e=>this.isSelected(e)).length}},methods:{chipText(e){return this.$t(`kling.inspiration.chip.${e}`)},isSelected(e){return e?this.prompt.includes(e):!1},setPrompt(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:e})},onToggle(e){e&&(this.isSelected(e)?this.setPrompt(q(this.prompt,e)):this.setPrompt(go(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(const t of this.allChipTexts)for(;e.includes(t);)e=q(e,t);this.setPrompt(e)}}}),Ro={class:"drawer-content"},Ao={class:"drawer-header"},Do={class:"title-row"},Po={class:"title"},Go={class:"hint"},Ko={key:0,class:"selected-bar"},Oo={class:"selected-text"},jo={class:"groups"},No={class:"group-title"},Bo={class:"chip-grid"},zo=["onClick"];function Fo(e,t,s,l,u,$){const d=o("font-awesome-icon"),p=o("el-button"),g=o("el-drawer");return a(),S(g,{modelValue:e.visible,"onUpdate:modelValue":t[1]||(t[1]=c=>e.visible=c),direction:"rtl","with-header":!1,size:e.drawerSize,"custom-class":"kling-inspiration-drawer","destroy-on-close":!1},{default:f(()=>[i("div",Ro,[i("div",Ao,[i("div",Do,[n(d,{icon:"fa-regular fa-lightbulb",class:"mr-2"}),i("span",Po,r(e.$t("kling.inspiration.title")),1)]),n(p,{text:"",icon:e.Close,class:"close-btn",onClick:t[0]||(t[0]=c=>e.visible=!1)},null,8,["icon"])]),i("div",Go,r(e.$t("kling.inspiration.hint")),1),e.selectedCount>0?(a(),m("div",Ko,[i("span",Oo,r(e.$t("kling.inspiration.selectedSummary",{count:e.selectedCount})),1),n(p,{text:"",size:"small",class:"clear-btn",onClick:e.onClearSelected},{default:f(()=>[C(r(e.$t("kling.inspiration.clearSelected")),1)]),_:1},8,["onClick"])])):v("",!0),i("div",jo,[(a(!0),m(V,null,T(e.groups,c=>(a(),m("div",{key:c.groupKey,class:"group"},[i("div",No,r(e.$t(`kling.inspiration.group.${c.groupKey}`)),1),i("div",Bo,[(a(!0),m(V,null,T(c.chipKeys,k=>(a(),m("button",{key:k,type:"button",class:U({chip:!0,active:e.isSelected(e.chipText(k))}),onClick:h=>e.onToggle(e.chipText(k))},r(e.chipText(k)),11,zo))),128))])]))),128))])])]),_:1},8,["modelValue","size"])}const qo=w(Uo,[["render",Fo],["__scopeId","data-v-7d457a69"]]),Ho={"kling-v3":"v3","kling-v3-omni":"v3-Omni","kling-v2-6":"v2.6","kling-v2-5-turbo":"v2.5-Turbo","kling-v2-1-master":"v2.1-Master","kling-v2-master":"v2-Master","kling-v1-6":"v1.6","kling-v1":"v1","kling-video-o1":"Video-o1"},Wo={std:"720p",pro:"1080p","4k":"4K"},Jo=y({name:"SummaryChip",components:{FontAwesomeIcon:L},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){const e=this.config?.model||"kling-v2-5-turbo";return Ho[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||""},modeLabel(){const e=this.config?.mode||"std";return Wo[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),Qo={class:"summary-chip"},Yo=["title"],Xo=["title"],Zo=["title"],xo=["title"],en=["title"];function tn(e,t,s,l,u,$){const d=o("font-awesome-icon");return a(),m("div",Qo,[i("span",{class:"part",title:e.$t("kling.name.model")},r(e.modelLabel),9,Yo),t[0]||(t[0]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.duration")},r(e.durationLabel),9,Xo),t[1]||(t[1]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.ratio")},r(e.aspectRatio||"16:9"),9,Zo),t[2]||(t[2]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.mode")},r(e.modeLabel),9,xo),e.generateAudio?(a(),m("span",{key:0,class:"audio",title:e.$t("kling.name.generateAudio")},[n(d,{icon:"fa-solid fa-headphones"})],8,en)):v("",!0)])}const on=w(Jo,[["render",tn],["__scopeId","data-v-418a6733"]]),nn=y({name:"ConfigPanel",components:{ElButton:M,Consumption:me,FontAwesomeIcon:L,PromptInput:Co,NegativePromptInput:Mo,ModelSelector:st,ModeSelector:ut,DurationSelector:vt,RatioSelector:It,StartImage:At,CfgScaleSelector:Qt,GenerateAudioSelector:oo,CameraControlSelector:po,InspirationDrawer:qo,SummaryChip:on,EndImage:Nt},emits:["generate"],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},consumption(){return _e(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit("generate")}}}),sn={class:"flex flex-col h-full"},an={class:"flex-1 overflow-y-auto p-5"},ln={class:"flex flex-col items-center justify-center px-5 pb-5"};function rn(e,t,s,l,u,$){const d=o("prompt-input"),p=o("model-selector"),g=o("ratio-selector"),c=o("start-image"),k=o("end-image"),h=o("duration-selector"),_=o("mode-selector"),E=o("generate-audio-selector"),R=o("camera-control-selector"),A=o("cfg-scale-selector"),B=o("negative-prompt-input"),ke=o("summary-chip"),ve=o("consumption"),x=o("font-awesome-icon"),ee=o("el-button"),be=o("inspiration-drawer");return a(),m("div",sn,[i("div",an,[n(d,{class:"mb-4",onOpenInspiration:t[0]||(t[0]=te=>e.inspirationOpen=!0)}),n(p,{class:"mb-4"}),n(g,{class:"mb-4"}),n(c,{class:"mb-2"}),n(k,{class:"mb-2"}),n(h,{class:"mb-4"}),n(_,{class:"mb-4"}),n(E,{class:"mb-4"}),n(R,{class:"mb-4"}),n(A,{class:"mb-4"}),n(B,{class:"mb-4"})]),i("div",ln,[n(ke),n(ve,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(a(),S(ee,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:f(()=>[n(x,{icon:"fa-solid fa-magic",class:"mr-2"}),C(" "+r(e.$t("kling.button.extend")),1)]),_:1},8,["onClick"])):(a(),S(ee,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:f(()=>[n(x,{icon:"fa-solid fa-magic",class:"mr-2"}),C(" "+r(e.$t("kling.button.generate")),1)]),_:1},8,["onClick"]))]),n(be,{modelValue:e.inspirationOpen,"onUpdate:modelValue":t[1]||(t[1]=te=>e.inspirationOpen=te)},null,8,["modelValue"])])}const cn=w(nn,[["render",rn]]),dn=y({name:"MotionImage",components:{ElUpload:N,ElButton:M,InfoIcon:I,FontAwesomeIcon:L,ImagePreview:j},mixins:[J,O],data(){return{fileList:[],uploadUrl:K()+"/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(){b.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){b.error(this.$t("kling.message.uploadReferencesError"))},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,image_url:void 0})},onSetImageUrl(){const e=this.urls?.[0];this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,image_url:e})},async onSuccess(){this.onSetImageUrl()}}}),un={class:"relative"},mn={class:"flex justify-between"},pn={class:"flex justify-start items-center"},gn={class:"text-sm font-bold"};function fn(e,t,s,l,u,$){const d=o("info-icon"),p=o("image-preview"),g=o("font-awesome-icon"),c=o("el-button"),k=o("el-upload");return a(),m("div",un,[i("div",mn,[i("div",pn,[i("span",gn,r(e.$t("kling.name.motionImage")),1),n(d,{content:e.$t("kling.description.motionImage")},null,8,["content"])])]),n(k,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=h=>e.fileList=h),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:f(({file:h})=>[h.url&&h.percentage!==void 0?(a(),S(p,{key:0,url:h.url,name:h.name,percentage:h.percentage,onRemove:_=>e.onRemove(h)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:f(()=>[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:f(()=>[n(g,{icon:"fa-solid fa-upload",class:"icon mr-1"}),C(" "+r(e.$t("kling.button.uploadReferences")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const hn=w(dn,[["render",fn],["__scopeId","data-v-e52eaf2f"]]),_n=y({name:"MotionVideo",components:{ElUpload:N,ElButton:M,InfoIcon:I,FilePreview:Pe,FontAwesomeIcon:L},mixins:[O],data(){return{fileList:[],uploadUrl:K()+"/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(){b.warning(this.$t("kling.message.uploadVideoExceed"))},onError(){b.error(this.$t("kling.message.uploadVideoError"))},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,video_url:void 0})},beforeUpload(e){const t=e.type==="video/mp4"||e.type==="video/quicktime",s=e.size/1024/1024<100;return t?s?!0:(b.error(this.$t("kling.message.uploadVideoSizeExceed")),!1):(b.error(this.$t("kling.message.uploadVideoTypeFailed")),!1)},onSetVideoUrl(){const e=this.urls?.[0];this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,video_url:e})},async onSuccess(){this.onSetVideoUrl()}}}),$n={class:"relative"},kn={class:"flex justify-between"},vn={class:"flex justify-start items-center"},bn={class:"text-sm font-bold"};function yn(e,t,s,l,u,$){const d=o("info-icon"),p=o("file-preview"),g=o("font-awesome-icon"),c=o("el-button"),k=o("el-upload");return a(),m("div",$n,[i("div",kn,[i("div",vn,[i("span",bn,r(e.$t("kling.name.motionVideo")),1),n(d,{content:e.$t("kling.description.motionVideo")},null,8,["content"])])]),n(k,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=h=>e.fileList=h),accept:".mp4,.mov",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"before-upload":e.beforeUpload,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:f(({file:h})=>[h.percentage!==void 0?(a(),S(p,{key:0,url:h.url||h.response?.file_url,name:h.name,percentage:h.percentage,onRemove:_=>e.onRemove(h)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:f(()=>[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:f(()=>[n(g,{icon:"fa-solid fa-upload",class:"icon mr-1"}),C(" "+r(e.$t("kling.button.uploadVideoUrl")),1)]),_:1})]),_:1},8,["file-list","action","before-upload","on-exceed","on-error","on-success","headers"])])}const wn=w(_n,[["render",yn],["__scopeId","data-v-7019a8d2"]]),Cn=y({name:"MotionPromptInput",components:{ElInput:he,InfoIcon:I},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||""},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),Sn={class:"field"},Vn={class:"box"},In={class:"title font-bold"};function Tn(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-input");return a(),m("div",Sn,[i("div",Vn,[i("h2",In,r(e.$t("kling.name.motionPrompt")),1),n(d,{content:e.$t("kling.description.motionPrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=g=>e.prompt=g),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.motionPrompt")},null,8,["modelValue","placeholder"])])}const En=w(Cn,[["render",Tn],["__scopeId","data-v-ca9fdbe5"]]),re="video",Ln=y({name:"CharacterOrientationSelector",components:{ElRadioGroup:Ke,ElRadioButton:Ge,InfoIcon:I},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||re},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,character_orientation:e})}}},mounted(){this.$store.state.kling?.motionConfig?.character_orientation||(this.value=re)}}),Mn={class:"field"},Un={class:"header"},Rn={class:"text-sm font-bold"};function An(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-radio-button"),g=o("el-radio-group");return a(),m("div",Mn,[i("div",Un,[i("span",Rn,r(e.$t("kling.name.characterOrientation")),1),n(d,{content:e.$t("kling.description.characterOrientation")},null,8,["content"])]),n(g,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),size:"small",class:"value"},{default:f(()=>[n(p,{label:"image"},{default:f(()=>[C(r(e.$t("kling.name.orientationImage")),1)]),_:1}),n(p,{label:"video"},{default:f(()=>[C(r(e.$t("kling.name.orientationVideo")),1)]),_:1})]),_:1},8,["modelValue"])])}const Dn=w(Ln,[["render",An],["__scopeId","data-v-7a91195b"]]),ce="std",Pn=y({name:"MotionModeSelector",components:{ElSelect:G,ElOption:P,InfoIcon:I},computed:{options(){return[{value:"std",label:this.$t("kling.name.modeStd")},{value:"pro",label:this.$t("kling.name.modePro")}]},value:{get(){return this.$store.state.kling?.motionConfig?.mode||ce},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=ce)}}),Gn={class:"field"},Kn={class:"header"},On={class:"title font-bold"};function jn(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-option"),g=o("el-select");return a(),m("div",Gn,[i("div",Kn,[i("h2",On,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.motionMode")},null,8,["content"])]),n(g,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),class:"value",placeholder:e.$t("kling.placeholder.select")},{default:f(()=>[(a(!0),m(V,null,T(e.options,c=>(a(),S(p,{key:c.value,label:c.label,value:c.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Nn=w(Pn,[["render",jn],["__scopeId","data-v-1295688c"]]),Bn=y({name:"KeepOriginalSoundSelector",components:{ElSwitch:fe,InfoIcon:I},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"})}}}}),zn={class:"relative"},Fn={class:"flex justify-between items-center"},qn={class:"flex justify-start items-center"},Hn={class:"text-sm font-bold"};function Wn(e,t,s,l,u,$){const d=o("info-icon"),p=o("el-switch");return a(),m("div",zn,[i("div",Fn,[i("div",qn,[i("span",Hn,r(e.$t("kling.name.keepOriginalSound")),1),n(d,{content:e.$t("kling.description.keepOriginalSound")},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=g=>e.value=g)},null,8,["modelValue"])])])}const Jn=w(Bn,[["render",Wn]]),Qn=y({name:"MotionPanel",components:{ElButton:M,FontAwesomeIcon:L,Consumption:me,MotionImage:hn,MotionVideo:wn,MotionPromptInput:En,CharacterOrientationSelector:Dn,MotionModeSelector:Nn,KeepOriginalSoundSelector:Jn},emits:["generate"],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return _e(this.motionConfig,this.service?.cost)},service(){return this.$store.state.kling?.service},canGenerate(){const e=this.motionConfig;return!!(e?.image_url&&e?.video_url)}},methods:{onGenerate(){this.$emit("generate")}}}),Yn={class:"flex flex-col h-full"},Xn={class:"flex-1 overflow-y-auto p-5"},Zn={class:"flex flex-col items-center justify-center px-5 pb-5"};function xn(e,t,s,l,u,$){const d=o("motion-image"),p=o("motion-video"),g=o("motion-prompt-input"),c=o("character-orientation-selector"),k=o("motion-mode-selector"),h=o("keep-original-sound-selector"),_=o("consumption"),E=o("font-awesome-icon"),R=o("el-button");return a(),m("div",Yn,[i("div",Xn,[n(d,{class:"mb-3"}),n(p,{class:"mb-3"}),n(g,{class:"mb-4"}),n(c,{class:"mb-4"}),n(k,{class:"mb-4"}),n(h,{class:"mb-4"})]),i("div",Zn,[n(_,{value:e.consumption,service:e.service},null,8,["value","service"]),n(R,{type:"primary",class:"btn w-full",round:"",disabled:!e.canGenerate,onClick:e.onGenerate},{default:f(()=>[n(E,{icon:"fa-solid fa-magic",class:"mr-2"}),C(" "+r(e.$t("kling.button.generateMotion")),1)]),_:1},8,["disabled","onClick"])])])}const es=w(Qn,[["render",xn]]),ts=y({name:"KlingTabSwitcher",components:{ElTabs:je,ElTabPane:Oe,ElTag:Se},props:{modelValue:{type:String,default:"videos"}},emits:["update:modelValue"],computed:{tabs(){return[{value:"videos",label:this.$t("kling.tab.videoGeneration")},{value:"motion",label:this.$t("kling.tab.motionControl")}]}},methods:{onUpdate(e){this.$emit("update:modelValue",e)}}}),os=["title"],ns={class:"text"};function ss(e,t,s,l,u,$){const d=o("el-tag"),p=o("el-tab-pane"),g=o("el-tabs");return a(),S(g,{"model-value":e.modelValue,class:"kling-tabs",stretch:"","onUpdate:modelValue":e.onUpdate},{default:f(()=>[(a(!0),m(V,null,T(e.tabs,c=>(a(),S(p,{key:c.value,name:c.value,disabled:c.disabled},{label:f(()=>[i("span",{class:"tab-label",title:c.disabled?c.disabledReason:void 0},[i("span",ns,r(c.label),1),c.badge?(a(),S(d,{key:0,size:"small",type:"warning",class:"badge"},{default:f(()=>[C(r(c.badge),1)]),_:2},1024)):v("",!0)],8,os)]),_:2},1032,["name","disabled"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])}const is=w(ts,[["render",ss],["__scopeId","data-v-bf00c27e"]]),as=y({name:"TaskPreview",components:{ElImage:qe,CopyToClipboard:Ne,FontAwesomeIcon:L,ElAlert:Fe,VideoPlayer:Be,ElTooltip:Q,ElButton:M,ImagePreview:j,ApiCodeButton:ze},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},referenceImages(){const e=[],t=this.modelValue?.request?.start_image_url,s=this.modelValue?.request?.end_image_url;return t&&e.push({url:t,name:"start-image"}),s&&e.push({url:s,name:"end-image"}),e}},methods:{onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onOpenVideo(e){window.open(e,"_blank")}}}),ls={class:"preview"},rs={class:"left"},cs={class:"main"},ds={class:"bot"},us={class:"datetime"},ms={class:"info"},ps={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},gs={key:1,class:"prompt mt-2"},fs={key:0},hs={key:1},_s={key:0,class:U({content:!0,failed:!0})},$s={key:0,class:"mb-4"},ks={key:1,class:U({operations:!0,"mt-2":!0})},vs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},bs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ys={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},ws={key:1,class:U({content:!0})},Cs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ss={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Vs={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Is={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Ts={key:2,class:U({content:!0})},Es={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ls={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Ms(e,t,s,l,u,$){const d=o("el-image"),p=o("image-preview"),g=o("video-player"),c=o("el-button"),k=o("el-tooltip"),h=o("api-code-button"),_=o("font-awesome-icon"),E=o("copy-to-clipboard"),R=o("el-alert");return a(),m("div",ls,[i("div",rs,[n(d,{src:"https://cdn.acedata.cloud/qpbbbb.jpg",class:"avatar"})]),i("div",cs,[i("div",ds,[C(r(e.$t("kling.name.klingBot"))+" ",1),i("span",us,r(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),i("div",ms,[e.referenceImages.length>0?(a(),m("div",ps,[(a(!0),m(V,null,T(e.referenceImages,(A,B)=>(a(),S(p,{key:B,url:A.url,name:A.name,closable:!1},null,8,["url","name"]))),128))])):v("",!0),e.modelValue?.request?.prompt?(a(),m("p",gs,[C(r(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?v("",!0):(a(),m("span",fs," - ("+r(e.$t("kling.status.pending"))+") ",1)),e.modelValue?.response?.state==="submitted"||e.modelValue?.response?.state==="processing"||e.modelValue?.response?.state==="pending"||e.modelValue?.response?.state==="completed"?(a(),m("span",hs," - ("+r(e.$t("kling.status.processing"))+") ",1)):v("",!0)])):v("",!0)]),e.modelValue?.response?.success===!0?(a(),m("div",_s,[e.modelValue?.response.video_url?(a(),m("div",$s,[n(g,{src:e.modelValue?.response.video_url},null,8,["src"])])):v("",!0),e.modelValue?.response.success?(a(),m("div",ks,[n(k,{class:"box-item",effect:"dark",content:e.$t("kling.message.downloadVideo"),placement:"top-start"},{default:f(()=>[e.modelValue?.response.video_url?(a(),S(c,{key:0,type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=A=>e.onDownload(A,e.modelValue?.response.video_url))},{default:f(()=>[C(r(e.$t("kling.button.download")),1)]),_:1})):v("",!0)]),_:1},8,["content"]),n(h,{path:"/kling/videos",body:e.modelValue?.request},null,8,["body"])])):v("",!0),n(R,{closable:!1,class:"mt-2 success"},{default:f(()=>[i("p",vs,[n(_,{icon:"fa-solid fa-hashtag",class:"mr-1"}),C(" "+r(e.$t("kling.name.model"))+": "+r(e.modelValue?.request?.model),1)]),i("p",bs,[n(_,{icon:"fa-solid fa-magic",class:"mr-1"}),C(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(E,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(a(),m("p",ys,[n(_,{icon:"fa-solid fa-clock",class:"mr-1"}),C(" "+r(e.$t("kling.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):v("",!0)]),_:1})])):v("",!0),e.modelValue?.response?.success===!1?(a(),m("div",ws,[n(R,{closable:!1,class:"failure"},{template:f(()=>[n(_,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),C(" "+r(e.$t("kling.name.failure")),1)]),default:f(()=>[i("p",Cs,[n(_,{icon:"fa-solid fa-magic",class:"mr-1"}),C(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(E,{content:e.modelValue?.id},null,8,["content"])]),i("p",Ss,[n(_,{icon:"fa-solid fa-circle-info",class:"mr-1"}),C(" "+r(e.$t("kling.name.failureReason"))+": "+r(e.modelValue?.response?.error?.message)+" ",1),n(E,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(a(),m("p",Vs,[n(_,{icon:"fa-solid fa-clock",class:"mr-1"}),C(" "+r(e.$t("kling.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):v("",!0),e.modelValue?.response?.trace_id?(a(),m("p",Is,[n(_,{icon:"fa-solid fa-hashtag",class:"mr-1"}),C(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(E,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):v("",!0)]),_:1})])):v("",!0),e.modelValue?.response?.success===void 0?(a(),m("div",Ts,[n(R,{closable:!1,class:"info"},{template:f(()=>[n(_,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),C(" "+r(e.$t("kling.name.failure")),1)]),default:f(()=>[i("p",Es,[n(_,{icon:"fa-solid fa-magic",class:"mr-1"}),C(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(E,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.response?.trace_id?(a(),m("p",Ls,[n(_,{icon:"fa-solid fa-hashtag",class:"mr-1"}),C(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(E,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):v("",!0)]),_:1})])):v("",!0)])])}const Us=w(as,[["render",Ms],["__scopeId","data-v-422e2570"]]),Rs=y({name:"RecentPanel",components:{TaskPreview:Us,NoTasks:De,BotPlaceholder:He,ScrollList:Me},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?.()}}}),As={key:0},Ds={key:2,class:"w-full h-full flex items-center justify-center"};function Ps(e,t,s,l,u,$){const d=o("bot-placeholder"),p=o("task-preview"),g=o("scroll-list"),c=o("no-tasks");return a(),m(V,null,[e.tasks?.items===void 0?(a(),m("div",As,[n(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(a(),S(g,{key:1,ref:"scrollList",class:"h-full w-full overflow-y-auto tasks",loading:e.loading,onReachTop:t[0]||(t[0]=k=>e.$emit("reach-top"))},{default:f(()=>[(a(!0),m(V,null,T(e.tasks?.items,k=>(a(),S(p,{key:k.id,"model-value":k},null,8,["model-value"]))),128))]),_:1},8,["loading"])):v("",!0),e.tasks?.items?.length===0?(a(),m("div",Ds,[n(c)])):v("",!0)],64)}const Gs=w(Rs,[["render",Ps]]),de=Ve("kling"),Ks=y({name:"KlingIndex",components:{ConfigPanel:cn,MotionPanel:es,TabSwitcher:is,Layout:Ze,RecentPanel:Gs},mixins:[Re],inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===se.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===se.Request||this.fetchingTasks},credential(){return this.$store.state.kling.credential},config(){return this.$store.state.kling.config},motionConfig(){return this.$store.state.kling.motionConfig},taskType(){return this.$store.state.kling.taskType||"videos"},tasks(){return this.$store.state.kling.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await Ue({tasks:this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("kling/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("kling/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:s,createdAtMax:l}=e||{};console.debug("limit",t,"createdAtMin",s,"createdAtMax",l),this.fetchingTasks=!0;try{await this.$store.dispatch("kling/getTasks",{limit:t,createdAtMin:s,createdAtMax:l})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!ae(this.uploadTracker,u=>this.$t(u),u=>b.warning(u)))return;const{camera_control:e,...t}=this.config||{},s={...t,callback_url:de};if(!s.video_id&&!t.video_url&&!s.start_image_url&&s.end_image_url){b.warning(this.$t("kling.message.endImageRequiresStart"));return}s.action||(s.video_id||t.video_url?s.action="extend":s.start_image_url?s.action="image2video":s.action="text2video"),s.action==="text2video"&&s.end_image_url&&delete s.end_image_url,e?.type&&(s.camera_control={type:e.type,...e.type==="simple"&&e.config?{config:Object.fromEntries(Object.entries(e.config).filter(([,u])=>u!=null))}:{}});const l=this.credential?.token;if(!l){console.error("no token specified");return}b.info(this.$t("kling.message.startingTask")),oe("kling",ne.generate(s,{token:l})).then(()=>{b.success(this.$t("kling.message.startTaskSuccess"))}).catch(u=>{u?.response?.data?.error?.code===le?b.error(this.$t("kling.message.usedUp")):b.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},async onTabChange(e){e!==this.taskType&&(await this.$store.dispatch("kling/setTaskType",e),await this.onGetTasks(),await this.onScrollDown())},async onGenerateMotion(){if(!ae(this.uploadTracker,l=>this.$t(l),l=>b.warning(l)))return;const e=this.motionConfig||{};if(!e.image_url||!e.video_url){b.warning(this.$t("kling.message.motionMissingInputs"));return}const t={image_url:e.image_url,video_url:e.video_url,character_orientation:e.character_orientation||"video",mode:e.mode||"std",keep_original_sound:e.keep_original_sound??"yes",...e.prompt?{prompt:e.prompt}:{},callback_url:de},s=this.credential?.token;if(!s){console.error("no token specified");return}b.info(this.$t("kling.message.startingTask")),oe("kling",ne.motion(t,{token:s})).then(()=>{b.success(this.$t("kling.message.startTaskSuccess"))}).catch(l=>{l?.response?.data?.error?.code===le?b.error(this.$t("kling.message.usedUp")):b.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),Os={class:"flex flex-col h-full"},js={class:"flex-1 min-h-0"};function Ns(e,t,s,l,u,$){const d=o("tab-switcher"),p=o("config-panel"),g=o("motion-panel"),c=o("recent-panel"),k=o("layout");return a(),S(k,null,{config:f(()=>[i("div",Os,[n(d,{"model-value":e.taskType,"onUpdate:modelValue":e.onTabChange},null,8,["model-value","onUpdate:modelValue"]),i("div",js,[e.taskType==="videos"?(a(),S(p,{key:0,onGenerate:e.onGenerate},null,8,["onGenerate"])):e.taskType==="motion"?(a(),S(g,{key:1,onGenerate:e.onGenerateMotion},null,8,["onGenerate"])):v("",!0)])])]),result:f(()=>[n(c,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Wi=w(Ks,[["render",Ns]]);export{Wi as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as C}from"./index.es-D8MU6eMk.js";import{E as P}from"./index-DbBDYLLC.js";import{E as G}from"./index-C09FcKq9.js";import{d as b,H as i,E as r,z as A,C as s,y as d,D as n,q as o,F as a,I as _,O as T,N as I,x as S,Q as E,c as L,J as $}from"./vendor-vue-NSDaktjZ.js";import{H as k,bp as M,cs as D,bg as z,o as B,S as V,ct as O}from"./index-B5267oqA.js";import{p as j}from"./pasteUploadMixin-BurWbGNQ.js";import{u as q,a as F,e as N}from"./uploadTrackerMixin--N-yU8Tl.js";import{I as H,S as J,l as Q}from"./pagination-BlJ6xPMo.js";import{I as W}from"./ImagePreview-D-9EFWby.js";import{E as K}from"./index-bs2QXOh6.js";import{E as v}from"./index-CCwWrfc4.js";import{a as X,E as Y}from"./index-DfAn9V8y.js";import{E as U}from"./index-Bf3A60rN.js";import{E as Z,a as x}from"./index-BM3sPBDY.js";import{b as ee,a as se}from"./errorCode-Cqj9Td_Z.js";import{A as te}from"./Status-CUQyGBNT.js";import{C as oe}from"./CopyToClipboard-g4vBpWAA.js";import{A as ae}from"./ApiCodeButton-BxWrNlio.js";import{E as ne}from"./index-B5jo7NY3.js";import{E as ie,a as le}from"./index-68NaTtAT.js";import"./use-form-item-CAmCDDpm.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Df5ITouH.js";import"./index-CzL5AhXP.js";import"./index-C94_tKkM.js";import"./typescript-GHEyAG9P.js";import"./highlight-BIVpqebW.js";import"./index-BLjywj98.js";import"./vendor-highlight-lEWW1Jxd.js";import"./index-Tga9YfTB.js";import"./_baseClone-BEl0SBVQ.js";import"./_Uint8Array-pk5G6DXb.js";import"./_initCloneObject-7jYqtSMb.js";import"./isEqual-Dh50OCem.js";import"./debounce-DBeMKn11.js";import"./index-DVPxXPIi.js";import"./strings-beZM2Y-f.js";import"./isPlainObject-dMdaxYmL.js";const re=b({name:"LayoutHeadshots",components:{ElDrawer:G,ElButton:P,FontAwesomeIcon:C},data(){return{drawer:!1}}}),ce={class:"main flex flex-row flex-1"},de={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},pe={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function me(e,t,c,f,y,w){const p=n("font-awesome-icon"),g=n("el-button"),m=n("el-drawer");return o(),i("div",ce,[r("div",de,[A(e.$slots,"config",{},void 0,!0)]),r("div",pe,[A(e.$slots,"result",{},void 0,!0)]),s(g,{circle:"",class:"menu",onClick:t[0]||(t[0]=l=>e.drawer=!0)},{default:d(()=>[s(p,{icon:"fa-solid fa-gear"})]),_:1}),s(m,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=l=>e.drawer=l),"with-header":!1,size:"340px",class:"drawer"},{default:d(()=>[A(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const ue=k(re,[["render",me],["__scopeId","data-v-ada6b2d1"]]),he=b({name:"ImageUrlsInput",components:{ElUpload:K,ElButton:P,InfoIcon:H,ImagePreview:W,FontAwesomeIcon:C},mixins:[j,q],data(){return{fileList:[],uploadUrl:M()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.headshots?.config?.image_urls},set(){const e=this.urls;this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,image_urls:e})}}},mounted(){this.value||(this.value=void 0),this.onSetImageUrls()},methods:{onExceed(){v.warning(this.$t("headshots.message.uploadImageExceed"))},onError(){v.error(this.$t("headshots.message.uploadImageError"))},onSetImageUrls(){const e=this.urls;this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,image_urls:e})},async onSuccess(){this.onSetImageUrls()}}}),fe={class:"field"},ge={class:"title font-bold"},_e={class:"upload-wrapper"};function $e(e,t,c,f,y,w){const p=n("image-preview"),g=n("font-awesome-icon"),m=n("el-button"),l=n("el-upload"),u=n("info-icon");return o(),i("div",fe,[r("h2",ge,a(e.$t("headshots.name.endImageUrls")),1),r("div",_e,[s(l,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=h=>e.fileList=h),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",class:"value upload-wrapper",limit:2,multiple:!0,"list-type":"picture",action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:d(({file:h})=>[s(p,{url:h.url||h.response?.file_url,name:h.name,percentage:h.percentage,onRemove:R=>e.fileList.splice(e.fileList.indexOf(h),1)},null,8,["url","name","percentage","onRemove"])]),default:d(()=>[s(m,{size:"small",type:"primary",round:""},{default:d(()=>[s(g,{icon:"fa-solid fa-upload",class:"mr-1"}),_(" "+a(e.$t("headshots.button.uploadImageUrls")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])]),s(u,{content:e.$t("headshots.description.endImageUrls"),class:"info"},null,8,["content"])])}const ve=k(he,[["render",$e],["__scopeId","data-v-d468812a"]]),be="fast",ke=b({name:"ModeSelector",components:{ElRadioButton:Y,ElRadioGroup:X},data(){return{options:[{label:this.$t("headshots.button.fast"),value:"fast"},{label:this.$t("headshots.button.relax"),value:"relax"}]}},computed:{value:{get(){return this.$store.state.headshots.config?.mode},set(e){console.debug("set mode",e),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots.config,mode:e})}}},mounted(){this.value||(this.value=be)}}),ye={class:"field"},we={class:"title font-bold"};function Te(e,t,c,f,y,w){const p=n("el-radio-button"),g=n("el-radio-group");return o(),i("div",ye,[r("h2",we,a(e.$t("headshots.name.mode")),1),s(g,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=m=>e.value=m),class:"mode"},{default:d(()=>[(o(!0),i(T,null,I(e.options,m=>(o(),S(p,{key:m.value,label:m.value},{default:d(()=>[_(a(m.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])])}const Ie=k(ke,[["render",Te],["__scopeId","data-v-e7702494"]]),Ee=b({name:"StylizeSelector",components:{ElTabs:x,ElTabPane:Z,ElImage:U},data(){return{tab:"styles",value:"",elements:{styles:{displayName:this.$t("headshots.styleCategory.styles"),items:[{image:"https://static.aipedias.com/aicamera/common/20241008/20241008202314260779439.png",label:this.$t("headshots.styleTag.malePportrait"),value:"male_portrait"},{image:"https://static.aipedias.com/aicamera/common/20241008/202410082022241e9755548.png",label:this.$t("headshots.styleTag.malePportrait2"),value:"male_portrait2"},{image:"https://static.aipedias.com/aicamera/common/20241101/20241101170130d78f66521.png",label:this.$t("headshots.styleTag.kindergarten"),value:"kindergarten"},{image:"https://static.aipedias.com/aicamera/common/20240923/20240923123233accf60398.webp",label:this.$t("headshots.styleTag.logoTshirt"),value:"logo_tshirt"},{image:"https://static.aipedias.com/aicamera/common/20241025/202410252012329472d0656.jpg",label:this.$t("headshots.styleTag.wedding"),value:"wedding"},{image:"https://static.aipedias.com/aicamera/common/20240915/20240915145045254931400.webp",label:this.$t("headshots.styleTag.businessPphoto"),value:"business_photo"},{image:"https://static.aipedias.com/aicamera/common/20240810/20240810194526040341795.jpg",label:this.$t("headshots.styleTag.bobSuit"),value:"bob_suit"},{image:"https://static.aipedias.com/aicamera/common/20240717/20240717152654e0b348173.webp",label:this.$t("headshots.styleTag.femalePortrait"),value:"female_portrait"}]}}}},watch:{value(e){console.debug("set template",e),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,template:e})}},mounted(){this.value||(this.value=""),console.debug("set template",this.value),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,template:this.value})},methods:{onToggle(e){this.value===e?this.value="":this.value=e,console.debug("set template",this.value),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,template:this.value})}}}),Se={class:"field"},Ve=["onClick"],Ce={class:"name"};function Ae(e,t,c,f,y,w){const p=n("el-image"),g=n("el-tab-pane"),m=n("el-tabs");return o(),i("div",Se,[s(m,{modelValue:e.tab,"onUpdate:modelValue":t[0]||(t[0]=l=>e.tab=l)},{default:d(()=>[(o(!0),i(T,null,I(e.elements,(l,u)=>(o(),S(g,{key:u,label:l.displayName,name:u,class:"pane"},{default:d(()=>[(o(!0),i(T,null,I(l.items,(h,R)=>(o(),i("div",{key:R,class:E({item:!0,active:e.value===h.value}),onClick:Ss=>e.onToggle(h.value)},[s(p,{src:h.image,fit:"fill",class:"preview"},null,8,["src"]),r("span",Ce,a(h.label),1)],10,Ve))),128))]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])])}const Pe=k(Ee,[["render",Ae],["__scopeId","data-v-be4bd25d"]]),Re=b({name:"PresetPanel",components:{ModeSelector:Ie,ImageUrlsInput:ve,ElButton:P,FontAwesomeIcon:C,ElementsSelector:Pe},emits:["generate"],computed:{config(){return this.$store.state.headshots?.config}},methods:{onGenerate(){this.$emit("generate")}}}),Ue={class:"panel"},Ge={class:"config"},Le={class:"actions"};function Me(e,t,c,f,y,w){const p=n("elements-selector"),g=n("mode-selector"),m=n("image-urls-input"),l=n("font-awesome-icon"),u=n("el-button");return o(),i("div",Ue,[r("div",Ge,[s(p,{class:"mb-4"}),s(g,{class:"mb-4"}),s(m,{class:"mb-4"}),r("div",Le,[s(u,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:d(()=>[s(l,{icon:"fa-solid fa-magic",class:"mr-2"}),_(" "+a(e.$t("headshots.button.generate")),1)]),_:1},8,["onClick"])])])])}const De=k(Re,[["render",Me],["__scopeId","data-v-848739f6"]]),ze=b({name:"ImageGallery",props:{modelValue:{type:Object,required:!0}},setup(e){return{images:L(()=>e.modelValue?.response?.data?.slice(0,2)||[]),viewImage:f=>{window.open(f,"_blank")}}}}),Be={class:"image-gallery"},Oe=["src"],je=["onClick"];function qe(e,t,c,f,y,w){return o(),i("div",Be,[(o(!0),i(T,null,I(e.images,(p,g)=>(o(),i("div",{key:g,class:"image-container"},[r("img",{src:p.image_url,alt:"Image"},null,8,Oe),p.image_url?(o(),i("button",{key:0,class:"view-button",onClick:m=>e.viewImage(p.image_url)},a(e.$t("headshots.button.viewImage")),9,je)):$("",!0)]))),128))])}const Fe=k(ze,[["render",qe],["__scopeId","data-v-42f0a7be"]]),Ne=b({name:"TaskPreview",components:{ElImage:U,CopyToClipboard:oe,FontAwesomeIcon:C,ElAlert:ne,ImageGallery:Fe,ApiCodeButton:ae},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.headshots?.application},config(){return this.$store.state.headshots?.config}},methods:{onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onReload(e){const t=e.target,c=new URL(t.src),f=c.searchParams.get("retry");if(!f)c.searchParams.set("retry","1");else if(parseInt(f)<2)c.searchParams.set("retry",(parseInt(f)+1).toString());else return;t.src=c.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),He={class:"preview"},Je={class:"left"},Qe={class:"main"},We={class:"bot"},Ke={class:"datetime"},Xe={class:"info"},Ye={key:0,class:"prompt mt-2"},Ze={key:0},xe={key:1},es={key:0,class:E({content:!0,failed:!0})},ss={class:"image-wrapper"},ts={class:E({operations:!0,"mt-2":!0,"mb-2":!0})},os={class:"description"},as={key:0,class:"description"},ns={key:1,class:E({content:!0})},is={class:"description"},ls={class:"description"},rs={key:0,class:"description"},cs={class:"description"},ds={key:2,class:E({content:!0})},ps={class:"description"},ms={key:3,class:E({content:!0})},us={class:"description"};function hs(e,t,c,f,y,w){const p=n("el-image"),g=n("image-gallery"),m=n("api-code-button"),l=n("font-awesome-icon"),u=n("copy-to-clipboard"),h=n("el-alert");return o(),i("div",He,[r("div",Je,[s(p,{src:"https://cdn.acedata.cloud/isxyfw.png",class:"avatar"})]),r("div",Qe,[r("div",We,[_(a(e.$t("headshots.name.headshotsBot"))+" ",1),r("span",Ke,a(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),r("div",Xe,[e.modelValue?.request?.template?(o(),i("p",Ye,[_(a(e.modelValue?.request?.template)+" ",1),e.modelValue?.response?$("",!0):(o(),i("span",Ze," - ("+a(e.$t("headshots.status.pending"))+") ",1)),e.modelValue?.response?.status==="unknown"?(o(),i("span",xe," - ("+a(e.$t("headshots.status.processing"))+") ",1)):$("",!0)])):$("",!0)]),e.modelValue?.response?.success===!0?(o(),i("div",es,[r("div",ss,[s(g,{"model-value":e.modelValue},null,8,["model-value"])]),r("div",ts,[s(m,{path:"/headshots/images",body:e.modelValue?.request},null,8,["body"])]),s(h,{closable:!1,class:"mt-2 success"},{default:d(()=>[r("p",os,[s(l,{icon:"fa-solid fa-magic",class:"mr-1"}),_(" "+a(e.$t("headshots.name.taskId"))+": "+a(e.modelValue?.id)+" ",1),s(u,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.elapsed?(o(),i("p",as,[s(l,{icon:"fa-solid fa-clock",class:"mr-1"}),_(" "+a(e.$t("headshots.name.elapsed"))+": "+a(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0)]),_:1})])):$("",!0),e.modelValue?.response?.success===!1?(o(),i("div",ns,[s(h,{closable:!1,class:"failure"},{template:d(()=>[s(l,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),_(" "+a(e.$t("headshots.name.failure")),1)]),default:d(()=>[r("p",is,[s(l,{icon:"fa-solid fa-magic",class:"mr-1"}),_(" "+a(e.$t("headshots.name.taskId"))+": "+a(e.modelValue?.id)+" ",1),s(u,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),r("p",ls,[s(l,{icon:"fa-solid fa-circle-info",class:"mr-1"}),_(" "+a(e.$t("headshots.name.failureReason"))+": "+a(e.modelValue?.response?.error?.message)+" ",1),s(u,{content:e.modelValue?.response?.error?.message,class:"btn-copy"},null,8,["content"])]),e.modelValue?.elapsed?(o(),i("p",rs,[s(l,{icon:"fa-solid fa-clock",class:"mr-1"}),_(" "+a(e.$t("headshots.name.elapsed"))+": "+a(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0),r("p",cs,[s(l,{icon:"fa-solid fa-hashtag",class:"mr-1"}),_(" "+a(e.$t("headshots.name.traceId"))+": "+a(e.modelValue?.response?.trace_id)+" ",1),s(u,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])]),_:1})])):$("",!0),e.modelValue?.response?$("",!0):(o(),i("div",ds,[s(h,{closable:!1,class:"info"},{template:d(()=>[s(l,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),_(" "+a(e.$t("headshots.name.failure")),1)]),default:d(()=>[r("p",ps,[s(l,{icon:"fa-solid fa-magic",class:"mr-1"}),_(" "+a(e.$t("headshots.name.taskId"))+": "+a(e.modelValue?.id)+" ",1),s(u,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])])]),_:1})])),e.modelValue?.response?.status==="unknown"?(o(),i("div",ms,[s(h,{closable:!1,class:"info"},{template:d(()=>[s(l,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),_(" "+a(e.$t("headshots.name.failure")),1)]),default:d(()=>[r("p",us,[s(l,{icon:"fa-solid fa-magic",class:"mr-1"}),_(" "+a(e.$t("headshots.name.taskId"))+": "+a(e.modelValue?.id)+" ",1),s(u,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])])]),_:1})])):$("",!0)])])}const fs=k(Ne,[["render",hs],["__scopeId","data-v-4449c07c"]]),gs=b({name:"RecentPanel",components:{TaskPreview:fs,ElSkeleton:le,ElSkeletonItem:ie,ScrollList:J},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.headshots?.tasks,items:this.$store.state.headshots?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),_s={key:0,class:"tasks"},$s={class:"left"},vs={class:"main"},bs={key:1,class:"tasks"},ks={key:2,class:"description"};function ys(e,t,c,f,y,w){const p=n("el-skeleton-item"),g=n("el-skeleton"),m=n("task-preview"),l=n("scroll-list");return o(),S(l,{ref:"scrollList",class:"panel recent",loading:e.loading,onReachTop:t[0]||(t[0]=u=>e.$emit("reach-top"))},{default:d(()=>[e.tasks?.items===void 0?(o(),i("div",_s,[(o(),i(T,null,I(3,u=>r("div",{key:u,class:"task placeholder"},[r("div",$s,[s(g,{animated:""},{template:d(()=>[s(p,{variant:"image",class:"avatar"})]),_:1})]),r("div",vs,[s(g,{animated:""},{template:d(()=>[s(p,{variant:"p",class:"title"}),s(p,{variant:"image",class:"icon"})]),_:1})])])),64))])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(o(),i("div",bs,[(o(!0),i(T,null,I(e.tasks?.items,(u,h)=>(o(),S(m,{key:h,"model-value":u,class:"preview"},null,8,["model-value"]))),128))])):$("",!0),e.tasks?.items?.length===0?(o(),i("p",ks,a(e.$t("headshots.message.noTasks")),1)):$("",!0)]),_:1},8,["loading"])}const ws=k(gs,[["render",ys],["__scopeId","data-v-ffd55c16"]]),Ts=O("headshots"),Is=b({name:"HeadshotsIndex",components:{ConfigPanel:De,Layout:ue,ApplicationStatus:te,RecentPanel:ws},mixins:[F],inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.headshots?.status?.getApplications===V.Request},tasksLoading(){return this.$store.state.headshots?.status?.getTasks===V.Request||this.fetchingTasks},service(){return this.$store.state.headshots.service},credential(){return this.$store.state.headshots.credential},config(){return this.$store.state.headshots.config},initializing(){return this.$store.state.headshots.status.getApplications===V.Request},needApply(){return this.$store.state.headshots.status.getApplications===V.Success&&!this.application},application(){return this.$store.state.headshots.application},applications(){return this.$store.state.headshots.applications},tasks(){return this.$store.state.headshots.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await Q({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("headshots/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("headshots/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},onApply(){B.create({application:this.application}).then(({data:e})=>{this.application=e,v.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{e?.response?.data?.code===se&&v.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:c,createdAtMax:f}=e||{};console.debug("limit",t,"createdAtMin",c,"createdAtMax",f),this.fetchingTasks=!0;try{await this.$store.dispatch("headshots/getTasks",{limit:t,createdAtMin:c,createdAtMax:f})}finally{this.fetchingTasks=!1}},async onGeneratePicture(){if(!N(this.uploadTracker,c=>this.$t(c),c=>v.warning(c)))return;const e={...this.config,callback_url:Ts},t=this.credential?.token;if(!t){console.error("no token specified");return}v.info(this.$t("headshots.message.startingTask")),D("headshots",z.generate(e,{token:t})).then(()=>{v.success(this.$t("headshots.message.startTaskSuccess")),this.$store.commit("headshots/setConfig",{config:void 0})}).catch(c=>{c?.response?.data?.error?.code===ee?v.error(this.$t("headshots.message.usedUp")):v.error(this.$t("headshots.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Es(e,t,c,f,y,w){const p=n("config-panel"),g=n("application-status"),m=n("recent-panel"),l=n("layout");return o(),S(l,null,{config:d(()=>[s(p,{onGenerate:e.onGeneratePicture},null,8,["onGenerate"])]),result:d(()=>[s(g,{initializing:e.initializing,application:e.application,applications:e.applications,service:e.service,"need-apply":e.needApply,class:"mb-4",onRefresh:e.onGetApplication,onSelect:t[0]||(t[0]=u=>e.$store.dispatch("headshots/setApplication",u))},null,8,["initializing","application","applications","service","need-apply","onRefresh"]),s(m,{ref:"recentPanel",class:"panel recent",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const ht=k(Is,[["render",Es],["__scopeId","data-v-c707e859"]]);export{ht as default};
|
|
1
|
+
import{F as C}from"./index.es-Dz2WW0mO.js";import{E as P}from"./index-BGH0IgYz.js";import{E as G}from"./index-BsyPjG1u.js";import{d as b,H as i,E as r,z as A,C as s,y as d,D as n,q as o,F as a,I as _,O as T,N as I,x as S,Q as E,c as L,J as $}from"./vendor-vue-NSDaktjZ.js";import{H as k,bp as M,cs as D,bg as z,o as B,S as V,ct as O}from"./index-D4JEvBET.js";import{p as j}from"./pasteUploadMixin-BurWbGNQ.js";import{u as q,a as F,e as N}from"./uploadTrackerMixin--N-yU8Tl.js";import{I as H,S as J,l as Q}from"./pagination-33HYpCcx.js";import{I as W}from"./ImagePreview-Dw054CSM.js";import{E as K}from"./index-CV7E7mDR.js";import{E as v}from"./index-B7TkhThA.js";import{a as X,E as Y}from"./index-DC-SxuPE.js";import{E as U}from"./index-DHCVQU69.js";import{E as Z,a as x}from"./index-C6maAFlu.js";import{b as ee,a as se}from"./errorCode-Cqj9Td_Z.js";import{A as te}from"./Status-D5L_4PIo.js";import{C as oe}from"./CopyToClipboard-D8319xRo.js";import{A as ae}from"./ApiCodeButton-DbBsqIvO.js";import{E as ne}from"./index-BeLJU121.js";import{E as ie,a as le}from"./index-BIE-c4ov.js";import"./use-form-item-CfxgrMhy.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Df5ITouH.js";import"./index-DKUx2sg9.js";import"./index-DAQQMQN_.js";import"./typescript-BxdtUEmf.js";import"./highlight-DRPB0jUE.js";import"./index-BLjywj98.js";import"./vendor-highlight-lEWW1Jxd.js";import"./index-ClZhoIFv.js";import"./_baseClone-XRiJGh2W.js";import"./_Uint8Array-CPbtsK4f.js";import"./_initCloneObject-CugDqvBf.js";import"./isEqual-CCMJAc_b.js";import"./debounce-Cix8aYnY.js";import"./index-DGOShBRo.js";import"./strings-beZM2Y-f.js";import"./isPlainObject-woldJKog.js";const re=b({name:"LayoutHeadshots",components:{ElDrawer:G,ElButton:P,FontAwesomeIcon:C},data(){return{drawer:!1}}}),ce={class:"main flex flex-row flex-1"},de={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},pe={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function me(e,t,c,f,y,w){const p=n("font-awesome-icon"),g=n("el-button"),m=n("el-drawer");return o(),i("div",ce,[r("div",de,[A(e.$slots,"config",{},void 0,!0)]),r("div",pe,[A(e.$slots,"result",{},void 0,!0)]),s(g,{circle:"",class:"menu",onClick:t[0]||(t[0]=l=>e.drawer=!0)},{default:d(()=>[s(p,{icon:"fa-solid fa-gear"})]),_:1}),s(m,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=l=>e.drawer=l),"with-header":!1,size:"340px",class:"drawer"},{default:d(()=>[A(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const ue=k(re,[["render",me],["__scopeId","data-v-ada6b2d1"]]),he=b({name:"ImageUrlsInput",components:{ElUpload:K,ElButton:P,InfoIcon:H,ImagePreview:W,FontAwesomeIcon:C},mixins:[j,q],data(){return{fileList:[],uploadUrl:M()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.headshots?.config?.image_urls},set(){const e=this.urls;this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,image_urls:e})}}},mounted(){this.value||(this.value=void 0),this.onSetImageUrls()},methods:{onExceed(){v.warning(this.$t("headshots.message.uploadImageExceed"))},onError(){v.error(this.$t("headshots.message.uploadImageError"))},onSetImageUrls(){const e=this.urls;this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,image_urls:e})},async onSuccess(){this.onSetImageUrls()}}}),fe={class:"field"},ge={class:"title font-bold"},_e={class:"upload-wrapper"};function $e(e,t,c,f,y,w){const p=n("image-preview"),g=n("font-awesome-icon"),m=n("el-button"),l=n("el-upload"),u=n("info-icon");return o(),i("div",fe,[r("h2",ge,a(e.$t("headshots.name.endImageUrls")),1),r("div",_e,[s(l,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=h=>e.fileList=h),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",class:"value upload-wrapper",limit:2,multiple:!0,"list-type":"picture",action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:d(({file:h})=>[s(p,{url:h.url||h.response?.file_url,name:h.name,percentage:h.percentage,onRemove:R=>e.fileList.splice(e.fileList.indexOf(h),1)},null,8,["url","name","percentage","onRemove"])]),default:d(()=>[s(m,{size:"small",type:"primary",round:""},{default:d(()=>[s(g,{icon:"fa-solid fa-upload",class:"mr-1"}),_(" "+a(e.$t("headshots.button.uploadImageUrls")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])]),s(u,{content:e.$t("headshots.description.endImageUrls"),class:"info"},null,8,["content"])])}const ve=k(he,[["render",$e],["__scopeId","data-v-d468812a"]]),be="fast",ke=b({name:"ModeSelector",components:{ElRadioButton:Y,ElRadioGroup:X},data(){return{options:[{label:this.$t("headshots.button.fast"),value:"fast"},{label:this.$t("headshots.button.relax"),value:"relax"}]}},computed:{value:{get(){return this.$store.state.headshots.config?.mode},set(e){console.debug("set mode",e),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots.config,mode:e})}}},mounted(){this.value||(this.value=be)}}),ye={class:"field"},we={class:"title font-bold"};function Te(e,t,c,f,y,w){const p=n("el-radio-button"),g=n("el-radio-group");return o(),i("div",ye,[r("h2",we,a(e.$t("headshots.name.mode")),1),s(g,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=m=>e.value=m),class:"mode"},{default:d(()=>[(o(!0),i(T,null,I(e.options,m=>(o(),S(p,{key:m.value,label:m.value},{default:d(()=>[_(a(m.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])])}const Ie=k(ke,[["render",Te],["__scopeId","data-v-e7702494"]]),Ee=b({name:"StylizeSelector",components:{ElTabs:x,ElTabPane:Z,ElImage:U},data(){return{tab:"styles",value:"",elements:{styles:{displayName:this.$t("headshots.styleCategory.styles"),items:[{image:"https://static.aipedias.com/aicamera/common/20241008/20241008202314260779439.png",label:this.$t("headshots.styleTag.malePportrait"),value:"male_portrait"},{image:"https://static.aipedias.com/aicamera/common/20241008/202410082022241e9755548.png",label:this.$t("headshots.styleTag.malePportrait2"),value:"male_portrait2"},{image:"https://static.aipedias.com/aicamera/common/20241101/20241101170130d78f66521.png",label:this.$t("headshots.styleTag.kindergarten"),value:"kindergarten"},{image:"https://static.aipedias.com/aicamera/common/20240923/20240923123233accf60398.webp",label:this.$t("headshots.styleTag.logoTshirt"),value:"logo_tshirt"},{image:"https://static.aipedias.com/aicamera/common/20241025/202410252012329472d0656.jpg",label:this.$t("headshots.styleTag.wedding"),value:"wedding"},{image:"https://static.aipedias.com/aicamera/common/20240915/20240915145045254931400.webp",label:this.$t("headshots.styleTag.businessPphoto"),value:"business_photo"},{image:"https://static.aipedias.com/aicamera/common/20240810/20240810194526040341795.jpg",label:this.$t("headshots.styleTag.bobSuit"),value:"bob_suit"},{image:"https://static.aipedias.com/aicamera/common/20240717/20240717152654e0b348173.webp",label:this.$t("headshots.styleTag.femalePortrait"),value:"female_portrait"}]}}}},watch:{value(e){console.debug("set template",e),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,template:e})}},mounted(){this.value||(this.value=""),console.debug("set template",this.value),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,template:this.value})},methods:{onToggle(e){this.value===e?this.value="":this.value=e,console.debug("set template",this.value),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,template:this.value})}}}),Se={class:"field"},Ve=["onClick"],Ce={class:"name"};function Ae(e,t,c,f,y,w){const p=n("el-image"),g=n("el-tab-pane"),m=n("el-tabs");return o(),i("div",Se,[s(m,{modelValue:e.tab,"onUpdate:modelValue":t[0]||(t[0]=l=>e.tab=l)},{default:d(()=>[(o(!0),i(T,null,I(e.elements,(l,u)=>(o(),S(g,{key:u,label:l.displayName,name:u,class:"pane"},{default:d(()=>[(o(!0),i(T,null,I(l.items,(h,R)=>(o(),i("div",{key:R,class:E({item:!0,active:e.value===h.value}),onClick:Ss=>e.onToggle(h.value)},[s(p,{src:h.image,fit:"fill",class:"preview"},null,8,["src"]),r("span",Ce,a(h.label),1)],10,Ve))),128))]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])])}const Pe=k(Ee,[["render",Ae],["__scopeId","data-v-be4bd25d"]]),Re=b({name:"PresetPanel",components:{ModeSelector:Ie,ImageUrlsInput:ve,ElButton:P,FontAwesomeIcon:C,ElementsSelector:Pe},emits:["generate"],computed:{config(){return this.$store.state.headshots?.config}},methods:{onGenerate(){this.$emit("generate")}}}),Ue={class:"panel"},Ge={class:"config"},Le={class:"actions"};function Me(e,t,c,f,y,w){const p=n("elements-selector"),g=n("mode-selector"),m=n("image-urls-input"),l=n("font-awesome-icon"),u=n("el-button");return o(),i("div",Ue,[r("div",Ge,[s(p,{class:"mb-4"}),s(g,{class:"mb-4"}),s(m,{class:"mb-4"}),r("div",Le,[s(u,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:d(()=>[s(l,{icon:"fa-solid fa-magic",class:"mr-2"}),_(" "+a(e.$t("headshots.button.generate")),1)]),_:1},8,["onClick"])])])])}const De=k(Re,[["render",Me],["__scopeId","data-v-848739f6"]]),ze=b({name:"ImageGallery",props:{modelValue:{type:Object,required:!0}},setup(e){return{images:L(()=>e.modelValue?.response?.data?.slice(0,2)||[]),viewImage:f=>{window.open(f,"_blank")}}}}),Be={class:"image-gallery"},Oe=["src"],je=["onClick"];function qe(e,t,c,f,y,w){return o(),i("div",Be,[(o(!0),i(T,null,I(e.images,(p,g)=>(o(),i("div",{key:g,class:"image-container"},[r("img",{src:p.image_url,alt:"Image"},null,8,Oe),p.image_url?(o(),i("button",{key:0,class:"view-button",onClick:m=>e.viewImage(p.image_url)},a(e.$t("headshots.button.viewImage")),9,je)):$("",!0)]))),128))])}const Fe=k(ze,[["render",qe],["__scopeId","data-v-42f0a7be"]]),Ne=b({name:"TaskPreview",components:{ElImage:U,CopyToClipboard:oe,FontAwesomeIcon:C,ElAlert:ne,ImageGallery:Fe,ApiCodeButton:ae},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.headshots?.application},config(){return this.$store.state.headshots?.config}},methods:{onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onReload(e){const t=e.target,c=new URL(t.src),f=c.searchParams.get("retry");if(!f)c.searchParams.set("retry","1");else if(parseInt(f)<2)c.searchParams.set("retry",(parseInt(f)+1).toString());else return;t.src=c.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),He={class:"preview"},Je={class:"left"},Qe={class:"main"},We={class:"bot"},Ke={class:"datetime"},Xe={class:"info"},Ye={key:0,class:"prompt mt-2"},Ze={key:0},xe={key:1},es={key:0,class:E({content:!0,failed:!0})},ss={class:"image-wrapper"},ts={class:E({operations:!0,"mt-2":!0,"mb-2":!0})},os={class:"description"},as={key:0,class:"description"},ns={key:1,class:E({content:!0})},is={class:"description"},ls={class:"description"},rs={key:0,class:"description"},cs={class:"description"},ds={key:2,class:E({content:!0})},ps={class:"description"},ms={key:3,class:E({content:!0})},us={class:"description"};function hs(e,t,c,f,y,w){const p=n("el-image"),g=n("image-gallery"),m=n("api-code-button"),l=n("font-awesome-icon"),u=n("copy-to-clipboard"),h=n("el-alert");return o(),i("div",He,[r("div",Je,[s(p,{src:"https://cdn.acedata.cloud/isxyfw.png",class:"avatar"})]),r("div",Qe,[r("div",We,[_(a(e.$t("headshots.name.headshotsBot"))+" ",1),r("span",Ke,a(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),r("div",Xe,[e.modelValue?.request?.template?(o(),i("p",Ye,[_(a(e.modelValue?.request?.template)+" ",1),e.modelValue?.response?$("",!0):(o(),i("span",Ze," - ("+a(e.$t("headshots.status.pending"))+") ",1)),e.modelValue?.response?.status==="unknown"?(o(),i("span",xe," - ("+a(e.$t("headshots.status.processing"))+") ",1)):$("",!0)])):$("",!0)]),e.modelValue?.response?.success===!0?(o(),i("div",es,[r("div",ss,[s(g,{"model-value":e.modelValue},null,8,["model-value"])]),r("div",ts,[s(m,{path:"/headshots/images",body:e.modelValue?.request},null,8,["body"])]),s(h,{closable:!1,class:"mt-2 success"},{default:d(()=>[r("p",os,[s(l,{icon:"fa-solid fa-magic",class:"mr-1"}),_(" "+a(e.$t("headshots.name.taskId"))+": "+a(e.modelValue?.id)+" ",1),s(u,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.elapsed?(o(),i("p",as,[s(l,{icon:"fa-solid fa-clock",class:"mr-1"}),_(" "+a(e.$t("headshots.name.elapsed"))+": "+a(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0)]),_:1})])):$("",!0),e.modelValue?.response?.success===!1?(o(),i("div",ns,[s(h,{closable:!1,class:"failure"},{template:d(()=>[s(l,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),_(" "+a(e.$t("headshots.name.failure")),1)]),default:d(()=>[r("p",is,[s(l,{icon:"fa-solid fa-magic",class:"mr-1"}),_(" "+a(e.$t("headshots.name.taskId"))+": "+a(e.modelValue?.id)+" ",1),s(u,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),r("p",ls,[s(l,{icon:"fa-solid fa-circle-info",class:"mr-1"}),_(" "+a(e.$t("headshots.name.failureReason"))+": "+a(e.modelValue?.response?.error?.message)+" ",1),s(u,{content:e.modelValue?.response?.error?.message,class:"btn-copy"},null,8,["content"])]),e.modelValue?.elapsed?(o(),i("p",rs,[s(l,{icon:"fa-solid fa-clock",class:"mr-1"}),_(" "+a(e.$t("headshots.name.elapsed"))+": "+a(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0),r("p",cs,[s(l,{icon:"fa-solid fa-hashtag",class:"mr-1"}),_(" "+a(e.$t("headshots.name.traceId"))+": "+a(e.modelValue?.response?.trace_id)+" ",1),s(u,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])]),_:1})])):$("",!0),e.modelValue?.response?$("",!0):(o(),i("div",ds,[s(h,{closable:!1,class:"info"},{template:d(()=>[s(l,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),_(" "+a(e.$t("headshots.name.failure")),1)]),default:d(()=>[r("p",ps,[s(l,{icon:"fa-solid fa-magic",class:"mr-1"}),_(" "+a(e.$t("headshots.name.taskId"))+": "+a(e.modelValue?.id)+" ",1),s(u,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])])]),_:1})])),e.modelValue?.response?.status==="unknown"?(o(),i("div",ms,[s(h,{closable:!1,class:"info"},{template:d(()=>[s(l,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),_(" "+a(e.$t("headshots.name.failure")),1)]),default:d(()=>[r("p",us,[s(l,{icon:"fa-solid fa-magic",class:"mr-1"}),_(" "+a(e.$t("headshots.name.taskId"))+": "+a(e.modelValue?.id)+" ",1),s(u,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])])]),_:1})])):$("",!0)])])}const fs=k(Ne,[["render",hs],["__scopeId","data-v-4449c07c"]]),gs=b({name:"RecentPanel",components:{TaskPreview:fs,ElSkeleton:le,ElSkeletonItem:ie,ScrollList:J},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.headshots?.tasks,items:this.$store.state.headshots?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),_s={key:0,class:"tasks"},$s={class:"left"},vs={class:"main"},bs={key:1,class:"tasks"},ks={key:2,class:"description"};function ys(e,t,c,f,y,w){const p=n("el-skeleton-item"),g=n("el-skeleton"),m=n("task-preview"),l=n("scroll-list");return o(),S(l,{ref:"scrollList",class:"panel recent",loading:e.loading,onReachTop:t[0]||(t[0]=u=>e.$emit("reach-top"))},{default:d(()=>[e.tasks?.items===void 0?(o(),i("div",_s,[(o(),i(T,null,I(3,u=>r("div",{key:u,class:"task placeholder"},[r("div",$s,[s(g,{animated:""},{template:d(()=>[s(p,{variant:"image",class:"avatar"})]),_:1})]),r("div",vs,[s(g,{animated:""},{template:d(()=>[s(p,{variant:"p",class:"title"}),s(p,{variant:"image",class:"icon"})]),_:1})])])),64))])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(o(),i("div",bs,[(o(!0),i(T,null,I(e.tasks?.items,(u,h)=>(o(),S(m,{key:h,"model-value":u,class:"preview"},null,8,["model-value"]))),128))])):$("",!0),e.tasks?.items?.length===0?(o(),i("p",ks,a(e.$t("headshots.message.noTasks")),1)):$("",!0)]),_:1},8,["loading"])}const ws=k(gs,[["render",ys],["__scopeId","data-v-ffd55c16"]]),Ts=O("headshots"),Is=b({name:"HeadshotsIndex",components:{ConfigPanel:De,Layout:ue,ApplicationStatus:te,RecentPanel:ws},mixins:[F],inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.headshots?.status?.getApplications===V.Request},tasksLoading(){return this.$store.state.headshots?.status?.getTasks===V.Request||this.fetchingTasks},service(){return this.$store.state.headshots.service},credential(){return this.$store.state.headshots.credential},config(){return this.$store.state.headshots.config},initializing(){return this.$store.state.headshots.status.getApplications===V.Request},needApply(){return this.$store.state.headshots.status.getApplications===V.Success&&!this.application},application(){return this.$store.state.headshots.application},applications(){return this.$store.state.headshots.applications},tasks(){return this.$store.state.headshots.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await Q({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("headshots/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("headshots/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},onApply(){B.create({application:this.application}).then(({data:e})=>{this.application=e,v.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{e?.response?.data?.code===se&&v.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:c,createdAtMax:f}=e||{};console.debug("limit",t,"createdAtMin",c,"createdAtMax",f),this.fetchingTasks=!0;try{await this.$store.dispatch("headshots/getTasks",{limit:t,createdAtMin:c,createdAtMax:f})}finally{this.fetchingTasks=!1}},async onGeneratePicture(){if(!N(this.uploadTracker,c=>this.$t(c),c=>v.warning(c)))return;const e={...this.config,callback_url:Ts},t=this.credential?.token;if(!t){console.error("no token specified");return}v.info(this.$t("headshots.message.startingTask")),D("headshots",z.generate(e,{token:t})).then(()=>{v.success(this.$t("headshots.message.startTaskSuccess")),this.$store.commit("headshots/setConfig",{config:void 0})}).catch(c=>{c?.response?.data?.error?.code===ee?v.error(this.$t("headshots.message.usedUp")):v.error(this.$t("headshots.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Es(e,t,c,f,y,w){const p=n("config-panel"),g=n("application-status"),m=n("recent-panel"),l=n("layout");return o(),S(l,null,{config:d(()=>[s(p,{onGenerate:e.onGeneratePicture},null,8,["onGenerate"])]),result:d(()=>[s(g,{initializing:e.initializing,application:e.application,applications:e.applications,service:e.service,"need-apply":e.needApply,class:"mb-4",onRefresh:e.onGetApplication,onSelect:t[0]||(t[0]=u=>e.$store.dispatch("headshots/setApplication",u))},null,8,["initializing","application","applications","service","need-apply","onRefresh"]),s(m,{ref:"recentPanel",class:"panel recent",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const ht=k(Is,[["render",Es],["__scopeId","data-v-c707e859"]]);export{ht as default};
|