@acedatacloud/nexior 3.108.0 → 3.110.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-zVS5e1Dk.js → Auth-CZBUsR-8.js} +1 -1
- package/dist/assets/{BotPlaceholder-PAjP823v.js → BotPlaceholder-808fKlrc.js} +1 -1
- package/dist/assets/{Callback-YdLWzI1c.js → Callback-BCw34S4I.js} +1 -1
- package/dist/assets/Console-DPEMhi7m.js +1 -0
- package/dist/assets/{Consumption-DtKxSOW0.js → Consumption-D8o6ZGlD.js} +1 -1
- package/dist/assets/{Conversation-DKKL2eDr.js → Conversation-BQ_U-I9L.js} +7 -7
- package/dist/assets/{CopyToClipboard-D8MfLJZp.js → CopyToClipboard-99x8TU_E.js} +1 -1
- package/dist/assets/{Detail-BJ3NxO0t.js → Detail-BTbBX_0l.js} +2 -2
- package/dist/assets/EditArray-BodaIya6.js +1 -0
- package/dist/assets/{Extra-BMK-v91O.js → Extra-CUrRwWxs.js} +1 -1
- package/dist/assets/{FilePreview-Bo7MaLrW.js → FilePreview-BMrbMk0x.js} +1 -1
- package/dist/assets/{History-BIQ2m0vZ.js → History-ZibpTepi.js} +1 -1
- package/dist/assets/IconPark.vue_vue_type_script_setup_true_lang-BF3qQycP.js +1 -0
- package/dist/assets/{ImagePreview-Dh9-XvKp.js → ImagePreview-B7ddO4K-.js} +1 -1
- package/dist/assets/{ImageWrapper-DPBNLYFT.js → ImageWrapper-B4mqUlhx.js} +1 -1
- package/dist/assets/{Index-D0je4Hb5.css → Index-BDmY1SY6.css} +1 -1
- package/dist/assets/{Index-0BNr41li.js → Index-BHFKdAzq.js} +1 -1
- package/dist/assets/{Index-LlYUHORU.js → Index-BIDqjbbO.js} +1 -1
- package/dist/assets/{Index-BWsajPgD.js → Index-Bg2Zm6-5.js} +1 -1
- package/dist/assets/{Index-DedaKs1r.js → Index-BpUiKoDK.js} +1 -1
- package/dist/assets/{Index-DuU78Uug.js → Index-C1xSniax.js} +1 -1
- package/dist/assets/{Index-BhbLi2Wu.js → Index-CK59qCoD.js} +1 -1
- package/dist/assets/{Index-DX6hm6OG.js → Index-CKjQDdoM.js} +1 -1
- package/dist/assets/Index-CSso_LoA.js +1 -0
- package/dist/assets/{Index-HxTiuRA7.js → Index-CUQg6KBW.js} +1 -1
- package/dist/assets/Index-CdKg1Y3u.js +1 -0
- package/dist/assets/{Index-Dsz19JNR.js → Index-CgdNSbRG.js} +1 -1
- package/dist/assets/{Index-C4f-sAnz.js → Index-CjcUhG9o.js} +2 -2
- package/dist/assets/{Index-77a4rojZ.js → Index-CjvSntWd.js} +1 -1
- package/dist/assets/Index-Ck00cdj3.js +1 -0
- package/dist/assets/{Index-C371szRa.js → Index-DCsM3bGF.js} +1 -1
- package/dist/assets/{Index-DH7JortT.js → Index-DEnL8MY5.js} +1 -1
- package/dist/assets/{Index-BDbVNS0t.js → Index-DHRBWrtm.js} +1 -1
- package/dist/assets/{Index-DfC96PCx.js → Index-DUe_N0MN.js} +1 -1
- package/dist/assets/{Index-eJDUZOqx.js → Index-DZEI8Sn1.js} +1 -1
- package/dist/assets/{Index-DPg6ghUo.js → Index-DpUp9_s9.js} +1 -1
- package/dist/assets/Index-Fco5LKSK.js +1 -0
- package/dist/assets/{Index-BzYCSO-B.js → Index-GcemLKVi.js} +1 -1
- package/dist/assets/{Index-Du3G-yxP.js → Index-RB9xEjUG.js} +1 -1
- package/dist/assets/{Index-BUhhttiR.js → Index-rd81kAqo.js} +1 -1
- package/dist/assets/Invitees-BvTLQ2Dx.js +1 -0
- package/dist/assets/{List-C6qESiDX.js → List-CzCbV2RI.js} +1 -1
- package/dist/assets/List-DrRSr6rf.js +1 -0
- package/dist/assets/{List-C7m0Yi5O.js → List-DxmG5Fsu.js} +1 -1
- package/dist/assets/Main-DAOxrJFm.js +1 -0
- package/dist/assets/Navigator-7tnlvMe5.js +1 -0
- package/dist/assets/Navigator-pY9n2Xr_.css +1 -0
- package/dist/assets/{NoTasks-DqYFgS_3.js → NoTasks-CzCoCJiJ.js} +1 -1
- package/dist/assets/{NotFound-D1e-3ova.js → NotFound-1k_dya0M.js} +1 -1
- package/dist/assets/{OAuthCallback-BgBZC5Lx.js → OAuthCallback-D2YKjyo8.js} +1 -1
- package/dist/assets/Pagination-BmrVtAe2.js +1 -0
- package/dist/assets/{ScrollList-CLSW3Dbs.js → ScrollList-CHr2ER0d.js} +1 -1
- package/dist/assets/{Status-CCKc1DDl.js → Status-BtwLPzrZ.js} +1 -1
- package/dist/assets/{Subscribe-CIaSSZ8X.js → Subscribe-DNcY8cWa.js} +1 -1
- package/dist/assets/{TransportWebHID-BQ0-asjx.js → TransportWebHID-BiNkPg4j.js} +1 -1
- package/dist/assets/{VideoPlayer-e--8Rl5J.js → VideoPlayer-BJPVVH4v.js} +1 -1
- package/dist/assets/{_Uint8Array-BtL2weNZ.js → _Uint8Array-BWy8cKCo.js} +1 -1
- package/dist/assets/{_baseClone-CLa2JSau.js → _baseClone-CVDR-yNh.js} +1 -1
- package/dist/assets/{_baseIteratee-D4xvLM3s.js → _baseIteratee-GCheQ423.js} +1 -1
- package/dist/assets/{_initCloneObject-toOyHWRX.js → _initCloneObject-BnGf6y2Q.js} +1 -1
- package/dist/assets/{add-Cdy5BqQn.js → add-CkjK2xW1.js} +1 -1
- package/dist/assets/{all-wallets-DvcE11VI.js → all-wallets-CdL_YtIS.js} +1 -1
- package/dist/assets/{app-store-0_Pow1kc.js → app-store-Bt1dpC73.js} +1 -1
- package/dist/assets/{apple-BUjWzLQK.js → apple-CEeGRsLR.js} +1 -1
- package/dist/assets/{arrow-bottom-CD1iQIYK.js → arrow-bottom-CY7QPC3v.js} +1 -1
- package/dist/assets/{arrow-bottom-circle-CmTKNmVz.js → arrow-bottom-circle-DUacLrTK.js} +1 -1
- package/dist/assets/{arrow-left-CQL6Uhms.js → arrow-left-DdkU_cJC.js} +1 -1
- package/dist/assets/{arrow-right-Cjg65YpT.js → arrow-right-BApVZAmW.js} +1 -1
- package/dist/assets/{arrow-top-PcWlVXih.js → arrow-top-6DcF8ipC.js} +1 -1
- package/dist/assets/{avatar-BA-f4AKX.js → avatar-C0m3kdBO.js} +1 -1
- package/dist/assets/{bank-mnjwVKQN.js → bank-FZTS0Bvm.js} +1 -1
- package/dist/assets/{basic-D5C9DEO2.js → basic-z3EiNtlJ.js} +1 -1
- package/dist/assets/{browser-DEyKUR6X.js → browser-D-00yn8G.js} +1 -1
- package/dist/assets/byokCredential-Cdy8REIp.js +1 -0
- package/dist/assets/{card-ZntnNq7S.js → card-D_wHBdr4.js} +1 -1
- package/dist/assets/{castArray-DCHtvbqo.js → castArray-BX2YHThj.js} +1 -1
- package/dist/assets/chat-D11jX4Iv.js +2 -0
- package/dist/assets/{checkmark-vqUUVRDF.js → checkmark-BEf3bMy_.js} +1 -1
- package/dist/assets/{checkmark-bold-65uGszaN.js → checkmark-bold-Bw9dOPyC.js} +1 -1
- package/dist/assets/{chevron-bottom-CQZTYcvm.js → chevron-bottom-GHiW7kBq.js} +1 -1
- package/dist/assets/{chevron-left-CKW1BARx.js → chevron-left-CNEj2dO4.js} +1 -1
- package/dist/assets/{chevron-right-CJa41M5T.js → chevron-right-sgqFx8lL.js} +1 -1
- package/dist/assets/{chevron-top-Bwcsi6Fc.js → chevron-top-DlAuFkpk.js} +1 -1
- package/dist/assets/{chrome-store-BE25Pa9x.js → chrome-store-ClGqsVeO.js} +1 -1
- package/dist/assets/{clock-xj7EdKic.js → clock-Dn87YZjp.js} +1 -1
- package/dist/assets/{close-CT7bFxJI.js → close-BwRH304n.js} +1 -1
- package/dist/assets/{coinPlaceholder-5CTzP4NT.js → coinPlaceholder-D3MTdGQ0.js} +1 -1
- package/dist/assets/{common-yRaSE63I.js → common-Dd5FTt3o.js} +1 -1
- package/dist/assets/{common-B14ULdeG.js → common-QyUpPC75.js} +1 -1
- package/dist/assets/{compass-Dv-0B9GR.js → compass-C-E2T0zy.js} +1 -1
- package/dist/assets/{copy-BLWdmT9m.js → copy-BNJGAvMa.js} +1 -1
- package/dist/assets/{cursor-DAJSj7A9.js → cursor--i4Xa0OQ.js} +1 -1
- package/dist/assets/{cursor-transparent-CY6Udyqb.js → cursor-transparent-WOU8mk8F.js} +1 -1
- package/dist/assets/{debounce-BSdgAkOS.js → debounce-rFO21RGd.js} +1 -1
- package/dist/assets/{desktop-DD9E3u_A.js → desktop-CdiQ5DFl.js} +1 -1
- package/dist/assets/{disconnect-B1ntDtWb.js → disconnect-BBTXz5Xp.js} +1 -1
- package/dist/assets/{discord-Cd-PmPkY.js → discord-BavN0D2g.js} +1 -1
- package/dist/assets/{distribution-mjUnnC-h.js → distribution-gC6pfUsz.js} +1 -1
- package/dist/assets/{dropdown-CYDyXxEu.js → dropdown-D7fDLjhX.js} +1 -1
- package/dist/assets/{etherscan-gtDZdE0i.js → etherscan-Bw-ZKmx-.js} +1 -1
- package/dist/assets/{exclamation-triangle-CpVgpz55.js → exclamation-triangle-DOt3gbax.js} +1 -1
- package/dist/assets/{extension-9BvXh8bE.js → extension-DAiziIeO.js} +1 -1
- package/dist/assets/{external-link-DILxfqqN.js → external-link-Cv8eFrXr.js} +1 -1
- package/dist/assets/{facebook-BrZqpFIw.js → facebook-CzJaALeT.js} +1 -1
- package/dist/assets/{farcaster-oyChKJgy.js → farcaster-DlHpFJ18.js} +1 -1
- package/dist/assets/{filters-BDv3O6Xe.js → filters-BWg9cLQ3.js} +1 -1
- package/dist/assets/{flux-DqA6rzqI.js → flux-BP0RP-7R.js} +1 -1
- package/dist/assets/{github-5Xk5UWFn.js → github-BlSjhO5R.js} +1 -1
- package/dist/assets/{google-B7y7CLXd.js → google-wrIehkN1.js} +1 -1
- package/dist/assets/{hailuo-zvLClPNR.js → hailuo-CpEa1UDZ.js} +1 -1
- package/dist/assets/{headshots-DtMQ-fML.js → headshots-C_z_6iJl.js} +1 -1
- package/dist/assets/{help-circle-C4grA0b3.js → help-circle-CgG5yAaM.js} +1 -1
- package/dist/assets/{id-BqGIhZxE.js → id-D2oqHw8z.js} +1 -1
- package/dist/assets/{image-D_kqC-k3.js → image-D4yLPdQZ.js} +1 -1
- package/dist/assets/{index-C0dHnShz.js → index-26h1mgt-.js} +1 -1
- package/dist/assets/index-38G9IKZp.js +1 -0
- package/dist/assets/{index-gZYfPUqH.js → index-3euot5lf.js} +1 -1
- package/dist/assets/index-B--xRYrq.js +1 -0
- package/dist/assets/{index-4zhYnizi.js → index-B2UzvqRs.js} +1 -1
- package/dist/assets/index-B2l9Ai7a.js +1 -0
- package/dist/assets/{index-C8gv9XpT.js → index-B5aLH4ZV.js} +1 -1
- package/dist/assets/{index-COinJ3wV.js → index-BCtLhxeC.js} +1 -1
- package/dist/assets/{index-CBjdw82V.js → index-BEYNW2EK.js} +1 -1
- package/dist/assets/{index-DZxK-Gau.js → index-BEvg2pRE.js} +1 -1
- package/dist/assets/{index-CvU5FK4u.js → index-BHTuBZXJ.js} +1 -1
- package/dist/assets/{index-CRyZ32qo.js → index-BRydlsSG.js} +1 -1
- package/dist/assets/{index-e3HA0biF.js → index-BVMM7e5x.js} +1 -1
- package/dist/assets/{index-3079y3xc.js → index-BXMkJF7H.js} +1 -1
- package/dist/assets/{index-C719vQ0b.js → index-B_xoWE5M.js} +1 -1
- package/dist/assets/{index-DPvEmYP7.js → index-BdrHjNrn.js} +2 -2
- package/dist/assets/{index-B2obAGFg.js → index-BlG1KEGq.js} +1 -1
- package/dist/assets/{index-sUPnpVwg.js → index-Bw6diQ6i.js} +2 -2
- package/dist/assets/{index-oC6bXubz.js → index-BwN6IC9f.js} +1 -1
- package/dist/assets/{index-BMqHAFe8.js → index-ByyI6VwW.js} +1 -1
- package/dist/assets/index-C1Nafj7o.js +1 -0
- package/dist/assets/{index-h55T8DVq.js → index-CENBZ_Mi.js} +1 -1
- package/dist/assets/index-CJJgickM.js +1 -0
- package/dist/assets/{index-B_sHRuvM.js → index-CJtfHm7C.js} +1 -1
- package/dist/assets/{index-J0DUz7lI.js → index-CNQqVjGk.js} +1 -1
- package/dist/assets/{index-BtQumjje.js → index-CNnZhdJr.js} +1 -1
- package/dist/assets/{index-Bc1uL1lh.js → index-CRPCTgYK.js} +1 -1
- package/dist/assets/{index-DzeWdEL6.js → index-CUOB8-6a.js} +6 -6
- package/dist/assets/index-CW-yt64R.js +1 -0
- package/dist/assets/{index-BqfmO_GZ.js → index-CWoJcxvr.js} +1 -1
- package/dist/assets/{index-Dz07L-di.js → index-CbXIzWSz.js} +1 -1
- package/dist/assets/{index-CWijHLd4.js → index-Cu8jEzMt.js} +1 -1
- package/dist/assets/{index-GYQMtYT6.js → index-CwJsW1oV.js} +1 -1
- package/dist/assets/{index-D4R39Q4T.js → index-D4Yc4tRk.js} +1 -1
- package/dist/assets/{index-Cn4_bu9L.js → index-D4vu-0Vi.js} +3 -3
- package/dist/assets/{index-BJKA6-Z-.js → index-D8V5LY1E.js} +1 -1
- package/dist/assets/{index-CGzKdsQS.js → index-DB1wHeLA.js} +1 -1
- package/dist/assets/{index-C_MyWrFR.js → index-DBcVZLrq.js} +1 -1
- package/dist/assets/{index-BlBQVbe7.js → index-DKT9lpv-.js} +1 -1
- package/dist/assets/{index-DAILxU5_.js → index-DPl_Q5wR.js} +1 -1
- package/dist/assets/{index-C36XUd3I.js → index-DTQtEf7n.js} +1 -1
- package/dist/assets/{index-CAois4ub.js → index-DUswWNzD.js} +1 -1
- package/dist/assets/{index-KJyVGKox.js → index-DWTCukaE.js} +1 -1
- package/dist/assets/index-DdfzO8ET.js +1 -0
- package/dist/assets/{index-BKQt60Ja.js → index-DefEPu5Z.js} +1 -1
- package/dist/assets/{index-B81rhKOl.js → index-DrvGU9i_.js} +1 -1
- package/dist/assets/index-Ds-UbI_q.js +1 -0
- package/dist/assets/{index-HsCXET59.js → index-DsKeM0Xq.js} +1 -1
- package/dist/assets/{index-D9jYVi3R.js → index-FF4WAJT-.js} +1 -1
- package/dist/assets/{index-CnxV03kA.js → index-FTscF_cz.js} +14 -14
- package/dist/assets/{index-CGF8tuXZ.js → index-FhK8yklc.js} +1 -1
- package/dist/assets/{index-BDsGzS8q.js → index-O7t1BsNB.js} +1 -1
- package/dist/assets/{index-DhIU2Ld8.js → index-RiVU3gTe.js} +1 -1
- package/dist/assets/{index-BXYIQVCp.js → index-W9z3tmv_.js} +1 -1
- package/dist/assets/{index-DjtI4ek9.js → index-a10HPOrI.js} +1 -1
- package/dist/assets/index-aO6Fi57H.js +1 -0
- package/dist/assets/{index-Y0NlT3jW.js → index-brUXT6Ic.js} +1 -1
- package/dist/assets/{index-CI4HOy64.js → index-d1Dl3INe.js} +1 -1
- package/dist/assets/index-jii325vi.js +1 -0
- package/dist/assets/{index-DCAfo8xw.js → index-o4zhAWG6.js} +1 -1
- package/dist/assets/{index-BqVw-i1m.js → index-oWuBTe9g.js} +1 -1
- package/dist/assets/{index.browser.esm-B9lcScWN.js → index.browser.esm-BaPNoGjI.js} +1 -1
- package/dist/assets/{index.es-CR5c3J-H.js → index.es-B1lW1a9B.js} +1 -1
- package/dist/assets/{info-BSOtOA-S.js → info-D2mbPMyX.js} +1 -1
- package/dist/assets/{info-circle-L_JdUOzd.js → info-circle-CQtpHFeL.js} +1 -1
- package/dist/assets/{isEqual-BUu7kkim.js → isEqual-BiGspMHU.js} +1 -1
- package/dist/assets/{isPlainObject-C951NK-Z.js → isPlainObject-1A9ncyWS.js} +1 -1
- package/dist/assets/{kling-oH6EbWd-.js → kling-Bga-2-Yk.js} +1 -1
- package/dist/assets/{lightbulb-CjYEE-pX.js → lightbulb-SMN0MP8P.js} +1 -1
- package/dist/assets/{luma-La5liYsl.js → luma-CHNWeOk6.js} +1 -1
- package/dist/assets/{mail-BNdDOdlU.js → mail-D-ZfsNgq.js} +1 -1
- package/dist/assets/{midjourney-6_dcZ0uf.js → midjourney-BdpbGQo1.js} +1 -1
- package/dist/assets/{mobile-PeQmDWlT.js → mobile-DEieegSW.js} +1 -1
- package/dist/assets/{more-DceYr4Lz.js → more-BMIzMnqp.js} +1 -1
- package/dist/assets/{nanobanana-BlWLw-0i.js → nanobanana-JVOGegpV.js} +1 -1
- package/dist/assets/{network-placeholder-8tg15sZ6.js → network-placeholder-ppqpKoOQ.js} +1 -1
- package/dist/assets/{nftPlaceholder-Oe4wEZQH.js → nftPlaceholder-55iywwqB.js} +1 -1
- package/dist/assets/{off-CKC5I7Sy.js → off-CpesiVFf.js} +1 -1
- package/dist/assets/{openaiimage-D2v8r2k0.js → openaiimage-CEkHQ02c.js} +1 -1
- package/dist/assets/{order-Br2dvRZB.js → order-BFBb3_Nm.js} +1 -1
- package/dist/assets/{pika-Cp3tYlXA.js → pika-DF9AQtCB.js} +1 -1
- package/dist/assets/{pixverse-8cawnrYd.js → pixverse-NFnml3Ad.js} +1 -1
- package/dist/assets/{pixverse-eUATiZ_u.js → pixverse-g-p4CgDy.js} +1 -1
- package/dist/assets/{play-store-Dh4-9TDC.js → play-store-EtWgj9tY.js} +1 -1
- package/dist/assets/{plus-DuKsmxfn.js → plus-Bz9Zrmf7.js} +1 -1
- package/dist/assets/{price-WuGL9UMF.js → price-D5TNZtWD.js} +1 -1
- package/dist/assets/{producer-DbMvJ5IJ.js → producer-BTXuQmdX.js} +1 -1
- package/dist/assets/{qr-code-xikcy3vY.js → qr-code-BteNX7f7.js} +1 -1
- package/dist/assets/{qrart-3p-uK2yX.js → qrart-DBM0vNab.js} +1 -1
- package/dist/assets/{recycle-horizontal-BTeDybYv.js → recycle-horizontal-DoCeu-wB.js} +1 -1
- package/dist/assets/{refresh-wEube-8p.js → refresh-B27QPFje.js} +1 -1
- package/dist/assets/{reown-logo-Duvq4cIZ.js → reown-logo-DOxrtg5r.js} +1 -1
- package/dist/assets/{search-4dSIOsol.js → search-Bbvjy0sE.js} +1 -1
- package/dist/assets/{secp256k1-DO_c0HE4.js → secp256k1-DfbSkrJA.js} +1 -1
- package/dist/assets/{secp256k1-D3b5sS3Y.js → secp256k1-cwsWPnax.js} +1 -1
- package/dist/assets/{seedance-BHv8zgWE.js → seedance-DHGvvKi5.js} +1 -1
- package/dist/assets/{seedream-BBuvt17Y.js → seedream-BGv1ajnv.js} +1 -1
- package/dist/assets/{send-C38hffi0.js → send-CKT6bzdT.js} +1 -1
- package/dist/assets/{service-D2vZhmYV.js → service-C5LrDt_v.js} +1 -1
- package/dist/assets/{solana-wallets-Bb5-bt8W.js → solana-wallets-D3sNEfV2.js} +2 -2
- package/dist/assets/{solana-wallets-vue-sz_RAUZf.js → solana-wallets-vue-CJOnb2mO.js} +1 -1
- package/dist/assets/{solanaEmbed.esm-B2XG1XS-.js → solanaEmbed.esm-AUvjIviJ.js} +1 -1
- package/dist/assets/{sora-CALwkS60.js → sora-B2wrmmta.js} +1 -1
- package/dist/assets/{string_decoder-BdyrBKKN.js → string_decoder-pE91rp0R.js} +1 -1
- package/dist/assets/{suno-CTS84rTs.js → suno-D94YFwAz.js} +1 -1
- package/dist/assets/{swapHorizontal-CIlvi2s1.js → swapHorizontal-7WpTJnsP.js} +1 -1
- package/dist/assets/{swapHorizontalBold-pb7Mt9U9.js → swapHorizontalBold-BCnSLf6o.js} +1 -1
- package/dist/assets/{swapHorizontalMedium-DwW_bADA.js → swapHorizontalMedium-mWC-N_Ro.js} +1 -1
- package/dist/assets/{swapHorizontalRoundedBold-BH0c6-X7.js → swapHorizontalRoundedBold-Bu0IBfBl.js} +1 -1
- package/dist/assets/{swapVertical-BmvQbdlw.js → swapVertical-zPCGtEyW.js} +1 -1
- package/dist/assets/{telegram-zNhhvV-T.js → telegram-CqVol6C7.js} +1 -1
- package/dist/assets/{three-dots-C2CRUM09.js → three-dots-BvwfJBxD.js} +1 -1
- package/dist/assets/{twitch-C4zzdLky.js → twitch-W0B0uQ2_.js} +1 -1
- package/dist/assets/{twitterIcon-B92_7L89.js → twitterIcon-Dy3K7R98.js} +1 -1
- package/dist/assets/{typescript-D-y7TKkl.js → typescript-CUMR9uNq.js} +1 -1
- package/dist/assets/{use-form-item-n1D0HOVh.js → use-form-item-DDWqgx7q.js} +1 -1
- package/dist/assets/validator-pb75_c-A.js +1 -0
- package/dist/assets/{veo-NH_MUVor.js → veo-Dg8Zhpd-.js} +1 -1
- package/dist/assets/{veo-CvNN8wNJ.js → veo-ibQ-pqXQ.js} +1 -1
- package/dist/assets/{verify-filled-DWfvqtTf.js → verify-filled-CKhjqWtR.js} +1 -1
- package/dist/assets/{verify-ZKFLiBPb.js → verify-qcg7LJmo.js} +1 -1
- package/dist/assets/{w3m-modal-z_Zw8vbr.js → w3m-modal-BYAeKj4C.js} +1 -1
- package/dist/assets/{wallet-placeholder-CxBgqhLt.js → wallet-placeholder-DdZaIWvi.js} +1 -1
- package/dist/assets/{wallet-CV4sqa98.js → wallet-q_V1cxSj.js} +1 -1
- package/dist/assets/{walletconnect-f0Q1J2xH.js → walletconnect-DqDsf_VI.js} +1 -1
- package/dist/assets/{wan-DnauGLkm.js → wan-BSsn6vES.js} +1 -1
- package/dist/assets/{warning-circle-Bo6YPJN9.js → warning-circle-olX97x29.js} +1 -1
- package/dist/assets/{web-Xw8Vpm8m.js → web-CpRQ4ifd.js} +1 -1
- package/dist/assets/{web-DHymevVm.js → web-Csr5ExDC.js} +1 -1
- package/dist/assets/{x-BdAb1Kuh.js → x-DfcqJEz9.js} +1 -1
- package/dist/index.html +62 -14
- package/package.json +1 -1
- package/dist/assets/Console-BX4tut8T.js +0 -1
- package/dist/assets/EditArray-qckoLhGU.js +0 -1
- package/dist/assets/IconPark.vue_vue_type_script_setup_true_lang-D5nebBc1.js +0 -1
- package/dist/assets/Index-621jgqyo.js +0 -1
- package/dist/assets/Index-BRHvzLcH.js +0 -1
- package/dist/assets/Index-BXgQL3oy.js +0 -1
- package/dist/assets/Index-CpxDt76g.js +0 -1
- package/dist/assets/Index-D1zi3VjW.css +0 -1
- package/dist/assets/Index-KYDwuUCb.js +0 -1
- package/dist/assets/Invitees-CfZKpPdS.js +0 -1
- package/dist/assets/List-Cw1eUK3j.js +0 -1
- package/dist/assets/Main-ZnfTm2_c.js +0 -1
- package/dist/assets/Navigator-1EahaRlS.css +0 -1
- package/dist/assets/Navigator-DEO-xgNM.js +0 -1
- package/dist/assets/Pagination-BQtrBLcO.js +0 -1
- package/dist/assets/byokCredential-umfRCH1d.js +0 -1
- package/dist/assets/chat-DdiicJjo.js +0 -2
- package/dist/assets/index-BGWjIWtx.js +0 -1
- package/dist/assets/index-Bd3Ciuoz.js +0 -1
- package/dist/assets/index-CFMP3iYS.js +0 -1
- package/dist/assets/index-CahX5AtG.js +0 -1
- package/dist/assets/index-CtIMFI1x.js +0 -1
- package/dist/assets/index-DAIZ68Ng.js +0 -1
- package/dist/assets/index-DOwlxqQ4.js +0 -1
- package/dist/assets/index-DRNT-3tY.js +0 -1
- package/dist/assets/index-Dnv-ARoh.js +0 -1
- package/dist/assets/index-aX-s__p_.js +0 -1
- package/dist/assets/validator-kdYNLPlp.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as T}from"./index.es-B1lW1a9B.js";import{E as I}from"./index-jii325vi.js";import{E as W}from"./index-38G9IKZp.js";import{d as b,H as i,E as r,z as D,C as t,y as u,D as s,q as n,F as o,O as L,N as F,x as w,J as _,I as f,M as X,Q as C}from"./vendor-vue-DU0w5ewx.js";import{E,cS as J,cT as K,cU as Q,cV as P,cW as Y,cX as Z,cY as x,cZ as ee,b1 as M,c_ as te,c$ as se,d0 as oe,d1 as ne,d2 as ae,ap as O}from"./index-FTscF_cz.js";import{I as S,S as le}from"./ScrollList-CHr2ER0d.js";import{E as ie}from"./index-DUswWNzD.js";import{E as R,a as U}from"./index-DKT9lpv-.js";import{E as G}from"./index-o4zhAWG6.js";import{p as j}from"./pasteUploadMixin-BurWbGNQ.js";import{I as B}from"./ImagePreview-B7ddO4K-.js";import{E as q}from"./index-aO6Fi57H.js";import{E as y}from"./index-FF4WAJT-.js";import{C as re}from"./Consumption-D8o6ZGlD.js";import{a as ce}from"./price-D5TNZtWD.js";import{C as de}from"./CopyToClipboard-99x8TU_E.js";import{V as me}from"./VideoPlayer-BJPVVH4v.js";import{I as pe}from"./ImageWrapper-B4mqUlhx.js";import{E as ue}from"./index-DTQtEf7n.js";import{E as fe}from"./index-B2l9Ai7a.js";import{E as _e}from"./index-DdfzO8ET.js";import{B as he}from"./BotPlaceholder-808fKlrc.js";import{N as ve}from"./NoTasks-CzCoCJiJ.js";import{b as $e}from"./errorCode-Cqj9Td_Z.js";import{s as ge}from"./seedance-DHGvvKi5.js";import{l as be}from"./pagination-CcnL0MdN.js";import"./use-form-item-DDWqgx7q.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-Cvgzdobq.js";import"./vendor-vue-router-9TBHB1ku.js";import"./typescript-CUMR9uNq.js";import"./index-DB1wHeLA.js";import"./index-RiVU3gTe.js";import"./index-BRydlsSG.js";import"./strings-DigWlKo9.js";import"./isEqual-BiGspMHU.js";import"./_Uint8Array-BWy8cKCo.js";import"./castArray-BX2YHThj.js";import"./debounce-rFO21RGd.js";import"./_baseIteratee-GCheQ423.js";import"./index-CJtfHm7C.js";import"./validator-pb75_c-A.js";import"./index-BdrHjNrn.js";import"./_baseClone-CVDR-yNh.js";import"./_initCloneObject-BnGf6y2Q.js";import"./vue-plyr-BO2nlN4c.js";import"./index-CJJgickM.js";const Ee=b({name:"LayoutSeedance",components:{ElDrawer:W,ElButton:I,FontAwesomeIcon:T},data(){return{drawer:!1}}}),ke={class:"main flex flex-row flex-1"},ye={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},we={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function Se(e,a,p,h,g,$){const c=s("font-awesome-icon"),l=s("el-button"),m=s("el-drawer");return n(),i("div",ke,[r("div",ye,[D(e.$slots,"config",{},void 0,!0)]),r("div",we,[D(e.$slots,"result",{},void 0,!0)]),t(l,{circle:"",class:"menu",onClick:a[0]||(a[0]=d=>e.drawer=!0)},{default:u(()=>[t(c,{icon:"fa-solid fa-magic"})]),_:1}),t(m,{modelValue:e.drawer,"onUpdate:modelValue":a[1]||(a[1]=d=>e.drawer=d),direction:"ltr","with-header":!1,size:"350px"},{default:u(()=>[D(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Ve=E(Ee,[["render",Se],["__scopeId","data-v-02e4e4b3"]]),Le="",Te=b({name:"SeedancePromptInput",components:{ElInput:ie,InfoIcon:S},computed:{prompt:{get(){return this.$store.state.seedance?.config?.prompt},set(e){this.$store.commit("seedance/setConfig",{...this.$store.state.seedance?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=Le)}}),Ie={class:"field"},Ce={class:"box"},Fe={class:"title font-bold"};function Ae(e,a,p,h,g,$){const c=s("info-icon"),l=s("el-input");return n(),i("div",Ie,[r("div",Ce,[r("h2",Fe,o(e.$t("seedance.name.prompt")),1),t(c,{content:e.$t("seedance.description.prompt"),class:"info"},null,8,["content"])]),t(l,{modelValue:e.prompt,"onUpdate:modelValue":a[0]||(a[0]=m=>e.prompt=m),rows:4,type:"textarea",class:"prompt",placeholder:e.$t("seedance.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const De=E(Te,[["render",Ae],["__scopeId","data-v-865909f4"]]),Re=b({name:"SeedanceModelSelector",components:{ElSelect:U,ElOption:R,InfoIcon:S},data(){return{options:[{value:K,label:this.$t("seedance.model.seedance10pro")},{value:Q,label:this.$t("seedance.model.seedance10proFast")},{value:P,label:this.$t("seedance.model.seedance15pro")},{value:Y,label:this.$t("seedance.model.seedance10liteT2v")},{value:Z,label:this.$t("seedance.model.seedance10liteI2v")}]}},computed:{value:{get(){return this.$store.state.seedance?.config?.model},set(e){this.$store.commit("seedance/setConfig",{...this.$store.state.seedance?.config,model:e})}}},mounted(){this.value||(this.value=J)}}),Ue={class:"field"},Ne={class:"label"},Oe={class:"box"},Pe={class:"title font-bold"};function Me(e,a,p,h,g,$){const c=s("info-icon"),l=s("el-option"),m=s("el-select");return n(),i("div",Ue,[r("div",Ne,[r("div",Oe,[r("h2",Pe,o(e.$t("seedance.name.model")),1),t(c,{content:e.$t("seedance.description.model"),class:"info"},null,8,["content"])])]),t(m,{modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=d=>e.value=d),class:"value",placeholder:e.$t("seedance.placeholder.select")},{default:u(()=>[(n(!0),i(L,null,F(e.options,d=>(n(),w(l,{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Ge=E(Re,[["render",Me],["__scopeId","data-v-eaa1425a"]]),je=b({name:"SeedanceDurationSelector",components:{ElSelect:U,ElOption:R,InfoIcon:S},data(){return{options:[{value:2,label:"2s"},{value:3,label:"3s"},{value:4,label:"4s"},{value:5,label:"5s"},{value:6,label:"6s"},{value:7,label:"7s"},{value:8,label:"8s"},{value:9,label:"9s"},{value:10,label:"10s"},{value:11,label:"11s"},{value:12,label:"12s"}]}},computed:{value:{get(){return this.$store.state.seedance?.config?.duration},set(e){this.$store.commit("seedance/setConfig",{...this.$store.state.seedance?.config,duration:e})}}},mounted(){this.value||(this.value=x)}}),Be={class:"field"},qe={class:"label"},ze={class:"box"},He={class:"title font-bold"};function We(e,a,p,h,g,$){const c=s("info-icon"),l=s("el-option"),m=s("el-select");return n(),i("div",Be,[r("div",qe,[r("div",ze,[r("h2",He,o(e.$t("seedance.name.duration")),1),t(c,{content:e.$t("seedance.description.duration"),class:"info"},null,8,["content"])])]),t(m,{modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=d=>e.value=d),class:"value",placeholder:e.$t("seedance.placeholder.select")},{default:u(()=>[(n(!0),i(L,null,F(e.options,d=>(n(),w(l,{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Xe=E(je,[["render",We],["__scopeId","data-v-5c809a72"]]),Je=b({name:"SeedanceGenerateAudioSwitch",components:{ElSwitch:G,InfoIcon:S},computed:{isSupported(){return this.$store.state.seedance?.config?.model===P},value:{get(){return this.$store.state.seedance?.config?.generate_audio??!1},set(e){this.$store.commit("seedance/setConfig",{...this.$store.state.seedance?.config,generate_audio:e})}}},watch:{isSupported(e){!e&&this.value&&(this.value=!1)}},mounted(){this.value===void 0&&(this.value=ee)}}),Ke={key:0,class:"field"},Qe={class:"label"},Ye={class:"box"},Ze={class:"title font-bold"},xe={class:"value"};function et(e,a,p,h,g,$){const c=s("info-icon"),l=s("el-switch");return e.isSupported?(n(),i("div",Ke,[r("div",Qe,[r("div",Ye,[r("h2",Ze,o(e.$t("seedance.name.generateAudio")),1),t(c,{content:e.$t("seedance.description.generateAudio"),class:"info"},null,8,["content"])])]),r("div",xe,[t(l,{modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=m=>e.value=m),"inline-prompt":"","active-text":e.$t("seedance.button.on"),"inactive-text":e.$t("seedance.button.off")},null,8,["modelValue","active-text","inactive-text"])])])):_("",!0)}const tt=E(Je,[["render",et],["__scopeId","data-v-8d716dcc"]]),st=b({name:"SeedanceFirstFrameImage",components:{ElUpload:q,ElButton:I,InfoIcon:S,FontAwesomeIcon:T,ImagePreview:B},mixins:[j],data(){return{fileList:[],uploadUrl:M()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},methods:{onExceed(){y.warning(this.$t("seedance.message.uploadExceed"))},onError(){y.error(this.$t("seedance.message.uploadError"))},onSetFirstFrameUrl(){const e=this.urls?.[0],p=(this.$store.state.seedance?.config?.images||[]).filter(h=>h?.role!=="first_frame");e&&p.push({url:e,role:"first_frame"}),this.$store.commit("seedance/setConfig",{...this.$store.state.seedance?.config,images:p.length>0?p:void 0})},async onSuccess(){this.onSetFirstFrameUrl()},async onRemove(){this.onSetFirstFrameUrl()}}}),ot={class:"relative"},nt={class:"flex justify-between"},at={class:"flex justify-start items-center"},lt={class:"text-sm font-bold"};function it(e,a,p,h,g,$){const c=s("info-icon"),l=s("image-preview"),m=s("font-awesome-icon"),d=s("el-button"),k=s("el-upload");return n(),i("div",ot,[r("div",nt,[r("div",at,[r("span",lt,o(e.$t("seedance.name.firstFrame")),1),t(c,{content:e.$t("seedance.description.firstFrame")},null,8,["content"])])]),t(k,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":a[0]||(a[0]=v=>e.fileList=v),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,"on-remove":e.onRemove,headers:e.headers},{file:u(({file:v})=>[v.url&&v.percentage!==void 0?(n(),w(l,{key:0,url:v.url,name:v.name,percentage:v.percentage,onRemove:V=>e.fileList.splice(e.fileList.indexOf(v),1)},null,8,["url","name","percentage","onRemove"])):_("",!0)]),default:u(()=>[t(d,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:u(()=>[t(m,{icon:"fa-solid fa-upload",class:"icon mr-1"}),f(" "+o(e.$t("seedance.button.upload")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","on-remove","headers"])])}const rt=E(st,[["render",it],["__scopeId","data-v-5294baf8"]]),ct=b({name:"SeedanceLastFrameImage",components:{ElUpload:q,ElButton:I,ImagePreview:B,InfoIcon:S,FontAwesomeIcon:T},mixins:[j],data(){return{fileList:[],uploadUrl:M()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},methods:{onExceed(){y.warning(this.$t("seedance.message.uploadExceed"))},onError(){y.error(this.$t("seedance.message.uploadError"))},onSetLastFrameUrl(){const e=this.urls?.[0],p=(this.$store.state.seedance?.config?.images||[]).filter(h=>h?.role!=="last_frame");e&&p.push({url:e,role:"last_frame"}),this.$store.commit("seedance/setConfig",{...this.$store.state.seedance?.config,images:p.length>0?p:void 0})},async onSuccess(){this.onSetLastFrameUrl()},async onRemove(){this.onSetLastFrameUrl()}}}),dt={class:"relative"},mt={class:"flex justify-between"},pt={class:"flex justify-start items-center"},ut={class:"text-sm font-bold"};function ft(e,a,p,h,g,$){const c=s("info-icon"),l=s("image-preview"),m=s("font-awesome-icon"),d=s("el-button"),k=s("el-upload");return n(),i("div",dt,[r("div",mt,[r("div",pt,[r("span",ut,o(e.$t("seedance.name.lastFrame")),1),t(c,{content:e.$t("seedance.description.lastFrame")},null,8,["content"])])]),t(k,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":a[0]||(a[0]=v=>e.fileList=v),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,"on-remove":e.onRemove,headers:e.headers},{file:u(({file:v})=>[v.url&&v.percentage!==void 0?(n(),w(l,{key:0,url:v.url,name:v.name,percentage:v.percentage,onRemove:V=>e.fileList.splice(e.fileList.indexOf(v),1)},null,8,["url","name","percentage","onRemove"])):_("",!0)]),default:u(()=>[t(d,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:u(()=>[t(m,{icon:"fa-solid fa-upload",class:"icon mr-1"}),f(" "+o(e.$t("seedance.button.upload")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","on-remove","headers"])])}const _t=E(ct,[["render",ft],["__scopeId","data-v-f423739f"]]),ht=b({name:"SeedanceServiceTierSelector",components:{ElSelect:U,ElOption:R,InfoIcon:S},data(){return{options:[{value:se,label:this.$t("seedance.serviceTier.default")},{value:oe,label:this.$t("seedance.serviceTier.flex")}]}},computed:{value:{get(){return this.$store.state.seedance?.config?.service_tier},set(e){this.$store.commit("seedance/setConfig",{...this.$store.state.seedance?.config,service_tier:e})}}},mounted(){this.value||(this.value=te)}}),vt={class:"field"},$t={class:"label"},gt={class:"box"},bt={class:"title font-bold"};function Et(e,a,p,h,g,$){const c=s("info-icon"),l=s("el-option"),m=s("el-select");return n(),i("div",vt,[r("div",$t,[r("div",gt,[r("h2",bt,o(e.$t("seedance.name.serviceTier")),1),t(c,{content:e.$t("seedance.description.serviceTier"),class:"info"},null,8,["content"])])]),t(m,{modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=d=>e.value=d),class:"value",placeholder:e.$t("seedance.placeholder.select")},{default:u(()=>[(n(!0),i(L,null,F(e.options,d=>(n(),w(l,{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const kt=E(ht,[["render",Et],["__scopeId","data-v-a62125ec"]]),yt=b({name:"SeedanceReturnLastFrameSwitch",components:{ElSwitch:G,InfoIcon:S},computed:{value:{get(){return this.$store.state.seedance?.config?.return_last_frame},set(e){this.$store.commit("seedance/setConfig",{...this.$store.state.seedance?.config,return_last_frame:e})}}},mounted(){this.value===void 0&&(this.value=ne)}}),wt={class:"field"},St={class:"label"},Vt={class:"box"},Lt={class:"title font-bold"},Tt={class:"value"};function It(e,a,p,h,g,$){const c=s("info-icon"),l=s("el-switch");return n(),i("div",wt,[r("div",St,[r("div",Vt,[r("h2",Lt,o(e.$t("seedance.name.returnLastFrame")),1),t(c,{content:e.$t("seedance.description.returnLastFrame"),class:"info"},null,8,["content"])])]),r("div",Tt,[t(l,{modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=m=>e.value=m),"inline-prompt":"","active-text":e.$t("seedance.button.on"),"inactive-text":e.$t("seedance.button.off")},null,8,["modelValue","active-text","inactive-text"])])])}const Ct=E(yt,[["render",It],["__scopeId","data-v-cd179b1c"]]),Ft=b({name:"SeedanceConfigPanel",components:{ElButton:I,FontAwesomeIcon:T,PromptInput:De,ModelSelector:Ge,DurationSelector:Xe,GenerateAudioSwitch:tt,ServiceTierSelector:kt,ReturnLastFrameSwitch:Ct,FirstFrameImage:rt,LastFrameImage:_t,Consumption:re},emits:["generate"],computed:{config(){return this.$store.state.seedance?.config},consumption(){return ce(this.config,this.service?.cost)},service(){return this.$store.state.seedance?.service}},methods:{onGenerate(){this.$emit("generate")}}}),At={class:"flex flex-col h-full"},Dt={class:"flex-1 overflow-y-auto p-5"},Rt={class:"flex flex-col items-center justify-center px-5 pb-5"};function Ut(e,a,p,h,g,$){const c=s("prompt-input"),l=s("model-selector"),m=s("duration-selector"),d=s("generate-audio-switch"),k=s("service-tier-selector"),v=s("return-last-frame-switch"),V=s("first-frame-image"),A=s("last-frame-image"),N=s("consumption"),z=s("font-awesome-icon"),H=s("el-button");return n(),i("div",At,[r("div",Dt,[t(c,{class:"mb-4"}),t(l,{class:"mb-4"}),t(m,{class:"mb-4"}),t(d,{class:"mb-4"}),t(k,{class:"mb-4"}),t(v,{class:"mb-4"}),t(V,{class:"mb-2"}),t(A,{class:"mb-2"})]),r("div",Rt,[t(N,{value:e.consumption,service:e.service},null,8,["value","service"]),t(H,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:u(()=>[t(z,{icon:"fa-solid fa-magic",class:"mr-2"}),f(" "+o(e.$t("seedance.button.generate")),1)]),_:1},8,["onClick"])])])}const Nt=E(Ft,[["render",Ut]]),Ot=b({name:"SeedanceTaskPreview",components:{ElImage:_e,CopyToClipboard:de,FontAwesomeIcon:T,ElAlert:fe,VideoPlayer:me,ElTooltip:ue,ElButton:I,ImageWrapper:pe},props:{modelValue:{type:Object,required:!0}},data(){return{seedanceLogo:ae}},computed:{video(){return this.modelValue?.response?.data}},methods:{onDownload(e){window.open(e,"_blank")}}}),Pt={class:"preview"},Mt={class:"left"},Gt={class:"main"},jt={class:"bot"},Bt={class:"datetime"},qt={class:"info"},zt={key:0,class:"prompt mt-2"},Ht={key:0},Wt={key:1},Xt={key:0,class:C({content:!0})},Jt={class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Kt={key:1,class:C({content:!0})},Qt={key:0,class:"mb-4"},Yt={key:1,class:"mb-4"},Zt={key:2,class:C({operations:!0,"mt-2":!0,"mb-2":!0})},xt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},es={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ts={key:2,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ss={key:0},os={key:1},ns={key:3,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},as={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ls={key:4,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},is={key:5,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},rs={key:2,class:C({content:!0})},cs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ds={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ms={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ps={key:2,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},us={key:3,class:C({content:!0})},fs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},_s={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function hs(e,a,p,h,g,$){const c=s("el-image"),l=s("font-awesome-icon"),m=s("copy-to-clipboard"),d=s("el-alert"),k=s("video-player"),v=s("image-wrapper"),V=s("el-button"),A=s("el-tooltip");return n(),i("div",Pt,[r("div",Mt,[t(c,{src:e.seedanceLogo,class:"avatar"},null,8,["src"])]),r("div",Gt,[r("div",jt,[f(o(e.$t("seedance.name.seedanceBot"))+" ",1),r("span",Bt,o(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),r("div",qt,[e.modelValue?.request?.prompt?(n(),i("p",zt,[f(o(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?e.video?.status==="processing"||e.video?.status==="pending"?(n(),i("span",Wt," - ("+o(e.$t("seedance.status.processing"))+") ",1)):_("",!0):(n(),i("span",Ht," - ("+o(e.$t("seedance.status.pending"))+") ",1))])):_("",!0)]),e.modelValue?.response?e.modelValue?.response?.success===!0?(n(),i("div",Kt,[e.video?.video_url?(n(),i("div",Qt,[t(k,{src:e.video?.video_url},null,8,["src"])])):_("",!0),e.video?.last_frame_url?(n(),i("div",Yt,[t(v,{src:e.video?.last_frame_url,"raw-src":e.video?.last_frame_url},null,8,["src","raw-src"])])):_("",!0),e.video?.video_url?(n(),i("div",Zt,[t(A,{class:"box-item",effect:"dark",content:e.$t("seedance.message.downloadVideo"),placement:"top-start"},{default:u(()=>[t(V,{type:"info",size:"small",class:"btn-action",onClick:a[0]||(a[0]=X(N=>e.onDownload(e.video?.video_url),["stop"]))},{default:u(()=>[f(o(e.$t("seedance.button.download")),1)]),_:1})]),_:1},8,["content"])])):_("",!0),t(d,{closable:!1,class:"mt-2 success"},{default:u(()=>[e.modelValue?.request?.model?(n(),i("p",xt,[t(l,{icon:"fa-solid fa-cube",class:"mr-1"}),f(" "+o(e.$t("seedance.name.model"))+": "+o(e.modelValue?.request?.model),1)])):_("",!0),e.video?.duration?(n(),i("p",es,[t(l,{icon:"fa-solid fa-clock",class:"mr-1"}),f(" "+o(e.$t("seedance.name.duration"))+": "+o(e.video?.duration)+"s ",1)])):_("",!0),e.video?.resolution?(n(),i("p",ts,[t(l,{icon:"fa-solid fa-expand",class:"mr-1"}),f(" "+o(e.$t("seedance.name.resolution"))+": "+o(e.video?.resolution)+" ",1),e.video?.ratio?(n(),i("span",ss," · "+o(e.video?.ratio),1)):_("",!0),e.video?.framespersecond?(n(),i("span",os," · "+o(e.video?.framespersecond)+"fps",1)):_("",!0)])):_("",!0),e.modelValue?.request?.generate_audio?(n(),i("p",ns,[t(l,{icon:"fa-solid fa-volume-up",class:"mr-1"}),f(" "+o(e.$t("seedance.name.generateAudio"))+": "+o(e.$t("seedance.button.on")),1)])):_("",!0),r("p",as,[t(l,{icon:"fa-solid fa-magic",class:"mr-1"}),f(" "+o(e.$t("seedance.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),t(m,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])]),e.modelValue?.elapsed?(n(),i("p",ls,[t(l,{icon:"fa-solid fa-clock",class:"mr-1"}),f(" "+o(e.$t("seedance.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):_("",!0),e.modelValue?.response?.trace_id?(n(),i("p",is,[t(l,{icon:"fa-solid fa-hashtag",class:"mr-1"}),f(" "+o(e.$t("seedance.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),t(m,{content:e.modelValue?.response?.trace_id,class:"btn-copy inline-block"},null,8,["content"])])):_("",!0)]),_:1})])):e.modelValue?.response?.success===!1?(n(),i("div",rs,[t(d,{closable:!1,class:"failure"},{template:u(()=>[t(l,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),f(" "+o(e.$t("seedance.name.failure")),1)]),default:u(()=>[r("p",cs,[t(l,{icon:"fa-solid fa-magic",class:"mr-1"}),f(" "+o(e.$t("seedance.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),t(m,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])]),e.modelValue?.response?.error?.message?(n(),i("p",ds,[t(l,{icon:"fa-solid fa-circle-info",class:"mr-1"}),f(" "+o(e.$t("seedance.name.failureReason"))+": "+o(e.modelValue?.response?.error?.message)+" ",1),t(m,{content:e.modelValue?.response?.error?.message,class:"btn-copy inline-block"},null,8,["content"])])):_("",!0),e.modelValue?.elapsed?(n(),i("p",ms,[t(l,{icon:"fa-solid fa-clock",class:"mr-1"}),f(" "+o(e.$t("seedance.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):_("",!0),e.modelValue?.response?.trace_id?(n(),i("p",ps,[t(l,{icon:"fa-solid fa-hashtag",class:"mr-1"}),f(" "+o(e.$t("seedance.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),t(m,{content:e.modelValue?.response?.trace_id,class:"btn-copy inline-block"},null,8,["content"])])):_("",!0)]),_:1})])):(n(),i("div",us,[t(d,{closable:!1,class:"info"},{template:u(()=>[t(l,{icon:"fa-solid fa-circle-info",class:"mr-1"}),f(" "+o(e.$t("seedance.name.status")),1)]),default:u(()=>[r("p",fs,[t(l,{icon:"fa-solid fa-magic",class:"mr-1"}),f(" "+o(e.$t("seedance.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),t(m,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])]),e.modelValue?.response?.trace_id?(n(),i("p",_s,[t(l,{icon:"fa-solid fa-hashtag",class:"mr-1"}),f(" "+o(e.$t("seedance.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),t(m,{content:e.modelValue?.response?.trace_id,class:"btn-copy inline-block"},null,8,["content"])])):_("",!0)]),_:1})])):(n(),i("div",Xt,[t(d,{closable:!1,class:"info"},{template:u(()=>[t(l,{icon:"fa-regular fa-clock",class:"mr-1"}),f(" "+o(e.$t("seedance.status.pending")),1)]),default:u(()=>[r("p",Jt,[t(l,{icon:"fa-solid fa-magic",class:"mr-1"}),f(" "+o(e.$t("seedance.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),t(m,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])])]),_:1})]))])])}const vs=E(Ot,[["render",hs],["__scopeId","data-v-55180a54"]]),$s=b({name:"SeedanceRecentPanel",components:{TaskPreview:vs,BotPlaceholder:he,NoTasks:ve,ScrollList:le},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],computed:{tasks(){return{...this.$store.state.seedance?.tasks,items:this.$store.state.seedance?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),gs={key:0},bs={key:2,class:"w-full h-full flex items-center justify-center"};function Es(e,a,p,h,g,$){const c=s("bot-placeholder"),l=s("task-preview"),m=s("scroll-list"),d=s("no-tasks");return n(),i(L,null,[e.tasks?.items===void 0?(n(),i("div",gs,[t(c)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(n(),w(m,{key:1,ref:"scrollList",class:"tasks w-full h-full overflow-y-auto",loading:e.loading,onReachTop:a[0]||(a[0]=k=>e.$emit("reach-top"))},{default:u(()=>[(n(!0),i(L,null,F(e.tasks?.items,k=>(n(),w(l,{key:k.id,"model-value":k},null,8,["model-value"]))),128))]),_:1},8,["loading"])):_("",!0),e.tasks?.items?.length===0?(n(),i("div",bs,[t(d)])):_("",!0)],64)}const ks=E($s,[["render",Es]]),ys="https://webhook.acedata.cloud/seedance",ws=b({name:"SeedanceIndex",components:{ConfigPanel:Nt,Layout:Ve,RecentPanel:ks},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.seedance?.status?.getApplications===O.Request},tasksLoading(){return this.$store.state.seedance?.status?.getTasks===O.Request||this.fetchingTasks},credential(){return this.$store.state.seedance?.credential},config(){return this.$store.state.seedance?.config},tasks(){return this.$store.state.seedance?.tasks}},watch:{initialized:{async handler(e){e&&(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 be({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(){await this.$store.dispatch("seedance/getService")},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;const{limit:a=5,createdAtMin:p,createdAtMax:h}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch("seedance/getTasks",{limit:a,createdAtMin:p,createdAtMax:h})}finally{this.fetchingTasks=!1}},async onGenerate(){const e={...this.config||{}};if(typeof e?.prompt=="string"&&(e.prompt=e.prompt.trim(),e.prompt||delete e.prompt),Array.isArray(e?.images)){e.images=e.images.filter(c=>!!c?.url);const g=e.images.some(c=>c?.role==="first_frame"),$=e.images.some(c=>c?.role==="last_frame");!g&&$&&(e.images=e.images.map(c=>c?.role==="last_frame"?{...c,role:"first_frame"}:c))}!(Array.isArray(e?.images)&&e.images.length>0)&&"images"in e&&delete e.images;const p={...e,callback_url:ys},h=this.credential?.token;if(!h){console.error("no token specified");return}y.info(this.$t("seedance.message.startingTask")),ge.generate(p,{token:h}).then(()=>{y.success(this.$t("seedance.message.startTaskSuccess"))}).catch(g=>{const $=g?.response?.data;$?.error?.code===$e?y.error(this.$t("seedance.message.usedUp")):y.error(this.$t("seedance.message.startTaskFailed")+($?.error?.message||""))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Ss(e,a,p,h,g,$){const c=s("config-panel"),l=s("recent-panel"),m=s("layout");return n(),w(m,null,{config:u(()=>[t(c,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:u(()=>[t(l,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Eo=E(ws,[["render",Ss]]);export{Eo as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as C}from"./index.es-CR5c3J-H.js";import{E as P}from"./index-DRNT-3tY.js";import{E as G}from"./index-CtIMFI1x.js";import{d as v,H as l,E as r,z as A,C as s,y as d,D as n,q as o,F as a,I as g,O as I,N as T,x as E,Q as S,c as U,J as $}from"./vendor-vue-DU0w5ewx.js";import{D as b,b0 as D,a6 as z,ao as V}from"./index-CnxV03kA.js";import{p as M}from"./pasteUploadMixin-BurWbGNQ.js";import{I as O,S as j}from"./ScrollList-CLSW3Dbs.js";import{I as B}from"./ImagePreview-Dh9-XvKp.js";import{E as q}from"./index-DAIZ68Ng.js";import{E as w}from"./index-D9jYVi3R.js";import{a as F,E as N}from"./index-CahX5AtG.js";import{E as L}from"./index-DOwlxqQ4.js";import{E as H,a as J}from"./index-Dnv-ARoh.js";import{b as Q,a as K}from"./errorCode-Cqj9Td_Z.js";import{h as W}from"./headshots-DtMQ-fML.js";import{A as X}from"./Status-CCKc1DDl.js";import{C as Y}from"./CopyToClipboard-D8MfLJZp.js";import{E as Z}from"./index-BGWjIWtx.js";import{E as x,a as ee}from"./index-CFMP3iYS.js";import{l as se}from"./pagination-CcnL0MdN.js";import"./use-form-item-n1D0HOVh.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-Cvgzdobq.js";import"./vendor-vue-router-9TBHB1ku.js";import"./index-C36XUd3I.js";import"./index-CGzKdsQS.js";import"./typescript-D-y7TKkl.js";import"./index-DPvEmYP7.js";import"./_baseClone-CLa2JSau.js";import"./_Uint8Array-BtL2weNZ.js";import"./_initCloneObject-toOyHWRX.js";import"./isEqual-BUu7kkim.js";import"./debounce-BSdgAkOS.js";import"./index-DhIU2Ld8.js";import"./strings-DigWlKo9.js";import"./isPlainObject-C951NK-Z.js";const te=v({name:"LayoutHeadshots",components:{ElDrawer:G,ElButton:P,FontAwesomeIcon:C},data(){return{drawer:!1}}}),oe={class:"main flex flex-row flex-1"},ae={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},ne={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function ie(e,t,m,h,k,y){const p=n("font-awesome-icon"),u=n("el-button"),i=n("el-drawer");return o(),l("div",oe,[r("div",ae,[A(e.$slots,"config",{},void 0,!0)]),r("div",ne,[A(e.$slots,"result",{},void 0,!0)]),s(u,{circle:"",class:"menu",onClick:t[0]||(t[0]=c=>e.drawer=!0)},{default:d(()=>[s(p,{icon:"fa-solid fa-gear"})]),_:1}),s(i,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=c=>e.drawer=c),"with-header":!1,size:"340px",class:"drawer"},{default:d(()=>[A(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const le=b(te,[["render",ie],["__scopeId","data-v-202b355b"]]),re=v({name:"ImageUrlsInput",components:{ElUpload:q,ElButton:P,InfoIcon:O,ImagePreview:B,FontAwesomeIcon:C},mixins:[M],data(){return{fileList:[],uploadUrl:D()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.headshots?.config?.image_urls},set(){const e=this.urls;this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,image_urls:e})}}},mounted(){this.value||(this.value=void 0),this.onSetImageUrls()},methods:{onExceed(){w.warning(this.$t("headshots.message.uploadImageExceed"))},onError(){w.error(this.$t("headshots.message.uploadImageError"))},onSetImageUrls(){const e=this.urls;this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,image_urls:e})},async onSuccess(){this.onSetImageUrls()}}}),ce={class:"field"},de={class:"title font-bold"},pe={class:"upload-wrapper"};function me(e,t,m,h,k,y){const p=n("image-preview"),u=n("font-awesome-icon"),i=n("el-button"),c=n("el-upload"),f=n("info-icon");return o(),l("div",ce,[r("h2",de,a(e.$t("headshots.name.endImageUrls")),1),r("div",pe,[s(c,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",class:"value upload-wrapper",limit:2,multiple:!0,"list-type":"picture",action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:d(({file:_})=>[s(p,{url:_.url||_.response?.file_url,name:_.name,percentage:_.percentage,onRemove:R=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])]),default:d(()=>[s(i,{size:"small",type:"primary",round:""},{default:d(()=>[s(u,{icon:"fa-solid fa-upload",class:"mr-1"}),g(" "+a(e.$t("headshots.button.uploadImageUrls")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])]),s(f,{content:e.$t("headshots.description.endImageUrls"),class:"info"},null,8,["content"])])}const he=b(re,[["render",me],["__scopeId","data-v-ca56051e"]]),ue="fast",fe=v({name:"ModeSelector",components:{ElRadioButton:N,ElRadioGroup:F},data(){return{options:[{label:this.$t("headshots.button.fast"),value:"fast"},{label:this.$t("headshots.button.relax"),value:"relax"}]}},computed:{value:{get(){return this.$store.state.headshots.config?.mode},set(e){console.debug("set mode",e),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots.config,mode:e})}}},mounted(){this.value||(this.value=ue)}}),ge={class:"field"},_e={class:"title font-bold"};function $e(e,t,m,h,k,y){const p=n("el-radio-button"),u=n("el-radio-group");return o(),l("div",ge,[r("h2",_e,a(e.$t("headshots.name.mode")),1),s(u,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=i=>e.value=i),class:"mode"},{default:d(()=>[(o(!0),l(I,null,T(e.options,i=>(o(),E(p,{key:i.value,label:i.value},{default:d(()=>[g(a(i.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])])}const ve=b(fe,[["render",$e],["__scopeId","data-v-e7702494"]]),be=v({name:"StylizeSelector",components:{ElTabs:J,ElTabPane:H,ElImage:L},data(){return{tab:"styles",value:"",elements:{styles:{displayName:this.$t("headshots.styleCategory.styles"),items:[{image:"https://static.aipedias.com/aicamera/common/20241008/20241008202314260779439.png",label:this.$t("headshots.styleTag.malePportrait"),value:"male_portrait"},{image:"https://static.aipedias.com/aicamera/common/20241008/202410082022241e9755548.png",label:this.$t("headshots.styleTag.malePportrait2"),value:"male_portrait2"},{image:"https://static.aipedias.com/aicamera/common/20241101/20241101170130d78f66521.png",label:this.$t("headshots.styleTag.kindergarten"),value:"kindergarten"},{image:"https://static.aipedias.com/aicamera/common/20240923/20240923123233accf60398.webp",label:this.$t("headshots.styleTag.logoTshirt"),value:"logo_tshirt"},{image:"https://static.aipedias.com/aicamera/common/20241025/202410252012329472d0656.jpg",label:this.$t("headshots.styleTag.wedding"),value:"wedding"},{image:"https://static.aipedias.com/aicamera/common/20240915/20240915145045254931400.webp",label:this.$t("headshots.styleTag.businessPphoto"),value:"business_photo"},{image:"https://static.aipedias.com/aicamera/common/20240810/20240810194526040341795.jpg",label:this.$t("headshots.styleTag.bobSuit"),value:"bob_suit"},{image:"https://static.aipedias.com/aicamera/common/20240717/20240717152654e0b348173.webp",label:this.$t("headshots.styleTag.femalePortrait"),value:"female_portrait"}]}}}},watch:{value(e){console.debug("set template",e),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,template:e})}},mounted(){this.value||(this.value=""),console.debug("set template",this.value),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,template:this.value})},methods:{onToggle(e){this.value===e?this.value="":this.value=e,console.debug("set template",this.value),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,template:this.value})}}}),ke={class:"field"},ye=["onClick"],we={class:"name"};function Ie(e,t,m,h,k,y){const p=n("el-image"),u=n("el-tab-pane"),i=n("el-tabs");return o(),l("div",ke,[s(i,{modelValue:e.tab,"onUpdate:modelValue":t[0]||(t[0]=c=>e.tab=c)},{default:d(()=>[(o(!0),l(I,null,T(e.elements,(c,f)=>(o(),E(u,{key:f,label:c.displayName,name:f,class:"pane"},{default:d(()=>[(o(!0),l(I,null,T(c.items,(_,R)=>(o(),l("div",{key:R,class:S({item:!0,active:e.value===_.value}),onClick:bs=>e.onToggle(_.value)},[s(p,{src:_.image,fit:"fill",class:"preview"},null,8,["src"]),r("span",we,a(_.label),1)],10,ye))),128))]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])])}const Te=b(be,[["render",Ie],["__scopeId","data-v-be4bd25d"]]),Ee=v({name:"PresetPanel",components:{ModeSelector:ve,ImageUrlsInput:he,ElButton:P,FontAwesomeIcon:C,ElementsSelector:Te},emits:["generate"],computed:{config(){return this.$store.state.headshots?.config}},methods:{onGenerate(){this.$emit("generate")}}}),Se={class:"panel"},Ve={class:"config"},Ce={class:"actions"};function Ae(e,t,m,h,k,y){const p=n("elements-selector"),u=n("mode-selector"),i=n("image-urls-input"),c=n("font-awesome-icon"),f=n("el-button");return o(),l("div",Se,[r("div",Ve,[s(p,{class:"mb-4"}),s(u,{class:"mb-4"}),s(i,{class:"mb-4"}),r("div",Ce,[s(f,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:d(()=>[s(c,{icon:"fa-solid fa-magic",class:"mr-2"}),g(" "+a(e.$t("headshots.button.generate")),1)]),_:1},8,["onClick"])])])])}const Pe=b(Ee,[["render",Ae],["__scopeId","data-v-848739f6"]]),Re=v({name:"ImageGallery",props:{modelValue:{type:Object,required:!0}},setup(e){return{images:U(()=>e.modelValue?.response?.data?.slice(0,2)||[]),viewImage:h=>{window.open(h,"_blank")}}}}),Le={class:"image-gallery"},Ge=["src"],Ue=["onClick"];function De(e,t,m,h,k,y){return o(),l("div",Le,[(o(!0),l(I,null,T(e.images,(p,u)=>(o(),l("div",{key:u,class:"image-container"},[r("img",{src:p.image_url,alt:"Image"},null,8,Ge),p.image_url?(o(),l("button",{key:0,class:"view-button",onClick:i=>e.viewImage(p.image_url)},a(e.$t("headshots.button.viewImage")),9,Ue)):$("",!0)]))),128))])}const ze=b(Re,[["render",De],["__scopeId","data-v-42f0a7be"]]),Me=v({name:"TaskPreview",components:{ElImage:L,CopyToClipboard:Y,FontAwesomeIcon:C,ElAlert:Z,ImageGallery:ze},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.headshots?.application},config(){return this.$store.state.headshots?.config}},methods:{onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onReload(e){const t=e.target,m=new URL(t.src),h=m.searchParams.get("retry");if(!h)m.searchParams.set("retry","1");else if(parseInt(h)<2)m.searchParams.set("retry",(parseInt(h)+1).toString());else return;t.src=m.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),Oe={class:"preview"},je={class:"left"},Be={class:"main"},qe={class:"bot"},Fe={class:"datetime"},Ne={class:"info"},He={key:0,class:"prompt mt-2"},Je={key:0},Qe={key:1},Ke={key:0,class:S({content:!0,failed:!0})},We={class:"image-wrapper"},Xe={class:"description"},Ye={key:0,class:"description"},Ze={key:1,class:S({content:!0})},xe={class:"description"},es={class:"description"},ss={key:0,class:"description"},ts={class:"description"},os={key:2,class:S({content:!0})},as={class:"description"},ns={key:3,class:S({content:!0})},is={class:"description"};function ls(e,t,m,h,k,y){const p=n("el-image"),u=n("image-gallery"),i=n("font-awesome-icon"),c=n("copy-to-clipboard"),f=n("el-alert");return o(),l("div",Oe,[r("div",je,[s(p,{src:"https://cdn.acedata.cloud/isxyfw.png",class:"avatar"})]),r("div",Be,[r("div",qe,[g(a(e.$t("headshots.name.headshotsBot"))+" ",1),r("span",Fe,a(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),r("div",Ne,[e.modelValue?.request?.template?(o(),l("p",He,[g(a(e.modelValue?.request?.template)+" ",1),e.modelValue?.response?$("",!0):(o(),l("span",Je," - ("+a(e.$t("headshots.status.pending"))+") ",1)),e.modelValue?.response?.status==="unknown"?(o(),l("span",Qe," - ("+a(e.$t("headshots.status.processing"))+") ",1)):$("",!0)])):$("",!0)]),e.modelValue?.response?.success===!0?(o(),l("div",Ke,[r("div",We,[s(u,{"model-value":e.modelValue},null,8,["model-value"])]),s(f,{closable:!1,class:"mt-2 success"},{default:d(()=>[r("p",Xe,[s(i,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+a(e.$t("headshots.name.taskId"))+": "+a(e.modelValue?.id)+" ",1),s(c,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.elapsed?(o(),l("p",Ye,[s(i,{icon:"fa-solid fa-clock",class:"mr-1"}),g(" "+a(e.$t("headshots.name.elapsed"))+": "+a(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0)]),_:1})])):$("",!0),e.modelValue?.response?.success===!1?(o(),l("div",Ze,[s(f,{closable:!1,class:"failure"},{template:d(()=>[s(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),g(" "+a(e.$t("headshots.name.failure")),1)]),default:d(()=>[r("p",xe,[s(i,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+a(e.$t("headshots.name.taskId"))+": "+a(e.modelValue?.id)+" ",1),s(c,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),r("p",es,[s(i,{icon:"fa-solid fa-circle-info",class:"mr-1"}),g(" "+a(e.$t("headshots.name.failureReason"))+": "+a(e.modelValue?.response?.error?.message)+" ",1),s(c,{content:e.modelValue?.response?.error?.message,class:"btn-copy"},null,8,["content"])]),e.modelValue?.elapsed?(o(),l("p",ss,[s(i,{icon:"fa-solid fa-clock",class:"mr-1"}),g(" "+a(e.$t("headshots.name.elapsed"))+": "+a(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0),r("p",ts,[s(i,{icon:"fa-solid fa-hashtag",class:"mr-1"}),g(" "+a(e.$t("headshots.name.traceId"))+": "+a(e.modelValue?.response?.trace_id)+" ",1),s(c,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])]),_:1})])):$("",!0),e.modelValue?.response?$("",!0):(o(),l("div",os,[s(f,{closable:!1,class:"info"},{template:d(()=>[s(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),g(" "+a(e.$t("headshots.name.failure")),1)]),default:d(()=>[r("p",as,[s(i,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+a(e.$t("headshots.name.taskId"))+": "+a(e.modelValue?.id)+" ",1),s(c,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])])]),_:1})])),e.modelValue?.response?.status==="unknown"?(o(),l("div",ns,[s(f,{closable:!1,class:"info"},{template:d(()=>[s(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),g(" "+a(e.$t("headshots.name.failure")),1)]),default:d(()=>[r("p",is,[s(i,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+a(e.$t("headshots.name.taskId"))+": "+a(e.modelValue?.id)+" ",1),s(c,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])])]),_:1})])):$("",!0)])])}const rs=b(Me,[["render",ls],["__scopeId","data-v-d286678e"]]),cs=v({name:"RecentPanel",components:{TaskPreview:rs,ElSkeleton:ee,ElSkeletonItem:x,ScrollList:j},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.headshots?.tasks,items:this.$store.state.headshots?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),ds={key:0,class:"tasks"},ps={class:"left"},ms={class:"main"},hs={key:1,class:"tasks"},us={key:2,class:"description"};function fs(e,t,m,h,k,y){const p=n("el-skeleton-item"),u=n("el-skeleton"),i=n("task-preview"),c=n("scroll-list");return o(),E(c,{ref:"scrollList",class:"panel recent",loading:e.loading,onReachTop:t[0]||(t[0]=f=>e.$emit("reach-top"))},{default:d(()=>[e.tasks?.items===void 0?(o(),l("div",ds,[(o(),l(I,null,T(3,f=>r("div",{key:f,class:"task placeholder"},[r("div",ps,[s(u,{animated:""},{template:d(()=>[s(p,{variant:"image",class:"avatar"})]),_:1})]),r("div",ms,[s(u,{animated:""},{template:d(()=>[s(p,{variant:"p",class:"title"}),s(p,{variant:"image",class:"icon"})]),_:1})])])),64))])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(o(),l("div",hs,[(o(!0),l(I,null,T(e.tasks?.items,(f,_)=>(o(),E(i,{key:_,"model-value":f,class:"preview"},null,8,["model-value"]))),128))])):$("",!0),e.tasks?.items?.length===0?(o(),l("p",us,a(e.$t("headshots.message.noTasks")),1)):$("",!0)]),_:1},8,["loading"])}const gs=b(cs,[["render",fs],["__scopeId","data-v-ffd55c16"]]),_s="https://webhook.acedata.cloud/headshots",$s=v({name:"HeadshotsIndex",components:{ConfigPanel:Pe,Layout:le,ApplicationStatus:X,RecentPanel:gs},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.headshots?.status?.getApplications===V.Request},tasksLoading(){return this.$store.state.headshots?.status?.getTasks===V.Request||this.fetchingTasks},service(){return this.$store.state.headshots.service},credential(){return this.$store.state.headshots.credential},config(){return this.$store.state.headshots.config},initializing(){return this.$store.state.headshots.status.getApplications===V.Request},needApply(){return this.$store.state.headshots.status.getApplications===V.Success&&!this.application},application(){return this.$store.state.headshots.application},applications(){return this.$store.state.headshots.applications},tasks(){return this.$store.state.headshots.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await se({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("headshots/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("headshots/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},onApply(){z.create({application:this.application}).then(({data:e})=>{this.application=e,w.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{e?.response?.data?.code===K&&w.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:m,createdAtMax:h}=e||{};console.debug("limit",t,"createdAtMin",m,"createdAtMax",h),this.fetchingTasks=!0;try{await this.$store.dispatch("headshots/getTasks",{limit:t,createdAtMin:m,createdAtMax:h})}finally{this.fetchingTasks=!1}},async onGeneratePicture(){const e={...this.config,callback_url:_s},t=this.credential?.token;if(!t){console.error("no token specified");return}w.info(this.$t("headshots.message.startingTask")),W.generate(e,{token:t}).then(()=>{w.success(this.$t("headshots.message.startTaskSuccess")),this.$store.commit("headshots/setConfig",{config:void 0})}).catch(m=>{m?.response?.data?.error?.code===Q?w.error(this.$t("headshots.message.usedUp")):w.error(this.$t("headshots.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function vs(e,t,m,h,k,y){const p=n("config-panel"),u=n("application-status"),i=n("recent-panel"),c=n("layout");return o(),E(c,null,{config:d(()=>[s(p,{onGenerate:e.onGeneratePicture},null,8,["onGenerate"])]),result:d(()=>[s(u,{initializing:e.initializing,application:e.application,applications:e.applications,service:e.service,"need-apply":e.needApply,class:"mb-4",onRefresh:e.onGetApplication,onSelect:t[0]||(t[0]=f=>e.$store.dispatch("headshots/setApplication",f))},null,8,["initializing","application","applications","service","need-apply","onRefresh"]),s(i,{ref:"recentPanel",class:"panel recent",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const at=b($s,[["render",vs],["__scopeId","data-v-6cafffbd"]]);export{at as default};
|
|
1
|
+
import{F as C}from"./index.es-B1lW1a9B.js";import{E as P}from"./index-jii325vi.js";import{E as G}from"./index-38G9IKZp.js";import{d as v,H as l,E as r,z as A,C as s,y as d,D as n,q as o,F as a,I as g,O as I,N as T,x as E,Q as S,c as U,J as $}from"./vendor-vue-DU0w5ewx.js";import{E as b,b1 as D,a7 as z,ap as V}from"./index-FTscF_cz.js";import{p as M}from"./pasteUploadMixin-BurWbGNQ.js";import{I as O,S as j}from"./ScrollList-CHr2ER0d.js";import{I as B}from"./ImagePreview-B7ddO4K-.js";import{E as q}from"./index-aO6Fi57H.js";import{E as w}from"./index-FF4WAJT-.js";import{a as F,E as N}from"./index-B--xRYrq.js";import{E as L}from"./index-DdfzO8ET.js";import{E as H,a as J}from"./index-CW-yt64R.js";import{b as Q,a as K}from"./errorCode-Cqj9Td_Z.js";import{h as W}from"./headshots-C_z_6iJl.js";import{A as X}from"./Status-BtwLPzrZ.js";import{C as Y}from"./CopyToClipboard-99x8TU_E.js";import{E as Z}from"./index-B2l9Ai7a.js";import{E as x,a as ee}from"./index-CJJgickM.js";import{l as se}from"./pagination-CcnL0MdN.js";import"./use-form-item-DDWqgx7q.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-Cvgzdobq.js";import"./vendor-vue-router-9TBHB1ku.js";import"./index-DTQtEf7n.js";import"./index-DB1wHeLA.js";import"./typescript-CUMR9uNq.js";import"./index-BdrHjNrn.js";import"./_baseClone-CVDR-yNh.js";import"./_Uint8Array-BWy8cKCo.js";import"./_initCloneObject-BnGf6y2Q.js";import"./isEqual-BiGspMHU.js";import"./debounce-rFO21RGd.js";import"./index-RiVU3gTe.js";import"./strings-DigWlKo9.js";import"./isPlainObject-1A9ncyWS.js";const te=v({name:"LayoutHeadshots",components:{ElDrawer:G,ElButton:P,FontAwesomeIcon:C},data(){return{drawer:!1}}}),oe={class:"main flex flex-row flex-1"},ae={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},ne={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function ie(e,t,m,h,k,y){const p=n("font-awesome-icon"),u=n("el-button"),i=n("el-drawer");return o(),l("div",oe,[r("div",ae,[A(e.$slots,"config",{},void 0,!0)]),r("div",ne,[A(e.$slots,"result",{},void 0,!0)]),s(u,{circle:"",class:"menu",onClick:t[0]||(t[0]=c=>e.drawer=!0)},{default:d(()=>[s(p,{icon:"fa-solid fa-gear"})]),_:1}),s(i,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=c=>e.drawer=c),"with-header":!1,size:"340px",class:"drawer"},{default:d(()=>[A(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const le=b(te,[["render",ie],["__scopeId","data-v-202b355b"]]),re=v({name:"ImageUrlsInput",components:{ElUpload:q,ElButton:P,InfoIcon:O,ImagePreview:B,FontAwesomeIcon:C},mixins:[M],data(){return{fileList:[],uploadUrl:D()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.headshots?.config?.image_urls},set(){const e=this.urls;this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,image_urls:e})}}},mounted(){this.value||(this.value=void 0),this.onSetImageUrls()},methods:{onExceed(){w.warning(this.$t("headshots.message.uploadImageExceed"))},onError(){w.error(this.$t("headshots.message.uploadImageError"))},onSetImageUrls(){const e=this.urls;this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,image_urls:e})},async onSuccess(){this.onSetImageUrls()}}}),ce={class:"field"},de={class:"title font-bold"},pe={class:"upload-wrapper"};function me(e,t,m,h,k,y){const p=n("image-preview"),u=n("font-awesome-icon"),i=n("el-button"),c=n("el-upload"),f=n("info-icon");return o(),l("div",ce,[r("h2",de,a(e.$t("headshots.name.endImageUrls")),1),r("div",pe,[s(c,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",class:"value upload-wrapper",limit:2,multiple:!0,"list-type":"picture",action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:d(({file:_})=>[s(p,{url:_.url||_.response?.file_url,name:_.name,percentage:_.percentage,onRemove:R=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])]),default:d(()=>[s(i,{size:"small",type:"primary",round:""},{default:d(()=>[s(u,{icon:"fa-solid fa-upload",class:"mr-1"}),g(" "+a(e.$t("headshots.button.uploadImageUrls")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])]),s(f,{content:e.$t("headshots.description.endImageUrls"),class:"info"},null,8,["content"])])}const he=b(re,[["render",me],["__scopeId","data-v-ca56051e"]]),ue="fast",fe=v({name:"ModeSelector",components:{ElRadioButton:N,ElRadioGroup:F},data(){return{options:[{label:this.$t("headshots.button.fast"),value:"fast"},{label:this.$t("headshots.button.relax"),value:"relax"}]}},computed:{value:{get(){return this.$store.state.headshots.config?.mode},set(e){console.debug("set mode",e),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots.config,mode:e})}}},mounted(){this.value||(this.value=ue)}}),ge={class:"field"},_e={class:"title font-bold"};function $e(e,t,m,h,k,y){const p=n("el-radio-button"),u=n("el-radio-group");return o(),l("div",ge,[r("h2",_e,a(e.$t("headshots.name.mode")),1),s(u,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=i=>e.value=i),class:"mode"},{default:d(()=>[(o(!0),l(I,null,T(e.options,i=>(o(),E(p,{key:i.value,label:i.value},{default:d(()=>[g(a(i.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])])}const ve=b(fe,[["render",$e],["__scopeId","data-v-e7702494"]]),be=v({name:"StylizeSelector",components:{ElTabs:J,ElTabPane:H,ElImage:L},data(){return{tab:"styles",value:"",elements:{styles:{displayName:this.$t("headshots.styleCategory.styles"),items:[{image:"https://static.aipedias.com/aicamera/common/20241008/20241008202314260779439.png",label:this.$t("headshots.styleTag.malePportrait"),value:"male_portrait"},{image:"https://static.aipedias.com/aicamera/common/20241008/202410082022241e9755548.png",label:this.$t("headshots.styleTag.malePportrait2"),value:"male_portrait2"},{image:"https://static.aipedias.com/aicamera/common/20241101/20241101170130d78f66521.png",label:this.$t("headshots.styleTag.kindergarten"),value:"kindergarten"},{image:"https://static.aipedias.com/aicamera/common/20240923/20240923123233accf60398.webp",label:this.$t("headshots.styleTag.logoTshirt"),value:"logo_tshirt"},{image:"https://static.aipedias.com/aicamera/common/20241025/202410252012329472d0656.jpg",label:this.$t("headshots.styleTag.wedding"),value:"wedding"},{image:"https://static.aipedias.com/aicamera/common/20240915/20240915145045254931400.webp",label:this.$t("headshots.styleTag.businessPphoto"),value:"business_photo"},{image:"https://static.aipedias.com/aicamera/common/20240810/20240810194526040341795.jpg",label:this.$t("headshots.styleTag.bobSuit"),value:"bob_suit"},{image:"https://static.aipedias.com/aicamera/common/20240717/20240717152654e0b348173.webp",label:this.$t("headshots.styleTag.femalePortrait"),value:"female_portrait"}]}}}},watch:{value(e){console.debug("set template",e),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,template:e})}},mounted(){this.value||(this.value=""),console.debug("set template",this.value),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,template:this.value})},methods:{onToggle(e){this.value===e?this.value="":this.value=e,console.debug("set template",this.value),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,template:this.value})}}}),ke={class:"field"},ye=["onClick"],we={class:"name"};function Ie(e,t,m,h,k,y){const p=n("el-image"),u=n("el-tab-pane"),i=n("el-tabs");return o(),l("div",ke,[s(i,{modelValue:e.tab,"onUpdate:modelValue":t[0]||(t[0]=c=>e.tab=c)},{default:d(()=>[(o(!0),l(I,null,T(e.elements,(c,f)=>(o(),E(u,{key:f,label:c.displayName,name:f,class:"pane"},{default:d(()=>[(o(!0),l(I,null,T(c.items,(_,R)=>(o(),l("div",{key:R,class:S({item:!0,active:e.value===_.value}),onClick:bs=>e.onToggle(_.value)},[s(p,{src:_.image,fit:"fill",class:"preview"},null,8,["src"]),r("span",we,a(_.label),1)],10,ye))),128))]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])])}const Te=b(be,[["render",Ie],["__scopeId","data-v-be4bd25d"]]),Ee=v({name:"PresetPanel",components:{ModeSelector:ve,ImageUrlsInput:he,ElButton:P,FontAwesomeIcon:C,ElementsSelector:Te},emits:["generate"],computed:{config(){return this.$store.state.headshots?.config}},methods:{onGenerate(){this.$emit("generate")}}}),Se={class:"panel"},Ve={class:"config"},Ce={class:"actions"};function Ae(e,t,m,h,k,y){const p=n("elements-selector"),u=n("mode-selector"),i=n("image-urls-input"),c=n("font-awesome-icon"),f=n("el-button");return o(),l("div",Se,[r("div",Ve,[s(p,{class:"mb-4"}),s(u,{class:"mb-4"}),s(i,{class:"mb-4"}),r("div",Ce,[s(f,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:d(()=>[s(c,{icon:"fa-solid fa-magic",class:"mr-2"}),g(" "+a(e.$t("headshots.button.generate")),1)]),_:1},8,["onClick"])])])])}const Pe=b(Ee,[["render",Ae],["__scopeId","data-v-848739f6"]]),Re=v({name:"ImageGallery",props:{modelValue:{type:Object,required:!0}},setup(e){return{images:U(()=>e.modelValue?.response?.data?.slice(0,2)||[]),viewImage:h=>{window.open(h,"_blank")}}}}),Le={class:"image-gallery"},Ge=["src"],Ue=["onClick"];function De(e,t,m,h,k,y){return o(),l("div",Le,[(o(!0),l(I,null,T(e.images,(p,u)=>(o(),l("div",{key:u,class:"image-container"},[r("img",{src:p.image_url,alt:"Image"},null,8,Ge),p.image_url?(o(),l("button",{key:0,class:"view-button",onClick:i=>e.viewImage(p.image_url)},a(e.$t("headshots.button.viewImage")),9,Ue)):$("",!0)]))),128))])}const ze=b(Re,[["render",De],["__scopeId","data-v-42f0a7be"]]),Me=v({name:"TaskPreview",components:{ElImage:L,CopyToClipboard:Y,FontAwesomeIcon:C,ElAlert:Z,ImageGallery:ze},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.headshots?.application},config(){return this.$store.state.headshots?.config}},methods:{onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onReload(e){const t=e.target,m=new URL(t.src),h=m.searchParams.get("retry");if(!h)m.searchParams.set("retry","1");else if(parseInt(h)<2)m.searchParams.set("retry",(parseInt(h)+1).toString());else return;t.src=m.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),Oe={class:"preview"},je={class:"left"},Be={class:"main"},qe={class:"bot"},Fe={class:"datetime"},Ne={class:"info"},He={key:0,class:"prompt mt-2"},Je={key:0},Qe={key:1},Ke={key:0,class:S({content:!0,failed:!0})},We={class:"image-wrapper"},Xe={class:"description"},Ye={key:0,class:"description"},Ze={key:1,class:S({content:!0})},xe={class:"description"},es={class:"description"},ss={key:0,class:"description"},ts={class:"description"},os={key:2,class:S({content:!0})},as={class:"description"},ns={key:3,class:S({content:!0})},is={class:"description"};function ls(e,t,m,h,k,y){const p=n("el-image"),u=n("image-gallery"),i=n("font-awesome-icon"),c=n("copy-to-clipboard"),f=n("el-alert");return o(),l("div",Oe,[r("div",je,[s(p,{src:"https://cdn.acedata.cloud/isxyfw.png",class:"avatar"})]),r("div",Be,[r("div",qe,[g(a(e.$t("headshots.name.headshotsBot"))+" ",1),r("span",Fe,a(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),r("div",Ne,[e.modelValue?.request?.template?(o(),l("p",He,[g(a(e.modelValue?.request?.template)+" ",1),e.modelValue?.response?$("",!0):(o(),l("span",Je," - ("+a(e.$t("headshots.status.pending"))+") ",1)),e.modelValue?.response?.status==="unknown"?(o(),l("span",Qe," - ("+a(e.$t("headshots.status.processing"))+") ",1)):$("",!0)])):$("",!0)]),e.modelValue?.response?.success===!0?(o(),l("div",Ke,[r("div",We,[s(u,{"model-value":e.modelValue},null,8,["model-value"])]),s(f,{closable:!1,class:"mt-2 success"},{default:d(()=>[r("p",Xe,[s(i,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+a(e.$t("headshots.name.taskId"))+": "+a(e.modelValue?.id)+" ",1),s(c,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.elapsed?(o(),l("p",Ye,[s(i,{icon:"fa-solid fa-clock",class:"mr-1"}),g(" "+a(e.$t("headshots.name.elapsed"))+": "+a(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0)]),_:1})])):$("",!0),e.modelValue?.response?.success===!1?(o(),l("div",Ze,[s(f,{closable:!1,class:"failure"},{template:d(()=>[s(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),g(" "+a(e.$t("headshots.name.failure")),1)]),default:d(()=>[r("p",xe,[s(i,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+a(e.$t("headshots.name.taskId"))+": "+a(e.modelValue?.id)+" ",1),s(c,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),r("p",es,[s(i,{icon:"fa-solid fa-circle-info",class:"mr-1"}),g(" "+a(e.$t("headshots.name.failureReason"))+": "+a(e.modelValue?.response?.error?.message)+" ",1),s(c,{content:e.modelValue?.response?.error?.message,class:"btn-copy"},null,8,["content"])]),e.modelValue?.elapsed?(o(),l("p",ss,[s(i,{icon:"fa-solid fa-clock",class:"mr-1"}),g(" "+a(e.$t("headshots.name.elapsed"))+": "+a(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0),r("p",ts,[s(i,{icon:"fa-solid fa-hashtag",class:"mr-1"}),g(" "+a(e.$t("headshots.name.traceId"))+": "+a(e.modelValue?.response?.trace_id)+" ",1),s(c,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])]),_:1})])):$("",!0),e.modelValue?.response?$("",!0):(o(),l("div",os,[s(f,{closable:!1,class:"info"},{template:d(()=>[s(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),g(" "+a(e.$t("headshots.name.failure")),1)]),default:d(()=>[r("p",as,[s(i,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+a(e.$t("headshots.name.taskId"))+": "+a(e.modelValue?.id)+" ",1),s(c,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])])]),_:1})])),e.modelValue?.response?.status==="unknown"?(o(),l("div",ns,[s(f,{closable:!1,class:"info"},{template:d(()=>[s(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),g(" "+a(e.$t("headshots.name.failure")),1)]),default:d(()=>[r("p",is,[s(i,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+a(e.$t("headshots.name.taskId"))+": "+a(e.modelValue?.id)+" ",1),s(c,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])])]),_:1})])):$("",!0)])])}const rs=b(Me,[["render",ls],["__scopeId","data-v-d286678e"]]),cs=v({name:"RecentPanel",components:{TaskPreview:rs,ElSkeleton:ee,ElSkeletonItem:x,ScrollList:j},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.headshots?.tasks,items:this.$store.state.headshots?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),ds={key:0,class:"tasks"},ps={class:"left"},ms={class:"main"},hs={key:1,class:"tasks"},us={key:2,class:"description"};function fs(e,t,m,h,k,y){const p=n("el-skeleton-item"),u=n("el-skeleton"),i=n("task-preview"),c=n("scroll-list");return o(),E(c,{ref:"scrollList",class:"panel recent",loading:e.loading,onReachTop:t[0]||(t[0]=f=>e.$emit("reach-top"))},{default:d(()=>[e.tasks?.items===void 0?(o(),l("div",ds,[(o(),l(I,null,T(3,f=>r("div",{key:f,class:"task placeholder"},[r("div",ps,[s(u,{animated:""},{template:d(()=>[s(p,{variant:"image",class:"avatar"})]),_:1})]),r("div",ms,[s(u,{animated:""},{template:d(()=>[s(p,{variant:"p",class:"title"}),s(p,{variant:"image",class:"icon"})]),_:1})])])),64))])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(o(),l("div",hs,[(o(!0),l(I,null,T(e.tasks?.items,(f,_)=>(o(),E(i,{key:_,"model-value":f,class:"preview"},null,8,["model-value"]))),128))])):$("",!0),e.tasks?.items?.length===0?(o(),l("p",us,a(e.$t("headshots.message.noTasks")),1)):$("",!0)]),_:1},8,["loading"])}const gs=b(cs,[["render",fs],["__scopeId","data-v-ffd55c16"]]),_s="https://webhook.acedata.cloud/headshots",$s=v({name:"HeadshotsIndex",components:{ConfigPanel:Pe,Layout:le,ApplicationStatus:X,RecentPanel:gs},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.headshots?.status?.getApplications===V.Request},tasksLoading(){return this.$store.state.headshots?.status?.getTasks===V.Request||this.fetchingTasks},service(){return this.$store.state.headshots.service},credential(){return this.$store.state.headshots.credential},config(){return this.$store.state.headshots.config},initializing(){return this.$store.state.headshots.status.getApplications===V.Request},needApply(){return this.$store.state.headshots.status.getApplications===V.Success&&!this.application},application(){return this.$store.state.headshots.application},applications(){return this.$store.state.headshots.applications},tasks(){return this.$store.state.headshots.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await se({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("headshots/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("headshots/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},onApply(){z.create({application:this.application}).then(({data:e})=>{this.application=e,w.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{e?.response?.data?.code===K&&w.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:m,createdAtMax:h}=e||{};console.debug("limit",t,"createdAtMin",m,"createdAtMax",h),this.fetchingTasks=!0;try{await this.$store.dispatch("headshots/getTasks",{limit:t,createdAtMin:m,createdAtMax:h})}finally{this.fetchingTasks=!1}},async onGeneratePicture(){const e={...this.config,callback_url:_s},t=this.credential?.token;if(!t){console.error("no token specified");return}w.info(this.$t("headshots.message.startingTask")),W.generate(e,{token:t}).then(()=>{w.success(this.$t("headshots.message.startTaskSuccess")),this.$store.commit("headshots/setConfig",{config:void 0})}).catch(m=>{m?.response?.data?.error?.code===Q?w.error(this.$t("headshots.message.usedUp")):w.error(this.$t("headshots.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function vs(e,t,m,h,k,y){const p=n("config-panel"),u=n("application-status"),i=n("recent-panel"),c=n("layout");return o(),E(c,null,{config:d(()=>[s(p,{onGenerate:e.onGeneratePicture},null,8,["onGenerate"])]),result:d(()=>[s(u,{initializing:e.initializing,application:e.application,applications:e.applications,service:e.service,"need-apply":e.needApply,class:"mb-4",onRefresh:e.onGetApplication,onSelect:t[0]||(t[0]=f=>e.$store.dispatch("headshots/setApplication",f))},null,8,["initializing","application","applications","service","need-apply","onRefresh"]),s(i,{ref:"recentPanel",class:"panel recent",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const at=b($s,[["render",vs],["__scopeId","data-v-6cafffbd"]]);export{at as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as E}from"./index.es-B1lW1a9B.js";import{E as L}from"./index-jii325vi.js";import{E as de}from"./index-38G9IKZp.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 be,I as w,M as ye}from"./vendor-vue-DU0w5ewx.js";import{E as y,b1 as A,a0 as we,F as Ce,ap as te}from"./index-FTscF_cz.js";import{b as Ve,c as oe,d as F,e as N,f as Se,g as Te,h as Ie}from"./kling-CtoPhhA9.js";import{E as P,a as D}from"./index-DKT9lpv-.js";import{E as q}from"./index-DsKeM0Xq.js";import{E as C}from"./index-FF4WAJT-.js";import{I as S,S as Ee}from"./ScrollList-CHr2ER0d.js";import{a as H,E as me}from"./index-DefEPu5Z.js";import{p as W}from"./pasteUploadMixin-BurWbGNQ.js";import{I as G}from"./ImagePreview-B7ddO4K-.js";import{E as J}from"./index-DTQtEf7n.js";import{E as K}from"./index-aO6Fi57H.js";import{C as pe}from"./Consumption-D8o6ZGlD.js";import{E as ue}from"./index-o4zhAWG6.js";import{E as Q}from"./index-DUswWNzD.js";import{a as ge}from"./price-D5TNZtWD.js";import{F as Le}from"./FilePreview-BMrbMk0x.js";import{E as Me,a as Ue}from"./index-B--xRYrq.js";import{E as Re,a as Ae}from"./index-CW-yt64R.js";import{b as ne}from"./errorCode-Cqj9Td_Z.js";import{k as se}from"./kling-Bga-2-Yk.js";import{C as Pe}from"./CopyToClipboard-99x8TU_E.js";import{V as De}from"./VideoPlayer-BJPVVH4v.js";import{E as Ge}from"./index-B2l9Ai7a.js";import{E as Ke}from"./index-DdfzO8ET.js";import{B as Oe}from"./BotPlaceholder-808fKlrc.js";import{N as je}from"./NoTasks-CzCoCJiJ.js";import{l as Ne}from"./pagination-CcnL0MdN.js";import"./use-form-item-DDWqgx7q.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-Cvgzdobq.js";import"./vendor-vue-router-9TBHB1ku.js";import"./index-BRydlsSG.js";import"./typescript-CUMR9uNq.js";import"./index-DB1wHeLA.js";import"./strings-DigWlKo9.js";import"./isEqual-BiGspMHU.js";import"./_Uint8Array-BWy8cKCo.js";import"./castArray-BX2YHThj.js";import"./debounce-rFO21RGd.js";import"./_baseIteratee-GCheQ423.js";import"./index-CJtfHm7C.js";import"./validator-pb75_c-A.js";import"./index-Bz0iDXPF.js";import"./index-BdrHjNrn.js";import"./_baseClone-CVDR-yNh.js";import"./_initCloneObject-BnGf6y2Q.js";import"./index-RiVU3gTe.js";import"./isPlainObject-1A9ncyWS.js";import"./vue-plyr-BO2nlN4c.js";import"./index-CJJgickM.js";const Be=b({name:"LayoutKling",components:{ElDrawer:de,ElButton:L,FontAwesomeIcon:E},data(){return{drawer:!1}}}),ze={class:"main flex flex-row flex-1 min-h-0"},Fe={class:"config w-[320px] flex-none h-full flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},qe={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function He(e,t,s,a,u,$){const c=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),m("div",ze,[i("div",Fe,[j(e.$slots,"config",{},void 0,!0)]),i("div",qe,[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 We=y(Be,[["render",He],["__scopeId","data-v-8fa7523c"]]),Je={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function fe(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 Je}}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 $=fe(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 Qe=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(Ve)},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})}}}),Ye={class:"field"},Xe={class:"title font-bold"};function Ze(e,t,s,a,u,$){const c=o("el-option"),p=o("el-select");return l(),m("div",Ye,[i("h2",Xe,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 xe=y(Qe,[["render",Ze],["__scopeId","data-v-04059875"]]),et=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(oe)}},mounted(){this.value||this.applyMode(oe)},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})}}}),tt={class:"field"},ot={class:"header"},nt={class:"title font-bold"},st={key:0,class:"opt-tip"};function it(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),m("div",tt,[i("div",ot,[i("h2",nt,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",st,r(d.disabledReason),1)):k("",!0)]),_:2},1032,["label","value","disabled"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const lt=y(et,[["render",it],["__scopeId","data-v-9a8fa3c5"]]),ie=[3,5,8,10,12,15],le=[5,10],at=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?ie:le,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?ie:le).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})}}}),rt={class:"field"},ct={class:"header"},dt={class:"title font-bold"},mt={class:"value-display"};function pt(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-slider");return l(),m("div",rt,[i("div",ct,[i("h2",dt,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",mt,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 ut=y(at,[["render",pt],["__scopeId","data-v-aa1a22a1"]]),gt=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=Se)}}),ft={class:"text-sm font-bold mb-2 block"},ht={class:"items"},_t=["onClick"],$t={class:"name"};function vt(e,t,s,a,u,$){return l(),m("div",null,[i("span",ft,r(e.$t("kling.name.ratio")),1),i("div",ht,[(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:be({width:c.width+"px",height:c.height+"px"})},null,4)],2),i("p",$t,r(c.label),1)],10,_t))),128))])])}const kt=y(gt,[["render",vt],["__scopeId","data-v-cdb14b2f"]]),bt=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()}}}),yt={class:"relative"},wt={class:"flex justify-between"},Ct={class:"flex justify-start items-center"},Vt={class:"text-sm font-bold"};function St(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",yt,[i("div",wt,[i("div",Ct,[i("span",Vt,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 Tt=y(bt,[["render",St],["__scopeId","data-v-40832274"]]),It=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 fe(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()}}}),Et={class:"relative"},Lt={class:"flex justify-between"},Mt={class:"flex justify-start items-center"},Ut={class:"text-sm font-bold"};function Rt(e,t,s,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",Et,[i("div",Lt,[i("div",Mt,[i("span",Ut,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 At=y(It,[["render",Rt],["__scopeId","data-v-6959ad44"]]),Pt=b({name:"CfgScaleSelector",components:{ElSlider:H,InfoIcon:S,ElInputNumber:me},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=Te)}}),Dt={class:"flex justify-between"},Gt={class:"flex justify-start items-center"},Kt={class:"text-sm font-bold"},Ot={class:"flex justify-end items-center"},jt={class:"w-full"};function Nt(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",Dt,[i("div",Gt,[i("span",Kt,r(e.$t("kling.name.cfgScale")),1),n(c,{content:e.$t("kling.description.cfgScale")},null,8,["content"])]),i("div",Ot,[n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),"controls-position":"right"},null,8,["modelValue"])])]),i("div",jt,[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 Bt=y(Pt,[["render",Nt]]),zt=b({name:"GenerateAudioSelector",components:{ElSwitch:ue,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??Ie:!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})}}}),Ft={class:"relative"},qt={class:"flex justify-between items-center"},Ht={class:"flex justify-start items-center"},Wt={class:"text-sm font-bold"};function Jt(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-switch");return l(),m("div",Ft,[i("div",qt,[i("div",Ht,[i("span",Wt,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 Qt=y(zt,[["render",Jt]]),Yt=["horizontal","vertical","pan","tilt","roll","zoom"],Xt=b({name:"CameraControlSelector",components:{ElSelect:D,ElOption:P,ElSlider:H,ElInputNumber:me,InfoIcon:S},data(){return{configKeys:Yt}},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)}}}),Zt={class:"field"},xt={class:"header"},eo={class:"text-sm font-bold"},to={key:0,class:"config-grid"},oo={class:"cfg-row-head"},no={class:"cfg-name"};function so(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",Zt,[i("div",xt,[i("span",eo,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",to,[(l(!0),m(T,null,I(e.configKeys,g=>(l(),m("div",{key:g,class:"cfg-row"},[i("div",oo,[i("span",no,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 io=y(Xt,[["render",so],["__scopeId","data-v-fb7b34d0"]]),he=[{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 lo(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 ao=b({name:"InspirationPills",components:{FontAwesomeIcon:E},computed:{prompt(){return this.$store.state.kling?.config?.prompt||""},allChipTexts(){return he.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})}}}),ro={key:0,class:"pills",role:"list"},co={class:"pill-text"},mo=["aria-label","onClick"];function po(e,t,s,a,u,$){const c=o("font-awesome-icon");return e.selected.length>0?(l(),m("div",ro,[(l(!0),m(T,null,I(e.selected,p=>(l(),m("div",{key:p,class:"pill",role:"listitem"},[i("span",co,r(p),1),i("button",{type:"button",class:"pill-remove","aria-label":e.$t("kling.inspiration.removeChip"),onClick:ye(f=>e.onRemove(p),["stop"])},[n(c,{icon:"fa-solid fa-xmark"})],8,mo)]))),128))])):k("",!0)}const uo=y(ao,[["render",po],["__scopeId","data-v-5fc4fa65"]]),go="",fo=b({name:"PromptInput",components:{ElInput:Q,ElButton:L,FontAwesomeIcon:E,InfoIcon:S,InspirationPills:uo},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=go)}}),ho={class:"field"},_o={class:"box"},$o={class:"title font-bold"},vo={class:"actions"};function ko(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",ho,[i("div",_o,[i("h2",$o,r(e.$t("kling.name.prompt")),1),i("div",vo,[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 bo=y(fo,[["render",ko],["__scopeId","data-v-0a5c57b8"]]),yo="",wo=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=yo)}}),Co={class:"field"},Vo={class:"box"},So={class:"title font-bold"};function To(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-input");return l(),m("div",Co,[i("div",Vo,[i("h2",So,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 Io=y(wo,[["render",To],["__scopeId","data-v-de98cf01"]]),Eo=b({name:"InspirationDrawer",components:{ElDrawer:de,ElButton:L,FontAwesomeIcon:E},props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],data(){return{groups:he,Close:we}},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(lo(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)}}}),Lo={class:"drawer-content"},Mo={class:"drawer-header"},Uo={class:"title-row"},Ro={class:"title"},Ao={class:"hint"},Po={key:0,class:"selected-bar"},Do={class:"selected-text"},Go={class:"groups"},Ko={class:"group-title"},Oo={class:"chip-grid"},jo=["onClick"];function No(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",Lo,[i("div",Mo,[i("div",Uo,[n(c,{icon:"fa-regular fa-lightbulb",class:"mr-2"}),i("span",Ro,r(e.$t("kling.inspiration.title")),1)]),n(p,{text:"",icon:e.Close,class:"close-btn",onClick:t[0]||(t[0]=d=>e.visible=!1)},null,8,["icon"])]),i("div",Ao,r(e.$t("kling.inspiration.hint")),1),e.selectedCount>0?(l(),m("div",Po,[i("span",Do,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",Go,[(l(!0),m(T,null,I(e.groups,d=>(l(),m("div",{key:d.groupKey,class:"group"},[i("div",Ko,r(e.$t(`kling.inspiration.group.${d.groupKey}`)),1),i("div",Oo,[(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,jo))),128))])]))),128))])])]),_:1},8,["modelValue","size"])}const Bo=y(Eo,[["render",No],["__scopeId","data-v-7d457a69"]]),zo={"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"},Fo={std:"720p",pro:"1080p","4k":"4K"},qo=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 zo[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||""},modeLabel(){const e=this.config?.mode||"std";return Fo[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),Ho={class:"summary-chip"},Wo=["title"],Jo=["title"],Qo=["title"],Yo=["title"],Xo=["title"];function Zo(e,t,s,a,u,$){const c=o("font-awesome-icon");return l(),m("div",Ho,[i("span",{class:"part",title:e.$t("kling.name.model")},r(e.modelLabel),9,Wo),t[0]||(t[0]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.duration")},r(e.durationLabel),9,Jo),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,Qo),t[2]||(t[2]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.mode")},r(e.modeLabel),9,Yo),e.generateAudio?(l(),m("span",{key:0,class:"audio",title:e.$t("kling.name.generateAudio")},[n(c,{icon:"fa-solid fa-headphones"})],8,Xo)):k("",!0)])}const xo=y(qo,[["render",Zo],["__scopeId","data-v-418a6733"]]),en=b({name:"ConfigPanel",components:{ElButton:L,Consumption:pe,FontAwesomeIcon:E,PromptInput:bo,NegativePromptInput:Io,ModelSelector:xe,ModeSelector:lt,DurationSelector:ut,RatioSelector:kt,StartImage:Tt,CfgScaleSelector:Bt,GenerateAudioSelector:Qt,CameraControlSelector:io,InspirationDrawer:Bo,SummaryChip:xo,EndImage:At},emits:["generate"],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},consumption(){return ge(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit("generate")}}}),tn={class:"flex flex-col h-full"},on={class:"flex-1 overflow-y-auto p-5"},nn={class:"flex flex-col items-center justify-center px-5 pb-5"};function sn(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"),$e=o("summary-chip"),ve=o("consumption"),Z=o("font-awesome-icon"),x=o("el-button"),ke=o("inspiration-drawer");return l(),m("div",tn,[i("div",on,[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",nn,[n($e),n(ve,{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(ke,{modelValue:e.inspirationOpen,"onUpdate:modelValue":t[1]||(t[1]=ee=>e.inspirationOpen=ee)},null,8,["modelValue"])])}const ln=y(en,[["render",sn]]),an=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()}}}),rn={class:"relative"},cn={class:"flex justify-between"},dn={class:"flex justify-start items-center"},mn={class:"text-sm font-bold"};function pn(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",rn,[i("div",cn,[i("div",dn,[i("span",mn,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 un=y(an,[["render",pn],["__scopeId","data-v-37d42da7"]]),gn=b({name:"MotionVideo",components:{ElUpload:K,ElButton:L,InfoIcon:S,FilePreview:Le,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()}}}),fn={class:"relative"},hn={class:"flex justify-between"},_n={class:"flex justify-start items-center"},$n={class:"text-sm font-bold"};function vn(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",fn,[i("div",hn,[i("div",_n,[i("span",$n,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 kn=y(gn,[["render",vn],["__scopeId","data-v-5cf93212"]]),bn=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})}}}}),yn={class:"field"},wn={class:"box"},Cn={class:"title font-bold"};function Vn(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-input");return l(),m("div",yn,[i("div",wn,[i("h2",Cn,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 Sn=y(bn,[["render",Vn],["__scopeId","data-v-ca9fdbe5"]]),ae="video",Tn=b({name:"CharacterOrientationSelector",components:{ElRadioGroup:Ue,ElRadioButton:Me,InfoIcon:S},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||ae},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=ae)}}),In={class:"field"},En={class:"header"},Ln={class:"text-sm font-bold"};function Mn(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-radio-button"),f=o("el-radio-group");return l(),m("div",In,[i("div",En,[i("span",Ln,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 Un=y(Tn,[["render",Mn],["__scopeId","data-v-7a91195b"]]),re="std",Rn=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||re},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=re)}}),An={class:"field"},Pn={class:"header"},Dn={class:"title font-bold"};function Gn(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),m("div",An,[i("div",Pn,[i("h2",Dn,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 Kn=y(Rn,[["render",Gn],["__scopeId","data-v-1295688c"]]),On=b({name:"KeepOriginalSoundSelector",components:{ElSwitch:ue,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"})}}}}),jn={class:"relative"},Nn={class:"flex justify-between items-center"},Bn={class:"flex justify-start items-center"},zn={class:"text-sm font-bold"};function Fn(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-switch");return l(),m("div",jn,[i("div",Nn,[i("div",Bn,[i("span",zn,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 qn=y(On,[["render",Fn]]),Hn=b({name:"MotionPanel",components:{ElButton:L,FontAwesomeIcon:E,Consumption:pe,MotionImage:un,MotionVideo:kn,MotionPromptInput:Sn,CharacterOrientationSelector:Un,MotionModeSelector:Kn,KeepOriginalSoundSelector:qn},emits:["generate"],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return ge(this.motionConfig,this.service?.cost)},service(){return this.$store.state.kling?.service},canGenerate(){const e=this.motionConfig;return!!(e?.image_url&&e?.video_url)}},methods:{onGenerate(){this.$emit("generate")}}}),Wn={class:"flex flex-col h-full"},Jn={class:"flex-1 overflow-y-auto p-5"},Qn={class:"flex flex-col items-center justify-center px-5 pb-5"};function Yn(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",Wn,[i("div",Jn,[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",Qn,[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 Xn=y(Hn,[["render",Yn]]),Zn=b({name:"KlingTabSwitcher",components:{ElTabs:Ae,ElTabPane:Re,ElTag:Ce},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)}}}),xn=["title"],es={class:"text"};function ts(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",es,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,xn)]),_:2},1032,["name","disabled"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])}const os=y(Zn,[["render",ts],["__scopeId","data-v-bf00c27e"]]),ns=b({name:"TaskPreview",components:{ElImage:Ke,CopyToClipboard:Pe,FontAwesomeIcon:E,ElAlert:Ge,VideoPlayer:De,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")}}}),ss={class:"preview"},is={class:"left"},ls={class:"main"},as={class:"bot"},rs={class:"datetime"},cs={class:"info"},ds={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},ms={key:1,class:"prompt mt-2"},ps={key:0},us={key:1},gs={key:0,class:R({content:!0,failed:!0})},fs={key:0,class:"mb-4"},hs={key:1,class:R({operations:!0,"mt-2":!0})},_s={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},$s={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},vs={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},ks={key:1,class:R({content:!0})},bs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ys={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ws={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Cs={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Vs={key:2,class:R({content:!0})},Ss={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ts={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Is(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",ss,[i("div",is,[n(c,{src:"https://cdn.acedata.cloud/qpbbbb.jpg",class:"avatar"})]),i("div",ls,[i("div",as,[w(r(e.$t("kling.name.klingBot"))+" ",1),i("span",rs,r(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),i("div",cs,[e.referenceImages.length>0?(l(),m("div",ds,[(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",ms,[w(r(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?k("",!0):(l(),m("span",ps," - ("+r(e.$t("kling.status.pending"))+") ",1)),e.modelValue?.response?.state==="submitted"||e.modelValue?.response?.state==="processing"||e.modelValue?.response?.state==="pending"||e.modelValue?.response?.state==="completed"?(l(),m("span",us," - ("+r(e.$t("kling.status.processing"))+") ",1)):k("",!0)])):k("",!0)]),e.modelValue?.response?.success===!0?(l(),m("div",gs,[e.modelValue?.response.video_url?(l(),m("div",fs,[n(f,{src:e.modelValue?.response.video_url},null,8,["src"])])):k("",!0),e.modelValue?.response.success?(l(),m("div",hs,[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",$s,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(l(),m("p",vs,[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",ks,[n(M,{closable:!1,class:"failure"},{template:h(()=>[n(g,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),w(" "+r(e.$t("kling.name.failure")),1)]),default:h(()=>[i("p",bs,[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",ys,[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",ws,[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",Cs,[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",Vs,[n(M,{closable:!1,class:"info"},{template:h(()=>[n(g,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),w(" "+r(e.$t("kling.name.failure")),1)]),default:h(()=>[i("p",Ss,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.response?.trace_id?(l(),m("p",Ts,[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 Es=y(ns,[["render",Is],["__scopeId","data-v-e8e87659"]]),Ls=b({name:"RecentPanel",components:{TaskPreview:Es,NoTasks:je,BotPlaceholder:Oe,ScrollList:Ee},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.kling?.tasks,items:this.$store.state.kling?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Ms={key:0},Us={key:2,class:"w-full h-full flex items-center justify-center"};function Rs(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",Ms,[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",Us,[n(d)])):k("",!0)],64)}const As=y(Ls,[["render",Rs]]),ce="https://webhook.acedata.cloud/kling",Ps=b({name:"KlingIndex",components:{ConfigPanel:ln,MotionPanel:Xn,TabSwitcher:os,Layout:We,RecentPanel:As},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===te.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===te.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 Ne({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:ce};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")),se.generate(s,{token:a}).then(()=>{C.success(this.$t("kling.message.startTaskSuccess"))}).catch(u=>{u?.response?.data?.error?.code===ne?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:ce},s=this.credential?.token;if(!s){console.error("no token specified");return}C.info(this.$t("kling.message.startingTask")),se.motion(t,{token:s}).then(()=>{C.success(this.$t("kling.message.startTaskSuccess"))}).catch(a=>{a?.response?.data?.error?.code===ne?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)})}}}),Ds={class:"flex flex-col h-full"},Gs={class:"flex-1 min-h-0"};function Ks(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",Ds,[n(c,{"model-value":e.taskType,"onUpdate:modelValue":e.onTabChange},null,8,["model-value","onUpdate:modelValue"]),i("div",Gs,[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 ji=y(Ps,[["render",Ks]]);export{ji as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as P}from"./index.es-CR5c3J-H.js";import{E as U}from"./index-DRNT-3tY.js";import{E as Y}from"./index-CtIMFI1x.js";import{d as b,H as i,E as r,z as L,C as a,y as p,D as n,q as t,F as l,O as E,N as T,x as m,Q as A,R as J,J as d,I as _}from"./vendor-vue-DU0w5ewx.js";import{D as k,b0 as Q,ao as M}from"./index-CnxV03kA.js";import{b as K,c as W,d as Z,e as x,f as ee,g as oe,h as D,i as te,j as se,k as ne}from"./veo-NH_MUVor.js";import{E as C,a as O}from"./index-BlBQVbe7.js";import{I as j,S as ae}from"./ScrollList-CLSW3Dbs.js";import{E as le}from"./index-DCAfo8xw.js";import{V as G}from"./VideoPlayer-e--8Rl5J.js";import{E as R}from"./index-CAois4ub.js";import{p as ie}from"./pasteUploadMixin-BurWbGNQ.js";import{I as re}from"./ImagePreview-Dh9-XvKp.js";import{E as ce}from"./index-DAIZ68Ng.js";import{E as I}from"./index-D9jYVi3R.js";import{C as de}from"./Consumption-DtKxSOW0.js";import{a as ue}from"./price-WuGL9UMF.js";import{b as pe}from"./errorCode-Cqj9Td_Z.js";import{v as me}from"./veo-CvNN8wNJ.js";import{C as ve}from"./CopyToClipboard-D8MfLJZp.js";import{E as fe}from"./index-C36XUd3I.js";import{E as _e}from"./index-BGWjIWtx.js";import{E as he}from"./index-DOwlxqQ4.js";import{B as $e}from"./BotPlaceholder-PAjP823v.js";import{N as ge}from"./NoTasks-DqYFgS_3.js";import{l as be}from"./pagination-CcnL0MdN.js";import"./use-form-item-n1D0HOVh.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-Cvgzdobq.js";import"./vendor-vue-router-9TBHB1ku.js";import"./index-CRyZ32qo.js";import"./typescript-D-y7TKkl.js";import"./index-CGzKdsQS.js";import"./strings-DigWlKo9.js";import"./isEqual-BUu7kkim.js";import"./_Uint8Array-BtL2weNZ.js";import"./castArray-DCHtvbqo.js";import"./debounce-BSdgAkOS.js";import"./_baseIteratee-D4xvLM3s.js";import"./index-B_sHRuvM.js";import"./validator-kdYNLPlp.js";import"./vue-plyr-BO2nlN4c.js";import"./index-DhIU2Ld8.js";import"./index-DPvEmYP7.js";import"./_baseClone-CLa2JSau.js";import"./_initCloneObject-toOyHWRX.js";import"./index-CFMP3iYS.js";const ke=b({name:"LayoutVeo",components:{ElDrawer:Y,ElButton:U,FontAwesomeIcon:P},data(){return{drawer:!1}}}),ye={class:"main flex flex-row flex-1"},Ve={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},we={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function Ee(e,o,v,f,y,V){const c=n("font-awesome-icon"),u=n("el-button"),s=n("el-drawer");return t(),i("div",ye,[r("div",Ve,[L(e.$slots,"config",{},void 0,!0)]),r("div",we,[L(e.$slots,"result",{},void 0,!0)]),a(u,{circle:"",class:"menu",onClick:o[0]||(o[0]=w=>e.drawer=!0)},{default:p(()=>[a(c,{icon:"fa-solid fa-magic"})]),_:1}),a(s,{modelValue:e.drawer,"onUpdate:modelValue":o[1]||(o[1]=w=>e.drawer=w),direction:"ltr","with-header":!1,size:"350px"},{default:p(()=>[L(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Ie=k(ke,[["render",Ee],["__scopeId","data-v-816b984c"]]),Te=b({name:"ModelSelector",components:{ElSelect:O,ElOption:C},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{options:[{value:"veo2",label:"veo2"},{value:"veo2-fast",label:"veo2-fast"},{value:"veo3",label:"veo3"},{value:"veo3-fast",label:"veo3-fast"},{value:"veo31-fast",label:"veo31-fast"},{value:"veo31",label:"veo31"},{value:"veo31-fast-ingredients",label:"veo31-fast-ingredients"}]}},computed:{value:{get(){return this.$store.state.veo?.config?.model},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,model:e})}}},mounted(){this.value||(this.value=K)}}),Se={class:"field"},Ae={class:"title font-bold"};function Ce(e,o,v,f,y,V){const c=n("el-option"),u=n("el-select");return t(),i("div",Se,[r("h2",Ae,l(e.$t("veo.name.model")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s),class:"value",placeholder:e.$t("veo.placeholder.select")},{default:p(()=>[(t(!0),i(E,null,T(e.options,s=>(t(),m(c,{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Oe=k(Te,[["render",Ce],["__scopeId","data-v-a59d89c9"]]),Pe=b({name:"ActionSelector",components:{ElSelect:O,ElOption:C},data(){return{}},computed:{options(){return[{value:"text2video",label:this.$t("veo.button.action1")},{value:"image2video",label:this.$t("veo.button.action2")},{value:"ingredients2video",label:this.$t("veo.button.actionIngredients")},{value:"upsample",label:this.$t("veo.button.actionUpsample")},{value:"extend",label:this.$t("veo.button.actionExtend")},{value:"reshoot",label:this.$t("veo.button.actionReshoot")},{value:"object_insert",label:this.$t("veo.button.actionObjectInsert")},{value:"object_remove",label:this.$t("veo.button.actionObjectRemove")}]},value:{get(){return this.$store.state.veo?.config?.action},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,action:e})}}},mounted(){this.value||(this.value=W)}}),Ue={class:"field"},Le={class:"title font-bold"},je={class:"float-left"};function Re(e,o,v,f,y,V){const c=n("el-option"),u=n("el-select");return t(),i("div",Ue,[r("h2",Le,l(e.$t("veo.name.action")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s),class:"value",placeholder:e.$t("veo.placeholder.select"),clearable:""},{default:p(()=>[(t(!0),i(E,null,T(e.options,s=>(t(),m(c,{key:s.value,label:s.label,value:s.value},{default:p(()=>[r("span",je,l(s.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Me=k(Pe,[["render",Re],["__scopeId","data-v-f4d8785c"]]),De=b({name:"TranslationSelector",components:{ElSwitch:le,InfoIcon:j},computed:{value:{get(){return this.$store.state.veo?.config?.translation},set(e){console.debug("set translation",e),this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,translation:e})}}},mounted(){this.value===void 0&&(this.value=Z)}}),Ge={class:"relative"},Ne={class:"flex justify-between"},Fe={class:"flex justify-start items-center"},ze={class:"text-sm font-bold"},Be={class:"flex justify-end items-center"};function qe(e,o,v,f,y,V){const c=n("info-icon"),u=n("el-switch");return t(),i("div",Ge,[r("div",Ne,[r("div",Fe,[r("span",ze,l(e.$t("veo.name.translation")),1),a(c,{content:e.$t("veo.description.translation")},null,8,["content"])]),r("div",Be,[a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s),class:"value"},null,8,["modelValue"])])])])}const He=k(De,[["render",qe]]),Xe=b({name:"AspectRatioSelector",data(){return{options:[{value:"1:1",label:"1:1",width:20,height:20},{value:"4:3",label:"4:3",width:20,height:15},{value:"3:4",label:"3:4",width:15,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.veo?.config?.aspect_ratio},set(e){console.debug("set aspect_ratio",e),this.$store.commit("veo/setConfig",{...this.$store.state?.veo?.config,aspect_ratio:e})}}},mounted(){this.value||(this.value=x)}}),Ye={class:"text-sm font-bold mb-2 block"},Je={class:"items"},Qe=["onClick"],Ke={class:"name"};function We(e,o,v,f,y,V){return t(),i("div",null,[r("span",Ye,l(e.$t("veo.name.ratio")),1),r("div",Je,[(t(!0),i(E,null,T(e.options,(c,u)=>(t(),i("div",{key:u,class:A({active:e.active===u,item:!0}),onClick:s=>e.value=c.value},[r("div",{class:A(["preview",c.label])},[r("div",{class:"rect",style:J({width:c.width+"px",height:c.height+"px"})},null,4)],2),r("p",Ke,l(c.label),1)],10,Qe))),128))])])}const Ze=k(Xe,[["render",We],["__scopeId","data-v-0f16be77"]]),xe=b({name:"VideoFromInput",components:{VideoPlayer:G},props:{modelValue:{type:Object,required:!1,default:void 0}},data(){return{options:{quality:{default:"1080p"}}}},computed:{config(){return this.$store.state.veo?.config}}}),eo={class:"relative"},oo={class:"flex mb-2"},to={class:"text-sm font-bold"};function so(e,o,v,f,y,V){const c=n("video-player");return t(),i("div",eo,[r("div",oo,[r("span",to,l(e.$t("veo.name.action3")),1)]),r("div",null,[e.config?.video_url?(t(),m(c,{key:0,src:e.config?.video_url},null,8,["src"])):d("",!0)])])}const no=k(xe,[["render",so]]),ao=b({name:"VideoIdInput",components:{ElInput:R},computed:{value:{get(){return this.$store.state.veo?.config?.video_id},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,video_id:e})}}}}),lo={class:"field"},io={class:"title font-bold"};function ro(e,o,v,f,y,V){const c=n("el-input");return t(),i("div",lo,[r("h2",io,l(e.$t("veo.name.videoId")),1),a(c,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=u=>e.value=u),class:"value",type:"text",placeholder:e.$t("veo.placeholder.videoId"),clearable:""},null,8,["modelValue","placeholder"])])}const co=k(ao,[["render",ro],["__scopeId","data-v-6eba4026"]]),uo=b({name:"StartEndImage",components:{ElUpload:ce,ElButton:U,InfoIcon:j,FontAwesomeIcon:P,ImagePreview:re},mixins:[ie],emits:["change"],data(){return{fileList:[],uploadUrl:Q()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.veo?.config?.image_urls},set(){}}},mounted(){this.value||(this.value=void 0),this.onSetStartEndImageUrl()},methods:{onExceed(){I.warning(this.$t("veo.message.uploadReferencesExceed"))},onError(){I.error(this.$t("veo.message.uploadReferencesError"))},onSetStartEndImageUrl(){const e=this.urls;this.$store.commit("veo/setConfig",{...this.$store.state?.veo?.config,image_urls:e})},async onSuccess(){this.onSetStartEndImageUrl()}}}),po={class:"relative"},mo={class:"flex justify-between"},vo={class:"flex justify-start items-center"},fo={class:"text-sm font-bold"};function _o(e,o,v,f,y,V){const c=n("info-icon"),u=n("image-preview"),s=n("font-awesome-icon"),w=n("el-button"),$=n("el-upload");return t(),i("div",po,[r("div",mo,[r("div",vo,[r("span",fo,l(e.$t("veo.name.startEndImage")),1),a(c,{content:e.$t("veo.description.uploadStartEndImage")},null,8,["content"])])]),a($,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":o[0]||(o[0]=h=>e.fileList=h),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:2,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:p(({file:h})=>[h.url&&h.percentage!==void 0?(t(),m(u,{key:0,url:h.url,name:h.name,percentage:h.percentage,onRemove:S=>e.fileList.splice(e.fileList.indexOf(h),1)},null,8,["url","name","percentage","onRemove"])):d("",!0)]),default:p(()=>[a(w,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:p(()=>[a(s,{icon:"fa-solid fa-upload",class:"icon mr-1"}),_(" "+l(e.$t("veo.button.uploadReferences")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const ho=k(uo,[["render",_o],["__scopeId","data-v-b8ddb8fb"]]),$o=b({name:"UpsampleActionSelector",components:{ElSelect:O,ElOption:C},computed:{options(){return oe.map(e=>({value:e,label:e}))},value:{get(){return this.$store.state.veo?.config?.upsample_action},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,upsample_action:e})}}},mounted(){this.value||(this.value=ee)}}),go={class:"field"},bo={class:"title font-bold"};function ko(e,o,v,f,y,V){const c=n("el-option"),u=n("el-select");return t(),i("div",go,[r("h2",bo,l(e.$t("veo.name.upsampleAction")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s),class:"value",placeholder:e.$t("veo.placeholder.select")},{default:p(()=>[(t(!0),i(E,null,T(e.options,s=>(t(),m(c,{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const yo=k($o,[["render",ko],["__scopeId","data-v-8b74a7ae"]]),Vo=b({name:"ExtendModelSelector",components:{ElSelect:O,ElOption:C},computed:{options(){return D.map(e=>({value:e,label:e}))},value:{get(){return this.$store.state.veo?.config?.model},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,model:e})}}},mounted(){(!this.value||!D.includes(this.value))&&(this.value=te)}}),wo={class:"field"},Eo={class:"title font-bold"};function Io(e,o,v,f,y,V){const c=n("el-option"),u=n("el-select");return t(),i("div",wo,[r("h2",Eo,l(e.$t("veo.name.model")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s),class:"value",placeholder:e.$t("veo.placeholder.select")},{default:p(()=>[(t(!0),i(E,null,T(e.options,s=>(t(),m(c,{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const To=k(Vo,[["render",Io],["__scopeId","data-v-cc3f9355"]]),So=b({name:"MotionTypeSelector",components:{ElSelect:O,ElOption:C},computed:{options(){return ne.map(e=>({value:e,label:e}))},value:{get(){return this.$store.state.veo?.config?.motion_type},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,motion_type:e})}}},mounted(){this.value||(this.value=se)}}),Ao={class:"field"},Co={class:"title font-bold"};function Oo(e,o,v,f,y,V){const c=n("el-option"),u=n("el-select");return t(),i("div",Ao,[r("h2",Co,l(e.$t("veo.name.motionType")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s),class:"value",placeholder:e.$t("veo.placeholder.select"),filterable:""},{default:p(()=>[(t(!0),i(E,null,T(e.options,s=>(t(),m(c,{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Po=k(So,[["render",Oo],["__scopeId","data-v-3affff3c"]]),Uo=b({name:"ImageMaskInput",components:{ElInput:R},computed:{value:{get(){return this.$store.state.veo?.config?.image_mask},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,image_mask:e})}}}}),Lo={class:"field"},jo={class:"title font-bold"};function Ro(e,o,v,f,y,V){const c=n("el-input");return t(),i("div",Lo,[r("h2",jo,l(e.$t("veo.name.imageMask")),1),a(c,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=u=>e.value=u),class:"value",type:"text",placeholder:e.$t("veo.placeholder.imageMask"),clearable:""},null,8,["modelValue","placeholder"])])}const Mo=k(Uo,[["render",Ro],["__scopeId","data-v-6cc27c68"]]),Do="",Go=b({name:"PromptInput",components:{ElInput:R,InfoIcon:j},computed:{prompt:{get(){return this.$store.state.veo?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=Do)}}),No={class:"field"},Fo={class:"box"},zo={class:"title font-bold"};function Bo(e,o,v,f,y,V){const c=n("info-icon"),u=n("el-input");return t(),i("div",No,[r("div",Fo,[r("h2",zo,l(e.$t("veo.name.prompt")),1),a(c,{content:e.$t("veo.description.prompt"),class:"info"},null,8,["content"])]),a(u,{modelValue:e.prompt,"onUpdate:modelValue":o[0]||(o[0]=s=>e.prompt=s),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("veo.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const qo=k(Go,[["render",Bo],["__scopeId","data-v-84c55ea0"]]),Ho=["upsample","extend","reshoot","object_insert","object_remove","get1080p"],Xo=["text2video","image2video","ingredients2video"],Yo=b({name:"ConfigPanel",components:{ElButton:U,Consumption:de,FontAwesomeIcon:P,PromptInput:qo,ModelSelector:Oe,StartEndImage:ho,ActionSelector:Me,VideoFromInput:no,VideoIdInput:co,UpsampleActionSelector:yo,ExtendModelSelector:To,MotionTypeSelector:Po,ImageMaskInput:Mo,TranslationSelector:He,AspectRatioSelector:Ze},emits:["generate"],computed:{config(){return this.$store.state.veo?.config},consumption(){return ue(this.config,this.service?.cost)},service(){return this.$store.state.veo?.service},isPostProcessing(){return Ho.includes(this.config?.action??"")},isGeneration(){return Xo.includes(this.config?.action??"")}},methods:{onGenerate(){this.$emit("generate")}}}),Jo={class:"flex flex-col h-full"},Qo={class:"flex-1 overflow-y-auto p-5"},Ko={class:"flex flex-col items-center justify-center px-5 pb-5"};function Wo(e,o,v,f,y,V){const c=n("action-selector"),u=n("video-from-input"),s=n("video-id-input"),w=n("upsample-action-selector"),$=n("extend-model-selector"),h=n("prompt-input"),S=n("motion-type-selector"),g=n("image-mask-input"),N=n("translation-selector"),F=n("aspect-ratio-selector"),z=n("model-selector"),B=n("start-end-image"),q=n("consumption"),H=n("font-awesome-icon"),X=n("el-button");return t(),i("div",Jo,[r("div",Qo,[a(c,{class:"mb-4"}),e.isPostProcessing?(t(),i(E,{key:0},[e.config?.video_url?(t(),m(u,{key:0,class:"mb-4"})):d("",!0),a(s,{class:"mb-4"})],64)):d("",!0),e.config?.action==="upsample"?(t(),m(w,{key:1,class:"mb-4"})):d("",!0),e.config?.action==="extend"?(t(),m($,{key:2,class:"mb-4"})):d("",!0),e.config?.action==="extend"?(t(),m(h,{key:3,class:"mb-4"})):d("",!0),e.config?.action==="reshoot"?(t(),m(S,{key:4,class:"mb-4"})):d("",!0),e.config?.action==="object_insert"?(t(),m(h,{key:5,class:"mb-4"})):d("",!0),e.config?.action==="object_insert"||e.config?.action==="object_remove"?(t(),m(g,{key:6,class:"mb-4"})):d("",!0),e.config?.action==="object_remove"?(t(),m(h,{key:7,class:"mb-4"})):d("",!0),e.isGeneration?(t(),i(E,{key:8},[a(N,{class:"mb-4"}),e.config?.action==="image2video"||e.config?.action==="ingredients2video"?(t(),m(F,{key:0,class:"mb-4"})):d("",!0),a(h,{class:"mb-4"}),e.config?.action!=="ingredients2video"?(t(),m(z,{key:1,class:"mb-4"})):d("",!0),e.config?.action==="image2video"||e.config?.action==="ingredients2video"?(t(),m(B,{key:2,class:"mb-2"})):d("",!0)],64)):d("",!0)]),r("div",Ko,[a(q,{value:e.consumption,service:e.service},null,8,["value","service"]),a(X,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:p(()=>[a(H,{icon:"fa-solid fa-magic",class:"mr-2"}),_(" "+l(e.$t("veo.button.generate")),1)]),_:1},8,["onClick"])])])}const Zo=k(Yo,[["render",Wo]]),xo=b({name:"TaskPreview",components:{ElImage:he,CopyToClipboard:ve,FontAwesomeIcon:P,ElAlert:_e,VideoPlayer:G,ElTooltip:fe,ElButton:U},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.veo?.application},config(){return this.$store.state.veo?.config}},methods:{onPickAction(e,o,v,f){console.debug("seed config from preview",{action:v,upsampleAction:f,response:o}),this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,action:v,video_id:o?.data?.[0]?.id,video_url:o?.data?.[0]?.video_url,...f?{upsample_action:f}:{}})},onDownload(e,o){e.stopPropagation(),console.log("on download"),window.open(o,"_blank")},onOpenVideo(e){window.open(e,"_blank")}}}),et={class:"preview"},ot={class:"left"},tt={class:"main"},st={class:"bot"},nt={class:"datetime"},at={class:"info"},lt={key:0,class:"prompt mt-2"},it={key:0},rt={key:1},ct={key:0,class:A({content:!0,failed:!0})},dt={key:0,class:"mb-4"},ut={key:1,class:A({operations:!0,"mt-2":!0})},pt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},mt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},vt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},ft={key:1,class:A({content:!0})},_t={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ht={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},$t={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},gt={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},bt={key:2,class:A({content:!0})},kt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},yt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Vt(e,o,v,f,y,V){const c=n("el-image"),u=n("video-player"),s=n("el-button"),w=n("el-tooltip"),$=n("font-awesome-icon"),h=n("copy-to-clipboard"),S=n("el-alert");return t(),i("div",et,[r("div",ot,[a(c,{src:"https://cdn.acedata.cloud/8nxyy9.jpg",class:"avatar"})]),r("div",tt,[r("div",st,[_(l(e.$t("veo.name.veoBot"))+" ",1),r("span",nt,l(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),r("div",at,[e.modelValue?.request?.prompt?(t(),i("p",lt,[_(l(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?d("",!0):(t(),i("span",it," - ("+l(e.$t("veo.status.pending"))+") ",1)),Array.isArray(e.modelValue?.response?.data)&&e.modelValue?.response?.data[0]?.state==="running"?(t(),i("span",rt," - ("+l(e.$t("veo.status.processing"))+") ",1)):d("",!0)])):d("",!0)]),e.modelValue?.response?.success===!0&&e.modelValue?.response?.data?(t(),i("div",ct,[e.modelValue?.response?.data[0]?.video_url?(t(),i("div",dt,[a(u,{src:e.modelValue?.response?.data[0]?.video_url},null,8,["src"])])):d("",!0),e.modelValue?.response.success?(t(),i("div",ut,[e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:0,type:"info",size:"small",class:"btn-action",onClick:o[0]||(o[0]=g=>e.onPickAction(g,e.modelValue?.response,"upsample","1080p"))},{default:p(()=>[_(l(e.$t("veo.button.actionUpsample1080p")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:1,type:"info",size:"small",class:"btn-action",onClick:o[1]||(o[1]=g=>e.onPickAction(g,e.modelValue?.response,"upsample","4k"))},{default:p(()=>[_(l(e.$t("veo.button.actionUpsample4k")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:2,type:"info",size:"small",class:"btn-action",onClick:o[2]||(o[2]=g=>e.onPickAction(g,e.modelValue?.response,"upsample","gif"))},{default:p(()=>[_(l(e.$t("veo.button.actionUpsampleGif")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:3,type:"info",size:"small",class:"btn-action",onClick:o[3]||(o[3]=g=>e.onPickAction(g,e.modelValue?.response,"extend"))},{default:p(()=>[_(l(e.$t("veo.button.actionExtend")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:4,type:"info",size:"small",class:"btn-action",onClick:o[4]||(o[4]=g=>e.onPickAction(g,e.modelValue?.response,"reshoot"))},{default:p(()=>[_(l(e.$t("veo.button.actionReshoot")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:5,type:"info",size:"small",class:"btn-action",onClick:o[5]||(o[5]=g=>e.onPickAction(g,e.modelValue?.response,"object_insert"))},{default:p(()=>[_(l(e.$t("veo.button.actionObjectInsert")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:6,type:"info",size:"small",class:"btn-action",onClick:o[6]||(o[6]=g=>e.onPickAction(g,e.modelValue?.response,"object_remove"))},{default:p(()=>[_(l(e.$t("veo.button.actionObjectRemove")),1)]),_:1})):d("",!0),a(w,{class:"box-item",effect:"dark",content:e.$t("veo.message.downloadVideo"),placement:"top-start"},{default:p(()=>[e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:0,type:"info",size:"small",class:"btn-action",onClick:o[7]||(o[7]=g=>e.onDownload(g,e.modelValue?.response?.data[0]?.video_url))},{default:p(()=>[_(l(e.$t("veo.button.download")),1)]),_:1})):d("",!0)]),_:1},8,["content"])])):d("",!0),a(S,{closable:!1,class:"mt-2 success"},{default:p(()=>[r("p",pt,[a($,{icon:"fa-solid fa-hashtag",class:"mr-1"}),_(" "+l(e.$t("veo.name.model"))+": "+l(e.modelValue?.request?.model),1)]),r("p",mt,[a($,{icon:"fa-solid fa-magic",class:"mr-1"}),_(" "+l(e.$t("veo.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),a(h,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(t(),i("p",vt,[a($,{icon:"fa-solid fa-clock",class:"mr-1"}),_(" "+l(e.$t("veo.name.elapsed"))+": "+l(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):d("",!0)]),_:1})])):d("",!0),e.modelValue?.response?.success===!1?(t(),i("div",ft,[a(S,{closable:!1,class:"failure"},{template:p(()=>[a($,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),_(" "+l(e.$t("veo.name.failure")),1)]),default:p(()=>[r("p",_t,[a($,{icon:"fa-solid fa-magic",class:"mr-1"}),_(" "+l(e.$t("veo.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),a(h,{content:e.modelValue?.id},null,8,["content"])]),r("p",ht,[a($,{icon:"fa-solid fa-circle-info",class:"mr-1"}),_(" "+l(e.$t("veo.name.failureReason"))+": "+l(e.modelValue?.response?.error?.message)+" ",1),a(h,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(t(),i("p",$t,[a($,{icon:"fa-solid fa-clock",class:"mr-1"}),_(" "+l(e.$t("veo.name.elapsed"))+": "+l(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):d("",!0),e.modelValue?.response?.trace_id?(t(),i("p",gt,[a($,{icon:"fa-solid fa-hashtag",class:"mr-1"}),_(" "+l(e.$t("veo.name.traceId"))+": "+l(e.modelValue?.response?.trace_id)+" ",1),a(h,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):d("",!0)]),_:1})])):d("",!0),e.modelValue?.response?.success===void 0?(t(),i("div",bt,[a(S,{closable:!1,class:"info"},{template:p(()=>[a($,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),_(" "+l(e.$t("veo.name.failure")),1)]),default:p(()=>[r("p",kt,[a($,{icon:"fa-solid fa-magic",class:"mr-1"}),_(" "+l(e.$t("veo.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),a(h,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.response?.trace_id?(t(),i("p",yt,[a($,{icon:"fa-solid fa-hashtag",class:"mr-1"}),_(" "+l(e.$t("veo.name.traceId"))+": "+l(e.modelValue?.response?.trace_id)+" ",1),a(h,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):d("",!0)]),_:1})])):d("",!0)])])}const wt=k(xo,[["render",Vt],["__scopeId","data-v-83f2991f"]]),Et=b({name:"RecentPanel",components:{TaskPreview:wt,NoTasks:ge,BotPlaceholder:$e,ScrollList:ae},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.veo?.tasks,items:this.$store.state.veo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),It={key:0},Tt={key:2,class:"w-full h-full flex items-center justify-center"};function St(e,o,v,f,y,V){const c=n("bot-placeholder"),u=n("task-preview"),s=n("scroll-list"),w=n("no-tasks");return t(),i(E,null,[e.tasks?.items===void 0?(t(),i("div",It,[a(c)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(t(),m(s,{key:1,ref:"scrollList",class:"tasks h-full w-full overflow-y-auto",loading:e.loading,onReachTop:o[0]||(o[0]=$=>e.$emit("reach-top"))},{default:p(()=>[(t(!0),i(E,null,T(e.tasks?.items,($,h)=>(t(),m(u,{key:h,"model-value":$},null,8,["model-value"]))),128))]),_:1},8,["loading"])):d("",!0),e.tasks?.items?.length===0?(t(),i("div",Tt,[a(w)])):d("",!0)],64)}const At=k(Et,[["render",St]]),Ct="https://webhook.acedata.cloud/veo",Ot=b({name:"VeoIndex",components:{ConfigPanel:Zo,Layout:Ie,RecentPanel:At},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.veo?.status?.getApplications===M.Request},tasksLoading(){return this.$store.state.veo?.status?.getTasks===M.Request||this.fetchingTasks},credential(){return this.$store.state.veo.credential},config(){return this.$store.state.veo.config},tasks(){return this.$store.state.veo.tasks}},watch:{tasks:{handler(e,o){e?.items?.length>o?.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 be({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("veo/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("veo/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:o=5,createdAtMin:v,createdAtMax:f}=e||{};console.debug("limit",o,"createdAtMin",v,"createdAtMax",f),this.fetchingTasks=!0;try{await this.$store.dispatch("veo/getTasks",{limit:o,createdAtMin:v,createdAtMax:f})}finally{this.fetchingTasks=!1}},async onGenerate(){const e={...this.config,callback_url:Ct},o=this.credential?.token;if(!o){console.error("no token specified");return}if(e.action==="image2video"&&!(e.image_urls&&e.image_urls.length>0)){I.warning(this.$t("veo.message.imageRequired"));return}(!e.image_urls||e.image_urls.length===0)&&delete e.image_urls,I.info(this.$t("veo.message.startingTask")),me.generate(e,{token:o}).then(()=>{I.success(this.$t("veo.message.startTaskSuccess"))}).catch(v=>{v?.response?.data?.error?.code===pe?I.error(this.$t("veo.message.usedUp")):I.error(this.$t("veo.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Pt(e,o,v,f,y,V){const c=n("config-panel"),u=n("recent-panel"),s=n("layout");return t(),m(s,null,{config:p(()=>[a(c,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:p(()=>[a(u,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Ts=k(Ot,[["render",Pt]]);export{Ts as default};
|
|
1
|
+
import{F as P}from"./index.es-B1lW1a9B.js";import{E as U}from"./index-jii325vi.js";import{E as Y}from"./index-38G9IKZp.js";import{d as b,H as i,E as r,z as L,C as a,y as p,D as n,q as t,F as l,O as E,N as T,x as m,Q as A,R as J,J as d,I as _}from"./vendor-vue-DU0w5ewx.js";import{E as k,b1 as Q,ap as M}from"./index-FTscF_cz.js";import{a as K,b as W,c as Z,d as x,e as ee,f as oe,g as G,h as te,i as se,j as ne}from"./veo-Dg8Zhpd-.js";import{E as C,a as O}from"./index-DKT9lpv-.js";import{I as j,S as ae}from"./ScrollList-CHr2ER0d.js";import{E as le}from"./index-o4zhAWG6.js";import{V as D}from"./VideoPlayer-BJPVVH4v.js";import{E as R}from"./index-DUswWNzD.js";import{p as ie}from"./pasteUploadMixin-BurWbGNQ.js";import{I as re}from"./ImagePreview-B7ddO4K-.js";import{E as ce}from"./index-aO6Fi57H.js";import{E as I}from"./index-FF4WAJT-.js";import{C as de}from"./Consumption-D8o6ZGlD.js";import{a as ue}from"./price-D5TNZtWD.js";import{b as pe}from"./errorCode-Cqj9Td_Z.js";import{v as me}from"./veo-ibQ-pqXQ.js";import{C as ve}from"./CopyToClipboard-99x8TU_E.js";import{E as fe}from"./index-DTQtEf7n.js";import{E as _e}from"./index-B2l9Ai7a.js";import{E as he}from"./index-DdfzO8ET.js";import{B as $e}from"./BotPlaceholder-808fKlrc.js";import{N as ge}from"./NoTasks-CzCoCJiJ.js";import{l as be}from"./pagination-CcnL0MdN.js";import"./use-form-item-DDWqgx7q.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-Cvgzdobq.js";import"./vendor-vue-router-9TBHB1ku.js";import"./index-BRydlsSG.js";import"./typescript-CUMR9uNq.js";import"./index-DB1wHeLA.js";import"./strings-DigWlKo9.js";import"./isEqual-BiGspMHU.js";import"./_Uint8Array-BWy8cKCo.js";import"./castArray-BX2YHThj.js";import"./debounce-rFO21RGd.js";import"./_baseIteratee-GCheQ423.js";import"./index-CJtfHm7C.js";import"./validator-pb75_c-A.js";import"./vue-plyr-BO2nlN4c.js";import"./index-RiVU3gTe.js";import"./index-BdrHjNrn.js";import"./_baseClone-CVDR-yNh.js";import"./_initCloneObject-BnGf6y2Q.js";import"./index-CJJgickM.js";const ke=b({name:"LayoutVeo",components:{ElDrawer:Y,ElButton:U,FontAwesomeIcon:P},data(){return{drawer:!1}}}),ye={class:"main flex flex-row flex-1"},Ve={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},we={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function Ee(e,o,v,f,y,V){const c=n("font-awesome-icon"),u=n("el-button"),s=n("el-drawer");return t(),i("div",ye,[r("div",Ve,[L(e.$slots,"config",{},void 0,!0)]),r("div",we,[L(e.$slots,"result",{},void 0,!0)]),a(u,{circle:"",class:"menu",onClick:o[0]||(o[0]=w=>e.drawer=!0)},{default:p(()=>[a(c,{icon:"fa-solid fa-magic"})]),_:1}),a(s,{modelValue:e.drawer,"onUpdate:modelValue":o[1]||(o[1]=w=>e.drawer=w),direction:"ltr","with-header":!1,size:"350px"},{default:p(()=>[L(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Ie=k(ke,[["render",Ee],["__scopeId","data-v-816b984c"]]),Te=b({name:"ModelSelector",components:{ElSelect:O,ElOption:C},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{options:[{value:"veo2",label:"veo2"},{value:"veo2-fast",label:"veo2-fast"},{value:"veo3",label:"veo3"},{value:"veo3-fast",label:"veo3-fast"},{value:"veo31-fast",label:"veo31-fast"},{value:"veo31",label:"veo31"},{value:"veo31-fast-ingredients",label:"veo31-fast-ingredients"}]}},computed:{value:{get(){return this.$store.state.veo?.config?.model},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,model:e})}}},mounted(){this.value||(this.value=K)}}),Se={class:"field"},Ae={class:"title font-bold"};function Ce(e,o,v,f,y,V){const c=n("el-option"),u=n("el-select");return t(),i("div",Se,[r("h2",Ae,l(e.$t("veo.name.model")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s),class:"value",placeholder:e.$t("veo.placeholder.select")},{default:p(()=>[(t(!0),i(E,null,T(e.options,s=>(t(),m(c,{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Oe=k(Te,[["render",Ce],["__scopeId","data-v-a59d89c9"]]),Pe=b({name:"ActionSelector",components:{ElSelect:O,ElOption:C},data(){return{}},computed:{options(){return[{value:"text2video",label:this.$t("veo.button.action1")},{value:"image2video",label:this.$t("veo.button.action2")},{value:"ingredients2video",label:this.$t("veo.button.actionIngredients")},{value:"upsample",label:this.$t("veo.button.actionUpsample")},{value:"extend",label:this.$t("veo.button.actionExtend")},{value:"reshoot",label:this.$t("veo.button.actionReshoot")},{value:"object_insert",label:this.$t("veo.button.actionObjectInsert")},{value:"object_remove",label:this.$t("veo.button.actionObjectRemove")}]},value:{get(){return this.$store.state.veo?.config?.action},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,action:e})}}},mounted(){this.value||(this.value=W)}}),Ue={class:"field"},Le={class:"title font-bold"},je={class:"float-left"};function Re(e,o,v,f,y,V){const c=n("el-option"),u=n("el-select");return t(),i("div",Ue,[r("h2",Le,l(e.$t("veo.name.action")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s),class:"value",placeholder:e.$t("veo.placeholder.select"),clearable:""},{default:p(()=>[(t(!0),i(E,null,T(e.options,s=>(t(),m(c,{key:s.value,label:s.label,value:s.value},{default:p(()=>[r("span",je,l(s.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Me=k(Pe,[["render",Re],["__scopeId","data-v-f4d8785c"]]),Ge=b({name:"TranslationSelector",components:{ElSwitch:le,InfoIcon:j},computed:{value:{get(){return this.$store.state.veo?.config?.translation},set(e){console.debug("set translation",e),this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,translation:e})}}},mounted(){this.value===void 0&&(this.value=Z)}}),De={class:"relative"},Ne={class:"flex justify-between"},Fe={class:"flex justify-start items-center"},ze={class:"text-sm font-bold"},Be={class:"flex justify-end items-center"};function qe(e,o,v,f,y,V){const c=n("info-icon"),u=n("el-switch");return t(),i("div",De,[r("div",Ne,[r("div",Fe,[r("span",ze,l(e.$t("veo.name.translation")),1),a(c,{content:e.$t("veo.description.translation")},null,8,["content"])]),r("div",Be,[a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s),class:"value"},null,8,["modelValue"])])])])}const He=k(Ge,[["render",qe]]),Xe=b({name:"AspectRatioSelector",data(){return{options:[{value:"1:1",label:"1:1",width:20,height:20},{value:"4:3",label:"4:3",width:20,height:15},{value:"3:4",label:"3:4",width:15,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.veo?.config?.aspect_ratio},set(e){console.debug("set aspect_ratio",e),this.$store.commit("veo/setConfig",{...this.$store.state?.veo?.config,aspect_ratio:e})}}},mounted(){this.value||(this.value=x)}}),Ye={class:"text-sm font-bold mb-2 block"},Je={class:"items"},Qe=["onClick"],Ke={class:"name"};function We(e,o,v,f,y,V){return t(),i("div",null,[r("span",Ye,l(e.$t("veo.name.ratio")),1),r("div",Je,[(t(!0),i(E,null,T(e.options,(c,u)=>(t(),i("div",{key:u,class:A({active:e.active===u,item:!0}),onClick:s=>e.value=c.value},[r("div",{class:A(["preview",c.label])},[r("div",{class:"rect",style:J({width:c.width+"px",height:c.height+"px"})},null,4)],2),r("p",Ke,l(c.label),1)],10,Qe))),128))])])}const Ze=k(Xe,[["render",We],["__scopeId","data-v-0f16be77"]]),xe=b({name:"VideoFromInput",components:{VideoPlayer:D},props:{modelValue:{type:Object,required:!1,default:void 0}},data(){return{options:{quality:{default:"1080p"}}}},computed:{config(){return this.$store.state.veo?.config}}}),eo={class:"relative"},oo={class:"flex mb-2"},to={class:"text-sm font-bold"};function so(e,o,v,f,y,V){const c=n("video-player");return t(),i("div",eo,[r("div",oo,[r("span",to,l(e.$t("veo.name.action3")),1)]),r("div",null,[e.config?.video_url?(t(),m(c,{key:0,src:e.config?.video_url},null,8,["src"])):d("",!0)])])}const no=k(xe,[["render",so]]),ao=b({name:"VideoIdInput",components:{ElInput:R},computed:{value:{get(){return this.$store.state.veo?.config?.video_id},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,video_id:e})}}}}),lo={class:"field"},io={class:"title font-bold"};function ro(e,o,v,f,y,V){const c=n("el-input");return t(),i("div",lo,[r("h2",io,l(e.$t("veo.name.videoId")),1),a(c,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=u=>e.value=u),class:"value",type:"text",placeholder:e.$t("veo.placeholder.videoId"),clearable:""},null,8,["modelValue","placeholder"])])}const co=k(ao,[["render",ro],["__scopeId","data-v-6eba4026"]]),uo=b({name:"StartEndImage",components:{ElUpload:ce,ElButton:U,InfoIcon:j,FontAwesomeIcon:P,ImagePreview:re},mixins:[ie],emits:["change"],data(){return{fileList:[],uploadUrl:Q()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.veo?.config?.image_urls},set(){}}},mounted(){this.value||(this.value=void 0),this.onSetStartEndImageUrl()},methods:{onExceed(){I.warning(this.$t("veo.message.uploadReferencesExceed"))},onError(){I.error(this.$t("veo.message.uploadReferencesError"))},onSetStartEndImageUrl(){const e=this.urls;this.$store.commit("veo/setConfig",{...this.$store.state?.veo?.config,image_urls:e})},async onSuccess(){this.onSetStartEndImageUrl()}}}),po={class:"relative"},mo={class:"flex justify-between"},vo={class:"flex justify-start items-center"},fo={class:"text-sm font-bold"};function _o(e,o,v,f,y,V){const c=n("info-icon"),u=n("image-preview"),s=n("font-awesome-icon"),w=n("el-button"),$=n("el-upload");return t(),i("div",po,[r("div",mo,[r("div",vo,[r("span",fo,l(e.$t("veo.name.startEndImage")),1),a(c,{content:e.$t("veo.description.uploadStartEndImage")},null,8,["content"])])]),a($,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":o[0]||(o[0]=h=>e.fileList=h),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:2,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:p(({file:h})=>[h.url&&h.percentage!==void 0?(t(),m(u,{key:0,url:h.url,name:h.name,percentage:h.percentage,onRemove:S=>e.fileList.splice(e.fileList.indexOf(h),1)},null,8,["url","name","percentage","onRemove"])):d("",!0)]),default:p(()=>[a(w,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:p(()=>[a(s,{icon:"fa-solid fa-upload",class:"icon mr-1"}),_(" "+l(e.$t("veo.button.uploadReferences")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const ho=k(uo,[["render",_o],["__scopeId","data-v-b8ddb8fb"]]),$o=b({name:"UpsampleActionSelector",components:{ElSelect:O,ElOption:C},computed:{options(){return oe.map(e=>({value:e,label:e}))},value:{get(){return this.$store.state.veo?.config?.upsample_action},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,upsample_action:e})}}},mounted(){this.value||(this.value=ee)}}),go={class:"field"},bo={class:"title font-bold"};function ko(e,o,v,f,y,V){const c=n("el-option"),u=n("el-select");return t(),i("div",go,[r("h2",bo,l(e.$t("veo.name.upsampleAction")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s),class:"value",placeholder:e.$t("veo.placeholder.select")},{default:p(()=>[(t(!0),i(E,null,T(e.options,s=>(t(),m(c,{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const yo=k($o,[["render",ko],["__scopeId","data-v-8b74a7ae"]]),Vo=b({name:"ExtendModelSelector",components:{ElSelect:O,ElOption:C},computed:{options(){return G.map(e=>({value:e,label:e}))},value:{get(){return this.$store.state.veo?.config?.model},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,model:e})}}},mounted(){(!this.value||!G.includes(this.value))&&(this.value=te)}}),wo={class:"field"},Eo={class:"title font-bold"};function Io(e,o,v,f,y,V){const c=n("el-option"),u=n("el-select");return t(),i("div",wo,[r("h2",Eo,l(e.$t("veo.name.model")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s),class:"value",placeholder:e.$t("veo.placeholder.select")},{default:p(()=>[(t(!0),i(E,null,T(e.options,s=>(t(),m(c,{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const To=k(Vo,[["render",Io],["__scopeId","data-v-cc3f9355"]]),So=b({name:"MotionTypeSelector",components:{ElSelect:O,ElOption:C},computed:{options(){return ne.map(e=>({value:e,label:e}))},value:{get(){return this.$store.state.veo?.config?.motion_type},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,motion_type:e})}}},mounted(){this.value||(this.value=se)}}),Ao={class:"field"},Co={class:"title font-bold"};function Oo(e,o,v,f,y,V){const c=n("el-option"),u=n("el-select");return t(),i("div",Ao,[r("h2",Co,l(e.$t("veo.name.motionType")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s),class:"value",placeholder:e.$t("veo.placeholder.select"),filterable:""},{default:p(()=>[(t(!0),i(E,null,T(e.options,s=>(t(),m(c,{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Po=k(So,[["render",Oo],["__scopeId","data-v-3affff3c"]]),Uo=b({name:"ImageMaskInput",components:{ElInput:R},computed:{value:{get(){return this.$store.state.veo?.config?.image_mask},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,image_mask:e})}}}}),Lo={class:"field"},jo={class:"title font-bold"};function Ro(e,o,v,f,y,V){const c=n("el-input");return t(),i("div",Lo,[r("h2",jo,l(e.$t("veo.name.imageMask")),1),a(c,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=u=>e.value=u),class:"value",type:"text",placeholder:e.$t("veo.placeholder.imageMask"),clearable:""},null,8,["modelValue","placeholder"])])}const Mo=k(Uo,[["render",Ro],["__scopeId","data-v-6cc27c68"]]),Go="",Do=b({name:"PromptInput",components:{ElInput:R,InfoIcon:j},computed:{prompt:{get(){return this.$store.state.veo?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=Go)}}),No={class:"field"},Fo={class:"box"},zo={class:"title font-bold"};function Bo(e,o,v,f,y,V){const c=n("info-icon"),u=n("el-input");return t(),i("div",No,[r("div",Fo,[r("h2",zo,l(e.$t("veo.name.prompt")),1),a(c,{content:e.$t("veo.description.prompt"),class:"info"},null,8,["content"])]),a(u,{modelValue:e.prompt,"onUpdate:modelValue":o[0]||(o[0]=s=>e.prompt=s),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("veo.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const qo=k(Do,[["render",Bo],["__scopeId","data-v-84c55ea0"]]),Ho=["upsample","extend","reshoot","object_insert","object_remove","get1080p"],Xo=["text2video","image2video","ingredients2video"],Yo=b({name:"ConfigPanel",components:{ElButton:U,Consumption:de,FontAwesomeIcon:P,PromptInput:qo,ModelSelector:Oe,StartEndImage:ho,ActionSelector:Me,VideoFromInput:no,VideoIdInput:co,UpsampleActionSelector:yo,ExtendModelSelector:To,MotionTypeSelector:Po,ImageMaskInput:Mo,TranslationSelector:He,AspectRatioSelector:Ze},emits:["generate"],computed:{config(){return this.$store.state.veo?.config},consumption(){return ue(this.config,this.service?.cost)},service(){return this.$store.state.veo?.service},isPostProcessing(){return Ho.includes(this.config?.action??"")},isGeneration(){return Xo.includes(this.config?.action??"")}},methods:{onGenerate(){this.$emit("generate")}}}),Jo={class:"flex flex-col h-full"},Qo={class:"flex-1 overflow-y-auto p-5"},Ko={class:"flex flex-col items-center justify-center px-5 pb-5"};function Wo(e,o,v,f,y,V){const c=n("action-selector"),u=n("video-from-input"),s=n("video-id-input"),w=n("upsample-action-selector"),$=n("extend-model-selector"),h=n("prompt-input"),S=n("motion-type-selector"),g=n("image-mask-input"),N=n("translation-selector"),F=n("aspect-ratio-selector"),z=n("model-selector"),B=n("start-end-image"),q=n("consumption"),H=n("font-awesome-icon"),X=n("el-button");return t(),i("div",Jo,[r("div",Qo,[a(c,{class:"mb-4"}),e.isPostProcessing?(t(),i(E,{key:0},[e.config?.video_url?(t(),m(u,{key:0,class:"mb-4"})):d("",!0),a(s,{class:"mb-4"})],64)):d("",!0),e.config?.action==="upsample"?(t(),m(w,{key:1,class:"mb-4"})):d("",!0),e.config?.action==="extend"?(t(),m($,{key:2,class:"mb-4"})):d("",!0),e.config?.action==="extend"?(t(),m(h,{key:3,class:"mb-4"})):d("",!0),e.config?.action==="reshoot"?(t(),m(S,{key:4,class:"mb-4"})):d("",!0),e.config?.action==="object_insert"?(t(),m(h,{key:5,class:"mb-4"})):d("",!0),e.config?.action==="object_insert"||e.config?.action==="object_remove"?(t(),m(g,{key:6,class:"mb-4"})):d("",!0),e.config?.action==="object_remove"?(t(),m(h,{key:7,class:"mb-4"})):d("",!0),e.isGeneration?(t(),i(E,{key:8},[a(N,{class:"mb-4"}),e.config?.action==="image2video"||e.config?.action==="ingredients2video"?(t(),m(F,{key:0,class:"mb-4"})):d("",!0),a(h,{class:"mb-4"}),e.config?.action!=="ingredients2video"?(t(),m(z,{key:1,class:"mb-4"})):d("",!0),e.config?.action==="image2video"||e.config?.action==="ingredients2video"?(t(),m(B,{key:2,class:"mb-2"})):d("",!0)],64)):d("",!0)]),r("div",Ko,[a(q,{value:e.consumption,service:e.service},null,8,["value","service"]),a(X,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:p(()=>[a(H,{icon:"fa-solid fa-magic",class:"mr-2"}),_(" "+l(e.$t("veo.button.generate")),1)]),_:1},8,["onClick"])])])}const Zo=k(Yo,[["render",Wo]]),xo=b({name:"TaskPreview",components:{ElImage:he,CopyToClipboard:ve,FontAwesomeIcon:P,ElAlert:_e,VideoPlayer:D,ElTooltip:fe,ElButton:U},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.veo?.application},config(){return this.$store.state.veo?.config}},methods:{onPickAction(e,o,v,f){console.debug("seed config from preview",{action:v,upsampleAction:f,response:o}),this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,action:v,video_id:o?.data?.[0]?.id,video_url:o?.data?.[0]?.video_url,...f?{upsample_action:f}:{}})},onDownload(e,o){e.stopPropagation(),console.log("on download"),window.open(o,"_blank")},onOpenVideo(e){window.open(e,"_blank")}}}),et={class:"preview"},ot={class:"left"},tt={class:"main"},st={class:"bot"},nt={class:"datetime"},at={class:"info"},lt={key:0,class:"prompt mt-2"},it={key:0},rt={key:1},ct={key:0,class:A({content:!0,failed:!0})},dt={key:0,class:"mb-4"},ut={key:1,class:A({operations:!0,"mt-2":!0})},pt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},mt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},vt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},ft={key:1,class:A({content:!0})},_t={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ht={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},$t={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},gt={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},bt={key:2,class:A({content:!0})},kt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},yt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Vt(e,o,v,f,y,V){const c=n("el-image"),u=n("video-player"),s=n("el-button"),w=n("el-tooltip"),$=n("font-awesome-icon"),h=n("copy-to-clipboard"),S=n("el-alert");return t(),i("div",et,[r("div",ot,[a(c,{src:"https://cdn.acedata.cloud/8nxyy9.jpg",class:"avatar"})]),r("div",tt,[r("div",st,[_(l(e.$t("veo.name.veoBot"))+" ",1),r("span",nt,l(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),r("div",at,[e.modelValue?.request?.prompt?(t(),i("p",lt,[_(l(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?d("",!0):(t(),i("span",it," - ("+l(e.$t("veo.status.pending"))+") ",1)),Array.isArray(e.modelValue?.response?.data)&&e.modelValue?.response?.data[0]?.state==="running"?(t(),i("span",rt," - ("+l(e.$t("veo.status.processing"))+") ",1)):d("",!0)])):d("",!0)]),e.modelValue?.response?.success===!0&&e.modelValue?.response?.data?(t(),i("div",ct,[e.modelValue?.response?.data[0]?.video_url?(t(),i("div",dt,[a(u,{src:e.modelValue?.response?.data[0]?.video_url},null,8,["src"])])):d("",!0),e.modelValue?.response.success?(t(),i("div",ut,[e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:0,type:"info",size:"small",class:"btn-action",onClick:o[0]||(o[0]=g=>e.onPickAction(g,e.modelValue?.response,"upsample","1080p"))},{default:p(()=>[_(l(e.$t("veo.button.actionUpsample1080p")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:1,type:"info",size:"small",class:"btn-action",onClick:o[1]||(o[1]=g=>e.onPickAction(g,e.modelValue?.response,"upsample","4k"))},{default:p(()=>[_(l(e.$t("veo.button.actionUpsample4k")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:2,type:"info",size:"small",class:"btn-action",onClick:o[2]||(o[2]=g=>e.onPickAction(g,e.modelValue?.response,"upsample","gif"))},{default:p(()=>[_(l(e.$t("veo.button.actionUpsampleGif")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:3,type:"info",size:"small",class:"btn-action",onClick:o[3]||(o[3]=g=>e.onPickAction(g,e.modelValue?.response,"extend"))},{default:p(()=>[_(l(e.$t("veo.button.actionExtend")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:4,type:"info",size:"small",class:"btn-action",onClick:o[4]||(o[4]=g=>e.onPickAction(g,e.modelValue?.response,"reshoot"))},{default:p(()=>[_(l(e.$t("veo.button.actionReshoot")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:5,type:"info",size:"small",class:"btn-action",onClick:o[5]||(o[5]=g=>e.onPickAction(g,e.modelValue?.response,"object_insert"))},{default:p(()=>[_(l(e.$t("veo.button.actionObjectInsert")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:6,type:"info",size:"small",class:"btn-action",onClick:o[6]||(o[6]=g=>e.onPickAction(g,e.modelValue?.response,"object_remove"))},{default:p(()=>[_(l(e.$t("veo.button.actionObjectRemove")),1)]),_:1})):d("",!0),a(w,{class:"box-item",effect:"dark",content:e.$t("veo.message.downloadVideo"),placement:"top-start"},{default:p(()=>[e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:0,type:"info",size:"small",class:"btn-action",onClick:o[7]||(o[7]=g=>e.onDownload(g,e.modelValue?.response?.data[0]?.video_url))},{default:p(()=>[_(l(e.$t("veo.button.download")),1)]),_:1})):d("",!0)]),_:1},8,["content"])])):d("",!0),a(S,{closable:!1,class:"mt-2 success"},{default:p(()=>[r("p",pt,[a($,{icon:"fa-solid fa-hashtag",class:"mr-1"}),_(" "+l(e.$t("veo.name.model"))+": "+l(e.modelValue?.request?.model),1)]),r("p",mt,[a($,{icon:"fa-solid fa-magic",class:"mr-1"}),_(" "+l(e.$t("veo.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),a(h,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(t(),i("p",vt,[a($,{icon:"fa-solid fa-clock",class:"mr-1"}),_(" "+l(e.$t("veo.name.elapsed"))+": "+l(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):d("",!0)]),_:1})])):d("",!0),e.modelValue?.response?.success===!1?(t(),i("div",ft,[a(S,{closable:!1,class:"failure"},{template:p(()=>[a($,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),_(" "+l(e.$t("veo.name.failure")),1)]),default:p(()=>[r("p",_t,[a($,{icon:"fa-solid fa-magic",class:"mr-1"}),_(" "+l(e.$t("veo.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),a(h,{content:e.modelValue?.id},null,8,["content"])]),r("p",ht,[a($,{icon:"fa-solid fa-circle-info",class:"mr-1"}),_(" "+l(e.$t("veo.name.failureReason"))+": "+l(e.modelValue?.response?.error?.message)+" ",1),a(h,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(t(),i("p",$t,[a($,{icon:"fa-solid fa-clock",class:"mr-1"}),_(" "+l(e.$t("veo.name.elapsed"))+": "+l(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):d("",!0),e.modelValue?.response?.trace_id?(t(),i("p",gt,[a($,{icon:"fa-solid fa-hashtag",class:"mr-1"}),_(" "+l(e.$t("veo.name.traceId"))+": "+l(e.modelValue?.response?.trace_id)+" ",1),a(h,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):d("",!0)]),_:1})])):d("",!0),e.modelValue?.response?.success===void 0?(t(),i("div",bt,[a(S,{closable:!1,class:"info"},{template:p(()=>[a($,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),_(" "+l(e.$t("veo.name.failure")),1)]),default:p(()=>[r("p",kt,[a($,{icon:"fa-solid fa-magic",class:"mr-1"}),_(" "+l(e.$t("veo.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),a(h,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.response?.trace_id?(t(),i("p",yt,[a($,{icon:"fa-solid fa-hashtag",class:"mr-1"}),_(" "+l(e.$t("veo.name.traceId"))+": "+l(e.modelValue?.response?.trace_id)+" ",1),a(h,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):d("",!0)]),_:1})])):d("",!0)])])}const wt=k(xo,[["render",Vt],["__scopeId","data-v-83f2991f"]]),Et=b({name:"RecentPanel",components:{TaskPreview:wt,NoTasks:ge,BotPlaceholder:$e,ScrollList:ae},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.veo?.tasks,items:this.$store.state.veo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),It={key:0},Tt={key:2,class:"w-full h-full flex items-center justify-center"};function St(e,o,v,f,y,V){const c=n("bot-placeholder"),u=n("task-preview"),s=n("scroll-list"),w=n("no-tasks");return t(),i(E,null,[e.tasks?.items===void 0?(t(),i("div",It,[a(c)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(t(),m(s,{key:1,ref:"scrollList",class:"tasks h-full w-full overflow-y-auto",loading:e.loading,onReachTop:o[0]||(o[0]=$=>e.$emit("reach-top"))},{default:p(()=>[(t(!0),i(E,null,T(e.tasks?.items,($,h)=>(t(),m(u,{key:h,"model-value":$},null,8,["model-value"]))),128))]),_:1},8,["loading"])):d("",!0),e.tasks?.items?.length===0?(t(),i("div",Tt,[a(w)])):d("",!0)],64)}const At=k(Et,[["render",St]]),Ct="https://webhook.acedata.cloud/veo",Ot=b({name:"VeoIndex",components:{ConfigPanel:Zo,Layout:Ie,RecentPanel:At},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.veo?.status?.getApplications===M.Request},tasksLoading(){return this.$store.state.veo?.status?.getTasks===M.Request||this.fetchingTasks},credential(){return this.$store.state.veo.credential},config(){return this.$store.state.veo.config},tasks(){return this.$store.state.veo.tasks}},watch:{tasks:{handler(e,o){e?.items?.length>o?.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 be({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("veo/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("veo/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:o=5,createdAtMin:v,createdAtMax:f}=e||{};console.debug("limit",o,"createdAtMin",v,"createdAtMax",f),this.fetchingTasks=!0;try{await this.$store.dispatch("veo/getTasks",{limit:o,createdAtMin:v,createdAtMax:f})}finally{this.fetchingTasks=!1}},async onGenerate(){const e={...this.config,callback_url:Ct},o=this.credential?.token;if(!o){console.error("no token specified");return}if(e.action==="image2video"&&!(e.image_urls&&e.image_urls.length>0)){I.warning(this.$t("veo.message.imageRequired"));return}(!e.image_urls||e.image_urls.length===0)&&delete e.image_urls,I.info(this.$t("veo.message.startingTask")),me.generate(e,{token:o}).then(()=>{I.success(this.$t("veo.message.startTaskSuccess"))}).catch(v=>{v?.response?.data?.error?.code===pe?I.error(this.$t("veo.message.usedUp")):I.error(this.$t("veo.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Pt(e,o,v,f,y,V){const c=n("config-panel"),u=n("recent-panel"),s=n("layout");return t(),m(s,null,{config:p(()=>[a(c,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:p(()=>[a(u,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Ts=k(Ot,[["render",Pt]]);export{Ts as default};
|