@acedatacloud/nexior 3.143.0 → 3.145.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-CtUQEVNK.js → Auth-Bcd_FQfE.js} +1 -1
- package/dist/assets/{BotPlaceholder-BPfrGl17.js → BotPlaceholder-CNmFsyHW.js} +1 -1
- package/dist/assets/{Callback-CUZz-_uL.js → Callback-CmuwXr0C.js} +1 -1
- package/dist/assets/{Console-CZyUJwFi.js → Console-Bhy8ZDT6.js} +1 -1
- package/dist/assets/{Consumption-ClgEQgDH.js → Consumption-B7VhIhqT.js} +1 -1
- package/dist/assets/{Conversation-BJLfspBm.js → Conversation-DyU_6WFd.js} +1 -1
- package/dist/assets/{CopyToClipboard-B-j3IeKI.js → CopyToClipboard-CjTKb5D7.js} +1 -1
- package/dist/assets/Detail-YjS_AC08.js +2 -0
- package/dist/assets/{EditArray-B_9d9BF5.js → EditArray-BVjFH5IE.js} +1 -1
- package/dist/assets/{Extra-FPsB7z1H.js → Extra-DOBJ2Do2.js} +1 -1
- package/dist/assets/{FilePreview-DnWckrxT.js → FilePreview-CAVXYqye.js} +1 -1
- package/dist/assets/{History-B0ogAEX0.js → History-D0tIrvRd.js} +1 -1
- package/dist/assets/{IconPark.vue_vue_type_script_setup_true_lang-BZE7qVtA.js → IconPark.vue_vue_type_script_setup_true_lang-DUqQ6FXu.js} +1 -1
- package/dist/assets/{ImagePreview-Dj1qrKsG.js → ImagePreview-HgasgWaO.js} +1 -1
- package/dist/assets/{ImageWrapper-CW4rFhRa.js → ImageWrapper-BPSX8LpN.js} +1 -1
- package/dist/assets/{Index-CXn6Z5SI.js → Index-3BO_Ri0o.js} +1 -1
- package/dist/assets/{Index-B353sbqU.js → Index-4-jzKJtu.js} +1 -1
- package/dist/assets/{Index-C_jBhDqQ.js → Index-BRbncyTo.js} +1 -1
- package/dist/assets/{Index-CKQ20PRK.js → Index-Be-d-KvB.js} +1 -1
- package/dist/assets/{Index-CSkumcf5.js → Index-Bmk5NkxW.js} +1 -1
- package/dist/assets/{Index-pd-FlLOH.js → Index-BsHL_Wwo.js} +1 -1
- package/dist/assets/{Index-Bpx7haqT.js → Index-C0pH2iDJ.js} +1 -1
- package/dist/assets/{Index-CiBO7-CL.js → Index-C4YIXXL8.js} +1 -1
- package/dist/assets/{Index-BRZNJRcF.js → Index-C8Fua3cf.js} +1 -1
- package/dist/assets/{Index-CbRlUGpE.js → Index-CAKKBf2L.js} +1 -1
- package/dist/assets/{Index-CNGIO1-q.js → Index-CiArp3LH.js} +1 -1
- package/dist/assets/{Index-BXflygvQ.js → Index-CtV2rxnj.js} +1 -1
- package/dist/assets/{Index-d-dEUMMS.js → Index-D66ZjpcH.js} +1 -1
- package/dist/assets/{Index-CG-k5P0E.js → Index-D9NF36FM.js} +1 -1
- package/dist/assets/{Index-BHxzob5z.js → Index-DL3naVUV.js} +1 -1
- package/dist/assets/{Index-BFxmvZkU.js → Index-DQu_LZVY.js} +1 -1
- package/dist/assets/{Index-DQWQvmzR.js → Index-DX3bRVLE.js} +1 -1
- package/dist/assets/{Index-CXG8sBCz.js → Index-D_LGWeCn.js} +1 -1
- package/dist/assets/{Index-BMybNjHW.js → Index-DdBx76zI.js} +1 -1
- package/dist/assets/{Index-5KHWi7Dq.js → Index-Dz84pOy3.js} +1 -1
- package/dist/assets/{Index-Dykr7MYF.js → Index-FMKvTAYK.js} +1 -1
- package/dist/assets/{Index-DyeXiZOC.js → Index-mKc-vZ9i.js} +1 -1
- package/dist/assets/{Index-_KEm4PEs.js → Index-p1DDpd9d.js} +1 -1
- package/dist/assets/{Index-DZGZybb4.js → Index-yc1GcKQL.js} +1 -1
- package/dist/assets/{Invitees-CKE3swBs.js → Invitees-DfmmDVbX.js} +1 -1
- package/dist/assets/{List-LJIK4Wu3.js → List-B13CxvEg.js} +1 -1
- package/dist/assets/{List-Bs9Dt7II.js → List-CK9iLvwi.js} +1 -1
- package/dist/assets/{List-HEowMEan.js → List-DaU-ifIi.js} +1 -1
- package/dist/assets/Main-B_at2DGq.js +1 -0
- package/dist/assets/Navigator-BBSWFMcD.js +1 -0
- package/dist/assets/{NoTasks-CUTKaxqT.js → NoTasks-lh6VlwMM.js} +1 -1
- package/dist/assets/{NotFound-D19HSsaM.js → NotFound-D1T--4tX.js} +1 -1
- package/dist/assets/{OAuthCallback-Bjehu6_9.js → OAuthCallback-BnXAyr6Q.js} +1 -1
- package/dist/assets/{Pagination-D7oYcJPo.js → Pagination-BycLvgLk.js} +1 -1
- package/dist/assets/{Status-Dott-sZ5.js → Status-CxIwJOfe.js} +1 -1
- package/dist/assets/{Subscribe-Cuiwkot5.js → Subscribe-BNewndJw.js} +1 -1
- package/dist/assets/{VideoPlayer-D9YyWMtB.js → VideoPlayer-3Re_CJKG.js} +1 -1
- package/dist/assets/{_Uint8Array-DfhsEbA6.js → _Uint8Array-zPfACQFm.js} +1 -1
- package/dist/assets/{_baseClone-0JASqonl.js → _baseClone-BH5bAI4w.js} +1 -1
- package/dist/assets/{_baseIteratee-D64njDFX.js → _baseIteratee-BDYveGWO.js} +1 -1
- package/dist/assets/{_initCloneObject-CT9aktWN.js → _initCloneObject-DNcVRVtY.js} +1 -1
- package/dist/assets/{add-DzyDrpy_.js → add-D1h7uORx.js} +1 -1
- package/dist/assets/{all-wallets-C61SK3TG.js → all-wallets-Z5LRMPMB.js} +1 -1
- package/dist/assets/{app-store--3y1_rqD.js → app-store-Dz64ZmnH.js} +1 -1
- package/dist/assets/{apple-DCMexxNe.js → apple-Ck9oGqte.js} +1 -1
- package/dist/assets/{arrow-bottom-BLWgwgR_.js → arrow-bottom-BOVk32t7.js} +1 -1
- package/dist/assets/{arrow-bottom-circle-CO8dfn1r.js → arrow-bottom-circle-BvSV7DF3.js} +1 -1
- package/dist/assets/{arrow-left-BtBEwMpk.js → arrow-left-DSOaPAIY.js} +1 -1
- package/dist/assets/{arrow-right-DE867PMf.js → arrow-right-Wnla9ZH8.js} +1 -1
- package/dist/assets/{arrow-top-D6ia32Do.js → arrow-top-Ckslb1Yk.js} +1 -1
- package/dist/assets/{avatar-DoH5qvQb.js → avatar-P7ipnSbq.js} +1 -1
- package/dist/assets/{bank-nHz1zcsF.js → bank-HS6lJ7gc.js} +1 -1
- package/dist/assets/{basic-BATfqZ4A.js → basic-Cd0LmFJh.js} +1 -1
- package/dist/assets/{browser-BHdX4mfm.js → browser-Db3rziUx.js} +1 -1
- package/dist/assets/{byokCredential-BO7-v5YN.js → byokCredential-xNsUWNi0.js} +1 -1
- package/dist/assets/{card-BnzclBSU.js → card-2hqPeux7.js} +1 -1
- package/dist/assets/{castArray-Den3_6LQ.js → castArray-B6RNe9d9.js} +1 -1
- package/dist/assets/{chat-DZJrcSit.js → chat-DO0KTVPz.js} +1 -1
- package/dist/assets/{checkmark-CQSvr6ZZ.js → checkmark-DAahMVGY.js} +1 -1
- package/dist/assets/{checkmark-bold-6RskSnLi.js → checkmark-bold-CeyAr_bc.js} +1 -1
- package/dist/assets/{chevron-bottom-CPCo3DY0.js → chevron-bottom-DVGaXtMP.js} +1 -1
- package/dist/assets/{chevron-left-BirjUKvX.js → chevron-left-D1wITPBk.js} +1 -1
- package/dist/assets/{chevron-right-CdU0xk79.js → chevron-right-DyC7moVa.js} +1 -1
- package/dist/assets/{chevron-top-D1oFtKMM.js → chevron-top-CioYJ6M3.js} +1 -1
- package/dist/assets/{chrome-store-6CbzVUB-.js → chrome-store-cnpRaoZA.js} +1 -1
- package/dist/assets/{clock-DzwUWAMI.js → clock-D6t9szSk.js} +1 -1
- package/dist/assets/{close-CwhwrwkW.js → close-BU9PmWj3.js} +1 -1
- package/dist/assets/{coinPlaceholder-H7CxrcQG.js → coinPlaceholder-BwdUbSxr.js} +1 -1
- package/dist/assets/{compass-zOb3c-um.js → compass-BJOJEWK6.js} +1 -1
- package/dist/assets/{copy-CVogK2-j.js → copy-DzYw09B-.js} +1 -1
- package/dist/assets/{cursor-DoG7MjKg.js → cursor-Dj1ZIAbo.js} +1 -1
- package/dist/assets/{cursor-transparent-BUzXtRXv.js → cursor-transparent-BI7VBP85.js} +1 -1
- package/dist/assets/{debounce-qySOHK2f.js → debounce-Bgvad3gW.js} +1 -1
- package/dist/assets/{desktop-BpN-Z-Th.js → desktop-BOaQ4I_y.js} +1 -1
- package/dist/assets/{disconnect-DjVB9pUw.js → disconnect-CRNAmv6J.js} +1 -1
- package/dist/assets/{discord-DAa-xF6t.js → discord-DTFTGH7i.js} +1 -1
- package/dist/assets/{distribution-CFTKR_7N.js → distribution-GXAY8wHO.js} +1 -1
- package/dist/assets/{dropdown-QJOjX_D8.js → dropdown-Ds_Yfcr3.js} +1 -1
- package/dist/assets/{etherscan-pBkuDjyY.js → etherscan-Ddy2Obh7.js} +1 -1
- package/dist/assets/{exclamation-triangle-Cqg9_-TP.js → exclamation-triangle-De8ni2zP.js} +1 -1
- package/dist/assets/{extension-BoRHvse0.js → extension-CVSJR3Zj.js} +1 -1
- package/dist/assets/{external-link-Co8JaB3x.js → external-link-DT63tzov.js} +1 -1
- package/dist/assets/{facebook-DgDQRfgR.js → facebook-COU5DrQ7.js} +1 -1
- package/dist/assets/{farcaster-D69aKskv.js → farcaster-BABEFvcE.js} +1 -1
- package/dist/assets/{filters-D2dMSL_o.js → filters-CdsNc8CC.js} +1 -1
- package/dist/assets/{flux-BwAC3S5-.js → flux-CbDtTQYV.js} +1 -1
- package/dist/assets/{github-D7whLcWp.js → github-DrdaLyZW.js} +1 -1
- package/dist/assets/{google-DmFMO6N5.js → google-CD47CCku.js} +1 -1
- package/dist/assets/{hailuo-B8zs9Ovu.js → hailuo-DBXlAmSU.js} +1 -1
- package/dist/assets/{headshots-DanVR0aX.js → headshots-ZFMLaFUS.js} +1 -1
- package/dist/assets/{help-circle-DxoMXqOF.js → help-circle-fftaPb3x.js} +1 -1
- package/dist/assets/{id-DKliwwSL.js → id-DTcbLrGx.js} +1 -1
- package/dist/assets/{image-B_J5ddmn.js → image-BHht08tt.js} +1 -1
- package/dist/assets/{index-DcJdQSfw.js → index--ITSBEmY.js} +1 -1
- package/dist/assets/{index-B1kni6-B.js → index-1UVG53lr.js} +1 -1
- package/dist/assets/{index-CTjlNIkO.js → index-2f4k1cBC.js} +1 -1
- package/dist/assets/{index-CpSvxFK6.js → index-AS5LKeZ1.js} +1 -1
- package/dist/assets/{index-DMZjaLyD.js → index-B5KTk9zq.js} +1 -1
- package/dist/assets/{index-BlzSfoGW.js → index-BCKGKuDt.js} +1 -1
- package/dist/assets/{index-BjJZ22Y3.js → index-BN8XbIGe.js} +1 -1
- package/dist/assets/{index-DxKv9BIl.js → index-BTzdyisK.js} +1 -1
- package/dist/assets/{index-Bo_JlvjV.js → index-BcFKKIUX.js} +1 -1
- package/dist/assets/{index-CkrK0Qe5.js → index-BcnDqXUY.js} +1 -1
- package/dist/assets/{index-BqyUpApV.js → index-BeVJ1d8k.js} +1 -1
- package/dist/assets/{index-IuzkX0PB.js → index-BeZoz16H.js} +1 -1
- package/dist/assets/{index-DR3AmhzB.js → index-BhYvS2lE.js} +1 -1
- package/dist/assets/{index-D1bOBFvl.js → index-Bhxdizeo.js} +1 -1
- package/dist/assets/{index-Vod2n73X.js → index-BlySwQwE.js} +1 -1
- package/dist/assets/{index-vIjQu9iy.js → index-BqGdcWXt.js} +1 -1
- package/dist/assets/{index-NUkv1M5_.js → index-BqgMgNDY.js} +1 -1
- package/dist/assets/{index-Dt3X1kZ4.js → index-BxSUUB-x.js} +1 -1
- package/dist/assets/{index-CTDK5ATG.js → index-ByMG6mdc.js} +1 -1
- package/dist/assets/{index-BiFnm5Fz.js → index-C55V3Vh7.js} +1 -1
- package/dist/assets/{index-C-wF25mS.js → index-CMTSX3ru.js} +1 -1
- package/dist/assets/{index-CL9QQab3.js → index-CQXDIlVP.js} +5 -5
- package/dist/assets/{index-BTIqLd-9.js → index-CX6qI1Y1.js} +1 -1
- package/dist/assets/{index-CHxnPGsh.js → index-CcOD60CZ.js} +1 -1
- package/dist/assets/{index-B2Oy_3FT.js → index-CiLK9hZH.js} +1 -1
- package/dist/assets/{index-ApUzrZjA.js → index-CqVRSwiW.js} +1 -1
- package/dist/assets/{index-Bs5Q_18V.js → index-CshfjmlG.js} +3 -3
- package/dist/assets/{index-BPR2ZBL3.js → index-CwjV6n_U.js} +1 -1
- package/dist/assets/{index-ByRmkGAV.js → index-CwrZ8xOX.js} +1 -1
- package/dist/assets/{index-C_B9_8m5.js → index-CwsedSmm.js} +1 -1
- package/dist/assets/{index-Cl0U4sgn.js → index-CxX6Br5p.js} +1 -1
- package/dist/assets/{index-DZIBVLbD.css → index-CyoihLmI.css} +1 -1
- package/dist/assets/{index-C7C4YZtO.js → index-D2IhGC0l.js} +1 -1
- package/dist/assets/{index-DoXdKcuT.js → index-D4zPprsM.js} +1 -1
- package/dist/assets/{index-CXhhCjmF.js → index-D6bxFUBl.js} +1 -1
- package/dist/assets/{index-BY3ZI2OY.js → index-D9YigYRM.js} +1 -1
- package/dist/assets/{index-0ObN0Dig.js → index-DBMKRB09.js} +1 -1
- package/dist/assets/{index-DuNzbqbv.js → index-DEoB1b-Q.js} +2 -2
- package/dist/assets/{index-DV28EGIy.js → index-DG0_iu85.js} +1 -1
- package/dist/assets/{index-XaPqTDhv.js → index-DHmtS4Ao.js} +1 -1
- package/dist/assets/{index-Cmh-m9tQ.js → index-DNBp4uLy.js} +1 -1
- package/dist/assets/{index-DxpQaVyM.js → index-DPFomByA.js} +1 -1
- package/dist/assets/{index-BW2wbkhi.js → index-DYA2f3uk.js} +1 -1
- package/dist/assets/{index-CkIeLqJ4.js → index-D_tYpdWX.js} +1 -1
- package/dist/assets/{index-Cefy4vQg.js → index-Da-zbbE5.js} +1 -1
- package/dist/assets/{index-CH1zG0ot.js → index-DarN4AvK.js} +1 -1
- package/dist/assets/{index-qn-HlcRf.js → index-Dh4v3_J-.js} +1 -1
- package/dist/assets/{index-kGAGAJMD.js → index-DhSkah7J.js} +1 -1
- package/dist/assets/{index-B1q4_wjP.js → index-Dkfe3LOt.js} +1 -1
- package/dist/assets/{index-Dhu22YaW.js → index-Dr7U401z.js} +1 -1
- package/dist/assets/{index-CJo-6wRX.js → index-HVpXn9hz.js} +1 -1
- package/dist/assets/{index-Cyf8EOi-.js → index-R1yPGE-K.js} +14 -14
- package/dist/assets/{index-D6eGd2z6.js → index-TJe5wIf-.js} +1 -1
- package/dist/assets/{index-BowVIJh5.js → index-TLFtrkXP.js} +1 -1
- package/dist/assets/{index-C9wQOJYW.js → index-Tvcl48Dl.js} +1 -1
- package/dist/assets/{index-DyXkWXGx.js → index-WNpebUaQ.js} +1 -1
- package/dist/assets/{index-BVx89d8R.js → index-WWnbhW6C.js} +1 -1
- package/dist/assets/{index-De59Ka4m.js → index-ann4v9Y_.js} +1 -1
- package/dist/assets/{index-Hg-ElA3u.js → index-igFi8o3V.js} +1 -1
- package/dist/assets/{index-BWyQEIEc.js → index-q8T9ydUq.js} +1 -1
- package/dist/assets/{index-DdEU08KU.js → index-v6GVmx9u.js} +1 -1
- package/dist/assets/{index.browser.esm-D-iED0Cc.js → index.browser.esm-DVf7ZwVe.js} +1 -1
- package/dist/assets/{index.es-TsWsNkRg.js → index.es-Dj9Wy0z7.js} +1 -1
- package/dist/assets/{info-CL_whZjn.js → info-CfvPUYtJ.js} +1 -1
- package/dist/assets/{info-circle-zTGxSNMv.js → info-circle-D42NurP4.js} +1 -1
- package/dist/assets/{isEqual-Dcf8wohg.js → isEqual-DPhKVN6J.js} +1 -1
- package/dist/assets/{isPlainObject-DoEvj-JF.js → isPlainObject-CKjDbn9w.js} +1 -1
- package/dist/assets/{kling-CHRtfU1h.js → kling-Bk4q6wSq.js} +1 -1
- package/dist/assets/{lightbulb-Bs5mJUnu.js → lightbulb-C2B6zSDV.js} +1 -1
- package/dist/assets/{luma-DnaLw93c.js → luma-CSNiAjhT.js} +1 -1
- package/dist/assets/{mail-0QMW3eXE.js → mail-BeP83PJj.js} +1 -1
- package/dist/assets/{midjourney-CS8ptNIO.js → midjourney-Br4pe5fD.js} +1 -1
- package/dist/assets/{mobile-DuSCK1a5.js → mobile-DPPix6Fz.js} +1 -1
- package/dist/assets/{more-DG-UiUYg.js → more-C1ai7jhI.js} +1 -1
- package/dist/assets/{nanobanana-CxQYAZGf.js → nanobanana-RIPuwiyQ.js} +1 -1
- package/dist/assets/{network-placeholder-DVZvCh2s.js → network-placeholder-_ouFW_hY.js} +1 -1
- package/dist/assets/{nftPlaceholder-lPnm7SOn.js → nftPlaceholder-D9MBythW.js} +1 -1
- package/dist/assets/{off-C8urHZqx.js → off-D3ns7S7B.js} +1 -1
- package/dist/assets/{openaiimage-B-V3xEPL.js → openaiimage-DSUNoC5s.js} +1 -1
- package/dist/assets/{order-Bmp_yaG1.js → order-CmQ7fVcr.js} +1 -1
- package/dist/assets/{pagination-Kf9WeXkv.js → pagination-Dk6EMJPI.js} +1 -1
- package/dist/assets/{pika-BiKq2nSB.js → pika-CQ7oBphS.js} +1 -1
- package/dist/assets/{pixverse-C4gMbePC.js → pixverse-CRcPaa8n.js} +1 -1
- package/dist/assets/{play-store-XGMJl_Pn.js → play-store-CICqToR5.js} +1 -1
- package/dist/assets/{plus-BqgdwTLw.js → plus-54zgwgij.js} +1 -1
- package/dist/assets/{price-CnHV1sgg.js → price-D01Whf9j.js} +1 -1
- package/dist/assets/{producer-DBQx_C86.js → producer-CsQ-ud8v.js} +1 -1
- package/dist/assets/{qr-code-EM8QiYyD.js → qr-code-BHnpZu_y.js} +1 -1
- package/dist/assets/{qrart-Dw2YrUVF.js → qrart-VZeCoPvn.js} +1 -1
- package/dist/assets/{recycle-horizontal-DNZ_fKjj.js → recycle-horizontal-OIcA7hF6.js} +1 -1
- package/dist/assets/{refresh-C6pr3cc6.js → refresh-tUuc5PeI.js} +1 -1
- package/dist/assets/{reown-logo-BczI0j4a.js → reown-logo-DzRJ7x9D.js} +1 -1
- package/dist/assets/{search-i-aR-LkD.js → search-CpBvhQPk.js} +1 -1
- package/dist/assets/{secp256k1-BH-Xrsbp.js → secp256k1-C2YQD_YY.js} +1 -1
- package/dist/assets/{secp256k1-64NdIXXC.js → secp256k1-CEzU3tRZ.js} +1 -1
- package/dist/assets/{seedance-D-UOraSv.js → seedance-CAhN-KHG.js} +1 -1
- package/dist/assets/{seedream--P09hKyP.js → seedream-DX8rHHuo.js} +1 -1
- package/dist/assets/{send-BKqbXKgW.js → send-DVj6gTrO.js} +1 -1
- package/dist/assets/{service-BSfAGiOY.js → service-CIIfoqM2.js} +1 -1
- package/dist/assets/{solana-wallets-OgrTm8Iq.js → solana-wallets-C5g_56pa.js} +2 -2
- package/dist/assets/{solana-wallets-vue-Ca9b6qlb.js → solana-wallets-vue-C7MyUMUN.js} +1 -1
- package/dist/assets/{sora-BC_C_K6y.js → sora-v5G77ss9.js} +1 -1
- package/dist/assets/{suno-DJNe_FQB.js → suno-ijFClzIj.js} +1 -1
- package/dist/assets/{swapHorizontal-67e30EgZ.js → swapHorizontal-D_PgXCB7.js} +1 -1
- package/dist/assets/{swapHorizontalBold-DeASCDI4.js → swapHorizontalBold-iIhEvuBq.js} +1 -1
- package/dist/assets/{swapHorizontalMedium-xCn2o46w.js → swapHorizontalMedium-DwHpsIIL.js} +1 -1
- package/dist/assets/{swapHorizontalRoundedBold-BbahDpkx.js → swapHorizontalRoundedBold-B1z4aB-3.js} +1 -1
- package/dist/assets/{swapVertical-Cgc3RF8L.js → swapVertical-Cu_M3d02.js} +1 -1
- package/dist/assets/{telegram-8VQcI4of.js → telegram-BRMsZm47.js} +1 -1
- package/dist/assets/{three-dots-B2Z18kUd.js → three-dots-BvEuVwA7.js} +1 -1
- package/dist/assets/{twitch-DjoQouxh.js → twitch-IbVvPFjH.js} +1 -1
- package/dist/assets/{twitterIcon-hMeBY06b.js → twitterIcon-BaWhktKI.js} +1 -1
- package/dist/assets/{typescript-C1XBDfAK.js → typescript-DAmrEi8b.js} +1 -1
- package/dist/assets/{use-form-item-RRBZ2FOX.js → use-form-item-_IfxE0T4.js} +1 -1
- package/dist/assets/validator-C-MfJUQn.js +1 -0
- package/dist/assets/{veo-CtD3A3j-.js → veo-CTmcZFTp.js} +1 -1
- package/dist/assets/{verify-filled-CY_YWmoQ.js → verify-filled-PxnEAkhc.js} +1 -1
- package/dist/assets/{verify-ghGtyftd.js → verify-q9dhh2mE.js} +1 -1
- package/dist/assets/{w3m-modal-DejLuZa8.js → w3m-modal-hfHm2Uri.js} +1 -1
- package/dist/assets/{wallet-BWHSp4R8.js → wallet-CwViWSiP.js} +1 -1
- package/dist/assets/{wallet-placeholder-rUJuUg4d.js → wallet-placeholder-B2O8wQva.js} +1 -1
- package/dist/assets/{walletconnect-JjlChPhX.js → walletconnect-BCwFGBEo.js} +1 -1
- package/dist/assets/{wan-CaJsMNtt.js → wan-BSSe6hD9.js} +1 -1
- package/dist/assets/{warning-circle-BJhp1Zgv.js → warning-circle-Dp2zXZHT.js} +1 -1
- package/dist/assets/{web-BKG_umNP.js → web-C5_xJ9ki.js} +1 -1
- package/dist/assets/{web-CfaNoXz2.js → web-gzaBMVYU.js} +1 -1
- package/dist/assets/{x-CRob5JDu.js → x-Cl404UP6.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/Detail-slLvnO9U.js +0 -2
- package/dist/assets/Main-BMztfwzI.js +0 -1
- package/dist/assets/Navigator-CQgH5RDk.js +0 -1
- package/dist/assets/validator-DZr7xmmp.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as E}from"./index.es-TsWsNkRg.js";import{E as L}from"./index-CkIeLqJ4.js";import{E as me}from"./index-XaPqTDhv.js";import{d as b,H as m,E as i,z as j,C as n,y as h,D as o,q as l,F as r,x as V,O as T,N as I,Q as R,J as k,R as ye,I as w,M as we}from"./vendor-vue-NSDaktjZ.js";import{E as y,b7 as A,a0 as Ce,F as Ve,cd as te,aw as oe}from"./index-Cyf8EOi-.js";import{b as Se,c as ne,d as F,e as N,f as Te,g as Ie,h as Ee}from"./kling-CtoPhhA9.js";import{E as P,a as D}from"./index-DxpQaVyM.js";import{E as q}from"./index-C9wQOJYW.js";import{E as C}from"./index-DdEU08KU.js";import{I as S,S as Le,l as Me}from"./pagination-Kf9WeXkv.js";import{E as H}from"./index-qn-HlcRf.js";import{p as W}from"./pasteUploadMixin-BurWbGNQ.js";import{I as G}from"./ImagePreview-Dj1qrKsG.js";import{E as J}from"./index-D6eGd2z6.js";import{E as K}from"./index-CTjlNIkO.js";import{C as pe}from"./Consumption-ClgEQgDH.js";import{E as ue}from"./index-BowVIJh5.js";import{E as ge}from"./index-NUkv1M5_.js";import{E as Q}from"./index-Bo_JlvjV.js";import{a as fe}from"./price-CnHV1sgg.js";import{F as Ue}from"./FilePreview-DnWckrxT.js";import{E as Re,a as Ae}from"./index-DoXdKcuT.js";import{E as Pe,a as De}from"./index-CkrK0Qe5.js";import{b as se}from"./errorCode-Cqj9Td_Z.js";import{k as ie}from"./kling-CHRtfU1h.js";import{C as Ge}from"./CopyToClipboard-B-j3IeKI.js";import{V as Ke}from"./VideoPlayer-D9YyWMtB.js";import{E as Oe}from"./index-BPR2ZBL3.js";import{E as je}from"./index-BVx89d8R.js";import{B as Ne}from"./BotPlaceholder-BPfrGl17.js";import{N as Be}from"./NoTasks-CUTKaxqT.js";import"./use-form-item-RRBZ2FOX.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./index-BWyQEIEc.js";import"./typescript-C1XBDfAK.js";import"./index-DxKv9BIl.js";import"./strings-beZM2Y-f.js";import"./isEqual-Dcf8wohg.js";import"./_Uint8Array-DfhsEbA6.js";import"./castArray-Den3_6LQ.js";import"./debounce-qySOHK2f.js";import"./_baseIteratee-D64njDFX.js";import"./index-DMZjaLyD.js";import"./validator-DZr7xmmp.js";import"./index-kGAGAJMD.js";import"./_baseClone-0JASqonl.js";import"./_initCloneObject-CT9aktWN.js";import"./index-Cu41y2Fl.js";import"./index-B2Oy_3FT.js";import"./isPlainObject-DoEvj-JF.js";import"./vue-plyr-BO2nlN4c.js";import"./index-Cl0U4sgn.js";const ze=b({name:"LayoutKling",components:{ElDrawer:me,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 c=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),m("div",Fe,[i("div",qe,[j(e.$slots,"config",{},void 0,!0)]),i("div",He,[j(e.$slots,"result",{},void 0,!0)]),n(p,{circle:"",class:"menu",onClick:t[0]||(t[0]=d=>e.drawer=!0)},{default:h(()=>[n(c,{icon:"fa-solid fa-magic"})]),_:1}),n(f,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=d=>e.drawer=d),direction:"ltr","with-header":!1,size:"350px"},{default:h(()=>[j(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Je=y(ze,[["render",We],["__scopeId","data-v-8fa7523c"]]),Qe={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function he(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 Y(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 $=he(s,a,u),c=[];return e.end_image_url&&!$.endImage&&c.push({field:"end_image_url",i18nLabel:"kling.name.endImage"}),e.generate_audio&&!$.audio&&c.push({field:"generate_audio",i18nLabel:"kling.name.generateAudio"}),e.camera_control?.type&&!$.motionControl&&c.push({field:"camera_control",i18nLabel:"kling.name.cameraControl"}),c}function X(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:D,ElOption:P},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{revertKey:0,options:[{value:"kling-v3",label:"v3"},{value:"kling-v3-omni",label:"v3-Omni"},{value:"kling-v2-6",label:"v2.6"},{value:"kling-v2-5-turbo",label:"v2.5-Turbo"},{value:"kling-v2-1-master",label:"v2.1-Master"},{value:"kling-v2-master",label:"v2-Master"},{value:"kling-v1-6",label:"v1.6"},{value:"kling-v1",label:"v1"},{value:"kling-video-o1",label:"Video-o1"}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(Se)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Y(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=X({...t,model:e},s);this.$store.commit("kling/setConfig",u),C.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 c=o("el-option"),p=o("el-select");return l(),m("div",Xe,[i("h2",Ze,r(e.$t("pika.name.model")),1),(l(),V(p,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("pika.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),m(T,null,I(e.options,f=>(l(),V(c,{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:D,ElOption:P,InfoIcon:S},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=Y(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=X({...t,mode:e},s);this.$store.commit("kling/setConfig",u),C.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 c=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(c,{content:e.$t("kling.description.mode"),class:"info-icon"},null,8,["content"])]),(l(),V(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(T,null,I(e.options,d=>(l(),V(p,{key:d.value,label:d.label,value:d.value,disabled:d.disabled},{default:h(()=>[i("span",{class:R({"opt-disabled":d.disabled})},r(d.label),3),d.disabled&&d.disabledReason?(l(),m("span",it,r(d.disabledReason),1)):k("",!0)]),_:2},1032,["label","value","disabled"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const at=y(tt,[["render",lt],["__scopeId","data-v-9a8fa3c5"]]),le=[3,5,8,10,12,15],ae=[5,10],rt=b({name:"DurationSelector",components:{ElSlider:H,InfoIcon:S},props:{modelValue:{type:Number,default:void 0}},emits:["update:modelValue"],data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},isV3Model(){return F.includes(this.selectedModel)},sliderMin(){return this.isV3Model?3:5},sliderMax(){return this.isV3Model?15:10},sliderStep(){return this.isV3Model?1:5},marks(){const e=this.isV3Model?le:ae,t={};for(const s of e)t[s]=`${s}s`;return t},value(){return this.$store.state.kling?.config?.duration??N},sliderValue(){const e=this.value;return e<this.sliderMin?this.sliderMin:e>this.sliderMax?this.sliderMax:e}},watch:{isV3Model(e){(this.isV3Model?le:ae).includes(this.value)||this.applyDuration(N)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(N)},methods:{async onChange(e){const t=Array.isArray(e)?e[0]:e,s=this.$store.state.kling?.config||{},a=Y(s,{duration:t});if(a.length===0){this.applyDuration(t);return}const u=a.map($=>this.$t($.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:u}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const $=X({...s,duration:t},a);this.$store.commit("kling/setConfig",$),C.success(this.$t("kling.message.featureRemovedNotice",{fields:u}))}catch{this.revertKey+=1}},applyDuration(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,duration:e})}}}),ct={class:"field"},dt={class:"header"},mt={class:"title font-bold"},pt={class:"value-display"};function ut(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-slider");return l(),m("div",ct,[i("div",dt,[i("h2",mt,r(e.$t("kling.name.duration")),1),n(c,{content:e.$t("kling.description.duration"),class:"info-icon ml-1"},null,8,["content"]),i("span",pt,r(e.value)+"s",1)]),(l(),V(p,{key:e.revertKey,"model-value":e.sliderValue,class:"slider",min:e.sliderMin,max:e.sliderMax,step:e.sliderStep,marks:e.marks,"show-tooltip":!1,onChange:e.onChange},null,8,["model-value","min","max","step","marks","onChange"]))])}const gt=y(rt,[["render",ut],["__scopeId","data-v-aa1a22a1"]]),ft=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=Te)}}),ht={class:"text-sm font-bold mb-2 block"},_t={class:"items"},$t=["onClick"],vt={class:"name"};function kt(e,t,s,a,u,$){return l(),m("div",null,[i("span",ht,r(e.$t("kling.name.ratio")),1),i("div",_t,[(l(!0),m(T,null,I(e.options,(c,p)=>(l(),m("div",{key:p,class:R({active:e.active===p,item:!0}),onClick:f=>e.value=c.value},[i("div",{class:R(["preview",c.label])},[i("div",{class:"rect",style:ye({width:c.width+"px",height:c.height+"px"})},null,4)],2),i("p",vt,r(c.label),1)],10,$t))),128))])])}const bt=y(ft,[["render",kt],["__scopeId","data-v-cdb14b2f"]]),yt=b({name:"StartImage",components:{ElUpload:K,ElButton:L,ElTooltip:J,InfoIcon:S,FontAwesomeIcon:E,ImagePreview:G},mixins:[W],emits:["change"],data(){return{fileList:[],uploadUrl:A()+"/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(){C.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){C.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()}}}),wt={class:"relative"},Ct={class:"flex justify-between"},Vt={class:"flex justify-start items-center"},St={class:"text-sm font-bold"};function Tt(e,t,s,a,u,$){const c=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),d=o("el-button"),v=o("el-tooltip"),g=o("el-upload");return l(),m("div",wt,[i("div",Ct,[i("div",Vt,[i("span",St,r(e.$t("kling.name.startImage")),1),n(c,{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(),V(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(v,{content:e.$t("kling.message.uploadReferencesExceed"),disabled:!e.reachedLimit,placement:"top"},{default:h(()=>[i("span",null,[n(d,{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 It=y(yt,[["render",Tt],["__scopeId","data-v-40832274"]]),Et=b({name:"EndImage",components:{ElUpload:K,ElButton:L,ElTooltip:J,ImagePreview:G,InfoIcon:S,FontAwesomeIcon:E},mixins:[W],data(){return{fileList:[],uploadUrl:A()+"/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 he(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},uploadDisabled(){return this.reachedLimit||!this.endImageSupported},uploadTooltip(){return this.endImageSupported?this.reachedLimit?this.$t("kling.message.uploadReferencesExceed"):"":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=[])}},mounted(){this.value||(this.value=void 0),this.onSetEndImageUrl()},methods:{onBeforeUpload(){return this.endImageSupported?!0:(C.warning(this.$t("kling.message.endImageNotSupported")),!1)},onExceed(){C.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){C.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()}}}),Lt={class:"relative"},Mt={class:"flex justify-between"},Ut={class:"flex justify-start items-center"},Rt={class:"text-sm font-bold"};function At(e,t,s,a,u,$){const c=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),d=o("el-button"),v=o("el-tooltip"),g=o("el-upload");return l(),m("div",Lt,[i("div",Mt,[i("div",Ut,[i("span",Rt,r(e.$t("kling.name.endImage")),1),n(c,{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(),V(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(v,{content:e.uploadTooltip,disabled:!e.uploadDisabled,placement:"top"},{default:h(()=>[i("span",null,[n(d,{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 Pt=y(Et,[["render",At],["__scopeId","data-v-6959ad44"]]),Dt=b({name:"CfgScaleSelector",components:{ElSlider:H,InfoIcon:S,ElInputNumber:ue},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)}}),Gt={class:"flex justify-between"},Kt={class:"flex justify-start items-center"},Ot={class:"text-sm font-bold"},jt={class:"flex justify-end items-center"},Nt={class:"w-full"};function Bt(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-input-number"),f=o("el-slider");return l(),m("div",null,[i("div",Gt,[i("div",Kt,[i("span",Ot,r(e.$t("kling.name.cfgScale")),1),n(c,{content:e.$t("kling.description.cfgScale")},null,8,["content"])]),i("div",jt,[n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),"controls-position":"right"},null,8,["modelValue"])])]),i("div",Nt,[n(f,{modelValue:e.value,"onUpdate:modelValue":t[1]||(t[1]=d=>e.value=d),min:0,max:1,step:.1},null,8,["modelValue"])])])}const zt=y(Dt,[["render",Bt]]),Ft=b({name:"GenerateAudioSelector",components:{ElSwitch:ge,InfoIcon:S},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??Ee:!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})}}}),qt={class:"relative"},Ht={class:"flex justify-between items-center"},Wt={class:"flex justify-start items-center"},Jt={class:"text-sm font-bold"};function Qt(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-switch");return l(),m("div",qt,[i("div",Ht,[i("div",Wt,[i("span",Jt,r(e.$t("kling.name.generateAudio")),1),n(c,{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 Yt=y(Ft,[["render",Qt]]),Xt=["horizontal","vertical","pan","tilt","roll","zoom"],Zt=b({name:"CameraControlSelector",components:{ElSelect:D,ElOption:P,ElSlider:H,ElInputNumber:ue,InfoIcon:S},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||""},disabled(){return this.selectedMode==="4k"},tooltipContent(){return this.disabled?this.$t("kling.description.cameraControlDisabled4k"):this.$t("kling.description.cameraControl")},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)}}}),xt={class:"field"},eo={class:"header"},to={class:"text-sm font-bold"},oo={key:0,class:"config-grid"},no={class:"cfg-row-head"},so={class:"cfg-name"};function io(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-option"),f=o("el-select"),d=o("el-input-number"),v=o("el-slider");return l(),m("div",xt,[i("div",eo,[i("span",to,r(e.$t("kling.name.cameraControl")),1),n(c,{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(T,null,I(e.typeOptions,g=>(l(),V(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",oo,[(l(!0),m(T,null,I(e.configKeys,g=>(l(),m("div",{key:g,class:"cfg-row"},[i("div",no,[i("span",so,r(e.$t(`kling.name.cc_${g}`)),1),n(d,{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(v,{"model-value":e.configValues[g]??0,min:-1,max:1,step:.1,onInput:_=>e.onSliderChange(g,_)},null,8,["model-value","onInput"])]))),128))])):k("",!0)])}const lo=y(Zt,[["render",io],["__scopeId","data-v-fb7b34d0"]]),_e=[{groupKey:"cameraMovements",chipKeys:["rotateAround","stationary","handheld","zoomOut","zoomIn","follow","panRight","tiltUp","tiltDown","orbit"]},{groupKey:"cameraSpeed",chipKeys:["speedSlow","speedMedium","speedFast"]},{groupKey:"shotType",chipKeys:["shotClose","shotMedium","shotLong","shotLowAngle","shotHighAngle","shotShallowDof","shotFront","shotProfile","shotCloseUp","shotDrone"]},{groupKey:"light",chipKeys:["lightSunlight","lightSoft","lightNeon","lightWarm","lightNature","lightCandle","lightCityNight"]},{groupKey:"frame",chipKeys:["frameRichDetails","frameSimpleBg"]},{groupKey:"atmosphere",chipKeys:["atmosphereMysterious","atmospherePeaceful","atmosphereHeartwarming","atmosphereVivid","atmosphereColorful"]}],B=", ";function ao(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 ro=b({name:"InspirationPills",components:{FontAwesomeIcon:E},computed:{prompt(){return this.$store.state.kling?.config?.prompt||""},allChipTexts(){return _e.flatMap(e=>e.chipKeys.map(t=>this.$t(`kling.inspiration.chip.${t}`)))},selected(){const e=this.prompt;if(!e)return[];const t=[];for(const s of this.allChipTexts){const 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})}}}),co={key:0,class:"pills",role:"list"},mo={class:"pill-text"},po=["aria-label","onClick"];function uo(e,t,s,a,u,$){const c=o("font-awesome-icon");return e.selected.length>0?(l(),m("div",co,[(l(!0),m(T,null,I(e.selected,p=>(l(),m("div",{key:p,class:"pill",role:"listitem"},[i("span",mo,r(p),1),i("button",{type:"button",class:"pill-remove","aria-label":e.$t("kling.inspiration.removeChip"),onClick:we(f=>e.onRemove(p),["stop"])},[n(c,{icon:"fa-solid fa-xmark"})],8,po)]))),128))])):k("",!0)}const go=y(ro,[["render",uo],["__scopeId","data-v-5fc4fa65"]]),fo="",ho=b({name:"PromptInput",components:{ElInput:Q,ElButton:L,FontAwesomeIcon:E,InfoIcon:S,InspirationPills:go},emits:["open-inspiration"],computed:{prompt:{get(){return this.$store.state.kling?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=fo)}}),_o={class:"field"},$o={class:"box"},vo={class:"title font-bold"},ko={class:"actions"};function bo(e,t,s,a,u,$){const c=o("font-awesome-icon"),p=o("el-button"),f=o("info-icon"),d=o("inspiration-pills"),v=o("el-input");return l(),m("div",_o,[i("div",$o,[i("h2",vo,r(e.$t("kling.name.prompt")),1),i("div",ko,[n(p,{text:"",size:"small",class:"inspiration-btn",onClick:t[0]||(t[0]=g=>e.$emit("open-inspiration"))},{default:h(()=>[n(c,{icon:"fa-regular fa-lightbulb",class:"mr-1"}),w(" "+r(e.$t("kling.inspiration.openButton")),1)]),_:1}),n(f,{content:e.$t("kling.description.prompt"),class:"info"},null,8,["content"])])]),n(d),n(v,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||(t[1]=g=>e.prompt=g),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const yo=y(ho,[["render",bo],["__scopeId","data-v-0a5c57b8"]]),wo="",Co=b({name:"NegativePromptInput",components:{ElInput:Q,InfoIcon:S},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=wo)}}),Vo={class:"field"},So={class:"box"},To={class:"title font-bold"};function Io(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-input");return l(),m("div",Vo,[i("div",So,[i("h2",To,r(e.$t("kling.name.negativePrompt")),1),n(c,{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 Eo=y(Co,[["render",Io],["__scopeId","data-v-de98cf01"]]),Lo=b({name:"InspirationDrawer",components:{ElDrawer:me,ElButton:L,FontAwesomeIcon:E},props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],data(){return{groups:_e,Close:Ce}},computed:{visible:{get(){return this.modelValue},set(e){this.$emit("update:modelValue",e)}},drawerSize(){return window.innerWidth<768?"100%":"380px"},prompt(){return this.$store.state.kling?.config?.prompt||""},allChipTexts(){return this.groups.flatMap(e=>e.chipKeys.map(t=>this.$t(`kling.inspiration.chip.${t}`)))},selectedCount(){return this.allChipTexts.filter(e=>this.isSelected(e)).length}},methods:{chipText(e){return this.$t(`kling.inspiration.chip.${e}`)},isSelected(e){return e?this.prompt.includes(e):!1},setPrompt(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:e})},onToggle(e){e&&(this.isSelected(e)?this.setPrompt(z(this.prompt,e)):this.setPrompt(ao(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)}}}),Mo={class:"drawer-content"},Uo={class:"drawer-header"},Ro={class:"title-row"},Ao={class:"title"},Po={class:"hint"},Do={key:0,class:"selected-bar"},Go={class:"selected-text"},Ko={class:"groups"},Oo={class:"group-title"},jo={class:"chip-grid"},No=["onClick"];function Bo(e,t,s,a,u,$){const c=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),V(f,{modelValue:e.visible,"onUpdate:modelValue":t[1]||(t[1]=d=>e.visible=d),direction:"rtl","with-header":!1,size:e.drawerSize,"custom-class":"kling-inspiration-drawer","destroy-on-close":!1},{default:h(()=>[i("div",Mo,[i("div",Uo,[i("div",Ro,[n(c,{icon:"fa-regular fa-lightbulb",class:"mr-2"}),i("span",Ao,r(e.$t("kling.inspiration.title")),1)]),n(p,{text:"",icon:e.Close,class:"close-btn",onClick:t[0]||(t[0]=d=>e.visible=!1)},null,8,["icon"])]),i("div",Po,r(e.$t("kling.inspiration.hint")),1),e.selectedCount>0?(l(),m("div",Do,[i("span",Go,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"])])):k("",!0),i("div",Ko,[(l(!0),m(T,null,I(e.groups,d=>(l(),m("div",{key:d.groupKey,class:"group"},[i("div",Oo,r(e.$t(`kling.inspiration.group.${d.groupKey}`)),1),i("div",jo,[(l(!0),m(T,null,I(d.chipKeys,v=>(l(),m("button",{key:v,type:"button",class:R({chip:!0,active:e.isSelected(e.chipText(v))}),onClick:g=>e.onToggle(e.chipText(v))},r(e.chipText(v)),11,No))),128))])]))),128))])])]),_:1},8,["modelValue","size"])}const zo=y(Lo,[["render",Bo],["__scopeId","data-v-7d457a69"]]),Fo={"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"},qo={std:"720p",pro:"1080p","4k":"4K"},Ho=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 Fo[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||""},modeLabel(){const e=this.config?.mode||"std";return qo[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),Wo={class:"summary-chip"},Jo=["title"],Qo=["title"],Yo=["title"],Xo=["title"],Zo=["title"];function xo(e,t,s,a,u,$){const c=o("font-awesome-icon");return l(),m("div",Wo,[i("span",{class:"part",title:e.$t("kling.name.model")},r(e.modelLabel),9,Jo),t[0]||(t[0]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.duration")},r(e.durationLabel),9,Qo),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,Yo),t[2]||(t[2]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.mode")},r(e.modeLabel),9,Xo),e.generateAudio?(l(),m("span",{key:0,class:"audio",title:e.$t("kling.name.generateAudio")},[n(c,{icon:"fa-solid fa-headphones"})],8,Zo)):k("",!0)])}const en=y(Ho,[["render",xo],["__scopeId","data-v-418a6733"]]),tn=b({name:"ConfigPanel",components:{ElButton:L,Consumption:pe,FontAwesomeIcon:E,PromptInput:yo,NegativePromptInput:Eo,ModelSelector:et,ModeSelector:at,DurationSelector:gt,RatioSelector:bt,StartImage:It,CfgScaleSelector:zt,GenerateAudioSelector:Yt,CameraControlSelector:lo,InspirationDrawer:zo,SummaryChip:en,EndImage:Pt},emits:["generate"],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},consumption(){return fe(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit("generate")}}}),on={class:"flex flex-col h-full"},nn={class:"flex-1 overflow-y-auto p-5"},sn={class:"flex flex-col items-center justify-center px-5 pb-5"};function ln(e,t,s,a,u,$){const c=o("prompt-input"),p=o("model-selector"),f=o("ratio-selector"),d=o("start-image"),v=o("end-image"),g=o("duration-selector"),_=o("mode-selector"),M=o("generate-audio-selector"),U=o("camera-control-selector"),O=o("cfg-scale-selector"),$e=o("negative-prompt-input"),ve=o("summary-chip"),ke=o("consumption"),Z=o("font-awesome-icon"),x=o("el-button"),be=o("inspiration-drawer");return l(),m("div",on,[i("div",nn,[n(c,{class:"mb-4",onOpenInspiration:t[0]||(t[0]=ee=>e.inspirationOpen=!0)}),n(p,{class:"mb-4"}),n(f,{class:"mb-4"}),n(d,{class:"mb-2"}),n(v,{class:"mb-2"}),n(g,{class:"mb-4"}),n(_,{class:"mb-4"}),n(M,{class:"mb-4"}),n(U,{class:"mb-4"}),n(O,{class:"mb-4"}),n($e,{class:"mb-4"})]),i("div",sn,[n(ve),n(ke,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(l(),V(x,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(Z,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.extend")),1)]),_:1},8,["onClick"])):(l(),V(x,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(Z,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.generate")),1)]),_:1},8,["onClick"]))]),n(be,{modelValue:e.inspirationOpen,"onUpdate:modelValue":t[1]||(t[1]=ee=>e.inspirationOpen=ee)},null,8,["modelValue"])])}const an=y(tn,[["render",ln]]),rn=b({name:"MotionImage",components:{ElUpload:K,ElButton:L,InfoIcon:S,FontAwesomeIcon:E,ImagePreview:G},mixins:[W],data(){return{fileList:[],uploadUrl:A()+"/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(){C.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){C.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()}}}),cn={class:"relative"},dn={class:"flex justify-between"},mn={class:"flex justify-start items-center"},pn={class:"text-sm font-bold"};function un(e,t,s,a,u,$){const c=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),d=o("el-button"),v=o("el-upload");return l(),m("div",cn,[i("div",dn,[i("div",mn,[i("span",pn,r(e.$t("kling.name.motionImage")),1),n(c,{content:e.$t("kling.description.motionImage")},null,8,["content"])])]),n(v,{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(),V(p,{key:0,url:g.url,name:g.name,percentage:g.percentage,onRemove:_=>e.onRemove(g)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(d,{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 gn=y(rn,[["render",un],["__scopeId","data-v-37d42da7"]]),fn=b({name:"MotionVideo",components:{ElUpload:K,ElButton:L,InfoIcon:S,FilePreview:Ue,FontAwesomeIcon:E},data(){return{fileList:[],uploadUrl:A()+"/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(){C.warning(this.$t("kling.message.uploadVideoExceed"))},onError(){C.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:(C.error(this.$t("kling.message.uploadVideoSizeExceed")),!1):(C.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()}}}),hn={class:"relative"},_n={class:"flex justify-between"},$n={class:"flex justify-start items-center"},vn={class:"text-sm font-bold"};function kn(e,t,s,a,u,$){const c=o("info-icon"),p=o("file-preview"),f=o("font-awesome-icon"),d=o("el-button"),v=o("el-upload");return l(),m("div",hn,[i("div",_n,[i("div",$n,[i("span",vn,r(e.$t("kling.name.motionVideo")),1),n(c,{content:e.$t("kling.description.motionVideo")},null,8,["content"])])]),n(v,{"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(),V(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"])):k("",!0)]),default:h(()=>[n(d,{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 bn=y(fn,[["render",kn],["__scopeId","data-v-5cf93212"]]),yn=b({name:"MotionPromptInput",components:{ElInput:Q,InfoIcon:S},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||""},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),wn={class:"field"},Cn={class:"box"},Vn={class:"title font-bold"};function Sn(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-input");return l(),m("div",wn,[i("div",Cn,[i("h2",Vn,r(e.$t("kling.name.motionPrompt")),1),n(c,{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 Tn=y(yn,[["render",Sn],["__scopeId","data-v-ca9fdbe5"]]),re="video",In=b({name:"CharacterOrientationSelector",components:{ElRadioGroup:Ae,ElRadioButton:Re,InfoIcon:S},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||re},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,character_orientation:e})}}},mounted(){this.$store.state.kling?.motionConfig?.character_orientation||(this.value=re)}}),En={class:"field"},Ln={class:"header"},Mn={class:"text-sm font-bold"};function Un(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-radio-button"),f=o("el-radio-group");return l(),m("div",En,[i("div",Ln,[i("span",Mn,r(e.$t("kling.name.characterOrientation")),1),n(c,{content:e.$t("kling.description.characterOrientation")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),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 Rn=y(In,[["render",Un],["__scopeId","data-v-7a91195b"]]),ce="std",An=b({name:"MotionModeSelector",components:{ElSelect:D,ElOption:P,InfoIcon:S},computed:{options(){return[{value:"std",label:this.$t("kling.name.modeStd")},{value:"pro",label:this.$t("kling.name.modePro")}]},value:{get(){return this.$store.state.kling?.motionConfig?.mode||ce},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=ce)}}),Pn={class:"field"},Dn={class:"header"},Gn={class:"title font-bold"};function Kn(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),m("div",Pn,[i("div",Dn,[i("h2",Gn,r(e.$t("kling.name.mode")),1),n(c,{content:e.$t("kling.description.motionMode")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),class:"value",placeholder:e.$t("kling.placeholder.select")},{default:h(()=>[(l(!0),m(T,null,I(e.options,d=>(l(),V(p,{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const On=y(An,[["render",Kn],["__scopeId","data-v-1295688c"]]),jn=b({name:"KeepOriginalSoundSelector",components:{ElSwitch:ge,InfoIcon:S},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"})}}}}),Nn={class:"relative"},Bn={class:"flex justify-between items-center"},zn={class:"flex justify-start items-center"},Fn={class:"text-sm font-bold"};function qn(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-switch");return l(),m("div",Nn,[i("div",Bn,[i("div",zn,[i("span",Fn,r(e.$t("kling.name.keepOriginalSound")),1),n(c,{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 Hn=y(jn,[["render",qn]]),Wn=b({name:"MotionPanel",components:{ElButton:L,FontAwesomeIcon:E,Consumption:pe,MotionImage:gn,MotionVideo:bn,MotionPromptInput:Tn,CharacterOrientationSelector:Rn,MotionModeSelector:On,KeepOriginalSoundSelector:Hn},emits:["generate"],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return fe(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")}}}),Jn={class:"flex flex-col h-full"},Qn={class:"flex-1 overflow-y-auto p-5"},Yn={class:"flex flex-col items-center justify-center px-5 pb-5"};function Xn(e,t,s,a,u,$){const c=o("motion-image"),p=o("motion-video"),f=o("motion-prompt-input"),d=o("character-orientation-selector"),v=o("motion-mode-selector"),g=o("keep-original-sound-selector"),_=o("consumption"),M=o("font-awesome-icon"),U=o("el-button");return l(),m("div",Jn,[i("div",Qn,[n(c,{class:"mb-3"}),n(p,{class:"mb-3"}),n(f,{class:"mb-4"}),n(d,{class:"mb-4"}),n(v,{class:"mb-4"}),n(g,{class:"mb-4"})]),i("div",Yn,[n(_,{value:e.consumption,service:e.service},null,8,["value","service"]),n(U,{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 Zn=y(Wn,[["render",Xn]]),xn=b({name:"KlingTabSwitcher",components:{ElTabs:De,ElTabPane:Pe,ElTag:Ve},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)}}}),es=["title"],ts={class:"text"};function os(e,t,s,a,u,$){const c=o("el-tag"),p=o("el-tab-pane"),f=o("el-tabs");return l(),V(f,{"model-value":e.modelValue,class:"kling-tabs",stretch:"","onUpdate:modelValue":e.onUpdate},{default:h(()=>[(l(!0),m(T,null,I(e.tabs,d=>(l(),V(p,{key:d.value,name:d.value,disabled:d.disabled},{label:h(()=>[i("span",{class:"tab-label",title:d.disabled?d.disabledReason:void 0},[i("span",ts,r(d.label),1),d.badge?(l(),V(c,{key:0,size:"small",type:"warning",class:"badge"},{default:h(()=>[w(r(d.badge),1)]),_:2},1024)):k("",!0)],8,es)]),_:2},1032,["name","disabled"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])}const ns=y(xn,[["render",os],["__scopeId","data-v-bf00c27e"]]),ss=b({name:"TaskPreview",components:{ElImage:je,CopyToClipboard:Ge,FontAwesomeIcon:E,ElAlert:Oe,VideoPlayer:Ke,ElTooltip:J,ElButton:L,ImagePreview:G},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")}}}),is={class:"preview"},ls={class:"left"},as={class:"main"},rs={class:"bot"},cs={class:"datetime"},ds={class:"info"},ms={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},ps={key:1,class:"prompt mt-2"},us={key:0},gs={key:1},fs={key:0,class:R({content:!0,failed:!0})},hs={key:0,class:"mb-4"},_s={key:1,class:R({operations:!0,"mt-2":!0})},$s={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},vs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ks={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},bs={key:1,class:R({content:!0})},ys={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ws={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Cs={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Vs={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Ss={key:2,class:R({content:!0})},Ts={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Is={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Es(e,t,s,a,u,$){const c=o("el-image"),p=o("image-preview"),f=o("video-player"),d=o("el-button"),v=o("el-tooltip"),g=o("font-awesome-icon"),_=o("copy-to-clipboard"),M=o("el-alert");return l(),m("div",is,[i("div",ls,[n(c,{src:"https://cdn.acedata.cloud/qpbbbb.jpg",class:"avatar"})]),i("div",as,[i("div",rs,[w(r(e.$t("kling.name.klingBot"))+" ",1),i("span",cs,r(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),i("div",ds,[e.referenceImages.length>0?(l(),m("div",ms,[(l(!0),m(T,null,I(e.referenceImages,(U,O)=>(l(),V(p,{key:O,url:U.url,name:U.name,closable:!1},null,8,["url","name"]))),128))])):k("",!0),e.modelValue?.request?.prompt?(l(),m("p",ps,[w(r(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?k("",!0):(l(),m("span",us," - ("+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",gs," - ("+r(e.$t("kling.status.processing"))+") ",1)):k("",!0)])):k("",!0)]),e.modelValue?.response?.success===!0?(l(),m("div",fs,[e.modelValue?.response.video_url?(l(),m("div",hs,[n(f,{src:e.modelValue?.response.video_url},null,8,["src"])])):k("",!0),e.modelValue?.response.success?(l(),m("div",_s,[n(v,{class:"box-item",effect:"dark",content:e.$t("kling.message.downloadVideo"),placement:"top-start"},{default:h(()=>[e.modelValue?.response.video_url?(l(),V(d,{key:0,type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=U=>e.onDownload(U,e.modelValue?.response.video_url))},{default:h(()=>[w(r(e.$t("kling.button.download")),1)]),_:1})):k("",!0)]),_:1},8,["content"])])):k("",!0),n(M,{closable:!1,class:"mt-2 success"},{default:h(()=>[i("p",$s,[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",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"])]),e.modelValue?.elapsed?(l(),m("p",ks,[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)])):k("",!0)]),_:1})])):k("",!0),e.modelValue?.response?.success===!1?(l(),m("div",bs,[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",ys,[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",ws,[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",Cs,[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)])):k("",!0),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"])])):k("",!0)]),_:1})])):k("",!0),e.modelValue?.response?.success===void 0?(l(),m("div",Ss,[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",Ts,[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",Is,[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"])])):k("",!0)]),_:1})])):k("",!0)])])}const Ls=y(ss,[["render",Es],["__scopeId","data-v-e8e87659"]]),Ms=b({name:"RecentPanel",components:{TaskPreview:Ls,NoTasks:Be,BotPlaceholder:Ne,ScrollList:Le},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?.()}}}),Us={key:0},Rs={key:2,class:"w-full h-full flex items-center justify-center"};function As(e,t,s,a,u,$){const c=o("bot-placeholder"),p=o("task-preview"),f=o("scroll-list"),d=o("no-tasks");return l(),m(T,null,[e.tasks?.items===void 0?(l(),m("div",Us,[n(c)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(l(),V(f,{key:1,ref:"scrollList",class:"h-full w-full overflow-y-auto tasks",loading:e.loading,onReachTop:t[0]||(t[0]=v=>e.$emit("reach-top"))},{default:h(()=>[(l(!0),m(T,null,I(e.tasks?.items,v=>(l(),V(p,{key:v.id,"model-value":v},null,8,["model-value"]))),128))]),_:1},8,["loading"])):k("",!0),e.tasks?.items?.length===0?(l(),m("div",Rs,[n(d)])):k("",!0)],64)}const Ps=y(Ms,[["render",As]]),de="https://webhook.acedata.cloud/kling",Ds=b({name:"KlingIndex",components:{ConfigPanel:an,MotionPanel:Zn,TabSwitcher:ns,Layout:Je,RecentPanel:Ps},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 Me({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:de};if(!s.video_id&&!t.video_url&&!s.start_image_url&&s.end_image_url){C.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}C.info(this.$t("kling.message.startingTask")),te("kling",ie.generate(s,{token:a})).then(()=>{C.success(this.$t("kling.message.startTaskSuccess"))}).catch(u=>{u?.response?.data?.error?.code===se?C.error(this.$t("kling.message.usedUp")):C.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){C.warning(this.$t("kling.message.motionMissingInputs"));return}const t={image_url:e.image_url,video_url:e.video_url,character_orientation:e.character_orientation||"video",mode:e.mode||"std",keep_original_sound:e.keep_original_sound??"yes",...e.prompt?{prompt:e.prompt}:{},callback_url:de},s=this.credential?.token;if(!s){console.error("no token specified");return}C.info(this.$t("kling.message.startingTask")),te("kling",ie.motion(t,{token:s})).then(()=>{C.success(this.$t("kling.message.startTaskSuccess"))}).catch(a=>{a?.response?.data?.error?.code===se?C.error(this.$t("kling.message.usedUp")):C.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),Gs={class:"flex flex-col h-full"},Ks={class:"flex-1 min-h-0"};function Os(e,t,s,a,u,$){const c=o("tab-switcher"),p=o("config-panel"),f=o("motion-panel"),d=o("recent-panel"),v=o("layout");return l(),V(v,null,{config:h(()=>[i("div",Gs,[n(c,{"model-value":e.taskType,"onUpdate:modelValue":e.onTabChange},null,8,["model-value","onUpdate:modelValue"]),i("div",Ks,[e.taskType==="videos"?(l(),V(p,{key:0,onGenerate:e.onGenerate},null,8,["onGenerate"])):e.taskType==="motion"?(l(),V(f,{key:1,onGenerate:e.onGenerateMotion},null,8,["onGenerate"])):k("",!0)])])]),result:h(()=>[n(d,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Ni=y(Ds,[["render",Os]]);export{Ni as default};
|
|
1
|
+
import{F as E}from"./index.es-Dj9Wy0z7.js";import{E as L}from"./index-D_tYpdWX.js";import{E as me}from"./index-DHmtS4Ao.js";import{d as b,H as m,E as i,z as j,C as n,y as h,D as o,q as l,F as r,x as V,O as T,N as I,Q as R,J as k,R as ye,I as w,M as we}from"./vendor-vue-NSDaktjZ.js";import{E as y,b7 as A,a0 as Ce,F as Ve,cd as te,aw as oe}from"./index-R1yPGE-K.js";import{b as Se,c as ne,d as F,e as N,f as Te,g as Ie,h as Ee}from"./kling-CtoPhhA9.js";import{E as P,a as D}from"./index-DPFomByA.js";import{E as q}from"./index-Tvcl48Dl.js";import{E as C}from"./index-v6GVmx9u.js";import{I as S,S as Le,l as Me}from"./pagination-Dk6EMJPI.js";import{E as H}from"./index-Dh4v3_J-.js";import{p as W}from"./pasteUploadMixin-BurWbGNQ.js";import{I as G}from"./ImagePreview-HgasgWaO.js";import{E as J}from"./index-TJe5wIf-.js";import{E as K}from"./index-2f4k1cBC.js";import{C as pe}from"./Consumption-B7VhIhqT.js";import{E as ue}from"./index-TLFtrkXP.js";import{E as ge}from"./index-BqgMgNDY.js";import{E as Q}from"./index-BcFKKIUX.js";import{a as fe}from"./price-D01Whf9j.js";import{F as Ue}from"./FilePreview-CAVXYqye.js";import{E as Re,a as Ae}from"./index-D4zPprsM.js";import{E as Pe,a as De}from"./index-BcnDqXUY.js";import{b as se}from"./errorCode-Cqj9Td_Z.js";import{k as ie}from"./kling-Bk4q6wSq.js";import{C as Ge}from"./CopyToClipboard-CjTKb5D7.js";import{V as Ke}from"./VideoPlayer-3Re_CJKG.js";import{E as Oe}from"./index-CwjV6n_U.js";import{E as je}from"./index-WWnbhW6C.js";import{B as Ne}from"./BotPlaceholder-CNmFsyHW.js";import{N as Be}from"./NoTasks-lh6VlwMM.js";import"./use-form-item-_IfxE0T4.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./index-q8T9ydUq.js";import"./typescript-DAmrEi8b.js";import"./index-BTzdyisK.js";import"./strings-beZM2Y-f.js";import"./isEqual-DPhKVN6J.js";import"./_Uint8Array-zPfACQFm.js";import"./castArray-B6RNe9d9.js";import"./debounce-Bgvad3gW.js";import"./_baseIteratee-BDYveGWO.js";import"./index-B5KTk9zq.js";import"./validator-C-MfJUQn.js";import"./index-DhSkah7J.js";import"./_baseClone-BH5bAI4w.js";import"./_initCloneObject-DNcVRVtY.js";import"./index-Cu41y2Fl.js";import"./index-CiLK9hZH.js";import"./isPlainObject-CKjDbn9w.js";import"./vue-plyr-BO2nlN4c.js";import"./index-CxX6Br5p.js";const ze=b({name:"LayoutKling",components:{ElDrawer:me,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 c=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),m("div",Fe,[i("div",qe,[j(e.$slots,"config",{},void 0,!0)]),i("div",He,[j(e.$slots,"result",{},void 0,!0)]),n(p,{circle:"",class:"menu",onClick:t[0]||(t[0]=d=>e.drawer=!0)},{default:h(()=>[n(c,{icon:"fa-solid fa-magic"})]),_:1}),n(f,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=d=>e.drawer=d),direction:"ltr","with-header":!1,size:"350px"},{default:h(()=>[j(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Je=y(ze,[["render",We],["__scopeId","data-v-8fa7523c"]]),Qe={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function he(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 Y(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 $=he(s,a,u),c=[];return e.end_image_url&&!$.endImage&&c.push({field:"end_image_url",i18nLabel:"kling.name.endImage"}),e.generate_audio&&!$.audio&&c.push({field:"generate_audio",i18nLabel:"kling.name.generateAudio"}),e.camera_control?.type&&!$.motionControl&&c.push({field:"camera_control",i18nLabel:"kling.name.cameraControl"}),c}function X(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:D,ElOption:P},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{revertKey:0,options:[{value:"kling-v3",label:"v3"},{value:"kling-v3-omni",label:"v3-Omni"},{value:"kling-v2-6",label:"v2.6"},{value:"kling-v2-5-turbo",label:"v2.5-Turbo"},{value:"kling-v2-1-master",label:"v2.1-Master"},{value:"kling-v2-master",label:"v2-Master"},{value:"kling-v1-6",label:"v1.6"},{value:"kling-v1",label:"v1"},{value:"kling-video-o1",label:"Video-o1"}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(Se)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Y(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=X({...t,model:e},s);this.$store.commit("kling/setConfig",u),C.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 c=o("el-option"),p=o("el-select");return l(),m("div",Xe,[i("h2",Ze,r(e.$t("pika.name.model")),1),(l(),V(p,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("pika.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),m(T,null,I(e.options,f=>(l(),V(c,{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:D,ElOption:P,InfoIcon:S},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=Y(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=X({...t,mode:e},s);this.$store.commit("kling/setConfig",u),C.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 c=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(c,{content:e.$t("kling.description.mode"),class:"info-icon"},null,8,["content"])]),(l(),V(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(T,null,I(e.options,d=>(l(),V(p,{key:d.value,label:d.label,value:d.value,disabled:d.disabled},{default:h(()=>[i("span",{class:R({"opt-disabled":d.disabled})},r(d.label),3),d.disabled&&d.disabledReason?(l(),m("span",it,r(d.disabledReason),1)):k("",!0)]),_:2},1032,["label","value","disabled"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const at=y(tt,[["render",lt],["__scopeId","data-v-9a8fa3c5"]]),le=[3,5,8,10,12,15],ae=[5,10],rt=b({name:"DurationSelector",components:{ElSlider:H,InfoIcon:S},props:{modelValue:{type:Number,default:void 0}},emits:["update:modelValue"],data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},isV3Model(){return F.includes(this.selectedModel)},sliderMin(){return this.isV3Model?3:5},sliderMax(){return this.isV3Model?15:10},sliderStep(){return this.isV3Model?1:5},marks(){const e=this.isV3Model?le:ae,t={};for(const s of e)t[s]=`${s}s`;return t},value(){return this.$store.state.kling?.config?.duration??N},sliderValue(){const e=this.value;return e<this.sliderMin?this.sliderMin:e>this.sliderMax?this.sliderMax:e}},watch:{isV3Model(e){(this.isV3Model?le:ae).includes(this.value)||this.applyDuration(N)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(N)},methods:{async onChange(e){const t=Array.isArray(e)?e[0]:e,s=this.$store.state.kling?.config||{},a=Y(s,{duration:t});if(a.length===0){this.applyDuration(t);return}const u=a.map($=>this.$t($.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:u}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const $=X({...s,duration:t},a);this.$store.commit("kling/setConfig",$),C.success(this.$t("kling.message.featureRemovedNotice",{fields:u}))}catch{this.revertKey+=1}},applyDuration(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,duration:e})}}}),ct={class:"field"},dt={class:"header"},mt={class:"title font-bold"},pt={class:"value-display"};function ut(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-slider");return l(),m("div",ct,[i("div",dt,[i("h2",mt,r(e.$t("kling.name.duration")),1),n(c,{content:e.$t("kling.description.duration"),class:"info-icon ml-1"},null,8,["content"]),i("span",pt,r(e.value)+"s",1)]),(l(),V(p,{key:e.revertKey,"model-value":e.sliderValue,class:"slider",min:e.sliderMin,max:e.sliderMax,step:e.sliderStep,marks:e.marks,"show-tooltip":!1,onChange:e.onChange},null,8,["model-value","min","max","step","marks","onChange"]))])}const gt=y(rt,[["render",ut],["__scopeId","data-v-aa1a22a1"]]),ft=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=Te)}}),ht={class:"text-sm font-bold mb-2 block"},_t={class:"items"},$t=["onClick"],vt={class:"name"};function kt(e,t,s,a,u,$){return l(),m("div",null,[i("span",ht,r(e.$t("kling.name.ratio")),1),i("div",_t,[(l(!0),m(T,null,I(e.options,(c,p)=>(l(),m("div",{key:p,class:R({active:e.active===p,item:!0}),onClick:f=>e.value=c.value},[i("div",{class:R(["preview",c.label])},[i("div",{class:"rect",style:ye({width:c.width+"px",height:c.height+"px"})},null,4)],2),i("p",vt,r(c.label),1)],10,$t))),128))])])}const bt=y(ft,[["render",kt],["__scopeId","data-v-cdb14b2f"]]),yt=b({name:"StartImage",components:{ElUpload:K,ElButton:L,ElTooltip:J,InfoIcon:S,FontAwesomeIcon:E,ImagePreview:G},mixins:[W],emits:["change"],data(){return{fileList:[],uploadUrl:A()+"/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(){C.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){C.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()}}}),wt={class:"relative"},Ct={class:"flex justify-between"},Vt={class:"flex justify-start items-center"},St={class:"text-sm font-bold"};function Tt(e,t,s,a,u,$){const c=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),d=o("el-button"),v=o("el-tooltip"),g=o("el-upload");return l(),m("div",wt,[i("div",Ct,[i("div",Vt,[i("span",St,r(e.$t("kling.name.startImage")),1),n(c,{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(),V(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(v,{content:e.$t("kling.message.uploadReferencesExceed"),disabled:!e.reachedLimit,placement:"top"},{default:h(()=>[i("span",null,[n(d,{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 It=y(yt,[["render",Tt],["__scopeId","data-v-40832274"]]),Et=b({name:"EndImage",components:{ElUpload:K,ElButton:L,ElTooltip:J,ImagePreview:G,InfoIcon:S,FontAwesomeIcon:E},mixins:[W],data(){return{fileList:[],uploadUrl:A()+"/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 he(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},uploadDisabled(){return this.reachedLimit||!this.endImageSupported},uploadTooltip(){return this.endImageSupported?this.reachedLimit?this.$t("kling.message.uploadReferencesExceed"):"":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=[])}},mounted(){this.value||(this.value=void 0),this.onSetEndImageUrl()},methods:{onBeforeUpload(){return this.endImageSupported?!0:(C.warning(this.$t("kling.message.endImageNotSupported")),!1)},onExceed(){C.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){C.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()}}}),Lt={class:"relative"},Mt={class:"flex justify-between"},Ut={class:"flex justify-start items-center"},Rt={class:"text-sm font-bold"};function At(e,t,s,a,u,$){const c=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),d=o("el-button"),v=o("el-tooltip"),g=o("el-upload");return l(),m("div",Lt,[i("div",Mt,[i("div",Ut,[i("span",Rt,r(e.$t("kling.name.endImage")),1),n(c,{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(),V(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(v,{content:e.uploadTooltip,disabled:!e.uploadDisabled,placement:"top"},{default:h(()=>[i("span",null,[n(d,{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 Pt=y(Et,[["render",At],["__scopeId","data-v-6959ad44"]]),Dt=b({name:"CfgScaleSelector",components:{ElSlider:H,InfoIcon:S,ElInputNumber:ue},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)}}),Gt={class:"flex justify-between"},Kt={class:"flex justify-start items-center"},Ot={class:"text-sm font-bold"},jt={class:"flex justify-end items-center"},Nt={class:"w-full"};function Bt(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-input-number"),f=o("el-slider");return l(),m("div",null,[i("div",Gt,[i("div",Kt,[i("span",Ot,r(e.$t("kling.name.cfgScale")),1),n(c,{content:e.$t("kling.description.cfgScale")},null,8,["content"])]),i("div",jt,[n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),"controls-position":"right"},null,8,["modelValue"])])]),i("div",Nt,[n(f,{modelValue:e.value,"onUpdate:modelValue":t[1]||(t[1]=d=>e.value=d),min:0,max:1,step:.1},null,8,["modelValue"])])])}const zt=y(Dt,[["render",Bt]]),Ft=b({name:"GenerateAudioSelector",components:{ElSwitch:ge,InfoIcon:S},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??Ee:!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})}}}),qt={class:"relative"},Ht={class:"flex justify-between items-center"},Wt={class:"flex justify-start items-center"},Jt={class:"text-sm font-bold"};function Qt(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-switch");return l(),m("div",qt,[i("div",Ht,[i("div",Wt,[i("span",Jt,r(e.$t("kling.name.generateAudio")),1),n(c,{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 Yt=y(Ft,[["render",Qt]]),Xt=["horizontal","vertical","pan","tilt","roll","zoom"],Zt=b({name:"CameraControlSelector",components:{ElSelect:D,ElOption:P,ElSlider:H,ElInputNumber:ue,InfoIcon:S},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||""},disabled(){return this.selectedMode==="4k"},tooltipContent(){return this.disabled?this.$t("kling.description.cameraControlDisabled4k"):this.$t("kling.description.cameraControl")},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)}}}),xt={class:"field"},eo={class:"header"},to={class:"text-sm font-bold"},oo={key:0,class:"config-grid"},no={class:"cfg-row-head"},so={class:"cfg-name"};function io(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-option"),f=o("el-select"),d=o("el-input-number"),v=o("el-slider");return l(),m("div",xt,[i("div",eo,[i("span",to,r(e.$t("kling.name.cameraControl")),1),n(c,{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(T,null,I(e.typeOptions,g=>(l(),V(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",oo,[(l(!0),m(T,null,I(e.configKeys,g=>(l(),m("div",{key:g,class:"cfg-row"},[i("div",no,[i("span",so,r(e.$t(`kling.name.cc_${g}`)),1),n(d,{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(v,{"model-value":e.configValues[g]??0,min:-1,max:1,step:.1,onInput:_=>e.onSliderChange(g,_)},null,8,["model-value","onInput"])]))),128))])):k("",!0)])}const lo=y(Zt,[["render",io],["__scopeId","data-v-fb7b34d0"]]),_e=[{groupKey:"cameraMovements",chipKeys:["rotateAround","stationary","handheld","zoomOut","zoomIn","follow","panRight","tiltUp","tiltDown","orbit"]},{groupKey:"cameraSpeed",chipKeys:["speedSlow","speedMedium","speedFast"]},{groupKey:"shotType",chipKeys:["shotClose","shotMedium","shotLong","shotLowAngle","shotHighAngle","shotShallowDof","shotFront","shotProfile","shotCloseUp","shotDrone"]},{groupKey:"light",chipKeys:["lightSunlight","lightSoft","lightNeon","lightWarm","lightNature","lightCandle","lightCityNight"]},{groupKey:"frame",chipKeys:["frameRichDetails","frameSimpleBg"]},{groupKey:"atmosphere",chipKeys:["atmosphereMysterious","atmospherePeaceful","atmosphereHeartwarming","atmosphereVivid","atmosphereColorful"]}],B=", ";function ao(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 ro=b({name:"InspirationPills",components:{FontAwesomeIcon:E},computed:{prompt(){return this.$store.state.kling?.config?.prompt||""},allChipTexts(){return _e.flatMap(e=>e.chipKeys.map(t=>this.$t(`kling.inspiration.chip.${t}`)))},selected(){const e=this.prompt;if(!e)return[];const t=[];for(const s of this.allChipTexts){const 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})}}}),co={key:0,class:"pills",role:"list"},mo={class:"pill-text"},po=["aria-label","onClick"];function uo(e,t,s,a,u,$){const c=o("font-awesome-icon");return e.selected.length>0?(l(),m("div",co,[(l(!0),m(T,null,I(e.selected,p=>(l(),m("div",{key:p,class:"pill",role:"listitem"},[i("span",mo,r(p),1),i("button",{type:"button",class:"pill-remove","aria-label":e.$t("kling.inspiration.removeChip"),onClick:we(f=>e.onRemove(p),["stop"])},[n(c,{icon:"fa-solid fa-xmark"})],8,po)]))),128))])):k("",!0)}const go=y(ro,[["render",uo],["__scopeId","data-v-5fc4fa65"]]),fo="",ho=b({name:"PromptInput",components:{ElInput:Q,ElButton:L,FontAwesomeIcon:E,InfoIcon:S,InspirationPills:go},emits:["open-inspiration"],computed:{prompt:{get(){return this.$store.state.kling?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=fo)}}),_o={class:"field"},$o={class:"box"},vo={class:"title font-bold"},ko={class:"actions"};function bo(e,t,s,a,u,$){const c=o("font-awesome-icon"),p=o("el-button"),f=o("info-icon"),d=o("inspiration-pills"),v=o("el-input");return l(),m("div",_o,[i("div",$o,[i("h2",vo,r(e.$t("kling.name.prompt")),1),i("div",ko,[n(p,{text:"",size:"small",class:"inspiration-btn",onClick:t[0]||(t[0]=g=>e.$emit("open-inspiration"))},{default:h(()=>[n(c,{icon:"fa-regular fa-lightbulb",class:"mr-1"}),w(" "+r(e.$t("kling.inspiration.openButton")),1)]),_:1}),n(f,{content:e.$t("kling.description.prompt"),class:"info"},null,8,["content"])])]),n(d),n(v,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||(t[1]=g=>e.prompt=g),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const yo=y(ho,[["render",bo],["__scopeId","data-v-0a5c57b8"]]),wo="",Co=b({name:"NegativePromptInput",components:{ElInput:Q,InfoIcon:S},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=wo)}}),Vo={class:"field"},So={class:"box"},To={class:"title font-bold"};function Io(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-input");return l(),m("div",Vo,[i("div",So,[i("h2",To,r(e.$t("kling.name.negativePrompt")),1),n(c,{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 Eo=y(Co,[["render",Io],["__scopeId","data-v-de98cf01"]]),Lo=b({name:"InspirationDrawer",components:{ElDrawer:me,ElButton:L,FontAwesomeIcon:E},props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],data(){return{groups:_e,Close:Ce}},computed:{visible:{get(){return this.modelValue},set(e){this.$emit("update:modelValue",e)}},drawerSize(){return window.innerWidth<768?"100%":"380px"},prompt(){return this.$store.state.kling?.config?.prompt||""},allChipTexts(){return this.groups.flatMap(e=>e.chipKeys.map(t=>this.$t(`kling.inspiration.chip.${t}`)))},selectedCount(){return this.allChipTexts.filter(e=>this.isSelected(e)).length}},methods:{chipText(e){return this.$t(`kling.inspiration.chip.${e}`)},isSelected(e){return e?this.prompt.includes(e):!1},setPrompt(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:e})},onToggle(e){e&&(this.isSelected(e)?this.setPrompt(z(this.prompt,e)):this.setPrompt(ao(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)}}}),Mo={class:"drawer-content"},Uo={class:"drawer-header"},Ro={class:"title-row"},Ao={class:"title"},Po={class:"hint"},Do={key:0,class:"selected-bar"},Go={class:"selected-text"},Ko={class:"groups"},Oo={class:"group-title"},jo={class:"chip-grid"},No=["onClick"];function Bo(e,t,s,a,u,$){const c=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),V(f,{modelValue:e.visible,"onUpdate:modelValue":t[1]||(t[1]=d=>e.visible=d),direction:"rtl","with-header":!1,size:e.drawerSize,"custom-class":"kling-inspiration-drawer","destroy-on-close":!1},{default:h(()=>[i("div",Mo,[i("div",Uo,[i("div",Ro,[n(c,{icon:"fa-regular fa-lightbulb",class:"mr-2"}),i("span",Ao,r(e.$t("kling.inspiration.title")),1)]),n(p,{text:"",icon:e.Close,class:"close-btn",onClick:t[0]||(t[0]=d=>e.visible=!1)},null,8,["icon"])]),i("div",Po,r(e.$t("kling.inspiration.hint")),1),e.selectedCount>0?(l(),m("div",Do,[i("span",Go,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"])])):k("",!0),i("div",Ko,[(l(!0),m(T,null,I(e.groups,d=>(l(),m("div",{key:d.groupKey,class:"group"},[i("div",Oo,r(e.$t(`kling.inspiration.group.${d.groupKey}`)),1),i("div",jo,[(l(!0),m(T,null,I(d.chipKeys,v=>(l(),m("button",{key:v,type:"button",class:R({chip:!0,active:e.isSelected(e.chipText(v))}),onClick:g=>e.onToggle(e.chipText(v))},r(e.chipText(v)),11,No))),128))])]))),128))])])]),_:1},8,["modelValue","size"])}const zo=y(Lo,[["render",Bo],["__scopeId","data-v-7d457a69"]]),Fo={"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"},qo={std:"720p",pro:"1080p","4k":"4K"},Ho=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 Fo[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||""},modeLabel(){const e=this.config?.mode||"std";return qo[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),Wo={class:"summary-chip"},Jo=["title"],Qo=["title"],Yo=["title"],Xo=["title"],Zo=["title"];function xo(e,t,s,a,u,$){const c=o("font-awesome-icon");return l(),m("div",Wo,[i("span",{class:"part",title:e.$t("kling.name.model")},r(e.modelLabel),9,Jo),t[0]||(t[0]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.duration")},r(e.durationLabel),9,Qo),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,Yo),t[2]||(t[2]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.mode")},r(e.modeLabel),9,Xo),e.generateAudio?(l(),m("span",{key:0,class:"audio",title:e.$t("kling.name.generateAudio")},[n(c,{icon:"fa-solid fa-headphones"})],8,Zo)):k("",!0)])}const en=y(Ho,[["render",xo],["__scopeId","data-v-418a6733"]]),tn=b({name:"ConfigPanel",components:{ElButton:L,Consumption:pe,FontAwesomeIcon:E,PromptInput:yo,NegativePromptInput:Eo,ModelSelector:et,ModeSelector:at,DurationSelector:gt,RatioSelector:bt,StartImage:It,CfgScaleSelector:zt,GenerateAudioSelector:Yt,CameraControlSelector:lo,InspirationDrawer:zo,SummaryChip:en,EndImage:Pt},emits:["generate"],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},consumption(){return fe(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit("generate")}}}),on={class:"flex flex-col h-full"},nn={class:"flex-1 overflow-y-auto p-5"},sn={class:"flex flex-col items-center justify-center px-5 pb-5"};function ln(e,t,s,a,u,$){const c=o("prompt-input"),p=o("model-selector"),f=o("ratio-selector"),d=o("start-image"),v=o("end-image"),g=o("duration-selector"),_=o("mode-selector"),M=o("generate-audio-selector"),U=o("camera-control-selector"),O=o("cfg-scale-selector"),$e=o("negative-prompt-input"),ve=o("summary-chip"),ke=o("consumption"),Z=o("font-awesome-icon"),x=o("el-button"),be=o("inspiration-drawer");return l(),m("div",on,[i("div",nn,[n(c,{class:"mb-4",onOpenInspiration:t[0]||(t[0]=ee=>e.inspirationOpen=!0)}),n(p,{class:"mb-4"}),n(f,{class:"mb-4"}),n(d,{class:"mb-2"}),n(v,{class:"mb-2"}),n(g,{class:"mb-4"}),n(_,{class:"mb-4"}),n(M,{class:"mb-4"}),n(U,{class:"mb-4"}),n(O,{class:"mb-4"}),n($e,{class:"mb-4"})]),i("div",sn,[n(ve),n(ke,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(l(),V(x,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(Z,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.extend")),1)]),_:1},8,["onClick"])):(l(),V(x,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(Z,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.generate")),1)]),_:1},8,["onClick"]))]),n(be,{modelValue:e.inspirationOpen,"onUpdate:modelValue":t[1]||(t[1]=ee=>e.inspirationOpen=ee)},null,8,["modelValue"])])}const an=y(tn,[["render",ln]]),rn=b({name:"MotionImage",components:{ElUpload:K,ElButton:L,InfoIcon:S,FontAwesomeIcon:E,ImagePreview:G},mixins:[W],data(){return{fileList:[],uploadUrl:A()+"/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(){C.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){C.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()}}}),cn={class:"relative"},dn={class:"flex justify-between"},mn={class:"flex justify-start items-center"},pn={class:"text-sm font-bold"};function un(e,t,s,a,u,$){const c=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),d=o("el-button"),v=o("el-upload");return l(),m("div",cn,[i("div",dn,[i("div",mn,[i("span",pn,r(e.$t("kling.name.motionImage")),1),n(c,{content:e.$t("kling.description.motionImage")},null,8,["content"])])]),n(v,{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(),V(p,{key:0,url:g.url,name:g.name,percentage:g.percentage,onRemove:_=>e.onRemove(g)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(d,{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 gn=y(rn,[["render",un],["__scopeId","data-v-37d42da7"]]),fn=b({name:"MotionVideo",components:{ElUpload:K,ElButton:L,InfoIcon:S,FilePreview:Ue,FontAwesomeIcon:E},data(){return{fileList:[],uploadUrl:A()+"/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(){C.warning(this.$t("kling.message.uploadVideoExceed"))},onError(){C.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:(C.error(this.$t("kling.message.uploadVideoSizeExceed")),!1):(C.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()}}}),hn={class:"relative"},_n={class:"flex justify-between"},$n={class:"flex justify-start items-center"},vn={class:"text-sm font-bold"};function kn(e,t,s,a,u,$){const c=o("info-icon"),p=o("file-preview"),f=o("font-awesome-icon"),d=o("el-button"),v=o("el-upload");return l(),m("div",hn,[i("div",_n,[i("div",$n,[i("span",vn,r(e.$t("kling.name.motionVideo")),1),n(c,{content:e.$t("kling.description.motionVideo")},null,8,["content"])])]),n(v,{"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(),V(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"])):k("",!0)]),default:h(()=>[n(d,{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 bn=y(fn,[["render",kn],["__scopeId","data-v-5cf93212"]]),yn=b({name:"MotionPromptInput",components:{ElInput:Q,InfoIcon:S},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||""},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),wn={class:"field"},Cn={class:"box"},Vn={class:"title font-bold"};function Sn(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-input");return l(),m("div",wn,[i("div",Cn,[i("h2",Vn,r(e.$t("kling.name.motionPrompt")),1),n(c,{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 Tn=y(yn,[["render",Sn],["__scopeId","data-v-ca9fdbe5"]]),re="video",In=b({name:"CharacterOrientationSelector",components:{ElRadioGroup:Ae,ElRadioButton:Re,InfoIcon:S},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||re},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,character_orientation:e})}}},mounted(){this.$store.state.kling?.motionConfig?.character_orientation||(this.value=re)}}),En={class:"field"},Ln={class:"header"},Mn={class:"text-sm font-bold"};function Un(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-radio-button"),f=o("el-radio-group");return l(),m("div",En,[i("div",Ln,[i("span",Mn,r(e.$t("kling.name.characterOrientation")),1),n(c,{content:e.$t("kling.description.characterOrientation")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),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 Rn=y(In,[["render",Un],["__scopeId","data-v-7a91195b"]]),ce="std",An=b({name:"MotionModeSelector",components:{ElSelect:D,ElOption:P,InfoIcon:S},computed:{options(){return[{value:"std",label:this.$t("kling.name.modeStd")},{value:"pro",label:this.$t("kling.name.modePro")}]},value:{get(){return this.$store.state.kling?.motionConfig?.mode||ce},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=ce)}}),Pn={class:"field"},Dn={class:"header"},Gn={class:"title font-bold"};function Kn(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),m("div",Pn,[i("div",Dn,[i("h2",Gn,r(e.$t("kling.name.mode")),1),n(c,{content:e.$t("kling.description.motionMode")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),class:"value",placeholder:e.$t("kling.placeholder.select")},{default:h(()=>[(l(!0),m(T,null,I(e.options,d=>(l(),V(p,{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const On=y(An,[["render",Kn],["__scopeId","data-v-1295688c"]]),jn=b({name:"KeepOriginalSoundSelector",components:{ElSwitch:ge,InfoIcon:S},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"})}}}}),Nn={class:"relative"},Bn={class:"flex justify-between items-center"},zn={class:"flex justify-start items-center"},Fn={class:"text-sm font-bold"};function qn(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-switch");return l(),m("div",Nn,[i("div",Bn,[i("div",zn,[i("span",Fn,r(e.$t("kling.name.keepOriginalSound")),1),n(c,{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 Hn=y(jn,[["render",qn]]),Wn=b({name:"MotionPanel",components:{ElButton:L,FontAwesomeIcon:E,Consumption:pe,MotionImage:gn,MotionVideo:bn,MotionPromptInput:Tn,CharacterOrientationSelector:Rn,MotionModeSelector:On,KeepOriginalSoundSelector:Hn},emits:["generate"],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return fe(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")}}}),Jn={class:"flex flex-col h-full"},Qn={class:"flex-1 overflow-y-auto p-5"},Yn={class:"flex flex-col items-center justify-center px-5 pb-5"};function Xn(e,t,s,a,u,$){const c=o("motion-image"),p=o("motion-video"),f=o("motion-prompt-input"),d=o("character-orientation-selector"),v=o("motion-mode-selector"),g=o("keep-original-sound-selector"),_=o("consumption"),M=o("font-awesome-icon"),U=o("el-button");return l(),m("div",Jn,[i("div",Qn,[n(c,{class:"mb-3"}),n(p,{class:"mb-3"}),n(f,{class:"mb-4"}),n(d,{class:"mb-4"}),n(v,{class:"mb-4"}),n(g,{class:"mb-4"})]),i("div",Yn,[n(_,{value:e.consumption,service:e.service},null,8,["value","service"]),n(U,{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 Zn=y(Wn,[["render",Xn]]),xn=b({name:"KlingTabSwitcher",components:{ElTabs:De,ElTabPane:Pe,ElTag:Ve},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)}}}),es=["title"],ts={class:"text"};function os(e,t,s,a,u,$){const c=o("el-tag"),p=o("el-tab-pane"),f=o("el-tabs");return l(),V(f,{"model-value":e.modelValue,class:"kling-tabs",stretch:"","onUpdate:modelValue":e.onUpdate},{default:h(()=>[(l(!0),m(T,null,I(e.tabs,d=>(l(),V(p,{key:d.value,name:d.value,disabled:d.disabled},{label:h(()=>[i("span",{class:"tab-label",title:d.disabled?d.disabledReason:void 0},[i("span",ts,r(d.label),1),d.badge?(l(),V(c,{key:0,size:"small",type:"warning",class:"badge"},{default:h(()=>[w(r(d.badge),1)]),_:2},1024)):k("",!0)],8,es)]),_:2},1032,["name","disabled"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])}const ns=y(xn,[["render",os],["__scopeId","data-v-bf00c27e"]]),ss=b({name:"TaskPreview",components:{ElImage:je,CopyToClipboard:Ge,FontAwesomeIcon:E,ElAlert:Oe,VideoPlayer:Ke,ElTooltip:J,ElButton:L,ImagePreview:G},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")}}}),is={class:"preview"},ls={class:"left"},as={class:"main"},rs={class:"bot"},cs={class:"datetime"},ds={class:"info"},ms={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},ps={key:1,class:"prompt mt-2"},us={key:0},gs={key:1},fs={key:0,class:R({content:!0,failed:!0})},hs={key:0,class:"mb-4"},_s={key:1,class:R({operations:!0,"mt-2":!0})},$s={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},vs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ks={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},bs={key:1,class:R({content:!0})},ys={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ws={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Cs={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Vs={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Ss={key:2,class:R({content:!0})},Ts={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Is={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Es(e,t,s,a,u,$){const c=o("el-image"),p=o("image-preview"),f=o("video-player"),d=o("el-button"),v=o("el-tooltip"),g=o("font-awesome-icon"),_=o("copy-to-clipboard"),M=o("el-alert");return l(),m("div",is,[i("div",ls,[n(c,{src:"https://cdn.acedata.cloud/qpbbbb.jpg",class:"avatar"})]),i("div",as,[i("div",rs,[w(r(e.$t("kling.name.klingBot"))+" ",1),i("span",cs,r(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),i("div",ds,[e.referenceImages.length>0?(l(),m("div",ms,[(l(!0),m(T,null,I(e.referenceImages,(U,O)=>(l(),V(p,{key:O,url:U.url,name:U.name,closable:!1},null,8,["url","name"]))),128))])):k("",!0),e.modelValue?.request?.prompt?(l(),m("p",ps,[w(r(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?k("",!0):(l(),m("span",us," - ("+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",gs," - ("+r(e.$t("kling.status.processing"))+") ",1)):k("",!0)])):k("",!0)]),e.modelValue?.response?.success===!0?(l(),m("div",fs,[e.modelValue?.response.video_url?(l(),m("div",hs,[n(f,{src:e.modelValue?.response.video_url},null,8,["src"])])):k("",!0),e.modelValue?.response.success?(l(),m("div",_s,[n(v,{class:"box-item",effect:"dark",content:e.$t("kling.message.downloadVideo"),placement:"top-start"},{default:h(()=>[e.modelValue?.response.video_url?(l(),V(d,{key:0,type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=U=>e.onDownload(U,e.modelValue?.response.video_url))},{default:h(()=>[w(r(e.$t("kling.button.download")),1)]),_:1})):k("",!0)]),_:1},8,["content"])])):k("",!0),n(M,{closable:!1,class:"mt-2 success"},{default:h(()=>[i("p",$s,[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",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"])]),e.modelValue?.elapsed?(l(),m("p",ks,[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)])):k("",!0)]),_:1})])):k("",!0),e.modelValue?.response?.success===!1?(l(),m("div",bs,[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",ys,[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",ws,[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",Cs,[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)])):k("",!0),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"])])):k("",!0)]),_:1})])):k("",!0),e.modelValue?.response?.success===void 0?(l(),m("div",Ss,[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",Ts,[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",Is,[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"])])):k("",!0)]),_:1})])):k("",!0)])])}const Ls=y(ss,[["render",Es],["__scopeId","data-v-e8e87659"]]),Ms=b({name:"RecentPanel",components:{TaskPreview:Ls,NoTasks:Be,BotPlaceholder:Ne,ScrollList:Le},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?.()}}}),Us={key:0},Rs={key:2,class:"w-full h-full flex items-center justify-center"};function As(e,t,s,a,u,$){const c=o("bot-placeholder"),p=o("task-preview"),f=o("scroll-list"),d=o("no-tasks");return l(),m(T,null,[e.tasks?.items===void 0?(l(),m("div",Us,[n(c)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(l(),V(f,{key:1,ref:"scrollList",class:"h-full w-full overflow-y-auto tasks",loading:e.loading,onReachTop:t[0]||(t[0]=v=>e.$emit("reach-top"))},{default:h(()=>[(l(!0),m(T,null,I(e.tasks?.items,v=>(l(),V(p,{key:v.id,"model-value":v},null,8,["model-value"]))),128))]),_:1},8,["loading"])):k("",!0),e.tasks?.items?.length===0?(l(),m("div",Rs,[n(d)])):k("",!0)],64)}const Ps=y(Ms,[["render",As]]),de="https://webhook.acedata.cloud/kling",Ds=b({name:"KlingIndex",components:{ConfigPanel:an,MotionPanel:Zn,TabSwitcher:ns,Layout:Je,RecentPanel:Ps},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 Me({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:de};if(!s.video_id&&!t.video_url&&!s.start_image_url&&s.end_image_url){C.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}C.info(this.$t("kling.message.startingTask")),te("kling",ie.generate(s,{token:a})).then(()=>{C.success(this.$t("kling.message.startTaskSuccess"))}).catch(u=>{u?.response?.data?.error?.code===se?C.error(this.$t("kling.message.usedUp")):C.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){C.warning(this.$t("kling.message.motionMissingInputs"));return}const t={image_url:e.image_url,video_url:e.video_url,character_orientation:e.character_orientation||"video",mode:e.mode||"std",keep_original_sound:e.keep_original_sound??"yes",...e.prompt?{prompt:e.prompt}:{},callback_url:de},s=this.credential?.token;if(!s){console.error("no token specified");return}C.info(this.$t("kling.message.startingTask")),te("kling",ie.motion(t,{token:s})).then(()=>{C.success(this.$t("kling.message.startTaskSuccess"))}).catch(a=>{a?.response?.data?.error?.code===se?C.error(this.$t("kling.message.usedUp")):C.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),Gs={class:"flex flex-col h-full"},Ks={class:"flex-1 min-h-0"};function Os(e,t,s,a,u,$){const c=o("tab-switcher"),p=o("config-panel"),f=o("motion-panel"),d=o("recent-panel"),v=o("layout");return l(),V(v,null,{config:h(()=>[i("div",Gs,[n(c,{"model-value":e.taskType,"onUpdate:modelValue":e.onTabChange},null,8,["model-value","onUpdate:modelValue"]),i("div",Ks,[e.taskType==="videos"?(l(),V(p,{key:0,onGenerate:e.onGenerate},null,8,["onGenerate"])):e.taskType==="motion"?(l(),V(f,{key:1,onGenerate:e.onGenerateMotion},null,8,["onGenerate"])):k("",!0)])])]),result:h(()=>[n(d,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Ni=y(Ds,[["render",Os]]);export{Ni as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as C}from"./index.es-TsWsNkRg.js";import{E as D}from"./index-CkIeLqJ4.js";import{E as W}from"./index-XaPqTDhv.js";import{d as E,H as i,E as l,z as q,C as s,y as g,D as n,q as a,F as o,I as u,O as y,N as V,x as w,J as $,M as K,Q as A}from"./vendor-vue-NSDaktjZ.js";import{E as k,b7 as Z,cA as H,cB as J,cC as X,cD as Q,cE as Y,cF as ee,cG as te,cH as z,cI as G,cJ as U,cK as P,cL as se,cM as O,cN as oe,cO as B,cd as ae,aw as j}from"./index-Cyf8EOi-.js";import{I as L,S as ne,l as re}from"./pagination-Kf9WeXkv.js";import{E as le}from"./index-Bo_JlvjV.js";import{p as ie}from"./pasteUploadMixin-BurWbGNQ.js";import{I as F}from"./ImagePreview-Dj1qrKsG.js";import{E as ce}from"./index-CTjlNIkO.js";import{E as I}from"./index-DdEU08KU.js";import{C as me}from"./Consumption-ClgEQgDH.js";import{a as de}from"./price-CnHV1sgg.js";import{E as x,a as N}from"./index-DxpQaVyM.js";import{E as ue}from"./index-BowVIJh5.js";import{b as pe}from"./errorCode-Cqj9Td_Z.js";import{s as fe}from"./seedream--P09hKyP.js";import{C as _e}from"./CopyToClipboard-B-j3IeKI.js";import{I as ge}from"./ImageWrapper-CW4rFhRa.js";import{E as he}from"./index-D6eGd2z6.js";import{E as $e}from"./index-BPR2ZBL3.js";import{E as ve}from"./index-BVx89d8R.js";import{B as be}from"./BotPlaceholder-BPfrGl17.js";import{N as Ee}from"./NoTasks-CUTKaxqT.js";import"./use-form-item-RRBZ2FOX.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./typescript-C1XBDfAK.js";import"./index-DxKv9BIl.js";import"./index-B2Oy_3FT.js";import"./index-kGAGAJMD.js";import"./_baseClone-0JASqonl.js";import"./_Uint8Array-DfhsEbA6.js";import"./_initCloneObject-CT9aktWN.js";import"./isEqual-Dcf8wohg.js";import"./index-BWyQEIEc.js";import"./strings-beZM2Y-f.js";import"./castArray-Den3_6LQ.js";import"./debounce-qySOHK2f.js";import"./_baseIteratee-D64njDFX.js";import"./index-DMZjaLyD.js";import"./index-Cu41y2Fl.js";import"./index-Cl0U4sgn.js";const ke=E({name:"LayoutSeedream",components:{ElDrawer:W,ElButton:D,FontAwesomeIcon:C},data(){return{drawer:!1}}}),ye={class:"main flex flex-row flex-1"},we={class:"config w-[320px] h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},Se={class:"result h-full p-6 flex-1 flex flex-col bg-[var(--app-content-bg)]"};function Ie(e,t,d,c,h,p){const f=n("font-awesome-icon"),_=n("el-button"),r=n("el-drawer");return a(),i("div",ye,[l("div",we,[q(e.$slots,"config",{},void 0,!0)]),l("div",Se,[q(e.$slots,"result",{},void 0,!0)]),s(_,{circle:"",class:"menu",onClick:t[0]||(t[0]=m=>e.drawer=!0)},{default:g(()=>[s(f,{icon:"fa-solid fa-magic"})]),_:1}),s(r,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=m=>e.drawer=m),direction:"ltr","with-header":!1,size:"340px",class:"drawer"},{default:g(()=>[q(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Ve=k(ke,[["render",Ie],["__scopeId","data-v-5ff0c320"]]),Me="",Ae=E({name:"SeedreamPromptInput",components:{ElInput:le,InfoIcon:L},computed:{prompt:{get(){return this.$store.state.seedream?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=Me)}}),Le={class:"field"},Re={class:"box"},Te={class:"title font-bold"};function Ce(e,t,d,c,h,p){const f=n("info-icon"),_=n("el-input");return a(),i("div",Le,[l("div",Re,[l("h2",Te,o(e.$t("seedream.name.prompt")),1),s(f,{content:e.$t("seedream.description.prompt"),class:"info"},null,8,["content"])]),s(_,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=r=>e.prompt=r),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("seedream.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const De=k(Ae,[["render",Ce],["__scopeId","data-v-5559520a"]]),qe=E({name:"SeedreamImageInput",components:{ElUpload:ce,ElButton:D,InfoIcon:L,ImagePreview:F,FontAwesomeIcon:C},mixins:[ie],data(){return{fileList:[],uploadUrl:Z()+"/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}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){const c=(this.fileList||[]).filter(h=>!h?.response?.file_url);this.fileList=c.length?c:[];return}const t=[];e.forEach(c=>{const h=this.fileList.find(p=>p?.response?.file_url===c||p?.url===c);h?t.push(h):t.push({name:c.split("/").pop()||c,url:c,status:"success",percentage:100,response:{file_url:c}})}),(this.fileList||[]).filter(c=>!c?.response?.file_url).forEach(c=>{t.some(p=>p===c||p?.url===c?.url||p?.response?.file_url===c?.response?.file_url)||t.push(c)}),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(){I.warning(this.$t("seedream.message.uploadImageExceed"))},onError(){I.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={class:"field"},Ge={class:"label"},Ue={class:"box"},Pe={class:"title font-bold"},Oe={class:"value"},je={class:"file-list mt-2 flex flex-wrap gap-[10px]"};function Be(e,t,d,c,h,p){const f=n("info-icon"),_=n("font-awesome-icon"),r=n("el-button"),m=n("el-upload"),b=n("image-preview");return a(),i(y,null,[l("div",ze,[l("div",Ge,[l("div",Ue,[l("h2",Pe,o(e.$t("seedream.name.imageUrls")),1),s(f,{content:e.$t("seedream.description.imageUrls"),class:"info"},null,8,["content"])])]),l("div",Oe,[s(m,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=v=>e.fileList=v),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:g(()=>[s(r,{size:"small",type:"primary",round:""},{default:g(()=>[s(_,{icon:"fa-solid fa-upload",class:"mr-1"}),u(" "+o(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",je,[(a(!0),i(y,null,V(e.fileList,(v,S)=>(a(),w(b,{key:v.uid||v?.response?.file_url||v.url||S,url:v.url||v?.response?.file_url,name:v.name,percentage:v.percentage,onRemove:R=>e.onRemovePreview(S,v)},null,8,["url","name","percentage","onRemove"]))),128))])],64)}const Fe=k(qe,[["render",Be],["__scopeId","data-v-dc18c674"]]),xe=E({name:"SeedreamModelSelector",components:{ElSelect:N,ElOption:x,InfoIcon:L},data(){return{options:[{value:J,label:this.$t("seedream.model.seedream50")},{value:X,label:this.$t("seedream.model.seedream45")},{value:Q,label:this.$t("seedream.model.seedream40")},{value:Y,label:this.$t("seedream.model.seedream30t2i")},{value:ee,label:this.$t("seedream.model.seededit30i2i")}]}},computed:{value:{get(){return this.$store.state.seedream?.config?.model},set(e){this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,model:e})}}},mounted(){this.value||(this.value=H)}}),Ne={class:"field"},We={class:"label"},Ke={class:"box"},Ze={class:"title font-bold"};function He(e,t,d,c,h,p){const f=n("info-icon"),_=n("el-option"),r=n("el-select");return a(),i("div",Ne,[l("div",We,[l("div",Ke,[l("h2",Ze,o(e.$t("seedream.name.model")),1),s(f,{content:e.$t("seedream.description.model"),class:"info"},null,8,["content"])])]),s(r,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=m=>e.value=m),class:"value",placeholder:e.$t("seedream.placeholder.select")},{default:g(()=>[(a(!0),i(y,null,V(e.options,m=>(a(),w(_,{key:m.value,label:m.label,value:m.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Je=k(xe,[["render",He],["__scopeId","data-v-609ade55"]]),Xe=E({name:"SeedreamSizeSelector",components:{ElSelect:N,ElOption:x,InfoIcon:L},data(){return{options:[{value:z,label:z},{value:G,label:G},{value:U,label:U},{value:P,label:P}]}},computed:{value:{get(){return this.$store.state.seedream?.config?.size},set(e){this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,size:e})}}},mounted(){this.value||(this.value=te)}}),Qe={class:"field"},Ye={class:"label"},et={class:"box"},tt={class:"title font-bold"};function st(e,t,d,c,h,p){const f=n("info-icon"),_=n("el-option"),r=n("el-select");return a(),i("div",Qe,[l("div",Ye,[l("div",et,[l("h2",tt,o(e.$t("seedream.name.size")),1),s(f,{content:e.$t("seedream.description.size"),class:"info"},null,8,["content"])])]),s(r,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=m=>e.value=m),class:"value",placeholder:e.$t("seedream.placeholder.select"),filterable:"","allow-create":"","default-first-option":""},{default:g(()=>[(a(!0),i(y,null,V(e.options,m=>(a(),w(_,{key:m.value,label:m.label,value:m.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const ot=k(Xe,[["render",st],["__scopeId","data-v-44d5c9d9"]]),at=E({name:"SeedreamMaxImagesSelector",components:{ElInputNumber:ue,InfoIcon:L},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return oe(this.config?.model)},referenceImageCount(){const e=this.config?.image;return Array.isArray(e)?e.length:0},effectiveMax(){const e=O-this.referenceImageCount;return Math.max(1,Math.min(O,e))},value:{get(){const e=this.config?.sequential_image_generation_options?.max_images;return typeof e=="number"&&e>=1?e:se},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:{supported:{immediate:!0,handler(e){if(e)return;const t={...this.config||{}};let d=!1;t.sequential_image_generation&&(delete t.sequential_image_generation,d=!0),t.sequential_image_generation_options&&(delete t.sequential_image_generation_options,d=!0),d&&this.$store.commit("seedream/setConfig",t)}},effectiveMax(e){this.value>e&&(this.value=e)}}}),nt={key:0,class:"field"},rt={class:"label"},lt={class:"box"},it={class:"title font-bold"},ct={class:"value"};function mt(e,t,d,c,h,p){const f=n("info-icon"),_=n("el-input-number");return e.supported?(a(),i("div",nt,[l("div",rt,[l("div",lt,[l("h2",it,o(e.$t("seedream.name.maxImages")),1),s(f,{content:e.$t("seedream.description.maxImages"),class:"info"},null,8,["content"])])]),l("div",ct,[s(_,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=r=>e.value=r),min:1,max:e.effectiveMax,step:1,size:"default","controls-position":"right",class:"counter"},null,8,["modelValue","max"])])])):$("",!0)}const dt=k(at,[["render",mt],["__scopeId","data-v-17ef8d1a"]]),ut=E({name:"SeedreamConfigPanel",components:{ElButton:D,FontAwesomeIcon:C,PromptInput:De,Consumption:me,ImageInput:Fe,ModelSelector:Je,SizeSelector:ot,MaxImagesSelector:dt},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 de({...e,action:t?"edit":"generate",model:B(e?.model),count:d},this.service?.cost)},service(){return this.$store.state.seedream?.service}},methods:{onGenerate(){this.$emit("generate")}}}),pt={class:"flex flex-col h-full"},ft={class:"flex-1 overflow-y-auto p-5"},_t={class:"flex flex-col items-center justify-center px-5 pb-5"};function gt(e,t,d,c,h,p){const f=n("model-selector"),_=n("size-selector"),r=n("max-images-selector"),m=n("prompt-input"),b=n("image-input"),v=n("consumption"),S=n("font-awesome-icon"),R=n("el-button");return a(),i("div",pt,[l("div",ft,[s(f,{class:"mb-4"}),s(_,{class:"mb-4"}),s(r,{class:"mb-4"}),s(m,{class:"mb-4"}),s(b,{class:"mb-4"})]),l("div",_t,[s(v,{value:e.consumption,service:e.service},null,8,["value","service"]),s(R,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:g(()=>[s(S,{icon:"fa-solid fa-magic",class:"mr-2"}),u(" "+o(e.$t("seedream.button.generate")),1)]),_:1},8,["onClick"])])])}const ht=k(ut,[["render",gt]]),$t=E({name:"SeedreamTaskPreview",components:{ElImage:ve,CopyToClipboard:_e,FontAwesomeIcon:C,ElAlert:$e,ImageWrapper:ge,ElButton:D,ElTooltip:he,ImagePreview:F},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 B(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)}}}),vt={class:"preview"},bt={class:"left"},Et={class:"main"},kt={class:"bot"},yt={class:"datetime"},wt={class:"info"},St={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},It={key:1,class:"prompt mt-2"},Vt={key:0},Mt={key:0,class:A({content:!0})},At={class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Lt={key:1,class:A({content:!0,failed:!0})},Rt={class:"flex justify-start items-center gap-4 w-full overflow-x-auto"},Tt={class:A({operations:!0,"mt-2":!0,"mb-2":!0})},Ct={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Dt={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},qt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},zt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Gt={key:2,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ut={key:3,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Pt={key:2,class:A({content:!0})},Ot={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},jt={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Bt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ft={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},xt={key:2,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Nt={key:3,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Wt={key:4,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Kt={key:3,class:A({content:!0})},Zt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ht={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Jt(e,t,d,c,h,p){const f=n("el-image"),_=n("image-preview"),r=n("font-awesome-icon"),m=n("copy-to-clipboard"),b=n("el-alert"),v=n("image-wrapper"),S=n("el-button"),R=n("el-tooltip");return a(),i("div",vt,[l("div",bt,[s(f,{src:"https://cdn.acedata.cloud/9egrbn.png",class:"avatar"})]),l("div",Et,[l("div",kt,[u(o(e.$t("seedream.name.seedreamBot"))+" ",1),l("span",yt,o(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),l("div",wt,[Array.isArray(e.modelValue?.request?.image)&&e.modelValue?.request?.image.length>0?(a(),i("div",St,[(a(!0),i(y,null,V(e.modelValue?.request?.image,(M,T)=>(a(),w(_,{key:T,url:M,name:`image-${T+1}`,closable:!1},null,8,["url","name"]))),128))])):$("",!0),e.modelValue?.request?.prompt?(a(),i("p",It,[u(o(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?$("",!0):(a(),i("span",Vt," - ("+o(e.$t("seedream.status.pending"))+") ",1))])):$("",!0)]),e.modelValue?.response?e.modelValue?.response?.success===!0?(a(),i("div",Lt,[l("div",Rt,[(a(!0),i(y,null,V(e.images,(M,T)=>(a(),w(v,{key:T,src:M?.image_url,"raw-src":M?.image_url},null,8,["src","raw-src"]))),128))]),l("div",Tt,[s(R,{class:"box-item",effect:"dark",content:e.$t("common.button.edit"),placement:"top-start"},{default:g(()=>[s(S,{type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=K(M=>e.onEdit(e.images?.[0]?.image_url),["stop"]))},{default:g(()=>[u(o(e.$t("common.button.edit")),1)]),_:1})]),_:1},8,["content"])]),s(b,{closable:!1,class:"mt-2 success"},{default:g(()=>[e.modelValue?.request?.model?(a(),i("p",Ct,[s(r,{icon:"fa-solid fa-cube",class:"mr-1"}),u(" "+o(e.$t("seedream.name.model"))+": "+o(e.shortModel(e.modelValue?.request?.model)),1)])):$("",!0),e.modelValue?.request?.size?(a(),i("p",Dt,[s(r,{icon:"fa-solid fa-image",class:"mr-1"}),u(" "+o(e.$t("seedream.name.size"))+": "+o(e.modelValue?.request?.size),1)])):$("",!0),l("p",qt,[s(r,{icon:"fa-solid fa-bolt",class:"mr-1"}),u(" "+o(e.$t("seedream.name.task"))+": "+o(e.isEdit?e.$t("seedream.name.edits"):e.$t("seedream.name.generate")),1)]),l("p",zt,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])]),e.modelValue?.elapsed?(a(),i("p",Gt,[s(r,{icon:"fa-solid fa-clock",class:"mr-1"}),u(" "+o(e.$t("seedream.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0),e.modelValue?.response?.trace_id?(a(),i("p",Ut,[s(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),u(" "+o(e.$t("seedream.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),s(m,{content:e.modelValue?.response?.trace_id,class:"btn-copy inline-block"},null,8,["content"])])):$("",!0)]),_:1})])):e.modelValue?.response?.success===!1?(a(),i("div",Pt,[s(b,{closable:!1,class:"failure"},{template:g(()=>[s(r,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),u(" "+o(e.$t("seedream.name.failure")),1)]),default:g(()=>[e.modelValue?.request?.model?(a(),i("p",Ot,[s(r,{icon:"fa-solid fa-cube",class:"mr-1"}),u(" "+o(e.$t("seedream.name.model"))+": "+o(e.shortModel(e.modelValue?.request?.model)),1)])):$("",!0),e.modelValue?.request?.size?(a(),i("p",jt,[s(r,{icon:"fa-solid fa-image",class:"mr-1"}),u(" "+o(e.$t("seedream.name.size"))+": "+o(e.modelValue?.request?.size),1)])):$("",!0),l("p",Bt,[s(r,{icon:"fa-solid fa-bolt",class:"mr-1"}),u(" "+o(e.$t("seedream.name.task"))+": "+o(e.isEdit?e.$t("seedream.name.edits"):e.$t("seedream.name.generate")),1)]),l("p",Ft,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.response?.error?.message?(a(),i("p",xt,[s(r,{icon:"fa-solid fa-circle-info",class:"mr-1"}),u(" "+o(e.$t("seedream.name.failureReason"))+": "+o(e.modelValue?.response?.error?.message)+" ",1),s(m,{content:e.modelValue?.response?.error?.message,class:"btn-copy"},null,8,["content"])])):$("",!0),e.modelValue?.elapsed?(a(),i("p",Nt,[s(r,{icon:"fa-solid fa-clock",class:"mr-1"}),u(" "+o(e.$t("seedream.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0),e.modelValue?.response?.trace_id?(a(),i("p",Wt,[s(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),u(" "+o(e.$t("seedream.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),s(m,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])):$("",!0)]),_:1})])):(a(),i("div",Kt,[s(b,{closable:!1,class:"info"},{template:g(()=>[s(r,{icon:"fa-solid fa-circle-info",class:"mr-1"}),u(" "+o(e.$t("seedream.name.status")),1)]),default:g(()=>[l("p",Zt,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.response?.trace_id?(a(),i("p",Ht,[s(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),u(" "+o(e.$t("seedream.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),s(m,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])):$("",!0)]),_:1})])):(a(),i("div",Mt,[s(b,{closable:!1,class:"info"},{template:g(()=>[s(r,{icon:"fa-regular fa-clock",class:"mr-1"}),u(" "+o(e.$t("seedream.status.pending")),1)]),default:g(()=>[l("p",At,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])])]),_:1})]))])])}const Xt=k($t,[["render",Jt],["__scopeId","data-v-0dfc6a09"]]),Qt=E({name:"SeedreamRecentPanel",components:{TaskPreview:Xt,BotPlaceholder:be,NoTasks:Ee,ScrollList:ne},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?.()}}}),Yt={key:0},es={key:2,class:"w-full h-full flex items-center justify-center"};function ts(e,t,d,c,h,p){const f=n("bot-placeholder"),_=n("task-preview"),r=n("scroll-list"),m=n("no-tasks");return a(),i(y,null,[e.tasks?.items===void 0?(a(),i("div",Yt,[s(f)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(a(),w(r,{key:1,ref:"scrollList",class:"tasks h-full w-full overflow-y-auto",loading:e.loading,onReachTop:t[0]||(t[0]=b=>e.$emit("reach-top"))},{default:g(()=>[(a(!0),i(y,null,V(e.tasks?.items,b=>(a(),w(_,{key:b.id,"model-value":b},null,8,["model-value"]))),128))]),_:1},8,["loading"])):$("",!0),e.tasks?.items?.length===0?(a(),i("div",es,[s(m)])):$("",!0)],64)}const ss=k(Qt,[["render",ts]]),os="https://webhook.acedata.cloud/seedream",as=E({name:"SeedreamIndex",components:{ConfigPanel:ht,Layout:Ve,RecentPanel:ss},inject:["initialized"],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.seedream?.status?.getApplications===j.Request},tasksLoading(){return this.$store.state.seedream?.status?.getTasks===j.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 re({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:c}=e||{};console.debug("limit",t,"createdAtMin",d,"createdAtMax",c),await this.$store.dispatch("seedream/getTasks",{limit:t,createdAtMin:d,createdAtMax:c})},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:os},c=this.credential?.token;if(!c){console.error("no token specified");return}I.info(this.$t("seedream.message.startingTask")),ae("seedream",fe.generate(d,{token:c})).then(()=>{I.success(this.$t("seedream.message.startTaskSuccess"))}).catch(h=>{const p=h?.response?.data;p?.error?.code===pe?I.error(this.$t("seedream.message.usedUp")):I.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 ns(e,t,d,c,h,p){const f=n("config-panel"),_=n("recent-panel"),r=n("layout");return a(),w(r,null,{config:g(()=>[s(f,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:g(()=>[s(_,{ref:"recentPanel",loading:e.loading,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Xs=k(as,[["render",ns]]);export{Xs as default};
|
|
1
|
+
import{F as C}from"./index.es-Dj9Wy0z7.js";import{E as D}from"./index-D_tYpdWX.js";import{E as W}from"./index-DHmtS4Ao.js";import{d as E,H as i,E as l,z as q,C as s,y as g,D as n,q as a,F as o,I as u,O as y,N as V,x as w,J as $,M as K,Q as A}from"./vendor-vue-NSDaktjZ.js";import{E as k,b7 as Z,cB as H,cC as J,cD as X,cE as Q,cF as Y,cG as ee,cH as te,cI as z,cJ as G,cK as U,cL as P,cM as se,cN as O,cO as oe,cP as B,cd as ae,aw as j}from"./index-R1yPGE-K.js";import{I as L,S as ne,l as re}from"./pagination-Dk6EMJPI.js";import{E as le}from"./index-BcFKKIUX.js";import{p as ie}from"./pasteUploadMixin-BurWbGNQ.js";import{I as F}from"./ImagePreview-HgasgWaO.js";import{E as ce}from"./index-2f4k1cBC.js";import{E as I}from"./index-v6GVmx9u.js";import{C as me}from"./Consumption-B7VhIhqT.js";import{a as de}from"./price-D01Whf9j.js";import{E as x,a as N}from"./index-DPFomByA.js";import{E as ue}from"./index-TLFtrkXP.js";import{b as pe}from"./errorCode-Cqj9Td_Z.js";import{s as fe}from"./seedream-DX8rHHuo.js";import{C as _e}from"./CopyToClipboard-CjTKb5D7.js";import{I as ge}from"./ImageWrapper-BPSX8LpN.js";import{E as he}from"./index-TJe5wIf-.js";import{E as $e}from"./index-CwjV6n_U.js";import{E as ve}from"./index-WWnbhW6C.js";import{B as be}from"./BotPlaceholder-CNmFsyHW.js";import{N as Ee}from"./NoTasks-lh6VlwMM.js";import"./use-form-item-_IfxE0T4.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./typescript-DAmrEi8b.js";import"./index-BTzdyisK.js";import"./index-CiLK9hZH.js";import"./index-DhSkah7J.js";import"./_baseClone-BH5bAI4w.js";import"./_Uint8Array-zPfACQFm.js";import"./_initCloneObject-DNcVRVtY.js";import"./isEqual-DPhKVN6J.js";import"./index-q8T9ydUq.js";import"./strings-beZM2Y-f.js";import"./castArray-B6RNe9d9.js";import"./debounce-Bgvad3gW.js";import"./_baseIteratee-BDYveGWO.js";import"./index-B5KTk9zq.js";import"./index-Cu41y2Fl.js";import"./index-CxX6Br5p.js";const ke=E({name:"LayoutSeedream",components:{ElDrawer:W,ElButton:D,FontAwesomeIcon:C},data(){return{drawer:!1}}}),ye={class:"main flex flex-row flex-1"},we={class:"config w-[320px] h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},Se={class:"result h-full p-6 flex-1 flex flex-col bg-[var(--app-content-bg)]"};function Ie(e,t,d,c,h,p){const f=n("font-awesome-icon"),_=n("el-button"),r=n("el-drawer");return a(),i("div",ye,[l("div",we,[q(e.$slots,"config",{},void 0,!0)]),l("div",Se,[q(e.$slots,"result",{},void 0,!0)]),s(_,{circle:"",class:"menu",onClick:t[0]||(t[0]=m=>e.drawer=!0)},{default:g(()=>[s(f,{icon:"fa-solid fa-magic"})]),_:1}),s(r,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=m=>e.drawer=m),direction:"ltr","with-header":!1,size:"340px",class:"drawer"},{default:g(()=>[q(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Ve=k(ke,[["render",Ie],["__scopeId","data-v-5ff0c320"]]),Me="",Ae=E({name:"SeedreamPromptInput",components:{ElInput:le,InfoIcon:L},computed:{prompt:{get(){return this.$store.state.seedream?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=Me)}}),Le={class:"field"},Re={class:"box"},Te={class:"title font-bold"};function Ce(e,t,d,c,h,p){const f=n("info-icon"),_=n("el-input");return a(),i("div",Le,[l("div",Re,[l("h2",Te,o(e.$t("seedream.name.prompt")),1),s(f,{content:e.$t("seedream.description.prompt"),class:"info"},null,8,["content"])]),s(_,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=r=>e.prompt=r),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("seedream.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const De=k(Ae,[["render",Ce],["__scopeId","data-v-5559520a"]]),qe=E({name:"SeedreamImageInput",components:{ElUpload:ce,ElButton:D,InfoIcon:L,ImagePreview:F,FontAwesomeIcon:C},mixins:[ie],data(){return{fileList:[],uploadUrl:Z()+"/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}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){const c=(this.fileList||[]).filter(h=>!h?.response?.file_url);this.fileList=c.length?c:[];return}const t=[];e.forEach(c=>{const h=this.fileList.find(p=>p?.response?.file_url===c||p?.url===c);h?t.push(h):t.push({name:c.split("/").pop()||c,url:c,status:"success",percentage:100,response:{file_url:c}})}),(this.fileList||[]).filter(c=>!c?.response?.file_url).forEach(c=>{t.some(p=>p===c||p?.url===c?.url||p?.response?.file_url===c?.response?.file_url)||t.push(c)}),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(){I.warning(this.$t("seedream.message.uploadImageExceed"))},onError(){I.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={class:"field"},Ge={class:"label"},Ue={class:"box"},Pe={class:"title font-bold"},Oe={class:"value"},je={class:"file-list mt-2 flex flex-wrap gap-[10px]"};function Be(e,t,d,c,h,p){const f=n("info-icon"),_=n("font-awesome-icon"),r=n("el-button"),m=n("el-upload"),b=n("image-preview");return a(),i(y,null,[l("div",ze,[l("div",Ge,[l("div",Ue,[l("h2",Pe,o(e.$t("seedream.name.imageUrls")),1),s(f,{content:e.$t("seedream.description.imageUrls"),class:"info"},null,8,["content"])])]),l("div",Oe,[s(m,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=v=>e.fileList=v),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:g(()=>[s(r,{size:"small",type:"primary",round:""},{default:g(()=>[s(_,{icon:"fa-solid fa-upload",class:"mr-1"}),u(" "+o(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",je,[(a(!0),i(y,null,V(e.fileList,(v,S)=>(a(),w(b,{key:v.uid||v?.response?.file_url||v.url||S,url:v.url||v?.response?.file_url,name:v.name,percentage:v.percentage,onRemove:R=>e.onRemovePreview(S,v)},null,8,["url","name","percentage","onRemove"]))),128))])],64)}const Fe=k(qe,[["render",Be],["__scopeId","data-v-dc18c674"]]),xe=E({name:"SeedreamModelSelector",components:{ElSelect:N,ElOption:x,InfoIcon:L},data(){return{options:[{value:J,label:this.$t("seedream.model.seedream50")},{value:X,label:this.$t("seedream.model.seedream45")},{value:Q,label:this.$t("seedream.model.seedream40")},{value:Y,label:this.$t("seedream.model.seedream30t2i")},{value:ee,label:this.$t("seedream.model.seededit30i2i")}]}},computed:{value:{get(){return this.$store.state.seedream?.config?.model},set(e){this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,model:e})}}},mounted(){this.value||(this.value=H)}}),Ne={class:"field"},We={class:"label"},Ke={class:"box"},Ze={class:"title font-bold"};function He(e,t,d,c,h,p){const f=n("info-icon"),_=n("el-option"),r=n("el-select");return a(),i("div",Ne,[l("div",We,[l("div",Ke,[l("h2",Ze,o(e.$t("seedream.name.model")),1),s(f,{content:e.$t("seedream.description.model"),class:"info"},null,8,["content"])])]),s(r,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=m=>e.value=m),class:"value",placeholder:e.$t("seedream.placeholder.select")},{default:g(()=>[(a(!0),i(y,null,V(e.options,m=>(a(),w(_,{key:m.value,label:m.label,value:m.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Je=k(xe,[["render",He],["__scopeId","data-v-609ade55"]]),Xe=E({name:"SeedreamSizeSelector",components:{ElSelect:N,ElOption:x,InfoIcon:L},data(){return{options:[{value:z,label:z},{value:G,label:G},{value:U,label:U},{value:P,label:P}]}},computed:{value:{get(){return this.$store.state.seedream?.config?.size},set(e){this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,size:e})}}},mounted(){this.value||(this.value=te)}}),Qe={class:"field"},Ye={class:"label"},et={class:"box"},tt={class:"title font-bold"};function st(e,t,d,c,h,p){const f=n("info-icon"),_=n("el-option"),r=n("el-select");return a(),i("div",Qe,[l("div",Ye,[l("div",et,[l("h2",tt,o(e.$t("seedream.name.size")),1),s(f,{content:e.$t("seedream.description.size"),class:"info"},null,8,["content"])])]),s(r,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=m=>e.value=m),class:"value",placeholder:e.$t("seedream.placeholder.select"),filterable:"","allow-create":"","default-first-option":""},{default:g(()=>[(a(!0),i(y,null,V(e.options,m=>(a(),w(_,{key:m.value,label:m.label,value:m.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const ot=k(Xe,[["render",st],["__scopeId","data-v-44d5c9d9"]]),at=E({name:"SeedreamMaxImagesSelector",components:{ElInputNumber:ue,InfoIcon:L},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return oe(this.config?.model)},referenceImageCount(){const e=this.config?.image;return Array.isArray(e)?e.length:0},effectiveMax(){const e=O-this.referenceImageCount;return Math.max(1,Math.min(O,e))},value:{get(){const e=this.config?.sequential_image_generation_options?.max_images;return typeof e=="number"&&e>=1?e:se},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:{supported:{immediate:!0,handler(e){if(e)return;const t={...this.config||{}};let d=!1;t.sequential_image_generation&&(delete t.sequential_image_generation,d=!0),t.sequential_image_generation_options&&(delete t.sequential_image_generation_options,d=!0),d&&this.$store.commit("seedream/setConfig",t)}},effectiveMax(e){this.value>e&&(this.value=e)}}}),nt={key:0,class:"field"},rt={class:"label"},lt={class:"box"},it={class:"title font-bold"},ct={class:"value"};function mt(e,t,d,c,h,p){const f=n("info-icon"),_=n("el-input-number");return e.supported?(a(),i("div",nt,[l("div",rt,[l("div",lt,[l("h2",it,o(e.$t("seedream.name.maxImages")),1),s(f,{content:e.$t("seedream.description.maxImages"),class:"info"},null,8,["content"])])]),l("div",ct,[s(_,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=r=>e.value=r),min:1,max:e.effectiveMax,step:1,size:"default","controls-position":"right",class:"counter"},null,8,["modelValue","max"])])])):$("",!0)}const dt=k(at,[["render",mt],["__scopeId","data-v-17ef8d1a"]]),ut=E({name:"SeedreamConfigPanel",components:{ElButton:D,FontAwesomeIcon:C,PromptInput:De,Consumption:me,ImageInput:Fe,ModelSelector:Je,SizeSelector:ot,MaxImagesSelector:dt},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 de({...e,action:t?"edit":"generate",model:B(e?.model),count:d},this.service?.cost)},service(){return this.$store.state.seedream?.service}},methods:{onGenerate(){this.$emit("generate")}}}),pt={class:"flex flex-col h-full"},ft={class:"flex-1 overflow-y-auto p-5"},_t={class:"flex flex-col items-center justify-center px-5 pb-5"};function gt(e,t,d,c,h,p){const f=n("model-selector"),_=n("size-selector"),r=n("max-images-selector"),m=n("prompt-input"),b=n("image-input"),v=n("consumption"),S=n("font-awesome-icon"),R=n("el-button");return a(),i("div",pt,[l("div",ft,[s(f,{class:"mb-4"}),s(_,{class:"mb-4"}),s(r,{class:"mb-4"}),s(m,{class:"mb-4"}),s(b,{class:"mb-4"})]),l("div",_t,[s(v,{value:e.consumption,service:e.service},null,8,["value","service"]),s(R,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:g(()=>[s(S,{icon:"fa-solid fa-magic",class:"mr-2"}),u(" "+o(e.$t("seedream.button.generate")),1)]),_:1},8,["onClick"])])])}const ht=k(ut,[["render",gt]]),$t=E({name:"SeedreamTaskPreview",components:{ElImage:ve,CopyToClipboard:_e,FontAwesomeIcon:C,ElAlert:$e,ImageWrapper:ge,ElButton:D,ElTooltip:he,ImagePreview:F},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 B(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)}}}),vt={class:"preview"},bt={class:"left"},Et={class:"main"},kt={class:"bot"},yt={class:"datetime"},wt={class:"info"},St={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},It={key:1,class:"prompt mt-2"},Vt={key:0},Mt={key:0,class:A({content:!0})},At={class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Lt={key:1,class:A({content:!0,failed:!0})},Rt={class:"flex justify-start items-center gap-4 w-full overflow-x-auto"},Tt={class:A({operations:!0,"mt-2":!0,"mb-2":!0})},Ct={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Dt={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},qt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},zt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Gt={key:2,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ut={key:3,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Pt={key:2,class:A({content:!0})},Ot={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},jt={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Bt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ft={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},xt={key:2,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Nt={key:3,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Wt={key:4,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Kt={key:3,class:A({content:!0})},Zt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ht={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Jt(e,t,d,c,h,p){const f=n("el-image"),_=n("image-preview"),r=n("font-awesome-icon"),m=n("copy-to-clipboard"),b=n("el-alert"),v=n("image-wrapper"),S=n("el-button"),R=n("el-tooltip");return a(),i("div",vt,[l("div",bt,[s(f,{src:"https://cdn.acedata.cloud/9egrbn.png",class:"avatar"})]),l("div",Et,[l("div",kt,[u(o(e.$t("seedream.name.seedreamBot"))+" ",1),l("span",yt,o(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),l("div",wt,[Array.isArray(e.modelValue?.request?.image)&&e.modelValue?.request?.image.length>0?(a(),i("div",St,[(a(!0),i(y,null,V(e.modelValue?.request?.image,(M,T)=>(a(),w(_,{key:T,url:M,name:`image-${T+1}`,closable:!1},null,8,["url","name"]))),128))])):$("",!0),e.modelValue?.request?.prompt?(a(),i("p",It,[u(o(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?$("",!0):(a(),i("span",Vt," - ("+o(e.$t("seedream.status.pending"))+") ",1))])):$("",!0)]),e.modelValue?.response?e.modelValue?.response?.success===!0?(a(),i("div",Lt,[l("div",Rt,[(a(!0),i(y,null,V(e.images,(M,T)=>(a(),w(v,{key:T,src:M?.image_url,"raw-src":M?.image_url},null,8,["src","raw-src"]))),128))]),l("div",Tt,[s(R,{class:"box-item",effect:"dark",content:e.$t("common.button.edit"),placement:"top-start"},{default:g(()=>[s(S,{type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=K(M=>e.onEdit(e.images?.[0]?.image_url),["stop"]))},{default:g(()=>[u(o(e.$t("common.button.edit")),1)]),_:1})]),_:1},8,["content"])]),s(b,{closable:!1,class:"mt-2 success"},{default:g(()=>[e.modelValue?.request?.model?(a(),i("p",Ct,[s(r,{icon:"fa-solid fa-cube",class:"mr-1"}),u(" "+o(e.$t("seedream.name.model"))+": "+o(e.shortModel(e.modelValue?.request?.model)),1)])):$("",!0),e.modelValue?.request?.size?(a(),i("p",Dt,[s(r,{icon:"fa-solid fa-image",class:"mr-1"}),u(" "+o(e.$t("seedream.name.size"))+": "+o(e.modelValue?.request?.size),1)])):$("",!0),l("p",qt,[s(r,{icon:"fa-solid fa-bolt",class:"mr-1"}),u(" "+o(e.$t("seedream.name.task"))+": "+o(e.isEdit?e.$t("seedream.name.edits"):e.$t("seedream.name.generate")),1)]),l("p",zt,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])]),e.modelValue?.elapsed?(a(),i("p",Gt,[s(r,{icon:"fa-solid fa-clock",class:"mr-1"}),u(" "+o(e.$t("seedream.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0),e.modelValue?.response?.trace_id?(a(),i("p",Ut,[s(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),u(" "+o(e.$t("seedream.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),s(m,{content:e.modelValue?.response?.trace_id,class:"btn-copy inline-block"},null,8,["content"])])):$("",!0)]),_:1})])):e.modelValue?.response?.success===!1?(a(),i("div",Pt,[s(b,{closable:!1,class:"failure"},{template:g(()=>[s(r,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),u(" "+o(e.$t("seedream.name.failure")),1)]),default:g(()=>[e.modelValue?.request?.model?(a(),i("p",Ot,[s(r,{icon:"fa-solid fa-cube",class:"mr-1"}),u(" "+o(e.$t("seedream.name.model"))+": "+o(e.shortModel(e.modelValue?.request?.model)),1)])):$("",!0),e.modelValue?.request?.size?(a(),i("p",jt,[s(r,{icon:"fa-solid fa-image",class:"mr-1"}),u(" "+o(e.$t("seedream.name.size"))+": "+o(e.modelValue?.request?.size),1)])):$("",!0),l("p",Bt,[s(r,{icon:"fa-solid fa-bolt",class:"mr-1"}),u(" "+o(e.$t("seedream.name.task"))+": "+o(e.isEdit?e.$t("seedream.name.edits"):e.$t("seedream.name.generate")),1)]),l("p",Ft,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.response?.error?.message?(a(),i("p",xt,[s(r,{icon:"fa-solid fa-circle-info",class:"mr-1"}),u(" "+o(e.$t("seedream.name.failureReason"))+": "+o(e.modelValue?.response?.error?.message)+" ",1),s(m,{content:e.modelValue?.response?.error?.message,class:"btn-copy"},null,8,["content"])])):$("",!0),e.modelValue?.elapsed?(a(),i("p",Nt,[s(r,{icon:"fa-solid fa-clock",class:"mr-1"}),u(" "+o(e.$t("seedream.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0),e.modelValue?.response?.trace_id?(a(),i("p",Wt,[s(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),u(" "+o(e.$t("seedream.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),s(m,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])):$("",!0)]),_:1})])):(a(),i("div",Kt,[s(b,{closable:!1,class:"info"},{template:g(()=>[s(r,{icon:"fa-solid fa-circle-info",class:"mr-1"}),u(" "+o(e.$t("seedream.name.status")),1)]),default:g(()=>[l("p",Zt,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.response?.trace_id?(a(),i("p",Ht,[s(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),u(" "+o(e.$t("seedream.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),s(m,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])):$("",!0)]),_:1})])):(a(),i("div",Mt,[s(b,{closable:!1,class:"info"},{template:g(()=>[s(r,{icon:"fa-regular fa-clock",class:"mr-1"}),u(" "+o(e.$t("seedream.status.pending")),1)]),default:g(()=>[l("p",At,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])])]),_:1})]))])])}const Xt=k($t,[["render",Jt],["__scopeId","data-v-0dfc6a09"]]),Qt=E({name:"SeedreamRecentPanel",components:{TaskPreview:Xt,BotPlaceholder:be,NoTasks:Ee,ScrollList:ne},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?.()}}}),Yt={key:0},es={key:2,class:"w-full h-full flex items-center justify-center"};function ts(e,t,d,c,h,p){const f=n("bot-placeholder"),_=n("task-preview"),r=n("scroll-list"),m=n("no-tasks");return a(),i(y,null,[e.tasks?.items===void 0?(a(),i("div",Yt,[s(f)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(a(),w(r,{key:1,ref:"scrollList",class:"tasks h-full w-full overflow-y-auto",loading:e.loading,onReachTop:t[0]||(t[0]=b=>e.$emit("reach-top"))},{default:g(()=>[(a(!0),i(y,null,V(e.tasks?.items,b=>(a(),w(_,{key:b.id,"model-value":b},null,8,["model-value"]))),128))]),_:1},8,["loading"])):$("",!0),e.tasks?.items?.length===0?(a(),i("div",es,[s(m)])):$("",!0)],64)}const ss=k(Qt,[["render",ts]]),os="https://webhook.acedata.cloud/seedream",as=E({name:"SeedreamIndex",components:{ConfigPanel:ht,Layout:Ve,RecentPanel:ss},inject:["initialized"],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.seedream?.status?.getApplications===j.Request},tasksLoading(){return this.$store.state.seedream?.status?.getTasks===j.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 re({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:c}=e||{};console.debug("limit",t,"createdAtMin",d,"createdAtMax",c),await this.$store.dispatch("seedream/getTasks",{limit:t,createdAtMin:d,createdAtMax:c})},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:os},c=this.credential?.token;if(!c){console.error("no token specified");return}I.info(this.$t("seedream.message.startingTask")),ae("seedream",fe.generate(d,{token:c})).then(()=>{I.success(this.$t("seedream.message.startTaskSuccess"))}).catch(h=>{const p=h?.response?.data;p?.error?.code===pe?I.error(this.$t("seedream.message.usedUp")):I.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 ns(e,t,d,c,h,p){const f=n("config-panel"),_=n("recent-panel"),r=n("layout");return a(),w(r,null,{config:g(()=>[s(f,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:g(()=>[s(_,{ref:"recentPanel",loading:e.loading,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Xs=k(as,[["render",ns]]);export{Xs as default};
|