@acedatacloud/nexior 3.206.0 → 3.207.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/{Auth-CSfb56OH.js → Auth-Dce920-R.js} +1 -1
- package/dist/assets/{BotPlaceholder-Dy1gr-9h.js → BotPlaceholder-BZTrMT1c.js} +1 -1
- package/dist/assets/{Callback-BYME1VlY.js → Callback-BMjqPSwT.js} +1 -1
- package/dist/assets/{Console-lBWrcjsC.js → Console-C4D3R1ck.js} +1 -1
- package/dist/assets/{Consumption-DVkwcyaB.js → Consumption-tJVE5oXO.js} +1 -1
- package/dist/assets/{Conversation-10zfI04-.js → Conversation-CqsIS4eA.js} +1 -1
- package/dist/assets/{CopyToClipboard-UnYO6hAq.js → CopyToClipboard-BthEHufq.js} +1 -1
- package/dist/assets/{Detail-DZKtD8io.js → Detail-WTNxNgmJ.js} +2 -2
- package/dist/assets/{Extra-DPpMWois.js → Extra-C-xZRZXJ.js} +1 -1
- package/dist/assets/{FilePreview-B7MnxDfU.js → FilePreview-19tiWMqq.js} +1 -1
- package/dist/assets/{History-D6dr3Hov.js → History-Q0DrqZIg.js} +1 -1
- package/dist/assets/IconPark.vue_vue_type_script_setup_true_lang-CpAUocHI.js +1 -0
- package/dist/assets/{ImagePreview-C4OiWDg9.js → ImagePreview-CJP-yB4D.js} +1 -1
- package/dist/assets/{ImageWrapper-DcqueDH9.js → ImageWrapper-BBWjyl4X.js} +1 -1
- package/dist/assets/{Index-CMesc4Xc.js → Index-3Fm2prBE.js} +1 -1
- package/dist/assets/{Index-B4AhoY-s.js → Index-9VLv8Mii.js} +1 -1
- package/dist/assets/{Index-Baghl01K.js → Index-B4MkRRvd.js} +1 -1
- package/dist/assets/{Index-DaA0NCra.js → Index-BALZObRM.js} +1 -1
- package/dist/assets/{Index-CeBv8r8l.js → Index-BHQ2-n3q.js} +1 -1
- package/dist/assets/{Index-qcVZJBdC.js → Index-BV1OjZBh.js} +1 -1
- package/dist/assets/{Index-CVeZRx01.js → Index-B_oLeXIS.js} +1 -1
- package/dist/assets/{Index-iggsMn50.js → Index-Bxun8G4k.js} +1 -1
- package/dist/assets/{Index-XE6kq-2M.js → Index-C3jOzeR8.js} +1 -1
- package/dist/assets/{Index-B8ME-u_E.js → Index-CfbJEwPf.js} +1 -1
- package/dist/assets/{Index-Bv2s_27T.js → Index-CmsydDPC.js} +1 -1
- package/dist/assets/{Index-YfBUyTR2.js → Index-CwiBhoSK.js} +1 -1
- package/dist/assets/{Index-__LWV3GV.js → Index-CzfrNUJN.js} +1 -1
- package/dist/assets/{Index-Dasz5Em7.js → Index-D7Skgxbm.js} +1 -1
- package/dist/assets/{Index-DirH7cSv.js → Index-DD0EHZ6s.js} +1 -1
- package/dist/assets/{Index-DCN9OZCF.js → Index-DIlbji30.js} +1 -1
- package/dist/assets/{Index-Bz3ITLtF.js → Index-DNSZVt8d.js} +1 -1
- package/dist/assets/{Index-DL2N84Ds.js → Index-DYu-UVrx.js} +1 -1
- package/dist/assets/{Index-BMuqpm_q.js → Index-Df_3f5g9.js} +1 -1
- package/dist/assets/{Index-D5DYhXUV.js → Index-Fpq3jlhy.js} +1 -1
- package/dist/assets/{Index-CiRWgQ-2.js → Index-pI_3O6FW.js} +1 -1
- package/dist/assets/{Index-SFPWTqVD.js → Index-sEfNwE6k.js} +1 -1
- package/dist/assets/{Index-CBATDK9E.js → Index-stgmagiE.js} +1 -1
- package/dist/assets/{Index-C9Wrha4U.js → Index-wlbCPr9q.js} +1 -1
- package/dist/assets/{Invitees-DmseEV64.js → Invitees-CQ7RiHMG.js} +1 -1
- package/dist/assets/{List-Dr3s27uo.js → List-C5xUnQHw.js} +1 -1
- package/dist/assets/{List-M5uwWU2x.js → List-Cf1eN4n0.js} +1 -1
- package/dist/assets/{List-D0koPLXY.js → List-EZ2xSsBF.js} +1 -1
- package/dist/assets/{Main-DJzR9yMb.js → Main-bqIl_fwV.js} +1 -1
- package/dist/assets/{Navigator-CjIGA6hj.js → Navigator-DPxvQ9my.js} +1 -1
- package/dist/assets/{NoTasks-Dpcud_u4.js → NoTasks-gaaOL_m7.js} +1 -1
- package/dist/assets/{NotFound-Cq0QMOF0.js → NotFound-DZNa0j-I.js} +1 -1
- package/dist/assets/Pagination-DRjlL_dM.js +1 -0
- package/dist/assets/{Status-C3OMqSVk.js → Status-DzvbugyE.js} +1 -1
- package/dist/assets/{Subscribe-BFaBhkN-.js → Subscribe-BGO77YBo.js} +1 -1
- package/dist/assets/{VideoPlayer-B-GlKJVH.js → VideoPlayer-Dn-EFbop.js} +1 -1
- package/dist/assets/{_Uint8Array-Dhv101dV.js → _Uint8Array-BnVWNeHp.js} +1 -1
- package/dist/assets/{_baseClone-D4Hl6Ymo.js → _baseClone-Q0okPItx.js} +1 -1
- package/dist/assets/{_baseIteratee-URGnejHV.js → _baseIteratee-Bw61Z4Wx.js} +1 -1
- package/dist/assets/{_initCloneObject-QV4IIV31.js → _initCloneObject-DuLU5kHr.js} +1 -1
- package/dist/assets/{add-DiZxRfyv.js → add-BHJc9-Xi.js} +1 -1
- package/dist/assets/{all-wallets-CA9kjtPr.js → all-wallets-BfC1-iuR.js} +1 -1
- package/dist/assets/{app-store-BCdBcz5B.js → app-store-Bn7LbjBW.js} +1 -1
- package/dist/assets/{apple-D2H-LpvN.js → apple-BzgZCTUI.js} +1 -1
- package/dist/assets/{arrow-bottom-D7Saw1wE.js → arrow-bottom-B4m8T3u_.js} +1 -1
- package/dist/assets/{arrow-bottom-circle-qnXeaRx8.js → arrow-bottom-circle-BUTrvpis.js} +1 -1
- package/dist/assets/{arrow-left-BCE22ALC.js → arrow-left-BubUEC4-.js} +1 -1
- package/dist/assets/{arrow-right-SsSFJ46C.js → arrow-right-B1FF85iL.js} +1 -1
- package/dist/assets/{arrow-top-PyB9YJIL.js → arrow-top-lPzDOg2G.js} +1 -1
- package/dist/assets/{avatar-C9Pg0w_c.js → avatar-DojN-v8h.js} +1 -1
- package/dist/assets/{bank-CyTn1N8k.js → bank-D-ejARzl.js} +1 -1
- package/dist/assets/{basic-B30XfaoD.js → basic-DT6LkBVZ.js} +1 -1
- package/dist/assets/{browser-h2vsWFJr.js → browser-Cww9lHqu.js} +1 -1
- package/dist/assets/{byokCredential-BhS7uMA-.js → byokCredential-DVQ4GuRL.js} +1 -1
- package/dist/assets/{card-DKehLwUY.js → card-BHHkstVg.js} +1 -1
- package/dist/assets/{castArray-DD0p5-P9.js → castArray-CB5VORGs.js} +1 -1
- package/dist/assets/{chat-DoZXmsvM.js → chat-15L1iHYd.js} +1 -1
- package/dist/assets/{chat-BzleL_Uz.js → chat-BIGDz2U8.js} +1 -1
- package/dist/assets/{chat-D2m8gku0.js → chat-Bzz6VpI2.js} +1 -1
- package/dist/assets/{chat-CSNt1o-J.js → chat-C1Fov3VZ.js} +1 -1
- package/dist/assets/{chat-o7hynbrW.js → chat-CLbEuebR.js} +1 -1
- package/dist/assets/{chat-chnRJg4L.js → chat-CMe4j38Z.js} +1 -1
- package/dist/assets/{chat-IohVlXXK.js → chat-CPJzXDDq.js} +1 -1
- package/dist/assets/{chat-BnGvwufG.js → chat-CRMiyNWh.js} +1 -1
- package/dist/assets/{chat-BJaOxsfW.js → chat-C_QoPV7n.js} +1 -1
- package/dist/assets/{chat-L6m5LCyf.js → chat-Cq5B3uAW.js} +1 -1
- package/dist/assets/{chat-BSG7BtPO.js → chat-CzBgIVjJ.js} +1 -1
- package/dist/assets/{chat-CcNcNOvq.js → chat-DLPgIxZs.js} +1 -1
- package/dist/assets/{chat-Bk4YS_XZ.js → chat-Db5jHkMr.js} +1 -1
- package/dist/assets/{chat-DcMaoanl.js → chat-DnTeHwdL.js} +1 -1
- package/dist/assets/{chat-DF8O2BE6.js → chat-GQ2lWN7D.js} +1 -1
- package/dist/assets/{chat-Cx5rbNLL.js → chat-J0zL9WVN.js} +1 -1
- package/dist/assets/{chat-DSivFUAE.js → chat-JNXCDzNu.js} +1 -1
- package/dist/assets/{chat-DKzVdvmc.js → chat-_8bK1SD2.js} +1 -1
- package/dist/assets/{chat-C3f_SV5W.js → chat-q7DMvyHC.js} +1 -1
- package/dist/assets/{checkmark-DCCGge-I.js → checkmark-BOJIqbkU.js} +1 -1
- package/dist/assets/{checkmark-bold-BjtXpXNX.js → checkmark-bold-AM2r6J2s.js} +1 -1
- package/dist/assets/{chevron-bottom-CmdeH3YF.js → chevron-bottom-B3LHjJJ3.js} +1 -1
- package/dist/assets/{chevron-left-jekdBZYG.js → chevron-left-o1oDm0g0.js} +1 -1
- package/dist/assets/{chevron-right-LfqT_ogg.js → chevron-right-BujYbnWr.js} +1 -1
- package/dist/assets/{chevron-top-CEAm5to6.js → chevron-top-DPGdnhlq.js} +1 -1
- package/dist/assets/{chrome-store-BR7UKoMo.js → chrome-store-B0C7Dvg3.js} +1 -1
- package/dist/assets/{clock-DB9rcQyy.js → clock-Dq90QgyH.js} +1 -1
- package/dist/assets/{close-CDLiDwhi.js → close-Ddw43auG.js} +1 -1
- package/dist/assets/{coinPlaceholder-BSe6THBQ.js → coinPlaceholder-BClGALbt.js} +1 -1
- package/dist/assets/{compass-DzdDf23d.js → compass-j3x_JuF7.js} +1 -1
- package/dist/assets/{copy-B5-OW2a2.js → copy-CoDaeoDy.js} +1 -1
- package/dist/assets/{createTaskActions-2NM5wfUJ.js → createTaskActions-Mbk9YPjO.js} +1 -1
- package/dist/assets/{cursor-C6Ujgj3H.js → cursor-BUcjAEEw.js} +1 -1
- package/dist/assets/{cursor-transparent-DikOUPZ7.js → cursor-transparent-C75fbcep.js} +1 -1
- package/dist/assets/{debounce-CQuM7WhN.js → debounce-Bt9MZ6bV.js} +1 -1
- package/dist/assets/{desktop-BKDvEQGr.js → desktop-B5niTzqq.js} +1 -1
- package/dist/assets/{disconnect-yMe0chPA.js → disconnect-CLvOZFae.js} +1 -1
- package/dist/assets/{discord-BqdL6YRL.js → discord-DG2H5efs.js} +1 -1
- package/dist/assets/{distribution-CdFl_HYM.js → distribution-DJ7DtFet.js} +1 -1
- package/dist/assets/{dropdown-Be9A6Q1U.js → dropdown-DFq4J8nF.js} +1 -1
- package/dist/assets/{etherscan-VSRxJAHz.js → etherscan-XsFEw09l.js} +1 -1
- package/dist/assets/{exclamation-triangle-C4ZeuUXe.js → exclamation-triangle-Dvyl-cKA.js} +1 -1
- package/dist/assets/{extension-CYSGh5Ps.js → extension-DbFHjx1L.js} +1 -1
- package/dist/assets/{external-link-C2t48ySQ.js → external-link-ChP60Cu4.js} +1 -1
- package/dist/assets/{facebook-DX84uKaw.js → facebook-xJCj9izo.js} +1 -1
- package/dist/assets/{farcaster-D7krxIjZ.js → farcaster-DZq_Zkvf.js} +1 -1
- package/dist/assets/{filters-_NOp5ZNB.js → filters-B5n92rN7.js} +1 -1
- package/dist/assets/{github-IswwPpZb.js → github-gJJFFYif.js} +1 -1
- package/dist/assets/{google-ha9xfgLN.js → google-Cw8hP4bz.js} +1 -1
- package/dist/assets/{help-circle-Dq5mSEXw.js → help-circle-Dfvo07Ng.js} +1 -1
- package/dist/assets/{id-m1VjxbRl.js → id-D-i1S0fL.js} +1 -1
- package/dist/assets/{image-BeNPNxJW.js → image-DM3GT_fn.js} +1 -1
- package/dist/assets/{index-9yJ1N7L6.js → index-5b5QT5kF.js} +1 -1
- package/dist/assets/{index-B9UWj95d.js → index-B3oq9DXF.js} +1 -1
- package/dist/assets/index-B6W1wPG_.js +1 -0
- package/dist/assets/index-B9EcsscT.js +1 -0
- package/dist/assets/{index-CNJJpejN.js → index-BB9Q0vES.js} +1 -1
- package/dist/assets/{index-C9dS1Vww.js → index-BEOL0Xrj.js} +1 -1
- package/dist/assets/{index-6RhQMvFk.js → index-BHiGwdGq.js} +1 -1
- package/dist/assets/{index-BlFREO4o.js → index-BHl7APJC.js} +1 -1
- package/dist/assets/{index-B5O-vJei.js → index-BLB6heXB.js} +1 -1
- package/dist/assets/{index-DlCMkuoQ.js → index-BQg-qW1C.js} +1 -1
- package/dist/assets/{index-Cgotms-9.js → index-BY-fNnkK.js} +1 -1
- package/dist/assets/{index-DdrN6aYX.js → index-BZRCFjq5.js} +1 -1
- package/dist/assets/{index-sF_c-ZTZ.js → index-BqF_vHYf.js} +1 -1
- package/dist/assets/{index-Bcw8SuLC.js → index-BzVS_KLU.js} +1 -1
- package/dist/assets/{index-5QUi5jMP.js → index-C9eoKJfs.js} +1 -1
- package/dist/assets/{index-Pm_NNVry.js → index-CBIxq1Mn.js} +1 -1
- package/dist/assets/{index-DdTPL-Mv.js → index-CEsBfy8P.js} +1 -1
- package/dist/assets/{index-BLYgMn4W.js → index-CHmkar7W.js} +1 -1
- package/dist/assets/{index-CpWcFmdT.js → index-CLR-flkd.js} +2 -2
- package/dist/assets/index-CLxhDB-t.js +1 -0
- package/dist/assets/{index-DoifIIRJ.js → index-CMCbURvj.js} +1 -1
- package/dist/assets/{index-DPHGUkiZ.js → index-CX13bdIk.js} +3 -3
- package/dist/assets/{index-CjbcI5gK.js → index-CXsMugBf.js} +1 -1
- package/dist/assets/index-CbbUfyeR.js +1 -0
- package/dist/assets/{index-BY_Hhm9s.js → index-Cd5Ej_f3.js} +1 -1
- package/dist/assets/{index-BDF48iTM.js → index-CfWyJXht.js} +1 -1
- package/dist/assets/{index-yQOfqDCz.js → index-CfvQR26y.js} +1 -1
- package/dist/assets/{index-Dxq53QkJ.js → index-CiLcyhjJ.js} +1 -1
- package/dist/assets/{index-DM6P3x3N.js → index-ClwpIr_P.js} +1 -1
- package/dist/assets/{index-B6qEofLE.js → index-Cm0SnhY0.js} +1 -1
- package/dist/assets/{index-CCfnxGYg.js → index-CnhjD_2F.js} +4 -4
- package/dist/assets/{index-Z7FqG7qm.js → index-Co5T7YKQ.js} +1 -1
- package/dist/assets/{index-B1DLX4Fc.js → index-CrH79zK9.js} +1 -1
- package/dist/assets/{index-MuxMnGqS.js → index-CvVK6L7k.js} +1 -1
- package/dist/assets/{index-mTDdtUSQ.js → index-CwPjkJs4.js} +1 -1
- package/dist/assets/{index-CoYnpgkX.js → index-D1rl1ShF.js} +1 -1
- package/dist/assets/{index-CqLRzQZy.js → index-D3aOatfx.js} +1 -1
- package/dist/assets/{index-3c5oSDnc.js → index-D4eloMlC.js} +1 -1
- package/dist/assets/{index-CWu2cUvK.js → index-D7IaIK0w.js} +1 -1
- package/dist/assets/{index-B5vjdbxo.js → index-D7LXRPby.js} +1 -1
- package/dist/assets/{index-B1msaBme.js → index-DFzC0rQH.js} +1 -1
- package/dist/assets/{index-DpJj9HmB.js → index-DM2bAVRX.js} +1 -1
- package/dist/assets/{index-BHtuVUFl.js → index-DPq9Ww9N.js} +1 -1
- package/dist/assets/{index-Bq9ls24b.js → index-DUqJAZYu.js} +1 -1
- package/dist/assets/{index-0bs-5Squ.js → index-DXEiBbAN.js} +2 -2
- package/dist/assets/{index-CWRXZUk7.js → index-DZ_0eneF.js} +1 -1
- package/dist/assets/{index-BXLA00YT.js → index-DcsXEqCx.js} +5 -5
- package/dist/assets/{index-F6di8YRk.js → index-Dj0O4JQ-.js} +1 -1
- package/dist/assets/{index-DgJP0RTq.js → index-DjJwI7Q0.js} +1 -1
- package/dist/assets/index-DmYzMmpZ.js +1 -0
- package/dist/assets/{index-TGK76xjl.js → index-DpPoOWtb.js} +1 -1
- package/dist/assets/{index-Bbh6HVkj.js → index-Du2B_Wxi.js} +1 -1
- package/dist/assets/{index-BwEtWche.js → index-Kc0m7PO-.js} +1 -1
- package/dist/assets/{index-CQzk_lha.js → index-NWO7ox7u.js} +2 -2
- package/dist/assets/{index-D2dNGLLf.js → index-eG-nVdDk.js} +1 -1
- package/dist/assets/{index-oXSgzRw8.js → index-hAESLnAe.js} +1 -1
- package/dist/assets/{index-BbjLkNT5.js → index-qUrXiTT8.js} +1 -1
- package/dist/assets/index-uim_HWNA.js +1 -0
- package/dist/assets/{index-BfSiZO1Q.js → index-ws34Ea3I.js} +1 -1
- package/dist/assets/{index-TQ6wokdY.js → index-zgQkx08I.js} +1 -1
- package/dist/assets/{index.browser.esm-Ec1sdTPa.js → index.browser.esm-ByUOgEo_.js} +1 -1
- package/dist/assets/{index.es-D5toi_yB.js → index.es-DN8G0P37.js} +1 -1
- package/dist/assets/{info-CbPpfCBR.js → info-CXP9N7Ey.js} +1 -1
- package/dist/assets/{info-circle-C7LMv3wy.js → info-circle-7IJbskr1.js} +1 -1
- package/dist/assets/{isEqual-1RENOQre.js → isEqual-DGVdfmbU.js} +1 -1
- package/dist/assets/{isPlainObject-CS0cmpQf.js → isPlainObject-C8-9-V_9.js} +1 -1
- package/dist/assets/{lightbulb-CRhf61JD.js → lightbulb-1OQ0mdcY.js} +1 -1
- package/dist/assets/{mail-Ciy-_QID.js → mail-DMAMEqQh.js} +1 -1
- package/dist/assets/{midjourney-HC3LAlrs.js → midjourney-BwxG0zA1.js} +1 -1
- package/dist/assets/{mobile-CPVh5p5n.js → mobile-WNoGZhDV.js} +1 -1
- package/dist/assets/{more-B_z-uJxf.js → more-CdeUEKOp.js} +1 -1
- package/dist/assets/{network-placeholder-DFTSuhGH.js → network-placeholder-DJBWa-A2.js} +1 -1
- package/dist/assets/{nftPlaceholder-DiM6ZvWl.js → nftPlaceholder-Bo37HhYE.js} +1 -1
- package/dist/assets/{off-Dv23VNZK.js → off-CmfzTxhN.js} +1 -1
- package/dist/assets/{order-DSUfJcNS.js → order-BJTgbKYU.js} +1 -1
- package/dist/assets/{pagination-BO6RV-kc.js → pagination-BCTFE7Z3.js} +1 -1
- package/dist/assets/{play-store-DXERZsFT.js → play-store-BwwY4IKx.js} +1 -1
- package/dist/assets/{plus-Dem0uVoZ.js → plus-BMB1cqqT.js} +1 -1
- package/dist/assets/{price-DPkoP0YP.js → price-7DAsoJmR.js} +1 -1
- package/dist/assets/{producer-CBZL3Tt8.js → producer-Cb73jID1.js} +1 -1
- package/dist/assets/{qr-code-C6MN6eiv.js → qr-code-BFxEy5_a.js} +1 -1
- package/dist/assets/{recycle-horizontal-e7OAO3BB.js → recycle-horizontal-C_bgJwUY.js} +1 -1
- package/dist/assets/{refresh-BZL6-I1K.js → refresh-BCE09s8e.js} +1 -1
- package/dist/assets/{reown-logo-D2M2JHp4.js → reown-logo-DQp_r0An.js} +1 -1
- package/dist/assets/{search-CZzguwmn.js → search-BUoFuygq.js} +1 -1
- package/dist/assets/{secp256k1-9xwshtD-.js → secp256k1-QHTbOsJo.js} +1 -1
- package/dist/assets/{secp256k1-CuUMuaUz.js → secp256k1-XjfkD12g.js} +1 -1
- package/dist/assets/seedance-BdAwAq2M.js +1 -0
- package/dist/assets/seedance-BgXQJNYF.js +1 -0
- package/dist/assets/seedance-BugWQiST.js +1 -0
- package/dist/assets/seedance-C-pp6mhg.js +1 -0
- package/dist/assets/seedance-C446w2fF.js +1 -0
- package/dist/assets/seedance-CI0MVpsz.js +1 -0
- package/dist/assets/seedance-CV79TVBT.js +1 -0
- package/dist/assets/seedance-CuExFF17.js +1 -0
- package/dist/assets/seedance-D07JvXV_.js +1 -0
- package/dist/assets/{seedance-RkI_fBb4.js → seedance-D5U-QGR7.js} +1 -1
- package/dist/assets/seedance-DBz-t4EK.js +1 -0
- package/dist/assets/seedance-DQPnxVvQ.js +1 -0
- package/dist/assets/seedance-D_QTHXq3.js +1 -0
- package/dist/assets/seedance-DkUpjRcE.js +1 -0
- package/dist/assets/seedance-lg8R1TTa.js +1 -0
- package/dist/assets/seedance-okIhOu0L.js +1 -0
- package/dist/assets/{seedream-Bb4LS1xp.js → seedream-CN1BaFH-.js} +1 -1
- package/dist/assets/{send-ChJZTEP2.js → send-BZ_FRT-x.js} +1 -1
- package/dist/assets/{service-dszq0yWz.js → service-D9QPLvru.js} +1 -1
- package/dist/assets/{solana-wallets-DHA44qD6.js → solana-wallets-C0MIh7dX.js} +2 -2
- package/dist/assets/{solana-wallets-vue-Dy7_7s0F.js → solana-wallets-vue-D5nyZmND.js} +1 -1
- package/dist/assets/{suno-DZUIu5iQ.js → suno-dLVdLz6A.js} +1 -1
- package/dist/assets/{swapHorizontal-Bs1loZJ0.js → swapHorizontal-DjVLKsq6.js} +1 -1
- package/dist/assets/{swapHorizontalBold-DesPLud9.js → swapHorizontalBold-CpmWZfom.js} +1 -1
- package/dist/assets/{swapHorizontalMedium-rCDxIvRe.js → swapHorizontalMedium-DIHCVdP3.js} +1 -1
- package/dist/assets/{swapHorizontalRoundedBold-CqJlLgjd.js → swapHorizontalRoundedBold-Bn16xTyV.js} +1 -1
- package/dist/assets/{swapVertical-DzdY--dV.js → swapVertical-D3FvZJb6.js} +1 -1
- package/dist/assets/{telegram-B25J3wn3.js → telegram-C_PlgbOP.js} +1 -1
- package/dist/assets/{three-dots-BxpOjm5v.js → three-dots-lu6K3YVM.js} +1 -1
- package/dist/assets/{twitch-ClxYbBcn.js → twitch-CZLL61zT.js} +1 -1
- package/dist/assets/{twitterIcon-czoCz_op.js → twitterIcon-Due6Eiu4.js} +1 -1
- package/dist/assets/{typescript-DYVOpHug.js → typescript-COFNajQU.js} +1 -1
- package/dist/assets/{use-form-item-BdyDMPU-.js → use-form-item-BKB_7n3g.js} +1 -1
- package/dist/assets/validator-QEfhhC-Q.js +1 -0
- package/dist/assets/{verify-D7EJG1ou.js → verify-CewIogRr.js} +1 -1
- package/dist/assets/{verify-filled-d0eV_EPV.js → verify-filled-DBIhvgaD.js} +1 -1
- package/dist/assets/{w3m-modal-CBwHoVyK.js → w3m-modal-DAUMYSwf.js} +1 -1
- package/dist/assets/{wallet-BI8hd63W.js → wallet-DFzSwL2i.js} +1 -1
- package/dist/assets/{wallet-placeholder--PgzZ8AB.js → wallet-placeholder-BQA1DTjB.js} +1 -1
- package/dist/assets/{walletconnect-CbbQ1JOe.js → walletconnect-Cl4FGvYO.js} +1 -1
- package/dist/assets/{warning-circle-DnyZS71o.js → warning-circle-BOMPFMKZ.js} +1 -1
- package/dist/assets/{web-Nk2aCv1V.js → web-B0QX44uP.js} +1 -1
- package/dist/assets/{web-DLCZq3oI.js → web-Dw69BXzS.js} +1 -1
- package/dist/assets/{x-Dk_bD2dZ.js → x-C7_XWmru.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/IconPark.vue_vue_type_script_setup_true_lang-SDs1IsFL.js +0 -1
- package/dist/assets/OAuthCallback--H6yOQ5o.js +0 -1
- package/dist/assets/OAuthCallback-C9p1KhIU.css +0 -1
- package/dist/assets/Pagination-DMLrbyDg.js +0 -1
- package/dist/assets/index-1diQ6JT1.js +0 -1
- package/dist/assets/index-7i1RSn5L.js +0 -1
- package/dist/assets/index-DU5biqWK.js +0 -1
- package/dist/assets/index-Dwk0fHJ3.js +0 -1
- package/dist/assets/index-DzM45IpD.js +0 -1
- package/dist/assets/index-oRUvw3Ui.js +0 -1
- package/dist/assets/seedance-BO2Y7lG0.js +0 -1
- package/dist/assets/seedance-BaC_7dt2.js +0 -1
- package/dist/assets/seedance-C0xtCKBO.js +0 -1
- package/dist/assets/seedance-C27Na3dE.js +0 -1
- package/dist/assets/seedance-C5_UK3dA.js +0 -1
- package/dist/assets/seedance-C7MK-yfm.js +0 -1
- package/dist/assets/seedance-CCQy-nqd.js +0 -1
- package/dist/assets/seedance-CJUmYosg.js +0 -1
- package/dist/assets/seedance-CiZbFmTS.js +0 -1
- package/dist/assets/seedance-DPEyCbS4.js +0 -1
- package/dist/assets/seedance-K6baVhtp.js +0 -1
- package/dist/assets/seedance-ReJcvMlz.js +0 -1
- package/dist/assets/seedance-j6Jz1KQV.js +0 -1
- package/dist/assets/seedance-oO0Q6WuG.js +0 -1
- package/dist/assets/seedance-pwdOdxdA.js +0 -1
- package/dist/assets/validator-B70qvqYD.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as E}from"./index.es-D5toi_yB.js";import{E as L}from"./index-mTDdtUSQ.js";import{E as re}from"./index-DU5biqWK.js";import{d as b,H as m,E as i,z as N,C as n,y as h,D as o,q as l,F as r,x as C,O as V,N as T,Q as U,J as v,R as ve,I as w,M as be}from"./vendor-vue-NSDaktjZ.js";import{G as y,bj as G,ag as ye,H as we,co as ee,aF as te,S as oe,cp as Ce}from"./index-CCfnxGYg.js";import{b as Se,c as ne,d as F,e as D,f as Ve,g as Ie,h as Te}from"./kling-CtoPhhA9.js";import{E as A,a as P}from"./index-B1msaBme.js";import{E as q}from"./index-CWu2cUvK.js";import{E as S}from"./index-CoYnpgkX.js";import{I,S as Ee,l as Le}from"./pagination-BO6RV-kc.js";import{p as H}from"./pasteUploadMixin-BurWbGNQ.js";import{I as K}from"./ImagePreview-C4OiWDg9.js";import{E as W}from"./index-DM6P3x3N.js";import{E as O}from"./index-BwEtWche.js";import{C as ce}from"./Consumption-DVkwcyaB.js";import{E as de}from"./index-BfSiZO1Q.js";import{E as me}from"./index-6RhQMvFk.js";import{E as ue}from"./index-7i1RSn5L.js";import{P as Me,N as Re}from"./NoTasks-Dpcud_u4.js";import{E as pe}from"./index-B5vjdbxo.js";import{a as ge}from"./price-DPkoP0YP.js";import{F as Ue}from"./FilePreview-B7MnxDfU.js";import{E as De,a as Ae}from"./index-Dxq53QkJ.js";import{E as Pe,a as Ge}from"./index-sF_c-ZTZ.js";import{b as se}from"./errorCode-Cqj9Td_Z.js";import{C as Ke}from"./CopyToClipboard-UnYO6hAq.js";import{V as Oe}from"./VideoPlayer-B-GlKJVH.js";import{E as je}from"./index-oRUvw3Ui.js";import{E as Ne}from"./index-B1DLX4Fc.js";import{B as Be}from"./BotPlaceholder-Dy1gr-9h.js";import"./use-form-item-BdyDMPU-.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Df5ITouH.js";import"./index-Dwk0fHJ3.js";import"./typescript-DYVOpHug.js";import"./index-BHtuVUFl.js";import"./strings-beZM2Y-f.js";import"./isEqual-1RENOQre.js";import"./_Uint8Array-Dhv101dV.js";import"./castArray-DD0p5-P9.js";import"./debounce-CQuM7WhN.js";import"./_baseIteratee-URGnejHV.js";import"./index-3c5oSDnc.js";import"./validator-B70qvqYD.js";import"./index-CpWcFmdT.js";import"./_baseClone-D4Hl6Ymo.js";import"./_initCloneObject-QV4IIV31.js";import"./index-Cu41y2Fl.js";import"./index-BbjLkNT5.js";import"./isPlainObject-CS0cmpQf.js";import"./vue-plyr-BO2nlN4c.js";import"./index-1diQ6JT1.js";const ze=b({name:"LayoutKling",components:{ElDrawer:re,ElButton:L,FontAwesomeIcon:E},data(){return{drawer:!1}}}),Fe={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)]"},He={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function We(e,t,s,a,u,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),m("div",Fe,[i("div",qe,[N(e.$slots,"config",{},void 0,!0)]),i("div",He,[N(e.$slots,"result",{},void 0,!0)]),n(p,{circle:"",class:"menu",onClick:t[0]||(t[0]=c=>e.drawer=!0)},{default:h(()=>[n(d,{icon:"fa-solid fa-magic"})]),_:1}),n(f,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=c=>e.drawer=c),direction:"ltr","with-header":!1,size:"350px"},{default:h(()=>[N(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Je=y(ze,[["render",We],["__scopeId","data-v-be4bb0df"]]),Qe={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function J(e,t,s){const a=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:a==="pro",audio:!1,motionControl:!1};case"kling-v2-6":return{text2video:!0,image2video:!0,endImage:a==="pro",audio:a==="pro",motionControl:!1};case"kling-v2-master":case"kling-v2-1-master":return{text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};case"kling-v3":return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:a!=="4k"};case"kling-v3-omni":return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:!1};case"kling-video-o1":return{text2video:!0,image2video:!0,endImage:!0,audio:!1,motionControl:!1};default:return Qe}}function Q(e,t){if(!e)return[];const s=t.model??e.model,a=t.mode??e.mode,u=t.duration??e.duration;if(!s)return[];const $=J(s,a,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 Y(e,t){const s={...e};for(const a of t)a.field==="end_image_url"&&(s.end_image_url=void 0),a.field==="generate_audio"&&(s.generate_audio=!1),a.field==="camera_control"&&(s.camera_control=void 0);return s}const Ye=b({name:"ModelSelector",components:{ElSelect:P,ElOption:A},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{revertKey:0,options:[{value:"kling-v3",label:"v3"},{value:"kling-v3-omni",label:"v3-Omni"},{value:"kling-v2-6",label:"v2.6"},{value:"kling-v2-5-turbo",label:"v2.5-Turbo"},{value:"kling-v2-1-master",label:"v2.1-Master"},{value:"kling-v2-master",label:"v2-Master"},{value:"kling-v1-6",label:"v1.6"},{value:"kling-v1",label:"v1"},{value:"kling-video-o1",label:"Video-o1"}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(Se)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Q(t,{model:e});if(s.length===0){this.applyModel(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=Y({...t,model:e},s);this.$store.commit("kling/setConfig",u),S.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,model:e})}}}),Xe={class:"field"},Ze={class:"title font-bold"};function xe(e,t,s,a,u,$){const d=o("el-option"),p=o("el-select");return l(),m("div",Xe,[i("h2",Ze,r(e.$t("pika.name.model")),1),(l(),C(p,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("pika.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),m(V,null,T(e.options,f=>(l(),C(d,{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const et=y(Ye,[["render",xe],["__scopeId","data-v-04059875"]]),tt=b({name:"ModeSelector",components:{ElSelect:P,ElOption:A,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 F.includes(this.selectedModel)?this.cameraControlSet?this.$t("kling.description.mode4kIncompatibleCamera"):"":this.$t("kling.description.mode4kRequiresV3")},options(){return[{value:"std",label:this.$t("kling.name.modeStd"),disabled:!1,disabledReason:""},{value:"pro",label:this.$t("kling.name.modePro"),disabled:!1,disabledReason:""},{value:"4k",label:this.$t("kling.name.mode4k"),disabled:!!this.fourKReason,disabledReason:this.fourKReason}]},value(){return this.$store.state.kling?.config?.mode}},watch:{fourKReason(e){e&&this.value==="4k"&&this.applyMode(ne)}},mounted(){this.value||this.applyMode(ne)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Q(t,{mode:e});if(s.length===0){this.applyMode(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=Y({...t,mode:e},s);this.$store.commit("kling/setConfig",u),S.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyMode(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,mode:e})}}}),ot={class:"field"},nt={class:"header"},st={class:"title font-bold"},it={key:0,class:"opt-tip"};function lt(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),m("div",ot,[i("div",nt,[i("h2",st,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.mode"),class:"info-icon"},null,8,["content"])]),(l(),C(f,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("kling.placeholder.select"),clearable:!0,onChange:e.onChange},{default:h(()=>[(l(!0),m(V,null,T(e.options,c=>(l(),C(p,{key:c.value,label:c.label,value:c.value,disabled:c.disabled},{default:h(()=>[i("span",{class:U({"opt-disabled":c.disabled})},r(c.label),3),c.disabled&&c.disabledReason?(l(),m("span",it,r(c.disabledReason),1)):v("",!0)]),_:2},1032,["label","value","disabled"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const at=y(tt,[["render",lt],["__scopeId","data-v-9a8fa3c5"]]),rt=[3,5,8,10,12,15],ct=[5,10],dt=b({name:"DurationSelector",components:{ElSelect:P,ElOption:A,InfoIcon:I},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},isV3Model(){return F.includes(this.selectedModel)},allowedDurations(){return this.isV3Model?rt:ct},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=Q(t,{duration:e});if(s.length===0){this.applyDuration(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=Y({...t,duration:e},s);this.$store.commit("kling/setConfig",u),S.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyDuration(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,duration:e})}}}),mt={class:"field"},ut={class:"control"},pt={class:"label"},gt={class:"title font-bold"};function ft(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),m("div",mt,[i("div",ut,[i("div",pt,[i("h2",gt,r(e.$t("kling.name.duration")),1),n(d,{content:e.$t("kling.description.duration"),class:"info-icon ml-1"},null,8,["content"])]),(l(),C(f,{key:e.revertKey,"model-value":e.selectValue,class:"value",placeholder:e.$t("kling.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),m(V,null,T(e.allowedDurations,c=>(l(),C(p,{key:c,label:`${c}s`,value:c},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])])}const ht=y(dt,[["render",ft],["__scopeId","data-v-5ae55e28"]]),_t=b({name:"RatioSelector",data(){return{options:[{value:"1:1",label:"1:1",width:20,height:20},{value:"16:9",label:"16:9",width:25,height:13},{value:"9:16",label:"9:16",width:13,height:25}]}},computed:{active(){return this.options.findIndex(e=>e.value===this.value)||0},value:{get(){return this.$store.state?.kling?.config?.aspect_ratio},set(e){console.debug("set ratio",e),this.$store.commit("kling/setConfig",{...this.$store.state?.kling?.config,aspect_ratio:e})}}},mounted(){this.value||(this.value=Ve)}}),$t={class:"text-sm font-bold mb-2 block"},kt={class:"items"},vt=["onClick"],bt={class:"name"};function yt(e,t,s,a,u,$){return l(),m("div",null,[i("span",$t,r(e.$t("kling.name.ratio")),1),i("div",kt,[(l(!0),m(V,null,T(e.options,(d,p)=>(l(),m("div",{key:p,class:U({active:e.active===p,item:!0}),onClick:f=>e.value=d.value},[i("div",{class:U(["preview",d.label])},[i("div",{class:"rect",style:ve({width:d.width+"px",height:d.height+"px"})},null,4)],2),i("p",bt,r(d.label),1)],10,vt))),128))])])}const wt=y(_t,[["render",yt],["__scopeId","data-v-cdb14b2f"]]),Ct=b({name:"StartImage",components:{ElUpload:O,ElButton:L,ElTooltip:W,InfoIcon:I,FontAwesomeIcon:E,ImagePreview:K},mixins:[H],emits:["change"],data(){return{fileList:[],uploadUrl:G()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},value:{get(){return this.$store.state?.kling?.config?.start_image_url},set(){}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){S.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){S.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()}}}),St={class:"relative"},Vt={class:"flex justify-between"},It={class:"flex justify-start items-center"},Tt={class:"text-sm font-bold"};function Et(e,t,s,a,u,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),k=o("el-tooltip"),g=o("el-upload");return l(),m("div",St,[i("div",Vt,[i("div",It,[i("span",Tt,r(e.$t("kling.name.startImage")),1),n(d,{content:e.$t("kling.description.uploadStartImage")},null,8,["content"])])]),n(g,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,disabled:e.reachedLimit,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:_})=>[_.url&&_.percentage!==void 0?(l(),C(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:h(()=>[n(k,{content:e.$t("kling.message.uploadReferencesExceed"),disabled:!e.reachedLimit,placement:"top"},{default:h(()=>[i("span",null,[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.reachedLimit},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$t("kling.button.uploadReferences")),1)]),_:1},8,["disabled"])])]),_:1},8,["content","disabled"])]),_:1},8,["file-list","disabled","action","on-exceed","on-error","on-success","headers"])])}const Lt=y(Ct,[["render",Et],["__scopeId","data-v-68cf38f5"]]),Mt=b({name:"EndImage",components:{ElUpload:O,ElButton:L,ElTooltip:W,ImagePreview:K,InfoIcon:I,FontAwesomeIcon:E},mixins:[H],data(){return{fileList:[],uploadUrl:G()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},klingConfig(){return this.$store.state?.kling?.config||{}},endImageSupported(){return J(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:(S.warning(this.$t("kling.message.endImageRequiresStart")),!1):(S.warning(this.$t("kling.message.endImageNotSupported")),!1)},onExceed(){S.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){S.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()}}}),Rt={class:"relative"},Ut={class:"flex justify-between"},Dt={class:"flex justify-start items-center"},At={class:"text-sm font-bold"};function Pt(e,t,s,a,u,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),k=o("el-tooltip"),g=o("el-upload");return l(),m("div",Rt,[i("div",Ut,[i("div",Dt,[i("span",At,r(e.$t("kling.name.endImage")),1),n(d,{content:e.$t("kling.description.uploadEndImage")},null,8,["content"])])]),n(g,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,disabled:e.uploadDisabled,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","before-upload":e.onBeforeUpload,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:_})=>[_.url&&_.percentage!==void 0?(l(),C(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:h(()=>[n(k,{content:e.uploadTooltip,disabled:!e.uploadDisabled,placement:"top"},{default:h(()=>[i("span",null,[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.uploadDisabled},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$t("kling.button.uploadReferences")),1)]),_:1},8,["disabled"])])]),_:1},8,["content","disabled"])]),_:1},8,["file-list","disabled","action","before-upload","on-exceed","on-error","on-success","headers"])])}const Gt=y(Mt,[["render",Pt],["__scopeId","data-v-593c3bde"]]),Kt=b({name:"CfgScaleSelector",components:{ElSlider:me,InfoIcon:I,ElInputNumber:de},computed:{value:{get(){return this.$store.state?.kling?.config?.cfg_scale},set(e){console.debug("set cfg_scale",e),this.$store.commit("kling/setConfig",{...this.$store.state?.kling?.config,cfg_scale:e})}}},mounted(){this.value||(this.value=Ie)}}),Ot={class:"flex justify-between"},jt={class:"flex justify-start items-center"},Nt={class:"text-sm font-bold"},Bt={class:"flex justify-end items-center"},zt={class:"w-full"};function Ft(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-input-number"),f=o("el-slider");return l(),m("div",null,[i("div",Ot,[i("div",jt,[i("span",Nt,r(e.$t("kling.name.cfgScale")),1),n(d,{content:e.$t("kling.description.cfgScale")},null,8,["content"])]),i("div",Bt,[n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),"controls-position":"right"},null,8,["modelValue"])])]),i("div",zt,[n(f,{modelValue:e.value,"onUpdate:modelValue":t[1]||(t[1]=c=>e.value=c),min:0,max:1,step:.1},null,8,["modelValue"])])])}const qt=y(Kt,[["render",Ft]]),Ht=b({name:"GenerateAudioSelector",components:{ElSwitch:ue,InfoIcon:I},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},selectedMode(){return this.$store.state.kling?.config?.mode||""},supported(){return!!(F.includes(this.selectedModel)||this.selectedModel==="kling-v2-6"&&this.selectedMode==="pro")},tooltipContent(){return this.supported?this.$t("kling.description.generateAudio"):this.$t("kling.description.generateAudioUnsupported")},value:{get(){return this.supported?this.$store.state.kling?.config?.generate_audio??Te:!1},set(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,generate_audio:e})}}},watch:{supported(e){!e&&this.$store.state.kling?.config?.generate_audio&&this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,generate_audio:!1})}}}),Wt={class:"relative"},Jt={class:"flex justify-between items-center"},Qt={class:"flex justify-start items-center"},Yt={class:"text-sm font-bold"};function Xt(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-switch");return l(),m("div",Wt,[i("div",Jt,[i("div",Qt,[i("span",Yt,r(e.$t("kling.name.generateAudio")),1),n(d,{content:e.tooltipContent},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=f=>e.value=f),class:"value",disabled:!e.supported},null,8,["modelValue","disabled"])])])}const Zt=y(Ht,[["render",Xt]]),xt=["horizontal","vertical","pan","tilt","roll","zoom"],eo=b({name:"CameraControlSelector",components:{ElSelect:P,ElOption:A,ElSlider:me,ElInputNumber:de,InfoIcon:I},data(){return{configKeys:xt}},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 J(this.selectedModel,this.selectedMode,this.selectedDuration).motionControl},hasStartImage(){return!!this.$store.state.kling?.config?.start_image_url},disabled(){return!this.motionControlSupported||this.hasStartImage},tooltipContent(){return this.motionControlSupported?this.hasStartImage?this.$t("kling.description.cameraControlDisabledImage2Video"):this.$t("kling.description.cameraControl"):this.$t("kling.description.cameraControlNotSupported")},selectedType(){return this.$store.state.kling?.config?.camera_control?.type},selectedTypeRaw:{get(){return this.selectedType??""},set(e){const t=this.$store.state.kling?.config||{};if(!e){const a={...t};delete a.camera_control,this.$store.commit("kling/setConfig",a);return}const s=e;this.$store.commit("kling/setConfig",{...t,camera_control:{type:s,config:s==="simple"?t.camera_control?.config||{}:void 0}})}},configValues(){return this.$store.state.kling?.config?.camera_control?.config||{}}},watch:{disabled(e){e&&this.selectedType!==void 0&&(this.selectedTypeRaw="")}},methods:{writeConfig(e,t){const s=this.$store.state.kling?.config||{},a=s.camera_control||{type:"simple"},u={...a.config||{}};t==null?delete u[e]:u[e]=t,this.$store.commit("kling/setConfig",{...s,camera_control:{...a,type:"simple",config:u}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),to={class:"field"},oo={class:"header"},no={class:"text-sm font-bold"},so={key:0,class:"config-grid"},io={class:"cfg-row-head"},lo={class:"cfg-name"};function ao(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select"),c=o("el-input-number"),k=o("el-slider");return l(),m("div",to,[i("div",oo,[i("span",no,r(e.$t("kling.name.cameraControl")),1),n(d,{content:e.tooltipContent},null,8,["content"])]),n(f,{modelValue:e.selectedTypeRaw,"onUpdate:modelValue":t[0]||(t[0]=g=>e.selectedTypeRaw=g),class:"value",placeholder:e.$t("kling.placeholder.cameraType"),clearable:!0,disabled:e.disabled},{default:h(()=>[(l(!0),m(V,null,T(e.typeOptions,g=>(l(),C(p,{key:g.value,label:g.label,value:g.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","disabled"]),e.selectedType==="simple"&&!e.disabled?(l(),m("div",so,[(l(!0),m(V,null,T(e.configKeys,g=>(l(),m("div",{key:g,class:"cfg-row"},[i("div",io,[i("span",lo,r(e.$t(`kling.name.cc_${g}`)),1),n(c,{modelValue:e.configValues[g],"onUpdate:modelValue":_=>e.configValues[g]=_,min:-1,max:1,step:.1,precision:1,"controls-position":"right",size:"small",class:"cfg-num",onChange:_=>e.onNumberChange(g,_)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),n(k,{"model-value":e.configValues[g]??0,min:-1,max:1,step:.1,onInput:_=>e.onSliderChange(g,_)},null,8,["model-value","onInput"])]))),128))])):v("",!0)])}const ro=y(eo,[["render",ao],["__scopeId","data-v-cd896060"]]),fe=[{groupKey:"cameraMovements",chipKeys:["rotateAround","stationary","handheld","zoomOut","zoomIn","follow","panRight","tiltUp","tiltDown","orbit"]},{groupKey:"cameraSpeed",chipKeys:["speedSlow","speedMedium","speedFast"]},{groupKey:"shotType",chipKeys:["shotClose","shotMedium","shotLong","shotLowAngle","shotHighAngle","shotShallowDof","shotFront","shotProfile","shotCloseUp","shotDrone"]},{groupKey:"light",chipKeys:["lightSunlight","lightSoft","lightNeon","lightWarm","lightNature","lightCandle","lightCityNight"]},{groupKey:"frame",chipKeys:["frameRichDetails","frameSimpleBg"]},{groupKey:"atmosphere",chipKeys:["atmosphereMysterious","atmospherePeaceful","atmosphereHeartwarming","atmosphereVivid","atmosphereColorful"]}],B=", ";function co(e,t){const s=(e||"").trim();return s?s.includes(t)?s:`${s}${B}${t}`:t}function z(e,t){if(!e||!t)return e||"";const s=[`${t}${B}`,`${B}${t}`,t];let a=e;for(const u of s)if(a.includes(u)){a=a.replace(u,"");break}return a.replace(/(?:,\s*)+$/,"").replace(/^(?:,\s*)+/,"")}const mo=b({name:"InspirationPills",components:{FontAwesomeIcon:E},computed:{prompt(){return this.$store.state.kling?.config?.prompt||""},allChipTexts(){return fe.flatMap(e=>e.chipKeys.map(t=>this.$t(`kling.inspiration.chip.${t}`)))},selected(){const e=this.prompt;if(!e)return[];const t=[];for(const s of this.allChipTexts){const a=e.indexOf(s);a!==-1&&t.push({text:s,idx:a})}return t.sort((s,a)=>s.idx-a.idx).map(s=>s.text)}},methods:{onRemove(e){const t=z(this.prompt,e);this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:t})}}}),uo={key:0,class:"pills",role:"list"},po={class:"pill-text"},go=["aria-label","onClick"];function fo(e,t,s,a,u,$){const d=o("font-awesome-icon");return e.selected.length>0?(l(),m("div",uo,[(l(!0),m(V,null,T(e.selected,p=>(l(),m("div",{key:p,class:"pill",role:"listitem"},[i("span",po,r(p),1),i("button",{type:"button",class:"pill-remove","aria-label":e.$t("kling.inspiration.removeChip"),onClick:be(f=>e.onRemove(p),["stop"])},[n(d,{icon:"fa-solid fa-xmark"})],8,go)]))),128))])):v("",!0)}const ho=y(mo,[["render",fo],["__scopeId","data-v-5fc4fa65"]]),_o="",$o=b({name:"PromptInput",components:{ElButton:L,FontAwesomeIcon:E,PromptTextarea:Me,InspirationPills:ho},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=_o)}});function ko(e,t,s,a,u,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("inspiration-pills"),c=o("prompt-textarea");return l(),C(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:h(()=>[n(p,{text:"",size:"small",class:"inspiration-btn",onClick:t[0]||(t[0]=k=>e.$emit("open-inspiration"))},{default:h(()=>[n(d,{icon:"fa-regular fa-lightbulb",class:"mr-1"}),w(" "+r(e.$t("kling.inspiration.openButton")),1)]),_:1})]),before:h(()=>[n(f)]),_:1},8,["modelValue","title","info","placeholder"])}const vo=y($o,[["render",ko],["__scopeId","data-v-c01fc1a6"]]),bo="",yo=b({name:"NegativePromptInput",components:{ElInput:pe,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=bo)}}),wo={class:"field"},Co={class:"box"},So={class:"title font-bold"};function Vo(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-input");return l(),m("div",wo,[i("div",Co,[i("h2",So,r(e.$t("kling.name.negativePrompt")),1),n(d,{content:e.$t("kling.description.negativePrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=f=>e.prompt=f),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.negativePrompt")},null,8,["modelValue","placeholder"])])}const Io=y(yo,[["render",Vo],["__scopeId","data-v-de98cf01"]]),To=b({name:"InspirationDrawer",components:{ElDrawer:re,ElButton:L,FontAwesomeIcon:E},props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],data(){return{groups:fe,Close:ye}},computed:{visible:{get(){return this.modelValue},set(e){this.$emit("update:modelValue",e)}},drawerSize(){return window.innerWidth<768?"100%":"380px"},prompt(){return this.$store.state.kling?.config?.prompt||""},allChipTexts(){return this.groups.flatMap(e=>e.chipKeys.map(t=>this.$t(`kling.inspiration.chip.${t}`)))},selectedCount(){return this.allChipTexts.filter(e=>this.isSelected(e)).length}},methods:{chipText(e){return this.$t(`kling.inspiration.chip.${e}`)},isSelected(e){return e?this.prompt.includes(e):!1},setPrompt(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:e})},onToggle(e){e&&(this.isSelected(e)?this.setPrompt(z(this.prompt,e)):this.setPrompt(co(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(const t of this.allChipTexts)for(;e.includes(t);)e=z(e,t);this.setPrompt(e)}}}),Eo={class:"drawer-content"},Lo={class:"drawer-header"},Mo={class:"title-row"},Ro={class:"title"},Uo={class:"hint"},Do={key:0,class:"selected-bar"},Ao={class:"selected-text"},Po={class:"groups"},Go={class:"group-title"},Ko={class:"chip-grid"},Oo=["onClick"];function jo(e,t,s,a,u,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),C(f,{modelValue:e.visible,"onUpdate:modelValue":t[1]||(t[1]=c=>e.visible=c),direction:"rtl","with-header":!1,size:e.drawerSize,"custom-class":"kling-inspiration-drawer","destroy-on-close":!1},{default:h(()=>[i("div",Eo,[i("div",Lo,[i("div",Mo,[n(d,{icon:"fa-regular fa-lightbulb",class:"mr-2"}),i("span",Ro,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",Uo,r(e.$t("kling.inspiration.hint")),1),e.selectedCount>0?(l(),m("div",Do,[i("span",Ao,r(e.$t("kling.inspiration.selectedSummary",{count:e.selectedCount})),1),n(p,{text:"",size:"small",class:"clear-btn",onClick:e.onClearSelected},{default:h(()=>[w(r(e.$t("kling.inspiration.clearSelected")),1)]),_:1},8,["onClick"])])):v("",!0),i("div",Po,[(l(!0),m(V,null,T(e.groups,c=>(l(),m("div",{key:c.groupKey,class:"group"},[i("div",Go,r(e.$t(`kling.inspiration.group.${c.groupKey}`)),1),i("div",Ko,[(l(!0),m(V,null,T(c.chipKeys,k=>(l(),m("button",{key:k,type:"button",class:U({chip:!0,active:e.isSelected(e.chipText(k))}),onClick:g=>e.onToggle(e.chipText(k))},r(e.chipText(k)),11,Oo))),128))])]))),128))])])]),_:1},8,["modelValue","size"])}const No=y(To,[["render",jo],["__scopeId","data-v-7d457a69"]]),Bo={"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"},zo={std:"720p",pro:"1080p","4k":"4K"},Fo=b({name:"SummaryChip",components:{FontAwesomeIcon:E},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){const e=this.config?.model||"kling-v2-5-turbo";return Bo[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||""},modeLabel(){const e=this.config?.mode||"std";return zo[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),qo={class:"summary-chip"},Ho=["title"],Wo=["title"],Jo=["title"],Qo=["title"],Yo=["title"];function Xo(e,t,s,a,u,$){const d=o("font-awesome-icon");return l(),m("div",qo,[i("span",{class:"part",title:e.$t("kling.name.model")},r(e.modelLabel),9,Ho),t[0]||(t[0]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.duration")},r(e.durationLabel),9,Wo),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,Jo),t[2]||(t[2]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.mode")},r(e.modeLabel),9,Qo),e.generateAudio?(l(),m("span",{key:0,class:"audio",title:e.$t("kling.name.generateAudio")},[n(d,{icon:"fa-solid fa-headphones"})],8,Yo)):v("",!0)])}const Zo=y(Fo,[["render",Xo],["__scopeId","data-v-418a6733"]]),xo=b({name:"ConfigPanel",components:{ElButton:L,Consumption:ce,FontAwesomeIcon:E,PromptInput:vo,NegativePromptInput:Io,ModelSelector:et,ModeSelector:at,DurationSelector:ht,RatioSelector:wt,StartImage:Lt,CfgScaleSelector:qt,GenerateAudioSelector:Zt,CameraControlSelector:ro,InspirationDrawer:No,SummaryChip:Zo,EndImage:Gt},emits:["generate"],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},consumption(){return ge(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit("generate")}}}),en={class:"flex flex-col h-full"},tn={class:"flex-1 overflow-y-auto p-5"},on={class:"flex flex-col items-center justify-center px-5 pb-5"};function nn(e,t,s,a,u,$){const d=o("prompt-input"),p=o("model-selector"),f=o("ratio-selector"),c=o("start-image"),k=o("end-image"),g=o("duration-selector"),_=o("mode-selector"),M=o("generate-audio-selector"),R=o("camera-control-selector"),j=o("cfg-scale-selector"),he=o("negative-prompt-input"),_e=o("summary-chip"),$e=o("consumption"),X=o("font-awesome-icon"),Z=o("el-button"),ke=o("inspiration-drawer");return l(),m("div",en,[i("div",tn,[n(d,{class:"mb-4",onOpenInspiration:t[0]||(t[0]=x=>e.inspirationOpen=!0)}),n(p,{class:"mb-4"}),n(f,{class:"mb-4"}),n(c,{class:"mb-2"}),n(k,{class:"mb-2"}),n(g,{class:"mb-4"}),n(_,{class:"mb-4"}),n(M,{class:"mb-4"}),n(R,{class:"mb-4"}),n(j,{class:"mb-4"}),n(he,{class:"mb-4"})]),i("div",on,[n(_e),n($e,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(l(),C(Z,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(X,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.extend")),1)]),_:1},8,["onClick"])):(l(),C(Z,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(X,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.generate")),1)]),_:1},8,["onClick"]))]),n(ke,{modelValue:e.inspirationOpen,"onUpdate:modelValue":t[1]||(t[1]=x=>e.inspirationOpen=x)},null,8,["modelValue"])])}const sn=y(xo,[["render",nn]]),ln=b({name:"MotionImage",components:{ElUpload:O,ElButton:L,InfoIcon:I,FontAwesomeIcon:E,ImagePreview:K},mixins:[H],data(){return{fileList:[],uploadUrl:G()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetImageUrl()},methods:{onExceed(){S.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){S.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()}}}),an={class:"relative"},rn={class:"flex justify-between"},cn={class:"flex justify-start items-center"},dn={class:"text-sm font-bold"};function mn(e,t,s,a,u,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),k=o("el-upload");return l(),m("div",an,[i("div",rn,[i("div",cn,[i("span",dn,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]=g=>e.fileList=g),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:g})=>[g.url&&g.percentage!==void 0?(l(),C(p,{key:0,url:g.url,name:g.name,percentage:g.percentage,onRemove:_=>e.onRemove(g)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:h(()=>[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$t("kling.button.uploadReferences")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const un=y(ln,[["render",mn],["__scopeId","data-v-37d42da7"]]),pn=b({name:"MotionVideo",components:{ElUpload:O,ElButton:L,InfoIcon:I,FilePreview:Ue,FontAwesomeIcon:E},data(){return{fileList:[],uploadUrl:G()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetVideoUrl()},methods:{onExceed(){S.warning(this.$t("kling.message.uploadVideoExceed"))},onError(){S.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:(S.error(this.$t("kling.message.uploadVideoSizeExceed")),!1):(S.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()}}}),gn={class:"relative"},fn={class:"flex justify-between"},hn={class:"flex justify-start items-center"},_n={class:"text-sm font-bold"};function $n(e,t,s,a,u,$){const d=o("info-icon"),p=o("file-preview"),f=o("font-awesome-icon"),c=o("el-button"),k=o("el-upload");return l(),m("div",gn,[i("div",fn,[i("div",hn,[i("span",_n,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]=g=>e.fileList=g),accept:".mp4,.mov",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"before-upload":e.beforeUpload,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:g})=>[g.percentage!==void 0?(l(),C(p,{key:0,url:g.url||g.response?.file_url,name:g.name,percentage:g.percentage,onRemove:_=>e.onRemove(g)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:h(()=>[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$t("kling.button.uploadVideoUrl")),1)]),_:1})]),_:1},8,["file-list","action","before-upload","on-exceed","on-error","on-success","headers"])])}const kn=y(pn,[["render",$n],["__scopeId","data-v-5cf93212"]]),vn=b({name:"MotionPromptInput",components:{ElInput:pe,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})}}}}),bn={class:"field"},yn={class:"box"},wn={class:"title font-bold"};function Cn(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-input");return l(),m("div",bn,[i("div",yn,[i("h2",wn,r(e.$t("kling.name.motionPrompt")),1),n(d,{content:e.$t("kling.description.motionPrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=f=>e.prompt=f),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.motionPrompt")},null,8,["modelValue","placeholder"])])}const Sn=y(vn,[["render",Cn],["__scopeId","data-v-ca9fdbe5"]]),ie="video",Vn=b({name:"CharacterOrientationSelector",components:{ElRadioGroup:Ae,ElRadioButton:De,InfoIcon:I},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||ie},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=ie)}}),In={class:"field"},Tn={class:"header"},En={class:"text-sm font-bold"};function Ln(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-radio-button"),f=o("el-radio-group");return l(),m("div",In,[i("div",Tn,[i("span",En,r(e.$t("kling.name.characterOrientation")),1),n(d,{content:e.$t("kling.description.characterOrientation")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),size:"small",class:"value"},{default:h(()=>[n(p,{label:"image"},{default:h(()=>[w(r(e.$t("kling.name.orientationImage")),1)]),_:1}),n(p,{label:"video"},{default:h(()=>[w(r(e.$t("kling.name.orientationVideo")),1)]),_:1})]),_:1},8,["modelValue"])])}const Mn=y(Vn,[["render",Ln],["__scopeId","data-v-7a91195b"]]),le="std",Rn=b({name:"MotionModeSelector",components:{ElSelect:P,ElOption:A,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||le},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=le)}}),Un={class:"field"},Dn={class:"header"},An={class:"title font-bold"};function Pn(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),m("div",Un,[i("div",Dn,[i("h2",An,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.motionMode")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),class:"value",placeholder:e.$t("kling.placeholder.select")},{default:h(()=>[(l(!0),m(V,null,T(e.options,c=>(l(),C(p,{key:c.value,label:c.label,value:c.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Gn=y(Rn,[["render",Pn],["__scopeId","data-v-1295688c"]]),Kn=b({name:"KeepOriginalSoundSelector",components:{ElSwitch:ue,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"})}}}}),On={class:"relative"},jn={class:"flex justify-between items-center"},Nn={class:"flex justify-start items-center"},Bn={class:"text-sm font-bold"};function zn(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-switch");return l(),m("div",On,[i("div",jn,[i("div",Nn,[i("span",Bn,r(e.$t("kling.name.keepOriginalSound")),1),n(d,{content:e.$t("kling.description.keepOriginalSound")},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=f=>e.value=f)},null,8,["modelValue"])])])}const Fn=y(Kn,[["render",zn]]),qn=b({name:"MotionPanel",components:{ElButton:L,FontAwesomeIcon:E,Consumption:ce,MotionImage:un,MotionVideo:kn,MotionPromptInput:Sn,CharacterOrientationSelector:Mn,MotionModeSelector:Gn,KeepOriginalSoundSelector:Fn},emits:["generate"],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return ge(this.motionConfig,this.service?.cost)},service(){return this.$store.state.kling?.service},canGenerate(){const e=this.motionConfig;return!!(e?.image_url&&e?.video_url)}},methods:{onGenerate(){this.$emit("generate")}}}),Hn={class:"flex flex-col h-full"},Wn={class:"flex-1 overflow-y-auto p-5"},Jn={class:"flex flex-col items-center justify-center px-5 pb-5"};function Qn(e,t,s,a,u,$){const d=o("motion-image"),p=o("motion-video"),f=o("motion-prompt-input"),c=o("character-orientation-selector"),k=o("motion-mode-selector"),g=o("keep-original-sound-selector"),_=o("consumption"),M=o("font-awesome-icon"),R=o("el-button");return l(),m("div",Hn,[i("div",Wn,[n(d,{class:"mb-3"}),n(p,{class:"mb-3"}),n(f,{class:"mb-4"}),n(c,{class:"mb-4"}),n(k,{class:"mb-4"}),n(g,{class:"mb-4"})]),i("div",Jn,[n(_,{value:e.consumption,service:e.service},null,8,["value","service"]),n(R,{type:"primary",class:"btn w-full",round:"",disabled:!e.canGenerate,onClick:e.onGenerate},{default:h(()=>[n(M,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.generateMotion")),1)]),_:1},8,["disabled","onClick"])])])}const Yn=y(qn,[["render",Qn]]),Xn=b({name:"KlingTabSwitcher",components:{ElTabs:Ge,ElTabPane:Pe,ElTag:we},props:{modelValue:{type:String,default:"videos"}},emits:["update:modelValue"],computed:{tabs(){return[{value:"videos",label:this.$t("kling.tab.videoGeneration")},{value:"motion",label:this.$t("kling.tab.motionControl")}]}},methods:{onUpdate(e){this.$emit("update:modelValue",e)}}}),Zn=["title"],xn={class:"text"};function es(e,t,s,a,u,$){const d=o("el-tag"),p=o("el-tab-pane"),f=o("el-tabs");return l(),C(f,{"model-value":e.modelValue,class:"kling-tabs",stretch:"","onUpdate:modelValue":e.onUpdate},{default:h(()=>[(l(!0),m(V,null,T(e.tabs,c=>(l(),C(p,{key:c.value,name:c.value,disabled:c.disabled},{label:h(()=>[i("span",{class:"tab-label",title:c.disabled?c.disabledReason:void 0},[i("span",xn,r(c.label),1),c.badge?(l(),C(d,{key:0,size:"small",type:"warning",class:"badge"},{default:h(()=>[w(r(c.badge),1)]),_:2},1024)):v("",!0)],8,Zn)]),_:2},1032,["name","disabled"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])}const ts=y(Xn,[["render",es],["__scopeId","data-v-bf00c27e"]]),os=b({name:"TaskPreview",components:{ElImage:Ne,CopyToClipboard:Ke,FontAwesomeIcon:E,ElAlert:je,VideoPlayer:Oe,ElTooltip:W,ElButton:L,ImagePreview:K},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},referenceImages(){const e=[],t=this.modelValue?.request?.start_image_url,s=this.modelValue?.request?.end_image_url;return t&&e.push({url:t,name:"start-image"}),s&&e.push({url:s,name:"end-image"}),e}},methods:{onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onOpenVideo(e){window.open(e,"_blank")}}}),ns={class:"preview"},ss={class:"left"},is={class:"main"},ls={class:"bot"},as={class:"datetime"},rs={class:"info"},cs={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},ds={key:1,class:"prompt mt-2"},ms={key:0},us={key:1},ps={key:0,class:U({content:!0,failed:!0})},gs={key:0,class:"mb-4"},fs={key:1,class:U({operations:!0,"mt-2":!0})},hs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},_s={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},$s={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},ks={key:1,class:U({content:!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-2"},ws={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Cs={key:2,class:U({content:!0})},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-0"};function Is(e,t,s,a,u,$){const d=o("el-image"),p=o("image-preview"),f=o("video-player"),c=o("el-button"),k=o("el-tooltip"),g=o("font-awesome-icon"),_=o("copy-to-clipboard"),M=o("el-alert");return l(),m("div",ns,[i("div",ss,[n(d,{src:"https://cdn.acedata.cloud/qpbbbb.jpg",class:"avatar"})]),i("div",is,[i("div",ls,[w(r(e.$t("kling.name.klingBot"))+" ",1),i("span",as,r(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),i("div",rs,[e.referenceImages.length>0?(l(),m("div",cs,[(l(!0),m(V,null,T(e.referenceImages,(R,j)=>(l(),C(p,{key:j,url:R.url,name:R.name,closable:!1},null,8,["url","name"]))),128))])):v("",!0),e.modelValue?.request?.prompt?(l(),m("p",ds,[w(r(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?v("",!0):(l(),m("span",ms," - ("+r(e.$t("kling.status.pending"))+") ",1)),e.modelValue?.response?.state==="submitted"||e.modelValue?.response?.state==="processing"||e.modelValue?.response?.state==="pending"||e.modelValue?.response?.state==="completed"?(l(),m("span",us," - ("+r(e.$t("kling.status.processing"))+") ",1)):v("",!0)])):v("",!0)]),e.modelValue?.response?.success===!0?(l(),m("div",ps,[e.modelValue?.response.video_url?(l(),m("div",gs,[n(f,{src:e.modelValue?.response.video_url},null,8,["src"])])):v("",!0),e.modelValue?.response.success?(l(),m("div",fs,[n(k,{class:"box-item",effect:"dark",content:e.$t("kling.message.downloadVideo"),placement:"top-start"},{default:h(()=>[e.modelValue?.response.video_url?(l(),C(c,{key:0,type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=R=>e.onDownload(R,e.modelValue?.response.video_url))},{default:h(()=>[w(r(e.$t("kling.button.download")),1)]),_:1})):v("",!0)]),_:1},8,["content"])])):v("",!0),n(M,{closable:!1,class:"mt-2 success"},{default:h(()=>[i("p",hs,[n(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.model"))+": "+r(e.modelValue?.request?.model),1)]),i("p",_s,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(l(),m("p",$s,[n(g,{icon:"fa-solid fa-clock",class:"mr-1"}),w(" "+r(e.$t("kling.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):v("",!0)]),_:1})])):v("",!0),e.modelValue?.response?.success===!1?(l(),m("div",ks,[n(M,{closable:!1,class:"failure"},{template:h(()=>[n(g,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),w(" "+r(e.$t("kling.name.failure")),1)]),default:h(()=>[i("p",vs,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),i("p",bs,[n(g,{icon:"fa-solid fa-circle-info",class:"mr-1"}),w(" "+r(e.$t("kling.name.failureReason"))+": "+r(e.modelValue?.response?.error?.message)+" ",1),n(_,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(l(),m("p",ys,[n(g,{icon:"fa-solid fa-clock",class:"mr-1"}),w(" "+r(e.$t("kling.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):v("",!0),e.modelValue?.response?.trace_id?(l(),m("p",ws,[n(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(_,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):v("",!0)]),_:1})])):v("",!0),e.modelValue?.response?.success===void 0?(l(),m("div",Cs,[n(M,{closable:!1,class:"info"},{template:h(()=>[n(g,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),w(" "+r(e.$t("kling.name.failure")),1)]),default:h(()=>[i("p",Ss,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.response?.trace_id?(l(),m("p",Vs,[n(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(_,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):v("",!0)]),_:1})])):v("",!0)])])}const Ts=y(os,[["render",Is],["__scopeId","data-v-e8e87659"]]),Es=b({name:"RecentPanel",components:{TaskPreview:Ts,NoTasks:Re,BotPlaceholder:Be,ScrollList:Ee},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.kling?.tasks,items:this.$store.state.kling?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Ls={key:0},Ms={key:2,class:"w-full h-full flex items-center justify-center"};function Rs(e,t,s,a,u,$){const d=o("bot-placeholder"),p=o("task-preview"),f=o("scroll-list"),c=o("no-tasks");return l(),m(V,null,[e.tasks?.items===void 0?(l(),m("div",Ls,[n(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(l(),C(f,{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:h(()=>[(l(!0),m(V,null,T(e.tasks?.items,k=>(l(),C(p,{key:k.id,"model-value":k},null,8,["model-value"]))),128))]),_:1},8,["loading"])):v("",!0),e.tasks?.items?.length===0?(l(),m("div",Ms,[n(c)])):v("",!0)],64)}const Us=y(Es,[["render",Rs]]),ae=Ce("kling"),Ds=b({name:"KlingIndex",components:{ConfigPanel:sn,MotionPanel:Yn,TabSwitcher:ts,Layout:Je,RecentPanel:Us},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===oe.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===oe.Request||this.fetchingTasks},credential(){return this.$store.state.kling.credential},config(){return this.$store.state.kling.config},motionConfig(){return this.$store.state.kling.motionConfig},taskType(){return this.$store.state.kling.taskType||"videos"},tasks(){return this.$store.state.kling.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await Le({tasks:this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("kling/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("kling/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:s,createdAtMax:a}=e||{};console.debug("limit",t,"createdAtMin",s,"createdAtMax",a),this.fetchingTasks=!0;try{await this.$store.dispatch("kling/getTasks",{limit:t,createdAtMin:s,createdAtMax:a})}finally{this.fetchingTasks=!1}},async onGenerate(){const{camera_control:e,...t}=this.config||{},s={...t,callback_url:ae};if(!s.video_id&&!t.video_url&&!s.start_image_url&&s.end_image_url){S.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 a=this.credential?.token;if(!a){console.error("no token specified");return}S.info(this.$t("kling.message.startingTask")),ee("kling",te.generate(s,{token:a})).then(()=>{S.success(this.$t("kling.message.startTaskSuccess"))}).catch(u=>{u?.response?.data?.error?.code===se?S.error(this.$t("kling.message.usedUp")):S.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},async onTabChange(e){e!==this.taskType&&(await this.$store.dispatch("kling/setTaskType",e),await this.onGetTasks(),await this.onScrollDown())},async onGenerateMotion(){const e=this.motionConfig||{};if(!e.image_url||!e.video_url){S.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:ae},s=this.credential?.token;if(!s){console.error("no token specified");return}S.info(this.$t("kling.message.startingTask")),ee("kling",te.motion(t,{token:s})).then(()=>{S.success(this.$t("kling.message.startTaskSuccess"))}).catch(a=>{a?.response?.data?.error?.code===se?S.error(this.$t("kling.message.usedUp")):S.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),As={class:"flex flex-col h-full"},Ps={class:"flex-1 min-h-0"};function Gs(e,t,s,a,u,$){const d=o("tab-switcher"),p=o("config-panel"),f=o("motion-panel"),c=o("recent-panel"),k=o("layout");return l(),C(k,null,{config:h(()=>[i("div",As,[n(d,{"model-value":e.taskType,"onUpdate:modelValue":e.onTabChange},null,8,["model-value","onUpdate:modelValue"]),i("div",Ps,[e.taskType==="videos"?(l(),C(p,{key:0,onGenerate:e.onGenerate},null,8,["onGenerate"])):e.taskType==="motion"?(l(),C(f,{key:1,onGenerate:e.onGenerateMotion},null,8,["onGenerate"])):v("",!0)])])]),result:h(()=>[n(c,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Ki=y(Ds,[["render",Gs]]);export{Ki as default};
|
|
1
|
+
import{F as E}from"./index.es-DN8G0P37.js";import{E as L}from"./index-CwPjkJs4.js";import{E as re}from"./index-B6W1wPG_.js";import{d as b,H as m,E as i,z as N,C as n,y as h,D as o,q as l,F as r,x as C,O as V,N as T,Q as U,J as v,R as ve,I as w,M as be}from"./vendor-vue-NSDaktjZ.js";import{G as y,bj as G,ag as ye,H as we,co as ee,aF as te,S as oe,cp as Ce}from"./index-CnhjD_2F.js";import{b as Se,c as ne,d as F,e as D,f as Ve,g as Ie,h as Te}from"./kling-CtoPhhA9.js";import{E as A,a as P}from"./index-DFzC0rQH.js";import{E as q}from"./index-D7IaIK0w.js";import{E as S}from"./index-D1rl1ShF.js";import{I,S as Ee,l as Le}from"./pagination-BCTFE7Z3.js";import{p as H}from"./pasteUploadMixin-BurWbGNQ.js";import{I as K}from"./ImagePreview-CJP-yB4D.js";import{E as W}from"./index-ClwpIr_P.js";import{E as O}from"./index-Kc0m7PO-.js";import{C as ce}from"./Consumption-tJVE5oXO.js";import{E as de}from"./index-ws34Ea3I.js";import{E as me}from"./index-BHiGwdGq.js";import{E as ue}from"./index-CLxhDB-t.js";import{P as Me,N as Re}from"./NoTasks-gaaOL_m7.js";import{E as pe}from"./index-D7LXRPby.js";import{a as ge}from"./price-7DAsoJmR.js";import{F as Ue}from"./FilePreview-19tiWMqq.js";import{E as De,a as Ae}from"./index-CiLcyhjJ.js";import{E as Pe,a as Ge}from"./index-BqF_vHYf.js";import{b as se}from"./errorCode-Cqj9Td_Z.js";import{C as Ke}from"./CopyToClipboard-BthEHufq.js";import{V as Oe}from"./VideoPlayer-Dn-EFbop.js";import{E as je}from"./index-CbbUfyeR.js";import{E as Ne}from"./index-CrH79zK9.js";import{B as Be}from"./BotPlaceholder-BZTrMT1c.js";import"./use-form-item-BKB_7n3g.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Df5ITouH.js";import"./index-DmYzMmpZ.js";import"./typescript-COFNajQU.js";import"./index-DPq9Ww9N.js";import"./strings-beZM2Y-f.js";import"./isEqual-DGVdfmbU.js";import"./_Uint8Array-BnVWNeHp.js";import"./castArray-CB5VORGs.js";import"./debounce-Bt9MZ6bV.js";import"./_baseIteratee-Bw61Z4Wx.js";import"./index-D4eloMlC.js";import"./validator-QEfhhC-Q.js";import"./index-CLR-flkd.js";import"./_baseClone-Q0okPItx.js";import"./_initCloneObject-DuLU5kHr.js";import"./index-Cu41y2Fl.js";import"./index-qUrXiTT8.js";import"./isPlainObject-C8-9-V_9.js";import"./vue-plyr-BO2nlN4c.js";import"./index-uim_HWNA.js";const ze=b({name:"LayoutKling",components:{ElDrawer:re,ElButton:L,FontAwesomeIcon:E},data(){return{drawer:!1}}}),Fe={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)]"},He={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function We(e,t,s,a,u,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),m("div",Fe,[i("div",qe,[N(e.$slots,"config",{},void 0,!0)]),i("div",He,[N(e.$slots,"result",{},void 0,!0)]),n(p,{circle:"",class:"menu",onClick:t[0]||(t[0]=c=>e.drawer=!0)},{default:h(()=>[n(d,{icon:"fa-solid fa-magic"})]),_:1}),n(f,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=c=>e.drawer=c),direction:"ltr","with-header":!1,size:"350px"},{default:h(()=>[N(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Je=y(ze,[["render",We],["__scopeId","data-v-be4bb0df"]]),Qe={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function J(e,t,s){const a=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:a==="pro",audio:!1,motionControl:!1};case"kling-v2-6":return{text2video:!0,image2video:!0,endImage:a==="pro",audio:a==="pro",motionControl:!1};case"kling-v2-master":case"kling-v2-1-master":return{text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};case"kling-v3":return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:a!=="4k"};case"kling-v3-omni":return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:!1};case"kling-video-o1":return{text2video:!0,image2video:!0,endImage:!0,audio:!1,motionControl:!1};default:return Qe}}function Q(e,t){if(!e)return[];const s=t.model??e.model,a=t.mode??e.mode,u=t.duration??e.duration;if(!s)return[];const $=J(s,a,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 Y(e,t){const s={...e};for(const a of t)a.field==="end_image_url"&&(s.end_image_url=void 0),a.field==="generate_audio"&&(s.generate_audio=!1),a.field==="camera_control"&&(s.camera_control=void 0);return s}const Ye=b({name:"ModelSelector",components:{ElSelect:P,ElOption:A},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{revertKey:0,options:[{value:"kling-v3",label:"v3"},{value:"kling-v3-omni",label:"v3-Omni"},{value:"kling-v2-6",label:"v2.6"},{value:"kling-v2-5-turbo",label:"v2.5-Turbo"},{value:"kling-v2-1-master",label:"v2.1-Master"},{value:"kling-v2-master",label:"v2-Master"},{value:"kling-v1-6",label:"v1.6"},{value:"kling-v1",label:"v1"},{value:"kling-video-o1",label:"Video-o1"}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(Se)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Q(t,{model:e});if(s.length===0){this.applyModel(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=Y({...t,model:e},s);this.$store.commit("kling/setConfig",u),S.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,model:e})}}}),Xe={class:"field"},Ze={class:"title font-bold"};function xe(e,t,s,a,u,$){const d=o("el-option"),p=o("el-select");return l(),m("div",Xe,[i("h2",Ze,r(e.$t("pika.name.model")),1),(l(),C(p,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("pika.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),m(V,null,T(e.options,f=>(l(),C(d,{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const et=y(Ye,[["render",xe],["__scopeId","data-v-04059875"]]),tt=b({name:"ModeSelector",components:{ElSelect:P,ElOption:A,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 F.includes(this.selectedModel)?this.cameraControlSet?this.$t("kling.description.mode4kIncompatibleCamera"):"":this.$t("kling.description.mode4kRequiresV3")},options(){return[{value:"std",label:this.$t("kling.name.modeStd"),disabled:!1,disabledReason:""},{value:"pro",label:this.$t("kling.name.modePro"),disabled:!1,disabledReason:""},{value:"4k",label:this.$t("kling.name.mode4k"),disabled:!!this.fourKReason,disabledReason:this.fourKReason}]},value(){return this.$store.state.kling?.config?.mode}},watch:{fourKReason(e){e&&this.value==="4k"&&this.applyMode(ne)}},mounted(){this.value||this.applyMode(ne)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Q(t,{mode:e});if(s.length===0){this.applyMode(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=Y({...t,mode:e},s);this.$store.commit("kling/setConfig",u),S.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyMode(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,mode:e})}}}),ot={class:"field"},nt={class:"header"},st={class:"title font-bold"},it={key:0,class:"opt-tip"};function lt(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),m("div",ot,[i("div",nt,[i("h2",st,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.mode"),class:"info-icon"},null,8,["content"])]),(l(),C(f,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("kling.placeholder.select"),clearable:!0,onChange:e.onChange},{default:h(()=>[(l(!0),m(V,null,T(e.options,c=>(l(),C(p,{key:c.value,label:c.label,value:c.value,disabled:c.disabled},{default:h(()=>[i("span",{class:U({"opt-disabled":c.disabled})},r(c.label),3),c.disabled&&c.disabledReason?(l(),m("span",it,r(c.disabledReason),1)):v("",!0)]),_:2},1032,["label","value","disabled"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const at=y(tt,[["render",lt],["__scopeId","data-v-9a8fa3c5"]]),rt=[3,5,8,10,12,15],ct=[5,10],dt=b({name:"DurationSelector",components:{ElSelect:P,ElOption:A,InfoIcon:I},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},isV3Model(){return F.includes(this.selectedModel)},allowedDurations(){return this.isV3Model?rt:ct},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=Q(t,{duration:e});if(s.length===0){this.applyDuration(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=Y({...t,duration:e},s);this.$store.commit("kling/setConfig",u),S.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyDuration(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,duration:e})}}}),mt={class:"field"},ut={class:"control"},pt={class:"label"},gt={class:"title font-bold"};function ft(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),m("div",mt,[i("div",ut,[i("div",pt,[i("h2",gt,r(e.$t("kling.name.duration")),1),n(d,{content:e.$t("kling.description.duration"),class:"info-icon ml-1"},null,8,["content"])]),(l(),C(f,{key:e.revertKey,"model-value":e.selectValue,class:"value",placeholder:e.$t("kling.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),m(V,null,T(e.allowedDurations,c=>(l(),C(p,{key:c,label:`${c}s`,value:c},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])])}const ht=y(dt,[["render",ft],["__scopeId","data-v-5ae55e28"]]),_t=b({name:"RatioSelector",data(){return{options:[{value:"1:1",label:"1:1",width:20,height:20},{value:"16:9",label:"16:9",width:25,height:13},{value:"9:16",label:"9:16",width:13,height:25}]}},computed:{active(){return this.options.findIndex(e=>e.value===this.value)||0},value:{get(){return this.$store.state?.kling?.config?.aspect_ratio},set(e){console.debug("set ratio",e),this.$store.commit("kling/setConfig",{...this.$store.state?.kling?.config,aspect_ratio:e})}}},mounted(){this.value||(this.value=Ve)}}),$t={class:"text-sm font-bold mb-2 block"},kt={class:"items"},vt=["onClick"],bt={class:"name"};function yt(e,t,s,a,u,$){return l(),m("div",null,[i("span",$t,r(e.$t("kling.name.ratio")),1),i("div",kt,[(l(!0),m(V,null,T(e.options,(d,p)=>(l(),m("div",{key:p,class:U({active:e.active===p,item:!0}),onClick:f=>e.value=d.value},[i("div",{class:U(["preview",d.label])},[i("div",{class:"rect",style:ve({width:d.width+"px",height:d.height+"px"})},null,4)],2),i("p",bt,r(d.label),1)],10,vt))),128))])])}const wt=y(_t,[["render",yt],["__scopeId","data-v-cdb14b2f"]]),Ct=b({name:"StartImage",components:{ElUpload:O,ElButton:L,ElTooltip:W,InfoIcon:I,FontAwesomeIcon:E,ImagePreview:K},mixins:[H],emits:["change"],data(){return{fileList:[],uploadUrl:G()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},value:{get(){return this.$store.state?.kling?.config?.start_image_url},set(){}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){S.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){S.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()}}}),St={class:"relative"},Vt={class:"flex justify-between"},It={class:"flex justify-start items-center"},Tt={class:"text-sm font-bold"};function Et(e,t,s,a,u,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),k=o("el-tooltip"),g=o("el-upload");return l(),m("div",St,[i("div",Vt,[i("div",It,[i("span",Tt,r(e.$t("kling.name.startImage")),1),n(d,{content:e.$t("kling.description.uploadStartImage")},null,8,["content"])])]),n(g,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,disabled:e.reachedLimit,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:_})=>[_.url&&_.percentage!==void 0?(l(),C(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:h(()=>[n(k,{content:e.$t("kling.message.uploadReferencesExceed"),disabled:!e.reachedLimit,placement:"top"},{default:h(()=>[i("span",null,[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.reachedLimit},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$t("kling.button.uploadReferences")),1)]),_:1},8,["disabled"])])]),_:1},8,["content","disabled"])]),_:1},8,["file-list","disabled","action","on-exceed","on-error","on-success","headers"])])}const Lt=y(Ct,[["render",Et],["__scopeId","data-v-68cf38f5"]]),Mt=b({name:"EndImage",components:{ElUpload:O,ElButton:L,ElTooltip:W,ImagePreview:K,InfoIcon:I,FontAwesomeIcon:E},mixins:[H],data(){return{fileList:[],uploadUrl:G()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},klingConfig(){return this.$store.state?.kling?.config||{}},endImageSupported(){return J(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:(S.warning(this.$t("kling.message.endImageRequiresStart")),!1):(S.warning(this.$t("kling.message.endImageNotSupported")),!1)},onExceed(){S.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){S.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()}}}),Rt={class:"relative"},Ut={class:"flex justify-between"},Dt={class:"flex justify-start items-center"},At={class:"text-sm font-bold"};function Pt(e,t,s,a,u,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),k=o("el-tooltip"),g=o("el-upload");return l(),m("div",Rt,[i("div",Ut,[i("div",Dt,[i("span",At,r(e.$t("kling.name.endImage")),1),n(d,{content:e.$t("kling.description.uploadEndImage")},null,8,["content"])])]),n(g,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,disabled:e.uploadDisabled,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","before-upload":e.onBeforeUpload,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:_})=>[_.url&&_.percentage!==void 0?(l(),C(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:h(()=>[n(k,{content:e.uploadTooltip,disabled:!e.uploadDisabled,placement:"top"},{default:h(()=>[i("span",null,[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.uploadDisabled},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$t("kling.button.uploadReferences")),1)]),_:1},8,["disabled"])])]),_:1},8,["content","disabled"])]),_:1},8,["file-list","disabled","action","before-upload","on-exceed","on-error","on-success","headers"])])}const Gt=y(Mt,[["render",Pt],["__scopeId","data-v-593c3bde"]]),Kt=b({name:"CfgScaleSelector",components:{ElSlider:me,InfoIcon:I,ElInputNumber:de},computed:{value:{get(){return this.$store.state?.kling?.config?.cfg_scale},set(e){console.debug("set cfg_scale",e),this.$store.commit("kling/setConfig",{...this.$store.state?.kling?.config,cfg_scale:e})}}},mounted(){this.value||(this.value=Ie)}}),Ot={class:"flex justify-between"},jt={class:"flex justify-start items-center"},Nt={class:"text-sm font-bold"},Bt={class:"flex justify-end items-center"},zt={class:"w-full"};function Ft(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-input-number"),f=o("el-slider");return l(),m("div",null,[i("div",Ot,[i("div",jt,[i("span",Nt,r(e.$t("kling.name.cfgScale")),1),n(d,{content:e.$t("kling.description.cfgScale")},null,8,["content"])]),i("div",Bt,[n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),"controls-position":"right"},null,8,["modelValue"])])]),i("div",zt,[n(f,{modelValue:e.value,"onUpdate:modelValue":t[1]||(t[1]=c=>e.value=c),min:0,max:1,step:.1},null,8,["modelValue"])])])}const qt=y(Kt,[["render",Ft]]),Ht=b({name:"GenerateAudioSelector",components:{ElSwitch:ue,InfoIcon:I},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},selectedMode(){return this.$store.state.kling?.config?.mode||""},supported(){return!!(F.includes(this.selectedModel)||this.selectedModel==="kling-v2-6"&&this.selectedMode==="pro")},tooltipContent(){return this.supported?this.$t("kling.description.generateAudio"):this.$t("kling.description.generateAudioUnsupported")},value:{get(){return this.supported?this.$store.state.kling?.config?.generate_audio??Te:!1},set(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,generate_audio:e})}}},watch:{supported(e){!e&&this.$store.state.kling?.config?.generate_audio&&this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,generate_audio:!1})}}}),Wt={class:"relative"},Jt={class:"flex justify-between items-center"},Qt={class:"flex justify-start items-center"},Yt={class:"text-sm font-bold"};function Xt(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-switch");return l(),m("div",Wt,[i("div",Jt,[i("div",Qt,[i("span",Yt,r(e.$t("kling.name.generateAudio")),1),n(d,{content:e.tooltipContent},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=f=>e.value=f),class:"value",disabled:!e.supported},null,8,["modelValue","disabled"])])])}const Zt=y(Ht,[["render",Xt]]),xt=["horizontal","vertical","pan","tilt","roll","zoom"],eo=b({name:"CameraControlSelector",components:{ElSelect:P,ElOption:A,ElSlider:me,ElInputNumber:de,InfoIcon:I},data(){return{configKeys:xt}},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 J(this.selectedModel,this.selectedMode,this.selectedDuration).motionControl},hasStartImage(){return!!this.$store.state.kling?.config?.start_image_url},disabled(){return!this.motionControlSupported||this.hasStartImage},tooltipContent(){return this.motionControlSupported?this.hasStartImage?this.$t("kling.description.cameraControlDisabledImage2Video"):this.$t("kling.description.cameraControl"):this.$t("kling.description.cameraControlNotSupported")},selectedType(){return this.$store.state.kling?.config?.camera_control?.type},selectedTypeRaw:{get(){return this.selectedType??""},set(e){const t=this.$store.state.kling?.config||{};if(!e){const a={...t};delete a.camera_control,this.$store.commit("kling/setConfig",a);return}const s=e;this.$store.commit("kling/setConfig",{...t,camera_control:{type:s,config:s==="simple"?t.camera_control?.config||{}:void 0}})}},configValues(){return this.$store.state.kling?.config?.camera_control?.config||{}}},watch:{disabled(e){e&&this.selectedType!==void 0&&(this.selectedTypeRaw="")}},methods:{writeConfig(e,t){const s=this.$store.state.kling?.config||{},a=s.camera_control||{type:"simple"},u={...a.config||{}};t==null?delete u[e]:u[e]=t,this.$store.commit("kling/setConfig",{...s,camera_control:{...a,type:"simple",config:u}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),to={class:"field"},oo={class:"header"},no={class:"text-sm font-bold"},so={key:0,class:"config-grid"},io={class:"cfg-row-head"},lo={class:"cfg-name"};function ao(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select"),c=o("el-input-number"),k=o("el-slider");return l(),m("div",to,[i("div",oo,[i("span",no,r(e.$t("kling.name.cameraControl")),1),n(d,{content:e.tooltipContent},null,8,["content"])]),n(f,{modelValue:e.selectedTypeRaw,"onUpdate:modelValue":t[0]||(t[0]=g=>e.selectedTypeRaw=g),class:"value",placeholder:e.$t("kling.placeholder.cameraType"),clearable:!0,disabled:e.disabled},{default:h(()=>[(l(!0),m(V,null,T(e.typeOptions,g=>(l(),C(p,{key:g.value,label:g.label,value:g.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","disabled"]),e.selectedType==="simple"&&!e.disabled?(l(),m("div",so,[(l(!0),m(V,null,T(e.configKeys,g=>(l(),m("div",{key:g,class:"cfg-row"},[i("div",io,[i("span",lo,r(e.$t(`kling.name.cc_${g}`)),1),n(c,{modelValue:e.configValues[g],"onUpdate:modelValue":_=>e.configValues[g]=_,min:-1,max:1,step:.1,precision:1,"controls-position":"right",size:"small",class:"cfg-num",onChange:_=>e.onNumberChange(g,_)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),n(k,{"model-value":e.configValues[g]??0,min:-1,max:1,step:.1,onInput:_=>e.onSliderChange(g,_)},null,8,["model-value","onInput"])]))),128))])):v("",!0)])}const ro=y(eo,[["render",ao],["__scopeId","data-v-cd896060"]]),fe=[{groupKey:"cameraMovements",chipKeys:["rotateAround","stationary","handheld","zoomOut","zoomIn","follow","panRight","tiltUp","tiltDown","orbit"]},{groupKey:"cameraSpeed",chipKeys:["speedSlow","speedMedium","speedFast"]},{groupKey:"shotType",chipKeys:["shotClose","shotMedium","shotLong","shotLowAngle","shotHighAngle","shotShallowDof","shotFront","shotProfile","shotCloseUp","shotDrone"]},{groupKey:"light",chipKeys:["lightSunlight","lightSoft","lightNeon","lightWarm","lightNature","lightCandle","lightCityNight"]},{groupKey:"frame",chipKeys:["frameRichDetails","frameSimpleBg"]},{groupKey:"atmosphere",chipKeys:["atmosphereMysterious","atmospherePeaceful","atmosphereHeartwarming","atmosphereVivid","atmosphereColorful"]}],B=", ";function co(e,t){const s=(e||"").trim();return s?s.includes(t)?s:`${s}${B}${t}`:t}function z(e,t){if(!e||!t)return e||"";const s=[`${t}${B}`,`${B}${t}`,t];let a=e;for(const u of s)if(a.includes(u)){a=a.replace(u,"");break}return a.replace(/(?:,\s*)+$/,"").replace(/^(?:,\s*)+/,"")}const mo=b({name:"InspirationPills",components:{FontAwesomeIcon:E},computed:{prompt(){return this.$store.state.kling?.config?.prompt||""},allChipTexts(){return fe.flatMap(e=>e.chipKeys.map(t=>this.$t(`kling.inspiration.chip.${t}`)))},selected(){const e=this.prompt;if(!e)return[];const t=[];for(const s of this.allChipTexts){const a=e.indexOf(s);a!==-1&&t.push({text:s,idx:a})}return t.sort((s,a)=>s.idx-a.idx).map(s=>s.text)}},methods:{onRemove(e){const t=z(this.prompt,e);this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:t})}}}),uo={key:0,class:"pills",role:"list"},po={class:"pill-text"},go=["aria-label","onClick"];function fo(e,t,s,a,u,$){const d=o("font-awesome-icon");return e.selected.length>0?(l(),m("div",uo,[(l(!0),m(V,null,T(e.selected,p=>(l(),m("div",{key:p,class:"pill",role:"listitem"},[i("span",po,r(p),1),i("button",{type:"button",class:"pill-remove","aria-label":e.$t("kling.inspiration.removeChip"),onClick:be(f=>e.onRemove(p),["stop"])},[n(d,{icon:"fa-solid fa-xmark"})],8,go)]))),128))])):v("",!0)}const ho=y(mo,[["render",fo],["__scopeId","data-v-5fc4fa65"]]),_o="",$o=b({name:"PromptInput",components:{ElButton:L,FontAwesomeIcon:E,PromptTextarea:Me,InspirationPills:ho},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=_o)}});function ko(e,t,s,a,u,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("inspiration-pills"),c=o("prompt-textarea");return l(),C(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:h(()=>[n(p,{text:"",size:"small",class:"inspiration-btn",onClick:t[0]||(t[0]=k=>e.$emit("open-inspiration"))},{default:h(()=>[n(d,{icon:"fa-regular fa-lightbulb",class:"mr-1"}),w(" "+r(e.$t("kling.inspiration.openButton")),1)]),_:1})]),before:h(()=>[n(f)]),_:1},8,["modelValue","title","info","placeholder"])}const vo=y($o,[["render",ko],["__scopeId","data-v-c01fc1a6"]]),bo="",yo=b({name:"NegativePromptInput",components:{ElInput:pe,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=bo)}}),wo={class:"field"},Co={class:"box"},So={class:"title font-bold"};function Vo(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-input");return l(),m("div",wo,[i("div",Co,[i("h2",So,r(e.$t("kling.name.negativePrompt")),1),n(d,{content:e.$t("kling.description.negativePrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=f=>e.prompt=f),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.negativePrompt")},null,8,["modelValue","placeholder"])])}const Io=y(yo,[["render",Vo],["__scopeId","data-v-de98cf01"]]),To=b({name:"InspirationDrawer",components:{ElDrawer:re,ElButton:L,FontAwesomeIcon:E},props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],data(){return{groups:fe,Close:ye}},computed:{visible:{get(){return this.modelValue},set(e){this.$emit("update:modelValue",e)}},drawerSize(){return window.innerWidth<768?"100%":"380px"},prompt(){return this.$store.state.kling?.config?.prompt||""},allChipTexts(){return this.groups.flatMap(e=>e.chipKeys.map(t=>this.$t(`kling.inspiration.chip.${t}`)))},selectedCount(){return this.allChipTexts.filter(e=>this.isSelected(e)).length}},methods:{chipText(e){return this.$t(`kling.inspiration.chip.${e}`)},isSelected(e){return e?this.prompt.includes(e):!1},setPrompt(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:e})},onToggle(e){e&&(this.isSelected(e)?this.setPrompt(z(this.prompt,e)):this.setPrompt(co(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(const t of this.allChipTexts)for(;e.includes(t);)e=z(e,t);this.setPrompt(e)}}}),Eo={class:"drawer-content"},Lo={class:"drawer-header"},Mo={class:"title-row"},Ro={class:"title"},Uo={class:"hint"},Do={key:0,class:"selected-bar"},Ao={class:"selected-text"},Po={class:"groups"},Go={class:"group-title"},Ko={class:"chip-grid"},Oo=["onClick"];function jo(e,t,s,a,u,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),C(f,{modelValue:e.visible,"onUpdate:modelValue":t[1]||(t[1]=c=>e.visible=c),direction:"rtl","with-header":!1,size:e.drawerSize,"custom-class":"kling-inspiration-drawer","destroy-on-close":!1},{default:h(()=>[i("div",Eo,[i("div",Lo,[i("div",Mo,[n(d,{icon:"fa-regular fa-lightbulb",class:"mr-2"}),i("span",Ro,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",Uo,r(e.$t("kling.inspiration.hint")),1),e.selectedCount>0?(l(),m("div",Do,[i("span",Ao,r(e.$t("kling.inspiration.selectedSummary",{count:e.selectedCount})),1),n(p,{text:"",size:"small",class:"clear-btn",onClick:e.onClearSelected},{default:h(()=>[w(r(e.$t("kling.inspiration.clearSelected")),1)]),_:1},8,["onClick"])])):v("",!0),i("div",Po,[(l(!0),m(V,null,T(e.groups,c=>(l(),m("div",{key:c.groupKey,class:"group"},[i("div",Go,r(e.$t(`kling.inspiration.group.${c.groupKey}`)),1),i("div",Ko,[(l(!0),m(V,null,T(c.chipKeys,k=>(l(),m("button",{key:k,type:"button",class:U({chip:!0,active:e.isSelected(e.chipText(k))}),onClick:g=>e.onToggle(e.chipText(k))},r(e.chipText(k)),11,Oo))),128))])]))),128))])])]),_:1},8,["modelValue","size"])}const No=y(To,[["render",jo],["__scopeId","data-v-7d457a69"]]),Bo={"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"},zo={std:"720p",pro:"1080p","4k":"4K"},Fo=b({name:"SummaryChip",components:{FontAwesomeIcon:E},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){const e=this.config?.model||"kling-v2-5-turbo";return Bo[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||""},modeLabel(){const e=this.config?.mode||"std";return zo[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),qo={class:"summary-chip"},Ho=["title"],Wo=["title"],Jo=["title"],Qo=["title"],Yo=["title"];function Xo(e,t,s,a,u,$){const d=o("font-awesome-icon");return l(),m("div",qo,[i("span",{class:"part",title:e.$t("kling.name.model")},r(e.modelLabel),9,Ho),t[0]||(t[0]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.duration")},r(e.durationLabel),9,Wo),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,Jo),t[2]||(t[2]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.mode")},r(e.modeLabel),9,Qo),e.generateAudio?(l(),m("span",{key:0,class:"audio",title:e.$t("kling.name.generateAudio")},[n(d,{icon:"fa-solid fa-headphones"})],8,Yo)):v("",!0)])}const Zo=y(Fo,[["render",Xo],["__scopeId","data-v-418a6733"]]),xo=b({name:"ConfigPanel",components:{ElButton:L,Consumption:ce,FontAwesomeIcon:E,PromptInput:vo,NegativePromptInput:Io,ModelSelector:et,ModeSelector:at,DurationSelector:ht,RatioSelector:wt,StartImage:Lt,CfgScaleSelector:qt,GenerateAudioSelector:Zt,CameraControlSelector:ro,InspirationDrawer:No,SummaryChip:Zo,EndImage:Gt},emits:["generate"],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},consumption(){return ge(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit("generate")}}}),en={class:"flex flex-col h-full"},tn={class:"flex-1 overflow-y-auto p-5"},on={class:"flex flex-col items-center justify-center px-5 pb-5"};function nn(e,t,s,a,u,$){const d=o("prompt-input"),p=o("model-selector"),f=o("ratio-selector"),c=o("start-image"),k=o("end-image"),g=o("duration-selector"),_=o("mode-selector"),M=o("generate-audio-selector"),R=o("camera-control-selector"),j=o("cfg-scale-selector"),he=o("negative-prompt-input"),_e=o("summary-chip"),$e=o("consumption"),X=o("font-awesome-icon"),Z=o("el-button"),ke=o("inspiration-drawer");return l(),m("div",en,[i("div",tn,[n(d,{class:"mb-4",onOpenInspiration:t[0]||(t[0]=x=>e.inspirationOpen=!0)}),n(p,{class:"mb-4"}),n(f,{class:"mb-4"}),n(c,{class:"mb-2"}),n(k,{class:"mb-2"}),n(g,{class:"mb-4"}),n(_,{class:"mb-4"}),n(M,{class:"mb-4"}),n(R,{class:"mb-4"}),n(j,{class:"mb-4"}),n(he,{class:"mb-4"})]),i("div",on,[n(_e),n($e,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(l(),C(Z,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(X,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.extend")),1)]),_:1},8,["onClick"])):(l(),C(Z,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(X,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.generate")),1)]),_:1},8,["onClick"]))]),n(ke,{modelValue:e.inspirationOpen,"onUpdate:modelValue":t[1]||(t[1]=x=>e.inspirationOpen=x)},null,8,["modelValue"])])}const sn=y(xo,[["render",nn]]),ln=b({name:"MotionImage",components:{ElUpload:O,ElButton:L,InfoIcon:I,FontAwesomeIcon:E,ImagePreview:K},mixins:[H],data(){return{fileList:[],uploadUrl:G()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetImageUrl()},methods:{onExceed(){S.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){S.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()}}}),an={class:"relative"},rn={class:"flex justify-between"},cn={class:"flex justify-start items-center"},dn={class:"text-sm font-bold"};function mn(e,t,s,a,u,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),k=o("el-upload");return l(),m("div",an,[i("div",rn,[i("div",cn,[i("span",dn,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]=g=>e.fileList=g),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:g})=>[g.url&&g.percentage!==void 0?(l(),C(p,{key:0,url:g.url,name:g.name,percentage:g.percentage,onRemove:_=>e.onRemove(g)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:h(()=>[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$t("kling.button.uploadReferences")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const un=y(ln,[["render",mn],["__scopeId","data-v-37d42da7"]]),pn=b({name:"MotionVideo",components:{ElUpload:O,ElButton:L,InfoIcon:I,FilePreview:Ue,FontAwesomeIcon:E},data(){return{fileList:[],uploadUrl:G()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetVideoUrl()},methods:{onExceed(){S.warning(this.$t("kling.message.uploadVideoExceed"))},onError(){S.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:(S.error(this.$t("kling.message.uploadVideoSizeExceed")),!1):(S.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()}}}),gn={class:"relative"},fn={class:"flex justify-between"},hn={class:"flex justify-start items-center"},_n={class:"text-sm font-bold"};function $n(e,t,s,a,u,$){const d=o("info-icon"),p=o("file-preview"),f=o("font-awesome-icon"),c=o("el-button"),k=o("el-upload");return l(),m("div",gn,[i("div",fn,[i("div",hn,[i("span",_n,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]=g=>e.fileList=g),accept:".mp4,.mov",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"before-upload":e.beforeUpload,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:g})=>[g.percentage!==void 0?(l(),C(p,{key:0,url:g.url||g.response?.file_url,name:g.name,percentage:g.percentage,onRemove:_=>e.onRemove(g)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:h(()=>[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$t("kling.button.uploadVideoUrl")),1)]),_:1})]),_:1},8,["file-list","action","before-upload","on-exceed","on-error","on-success","headers"])])}const kn=y(pn,[["render",$n],["__scopeId","data-v-5cf93212"]]),vn=b({name:"MotionPromptInput",components:{ElInput:pe,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})}}}}),bn={class:"field"},yn={class:"box"},wn={class:"title font-bold"};function Cn(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-input");return l(),m("div",bn,[i("div",yn,[i("h2",wn,r(e.$t("kling.name.motionPrompt")),1),n(d,{content:e.$t("kling.description.motionPrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=f=>e.prompt=f),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.motionPrompt")},null,8,["modelValue","placeholder"])])}const Sn=y(vn,[["render",Cn],["__scopeId","data-v-ca9fdbe5"]]),ie="video",Vn=b({name:"CharacterOrientationSelector",components:{ElRadioGroup:Ae,ElRadioButton:De,InfoIcon:I},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||ie},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=ie)}}),In={class:"field"},Tn={class:"header"},En={class:"text-sm font-bold"};function Ln(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-radio-button"),f=o("el-radio-group");return l(),m("div",In,[i("div",Tn,[i("span",En,r(e.$t("kling.name.characterOrientation")),1),n(d,{content:e.$t("kling.description.characterOrientation")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),size:"small",class:"value"},{default:h(()=>[n(p,{label:"image"},{default:h(()=>[w(r(e.$t("kling.name.orientationImage")),1)]),_:1}),n(p,{label:"video"},{default:h(()=>[w(r(e.$t("kling.name.orientationVideo")),1)]),_:1})]),_:1},8,["modelValue"])])}const Mn=y(Vn,[["render",Ln],["__scopeId","data-v-7a91195b"]]),le="std",Rn=b({name:"MotionModeSelector",components:{ElSelect:P,ElOption:A,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||le},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=le)}}),Un={class:"field"},Dn={class:"header"},An={class:"title font-bold"};function Pn(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),m("div",Un,[i("div",Dn,[i("h2",An,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.motionMode")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),class:"value",placeholder:e.$t("kling.placeholder.select")},{default:h(()=>[(l(!0),m(V,null,T(e.options,c=>(l(),C(p,{key:c.value,label:c.label,value:c.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Gn=y(Rn,[["render",Pn],["__scopeId","data-v-1295688c"]]),Kn=b({name:"KeepOriginalSoundSelector",components:{ElSwitch:ue,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"})}}}}),On={class:"relative"},jn={class:"flex justify-between items-center"},Nn={class:"flex justify-start items-center"},Bn={class:"text-sm font-bold"};function zn(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-switch");return l(),m("div",On,[i("div",jn,[i("div",Nn,[i("span",Bn,r(e.$t("kling.name.keepOriginalSound")),1),n(d,{content:e.$t("kling.description.keepOriginalSound")},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=f=>e.value=f)},null,8,["modelValue"])])])}const Fn=y(Kn,[["render",zn]]),qn=b({name:"MotionPanel",components:{ElButton:L,FontAwesomeIcon:E,Consumption:ce,MotionImage:un,MotionVideo:kn,MotionPromptInput:Sn,CharacterOrientationSelector:Mn,MotionModeSelector:Gn,KeepOriginalSoundSelector:Fn},emits:["generate"],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return ge(this.motionConfig,this.service?.cost)},service(){return this.$store.state.kling?.service},canGenerate(){const e=this.motionConfig;return!!(e?.image_url&&e?.video_url)}},methods:{onGenerate(){this.$emit("generate")}}}),Hn={class:"flex flex-col h-full"},Wn={class:"flex-1 overflow-y-auto p-5"},Jn={class:"flex flex-col items-center justify-center px-5 pb-5"};function Qn(e,t,s,a,u,$){const d=o("motion-image"),p=o("motion-video"),f=o("motion-prompt-input"),c=o("character-orientation-selector"),k=o("motion-mode-selector"),g=o("keep-original-sound-selector"),_=o("consumption"),M=o("font-awesome-icon"),R=o("el-button");return l(),m("div",Hn,[i("div",Wn,[n(d,{class:"mb-3"}),n(p,{class:"mb-3"}),n(f,{class:"mb-4"}),n(c,{class:"mb-4"}),n(k,{class:"mb-4"}),n(g,{class:"mb-4"})]),i("div",Jn,[n(_,{value:e.consumption,service:e.service},null,8,["value","service"]),n(R,{type:"primary",class:"btn w-full",round:"",disabled:!e.canGenerate,onClick:e.onGenerate},{default:h(()=>[n(M,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.generateMotion")),1)]),_:1},8,["disabled","onClick"])])])}const Yn=y(qn,[["render",Qn]]),Xn=b({name:"KlingTabSwitcher",components:{ElTabs:Ge,ElTabPane:Pe,ElTag:we},props:{modelValue:{type:String,default:"videos"}},emits:["update:modelValue"],computed:{tabs(){return[{value:"videos",label:this.$t("kling.tab.videoGeneration")},{value:"motion",label:this.$t("kling.tab.motionControl")}]}},methods:{onUpdate(e){this.$emit("update:modelValue",e)}}}),Zn=["title"],xn={class:"text"};function es(e,t,s,a,u,$){const d=o("el-tag"),p=o("el-tab-pane"),f=o("el-tabs");return l(),C(f,{"model-value":e.modelValue,class:"kling-tabs",stretch:"","onUpdate:modelValue":e.onUpdate},{default:h(()=>[(l(!0),m(V,null,T(e.tabs,c=>(l(),C(p,{key:c.value,name:c.value,disabled:c.disabled},{label:h(()=>[i("span",{class:"tab-label",title:c.disabled?c.disabledReason:void 0},[i("span",xn,r(c.label),1),c.badge?(l(),C(d,{key:0,size:"small",type:"warning",class:"badge"},{default:h(()=>[w(r(c.badge),1)]),_:2},1024)):v("",!0)],8,Zn)]),_:2},1032,["name","disabled"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])}const ts=y(Xn,[["render",es],["__scopeId","data-v-bf00c27e"]]),os=b({name:"TaskPreview",components:{ElImage:Ne,CopyToClipboard:Ke,FontAwesomeIcon:E,ElAlert:je,VideoPlayer:Oe,ElTooltip:W,ElButton:L,ImagePreview:K},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},referenceImages(){const e=[],t=this.modelValue?.request?.start_image_url,s=this.modelValue?.request?.end_image_url;return t&&e.push({url:t,name:"start-image"}),s&&e.push({url:s,name:"end-image"}),e}},methods:{onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onOpenVideo(e){window.open(e,"_blank")}}}),ns={class:"preview"},ss={class:"left"},is={class:"main"},ls={class:"bot"},as={class:"datetime"},rs={class:"info"},cs={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},ds={key:1,class:"prompt mt-2"},ms={key:0},us={key:1},ps={key:0,class:U({content:!0,failed:!0})},gs={key:0,class:"mb-4"},fs={key:1,class:U({operations:!0,"mt-2":!0})},hs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},_s={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},$s={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},ks={key:1,class:U({content:!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-2"},ws={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Cs={key:2,class:U({content:!0})},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-0"};function Is(e,t,s,a,u,$){const d=o("el-image"),p=o("image-preview"),f=o("video-player"),c=o("el-button"),k=o("el-tooltip"),g=o("font-awesome-icon"),_=o("copy-to-clipboard"),M=o("el-alert");return l(),m("div",ns,[i("div",ss,[n(d,{src:"https://cdn.acedata.cloud/qpbbbb.jpg",class:"avatar"})]),i("div",is,[i("div",ls,[w(r(e.$t("kling.name.klingBot"))+" ",1),i("span",as,r(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),i("div",rs,[e.referenceImages.length>0?(l(),m("div",cs,[(l(!0),m(V,null,T(e.referenceImages,(R,j)=>(l(),C(p,{key:j,url:R.url,name:R.name,closable:!1},null,8,["url","name"]))),128))])):v("",!0),e.modelValue?.request?.prompt?(l(),m("p",ds,[w(r(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?v("",!0):(l(),m("span",ms," - ("+r(e.$t("kling.status.pending"))+") ",1)),e.modelValue?.response?.state==="submitted"||e.modelValue?.response?.state==="processing"||e.modelValue?.response?.state==="pending"||e.modelValue?.response?.state==="completed"?(l(),m("span",us," - ("+r(e.$t("kling.status.processing"))+") ",1)):v("",!0)])):v("",!0)]),e.modelValue?.response?.success===!0?(l(),m("div",ps,[e.modelValue?.response.video_url?(l(),m("div",gs,[n(f,{src:e.modelValue?.response.video_url},null,8,["src"])])):v("",!0),e.modelValue?.response.success?(l(),m("div",fs,[n(k,{class:"box-item",effect:"dark",content:e.$t("kling.message.downloadVideo"),placement:"top-start"},{default:h(()=>[e.modelValue?.response.video_url?(l(),C(c,{key:0,type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=R=>e.onDownload(R,e.modelValue?.response.video_url))},{default:h(()=>[w(r(e.$t("kling.button.download")),1)]),_:1})):v("",!0)]),_:1},8,["content"])])):v("",!0),n(M,{closable:!1,class:"mt-2 success"},{default:h(()=>[i("p",hs,[n(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.model"))+": "+r(e.modelValue?.request?.model),1)]),i("p",_s,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(l(),m("p",$s,[n(g,{icon:"fa-solid fa-clock",class:"mr-1"}),w(" "+r(e.$t("kling.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):v("",!0)]),_:1})])):v("",!0),e.modelValue?.response?.success===!1?(l(),m("div",ks,[n(M,{closable:!1,class:"failure"},{template:h(()=>[n(g,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),w(" "+r(e.$t("kling.name.failure")),1)]),default:h(()=>[i("p",vs,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),i("p",bs,[n(g,{icon:"fa-solid fa-circle-info",class:"mr-1"}),w(" "+r(e.$t("kling.name.failureReason"))+": "+r(e.modelValue?.response?.error?.message)+" ",1),n(_,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(l(),m("p",ys,[n(g,{icon:"fa-solid fa-clock",class:"mr-1"}),w(" "+r(e.$t("kling.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):v("",!0),e.modelValue?.response?.trace_id?(l(),m("p",ws,[n(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(_,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):v("",!0)]),_:1})])):v("",!0),e.modelValue?.response?.success===void 0?(l(),m("div",Cs,[n(M,{closable:!1,class:"info"},{template:h(()=>[n(g,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),w(" "+r(e.$t("kling.name.failure")),1)]),default:h(()=>[i("p",Ss,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.response?.trace_id?(l(),m("p",Vs,[n(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(_,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):v("",!0)]),_:1})])):v("",!0)])])}const Ts=y(os,[["render",Is],["__scopeId","data-v-e8e87659"]]),Es=b({name:"RecentPanel",components:{TaskPreview:Ts,NoTasks:Re,BotPlaceholder:Be,ScrollList:Ee},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.kling?.tasks,items:this.$store.state.kling?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Ls={key:0},Ms={key:2,class:"w-full h-full flex items-center justify-center"};function Rs(e,t,s,a,u,$){const d=o("bot-placeholder"),p=o("task-preview"),f=o("scroll-list"),c=o("no-tasks");return l(),m(V,null,[e.tasks?.items===void 0?(l(),m("div",Ls,[n(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(l(),C(f,{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:h(()=>[(l(!0),m(V,null,T(e.tasks?.items,k=>(l(),C(p,{key:k.id,"model-value":k},null,8,["model-value"]))),128))]),_:1},8,["loading"])):v("",!0),e.tasks?.items?.length===0?(l(),m("div",Ms,[n(c)])):v("",!0)],64)}const Us=y(Es,[["render",Rs]]),ae=Ce("kling"),Ds=b({name:"KlingIndex",components:{ConfigPanel:sn,MotionPanel:Yn,TabSwitcher:ts,Layout:Je,RecentPanel:Us},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===oe.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===oe.Request||this.fetchingTasks},credential(){return this.$store.state.kling.credential},config(){return this.$store.state.kling.config},motionConfig(){return this.$store.state.kling.motionConfig},taskType(){return this.$store.state.kling.taskType||"videos"},tasks(){return this.$store.state.kling.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await Le({tasks:this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("kling/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("kling/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:s,createdAtMax:a}=e||{};console.debug("limit",t,"createdAtMin",s,"createdAtMax",a),this.fetchingTasks=!0;try{await this.$store.dispatch("kling/getTasks",{limit:t,createdAtMin:s,createdAtMax:a})}finally{this.fetchingTasks=!1}},async onGenerate(){const{camera_control:e,...t}=this.config||{},s={...t,callback_url:ae};if(!s.video_id&&!t.video_url&&!s.start_image_url&&s.end_image_url){S.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 a=this.credential?.token;if(!a){console.error("no token specified");return}S.info(this.$t("kling.message.startingTask")),ee("kling",te.generate(s,{token:a})).then(()=>{S.success(this.$t("kling.message.startTaskSuccess"))}).catch(u=>{u?.response?.data?.error?.code===se?S.error(this.$t("kling.message.usedUp")):S.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},async onTabChange(e){e!==this.taskType&&(await this.$store.dispatch("kling/setTaskType",e),await this.onGetTasks(),await this.onScrollDown())},async onGenerateMotion(){const e=this.motionConfig||{};if(!e.image_url||!e.video_url){S.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:ae},s=this.credential?.token;if(!s){console.error("no token specified");return}S.info(this.$t("kling.message.startingTask")),ee("kling",te.motion(t,{token:s})).then(()=>{S.success(this.$t("kling.message.startTaskSuccess"))}).catch(a=>{a?.response?.data?.error?.code===se?S.error(this.$t("kling.message.usedUp")):S.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),As={class:"flex flex-col h-full"},Ps={class:"flex-1 min-h-0"};function Gs(e,t,s,a,u,$){const d=o("tab-switcher"),p=o("config-panel"),f=o("motion-panel"),c=o("recent-panel"),k=o("layout");return l(),C(k,null,{config:h(()=>[i("div",As,[n(d,{"model-value":e.taskType,"onUpdate:modelValue":e.onTabChange},null,8,["model-value","onUpdate:modelValue"]),i("div",Ps,[e.taskType==="videos"?(l(),C(p,{key:0,onGenerate:e.onGenerate},null,8,["onGenerate"])):e.taskType==="motion"?(l(),C(f,{key:1,onGenerate:e.onGenerateMotion},null,8,["onGenerate"])):v("",!0)])])]),result:h(()=>[n(c,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Ki=y(Ds,[["render",Gs]]);export{Ki as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as q}from"./index.es-D5toi_yB.js";import{E as P}from"./index-mTDdtUSQ.js";import{E as oe}from"./index-DU5biqWK.js";import{d as k,H as c,E as l,z as U,C as s,y as $,D as n,q as a,x as b,F as r,I as g,O as y,N as I,J as v,M as ae,Q as D}from"./vendor-vue-NSDaktjZ.js";import{G as S,dg as O,dh as R,di as j,dj as L,dk as G,dl as W,dm as F,dn as H,dp as J,dq as Q,bj as ne,dr as re,ds as K,dt as le,du as ie,dv as ce,dw as Z,dx as de,dy as me,dz as Y,co as ue,S as X,cp as pe}from"./index-CCfnxGYg.js";import{P as fe,N as _e}from"./NoTasks-Dpcud_u4.js";import{p as ge}from"./pasteUploadMixin-BurWbGNQ.js";import{I as A,S as he,l as $e}from"./pagination-BO6RV-kc.js";import{I as ee}from"./ImagePreview-C4OiWDg9.js";import{E as ve}from"./index-BwEtWche.js";import{E as z}from"./index-CoYnpgkX.js";import{C as be}from"./Consumption-DVkwcyaB.js";import{a as Ee}from"./price-DPkoP0YP.js";import{E as B,a as x,b as ke}from"./index-B1msaBme.js";import{E as Se}from"./index-CWu2cUvK.js";import{E as N}from"./index-BfSiZO1Q.js";import{E as ye}from"./index-7i1RSn5L.js";import{b as we}from"./errorCode-Cqj9Td_Z.js";import{s as Ie}from"./seedream-Bb4LS1xp.js";import{C as Ae}from"./CopyToClipboard-UnYO6hAq.js";import{I as Ve}from"./ImageWrapper-DcqueDH9.js";import{E as ze}from"./index-DM6P3x3N.js";import{E as Te}from"./index-oRUvw3Ui.js";import{E as Me}from"./index-B1DLX4Fc.js";import{B as Re}from"./BotPlaceholder-Dy1gr-9h.js";import"./use-form-item-BdyDMPU-.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Df5ITouH.js";import"./index-B5vjdbxo.js";import"./typescript-DYVOpHug.js";import"./index-BHtuVUFl.js";import"./index-BbjLkNT5.js";import"./index-CpWcFmdT.js";import"./_baseClone-D4Hl6Ymo.js";import"./_Uint8Array-Dhv101dV.js";import"./_initCloneObject-QV4IIV31.js";import"./isEqual-1RENOQre.js";import"./index-Dwk0fHJ3.js";import"./strings-beZM2Y-f.js";import"./castArray-DD0p5-P9.js";import"./debounce-CQuM7WhN.js";import"./_baseIteratee-URGnejHV.js";import"./index-3c5oSDnc.js";import"./validator-B70qvqYD.js";import"./index-Cu41y2Fl.js";import"./index-1diQ6JT1.js";const Le=k({name:"LayoutSeedream",components:{ElDrawer:oe,ElButton:P,FontAwesomeIcon:q},data(){return{drawer:!1}}}),De={class:"main flex flex-row flex-1"},Ce={class:"config w-[320px] h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},qe={class:"result h-full p-6 flex-1 flex flex-col bg-[var(--app-content-bg)]"};function Pe(e,t,d,o,m,p){const u=n("font-awesome-icon"),f=n("el-button"),i=n("el-drawer");return a(),c("div",De,[l("div",Ce,[U(e.$slots,"config",{},void 0,!0)]),l("div",qe,[U(e.$slots,"result",{},void 0,!0)]),s(f,{circle:"",class:"menu",onClick:t[0]||(t[0]=_=>e.drawer=!0)},{default:$(()=>[s(u,{icon:"fa-solid fa-magic"})]),_:1}),s(i,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=_=>e.drawer=_),direction:"ltr","with-header":!1,size:"340px",class:"drawer"},{default:$(()=>[U(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Ue=S(Le,[["render",Pe],["__scopeId","data-v-f2a6eb9e"]]),Ge="",Fe=k({name:"SeedreamPromptInput",components:{PromptTextarea:fe},computed:{prompt:{get(){return this.$store.state.seedream?.config?.prompt},set(e){this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=Ge)}});function Oe(e,t,d,o,m,p){const u=n("prompt-textarea");return a(),b(u,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=f=>e.prompt=f),title:e.$t("seedream.name.prompt"),info:e.$t("seedream.description.prompt"),placeholder:e.$t("seedream.placeholder.prompt")},null,8,["modelValue","title","info","placeholder"])}const je=S(Fe,[["render",Oe]]),Be={image:!0,imageRequired:!1,sizeTiers:[O,R,j,L],sizeAdaptive:!0,sizePixel:!0,sizePixelDefault:void 0,groupGeneration:!1,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};function w(e){switch(e){case Q:return{image:!0,imageRequired:!1,sizeTiers:[R,j,L],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!0,tools:!0};case J:return{image:!0,imageRequired:!1,sizeTiers:[R,L],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};case H:return{image:!0,imageRequired:!1,sizeTiers:[O,R,L],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};case F:return{image:!1,imageRequired:!1,sizeTiers:[],sizeAdaptive:!1,sizePixel:!0,sizePixelDefault:"1024x1024",groupGeneration:!1,seed:!0,guidanceScale:!0,guidanceScaleDefault:W[F],outputFormat:!1,tools:!1};case G:return{image:!0,imageRequired:!0,sizeTiers:[],sizeAdaptive:!1,sizePixel:!0,sizePixelDefault:"1024x1024",groupGeneration:!1,seed:!1,guidanceScale:!0,guidanceScaleDefault:W[G],outputFormat:!1,tools:!1};default:return Be}}const xe=[O,R,j,L];function Ne(e,t){if(!e)return[];const d=t.model??e.model;if(!d)return[];const o=w(d),m=[];Array.isArray(e.image)&&e.image.length>0&&!o.image&&m.push({field:"image",i18nLabel:"seedream.name.imageUrls"});const p=typeof e.size=="string"?e.size:void 0;if(p){const u=p.toUpperCase();xe.includes(u)&&!o.sizeTiers.includes(u)?m.push({field:"size",i18nLabel:"seedream.name.size"}):p==="adaptive"&&!o.sizeAdaptive&&m.push({field:"size",i18nLabel:"seedream.name.size"})}return e.sequential_image_generation==="auto"&&!o.groupGeneration&&m.push({field:"sequential_image_generation",i18nLabel:"seedream.name.maxImages"}),e.seed!==void 0&&e.seed!==null&&!o.seed&&m.push({field:"seed",i18nLabel:"seedream.name.seed"}),e.guidance_scale!==void 0&&e.guidance_scale!==null&&!o.guidanceScale&&m.push({field:"guidance_scale",i18nLabel:"seedream.name.guidanceScale"}),e.output_format&&!o.outputFormat&&m.push({field:"output_format",i18nLabel:"seedream.name.outputFormat"}),Array.isArray(e.tools)&&e.tools.length>0&&!o.tools&&m.push({field:"tools",i18nLabel:"seedream.name.tools"}),m}function We(e,t,d){const o={...e},m=d.model??e.model,p=w(m);for(const u of t)switch(u.field){case"image":delete o.image;break;case"size":p.sizePixelDefault?o.size=p.sizePixelDefault:delete o.size;break;case"sequential_image_generation":o.sequential_image_generation="disabled",delete o.sequential_image_generation_options;break;case"seed":delete o.seed;break;case"guidance_scale":delete o.guidance_scale;break;case"output_format":delete o.output_format;break;case"tools":delete o.tools;break}return o}const Ke=k({name:"SeedreamImageInput",components:{ElUpload:ve,ElButton:P,InfoIcon:A,ImagePreview:ee,FontAwesomeIcon:q},mixins:[ge],data(){return{fileList:[],uploadUrl:ne()+"/api/v1/files/",suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.seedream?.config?.image},model(){return this.$store.state.seedream?.config?.model},supported(){return w(this.model).image}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){const o=(this.fileList||[]).filter(m=>!m?.response?.file_url);this.fileList=o.length?o:[];return}const t=[];e.forEach(o=>{const m=this.fileList.find(p=>p?.response?.file_url===o||p?.url===o);m?t.push(m):t.push({name:o.split("/").pop()||o,url:o,status:"success",percentage:100,response:{file_url:o}})}),(this.fileList||[]).filter(o=>!o?.response?.file_url).forEach(o=>{t.some(p=>p===o||p?.url===o?.url||p?.response?.file_url===o?.response?.file_url)||t.push(o)}),this.fileList=t}}},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url=="string"&&e.url.startsWith("blob:"))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImages()},onExceed(){z.warning(this.$t("seedream.message.uploadImageExceed"))},onError(){z.error(this.$t("seedream.message.uploadImageError"))},onSetImages(){const e=this.urls;this.suppressWatch=!0,this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,image:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImages()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url=="string"&&t.url.startsWith("blob:"))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImages()}}}),Ze={key:0},Xe={class:"field"},He={class:"label"},Je={class:"box"},Qe={class:"title font-bold"},Ye={class:"value"},et={class:"file-list mt-2 flex flex-wrap gap-[10px]"};function tt(e,t,d,o,m,p){const u=n("info-icon"),f=n("font-awesome-icon"),i=n("el-button"),_=n("el-upload"),h=n("image-preview");return e.supported?(a(),c("div",Ze,[l("div",Xe,[l("div",He,[l("div",Je,[l("h2",Qe,r(e.$t("seedream.name.imageUrls")),1),s(u,{content:e.$t("seedream.description.imageUrls"),class:"info"},null,8,["content"])])]),l("div",Ye,[s(_,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=E=>e.fileList=E),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",limit:14,multiple:!0,"show-file-list":!1,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,"on-change":e.onChange,"on-remove":e.onRemove,headers:e.headers},{default:$(()=>[s(i,{size:"small",type:"primary",round:""},{default:$(()=>[s(f,{icon:"fa-solid fa-upload",class:"mr-1"}),g(" "+r(e.$t("seedream.button.uploadImageUrls")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","on-change","on-remove","headers"])])]),l("div",et,[(a(!0),c(y,null,I(e.fileList,(E,T)=>(a(),b(h,{key:E.uid||E?.response?.file_url||E.url||T,url:E.url||E?.response?.file_url,name:E.name,percentage:E.percentage,onRemove:C=>e.onRemovePreview(T,E)},null,8,["url","name","percentage","onRemove"]))),128))])])):v("",!0)}const st=S(Ke,[["render",tt],["__scopeId","data-v-2aa4829c"]]),ot=k({name:"SeedreamModelSelector",components:{ElSelect:x,ElOption:B,InfoIcon:A},data(){return{revertKey:0,options:[{value:Q,label:this.$t("seedream.model.seedream50")},{value:J,label:this.$t("seedream.model.seedream45")},{value:H,label:this.$t("seedream.model.seedream40")},{value:F,label:this.$t("seedream.model.seedream30t2i")},{value:G,label:this.$t("seedream.model.seededit30i2i")}]}},computed:{value(){return this.$store.state.seedream?.config?.model}},mounted(){this.value||this.applyModel(re)},methods:{async onChange(e){const t=this.$store.state.seedream?.config||{},d=Ne(t,{model:e});if(d.length===0){this.applyModel(e);return}const o=d.map(m=>this.$t(m.i18nLabel)).join("、");try{await Se.confirm(this.$t("seedream.message.featureNotSupportedBody",{fields:o}),this.$t("seedream.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("seedream.button.confirmContinue"),cancelButtonText:this.$t("seedream.button.cancelSwitch"),type:"warning"});const m=We({...t,model:e},d,{model:e});this.$store.commit("seedream/setConfig",m),z.success(this.$t("seedream.message.featureRemovedNotice",{fields:o}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,model:e})}}}),at={class:"field"},nt={class:"label"},rt={class:"box"},lt={class:"title font-bold"};function it(e,t,d,o,m,p){const u=n("info-icon"),f=n("el-option"),i=n("el-select");return a(),c("div",at,[l("div",nt,[l("div",rt,[l("h2",lt,r(e.$t("seedream.name.model")),1),s(u,{content:e.$t("seedream.description.model"),class:"info"},null,8,["content"])])]),(a(),b(i,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("seedream.placeholder.select"),onChange:e.onChange},{default:$(()=>[(a(!0),c(y,null,I(e.options,_=>(a(),b(f,{key:_.value,label:_.label,value:_.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const ct=S(ot,[["render",it],["__scopeId","data-v-8892a12c"]]),dt=k({name:"SeedreamSizeSelector",components:{ElSelect:x,ElOption:B,ElOptionGroup:ke,InfoIcon:A},data(){return{SEEDREAM_SIZE_ADAPTIVE:ie,pixelOptions:le}},computed:{model(){return this.$store.state.seedream?.config?.model},capabilities(){return w(this.model)},value:{get(){return this.$store.state.seedream?.config?.size},set(e){this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,size:e})}}},watch:{model:{immediate:!0,handler(){if(this.value)return;const e=this.capabilities;e.sizeTiers.length?this.value=e.sizeTiers.includes(K)?K:e.sizeTiers[0]:e.sizePixelDefault&&(this.value=e.sizePixelDefault)}}}}),mt={class:"field"},ut={class:"label"},pt={class:"box"},ft={class:"title font-bold"};function _t(e,t,d,o,m,p){const u=n("info-icon"),f=n("el-option"),i=n("el-option-group"),_=n("el-select");return a(),c("div",mt,[l("div",ut,[l("div",pt,[l("h2",ft,r(e.$t("seedream.name.size")),1),s(u,{content:e.$t("seedream.description.size"),class:"info"},null,8,["content"])])]),s(_,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=h=>e.value=h),class:"value",placeholder:e.$t("seedream.placeholder.size"),filterable:"","allow-create":"","default-first-option":""},{default:$(()=>[e.capabilities.sizeTiers.length?(a(),b(i,{key:0,label:e.$t("seedream.size.group.tier")},{default:$(()=>[(a(!0),c(y,null,I(e.capabilities.sizeTiers,h=>(a(),b(f,{key:h,label:h,value:h},null,8,["label","value"]))),128))]),_:1},8,["label"])):v("",!0),e.capabilities.sizeAdaptive?(a(),b(i,{key:1,label:e.$t("seedream.size.group.adaptive")},{default:$(()=>[(a(),b(f,{key:e.SEEDREAM_SIZE_ADAPTIVE,label:e.$t("seedream.size.adaptive"),value:e.SEEDREAM_SIZE_ADAPTIVE},null,8,["label","value"]))]),_:1},8,["label"])):v("",!0),s(i,{label:e.$t("seedream.size.group.pixel")},{default:$(()=>[(a(!0),c(y,null,I(e.pixelOptions,h=>(a(),b(f,{key:h.value,label:`${h.value} (${h.ratio})`,value:h.value},null,8,["label","value"]))),128))]),_:1},8,["label"])]),_:1},8,["modelValue","placeholder"])])}const gt=S(dt,[["render",_t],["__scopeId","data-v-dd7bd021"]]),ht=k({name:"SeedreamMaxImagesSelector",components:{ElInputNumber:N,InfoIcon:A},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return w(this.config?.model).groupGeneration},referenceImageCount(){const e=this.config?.image;return Array.isArray(e)?e.length:0},effectiveMax(){const e=Z-this.referenceImageCount;return Math.max(1,Math.min(Z,e))},value:{get(){const e=this.config?.sequential_image_generation_options?.max_images;return typeof e=="number"&&e>=1?e:ce},set(e){const t={...this.config||{}},d=Math.max(1,Math.min(this.effectiveMax,Math.floor(e||1)));d>1?(t.sequential_image_generation="auto",t.sequential_image_generation_options={...t.sequential_image_generation_options||{},max_images:d}):(t.sequential_image_generation="disabled",t.sequential_image_generation_options&&delete t.sequential_image_generation_options),this.$store.commit("seedream/setConfig",t)}}},watch:{effectiveMax(e){this.value>e&&(this.value=e)}}}),$t={key:0,class:"field"},vt={class:"label"},bt={class:"box"},Et={class:"title font-bold"},kt={class:"value"};function St(e,t,d,o,m,p){const u=n("info-icon"),f=n("el-input-number");return e.supported?(a(),c("div",$t,[l("div",vt,[l("div",bt,[l("h2",Et,r(e.$t("seedream.name.maxImages")),1),s(u,{content:e.$t("seedream.description.maxImages"),class:"info"},null,8,["content"])])]),l("div",kt,[s(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=i=>e.value=i),min:1,max:e.effectiveMax,step:1,size:"default","controls-position":"right",class:"counter"},null,8,["modelValue","max"])])])):v("",!0)}const yt=S(ht,[["render",St],["__scopeId","data-v-f079fd20"]]),wt=k({name:"SeedreamOutputFormatSelector",components:{ElSelect:x,ElOption:B,InfoIcon:A},data(){return{options:[...de]}},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return w(this.config?.model).outputFormat},value:{get(){return this.config?.output_format},set(e){const t={...this.config||{}};t.output_format=e,this.$store.commit("seedream/setConfig",t)}}}}),It={key:0,class:"field"},At={class:"label"},Vt={class:"box"},zt={class:"title font-bold"};function Tt(e,t,d,o,m,p){const u=n("info-icon"),f=n("el-option"),i=n("el-select");return e.supported?(a(),c("div",It,[l("div",At,[l("div",Vt,[l("h2",zt,r(e.$t("seedream.name.outputFormat")),1),s(u,{content:e.$t("seedream.description.outputFormat"),class:"info"},null,8,["content"])])]),s(i,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=_=>e.value=_),class:"value",placeholder:e.$t("seedream.placeholder.select")},{default:$(()=>[(a(!0),c(y,null,I(e.options,_=>(a(),b(f,{key:_,label:_.toUpperCase(),value:_},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])):v("",!0)}const Mt=S(wt,[["render",Tt],["__scopeId","data-v-69ea4c07"]]),Rt=k({name:"SeedreamSeedInput",components:{ElInputNumber:N,InfoIcon:A},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return w(this.config?.model).seed},value:{get(){const e=this.config?.seed;return typeof e=="number"?e:-1},set(e){const t={...this.config||{}},d=typeof e=="number"&&Number.isInteger(e)?e:-1;t.seed=d,this.$store.commit("seedream/setConfig",t)}}}}),Lt={key:0,class:"field"},Dt={class:"label"},Ct={class:"box"},qt={class:"title font-bold"},Pt={class:"value"};function Ut(e,t,d,o,m,p){const u=n("info-icon"),f=n("el-input-number");return e.supported?(a(),c("div",Lt,[l("div",Dt,[l("div",Ct,[l("h2",qt,r(e.$t("seedream.name.seed")),1),s(u,{content:e.$t("seedream.description.seed"),class:"info"},null,8,["content"])])]),l("div",Pt,[s(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=i=>e.value=i),min:-1,max:2147483647,step:1,size:"default","controls-position":"right",class:"counter"},null,8,["modelValue"])])])):v("",!0)}const Gt=S(Rt,[["render",Ut],["__scopeId","data-v-10cdc1e0"]]),Ft=k({name:"SeedreamGuidanceScaleInput",components:{ElInputNumber:N,InfoIcon:A},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return w(this.config?.model).guidanceScale},defaultValue(){return w(this.config?.model).guidanceScaleDefault??2.5},value:{get(){const e=this.config?.guidance_scale;return typeof e=="number"?e:this.defaultValue},set(e){const t={...this.config||{}},d=typeof e=="number"&&e>=1&&e<=10?e:this.defaultValue;t.guidance_scale=d,this.$store.commit("seedream/setConfig",t)}}}}),Ot={key:0,class:"field"},jt={class:"label"},Bt={class:"box"},xt={class:"title font-bold"},Nt={class:"value"};function Wt(e,t,d,o,m,p){const u=n("info-icon"),f=n("el-input-number");return e.supported?(a(),c("div",Ot,[l("div",jt,[l("div",Bt,[l("h2",xt,r(e.$t("seedream.name.guidanceScale")),1),s(u,{content:e.$t("seedream.description.guidanceScale"),class:"info"},null,8,["content"])])]),l("div",Nt,[s(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=i=>e.value=i),min:1,max:10,step:.1,precision:1,size:"default","controls-position":"right",class:"counter"},null,8,["modelValue"])])])):v("",!0)}const Kt=S(Ft,[["render",Wt],["__scopeId","data-v-7386f064"]]),Zt=k({name:"SeedreamWatermarkSwitch",components:{ElSwitch:ye,InfoIcon:A},computed:{value:{get(){const e=this.$store.state.seedream?.config?.watermark;return e===void 0?me:!!e},set(e){this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,watermark:e})}}}}),Xt={class:"field"},Ht={class:"label"},Jt={class:"box"},Qt={class:"title font-bold"},Yt={class:"value"};function es(e,t,d,o,m,p){const u=n("info-icon"),f=n("el-switch");return a(),c("div",Xt,[l("div",Ht,[l("div",Jt,[l("h2",Qt,r(e.$t("seedream.name.watermark")),1),s(u,{content:e.$t("seedream.description.watermark"),class:"info"},null,8,["content"])])]),l("div",Yt,[s(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=i=>e.value=i)},null,8,["modelValue"])])])}const ts=S(Zt,[["render",es],["__scopeId","data-v-9e2abf0f"]]),ss=k({name:"SeedreamConfigPanel",components:{ElButton:P,FontAwesomeIcon:q,PromptInput:je,Consumption:be,ImageInput:st,ModelSelector:ct,SizeSelector:gt,MaxImagesSelector:yt,OutputFormatSelector:Mt,SeedInput:Gt,GuidanceScaleInput:Kt,WatermarkSwitch:ts},emits:["generate"],computed:{config(){return this.$store.state.seedream?.config},consumption(){const e={...this.config||{}},t=Array.isArray(e?.image)&&e.image.length>0,d=e?.sequential_image_generation==="auto"?Math.max(1,Math.floor(e?.sequential_image_generation_options?.max_images||1)):1;return Ee({...e,action:t?"edit":"generate",model:Y(e?.model),count:d},this.service?.cost)},service(){return this.$store.state.seedream?.service}},methods:{onGenerate(){this.$emit("generate")}}}),os={class:"flex flex-col h-full"},as={class:"flex-1 overflow-y-auto p-5"},ns={class:"flex flex-col items-center justify-center px-5 pb-5"};function rs(e,t,d,o,m,p){const u=n("model-selector"),f=n("size-selector"),i=n("max-images-selector"),_=n("output-format-selector"),h=n("seed-input"),E=n("guidance-scale-input"),T=n("watermark-switch"),C=n("prompt-input"),V=n("image-input"),M=n("consumption"),te=n("font-awesome-icon"),se=n("el-button");return a(),c("div",os,[l("div",as,[s(u,{class:"mb-4"}),s(f,{class:"mb-4"}),s(i,{class:"mb-4"}),s(_,{class:"mb-4"}),s(h,{class:"mb-4"}),s(E,{class:"mb-4"}),s(T,{class:"mb-4"}),s(C,{class:"mb-4"}),s(V,{class:"mb-4"})]),l("div",ns,[s(M,{value:e.consumption,service:e.service},null,8,["value","service"]),s(se,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:$(()=>[s(te,{icon:"fa-solid fa-magic",class:"mr-2"}),g(" "+r(e.$t("seedream.button.generate")),1)]),_:1},8,["onClick"])])])}const ls=S(ss,[["render",rs]]),is=k({name:"SeedreamTaskPreview",components:{ElImage:Me,CopyToClipboard:Ae,FontAwesomeIcon:q,ElAlert:Te,ImageWrapper:Ve,ElButton:P,ElTooltip:ze,ImagePreview:ee},props:{modelValue:{type:Object,required:!0}},computed:{isEdit(){return Array.isArray(this.modelValue?.request?.image)&&(this.modelValue?.request?.image?.length||0)>0},images(){const e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{e.push(t)}),e}},methods:{shortModel(e){return Y(e)||e},onEdit(e){if(!e)return;console.debug("Edit image:",e);const t={...this.$store.state.seedream?.config||{}};t.image=[e],this.$store.commit("seedream/setConfig",t)}}}),cs={class:"preview"},ds={class:"left"},ms={class:"main"},us={class:"bot"},ps={class:"datetime"},fs={class:"info"},_s={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},gs={key:1,class:"prompt mt-2"},hs={key:0},$s={key:0,class:D({content:!0})},vs={class:"text-[var(--el-text-color-regular)] text-xs mb-0"},bs={key:1,class:D({content:!0,failed:!0})},Es={class:"flex justify-start items-center gap-4 w-full overflow-x-auto"},ks={class:D({operations:!0,"mt-2":!0,"mb-2":!0})},Ss={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ys={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ws={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Is={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},As={key:2,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Vs={key:3,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},zs={key:2,class:D({content:!0})},Ts={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ms={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Rs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ls={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ds={key:2,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Cs={key:3,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},qs={key:4,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Ps={key:3,class:D({content:!0})},Us={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Gs={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Fs(e,t,d,o,m,p){const u=n("el-image"),f=n("image-preview"),i=n("font-awesome-icon"),_=n("copy-to-clipboard"),h=n("el-alert"),E=n("image-wrapper"),T=n("el-button"),C=n("el-tooltip");return a(),c("div",cs,[l("div",ds,[s(u,{src:"https://cdn.acedata.cloud/9egrbn.png",class:"avatar"})]),l("div",ms,[l("div",us,[g(r(e.$t("seedream.name.seedreamBot"))+" ",1),l("span",ps,r(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),l("div",fs,[Array.isArray(e.modelValue?.request?.image)&&e.modelValue?.request?.image.length>0?(a(),c("div",_s,[(a(!0),c(y,null,I(e.modelValue?.request?.image,(V,M)=>(a(),b(f,{key:M,url:V,name:`image-${M+1}`,closable:!1},null,8,["url","name"]))),128))])):v("",!0),e.modelValue?.request?.prompt?(a(),c("p",gs,[g(r(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?v("",!0):(a(),c("span",hs," - ("+r(e.$t("seedream.status.pending"))+") ",1))])):v("",!0)]),e.modelValue?.response?e.modelValue?.response?.success===!0?(a(),c("div",bs,[l("div",Es,[(a(!0),c(y,null,I(e.images,(V,M)=>(a(),b(E,{key:M,src:V?.image_url,"raw-src":V?.image_url},null,8,["src","raw-src"]))),128))]),l("div",ks,[s(C,{class:"box-item",effect:"dark",content:e.$t("common.button.edit"),placement:"top-start"},{default:$(()=>[s(T,{type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=ae(V=>e.onEdit(e.images?.[0]?.image_url),["stop"]))},{default:$(()=>[g(r(e.$t("common.button.edit")),1)]),_:1})]),_:1},8,["content"])]),s(h,{closable:!1,class:"mt-2 success"},{default:$(()=>[e.modelValue?.request?.model?(a(),c("p",Ss,[s(i,{icon:"fa-solid fa-cube",class:"mr-1"}),g(" "+r(e.$t("seedream.name.model"))+": "+r(e.shortModel(e.modelValue?.request?.model)),1)])):v("",!0),e.modelValue?.request?.size?(a(),c("p",ys,[s(i,{icon:"fa-solid fa-image",class:"mr-1"}),g(" "+r(e.$t("seedream.name.size"))+": "+r(e.modelValue?.request?.size),1)])):v("",!0),l("p",ws,[s(i,{icon:"fa-solid fa-bolt",class:"mr-1"}),g(" "+r(e.$t("seedream.name.task"))+": "+r(e.isEdit?e.$t("seedream.name.edits"):e.$t("seedream.name.generate")),1)]),l("p",Is,[s(i,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+r(e.$t("seedream.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),s(_,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])]),e.modelValue?.elapsed?(a(),c("p",As,[s(i,{icon:"fa-solid fa-clock",class:"mr-1"}),g(" "+r(e.$t("seedream.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):v("",!0),e.modelValue?.response?.trace_id?(a(),c("p",Vs,[s(i,{icon:"fa-solid fa-hashtag",class:"mr-1"}),g(" "+r(e.$t("seedream.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),s(_,{content:e.modelValue?.response?.trace_id,class:"btn-copy inline-block"},null,8,["content"])])):v("",!0)]),_:1})])):e.modelValue?.response?.success===!1?(a(),c("div",zs,[s(h,{closable:!1,class:"failure"},{template:$(()=>[s(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),g(" "+r(e.$t("seedream.name.failure")),1)]),default:$(()=>[e.modelValue?.request?.model?(a(),c("p",Ts,[s(i,{icon:"fa-solid fa-cube",class:"mr-1"}),g(" "+r(e.$t("seedream.name.model"))+": "+r(e.shortModel(e.modelValue?.request?.model)),1)])):v("",!0),e.modelValue?.request?.size?(a(),c("p",Ms,[s(i,{icon:"fa-solid fa-image",class:"mr-1"}),g(" "+r(e.$t("seedream.name.size"))+": "+r(e.modelValue?.request?.size),1)])):v("",!0),l("p",Rs,[s(i,{icon:"fa-solid fa-bolt",class:"mr-1"}),g(" "+r(e.$t("seedream.name.task"))+": "+r(e.isEdit?e.$t("seedream.name.edits"):e.$t("seedream.name.generate")),1)]),l("p",Ls,[s(i,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+r(e.$t("seedream.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),s(_,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.response?.error?.message?(a(),c("p",Ds,[s(i,{icon:"fa-solid fa-circle-info",class:"mr-1"}),g(" "+r(e.$t("seedream.name.failureReason"))+": "+r(e.modelValue?.response?.error?.message)+" ",1),s(_,{content:e.modelValue?.response?.error?.message,class:"btn-copy"},null,8,["content"])])):v("",!0),e.modelValue?.elapsed?(a(),c("p",Cs,[s(i,{icon:"fa-solid fa-clock",class:"mr-1"}),g(" "+r(e.$t("seedream.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):v("",!0),e.modelValue?.response?.trace_id?(a(),c("p",qs,[s(i,{icon:"fa-solid fa-hashtag",class:"mr-1"}),g(" "+r(e.$t("seedream.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),s(_,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])):v("",!0)]),_:1})])):(a(),c("div",Ps,[s(h,{closable:!1,class:"info"},{template:$(()=>[s(i,{icon:"fa-solid fa-circle-info",class:"mr-1"}),g(" "+r(e.$t("seedream.name.status")),1)]),default:$(()=>[l("p",Us,[s(i,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+r(e.$t("seedream.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),s(_,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.response?.trace_id?(a(),c("p",Gs,[s(i,{icon:"fa-solid fa-hashtag",class:"mr-1"}),g(" "+r(e.$t("seedream.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),s(_,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])):v("",!0)]),_:1})])):(a(),c("div",$s,[s(h,{closable:!1,class:"info"},{template:$(()=>[s(i,{icon:"fa-regular fa-clock",class:"mr-1"}),g(" "+r(e.$t("seedream.status.pending")),1)]),default:$(()=>[l("p",vs,[s(i,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+r(e.$t("seedream.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),s(_,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])])]),_:1})]))])])}const Os=S(is,[["render",Fs],["__scopeId","data-v-0dfc6a09"]]),js=k({name:"SeedreamRecentPanel",components:{TaskPreview:Os,BotPlaceholder:Re,NoTasks:_e,ScrollList:he},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],computed:{tasks(){return{...this.$store.state.seedream?.tasks,items:this.$store.state.seedream?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Bs={key:0},xs={key:2,class:"w-full h-full flex items-center justify-center"};function Ns(e,t,d,o,m,p){const u=n("bot-placeholder"),f=n("task-preview"),i=n("scroll-list"),_=n("no-tasks");return a(),c(y,null,[e.tasks?.items===void 0?(a(),c("div",Bs,[s(u)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(a(),b(i,{key:1,ref:"scrollList",class:"tasks h-full w-full overflow-y-auto",loading:e.loading,onReachTop:t[0]||(t[0]=h=>e.$emit("reach-top"))},{default:$(()=>[(a(!0),c(y,null,I(e.tasks?.items,h=>(a(),b(f,{key:h.id,"model-value":h},null,8,["model-value"]))),128))]),_:1},8,["loading"])):v("",!0),e.tasks?.items?.length===0?(a(),c("div",xs,[s(_)])):v("",!0)],64)}const Ws=S(js,[["render",Ns]]),Ks=pe("seedream"),Zs=k({name:"SeedreamIndex",components:{ConfigPanel:ls,Layout:Ue,RecentPanel:Ws},inject:["initialized"],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.seedream?.status?.getApplications===X.Request},tasksLoading(){return this.$store.state.seedream?.status?.getTasks===X.Request},credential(){return this.$store.state.seedream?.credential},config(){return this.$store.state.seedream?.config},application(){return this.$store.state.seedream?.application},tasks(){return this.$store.state.seedream?.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await $e({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loading,setLoading:e=>this.loading=e,isBlocked:()=>this.tasksLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("seedream/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("seedream/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.tasksLoading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=20,createdAtMin:d,createdAtMax:o}=e||{};console.debug("limit",t,"createdAtMin",d,"createdAtMax",o),await this.$store.dispatch("seedream/getTasks",{limit:t,createdAtMin:d,createdAtMax:o})},async onGenerate(){const e={...this.config||{}};!(Array.isArray(e?.image)&&e.image.length>0)&&"image"in e&&delete e.image,e?.size||delete e.size;const d={...e,callback_url:Ks},o=this.credential?.token;if(!o){console.error("no token specified");return}z.info(this.$t("seedream.message.startingTask")),ue("seedream",Ie.generate(d,{token:o})).then(()=>{z.success(this.$t("seedream.message.startTaskSuccess"))}).catch(m=>{const p=m?.response?.data;p?.error?.code===we?z.error(this.$t("seedream.message.usedUp")):z.error(this.$t("seedream.message.startTaskFailed")+(p?.error?.message||""))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Xs(e,t,d,o,m,p){const u=n("config-panel"),f=n("recent-panel"),i=n("layout");return a(),b(i,null,{config:$(()=>[s(u,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:$(()=>[s(f,{ref:"recentPanel",loading:e.loading,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const No=S(Zs,[["render",Xs]]);export{No as default};
|
|
1
|
+
import{F as q}from"./index.es-DN8G0P37.js";import{E as P}from"./index-CwPjkJs4.js";import{E as oe}from"./index-B6W1wPG_.js";import{d as k,H as c,E as l,z as U,C as s,y as $,D as n,q as a,x as b,F as r,I as g,O as y,N as I,J as v,M as ae,Q as D}from"./vendor-vue-NSDaktjZ.js";import{G as S,dg as O,dh as R,di as j,dj as L,dk as G,dl as W,dm as F,dn as H,dp as J,dq as Q,bj as ne,dr as re,ds as K,dt as le,du as ie,dv as ce,dw as Z,dx as de,dy as me,dz as Y,co as ue,S as X,cp as pe}from"./index-CnhjD_2F.js";import{P as fe,N as _e}from"./NoTasks-gaaOL_m7.js";import{p as ge}from"./pasteUploadMixin-BurWbGNQ.js";import{I as A,S as he,l as $e}from"./pagination-BCTFE7Z3.js";import{I as ee}from"./ImagePreview-CJP-yB4D.js";import{E as ve}from"./index-Kc0m7PO-.js";import{E as z}from"./index-D1rl1ShF.js";import{C as be}from"./Consumption-tJVE5oXO.js";import{a as Ee}from"./price-7DAsoJmR.js";import{E as B,a as x,b as ke}from"./index-DFzC0rQH.js";import{E as Se}from"./index-D7IaIK0w.js";import{E as N}from"./index-ws34Ea3I.js";import{E as ye}from"./index-CLxhDB-t.js";import{b as we}from"./errorCode-Cqj9Td_Z.js";import{s as Ie}from"./seedream-CN1BaFH-.js";import{C as Ae}from"./CopyToClipboard-BthEHufq.js";import{I as Ve}from"./ImageWrapper-BBWjyl4X.js";import{E as ze}from"./index-ClwpIr_P.js";import{E as Te}from"./index-CbbUfyeR.js";import{E as Me}from"./index-CrH79zK9.js";import{B as Re}from"./BotPlaceholder-BZTrMT1c.js";import"./use-form-item-BKB_7n3g.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Df5ITouH.js";import"./index-D7LXRPby.js";import"./typescript-COFNajQU.js";import"./index-DPq9Ww9N.js";import"./index-qUrXiTT8.js";import"./index-CLR-flkd.js";import"./_baseClone-Q0okPItx.js";import"./_Uint8Array-BnVWNeHp.js";import"./_initCloneObject-DuLU5kHr.js";import"./isEqual-DGVdfmbU.js";import"./index-DmYzMmpZ.js";import"./strings-beZM2Y-f.js";import"./castArray-CB5VORGs.js";import"./debounce-Bt9MZ6bV.js";import"./_baseIteratee-Bw61Z4Wx.js";import"./index-D4eloMlC.js";import"./validator-QEfhhC-Q.js";import"./index-Cu41y2Fl.js";import"./index-uim_HWNA.js";const Le=k({name:"LayoutSeedream",components:{ElDrawer:oe,ElButton:P,FontAwesomeIcon:q},data(){return{drawer:!1}}}),De={class:"main flex flex-row flex-1"},Ce={class:"config w-[320px] h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},qe={class:"result h-full p-6 flex-1 flex flex-col bg-[var(--app-content-bg)]"};function Pe(e,t,d,o,m,p){const u=n("font-awesome-icon"),f=n("el-button"),i=n("el-drawer");return a(),c("div",De,[l("div",Ce,[U(e.$slots,"config",{},void 0,!0)]),l("div",qe,[U(e.$slots,"result",{},void 0,!0)]),s(f,{circle:"",class:"menu",onClick:t[0]||(t[0]=_=>e.drawer=!0)},{default:$(()=>[s(u,{icon:"fa-solid fa-magic"})]),_:1}),s(i,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=_=>e.drawer=_),direction:"ltr","with-header":!1,size:"340px",class:"drawer"},{default:$(()=>[U(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Ue=S(Le,[["render",Pe],["__scopeId","data-v-f2a6eb9e"]]),Ge="",Fe=k({name:"SeedreamPromptInput",components:{PromptTextarea:fe},computed:{prompt:{get(){return this.$store.state.seedream?.config?.prompt},set(e){this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=Ge)}});function Oe(e,t,d,o,m,p){const u=n("prompt-textarea");return a(),b(u,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=f=>e.prompt=f),title:e.$t("seedream.name.prompt"),info:e.$t("seedream.description.prompt"),placeholder:e.$t("seedream.placeholder.prompt")},null,8,["modelValue","title","info","placeholder"])}const je=S(Fe,[["render",Oe]]),Be={image:!0,imageRequired:!1,sizeTiers:[O,R,j,L],sizeAdaptive:!0,sizePixel:!0,sizePixelDefault:void 0,groupGeneration:!1,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};function w(e){switch(e){case Q:return{image:!0,imageRequired:!1,sizeTiers:[R,j,L],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!0,tools:!0};case J:return{image:!0,imageRequired:!1,sizeTiers:[R,L],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};case H:return{image:!0,imageRequired:!1,sizeTiers:[O,R,L],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};case F:return{image:!1,imageRequired:!1,sizeTiers:[],sizeAdaptive:!1,sizePixel:!0,sizePixelDefault:"1024x1024",groupGeneration:!1,seed:!0,guidanceScale:!0,guidanceScaleDefault:W[F],outputFormat:!1,tools:!1};case G:return{image:!0,imageRequired:!0,sizeTiers:[],sizeAdaptive:!1,sizePixel:!0,sizePixelDefault:"1024x1024",groupGeneration:!1,seed:!1,guidanceScale:!0,guidanceScaleDefault:W[G],outputFormat:!1,tools:!1};default:return Be}}const xe=[O,R,j,L];function Ne(e,t){if(!e)return[];const d=t.model??e.model;if(!d)return[];const o=w(d),m=[];Array.isArray(e.image)&&e.image.length>0&&!o.image&&m.push({field:"image",i18nLabel:"seedream.name.imageUrls"});const p=typeof e.size=="string"?e.size:void 0;if(p){const u=p.toUpperCase();xe.includes(u)&&!o.sizeTiers.includes(u)?m.push({field:"size",i18nLabel:"seedream.name.size"}):p==="adaptive"&&!o.sizeAdaptive&&m.push({field:"size",i18nLabel:"seedream.name.size"})}return e.sequential_image_generation==="auto"&&!o.groupGeneration&&m.push({field:"sequential_image_generation",i18nLabel:"seedream.name.maxImages"}),e.seed!==void 0&&e.seed!==null&&!o.seed&&m.push({field:"seed",i18nLabel:"seedream.name.seed"}),e.guidance_scale!==void 0&&e.guidance_scale!==null&&!o.guidanceScale&&m.push({field:"guidance_scale",i18nLabel:"seedream.name.guidanceScale"}),e.output_format&&!o.outputFormat&&m.push({field:"output_format",i18nLabel:"seedream.name.outputFormat"}),Array.isArray(e.tools)&&e.tools.length>0&&!o.tools&&m.push({field:"tools",i18nLabel:"seedream.name.tools"}),m}function We(e,t,d){const o={...e},m=d.model??e.model,p=w(m);for(const u of t)switch(u.field){case"image":delete o.image;break;case"size":p.sizePixelDefault?o.size=p.sizePixelDefault:delete o.size;break;case"sequential_image_generation":o.sequential_image_generation="disabled",delete o.sequential_image_generation_options;break;case"seed":delete o.seed;break;case"guidance_scale":delete o.guidance_scale;break;case"output_format":delete o.output_format;break;case"tools":delete o.tools;break}return o}const Ke=k({name:"SeedreamImageInput",components:{ElUpload:ve,ElButton:P,InfoIcon:A,ImagePreview:ee,FontAwesomeIcon:q},mixins:[ge],data(){return{fileList:[],uploadUrl:ne()+"/api/v1/files/",suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.seedream?.config?.image},model(){return this.$store.state.seedream?.config?.model},supported(){return w(this.model).image}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){const o=(this.fileList||[]).filter(m=>!m?.response?.file_url);this.fileList=o.length?o:[];return}const t=[];e.forEach(o=>{const m=this.fileList.find(p=>p?.response?.file_url===o||p?.url===o);m?t.push(m):t.push({name:o.split("/").pop()||o,url:o,status:"success",percentage:100,response:{file_url:o}})}),(this.fileList||[]).filter(o=>!o?.response?.file_url).forEach(o=>{t.some(p=>p===o||p?.url===o?.url||p?.response?.file_url===o?.response?.file_url)||t.push(o)}),this.fileList=t}}},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url=="string"&&e.url.startsWith("blob:"))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImages()},onExceed(){z.warning(this.$t("seedream.message.uploadImageExceed"))},onError(){z.error(this.$t("seedream.message.uploadImageError"))},onSetImages(){const e=this.urls;this.suppressWatch=!0,this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,image:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImages()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url=="string"&&t.url.startsWith("blob:"))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImages()}}}),Ze={key:0},Xe={class:"field"},He={class:"label"},Je={class:"box"},Qe={class:"title font-bold"},Ye={class:"value"},et={class:"file-list mt-2 flex flex-wrap gap-[10px]"};function tt(e,t,d,o,m,p){const u=n("info-icon"),f=n("font-awesome-icon"),i=n("el-button"),_=n("el-upload"),h=n("image-preview");return e.supported?(a(),c("div",Ze,[l("div",Xe,[l("div",He,[l("div",Je,[l("h2",Qe,r(e.$t("seedream.name.imageUrls")),1),s(u,{content:e.$t("seedream.description.imageUrls"),class:"info"},null,8,["content"])])]),l("div",Ye,[s(_,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=E=>e.fileList=E),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",limit:14,multiple:!0,"show-file-list":!1,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,"on-change":e.onChange,"on-remove":e.onRemove,headers:e.headers},{default:$(()=>[s(i,{size:"small",type:"primary",round:""},{default:$(()=>[s(f,{icon:"fa-solid fa-upload",class:"mr-1"}),g(" "+r(e.$t("seedream.button.uploadImageUrls")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","on-change","on-remove","headers"])])]),l("div",et,[(a(!0),c(y,null,I(e.fileList,(E,T)=>(a(),b(h,{key:E.uid||E?.response?.file_url||E.url||T,url:E.url||E?.response?.file_url,name:E.name,percentage:E.percentage,onRemove:C=>e.onRemovePreview(T,E)},null,8,["url","name","percentage","onRemove"]))),128))])])):v("",!0)}const st=S(Ke,[["render",tt],["__scopeId","data-v-2aa4829c"]]),ot=k({name:"SeedreamModelSelector",components:{ElSelect:x,ElOption:B,InfoIcon:A},data(){return{revertKey:0,options:[{value:Q,label:this.$t("seedream.model.seedream50")},{value:J,label:this.$t("seedream.model.seedream45")},{value:H,label:this.$t("seedream.model.seedream40")},{value:F,label:this.$t("seedream.model.seedream30t2i")},{value:G,label:this.$t("seedream.model.seededit30i2i")}]}},computed:{value(){return this.$store.state.seedream?.config?.model}},mounted(){this.value||this.applyModel(re)},methods:{async onChange(e){const t=this.$store.state.seedream?.config||{},d=Ne(t,{model:e});if(d.length===0){this.applyModel(e);return}const o=d.map(m=>this.$t(m.i18nLabel)).join("、");try{await Se.confirm(this.$t("seedream.message.featureNotSupportedBody",{fields:o}),this.$t("seedream.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("seedream.button.confirmContinue"),cancelButtonText:this.$t("seedream.button.cancelSwitch"),type:"warning"});const m=We({...t,model:e},d,{model:e});this.$store.commit("seedream/setConfig",m),z.success(this.$t("seedream.message.featureRemovedNotice",{fields:o}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,model:e})}}}),at={class:"field"},nt={class:"label"},rt={class:"box"},lt={class:"title font-bold"};function it(e,t,d,o,m,p){const u=n("info-icon"),f=n("el-option"),i=n("el-select");return a(),c("div",at,[l("div",nt,[l("div",rt,[l("h2",lt,r(e.$t("seedream.name.model")),1),s(u,{content:e.$t("seedream.description.model"),class:"info"},null,8,["content"])])]),(a(),b(i,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("seedream.placeholder.select"),onChange:e.onChange},{default:$(()=>[(a(!0),c(y,null,I(e.options,_=>(a(),b(f,{key:_.value,label:_.label,value:_.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const ct=S(ot,[["render",it],["__scopeId","data-v-8892a12c"]]),dt=k({name:"SeedreamSizeSelector",components:{ElSelect:x,ElOption:B,ElOptionGroup:ke,InfoIcon:A},data(){return{SEEDREAM_SIZE_ADAPTIVE:ie,pixelOptions:le}},computed:{model(){return this.$store.state.seedream?.config?.model},capabilities(){return w(this.model)},value:{get(){return this.$store.state.seedream?.config?.size},set(e){this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,size:e})}}},watch:{model:{immediate:!0,handler(){if(this.value)return;const e=this.capabilities;e.sizeTiers.length?this.value=e.sizeTiers.includes(K)?K:e.sizeTiers[0]:e.sizePixelDefault&&(this.value=e.sizePixelDefault)}}}}),mt={class:"field"},ut={class:"label"},pt={class:"box"},ft={class:"title font-bold"};function _t(e,t,d,o,m,p){const u=n("info-icon"),f=n("el-option"),i=n("el-option-group"),_=n("el-select");return a(),c("div",mt,[l("div",ut,[l("div",pt,[l("h2",ft,r(e.$t("seedream.name.size")),1),s(u,{content:e.$t("seedream.description.size"),class:"info"},null,8,["content"])])]),s(_,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=h=>e.value=h),class:"value",placeholder:e.$t("seedream.placeholder.size"),filterable:"","allow-create":"","default-first-option":""},{default:$(()=>[e.capabilities.sizeTiers.length?(a(),b(i,{key:0,label:e.$t("seedream.size.group.tier")},{default:$(()=>[(a(!0),c(y,null,I(e.capabilities.sizeTiers,h=>(a(),b(f,{key:h,label:h,value:h},null,8,["label","value"]))),128))]),_:1},8,["label"])):v("",!0),e.capabilities.sizeAdaptive?(a(),b(i,{key:1,label:e.$t("seedream.size.group.adaptive")},{default:$(()=>[(a(),b(f,{key:e.SEEDREAM_SIZE_ADAPTIVE,label:e.$t("seedream.size.adaptive"),value:e.SEEDREAM_SIZE_ADAPTIVE},null,8,["label","value"]))]),_:1},8,["label"])):v("",!0),s(i,{label:e.$t("seedream.size.group.pixel")},{default:$(()=>[(a(!0),c(y,null,I(e.pixelOptions,h=>(a(),b(f,{key:h.value,label:`${h.value} (${h.ratio})`,value:h.value},null,8,["label","value"]))),128))]),_:1},8,["label"])]),_:1},8,["modelValue","placeholder"])])}const gt=S(dt,[["render",_t],["__scopeId","data-v-dd7bd021"]]),ht=k({name:"SeedreamMaxImagesSelector",components:{ElInputNumber:N,InfoIcon:A},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return w(this.config?.model).groupGeneration},referenceImageCount(){const e=this.config?.image;return Array.isArray(e)?e.length:0},effectiveMax(){const e=Z-this.referenceImageCount;return Math.max(1,Math.min(Z,e))},value:{get(){const e=this.config?.sequential_image_generation_options?.max_images;return typeof e=="number"&&e>=1?e:ce},set(e){const t={...this.config||{}},d=Math.max(1,Math.min(this.effectiveMax,Math.floor(e||1)));d>1?(t.sequential_image_generation="auto",t.sequential_image_generation_options={...t.sequential_image_generation_options||{},max_images:d}):(t.sequential_image_generation="disabled",t.sequential_image_generation_options&&delete t.sequential_image_generation_options),this.$store.commit("seedream/setConfig",t)}}},watch:{effectiveMax(e){this.value>e&&(this.value=e)}}}),$t={key:0,class:"field"},vt={class:"label"},bt={class:"box"},Et={class:"title font-bold"},kt={class:"value"};function St(e,t,d,o,m,p){const u=n("info-icon"),f=n("el-input-number");return e.supported?(a(),c("div",$t,[l("div",vt,[l("div",bt,[l("h2",Et,r(e.$t("seedream.name.maxImages")),1),s(u,{content:e.$t("seedream.description.maxImages"),class:"info"},null,8,["content"])])]),l("div",kt,[s(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=i=>e.value=i),min:1,max:e.effectiveMax,step:1,size:"default","controls-position":"right",class:"counter"},null,8,["modelValue","max"])])])):v("",!0)}const yt=S(ht,[["render",St],["__scopeId","data-v-f079fd20"]]),wt=k({name:"SeedreamOutputFormatSelector",components:{ElSelect:x,ElOption:B,InfoIcon:A},data(){return{options:[...de]}},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return w(this.config?.model).outputFormat},value:{get(){return this.config?.output_format},set(e){const t={...this.config||{}};t.output_format=e,this.$store.commit("seedream/setConfig",t)}}}}),It={key:0,class:"field"},At={class:"label"},Vt={class:"box"},zt={class:"title font-bold"};function Tt(e,t,d,o,m,p){const u=n("info-icon"),f=n("el-option"),i=n("el-select");return e.supported?(a(),c("div",It,[l("div",At,[l("div",Vt,[l("h2",zt,r(e.$t("seedream.name.outputFormat")),1),s(u,{content:e.$t("seedream.description.outputFormat"),class:"info"},null,8,["content"])])]),s(i,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=_=>e.value=_),class:"value",placeholder:e.$t("seedream.placeholder.select")},{default:$(()=>[(a(!0),c(y,null,I(e.options,_=>(a(),b(f,{key:_,label:_.toUpperCase(),value:_},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])):v("",!0)}const Mt=S(wt,[["render",Tt],["__scopeId","data-v-69ea4c07"]]),Rt=k({name:"SeedreamSeedInput",components:{ElInputNumber:N,InfoIcon:A},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return w(this.config?.model).seed},value:{get(){const e=this.config?.seed;return typeof e=="number"?e:-1},set(e){const t={...this.config||{}},d=typeof e=="number"&&Number.isInteger(e)?e:-1;t.seed=d,this.$store.commit("seedream/setConfig",t)}}}}),Lt={key:0,class:"field"},Dt={class:"label"},Ct={class:"box"},qt={class:"title font-bold"},Pt={class:"value"};function Ut(e,t,d,o,m,p){const u=n("info-icon"),f=n("el-input-number");return e.supported?(a(),c("div",Lt,[l("div",Dt,[l("div",Ct,[l("h2",qt,r(e.$t("seedream.name.seed")),1),s(u,{content:e.$t("seedream.description.seed"),class:"info"},null,8,["content"])])]),l("div",Pt,[s(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=i=>e.value=i),min:-1,max:2147483647,step:1,size:"default","controls-position":"right",class:"counter"},null,8,["modelValue"])])])):v("",!0)}const Gt=S(Rt,[["render",Ut],["__scopeId","data-v-10cdc1e0"]]),Ft=k({name:"SeedreamGuidanceScaleInput",components:{ElInputNumber:N,InfoIcon:A},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return w(this.config?.model).guidanceScale},defaultValue(){return w(this.config?.model).guidanceScaleDefault??2.5},value:{get(){const e=this.config?.guidance_scale;return typeof e=="number"?e:this.defaultValue},set(e){const t={...this.config||{}},d=typeof e=="number"&&e>=1&&e<=10?e:this.defaultValue;t.guidance_scale=d,this.$store.commit("seedream/setConfig",t)}}}}),Ot={key:0,class:"field"},jt={class:"label"},Bt={class:"box"},xt={class:"title font-bold"},Nt={class:"value"};function Wt(e,t,d,o,m,p){const u=n("info-icon"),f=n("el-input-number");return e.supported?(a(),c("div",Ot,[l("div",jt,[l("div",Bt,[l("h2",xt,r(e.$t("seedream.name.guidanceScale")),1),s(u,{content:e.$t("seedream.description.guidanceScale"),class:"info"},null,8,["content"])])]),l("div",Nt,[s(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=i=>e.value=i),min:1,max:10,step:.1,precision:1,size:"default","controls-position":"right",class:"counter"},null,8,["modelValue"])])])):v("",!0)}const Kt=S(Ft,[["render",Wt],["__scopeId","data-v-7386f064"]]),Zt=k({name:"SeedreamWatermarkSwitch",components:{ElSwitch:ye,InfoIcon:A},computed:{value:{get(){const e=this.$store.state.seedream?.config?.watermark;return e===void 0?me:!!e},set(e){this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,watermark:e})}}}}),Xt={class:"field"},Ht={class:"label"},Jt={class:"box"},Qt={class:"title font-bold"},Yt={class:"value"};function es(e,t,d,o,m,p){const u=n("info-icon"),f=n("el-switch");return a(),c("div",Xt,[l("div",Ht,[l("div",Jt,[l("h2",Qt,r(e.$t("seedream.name.watermark")),1),s(u,{content:e.$t("seedream.description.watermark"),class:"info"},null,8,["content"])])]),l("div",Yt,[s(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=i=>e.value=i)},null,8,["modelValue"])])])}const ts=S(Zt,[["render",es],["__scopeId","data-v-9e2abf0f"]]),ss=k({name:"SeedreamConfigPanel",components:{ElButton:P,FontAwesomeIcon:q,PromptInput:je,Consumption:be,ImageInput:st,ModelSelector:ct,SizeSelector:gt,MaxImagesSelector:yt,OutputFormatSelector:Mt,SeedInput:Gt,GuidanceScaleInput:Kt,WatermarkSwitch:ts},emits:["generate"],computed:{config(){return this.$store.state.seedream?.config},consumption(){const e={...this.config||{}},t=Array.isArray(e?.image)&&e.image.length>0,d=e?.sequential_image_generation==="auto"?Math.max(1,Math.floor(e?.sequential_image_generation_options?.max_images||1)):1;return Ee({...e,action:t?"edit":"generate",model:Y(e?.model),count:d},this.service?.cost)},service(){return this.$store.state.seedream?.service}},methods:{onGenerate(){this.$emit("generate")}}}),os={class:"flex flex-col h-full"},as={class:"flex-1 overflow-y-auto p-5"},ns={class:"flex flex-col items-center justify-center px-5 pb-5"};function rs(e,t,d,o,m,p){const u=n("model-selector"),f=n("size-selector"),i=n("max-images-selector"),_=n("output-format-selector"),h=n("seed-input"),E=n("guidance-scale-input"),T=n("watermark-switch"),C=n("prompt-input"),V=n("image-input"),M=n("consumption"),te=n("font-awesome-icon"),se=n("el-button");return a(),c("div",os,[l("div",as,[s(u,{class:"mb-4"}),s(f,{class:"mb-4"}),s(i,{class:"mb-4"}),s(_,{class:"mb-4"}),s(h,{class:"mb-4"}),s(E,{class:"mb-4"}),s(T,{class:"mb-4"}),s(C,{class:"mb-4"}),s(V,{class:"mb-4"})]),l("div",ns,[s(M,{value:e.consumption,service:e.service},null,8,["value","service"]),s(se,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:$(()=>[s(te,{icon:"fa-solid fa-magic",class:"mr-2"}),g(" "+r(e.$t("seedream.button.generate")),1)]),_:1},8,["onClick"])])])}const ls=S(ss,[["render",rs]]),is=k({name:"SeedreamTaskPreview",components:{ElImage:Me,CopyToClipboard:Ae,FontAwesomeIcon:q,ElAlert:Te,ImageWrapper:Ve,ElButton:P,ElTooltip:ze,ImagePreview:ee},props:{modelValue:{type:Object,required:!0}},computed:{isEdit(){return Array.isArray(this.modelValue?.request?.image)&&(this.modelValue?.request?.image?.length||0)>0},images(){const e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{e.push(t)}),e}},methods:{shortModel(e){return Y(e)||e},onEdit(e){if(!e)return;console.debug("Edit image:",e);const t={...this.$store.state.seedream?.config||{}};t.image=[e],this.$store.commit("seedream/setConfig",t)}}}),cs={class:"preview"},ds={class:"left"},ms={class:"main"},us={class:"bot"},ps={class:"datetime"},fs={class:"info"},_s={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},gs={key:1,class:"prompt mt-2"},hs={key:0},$s={key:0,class:D({content:!0})},vs={class:"text-[var(--el-text-color-regular)] text-xs mb-0"},bs={key:1,class:D({content:!0,failed:!0})},Es={class:"flex justify-start items-center gap-4 w-full overflow-x-auto"},ks={class:D({operations:!0,"mt-2":!0,"mb-2":!0})},Ss={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ys={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ws={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Is={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},As={key:2,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Vs={key:3,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},zs={key:2,class:D({content:!0})},Ts={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ms={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Rs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ls={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ds={key:2,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Cs={key:3,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},qs={key:4,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Ps={key:3,class:D({content:!0})},Us={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Gs={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Fs(e,t,d,o,m,p){const u=n("el-image"),f=n("image-preview"),i=n("font-awesome-icon"),_=n("copy-to-clipboard"),h=n("el-alert"),E=n("image-wrapper"),T=n("el-button"),C=n("el-tooltip");return a(),c("div",cs,[l("div",ds,[s(u,{src:"https://cdn.acedata.cloud/9egrbn.png",class:"avatar"})]),l("div",ms,[l("div",us,[g(r(e.$t("seedream.name.seedreamBot"))+" ",1),l("span",ps,r(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),l("div",fs,[Array.isArray(e.modelValue?.request?.image)&&e.modelValue?.request?.image.length>0?(a(),c("div",_s,[(a(!0),c(y,null,I(e.modelValue?.request?.image,(V,M)=>(a(),b(f,{key:M,url:V,name:`image-${M+1}`,closable:!1},null,8,["url","name"]))),128))])):v("",!0),e.modelValue?.request?.prompt?(a(),c("p",gs,[g(r(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?v("",!0):(a(),c("span",hs," - ("+r(e.$t("seedream.status.pending"))+") ",1))])):v("",!0)]),e.modelValue?.response?e.modelValue?.response?.success===!0?(a(),c("div",bs,[l("div",Es,[(a(!0),c(y,null,I(e.images,(V,M)=>(a(),b(E,{key:M,src:V?.image_url,"raw-src":V?.image_url},null,8,["src","raw-src"]))),128))]),l("div",ks,[s(C,{class:"box-item",effect:"dark",content:e.$t("common.button.edit"),placement:"top-start"},{default:$(()=>[s(T,{type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=ae(V=>e.onEdit(e.images?.[0]?.image_url),["stop"]))},{default:$(()=>[g(r(e.$t("common.button.edit")),1)]),_:1})]),_:1},8,["content"])]),s(h,{closable:!1,class:"mt-2 success"},{default:$(()=>[e.modelValue?.request?.model?(a(),c("p",Ss,[s(i,{icon:"fa-solid fa-cube",class:"mr-1"}),g(" "+r(e.$t("seedream.name.model"))+": "+r(e.shortModel(e.modelValue?.request?.model)),1)])):v("",!0),e.modelValue?.request?.size?(a(),c("p",ys,[s(i,{icon:"fa-solid fa-image",class:"mr-1"}),g(" "+r(e.$t("seedream.name.size"))+": "+r(e.modelValue?.request?.size),1)])):v("",!0),l("p",ws,[s(i,{icon:"fa-solid fa-bolt",class:"mr-1"}),g(" "+r(e.$t("seedream.name.task"))+": "+r(e.isEdit?e.$t("seedream.name.edits"):e.$t("seedream.name.generate")),1)]),l("p",Is,[s(i,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+r(e.$t("seedream.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),s(_,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])]),e.modelValue?.elapsed?(a(),c("p",As,[s(i,{icon:"fa-solid fa-clock",class:"mr-1"}),g(" "+r(e.$t("seedream.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):v("",!0),e.modelValue?.response?.trace_id?(a(),c("p",Vs,[s(i,{icon:"fa-solid fa-hashtag",class:"mr-1"}),g(" "+r(e.$t("seedream.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),s(_,{content:e.modelValue?.response?.trace_id,class:"btn-copy inline-block"},null,8,["content"])])):v("",!0)]),_:1})])):e.modelValue?.response?.success===!1?(a(),c("div",zs,[s(h,{closable:!1,class:"failure"},{template:$(()=>[s(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),g(" "+r(e.$t("seedream.name.failure")),1)]),default:$(()=>[e.modelValue?.request?.model?(a(),c("p",Ts,[s(i,{icon:"fa-solid fa-cube",class:"mr-1"}),g(" "+r(e.$t("seedream.name.model"))+": "+r(e.shortModel(e.modelValue?.request?.model)),1)])):v("",!0),e.modelValue?.request?.size?(a(),c("p",Ms,[s(i,{icon:"fa-solid fa-image",class:"mr-1"}),g(" "+r(e.$t("seedream.name.size"))+": "+r(e.modelValue?.request?.size),1)])):v("",!0),l("p",Rs,[s(i,{icon:"fa-solid fa-bolt",class:"mr-1"}),g(" "+r(e.$t("seedream.name.task"))+": "+r(e.isEdit?e.$t("seedream.name.edits"):e.$t("seedream.name.generate")),1)]),l("p",Ls,[s(i,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+r(e.$t("seedream.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),s(_,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.response?.error?.message?(a(),c("p",Ds,[s(i,{icon:"fa-solid fa-circle-info",class:"mr-1"}),g(" "+r(e.$t("seedream.name.failureReason"))+": "+r(e.modelValue?.response?.error?.message)+" ",1),s(_,{content:e.modelValue?.response?.error?.message,class:"btn-copy"},null,8,["content"])])):v("",!0),e.modelValue?.elapsed?(a(),c("p",Cs,[s(i,{icon:"fa-solid fa-clock",class:"mr-1"}),g(" "+r(e.$t("seedream.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):v("",!0),e.modelValue?.response?.trace_id?(a(),c("p",qs,[s(i,{icon:"fa-solid fa-hashtag",class:"mr-1"}),g(" "+r(e.$t("seedream.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),s(_,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])):v("",!0)]),_:1})])):(a(),c("div",Ps,[s(h,{closable:!1,class:"info"},{template:$(()=>[s(i,{icon:"fa-solid fa-circle-info",class:"mr-1"}),g(" "+r(e.$t("seedream.name.status")),1)]),default:$(()=>[l("p",Us,[s(i,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+r(e.$t("seedream.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),s(_,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.response?.trace_id?(a(),c("p",Gs,[s(i,{icon:"fa-solid fa-hashtag",class:"mr-1"}),g(" "+r(e.$t("seedream.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),s(_,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])):v("",!0)]),_:1})])):(a(),c("div",$s,[s(h,{closable:!1,class:"info"},{template:$(()=>[s(i,{icon:"fa-regular fa-clock",class:"mr-1"}),g(" "+r(e.$t("seedream.status.pending")),1)]),default:$(()=>[l("p",vs,[s(i,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+r(e.$t("seedream.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),s(_,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])])]),_:1})]))])])}const Os=S(is,[["render",Fs],["__scopeId","data-v-0dfc6a09"]]),js=k({name:"SeedreamRecentPanel",components:{TaskPreview:Os,BotPlaceholder:Re,NoTasks:_e,ScrollList:he},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],computed:{tasks(){return{...this.$store.state.seedream?.tasks,items:this.$store.state.seedream?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Bs={key:0},xs={key:2,class:"w-full h-full flex items-center justify-center"};function Ns(e,t,d,o,m,p){const u=n("bot-placeholder"),f=n("task-preview"),i=n("scroll-list"),_=n("no-tasks");return a(),c(y,null,[e.tasks?.items===void 0?(a(),c("div",Bs,[s(u)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(a(),b(i,{key:1,ref:"scrollList",class:"tasks h-full w-full overflow-y-auto",loading:e.loading,onReachTop:t[0]||(t[0]=h=>e.$emit("reach-top"))},{default:$(()=>[(a(!0),c(y,null,I(e.tasks?.items,h=>(a(),b(f,{key:h.id,"model-value":h},null,8,["model-value"]))),128))]),_:1},8,["loading"])):v("",!0),e.tasks?.items?.length===0?(a(),c("div",xs,[s(_)])):v("",!0)],64)}const Ws=S(js,[["render",Ns]]),Ks=pe("seedream"),Zs=k({name:"SeedreamIndex",components:{ConfigPanel:ls,Layout:Ue,RecentPanel:Ws},inject:["initialized"],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.seedream?.status?.getApplications===X.Request},tasksLoading(){return this.$store.state.seedream?.status?.getTasks===X.Request},credential(){return this.$store.state.seedream?.credential},config(){return this.$store.state.seedream?.config},application(){return this.$store.state.seedream?.application},tasks(){return this.$store.state.seedream?.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await $e({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loading,setLoading:e=>this.loading=e,isBlocked:()=>this.tasksLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("seedream/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("seedream/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.tasksLoading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=20,createdAtMin:d,createdAtMax:o}=e||{};console.debug("limit",t,"createdAtMin",d,"createdAtMax",o),await this.$store.dispatch("seedream/getTasks",{limit:t,createdAtMin:d,createdAtMax:o})},async onGenerate(){const e={...this.config||{}};!(Array.isArray(e?.image)&&e.image.length>0)&&"image"in e&&delete e.image,e?.size||delete e.size;const d={...e,callback_url:Ks},o=this.credential?.token;if(!o){console.error("no token specified");return}z.info(this.$t("seedream.message.startingTask")),ue("seedream",Ie.generate(d,{token:o})).then(()=>{z.success(this.$t("seedream.message.startTaskSuccess"))}).catch(m=>{const p=m?.response?.data;p?.error?.code===we?z.error(this.$t("seedream.message.usedUp")):z.error(this.$t("seedream.message.startTaskFailed")+(p?.error?.message||""))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Xs(e,t,d,o,m,p){const u=n("config-panel"),f=n("recent-panel"),i=n("layout");return a(),b(i,null,{config:$(()=>[s(u,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:$(()=>[s(f,{ref:"recentPanel",loading:e.loading,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const No=S(Zs,[["render",Xs]]);export{No as default};
|